@excalidraw/common 0.18.0-a9ca16e → 0.18.0-abeeaeb

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/index.js +98 -75
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/colors.d.ts +15 -1
  5. package/dist/types/common/src/constants.d.ts +12 -7
  6. package/dist/types/common/src/keys.d.ts +2 -0
  7. package/dist/types/common/src/points.d.ts +1 -1
  8. package/dist/types/common/src/utils.d.ts +1 -43
  9. package/dist/types/element/src/Scene.d.ts +6 -4
  10. package/dist/types/element/src/align.d.ts +2 -2
  11. package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
  12. package/dist/types/element/src/arrows/focus.d.ts +5 -2
  13. package/dist/types/element/src/binding.d.ts +17 -8
  14. package/dist/types/element/src/bounds.d.ts +22 -7
  15. package/dist/types/element/src/bucketFill.d.ts +110 -0
  16. package/dist/types/element/src/collision.d.ts +1 -1
  17. package/dist/types/element/src/comparisons.d.ts +5 -4
  18. package/dist/types/element/src/convertToShape.d.ts +23 -0
  19. package/dist/types/element/src/distribute.d.ts +2 -2
  20. package/dist/types/element/src/dragElements.d.ts +27 -0
  21. package/dist/types/element/src/duplicate.d.ts +4 -3
  22. package/dist/types/element/src/embeddable.d.ts +2 -2
  23. package/dist/types/element/src/flowchart.d.ts +7 -7
  24. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  25. package/dist/types/element/src/frame.d.ts +9 -8
  26. package/dist/types/element/src/groups.d.ts +9 -9
  27. package/dist/types/element/src/index.d.ts +4 -1
  28. package/dist/types/element/src/linearElementEditor.d.ts +17 -10
  29. package/dist/types/element/src/newElement.d.ts +14 -0
  30. package/dist/types/element/src/renderElement.d.ts +0 -3
  31. package/dist/types/element/src/resizeElements.d.ts +2 -2
  32. package/dist/types/element/src/selection.d.ts +6 -6
  33. package/dist/types/element/src/shape.d.ts +13 -1
  34. package/dist/types/element/src/sortElements.d.ts +10 -0
  35. package/dist/types/element/src/textElement.d.ts +12 -9
  36. package/dist/types/element/src/transform.d.ts +2 -2
  37. package/dist/types/element/src/typeChecks.d.ts +26 -25
  38. package/dist/types/element/src/types.d.ts +8 -1
  39. package/dist/types/element/src/utils.d.ts +1 -1
  40. package/dist/types/element/src/zindex.d.ts +2 -2
  41. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +45 -18
  42. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  43. package/dist/types/excalidraw/actions/actionBoundText.d.ts +30 -12
  44. package/dist/types/excalidraw/actions/actionCanvas.d.ts +167 -940
  45. package/dist/types/excalidraw/actions/actionClipboard.d.ts +30 -12
  46. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +15 -6
  47. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +47 -19
  48. package/dist/types/excalidraw/actions/{actionEmbeddable.d.ts → actionDeselect.d.ts} +29 -35
  49. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  50. package/dist/types/excalidraw/actions/actionElementLink.d.ts +15 -6
  51. package/dist/types/excalidraw/actions/actionElementLock.d.ts +31 -13
  52. package/dist/types/excalidraw/actions/actionExport.d.ts +35 -17
  53. package/dist/types/excalidraw/actions/actionFrame.d.ts +57 -202
  54. package/dist/types/excalidraw/actions/actionGroup.d.ts +45 -27
  55. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +19 -8
  56. package/dist/types/excalidraw/actions/actionLink.d.ts +16 -7
  57. package/dist/types/excalidraw/actions/actionMenu.d.ts +15 -6
  58. package/dist/types/excalidraw/actions/actionProperties.d.ts +60 -30
  59. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +20 -11
  60. package/dist/types/excalidraw/actions/actionStyles.d.ts +15 -6
  61. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  62. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +16 -7
  63. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +19 -11
  64. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +16 -7
  65. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +16 -7
  66. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +19 -11
  67. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  68. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +16 -7
  69. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +17 -8
  70. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +16 -7
  71. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  72. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  73. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  74. package/dist/types/excalidraw/actions/types.d.ts +8 -4
  75. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  76. package/dist/types/excalidraw/appState.d.ts +13 -6
  77. package/dist/types/excalidraw/components/Actions.d.ts +17 -12
  78. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  79. package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
  80. package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
  81. package/dist/types/excalidraw/components/App.cursor.d.ts +30 -0
  82. package/dist/types/excalidraw/components/App.d.ts +363 -66
  83. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  84. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  85. package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
  86. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
  87. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  88. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
  89. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
  90. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
  91. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
  92. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  93. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
  94. package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
  95. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  96. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
  97. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  98. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  99. package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
  100. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  101. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  102. package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
  103. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  104. package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
  105. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
  106. package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
  107. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  108. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  109. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  110. package/dist/types/excalidraw/components/Popover.d.ts +1 -3
  111. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  112. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  113. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  114. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
  115. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  116. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  117. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
  118. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  119. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  120. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  121. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  122. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  123. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
  124. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
  125. package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
  126. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  127. package/dist/types/excalidraw/components/Tools.d.ts +146 -0
  128. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  129. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  130. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -1
  131. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  132. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  133. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  134. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  135. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
  136. package/dist/types/excalidraw/components/icons.d.ts +6 -1
  137. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +8 -4
  138. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  139. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  140. package/dist/types/excalidraw/data/blob.d.ts +40 -22
  141. package/dist/types/excalidraw/data/index.d.ts +4 -4
  142. package/dist/types/excalidraw/data/json.d.ts +26 -17
  143. package/dist/types/excalidraw/data/library.d.ts +1 -1
  144. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  145. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  146. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  147. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  148. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  149. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  150. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  151. package/dist/types/excalidraw/renderer/animation.d.ts +5 -1
  152. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -3
  153. package/dist/types/excalidraw/scene/Renderer.d.ts +426 -19
  154. package/dist/types/excalidraw/scene/export.d.ts +3 -3
  155. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  156. package/dist/types/excalidraw/scene/types.d.ts +4 -3
  157. package/dist/types/excalidraw/snapping.d.ts +7 -7
  158. package/dist/types/excalidraw/types.d.ts +415 -23
  159. package/dist/types/excalidraw/viewport.d.ts +275 -0
  160. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
  161. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  162. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  163. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  164. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  165. package/dist/types/laser-pointer/src/state.d.ts +36 -0
  166. package/dist/types/math/src/constants.d.ts +0 -1
  167. package/dist/types/math/src/curve.d.ts +4 -1
  168. package/dist/types/math/src/index.d.ts +1 -0
  169. package/dist/types/math/src/pca.d.ts +79 -0
  170. package/dist/types/math/src/point.d.ts +1 -0
  171. package/dist/types/math/src/polygon.d.ts +25 -1
  172. package/dist/types/utils/src/export.d.ts +3 -3
  173. package/dist/types/utils/src/index.d.ts +1 -2
  174. package/package.json +1 -1
  175. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  176. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  177. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  178. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
  179. package/dist/types/excalidraw/components/shapes.d.ts +0 -263
  180. package/dist/types/excalidraw/cursor.d.ts +0 -5
  181. package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
  182. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  183. package/dist/types/utils/src/bbox.d.ts +0 -9
  184. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -21,6 +21,11 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
21
21
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
22
22
  appState: {
23
23
  viewModeEnabled: boolean;
24
+ activeTool: {
25
+ lastActiveTool: import("../types").ActiveTool | null;
26
+ locked: boolean;
27
+ fromSelection: boolean;
28
+ } & import("../types").ActiveTool;
24
29
  zenModeEnabled: boolean;
25
30
  gridModeEnabled: boolean;
26
31
  objectsSnapModeEnabled: boolean;
@@ -28,11 +33,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
28
33
  name: string | null;
29
34
  currentItemArrowType: "sharp" | "round" | "elbow";
30
35
  gridSize: number;
31
- activeTool: {
32
- lastActiveTool: import("../types").ActiveTool | null;
33
- locked: boolean;
34
- fromSelection: boolean;
35
- } & import("../types").ActiveTool;
36
36
  contextMenu: {
37
37
  items: import("../components/ContextMenu").ContextMenuItems;
38
38
  top: number;
@@ -50,13 +50,17 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
50
50
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
51
51
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
52
52
  isBindingEnabled: boolean;
53
+ boxSelectionMode: import("../types").BoxSelectionMode;
53
54
  bindingPreference: "enabled" | "disabled";
54
55
  isMidpointSnappingEnabled: boolean;
55
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
56
56
  suggestedBinding: {
57
57
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
58
58
  midPoint?: import("@excalidraw/math").GlobalPoint;
59
59
  } | null;
60
+ hoveredArrowTextAnchor: {
61
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
62
+ anchor: "start" | "end" | "label";
63
+ } | null;
60
64
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
61
65
  frameRendering: {
62
66
  enabled: boolean;
@@ -64,8 +68,8 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
64
68
  outline: boolean;
65
69
  clip: boolean;
66
70
  };
67
- editingFrame: string | null;
68
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
71
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
72
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
69
73
  editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
70
74
  preferredSelectionTool: {
71
75
  type: "selection" | "lasso";
@@ -80,9 +84,10 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
80
84
  currentItemStrokeColor: string;
81
85
  currentItemBackgroundColor: string;
82
86
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
83
- currentItemStrokeWidth: number;
87
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
84
88
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
85
89
  currentItemRoughness: number;
90
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
86
91
  currentItemOpacity: number;
87
92
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
88
93
  currentItemFontSize: number;
@@ -94,6 +99,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
94
99
  viewBackgroundColor: string;
95
100
  scrollX: number;
96
101
  scrollY: number;
102
+ scrollConstraints: import("../types").ScrollConstraints | null;
97
103
  cursorButton: "up" | "down";
98
104
  scrolledOutside: boolean;
99
105
  isResizing: boolean;
@@ -158,8 +164,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
158
164
  x: number;
159
165
  y: number;
160
166
  } | null;
161
- userToFollow: import("../types").UserToFollow | null;
162
- followedBy: Set<import("../types").SocketId>;
163
167
  isCropping: boolean;
164
168
  croppingElementId: ExcalidrawElement["id"] | null;
165
169
  searchMatches: Readonly<{
@@ -171,6 +175,11 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
171
175
  [groupId: string]: true;
172
176
  };
173
177
  bindMode: import("@excalidraw/element/types").BindMode;
178
+ colorTopPicks: {
179
+ elementStroke: readonly string[] | null;
180
+ elementBackground: readonly string[] | null;
181
+ bucketFill: readonly string[] | null;
182
+ };
174
183
  };
175
184
  files: import("../types").BinaryFiles;
176
185
  };
@@ -186,6 +195,11 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
186
195
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
187
196
  appState: {
188
197
  viewModeEnabled: boolean;
198
+ activeTool: {
199
+ lastActiveTool: import("../types").ActiveTool | null;
200
+ locked: boolean;
201
+ fromSelection: boolean;
202
+ } & import("../types").ActiveTool;
189
203
  zenModeEnabled: boolean;
190
204
  gridModeEnabled: boolean;
191
205
  objectsSnapModeEnabled: boolean;
@@ -193,11 +207,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
193
207
  name: string | null;
194
208
  currentItemArrowType: "sharp" | "round" | "elbow";
195
209
  gridSize: number;
196
- activeTool: {
197
- lastActiveTool: import("../types").ActiveTool | null;
198
- locked: boolean;
199
- fromSelection: boolean;
200
- } & import("../types").ActiveTool;
201
210
  contextMenu: {
202
211
  items: import("../components/ContextMenu").ContextMenuItems;
203
212
  top: number;
@@ -215,13 +224,17 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
215
224
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
216
225
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
217
226
  isBindingEnabled: boolean;
227
+ boxSelectionMode: import("../types").BoxSelectionMode;
218
228
  bindingPreference: "enabled" | "disabled";
219
229
  isMidpointSnappingEnabled: boolean;
220
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
221
230
  suggestedBinding: {
222
231
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
223
232
  midPoint?: import("@excalidraw/math").GlobalPoint;
224
233
  } | null;
234
+ hoveredArrowTextAnchor: {
235
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
236
+ anchor: "start" | "end" | "label";
237
+ } | null;
225
238
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
226
239
  frameRendering: {
227
240
  enabled: boolean;
@@ -229,8 +242,8 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
229
242
  outline: boolean;
230
243
  clip: boolean;
231
244
  };
232
- editingFrame: string | null;
233
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
245
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
246
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
234
247
  editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
235
248
  preferredSelectionTool: {
236
249
  type: "selection" | "lasso";
@@ -245,9 +258,10 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
245
258
  currentItemStrokeColor: string;
246
259
  currentItemBackgroundColor: string;
247
260
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
248
- currentItemStrokeWidth: number;
261
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
249
262
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
250
263
  currentItemRoughness: number;
264
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
251
265
  currentItemOpacity: number;
252
266
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
253
267
  currentItemFontSize: number;
@@ -259,6 +273,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
259
273
  viewBackgroundColor: string;
260
274
  scrollX: number;
261
275
  scrollY: number;
276
+ scrollConstraints: import("../types").ScrollConstraints | null;
262
277
  cursorButton: "up" | "down";
263
278
  scrolledOutside: boolean;
264
279
  isResizing: boolean;
@@ -323,8 +338,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
323
338
  x: number;
324
339
  y: number;
325
340
  } | null;
326
- userToFollow: import("../types").UserToFollow | null;
327
- followedBy: Set<import("../types").SocketId>;
328
341
  isCropping: boolean;
329
342
  croppingElementId: ExcalidrawElement["id"] | null;
330
343
  searchMatches: Readonly<{
@@ -336,6 +349,11 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
336
349
  [groupId: string]: true;
337
350
  };
338
351
  bindMode: import("@excalidraw/element/types").BindMode;
352
+ colorTopPicks: {
353
+ elementStroke: readonly string[] | null;
354
+ elementBackground: readonly string[] | null;
355
+ bucketFill: readonly string[] | null;
356
+ };
339
357
  };
340
358
  files: import("../types").BinaryFiles;
341
359
  }>;
@@ -1,4 +1,4 @@
1
- import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
2
  import type { ExportType } from "../scene/types";
3
3
  import type { AppState, BinaryFiles } from "../types";
4
4
  export { loadFromBlob } from "./blob";
@@ -6,8 +6,8 @@ export { loadFromJSON, saveAsJSON } from "./json";
6
6
  export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
7
7
  _brand: "exportedElements";
8
8
  };
9
- export declare const prepareElementsForExport: (elements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
10
- exportingFrame: ExcalidrawFrameLikeElement | null;
9
+ export declare const prepareElementsForExport: (allElements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
10
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
11
11
  exportedElements: ExportedElements;
12
12
  };
13
13
  export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements: ExportedElements, appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, exportingFrame, }: {
@@ -17,5 +17,5 @@ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements:
17
17
  /** filename, if applicable */
18
18
  name?: string;
19
19
  fileHandle?: FileSystemFileHandle | null;
20
- exportingFrame: ExcalidrawFrameLikeElement | null;
20
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
21
21
  }) => Promise<FileSystemFileHandle | null | undefined>;
@@ -1,9 +1,9 @@
1
- import type { ExcalidrawElement, NonDeleted } from "@excalidraw/element/types";
1
+ import type { ExcalidrawElement } from "@excalidraw/element/types";
2
2
  import type { MaybePromise } from "@excalidraw/common/utility-types";
3
3
  import type { AppState, BinaryFiles, LibraryItems } from "../types";
4
4
  import type { ImportedDataState, ImportedLibraryData } from "./types";
5
5
  export type JSONExportData = {
6
- elements: readonly NonDeleted<ExcalidrawElement>[];
6
+ elements: readonly ExcalidrawElement[];
7
7
  appState: AppState;
8
8
  files: BinaryFiles;
9
9
  };
@@ -19,6 +19,11 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
19
19
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
20
20
  appState: {
21
21
  viewModeEnabled: boolean;
22
+ activeTool: {
23
+ lastActiveTool: import("../types").ActiveTool | null;
24
+ locked: boolean;
25
+ fromSelection: boolean;
26
+ } & import("../types").ActiveTool;
22
27
  zenModeEnabled: boolean;
23
28
  gridModeEnabled: boolean;
24
29
  objectsSnapModeEnabled: boolean;
@@ -26,11 +31,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
26
31
  name: string | null;
27
32
  currentItemArrowType: "sharp" | "round" | "elbow";
28
33
  gridSize: number;
29
- activeTool: {
30
- lastActiveTool: import("../types").ActiveTool | null;
31
- locked: boolean;
32
- fromSelection: boolean;
33
- } & import("../types").ActiveTool;
34
34
  contextMenu: {
35
35
  items: import("../components/ContextMenu").ContextMenuItems;
36
36
  top: number;
@@ -43,27 +43,31 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
43
43
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
44
44
  state: "hover" | "active";
45
45
  } | null;
46
- newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
46
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
47
47
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
48
- multiElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
48
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
49
49
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
50
50
  isBindingEnabled: boolean;
51
+ boxSelectionMode: import("../types").BoxSelectionMode;
51
52
  bindingPreference: "enabled" | "disabled";
52
53
  isMidpointSnappingEnabled: boolean;
53
- startBoundElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
54
54
  suggestedBinding: {
55
- element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
55
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
56
56
  midPoint?: import("@excalidraw/math").GlobalPoint;
57
57
  } | null;
58
- frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
58
+ hoveredArrowTextAnchor: {
59
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
60
+ anchor: "start" | "end" | "label";
61
+ } | null;
62
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
59
63
  frameRendering: {
60
64
  enabled: boolean;
61
65
  name: boolean;
62
66
  outline: boolean;
63
67
  clip: boolean;
64
68
  };
65
- editingFrame: string | null;
66
- elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
69
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
70
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
67
71
  editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
68
72
  preferredSelectionTool: {
69
73
  type: "selection" | "lasso";
@@ -78,9 +82,10 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
78
82
  currentItemStrokeColor: string;
79
83
  currentItemBackgroundColor: string;
80
84
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
81
- currentItemStrokeWidth: number;
85
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
82
86
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
83
87
  currentItemRoughness: number;
88
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
84
89
  currentItemOpacity: number;
85
90
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
86
91
  currentItemFontSize: number;
@@ -92,6 +97,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
92
97
  viewBackgroundColor: string;
93
98
  scrollX: number;
94
99
  scrollY: number;
100
+ scrollConstraints: import("../types").ScrollConstraints | null;
95
101
  cursorButton: "up" | "down";
96
102
  scrolledOutside: boolean;
97
103
  isResizing: boolean;
@@ -156,8 +162,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
156
162
  x: number;
157
163
  y: number;
158
164
  } | null;
159
- userToFollow: import("../types").UserToFollow | null;
160
- followedBy: Set<import("../types").SocketId>;
161
165
  isCropping: boolean;
162
166
  croppingElementId: ExcalidrawElement["id"] | null;
163
167
  searchMatches: Readonly<{
@@ -169,6 +173,11 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
169
173
  [groupId: string]: true;
170
174
  };
171
175
  bindMode: import("@excalidraw/element/types").BindMode;
176
+ colorTopPicks: {
177
+ elementStroke: readonly string[] | null;
178
+ elementBackground: readonly string[] | null;
179
+ bucketFill: readonly string[] | null;
180
+ };
172
181
  };
173
182
  files: BinaryFiles;
174
183
  }>;
@@ -37,7 +37,7 @@ export interface LibraryMigrationAdapter {
37
37
  /** clears entire storage afterwards */
38
38
  clear(): MaybePromise<void>;
39
39
  }
40
- export declare const libraryItemsAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
40
+ export declare const libraryItemsAtom: import("jotai").PrimitiveAtom<{
41
41
  status: "loading" | "loaded";
42
42
  /** indicates whether library is initialized with library items (has gone
43
43
  * through at least one update). Used in UI. Specific to this atom only. */
@@ -0,0 +1,16 @@
1
+ import type { GlobalPoint } from "@excalidraw/math";
2
+ import type App from "./components/App";
3
+ import type { Trail } from "./animatedTrail";
4
+ export declare class DrawShapeTrail implements Trail {
5
+ private app;
6
+ private trail;
7
+ constructor(app: App);
8
+ private getTrailOptions;
9
+ startPath(x: number, y: number): void;
10
+ addPointToPath(x: number, y: number): void;
11
+ endPath(): void;
12
+ clearTrails(): void;
13
+ getCurrentPoints(): GlobalPoint[];
14
+ start(container: SVGSVGElement): void;
15
+ stop(): void;
16
+ }
@@ -1,10 +1,9 @@
1
- import { AnimatedTrail } from "../animated-trail";
2
- import type { AnimationFrameHandler } from "../animation-frame-handler";
1
+ import { AnimatedTrail } from "../animatedTrail";
3
2
  import type App from "../components/App";
4
3
  export declare class EraserTrail extends AnimatedTrail {
5
4
  private elementsToErase;
6
5
  private groupsToErase;
7
- constructor(animationFrameHandler: AnimationFrameHandler, app: App);
6
+ constructor(app: App);
8
7
  startPath(x: number, y: number): void;
9
8
  addPointToPath(x: number, y: number, restore?: boolean): string[];
10
9
  private updateElementsToBeErased;
@@ -0,0 +1,29 @@
1
+ import type { AppState } from "../types";
2
+ /**
3
+ * Subscribes to specific appState changes. The component re-renders
4
+ * only when the specified prop(s) change — not on every appState update.
5
+ *
6
+ * Works both inside and outside the <Excalidraw> tree, as long as
7
+ * ExcalidrawAPIContext.Provider is an ancestor (automatically provided
8
+ * inside <Excalidraw>, or manually by the host app).
9
+ *
10
+ * Returns the narrowed value depending on prop form:
11
+ * - `keyof AppState` → `AppState[K]`
12
+ * - `(keyof AppState)[]` → whole `AppState`
13
+ * - selector function → selector's return type `T`
14
+ *
15
+ * If excalidrawAPI is not ready yet (host apps), hook is rerendered with latest
16
+ * value once available.
17
+ */
18
+ export declare function useAppStateValue<K extends keyof AppState>(prop: K, _internal?: boolean): AppState[K];
19
+ export declare function useAppStateValue(props: (keyof AppState)[], _internal?: boolean): AppState;
20
+ export declare function useAppStateValue<T>(selector: (appState: AppState) => T, _internal?: boolean): T;
21
+ /**
22
+ * Subscribes to specific appState changes without causing component rerenders.
23
+ *
24
+ * The callback is called on every matching change, but also on initial render
25
+ * so you can initialize your state.
26
+ */
27
+ export declare function useOnAppStateChange<K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void): undefined;
28
+ export declare function useOnAppStateChange(props: (keyof AppState)[], callback: (props: AppState, appState: AppState) => void): undefined;
29
+ export declare function useOnAppStateChange<T>(selector: (appState: AppState) => T, callback: (value: T, appState: AppState) => void): undefined;
@@ -1,6 +1,6 @@
1
1
  import type { LibraryItem } from "../types";
2
2
  export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
3
- export declare const libraryItemSvgsCache: import("jotai/vanilla/atom").PrimitiveAtom<SvgCache> & {
3
+ export declare const libraryItemSvgsCache: import("jotai").PrimitiveAtom<SvgCache> & {
4
4
  init: SvgCache;
5
5
  };
6
6
  export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache, ref: React.RefObject<HTMLDivElement | null>) => SVGSVGElement | undefined;
@@ -1,20 +1,18 @@
1
- import { AnimatedTrail } from "./animated-trail";
2
- import type { Trail } from "./animated-trail";
3
- import type { AnimationFrameHandler } from "./animation-frame-handler";
1
+ import { AnimatedTrail } from "./animatedTrail";
2
+ import type { Trail } from "./animatedTrail";
4
3
  import type App from "./components/App";
5
4
  export declare class LaserTrails implements Trail {
6
- private animationFrameHandler;
7
5
  private app;
8
6
  localTrail: AnimatedTrail;
9
7
  private collabTrails;
10
8
  private container?;
11
- constructor(animationFrameHandler: AnimationFrameHandler, app: App);
9
+ constructor(app: App);
12
10
  private getTrailOptions;
13
11
  startPath(x: number, y: number): void;
14
12
  addPointToPath(x: number, y: number): void;
15
13
  endPath(): void;
16
14
  start(container: SVGSVGElement): void;
17
15
  stop(): void;
18
- onFrame(): void;
19
- private updateCollabTrails;
16
+ private stopCollabTrails;
17
+ updateCollabTrails(collaborators: App["state"]["collaborators"]): void;
20
18
  }
@@ -1,5 +1,4 @@
1
- import { type AnimationFrameHandler } from "../animation-frame-handler";
2
- import { AnimatedTrail } from "../animated-trail";
1
+ import { AnimatedTrail } from "../animatedTrail";
3
2
  import type App from "../components/App";
4
3
  export declare class LassoTrail extends AnimatedTrail {
5
4
  private intersectedElements;
@@ -7,7 +6,7 @@ export declare class LassoTrail extends AnimatedTrail {
7
6
  private elementsSegments;
8
7
  private canvasTranslate;
9
8
  private keepPreviousSelection;
10
- constructor(animationFrameHandler: AnimationFrameHandler, app: App);
9
+ constructor(app: App);
11
10
  startPath(x: number, y: number, keepPreviousSelection?: boolean): void;
12
11
  selectElementsFromIds: (ids: string[]) => void;
13
12
  addPointToPath: (x: number, y: number, keepPreviousSelection?: boolean) => void;
@@ -1,5 +1,6 @@
1
1
  import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
2
2
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
3
+ import type { BoxSelectionMode } from "../types";
3
4
  export declare const getLassoSelectedElementIds: (input: {
4
5
  lassoPath: GlobalPoint[];
5
6
  elements: readonly ExcalidrawElement[];
@@ -8,6 +9,7 @@ export declare const getLassoSelectedElementIds: (input: {
8
9
  intersectedElements: Set<ExcalidrawElement["id"]>;
9
10
  enclosedElements: Set<ExcalidrawElement["id"]>;
10
11
  simplifyDistance?: number;
12
+ mode?: BoxSelectionMode;
11
13
  }) => {
12
14
  selectedElementIds: string[];
13
15
  };
@@ -3,10 +3,14 @@ export type Animation<R extends object> = (params: {
3
3
  state?: R;
4
4
  }) => R | null | undefined;
5
5
  export declare class AnimationController {
6
- private static isRunning;
6
+ private static scheduledFrame;
7
7
  private static animations;
8
8
  static start<R extends object>(key: string, animation: Animation<R>): void;
9
+ private static scheduleNextFrame;
10
+ private static cancelScheduledFrame;
11
+ private static cancelScheduledFrameIfIdle;
9
12
  private static tick;
10
13
  static running(key: string): boolean;
11
14
  static cancel(key: string): void;
15
+ static reset(): void;
12
16
  }
@@ -1,9 +1,7 @@
1
1
  import { getScrollBars } from "../scene/scrollbars";
2
- import type { InteractiveSceneRenderConfig, RenderableElementsMap } from "../scene/types";
2
+ import type { InteractiveSceneRenderConfig } from "../scene/types";
3
3
  declare const _renderInteractiveScene: ({ app, canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig, editorInterface, animationState, deltaTime, }: InteractiveSceneRenderConfig) => {
4
4
  scrollBars?: ReturnType<typeof getScrollBars>;
5
- atLeastOneVisibleElement: boolean;
6
- elementsMap: RenderableElementsMap;
7
5
  animationState?: typeof animationState;
8
6
  };
9
7
  /**