@dwelle/excalidraw 0.4.0-e80989b → 0.4.0-eadd4b9

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 (200) hide show
  1. package/CHANGELOG.md +458 -0
  2. package/README.md +16 -1424
  3. package/dist/excalidraw.development.js +1829 -500
  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 +430 -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 +52 -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 +2 -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 +16 -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/PasteChartDialog.d.ts +4 -5
  85. package/types/components/PenModeButton.d.ts +1 -1
  86. package/types/components/Popover.d.ts +1 -1
  87. package/types/components/ProjectName.d.ts +2 -1
  88. package/types/components/PublishLibrary.d.ts +2 -2
  89. package/types/components/RadioGroup.d.ts +12 -0
  90. package/types/components/Sidebar/Sidebar.d.ts +66 -63
  91. package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
  92. package/types/components/Sidebar/SidebarTab.d.ts +9 -0
  93. package/types/components/Sidebar/SidebarTabTrigger.d.ts +10 -0
  94. package/types/components/Sidebar/SidebarTabTriggers.d.ts +7 -0
  95. package/types/components/Sidebar/SidebarTabs.d.ts +7 -0
  96. package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
  97. package/types/components/Sidebar/common.d.ts +24 -7
  98. package/types/components/Spinner.d.ts +2 -1
  99. package/types/components/Stack.d.ts +4 -3
  100. package/types/components/Stats.d.ts +3 -3
  101. package/types/components/Switch.d.ts +9 -0
  102. package/types/components/ToolButton.d.ts +6 -5
  103. package/types/components/Tooltip.d.ts +1 -1
  104. package/types/components/Trans.d.ts +8 -0
  105. package/types/components/UserList.d.ts +0 -2
  106. package/types/components/dropdownMenu/DropdownMenu.d.ts +67 -0
  107. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
  108. package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  109. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
  110. package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
  111. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
  112. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
  113. package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  114. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +11 -0
  115. package/types/components/dropdownMenu/common.d.ts +6 -0
  116. package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  117. package/types/components/footer/Footer.d.ts +12 -0
  118. package/types/components/footer/FooterCenter.d.ts +8 -0
  119. package/types/components/hoc/withInternalFallback.d.ts +4 -0
  120. package/types/components/icons.d.ts +13 -2
  121. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
  122. package/types/components/main-menu/DefaultItems.d.ts +47 -0
  123. package/types/components/main-menu/MainMenu.d.ts +61 -0
  124. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
  125. package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  126. package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
  127. package/types/constants.d.ts +73 -16
  128. package/types/context/tunnels.d.ts +18 -0
  129. package/types/context/ui-appState.d.ts +4 -0
  130. package/types/data/blob.d.ts +3 -2
  131. package/types/data/encode.d.ts +1 -1
  132. package/types/data/filesystem.d.ts +2 -1
  133. package/types/data/index.d.ts +1 -1
  134. package/types/data/library.d.ts +3 -45
  135. package/types/data/restore.d.ts +10 -4
  136. package/types/data/types.d.ts +3 -5
  137. package/types/element/Hyperlink.d.ts +27 -18
  138. package/types/element/binding.d.ts +3 -3
  139. package/types/element/bounds.d.ts +32 -7
  140. package/types/element/collision.d.ts +7 -7
  141. package/types/element/dragElements.d.ts +2 -1
  142. package/types/element/image.d.ts +11 -1
  143. package/types/element/index.d.ts +3 -2
  144. package/types/element/linearElementEditor.d.ts +24 -13
  145. package/types/element/mutateElement.d.ts +2 -1
  146. package/types/element/newElement.d.ts +37 -11
  147. package/types/element/resizeElements.d.ts +1 -0
  148. package/types/element/showSelectedShapeActions.d.ts +2 -2
  149. package/types/element/sortElements.d.ts +2 -0
  150. package/types/element/textElement.d.ts +40 -5
  151. package/types/element/textWysiwyg.d.ts +6 -1
  152. package/types/element/transformHandles.d.ts +12 -5
  153. package/types/element/typeChecks.d.ts +12 -2
  154. package/types/element/types.d.ts +53 -36
  155. package/types/emitter.d.ts +1 -1
  156. package/types/errors.d.ts +1 -1
  157. package/types/frame.d.ts +40 -0
  158. package/types/ga.d.ts +5 -5
  159. package/types/groups.d.ts +4 -0
  160. package/types/hooks/useCreatePortalContainer.d.ts +4 -0
  161. package/types/hooks/useLibraryItemSvg.d.ts +11 -0
  162. package/types/hooks/useOutsideClick.d.ts +19 -1
  163. package/types/hooks/useScrollPosition.d.ts +2 -0
  164. package/types/hooks/useTransition.d.ts +2 -0
  165. package/types/i18n.d.ts +7 -1
  166. package/types/jotai.d.ts +20 -108
  167. package/types/keys.d.ts +4 -4
  168. package/types/math.d.ts +4 -1
  169. package/types/packages/excalidraw/example/App.d.ts +7 -1
  170. package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
  171. package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
  172. package/types/packages/excalidraw/example/initialData.d.ts +6 -0
  173. package/types/packages/excalidraw/index.d.ts +17 -3
  174. package/types/packages/utils.d.ts +26 -25
  175. package/types/renderer/renderElement.d.ts +7 -5
  176. package/types/renderer/renderScene.d.ts +13 -6
  177. package/types/renderer/roundRect.d.ts +1 -1
  178. package/types/scene/Scene.d.ts +12 -5
  179. package/types/scene/comparisons.d.ts +1 -1
  180. package/types/scene/export.d.ts +157 -10
  181. package/types/scene/index.d.ts +1 -1
  182. package/types/scene/selection.d.ts +15 -5
  183. package/types/scene/types.d.ts +13 -5
  184. package/types/types.d.ts +126 -77
  185. package/types/utility-types.d.ts +22 -0
  186. package/types/utils.d.ts +40 -9
  187. package/types/zindex.d.ts +4 -4
  188. package/types/actions/actionToggleLock.d.ts +0 -116
  189. package/types/components/ActiveFile.d.ts +0 -7
  190. package/types/components/ClearCanvas.d.ts +0 -4
  191. package/types/components/CollabButton.d.ts +0 -6
  192. package/types/components/ColorPicker.d.ts +0 -14
  193. package/types/components/Footer.d.ts +0 -10
  194. package/types/components/LibraryButton.d.ts +0 -8
  195. package/types/components/MenuItem.d.ts +0 -11
  196. package/types/components/MenuUtils.d.ts +0 -1
  197. package/types/components/SingleLibraryItem.d.ts +0 -10
  198. package/types/components/WelcomeScreen.d.ts +0 -10
  199. package/types/components/WelcomeScreenDecor.d.ts +0 -6
  200. package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
@@ -4,13 +4,12 @@ import { AppState, NormalizedZoomValue } from "../types";
4
4
  export declare const actionChangeViewBackgroundColor: {
5
5
  name: "changeViewBackgroundColor";
6
6
  trackEvent: false;
7
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
7
8
  perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
8
9
  appState: any;
9
10
  commitToHistory: boolean;
10
11
  };
11
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
12
- isInHamburgerMenu: boolean;
13
- }) => JSX.Element;
12
+ PanelComponent: ({ elements, appState, updateData, appProps }: import("./types").PanelComponentProps) => JSX.Element;
14
13
  } & {
15
14
  keyTest?: undefined;
16
15
  };
@@ -19,6 +18,7 @@ export declare const actionClearCanvas: {
19
18
  trackEvent: {
20
19
  category: "canvas";
21
20
  };
21
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
22
22
  perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
23
23
  elements: ExcalidrawElement[];
24
24
  appState: {
@@ -38,20 +38,24 @@ export declare const actionClearCanvas: {
38
38
  data: import("../charts").Spreadsheet;
39
39
  };
40
40
  activeTool: {
41
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
42
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
41
+ lastActiveTool: import("../types").LastActiveTool;
43
42
  locked: boolean;
43
+ } & ({
44
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
44
45
  customType: null;
45
46
  } | {
46
47
  type: "custom";
47
48
  customType: string;
48
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
49
- locked: boolean;
50
- };
49
+ });
51
50
  name: string;
51
+ contextMenu: {
52
+ items: import("../components/ContextMenu").ContextMenuItems;
53
+ top: number;
54
+ left: number;
55
+ } | null;
52
56
  showWelcomeScreen: boolean;
53
57
  isLoading: boolean;
54
- errorMessage: string | null;
58
+ errorMessage: import("react").ReactNode;
55
59
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
56
60
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
57
61
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -59,6 +63,10 @@ export declare const actionClearCanvas: {
59
63
  isBindingEnabled: boolean;
60
64
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
61
65
  suggestedBindings: import("../element/binding").SuggestedBinding[];
66
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
67
+ shouldRenderFrames: boolean;
68
+ editingFrame: string | null;
69
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
62
70
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
63
71
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
64
72
  exportWithDarkMode: boolean;
@@ -73,10 +81,9 @@ export declare const actionClearCanvas: {
73
81
  currentItemFontFamily: number;
74
82
  currentItemFontSize: number;
75
83
  currentItemTextAlign: string;
76
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
77
84
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
78
85
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
79
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
86
+ currentItemRoundness: import("../element/types").StrokeRoundness;
80
87
  viewBackgroundColor: string;
81
88
  scrollX: number;
82
89
  scrollY: number;
@@ -88,10 +95,13 @@ export declare const actionClearCanvas: {
88
95
  value: NormalizedZoomValue;
89
96
  }>;
90
97
  openMenu: "canvas" | "shape" | null;
91
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
92
- openSidebar: "library" | "customSidebar" | null;
93
- openDialog: "imageExport" | "help" | null;
94
- isSidebarDocked: boolean;
98
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
99
+ openSidebar: {
100
+ name: string;
101
+ tab?: string | undefined;
102
+ } | null;
103
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
104
+ defaultSidebarDockedPreference: boolean;
95
105
  lastPointerDownWith: import("../element/types").PointerType;
96
106
  selectedElementIds: {
97
107
  [id: string]: boolean;
@@ -99,6 +109,7 @@ export declare const actionClearCanvas: {
99
109
  previousSelectedElementIds: {
100
110
  [id: string]: boolean;
101
111
  };
112
+ selectedElementsAreBeingDragged: boolean;
102
113
  shouldCacheIgnoreZoom: boolean;
103
114
  toast: {
104
115
  message: string;
@@ -120,14 +131,12 @@ export declare const actionClearCanvas: {
120
131
  };
121
132
  commitToHistory: true;
122
133
  };
123
- PanelComponent: ({ updateData }: import("./types").PanelComponentProps & {
124
- isInHamburgerMenu: boolean;
125
- }) => JSX.Element;
126
134
  } & {
127
135
  keyTest?: undefined;
128
136
  };
129
137
  export declare const actionZoomIn: {
130
138
  name: "zoomIn";
139
+ viewMode: true;
131
140
  trackEvent: {
132
141
  category: "canvas";
133
142
  };
@@ -138,9 +147,14 @@ export declare const actionZoomIn: {
138
147
  zoom: {
139
148
  value: NormalizedZoomValue;
140
149
  };
150
+ contextMenu: {
151
+ items: import("../components/ContextMenu").ContextMenuItems;
152
+ top: number;
153
+ left: number;
154
+ } | null;
141
155
  showWelcomeScreen: boolean;
142
156
  isLoading: boolean;
143
- errorMessage: string | null;
157
+ errorMessage: import("react").ReactNode;
144
158
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
145
159
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
146
160
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -148,19 +162,22 @@ export declare const actionZoomIn: {
148
162
  isBindingEnabled: boolean;
149
163
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
150
164
  suggestedBindings: import("../element/binding").SuggestedBinding[];
165
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
166
+ shouldRenderFrames: boolean;
167
+ editingFrame: string | null;
168
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
151
169
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
152
170
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
153
171
  activeTool: {
154
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
155
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
172
+ lastActiveTool: import("../types").LastActiveTool;
156
173
  locked: boolean;
174
+ } & ({
175
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
157
176
  customType: null;
158
177
  } | {
159
178
  type: "custom";
160
179
  customType: string;
161
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
162
- locked: boolean;
163
- };
180
+ });
164
181
  penMode: boolean;
165
182
  penDetected: boolean;
166
183
  exportBackground: boolean;
@@ -177,10 +194,9 @@ export declare const actionZoomIn: {
177
194
  currentItemFontFamily: number;
178
195
  currentItemFontSize: number;
179
196
  currentItemTextAlign: string;
180
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
181
197
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
182
198
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
183
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
199
+ currentItemRoundness: import("../element/types").StrokeRoundness;
184
200
  viewBackgroundColor: string;
185
201
  cursorButton: "up" | "down";
186
202
  scrolledOutside: boolean;
@@ -188,10 +204,13 @@ export declare const actionZoomIn: {
188
204
  isResizing: boolean;
189
205
  isRotating: boolean;
190
206
  openMenu: "canvas" | "shape" | null;
191
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
192
- openSidebar: "library" | "customSidebar" | null;
193
- openDialog: "imageExport" | "help" | null;
194
- isSidebarDocked: boolean;
207
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
208
+ openSidebar: {
209
+ name: string;
210
+ tab?: string | undefined;
211
+ } | null;
212
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
213
+ defaultSidebarDockedPreference: boolean;
195
214
  lastPointerDownWith: import("../element/types").PointerType;
196
215
  selectedElementIds: {
197
216
  [id: string]: boolean;
@@ -199,6 +218,7 @@ export declare const actionZoomIn: {
199
218
  previousSelectedElementIds: {
200
219
  [id: string]: boolean;
201
220
  };
221
+ selectedElementsAreBeingDragged: boolean;
202
222
  shouldCacheIgnoreZoom: boolean;
203
223
  toast: {
204
224
  message: string;
@@ -234,15 +254,14 @@ export declare const actionZoomIn: {
234
254
  };
235
255
  commitToHistory: false;
236
256
  };
237
- PanelComponent: ({ updateData }: import("./types").PanelComponentProps & {
238
- isInHamburgerMenu: boolean;
239
- }) => JSX.Element;
257
+ PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
240
258
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
241
259
  } & {
242
260
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
243
261
  };
244
262
  export declare const actionZoomOut: {
245
263
  name: "zoomOut";
264
+ viewMode: true;
246
265
  trackEvent: {
247
266
  category: "canvas";
248
267
  };
@@ -253,9 +272,14 @@ export declare const actionZoomOut: {
253
272
  zoom: {
254
273
  value: NormalizedZoomValue;
255
274
  };
275
+ contextMenu: {
276
+ items: import("../components/ContextMenu").ContextMenuItems;
277
+ top: number;
278
+ left: number;
279
+ } | null;
256
280
  showWelcomeScreen: boolean;
257
281
  isLoading: boolean;
258
- errorMessage: string | null;
282
+ errorMessage: import("react").ReactNode;
259
283
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
260
284
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
261
285
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -263,19 +287,22 @@ export declare const actionZoomOut: {
263
287
  isBindingEnabled: boolean;
264
288
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
265
289
  suggestedBindings: import("../element/binding").SuggestedBinding[];
290
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
291
+ shouldRenderFrames: boolean;
292
+ editingFrame: string | null;
293
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
266
294
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
267
295
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
268
296
  activeTool: {
269
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
270
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
297
+ lastActiveTool: import("../types").LastActiveTool;
271
298
  locked: boolean;
299
+ } & ({
300
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
272
301
  customType: null;
273
302
  } | {
274
303
  type: "custom";
275
304
  customType: string;
276
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
277
- locked: boolean;
278
- };
305
+ });
279
306
  penMode: boolean;
280
307
  penDetected: boolean;
281
308
  exportBackground: boolean;
@@ -292,10 +319,9 @@ export declare const actionZoomOut: {
292
319
  currentItemFontFamily: number;
293
320
  currentItemFontSize: number;
294
321
  currentItemTextAlign: string;
295
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
296
322
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
297
323
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
298
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
324
+ currentItemRoundness: import("../element/types").StrokeRoundness;
299
325
  viewBackgroundColor: string;
300
326
  cursorButton: "up" | "down";
301
327
  scrolledOutside: boolean;
@@ -303,10 +329,13 @@ export declare const actionZoomOut: {
303
329
  isResizing: boolean;
304
330
  isRotating: boolean;
305
331
  openMenu: "canvas" | "shape" | null;
306
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
307
- openSidebar: "library" | "customSidebar" | null;
308
- openDialog: "imageExport" | "help" | null;
309
- isSidebarDocked: boolean;
332
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
333
+ openSidebar: {
334
+ name: string;
335
+ tab?: string | undefined;
336
+ } | null;
337
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
338
+ defaultSidebarDockedPreference: boolean;
310
339
  lastPointerDownWith: import("../element/types").PointerType;
311
340
  selectedElementIds: {
312
341
  [id: string]: boolean;
@@ -314,6 +343,7 @@ export declare const actionZoomOut: {
314
343
  previousSelectedElementIds: {
315
344
  [id: string]: boolean;
316
345
  };
346
+ selectedElementsAreBeingDragged: boolean;
317
347
  shouldCacheIgnoreZoom: boolean;
318
348
  toast: {
319
349
  message: string;
@@ -349,15 +379,14 @@ export declare const actionZoomOut: {
349
379
  };
350
380
  commitToHistory: false;
351
381
  };
352
- PanelComponent: ({ updateData }: import("./types").PanelComponentProps & {
353
- isInHamburgerMenu: boolean;
354
- }) => JSX.Element;
382
+ PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
355
383
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
356
384
  } & {
357
385
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
358
386
  };
359
387
  export declare const actionResetZoom: {
360
388
  name: "resetZoom";
389
+ viewMode: true;
361
390
  trackEvent: {
362
391
  category: "canvas";
363
392
  };
@@ -368,9 +397,14 @@ export declare const actionResetZoom: {
368
397
  zoom: {
369
398
  value: NormalizedZoomValue;
370
399
  };
400
+ contextMenu: {
401
+ items: import("../components/ContextMenu").ContextMenuItems;
402
+ top: number;
403
+ left: number;
404
+ } | null;
371
405
  showWelcomeScreen: boolean;
372
406
  isLoading: boolean;
373
- errorMessage: string | null;
407
+ errorMessage: import("react").ReactNode;
374
408
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
375
409
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
376
410
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -378,19 +412,22 @@ export declare const actionResetZoom: {
378
412
  isBindingEnabled: boolean;
379
413
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
380
414
  suggestedBindings: import("../element/binding").SuggestedBinding[];
415
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
416
+ shouldRenderFrames: boolean;
417
+ editingFrame: string | null;
418
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
381
419
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
382
420
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
383
421
  activeTool: {
384
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
385
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
422
+ lastActiveTool: import("../types").LastActiveTool;
386
423
  locked: boolean;
424
+ } & ({
425
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
387
426
  customType: null;
388
427
  } | {
389
428
  type: "custom";
390
429
  customType: string;
391
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
392
- locked: boolean;
393
- };
430
+ });
394
431
  penMode: boolean;
395
432
  penDetected: boolean;
396
433
  exportBackground: boolean;
@@ -407,10 +444,9 @@ export declare const actionResetZoom: {
407
444
  currentItemFontFamily: number;
408
445
  currentItemFontSize: number;
409
446
  currentItemTextAlign: string;
410
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
411
447
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
412
448
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
413
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
449
+ currentItemRoundness: import("../element/types").StrokeRoundness;
414
450
  viewBackgroundColor: string;
415
451
  cursorButton: "up" | "down";
416
452
  scrolledOutside: boolean;
@@ -418,10 +454,13 @@ export declare const actionResetZoom: {
418
454
  isResizing: boolean;
419
455
  isRotating: boolean;
420
456
  openMenu: "canvas" | "shape" | null;
421
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
422
- openSidebar: "library" | "customSidebar" | null;
423
- openDialog: "imageExport" | "help" | null;
424
- isSidebarDocked: boolean;
457
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
458
+ openSidebar: {
459
+ name: string;
460
+ tab?: string | undefined;
461
+ } | null;
462
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
463
+ defaultSidebarDockedPreference: boolean;
425
464
  lastPointerDownWith: import("../element/types").PointerType;
426
465
  selectedElementIds: {
427
466
  [id: string]: boolean;
@@ -429,6 +468,7 @@ export declare const actionResetZoom: {
429
468
  previousSelectedElementIds: {
430
469
  [id: string]: boolean;
431
470
  };
471
+ selectedElementsAreBeingDragged: boolean;
432
472
  shouldCacheIgnoreZoom: boolean;
433
473
  toast: {
434
474
  message: string;
@@ -464,13 +504,125 @@ export declare const actionResetZoom: {
464
504
  };
465
505
  commitToHistory: false;
466
506
  };
467
- PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
468
- isInHamburgerMenu: boolean;
469
- }) => JSX.Element;
507
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
470
508
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
471
509
  } & {
472
510
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
473
511
  };
512
+ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, zoomToSelection: boolean) => {
513
+ appState: {
514
+ zoom: {
515
+ value: NormalizedZoomValue;
516
+ };
517
+ scrollX: number;
518
+ scrollY: number;
519
+ contextMenu: {
520
+ items: import("../components/ContextMenu").ContextMenuItems;
521
+ top: number;
522
+ left: number;
523
+ } | null;
524
+ showWelcomeScreen: boolean;
525
+ isLoading: boolean;
526
+ errorMessage: import("react").ReactNode;
527
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
528
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
529
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
530
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
531
+ isBindingEnabled: boolean;
532
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
533
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
534
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
535
+ shouldRenderFrames: boolean;
536
+ editingFrame: string | null;
537
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
538
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
539
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
540
+ activeTool: {
541
+ lastActiveTool: import("../types").LastActiveTool;
542
+ locked: boolean;
543
+ } & ({
544
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
545
+ customType: null;
546
+ } | {
547
+ type: "custom";
548
+ customType: string;
549
+ });
550
+ penMode: boolean;
551
+ penDetected: boolean;
552
+ exportBackground: boolean;
553
+ exportEmbedScene: boolean;
554
+ exportWithDarkMode: boolean;
555
+ exportScale: number;
556
+ currentItemStrokeColor: string;
557
+ currentItemBackgroundColor: string;
558
+ currentItemFillStyle: import("../element/types").FillStyle;
559
+ currentItemStrokeWidth: number;
560
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
561
+ currentItemRoughness: number;
562
+ currentItemOpacity: number;
563
+ currentItemFontFamily: number;
564
+ currentItemFontSize: number;
565
+ currentItemTextAlign: string;
566
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
567
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
568
+ currentItemRoundness: import("../element/types").StrokeRoundness;
569
+ viewBackgroundColor: string;
570
+ cursorButton: "up" | "down";
571
+ scrolledOutside: boolean;
572
+ name: string;
573
+ isResizing: boolean;
574
+ isRotating: boolean;
575
+ openMenu: "canvas" | "shape" | null;
576
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
577
+ openSidebar: {
578
+ name: string;
579
+ tab?: string | undefined;
580
+ } | null;
581
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
582
+ defaultSidebarDockedPreference: boolean;
583
+ lastPointerDownWith: import("../element/types").PointerType;
584
+ selectedElementIds: {
585
+ [id: string]: boolean;
586
+ };
587
+ previousSelectedElementIds: {
588
+ [id: string]: boolean;
589
+ };
590
+ selectedElementsAreBeingDragged: boolean;
591
+ shouldCacheIgnoreZoom: boolean;
592
+ toast: {
593
+ message: string;
594
+ closable?: boolean | undefined;
595
+ duration?: number | undefined;
596
+ } | null;
597
+ zenModeEnabled: boolean;
598
+ theme: string;
599
+ gridSize: number | null;
600
+ viewModeEnabled: boolean;
601
+ selectedGroupIds: {
602
+ [groupId: string]: boolean;
603
+ };
604
+ editingGroupId: string | null;
605
+ width: number;
606
+ height: number;
607
+ offsetTop: number;
608
+ offsetLeft: number;
609
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
610
+ collaborators: Map<string, import("../types").Collaborator>;
611
+ showStats: boolean;
612
+ currentChartType: import("../element/types").ChartType;
613
+ pasteDialog: {
614
+ shown: false;
615
+ data: null;
616
+ } | {
617
+ shown: true;
618
+ data: import("../charts").Spreadsheet;
619
+ };
620
+ pendingImageElementId: string | null;
621
+ showHyperlinkPopup: false | "info" | "editor";
622
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
623
+ };
624
+ commitToHistory: boolean;
625
+ };
474
626
  export declare const actionZoomToSelected: {
475
627
  name: "zoomToSelection";
476
628
  trackEvent: {
@@ -483,9 +635,14 @@ export declare const actionZoomToSelected: {
483
635
  };
484
636
  scrollX: number;
485
637
  scrollY: number;
638
+ contextMenu: {
639
+ items: import("../components/ContextMenu").ContextMenuItems;
640
+ top: number;
641
+ left: number;
642
+ } | null;
486
643
  showWelcomeScreen: boolean;
487
644
  isLoading: boolean;
488
- errorMessage: string | null;
645
+ errorMessage: import("react").ReactNode;
489
646
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
490
647
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
491
648
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -493,19 +650,22 @@ export declare const actionZoomToSelected: {
493
650
  isBindingEnabled: boolean;
494
651
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
495
652
  suggestedBindings: import("../element/binding").SuggestedBinding[];
653
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
654
+ shouldRenderFrames: boolean;
655
+ editingFrame: string | null;
656
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
496
657
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
497
658
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
498
659
  activeTool: {
499
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
500
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
660
+ lastActiveTool: import("../types").LastActiveTool;
501
661
  locked: boolean;
662
+ } & ({
663
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
502
664
  customType: null;
503
665
  } | {
504
666
  type: "custom";
505
667
  customType: string;
506
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
507
- locked: boolean;
508
- };
668
+ });
509
669
  penMode: boolean;
510
670
  penDetected: boolean;
511
671
  exportBackground: boolean;
@@ -522,10 +682,9 @@ export declare const actionZoomToSelected: {
522
682
  currentItemFontFamily: number;
523
683
  currentItemFontSize: number;
524
684
  currentItemTextAlign: string;
525
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
526
685
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
527
686
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
528
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
687
+ currentItemRoundness: import("../element/types").StrokeRoundness;
529
688
  viewBackgroundColor: string;
530
689
  cursorButton: "up" | "down";
531
690
  scrolledOutside: boolean;
@@ -533,10 +692,13 @@ export declare const actionZoomToSelected: {
533
692
  isResizing: boolean;
534
693
  isRotating: boolean;
535
694
  openMenu: "canvas" | "shape" | null;
536
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
537
- openSidebar: "library" | "customSidebar" | null;
538
- openDialog: "imageExport" | "help" | null;
539
- isSidebarDocked: boolean;
695
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
696
+ openSidebar: {
697
+ name: string;
698
+ tab?: string | undefined;
699
+ } | null;
700
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
701
+ defaultSidebarDockedPreference: boolean;
540
702
  lastPointerDownWith: import("../element/types").PointerType;
541
703
  selectedElementIds: {
542
704
  [id: string]: boolean;
@@ -544,6 +706,7 @@ export declare const actionZoomToSelected: {
544
706
  previousSelectedElementIds: {
545
707
  [id: string]: boolean;
546
708
  };
709
+ selectedElementsAreBeingDragged: boolean;
547
710
  shouldCacheIgnoreZoom: boolean;
548
711
  toast: {
549
712
  message: string;
@@ -585,6 +748,7 @@ export declare const actionZoomToSelected: {
585
748
  };
586
749
  export declare const actionZoomToFit: {
587
750
  name: "zoomToFit";
751
+ viewMode: true;
588
752
  trackEvent: {
589
753
  category: "canvas";
590
754
  };
@@ -595,9 +759,14 @@ export declare const actionZoomToFit: {
595
759
  };
596
760
  scrollX: number;
597
761
  scrollY: number;
762
+ contextMenu: {
763
+ items: import("../components/ContextMenu").ContextMenuItems;
764
+ top: number;
765
+ left: number;
766
+ } | null;
598
767
  showWelcomeScreen: boolean;
599
768
  isLoading: boolean;
600
- errorMessage: string | null;
769
+ errorMessage: import("react").ReactNode;
601
770
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
602
771
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
603
772
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -605,19 +774,22 @@ export declare const actionZoomToFit: {
605
774
  isBindingEnabled: boolean;
606
775
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
607
776
  suggestedBindings: import("../element/binding").SuggestedBinding[];
777
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
778
+ shouldRenderFrames: boolean;
779
+ editingFrame: string | null;
780
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
608
781
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
609
782
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
610
783
  activeTool: {
611
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
612
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
784
+ lastActiveTool: import("../types").LastActiveTool;
613
785
  locked: boolean;
786
+ } & ({
787
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
614
788
  customType: null;
615
789
  } | {
616
790
  type: "custom";
617
791
  customType: string;
618
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
619
- locked: boolean;
620
- };
792
+ });
621
793
  penMode: boolean;
622
794
  penDetected: boolean;
623
795
  exportBackground: boolean;
@@ -634,10 +806,9 @@ export declare const actionZoomToFit: {
634
806
  currentItemFontFamily: number;
635
807
  currentItemFontSize: number;
636
808
  currentItemTextAlign: string;
637
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
638
809
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
639
810
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
640
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
811
+ currentItemRoundness: import("../element/types").StrokeRoundness;
641
812
  viewBackgroundColor: string;
642
813
  cursorButton: "up" | "down";
643
814
  scrolledOutside: boolean;
@@ -645,10 +816,13 @@ export declare const actionZoomToFit: {
645
816
  isResizing: boolean;
646
817
  isRotating: boolean;
647
818
  openMenu: "canvas" | "shape" | null;
648
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
649
- openSidebar: "library" | "customSidebar" | null;
650
- openDialog: "imageExport" | "help" | null;
651
- isSidebarDocked: boolean;
819
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
820
+ openSidebar: {
821
+ name: string;
822
+ tab?: string | undefined;
823
+ } | null;
824
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
825
+ defaultSidebarDockedPreference: boolean;
652
826
  lastPointerDownWith: import("../element/types").PointerType;
653
827
  selectedElementIds: {
654
828
  [id: string]: boolean;
@@ -656,6 +830,7 @@ export declare const actionZoomToFit: {
656
830
  previousSelectedElementIds: {
657
831
  [id: string]: boolean;
658
832
  };
833
+ selectedElementsAreBeingDragged: boolean;
659
834
  shouldCacheIgnoreZoom: boolean;
660
835
  toast: {
661
836
  message: string;
@@ -697,15 +872,21 @@ export declare const actionZoomToFit: {
697
872
  };
698
873
  export declare const actionToggleTheme: {
699
874
  name: "toggleTheme";
875
+ viewMode: true;
700
876
  trackEvent: {
701
877
  category: "canvas";
702
878
  };
703
879
  perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
704
880
  appState: {
705
881
  theme: any;
882
+ contextMenu: {
883
+ items: import("../components/ContextMenu").ContextMenuItems;
884
+ top: number;
885
+ left: number;
886
+ } | null;
706
887
  showWelcomeScreen: boolean;
707
888
  isLoading: boolean;
708
- errorMessage: string | null;
889
+ errorMessage: import("react").ReactNode;
709
890
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
710
891
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
711
892
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -713,19 +894,22 @@ export declare const actionToggleTheme: {
713
894
  isBindingEnabled: boolean;
714
895
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
715
896
  suggestedBindings: import("../element/binding").SuggestedBinding[];
897
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
898
+ shouldRenderFrames: boolean;
899
+ editingFrame: string | null;
900
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
716
901
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
717
902
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
718
903
  activeTool: {
719
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
720
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
904
+ lastActiveTool: import("../types").LastActiveTool;
721
905
  locked: boolean;
906
+ } & ({
907
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
722
908
  customType: null;
723
909
  } | {
724
910
  type: "custom";
725
911
  customType: string;
726
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
727
- locked: boolean;
728
- };
912
+ });
729
913
  penMode: boolean;
730
914
  penDetected: boolean;
731
915
  exportBackground: boolean;
@@ -742,10 +926,9 @@ export declare const actionToggleTheme: {
742
926
  currentItemFontFamily: number;
743
927
  currentItemFontSize: number;
744
928
  currentItemTextAlign: string;
745
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
746
929
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
747
930
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
748
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
931
+ currentItemRoundness: import("../element/types").StrokeRoundness;
749
932
  viewBackgroundColor: string;
750
933
  scrollX: number;
751
934
  scrollY: number;
@@ -758,10 +941,13 @@ export declare const actionToggleTheme: {
758
941
  value: NormalizedZoomValue;
759
942
  }>;
760
943
  openMenu: "canvas" | "shape" | null;
761
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
762
- openSidebar: "library" | "customSidebar" | null;
763
- openDialog: "imageExport" | "help" | null;
764
- isSidebarDocked: boolean;
944
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
945
+ openSidebar: {
946
+ name: string;
947
+ tab?: string | undefined;
948
+ } | null;
949
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
950
+ defaultSidebarDockedPreference: boolean;
765
951
  lastPointerDownWith: import("../element/types").PointerType;
766
952
  selectedElementIds: {
767
953
  [id: string]: boolean;
@@ -769,6 +955,7 @@ export declare const actionToggleTheme: {
769
955
  previousSelectedElementIds: {
770
956
  [id: string]: boolean;
771
957
  };
958
+ selectedElementsAreBeingDragged: boolean;
772
959
  shouldCacheIgnoreZoom: boolean;
773
960
  toast: {
774
961
  message: string;
@@ -803,15 +990,13 @@ export declare const actionToggleTheme: {
803
990
  };
804
991
  commitToHistory: false;
805
992
  };
806
- PanelComponent: ({ appState, updateData }: import("./types").PanelComponentProps & {
807
- isInHamburgerMenu: boolean;
808
- }) => JSX.Element;
809
993
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
994
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
810
995
  } & {
811
996
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
812
997
  };
813
- export declare const actionErase: {
814
- name: "eraser";
998
+ export declare const actionToggleEraserTool: {
999
+ name: "toggleEraserTool";
815
1000
  trackEvent: {
816
1001
  category: "toolbar";
817
1002
  };
@@ -820,19 +1005,142 @@ export declare const actionErase: {
820
1005
  selectedElementIds: {};
821
1006
  selectedGroupIds: {};
822
1007
  activeTool: {
823
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
824
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
1008
+ lastActiveTool: import("../types").LastActiveTool;
825
1009
  locked: boolean;
1010
+ } & ({
1011
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
826
1012
  customType: null;
827
1013
  } | {
828
1014
  type: "custom";
829
1015
  customType: string;
830
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
831
- locked: boolean;
1016
+ });
1017
+ contextMenu: {
1018
+ items: import("../components/ContextMenu").ContextMenuItems;
1019
+ top: number;
1020
+ left: number;
1021
+ } | null;
1022
+ showWelcomeScreen: boolean;
1023
+ isLoading: boolean;
1024
+ errorMessage: import("react").ReactNode;
1025
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1026
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1027
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
1028
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
1029
+ isBindingEnabled: boolean;
1030
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
1031
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
1032
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1033
+ shouldRenderFrames: boolean;
1034
+ editingFrame: string | null;
1035
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
1036
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1037
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1038
+ penMode: boolean;
1039
+ penDetected: boolean;
1040
+ exportBackground: boolean;
1041
+ exportEmbedScene: boolean;
1042
+ exportWithDarkMode: boolean;
1043
+ exportScale: number;
1044
+ currentItemStrokeColor: string;
1045
+ currentItemBackgroundColor: string;
1046
+ currentItemFillStyle: import("../element/types").FillStyle;
1047
+ currentItemStrokeWidth: number;
1048
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
1049
+ currentItemRoughness: number;
1050
+ currentItemOpacity: number;
1051
+ currentItemFontFamily: number;
1052
+ currentItemFontSize: number;
1053
+ currentItemTextAlign: string;
1054
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
1055
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
1056
+ currentItemRoundness: import("../element/types").StrokeRoundness;
1057
+ viewBackgroundColor: string;
1058
+ scrollX: number;
1059
+ scrollY: number;
1060
+ cursorButton: "up" | "down";
1061
+ scrolledOutside: boolean;
1062
+ name: string;
1063
+ isResizing: boolean;
1064
+ isRotating: boolean;
1065
+ zoom: Readonly<{
1066
+ value: NormalizedZoomValue;
1067
+ }>;
1068
+ openMenu: "canvas" | "shape" | null;
1069
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1070
+ openSidebar: {
1071
+ name: string;
1072
+ tab?: string | undefined;
1073
+ } | null;
1074
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1075
+ defaultSidebarDockedPreference: boolean;
1076
+ lastPointerDownWith: import("../element/types").PointerType;
1077
+ previousSelectedElementIds: {
1078
+ [id: string]: boolean;
832
1079
  };
1080
+ selectedElementsAreBeingDragged: boolean;
1081
+ shouldCacheIgnoreZoom: boolean;
1082
+ toast: {
1083
+ message: string;
1084
+ closable?: boolean | undefined;
1085
+ duration?: number | undefined;
1086
+ } | null;
1087
+ zenModeEnabled: boolean;
1088
+ theme: string;
1089
+ gridSize: number | null;
1090
+ viewModeEnabled: boolean;
1091
+ editingGroupId: string | null;
1092
+ width: number;
1093
+ height: number;
1094
+ offsetTop: number;
1095
+ offsetLeft: number;
1096
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
1097
+ collaborators: Map<string, import("../types").Collaborator>;
1098
+ showStats: boolean;
1099
+ currentChartType: import("../element/types").ChartType;
1100
+ pasteDialog: {
1101
+ shown: false;
1102
+ data: null;
1103
+ } | {
1104
+ shown: true;
1105
+ data: import("../charts").Spreadsheet;
1106
+ };
1107
+ pendingImageElementId: string | null;
1108
+ showHyperlinkPopup: false | "info" | "editor";
1109
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1110
+ };
1111
+ commitToHistory: true;
1112
+ };
1113
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1114
+ } & {
1115
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1116
+ };
1117
+ export declare const actionToggleHandTool: {
1118
+ name: "toggleHandTool";
1119
+ trackEvent: {
1120
+ category: "toolbar";
1121
+ };
1122
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
1123
+ appState: {
1124
+ selectedElementIds: {};
1125
+ selectedGroupIds: {};
1126
+ activeTool: {
1127
+ lastActiveTool: import("../types").LastActiveTool;
1128
+ locked: boolean;
1129
+ } & ({
1130
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
1131
+ customType: null;
1132
+ } | {
1133
+ type: "custom";
1134
+ customType: string;
1135
+ });
1136
+ contextMenu: {
1137
+ items: import("../components/ContextMenu").ContextMenuItems;
1138
+ top: number;
1139
+ left: number;
1140
+ } | null;
833
1141
  showWelcomeScreen: boolean;
834
1142
  isLoading: boolean;
835
- errorMessage: string | null;
1143
+ errorMessage: import("react").ReactNode;
836
1144
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
837
1145
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
838
1146
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -840,6 +1148,10 @@ export declare const actionErase: {
840
1148
  isBindingEnabled: boolean;
841
1149
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
842
1150
  suggestedBindings: import("../element/binding").SuggestedBinding[];
1151
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1152
+ shouldRenderFrames: boolean;
1153
+ editingFrame: string | null;
1154
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
843
1155
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
844
1156
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
845
1157
  penMode: boolean;
@@ -858,10 +1170,9 @@ export declare const actionErase: {
858
1170
  currentItemFontFamily: number;
859
1171
  currentItemFontSize: number;
860
1172
  currentItemTextAlign: string;
861
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
862
1173
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
863
1174
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
864
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
1175
+ currentItemRoundness: import("../element/types").StrokeRoundness;
865
1176
  viewBackgroundColor: string;
866
1177
  scrollX: number;
867
1178
  scrollY: number;
@@ -874,14 +1185,18 @@ export declare const actionErase: {
874
1185
  value: NormalizedZoomValue;
875
1186
  }>;
876
1187
  openMenu: "canvas" | "shape" | null;
877
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
878
- openSidebar: "library" | "customSidebar" | null;
879
- openDialog: "imageExport" | "help" | null;
880
- isSidebarDocked: boolean;
1188
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1189
+ openSidebar: {
1190
+ name: string;
1191
+ tab?: string | undefined;
1192
+ } | null;
1193
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1194
+ defaultSidebarDockedPreference: boolean;
881
1195
  lastPointerDownWith: import("../element/types").PointerType;
882
1196
  previousSelectedElementIds: {
883
1197
  [id: string]: boolean;
884
1198
  };
1199
+ selectedElementsAreBeingDragged: boolean;
885
1200
  shouldCacheIgnoreZoom: boolean;
886
1201
  toast: {
887
1202
  message: string;
@@ -915,9 +1230,6 @@ export declare const actionErase: {
915
1230
  commitToHistory: true;
916
1231
  };
917
1232
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
918
- PanelComponent: ({ elements, appState, updateData, data }: import("./types").PanelComponentProps & {
919
- isInHamburgerMenu: boolean;
920
- }) => JSX.Element;
921
1233
  } & {
922
1234
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
923
1235
  };