@excalidraw/excalidraw 0.18.0-6fc8502 → 0.18.0-a18b139

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 (90) hide show
  1. package/dist/dev/{chunk-H7XJ5UVD.js → chunk-MJMGTOVG.js} +2 -2
  2. package/dist/dev/{chunk-KYBDXI6F.js → chunk-U3G3LY5D.js} +5304 -5762
  3. package/dist/dev/chunk-U3G3LY5D.js.map +7 -0
  4. package/dist/dev/data/{image-NKFINVKH.js → image-Y366K5SN.js} +3 -3
  5. package/dist/dev/index.js +1090 -730
  6. package/dist/dev/index.js.map +4 -4
  7. package/dist/dev/subset-shared.chunk.js +1 -1
  8. package/dist/dev/subset-worker.chunk.js +1 -1
  9. package/dist/prod/chunk-PUQLEN73.js +33 -0
  10. package/dist/prod/{chunk-KJYFYP64.js → chunk-VQA74LVG.js} +1 -1
  11. package/dist/prod/data/image-WY2VMQLG.js +1 -0
  12. package/dist/prod/index.js +17 -17
  13. package/dist/prod/subset-shared.chunk.js +1 -1
  14. package/dist/prod/subset-worker.chunk.js +1 -1
  15. package/dist/types/common/src/constants.d.ts +2 -0
  16. package/dist/types/common/src/utils.d.ts +7 -1
  17. package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +8 -11
  18. package/dist/types/element/src/align.d.ts +3 -3
  19. package/dist/types/element/src/binding.d.ts +10 -11
  20. package/dist/types/element/src/bounds.d.ts +2 -2
  21. package/dist/types/element/src/collision.d.ts +1 -1
  22. package/dist/types/element/src/dragElements.d.ts +3 -2
  23. package/dist/types/element/src/duplicate.d.ts +10 -13
  24. package/dist/types/element/src/elbowArrow.d.ts +1 -1
  25. package/dist/types/element/src/flowchart.d.ts +3 -2
  26. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  27. package/dist/types/element/src/frame.d.ts +2 -2
  28. package/dist/types/element/src/linearElementEditor.d.ts +13 -13
  29. package/dist/types/element/src/mutateElement.d.ts +10 -2
  30. package/dist/types/element/src/resizeElements.d.ts +4 -4
  31. package/dist/types/element/src/selection.d.ts +11 -0
  32. package/dist/types/element/src/sizeHelpers.d.ts +0 -1
  33. package/dist/types/element/src/textElement.d.ts +5 -3
  34. package/dist/types/element/src/zindex.d.ts +3 -3
  35. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
  36. package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
  37. package/dist/types/excalidraw/actions/actionCanvas.d.ts +27 -27
  38. package/dist/types/excalidraw/actions/actionClipboard.d.ts +6 -6
  39. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
  40. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  41. package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -1
  42. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  43. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
  44. package/dist/types/excalidraw/actions/actionExport.d.ts +31 -31
  45. package/dist/types/excalidraw/actions/actionFinalize.d.ts +2 -2
  46. package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -4
  47. package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
  48. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
  49. package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -1
  50. package/dist/types/excalidraw/actions/actionNavigate.d.ts +1 -1
  51. package/dist/types/excalidraw/actions/actionProperties.d.ts +17 -17
  52. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  53. package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -1
  54. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  55. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  56. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -2
  57. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  58. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  59. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
  60. package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -2
  61. package/dist/types/excalidraw/appState.d.ts +15 -15
  62. package/dist/types/excalidraw/components/App.d.ts +15 -4
  63. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
  64. package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  65. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  66. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  67. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
  68. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  69. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  70. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  71. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  72. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  73. package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
  74. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -4
  75. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  76. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  77. package/dist/types/excalidraw/eraser/index.d.ts +14 -0
  78. package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
  79. package/dist/types/excalidraw/lasso/utils.d.ts +1 -2
  80. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -1
  81. package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
  82. package/dist/types/excalidraw/scene/types.d.ts +2 -0
  83. package/dist/types/excalidraw/types.d.ts +6 -0
  84. package/dist/types/math/src/types.d.ts +1 -0
  85. package/package.json +1 -1
  86. package/dist/dev/chunk-KYBDXI6F.js.map +0 -7
  87. package/dist/prod/chunk-CAN5RS4P.js +0 -31
  88. package/dist/prod/data/image-5XD47O4X.js +0 -1
  89. /package/dist/dev/{chunk-H7XJ5UVD.js.map → chunk-MJMGTOVG.js.map} +0 -0
  90. /package/dist/dev/data/{image-NKFINVKH.js.map → image-Y366K5SN.js.map} +0 -0
@@ -96,7 +96,7 @@ export declare const actionChangeFillStyle: {
96
96
  zoom: Readonly<{
97
97
  value: import("../types").NormalizedZoomValue;
98
98
  }>;
99
- openMenu: "shape" | "canvas" | null;
99
+ openMenu: "canvas" | "shape" | null;
100
100
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
101
101
  openSidebar: {
102
102
  name: string;
@@ -282,7 +282,7 @@ export declare const actionChangeStrokeWidth: {
282
282
  zoom: Readonly<{
283
283
  value: import("../types").NormalizedZoomValue;
284
284
  }>;
285
- openMenu: "shape" | "canvas" | null;
285
+ openMenu: "canvas" | "shape" | null;
286
286
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
287
287
  openSidebar: {
288
288
  name: string;
@@ -468,7 +468,7 @@ export declare const actionChangeSloppiness: {
468
468
  zoom: Readonly<{
469
469
  value: import("../types").NormalizedZoomValue;
470
470
  }>;
471
- openMenu: "shape" | "canvas" | null;
471
+ openMenu: "canvas" | "shape" | null;
472
472
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
473
473
  openSidebar: {
474
474
  name: string;
@@ -654,7 +654,7 @@ export declare const actionChangeStrokeStyle: {
654
654
  zoom: Readonly<{
655
655
  value: import("../types").NormalizedZoomValue;
656
656
  }>;
657
- openMenu: "shape" | "canvas" | null;
657
+ openMenu: "canvas" | "shape" | null;
658
658
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
659
659
  openSidebar: {
660
660
  name: string;
@@ -840,7 +840,7 @@ export declare const actionChangeOpacity: {
840
840
  zoom: Readonly<{
841
841
  value: import("../types").NormalizedZoomValue;
842
842
  }>;
843
- openMenu: "shape" | "canvas" | null;
843
+ openMenu: "canvas" | "shape" | null;
844
844
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
845
845
  openSidebar: {
846
846
  name: string;
@@ -1026,7 +1026,7 @@ export declare const actionChangeFontSize: {
1026
1026
  zoom: Readonly<{
1027
1027
  value: import("../types").NormalizedZoomValue;
1028
1028
  }>;
1029
- openMenu: "shape" | "canvas" | null;
1029
+ openMenu: "canvas" | "shape" | null;
1030
1030
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
1031
1031
  openSidebar: {
1032
1032
  name: string;
@@ -1213,7 +1213,7 @@ export declare const actionDecreaseFontSize: {
1213
1213
  zoom: Readonly<{
1214
1214
  value: import("../types").NormalizedZoomValue;
1215
1215
  }>;
1216
- openMenu: "shape" | "canvas" | null;
1216
+ openMenu: "canvas" | "shape" | null;
1217
1217
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
1218
1218
  openSidebar: {
1219
1219
  name: string;
@@ -1400,7 +1400,7 @@ export declare const actionIncreaseFontSize: {
1400
1400
  zoom: Readonly<{
1401
1401
  value: import("../types").NormalizedZoomValue;
1402
1402
  }>;
1403
- openMenu: "shape" | "canvas" | null;
1403
+ openMenu: "canvas" | "shape" | null;
1404
1404
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
1405
1405
  openSidebar: {
1406
1406
  name: string;
@@ -1518,8 +1518,8 @@ export declare const actionChangeFontFamily: {
1518
1518
  trackEvent: false;
1519
1519
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, value: any, app: AppClassProperties) => {
1520
1520
  appState: {
1521
- currentHoveredFontFamily: number | null;
1522
1521
  currentItemFontFamily: number;
1522
+ currentHoveredFontFamily: number | null;
1523
1523
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
1524
1524
  contextMenu: {
1525
1525
  items: import("../components/ContextMenu").ContextMenuItems;
@@ -1586,7 +1586,7 @@ export declare const actionChangeFontFamily: {
1586
1586
  zoom: Readonly<{
1587
1587
  value: import("../types").NormalizedZoomValue;
1588
1588
  }>;
1589
- openMenu: "shape" | "canvas" | null;
1589
+ openMenu: "canvas" | "shape" | null;
1590
1590
  openSidebar: {
1591
1591
  name: string;
1592
1592
  tab?: string | undefined;
@@ -1695,8 +1695,8 @@ export declare const actionChangeFontFamily: {
1695
1695
  } | {
1696
1696
  elements: ExcalidrawElement[];
1697
1697
  appState: {
1698
- currentHoveredFontFamily: number | null;
1699
1698
  currentItemFontFamily: number;
1699
+ currentHoveredFontFamily: number | null;
1700
1700
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
1701
1701
  contextMenu: {
1702
1702
  items: import("../components/ContextMenu").ContextMenuItems;
@@ -1763,7 +1763,7 @@ export declare const actionChangeFontFamily: {
1763
1763
  zoom: Readonly<{
1764
1764
  value: import("../types").NormalizedZoomValue;
1765
1765
  }>;
1766
- openMenu: "shape" | "canvas" | null;
1766
+ openMenu: "canvas" | "shape" | null;
1767
1767
  openSidebar: {
1768
1768
  name: string;
1769
1769
  tab?: string | undefined;
@@ -1948,7 +1948,7 @@ export declare const actionChangeTextAlign: {
1948
1948
  zoom: Readonly<{
1949
1949
  value: import("../types").NormalizedZoomValue;
1950
1950
  }>;
1951
- openMenu: "shape" | "canvas" | null;
1951
+ openMenu: "canvas" | "shape" | null;
1952
1952
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
1953
1953
  openSidebar: {
1954
1954
  name: string;
@@ -2136,7 +2136,7 @@ export declare const actionChangeVerticalAlign: {
2136
2136
  zoom: Readonly<{
2137
2137
  value: import("../types").NormalizedZoomValue;
2138
2138
  }>;
2139
- openMenu: "shape" | "canvas" | null;
2139
+ openMenu: "canvas" | "shape" | null;
2140
2140
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
2141
2141
  openSidebar: {
2142
2142
  name: string;
@@ -2322,7 +2322,7 @@ export declare const actionChangeRoundness: {
2322
2322
  zoom: Readonly<{
2323
2323
  value: import("../types").NormalizedZoomValue;
2324
2324
  }>;
2325
- openMenu: "shape" | "canvas" | null;
2325
+ openMenu: "canvas" | "shape" | null;
2326
2326
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
2327
2327
  openSidebar: {
2328
2328
  name: string;
@@ -2511,7 +2511,7 @@ export declare const actionChangeArrowhead: {
2511
2511
  zoom: Readonly<{
2512
2512
  value: import("../types").NormalizedZoomValue;
2513
2513
  }>;
2514
- openMenu: "shape" | "canvas" | null;
2514
+ openMenu: "canvas" | "shape" | null;
2515
2515
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
2516
2516
  openSidebar: {
2517
2517
  name: string;
@@ -2697,7 +2697,7 @@ export declare const actionChangeArrowType: {
2697
2697
  zoom: Readonly<{
2698
2698
  value: import("../types").NormalizedZoomValue;
2699
2699
  }>;
2700
- openMenu: "shape" | "canvas" | null;
2700
+ openMenu: "canvas" | "shape" | null;
2701
2701
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
2702
2702
  openSidebar: {
2703
2703
  name: string;
@@ -86,7 +86,7 @@ export declare const actionSelectAll: {
86
86
  zoom: Readonly<{
87
87
  value: import("../types").NormalizedZoomValue;
88
88
  }>;
89
- openMenu: "shape" | "canvas" | null;
89
+ openMenu: "canvas" | "shape" | null;
90
90
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
91
91
  openSidebar: {
92
92
  name: string;
@@ -79,7 +79,7 @@ export declare const actionCopyStyles: {
79
79
  zoom: Readonly<{
80
80
  value: import("../types").NormalizedZoomValue;
81
81
  }>;
82
- openMenu: "shape" | "canvas" | null;
82
+ openMenu: "canvas" | "shape" | null;
83
83
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
84
84
  openSidebar: {
85
85
  name: string;
@@ -81,7 +81,7 @@ export declare const actionToggleGridMode: {
81
81
  zoom: Readonly<{
82
82
  value: import("../types").NormalizedZoomValue;
83
83
  }>;
84
- openMenu: "shape" | "canvas" | null;
84
+ openMenu: "canvas" | "shape" | null;
85
85
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
86
86
  openSidebar: {
87
87
  name: string;
@@ -79,7 +79,7 @@ export declare const actionToggleObjectsSnapMode: {
79
79
  zoom: Readonly<{
80
80
  value: import("../types").NormalizedZoomValue;
81
81
  }>;
82
- openMenu: "shape" | "canvas" | null;
82
+ openMenu: "canvas" | "shape" | null;
83
83
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
84
84
  openSidebar: {
85
85
  name: string;
@@ -81,7 +81,7 @@ export declare const actionToggleSearchMenu: {
81
81
  zoom: Readonly<{
82
82
  value: import("../types").NormalizedZoomValue;
83
83
  }>;
84
- openMenu: "shape" | "canvas" | null;
84
+ openMenu: "canvas" | "shape" | null;
85
85
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
86
86
  openDialog: {
87
87
  name: "imageExport" | "help" | "jsonExport";
@@ -258,7 +258,7 @@ export declare const actionToggleSearchMenu: {
258
258
  zoom: Readonly<{
259
259
  value: import("../types").NormalizedZoomValue;
260
260
  }>;
261
- openMenu: "shape" | "canvas" | null;
261
+ openMenu: "canvas" | "shape" | null;
262
262
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
263
263
  defaultSidebarDockedPreference: boolean;
264
264
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -81,7 +81,7 @@ export declare const actionToggleStats: {
81
81
  zoom: Readonly<{
82
82
  value: import("../types").NormalizedZoomValue;
83
83
  }>;
84
- openMenu: "shape" | "canvas" | null;
84
+ openMenu: "canvas" | "shape" | null;
85
85
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
86
86
  openSidebar: {
87
87
  name: string;
@@ -78,7 +78,7 @@ export declare const actionToggleViewMode: {
78
78
  zoom: Readonly<{
79
79
  value: import("../types").NormalizedZoomValue;
80
80
  }>;
81
- openMenu: "shape" | "canvas" | null;
81
+ openMenu: "canvas" | "shape" | null;
82
82
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
83
83
  openSidebar: {
84
84
  name: string;
@@ -78,7 +78,7 @@ export declare const actionToggleZenMode: {
78
78
  zoom: Readonly<{
79
79
  value: import("../types").NormalizedZoomValue;
80
80
  }>;
81
- openMenu: "shape" | "canvas" | null;
81
+ openMenu: "canvas" | "shape" | null;
82
82
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
83
83
  openSidebar: {
84
84
  name: string;
@@ -46,7 +46,7 @@ export declare const actionSendToBack: {
46
46
  category: "element";
47
47
  };
48
48
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
49
- elements: readonly import("@excalidraw/element/types").ExcalidrawElement[] | import("@excalidraw/element/types").ExcalidrawElement[];
49
+ elements: import("@excalidraw/element/types").ExcalidrawElement[] | readonly import("@excalidraw/element/types").ExcalidrawElement[];
50
50
  appState: Readonly<import("../types").AppState>;
51
51
  captureUpdate: "IMMEDIATELY";
52
52
  };
@@ -64,7 +64,7 @@ export declare const actionBringToFront: {
64
64
  category: "element";
65
65
  };
66
66
  perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
67
- elements: readonly import("@excalidraw/element/types").ExcalidrawElement[] | import("@excalidraw/element/types").ExcalidrawElement[];
67
+ elements: import("@excalidraw/element/types").ExcalidrawElement[] | readonly import("@excalidraw/element/types").ExcalidrawElement[];
68
68
  appState: Readonly<import("../types").AppState>;
69
69
  captureUpdate: "IMMEDIATELY";
70
70
  };
@@ -1,13 +1,18 @@
1
1
  import type { AppState, NormalizedZoomValue } from "./types";
2
2
  export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
3
3
  export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
4
- viewBackgroundColor?: string | undefined;
5
4
  name?: string | null | undefined;
5
+ activeTool?: ({
6
+ lastActiveTool: import("./types").ActiveTool | null;
7
+ locked: boolean;
8
+ fromSelection: boolean;
9
+ } & import("./types").ActiveTool) | undefined;
6
10
  zoom?: Readonly<{
7
11
  value: NormalizedZoomValue;
8
12
  }> | undefined;
9
13
  scrollX?: number | undefined;
10
14
  scrollY?: number | undefined;
15
+ viewBackgroundColor?: string | undefined;
11
16
  editingGroupId?: string | null | undefined;
12
17
  selectedElementIds?: Readonly<{
13
18
  [id: string]: true;
@@ -18,23 +23,13 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
18
23
  } | undefined;
19
24
  selectedLinearElement?: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null | undefined;
20
25
  zenModeEnabled?: boolean | undefined;
21
- gridModeEnabled?: boolean | undefined;
22
- objectsSnapModeEnabled?: boolean | undefined;
23
- shouldCacheIgnoreZoom?: boolean | undefined;
24
- exportScale?: number | undefined;
25
- gridSize?: number | undefined;
26
- gridStep?: number | undefined;
27
26
  showWelcomeScreen?: boolean | undefined;
28
- activeTool?: ({
29
- lastActiveTool: import("./types").ActiveTool | null;
30
- locked: boolean;
31
- fromSelection: boolean;
32
- } & import("./types").ActiveTool) | undefined;
33
27
  penMode?: boolean | undefined;
34
28
  penDetected?: boolean | undefined;
35
29
  exportBackground?: boolean | undefined;
36
30
  exportEmbedScene?: boolean | undefined;
37
31
  exportWithDarkMode?: boolean | undefined;
32
+ exportScale?: number | undefined;
38
33
  currentItemStrokeColor?: string | undefined;
39
34
  currentItemBackgroundColor?: string | undefined;
40
35
  currentItemFillStyle?: import("@excalidraw/element/types").FillStyle | undefined;
@@ -51,7 +46,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
51
46
  currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
52
47
  cursorButton?: "up" | "down" | undefined;
53
48
  scrolledOutside?: boolean | undefined;
54
- openMenu?: "shape" | "canvas" | null | undefined;
49
+ openMenu?: "canvas" | "shape" | null | undefined;
55
50
  openSidebar?: {
56
51
  name: string;
57
52
  tab?: string | undefined;
@@ -61,23 +56,28 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
61
56
  previousSelectedElementIds?: {
62
57
  [id: string]: true;
63
58
  } | undefined;
59
+ shouldCacheIgnoreZoom?: boolean | undefined;
60
+ gridSize?: number | undefined;
61
+ gridStep?: number | undefined;
62
+ gridModeEnabled?: boolean | undefined;
64
63
  stats?: {
65
64
  open: boolean;
66
65
  panels: number;
67
66
  } | undefined;
68
67
  currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
68
+ objectsSnapModeEnabled?: boolean | undefined;
69
69
  };
70
70
  export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
71
71
  viewBackgroundColor?: string | undefined;
72
- gridModeEnabled?: boolean | undefined;
73
72
  gridSize?: number | undefined;
74
73
  gridStep?: number | undefined;
74
+ gridModeEnabled?: boolean | undefined;
75
75
  };
76
76
  export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
77
77
  viewBackgroundColor?: string | undefined;
78
- gridModeEnabled?: boolean | undefined;
79
78
  gridSize?: number | undefined;
80
79
  gridStep?: number | undefined;
80
+ gridModeEnabled?: boolean | undefined;
81
81
  };
82
82
  export declare const isEraserActive: ({ activeTool, }: {
83
83
  activeTool: AppState["activeTool"];
@@ -2,18 +2,20 @@ import React from "react";
2
2
  import { type EXPORT_IMAGE_TYPES } from "@excalidraw/common";
3
3
  import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
4
4
  import { FlowChartCreator } from "@excalidraw/element/flowchart";
5
+ import Scene from "@excalidraw/element/Scene";
6
+ import type { ElementUpdate } from "@excalidraw/element/mutateElement";
5
7
  import type { ExcalidrawElement, NonDeleted, InitializedExcalidrawImageElement, ExcalidrawImageElement, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered } from "@excalidraw/element/types";
8
+ import type { Mutable } from "@excalidraw/common/utility-types";
6
9
  import { ActionManager } from "../actions/manager";
7
10
  import { AnimationFrameHandler } from "../animation-frame-handler";
8
11
  import { History } from "../history";
9
- import Scene from "../scene/Scene";
10
12
  import { Fonts } from "../fonts";
11
13
  import { Renderer } from "../scene/Renderer";
12
14
  import { Emitter } from "../emitter";
13
15
  import { Store } from "../store";
14
- import { AnimatedTrail } from "../animated-trail";
15
16
  import { LaserTrails } from "../laser-trails";
16
17
  import { LassoTrail } from "../lasso";
18
+ import { EraserTrail } from "../eraser";
17
19
  import type { ExportedElements } from "../data";
18
20
  import type { FileSystemHandle } from "../data/filesystem";
19
21
  import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
@@ -97,7 +99,7 @@ declare class App extends React.Component<AppProps, AppState> {
97
99
  };
98
100
  animationFrameHandler: AnimationFrameHandler;
99
101
  laserTrails: LaserTrails;
100
- eraserTrail: AnimatedTrail;
102
+ eraserTrail: EraserTrail;
101
103
  lassoTrail: LassoTrail;
102
104
  onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
103
105
  onPointerDownEmitter: Emitter<[activeTool: {
@@ -150,6 +152,10 @@ declare class App extends React.Component<AppProps, AppState> {
150
152
  x: number;
151
153
  y: number;
152
154
  } | null;
155
+ origin: {
156
+ x: number;
157
+ y: number;
158
+ };
153
159
  };
154
160
  eventListeners: {
155
161
  onMove: {
@@ -215,6 +221,10 @@ declare class App extends React.Component<AppProps, AppState> {
215
221
  x: number;
216
222
  y: number;
217
223
  } | null;
224
+ origin: {
225
+ x: number;
226
+ y: number;
227
+ };
218
228
  };
219
229
  eventListeners: {
220
230
  onMove: {
@@ -388,6 +398,7 @@ declare class App extends React.Component<AppProps, AppState> {
388
398
  */
389
399
  captureUpdate?: SceneData["captureUpdate"];
390
400
  }) => void;
401
+ mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
391
402
  private triggerRender;
392
403
  /**
393
404
  * @returns whether the menu was toggled on or off
@@ -433,7 +444,7 @@ declare class App extends React.Component<AppProps, AppState> {
433
444
  private getTextElementAtPosition;
434
445
  private getElementAtPosition;
435
446
  private getElementsAtPosition;
436
- private getElementHitThreshold;
447
+ getElementHitThreshold(): number;
437
448
  private hitElement;
438
449
  private getTextBindableContainerAtPosition;
439
450
  private startTextEditing;
@@ -1,10 +1,11 @@
1
- import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type Scene from "@excalidraw/element/Scene";
2
3
  import "./ElementLinkDialog.scss";
3
4
  import type { AppProps, UIAppState } from "../types";
4
- declare const ElementLinkDialog: ({ sourceElementId, onClose, elementsMap, appState, generateLinkForSelection, }: {
5
+ declare const ElementLinkDialog: ({ sourceElementId, onClose, appState, scene, generateLinkForSelection, }: {
5
6
  sourceElementId: ExcalidrawElement["id"];
6
- elementsMap: ElementsMap;
7
7
  appState: UIAppState;
8
+ scene: Scene;
8
9
  onClose?: (() => void) | undefined;
9
10
  generateLinkForSelection: AppProps["generateLinkForSelection"];
10
11
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  interface AngleProps {
5
5
  element: ExcalidrawElement;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type Scene from "../../scene/Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  interface PositionProps {
5
5
  property: "gridStep";
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  interface DimensionDragInputProps {
5
5
  property: "width" | "height";
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
3
+ import type Scene from "@excalidraw/element/Scene";
3
4
  import "./DragInput.scss";
4
5
  import type { StatsInputProperty } from "./utils";
5
- import type Scene from "../../scene/Scene";
6
6
  import type { AppState } from "../../types";
7
7
  export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawElement> = (props: {
8
8
  accumulatedChange: number;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  interface FontSizeProps {
5
5
  element: ExcalidrawElement;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  interface MultiAngleProps {
5
5
  elements: readonly ExcalidrawElement[];
@@ -1,6 +1,6 @@
1
1
  import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
+ import type Scene from "@excalidraw/element/Scene";
2
3
  import type { AtomicUnit } from "./utils";
3
- import type Scene from "../../scene/Scene";
4
4
  import type { AppState } from "../../types";
5
5
  interface MultiDimensionProps {
6
6
  property: "width" | "height";
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  interface MultiFontSizeProps {
5
5
  elements: readonly ExcalidrawElement[];
@@ -1,6 +1,6 @@
1
1
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type Scene from "@excalidraw/element/Scene";
2
3
  import type { AtomicUnit } from "./utils";
3
- import type Scene from "../../scene/Scene";
4
4
  import type { AppState } from "../../types";
5
5
  interface MultiPositionProps {
6
6
  property: "x" | "y";
@@ -1,5 +1,5 @@
1
1
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  interface PositionProps {
5
5
  property: "x" | "y";
@@ -1,5 +1,5 @@
1
- import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
1
+ import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../../types";
4
4
  export type StatsInputProperty = "x" | "y" | "width" | "height" | "angle" | "fontSize" | "gridStep";
5
5
  export declare const SMALLEST_DELTA = 0.01;
@@ -14,9 +14,9 @@ export declare const newOrigin: (x1: number, y1: number, w1: number, h1: number,
14
14
  x: number;
15
15
  y: number;
16
16
  };
17
- export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement, elementsMap: NonDeletedSceneElementsMap, elements: readonly NonDeletedExcalidrawElement[], scene: Scene, originalElementsMap: ElementsMap, shouldInformMutation?: boolean) => void;
17
+ export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement, scene: Scene, originalElementsMap: ElementsMap, shouldInformMutation?: boolean) => void;
18
18
  export declare const getAtomicUnits: (targetElements: readonly ExcalidrawElement[], appState: AppState) => AtomicUnit[];
19
- export declare const updateBindings: (latestElement: ExcalidrawElement, elementsMap: NonDeletedSceneElementsMap, elements: readonly NonDeletedExcalidrawElement[], scene: Scene, options?: {
19
+ export declare const updateBindings: (latestElement: ExcalidrawElement, scene: Scene, options?: {
20
20
  simultaneouslyUpdated?: readonly ExcalidrawElement[];
21
21
  newSize?: {
22
22
  width: number;
@@ -14,6 +14,7 @@ type InteractiveCanvasProps = {
14
14
  selectionNonce: number | undefined;
15
15
  scale: number;
16
16
  appState: InteractiveCanvasAppState;
17
+ renderScrollbars: boolean;
17
18
  device: Device;
18
19
  renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
19
20
  handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
@@ -1,9 +1,10 @@
1
+ import type Scene from "@excalidraw/element/Scene";
1
2
  import type { ElementsMap, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
3
  import "./Hyperlink.scss";
3
4
  import type { AppState, ExcalidrawProps, UIAppState } from "../../types";
4
- export declare const Hyperlink: ({ element, elementsMap, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
5
+ export declare const Hyperlink: ({ element, scene, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
5
6
  element: NonDeletedExcalidrawElement;
6
- elementsMap: ElementsMap;
7
+ scene: Scene;
7
8
  setAppState: React.Component<any, AppState>["setState"];
8
9
  onLinkOpen: ExcalidrawProps["onLinkOpen"];
9
10
  setToast: (toast: {
@@ -0,0 +1,14 @@
1
+ import { AnimatedTrail } from "../animated-trail";
2
+ import type { AnimationFrameHandler } from "../animation-frame-handler";
3
+ import type App from "../components/App";
4
+ export declare class EraserTrail extends AnimatedTrail {
5
+ private elementsToErase;
6
+ private groupsToErase;
7
+ private segmentsCache;
8
+ private geometricShapesCache;
9
+ constructor(animationFrameHandler: AnimationFrameHandler, app: App);
10
+ startPath(x: number, y: number): void;
11
+ addPointToPath(x: number, y: number, restore?: boolean): string[];
12
+ private updateElementsToBeErased;
13
+ endPath(): void;
14
+ }
@@ -1,7 +1,7 @@
1
1
  import { type FontMetadata } from "@excalidraw/common";
2
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
+ import type Scene from "@excalidraw/element/Scene";
3
4
  import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
4
- import type Scene from "../scene/Scene";
5
5
  export declare class Fonts {
6
6
  static readonly loadedFontsCache: Set<string>;
7
7
  private static _registered;
@@ -1,6 +1,5 @@
1
- import type { GlobalPoint, LineSegment } from "@excalidraw/math/types";
1
+ import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
2
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
- export type ElementsSegmentsMap = Map<string, LineSegment<GlobalPoint>[]>;
4
3
  export declare const getLassoSelectedElementIds: (input: {
5
4
  lassoPath: GlobalPoint[];
6
5
  elements: readonly ExcalidrawElement[];
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "./Scene";
2
+ import type Scene from "@excalidraw/element/Scene";
3
3
  import type { AppState } from "../types";
4
4
  export declare class Renderer {
5
5
  private scene;
@@ -1,10 +1,9 @@
1
- import type { ExcalidrawElement } from "@excalidraw/element/types";
2
1
  import type { InteractiveCanvasAppState } from "../types";
3
- import type { ScrollBars } from "./types";
2
+ import type { RenderableElementsMap, ScrollBars } from "./types";
4
3
  export declare const SCROLLBAR_MARGIN = 4;
5
4
  export declare const SCROLLBAR_WIDTH = 6;
6
5
  export declare const SCROLLBAR_COLOR = "rgba(0,0,0,0.3)";
7
- export declare const getScrollBars: (elements: readonly ExcalidrawElement[], viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
6
+ export declare const getScrollBars: (elements: RenderableElementsMap, viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
8
7
  export declare const isOverScrollBars: (scrollBars: ScrollBars, x: number, y: number) => {
9
8
  isOverEither: boolean;
10
9
  isOverHorizontal: boolean;