@dwelle/excalidraw 0.4.0-d8d86cf → 0.4.0-e03b600

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/CHANGELOG.md +458 -0
  2. package/README.md +18 -1422
  3. package/dist/excalidraw.development.js +1882 -498
  4. package/dist/excalidraw.production.min.js +1 -1
  5. package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
  6. package/package.json +3 -3
  7. package/types/actions/actionAddToLibrary.d.ts +68 -34
  8. package/types/actions/actionAlign.d.ts +12 -18
  9. package/types/actions/actionBoundText.d.ts +158 -19
  10. package/types/actions/actionCanvas.d.ts +544 -118
  11. package/types/actions/actionClipboard.d.ts +132 -59
  12. package/types/actions/actionDeleteSelected.d.ts +72 -41
  13. package/types/actions/actionDistribute.d.ts +2 -6
  14. package/types/actions/actionDuplicateSelection.d.ts +2 -4
  15. package/types/actions/actionElementLock.d.ts +254 -0
  16. package/types/actions/actionExport.d.ts +215 -131
  17. package/types/actions/actionFinalize.d.ts +47 -27
  18. package/types/actions/actionFlip.d.ts +2 -4
  19. package/types/actions/actionFrame.d.ts +397 -0
  20. package/types/actions/actionGroup.d.ts +6 -10
  21. package/types/actions/actionHistory.d.ts +1 -1
  22. package/types/actions/actionLinearEditor.d.ts +25 -13
  23. package/types/actions/actionMenu.d.ts +73 -46
  24. package/types/actions/actionNavigate.d.ts +2 -3
  25. package/types/actions/actionProperties.d.ts +315 -198
  26. package/types/actions/actionStyles.d.ts +23 -12
  27. package/types/actions/actionToggleGridMode.d.ts +25 -12
  28. package/types/actions/actionToggleStats.d.ts +24 -12
  29. package/types/actions/actionToggleViewMode.d.ts +25 -12
  30. package/types/actions/actionToggleZenMode.d.ts +25 -12
  31. package/types/actions/actionZindex.d.ts +8 -16
  32. package/types/actions/index.d.ts +1 -1
  33. package/types/actions/manager.d.ts +3 -2
  34. package/types/actions/shortcuts.d.ts +2 -1
  35. package/types/actions/types.d.ts +13 -11
  36. package/types/appState.d.ts +16 -12
  37. package/types/charts.d.ts +2 -2
  38. package/types/clients.d.ts +5 -6
  39. package/types/clipboard.d.ts +2 -2
  40. package/types/colors.d.ts +60 -5
  41. package/types/components/Actions.d.ts +5 -5
  42. package/types/components/ActiveConfirmDialog.d.ts +4 -0
  43. package/types/components/App.d.ts +58 -68
  44. package/types/components/Avatar.d.ts +1 -2
  45. package/types/components/BraveMeasureTextError.d.ts +2 -0
  46. package/types/components/Button.d.ts +17 -0
  47. package/types/components/ButtonIconSelect.d.ts +11 -3
  48. package/types/components/Card.d.ts +7 -0
  49. package/types/components/ColorPicker/ColorInput.d.ts +7 -0
  50. package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
  51. package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
  52. package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
  53. package/types/components/ColorPicker/Picker.d.ts +18 -0
  54. package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
  55. package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
  56. package/types/components/ColorPicker/ShadeList.d.ts +8 -0
  57. package/types/components/ColorPicker/TopPicks.d.ts +9 -0
  58. package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
  59. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +21 -0
  60. package/types/components/ContextMenu.d.ts +9 -22
  61. package/types/components/DefaultSidebar.d.ts +30 -0
  62. package/types/components/Dialog.d.ts +3 -4
  63. package/types/components/ErrorDialog.d.ts +3 -2
  64. package/types/components/EyeDropper.d.ts +18 -0
  65. package/types/components/FilledButton.d.ts +17 -0
  66. package/types/components/FixedSideContainer.d.ts +1 -1
  67. package/types/components/HandButton.d.ts +10 -0
  68. package/types/components/HelpButton.d.ts +1 -2
  69. package/types/components/HintViewer.d.ts +2 -2
  70. package/types/components/HomeButton.d.ts +1 -1
  71. package/types/components/ImageExportDialog.d.ts +8 -13
  72. package/types/components/Island.d.ts +1 -1
  73. package/types/components/JSONExportDialog.d.ts +6 -4
  74. package/types/components/LayerUI.d.ts +7 -15
  75. package/types/components/LibraryMenu.d.ts +13 -14
  76. package/types/components/LibraryMenuBrowseButton.d.ts +2 -2
  77. package/types/components/LibraryMenuControlButtons.d.ts +9 -0
  78. package/types/components/LibraryMenuHeaderContent.d.ts +11 -5
  79. package/types/components/LibraryMenuItems.d.ts +6 -7
  80. package/types/components/LibraryMenuSection.d.ts +22 -0
  81. package/types/components/LibraryUnit.d.ts +7 -3
  82. package/types/components/LockButton.d.ts +1 -2
  83. package/types/components/MobileMenu.d.ts +8 -11
  84. package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
  85. package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
  86. package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
  87. package/types/components/PasteChartDialog.d.ts +4 -5
  88. package/types/components/PenModeButton.d.ts +1 -1
  89. package/types/components/Popover.d.ts +1 -1
  90. package/types/components/ProjectName.d.ts +2 -1
  91. package/types/components/PublishLibrary.d.ts +2 -2
  92. package/types/components/RadioGroup.d.ts +12 -0
  93. package/types/components/Sidebar/Sidebar.d.ts +66 -63
  94. package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
  95. package/types/components/Sidebar/SidebarTab.d.ts +9 -0
  96. package/types/components/Sidebar/SidebarTabTrigger.d.ts +10 -0
  97. package/types/components/Sidebar/SidebarTabTriggers.d.ts +7 -0
  98. package/types/components/Sidebar/SidebarTabs.d.ts +7 -0
  99. package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
  100. package/types/components/Sidebar/common.d.ts +24 -7
  101. package/types/components/Spinner.d.ts +2 -1
  102. package/types/components/Stack.d.ts +4 -3
  103. package/types/components/Stats.d.ts +3 -3
  104. package/types/components/Switch.d.ts +9 -0
  105. package/types/components/ToolButton.d.ts +6 -5
  106. package/types/components/Tooltip.d.ts +1 -1
  107. package/types/components/Trans.d.ts +8 -0
  108. package/types/components/UserList.d.ts +0 -2
  109. package/types/components/dropdownMenu/DropdownMenu.d.ts +67 -0
  110. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
  111. package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  112. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
  113. package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
  114. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
  115. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
  116. package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  117. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +11 -0
  118. package/types/components/dropdownMenu/common.d.ts +6 -0
  119. package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  120. package/types/components/footer/Footer.d.ts +12 -0
  121. package/types/components/footer/FooterCenter.d.ts +8 -0
  122. package/types/components/hoc/withInternalFallback.d.ts +4 -0
  123. package/types/components/icons.d.ts +14 -2
  124. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
  125. package/types/components/main-menu/DefaultItems.d.ts +47 -0
  126. package/types/components/main-menu/MainMenu.d.ts +61 -0
  127. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
  128. package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  129. package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
  130. package/types/constants.d.ts +73 -16
  131. package/types/context/tunnels.d.ts +19 -0
  132. package/types/context/ui-appState.d.ts +4 -0
  133. package/types/data/blob.d.ts +3 -2
  134. package/types/data/encode.d.ts +1 -1
  135. package/types/data/filesystem.d.ts +2 -1
  136. package/types/data/index.d.ts +1 -1
  137. package/types/data/library.d.ts +3 -45
  138. package/types/data/restore.d.ts +10 -4
  139. package/types/data/types.d.ts +3 -5
  140. package/types/element/Hyperlink.d.ts +27 -18
  141. package/types/element/binding.d.ts +3 -3
  142. package/types/element/bounds.d.ts +32 -7
  143. package/types/element/collision.d.ts +7 -7
  144. package/types/element/dragElements.d.ts +2 -1
  145. package/types/element/image.d.ts +11 -1
  146. package/types/element/index.d.ts +3 -2
  147. package/types/element/linearElementEditor.d.ts +24 -13
  148. package/types/element/mutateElement.d.ts +2 -1
  149. package/types/element/newElement.d.ts +37 -11
  150. package/types/element/resizeElements.d.ts +1 -0
  151. package/types/element/showSelectedShapeActions.d.ts +2 -2
  152. package/types/element/sortElements.d.ts +2 -0
  153. package/types/element/textElement.d.ts +40 -5
  154. package/types/element/textWysiwyg.d.ts +6 -1
  155. package/types/element/transformHandles.d.ts +12 -5
  156. package/types/element/typeChecks.d.ts +12 -2
  157. package/types/element/types.d.ts +53 -36
  158. package/types/emitter.d.ts +1 -1
  159. package/types/errors.d.ts +1 -1
  160. package/types/frame.d.ts +40 -0
  161. package/types/ga.d.ts +5 -5
  162. package/types/groups.d.ts +4 -0
  163. package/types/hooks/useCreatePortalContainer.d.ts +4 -0
  164. package/types/hooks/useLibraryItemSvg.d.ts +11 -0
  165. package/types/hooks/useOutsideClick.d.ts +19 -1
  166. package/types/hooks/useScrollPosition.d.ts +2 -0
  167. package/types/hooks/useTransition.d.ts +2 -0
  168. package/types/i18n.d.ts +7 -1
  169. package/types/jotai.d.ts +20 -108
  170. package/types/keys.d.ts +4 -4
  171. package/types/math.d.ts +4 -1
  172. package/types/packages/excalidraw/example/App.d.ts +7 -1
  173. package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
  174. package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
  175. package/types/packages/excalidraw/example/initialData.d.ts +6 -0
  176. package/types/packages/excalidraw/index.d.ts +17 -3
  177. package/types/packages/utils.d.ts +26 -25
  178. package/types/renderer/renderElement.d.ts +7 -5
  179. package/types/renderer/renderScene.d.ts +13 -6
  180. package/types/renderer/roundRect.d.ts +1 -1
  181. package/types/scene/Scene.d.ts +12 -5
  182. package/types/scene/comparisons.d.ts +1 -1
  183. package/types/scene/export.d.ts +157 -10
  184. package/types/scene/index.d.ts +1 -1
  185. package/types/scene/selection.d.ts +15 -5
  186. package/types/scene/types.d.ts +13 -5
  187. package/types/types.d.ts +126 -77
  188. package/types/utility-types.d.ts +22 -0
  189. package/types/utils.d.ts +30 -9
  190. package/types/zindex.d.ts +4 -4
  191. package/types/actions/actionToggleLock.d.ts +0 -116
  192. package/types/components/ActiveFile.d.ts +0 -7
  193. package/types/components/ClearCanvas.d.ts +0 -4
  194. package/types/components/CollabButton.d.ts +0 -6
  195. package/types/components/ColorPicker.d.ts +0 -14
  196. package/types/components/Footer.d.ts +0 -10
  197. package/types/components/LibraryButton.d.ts +0 -8
  198. package/types/components/MenuItem.d.ts +0 -11
  199. package/types/components/MenuUtils.d.ts +0 -1
  200. package/types/components/SingleLibraryItem.d.ts +0 -10
  201. package/types/components/WelcomeScreen.d.ts +0 -10
  202. package/types/components/WelcomeScreenDecor.d.ts +0 -6
  203. package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
@@ -9,9 +9,14 @@ export declare const actionFinalize: {
9
9
  appState: {
10
10
  cursorButton: "up";
11
11
  editingLinearElement: null;
12
+ contextMenu: {
13
+ items: import("../components/ContextMenu").ContextMenuItems;
14
+ top: number;
15
+ left: number;
16
+ } | null;
12
17
  showWelcomeScreen: boolean;
13
18
  isLoading: boolean;
14
- errorMessage: string | null;
19
+ errorMessage: import("react").ReactNode;
15
20
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
16
21
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
17
22
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -19,18 +24,21 @@ export declare const actionFinalize: {
19
24
  isBindingEnabled: boolean;
20
25
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
21
26
  suggestedBindings: import("../element/binding").SuggestedBinding[];
27
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
28
+ shouldRenderFrames: boolean;
29
+ editingFrame: string | null;
30
+ elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
22
31
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
23
32
  activeTool: {
24
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
25
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
33
+ lastActiveTool: import("../types").LastActiveTool;
26
34
  locked: boolean;
35
+ } & ({
36
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
27
37
  customType: null;
28
38
  } | {
29
39
  type: "custom";
30
40
  customType: string;
31
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
32
- locked: boolean;
33
- };
41
+ });
34
42
  penMode: boolean;
35
43
  penDetected: boolean;
36
44
  exportBackground: boolean;
@@ -47,10 +55,9 @@ export declare const actionFinalize: {
47
55
  currentItemFontFamily: number;
48
56
  currentItemFontSize: number;
49
57
  currentItemTextAlign: string;
50
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
51
58
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
52
59
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
53
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
60
+ currentItemRoundness: import("../element/types").StrokeRoundness;
54
61
  viewBackgroundColor: string;
55
62
  scrollX: number;
56
63
  scrollY: number;
@@ -62,10 +69,13 @@ export declare const actionFinalize: {
62
69
  value: import("../types").NormalizedZoomValue;
63
70
  }>;
64
71
  openMenu: "canvas" | "shape" | null;
65
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
66
- openSidebar: "library" | "customSidebar" | null;
67
- openDialog: "imageExport" | "help" | null;
68
- isSidebarDocked: boolean;
72
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
73
+ openSidebar: {
74
+ name: string;
75
+ tab?: string | undefined;
76
+ } | null;
77
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
78
+ defaultSidebarDockedPreference: boolean;
69
79
  lastPointerDownWith: import("../element/types").PointerType;
70
80
  selectedElementIds: {
71
81
  [id: string]: boolean;
@@ -73,6 +83,7 @@ export declare const actionFinalize: {
73
83
  previousSelectedElementIds: {
74
84
  [id: string]: boolean;
75
85
  };
86
+ selectedElementsAreBeingDragged: boolean;
76
87
  shouldCacheIgnoreZoom: boolean;
77
88
  toast: {
78
89
  message: string;
@@ -112,16 +123,15 @@ export declare const actionFinalize: {
112
123
  appState: {
113
124
  cursorButton: "up";
114
125
  activeTool: {
115
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
116
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
126
+ lastActiveTool: import("../types").LastActiveTool;
117
127
  locked: boolean;
128
+ } & ({
129
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
118
130
  customType: null;
119
131
  } | {
120
132
  type: "custom";
121
133
  customType: string;
122
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
123
- locked: boolean;
124
- };
134
+ });
125
135
  draggingElement: null;
126
136
  multiElement: null;
127
137
  editingElement: null;
@@ -132,12 +142,21 @@ export declare const actionFinalize: {
132
142
  };
133
143
  selectedLinearElement: LinearElementEditor | null;
134
144
  pendingImageElementId: null;
145
+ contextMenu: {
146
+ items: import("../components/ContextMenu").ContextMenuItems;
147
+ top: number;
148
+ left: number;
149
+ } | null;
135
150
  showWelcomeScreen: boolean;
136
151
  isLoading: boolean;
137
- errorMessage: string | null;
152
+ errorMessage: import("react").ReactNode;
138
153
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
139
154
  selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
140
155
  isBindingEnabled: boolean;
156
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
157
+ shouldRenderFrames: boolean;
158
+ editingFrame: string | null;
159
+ elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
141
160
  editingLinearElement: LinearElementEditor | null;
142
161
  penMode: boolean;
143
162
  penDetected: boolean;
@@ -155,10 +174,9 @@ export declare const actionFinalize: {
155
174
  currentItemFontFamily: number;
156
175
  currentItemFontSize: number;
157
176
  currentItemTextAlign: string;
158
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
159
177
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
160
178
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
161
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
179
+ currentItemRoundness: import("../element/types").StrokeRoundness;
162
180
  viewBackgroundColor: string;
163
181
  scrollX: number;
164
182
  scrollY: number;
@@ -170,14 +188,18 @@ export declare const actionFinalize: {
170
188
  value: import("../types").NormalizedZoomValue;
171
189
  }>;
172
190
  openMenu: "canvas" | "shape" | null;
173
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
174
- openSidebar: "library" | "customSidebar" | null;
175
- openDialog: "imageExport" | "help" | null;
176
- isSidebarDocked: boolean;
191
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
192
+ openSidebar: {
193
+ name: string;
194
+ tab?: string | undefined;
195
+ } | null;
196
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
197
+ defaultSidebarDockedPreference: boolean;
177
198
  lastPointerDownWith: import("../element/types").PointerType;
178
199
  previousSelectedElementIds: {
179
200
  [id: string]: boolean;
180
201
  };
202
+ selectedElementsAreBeingDragged: boolean;
181
203
  shouldCacheIgnoreZoom: boolean;
182
204
  toast: {
183
205
  message: string;
@@ -212,9 +234,7 @@ export declare const actionFinalize: {
212
234
  commitToHistory: boolean;
213
235
  };
214
236
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: AppState) => boolean;
215
- PanelComponent: ({ appState, updateData, data }: import("./types").PanelComponentProps & {
216
- isInHamburgerMenu: boolean;
217
- }) => JSX.Element;
237
+ PanelComponent: ({ appState, updateData, data }: import("./types").PanelComponentProps) => JSX.Element;
218
238
  } & {
219
239
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: AppState) => boolean) | undefined;
220
240
  };
@@ -7,13 +7,12 @@ export declare const actionFlipHorizontal: {
7
7
  category: "element";
8
8
  };
9
9
  perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
10
- elements: readonly ExcalidrawElement[];
10
+ elements: ExcalidrawElement[];
11
11
  appState: Readonly<AppState>;
12
12
  commitToHistory: true;
13
13
  };
14
14
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
15
15
  contextItemLabel: string;
16
- contextItemPredicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
17
16
  } & {
18
17
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
19
18
  };
@@ -23,13 +22,12 @@ export declare const actionFlipVertical: {
23
22
  category: "element";
24
23
  };
25
24
  perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
26
- elements: readonly ExcalidrawElement[];
25
+ elements: ExcalidrawElement[];
27
26
  appState: Readonly<AppState>;
28
27
  commitToHistory: true;
29
28
  };
30
29
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
31
30
  contextItemLabel: string;
32
- contextItemPredicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
33
31
  } & {
34
32
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
35
33
  };
@@ -0,0 +1,397 @@
1
+ /// <reference types="react" />
2
+ import { ExcalidrawElement } from "../element/types";
3
+ import { AppState } from "../types";
4
+ export declare const actionSelectAllElementsInFrame: {
5
+ name: "selectAllElementsInFrame";
6
+ trackEvent: {
7
+ category: "canvas";
8
+ };
9
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
10
+ elements: readonly ExcalidrawElement[];
11
+ appState: Readonly<AppState>;
12
+ commitToHistory: false;
13
+ };
14
+ contextItemLabel: string;
15
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
16
+ } & {
17
+ keyTest?: undefined;
18
+ };
19
+ export declare const actionRemoveAllElementsFromFrame: {
20
+ name: "removeAllElementsFromFrame";
21
+ trackEvent: {
22
+ category: "history";
23
+ };
24
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
25
+ elements: ExcalidrawElement[];
26
+ appState: {
27
+ selectedElementIds: {
28
+ [x: string]: true;
29
+ };
30
+ contextMenu: {
31
+ items: import("../components/ContextMenu").ContextMenuItems;
32
+ top: number;
33
+ left: number;
34
+ } | null;
35
+ showWelcomeScreen: boolean;
36
+ isLoading: boolean;
37
+ errorMessage: import("react").ReactNode;
38
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
39
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
40
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
41
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
42
+ isBindingEnabled: boolean;
43
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
44
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
45
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
46
+ shouldRenderFrames: boolean;
47
+ editingFrame: string | null;
48
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
49
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
50
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
51
+ activeTool: {
52
+ lastActiveTool: import("../types").LastActiveTool;
53
+ locked: boolean;
54
+ } & ({
55
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
56
+ customType: null;
57
+ } | {
58
+ type: "custom";
59
+ customType: string;
60
+ });
61
+ penMode: boolean;
62
+ penDetected: boolean;
63
+ exportBackground: boolean;
64
+ exportEmbedScene: boolean;
65
+ exportWithDarkMode: boolean;
66
+ exportScale: number;
67
+ currentItemStrokeColor: string;
68
+ currentItemBackgroundColor: string;
69
+ currentItemFillStyle: import("../element/types").FillStyle;
70
+ currentItemStrokeWidth: number;
71
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
72
+ currentItemRoughness: number;
73
+ currentItemOpacity: number;
74
+ currentItemFontFamily: number;
75
+ currentItemFontSize: number;
76
+ currentItemTextAlign: string;
77
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
78
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
79
+ currentItemRoundness: import("../element/types").StrokeRoundness;
80
+ viewBackgroundColor: string;
81
+ scrollX: number;
82
+ scrollY: number;
83
+ cursorButton: "up" | "down";
84
+ scrolledOutside: boolean;
85
+ name: string;
86
+ isResizing: boolean;
87
+ isRotating: boolean;
88
+ zoom: Readonly<{
89
+ value: import("../types").NormalizedZoomValue;
90
+ }>;
91
+ openMenu: "canvas" | "shape" | null;
92
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
93
+ openSidebar: {
94
+ name: string;
95
+ tab?: string | undefined;
96
+ } | null;
97
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
98
+ defaultSidebarDockedPreference: boolean;
99
+ lastPointerDownWith: import("../element/types").PointerType;
100
+ previousSelectedElementIds: {
101
+ [id: string]: boolean;
102
+ };
103
+ selectedElementsAreBeingDragged: boolean;
104
+ shouldCacheIgnoreZoom: boolean;
105
+ toast: {
106
+ message: string;
107
+ closable?: boolean | undefined;
108
+ duration?: number | undefined;
109
+ } | null;
110
+ zenModeEnabled: boolean;
111
+ theme: string;
112
+ gridSize: number | null;
113
+ viewModeEnabled: boolean;
114
+ selectedGroupIds: {
115
+ [groupId: string]: boolean;
116
+ };
117
+ editingGroupId: string | null;
118
+ width: number;
119
+ height: number;
120
+ offsetTop: number;
121
+ offsetLeft: number;
122
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
123
+ collaborators: Map<string, import("../types").Collaborator>;
124
+ showStats: boolean;
125
+ currentChartType: import("../element/types").ChartType;
126
+ pasteDialog: {
127
+ shown: false;
128
+ data: null;
129
+ } | {
130
+ shown: true;
131
+ data: import("../charts").Spreadsheet;
132
+ };
133
+ pendingImageElementId: string | null;
134
+ showHyperlinkPopup: false | "info" | "editor";
135
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
136
+ };
137
+ commitToHistory: true;
138
+ } | {
139
+ elements: readonly ExcalidrawElement[];
140
+ appState: Readonly<AppState>;
141
+ commitToHistory: false;
142
+ };
143
+ contextItemLabel: string;
144
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
145
+ } & {
146
+ keyTest?: undefined;
147
+ };
148
+ export declare const actionToggleFrameRendering: {
149
+ name: "toggleFrameRendering";
150
+ viewMode: true;
151
+ trackEvent: {
152
+ category: "canvas";
153
+ };
154
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
155
+ elements: readonly ExcalidrawElement[];
156
+ appState: {
157
+ shouldRenderFrames: boolean;
158
+ contextMenu: {
159
+ items: import("../components/ContextMenu").ContextMenuItems;
160
+ top: number;
161
+ left: number;
162
+ } | null;
163
+ showWelcomeScreen: boolean;
164
+ isLoading: boolean;
165
+ errorMessage: import("react").ReactNode;
166
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
167
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
168
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
169
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
170
+ isBindingEnabled: boolean;
171
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
172
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
173
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
174
+ editingFrame: string | null;
175
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
176
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
177
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
178
+ activeTool: {
179
+ lastActiveTool: import("../types").LastActiveTool;
180
+ locked: boolean;
181
+ } & ({
182
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
183
+ customType: null;
184
+ } | {
185
+ type: "custom";
186
+ customType: string;
187
+ });
188
+ penMode: boolean;
189
+ penDetected: boolean;
190
+ exportBackground: boolean;
191
+ exportEmbedScene: boolean;
192
+ exportWithDarkMode: boolean;
193
+ exportScale: number;
194
+ currentItemStrokeColor: string;
195
+ currentItemBackgroundColor: string;
196
+ currentItemFillStyle: import("../element/types").FillStyle;
197
+ currentItemStrokeWidth: number;
198
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
199
+ currentItemRoughness: number;
200
+ currentItemOpacity: number;
201
+ currentItemFontFamily: number;
202
+ currentItemFontSize: number;
203
+ currentItemTextAlign: string;
204
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
205
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
206
+ currentItemRoundness: import("../element/types").StrokeRoundness;
207
+ viewBackgroundColor: string;
208
+ scrollX: number;
209
+ scrollY: number;
210
+ cursorButton: "up" | "down";
211
+ scrolledOutside: boolean;
212
+ name: string;
213
+ isResizing: boolean;
214
+ isRotating: boolean;
215
+ zoom: Readonly<{
216
+ value: import("../types").NormalizedZoomValue;
217
+ }>;
218
+ openMenu: "canvas" | "shape" | null;
219
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
220
+ openSidebar: {
221
+ name: string;
222
+ tab?: string | undefined;
223
+ } | null;
224
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
225
+ defaultSidebarDockedPreference: boolean;
226
+ lastPointerDownWith: import("../element/types").PointerType;
227
+ selectedElementIds: {
228
+ [id: string]: boolean;
229
+ };
230
+ previousSelectedElementIds: {
231
+ [id: string]: boolean;
232
+ };
233
+ selectedElementsAreBeingDragged: boolean;
234
+ shouldCacheIgnoreZoom: boolean;
235
+ toast: {
236
+ message: string;
237
+ closable?: boolean | undefined;
238
+ duration?: number | undefined;
239
+ } | null;
240
+ zenModeEnabled: boolean;
241
+ theme: string;
242
+ gridSize: number | null;
243
+ viewModeEnabled: boolean;
244
+ selectedGroupIds: {
245
+ [groupId: string]: boolean;
246
+ };
247
+ editingGroupId: string | null;
248
+ width: number;
249
+ height: number;
250
+ offsetTop: number;
251
+ offsetLeft: number;
252
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
253
+ collaborators: Map<string, import("../types").Collaborator>;
254
+ showStats: boolean;
255
+ currentChartType: import("../element/types").ChartType;
256
+ pasteDialog: {
257
+ shown: false;
258
+ data: null;
259
+ } | {
260
+ shown: true;
261
+ data: import("../charts").Spreadsheet;
262
+ };
263
+ pendingImageElementId: string | null;
264
+ showHyperlinkPopup: false | "info" | "editor";
265
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
266
+ };
267
+ commitToHistory: false;
268
+ };
269
+ contextItemLabel: string;
270
+ checked: (appState: AppState) => boolean;
271
+ } & {
272
+ keyTest?: undefined;
273
+ };
274
+ export declare const actionSetFrameAsActiveTool: {
275
+ name: "setFrameAsActiveTool";
276
+ trackEvent: {
277
+ category: "toolbar";
278
+ };
279
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
280
+ elements: readonly ExcalidrawElement[];
281
+ appState: {
282
+ activeTool: {
283
+ lastActiveTool: import("../types").LastActiveTool;
284
+ locked: boolean;
285
+ } & ({
286
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
287
+ customType: null;
288
+ } | {
289
+ type: "custom";
290
+ customType: string;
291
+ });
292
+ contextMenu: {
293
+ items: import("../components/ContextMenu").ContextMenuItems;
294
+ top: number;
295
+ left: number;
296
+ } | null;
297
+ showWelcomeScreen: boolean;
298
+ isLoading: boolean;
299
+ errorMessage: import("react").ReactNode;
300
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
301
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
302
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
303
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
304
+ isBindingEnabled: boolean;
305
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
306
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
307
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
308
+ shouldRenderFrames: boolean;
309
+ editingFrame: string | null;
310
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
311
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
312
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
313
+ penMode: boolean;
314
+ penDetected: boolean;
315
+ exportBackground: boolean;
316
+ exportEmbedScene: boolean;
317
+ exportWithDarkMode: boolean;
318
+ exportScale: number;
319
+ currentItemStrokeColor: string;
320
+ currentItemBackgroundColor: string;
321
+ currentItemFillStyle: import("../element/types").FillStyle;
322
+ currentItemStrokeWidth: number;
323
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
324
+ currentItemRoughness: number;
325
+ currentItemOpacity: number;
326
+ currentItemFontFamily: number;
327
+ currentItemFontSize: number;
328
+ currentItemTextAlign: string;
329
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
330
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
331
+ currentItemRoundness: import("../element/types").StrokeRoundness;
332
+ viewBackgroundColor: string;
333
+ scrollX: number;
334
+ scrollY: number;
335
+ cursorButton: "up" | "down";
336
+ scrolledOutside: boolean;
337
+ name: string;
338
+ isResizing: boolean;
339
+ isRotating: boolean;
340
+ zoom: Readonly<{
341
+ value: import("../types").NormalizedZoomValue;
342
+ }>;
343
+ openMenu: "canvas" | "shape" | null;
344
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
345
+ openSidebar: {
346
+ name: string;
347
+ tab?: string | undefined;
348
+ } | null;
349
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
350
+ defaultSidebarDockedPreference: boolean;
351
+ lastPointerDownWith: import("../element/types").PointerType;
352
+ selectedElementIds: {
353
+ [id: string]: boolean;
354
+ };
355
+ previousSelectedElementIds: {
356
+ [id: string]: boolean;
357
+ };
358
+ selectedElementsAreBeingDragged: boolean;
359
+ shouldCacheIgnoreZoom: boolean;
360
+ toast: {
361
+ message: string;
362
+ closable?: boolean | undefined;
363
+ duration?: number | undefined;
364
+ } | null;
365
+ zenModeEnabled: boolean;
366
+ theme: string;
367
+ gridSize: number | null;
368
+ viewModeEnabled: boolean;
369
+ selectedGroupIds: {
370
+ [groupId: string]: boolean;
371
+ };
372
+ editingGroupId: string | null;
373
+ width: number;
374
+ height: number;
375
+ offsetTop: number;
376
+ offsetLeft: number;
377
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
378
+ collaborators: Map<string, import("../types").Collaborator>;
379
+ showStats: boolean;
380
+ currentChartType: import("../element/types").ChartType;
381
+ pasteDialog: {
382
+ shown: false;
383
+ data: null;
384
+ } | {
385
+ shown: true;
386
+ data: import("../charts").Spreadsheet;
387
+ };
388
+ pendingImageElementId: string | null;
389
+ showHyperlinkPopup: false | "info" | "editor";
390
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
391
+ };
392
+ commitToHistory: false;
393
+ };
394
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
395
+ } & {
396
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
397
+ };
@@ -6,7 +6,7 @@ export declare const actionGroup: {
6
6
  trackEvent: {
7
7
  category: "element";
8
8
  };
9
- perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
9
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
10
10
  appState: Readonly<AppState>;
11
11
  elements: readonly ExcalidrawElement[];
12
12
  commitToHistory: false;
@@ -16,11 +16,9 @@ export declare const actionGroup: {
16
16
  commitToHistory: true;
17
17
  };
18
18
  contextItemLabel: string;
19
- contextItemPredicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
19
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
20
20
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
21
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
22
- isInHamburgerMenu: boolean;
23
- }) => JSX.Element;
21
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
24
22
  } & {
25
23
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
26
24
  };
@@ -29,7 +27,7 @@ export declare const actionUngroup: {
29
27
  trackEvent: {
30
28
  category: "element";
31
29
  };
32
- perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
30
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
33
31
  appState: Readonly<AppState>;
34
32
  elements: readonly ExcalidrawElement[];
35
33
  commitToHistory: false;
@@ -40,10 +38,8 @@ export declare const actionUngroup: {
40
38
  };
41
39
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
42
40
  contextItemLabel: string;
43
- contextItemPredicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
44
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
45
- isInHamburgerMenu: boolean;
46
- }) => JSX.Element;
41
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
42
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
47
43
  } & {
48
44
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
49
45
  };
@@ -1,6 +1,6 @@
1
1
  import { Action } from "./types";
2
2
  import History from "../history";
3
- declare type ActionCreator = (history: History) => Action;
3
+ type ActionCreator = (history: History) => Action;
4
4
  export declare const createUndoAction: ActionCreator;
5
5
  export declare const createRedoAction: ActionCreator;
6
6
  export {};