@excalidraw/excalidraw 0.16.1-4c35eba → 0.16.1-aaf73c8

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 (54) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/excalidraw.development.js +140 -63
  3. package/dist/excalidraw.production.min.js +1 -1
  4. package/package.json +1 -1
  5. package/types/actions/actionAddToLibrary.d.ts +9 -27
  6. package/types/actions/actionAlign.d.ts +8 -8
  7. package/types/actions/actionBoundText.d.ts +6 -18
  8. package/types/actions/actionCanvas.d.ts +57 -123
  9. package/types/actions/actionClipboard.d.ts +19 -49
  10. package/types/actions/actionDeleteSelected.d.ts +11 -29
  11. package/types/actions/actionDistribute.d.ts +4 -4
  12. package/types/actions/actionDuplicateSelection.d.ts +2 -2
  13. package/types/actions/actionElementLock.d.ts +8 -20
  14. package/types/actions/actionExport.d.ts +42 -96
  15. package/types/actions/actionFinalize.d.ts +8 -20
  16. package/types/actions/actionFlip.d.ts +4 -4
  17. package/types/actions/actionFrame.d.ts +11 -29
  18. package/types/actions/actionGroup.d.ts +10 -22
  19. package/types/actions/actionLinearEditor.d.ts +3 -9
  20. package/types/actions/actionMenu.d.ts +11 -29
  21. package/types/actions/actionProperties.d.ts +43 -121
  22. package/types/actions/actionSelectAll.d.ts +5 -11
  23. package/types/actions/actionStyles.d.ts +7 -13
  24. package/types/actions/actionToggleGridMode.d.ts +5 -11
  25. package/types/actions/actionToggleObjectsSnapMode.d.ts +5 -11
  26. package/types/actions/actionToggleStats.d.ts +5 -11
  27. package/types/actions/actionToggleViewMode.d.ts +5 -11
  28. package/types/actions/actionToggleZenMode.d.ts +5 -11
  29. package/types/actions/actionZindex.d.ts +8 -8
  30. package/types/appState.d.ts +5 -11
  31. package/types/components/Actions.d.ts +4 -9
  32. package/types/components/App.d.ts +15 -5
  33. package/types/components/LaserTool/LaserPathManager.d.ts +28 -0
  34. package/types/components/LaserTool/LaserPointerButton.d.ts +10 -0
  35. package/types/components/LaserTool/LaserTool.d.ts +7 -0
  36. package/types/components/LayerUI.d.ts +2 -5
  37. package/types/components/MobileMenu.d.ts +1 -5
  38. package/types/components/Sidebar/Sidebar.d.ts +1 -1
  39. package/types/components/Stack.d.ts +2 -2
  40. package/types/components/dropdownMenu/DropdownMenu.d.ts +6 -3
  41. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +2 -1
  42. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -1
  43. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +2 -1
  44. package/types/components/dropdownMenu/common.d.ts +1 -1
  45. package/types/components/icons.d.ts +2 -0
  46. package/types/components/main-menu/MainMenu.d.ts +6 -3
  47. package/types/cursor.d.ts +5 -0
  48. package/types/element/Hyperlink.d.ts +5 -11
  49. package/types/element/embeddable.d.ts +3 -9
  50. package/types/element/linearElementEditor.d.ts +3 -9
  51. package/types/element/mutateElement.d.ts +1 -1
  52. package/types/frame.d.ts +5 -0
  53. package/types/types.d.ts +16 -17
  54. package/types/utils.d.ts +3 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/excalidraw",
3
- "version": "0.16.1-4c35eba",
3
+ "version": "0.16.1-aaf73c8",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -40,15 +40,9 @@ export declare const actionAddToLibrary: {
40
40
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
41
41
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
42
42
  activeTool: {
43
- lastActiveTool: import("../types").LastActiveTool;
43
+ lastActiveTool: import("../types").ActiveTool | null;
44
44
  locked: boolean;
45
- } & ({
46
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
47
- customType: null;
48
- } | {
49
- type: "custom";
50
- customType: string;
51
- });
45
+ } & import("../types").ActiveTool;
52
46
  penMode: boolean;
53
47
  penDetected: boolean;
54
48
  exportBackground: boolean;
@@ -122,7 +116,7 @@ export declare const actionAddToLibrary: {
122
116
  pendingImageElementId: string | null;
123
117
  showHyperlinkPopup: false | "editor" | "info";
124
118
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
125
- snapLines: import("../snapping").SnapLine[];
119
+ snapLines: readonly import("../snapping").SnapLine[];
126
120
  originSnapOffset: {
127
121
  x: number;
128
122
  y: number;
@@ -163,15 +157,9 @@ export declare const actionAddToLibrary: {
163
157
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
164
158
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
165
159
  activeTool: {
166
- lastActiveTool: import("../types").LastActiveTool;
160
+ lastActiveTool: import("../types").ActiveTool | null;
167
161
  locked: boolean;
168
- } & ({
169
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
170
- customType: null;
171
- } | {
172
- type: "custom";
173
- customType: string;
174
- });
162
+ } & import("../types").ActiveTool;
175
163
  penMode: boolean;
176
164
  penDetected: boolean;
177
165
  exportBackground: boolean;
@@ -250,7 +238,7 @@ export declare const actionAddToLibrary: {
250
238
  pendingImageElementId: string | null;
251
239
  showHyperlinkPopup: false | "editor" | "info";
252
240
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
253
- snapLines: import("../snapping").SnapLine[];
241
+ snapLines: readonly import("../snapping").SnapLine[];
254
242
  originSnapOffset: {
255
243
  x: number;
256
244
  y: number;
@@ -291,15 +279,9 @@ export declare const actionAddToLibrary: {
291
279
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
292
280
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
293
281
  activeTool: {
294
- lastActiveTool: import("../types").LastActiveTool;
282
+ lastActiveTool: import("../types").ActiveTool | null;
295
283
  locked: boolean;
296
- } & ({
297
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
298
- customType: null;
299
- } | {
300
- type: "custom";
301
- customType: string;
302
- });
284
+ } & import("../types").ActiveTool;
303
285
  penMode: boolean;
304
286
  penDetected: boolean;
305
287
  exportBackground: boolean;
@@ -378,7 +360,7 @@ export declare const actionAddToLibrary: {
378
360
  pendingImageElementId: string | null;
379
361
  showHyperlinkPopup: false | "editor" | "info";
380
362
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
381
- snapLines: import("../snapping").SnapLine[];
363
+ snapLines: readonly import("../snapping").SnapLine[];
382
364
  originSnapOffset: {
383
365
  x: number;
384
366
  y: number;
@@ -11,10 +11,10 @@ export declare const actionAlignTop: {
11
11
  elements: import("../scene/Scene").ExcalidrawElementsIncludingDeleted;
12
12
  commitToHistory: true;
13
13
  };
14
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
14
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
15
15
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => JSX.Element;
16
16
  } & {
17
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
17
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
18
18
  };
19
19
  export declare const actionAlignBottom: {
20
20
  name: "alignBottom";
@@ -27,10 +27,10 @@ export declare const actionAlignBottom: {
27
27
  elements: import("../scene/Scene").ExcalidrawElementsIncludingDeleted;
28
28
  commitToHistory: true;
29
29
  };
30
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
30
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
31
31
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => JSX.Element;
32
32
  } & {
33
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
33
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
34
34
  };
35
35
  export declare const actionAlignLeft: {
36
36
  name: "alignLeft";
@@ -43,10 +43,10 @@ export declare const actionAlignLeft: {
43
43
  elements: import("../scene/Scene").ExcalidrawElementsIncludingDeleted;
44
44
  commitToHistory: true;
45
45
  };
46
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
46
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
47
47
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => JSX.Element;
48
48
  } & {
49
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
49
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
50
50
  };
51
51
  export declare const actionAlignRight: {
52
52
  name: "alignRight";
@@ -59,10 +59,10 @@ export declare const actionAlignRight: {
59
59
  elements: import("../scene/Scene").ExcalidrawElementsIncludingDeleted;
60
60
  commitToHistory: true;
61
61
  };
62
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
62
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
63
63
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => JSX.Element;
64
64
  } & {
65
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
65
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
66
66
  };
67
67
  export declare const actionAlignVerticallyCentered: {
68
68
  name: "alignVerticallyCentered";
@@ -60,15 +60,9 @@ export declare const actionBindText: {
60
60
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
61
61
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
62
62
  activeTool: {
63
- lastActiveTool: import("../types").LastActiveTool;
63
+ lastActiveTool: import("../types").ActiveTool | null;
64
64
  locked: boolean;
65
- } & ({
66
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
67
- customType: null;
68
- } | {
69
- type: "custom";
70
- customType: string;
71
- });
65
+ } & import("../types").ActiveTool;
72
66
  penMode: boolean;
73
67
  penDetected: boolean;
74
68
  exportBackground: boolean;
@@ -144,7 +138,7 @@ export declare const actionBindText: {
144
138
  pendingImageElementId: string | null;
145
139
  showHyperlinkPopup: false | "editor" | "info";
146
140
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
147
- snapLines: import("../snapping").SnapLine[];
141
+ snapLines: readonly import("../snapping").SnapLine[];
148
142
  originSnapOffset: {
149
143
  x: number;
150
144
  y: number;
@@ -200,15 +194,9 @@ export declare const actionWrapTextInContainer: {
200
194
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
201
195
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
202
196
  activeTool: {
203
- lastActiveTool: import("../types").LastActiveTool;
197
+ lastActiveTool: import("../types").ActiveTool | null;
204
198
  locked: boolean;
205
- } & ({
206
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
207
- customType: null;
208
- } | {
209
- type: "custom";
210
- customType: string;
211
- });
199
+ } & import("../types").ActiveTool;
212
200
  penMode: boolean;
213
201
  penDetected: boolean;
214
202
  exportBackground: boolean;
@@ -284,7 +272,7 @@ export declare const actionWrapTextInContainer: {
284
272
  pendingImageElementId: string | null;
285
273
  showHyperlinkPopup: false | "editor" | "info";
286
274
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
287
- snapLines: import("../snapping").SnapLine[];
275
+ snapLines: readonly import("../snapping").SnapLine[];
288
276
  originSnapOffset: {
289
277
  x: number;
290
278
  y: number;
@@ -37,22 +37,10 @@ export declare const actionClearCanvas: {
37
37
  data: import("../charts").Spreadsheet;
38
38
  };
39
39
  activeTool: {
40
- lastActiveTool: import("../types").LastActiveTool;
40
+ lastActiveTool: import("../types").ActiveTool | null;
41
41
  locked: boolean;
42
- } & ({
43
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
44
- customType: null;
45
- } | {
46
- type: "custom";
47
- customType: string;
48
- });
42
+ } & import("../types").ActiveTool;
49
43
  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
44
  contextMenu: {
57
45
  items: import("../components/ContextMenu").ContextMenuItems;
58
46
  top: number;
@@ -125,6 +113,11 @@ export declare const actionClearCanvas: {
125
113
  };
126
114
  selectedElementsAreBeingDragged: boolean;
127
115
  shouldCacheIgnoreZoom: boolean;
116
+ toast: {
117
+ message: string;
118
+ closable?: boolean | undefined;
119
+ duration?: number | undefined;
120
+ } | null;
128
121
  zenModeEnabled: boolean;
129
122
  viewModeEnabled: boolean;
130
123
  selectedGroupIds: {
@@ -132,11 +125,12 @@ export declare const actionClearCanvas: {
132
125
  };
133
126
  editingGroupId: string | null;
134
127
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
128
+ collaborators: Map<string, import("../types").Collaborator>;
135
129
  currentChartType: import("../element/types").ChartType;
136
130
  pendingImageElementId: string | null;
137
131
  showHyperlinkPopup: false | "editor" | "info";
138
132
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
139
- snapLines: import("../snapping").SnapLine[];
133
+ snapLines: readonly import("../snapping").SnapLine[];
140
134
  originSnapOffset: {
141
135
  x: number;
142
136
  y: number;
@@ -192,15 +186,9 @@ export declare const actionZoomIn: {
192
186
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
193
187
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
194
188
  activeTool: {
195
- lastActiveTool: import("../types").LastActiveTool;
189
+ lastActiveTool: import("../types").ActiveTool | null;
196
190
  locked: boolean;
197
- } & ({
198
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
199
- customType: null;
200
- } | {
201
- type: "custom";
202
- customType: string;
203
- });
191
+ } & import("../types").ActiveTool;
204
192
  penMode: boolean;
205
193
  penDetected: boolean;
206
194
  exportBackground: boolean;
@@ -274,7 +262,7 @@ export declare const actionZoomIn: {
274
262
  pendingImageElementId: string | null;
275
263
  showHyperlinkPopup: false | "editor" | "info";
276
264
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
277
- snapLines: import("../snapping").SnapLine[];
265
+ snapLines: readonly import("../snapping").SnapLine[];
278
266
  originSnapOffset: {
279
267
  x: number;
280
268
  y: number;
@@ -284,9 +272,9 @@ export declare const actionZoomIn: {
284
272
  commitToHistory: false;
285
273
  };
286
274
  PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
287
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
275
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
288
276
  } & {
289
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
277
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
290
278
  };
291
279
  export declare const actionZoomOut: {
292
280
  name: "zoomOut";
@@ -332,15 +320,9 @@ export declare const actionZoomOut: {
332
320
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
333
321
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
334
322
  activeTool: {
335
- lastActiveTool: import("../types").LastActiveTool;
323
+ lastActiveTool: import("../types").ActiveTool | null;
336
324
  locked: boolean;
337
- } & ({
338
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
339
- customType: null;
340
- } | {
341
- type: "custom";
342
- customType: string;
343
- });
325
+ } & import("../types").ActiveTool;
344
326
  penMode: boolean;
345
327
  penDetected: boolean;
346
328
  exportBackground: boolean;
@@ -414,7 +396,7 @@ export declare const actionZoomOut: {
414
396
  pendingImageElementId: string | null;
415
397
  showHyperlinkPopup: false | "editor" | "info";
416
398
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
417
- snapLines: import("../snapping").SnapLine[];
399
+ snapLines: readonly import("../snapping").SnapLine[];
418
400
  originSnapOffset: {
419
401
  x: number;
420
402
  y: number;
@@ -424,9 +406,9 @@ export declare const actionZoomOut: {
424
406
  commitToHistory: false;
425
407
  };
426
408
  PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
427
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
409
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
428
410
  } & {
429
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
411
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
430
412
  };
431
413
  export declare const actionResetZoom: {
432
414
  name: "resetZoom";
@@ -472,15 +454,9 @@ export declare const actionResetZoom: {
472
454
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
473
455
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
474
456
  activeTool: {
475
- lastActiveTool: import("../types").LastActiveTool;
457
+ lastActiveTool: import("../types").ActiveTool | null;
476
458
  locked: boolean;
477
- } & ({
478
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
479
- customType: null;
480
- } | {
481
- type: "custom";
482
- customType: string;
483
- });
459
+ } & import("../types").ActiveTool;
484
460
  penMode: boolean;
485
461
  penDetected: boolean;
486
462
  exportBackground: boolean;
@@ -554,7 +530,7 @@ export declare const actionResetZoom: {
554
530
  pendingImageElementId: string | null;
555
531
  showHyperlinkPopup: false | "editor" | "info";
556
532
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
557
- snapLines: import("../snapping").SnapLine[];
533
+ snapLines: readonly import("../snapping").SnapLine[];
558
534
  originSnapOffset: {
559
535
  x: number;
560
536
  y: number;
@@ -564,9 +540,9 @@ export declare const actionResetZoom: {
564
540
  commitToHistory: false;
565
541
  };
566
542
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
567
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
543
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
568
544
  } & {
569
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
545
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
570
546
  };
571
547
  export declare const zoomToFit: ({ targetElements, appState, fitToViewport, viewportZoomFactor, }: {
572
548
  targetElements: readonly ExcalidrawElement[];
@@ -613,15 +589,9 @@ export declare const zoomToFit: ({ targetElements, appState, fitToViewport, view
613
589
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
614
590
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
615
591
  activeTool: {
616
- lastActiveTool: import("../types").LastActiveTool;
592
+ lastActiveTool: import("../types").ActiveTool | null;
617
593
  locked: boolean;
618
- } & ({
619
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
620
- customType: null;
621
- } | {
622
- type: "custom";
623
- customType: string;
624
- });
594
+ } & import("../types").ActiveTool;
625
595
  penMode: boolean;
626
596
  penDetected: boolean;
627
597
  exportBackground: boolean;
@@ -695,7 +665,7 @@ export declare const zoomToFit: ({ targetElements, appState, fitToViewport, view
695
665
  pendingImageElementId: string | null;
696
666
  showHyperlinkPopup: false | "editor" | "info";
697
667
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
698
- snapLines: import("../snapping").SnapLine[];
668
+ snapLines: readonly import("../snapping").SnapLine[];
699
669
  originSnapOffset: {
700
670
  x: number;
701
671
  y: number;
@@ -747,15 +717,9 @@ export declare const actionZoomToFitSelectionInViewport: {
747
717
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
748
718
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
749
719
  activeTool: {
750
- lastActiveTool: import("../types").LastActiveTool;
720
+ lastActiveTool: import("../types").ActiveTool | null;
751
721
  locked: boolean;
752
- } & ({
753
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
754
- customType: null;
755
- } | {
756
- type: "custom";
757
- customType: string;
758
- });
722
+ } & import("../types").ActiveTool;
759
723
  penMode: boolean;
760
724
  penDetected: boolean;
761
725
  exportBackground: boolean;
@@ -829,7 +793,7 @@ export declare const actionZoomToFitSelectionInViewport: {
829
793
  pendingImageElementId: string | null;
830
794
  showHyperlinkPopup: false | "editor" | "info";
831
795
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
832
- snapLines: import("../snapping").SnapLine[];
796
+ snapLines: readonly import("../snapping").SnapLine[];
833
797
  originSnapOffset: {
834
798
  x: number;
835
799
  y: number;
@@ -838,9 +802,9 @@ export declare const actionZoomToFitSelectionInViewport: {
838
802
  };
839
803
  commitToHistory: boolean;
840
804
  };
841
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
805
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
842
806
  } & {
843
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
807
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
844
808
  };
845
809
  export declare const actionZoomToFitSelection: {
846
810
  name: "zoomToFitSelection";
@@ -885,15 +849,9 @@ export declare const actionZoomToFitSelection: {
885
849
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
886
850
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
887
851
  activeTool: {
888
- lastActiveTool: import("../types").LastActiveTool;
852
+ lastActiveTool: import("../types").ActiveTool | null;
889
853
  locked: boolean;
890
- } & ({
891
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
892
- customType: null;
893
- } | {
894
- type: "custom";
895
- customType: string;
896
- });
854
+ } & import("../types").ActiveTool;
897
855
  penMode: boolean;
898
856
  penDetected: boolean;
899
857
  exportBackground: boolean;
@@ -967,7 +925,7 @@ export declare const actionZoomToFitSelection: {
967
925
  pendingImageElementId: string | null;
968
926
  showHyperlinkPopup: false | "editor" | "info";
969
927
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
970
- snapLines: import("../snapping").SnapLine[];
928
+ snapLines: readonly import("../snapping").SnapLine[];
971
929
  originSnapOffset: {
972
930
  x: number;
973
931
  y: number;
@@ -976,9 +934,9 @@ export declare const actionZoomToFitSelection: {
976
934
  };
977
935
  commitToHistory: boolean;
978
936
  };
979
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
937
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
980
938
  } & {
981
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
939
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
982
940
  };
983
941
  export declare const actionZoomToFit: {
984
942
  name: "zoomToFit";
@@ -1024,15 +982,9 @@ export declare const actionZoomToFit: {
1024
982
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1025
983
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1026
984
  activeTool: {
1027
- lastActiveTool: import("../types").LastActiveTool;
985
+ lastActiveTool: import("../types").ActiveTool | null;
1028
986
  locked: boolean;
1029
- } & ({
1030
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
1031
- customType: null;
1032
- } | {
1033
- type: "custom";
1034
- customType: string;
1035
- });
987
+ } & import("../types").ActiveTool;
1036
988
  penMode: boolean;
1037
989
  penDetected: boolean;
1038
990
  exportBackground: boolean;
@@ -1106,7 +1058,7 @@ export declare const actionZoomToFit: {
1106
1058
  pendingImageElementId: string | null;
1107
1059
  showHyperlinkPopup: false | "editor" | "info";
1108
1060
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1109
- snapLines: import("../snapping").SnapLine[];
1061
+ snapLines: readonly import("../snapping").SnapLine[];
1110
1062
  originSnapOffset: {
1111
1063
  x: number;
1112
1064
  y: number;
@@ -1115,9 +1067,9 @@ export declare const actionZoomToFit: {
1115
1067
  };
1116
1068
  commitToHistory: boolean;
1117
1069
  };
1118
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1070
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
1119
1071
  } & {
1120
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1072
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
1121
1073
  };
1122
1074
  export declare const actionToggleTheme: {
1123
1075
  name: "toggleTheme";
@@ -1159,15 +1111,9 @@ export declare const actionToggleTheme: {
1159
1111
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1160
1112
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1161
1113
  activeTool: {
1162
- lastActiveTool: import("../types").LastActiveTool;
1114
+ lastActiveTool: import("../types").ActiveTool | null;
1163
1115
  locked: boolean;
1164
- } & ({
1165
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
1166
- customType: null;
1167
- } | {
1168
- type: "custom";
1169
- customType: string;
1170
- });
1116
+ } & import("../types").ActiveTool;
1171
1117
  penMode: boolean;
1172
1118
  penDetected: boolean;
1173
1119
  exportBackground: boolean;
@@ -1245,7 +1191,7 @@ export declare const actionToggleTheme: {
1245
1191
  pendingImageElementId: string | null;
1246
1192
  showHyperlinkPopup: false | "editor" | "info";
1247
1193
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1248
- snapLines: import("../snapping").SnapLine[];
1194
+ snapLines: readonly import("../snapping").SnapLine[];
1249
1195
  originSnapOffset: {
1250
1196
  x: number;
1251
1197
  y: number;
@@ -1254,10 +1200,10 @@ export declare const actionToggleTheme: {
1254
1200
  };
1255
1201
  commitToHistory: false;
1256
1202
  };
1257
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1203
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
1258
1204
  predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
1259
1205
  } & {
1260
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1206
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
1261
1207
  };
1262
1208
  export declare const actionToggleEraserTool: {
1263
1209
  name: "toggleEraserTool";
@@ -1270,15 +1216,9 @@ export declare const actionToggleEraserTool: {
1270
1216
  selectedGroupIds: {};
1271
1217
  activeEmbeddable: null;
1272
1218
  activeTool: {
1273
- lastActiveTool: import("../types").LastActiveTool;
1219
+ lastActiveTool: import("../types").ActiveTool | null;
1274
1220
  locked: boolean;
1275
- } & ({
1276
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
1277
- customType: null;
1278
- } | {
1279
- type: "custom";
1280
- customType: string;
1281
- });
1221
+ } & import("../types").ActiveTool;
1282
1222
  contextMenu: {
1283
1223
  items: import("../components/ContextMenu").ContextMenuItems;
1284
1224
  top: number;
@@ -1377,7 +1317,7 @@ export declare const actionToggleEraserTool: {
1377
1317
  pendingImageElementId: string | null;
1378
1318
  showHyperlinkPopup: false | "editor" | "info";
1379
1319
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1380
- snapLines: import("../snapping").SnapLine[];
1320
+ snapLines: readonly import("../snapping").SnapLine[];
1381
1321
  originSnapOffset: {
1382
1322
  x: number;
1383
1323
  y: number;
@@ -1386,9 +1326,9 @@ export declare const actionToggleEraserTool: {
1386
1326
  };
1387
1327
  commitToHistory: true;
1388
1328
  };
1389
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1329
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
1390
1330
  } & {
1391
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1331
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
1392
1332
  };
1393
1333
  export declare const actionToggleHandTool: {
1394
1334
  name: "toggleHandTool";
@@ -1401,15 +1341,9 @@ export declare const actionToggleHandTool: {
1401
1341
  selectedGroupIds: {};
1402
1342
  activeEmbeddable: null;
1403
1343
  activeTool: {
1404
- lastActiveTool: import("../types").LastActiveTool;
1344
+ lastActiveTool: import("../types").ActiveTool | null;
1405
1345
  locked: boolean;
1406
- } & ({
1407
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
1408
- customType: null;
1409
- } | {
1410
- type: "custom";
1411
- customType: string;
1412
- });
1346
+ } & import("../types").ActiveTool;
1413
1347
  contextMenu: {
1414
1348
  items: import("../components/ContextMenu").ContextMenuItems;
1415
1349
  top: number;
@@ -1508,7 +1442,7 @@ export declare const actionToggleHandTool: {
1508
1442
  pendingImageElementId: string | null;
1509
1443
  showHyperlinkPopup: false | "editor" | "info";
1510
1444
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1511
- snapLines: import("../snapping").SnapLine[];
1445
+ snapLines: readonly import("../snapping").SnapLine[];
1512
1446
  originSnapOffset: {
1513
1447
  x: number;
1514
1448
  y: number;
@@ -1517,7 +1451,7 @@ export declare const actionToggleHandTool: {
1517
1451
  };
1518
1452
  commitToHistory: true;
1519
1453
  };
1520
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1454
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
1521
1455
  } & {
1522
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1456
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
1523
1457
  };