@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
@@ -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,239 @@ 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
+ };
626
+ export declare const zoomToFitViewport: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, zoomToSelection: boolean) => {
627
+ appState: {
628
+ scrollX: number;
629
+ scrollY: number;
630
+ zoom: {
631
+ value: NormalizedZoomValue;
632
+ };
633
+ contextMenu: {
634
+ items: import("../components/ContextMenu").ContextMenuItems;
635
+ top: number;
636
+ left: number;
637
+ } | null;
638
+ showWelcomeScreen: boolean;
639
+ isLoading: boolean;
640
+ errorMessage: import("react").ReactNode;
641
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
642
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
643
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
644
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
645
+ isBindingEnabled: boolean;
646
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
647
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
648
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
649
+ shouldRenderFrames: boolean;
650
+ editingFrame: string | null;
651
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
652
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
653
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
654
+ activeTool: {
655
+ lastActiveTool: import("../types").LastActiveTool;
656
+ locked: boolean;
657
+ } & ({
658
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
659
+ customType: null;
660
+ } | {
661
+ type: "custom";
662
+ customType: string;
663
+ });
664
+ penMode: boolean;
665
+ penDetected: boolean;
666
+ exportBackground: boolean;
667
+ exportEmbedScene: boolean;
668
+ exportWithDarkMode: boolean;
669
+ exportScale: number;
670
+ currentItemStrokeColor: string;
671
+ currentItemBackgroundColor: string;
672
+ currentItemFillStyle: import("../element/types").FillStyle;
673
+ currentItemStrokeWidth: number;
674
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
675
+ currentItemRoughness: number;
676
+ currentItemOpacity: number;
677
+ currentItemFontFamily: number;
678
+ currentItemFontSize: number;
679
+ currentItemTextAlign: string;
680
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
681
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
682
+ currentItemRoundness: import("../element/types").StrokeRoundness;
683
+ viewBackgroundColor: string;
684
+ cursorButton: "up" | "down";
685
+ scrolledOutside: boolean;
686
+ name: string;
687
+ isResizing: boolean;
688
+ isRotating: boolean;
689
+ openMenu: "canvas" | "shape" | null;
690
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
691
+ openSidebar: {
692
+ name: string;
693
+ tab?: string | undefined;
694
+ } | null;
695
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
696
+ defaultSidebarDockedPreference: boolean;
697
+ lastPointerDownWith: import("../element/types").PointerType;
698
+ selectedElementIds: {
699
+ [id: string]: boolean;
700
+ };
701
+ previousSelectedElementIds: {
702
+ [id: string]: boolean;
703
+ };
704
+ selectedElementsAreBeingDragged: boolean;
705
+ shouldCacheIgnoreZoom: boolean;
706
+ toast: {
707
+ message: string;
708
+ closable?: boolean | undefined;
709
+ duration?: number | undefined;
710
+ } | null;
711
+ zenModeEnabled: boolean;
712
+ theme: string;
713
+ gridSize: number | null;
714
+ viewModeEnabled: boolean;
715
+ selectedGroupIds: {
716
+ [groupId: string]: boolean;
717
+ };
718
+ editingGroupId: string | null;
719
+ width: number;
720
+ height: number;
721
+ offsetTop: number;
722
+ offsetLeft: number;
723
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
724
+ collaborators: Map<string, import("../types").Collaborator>;
725
+ showStats: boolean;
726
+ currentChartType: import("../element/types").ChartType;
727
+ pasteDialog: {
728
+ shown: false;
729
+ data: null;
730
+ } | {
731
+ shown: true;
732
+ data: import("../charts").Spreadsheet;
733
+ };
734
+ pendingImageElementId: string | null;
735
+ showHyperlinkPopup: false | "info" | "editor";
736
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
737
+ };
738
+ commitToHistory: boolean;
739
+ };
474
740
  export declare const actionZoomToSelected: {
475
741
  name: "zoomToSelection";
476
742
  trackEvent: {
@@ -483,9 +749,14 @@ export declare const actionZoomToSelected: {
483
749
  };
484
750
  scrollX: number;
485
751
  scrollY: number;
752
+ contextMenu: {
753
+ items: import("../components/ContextMenu").ContextMenuItems;
754
+ top: number;
755
+ left: number;
756
+ } | null;
486
757
  showWelcomeScreen: boolean;
487
758
  isLoading: boolean;
488
- errorMessage: string | null;
759
+ errorMessage: import("react").ReactNode;
489
760
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
490
761
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
491
762
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -493,19 +764,22 @@ export declare const actionZoomToSelected: {
493
764
  isBindingEnabled: boolean;
494
765
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
495
766
  suggestedBindings: import("../element/binding").SuggestedBinding[];
767
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
768
+ shouldRenderFrames: boolean;
769
+ editingFrame: string | null;
770
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
496
771
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
497
772
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
498
773
  activeTool: {
499
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
500
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
774
+ lastActiveTool: import("../types").LastActiveTool;
501
775
  locked: boolean;
776
+ } & ({
777
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
502
778
  customType: null;
503
779
  } | {
504
780
  type: "custom";
505
781
  customType: string;
506
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
507
- locked: boolean;
508
- };
782
+ });
509
783
  penMode: boolean;
510
784
  penDetected: boolean;
511
785
  exportBackground: boolean;
@@ -522,10 +796,9 @@ export declare const actionZoomToSelected: {
522
796
  currentItemFontFamily: number;
523
797
  currentItemFontSize: number;
524
798
  currentItemTextAlign: string;
525
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
526
799
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
527
800
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
528
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
801
+ currentItemRoundness: import("../element/types").StrokeRoundness;
529
802
  viewBackgroundColor: string;
530
803
  cursorButton: "up" | "down";
531
804
  scrolledOutside: boolean;
@@ -533,10 +806,13 @@ export declare const actionZoomToSelected: {
533
806
  isResizing: boolean;
534
807
  isRotating: boolean;
535
808
  openMenu: "canvas" | "shape" | null;
536
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
537
- openSidebar: "library" | "customSidebar" | null;
538
- openDialog: "imageExport" | "help" | null;
539
- isSidebarDocked: boolean;
809
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
810
+ openSidebar: {
811
+ name: string;
812
+ tab?: string | undefined;
813
+ } | null;
814
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
815
+ defaultSidebarDockedPreference: boolean;
540
816
  lastPointerDownWith: import("../element/types").PointerType;
541
817
  selectedElementIds: {
542
818
  [id: string]: boolean;
@@ -544,6 +820,7 @@ export declare const actionZoomToSelected: {
544
820
  previousSelectedElementIds: {
545
821
  [id: string]: boolean;
546
822
  };
823
+ selectedElementsAreBeingDragged: boolean;
547
824
  shouldCacheIgnoreZoom: boolean;
548
825
  toast: {
549
826
  message: string;
@@ -585,6 +862,7 @@ export declare const actionZoomToSelected: {
585
862
  };
586
863
  export declare const actionZoomToFit: {
587
864
  name: "zoomToFit";
865
+ viewMode: true;
588
866
  trackEvent: {
589
867
  category: "canvas";
590
868
  };
@@ -595,9 +873,14 @@ export declare const actionZoomToFit: {
595
873
  };
596
874
  scrollX: number;
597
875
  scrollY: number;
876
+ contextMenu: {
877
+ items: import("../components/ContextMenu").ContextMenuItems;
878
+ top: number;
879
+ left: number;
880
+ } | null;
598
881
  showWelcomeScreen: boolean;
599
882
  isLoading: boolean;
600
- errorMessage: string | null;
883
+ errorMessage: import("react").ReactNode;
601
884
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
602
885
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
603
886
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -605,19 +888,22 @@ export declare const actionZoomToFit: {
605
888
  isBindingEnabled: boolean;
606
889
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
607
890
  suggestedBindings: import("../element/binding").SuggestedBinding[];
891
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
892
+ shouldRenderFrames: boolean;
893
+ editingFrame: string | null;
894
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
608
895
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
609
896
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
610
897
  activeTool: {
611
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
612
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
898
+ lastActiveTool: import("../types").LastActiveTool;
613
899
  locked: boolean;
900
+ } & ({
901
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
614
902
  customType: null;
615
903
  } | {
616
904
  type: "custom";
617
905
  customType: string;
618
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
619
- locked: boolean;
620
- };
906
+ });
621
907
  penMode: boolean;
622
908
  penDetected: boolean;
623
909
  exportBackground: boolean;
@@ -634,10 +920,9 @@ export declare const actionZoomToFit: {
634
920
  currentItemFontFamily: number;
635
921
  currentItemFontSize: number;
636
922
  currentItemTextAlign: string;
637
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
638
923
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
639
924
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
640
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
925
+ currentItemRoundness: import("../element/types").StrokeRoundness;
641
926
  viewBackgroundColor: string;
642
927
  cursorButton: "up" | "down";
643
928
  scrolledOutside: boolean;
@@ -645,10 +930,13 @@ export declare const actionZoomToFit: {
645
930
  isResizing: boolean;
646
931
  isRotating: boolean;
647
932
  openMenu: "canvas" | "shape" | null;
648
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
649
- openSidebar: "library" | "customSidebar" | null;
650
- openDialog: "imageExport" | "help" | null;
651
- isSidebarDocked: boolean;
933
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
934
+ openSidebar: {
935
+ name: string;
936
+ tab?: string | undefined;
937
+ } | null;
938
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
939
+ defaultSidebarDockedPreference: boolean;
652
940
  lastPointerDownWith: import("../element/types").PointerType;
653
941
  selectedElementIds: {
654
942
  [id: string]: boolean;
@@ -656,6 +944,7 @@ export declare const actionZoomToFit: {
656
944
  previousSelectedElementIds: {
657
945
  [id: string]: boolean;
658
946
  };
947
+ selectedElementsAreBeingDragged: boolean;
659
948
  shouldCacheIgnoreZoom: boolean;
660
949
  toast: {
661
950
  message: string;
@@ -697,15 +986,21 @@ export declare const actionZoomToFit: {
697
986
  };
698
987
  export declare const actionToggleTheme: {
699
988
  name: "toggleTheme";
989
+ viewMode: true;
700
990
  trackEvent: {
701
991
  category: "canvas";
702
992
  };
703
993
  perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
704
994
  appState: {
705
995
  theme: any;
996
+ contextMenu: {
997
+ items: import("../components/ContextMenu").ContextMenuItems;
998
+ top: number;
999
+ left: number;
1000
+ } | null;
706
1001
  showWelcomeScreen: boolean;
707
1002
  isLoading: boolean;
708
- errorMessage: string | null;
1003
+ errorMessage: import("react").ReactNode;
709
1004
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
710
1005
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
711
1006
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -713,19 +1008,22 @@ export declare const actionToggleTheme: {
713
1008
  isBindingEnabled: boolean;
714
1009
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
715
1010
  suggestedBindings: import("../element/binding").SuggestedBinding[];
1011
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1012
+ shouldRenderFrames: boolean;
1013
+ editingFrame: string | null;
1014
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
716
1015
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
717
1016
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
718
1017
  activeTool: {
719
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
720
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
1018
+ lastActiveTool: import("../types").LastActiveTool;
721
1019
  locked: boolean;
1020
+ } & ({
1021
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
722
1022
  customType: null;
723
1023
  } | {
724
1024
  type: "custom";
725
1025
  customType: string;
726
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
727
- locked: boolean;
728
- };
1026
+ });
729
1027
  penMode: boolean;
730
1028
  penDetected: boolean;
731
1029
  exportBackground: boolean;
@@ -742,10 +1040,9 @@ export declare const actionToggleTheme: {
742
1040
  currentItemFontFamily: number;
743
1041
  currentItemFontSize: number;
744
1042
  currentItemTextAlign: string;
745
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
746
1043
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
747
1044
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
748
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
1045
+ currentItemRoundness: import("../element/types").StrokeRoundness;
749
1046
  viewBackgroundColor: string;
750
1047
  scrollX: number;
751
1048
  scrollY: number;
@@ -758,10 +1055,13 @@ export declare const actionToggleTheme: {
758
1055
  value: NormalizedZoomValue;
759
1056
  }>;
760
1057
  openMenu: "canvas" | "shape" | null;
761
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
762
- openSidebar: "library" | "customSidebar" | null;
763
- openDialog: "imageExport" | "help" | null;
764
- isSidebarDocked: boolean;
1058
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1059
+ openSidebar: {
1060
+ name: string;
1061
+ tab?: string | undefined;
1062
+ } | null;
1063
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1064
+ defaultSidebarDockedPreference: boolean;
765
1065
  lastPointerDownWith: import("../element/types").PointerType;
766
1066
  selectedElementIds: {
767
1067
  [id: string]: boolean;
@@ -769,6 +1069,7 @@ export declare const actionToggleTheme: {
769
1069
  previousSelectedElementIds: {
770
1070
  [id: string]: boolean;
771
1071
  };
1072
+ selectedElementsAreBeingDragged: boolean;
772
1073
  shouldCacheIgnoreZoom: boolean;
773
1074
  toast: {
774
1075
  message: string;
@@ -803,15 +1104,13 @@ export declare const actionToggleTheme: {
803
1104
  };
804
1105
  commitToHistory: false;
805
1106
  };
806
- PanelComponent: ({ appState, updateData }: import("./types").PanelComponentProps & {
807
- isInHamburgerMenu: boolean;
808
- }) => JSX.Element;
809
1107
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1108
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
810
1109
  } & {
811
1110
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
812
1111
  };
813
- export declare const actionErase: {
814
- name: "eraser";
1112
+ export declare const actionToggleEraserTool: {
1113
+ name: "toggleEraserTool";
815
1114
  trackEvent: {
816
1115
  category: "toolbar";
817
1116
  };
@@ -820,19 +1119,142 @@ export declare const actionErase: {
820
1119
  selectedElementIds: {};
821
1120
  selectedGroupIds: {};
822
1121
  activeTool: {
823
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
824
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
1122
+ lastActiveTool: import("../types").LastActiveTool;
825
1123
  locked: boolean;
1124
+ } & ({
1125
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
826
1126
  customType: null;
827
1127
  } | {
828
1128
  type: "custom";
829
1129
  customType: string;
830
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
831
- locked: boolean;
1130
+ });
1131
+ contextMenu: {
1132
+ items: import("../components/ContextMenu").ContextMenuItems;
1133
+ top: number;
1134
+ left: number;
1135
+ } | null;
1136
+ showWelcomeScreen: boolean;
1137
+ isLoading: boolean;
1138
+ errorMessage: import("react").ReactNode;
1139
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1140
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1141
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
1142
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
1143
+ isBindingEnabled: boolean;
1144
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
1145
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
1146
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1147
+ shouldRenderFrames: boolean;
1148
+ editingFrame: string | null;
1149
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
1150
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1151
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1152
+ penMode: boolean;
1153
+ penDetected: boolean;
1154
+ exportBackground: boolean;
1155
+ exportEmbedScene: boolean;
1156
+ exportWithDarkMode: boolean;
1157
+ exportScale: number;
1158
+ currentItemStrokeColor: string;
1159
+ currentItemBackgroundColor: string;
1160
+ currentItemFillStyle: import("../element/types").FillStyle;
1161
+ currentItemStrokeWidth: number;
1162
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
1163
+ currentItemRoughness: number;
1164
+ currentItemOpacity: number;
1165
+ currentItemFontFamily: number;
1166
+ currentItemFontSize: number;
1167
+ currentItemTextAlign: string;
1168
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
1169
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
1170
+ currentItemRoundness: import("../element/types").StrokeRoundness;
1171
+ viewBackgroundColor: string;
1172
+ scrollX: number;
1173
+ scrollY: number;
1174
+ cursorButton: "up" | "down";
1175
+ scrolledOutside: boolean;
1176
+ name: string;
1177
+ isResizing: boolean;
1178
+ isRotating: boolean;
1179
+ zoom: Readonly<{
1180
+ value: NormalizedZoomValue;
1181
+ }>;
1182
+ openMenu: "canvas" | "shape" | null;
1183
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1184
+ openSidebar: {
1185
+ name: string;
1186
+ tab?: string | undefined;
1187
+ } | null;
1188
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1189
+ defaultSidebarDockedPreference: boolean;
1190
+ lastPointerDownWith: import("../element/types").PointerType;
1191
+ previousSelectedElementIds: {
1192
+ [id: string]: boolean;
832
1193
  };
1194
+ selectedElementsAreBeingDragged: boolean;
1195
+ shouldCacheIgnoreZoom: boolean;
1196
+ toast: {
1197
+ message: string;
1198
+ closable?: boolean | undefined;
1199
+ duration?: number | undefined;
1200
+ } | null;
1201
+ zenModeEnabled: boolean;
1202
+ theme: string;
1203
+ gridSize: number | null;
1204
+ viewModeEnabled: boolean;
1205
+ editingGroupId: string | null;
1206
+ width: number;
1207
+ height: number;
1208
+ offsetTop: number;
1209
+ offsetLeft: number;
1210
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
1211
+ collaborators: Map<string, import("../types").Collaborator>;
1212
+ showStats: boolean;
1213
+ currentChartType: import("../element/types").ChartType;
1214
+ pasteDialog: {
1215
+ shown: false;
1216
+ data: null;
1217
+ } | {
1218
+ shown: true;
1219
+ data: import("../charts").Spreadsheet;
1220
+ };
1221
+ pendingImageElementId: string | null;
1222
+ showHyperlinkPopup: false | "info" | "editor";
1223
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1224
+ };
1225
+ commitToHistory: true;
1226
+ };
1227
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1228
+ } & {
1229
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1230
+ };
1231
+ export declare const actionToggleHandTool: {
1232
+ name: "toggleHandTool";
1233
+ trackEvent: {
1234
+ category: "toolbar";
1235
+ };
1236
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
1237
+ appState: {
1238
+ selectedElementIds: {};
1239
+ selectedGroupIds: {};
1240
+ activeTool: {
1241
+ lastActiveTool: import("../types").LastActiveTool;
1242
+ locked: boolean;
1243
+ } & ({
1244
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
1245
+ customType: null;
1246
+ } | {
1247
+ type: "custom";
1248
+ customType: string;
1249
+ });
1250
+ contextMenu: {
1251
+ items: import("../components/ContextMenu").ContextMenuItems;
1252
+ top: number;
1253
+ left: number;
1254
+ } | null;
833
1255
  showWelcomeScreen: boolean;
834
1256
  isLoading: boolean;
835
- errorMessage: string | null;
1257
+ errorMessage: import("react").ReactNode;
836
1258
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
837
1259
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
838
1260
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -840,6 +1262,10 @@ export declare const actionErase: {
840
1262
  isBindingEnabled: boolean;
841
1263
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
842
1264
  suggestedBindings: import("../element/binding").SuggestedBinding[];
1265
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1266
+ shouldRenderFrames: boolean;
1267
+ editingFrame: string | null;
1268
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
843
1269
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
844
1270
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
845
1271
  penMode: boolean;
@@ -858,10 +1284,9 @@ export declare const actionErase: {
858
1284
  currentItemFontFamily: number;
859
1285
  currentItemFontSize: number;
860
1286
  currentItemTextAlign: string;
861
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
862
1287
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
863
1288
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
864
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
1289
+ currentItemRoundness: import("../element/types").StrokeRoundness;
865
1290
  viewBackgroundColor: string;
866
1291
  scrollX: number;
867
1292
  scrollY: number;
@@ -874,14 +1299,18 @@ export declare const actionErase: {
874
1299
  value: NormalizedZoomValue;
875
1300
  }>;
876
1301
  openMenu: "canvas" | "shape" | null;
877
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
878
- openSidebar: "library" | "customSidebar" | null;
879
- openDialog: "imageExport" | "help" | null;
880
- isSidebarDocked: boolean;
1302
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1303
+ openSidebar: {
1304
+ name: string;
1305
+ tab?: string | undefined;
1306
+ } | null;
1307
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1308
+ defaultSidebarDockedPreference: boolean;
881
1309
  lastPointerDownWith: import("../element/types").PointerType;
882
1310
  previousSelectedElementIds: {
883
1311
  [id: string]: boolean;
884
1312
  };
1313
+ selectedElementsAreBeingDragged: boolean;
885
1314
  shouldCacheIgnoreZoom: boolean;
886
1315
  toast: {
887
1316
  message: string;
@@ -915,9 +1344,6 @@ export declare const actionErase: {
915
1344
  commitToHistory: true;
916
1345
  };
917
1346
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
918
- PanelComponent: ({ elements, appState, updateData, data }: import("./types").PanelComponentProps & {
919
- isInHamburgerMenu: boolean;
920
- }) => JSX.Element;
921
1347
  } & {
922
1348
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
923
1349
  };