@excalidraw/excalidraw 0.18.0-a5d6939 → 0.18.0-a8acc82

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 (184) hide show
  1. package/dist/dev/chunk-6MX365WZ.js +5666 -0
  2. package/dist/dev/chunk-6MX365WZ.js.map +7 -0
  3. package/dist/dev/chunk-CP5DND7P.js +7 -0
  4. package/dist/dev/chunk-CP5DND7P.js.map +7 -0
  5. package/dist/dev/{chunk-X3RYHLJU.js → chunk-QF5FRM6O.js} +15 -5
  6. package/dist/dev/chunk-QF5FRM6O.js.map +7 -0
  7. package/dist/dev/data/{image-JN3Y4CVN.js → image-GQCFJKGM.js} +3 -3
  8. package/dist/dev/index.css +230 -23
  9. package/dist/dev/index.css.map +3 -3
  10. package/dist/dev/index.js +10262 -10068
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-CKWC2GMK.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-A66AFZZU.js +7 -0
  16. package/dist/prod/chunk-I4UNSFV6.js +12 -0
  17. package/dist/prod/chunk-R2M7VUMD.js +4 -0
  18. package/dist/prod/data/image-JWK7QZ22.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +25 -17
  21. package/dist/prod/locales/{en-SBO6ZHT2.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 +40 -7
  25. package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
  26. package/dist/types/common/src/font-metadata.d.ts +4 -2
  27. package/dist/types/common/src/index.d.ts +1 -0
  28. package/dist/types/common/src/utility-types.d.ts +5 -0
  29. package/dist/types/common/src/utils.d.ts +18 -4
  30. package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
  31. package/dist/types/element/src/align.d.ts +4 -3
  32. package/dist/types/element/src/binding.d.ts +25 -14
  33. package/dist/types/element/src/bounds.d.ts +14 -6
  34. package/dist/types/element/src/collision.d.ts +18 -12
  35. package/dist/types/element/src/cropElement.d.ts +1 -1
  36. package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
  37. package/dist/types/element/src/distance.d.ts +2 -2
  38. package/dist/types/element/src/distribute.d.ts +2 -1
  39. package/dist/types/element/src/dragElements.d.ts +3 -2
  40. package/dist/types/element/src/elbowArrow.d.ts +1 -1
  41. package/dist/types/element/src/flowchart.d.ts +3 -2
  42. package/dist/types/element/src/fractionalIndex.d.ts +9 -3
  43. package/dist/types/element/src/frame.d.ts +4 -3
  44. package/dist/types/element/src/groups.d.ts +1 -0
  45. package/dist/types/element/src/index.d.ts +44 -2
  46. package/dist/types/element/src/linearElementEditor.d.ts +23 -36
  47. package/dist/types/element/src/mutateElement.d.ts +11 -3
  48. package/dist/types/element/src/newElement.d.ts +4 -3
  49. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  50. package/dist/types/element/src/renderElement.d.ts +4 -1
  51. package/dist/types/element/src/resizeElements.d.ts +5 -4
  52. package/dist/types/element/src/selection.d.ts +0 -5
  53. package/dist/types/element/src/shape.d.ts +42 -0
  54. package/dist/types/element/src/sizeHelpers.d.ts +2 -2
  55. package/dist/types/element/src/store.d.ts +237 -0
  56. package/dist/types/element/src/textElement.d.ts +4 -3
  57. package/dist/types/element/src/typeChecks.d.ts +19 -1
  58. package/dist/types/element/src/types.d.ts +15 -2
  59. package/dist/types/element/src/utils.d.ts +16 -6
  60. package/dist/types/element/src/zindex.d.ts +1 -1
  61. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +45 -54
  62. package/dist/types/excalidraw/actions/actionBoundText.d.ts +30 -36
  63. package/dist/types/excalidraw/actions/actionCanvas.d.ts +204 -242
  64. package/dist/types/excalidraw/actions/actionClipboard.d.ts +90 -106
  65. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +15 -18
  66. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +45 -53
  67. package/dist/types/excalidraw/actions/actionElementLink.d.ts +14 -17
  68. package/dist/types/excalidraw/actions/actionElementLock.d.ts +45 -52
  69. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +15 -18
  70. package/dist/types/excalidraw/actions/actionExport.d.ts +145 -172
  71. package/dist/types/excalidraw/actions/actionFinalize.d.ts +77 -42
  72. package/dist/types/excalidraw/actions/actionFrame.d.ts +107 -119
  73. package/dist/types/excalidraw/actions/actionGroup.d.ts +30 -36
  74. package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
  75. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +541 -20
  76. package/dist/types/excalidraw/actions/actionLink.d.ts +14 -17
  77. package/dist/types/excalidraw/actions/actionMenu.d.ts +42 -51
  78. package/dist/types/excalidraw/actions/actionNavigate.d.ts +29 -35
  79. package/dist/types/excalidraw/actions/actionProperties.d.ts +246 -274
  80. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +15 -18
  81. package/dist/types/excalidraw/actions/actionStyles.d.ts +15 -18
  82. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +15 -18
  83. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +15 -18
  84. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +14 -190
  85. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  86. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +15 -18
  87. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +15 -18
  88. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +15 -18
  89. package/dist/types/excalidraw/actions/index.d.ts +1 -1
  90. package/dist/types/excalidraw/actions/types.d.ts +4 -3
  91. package/dist/types/excalidraw/appState.d.ts +20 -10
  92. package/dist/types/excalidraw/clipboard.d.ts +64 -1
  93. package/dist/types/excalidraw/components/Actions.d.ts +8 -5
  94. package/dist/types/excalidraw/components/App.d.ts +30 -30
  95. package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  96. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  97. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +7 -2
  98. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  99. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
  100. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
  101. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
  102. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  103. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  104. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  105. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  106. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
  107. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  108. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  109. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +2 -1
  110. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  111. package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  112. package/dist/types/excalidraw/components/Range.d.ts +3 -3
  113. package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  114. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  115. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  116. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  117. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  118. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  119. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  120. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  121. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  122. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  123. package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
  124. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
  125. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  126. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  127. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  128. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  129. package/dist/types/excalidraw/components/icons.d.ts +9 -0
  130. package/dist/types/excalidraw/components/shapes.d.ts +129 -1
  131. package/dist/types/excalidraw/data/blob.d.ts +3 -7
  132. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  133. package/dist/types/excalidraw/data/restore.d.ts +6 -1
  134. package/dist/types/excalidraw/data/transform.d.ts +1 -1
  135. package/dist/types/excalidraw/data/types.d.ts +4 -1
  136. package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
  137. package/dist/types/excalidraw/eraser/index.d.ts +0 -2
  138. package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
  139. package/dist/types/excalidraw/history.d.ts +30 -22
  140. package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  141. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  142. package/dist/types/excalidraw/index.d.ts +11 -10
  143. package/dist/types/excalidraw/lasso/index.d.ts +1 -0
  144. package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
  145. package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
  146. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  147. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
  148. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  149. package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
  150. package/dist/types/excalidraw/scene/types.d.ts +2 -0
  151. package/dist/types/excalidraw/snapping.d.ts +2 -2
  152. package/dist/types/excalidraw/types.d.ts +36 -15
  153. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
  154. package/dist/types/math/src/angle.d.ts +2 -0
  155. package/dist/types/math/src/constants.d.ts +3 -0
  156. package/dist/types/math/src/curve.d.ts +34 -0
  157. package/dist/types/math/src/index.d.ts +1 -0
  158. package/dist/types/math/src/point.d.ts +1 -1
  159. package/dist/types/math/src/rectangle.d.ts +2 -0
  160. package/dist/types/math/src/segment.d.ts +1 -0
  161. package/dist/types/math/src/vector.d.ts +8 -2
  162. package/dist/types/utils/src/bbox.d.ts +1 -1
  163. package/dist/types/utils/src/index.d.ts +1 -1
  164. package/dist/types/utils/src/withinBounds.d.ts +1 -1
  165. package/history.ts +146 -109
  166. package/package.json +13 -10
  167. package/dist/dev/chunk-GBJ7S76A.js +0 -18599
  168. package/dist/dev/chunk-GBJ7S76A.js.map +0 -7
  169. package/dist/dev/chunk-GIMGG4AT.js +0 -7
  170. package/dist/dev/chunk-GIMGG4AT.js.map +0 -7
  171. package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
  172. package/dist/prod/chunk-GKI4RZ6C.js +0 -7
  173. package/dist/prod/chunk-IUH5AXLB.js +0 -12
  174. package/dist/prod/chunk-TVF64BAY.js +0 -33
  175. package/dist/prod/data/image-CZ2OEVDB.js +0 -1
  176. package/dist/types/element/src/Shape.d.ts +0 -17
  177. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  178. package/dist/types/element/src/shapes.d.ts +0 -23
  179. package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  180. package/dist/types/excalidraw/store.d.ts +0 -129
  181. package/dist/types/excalidraw/visualdebug.d.ts +0 -41
  182. package/dist/types/utils/src/collision.d.ts +0 -8
  183. /package/dist/dev/data/{image-JN3Y4CVN.js.map → image-GQCFJKGM.js.map} +0 -0
  184. /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-SMAPCEOQ.js.map} +0 -0
@@ -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;
@@ -32,7 +32,7 @@ export declare const actionToggleStats: {
32
32
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
33
33
  isBindingEnabled: boolean;
34
34
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
35
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
35
+ suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
36
36
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
37
37
  frameRendering: {
38
38
  enabled: boolean;
@@ -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").LinearElementEditor | null;
47
46
  activeTool: {
48
47
  lastActiveTool: import("../types").ActiveTool | null;
49
48
  locked: boolean;
@@ -81,8 +80,8 @@ export declare const actionToggleStats: {
81
80
  zoom: Readonly<{
82
81
  value: import("../types").NormalizedZoomValue;
83
82
  }>;
84
- openMenu: "shape" | "canvas" | null;
85
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
83
+ openMenu: "canvas" | "shape" | null;
84
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
86
85
  openSidebar: {
87
86
  name: string;
88
87
  tab?: string | undefined;
@@ -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,9 +158,8 @@ export declare const actionToggleStats: {
159
158
  shown: true;
160
159
  data: import("../charts").Spreadsheet;
161
160
  };
162
- pendingImageElementId: string | null;
163
161
  showHyperlinkPopup: false | "editor" | "info";
164
- selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
162
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
165
163
  snapLines: readonly import("../snapping").SnapLine[];
166
164
  originSnapOffset: {
167
165
  x: number;
@@ -172,16 +170,15 @@ export declare const actionToggleStats: {
172
170
  followedBy: Set<import("../types").SocketId>;
173
171
  isCropping: boolean;
174
172
  croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
173
+ searchMatches: Readonly<{
174
+ focusedId: string | null;
175
+ matches: readonly import("../types").SearchMatch[];
176
+ }> | null;
177
+ activeLockedId: string | null;
178
+ lockedMultiSelections: {
179
+ [groupId: string]: true;
180
+ };
181
+ stylesPanelMode: "compact" | "full";
185
182
  };
186
183
  captureUpdate: "EVENTUALLY";
187
184
  };
@@ -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;
@@ -29,7 +29,7 @@ export declare const actionToggleViewMode: {
29
29
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
30
30
  isBindingEnabled: boolean;
31
31
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
32
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
32
+ suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
33
33
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
34
34
  frameRendering: {
35
35
  enabled: boolean;
@@ -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").LinearElementEditor | null;
44
43
  activeTool: {
45
44
  lastActiveTool: import("../types").ActiveTool | null;
46
45
  locked: boolean;
@@ -78,8 +77,8 @@ export declare const actionToggleViewMode: {
78
77
  zoom: Readonly<{
79
78
  value: import("../types").NormalizedZoomValue;
80
79
  }>;
81
- openMenu: "shape" | "canvas" | null;
82
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
80
+ openMenu: "canvas" | "shape" | null;
81
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
83
82
  openSidebar: {
84
83
  name: string;
85
84
  tab?: string | undefined;
@@ -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,9 +158,8 @@ export declare const actionToggleViewMode: {
159
158
  shown: true;
160
159
  data: import("../charts").Spreadsheet;
161
160
  };
162
- pendingImageElementId: string | null;
163
161
  showHyperlinkPopup: false | "editor" | "info";
164
- selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
162
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
165
163
  snapLines: readonly import("../snapping").SnapLine[];
166
164
  originSnapOffset: {
167
165
  x: number;
@@ -172,16 +170,15 @@ export declare const actionToggleViewMode: {
172
170
  followedBy: Set<import("../types").SocketId>;
173
171
  isCropping: boolean;
174
172
  croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
173
+ searchMatches: Readonly<{
174
+ focusedId: string | null;
175
+ matches: readonly import("../types").SearchMatch[];
176
+ }> | null;
177
+ activeLockedId: string | null;
178
+ lockedMultiSelections: {
179
+ [groupId: string]: true;
180
+ };
181
+ stylesPanelMode: "compact" | "full";
185
182
  };
186
183
  captureUpdate: "EVENTUALLY";
187
184
  };
@@ -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;
@@ -29,7 +29,7 @@ export declare const actionToggleZenMode: {
29
29
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
30
30
  isBindingEnabled: boolean;
31
31
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
32
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
32
+ suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
33
33
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
34
34
  frameRendering: {
35
35
  enabled: boolean;
@@ -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").LinearElementEditor | null;
44
43
  activeTool: {
45
44
  lastActiveTool: import("../types").ActiveTool | null;
46
45
  locked: boolean;
@@ -78,8 +77,8 @@ export declare const actionToggleZenMode: {
78
77
  zoom: Readonly<{
79
78
  value: import("../types").NormalizedZoomValue;
80
79
  }>;
81
- openMenu: "shape" | "canvas" | null;
82
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
80
+ openMenu: "canvas" | "shape" | null;
81
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
83
82
  openSidebar: {
84
83
  name: string;
85
84
  tab?: string | undefined;
@@ -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,9 +158,8 @@ export declare const actionToggleZenMode: {
159
158
  shown: true;
160
159
  data: import("../charts").Spreadsheet;
161
160
  };
162
- pendingImageElementId: string | null;
163
161
  showHyperlinkPopup: false | "editor" | "info";
164
- selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
162
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
165
163
  snapLines: readonly import("../snapping").SnapLine[];
166
164
  originSnapOffset: {
167
165
  x: number;
@@ -172,16 +170,15 @@ export declare const actionToggleZenMode: {
172
170
  followedBy: Set<import("../types").SocketId>;
173
171
  isCropping: boolean;
174
172
  croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
173
+ searchMatches: Readonly<{
174
+ focusedId: string | null;
175
+ matches: readonly import("../types").SearchMatch[];
176
+ }> | null;
177
+ activeLockedId: string | null;
178
+ lockedMultiSelections: {
179
+ [groupId: string]: true;
180
+ };
181
+ stylesPanelMode: "compact" | "full";
185
182
  };
186
183
  captureUpdate: "EVENTUALLY";
187
184
  };
@@ -2,7 +2,7 @@ export { actionDeleteSelected } from "./actionDeleteSelected";
2
2
  export { actionBringForward, actionBringToFront, actionSendBackward, actionSendToBack, } from "./actionZindex";
3
3
  export { actionSelectAll } from "./actionSelectAll";
4
4
  export { actionDuplicateSelection } from "./actionDuplicateSelection";
5
- export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, } from "./actionProperties";
5
+ export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, actionChangeArrowProperties, } from "./actionProperties";
6
6
  export { actionChangeViewBackgroundColor, actionClearCanvas, actionZoomIn, actionZoomOut, actionResetZoom, actionZoomToFit, actionToggleTheme, } from "./actionCanvas";
7
7
  export { actionSetEmbeddableAsActiveTool } from "./actionEmbeddable";
8
8
  export { actionFinalize } from "./actionFinalize";
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { CaptureUpdateActionType } from "../store";
2
+ import type { CaptureUpdateActionType } from "@excalidraw/element";
3
3
  import type { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
4
4
  import type React from "react";
5
5
  export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api" | "commandPalette";
@@ -14,7 +14,7 @@ export type ActionResult = {
14
14
  type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
15
15
  export type UpdaterFn = (res: ActionResult) => void;
16
16
  export type ActionFilterFn = (action: Action) => void;
17
- export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool";
17
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
18
18
  export type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: AppState;
@@ -22,6 +22,7 @@ export type PanelComponentProps = {
22
22
  appProps: ExcalidrawProps;
23
23
  data?: Record<string, any>;
24
24
  app: AppClassProperties;
25
+ renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => React.JSX.Element | null;
25
26
  };
26
27
  export interface Action {
27
28
  name: ActionName;
@@ -35,7 +36,7 @@ export interface Action {
35
36
  predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
36
37
  checked?: (appState: Readonly<AppState>) => boolean;
37
38
  trackEvent: false | {
38
- category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu";
39
+ category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu" | "shape_switch";
39
40
  action?: string;
40
41
  predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
41
42
  };
@@ -16,14 +16,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
16
16
  selectedGroupIds?: {
17
17
  [groupId: string]: boolean;
18
18
  } | undefined;
19
- selectedLinearElement?: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null | undefined;
19
+ selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
20
20
  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
21
  showWelcomeScreen?: boolean | undefined;
28
22
  activeTool?: ({
29
23
  lastActiveTool: import("./types").ActiveTool | null;
@@ -35,6 +29,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
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,38 @@ 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
+ lockedMultiSelections?: {
70
+ [groupId: string]: true;
71
+ } | undefined;
72
+ stylesPanelMode?: "compact" | "full" | undefined;
69
73
  };
70
74
  export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
71
75
  viewBackgroundColor?: string | undefined;
72
- gridModeEnabled?: boolean | undefined;
73
76
  gridSize?: number | undefined;
74
77
  gridStep?: number | undefined;
78
+ gridModeEnabled?: boolean | undefined;
79
+ lockedMultiSelections?: {
80
+ [groupId: string]: true;
81
+ } | undefined;
75
82
  };
76
83
  export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
77
84
  viewBackgroundColor?: string | undefined;
78
- gridModeEnabled?: boolean | undefined;
79
85
  gridSize?: number | undefined;
80
86
  gridStep?: number | undefined;
87
+ gridModeEnabled?: boolean | undefined;
88
+ lockedMultiSelections?: {
89
+ [groupId: string]: true;
90
+ } | undefined;
81
91
  };
82
92
  export declare const isEraserActive: ({ activeTool, }: {
83
93
  activeTool: AppState["activeTool"];
@@ -1,5 +1,8 @@
1
1
  import { ALLOWED_PASTE_MIME_TYPES } from "@excalidraw/common";
2
+ import type { ValueOf } from "@excalidraw/common/utility-types";
3
+ import type { IMAGE_MIME_TYPES, STRING_MIME_TYPES } from "@excalidraw/common";
2
4
  import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
5
+ import type { FileSystemHandle } from "./data/filesystem";
3
6
  import type { Spreadsheet } from "./charts";
4
7
  import type { BinaryFiles } from "./types";
5
8
  export type PastedMixedContent = {
@@ -57,10 +60,70 @@ export declare const readSystemClipboard: () => Promise<{
57
60
  "image/avif"?: string | File | undefined;
58
61
  "image/jfif"?: string | File | undefined;
59
62
  }>;
63
+ type AllowedParsedDataTransferItem = {
64
+ type: ValueOf<typeof IMAGE_MIME_TYPES>;
65
+ kind: "file";
66
+ file: File;
67
+ fileHandle: FileSystemHandle | null;
68
+ } | {
69
+ type: ValueOf<typeof STRING_MIME_TYPES>;
70
+ kind: "string";
71
+ value: string;
72
+ };
73
+ type ParsedDataTransferItem = {
74
+ type: string;
75
+ kind: "file";
76
+ file: File;
77
+ fileHandle: FileSystemHandle | null;
78
+ } | {
79
+ type: string;
80
+ kind: "string";
81
+ value: string;
82
+ };
83
+ type ParsedDataTransferItemType<T extends AllowedParsedDataTransferItem["type"]> = AllowedParsedDataTransferItem & {
84
+ type: T;
85
+ };
86
+ export type ParsedDataTransferFile = Extract<AllowedParsedDataTransferItem, {
87
+ kind: "file";
88
+ }>;
89
+ type ParsedDataTranferList = ParsedDataTransferItem[] & {
90
+ /**
91
+ * Only allows filtering by known `string` data types, since `file`
92
+ * types can have multiple items of the same type (e.g. multiple image files)
93
+ * unlike `string` data transfer items.
94
+ */
95
+ findByType: typeof findDataTransferItemType;
96
+ /**
97
+ * Only allows filtering by known `string` data types, since `file`
98
+ * types can have multiple items of the same type (e.g. multiple image files)
99
+ * unlike `string` data transfer items.
100
+ */
101
+ getData: typeof getDataTransferItemData;
102
+ getFiles: typeof getDataTransferFiles;
103
+ };
104
+ declare const findDataTransferItemType: <T extends ValueOf<{
105
+ readonly text: "text/plain";
106
+ readonly html: "text/html";
107
+ readonly json: "application/json";
108
+ readonly excalidraw: "application/vnd.excalidraw+json";
109
+ readonly excalidrawlib: "application/vnd.excalidrawlib+json";
110
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
111
+ }>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<T> | null;
112
+ declare const getDataTransferItemData: <T extends ValueOf<{
113
+ readonly text: "text/plain";
114
+ readonly html: "text/html";
115
+ readonly json: "application/json";
116
+ readonly excalidraw: "application/vnd.excalidraw+json";
117
+ readonly excalidrawlib: "application/vnd.excalidrawlib+json";
118
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
119
+ }>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<ValueOf<typeof STRING_MIME_TYPES>>["value"] | null;
120
+ declare const getDataTransferFiles: (this: ParsedDataTranferList) => ParsedDataTransferFile[];
121
+ export declare const parseDataTransferEvent: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Promise<ParsedDataTranferList>;
60
122
  /**
61
123
  * Attempts to parse clipboard event.
62
124
  */
63
- export declare const parseClipboard: (event: ClipboardEvent, isPlainPaste?: boolean) => Promise<ClipboardData>;
125
+ export declare const parseClipboard: (dataList: ParsedDataTranferList, isPlainPaste?: boolean) => Promise<ClipboardData>;
64
126
  export declare const copyBlobToClipboardAsPng: (blob: Blob | Promise<Blob>) => Promise<void>;
65
127
  export declare const copyTextToSystemClipboard: (text: string | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
128
+ export declare const isClipboardEvent: (event: React.SyntheticEvent | Event) => event is ClipboardEvent;
66
129
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
2
  import "./Actions.scss";
3
- import type { AppClassProperties, AppProps, UIAppState, Zoom } from "../types";
3
+ import type { AppClassProperties, AppProps, UIAppState, Zoom, AppState } from "../types";
4
4
  import type { ActionManager } from "../actions/manager";
5
5
  export declare const canChangeStrokeColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
6
6
  export declare const canChangeBackgroundColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
@@ -10,6 +10,13 @@ export declare const SelectedShapeActions: ({ appState, elementsMap, renderActio
10
10
  renderAction: ActionManager["renderAction"];
11
11
  app: AppClassProperties;
12
12
  }) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const CompactShapeActions: ({ appState, elementsMap, renderAction, app, setAppState, }: {
14
+ appState: UIAppState;
15
+ elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap;
16
+ renderAction: ActionManager["renderAction"];
17
+ app: AppClassProperties;
18
+ setAppState: React.Component<any, AppState>["setState"];
19
+ }) => import("react/jsx-runtime").JSX.Element;
13
20
  export declare const ShapesSwitcher: ({ activeTool, appState, app, UIOptions, }: {
14
21
  activeTool: UIAppState["activeTool"];
15
22
  appState: UIAppState;
@@ -28,7 +35,3 @@ export declare const ExitZenModeAction: ({ actionManager, showExitZenModeBtn, }:
28
35
  actionManager: ActionManager;
29
36
  showExitZenModeBtn: boolean;
30
37
  }) => 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;