@excalidraw/excalidraw 0.18.0-864353b → 0.18.0-880dbb25e

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 (114) hide show
  1. package/dist/dev/{chunk-BBNNHA7I.js → chunk-CP5DND7P.js} +2 -2
  2. package/dist/dev/{chunk-BBNNHA7I.js.map → chunk-CP5DND7P.js.map} +1 -1
  3. package/dist/dev/chunk-CRKRRBMD.js +5677 -0
  4. package/dist/dev/chunk-CRKRRBMD.js.map +7 -0
  5. package/dist/dev/{chunk-7YMZV3TY.js → chunk-QF5FRM6O.js} +2 -2
  6. package/dist/dev/{chunk-7YMZV3TY.js.map → chunk-QF5FRM6O.js.map} +2 -2
  7. package/dist/dev/data/{image-OFYK7EOY.js → image-IWGLHPIX.js} +3 -3
  8. package/dist/dev/index.css +4 -0
  9. package/dist/dev/index.css.map +2 -2
  10. package/dist/dev/index.js +6341 -4110
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-KIY5SGI3.js → en-SMAPCEOQ.js} +2 -2
  13. package/dist/dev/subset-shared.chunk.js +1 -1
  14. package/dist/dev/subset-worker.chunk.js +1 -1
  15. package/dist/prod/{chunk-UH6Q3EIV.js → chunk-A66AFZZU.js} +1 -1
  16. package/dist/prod/chunk-HHV2PJKY.js +4 -0
  17. package/dist/prod/{chunk-OUULIERA.js → chunk-I4UNSFV6.js} +3 -3
  18. package/dist/prod/data/image-4SM4COIL.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +25 -18
  21. package/dist/prod/locales/{en-GCLCIHXH.js → en-TYY6KWIJ.js} +1 -1
  22. package/dist/prod/subset-shared.chunk.js +1 -1
  23. package/dist/prod/subset-worker.chunk.js +1 -1
  24. package/dist/types/common/src/constants.d.ts +12 -2
  25. package/dist/types/common/src/utils.d.ts +3 -5
  26. package/dist/types/element/src/Scene.d.ts +7 -3
  27. package/dist/types/element/src/align.d.ts +2 -1
  28. package/dist/types/element/src/binding.d.ts +10 -7
  29. package/dist/types/element/src/bounds.d.ts +11 -3
  30. package/dist/types/element/src/collision.d.ts +18 -12
  31. package/dist/types/element/src/cropElement.d.ts +1 -1
  32. package/dist/types/element/src/delta.d.ts +43 -10
  33. package/dist/types/element/src/distance.d.ts +2 -2
  34. package/dist/types/element/src/distribute.d.ts +2 -1
  35. package/dist/types/element/src/fractionalIndex.d.ts +8 -2
  36. package/dist/types/element/src/frame.d.ts +2 -2
  37. package/dist/types/element/src/groups.d.ts +1 -0
  38. package/dist/types/element/src/index.d.ts +1 -3
  39. package/dist/types/element/src/linearElementEditor.d.ts +5 -7
  40. package/dist/types/element/src/mutateElement.d.ts +1 -1
  41. package/dist/types/element/src/resizeElements.d.ts +1 -0
  42. package/dist/types/element/src/selection.d.ts +1 -1
  43. package/dist/types/element/src/shape.d.ts +42 -0
  44. package/dist/types/element/src/store.d.ts +18 -9
  45. package/dist/types/element/src/transformHandles.d.ts +4 -4
  46. package/dist/types/element/src/typeChecks.d.ts +4 -0
  47. package/dist/types/element/src/types.d.ts +1 -1
  48. package/dist/types/element/src/utils.d.ts +16 -6
  49. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +9 -15
  50. package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
  51. package/dist/types/excalidraw/actions/actionBoundText.d.ts +6 -10
  52. package/dist/types/excalidraw/actions/actionCanvas.d.ts +129 -155
  53. package/dist/types/excalidraw/actions/actionClipboard.d.ts +25 -36
  54. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +3 -5
  55. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +14 -20
  56. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
  57. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  58. package/dist/types/excalidraw/actions/actionElementLink.d.ts +2 -4
  59. package/dist/types/excalidraw/actions/actionElementLock.d.ts +8 -12
  60. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +3 -5
  61. package/dist/types/excalidraw/actions/actionExport.d.ts +112 -130
  62. package/dist/types/excalidraw/actions/actionFinalize.d.ts +9 -12
  63. package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
  64. package/dist/types/excalidraw/actions/actionFrame.d.ts +62 -70
  65. package/dist/types/excalidraw/actions/actionGroup.d.ts +12 -16
  66. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +84 -55
  67. package/dist/types/excalidraw/actions/actionLink.d.ts +4 -6
  68. package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -16
  69. package/dist/types/excalidraw/actions/actionNavigate.d.ts +6 -10
  70. package/dist/types/excalidraw/actions/actionProperties.d.ts +49 -79
  71. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +6 -8
  72. package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -9
  73. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +5 -7
  74. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -7
  75. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -6
  76. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -7
  77. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -7
  78. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -7
  79. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
  80. package/dist/types/excalidraw/appState.d.ts +20 -20
  81. package/dist/types/excalidraw/components/Actions.d.ts +0 -4
  82. package/dist/types/excalidraw/components/App.d.ts +16 -17
  83. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  84. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +11 -1
  85. package/dist/types/excalidraw/components/shapes.d.ts +1 -1
  86. package/dist/types/excalidraw/data/blob.d.ts +1 -1
  87. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  88. package/dist/types/excalidraw/data/restore.d.ts +6 -1
  89. package/dist/types/excalidraw/eraser/index.d.ts +0 -2
  90. package/dist/types/excalidraw/history.d.ts +21 -5
  91. package/dist/types/excalidraw/index.d.ts +2 -1
  92. package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
  93. package/dist/types/excalidraw/renderer/helpers.d.ts +3 -3
  94. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  95. package/dist/types/excalidraw/scene/Renderer.d.ts +0 -1
  96. package/dist/types/excalidraw/types.d.ts +7 -8
  97. package/dist/types/math/src/constants.d.ts +3 -0
  98. package/dist/types/math/src/curve.d.ts +32 -0
  99. package/dist/types/math/src/index.d.ts +1 -0
  100. package/dist/types/math/src/rectangle.d.ts +2 -0
  101. package/dist/types/math/src/vector.d.ts +4 -2
  102. package/history.ts +107 -44
  103. package/package.json +12 -9
  104. package/dist/dev/chunk-LL55DS44.js +0 -23677
  105. package/dist/dev/chunk-LL55DS44.js.map +0 -7
  106. package/dist/prod/chunk-F44EGBV2.js +0 -33
  107. package/dist/prod/data/image-CUOH64HE.js +0 -1
  108. package/dist/types/element/src/Shape.d.ts +0 -17
  109. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  110. package/dist/types/element/src/shapes.d.ts +0 -27
  111. package/dist/types/excalidraw/visualdebug.d.ts +0 -41
  112. package/dist/types/utils/src/collision.d.ts +0 -8
  113. /package/dist/dev/data/{image-OFYK7EOY.js.map → image-IWGLHPIX.js.map} +0 -0
  114. /package/dist/dev/locales/{en-KIY5SGI3.js.map → en-SMAPCEOQ.js.map} +0 -0
@@ -22,7 +22,7 @@ export declare const actionCopyStyles: {
22
22
  errorMessage: import("react").ReactNode;
23
23
  activeEmbeddable: {
24
24
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
25
- state: "hover" | "active";
25
+ state: "active" | "hover";
26
26
  } | null;
27
27
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
28
28
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -41,7 +41,6 @@ export declare const actionCopyStyles: {
41
41
  editingFrame: string | null;
42
42
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
43
43
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
44
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
45
44
  activeTool: {
46
45
  lastActiveTool: import("../types").ActiveTool | null;
47
46
  locked: boolean;
@@ -89,7 +88,7 @@ export declare const actionCopyStyles: {
89
88
  name: "imageExport" | "help" | "jsonExport";
90
89
  } | {
91
90
  name: "ttd";
92
- tab: "text-to-diagram" | "mermaid";
91
+ tab: "mermaid" | "text-to-diagram";
93
92
  } | {
94
93
  name: "commandPalette";
95
94
  } | {
@@ -156,8 +155,7 @@ export declare const actionCopyStyles: {
156
155
  shown: true;
157
156
  data: import("../charts").Spreadsheet;
158
157
  };
159
- pendingImageElementId: string | null;
160
- showHyperlinkPopup: false | "info" | "editor";
158
+ showHyperlinkPopup: false | "editor" | "info";
161
159
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
162
160
  snapLines: readonly import("../snapping").SnapLine[];
163
161
  originSnapOffset: {
@@ -180,9 +178,9 @@ export declare const actionCopyStyles: {
180
178
  };
181
179
  captureUpdate: "EVENTUALLY";
182
180
  };
183
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
181
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
184
182
  } & {
185
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
183
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
186
184
  };
187
185
  export declare const actionPasteStyles: {
188
186
  name: "pasteStyles";
@@ -198,7 +196,7 @@ export declare const actionPasteStyles: {
198
196
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
199
197
  captureUpdate: "IMMEDIATELY";
200
198
  };
201
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
199
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
202
200
  } & {
203
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
201
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
204
202
  };
@@ -24,7 +24,7 @@ export declare const actionToggleGridMode: {
24
24
  errorMessage: import("react").ReactNode;
25
25
  activeEmbeddable: {
26
26
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
27
- state: "hover" | "active";
27
+ state: "active" | "hover";
28
28
  } | null;
29
29
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
30
30
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -43,7 +43,6 @@ export declare const actionToggleGridMode: {
43
43
  editingFrame: string | null;
44
44
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
45
45
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
46
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
47
46
  activeTool: {
48
47
  lastActiveTool: import("../types").ActiveTool | null;
49
48
  locked: boolean;
@@ -91,7 +90,7 @@ export declare const actionToggleGridMode: {
91
90
  name: "imageExport" | "help" | "jsonExport";
92
91
  } | {
93
92
  name: "ttd";
94
- tab: "text-to-diagram" | "mermaid";
93
+ tab: "mermaid" | "text-to-diagram";
95
94
  } | {
96
95
  name: "commandPalette";
97
96
  } | {
@@ -162,8 +161,7 @@ export declare const actionToggleGridMode: {
162
161
  shown: true;
163
162
  data: import("../charts").Spreadsheet;
164
163
  };
165
- pendingImageElementId: string | null;
166
- showHyperlinkPopup: false | "info" | "editor";
164
+ showHyperlinkPopup: false | "editor" | "info";
167
165
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
168
166
  snapLines: readonly import("../snapping").SnapLine[];
169
167
  originSnapOffset: {
@@ -187,7 +185,7 @@ export declare const actionToggleGridMode: {
187
185
  };
188
186
  checked: (appState: AppState) => boolean;
189
187
  predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
190
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
188
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
191
189
  } & {
192
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
190
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
193
191
  };
@@ -22,7 +22,7 @@ export declare const actionToggleObjectsSnapMode: {
22
22
  errorMessage: import("react").ReactNode;
23
23
  activeEmbeddable: {
24
24
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
25
- state: "hover" | "active";
25
+ state: "active" | "hover";
26
26
  } | null;
27
27
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
28
28
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -41,7 +41,6 @@ export declare const actionToggleObjectsSnapMode: {
41
41
  editingFrame: string | null;
42
42
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
43
43
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
44
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
45
44
  activeTool: {
46
45
  lastActiveTool: import("../types").ActiveTool | null;
47
46
  locked: boolean;
@@ -89,7 +88,7 @@ export declare const actionToggleObjectsSnapMode: {
89
88
  name: "imageExport" | "help" | "jsonExport";
90
89
  } | {
91
90
  name: "ttd";
92
- tab: "text-to-diagram" | "mermaid";
91
+ tab: "mermaid" | "text-to-diagram";
93
92
  } | {
94
93
  name: "commandPalette";
95
94
  } | {
@@ -160,8 +159,7 @@ export declare const actionToggleObjectsSnapMode: {
160
159
  shown: true;
161
160
  data: import("../charts").Spreadsheet;
162
161
  };
163
- pendingImageElementId: string | null;
164
- showHyperlinkPopup: false | "info" | "editor";
162
+ showHyperlinkPopup: false | "editor" | "info";
165
163
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
166
164
  snapLines: readonly import("../snapping").SnapLine[];
167
165
  originSnapOffset: {
@@ -185,7 +183,7 @@ export declare const actionToggleObjectsSnapMode: {
185
183
  };
186
184
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
187
185
  predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
188
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
186
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
189
187
  } & {
190
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
188
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
191
189
  };
@@ -28,7 +28,7 @@ export declare const actionToggleSearchMenu: {
28
28
  errorMessage: import("react").ReactNode;
29
29
  activeEmbeddable: {
30
30
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
31
- state: "hover" | "active";
31
+ state: "active" | "hover";
32
32
  } | null;
33
33
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
34
34
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -47,7 +47,6 @@ export declare const actionToggleSearchMenu: {
47
47
  editingFrame: string | null;
48
48
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
49
49
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
50
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
51
50
  activeTool: {
52
51
  lastActiveTool: import("../types").ActiveTool | null;
53
52
  locked: boolean;
@@ -152,8 +151,7 @@ export declare const actionToggleSearchMenu: {
152
151
  shown: true;
153
152
  data: import("../charts").Spreadsheet;
154
153
  };
155
- pendingImageElementId: string | null;
156
- showHyperlinkPopup: false | "info" | "editor";
154
+ showHyperlinkPopup: false | "editor" | "info";
157
155
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
158
156
  snapLines: readonly import("../snapping").SnapLine[];
159
157
  originSnapOffset: {
@@ -178,7 +176,7 @@ export declare const actionToggleSearchMenu: {
178
176
  };
179
177
  checked: (appState: AppState) => boolean;
180
178
  predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
181
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
179
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
182
180
  } & {
183
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
181
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
184
182
  };
@@ -24,7 +24,7 @@ export declare const actionToggleStats: {
24
24
  errorMessage: import("react").ReactNode;
25
25
  activeEmbeddable: {
26
26
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
27
- state: "hover" | "active";
27
+ state: "active" | "hover";
28
28
  } | null;
29
29
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
30
30
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -43,7 +43,6 @@ export declare const actionToggleStats: {
43
43
  editingFrame: string | null;
44
44
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
45
45
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
46
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
47
46
  activeTool: {
48
47
  lastActiveTool: import("../types").ActiveTool | null;
49
48
  locked: boolean;
@@ -91,7 +90,7 @@ export declare const actionToggleStats: {
91
90
  name: "imageExport" | "help" | "jsonExport";
92
91
  } | {
93
92
  name: "ttd";
94
- tab: "text-to-diagram" | "mermaid";
93
+ tab: "mermaid" | "text-to-diagram";
95
94
  } | {
96
95
  name: "commandPalette";
97
96
  } | {
@@ -159,8 +158,7 @@ export declare const actionToggleStats: {
159
158
  shown: true;
160
159
  data: import("../charts").Spreadsheet;
161
160
  };
162
- pendingImageElementId: string | null;
163
- showHyperlinkPopup: false | "info" | "editor";
161
+ showHyperlinkPopup: false | "editor" | "info";
164
162
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
165
163
  snapLines: readonly import("../snapping").SnapLine[];
166
164
  originSnapOffset: {
@@ -184,7 +182,7 @@ export declare const actionToggleStats: {
184
182
  captureUpdate: "EVENTUALLY";
185
183
  };
186
184
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
187
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
185
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
188
186
  } & {
189
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
187
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
190
188
  };
@@ -21,7 +21,7 @@ export declare const actionToggleViewMode: {
21
21
  errorMessage: import("react").ReactNode;
22
22
  activeEmbeddable: {
23
23
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
24
- state: "hover" | "active";
24
+ state: "active" | "hover";
25
25
  } | null;
26
26
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
27
27
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -40,7 +40,6 @@ export declare const actionToggleViewMode: {
40
40
  editingFrame: string | null;
41
41
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
42
42
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
43
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
44
43
  activeTool: {
45
44
  lastActiveTool: import("../types").ActiveTool | null;
46
45
  locked: boolean;
@@ -88,7 +87,7 @@ export declare const actionToggleViewMode: {
88
87
  name: "imageExport" | "help" | "jsonExport";
89
88
  } | {
90
89
  name: "ttd";
91
- tab: "text-to-diagram" | "mermaid";
90
+ tab: "mermaid" | "text-to-diagram";
92
91
  } | {
93
92
  name: "commandPalette";
94
93
  } | {
@@ -159,8 +158,7 @@ export declare const actionToggleViewMode: {
159
158
  shown: true;
160
159
  data: import("../charts").Spreadsheet;
161
160
  };
162
- pendingImageElementId: string | null;
163
- showHyperlinkPopup: false | "info" | "editor";
161
+ showHyperlinkPopup: false | "editor" | "info";
164
162
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
165
163
  snapLines: readonly import("../snapping").SnapLine[];
166
164
  originSnapOffset: {
@@ -185,7 +183,7 @@ export declare const actionToggleViewMode: {
185
183
  };
186
184
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
187
185
  predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
188
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
186
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
189
187
  } & {
190
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
188
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
191
189
  };
@@ -21,7 +21,7 @@ export declare const actionToggleZenMode: {
21
21
  errorMessage: import("react").ReactNode;
22
22
  activeEmbeddable: {
23
23
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
24
- state: "hover" | "active";
24
+ state: "active" | "hover";
25
25
  } | null;
26
26
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
27
27
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -40,7 +40,6 @@ export declare const actionToggleZenMode: {
40
40
  editingFrame: string | null;
41
41
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
42
42
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
43
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
44
43
  activeTool: {
45
44
  lastActiveTool: import("../types").ActiveTool | null;
46
45
  locked: boolean;
@@ -88,7 +87,7 @@ export declare const actionToggleZenMode: {
88
87
  name: "imageExport" | "help" | "jsonExport";
89
88
  } | {
90
89
  name: "ttd";
91
- tab: "text-to-diagram" | "mermaid";
90
+ tab: "mermaid" | "text-to-diagram";
92
91
  } | {
93
92
  name: "commandPalette";
94
93
  } | {
@@ -159,8 +158,7 @@ export declare const actionToggleZenMode: {
159
158
  shown: true;
160
159
  data: import("../charts").Spreadsheet;
161
160
  };
162
- pendingImageElementId: string | null;
163
- showHyperlinkPopup: false | "info" | "editor";
161
+ showHyperlinkPopup: false | "editor" | "info";
164
162
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
165
163
  snapLines: readonly import("../snapping").SnapLine[];
166
164
  originSnapOffset: {
@@ -185,7 +183,7 @@ export declare const actionToggleZenMode: {
185
183
  };
186
184
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
187
185
  predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
188
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
186
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
189
187
  } & {
190
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
188
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
191
189
  };
@@ -13,10 +13,10 @@ export declare const actionSendBackward: {
13
13
  captureUpdate: "IMMEDIATELY";
14
14
  };
15
15
  keyPriority: number;
16
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
16
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
17
17
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
18
18
  } & {
19
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
19
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
20
20
  };
21
21
  export declare const actionBringForward: {
22
22
  name: "bringForward";
@@ -32,10 +32,10 @@ export declare const actionBringForward: {
32
32
  captureUpdate: "IMMEDIATELY";
33
33
  };
34
34
  keyPriority: number;
35
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
35
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
36
36
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
37
37
  } & {
38
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
38
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
39
39
  };
40
40
  export declare const actionSendToBack: {
41
41
  name: "sendToBack";
@@ -50,10 +50,10 @@ export declare const actionSendToBack: {
50
50
  appState: Readonly<import("../types").AppState>;
51
51
  captureUpdate: "IMMEDIATELY";
52
52
  };
53
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
53
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
54
54
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
55
55
  } & {
56
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
56
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
57
57
  };
58
58
  export declare const actionBringToFront: {
59
59
  name: "bringToFront";
@@ -68,8 +68,8 @@ export declare const actionBringToFront: {
68
68
  appState: Readonly<import("../types").AppState>;
69
69
  captureUpdate: "IMMEDIATELY";
70
70
  };
71
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
71
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
72
72
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
73
73
  } & {
74
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
74
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
75
75
  };
@@ -1,14 +1,23 @@
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
- stats?: {
5
- open: boolean;
6
- panels: number;
7
- } | undefined;
8
- exportWithDarkMode?: boolean | undefined;
9
- cursorButton?: "up" | "down" | undefined;
4
+ viewBackgroundColor?: string | undefined;
5
+ name?: string | null | undefined;
6
+ zoom?: Readonly<{
7
+ value: NormalizedZoomValue;
8
+ }> | undefined;
10
9
  scrollX?: number | undefined;
11
10
  scrollY?: number | undefined;
11
+ editingGroupId?: string | null | undefined;
12
+ selectedElementIds?: Readonly<{
13
+ [id: string]: true;
14
+ }> | undefined;
15
+ theme?: import("@excalidraw/element/types").Theme | undefined;
16
+ selectedGroupIds?: {
17
+ [groupId: string]: boolean;
18
+ } | undefined;
19
+ selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
20
+ zenModeEnabled?: boolean | undefined;
12
21
  showWelcomeScreen?: boolean | undefined;
13
22
  activeTool?: ({
14
23
  lastActiveTool: import("./types").ActiveTool | null;
@@ -19,6 +28,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
19
28
  penDetected?: boolean | undefined;
20
29
  exportBackground?: boolean | undefined;
21
30
  exportEmbedScene?: boolean | undefined;
31
+ exportWithDarkMode?: boolean | undefined;
22
32
  exportScale?: number | undefined;
23
33
  currentItemStrokeColor?: string | undefined;
24
34
  currentItemBackgroundColor?: string | undefined;
@@ -34,12 +44,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
34
44
  currentItemEndArrowhead?: import("@excalidraw/element/types").Arrowhead | null | undefined;
35
45
  currentItemRoundness?: import("@excalidraw/element/types").StrokeRoundness | undefined;
36
46
  currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
37
- viewBackgroundColor?: string | undefined;
47
+ cursorButton?: "up" | "down" | undefined;
38
48
  scrolledOutside?: boolean | undefined;
39
- name?: string | null | undefined;
40
- zoom?: Readonly<{
41
- value: NormalizedZoomValue;
42
- }> | undefined;
43
49
  openMenu?: "canvas" | "shape" | null | undefined;
44
50
  openSidebar?: {
45
51
  name: string;
@@ -47,24 +53,18 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
47
53
  } | null | undefined;
48
54
  defaultSidebarDockedPreference?: boolean | undefined;
49
55
  lastPointerDownWith?: import("@excalidraw/element/types").PointerType | undefined;
50
- selectedElementIds?: Readonly<{
51
- [id: string]: true;
52
- }> | undefined;
53
56
  previousSelectedElementIds?: {
54
57
  [id: string]: true;
55
58
  } | undefined;
56
59
  shouldCacheIgnoreZoom?: boolean | undefined;
57
- zenModeEnabled?: boolean | undefined;
58
- theme?: import("@excalidraw/element/types").Theme | undefined;
59
60
  gridSize?: number | undefined;
60
61
  gridStep?: number | undefined;
61
62
  gridModeEnabled?: boolean | undefined;
62
- selectedGroupIds?: {
63
- [groupId: string]: boolean;
63
+ stats?: {
64
+ open: boolean;
65
+ panels: number;
64
66
  } | undefined;
65
- editingGroupId?: string | null | undefined;
66
67
  currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
67
- selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
68
68
  objectsSnapModeEnabled?: boolean | undefined;
69
69
  lockedMultiSelections?: {
70
70
  [groupId: string]: true;
@@ -28,7 +28,3 @@ export declare const ExitZenModeAction: ({ actionManager, showExitZenModeBtn, }:
28
28
  actionManager: ActionManager;
29
29
  showExitZenModeBtn: boolean;
30
30
  }) => import("react/jsx-runtime").JSX.Element;
31
- export declare const FinalizeAction: ({ renderAction, className, }: {
32
- renderAction: ActionManager["renderAction"];
33
- className?: string | undefined;
34
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,7 @@
1
1
  import React from "react";
2
2
  import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
3
- import { LinearElementEditor } from "@excalidraw/element";
4
- import { FlowChartCreator } from "@excalidraw/element";
5
- import { Scene } from "@excalidraw/element";
6
- import { Store } from "@excalidraw/element";
7
- import type { ElementUpdate } from "@excalidraw/element";
8
- import type { ExcalidrawElement, NonDeleted, InitializedExcalidrawImageElement, ExcalidrawImageElement, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered } from "@excalidraw/element/types";
3
+ import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
+ import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, OrderedExcalidrawElement, SceneElementsMap } from "@excalidraw/element/types";
9
5
  import type { Mutable } from "@excalidraw/common/utility-types";
10
6
  import { ActionManager } from "../actions/manager";
11
7
  import { AnimationFrameHandler } from "../animation-frame-handler";
@@ -82,6 +78,7 @@ declare class App extends React.Component<AppProps, AppState> {
82
78
  /** embeds that have been inserted to DOM (as a perf optim, we don't want to
83
79
  * insert to DOM before user initially scrolls to them) */
84
80
  private initializedEmbeds;
81
+ private handleToastClose;
85
82
  private elementsPendingErasure;
86
83
  flowChartCreator: FlowChartCreator;
87
84
  private flowChartNavigator;
@@ -268,7 +265,7 @@ declare class App extends React.Component<AppProps, AppState> {
268
265
  private toggleOverscrollBehavior;
269
266
  render(): import("react/jsx-runtime").JSX.Element;
270
267
  focusContainer: AppClassProperties["focusContainer"];
271
- getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
268
+ getSceneElementsIncludingDeleted: () => readonly OrderedExcalidrawElement[];
272
269
  getSceneElementsMapIncludingDeleted: () => Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
273
270
  getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
274
271
  onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
@@ -400,6 +397,7 @@ declare class App extends React.Component<AppProps, AppState> {
400
397
  */
401
398
  captureUpdate?: SceneData["captureUpdate"];
402
399
  }) => void;
400
+ applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
403
401
  mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
404
402
  private triggerRender;
405
403
  /**
@@ -415,12 +413,9 @@ declare class App extends React.Component<AppProps, AppState> {
415
413
  private onKeyDown;
416
414
  private onKeyUp;
417
415
  private isToolSupported;
418
- setActiveTool: (tool: (({
419
- type: Exclude<ToolType, "image">;
416
+ setActiveTool: (tool: ({
417
+ type: ToolType;
420
418
  } | {
421
- type: Extract<ToolType, "image">;
422
- insertOnCanvasDirectly?: boolean;
423
- }) | {
424
419
  type: "custom";
425
420
  customType: string;
426
421
  }) & {
@@ -446,7 +441,7 @@ declare class App extends React.Component<AppProps, AppState> {
446
441
  private getTextElementAtPosition;
447
442
  private getElementAtPosition;
448
443
  private getElementsAtPosition;
449
- getElementHitThreshold(): number;
444
+ getElementHitThreshold(element: ExcalidrawElement): number;
450
445
  private hitElement;
451
446
  private getTextBindableContainerAtPosition;
452
447
  private startTextEditing;
@@ -509,13 +504,18 @@ declare class App extends React.Component<AppProps, AppState> {
509
504
  private restoreReadyToEraseElements;
510
505
  private eraseElements;
511
506
  private initializeImage;
507
+ /**
508
+ * use during async image initialization,
509
+ * when the placeholder image could have been modified in the meantime,
510
+ * and when you don't want to loose those modifications
511
+ */
512
+ private getLatestInitializedImageElement;
512
513
  /**
513
514
  * inserts image into elements array and rerenders
514
515
  */
515
- insertImageElement: (imageElement: ExcalidrawImageElement, imageFile: File, showCursorImagePreview?: boolean) => Promise<NonDeleted<InitializedExcalidrawImageElement> | null | undefined>;
516
- private setImagePreviewCursor;
516
+ private insertImageElement;
517
517
  private onImageAction;
518
- initializeImageDimensions: (imageElement: ExcalidrawImageElement, forceNaturalSize?: boolean) => void;
518
+ private getImageNaturalDimensions;
519
519
  /** updates image cache, refreshing updated elements and/or setting status
520
520
  to error for images that fail during <img> element creation */
521
521
  private updateImageCache;
@@ -526,7 +526,6 @@ declare class App extends React.Component<AppProps, AppState> {
526
526
  private scheduleImageRefresh;
527
527
  private updateBindingEnabledOnPointerMove;
528
528
  private maybeSuggestBindingAtCursor;
529
- private maybeSuggestBindingsForLinearElementAtCoords;
530
529
  private clearSelection;
531
530
  private handleInteractiveCanvasRef;
532
531
  private handleAppOnDrop;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const Ellipsify: ({ children, ...rest }: {
3
+ children: React.ReactNode;
4
+ } & import("react").HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
3
3
  import type { Scene } from "@excalidraw/element";
4
+ import { useApp, useExcalidrawSetAppState } from "../App";
4
5
  import "./DragInput.scss";
5
6
  import type { StatsInputProperty } from "./utils";
6
7
  import type { AppState } from "../../types";
@@ -16,6 +17,14 @@ export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawEl
16
17
  property: P;
17
18
  originalAppState: AppState;
18
19
  setInputValue: (value: number) => void;
20
+ app: ReturnType<typeof useApp>;
21
+ setAppState: ReturnType<typeof useExcalidrawSetAppState>;
22
+ }) => void;
23
+ export type DragFinishedCallbackType<E = ExcalidrawElement> = (props: {
24
+ app: ReturnType<typeof useApp>;
25
+ setAppState: ReturnType<typeof useExcalidrawSetAppState>;
26
+ originalElements: readonly E[] | null;
27
+ originalAppState: AppState;
19
28
  }) => void;
20
29
  interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElement> {
21
30
  label: string | React.ReactNode;
@@ -30,6 +39,7 @@ interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElemen
30
39
  appState: AppState;
31
40
  /** how many px you need to drag to get 1 unit change */
32
41
  sensitivity?: number;
42
+ dragFinishedCallback?: DragFinishedCallbackType;
33
43
  }
34
- declare const StatsDragInput: <T extends StatsInputProperty, E extends ExcalidrawElement = ExcalidrawElement>({ label, icon, dragInputCallback, value, elements, editable, shouldKeepAspectRatio, property, scene, appState, sensitivity, }: StatsDragInputProps<T, E>) => import("react/jsx-runtime").JSX.Element | null;
44
+ declare const StatsDragInput: <T extends StatsInputProperty, E extends ExcalidrawElement = ExcalidrawElement>({ label, icon, dragInputCallback, value, elements, editable, shouldKeepAspectRatio, property, scene, appState, sensitivity, dragFinishedCallback, }: StatsDragInputProps<T, E>) => import("react/jsx-runtime").JSX.Element | null;
35
45
  export default StatsDragInput;
@@ -59,4 +59,4 @@ export declare const SHAPES: readonly [{
59
59
  readonly numericKey: "0";
60
60
  readonly fillable: false;
61
61
  }];
62
- export declare const findShapeByKey: (key: string) => "text" | "line" | "arrow" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "image" | "eraser" | null;
62
+ export declare const findShapeByKey: (key: string) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | null;
@@ -6,7 +6,7 @@ import type { FileSystemHandle } from "./filesystem";
6
6
  import type { ImportedLibraryData } from "./types";
7
7
  export declare const getMimeType: (blob: Blob | string) => string;
8
8
  export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
9
- export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
9
+ export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
10
10
  export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
11
11
  export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
12
12
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
@@ -3,4 +3,5 @@ import type { MakeBrand } from "@excalidraw/common/utility-types";
3
3
  import type { AppState } from "../types";
4
4
  export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
5
5
  export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
6
+ export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
6
7
  export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];