@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
@@ -1,190 +1,270 @@
1
1
  import type { AppClassProperties } from "../types";
2
2
  export declare const SHAPES: readonly [{
3
+ readonly icon: import("react/jsx-runtime").JSX.Element;
4
+ readonly value: "hand";
5
+ readonly key: "h";
6
+ readonly numericKey: null;
7
+ readonly fillable: false;
8
+ readonly toolbar: true;
9
+ }, {
3
10
  readonly icon: import("react/jsx-runtime").JSX.Element;
4
11
  readonly value: "selection";
5
12
  readonly key: "v";
6
13
  readonly numericKey: "1";
7
14
  readonly fillable: true;
15
+ readonly toolbar: true;
8
16
  }, {
9
17
  readonly icon: import("react/jsx-runtime").JSX.Element;
10
18
  readonly value: "rectangle";
11
19
  readonly key: "r";
12
20
  readonly numericKey: "2";
13
21
  readonly fillable: true;
22
+ readonly toolbar: true;
14
23
  }, {
15
24
  readonly icon: import("react/jsx-runtime").JSX.Element;
16
25
  readonly value: "diamond";
17
26
  readonly key: "d";
18
27
  readonly numericKey: "3";
19
28
  readonly fillable: true;
29
+ readonly toolbar: true;
20
30
  }, {
21
31
  readonly icon: import("react/jsx-runtime").JSX.Element;
22
32
  readonly value: "ellipse";
23
33
  readonly key: "o";
24
34
  readonly numericKey: "4";
25
35
  readonly fillable: true;
36
+ readonly toolbar: true;
26
37
  }, {
27
38
  readonly icon: import("react/jsx-runtime").JSX.Element;
28
39
  readonly value: "arrow";
29
40
  readonly key: "a";
30
41
  readonly numericKey: "5";
31
42
  readonly fillable: true;
43
+ readonly toolbar: true;
32
44
  }, {
33
45
  readonly icon: import("react/jsx-runtime").JSX.Element;
34
46
  readonly value: "line";
35
47
  readonly key: "l";
36
48
  readonly numericKey: "6";
37
49
  readonly fillable: true;
50
+ readonly toolbar: true;
38
51
  }, {
39
52
  readonly icon: import("react/jsx-runtime").JSX.Element;
40
53
  readonly value: "freedraw";
41
54
  readonly key: readonly ["p", "x"];
42
55
  readonly numericKey: "7";
43
56
  readonly fillable: false;
57
+ readonly toolbar: true;
44
58
  }, {
45
59
  readonly icon: import("react/jsx-runtime").JSX.Element;
46
60
  readonly value: "text";
47
61
  readonly key: "t";
48
62
  readonly numericKey: "8";
49
63
  readonly fillable: false;
64
+ readonly toolbar: true;
50
65
  }, {
51
66
  readonly icon: import("react/jsx-runtime").JSX.Element;
52
67
  readonly value: "image";
53
68
  readonly key: null;
54
69
  readonly numericKey: "9";
55
70
  readonly fillable: false;
71
+ readonly toolbar: true;
56
72
  }, {
57
73
  readonly icon: import("react/jsx-runtime").JSX.Element;
58
74
  readonly value: "eraser";
59
75
  readonly key: "e";
60
76
  readonly numericKey: "0";
61
77
  readonly fillable: false;
78
+ readonly toolbar: true;
79
+ }, {
80
+ readonly icon: import("react/jsx-runtime").JSX.Element;
81
+ readonly value: "laser";
82
+ readonly key: "k";
83
+ readonly numericKey: null;
84
+ readonly fillable: false;
85
+ readonly toolbar: false;
62
86
  }];
63
87
  export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
88
+ readonly icon: import("react/jsx-runtime").JSX.Element;
89
+ readonly value: "hand";
90
+ readonly key: "h";
91
+ readonly numericKey: null;
92
+ readonly fillable: false;
93
+ readonly toolbar: true;
94
+ }, {
64
95
  readonly icon: import("react/jsx-runtime").JSX.Element;
65
96
  readonly value: "selection";
66
97
  readonly key: "v";
67
98
  readonly numericKey: "1";
68
99
  readonly fillable: true;
100
+ readonly toolbar: true;
69
101
  }, {
70
102
  readonly icon: import("react/jsx-runtime").JSX.Element;
71
103
  readonly value: "rectangle";
72
104
  readonly key: "r";
73
105
  readonly numericKey: "2";
74
106
  readonly fillable: true;
107
+ readonly toolbar: true;
75
108
  }, {
76
109
  readonly icon: import("react/jsx-runtime").JSX.Element;
77
110
  readonly value: "diamond";
78
111
  readonly key: "d";
79
112
  readonly numericKey: "3";
80
113
  readonly fillable: true;
114
+ readonly toolbar: true;
81
115
  }, {
82
116
  readonly icon: import("react/jsx-runtime").JSX.Element;
83
117
  readonly value: "ellipse";
84
118
  readonly key: "o";
85
119
  readonly numericKey: "4";
86
120
  readonly fillable: true;
121
+ readonly toolbar: true;
87
122
  }, {
88
123
  readonly icon: import("react/jsx-runtime").JSX.Element;
89
124
  readonly value: "arrow";
90
125
  readonly key: "a";
91
126
  readonly numericKey: "5";
92
127
  readonly fillable: true;
128
+ readonly toolbar: true;
93
129
  }, {
94
130
  readonly icon: import("react/jsx-runtime").JSX.Element;
95
131
  readonly value: "line";
96
132
  readonly key: "l";
97
133
  readonly numericKey: "6";
98
134
  readonly fillable: true;
135
+ readonly toolbar: true;
99
136
  }, {
100
137
  readonly icon: import("react/jsx-runtime").JSX.Element;
101
138
  readonly value: "freedraw";
102
139
  readonly key: readonly ["p", "x"];
103
140
  readonly numericKey: "7";
104
141
  readonly fillable: false;
142
+ readonly toolbar: true;
105
143
  }, {
106
144
  readonly icon: import("react/jsx-runtime").JSX.Element;
107
145
  readonly value: "text";
108
146
  readonly key: "t";
109
147
  readonly numericKey: "8";
110
148
  readonly fillable: false;
149
+ readonly toolbar: true;
111
150
  }, {
112
151
  readonly icon: import("react/jsx-runtime").JSX.Element;
113
152
  readonly value: "image";
114
153
  readonly key: null;
115
154
  readonly numericKey: "9";
116
155
  readonly fillable: false;
156
+ readonly toolbar: true;
117
157
  }, {
118
158
  readonly icon: import("react/jsx-runtime").JSX.Element;
119
159
  readonly value: "eraser";
120
160
  readonly key: "e";
121
161
  readonly numericKey: "0";
122
162
  readonly fillable: false;
163
+ readonly toolbar: true;
164
+ }, {
165
+ readonly icon: import("react/jsx-runtime").JSX.Element;
166
+ readonly value: "laser";
167
+ readonly key: "k";
168
+ readonly numericKey: null;
169
+ readonly fillable: false;
170
+ readonly toolbar: false;
123
171
  }] | readonly [{
172
+ readonly icon: import("react/jsx-runtime").JSX.Element;
173
+ readonly value: "hand";
174
+ readonly key: "h";
175
+ readonly numericKey: null;
176
+ readonly fillable: false;
177
+ readonly toolbar: true;
178
+ }, {
124
179
  readonly value: "lasso";
125
180
  readonly icon: import("react/jsx-runtime").JSX.Element;
126
181
  readonly key: "v";
127
182
  readonly numericKey: "1";
128
183
  readonly fillable: true;
184
+ readonly toolbar: true;
129
185
  }, ...({
186
+ readonly icon: import("react/jsx-runtime").JSX.Element;
187
+ readonly value: "hand";
188
+ readonly key: "h";
189
+ readonly numericKey: null;
190
+ readonly fillable: false;
191
+ readonly toolbar: true;
192
+ } | {
130
193
  readonly icon: import("react/jsx-runtime").JSX.Element;
131
194
  readonly value: "selection";
132
195
  readonly key: "v";
133
196
  readonly numericKey: "1";
134
197
  readonly fillable: true;
198
+ readonly toolbar: true;
135
199
  } | {
136
200
  readonly icon: import("react/jsx-runtime").JSX.Element;
137
201
  readonly value: "rectangle";
138
202
  readonly key: "r";
139
203
  readonly numericKey: "2";
140
204
  readonly fillable: true;
205
+ readonly toolbar: true;
141
206
  } | {
142
207
  readonly icon: import("react/jsx-runtime").JSX.Element;
143
208
  readonly value: "diamond";
144
209
  readonly key: "d";
145
210
  readonly numericKey: "3";
146
211
  readonly fillable: true;
212
+ readonly toolbar: true;
147
213
  } | {
148
214
  readonly icon: import("react/jsx-runtime").JSX.Element;
149
215
  readonly value: "ellipse";
150
216
  readonly key: "o";
151
217
  readonly numericKey: "4";
152
218
  readonly fillable: true;
219
+ readonly toolbar: true;
153
220
  } | {
154
221
  readonly icon: import("react/jsx-runtime").JSX.Element;
155
222
  readonly value: "arrow";
156
223
  readonly key: "a";
157
224
  readonly numericKey: "5";
158
225
  readonly fillable: true;
226
+ readonly toolbar: true;
159
227
  } | {
160
228
  readonly icon: import("react/jsx-runtime").JSX.Element;
161
229
  readonly value: "line";
162
230
  readonly key: "l";
163
231
  readonly numericKey: "6";
164
232
  readonly fillable: true;
233
+ readonly toolbar: true;
165
234
  } | {
166
235
  readonly icon: import("react/jsx-runtime").JSX.Element;
167
236
  readonly value: "freedraw";
168
237
  readonly key: readonly ["p", "x"];
169
238
  readonly numericKey: "7";
170
239
  readonly fillable: false;
240
+ readonly toolbar: true;
171
241
  } | {
172
242
  readonly icon: import("react/jsx-runtime").JSX.Element;
173
243
  readonly value: "text";
174
244
  readonly key: "t";
175
245
  readonly numericKey: "8";
176
246
  readonly fillable: false;
247
+ readonly toolbar: true;
177
248
  } | {
178
249
  readonly icon: import("react/jsx-runtime").JSX.Element;
179
250
  readonly value: "image";
180
251
  readonly key: null;
181
252
  readonly numericKey: "9";
182
253
  readonly fillable: false;
254
+ readonly toolbar: true;
183
255
  } | {
184
256
  readonly icon: import("react/jsx-runtime").JSX.Element;
185
257
  readonly value: "eraser";
186
258
  readonly key: "e";
187
259
  readonly numericKey: "0";
188
260
  readonly fillable: false;
261
+ readonly toolbar: true;
262
+ } | {
263
+ readonly icon: import("react/jsx-runtime").JSX.Element;
264
+ readonly value: "laser";
265
+ readonly key: "k";
266
+ readonly numericKey: null;
267
+ readonly fillable: false;
268
+ readonly toolbar: false;
189
269
  })[]];
190
- export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "lasso" | "eraser" | null;
270
+ export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "lasso" | "eraser" | "hand" | "laser" | null;
@@ -2,12 +2,11 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
2
2
  import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
4
  import type { AppState, DataURL, LibraryItem } from "../types";
5
- import type { FileSystemHandle } from "browser-fs-access";
6
5
  import type { ImportedLibraryData } from "./types";
7
6
  export declare const getMimeType: (blob: Blob | string) => string;
8
- export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
7
+ export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
9
8
  export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
10
- export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
9
+ export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
11
10
  export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
12
11
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
13
12
  type: ValueOf<typeof IMAGE_MIME_TYPES>;
@@ -15,8 +14,8 @@ export declare const isSupportedImageFile: (blob: Blob | null | undefined) => bl
15
14
  export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
16
15
  /** @see restore.localAppState */
17
16
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
18
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
19
- fileHandle?: FileSystemHandle | null) => Promise<{
17
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
18
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
20
19
  type: "application/vnd.excalidraw+json";
21
20
  data: {
22
21
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
@@ -46,12 +45,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
46
45
  } | {
47
46
  name: "elementLinkSelector";
48
47
  sourceElementId: ExcalidrawElement["id"];
48
+ } | {
49
+ name: "charts";
50
+ data: import("../charts").Spreadsheet;
51
+ rawText: string;
49
52
  };
50
53
  editingGroupId: import("@excalidraw/element/types").GroupId | null;
51
54
  selectedElementIds: Readonly<{
52
55
  [id: string]: true;
53
56
  }>;
54
57
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
58
+ activeTool: {
59
+ lastActiveTool: import("../types").ActiveTool | null;
60
+ locked: boolean;
61
+ fromSelection: boolean;
62
+ } & import("../types").ActiveTool;
55
63
  activeEmbeddable: {
56
64
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
57
65
  state: "hover" | "active";
@@ -64,13 +72,17 @@ fileHandle?: FileSystemHandle | null) => Promise<{
64
72
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
65
73
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
66
74
  isBindingEnabled: boolean;
67
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
75
+ isMidpointSnappingEnabled: boolean;
76
+ suggestedBinding: {
77
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
78
+ midPoint?: import("@excalidraw/math").GlobalPoint;
79
+ } | null;
68
80
  isRotating: boolean;
69
81
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
70
82
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
71
83
  snapLines: readonly import("../snapping").SnapLine[];
72
84
  zenModeEnabled: boolean;
73
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
85
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
74
86
  isCropping: boolean;
75
87
  croppingElementId: ExcalidrawElement["id"] | null;
76
88
  searchMatches: Readonly<{
@@ -83,6 +95,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
83
95
  }>;
84
96
  shouldCacheIgnoreZoom: boolean;
85
97
  exportScale: number;
98
+ currentItemArrowType: "sharp" | "round" | "elbow";
86
99
  bindMode: import("@excalidraw/element/types").BindMode;
87
100
  gridSize: number;
88
101
  contextMenu: {
@@ -94,13 +107,9 @@ fileHandle?: FileSystemHandle | null) => Promise<{
94
107
  isLoading: boolean;
95
108
  errorMessage: React.ReactNode;
96
109
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
97
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
110
+ boxSelectionMode: import("../types").BoxSelectionMode;
111
+ bindingPreference: "enabled" | "disabled";
98
112
  editingFrame: string | null;
99
- activeTool: {
100
- lastActiveTool: import("../types").ActiveTool | null;
101
- locked: boolean;
102
- fromSelection: boolean;
103
- } & import("../types").ActiveTool;
104
113
  preferredSelectionTool: {
105
114
  type: "selection" | "lasso";
106
115
  initialized: boolean;
@@ -124,7 +133,6 @@ fileHandle?: FileSystemHandle | null) => Promise<{
124
133
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
125
134
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
126
135
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
127
- currentItemArrowType: "sharp" | "round" | "elbow";
128
136
  cursorButton: "up" | "down";
129
137
  scrolledOutside: boolean;
130
138
  isResizing: boolean;
@@ -141,25 +149,17 @@ fileHandle?: FileSystemHandle | null) => Promise<{
141
149
  };
142
150
  selectedElementsAreBeingDragged: boolean;
143
151
  toast: {
144
- message: string;
152
+ message: React.ReactNode;
145
153
  closable?: boolean;
146
154
  duration?: number;
147
155
  } | null;
148
156
  gridStep: number;
149
157
  gridModeEnabled: boolean;
150
- fileHandle: FileSystemHandle | null;
158
+ fileHandle: FileSystemFileHandle | null;
151
159
  stats: {
152
160
  open: boolean;
153
161
  panels: number;
154
162
  };
155
- currentChartType: import("@excalidraw/element/types").ChartType;
156
- pasteDialog: {
157
- shown: false;
158
- data: null;
159
- } | {
160
- shown: true;
161
- data: import("../charts").Spreadsheet;
162
- };
163
163
  showHyperlinkPopup: false | "info" | "editor";
164
164
  originSnapOffset: {
165
165
  x: number;
@@ -181,8 +181,8 @@ fileHandle?: FileSystemHandle | null) => Promise<{
181
181
  export declare const loadFromBlob: (blob: Blob,
182
182
  /** @see restore.localAppState */
183
183
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
184
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
185
- fileHandle?: FileSystemHandle | null) => Promise<{
184
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
185
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
186
186
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
187
187
  appState: {
188
188
  viewBackgroundColor: string;
@@ -210,12 +210,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
210
210
  } | {
211
211
  name: "elementLinkSelector";
212
212
  sourceElementId: ExcalidrawElement["id"];
213
+ } | {
214
+ name: "charts";
215
+ data: import("../charts").Spreadsheet;
216
+ rawText: string;
213
217
  };
214
218
  editingGroupId: import("@excalidraw/element/types").GroupId | null;
215
219
  selectedElementIds: Readonly<{
216
220
  [id: string]: true;
217
221
  }>;
218
222
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
223
+ activeTool: {
224
+ lastActiveTool: import("../types").ActiveTool | null;
225
+ locked: boolean;
226
+ fromSelection: boolean;
227
+ } & import("../types").ActiveTool;
219
228
  activeEmbeddable: {
220
229
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
221
230
  state: "hover" | "active";
@@ -228,13 +237,17 @@ fileHandle?: FileSystemHandle | null) => Promise<{
228
237
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
229
238
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
230
239
  isBindingEnabled: boolean;
231
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
240
+ isMidpointSnappingEnabled: boolean;
241
+ suggestedBinding: {
242
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
243
+ midPoint?: import("@excalidraw/math").GlobalPoint;
244
+ } | null;
232
245
  isRotating: boolean;
233
246
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
234
247
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
235
248
  snapLines: readonly import("../snapping").SnapLine[];
236
249
  zenModeEnabled: boolean;
237
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
250
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
238
251
  isCropping: boolean;
239
252
  croppingElementId: ExcalidrawElement["id"] | null;
240
253
  searchMatches: Readonly<{
@@ -247,6 +260,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
247
260
  }>;
248
261
  shouldCacheIgnoreZoom: boolean;
249
262
  exportScale: number;
263
+ currentItemArrowType: "sharp" | "round" | "elbow";
250
264
  bindMode: import("@excalidraw/element/types").BindMode;
251
265
  gridSize: number;
252
266
  contextMenu: {
@@ -258,13 +272,9 @@ fileHandle?: FileSystemHandle | null) => Promise<{
258
272
  isLoading: boolean;
259
273
  errorMessage: React.ReactNode;
260
274
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
261
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
275
+ boxSelectionMode: import("../types").BoxSelectionMode;
276
+ bindingPreference: "enabled" | "disabled";
262
277
  editingFrame: string | null;
263
- activeTool: {
264
- lastActiveTool: import("../types").ActiveTool | null;
265
- locked: boolean;
266
- fromSelection: boolean;
267
- } & import("../types").ActiveTool;
268
278
  preferredSelectionTool: {
269
279
  type: "selection" | "lasso";
270
280
  initialized: boolean;
@@ -288,7 +298,6 @@ fileHandle?: FileSystemHandle | null) => Promise<{
288
298
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
289
299
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
290
300
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
291
- currentItemArrowType: "sharp" | "round" | "elbow";
292
301
  cursorButton: "up" | "down";
293
302
  scrolledOutside: boolean;
294
303
  isResizing: boolean;
@@ -305,25 +314,17 @@ fileHandle?: FileSystemHandle | null) => Promise<{
305
314
  };
306
315
  selectedElementsAreBeingDragged: boolean;
307
316
  toast: {
308
- message: string;
317
+ message: React.ReactNode;
309
318
  closable?: boolean;
310
319
  duration?: number;
311
320
  } | null;
312
321
  gridStep: number;
313
322
  gridModeEnabled: boolean;
314
- fileHandle: FileSystemHandle | null;
323
+ fileHandle: FileSystemFileHandle | null;
315
324
  stats: {
316
325
  open: boolean;
317
326
  panels: number;
318
327
  };
319
- currentChartType: import("@excalidraw/element/types").ChartType;
320
- pasteDialog: {
321
- shown: false;
322
- data: null;
323
- } | {
324
- shown: true;
325
- data: import("../charts").Spreadsheet;
326
- };
327
328
  showHyperlinkPopup: false | "info" | "editor";
328
329
  originSnapOffset: {
329
330
  x: number;
@@ -358,7 +359,7 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
358
359
  type: typeof MIME_TYPES.svg;
359
360
  };
360
361
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
361
- export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
362
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
362
363
  export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
363
364
  /** attempts to detect correct mimeType if none is set, or if an image
364
365
  * has an incorrect extension.
@@ -1,6 +1,5 @@
1
1
  import { supported as nativeFileSystemSupported } from "browser-fs-access";
2
2
  import { MIME_TYPES } from "@excalidraw/common";
3
- import type { FileSystemHandle } from "browser-fs-access";
4
3
  type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
5
4
  export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
6
5
  extensions?: FILE_EXTENSION[];
@@ -14,8 +13,7 @@ export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
14
13
  extension: FILE_EXTENSION;
15
14
  mimeTypes?: string[];
16
15
  description: string;
17
- /** existing FileSystemHandle */
18
- fileHandle?: FileSystemHandle | null;
19
- }) => Promise<FileSystemHandle | null>;
16
+ /** existing FileSystemFileHandle */
17
+ fileHandle?: FileSystemFileHandle | null;
18
+ }) => Promise<FileSystemFileHandle | null>;
20
19
  export { nativeFileSystemSupported };
21
- export type { FileSystemHandle };
@@ -1,5 +1,4 @@
1
1
  import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { FileSystemHandle } from "./filesystem";
3
2
  import type { ExportType } from "../scene/types";
4
3
  import type { AppState, BinaryFiles } from "../types";
5
4
  export { loadFromBlob } from "./blob";
@@ -17,6 +16,6 @@ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements:
17
16
  viewBackgroundColor: string;
18
17
  /** filename, if applicable */
19
18
  name?: string;
20
- fileHandle?: FileSystemHandle | null;
19
+ fileHandle?: FileSystemFileHandle | null;
21
20
  exportingFrame: ExcalidrawFrameLikeElement | null;
22
- }) => Promise<FileSystemHandle | null | undefined>;
21
+ }) => Promise<FileSystemFileHandle | null | undefined>;