@@ -11,14 +11,14 @@ interface KeyboardShortcutsProps {
1111
1212export const KeyboardShortcuts = ( { jsonStore = "https://json.openpatch.org" } : KeyboardShortcutsProps ) => {
1313 const { zoomIn, zoomOut, setCenter, fitView, screenToFlowPosition } = useReactFlow ( ) ;
14-
14+
1515 // Get store state
1616 const helpOpen = useEditorStore ( state => state . helpOpen ) ;
1717 const selectedNodeIds = useEditorStore ( state => state . selectedNodeIds ) ;
1818 const nodes = useEditorStore ( state => state . nodes ) ;
1919 const lastMousePosition = useEditorStore ( state => state . lastMousePosition ) ;
2020 const settings = useEditorStore ( state => state . settings ) ;
21-
21+
2222 // Get store actions
2323 const setHelpOpen = useEditorStore ( state => state . setHelpOpen ) ;
2424 const addNode = useEditorStore ( state => state . addNode ) ;
@@ -33,16 +33,16 @@ export const KeyboardShortcuts = ({ jsonStore = "https://json.openpatch.org" }:
3333 const showGrid = useEditorStore ( state => state . showGrid ) ;
3434 const setShowGrid = useEditorStore ( state => state . setShowGrid ) ;
3535 const deleteNode = useEditorStore ( state => state . deleteNode ) ;
36-
36+
3737 const language = settings ?. language || "en" ;
3838 const t = getTranslations ( language ) ;
39-
39+
4040 // Temporal store for undo/redo
4141 const { undo, redo } = useTemporalStore ( ( state ) => ( {
4242 undo : state . undo ,
4343 redo : state . redo ,
4444 } ) ) ;
45-
45+
4646 const onAddNode = ( type : "task" | "topic" | "image" | "text" ) => {
4747 const position = lastMousePosition || screenToFlowPosition ( { x : window . innerWidth / 2 , y : window . innerHeight / 2 } ) ;
4848 const newNode : Node < NodeData > = {
@@ -56,7 +56,7 @@ export const KeyboardShortcuts = ({ jsonStore = "https://json.openpatch.org" }:
5656 } ;
5757 addNode ( newNode ) ;
5858 } ;
59-
59+
6060 const onDeleteSelected = ( ) => {
6161 if ( selectedNodeIds . length > 0 ) {
6262 // Delete all selected nodes
@@ -66,7 +66,7 @@ export const KeyboardShortcuts = ({ jsonStore = "https://json.openpatch.org" }:
6666 setSelectedNodeIds ( [ ] ) ;
6767 }
6868 } ;
69-
69+
7070 const onSave = ( ) => {
7171 const roadmapData = getRoadmapData ( ) ;
7272 const dataStr = "data:text/json;charset=utf-8," + encodeURIComponent ( JSON . stringify ( roadmapData , null , 2 ) ) ;
@@ -77,24 +77,24 @@ export const KeyboardShortcuts = ({ jsonStore = "https://json.openpatch.org" }:
7777 downloadAnchorNode . click ( ) ;
7878 downloadAnchorNode . remove ( ) ;
7979 } ;
80-
80+
8181 const onTogglePreview = ( ) => {
8282 const currentPreviewMode = useEditorStore . getState ( ) . previewMode ;
8383 setPreviewMode ( ! currentPreviewMode ) ;
8484 } ;
85-
85+
8686 const onToggleDebug = ( ) => {
8787 const currentDebugMode = useEditorStore . getState ( ) . debugMode ;
8888 setDebugMode ( ! currentDebugMode ) ;
8989 } ;
90-
90+
9191 const onResetMap = ( ) => {
9292 if ( confirm ( t . resetMapWarning ) ) {
9393 setNodes ( [ ] ) ;
9494 setEdges ( [ ] ) ;
9595 }
9696 } ;
97-
97+
9898 const onCut = ( ) => {
9999 const selectedNodes = nodes . filter ( n => selectedNodeIds . includes ( n . id ) ) ;
100100 if ( selectedNodes . length > 0 ) {
@@ -106,14 +106,14 @@ export const KeyboardShortcuts = ({ jsonStore = "https://json.openpatch.org" }:
106106 setSelectedNodeIds ( [ ] ) ;
107107 }
108108 } ;
109-
109+
110110 const onCopy = ( ) => {
111111 const selectedNodes = nodes . filter ( n => selectedNodeIds . includes ( n . id ) ) ;
112112 if ( selectedNodes . length > 0 ) {
113113 setClipboard ( { nodes : selectedNodes , edges : [ ] } ) ;
114114 }
115115 } ;
116-
116+
117117 const onPaste = ( ) => {
118118 if ( clipboard && clipboard . nodes . length > 0 ) {
119119 const newNodes = clipboard . nodes . map ( n => ( {
@@ -125,16 +125,16 @@ export const KeyboardShortcuts = ({ jsonStore = "https://json.openpatch.org" }:
125125 setSelectedNodeIds ( newNodes . map ( n => n . id ) ) ;
126126 }
127127 } ;
128-
128+
129129 const onSelectAll = ( ) => {
130130 setSelectedNodeIds ( nodes . map ( n => n . id ) ) ;
131131 } ;
132-
132+
133133 const onZoomIn = ( ) => zoomIn ( ) ;
134134 const onZoomOut = ( ) => zoomOut ( ) ;
135135 const onResetZoom = ( ) => setCenter ( 0 , 0 , { zoom : 1 } ) ;
136136 const onFitView = ( ) => fitView ( ) ;
137-
137+
138138 const onZoomToSelection = ( ) => {
139139 if ( selectedNodeIds . length > 0 ) {
140140 const selectedNodes = nodes . filter ( n => selectedNodeIds . includes ( n . id ) ) ;
@@ -143,9 +143,9 @@ export const KeyboardShortcuts = ({ jsonStore = "https://json.openpatch.org" }:
143143 }
144144 }
145145 } ;
146-
146+
147147 const onToggleGrid = ( ) => setShowGrid ( ! showGrid ) ;
148-
148+
149149 useEffect ( ( ) => {
150150 const handleKeyDown = ( e : KeyboardEvent ) => {
151151 if ( e . ctrlKey || e . metaKey ) {
0 commit comments