@dwelle/excalidraw 0.4.0-d411eb2 → 0.4.0-d4bae3f

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