@zsviczian/excalidraw 0.13.0-obsidian-2 → 0.14.1-obsidian

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 (80) hide show
  1. package/README.md +417 -19
  2. package/dist/excalidraw.development.js +581 -1153
  3. package/dist/excalidraw.production.min.js +1 -1
  4. package/dist/excalidraw.production.min.js.LICENSE.txt +0 -102
  5. package/package.json +1 -1
  6. package/types/actions/actionAddToLibrary.d.ts +39 -18
  7. package/types/actions/actionAlign.d.ts +6 -18
  8. package/types/actions/actionBoundText.d.ts +15 -8
  9. package/types/actions/actionCanvas.d.ts +246 -76
  10. package/types/actions/actionClipboard.d.ts +84 -31
  11. package/types/actions/actionDeleteSelected.d.ts +40 -21
  12. package/types/actions/actionDistribute.d.ts +2 -6
  13. package/types/actions/actionDuplicateSelection.d.ts +1 -3
  14. package/types/actions/actionExport.d.ts +125 -78
  15. package/types/actions/actionFinalize.d.ts +27 -15
  16. package/types/actions/actionFlip.d.ts +2 -2
  17. package/types/actions/actionGroup.d.ts +4 -8
  18. package/types/actions/actionLinearEditor.d.ts +14 -7
  19. package/types/actions/actionMenu.d.ts +40 -26
  20. package/types/actions/actionNavigate.d.ts +1 -3
  21. package/types/actions/actionProperties.d.ts +182 -117
  22. package/types/actions/actionStyles.d.ts +13 -6
  23. package/types/actions/actionToggleGridMode.d.ts +14 -6
  24. package/types/actions/actionToggleLock.d.ts +13 -6
  25. package/types/actions/actionToggleStats.d.ts +13 -6
  26. package/types/actions/actionToggleViewMode.d.ts +14 -6
  27. package/types/actions/actionToggleZenMode.d.ts +14 -6
  28. package/types/actions/actionZindex.d.ts +4 -12
  29. package/types/actions/manager.d.ts +2 -1
  30. package/types/actions/types.d.ts +3 -5
  31. package/types/appState.d.ts +8 -6
  32. package/types/components/ActiveConfirmDialog.d.ts +24 -0
  33. package/types/components/App.d.ts +8 -50
  34. package/types/components/Button.d.ts +15 -0
  35. package/types/components/CollabButton.d.ts +1 -2
  36. package/types/components/ContextMenu.d.ts +8 -20
  37. package/types/components/HandButton.d.ts +10 -0
  38. package/types/components/JSONExportDialog.d.ts +3 -1
  39. package/types/components/LayerUI.d.ts +3 -3
  40. package/types/components/LibraryMenuHeaderContent.d.ts +23 -0
  41. package/types/components/LockButton.d.ts +0 -1
  42. package/types/components/MobileMenu.d.ts +5 -6
  43. package/types/components/ToolButton.d.ts +1 -1
  44. package/types/components/UserList.d.ts +0 -2
  45. package/types/components/dropdownMenu/DropdownMenu.d.ts +66 -0
  46. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
  47. package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  48. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
  49. package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
  50. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
  51. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
  52. package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  53. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +9 -0
  54. package/types/components/dropdownMenu/common.d.ts +6 -0
  55. package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  56. package/types/components/footer/Footer.d.ts +13 -0
  57. package/types/components/footer/FooterCenter.d.ts +8 -0
  58. package/types/components/icons.d.ts +2 -1
  59. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
  60. package/types/components/main-menu/DefaultItems.d.ts +44 -0
  61. package/types/components/main-menu/MainMenu.d.ts +60 -0
  62. package/types/components/mainMenu/DefaultItems.d.ts +44 -0
  63. package/types/components/mainMenu/MainMenu.d.ts +63 -0
  64. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
  65. package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  66. package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
  67. package/types/constants.d.ts +6 -4
  68. package/types/element/Hyperlink.d.ts +15 -10
  69. package/types/element/linearElementEditor.d.ts +14 -6
  70. package/types/element/textElement.d.ts +7 -0
  71. package/types/element/textWysiwyg.d.ts +6 -1
  72. package/types/excalidraw-app/data/index.d.ts +5 -0
  73. package/types/excalidraw-app/data/localStorage.d.ts +5 -0
  74. package/types/keys.d.ts +2 -3
  75. package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
  76. package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
  77. package/types/packages/excalidraw/index.d.ts +10 -0
  78. package/types/renderer/easingFunctions.d.ts +6 -0
  79. package/types/types.d.ts +54 -26
  80. package/types/utils.d.ts +23 -3
@@ -4,13 +4,12 @@ import { AppState, NormalizedZoomValue } from "../types";
4
4
  export declare const actionChangeViewBackgroundColor: {
5
5
  name: "changeViewBackgroundColor";
6
6
  trackEvent: false;
7
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
7
8
  perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
8
9
  appState: any;
9
10
  commitToHistory: boolean;
10
11
  };
11
- PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps & {
12
- isInHamburgerMenu: boolean;
13
- }) => JSX.Element;
12
+ PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
14
13
  } & {
15
14
  keyTest?: undefined;
16
15
  };
@@ -19,6 +18,7 @@ export declare const actionClearCanvas: {
19
18
  trackEvent: {
20
19
  category: "canvas";
21
20
  };
21
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
22
22
  perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
23
23
  elements: ExcalidrawElement[];
24
24
  appState: {
@@ -38,23 +38,29 @@ export declare const actionClearCanvas: {
38
38
  data: import("../charts").Spreadsheet;
39
39
  };
40
40
  activeTool: {
41
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
42
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
41
+ lastActiveTool: import("../types").LastActiveTool;
43
42
  locked: boolean;
43
+ } & ({
44
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
44
45
  customType: null;
45
46
  } | {
46
47
  type: "custom";
47
48
  customType: string;
48
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
49
- locked: boolean;
50
- };
49
+ });
51
50
  colorPalette: {
52
51
  canvasBackground?: string[] | undefined;
53
52
  elementBackground?: string[] | undefined;
54
53
  elementStroke?: string[] | undefined;
55
54
  };
56
55
  trayModeEnabled: boolean;
56
+ allowPinchZoom: boolean | undefined;
57
+ allowWheelZoom: boolean | undefined;
57
58
  name: string;
59
+ contextMenu: {
60
+ items: import("../components/ContextMenu").ContextMenuItems;
61
+ top: number;
62
+ left: number;
63
+ } | null;
58
64
  showWelcomeScreen: boolean;
59
65
  isLoading: boolean;
60
66
  errorMessage: string | null;
@@ -95,7 +101,7 @@ export declare const actionClearCanvas: {
95
101
  openMenu: "canvas" | "shape" | null;
96
102
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
97
103
  openSidebar: "library" | "customSidebar" | null;
98
- openDialog: "imageExport" | "help" | null;
104
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
99
105
  isSidebarDocked: boolean;
100
106
  lastPointerDownWith: import("../element/types").PointerType;
101
107
  selectedElementIds: {
@@ -111,6 +117,7 @@ export declare const actionClearCanvas: {
111
117
  duration?: number | undefined;
112
118
  } | null;
113
119
  zenModeEnabled: boolean;
120
+ previousGridSize: number | null;
114
121
  viewModeEnabled: boolean;
115
122
  selectedGroupIds: {
116
123
  [groupId: string]: boolean;
@@ -126,9 +133,6 @@ export declare const actionClearCanvas: {
126
133
  };
127
134
  commitToHistory: true;
128
135
  };
129
- PanelComponent: ({ updateData }: import("./types").PanelComponentProps & {
130
- isInHamburgerMenu: boolean;
131
- }) => JSX.Element;
132
136
  } & {
133
137
  keyTest?: undefined;
134
138
  };
@@ -145,6 +149,11 @@ export declare const actionZoomIn: {
145
149
  zoom: {
146
150
  value: NormalizedZoomValue;
147
151
  };
152
+ contextMenu: {
153
+ items: import("../components/ContextMenu").ContextMenuItems;
154
+ top: number;
155
+ left: number;
156
+ } | null;
148
157
  showWelcomeScreen: boolean;
149
158
  isLoading: boolean;
150
159
  errorMessage: string | null;
@@ -158,16 +167,15 @@ export declare const actionZoomIn: {
158
167
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
159
168
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
160
169
  activeTool: {
161
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
162
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
170
+ lastActiveTool: import("../types").LastActiveTool;
163
171
  locked: boolean;
172
+ } & ({
173
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
164
174
  customType: null;
165
175
  } | {
166
176
  type: "custom";
167
177
  customType: string;
168
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
169
- locked: boolean;
170
- };
178
+ });
171
179
  penMode: boolean;
172
180
  penDetected: boolean;
173
181
  exportBackground: boolean;
@@ -196,7 +204,7 @@ export declare const actionZoomIn: {
196
204
  openMenu: "canvas" | "shape" | null;
197
205
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
198
206
  openSidebar: "library" | "customSidebar" | null;
199
- openDialog: "imageExport" | "help" | null;
207
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
200
208
  isSidebarDocked: boolean;
201
209
  lastPointerDownWith: import("../element/types").PointerType;
202
210
  selectedElementIds: {
@@ -214,6 +222,7 @@ export declare const actionZoomIn: {
214
222
  zenModeEnabled: boolean;
215
223
  theme: string;
216
224
  gridSize: number | null;
225
+ previousGridSize: number | null;
217
226
  viewModeEnabled: boolean;
218
227
  selectedGroupIds: {
219
228
  [groupId: string]: boolean;
@@ -243,13 +252,13 @@ export declare const actionZoomIn: {
243
252
  elementBackground?: string[] | undefined;
244
253
  elementStroke?: string[] | undefined;
245
254
  };
255
+ allowWheelZoom?: boolean | undefined;
256
+ allowPinchZoom?: boolean | undefined;
246
257
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
247
258
  };
248
259
  commitToHistory: false;
249
260
  };
250
- PanelComponent: ({ updateData }: import("./types").PanelComponentProps & {
251
- isInHamburgerMenu: boolean;
252
- }) => JSX.Element;
261
+ PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
253
262
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
254
263
  } & {
255
264
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
@@ -267,6 +276,11 @@ export declare const actionZoomOut: {
267
276
  zoom: {
268
277
  value: NormalizedZoomValue;
269
278
  };
279
+ contextMenu: {
280
+ items: import("../components/ContextMenu").ContextMenuItems;
281
+ top: number;
282
+ left: number;
283
+ } | null;
270
284
  showWelcomeScreen: boolean;
271
285
  isLoading: boolean;
272
286
  errorMessage: string | null;
@@ -280,16 +294,15 @@ export declare const actionZoomOut: {
280
294
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
281
295
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
282
296
  activeTool: {
283
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
284
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
297
+ lastActiveTool: import("../types").LastActiveTool;
285
298
  locked: boolean;
299
+ } & ({
300
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
286
301
  customType: null;
287
302
  } | {
288
303
  type: "custom";
289
304
  customType: string;
290
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
291
- locked: boolean;
292
- };
305
+ });
293
306
  penMode: boolean;
294
307
  penDetected: boolean;
295
308
  exportBackground: boolean;
@@ -318,7 +331,7 @@ export declare const actionZoomOut: {
318
331
  openMenu: "canvas" | "shape" | null;
319
332
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
320
333
  openSidebar: "library" | "customSidebar" | null;
321
- openDialog: "imageExport" | "help" | null;
334
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
322
335
  isSidebarDocked: boolean;
323
336
  lastPointerDownWith: import("../element/types").PointerType;
324
337
  selectedElementIds: {
@@ -336,6 +349,7 @@ export declare const actionZoomOut: {
336
349
  zenModeEnabled: boolean;
337
350
  theme: string;
338
351
  gridSize: number | null;
352
+ previousGridSize: number | null;
339
353
  viewModeEnabled: boolean;
340
354
  selectedGroupIds: {
341
355
  [groupId: string]: boolean;
@@ -365,13 +379,13 @@ export declare const actionZoomOut: {
365
379
  elementBackground?: string[] | undefined;
366
380
  elementStroke?: string[] | undefined;
367
381
  };
382
+ allowWheelZoom?: boolean | undefined;
383
+ allowPinchZoom?: boolean | undefined;
368
384
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
369
385
  };
370
386
  commitToHistory: false;
371
387
  };
372
- PanelComponent: ({ updateData }: import("./types").PanelComponentProps & {
373
- isInHamburgerMenu: boolean;
374
- }) => JSX.Element;
388
+ PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
375
389
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
376
390
  } & {
377
391
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
@@ -389,6 +403,11 @@ export declare const actionResetZoom: {
389
403
  zoom: {
390
404
  value: NormalizedZoomValue;
391
405
  };
406
+ contextMenu: {
407
+ items: import("../components/ContextMenu").ContextMenuItems;
408
+ top: number;
409
+ left: number;
410
+ } | null;
392
411
  showWelcomeScreen: boolean;
393
412
  isLoading: boolean;
394
413
  errorMessage: string | null;
@@ -402,16 +421,15 @@ export declare const actionResetZoom: {
402
421
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
403
422
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
404
423
  activeTool: {
405
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
406
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
424
+ lastActiveTool: import("../types").LastActiveTool;
407
425
  locked: boolean;
426
+ } & ({
427
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
408
428
  customType: null;
409
429
  } | {
410
430
  type: "custom";
411
431
  customType: string;
412
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
413
- locked: boolean;
414
- };
432
+ });
415
433
  penMode: boolean;
416
434
  penDetected: boolean;
417
435
  exportBackground: boolean;
@@ -440,7 +458,7 @@ export declare const actionResetZoom: {
440
458
  openMenu: "canvas" | "shape" | null;
441
459
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
442
460
  openSidebar: "library" | "customSidebar" | null;
443
- openDialog: "imageExport" | "help" | null;
461
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
444
462
  isSidebarDocked: boolean;
445
463
  lastPointerDownWith: import("../element/types").PointerType;
446
464
  selectedElementIds: {
@@ -458,6 +476,7 @@ export declare const actionResetZoom: {
458
476
  zenModeEnabled: boolean;
459
477
  theme: string;
460
478
  gridSize: number | null;
479
+ previousGridSize: number | null;
461
480
  viewModeEnabled: boolean;
462
481
  selectedGroupIds: {
463
482
  [groupId: string]: boolean;
@@ -487,13 +506,13 @@ export declare const actionResetZoom: {
487
506
  elementBackground?: string[] | undefined;
488
507
  elementStroke?: string[] | undefined;
489
508
  };
509
+ allowWheelZoom?: boolean | undefined;
510
+ allowPinchZoom?: boolean | undefined;
490
511
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
491
512
  };
492
513
  commitToHistory: false;
493
514
  };
494
- PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
495
- isInHamburgerMenu: boolean;
496
- }) => JSX.Element;
515
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
497
516
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
498
517
  } & {
499
518
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
@@ -505,6 +524,11 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
505
524
  };
506
525
  scrollX: number;
507
526
  scrollY: number;
527
+ contextMenu: {
528
+ items: import("../components/ContextMenu").ContextMenuItems;
529
+ top: number;
530
+ left: number;
531
+ } | null;
508
532
  showWelcomeScreen: boolean;
509
533
  isLoading: boolean;
510
534
  errorMessage: string | null;
@@ -518,16 +542,15 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
518
542
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
519
543
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
520
544
  activeTool: {
521
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
522
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
545
+ lastActiveTool: import("../types").LastActiveTool;
523
546
  locked: boolean;
547
+ } & ({
548
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
524
549
  customType: null;
525
550
  } | {
526
551
  type: "custom";
527
552
  customType: string;
528
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
529
- locked: boolean;
530
- };
553
+ });
531
554
  penMode: boolean;
532
555
  penDetected: boolean;
533
556
  exportBackground: boolean;
@@ -556,7 +579,7 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
556
579
  openMenu: "canvas" | "shape" | null;
557
580
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
558
581
  openSidebar: "library" | "customSidebar" | null;
559
- openDialog: "imageExport" | "help" | null;
582
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
560
583
  isSidebarDocked: boolean;
561
584
  lastPointerDownWith: import("../element/types").PointerType;
562
585
  selectedElementIds: {
@@ -574,6 +597,7 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
574
597
  zenModeEnabled: boolean;
575
598
  theme: string;
576
599
  gridSize: number | null;
600
+ previousGridSize: number | null;
577
601
  viewModeEnabled: boolean;
578
602
  selectedGroupIds: {
579
603
  [groupId: string]: boolean;
@@ -603,6 +627,8 @@ export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[],
603
627
  elementBackground?: string[] | undefined;
604
628
  elementStroke?: string[] | undefined;
605
629
  };
630
+ allowWheelZoom?: boolean | undefined;
631
+ allowPinchZoom?: boolean | undefined;
606
632
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
607
633
  };
608
634
  commitToHistory: boolean;
@@ -619,6 +645,11 @@ export declare const actionZoomToSelected: {
619
645
  };
620
646
  scrollX: number;
621
647
  scrollY: number;
648
+ contextMenu: {
649
+ items: import("../components/ContextMenu").ContextMenuItems;
650
+ top: number;
651
+ left: number;
652
+ } | null;
622
653
  showWelcomeScreen: boolean;
623
654
  isLoading: boolean;
624
655
  errorMessage: string | null;
@@ -632,16 +663,15 @@ export declare const actionZoomToSelected: {
632
663
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
633
664
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
634
665
  activeTool: {
635
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
636
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
666
+ lastActiveTool: import("../types").LastActiveTool;
637
667
  locked: boolean;
668
+ } & ({
669
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
638
670
  customType: null;
639
671
  } | {
640
672
  type: "custom";
641
673
  customType: string;
642
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
643
- locked: boolean;
644
- };
674
+ });
645
675
  penMode: boolean;
646
676
  penDetected: boolean;
647
677
  exportBackground: boolean;
@@ -670,7 +700,7 @@ export declare const actionZoomToSelected: {
670
700
  openMenu: "canvas" | "shape" | null;
671
701
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
672
702
  openSidebar: "library" | "customSidebar" | null;
673
- openDialog: "imageExport" | "help" | null;
703
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
674
704
  isSidebarDocked: boolean;
675
705
  lastPointerDownWith: import("../element/types").PointerType;
676
706
  selectedElementIds: {
@@ -688,6 +718,7 @@ export declare const actionZoomToSelected: {
688
718
  zenModeEnabled: boolean;
689
719
  theme: string;
690
720
  gridSize: number | null;
721
+ previousGridSize: number | null;
691
722
  viewModeEnabled: boolean;
692
723
  selectedGroupIds: {
693
724
  [groupId: string]: boolean;
@@ -717,6 +748,8 @@ export declare const actionZoomToSelected: {
717
748
  elementBackground?: string[] | undefined;
718
749
  elementStroke?: string[] | undefined;
719
750
  };
751
+ allowWheelZoom?: boolean | undefined;
752
+ allowPinchZoom?: boolean | undefined;
720
753
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
721
754
  };
722
755
  commitToHistory: boolean;
@@ -738,6 +771,11 @@ export declare const actionZoomToFit: {
738
771
  };
739
772
  scrollX: number;
740
773
  scrollY: number;
774
+ contextMenu: {
775
+ items: import("../components/ContextMenu").ContextMenuItems;
776
+ top: number;
777
+ left: number;
778
+ } | null;
741
779
  showWelcomeScreen: boolean;
742
780
  isLoading: boolean;
743
781
  errorMessage: string | null;
@@ -751,16 +789,15 @@ export declare const actionZoomToFit: {
751
789
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
752
790
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
753
791
  activeTool: {
754
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
755
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
792
+ lastActiveTool: import("../types").LastActiveTool;
756
793
  locked: boolean;
794
+ } & ({
795
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
757
796
  customType: null;
758
797
  } | {
759
798
  type: "custom";
760
799
  customType: string;
761
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
762
- locked: boolean;
763
- };
800
+ });
764
801
  penMode: boolean;
765
802
  penDetected: boolean;
766
803
  exportBackground: boolean;
@@ -789,7 +826,7 @@ export declare const actionZoomToFit: {
789
826
  openMenu: "canvas" | "shape" | null;
790
827
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
791
828
  openSidebar: "library" | "customSidebar" | null;
792
- openDialog: "imageExport" | "help" | null;
829
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
793
830
  isSidebarDocked: boolean;
794
831
  lastPointerDownWith: import("../element/types").PointerType;
795
832
  selectedElementIds: {
@@ -807,6 +844,7 @@ export declare const actionZoomToFit: {
807
844
  zenModeEnabled: boolean;
808
845
  theme: string;
809
846
  gridSize: number | null;
847
+ previousGridSize: number | null;
810
848
  viewModeEnabled: boolean;
811
849
  selectedGroupIds: {
812
850
  [groupId: string]: boolean;
@@ -836,6 +874,8 @@ export declare const actionZoomToFit: {
836
874
  elementBackground?: string[] | undefined;
837
875
  elementStroke?: string[] | undefined;
838
876
  };
877
+ allowWheelZoom?: boolean | undefined;
878
+ allowPinchZoom?: boolean | undefined;
839
879
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
840
880
  };
841
881
  commitToHistory: boolean;
@@ -853,6 +893,11 @@ export declare const actionToggleTheme: {
853
893
  perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any, app: import("../types").AppClassProperties) => {
854
894
  appState: {
855
895
  theme: any;
896
+ contextMenu: {
897
+ items: import("../components/ContextMenu").ContextMenuItems;
898
+ top: number;
899
+ left: number;
900
+ } | null;
856
901
  showWelcomeScreen: boolean;
857
902
  isLoading: boolean;
858
903
  errorMessage: string | null;
@@ -866,16 +911,15 @@ export declare const actionToggleTheme: {
866
911
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
867
912
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
868
913
  activeTool: {
869
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
870
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
914
+ lastActiveTool: import("../types").LastActiveTool;
871
915
  locked: boolean;
916
+ } & ({
917
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
872
918
  customType: null;
873
919
  } | {
874
920
  type: "custom";
875
921
  customType: string;
876
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
877
- locked: boolean;
878
- };
922
+ });
879
923
  penMode: boolean;
880
924
  penDetected: boolean;
881
925
  exportBackground: boolean;
@@ -909,7 +953,7 @@ export declare const actionToggleTheme: {
909
953
  openMenu: "canvas" | "shape" | null;
910
954
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
911
955
  openSidebar: "library" | "customSidebar" | null;
912
- openDialog: "imageExport" | "help" | null;
956
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
913
957
  isSidebarDocked: boolean;
914
958
  lastPointerDownWith: import("../element/types").PointerType;
915
959
  selectedElementIds: {
@@ -926,6 +970,7 @@ export declare const actionToggleTheme: {
926
970
  } | null;
927
971
  zenModeEnabled: boolean;
928
972
  gridSize: number | null;
973
+ previousGridSize: number | null;
929
974
  viewModeEnabled: boolean;
930
975
  selectedGroupIds: {
931
976
  [groupId: string]: boolean;
@@ -955,19 +1000,19 @@ export declare const actionToggleTheme: {
955
1000
  elementBackground?: string[] | undefined;
956
1001
  elementStroke?: string[] | undefined;
957
1002
  };
1003
+ allowWheelZoom?: boolean | undefined;
1004
+ allowPinchZoom?: boolean | undefined;
958
1005
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
959
1006
  };
960
1007
  commitToHistory: false;
961
1008
  };
962
- PanelComponent: ({ appState, updateData }: import("./types").PanelComponentProps & {
963
- isInHamburgerMenu: boolean;
964
- }) => JSX.Element;
965
1009
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1010
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
966
1011
  } & {
967
1012
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
968
1013
  };
969
- export declare const actionErase: {
970
- name: "eraser";
1014
+ export declare const actionToggleEraserTool: {
1015
+ name: "toggleEraserTool";
971
1016
  trackEvent: {
972
1017
  category: "toolbar";
973
1018
  };
@@ -976,16 +1021,141 @@ export declare const actionErase: {
976
1021
  selectedElementIds: {};
977
1022
  selectedGroupIds: {};
978
1023
  activeTool: {
979
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
980
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
1024
+ lastActiveTool: import("../types").LastActiveTool;
981
1025
  locked: boolean;
1026
+ } & ({
1027
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
982
1028
  customType: null;
983
1029
  } | {
984
1030
  type: "custom";
985
1031
  customType: string;
986
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
987
- locked: boolean;
1032
+ });
1033
+ contextMenu: {
1034
+ items: import("../components/ContextMenu").ContextMenuItems;
1035
+ top: number;
1036
+ left: number;
1037
+ } | null;
1038
+ showWelcomeScreen: boolean;
1039
+ isLoading: boolean;
1040
+ errorMessage: string | null;
1041
+ draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1042
+ resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1043
+ multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
1044
+ selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
1045
+ isBindingEnabled: boolean;
1046
+ startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
1047
+ suggestedBindings: import("../element/binding").SuggestedBinding[];
1048
+ editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
1049
+ editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1050
+ penMode: boolean;
1051
+ penDetected: boolean;
1052
+ exportBackground: boolean;
1053
+ exportEmbedScene: boolean;
1054
+ exportWithDarkMode: boolean;
1055
+ exportScale: number;
1056
+ currentItemStrokeColor: string;
1057
+ currentItemBackgroundColor: string;
1058
+ currentItemFillStyle: import("../element/types").FillStyle;
1059
+ currentItemStrokeWidth: number;
1060
+ currentItemStrokeStyle: import("../element/types").StrokeStyle;
1061
+ currentItemRoughness: number;
1062
+ currentItemOpacity: number;
1063
+ currentItemFontFamily: number;
1064
+ currentItemFontSize: number;
1065
+ currentItemTextAlign: string;
1066
+ currentItemStartArrowhead: import("../element/types").Arrowhead | null;
1067
+ currentItemEndArrowhead: import("../element/types").Arrowhead | null;
1068
+ currentItemRoundness: import("../element/types").StrokeRoundness;
1069
+ viewBackgroundColor: string;
1070
+ scrollX: number;
1071
+ scrollY: number;
1072
+ cursorButton: "up" | "down";
1073
+ scrolledOutside: boolean;
1074
+ name: string;
1075
+ isResizing: boolean;
1076
+ isRotating: boolean;
1077
+ zoom: Readonly<{
1078
+ value: NormalizedZoomValue;
1079
+ }>;
1080
+ openMenu: "canvas" | "shape" | null;
1081
+ openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
1082
+ openSidebar: "library" | "customSidebar" | null;
1083
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1084
+ isSidebarDocked: boolean;
1085
+ lastPointerDownWith: import("../element/types").PointerType;
1086
+ previousSelectedElementIds: {
1087
+ [id: string]: boolean;
1088
+ };
1089
+ shouldCacheIgnoreZoom: boolean;
1090
+ toast: {
1091
+ message: string;
1092
+ closable?: boolean | undefined;
1093
+ duration?: number | undefined;
1094
+ } | null;
1095
+ zenModeEnabled: boolean;
1096
+ theme: string;
1097
+ gridSize: number | null;
1098
+ previousGridSize: number | null;
1099
+ viewModeEnabled: boolean;
1100
+ editingGroupId: string | null;
1101
+ width: number;
1102
+ height: number;
1103
+ offsetTop: number;
1104
+ offsetLeft: number;
1105
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
1106
+ collaborators: Map<string, import("../types").Collaborator>;
1107
+ showStats: boolean;
1108
+ currentChartType: import("../element/types").ChartType;
1109
+ pasteDialog: {
1110
+ shown: false;
1111
+ data: null;
1112
+ } | {
1113
+ shown: true;
1114
+ data: import("../charts").Spreadsheet;
988
1115
  };
1116
+ pendingImageElementId: string | null;
1117
+ showHyperlinkPopup: false | "info" | "editor";
1118
+ linkOpacity: number;
1119
+ trayModeEnabled: boolean;
1120
+ colorPalette: {
1121
+ canvasBackground?: string[] | undefined;
1122
+ elementBackground?: string[] | undefined;
1123
+ elementStroke?: string[] | undefined;
1124
+ };
1125
+ allowWheelZoom?: boolean | undefined;
1126
+ allowPinchZoom?: boolean | undefined;
1127
+ selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1128
+ };
1129
+ commitToHistory: true;
1130
+ };
1131
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1132
+ } & {
1133
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1134
+ };
1135
+ export declare const actionToggleHandTool: {
1136
+ name: "toggleHandTool";
1137
+ trackEvent: {
1138
+ category: "toolbar";
1139
+ };
1140
+ perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
1141
+ appState: {
1142
+ selectedElementIds: {};
1143
+ selectedGroupIds: {};
1144
+ activeTool: {
1145
+ lastActiveTool: import("../types").LastActiveTool;
1146
+ locked: boolean;
1147
+ } & ({
1148
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
1149
+ customType: null;
1150
+ } | {
1151
+ type: "custom";
1152
+ customType: string;
1153
+ });
1154
+ contextMenu: {
1155
+ items: import("../components/ContextMenu").ContextMenuItems;
1156
+ top: number;
1157
+ left: number;
1158
+ } | null;
989
1159
  showWelcomeScreen: boolean;
990
1160
  isLoading: boolean;
991
1161
  errorMessage: string | null;
@@ -1031,7 +1201,7 @@ export declare const actionErase: {
1031
1201
  openMenu: "canvas" | "shape" | null;
1032
1202
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
1033
1203
  openSidebar: "library" | "customSidebar" | null;
1034
- openDialog: "imageExport" | "help" | null;
1204
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
1035
1205
  isSidebarDocked: boolean;
1036
1206
  lastPointerDownWith: import("../element/types").PointerType;
1037
1207
  previousSelectedElementIds: {
@@ -1046,6 +1216,7 @@ export declare const actionErase: {
1046
1216
  zenModeEnabled: boolean;
1047
1217
  theme: string;
1048
1218
  gridSize: number | null;
1219
+ previousGridSize: number | null;
1049
1220
  viewModeEnabled: boolean;
1050
1221
  editingGroupId: string | null;
1051
1222
  width: number;
@@ -1072,14 +1243,13 @@ export declare const actionErase: {
1072
1243
  elementBackground?: string[] | undefined;
1073
1244
  elementStroke?: string[] | undefined;
1074
1245
  };
1246
+ allowWheelZoom?: boolean | undefined;
1247
+ allowPinchZoom?: boolean | undefined;
1075
1248
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
1076
1249
  };
1077
1250
  commitToHistory: true;
1078
1251
  };
1079
1252
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
1080
- PanelComponent: ({ elements, appState, updateData, data }: import("./types").PanelComponentProps & {
1081
- isInHamburgerMenu: boolean;
1082
- }) => JSX.Element;
1083
1253
  } & {
1084
1254
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
1085
1255
  };