@dwelle/excalidraw 0.4.0-cfd6fb7 → 0.4.0-d27af2e

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 (243) hide show
  1. package/CHANGELOG.md +497 -447
  2. package/README.md +18 -1362
  3. package/dist/excalidraw-assets/Assistant-Bold.woff2 +0 -0
  4. package/dist/excalidraw-assets/Assistant-Medium.woff2 +0 -0
  5. package/dist/excalidraw-assets/Assistant-Regular.woff2 +0 -0
  6. package/dist/excalidraw-assets/Assistant-SemiBold.woff2 +0 -0
  7. package/dist/excalidraw-assets/vendor-d415b28e9024dee4bb1b.js +2 -0
  8. package/dist/excalidraw-assets-dev/Assistant-Bold.woff2 +0 -0
  9. package/dist/excalidraw-assets-dev/Assistant-Medium.woff2 +0 -0
  10. package/dist/excalidraw-assets-dev/Assistant-Regular.woff2 +0 -0
  11. package/dist/excalidraw-assets-dev/Assistant-SemiBold.woff2 +0 -0
  12. package/dist/excalidraw-assets-dev/{vendor-c0592035c3911af79359.js → vendor-a14cd58fa2db417e42b2.js} +7 -7
  13. package/dist/excalidraw.development.js +3269 -1350
  14. package/dist/excalidraw.production.min.js +1 -1
  15. package/dist/excalidraw.production.min.js.LICENSE.txt +20 -7
  16. package/main.js +1 -8
  17. package/package.json +9 -4
  18. package/types/actions/actionAddToLibrary.d.ts +136 -55
  19. package/types/actions/actionAlign.d.ts +25 -20
  20. package/types/actions/actionBoundText.d.ts +193 -23
  21. package/types/actions/actionCanvas.d.ts +794 -172
  22. package/types/actions/actionClipboard.d.ts +252 -94
  23. package/types/actions/actionDeleteSelected.d.ts +144 -58
  24. package/types/actions/actionDistribute.d.ts +7 -8
  25. package/types/actions/actionDuplicateSelection.d.ts +1 -2
  26. package/types/actions/actionElementLock.d.ts +283 -0
  27. package/types/actions/actionExport.d.ts +469 -225
  28. package/types/actions/actionFinalize.d.ts +90 -40
  29. package/types/actions/actionFlip.d.ts +4 -7
  30. package/types/actions/actionFrame.d.ts +441 -0
  31. package/types/actions/actionGroup.d.ts +259 -10
  32. package/types/actions/actionHistory.d.ts +1 -1
  33. package/types/actions/actionLinearEditor.d.ts +141 -0
  34. package/types/actions/actionMenu.d.ts +141 -61
  35. package/types/actions/actionNavigate.d.ts +2 -1
  36. package/types/actions/actionProperties.d.ts +605 -253
  37. package/types/actions/actionSelectAll.d.ts +127 -2
  38. package/types/actions/actionStyles.d.ts +46 -20
  39. package/types/actions/actionToggleGridMode.d.ts +48 -20
  40. package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +60 -32
  41. package/types/actions/actionToggleStats.d.ts +47 -20
  42. package/types/actions/actionToggleViewMode.d.ts +48 -20
  43. package/types/actions/actionToggleZenMode.d.ts +48 -20
  44. package/types/actions/actionZindex.d.ts +4 -4
  45. package/types/actions/index.d.ts +3 -1
  46. package/types/actions/manager.d.ts +2 -1
  47. package/types/actions/shortcuts.d.ts +2 -1
  48. package/types/actions/types.d.ts +15 -10
  49. package/types/appState.d.ts +31 -25
  50. package/types/charts.d.ts +2 -2
  51. package/types/clients.d.ts +5 -6
  52. package/types/clipboard.d.ts +9 -3
  53. package/types/colors.d.ts +60 -5
  54. package/types/components/Actions.d.ts +20 -7
  55. package/types/components/ActiveConfirmDialog.d.ts +4 -0
  56. package/types/components/App.d.ts +95 -29
  57. package/types/components/Avatar.d.ts +2 -3
  58. package/types/components/BraveMeasureTextError.d.ts +2 -0
  59. package/types/components/Button.d.ts +16 -0
  60. package/types/components/ButtonIconSelect.d.ts +11 -3
  61. package/types/components/Card.d.ts +0 -1
  62. package/types/components/ColorPicker/ColorInput.d.ts +9 -0
  63. package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
  64. package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
  65. package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
  66. package/types/components/ColorPicker/Picker.d.ts +18 -0
  67. package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
  68. package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
  69. package/types/components/ColorPicker/ShadeList.d.ts +8 -0
  70. package/types/components/ColorPicker/TopPicks.d.ts +9 -0
  71. package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
  72. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
  73. package/types/components/ContextMenu.d.ts +9 -22
  74. package/types/components/DefaultSidebar.d.ts +29 -0
  75. package/types/components/Dialog.d.ts +3 -4
  76. package/types/components/DialogActionButton.d.ts +10 -0
  77. package/types/components/ErrorDialog.d.ts +3 -2
  78. package/types/components/ExcalidrawLogo.d.ts +15 -0
  79. package/types/components/EyeDropper.d.ts +28 -0
  80. package/types/components/FilledButton.d.ts +17 -0
  81. package/types/components/FixedSideContainer.d.ts +1 -1
  82. package/types/components/HandButton.d.ts +10 -0
  83. package/types/components/HelpButton.d.ts +7 -0
  84. package/types/components/HintViewer.d.ts +5 -5
  85. package/types/components/HomeButton.d.ts +5 -0
  86. package/types/components/ImageExportDialog.d.ts +8 -11
  87. package/types/components/InitializeApp.d.ts +2 -0
  88. package/types/components/Island.d.ts +1 -1
  89. package/types/components/JSONExportDialog.d.ts +8 -6
  90. package/types/components/LayerUI.d.ts +11 -15
  91. package/types/components/LibraryMenu.d.ts +15 -7
  92. package/types/components/LibraryMenuBrowseButton.d.ts +7 -0
  93. package/types/components/LibraryMenuControlButtons.d.ts +9 -0
  94. package/types/components/LibraryMenuHeaderContent.d.ts +17 -0
  95. package/types/components/LibraryMenuItems.d.ts +4 -14
  96. package/types/components/LibraryMenuSection.d.ts +22 -0
  97. package/types/components/LibraryUnit.d.ts +7 -5
  98. package/types/components/LoadingMessage.d.ts +2 -1
  99. package/types/components/LockButton.d.ts +1 -2
  100. package/types/components/MobileMenu.d.ts +13 -14
  101. package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
  102. package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
  103. package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
  104. package/types/components/PasteChartDialog.d.ts +4 -5
  105. package/types/components/PenModeButton.d.ts +1 -1
  106. package/types/components/Popover.d.ts +1 -1
  107. package/types/components/ProjectName.d.ts +2 -1
  108. package/types/components/PublishLibrary.d.ts +2 -2
  109. package/types/components/RadioGroup.d.ts +12 -0
  110. package/types/components/Section.d.ts +1 -1
  111. package/types/components/Sidebar/Sidebar.d.ts +76 -0
  112. package/types/components/Sidebar/SidebarHeader.d.ts +7 -0
  113. package/types/components/Sidebar/SidebarTab.d.ts +8 -0
  114. package/types/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
  115. package/types/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
  116. package/types/components/Sidebar/SidebarTabs.d.ts +6 -0
  117. package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
  118. package/types/components/Sidebar/common.d.ts +33 -0
  119. package/types/components/Spinner.d.ts +2 -1
  120. package/types/components/Stack.d.ts +4 -3
  121. package/types/components/Stats.d.ts +4 -4
  122. package/types/components/Switch.d.ts +9 -0
  123. package/types/components/ToolButton.d.ts +6 -5
  124. package/types/components/Tooltip.d.ts +1 -1
  125. package/types/components/Trans.d.ts +9 -0
  126. package/types/components/UserList.d.ts +0 -3
  127. package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
  128. package/types/components/canvases/StaticCanvas.d.ts +18 -0
  129. package/types/components/canvases/index.d.ts +3 -0
  130. package/types/components/dropdownMenu/DropdownMenu.d.ts +67 -0
  131. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
  132. package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  133. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
  134. package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
  135. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
  136. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
  137. package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  138. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
  139. package/types/components/dropdownMenu/common.d.ts +6 -0
  140. package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  141. package/types/components/footer/Footer.d.ts +12 -0
  142. package/types/components/footer/FooterCenter.d.ts +8 -0
  143. package/types/components/hoc/withInternalFallback.d.ts +4 -0
  144. package/types/components/icons.d.ts +95 -123
  145. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +9 -0
  146. package/types/components/main-menu/DefaultItems.d.ts +47 -0
  147. package/types/components/main-menu/MainMenu.d.ts +61 -0
  148. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +57 -0
  149. package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  150. package/types/components/welcome-screen/WelcomeScreen.d.ts +84 -0
  151. package/types/constants.d.ts +107 -23
  152. package/types/context/tunnels.d.ts +19 -0
  153. package/types/context/ui-appState.d.ts +4 -0
  154. package/types/data/blob.d.ts +4 -3
  155. package/types/data/encode.d.ts +1 -1
  156. package/types/data/filesystem.d.ts +2 -1
  157. package/types/data/index.d.ts +1 -1
  158. package/types/data/library.d.ts +3 -45
  159. package/types/data/restore.d.ts +10 -4
  160. package/types/data/transform.d.ts +71 -0
  161. package/types/data/types.d.ts +14 -1
  162. package/types/data/url.d.ts +7 -0
  163. package/types/element/Hyperlink.d.ts +58 -28
  164. package/types/element/binding.d.ts +4 -3
  165. package/types/element/bounds.d.ts +33 -8
  166. package/types/element/collision.d.ts +7 -7
  167. package/types/element/dragElements.d.ts +12 -2
  168. package/types/element/embeddable.d.ts +159 -0
  169. package/types/element/image.d.ts +11 -1
  170. package/types/element/index.d.ts +4 -3
  171. package/types/element/linearElementEditor.d.ts +96 -31
  172. package/types/element/mutateElement.d.ts +2 -1
  173. package/types/element/newElement.d.ts +59 -13
  174. package/types/element/resizeElements.d.ts +3 -3
  175. package/types/element/showSelectedShapeActions.d.ts +2 -2
  176. package/types/element/sizeHelpers.d.ts +8 -1
  177. package/types/element/sortElements.d.ts +2 -0
  178. package/types/element/textElement.d.ts +60 -8
  179. package/types/element/textWysiwyg.d.ts +7 -2
  180. package/types/element/transformHandles.d.ts +16 -10
  181. package/types/element/typeChecks.d.ts +14 -2
  182. package/types/element/types.d.ts +66 -35
  183. package/types/emitter.d.ts +1 -1
  184. package/types/errors.d.ts +1 -1
  185. package/types/frame.d.ts +40 -0
  186. package/types/ga.d.ts +5 -5
  187. package/types/groups.d.ts +15 -11
  188. package/types/history.d.ts +3 -3
  189. package/types/hooks/useCreatePortalContainer.d.ts +4 -0
  190. package/types/hooks/useLibraryItemSvg.d.ts +11 -0
  191. package/types/hooks/useOutsideClick.d.ts +19 -0
  192. package/types/hooks/useScrollPosition.d.ts +1 -0
  193. package/types/hooks/useStable.d.ts +1 -0
  194. package/types/hooks/useTransition.d.ts +2 -0
  195. package/types/i18n.d.ts +11 -2
  196. package/types/jotai.d.ts +20 -108
  197. package/types/keys.d.ts +20 -7
  198. package/types/math.d.ts +13 -1
  199. package/types/packages/excalidraw/example/App.d.ts +9 -2
  200. package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
  201. package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
  202. package/types/packages/excalidraw/example/initialData.d.ts +182 -64
  203. package/types/packages/excalidraw/example/sidebar/{Sidebar.d.ts → ExampleSidebar.d.ts} +1 -1
  204. package/types/packages/excalidraw/index.d.ts +20 -3
  205. package/types/packages/excalidraw/main.d.ts +3 -1
  206. package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
  207. package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
  208. package/types/packages/utils.d.ts +29 -22
  209. package/types/renderer/renderElement.d.ts +13 -22
  210. package/types/renderer/renderScene.d.ts +20 -30
  211. package/types/renderer/renderSnaps.d.ts +2 -0
  212. package/types/renderer/roundRect.d.ts +1 -1
  213. package/types/scene/Fonts.d.ts +21 -0
  214. package/types/scene/Renderer.d.ts +25 -0
  215. package/types/scene/Scene.d.ts +42 -5
  216. package/types/scene/Shape.d.ts +12 -0
  217. package/types/scene/ShapeCache.d.ts +20 -0
  218. package/types/scene/comparisons.d.ts +2 -3
  219. package/types/scene/export.d.ts +182 -10
  220. package/types/scene/index.d.ts +1 -1
  221. package/types/scene/scroll.d.ts +1 -1
  222. package/types/scene/scrollbars.d.ts +2 -6
  223. package/types/scene/selection.d.ts +27 -6
  224. package/types/scene/types.d.ts +69 -25
  225. package/types/shapes.d.ts +27 -3
  226. package/types/snapping.d.ts +108 -0
  227. package/types/types.d.ts +212 -79
  228. package/types/utility-types.d.ts +24 -0
  229. package/types/utils.d.ts +78 -12
  230. package/types/zindex.d.ts +4 -4
  231. package/dist/excalidraw-assets/vendor-52b1f3361986b6c6a4fe.js +0 -2
  232. package/types/components/ActiveFile.d.ts +0 -7
  233. package/types/components/BackgroundPickerAndDarkModeToggle.d.ts +0 -9
  234. package/types/components/ClearCanvas.d.ts +0 -4
  235. package/types/components/CollabButton.d.ts +0 -7
  236. package/types/components/ColorPicker.d.ts +0 -14
  237. package/types/components/HelpIcon.d.ts +0 -8
  238. package/types/components/LibraryButton.d.ts +0 -7
  239. package/types/components/SidebarLockButton.d.ts +0 -8
  240. package/types/components/SingleLibraryItem.d.ts +0 -10
  241. /package/dist/excalidraw-assets/{vendor-52b1f3361986b6c6a4fe.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
  242. /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-52b1f3361986b6c6a4fe.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
  243. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-c0592035c3911af79359.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
@@ -1,14 +1,14 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppState, NormalizedZoomValue } from "../types";
4
3
  export declare const actionChangeViewBackgroundColor: {
5
4
  name: "changeViewBackgroundColor";
6
5
  trackEvent: false;
6
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
7
7
  perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
8
8
  appState: any;
9
9
  commitToHistory: boolean;
10
10
  };
11
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
11
+ PanelComponent: ({ elements, appState, updateData, appProps }: import("./types").PanelComponentProps) => JSX.Element;
12
12
  } & {
13
13
  keyTest?: undefined;
14
14
  };
@@ -17,11 +17,12 @@ export declare const actionClearCanvas: {
17
17
  trackEvent: {
18
18
  category: "canvas";
19
19
  };
20
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
20
21
  perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
21
22
  elements: ExcalidrawElement[];
22
23
  appState: {
23
24
  files: {};
24
- theme: string;
25
+ theme: import("../element/types").Theme;
25
26
  penMode: boolean;
26
27
  penDetected: boolean;
27
28
  exportBackground: boolean;
@@ -36,25 +37,142 @@ export declare const actionClearCanvas: {
36
37
  data: import("../charts").Spreadsheet;
37
38
  };
38
39
  activeTool: {
39
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
40
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
40
+ lastActiveTool: import("../types").LastActiveTool;
41
41
  locked: boolean;
42
+ } & ({
43
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
42
44
  customType: null;
43
45
  } | {
44
46
  type: "custom";
45
47
  customType: string;
46
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
47
- locked: boolean;
48
+ });
49
+ name: string;
50
+ toast: {
51
+ message: string;
52
+ closable?: boolean | undefined;
53
+ duration?: number | undefined;
54
+ } | null;
55
+ collaborators: Map<string, import("../types").Collaborator>;
56
+ contextMenu: {
57
+ items: import("../components/ContextMenu").ContextMenuItems;
58
+ top: number;
59
+ left: number;
60
+ } | null;
61
+ showWelcomeScreen: boolean;
62
+ isLoading: boolean;
63
+ errorMessage: import("react").ReactNode;
64
+ activeEmbeddable: {
65
+ element: import("../element/types").NonDeletedExcalidrawElement;
66
+ state: "active" | "hover";
67
+ } | null;
68
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
69
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
70
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
71
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
72
+ isBindingEnabled: boolean;
73
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
74
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
75
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
76
+ frameRendering: {
77
+ enabled: boolean;
78
+ name: boolean;
79
+ outline: boolean;
80
+ clip: boolean;
48
81
  };
82
+ editingFrame: string | null;
83
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
84
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
85
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
86
+ exportWithDarkMode: boolean;
87
+ exportScale: number;
88
+ currentItemStrokeColor: string;
89
+ currentItemBackgroundColor: string;
90
+ currentItemFillStyle: import("../element/types").FillStyle;
91
+ currentItemStrokeWidth: number;
92
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
93
+ currentItemRoughness: number;
94
+ currentItemOpacity: number;
95
+ currentItemFontFamily: number;
96
+ currentItemFontSize: number;
97
+ currentItemTextAlign: string;
98
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
99
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
100
+ currentItemRoundness: import("../element/types").StrokeRoundness;
101
+ viewBackgroundColor: string;
49
102
  scrollX: number;
50
103
  scrollY: number;
51
- viewBackgroundColor: string;
104
+ cursorButton: "up" | "down";
105
+ scrolledOutside: boolean;
106
+ isResizing: boolean;
107
+ isRotating: boolean;
52
108
  zoom: Readonly<{
53
109
  value: NormalizedZoomValue;
54
110
  }>;
111
+ openMenu: "canvas" | "shape" | null;
112
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
113
+ openSidebar: {
114
+ name: string;
115
+ tab?: string | undefined;
116
+ } | null;
117
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
118
+ defaultSidebarDockedPreference: boolean;
119
+ lastPointerDownWith: import("../element/types").PointerType;
120
+ selectedElementIds: Readonly<{
121
+ [id: string]: true;
122
+ }>;
123
+ previousSelectedElementIds: {
124
+ [id: string]: true;
125
+ };
126
+ selectedElementsAreBeingDragged: boolean;
55
127
  shouldCacheIgnoreZoom: boolean;
128
+ zenModeEnabled: boolean;
129
+ viewModeEnabled: boolean;
130
+ selectedGroupIds: {
131
+ [groupId: string]: boolean;
132
+ };
133
+ editingGroupId: string | null;
134
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
135
+ currentChartType: import("../element/types").ChartType;
136
+ pendingImageElementId: string | null;
137
+ showHyperlinkPopup: false | "editor" | "info";
138
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
139
+ snapLines: import("../snapping").SnapLine[];
140
+ originSnapOffset: {
141
+ x: number;
142
+ y: number;
143
+ } | null;
144
+ objectsSnapModeEnabled: boolean;
145
+ };
146
+ commitToHistory: true;
147
+ };
148
+ } & {
149
+ keyTest?: undefined;
150
+ };
151
+ export declare const actionZoomIn: {
152
+ name: "zoomIn";
153
+ viewMode: true;
154
+ trackEvent: {
155
+ category: "canvas";
156
+ };
157
+ perform: (_elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
158
+ appState: {
159
+ scrollX: number;
160
+ scrollY: number;
161
+ zoom: {
162
+ value: NormalizedZoomValue;
163
+ };
164
+ contextMenu: {
165
+ items: import("../components/ContextMenu").ContextMenuItems;
166
+ top: number;
167
+ left: number;
168
+ } | null;
169
+ showWelcomeScreen: boolean;
56
170
  isLoading: boolean;
57
- errorMessage: string | null;
171
+ errorMessage: import("react").ReactNode;
172
+ activeEmbeddable: {
173
+ element: import("../element/types").NonDeletedExcalidrawElement;
174
+ state: "active" | "hover";
175
+ } | null;
58
176
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
59
177
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
60
178
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -62,8 +180,31 @@ export declare const actionClearCanvas: {
62
180
  isBindingEnabled: boolean;
63
181
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
64
182
  suggestedBindings: import("../element/binding").SuggestedBinding[];
183
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
184
+ frameRendering: {
185
+ enabled: boolean;
186
+ name: boolean;
187
+ outline: boolean;
188
+ clip: boolean;
189
+ };
190
+ editingFrame: string | null;
191
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
65
192
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
66
193
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
194
+ activeTool: {
195
+ lastActiveTool: import("../types").LastActiveTool;
196
+ locked: boolean;
197
+ } & ({
198
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
199
+ customType: null;
200
+ } | {
201
+ type: "custom";
202
+ customType: string;
203
+ });
204
+ penMode: boolean;
205
+ penDetected: boolean;
206
+ exportBackground: boolean;
207
+ exportEmbedScene: boolean;
67
208
  exportWithDarkMode: boolean;
68
209
  exportScale: number;
69
210
  currentItemStrokeColor: string;
@@ -75,54 +216,81 @@ export declare const actionClearCanvas: {
75
216
  currentItemOpacity: number;
76
217
  currentItemFontFamily: number;
77
218
  currentItemFontSize: number;
78
- currentItemTextAlign: import("../element/types").TextAlign;
79
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
219
+ currentItemTextAlign: string;
80
220
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
81
221
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
82
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
222
+ currentItemRoundness: import("../element/types").StrokeRoundness;
223
+ viewBackgroundColor: string;
83
224
  cursorButton: "up" | "down";
84
225
  scrolledOutside: boolean;
85
226
  name: string;
86
227
  isResizing: boolean;
87
228
  isRotating: boolean;
88
229
  openMenu: "canvas" | "shape" | null;
89
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
230
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
231
+ openSidebar: {
232
+ name: string;
233
+ tab?: string | undefined;
234
+ } | null;
235
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
236
+ defaultSidebarDockedPreference: boolean;
90
237
  lastPointerDownWith: import("../element/types").PointerType;
91
- selectedElementIds: {
92
- [id: string]: boolean;
93
- };
238
+ selectedElementIds: Readonly<{
239
+ [id: string]: true;
240
+ }>;
94
241
  previousSelectedElementIds: {
95
- [id: string]: boolean;
242
+ [id: string]: true;
96
243
  };
97
- showHelpDialog: boolean;
244
+ selectedElementsAreBeingDragged: boolean;
245
+ shouldCacheIgnoreZoom: boolean;
98
246
  toast: {
99
247
  message: string;
100
248
  closable?: boolean | undefined;
101
249
  duration?: number | undefined;
102
250
  } | null;
103
251
  zenModeEnabled: boolean;
252
+ theme: import("../element/types").Theme;
253
+ gridSize: number | null;
104
254
  viewModeEnabled: boolean;
105
255
  selectedGroupIds: {
106
256
  [groupId: string]: boolean;
107
257
  };
108
258
  editingGroupId: string | null;
109
- isLibraryOpen: boolean;
110
- isLibraryMenuDocked: boolean;
259
+ width: number;
260
+ height: number;
261
+ offsetTop: number;
262
+ offsetLeft: number;
111
263
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
112
264
  collaborators: Map<string, import("../types").Collaborator>;
265
+ showStats: boolean;
113
266
  currentChartType: import("../element/types").ChartType;
267
+ pasteDialog: {
268
+ shown: false;
269
+ data: null;
270
+ } | {
271
+ shown: true;
272
+ data: import("../charts").Spreadsheet;
273
+ };
114
274
  pendingImageElementId: string | null;
115
- showHyperlinkPopup: false | "info" | "editor";
275
+ showHyperlinkPopup: false | "editor" | "info";
116
276
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
277
+ snapLines: import("../snapping").SnapLine[];
278
+ originSnapOffset: {
279
+ x: number;
280
+ y: number;
281
+ } | null;
282
+ objectsSnapModeEnabled: boolean;
117
283
  };
118
- commitToHistory: true;
284
+ commitToHistory: false;
119
285
  };
120
286
  PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
287
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
121
288
  } & {
122
- keyTest?: undefined;
289
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
123
290
  };
124
- export declare const actionZoomIn: {
125
- name: "zoomIn";
291
+ export declare const actionZoomOut: {
292
+ name: "zoomOut";
293
+ viewMode: true;
126
294
  trackEvent: {
127
295
  category: "canvas";
128
296
  };
@@ -133,8 +301,18 @@ export declare const actionZoomIn: {
133
301
  zoom: {
134
302
  value: NormalizedZoomValue;
135
303
  };
304
+ contextMenu: {
305
+ items: import("../components/ContextMenu").ContextMenuItems;
306
+ top: number;
307
+ left: number;
308
+ } | null;
309
+ showWelcomeScreen: boolean;
136
310
  isLoading: boolean;
137
- errorMessage: string | null;
311
+ errorMessage: import("react").ReactNode;
312
+ activeEmbeddable: {
313
+ element: import("../element/types").NonDeletedExcalidrawElement;
314
+ state: "active" | "hover";
315
+ } | null;
138
316
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
139
317
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
140
318
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -142,19 +320,27 @@ export declare const actionZoomIn: {
142
320
  isBindingEnabled: boolean;
143
321
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
144
322
  suggestedBindings: import("../element/binding").SuggestedBinding[];
323
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
324
+ frameRendering: {
325
+ enabled: boolean;
326
+ name: boolean;
327
+ outline: boolean;
328
+ clip: boolean;
329
+ };
330
+ editingFrame: string | null;
331
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
145
332
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
146
333
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
147
334
  activeTool: {
148
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
149
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
335
+ lastActiveTool: import("../types").LastActiveTool;
150
336
  locked: boolean;
337
+ } & ({
338
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
151
339
  customType: null;
152
340
  } | {
153
341
  type: "custom";
154
342
  customType: string;
155
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
156
- locked: boolean;
157
- };
343
+ });
158
344
  penMode: boolean;
159
345
  penDetected: boolean;
160
346
  exportBackground: boolean;
@@ -170,11 +356,10 @@ export declare const actionZoomIn: {
170
356
  currentItemOpacity: number;
171
357
  currentItemFontFamily: number;
172
358
  currentItemFontSize: number;
173
- currentItemTextAlign: import("../element/types").TextAlign;
174
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
359
+ currentItemTextAlign: string;
175
360
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
176
361
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
177
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
362
+ currentItemRoundness: import("../element/types").StrokeRoundness;
178
363
  viewBackgroundColor: string;
179
364
  cursorButton: "up" | "down";
180
365
  scrolledOutside: boolean;
@@ -182,23 +367,29 @@ export declare const actionZoomIn: {
182
367
  isResizing: boolean;
183
368
  isRotating: boolean;
184
369
  openMenu: "canvas" | "shape" | null;
185
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
370
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
371
+ openSidebar: {
372
+ name: string;
373
+ tab?: string | undefined;
374
+ } | null;
375
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
376
+ defaultSidebarDockedPreference: boolean;
186
377
  lastPointerDownWith: import("../element/types").PointerType;
187
- selectedElementIds: {
188
- [id: string]: boolean;
189
- };
378
+ selectedElementIds: Readonly<{
379
+ [id: string]: true;
380
+ }>;
190
381
  previousSelectedElementIds: {
191
- [id: string]: boolean;
382
+ [id: string]: true;
192
383
  };
384
+ selectedElementsAreBeingDragged: boolean;
193
385
  shouldCacheIgnoreZoom: boolean;
194
- showHelpDialog: boolean;
195
386
  toast: {
196
387
  message: string;
197
388
  closable?: boolean | undefined;
198
389
  duration?: number | undefined;
199
390
  } | null;
200
391
  zenModeEnabled: boolean;
201
- theme: string;
392
+ theme: import("../element/types").Theme;
202
393
  gridSize: number | null;
203
394
  viewModeEnabled: boolean;
204
395
  selectedGroupIds: {
@@ -209,8 +400,6 @@ export declare const actionZoomIn: {
209
400
  height: number;
210
401
  offsetTop: number;
211
402
  offsetLeft: number;
212
- isLibraryOpen: boolean;
213
- isLibraryMenuDocked: boolean;
214
403
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
215
404
  collaborators: Map<string, import("../types").Collaborator>;
216
405
  showStats: boolean;
@@ -223,8 +412,14 @@ export declare const actionZoomIn: {
223
412
  data: import("../charts").Spreadsheet;
224
413
  };
225
414
  pendingImageElementId: string | null;
226
- showHyperlinkPopup: false | "info" | "editor";
415
+ showHyperlinkPopup: false | "editor" | "info";
227
416
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
417
+ snapLines: import("../snapping").SnapLine[];
418
+ originSnapOffset: {
419
+ x: number;
420
+ y: number;
421
+ } | null;
422
+ objectsSnapModeEnabled: boolean;
228
423
  };
229
424
  commitToHistory: false;
230
425
  };
@@ -233,8 +428,9 @@ export declare const actionZoomIn: {
233
428
  } & {
234
429
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
235
430
  };
236
- export declare const actionZoomOut: {
237
- name: "zoomOut";
431
+ export declare const actionResetZoom: {
432
+ name: "resetZoom";
433
+ viewMode: true;
238
434
  trackEvent: {
239
435
  category: "canvas";
240
436
  };
@@ -245,8 +441,18 @@ export declare const actionZoomOut: {
245
441
  zoom: {
246
442
  value: NormalizedZoomValue;
247
443
  };
444
+ contextMenu: {
445
+ items: import("../components/ContextMenu").ContextMenuItems;
446
+ top: number;
447
+ left: number;
448
+ } | null;
449
+ showWelcomeScreen: boolean;
248
450
  isLoading: boolean;
249
- errorMessage: string | null;
451
+ errorMessage: import("react").ReactNode;
452
+ activeEmbeddable: {
453
+ element: import("../element/types").NonDeletedExcalidrawElement;
454
+ state: "active" | "hover";
455
+ } | null;
250
456
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
251
457
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
252
458
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -254,19 +460,27 @@ export declare const actionZoomOut: {
254
460
  isBindingEnabled: boolean;
255
461
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
256
462
  suggestedBindings: import("../element/binding").SuggestedBinding[];
463
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
464
+ frameRendering: {
465
+ enabled: boolean;
466
+ name: boolean;
467
+ outline: boolean;
468
+ clip: boolean;
469
+ };
470
+ editingFrame: string | null;
471
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
257
472
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
258
473
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
259
474
  activeTool: {
260
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
261
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
475
+ lastActiveTool: import("../types").LastActiveTool;
262
476
  locked: boolean;
477
+ } & ({
478
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
263
479
  customType: null;
264
480
  } | {
265
481
  type: "custom";
266
482
  customType: string;
267
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
268
- locked: boolean;
269
- };
483
+ });
270
484
  penMode: boolean;
271
485
  penDetected: boolean;
272
486
  exportBackground: boolean;
@@ -282,11 +496,10 @@ export declare const actionZoomOut: {
282
496
  currentItemOpacity: number;
283
497
  currentItemFontFamily: number;
284
498
  currentItemFontSize: number;
285
- currentItemTextAlign: import("../element/types").TextAlign;
286
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
499
+ currentItemTextAlign: string;
287
500
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
288
501
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
289
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
502
+ currentItemRoundness: import("../element/types").StrokeRoundness;
290
503
  viewBackgroundColor: string;
291
504
  cursorButton: "up" | "down";
292
505
  scrolledOutside: boolean;
@@ -294,23 +507,29 @@ export declare const actionZoomOut: {
294
507
  isResizing: boolean;
295
508
  isRotating: boolean;
296
509
  openMenu: "canvas" | "shape" | null;
297
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
510
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
511
+ openSidebar: {
512
+ name: string;
513
+ tab?: string | undefined;
514
+ } | null;
515
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
516
+ defaultSidebarDockedPreference: boolean;
298
517
  lastPointerDownWith: import("../element/types").PointerType;
299
- selectedElementIds: {
300
- [id: string]: boolean;
301
- };
518
+ selectedElementIds: Readonly<{
519
+ [id: string]: true;
520
+ }>;
302
521
  previousSelectedElementIds: {
303
- [id: string]: boolean;
522
+ [id: string]: true;
304
523
  };
524
+ selectedElementsAreBeingDragged: boolean;
305
525
  shouldCacheIgnoreZoom: boolean;
306
- showHelpDialog: boolean;
307
526
  toast: {
308
527
  message: string;
309
528
  closable?: boolean | undefined;
310
529
  duration?: number | undefined;
311
530
  } | null;
312
531
  zenModeEnabled: boolean;
313
- theme: string;
532
+ theme: import("../element/types").Theme;
314
533
  gridSize: number | null;
315
534
  viewModeEnabled: boolean;
316
535
  selectedGroupIds: {
@@ -321,8 +540,6 @@ export declare const actionZoomOut: {
321
540
  height: number;
322
541
  offsetTop: number;
323
542
  offsetLeft: number;
324
- isLibraryOpen: boolean;
325
- isLibraryMenuDocked: boolean;
326
543
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
327
544
  collaborators: Map<string, import("../types").Collaborator>;
328
545
  showStats: boolean;
@@ -335,30 +552,182 @@ export declare const actionZoomOut: {
335
552
  data: import("../charts").Spreadsheet;
336
553
  };
337
554
  pendingImageElementId: string | null;
338
- showHyperlinkPopup: false | "info" | "editor";
555
+ showHyperlinkPopup: false | "editor" | "info";
339
556
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
557
+ snapLines: import("../snapping").SnapLine[];
558
+ originSnapOffset: {
559
+ x: number;
560
+ y: number;
561
+ } | null;
562
+ objectsSnapModeEnabled: boolean;
340
563
  };
341
564
  commitToHistory: false;
342
565
  };
343
- PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
566
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
344
567
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
345
568
  } & {
346
569
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
347
570
  };
348
- export declare const actionResetZoom: {
349
- name: "resetZoom";
571
+ export declare const zoomToFit: ({ targetElements, appState, fitToViewport, viewportZoomFactor, }: {
572
+ targetElements: readonly ExcalidrawElement[];
573
+ appState: Readonly<AppState>;
574
+ /** whether to fit content to viewport (beyond >100%) */
575
+ fitToViewport: boolean;
576
+ /** zoom content to cover X of the viewport, when fitToViewport=true */
577
+ viewportZoomFactor?: number | undefined;
578
+ }) => {
579
+ appState: {
580
+ scrollX: number;
581
+ scrollY: number;
582
+ zoom: {
583
+ value: NormalizedZoomValue;
584
+ };
585
+ contextMenu: {
586
+ items: import("../components/ContextMenu").ContextMenuItems;
587
+ top: number;
588
+ left: number;
589
+ } | null;
590
+ showWelcomeScreen: boolean;
591
+ isLoading: boolean;
592
+ errorMessage: import("react").ReactNode;
593
+ activeEmbeddable: {
594
+ element: import("../element/types").NonDeletedExcalidrawElement;
595
+ state: "active" | "hover";
596
+ } | null;
597
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
598
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
599
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
600
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
601
+ isBindingEnabled: boolean;
602
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
603
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
604
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
605
+ frameRendering: {
606
+ enabled: boolean;
607
+ name: boolean;
608
+ outline: boolean;
609
+ clip: boolean;
610
+ };
611
+ editingFrame: string | null;
612
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
613
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
614
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
615
+ activeTool: {
616
+ lastActiveTool: import("../types").LastActiveTool;
617
+ locked: boolean;
618
+ } & ({
619
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
620
+ customType: null;
621
+ } | {
622
+ type: "custom";
623
+ customType: string;
624
+ });
625
+ penMode: boolean;
626
+ penDetected: boolean;
627
+ exportBackground: boolean;
628
+ exportEmbedScene: boolean;
629
+ exportWithDarkMode: boolean;
630
+ exportScale: number;
631
+ currentItemStrokeColor: string;
632
+ currentItemBackgroundColor: string;
633
+ currentItemFillStyle: import("../element/types").FillStyle;
634
+ currentItemStrokeWidth: number;
635
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
636
+ currentItemRoughness: number;
637
+ currentItemOpacity: number;
638
+ currentItemFontFamily: number;
639
+ currentItemFontSize: number;
640
+ currentItemTextAlign: string;
641
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
642
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
643
+ currentItemRoundness: import("../element/types").StrokeRoundness;
644
+ viewBackgroundColor: string;
645
+ cursorButton: "up" | "down";
646
+ scrolledOutside: boolean;
647
+ name: string;
648
+ isResizing: boolean;
649
+ isRotating: boolean;
650
+ openMenu: "canvas" | "shape" | null;
651
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
652
+ openSidebar: {
653
+ name: string;
654
+ tab?: string | undefined;
655
+ } | null;
656
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
657
+ defaultSidebarDockedPreference: boolean;
658
+ lastPointerDownWith: import("../element/types").PointerType;
659
+ selectedElementIds: Readonly<{
660
+ [id: string]: true;
661
+ }>;
662
+ previousSelectedElementIds: {
663
+ [id: string]: true;
664
+ };
665
+ selectedElementsAreBeingDragged: boolean;
666
+ shouldCacheIgnoreZoom: boolean;
667
+ toast: {
668
+ message: string;
669
+ closable?: boolean | undefined;
670
+ duration?: number | undefined;
671
+ } | null;
672
+ zenModeEnabled: boolean;
673
+ theme: import("../element/types").Theme;
674
+ gridSize: number | null;
675
+ viewModeEnabled: boolean;
676
+ selectedGroupIds: {
677
+ [groupId: string]: boolean;
678
+ };
679
+ editingGroupId: string | null;
680
+ width: number;
681
+ height: number;
682
+ offsetTop: number;
683
+ offsetLeft: number;
684
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
685
+ collaborators: Map<string, import("../types").Collaborator>;
686
+ showStats: boolean;
687
+ currentChartType: import("../element/types").ChartType;
688
+ pasteDialog: {
689
+ shown: false;
690
+ data: null;
691
+ } | {
692
+ shown: true;
693
+ data: import("../charts").Spreadsheet;
694
+ };
695
+ pendingImageElementId: string | null;
696
+ showHyperlinkPopup: false | "editor" | "info";
697
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
698
+ snapLines: import("../snapping").SnapLine[];
699
+ originSnapOffset: {
700
+ x: number;
701
+ y: number;
702
+ } | null;
703
+ objectsSnapModeEnabled: boolean;
704
+ };
705
+ commitToHistory: boolean;
706
+ };
707
+ export declare const actionZoomToFitSelectionInViewport: {
708
+ name: "zoomToFitSelectionInViewport";
350
709
  trackEvent: {
351
710
  category: "canvas";
352
711
  };
353
- perform: (_elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
712
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
354
713
  appState: {
355
714
  scrollX: number;
356
715
  scrollY: number;
357
716
  zoom: {
358
717
  value: NormalizedZoomValue;
359
718
  };
719
+ contextMenu: {
720
+ items: import("../components/ContextMenu").ContextMenuItems;
721
+ top: number;
722
+ left: number;
723
+ } | null;
724
+ showWelcomeScreen: boolean;
360
725
  isLoading: boolean;
361
- errorMessage: string | null;
726
+ errorMessage: import("react").ReactNode;
727
+ activeEmbeddable: {
728
+ element: import("../element/types").NonDeletedExcalidrawElement;
729
+ state: "active" | "hover";
730
+ } | null;
362
731
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
363
732
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
364
733
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -366,19 +735,27 @@ export declare const actionResetZoom: {
366
735
  isBindingEnabled: boolean;
367
736
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
368
737
  suggestedBindings: import("../element/binding").SuggestedBinding[];
738
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
739
+ frameRendering: {
740
+ enabled: boolean;
741
+ name: boolean;
742
+ outline: boolean;
743
+ clip: boolean;
744
+ };
745
+ editingFrame: string | null;
746
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
369
747
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
370
748
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
371
749
  activeTool: {
372
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
373
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
750
+ lastActiveTool: import("../types").LastActiveTool;
374
751
  locked: boolean;
752
+ } & ({
753
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
375
754
  customType: null;
376
755
  } | {
377
756
  type: "custom";
378
757
  customType: string;
379
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
380
- locked: boolean;
381
- };
758
+ });
382
759
  penMode: boolean;
383
760
  penDetected: boolean;
384
761
  exportBackground: boolean;
@@ -394,11 +771,10 @@ export declare const actionResetZoom: {
394
771
  currentItemOpacity: number;
395
772
  currentItemFontFamily: number;
396
773
  currentItemFontSize: number;
397
- currentItemTextAlign: import("../element/types").TextAlign;
398
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
774
+ currentItemTextAlign: string;
399
775
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
400
776
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
401
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
777
+ currentItemRoundness: import("../element/types").StrokeRoundness;
402
778
  viewBackgroundColor: string;
403
779
  cursorButton: "up" | "down";
404
780
  scrolledOutside: boolean;
@@ -406,23 +782,29 @@ export declare const actionResetZoom: {
406
782
  isResizing: boolean;
407
783
  isRotating: boolean;
408
784
  openMenu: "canvas" | "shape" | null;
409
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
785
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
786
+ openSidebar: {
787
+ name: string;
788
+ tab?: string | undefined;
789
+ } | null;
790
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
791
+ defaultSidebarDockedPreference: boolean;
410
792
  lastPointerDownWith: import("../element/types").PointerType;
411
- selectedElementIds: {
412
- [id: string]: boolean;
413
- };
793
+ selectedElementIds: Readonly<{
794
+ [id: string]: true;
795
+ }>;
414
796
  previousSelectedElementIds: {
415
- [id: string]: boolean;
797
+ [id: string]: true;
416
798
  };
799
+ selectedElementsAreBeingDragged: boolean;
417
800
  shouldCacheIgnoreZoom: boolean;
418
- showHelpDialog: boolean;
419
801
  toast: {
420
802
  message: string;
421
803
  closable?: boolean | undefined;
422
804
  duration?: number | undefined;
423
805
  } | null;
424
806
  zenModeEnabled: boolean;
425
- theme: string;
807
+ theme: import("../element/types").Theme;
426
808
  gridSize: number | null;
427
809
  viewModeEnabled: boolean;
428
810
  selectedGroupIds: {
@@ -433,8 +815,6 @@ export declare const actionResetZoom: {
433
815
  height: number;
434
816
  offsetTop: number;
435
817
  offsetLeft: number;
436
- isLibraryOpen: boolean;
437
- isLibraryMenuDocked: boolean;
438
818
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
439
819
  collaborators: Map<string, import("../types").Collaborator>;
440
820
  showStats: boolean;
@@ -447,30 +827,45 @@ export declare const actionResetZoom: {
447
827
  data: import("../charts").Spreadsheet;
448
828
  };
449
829
  pendingImageElementId: string | null;
450
- showHyperlinkPopup: false | "info" | "editor";
830
+ showHyperlinkPopup: false | "editor" | "info";
451
831
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
832
+ snapLines: import("../snapping").SnapLine[];
833
+ originSnapOffset: {
834
+ x: number;
835
+ y: number;
836
+ } | null;
837
+ objectsSnapModeEnabled: boolean;
452
838
  };
453
- commitToHistory: false;
839
+ commitToHistory: boolean;
454
840
  };
455
- PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
456
841
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
457
842
  } & {
458
843
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
459
844
  };
460
- export declare const actionZoomToSelected: {
461
- name: "zoomToSelection";
845
+ export declare const actionZoomToFitSelection: {
846
+ name: "zoomToFitSelection";
462
847
  trackEvent: {
463
848
  category: "canvas";
464
849
  };
465
- perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
850
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
466
851
  appState: {
852
+ scrollX: number;
853
+ scrollY: number;
467
854
  zoom: {
468
855
  value: NormalizedZoomValue;
469
856
  };
470
- scrollX: number;
471
- scrollY: number;
857
+ contextMenu: {
858
+ items: import("../components/ContextMenu").ContextMenuItems;
859
+ top: number;
860
+ left: number;
861
+ } | null;
862
+ showWelcomeScreen: boolean;
472
863
  isLoading: boolean;
473
- errorMessage: string | null;
864
+ errorMessage: import("react").ReactNode;
865
+ activeEmbeddable: {
866
+ element: import("../element/types").NonDeletedExcalidrawElement;
867
+ state: "active" | "hover";
868
+ } | null;
474
869
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
475
870
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
476
871
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -478,19 +873,27 @@ export declare const actionZoomToSelected: {
478
873
  isBindingEnabled: boolean;
479
874
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
480
875
  suggestedBindings: import("../element/binding").SuggestedBinding[];
876
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
877
+ frameRendering: {
878
+ enabled: boolean;
879
+ name: boolean;
880
+ outline: boolean;
881
+ clip: boolean;
882
+ };
883
+ editingFrame: string | null;
884
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
481
885
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
482
886
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
483
887
  activeTool: {
484
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
485
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
888
+ lastActiveTool: import("../types").LastActiveTool;
486
889
  locked: boolean;
890
+ } & ({
891
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
487
892
  customType: null;
488
893
  } | {
489
894
  type: "custom";
490
895
  customType: string;
491
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
492
- locked: boolean;
493
- };
896
+ });
494
897
  penMode: boolean;
495
898
  penDetected: boolean;
496
899
  exportBackground: boolean;
@@ -506,11 +909,10 @@ export declare const actionZoomToSelected: {
506
909
  currentItemOpacity: number;
507
910
  currentItemFontFamily: number;
508
911
  currentItemFontSize: number;
509
- currentItemTextAlign: import("../element/types").TextAlign;
510
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
912
+ currentItemTextAlign: string;
511
913
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
512
914
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
513
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
915
+ currentItemRoundness: import("../element/types").StrokeRoundness;
514
916
  viewBackgroundColor: string;
515
917
  cursorButton: "up" | "down";
516
918
  scrolledOutside: boolean;
@@ -518,23 +920,29 @@ export declare const actionZoomToSelected: {
518
920
  isResizing: boolean;
519
921
  isRotating: boolean;
520
922
  openMenu: "canvas" | "shape" | null;
521
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
923
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
924
+ openSidebar: {
925
+ name: string;
926
+ tab?: string | undefined;
927
+ } | null;
928
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
929
+ defaultSidebarDockedPreference: boolean;
522
930
  lastPointerDownWith: import("../element/types").PointerType;
523
- selectedElementIds: {
524
- [id: string]: boolean;
525
- };
931
+ selectedElementIds: Readonly<{
932
+ [id: string]: true;
933
+ }>;
526
934
  previousSelectedElementIds: {
527
- [id: string]: boolean;
935
+ [id: string]: true;
528
936
  };
937
+ selectedElementsAreBeingDragged: boolean;
529
938
  shouldCacheIgnoreZoom: boolean;
530
- showHelpDialog: boolean;
531
939
  toast: {
532
940
  message: string;
533
941
  closable?: boolean | undefined;
534
942
  duration?: number | undefined;
535
943
  } | null;
536
944
  zenModeEnabled: boolean;
537
- theme: string;
945
+ theme: import("../element/types").Theme;
538
946
  gridSize: number | null;
539
947
  viewModeEnabled: boolean;
540
948
  selectedGroupIds: {
@@ -545,8 +953,6 @@ export declare const actionZoomToSelected: {
545
953
  height: number;
546
954
  offsetTop: number;
547
955
  offsetLeft: number;
548
- isLibraryOpen: boolean;
549
- isLibraryMenuDocked: boolean;
550
956
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
551
957
  collaborators: Map<string, import("../types").Collaborator>;
552
958
  showStats: boolean;
@@ -559,8 +965,14 @@ export declare const actionZoomToSelected: {
559
965
  data: import("../charts").Spreadsheet;
560
966
  };
561
967
  pendingImageElementId: string | null;
562
- showHyperlinkPopup: false | "info" | "editor";
968
+ showHyperlinkPopup: false | "editor" | "info";
563
969
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
970
+ snapLines: import("../snapping").SnapLine[];
971
+ originSnapOffset: {
972
+ x: number;
973
+ y: number;
974
+ } | null;
975
+ objectsSnapModeEnabled: boolean;
564
976
  };
565
977
  commitToHistory: boolean;
566
978
  };
@@ -570,18 +982,29 @@ export declare const actionZoomToSelected: {
570
982
  };
571
983
  export declare const actionZoomToFit: {
572
984
  name: "zoomToFit";
985
+ viewMode: true;
573
986
  trackEvent: {
574
987
  category: "canvas";
575
988
  };
576
989
  perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
577
990
  appState: {
991
+ scrollX: number;
992
+ scrollY: number;
578
993
  zoom: {
579
994
  value: NormalizedZoomValue;
580
995
  };
581
- scrollX: number;
582
- scrollY: number;
996
+ contextMenu: {
997
+ items: import("../components/ContextMenu").ContextMenuItems;
998
+ top: number;
999
+ left: number;
1000
+ } | null;
1001
+ showWelcomeScreen: boolean;
583
1002
  isLoading: boolean;
584
- errorMessage: string | null;
1003
+ errorMessage: import("react").ReactNode;
1004
+ activeEmbeddable: {
1005
+ element: import("../element/types").NonDeletedExcalidrawElement;
1006
+ state: "active" | "hover";
1007
+ } | null;
585
1008
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
586
1009
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
587
1010
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -589,19 +1012,27 @@ export declare const actionZoomToFit: {
589
1012
  isBindingEnabled: boolean;
590
1013
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
591
1014
  suggestedBindings: import("../element/binding").SuggestedBinding[];
1015
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1016
+ frameRendering: {
1017
+ enabled: boolean;
1018
+ name: boolean;
1019
+ outline: boolean;
1020
+ clip: boolean;
1021
+ };
1022
+ editingFrame: string | null;
1023
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
592
1024
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
593
1025
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
594
1026
  activeTool: {
595
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
596
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
1027
+ lastActiveTool: import("../types").LastActiveTool;
597
1028
  locked: boolean;
1029
+ } & ({
1030
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
598
1031
  customType: null;
599
1032
  } | {
600
1033
  type: "custom";
601
1034
  customType: string;
602
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
603
- locked: boolean;
604
- };
1035
+ });
605
1036
  penMode: boolean;
606
1037
  penDetected: boolean;
607
1038
  exportBackground: boolean;
@@ -617,11 +1048,10 @@ export declare const actionZoomToFit: {
617
1048
  currentItemOpacity: number;
618
1049
  currentItemFontFamily: number;
619
1050
  currentItemFontSize: number;
620
- currentItemTextAlign: import("../element/types").TextAlign;
621
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
1051
+ currentItemTextAlign: string;
622
1052
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
623
1053
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
624
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
1054
+ currentItemRoundness: import("../element/types").StrokeRoundness;
625
1055
  viewBackgroundColor: string;
626
1056
  cursorButton: "up" | "down";
627
1057
  scrolledOutside: boolean;
@@ -629,23 +1059,29 @@ export declare const actionZoomToFit: {
629
1059
  isResizing: boolean;
630
1060
  isRotating: boolean;
631
1061
  openMenu: "canvas" | "shape" | null;
632
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
1062
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1063
+ openSidebar: {
1064
+ name: string;
1065
+ tab?: string | undefined;
1066
+ } | null;
1067
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1068
+ defaultSidebarDockedPreference: boolean;
633
1069
  lastPointerDownWith: import("../element/types").PointerType;
634
- selectedElementIds: {
635
- [id: string]: boolean;
636
- };
1070
+ selectedElementIds: Readonly<{
1071
+ [id: string]: true;
1072
+ }>;
637
1073
  previousSelectedElementIds: {
638
- [id: string]: boolean;
1074
+ [id: string]: true;
639
1075
  };
1076
+ selectedElementsAreBeingDragged: boolean;
640
1077
  shouldCacheIgnoreZoom: boolean;
641
- showHelpDialog: boolean;
642
1078
  toast: {
643
1079
  message: string;
644
1080
  closable?: boolean | undefined;
645
1081
  duration?: number | undefined;
646
1082
  } | null;
647
1083
  zenModeEnabled: boolean;
648
- theme: string;
1084
+ theme: import("../element/types").Theme;
649
1085
  gridSize: number | null;
650
1086
  viewModeEnabled: boolean;
651
1087
  selectedGroupIds: {
@@ -656,8 +1092,6 @@ export declare const actionZoomToFit: {
656
1092
  height: number;
657
1093
  offsetTop: number;
658
1094
  offsetLeft: number;
659
- isLibraryOpen: boolean;
660
- isLibraryMenuDocked: boolean;
661
1095
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
662
1096
  collaborators: Map<string, import("../types").Collaborator>;
663
1097
  showStats: boolean;
@@ -670,8 +1104,14 @@ export declare const actionZoomToFit: {
670
1104
  data: import("../charts").Spreadsheet;
671
1105
  };
672
1106
  pendingImageElementId: string | null;
673
- showHyperlinkPopup: false | "info" | "editor";
1107
+ showHyperlinkPopup: false | "editor" | "info";
674
1108
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1109
+ snapLines: import("../snapping").SnapLine[];
1110
+ originSnapOffset: {
1111
+ x: number;
1112
+ y: number;
1113
+ } | null;
1114
+ objectsSnapModeEnabled: boolean;
675
1115
  };
676
1116
  commitToHistory: boolean;
677
1117
  };
@@ -681,14 +1121,25 @@ export declare const actionZoomToFit: {
681
1121
  };
682
1122
  export declare const actionToggleTheme: {
683
1123
  name: "toggleTheme";
1124
+ viewMode: true;
684
1125
  trackEvent: {
685
1126
  category: "canvas";
686
1127
  };
687
1128
  perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
688
1129
  appState: {
689
1130
  theme: any;
1131
+ contextMenu: {
1132
+ items: import("../components/ContextMenu").ContextMenuItems;
1133
+ top: number;
1134
+ left: number;
1135
+ } | null;
1136
+ showWelcomeScreen: boolean;
690
1137
  isLoading: boolean;
691
- errorMessage: string | null;
1138
+ errorMessage: import("react").ReactNode;
1139
+ activeEmbeddable: {
1140
+ element: import("../element/types").NonDeletedExcalidrawElement;
1141
+ state: "active" | "hover";
1142
+ } | null;
692
1143
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
693
1144
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
694
1145
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -696,19 +1147,27 @@ export declare const actionToggleTheme: {
696
1147
  isBindingEnabled: boolean;
697
1148
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
698
1149
  suggestedBindings: import("../element/binding").SuggestedBinding[];
1150
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1151
+ frameRendering: {
1152
+ enabled: boolean;
1153
+ name: boolean;
1154
+ outline: boolean;
1155
+ clip: boolean;
1156
+ };
1157
+ editingFrame: string | null;
1158
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
699
1159
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
700
1160
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
701
1161
  activeTool: {
702
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
703
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
1162
+ lastActiveTool: import("../types").LastActiveTool;
704
1163
  locked: boolean;
1164
+ } & ({
1165
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
705
1166
  customType: null;
706
1167
  } | {
707
1168
  type: "custom";
708
1169
  customType: string;
709
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
710
- locked: boolean;
711
- };
1170
+ });
712
1171
  penMode: boolean;
713
1172
  penDetected: boolean;
714
1173
  exportBackground: boolean;
@@ -724,11 +1183,10 @@ export declare const actionToggleTheme: {
724
1183
  currentItemOpacity: number;
725
1184
  currentItemFontFamily: number;
726
1185
  currentItemFontSize: number;
727
- currentItemTextAlign: import("../element/types").TextAlign;
728
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
1186
+ currentItemTextAlign: string;
729
1187
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
730
1188
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
731
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
1189
+ currentItemRoundness: import("../element/types").StrokeRoundness;
732
1190
  viewBackgroundColor: string;
733
1191
  scrollX: number;
734
1192
  scrollY: number;
@@ -741,16 +1199,22 @@ export declare const actionToggleTheme: {
741
1199
  value: NormalizedZoomValue;
742
1200
  }>;
743
1201
  openMenu: "canvas" | "shape" | null;
744
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
1202
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1203
+ openSidebar: {
1204
+ name: string;
1205
+ tab?: string | undefined;
1206
+ } | null;
1207
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1208
+ defaultSidebarDockedPreference: boolean;
745
1209
  lastPointerDownWith: import("../element/types").PointerType;
746
- selectedElementIds: {
747
- [id: string]: boolean;
748
- };
1210
+ selectedElementIds: Readonly<{
1211
+ [id: string]: true;
1212
+ }>;
749
1213
  previousSelectedElementIds: {
750
- [id: string]: boolean;
1214
+ [id: string]: true;
751
1215
  };
1216
+ selectedElementsAreBeingDragged: boolean;
752
1217
  shouldCacheIgnoreZoom: boolean;
753
- showHelpDialog: boolean;
754
1218
  toast: {
755
1219
  message: string;
756
1220
  closable?: boolean | undefined;
@@ -767,8 +1231,6 @@ export declare const actionToggleTheme: {
767
1231
  height: number;
768
1232
  offsetTop: number;
769
1233
  offsetLeft: number;
770
- isLibraryOpen: boolean;
771
- isLibraryMenuDocked: boolean;
772
1234
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
773
1235
  collaborators: Map<string, import("../types").Collaborator>;
774
1236
  showStats: boolean;
@@ -781,18 +1243,24 @@ export declare const actionToggleTheme: {
781
1243
  data: import("../charts").Spreadsheet;
782
1244
  };
783
1245
  pendingImageElementId: string | null;
784
- showHyperlinkPopup: false | "info" | "editor";
1246
+ showHyperlinkPopup: false | "editor" | "info";
785
1247
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1248
+ snapLines: import("../snapping").SnapLine[];
1249
+ originSnapOffset: {
1250
+ x: number;
1251
+ y: number;
1252
+ } | null;
1253
+ objectsSnapModeEnabled: boolean;
786
1254
  };
787
1255
  commitToHistory: false;
788
1256
  };
789
- PanelComponent: ({ appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
790
1257
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1258
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
791
1259
  } & {
792
1260
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
793
1261
  };
794
- export declare const actionErase: {
795
- name: "eraser";
1262
+ export declare const actionToggleEraserTool: {
1263
+ name: "toggleEraserTool";
796
1264
  trackEvent: {
797
1265
  category: "toolbar";
798
1266
  };
@@ -800,19 +1268,156 @@ export declare const actionErase: {
800
1268
  appState: {
801
1269
  selectedElementIds: {};
802
1270
  selectedGroupIds: {};
1271
+ activeEmbeddable: null;
803
1272
  activeTool: {
804
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
805
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
1273
+ lastActiveTool: import("../types").LastActiveTool;
806
1274
  locked: boolean;
1275
+ } & ({
1276
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
807
1277
  customType: null;
808
1278
  } | {
809
1279
  type: "custom";
810
1280
  customType: string;
811
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
812
- locked: boolean;
1281
+ });
1282
+ contextMenu: {
1283
+ items: import("../components/ContextMenu").ContextMenuItems;
1284
+ top: number;
1285
+ left: number;
1286
+ } | null;
1287
+ showWelcomeScreen: boolean;
1288
+ isLoading: boolean;
1289
+ errorMessage: import("react").ReactNode;
1290
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1291
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1292
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
1293
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
1294
+ isBindingEnabled: boolean;
1295
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
1296
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
1297
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1298
+ frameRendering: {
1299
+ enabled: boolean;
1300
+ name: boolean;
1301
+ outline: boolean;
1302
+ clip: boolean;
1303
+ };
1304
+ editingFrame: string | null;
1305
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
1306
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1307
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1308
+ penMode: boolean;
1309
+ penDetected: boolean;
1310
+ exportBackground: boolean;
1311
+ exportEmbedScene: boolean;
1312
+ exportWithDarkMode: boolean;
1313
+ exportScale: number;
1314
+ currentItemStrokeColor: string;
1315
+ currentItemBackgroundColor: string;
1316
+ currentItemFillStyle: import("../element/types").FillStyle;
1317
+ currentItemStrokeWidth: number;
1318
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
1319
+ currentItemRoughness: number;
1320
+ currentItemOpacity: number;
1321
+ currentItemFontFamily: number;
1322
+ currentItemFontSize: number;
1323
+ currentItemTextAlign: string;
1324
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
1325
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
1326
+ currentItemRoundness: import("../element/types").StrokeRoundness;
1327
+ viewBackgroundColor: string;
1328
+ scrollX: number;
1329
+ scrollY: number;
1330
+ cursorButton: "up" | "down";
1331
+ scrolledOutside: boolean;
1332
+ name: string;
1333
+ isResizing: boolean;
1334
+ isRotating: boolean;
1335
+ zoom: Readonly<{
1336
+ value: NormalizedZoomValue;
1337
+ }>;
1338
+ openMenu: "canvas" | "shape" | null;
1339
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1340
+ openSidebar: {
1341
+ name: string;
1342
+ tab?: string | undefined;
1343
+ } | null;
1344
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1345
+ defaultSidebarDockedPreference: boolean;
1346
+ lastPointerDownWith: import("../element/types").PointerType;
1347
+ previousSelectedElementIds: {
1348
+ [id: string]: true;
1349
+ };
1350
+ selectedElementsAreBeingDragged: boolean;
1351
+ shouldCacheIgnoreZoom: boolean;
1352
+ toast: {
1353
+ message: string;
1354
+ closable?: boolean | undefined;
1355
+ duration?: number | undefined;
1356
+ } | null;
1357
+ zenModeEnabled: boolean;
1358
+ theme: import("../element/types").Theme;
1359
+ gridSize: number | null;
1360
+ viewModeEnabled: boolean;
1361
+ editingGroupId: string | null;
1362
+ width: number;
1363
+ height: number;
1364
+ offsetTop: number;
1365
+ offsetLeft: number;
1366
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
1367
+ collaborators: Map<string, import("../types").Collaborator>;
1368
+ showStats: boolean;
1369
+ currentChartType: import("../element/types").ChartType;
1370
+ pasteDialog: {
1371
+ shown: false;
1372
+ data: null;
1373
+ } | {
1374
+ shown: true;
1375
+ data: import("../charts").Spreadsheet;
813
1376
  };
1377
+ pendingImageElementId: string | null;
1378
+ showHyperlinkPopup: false | "editor" | "info";
1379
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1380
+ snapLines: import("../snapping").SnapLine[];
1381
+ originSnapOffset: {
1382
+ x: number;
1383
+ y: number;
1384
+ } | null;
1385
+ objectsSnapModeEnabled: boolean;
1386
+ };
1387
+ commitToHistory: true;
1388
+ };
1389
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1390
+ } & {
1391
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1392
+ };
1393
+ export declare const actionToggleHandTool: {
1394
+ name: "toggleHandTool";
1395
+ trackEvent: {
1396
+ category: "toolbar";
1397
+ };
1398
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
1399
+ appState: {
1400
+ selectedElementIds: {};
1401
+ selectedGroupIds: {};
1402
+ activeEmbeddable: null;
1403
+ activeTool: {
1404
+ lastActiveTool: import("../types").LastActiveTool;
1405
+ locked: boolean;
1406
+ } & ({
1407
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
1408
+ customType: null;
1409
+ } | {
1410
+ type: "custom";
1411
+ customType: string;
1412
+ });
1413
+ contextMenu: {
1414
+ items: import("../components/ContextMenu").ContextMenuItems;
1415
+ top: number;
1416
+ left: number;
1417
+ } | null;
1418
+ showWelcomeScreen: boolean;
814
1419
  isLoading: boolean;
815
- errorMessage: string | null;
1420
+ errorMessage: import("react").ReactNode;
816
1421
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
817
1422
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
818
1423
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -820,6 +1425,15 @@ export declare const actionErase: {
820
1425
  isBindingEnabled: boolean;
821
1426
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
822
1427
  suggestedBindings: import("../element/binding").SuggestedBinding[];
1428
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
1429
+ frameRendering: {
1430
+ enabled: boolean;
1431
+ name: boolean;
1432
+ outline: boolean;
1433
+ clip: boolean;
1434
+ };
1435
+ editingFrame: string | null;
1436
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
823
1437
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
824
1438
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
825
1439
  penMode: boolean;
@@ -837,11 +1451,10 @@ export declare const actionErase: {
837
1451
  currentItemOpacity: number;
838
1452
  currentItemFontFamily: number;
839
1453
  currentItemFontSize: number;
840
- currentItemTextAlign: import("../element/types").TextAlign;
841
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
1454
+ currentItemTextAlign: string;
842
1455
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
843
1456
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
844
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
1457
+ currentItemRoundness: import("../element/types").StrokeRoundness;
845
1458
  viewBackgroundColor: string;
846
1459
  scrollX: number;
847
1460
  scrollY: number;
@@ -854,20 +1467,26 @@ export declare const actionErase: {
854
1467
  value: NormalizedZoomValue;
855
1468
  }>;
856
1469
  openMenu: "canvas" | "shape" | null;
857
- openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
1470
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
1471
+ openSidebar: {
1472
+ name: string;
1473
+ tab?: string | undefined;
1474
+ } | null;
1475
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1476
+ defaultSidebarDockedPreference: boolean;
858
1477
  lastPointerDownWith: import("../element/types").PointerType;
859
1478
  previousSelectedElementIds: {
860
- [id: string]: boolean;
1479
+ [id: string]: true;
861
1480
  };
1481
+ selectedElementsAreBeingDragged: boolean;
862
1482
  shouldCacheIgnoreZoom: boolean;
863
- showHelpDialog: boolean;
864
1483
  toast: {
865
1484
  message: string;
866
1485
  closable?: boolean | undefined;
867
1486
  duration?: number | undefined;
868
1487
  } | null;
869
1488
  zenModeEnabled: boolean;
870
- theme: string;
1489
+ theme: import("../element/types").Theme;
871
1490
  gridSize: number | null;
872
1491
  viewModeEnabled: boolean;
873
1492
  editingGroupId: string | null;
@@ -875,8 +1494,6 @@ export declare const actionErase: {
875
1494
  height: number;
876
1495
  offsetTop: number;
877
1496
  offsetLeft: number;
878
- isLibraryOpen: boolean;
879
- isLibraryMenuDocked: boolean;
880
1497
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
881
1498
  collaborators: Map<string, import("../types").Collaborator>;
882
1499
  showStats: boolean;
@@ -889,13 +1506,18 @@ export declare const actionErase: {
889
1506
  data: import("../charts").Spreadsheet;
890
1507
  };
891
1508
  pendingImageElementId: string | null;
892
- showHyperlinkPopup: false | "info" | "editor";
1509
+ showHyperlinkPopup: false | "editor" | "info";
893
1510
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1511
+ snapLines: import("../snapping").SnapLine[];
1512
+ originSnapOffset: {
1513
+ x: number;
1514
+ y: number;
1515
+ } | null;
1516
+ objectsSnapModeEnabled: boolean;
894
1517
  };
895
1518
  commitToHistory: true;
896
1519
  };
897
1520
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
898
- PanelComponent: ({ elements, appState, updateData, data }: import("./types").PanelComponentProps) => JSX.Element;
899
1521
  } & {
900
1522
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
901
1523
  };