@@ -46,6 +46,65 @@ function App() {
4646| ` roadmapData ` | ` string \| RoadmapData ` | ` undefined ` | Initial roadmap data (JSON string or object) |
4747| ` language ` | ` string ` | ` "en" ` | UI language (` "en" ` or ` "de" ` ) |
4848| ` jsonStore ` | ` string ` | ` "https://json.openpatch.org" ` | URL for JSON storage service |
49+ | ` disableSharing ` | ` boolean ` | ` false ` | Hide the share button (useful in environments without external sharing) |
50+ | ` disableFileOperations ` | ` boolean ` | ` false ` | Hide open and download buttons (useful when file operations are handled externally) |
51+ | ` keyBindings ` | ` Partial<KeyBindings> ` | ` undefined ` | Custom keyboard shortcuts (see [ Keyboard Shortcuts] ( #keyboard-shortcuts ) ) |
52+
53+ #### Keyboard Shortcuts
54+
55+ The editor includes many keyboard shortcuts for efficient editing. You can customize these shortcuts by providing a ` keyBindings ` prop:
56+
57+ ``` tsx
58+ import { LearningMapEditor , KeyBindings } from ' @learningmap/learningmap' ;
59+
60+ const customKeyBindings: Partial <KeyBindings > = {
61+ save: undefined , // Disable save shortcut
62+ addTaskNode: { key: ' t' , ctrl: true }, // Change from Ctrl+1 to Ctrl+T
63+ };
64+
65+ <LearningMapEditor keyBindings = { customKeyBindings } />
66+ ```
67+
68+ ** Default Keyboard Shortcuts:**
69+
70+ | Action | Default Shortcut | KeyBinding Property |
71+ | --------| -----------------| -------------------|
72+ | Add Task Node | ` Ctrl+1 ` | ` addTaskNode ` |
73+ | Add Topic Node | ` Ctrl+2 ` | ` addTopicNode ` |
74+ | Add Image Node | ` Ctrl+3 ` | ` addImageNode ` |
75+ | Add Text Node | ` Ctrl+4 ` | ` addTextNode ` |
76+ | Save | ` Ctrl+S ` | ` save ` |
77+ | Undo | ` Ctrl+Z ` | ` undo ` |
78+ | Redo | ` Ctrl+Y ` | ` redo ` |
79+ | Toggle Preview | ` Ctrl+P ` | ` togglePreview ` |
80+ | Toggle Debug | ` Ctrl+D ` | ` toggleDebug ` |
81+ | Zoom In | ` Ctrl++ ` | ` zoomIn ` |
82+ | Zoom Out | ` Ctrl+- ` | ` zoomOut ` |
83+ | Reset Zoom | ` Ctrl+0 ` | ` resetZoom ` |
84+ | Toggle Grid | ` Ctrl+' ` | ` toggleGrid ` |
85+ | Reset Map | ` Ctrl+Delete ` | ` resetMap ` |
86+ | Cut | ` Ctrl+X ` | ` cut ` |
87+ | Copy | ` Ctrl+C ` | ` copy ` |
88+ | Paste | ` Ctrl+V ` | ` paste ` |
89+ | Select All | ` Ctrl+A ` | ` selectAll ` |
90+ | Fit View | ` Shift+! ` | ` fitView ` |
91+ | Zoom to Selection | ` Shift+@ ` | ` zoomToSelection ` |
92+ | Delete Selected | ` Delete ` | ` deleteSelected ` |
93+ | Help | ` Ctrl+? ` | ` help ` |
94+
95+ ** KeyBinding Type:**
96+
97+ ``` typescript
98+ interface KeyBinding {
99+ key: string ;
100+ ctrl? : boolean ;
101+ shift? : boolean ;
102+ alt? : boolean ;
103+ meta? : boolean ;
104+ }
105+ ```
106+
107+ To disable a shortcut, set it to ` undefined ` . To customize, provide a ` KeyBinding ` object with the desired key combination.
49108
50109#### Features
51110
0 commit comments