@excalidraw/excalidraw 0.18.0-195a743 → 0.18.0-1b287a8ba

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 (163) hide show
  1. package/dist/dev/chunk-CBGOW5JB.js +5669 -0
  2. package/dist/dev/chunk-CBGOW5JB.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-T3M44BFV.js → chunk-QF5FRM6O.js} +12 -4
  6. package/dist/dev/chunk-QF5FRM6O.js.map +7 -0
  7. package/dist/dev/data/{image-TTQKTTOH.js → image-SURZSZNX.js} +3 -3
  8. package/dist/dev/index.css +89 -22
  9. package/dist/dev/index.css.map +3 -3
  10. package/dist/dev/index.js +7516 -9372
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-I23TB6DJ.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-IRHK23LL.js +4 -0
  18. package/dist/prod/data/image-HXEZYJPQ.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +26 -19
  21. package/dist/prod/locales/{en-TC3OFDA6.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 +19 -3
  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 +15 -5
  30. package/dist/types/element/src/Scene.d.ts +4 -4
  31. package/dist/types/element/src/align.d.ts +3 -2
  32. package/dist/types/element/src/binding.d.ts +11 -8
  33. package/dist/types/element/src/bounds.d.ts +12 -4
  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} +63 -38
  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 +1 -1
  40. package/dist/types/element/src/flowchart.d.ts +1 -1
  41. package/dist/types/element/src/fractionalIndex.d.ts +8 -2
  42. package/dist/types/element/src/frame.d.ts +3 -2
  43. package/dist/types/element/src/groups.d.ts +1 -0
  44. package/dist/types/element/src/index.d.ts +43 -2
  45. package/dist/types/element/src/linearElementEditor.d.ts +15 -29
  46. package/dist/types/element/src/mutateElement.d.ts +1 -1
  47. package/dist/types/element/src/newElement.d.ts +3 -2
  48. package/dist/types/element/src/resizeElements.d.ts +2 -1
  49. package/dist/types/element/src/selection.d.ts +0 -5
  50. package/dist/types/element/src/shape.d.ts +42 -0
  51. package/dist/types/element/src/sizeHelpers.d.ts +2 -1
  52. package/dist/types/element/src/store.d.ts +232 -0
  53. package/dist/types/element/src/textElement.d.ts +1 -1
  54. package/dist/types/element/src/typeChecks.d.ts +16 -1
  55. package/dist/types/element/src/types.d.ts +13 -3
  56. package/dist/types/element/src/utils.d.ts +16 -6
  57. package/dist/types/element/src/zindex.d.ts +3 -3
  58. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +39 -48
  59. package/dist/types/excalidraw/actions/actionBoundText.d.ts +26 -32
  60. package/dist/types/excalidraw/actions/actionCanvas.d.ts +173 -212
  61. package/dist/types/excalidraw/actions/actionClipboard.d.ts +75 -92
  62. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -16
  63. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +34 -42
  64. package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -15
  65. package/dist/types/excalidraw/actions/actionElementLock.d.ts +41 -48
  66. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -16
  67. package/dist/types/excalidraw/actions/actionExport.d.ts +127 -154
  68. package/dist/types/excalidraw/actions/actionFinalize.d.ts +69 -35
  69. package/dist/types/excalidraw/actions/actionFrame.d.ts +99 -111
  70. package/dist/types/excalidraw/actions/actionGroup.d.ts +26 -32
  71. package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
  72. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +505 -15
  73. package/dist/types/excalidraw/actions/actionLink.d.ts +13 -16
  74. package/dist/types/excalidraw/actions/actionMenu.d.ts +38 -47
  75. package/dist/types/excalidraw/actions/actionNavigate.d.ts +26 -32
  76. package/dist/types/excalidraw/actions/actionProperties.d.ts +186 -223
  77. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +12 -15
  78. package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -16
  79. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +13 -16
  80. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -16
  81. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +12 -188
  82. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -16
  83. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +13 -16
  84. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -16
  85. package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -2
  86. package/dist/types/excalidraw/actions/types.d.ts +3 -2
  87. package/dist/types/excalidraw/appState.d.ts +16 -7
  88. package/dist/types/excalidraw/components/App.d.ts +18 -20
  89. package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  90. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  91. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
  92. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  93. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
  94. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
  95. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
  96. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  97. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  98. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  99. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -28
  100. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  101. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  102. package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  103. package/dist/types/excalidraw/components/Range.d.ts +3 -3
  104. package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  105. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  106. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  107. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  108. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  109. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  110. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  111. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  112. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  113. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  114. package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
  115. package/dist/types/excalidraw/components/Stats/utils.d.ts +2 -1
  116. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  117. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -1
  118. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  119. package/dist/types/excalidraw/components/icons.d.ts +3 -0
  120. package/dist/types/excalidraw/components/shapes.d.ts +1 -1
  121. package/dist/types/excalidraw/data/transform.d.ts +1 -1
  122. package/dist/types/excalidraw/eraser/index.d.ts +0 -2
  123. package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
  124. package/dist/types/excalidraw/history.d.ts +30 -22
  125. package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  126. package/dist/types/excalidraw/index.d.ts +10 -9
  127. package/dist/types/excalidraw/lasso/index.d.ts +1 -0
  128. package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
  129. package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
  130. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
  131. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  132. package/dist/types/excalidraw/snapping.d.ts +2 -2
  133. package/dist/types/excalidraw/types.d.ts +23 -10
  134. package/dist/types/math/src/angle.d.ts +2 -0
  135. package/dist/types/math/src/constants.d.ts +3 -0
  136. package/dist/types/math/src/curve.d.ts +34 -0
  137. package/dist/types/math/src/index.d.ts +1 -0
  138. package/dist/types/math/src/point.d.ts +1 -1
  139. package/dist/types/math/src/rectangle.d.ts +2 -0
  140. package/dist/types/math/src/vector.d.ts +8 -2
  141. package/dist/types/utils/src/bbox.d.ts +1 -1
  142. package/dist/types/utils/src/index.d.ts +1 -1
  143. package/dist/types/utils/src/withinBounds.d.ts +1 -1
  144. package/history.ts +147 -110
  145. package/package.json +12 -9
  146. package/dist/dev/chunk-H3EW23X2.js +0 -18294
  147. package/dist/dev/chunk-H3EW23X2.js.map +0 -7
  148. package/dist/dev/chunk-T3M44BFV.js.map +0 -7
  149. package/dist/dev/chunk-WMGEUIQQ.js +0 -7
  150. package/dist/dev/chunk-WMGEUIQQ.js.map +0 -7
  151. package/dist/prod/chunk-2Z7RPVPO.js +0 -12
  152. package/dist/prod/chunk-7M43VNIB.js +0 -33
  153. package/dist/prod/chunk-GK4XUKZB.js +0 -7
  154. package/dist/prod/data/image-7YYIWLVQ.js +0 -1
  155. package/dist/types/element/src/Shape.d.ts +0 -17
  156. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  157. package/dist/types/element/src/shapes.d.ts +0 -23
  158. package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  159. package/dist/types/excalidraw/store.d.ts +0 -129
  160. package/dist/types/excalidraw/visualdebug.d.ts +0 -41
  161. package/dist/types/utils/src/collision.d.ts +0 -8
  162. /package/dist/dev/data/{image-TTQKTTOH.js.map → image-SURZSZNX.js.map} +0 -0
  163. /package/dist/dev/locales/{en-I23TB6DJ.js.map → en-SMAPCEOQ.js.map} +0 -0
@@ -1,11 +1,51 @@
1
1
  /// <reference types="react" />
2
- import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
2
+ import { LinearElementEditor } from "@excalidraw/element";
3
+ import type { LocalPoint } from "@excalidraw/math";
4
+ import type { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "@excalidraw/element/types";
3
5
  import type { AppState } from "../types";
4
6
  export declare const actionFinalize: {
5
7
  name: "finalize";
6
8
  label: string;
7
9
  trackEvent: false;
8
- perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
10
+ perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, data: any, app: import("../types").AppClassProperties) => {
11
+ elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
12
+ appState: {
13
+ selectedLinearElement: {
14
+ selectedPointsIndices: null;
15
+ elementId: string & {
16
+ _brand: "excalidrawLinearElementId";
17
+ };
18
+ pointerDownState: Readonly<{
19
+ prevSelectedPointsIndices: readonly number[] | null;
20
+ lastClickedPoint: number;
21
+ lastClickedIsEndPoint: boolean;
22
+ origin: Readonly<{
23
+ x: number;
24
+ y: number;
25
+ }> | null;
26
+ segmentMidpoint: {
27
+ value: import("@excalidraw/math").GlobalPoint | null;
28
+ index: number | null;
29
+ added: boolean;
30
+ };
31
+ }>;
32
+ isDragging: boolean;
33
+ lastUncommittedPoint: LocalPoint | null;
34
+ pointerOffset: Readonly<{
35
+ x: number;
36
+ y: number;
37
+ }>;
38
+ startBindingElement: import("@excalidraw/element/types").ExcalidrawBindableElement | "keep" | null;
39
+ endBindingElement: import("@excalidraw/element/types").ExcalidrawBindableElement | "keep" | null;
40
+ hoverPointIndex: number;
41
+ segmentMidPointHoveredCoords: import("@excalidraw/math").GlobalPoint | null;
42
+ elbowed: boolean;
43
+ customLineAngle: number | null;
44
+ };
45
+ suggestedBindings: never[];
46
+ };
47
+ captureUpdate: "IMMEDIATELY";
48
+ } | {
9
49
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[] | undefined;
10
50
  appState: {
11
51
  cursorButton: "up";
@@ -20,16 +60,16 @@ export declare const actionFinalize: {
20
60
  errorMessage: import("react").ReactNode;
21
61
  activeEmbeddable: {
22
62
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
23
- state: "hover" | "active";
63
+ state: "active" | "hover";
24
64
  } | null;
25
- newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
65
+ newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
26
66
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
27
- multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
67
+ multiElement: NonDeleted<ExcalidrawLinearElement> | null;
28
68
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
29
69
  isBindingEnabled: boolean;
30
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
31
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
32
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
70
+ startBoundElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
71
+ suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
72
+ frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
33
73
  frameRendering: {
34
74
  enabled: boolean;
35
75
  name: boolean;
@@ -37,7 +77,7 @@ export declare const actionFinalize: {
37
77
  clip: boolean;
38
78
  };
39
79
  editingFrame: string | null;
40
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
80
+ elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
41
81
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
42
82
  activeTool: {
43
83
  lastActiveTool: import("../types").ActiveTool | null;
@@ -85,7 +125,7 @@ export declare const actionFinalize: {
85
125
  name: "imageExport" | "help" | "jsonExport";
86
126
  } | {
87
127
  name: "ttd";
88
- tab: "text-to-diagram" | "mermaid";
128
+ tab: "mermaid" | "text-to-diagram";
89
129
  } | {
90
130
  name: "commandPalette";
91
131
  } | {
@@ -157,7 +197,6 @@ export declare const actionFinalize: {
157
197
  shown: true;
158
198
  data: import("../charts").Spreadsheet;
159
199
  };
160
- pendingImageElementId: string | null;
161
200
  showHyperlinkPopup: false | "editor" | "info";
162
201
  selectedLinearElement: LinearElementEditor | null;
163
202
  snapLines: readonly import("../snapping").SnapLine[];
@@ -170,16 +209,14 @@ export declare const actionFinalize: {
170
209
  followedBy: Set<import("../types").SocketId>;
171
210
  isCropping: boolean;
172
211
  croppingElementId: string | null;
173
- searchMatches: readonly {
174
- id: string;
175
- focus: boolean;
176
- matchedLines: {
177
- offsetX: number;
178
- offsetY: number;
179
- width: number;
180
- height: number;
181
- }[];
182
- }[];
212
+ searchMatches: Readonly<{
213
+ focusedId: string | null;
214
+ matches: readonly import("../types").SearchMatch[];
215
+ }> | null;
216
+ activeLockedId: string | null;
217
+ lockedMultiSelections: {
218
+ [groupId: string]: true;
219
+ };
183
220
  };
184
221
  captureUpdate: "IMMEDIATELY";
185
222
  } | {
@@ -202,7 +239,6 @@ export declare const actionFinalize: {
202
239
  [id: string]: true;
203
240
  }>;
204
241
  selectedLinearElement: LinearElementEditor | null;
205
- pendingImageElementId: null;
206
242
  contextMenu: {
207
243
  items: import("../components/ContextMenu").ContextMenuItems;
208
244
  top: number;
@@ -213,7 +249,7 @@ export declare const actionFinalize: {
213
249
  errorMessage: import("react").ReactNode;
214
250
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
215
251
  isBindingEnabled: boolean;
216
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
252
+ frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
217
253
  frameRendering: {
218
254
  enabled: boolean;
219
255
  name: boolean;
@@ -221,7 +257,7 @@ export declare const actionFinalize: {
221
257
  clip: boolean;
222
258
  };
223
259
  editingFrame: string | null;
224
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
260
+ elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
225
261
  editingLinearElement: LinearElementEditor | null;
226
262
  penMode: boolean;
227
263
  penDetected: boolean;
@@ -264,7 +300,7 @@ export declare const actionFinalize: {
264
300
  name: "imageExport" | "help" | "jsonExport";
265
301
  } | {
266
302
  name: "ttd";
267
- tab: "text-to-diagram" | "mermaid";
303
+ tab: "mermaid" | "text-to-diagram";
268
304
  } | {
269
305
  name: "commandPalette";
270
306
  } | {
@@ -344,16 +380,14 @@ export declare const actionFinalize: {
344
380
  followedBy: Set<import("../types").SocketId>;
345
381
  isCropping: boolean;
346
382
  croppingElementId: string | null;
347
- searchMatches: readonly {
348
- id: string;
349
- focus: boolean;
350
- matchedLines: {
351
- offsetX: number;
352
- offsetY: number;
353
- width: number;
354
- height: number;
355
- }[];
356
- }[];
383
+ searchMatches: Readonly<{
384
+ focusedId: string | null;
385
+ matches: readonly import("../types").SearchMatch[];
386
+ }> | null;
387
+ activeLockedId: string | null;
388
+ lockedMultiSelections: {
389
+ [groupId: string]: true;
390
+ };
357
391
  };
358
392
  captureUpdate: "IMMEDIATELY";
359
393
  };