@excalidraw/math 0.18.0-6135548 → 0.18.0-699826

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 (150) hide show
  1. package/dist/dev/index.js +150 -130
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +1 -1
  4. package/dist/types/common/debug.d.ts +21 -0
  5. package/dist/types/common/src/appEventBus.d.ts +27 -0
  6. package/dist/types/common/src/colors.d.ts +2 -2
  7. package/dist/types/common/src/constants.d.ts +5 -2
  8. package/dist/types/common/src/index.d.ts +3 -0
  9. package/dist/types/common/src/utils.d.ts +4 -7
  10. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  11. package/dist/types/element/src/Scene.d.ts +7 -3
  12. package/dist/types/element/src/arrowheads.d.ts +3 -0
  13. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  14. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  15. package/dist/types/element/src/binding.d.ts +13 -8
  16. package/dist/types/element/src/bounds.d.ts +22 -3
  17. package/dist/types/element/src/collision.d.ts +4 -3
  18. package/dist/types/element/src/distribute.d.ts +2 -1
  19. package/dist/types/element/src/duplicate.d.ts +1 -0
  20. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  21. package/dist/types/element/src/frame.d.ts +7 -6
  22. package/dist/types/element/src/index.d.ts +3 -0
  23. package/dist/types/element/src/linearElementEditor.d.ts +7 -2
  24. package/dist/types/element/src/mutateElement.d.ts +2 -0
  25. package/dist/types/element/src/selection.d.ts +7 -3
  26. package/dist/types/element/src/shape.d.ts +1 -1
  27. package/dist/types/element/src/textElement.d.ts +1 -1
  28. package/dist/types/element/src/textWrapping.d.ts +26 -0
  29. package/dist/types/element/src/typeChecks.d.ts +1 -0
  30. package/dist/types/element/src/types.d.ts +5 -2
  31. package/dist/types/element/src/utils.d.ts +6 -4
  32. package/dist/types/element/src/zindex.d.ts +1 -1
  33. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +41 -38
  34. package/dist/types/excalidraw/actions/actionBoundText.d.ts +29 -27
  35. package/dist/types/excalidraw/actions/actionCanvas.d.ts +169 -157
  36. package/dist/types/excalidraw/actions/actionClipboard.d.ts +28 -26
  37. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +14 -13
  38. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +44 -39
  39. package/dist/types/excalidraw/actions/actionDeselect.d.ts +159 -0
  40. package/dist/types/excalidraw/actions/actionElementLink.d.ts +10 -13
  41. package/dist/types/excalidraw/actions/actionElementLock.d.ts +28 -26
  42. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +14 -13
  43. package/dist/types/excalidraw/actions/actionExport.d.ts +77 -349
  44. package/dist/types/excalidraw/actions/actionFrame.d.ts +56 -52
  45. package/dist/types/excalidraw/actions/actionGroup.d.ts +29 -27
  46. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +16 -13
  47. package/dist/types/excalidraw/actions/actionLink.d.ts +14 -13
  48. package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -13
  49. package/dist/types/excalidraw/actions/actionProperties.d.ts +30 -28
  50. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +14 -13
  51. package/dist/types/excalidraw/actions/actionStyles.d.ts +14 -12
  52. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  53. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +172 -0
  54. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +14 -13
  55. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +172 -0
  56. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +14 -13
  57. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -13
  58. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +14 -13
  59. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -13
  60. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +14 -13
  61. package/dist/types/excalidraw/actions/index.d.ts +3 -0
  62. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  63. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  64. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  65. package/dist/types/excalidraw/appState.d.ts +10 -7
  66. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  67. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  68. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  69. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  70. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  71. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  72. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  73. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  74. package/dist/types/excalidraw/clipboard.d.ts +6 -7
  75. package/dist/types/excalidraw/components/App.d.ts +63 -16
  76. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  77. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  78. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
  79. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  80. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  81. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  82. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  83. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  84. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +2 -6
  85. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +2 -1
  86. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  87. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +11 -7
  88. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  89. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
  90. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  91. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
  92. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  93. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +4 -0
  94. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  95. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  96. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  97. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -1
  98. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  99. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  100. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -17
  101. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
  102. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -13
  103. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  104. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  105. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  106. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  107. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  108. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  109. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  110. package/dist/types/excalidraw/components/icons.d.ts +23 -9
  111. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +24 -3
  112. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -13
  113. package/dist/types/excalidraw/components/shapes.d.ts +81 -1
  114. package/dist/types/excalidraw/data/blob.d.ts +47 -46
  115. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  116. package/dist/types/excalidraw/data/index.d.ts +2 -3
  117. package/dist/types/excalidraw/data/json.d.ts +37 -28
  118. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  119. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  120. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  121. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  122. package/dist/types/excalidraw/renderer/animation.d.ts +4 -1
  123. package/dist/types/excalidraw/scene/Renderer.d.ts +425 -19
  124. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  125. package/dist/types/excalidraw/types.d.ts +116 -18
  126. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
  127. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  128. package/dist/types/math/src/constants.d.ts +0 -1
  129. package/dist/types/math/src/curve.d.ts +4 -1
  130. package/dist/types/math/src/point.d.ts +8 -2
  131. package/dist/types/math/src/types.d.ts +25 -1
  132. package/dist/types/utils/src/index.d.ts +1 -2
  133. package/package.json +2 -2
  134. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  135. package/dist/types/excalidraw/charts.d.ts +0 -27
  136. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  137. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  138. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  139. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  140. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
  141. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  142. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  143. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  144. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  145. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  146. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  147. package/dist/types/excalidraw/index.d.ts +0 -46
  148. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  149. package/dist/types/utils/src/bbox.d.ts +0 -9
  150. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -39,8 +39,13 @@ export declare const actionToggleElementLock: {
39
39
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
40
40
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
41
41
  isBindingEnabled: boolean;
42
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
43
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
42
+ boxSelectionMode: import("../types").BoxSelectionMode;
43
+ bindingPreference: "enabled" | "disabled";
44
+ isMidpointSnappingEnabled: boolean;
45
+ suggestedBinding: {
46
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
47
+ midPoint?: import("@excalidraw/math").GlobalPoint;
48
+ } | null;
44
49
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
45
50
  frameRendering: {
46
51
  enabled: boolean;
@@ -50,7 +55,7 @@ export declare const actionToggleElementLock: {
50
55
  };
51
56
  editingFrame: string | null;
52
57
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
53
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
58
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
54
59
  activeTool: {
55
60
  lastActiveTool: import("../types").ActiveTool | null;
56
61
  locked: boolean;
@@ -108,6 +113,10 @@ export declare const actionToggleElementLock: {
108
113
  } | {
109
114
  name: "elementLinkSelector";
110
115
  sourceElementId: ExcalidrawElement["id"];
116
+ } | {
117
+ name: "charts";
118
+ data: import("../charts").Spreadsheet;
119
+ rawText: string;
111
120
  };
112
121
  defaultSidebarDockedPreference: boolean;
113
122
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -120,7 +129,7 @@ export declare const actionToggleElementLock: {
120
129
  selectedElementsAreBeingDragged: boolean;
121
130
  shouldCacheIgnoreZoom: boolean;
122
131
  toast: {
123
- message: string;
132
+ message: React.ReactNode;
124
133
  closable?: boolean;
125
134
  duration?: number;
126
135
  } | null;
@@ -135,20 +144,12 @@ export declare const actionToggleElementLock: {
135
144
  height: number;
136
145
  offsetTop: number;
137
146
  offsetLeft: number;
138
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
147
+ fileHandle: FileSystemFileHandle | null;
139
148
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
140
149
  stats: {
141
150
  open: boolean;
142
151
  panels: number;
143
152
  };
144
- currentChartType: import("@excalidraw/element/types").ChartType;
145
- pasteDialog: {
146
- shown: false;
147
- data: null;
148
- } | {
149
- shown: true;
150
- data: import("../charts").Spreadsheet;
151
- };
152
153
  showHyperlinkPopup: false | "info" | "editor";
153
154
  snapLines: readonly import("../snapping").SnapLine[];
154
155
  originSnapOffset: {
@@ -208,8 +209,13 @@ export declare const actionUnlockAllElements: {
208
209
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
209
210
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
210
211
  isBindingEnabled: boolean;
211
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
212
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
212
+ boxSelectionMode: import("../types").BoxSelectionMode;
213
+ bindingPreference: "enabled" | "disabled";
214
+ isMidpointSnappingEnabled: boolean;
215
+ suggestedBinding: {
216
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
217
+ midPoint?: import("@excalidraw/math").GlobalPoint;
218
+ } | null;
213
219
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
214
220
  frameRendering: {
215
221
  enabled: boolean;
@@ -219,7 +225,7 @@ export declare const actionUnlockAllElements: {
219
225
  };
220
226
  editingFrame: string | null;
221
227
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
222
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
228
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
223
229
  activeTool: {
224
230
  lastActiveTool: import("../types").ActiveTool | null;
225
231
  locked: boolean;
@@ -277,6 +283,10 @@ export declare const actionUnlockAllElements: {
277
283
  } | {
278
284
  name: "elementLinkSelector";
279
285
  sourceElementId: ExcalidrawElement["id"];
286
+ } | {
287
+ name: "charts";
288
+ data: import("../charts").Spreadsheet;
289
+ rawText: string;
280
290
  };
281
291
  defaultSidebarDockedPreference: boolean;
282
292
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -289,7 +299,7 @@ export declare const actionUnlockAllElements: {
289
299
  selectedElementsAreBeingDragged: boolean;
290
300
  shouldCacheIgnoreZoom: boolean;
291
301
  toast: {
292
- message: string;
302
+ message: React.ReactNode;
293
303
  closable?: boolean;
294
304
  duration?: number;
295
305
  } | null;
@@ -304,20 +314,12 @@ export declare const actionUnlockAllElements: {
304
314
  height: number;
305
315
  offsetTop: number;
306
316
  offsetLeft: number;
307
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
317
+ fileHandle: FileSystemFileHandle | null;
308
318
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
309
319
  stats: {
310
320
  open: boolean;
311
321
  panels: number;
312
322
  };
313
- currentChartType: import("@excalidraw/element/types").ChartType;
314
- pasteDialog: {
315
- shown: false;
316
- data: null;
317
- } | {
318
- shown: true;
319
- data: import("../charts").Spreadsheet;
320
- };
321
323
  showHyperlinkPopup: false | "info" | "editor";
322
324
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
323
325
  snapLines: readonly import("../snapping").SnapLine[];
@@ -30,8 +30,13 @@ export declare const actionSetEmbeddableAsActiveTool: {
30
30
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
31
31
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
32
32
  isBindingEnabled: boolean;
33
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
34
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
33
+ boxSelectionMode: import("../types").BoxSelectionMode;
34
+ bindingPreference: "enabled" | "disabled";
35
+ isMidpointSnappingEnabled: boolean;
36
+ suggestedBinding: {
37
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
38
+ midPoint?: import("@excalidraw/math").GlobalPoint;
39
+ } | null;
35
40
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
36
41
  frameRendering: {
37
42
  enabled: boolean;
@@ -41,7 +46,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
41
46
  };
42
47
  editingFrame: string | null;
43
48
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
44
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
49
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
45
50
  preferredSelectionTool: {
46
51
  type: "selection" | "lasso";
47
52
  initialized: boolean;
@@ -94,6 +99,10 @@ export declare const actionSetEmbeddableAsActiveTool: {
94
99
  } | {
95
100
  name: "elementLinkSelector";
96
101
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
102
+ } | {
103
+ name: "charts";
104
+ data: import("../charts").Spreadsheet;
105
+ rawText: string;
97
106
  };
98
107
  defaultSidebarDockedPreference: boolean;
99
108
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -109,7 +118,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
109
118
  selectedElementsAreBeingDragged: boolean;
110
119
  shouldCacheIgnoreZoom: boolean;
111
120
  toast: {
112
- message: string;
121
+ message: React.ReactNode;
113
122
  closable?: boolean;
114
123
  duration?: number;
115
124
  } | null;
@@ -127,20 +136,12 @@ export declare const actionSetEmbeddableAsActiveTool: {
127
136
  height: number;
128
137
  offsetTop: number;
129
138
  offsetLeft: number;
130
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
139
+ fileHandle: FileSystemFileHandle | null;
131
140
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
132
141
  stats: {
133
142
  open: boolean;
134
143
  panels: number;
135
144
  };
136
- currentChartType: import("@excalidraw/element/types").ChartType;
137
- pasteDialog: {
138
- shown: false;
139
- data: null;
140
- } | {
141
- shown: true;
142
- data: import("../charts").Spreadsheet;
143
- };
144
145
  showHyperlinkPopup: false | "info" | "editor";
145
146
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
146
147
  snapLines: readonly import("../snapping").SnapLine[];