@dwelle/excalidraw 0.4.0-9db4535 → 0.4.0-9fa56da

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 (143) hide show
  1. package/CHANGELOG.md +255 -1
  2. package/README.md +4 -0
  3. package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js → vendor-d415b28e9024dee4bb1b.js} +2 -2
  4. package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
  5. package/dist/excalidraw.development.js +2123 -1783
  6. package/dist/excalidraw.production.min.js +1 -1
  7. package/package.json +7 -2
  8. package/types/actions/actionAddToLibrary.d.ts +84 -43
  9. package/types/actions/actionAlign.d.ts +33 -28
  10. package/types/actions/actionBoundText.d.ts +60 -32
  11. package/types/actions/actionCanvas.d.ts +436 -164
  12. package/types/actions/actionClipboard.d.ts +140 -74
  13. package/types/actions/actionDeleteSelected.d.ts +80 -42
  14. package/types/actions/actionDistribute.d.ts +11 -12
  15. package/types/actions/actionDuplicateSelection.d.ts +2 -3
  16. package/types/actions/actionElementLock.d.ts +58 -30
  17. package/types/actions/actionExport.d.ts +303 -177
  18. package/types/actions/actionFinalize.d.ts +56 -32
  19. package/types/actions/actionFlip.d.ts +8 -9
  20. package/types/actions/actionFrame.d.ts +423 -0
  21. package/types/actions/actionGroup.d.ts +250 -13
  22. package/types/actions/actionLinearEditor.d.ts +30 -17
  23. package/types/actions/actionMenu.d.ts +87 -47
  24. package/types/actions/actionNavigate.d.ts +1 -1
  25. package/types/actions/actionProperties.d.ts +370 -187
  26. package/types/actions/actionSelectAll.d.ts +123 -4
  27. package/types/actions/actionStyles.d.ts +32 -19
  28. package/types/actions/actionToggleGridMode.d.ts +30 -17
  29. package/types/actions/actionToggleObjectsSnapMode.d.ts +137 -0
  30. package/types/actions/actionToggleStats.d.ts +30 -17
  31. package/types/actions/actionToggleViewMode.d.ts +30 -17
  32. package/types/actions/actionToggleZenMode.d.ts +30 -17
  33. package/types/actions/actionZindex.d.ts +12 -12
  34. package/types/actions/index.d.ts +1 -0
  35. package/types/actions/shortcuts.d.ts +1 -1
  36. package/types/actions/types.d.ts +4 -3
  37. package/types/appState.d.ts +10 -15
  38. package/types/clients.d.ts +1 -5
  39. package/types/clipboard.d.ts +1 -0
  40. package/types/colors.d.ts +9 -9
  41. package/types/components/Actions.d.ts +4 -5
  42. package/types/components/App.d.ts +61 -28
  43. package/types/components/Avatar.d.ts +0 -1
  44. package/types/components/Button.d.ts +0 -1
  45. package/types/components/Card.d.ts +0 -1
  46. package/types/components/ColorPicker/ColorInput.d.ts +3 -1
  47. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  48. package/types/components/DefaultSidebar.d.ts +0 -1
  49. package/types/components/Dialog.d.ts +2 -1
  50. package/types/components/ExcalidrawLogo.d.ts +15 -0
  51. package/types/components/EyeDropper.d.ts +18 -8
  52. package/types/components/FilledButton.d.ts +2 -1
  53. package/types/components/HintViewer.d.ts +3 -4
  54. package/types/components/JSONExportDialog.d.ts +1 -1
  55. package/types/components/LaserTool/LaserPathManager.d.ts +28 -0
  56. package/types/components/LaserTool/LaserPointerButton.d.ts +10 -0
  57. package/types/components/LaserTool/LaserTool.d.ts +7 -0
  58. package/types/components/LayerUI.d.ts +6 -2
  59. package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
  60. package/types/components/LibraryUnit.d.ts +0 -1
  61. package/types/components/LoadingMessage.d.ts +0 -1
  62. package/types/components/MobileMenu.d.ts +4 -3
  63. package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
  64. package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
  65. package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
  66. package/types/components/Section.d.ts +1 -1
  67. package/types/components/Sidebar/Sidebar.d.ts +1 -1
  68. package/types/components/Sidebar/SidebarTab.d.ts +0 -1
  69. package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
  70. package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
  71. package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
  72. package/types/components/Stack.d.ts +2 -2
  73. package/types/components/ToolButton.d.ts +2 -1
  74. package/types/components/Trans.d.ts +2 -1
  75. package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
  76. package/types/components/canvases/StaticCanvas.d.ts +18 -0
  77. package/types/components/canvases/index.d.ts +3 -0
  78. package/types/components/dropdownMenu/DropdownMenu.d.ts +9 -5
  79. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +2 -1
  80. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -1
  81. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +2 -1
  82. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -2
  83. package/types/components/dropdownMenu/common.d.ts +1 -1
  84. package/types/components/icons.d.ts +6 -0
  85. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
  86. package/types/components/main-menu/MainMenu.d.ts +9 -5
  87. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
  88. package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
  89. package/types/constants.d.ts +35 -3
  90. package/types/context/tunnels.d.ts +1 -0
  91. package/types/data/transform.d.ts +71 -0
  92. package/types/data/url.d.ts +7 -0
  93. package/types/element/Hyperlink.d.ts +40 -23
  94. package/types/element/binding.d.ts +2 -1
  95. package/types/element/bounds.d.ts +30 -6
  96. package/types/element/collision.d.ts +7 -7
  97. package/types/element/dragElements.d.ts +12 -2
  98. package/types/element/embeddable.d.ts +153 -0
  99. package/types/element/index.d.ts +3 -2
  100. package/types/element/linearElementEditor.d.ts +33 -20
  101. package/types/element/newElement.d.ts +15 -6
  102. package/types/element/resizeElements.d.ts +2 -2
  103. package/types/element/sizeHelpers.d.ts +8 -1
  104. package/types/element/textElement.d.ts +5 -7
  105. package/types/element/textWysiwyg.d.ts +1 -1
  106. package/types/element/transformHandles.d.ts +10 -3
  107. package/types/element/typeChecks.d.ts +3 -1
  108. package/types/element/types.d.ts +19 -3
  109. package/types/frame.d.ts +40 -0
  110. package/types/groups.d.ts +15 -11
  111. package/types/history.d.ts +3 -3
  112. package/types/hooks/useOutsideClick.d.ts +0 -1
  113. package/types/hooks/useScrollPosition.d.ts +0 -1
  114. package/types/hooks/useStable.d.ts +1 -0
  115. package/types/i18n.d.ts +5 -2
  116. package/types/keys.d.ts +4 -0
  117. package/types/math.d.ts +3 -0
  118. package/types/packages/excalidraw/example/initialData.d.ts +182 -64
  119. package/types/packages/excalidraw/index.d.ts +3 -1
  120. package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
  121. package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
  122. package/types/packages/utils.d.ts +4 -1
  123. package/types/renderer/renderElement.d.ts +11 -22
  124. package/types/renderer/renderScene.d.ts +19 -27
  125. package/types/renderer/renderSnaps.d.ts +2 -0
  126. package/types/renderer/roundRect.d.ts +1 -1
  127. package/types/scene/Renderer.d.ts +25 -0
  128. package/types/scene/Scene.d.ts +23 -1
  129. package/types/scene/Shape.d.ts +12 -0
  130. package/types/scene/ShapeCache.d.ts +20 -0
  131. package/types/scene/export.d.ts +35 -9
  132. package/types/scene/scroll.d.ts +1 -1
  133. package/types/scene/scrollbars.d.ts +2 -6
  134. package/types/scene/selection.d.ts +26 -5
  135. package/types/scene/types.d.ts +66 -31
  136. package/types/snapping.d.ts +108 -0
  137. package/types/types.d.ts +130 -25
  138. package/types/utility-types.d.ts +3 -1
  139. package/types/utils.d.ts +60 -23
  140. package/types/zindex.d.ts +4 -4
  141. /package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
  142. /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
  143. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
@@ -1,45 +1,282 @@
1
- /// <reference types="react" />
2
- import { ExcalidrawElement } from "../element/types";
3
- import { AppState } from "../types";
1
+ import { ExcalidrawElement, ExcalidrawFrameElement } from "../element/types";
2
+ import { AppClassProperties, AppState } from "../types";
4
3
  export declare const actionGroup: {
5
4
  name: "group";
6
5
  trackEvent: {
7
6
  category: "element";
8
7
  };
9
- perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
8
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: AppClassProperties) => {
10
9
  appState: Readonly<AppState>;
11
10
  elements: readonly ExcalidrawElement[];
12
11
  commitToHistory: false;
13
12
  } | {
14
- appState: AppState;
13
+ appState: {
14
+ selectedElementIds: Readonly<{
15
+ [id: string]: true;
16
+ }>;
17
+ selectedGroupIds: {
18
+ [groupId: string]: boolean;
19
+ };
20
+ editingGroupId: string | null;
21
+ contextMenu: {
22
+ items: import("../components/ContextMenu").ContextMenuItems;
23
+ top: number;
24
+ left: number;
25
+ } | null;
26
+ showWelcomeScreen: boolean;
27
+ isLoading: boolean;
28
+ errorMessage: import("react").ReactNode;
29
+ activeEmbeddable: {
30
+ element: import("../element/types").NonDeletedExcalidrawElement;
31
+ state: "active" | "hover";
32
+ } | null;
33
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
34
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
35
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
36
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
37
+ isBindingEnabled: boolean;
38
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
39
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
40
+ frameToHighlight: import("../element/types").NonDeleted<ExcalidrawFrameElement> | null;
41
+ frameRendering: {
42
+ enabled: boolean;
43
+ name: boolean;
44
+ outline: boolean;
45
+ clip: boolean;
46
+ };
47
+ editingFrame: string | null;
48
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
49
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
50
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
51
+ activeTool: {
52
+ lastActiveTool: import("../types").ActiveTool | null;
53
+ locked: boolean;
54
+ } & import("../types").ActiveTool;
55
+ penMode: boolean;
56
+ penDetected: boolean;
57
+ exportBackground: boolean;
58
+ exportEmbedScene: boolean;
59
+ exportWithDarkMode: boolean;
60
+ exportScale: number;
61
+ currentItemStrokeColor: string;
62
+ currentItemBackgroundColor: string;
63
+ currentItemFillStyle: import("../element/types").FillStyle;
64
+ currentItemStrokeWidth: number;
65
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
66
+ currentItemRoughness: number;
67
+ currentItemOpacity: number;
68
+ currentItemFontFamily: number;
69
+ currentItemFontSize: number;
70
+ currentItemTextAlign: string;
71
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
72
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
73
+ currentItemRoundness: import("../element/types").StrokeRoundness;
74
+ viewBackgroundColor: string;
75
+ scrollX: number;
76
+ scrollY: number;
77
+ cursorButton: "up" | "down";
78
+ scrolledOutside: boolean;
79
+ name: string;
80
+ isResizing: boolean;
81
+ isRotating: boolean;
82
+ zoom: Readonly<{
83
+ value: import("../types").NormalizedZoomValue;
84
+ }>;
85
+ openMenu: "canvas" | "shape" | null;
86
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
87
+ openSidebar: {
88
+ name: string;
89
+ tab?: string | undefined;
90
+ } | null;
91
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
92
+ defaultSidebarDockedPreference: boolean;
93
+ lastPointerDownWith: import("../element/types").PointerType;
94
+ previousSelectedElementIds: {
95
+ [id: string]: true;
96
+ };
97
+ selectedElementsAreBeingDragged: boolean;
98
+ shouldCacheIgnoreZoom: boolean;
99
+ toast: {
100
+ message: string;
101
+ closable?: boolean | undefined;
102
+ duration?: number | undefined;
103
+ } | null;
104
+ zenModeEnabled: boolean;
105
+ theme: import("../element/types").Theme;
106
+ gridSize: number | null;
107
+ viewModeEnabled: boolean;
108
+ width: number;
109
+ height: number;
110
+ offsetTop: number;
111
+ offsetLeft: number;
112
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
113
+ collaborators: Map<string, import("../types").Collaborator>;
114
+ showStats: boolean;
115
+ currentChartType: import("../element/types").ChartType;
116
+ pasteDialog: {
117
+ shown: false;
118
+ data: null;
119
+ } | {
120
+ shown: true;
121
+ data: import("../charts").Spreadsheet;
122
+ };
123
+ pendingImageElementId: string | null;
124
+ showHyperlinkPopup: false | "editor" | "info";
125
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
126
+ snapLines: readonly import("../snapping").SnapLine[];
127
+ originSnapOffset: {
128
+ x: number;
129
+ y: number;
130
+ } | null;
131
+ objectsSnapModeEnabled: boolean;
132
+ };
15
133
  elements: ExcalidrawElement[];
16
134
  commitToHistory: true;
17
135
  };
18
136
  contextItemLabel: string;
19
- predicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
20
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
21
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
137
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
138
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
139
+ PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => JSX.Element;
22
140
  } & {
23
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
141
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
24
142
  };
25
143
  export declare const actionUngroup: {
26
144
  name: "ungroup";
27
145
  trackEvent: {
28
146
  category: "element";
29
147
  };
30
- perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => {
148
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: AppClassProperties) => {
31
149
  appState: Readonly<AppState>;
32
150
  elements: readonly ExcalidrawElement[];
33
151
  commitToHistory: false;
34
152
  } | {
35
- appState: AppState;
153
+ appState: {
154
+ selectedElementIds: Readonly<{
155
+ [id: string]: true;
156
+ }>;
157
+ selectedGroupIds: {
158
+ [groupId: string]: boolean;
159
+ };
160
+ editingGroupId: string | null;
161
+ contextMenu: {
162
+ items: import("../components/ContextMenu").ContextMenuItems;
163
+ top: number;
164
+ left: number;
165
+ } | null;
166
+ showWelcomeScreen: boolean;
167
+ isLoading: boolean;
168
+ errorMessage: import("react").ReactNode;
169
+ activeEmbeddable: {
170
+ element: import("../element/types").NonDeletedExcalidrawElement;
171
+ state: "active" | "hover";
172
+ } | null;
173
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
174
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
175
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
176
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
177
+ isBindingEnabled: boolean;
178
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
179
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
180
+ frameToHighlight: import("../element/types").NonDeleted<ExcalidrawFrameElement> | null;
181
+ frameRendering: {
182
+ enabled: boolean;
183
+ name: boolean;
184
+ outline: boolean;
185
+ clip: boolean;
186
+ };
187
+ editingFrame: string | null;
188
+ elementsToHighlight: import("../element/types").NonDeleted<ExcalidrawElement>[] | null;
189
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
190
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
191
+ activeTool: {
192
+ lastActiveTool: import("../types").ActiveTool | null;
193
+ locked: boolean;
194
+ } & import("../types").ActiveTool;
195
+ penMode: boolean;
196
+ penDetected: boolean;
197
+ exportBackground: boolean;
198
+ exportEmbedScene: boolean;
199
+ exportWithDarkMode: boolean;
200
+ exportScale: number;
201
+ currentItemStrokeColor: string;
202
+ currentItemBackgroundColor: string;
203
+ currentItemFillStyle: import("../element/types").FillStyle;
204
+ currentItemStrokeWidth: number;
205
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
206
+ currentItemRoughness: number;
207
+ currentItemOpacity: number;
208
+ currentItemFontFamily: number;
209
+ currentItemFontSize: number;
210
+ currentItemTextAlign: string;
211
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
212
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
213
+ currentItemRoundness: import("../element/types").StrokeRoundness;
214
+ viewBackgroundColor: string;
215
+ scrollX: number;
216
+ scrollY: number;
217
+ cursorButton: "up" | "down";
218
+ scrolledOutside: boolean;
219
+ name: string;
220
+ isResizing: boolean;
221
+ isRotating: boolean;
222
+ zoom: Readonly<{
223
+ value: import("../types").NormalizedZoomValue;
224
+ }>;
225
+ openMenu: "canvas" | "shape" | null;
226
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
227
+ openSidebar: {
228
+ name: string;
229
+ tab?: string | undefined;
230
+ } | null;
231
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
232
+ defaultSidebarDockedPreference: boolean;
233
+ lastPointerDownWith: import("../element/types").PointerType;
234
+ previousSelectedElementIds: {
235
+ [id: string]: true;
236
+ };
237
+ selectedElementsAreBeingDragged: boolean;
238
+ shouldCacheIgnoreZoom: boolean;
239
+ toast: {
240
+ message: string;
241
+ closable?: boolean | undefined;
242
+ duration?: number | undefined;
243
+ } | null;
244
+ zenModeEnabled: boolean;
245
+ theme: import("../element/types").Theme;
246
+ gridSize: number | null;
247
+ viewModeEnabled: boolean;
248
+ width: number;
249
+ height: number;
250
+ offsetTop: number;
251
+ offsetLeft: number;
252
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
253
+ collaborators: Map<string, import("../types").Collaborator>;
254
+ showStats: boolean;
255
+ currentChartType: import("../element/types").ChartType;
256
+ pasteDialog: {
257
+ shown: false;
258
+ data: null;
259
+ } | {
260
+ shown: true;
261
+ data: import("../charts").Spreadsheet;
262
+ };
263
+ pendingImageElementId: string | null;
264
+ showHyperlinkPopup: false | "editor" | "info";
265
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
266
+ snapLines: readonly import("../snapping").SnapLine[];
267
+ originSnapOffset: {
268
+ x: number;
269
+ y: number;
270
+ } | null;
271
+ objectsSnapModeEnabled: boolean;
272
+ };
36
273
  elements: ExcalidrawElement[];
37
274
  commitToHistory: true;
38
275
  };
39
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
276
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
40
277
  contextItemLabel: string;
41
278
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
42
279
  PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
43
280
  } & {
44
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
281
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
45
282
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LinearElementEditor } from "../element/linearElementEditor";
3
2
  import { ExcalidrawLinearElement } from "../element/types";
4
3
  export declare const actionToggleLinearEditor: {
@@ -6,7 +5,7 @@ export declare const actionToggleLinearEditor: {
6
5
  trackEvent: {
7
6
  category: "element";
8
7
  };
9
- predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState) => boolean;
8
+ predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
10
9
  perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties): {
11
10
  appState: {
12
11
  editingLinearElement: LinearElementEditor | null;
@@ -18,6 +17,10 @@ export declare const actionToggleLinearEditor: {
18
17
  showWelcomeScreen: boolean;
19
18
  isLoading: boolean;
20
19
  errorMessage: import("react").ReactNode;
20
+ activeEmbeddable: {
21
+ element: import("../element/types").NonDeletedExcalidrawElement;
22
+ state: "active" | "hover";
23
+ } | null;
21
24
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
22
25
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
23
26
  multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
@@ -25,17 +28,20 @@ export declare const actionToggleLinearEditor: {
25
28
  isBindingEnabled: boolean;
26
29
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
27
30
  suggestedBindings: import("../element/binding").SuggestedBinding[];
31
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
32
+ frameRendering: {
33
+ enabled: boolean;
34
+ name: boolean;
35
+ outline: boolean;
36
+ clip: boolean;
37
+ };
38
+ editingFrame: string | null;
39
+ elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
28
40
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
29
41
  activeTool: {
30
- lastActiveTool: import("../types").LastActiveTool;
42
+ lastActiveTool: import("../types").ActiveTool | null;
31
43
  locked: boolean;
32
- } & ({
33
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
34
- customType: null;
35
- } | {
36
- type: "custom";
37
- customType: string;
38
- });
44
+ } & import("../types").ActiveTool;
39
45
  penMode: boolean;
40
46
  penDetected: boolean;
41
47
  exportBackground: boolean;
@@ -75,12 +81,13 @@ export declare const actionToggleLinearEditor: {
75
81
  openDialog: "imageExport" | "help" | "jsonExport" | null;
76
82
  defaultSidebarDockedPreference: boolean;
77
83
  lastPointerDownWith: import("../element/types").PointerType;
78
- selectedElementIds: {
79
- [id: string]: boolean;
80
- };
84
+ selectedElementIds: Readonly<{
85
+ [id: string]: true;
86
+ }>;
81
87
  previousSelectedElementIds: {
82
- [id: string]: boolean;
88
+ [id: string]: true;
83
89
  };
90
+ selectedElementsAreBeingDragged: boolean;
84
91
  shouldCacheIgnoreZoom: boolean;
85
92
  toast: {
86
93
  message: string;
@@ -88,7 +95,7 @@ export declare const actionToggleLinearEditor: {
88
95
  duration?: number | undefined;
89
96
  } | null;
90
97
  zenModeEnabled: boolean;
91
- theme: string;
98
+ theme: import("../element/types").Theme;
92
99
  gridSize: number | null;
93
100
  viewModeEnabled: boolean;
94
101
  selectedGroupIds: {
@@ -111,12 +118,18 @@ export declare const actionToggleLinearEditor: {
111
118
  data: import("../charts").Spreadsheet;
112
119
  };
113
120
  pendingImageElementId: string | null;
114
- showHyperlinkPopup: false | "info" | "editor";
121
+ showHyperlinkPopup: false | "editor" | "info";
115
122
  selectedLinearElement: LinearElementEditor | null;
123
+ snapLines: readonly import("../snapping").SnapLine[];
124
+ originSnapOffset: {
125
+ x: number;
126
+ y: number;
127
+ } | null;
128
+ objectsSnapModeEnabled: boolean;
116
129
  };
117
130
  commitToHistory: false;
118
131
  };
119
- contextItemLabel: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => "labels.lineEditor.exit" | "labels.lineEditor.edit";
132
+ contextItemLabel: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, app: import("../types").AppClassProperties) => "labels.lineEditor.exit" | "labels.lineEditor.edit";
120
133
  } & {
121
134
  keyTest?: undefined;
122
135
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleCanvasMenu: {
3
2
  name: "toggleCanvasMenu";
4
3
  trackEvent: {
@@ -15,6 +14,10 @@ export declare const actionToggleCanvasMenu: {
15
14
  showWelcomeScreen: boolean;
16
15
  isLoading: boolean;
17
16
  errorMessage: import("react").ReactNode;
17
+ activeEmbeddable: {
18
+ element: import("../element/types").NonDeletedExcalidrawElement;
19
+ state: "active" | "hover";
20
+ } | null;
18
21
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
19
22
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
20
23
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -22,18 +25,21 @@ export declare const actionToggleCanvasMenu: {
22
25
  isBindingEnabled: boolean;
23
26
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
24
27
  suggestedBindings: import("../element/binding").SuggestedBinding[];
28
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
29
+ frameRendering: {
30
+ enabled: boolean;
31
+ name: boolean;
32
+ outline: boolean;
33
+ clip: boolean;
34
+ };
35
+ editingFrame: string | null;
36
+ elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
25
37
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
26
38
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
27
39
  activeTool: {
28
- lastActiveTool: import("../types").LastActiveTool;
40
+ lastActiveTool: import("../types").ActiveTool | null;
29
41
  locked: boolean;
30
- } & ({
31
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
32
- customType: null;
33
- } | {
34
- type: "custom";
35
- customType: string;
36
- });
42
+ } & import("../types").ActiveTool;
37
43
  penMode: boolean;
38
44
  penDetected: boolean;
39
45
  exportBackground: boolean;
@@ -72,12 +78,13 @@ export declare const actionToggleCanvasMenu: {
72
78
  openDialog: "imageExport" | "help" | "jsonExport" | null;
73
79
  defaultSidebarDockedPreference: boolean;
74
80
  lastPointerDownWith: import("../element/types").PointerType;
75
- selectedElementIds: {
76
- [id: string]: boolean;
77
- };
81
+ selectedElementIds: Readonly<{
82
+ [id: string]: true;
83
+ }>;
78
84
  previousSelectedElementIds: {
79
- [id: string]: boolean;
85
+ [id: string]: true;
80
86
  };
87
+ selectedElementsAreBeingDragged: boolean;
81
88
  shouldCacheIgnoreZoom: boolean;
82
89
  toast: {
83
90
  message: string;
@@ -85,7 +92,7 @@ export declare const actionToggleCanvasMenu: {
85
92
  duration?: number | undefined;
86
93
  } | null;
87
94
  zenModeEnabled: boolean;
88
- theme: string;
95
+ theme: import("../element/types").Theme;
89
96
  gridSize: number | null;
90
97
  viewModeEnabled: boolean;
91
98
  selectedGroupIds: {
@@ -108,8 +115,14 @@ export declare const actionToggleCanvasMenu: {
108
115
  data: import("../charts").Spreadsheet;
109
116
  };
110
117
  pendingImageElementId: string | null;
111
- showHyperlinkPopup: false | "info" | "editor";
118
+ showHyperlinkPopup: false | "editor" | "info";
112
119
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
120
+ snapLines: readonly import("../snapping").SnapLine[];
121
+ originSnapOffset: {
122
+ x: number;
123
+ y: number;
124
+ } | null;
125
+ objectsSnapModeEnabled: boolean;
113
126
  };
114
127
  commitToHistory: false;
115
128
  };
@@ -133,6 +146,10 @@ export declare const actionToggleEditMenu: {
133
146
  showWelcomeScreen: boolean;
134
147
  isLoading: boolean;
135
148
  errorMessage: import("react").ReactNode;
149
+ activeEmbeddable: {
150
+ element: import("../element/types").NonDeletedExcalidrawElement;
151
+ state: "active" | "hover";
152
+ } | null;
136
153
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
137
154
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
138
155
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -140,18 +157,21 @@ export declare const actionToggleEditMenu: {
140
157
  isBindingEnabled: boolean;
141
158
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
142
159
  suggestedBindings: import("../element/binding").SuggestedBinding[];
160
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
161
+ frameRendering: {
162
+ enabled: boolean;
163
+ name: boolean;
164
+ outline: boolean;
165
+ clip: boolean;
166
+ };
167
+ editingFrame: string | null;
168
+ elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
143
169
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
144
170
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
145
171
  activeTool: {
146
- lastActiveTool: import("../types").LastActiveTool;
172
+ lastActiveTool: import("../types").ActiveTool | null;
147
173
  locked: boolean;
148
- } & ({
149
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
150
- customType: null;
151
- } | {
152
- type: "custom";
153
- customType: string;
154
- });
174
+ } & import("../types").ActiveTool;
155
175
  penMode: boolean;
156
176
  penDetected: boolean;
157
177
  exportBackground: boolean;
@@ -190,12 +210,13 @@ export declare const actionToggleEditMenu: {
190
210
  openDialog: "imageExport" | "help" | "jsonExport" | null;
191
211
  defaultSidebarDockedPreference: boolean;
192
212
  lastPointerDownWith: import("../element/types").PointerType;
193
- selectedElementIds: {
194
- [id: string]: boolean;
195
- };
213
+ selectedElementIds: Readonly<{
214
+ [id: string]: true;
215
+ }>;
196
216
  previousSelectedElementIds: {
197
- [id: string]: boolean;
217
+ [id: string]: true;
198
218
  };
219
+ selectedElementsAreBeingDragged: boolean;
199
220
  shouldCacheIgnoreZoom: boolean;
200
221
  toast: {
201
222
  message: string;
@@ -203,7 +224,7 @@ export declare const actionToggleEditMenu: {
203
224
  duration?: number | undefined;
204
225
  } | null;
205
226
  zenModeEnabled: boolean;
206
- theme: string;
227
+ theme: import("../element/types").Theme;
207
228
  gridSize: number | null;
208
229
  viewModeEnabled: boolean;
209
230
  selectedGroupIds: {
@@ -226,8 +247,14 @@ export declare const actionToggleEditMenu: {
226
247
  data: import("../charts").Spreadsheet;
227
248
  };
228
249
  pendingImageElementId: string | null;
229
- showHyperlinkPopup: false | "info" | "editor";
250
+ showHyperlinkPopup: false | "editor" | "info";
230
251
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
252
+ snapLines: readonly import("../snapping").SnapLine[];
253
+ originSnapOffset: {
254
+ x: number;
255
+ y: number;
256
+ } | null;
257
+ objectsSnapModeEnabled: boolean;
231
258
  };
232
259
  commitToHistory: false;
233
260
  };
@@ -245,9 +272,8 @@ export declare const actionFullScreen: {
245
272
  perform: () => {
246
273
  commitToHistory: false;
247
274
  };
248
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
249
275
  } & {
250
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
276
+ keyTest?: undefined;
251
277
  };
252
278
  export declare const actionShortcuts: {
253
279
  name: "toggleShortcuts";
@@ -267,6 +293,10 @@ export declare const actionShortcuts: {
267
293
  showWelcomeScreen: boolean;
268
294
  isLoading: boolean;
269
295
  errorMessage: import("react").ReactNode;
296
+ activeEmbeddable: {
297
+ element: import("../element/types").NonDeletedExcalidrawElement;
298
+ state: "active" | "hover";
299
+ } | null;
270
300
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
271
301
  resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
272
302
  multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
@@ -274,18 +304,21 @@ export declare const actionShortcuts: {
274
304
  isBindingEnabled: boolean;
275
305
  startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
276
306
  suggestedBindings: import("../element/binding").SuggestedBinding[];
307
+ frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
308
+ frameRendering: {
309
+ enabled: boolean;
310
+ name: boolean;
311
+ outline: boolean;
312
+ clip: boolean;
313
+ };
314
+ editingFrame: string | null;
315
+ elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
277
316
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
278
317
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
279
318
  activeTool: {
280
- lastActiveTool: import("../types").LastActiveTool;
319
+ lastActiveTool: import("../types").ActiveTool | null;
281
320
  locked: boolean;
282
- } & ({
283
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
284
- customType: null;
285
- } | {
286
- type: "custom";
287
- customType: string;
288
- });
321
+ } & import("../types").ActiveTool;
289
322
  penMode: boolean;
290
323
  penDetected: boolean;
291
324
  exportBackground: boolean;
@@ -324,12 +357,13 @@ export declare const actionShortcuts: {
324
357
  } | null;
325
358
  defaultSidebarDockedPreference: boolean;
326
359
  lastPointerDownWith: import("../element/types").PointerType;
327
- selectedElementIds: {
328
- [id: string]: boolean;
329
- };
360
+ selectedElementIds: Readonly<{
361
+ [id: string]: true;
362
+ }>;
330
363
  previousSelectedElementIds: {
331
- [id: string]: boolean;
364
+ [id: string]: true;
332
365
  };
366
+ selectedElementsAreBeingDragged: boolean;
333
367
  shouldCacheIgnoreZoom: boolean;
334
368
  toast: {
335
369
  message: string;
@@ -337,7 +371,7 @@ export declare const actionShortcuts: {
337
371
  duration?: number | undefined;
338
372
  } | null;
339
373
  zenModeEnabled: boolean;
340
- theme: string;
374
+ theme: import("../element/types").Theme;
341
375
  gridSize: number | null;
342
376
  viewModeEnabled: boolean;
343
377
  selectedGroupIds: {
@@ -360,12 +394,18 @@ export declare const actionShortcuts: {
360
394
  data: import("../charts").Spreadsheet;
361
395
  };
362
396
  pendingImageElementId: string | null;
363
- showHyperlinkPopup: false | "info" | "editor";
397
+ showHyperlinkPopup: false | "editor" | "info";
364
398
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
399
+ snapLines: readonly import("../snapping").SnapLine[];
400
+ originSnapOffset: {
401
+ x: number;
402
+ y: number;
403
+ } | null;
404
+ objectsSnapModeEnabled: boolean;
365
405
  };
366
406
  commitToHistory: false;
367
407
  };
368
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
408
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
369
409
  } & {
370
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
410
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
371
411
  };