@excalidraw/math 0.18.0-b9d27d3 → 0.18.0-c141960

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 (102) hide show
  1. package/dist/dev/index.js +58 -61
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +1 -1
  4. package/dist/types/common/src/constants.d.ts +9 -13
  5. package/dist/types/common/src/editorInterface.d.ts +34 -0
  6. package/dist/types/common/src/index.d.ts +2 -0
  7. package/dist/types/common/src/utils.d.ts +9 -3
  8. package/dist/types/common/src/visualdebug.d.ts +41 -0
  9. package/dist/types/element/src/binding.d.ts +55 -43
  10. package/dist/types/element/src/collision.d.ts +6 -2
  11. package/dist/types/element/src/index.d.ts +0 -3
  12. package/dist/types/element/src/linearElementEditor.d.ts +15 -18
  13. package/dist/types/element/src/renderElement.d.ts +5 -2
  14. package/dist/types/element/src/resizeTest.d.ts +5 -4
  15. package/dist/types/element/src/transformHandles.d.ts +5 -4
  16. package/dist/types/element/src/typeChecks.d.ts +2 -3
  17. package/dist/types/element/src/types.d.ts +7 -11
  18. package/dist/types/element/src/utils.d.ts +2 -1
  19. package/dist/types/element/src/zindex.d.ts +7 -1
  20. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +34 -13
  21. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  22. package/dist/types/excalidraw/actions/actionBoundText.d.ts +25 -11
  23. package/dist/types/excalidraw/actions/actionCanvas.d.ts +152 -275
  24. package/dist/types/excalidraw/actions/actionClipboard.d.ts +46 -773
  25. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -5
  26. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +42 -23
  27. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  28. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  29. package/dist/types/excalidraw/actions/actionElementLink.d.ts +11 -6
  30. package/dist/types/excalidraw/actions/actionElementLock.d.ts +23 -9
  31. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +12 -5
  32. package/dist/types/excalidraw/actions/actionExport.d.ts +68 -943
  33. package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -393
  34. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -2
  35. package/dist/types/excalidraw/actions/actionFrame.d.ts +50 -24
  36. package/dist/types/excalidraw/actions/actionGroup.d.ts +24 -10
  37. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +22 -19
  38. package/dist/types/excalidraw/actions/actionLink.d.ts +9 -2
  39. package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -371
  40. package/dist/types/excalidraw/actions/actionNavigate.d.ts +21 -359
  41. package/dist/types/excalidraw/actions/actionProperties.d.ts +87 -2403
  42. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +12 -5
  43. package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -6
  44. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  45. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +11 -4
  46. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +11 -4
  47. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -5
  48. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  49. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +11 -4
  50. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +11 -4
  51. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -5
  52. package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -2
  53. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  54. package/dist/types/excalidraw/actions/manager.d.ts +1 -1
  55. package/dist/types/excalidraw/actions/register.d.ts +1 -1
  56. package/dist/types/excalidraw/actions/types.d.ts +4 -4
  57. package/dist/types/excalidraw/appState.d.ts +9 -4
  58. package/dist/types/excalidraw/clipboard.d.ts +2 -0
  59. package/dist/types/excalidraw/components/Actions.d.ts +21 -4
  60. package/dist/types/excalidraw/components/App.d.ts +26 -19
  61. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  62. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
  63. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  64. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  65. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -2
  66. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  67. package/dist/types/excalidraw/components/FilledButton.d.ts +1 -1
  68. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  69. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  70. package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
  71. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  72. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  73. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  74. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  75. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  76. package/dist/types/excalidraw/components/Popover.d.ts +2 -1
  77. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  78. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  79. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  80. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  81. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  82. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +6 -3
  83. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  84. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  85. package/dist/types/excalidraw/components/icons.d.ts +10 -0
  86. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +13 -1
  87. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
  88. package/dist/types/excalidraw/data/blob.d.ts +2 -2
  89. package/dist/types/excalidraw/data/restore.d.ts +3 -3
  90. package/dist/types/excalidraw/data/types.d.ts +4 -1
  91. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  92. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
  93. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  94. package/dist/types/excalidraw/index.d.ts +2 -3
  95. package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
  96. package/dist/types/excalidraw/renderer/helpers.d.ts +2 -6
  97. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +5 -13
  98. package/dist/types/excalidraw/scene/types.d.ts +15 -3
  99. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  100. package/dist/types/excalidraw/types.d.ts +31 -21
  101. package/dist/types/math/src/segment.d.ts +1 -0
  102. package/package.json +2 -2
@@ -1,361 +1,23 @@
1
1
  /// <reference types="react" />
2
- import type { Collaborator } from "../types";
3
- export declare const actionGoToCollaborator: {
4
- name: "goToCollaborator";
5
- label: string;
6
- viewMode: true;
7
- trackEvent: {
8
- category: "collab";
9
- };
10
- perform: (_elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, collaborator: Collaborator) => {
11
- appState: {
12
- userToFollow: null;
13
- contextMenu: {
14
- items: import("../components/ContextMenu").ContextMenuItems;
15
- top: number;
16
- left: number;
17
- } | null;
18
- showWelcomeScreen: boolean;
19
- isLoading: boolean;
20
- errorMessage: import("react").ReactNode;
21
- activeEmbeddable: {
22
- element: import("../../element/src/types").NonDeletedExcalidrawElement;
23
- state: "active" | "hover";
24
- } | null;
25
- newElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawNonSelectionElement> | null;
26
- resizingElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
27
- multiElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawLinearElement> | null;
28
- selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
29
- isBindingEnabled: boolean;
30
- startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
31
- suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
32
- frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
33
- frameRendering: {
34
- enabled: boolean;
35
- name: boolean;
36
- outline: boolean;
37
- clip: boolean;
38
- };
39
- editingFrame: string | null;
40
- elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
41
- editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
42
- activeTool: {
43
- lastActiveTool: import("../types").ActiveTool | null;
44
- locked: boolean;
45
- fromSelection: boolean;
46
- } & import("../types").ActiveTool;
47
- penMode: boolean;
48
- penDetected: boolean;
49
- exportBackground: boolean;
50
- exportEmbedScene: boolean;
51
- exportWithDarkMode: boolean;
52
- exportScale: number;
53
- currentItemStrokeColor: string;
54
- currentItemBackgroundColor: string;
55
- currentItemFillStyle: import("../../element/src/types").FillStyle;
56
- currentItemStrokeWidth: number;
57
- currentItemStrokeStyle: import("../../element/src/types").StrokeStyle;
58
- currentItemRoughness: number;
59
- currentItemOpacity: number;
60
- currentItemFontFamily: number;
61
- currentItemFontSize: number;
62
- currentItemTextAlign: string;
63
- currentItemStartArrowhead: import("../../element/src/types").Arrowhead | null;
64
- currentItemEndArrowhead: import("../../element/src/types").Arrowhead | null;
65
- currentHoveredFontFamily: number | null;
66
- currentItemRoundness: import("../../element/src/types").StrokeRoundness;
67
- currentItemArrowType: "round" | "sharp" | "elbow";
68
- viewBackgroundColor: string;
69
- scrollX: number;
70
- scrollY: number;
71
- cursorButton: "up" | "down";
72
- scrolledOutside: boolean;
73
- name: string | null;
74
- isResizing: boolean;
75
- isRotating: boolean;
76
- zoom: Readonly<{
77
- value: import("../types").NormalizedZoomValue;
78
- }>;
79
- openMenu: "canvas" | "shape" | null;
80
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
81
- openSidebar: {
82
- name: string;
83
- tab?: string | undefined;
84
- } | null;
85
- openDialog: {
86
- name: "imageExport" | "help" | "jsonExport";
87
- } | {
88
- name: "ttd";
89
- tab: "mermaid" | "text-to-diagram";
90
- } | {
91
- name: "commandPalette";
92
- } | {
93
- name: "elementLinkSelector";
94
- sourceElementId: string;
95
- } | null;
96
- defaultSidebarDockedPreference: boolean;
97
- lastPointerDownWith: import("../../element/src/types").PointerType;
98
- selectedElementIds: Readonly<{
99
- [id: string]: true;
100
- }>;
101
- hoveredElementIds: Readonly<{
102
- [id: string]: true;
103
- }>;
104
- previousSelectedElementIds: {
105
- [id: string]: true;
106
- };
107
- selectedElementsAreBeingDragged: boolean;
108
- shouldCacheIgnoreZoom: boolean;
109
- toast: {
110
- message: string;
111
- closable?: boolean | undefined;
112
- duration?: number | undefined;
113
- } | null;
114
- zenModeEnabled: boolean;
115
- theme: import("../../element/src/types").Theme;
116
- gridSize: number;
117
- gridStep: number;
118
- gridModeEnabled: boolean;
119
- viewModeEnabled: boolean;
120
- selectedGroupIds: {
121
- [groupId: string]: boolean;
122
- };
123
- editingGroupId: string | null;
124
- width: number;
125
- height: number;
126
- offsetTop: number;
127
- offsetLeft: number;
128
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
129
- collaborators: Map<import("../types").SocketId, Readonly<{
130
- pointer?: import("../types").CollaboratorPointer | undefined;
131
- button?: "up" | "down" | undefined;
132
- selectedElementIds?: Readonly<{
133
- [id: string]: true;
134
- }> | undefined;
135
- username?: string | null | undefined;
136
- userState?: import("..").UserIdleState | undefined;
137
- color?: {
138
- background: string;
139
- stroke: string;
140
- } | undefined;
141
- avatarUrl?: string | undefined;
142
- id?: string | undefined;
143
- socketId?: import("../types").SocketId | undefined;
144
- isCurrentUser?: boolean | undefined;
145
- isInCall?: boolean | undefined;
146
- isSpeaking?: boolean | undefined;
147
- isMuted?: boolean | undefined;
148
- }>>;
149
- stats: {
150
- open: boolean;
151
- panels: number;
152
- };
153
- currentChartType: import("../../element/src/types").ChartType;
154
- pasteDialog: {
155
- shown: false;
156
- data: null;
157
- } | {
158
- shown: true;
159
- data: import("../charts").Spreadsheet;
160
- };
161
- showHyperlinkPopup: false | "editor" | "info";
162
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
163
- snapLines: readonly import("../snapping").SnapLine[];
164
- originSnapOffset: {
165
- x: number;
166
- y: number;
167
- } | null;
168
- objectsSnapModeEnabled: boolean;
169
- followedBy: Set<import("../types").SocketId>;
170
- isCropping: boolean;
171
- croppingElementId: string | null;
172
- searchMatches: Readonly<{
173
- focusedId: string | null;
174
- matches: readonly import("../types").SearchMatch[];
175
- }> | null;
176
- activeLockedId: string | null;
177
- lockedMultiSelections: {
178
- [groupId: string]: true;
179
- };
180
- };
181
- captureUpdate: "EVENTUALLY";
182
- } | {
183
- appState: {
184
- userToFollow: {
185
- socketId: import("../types").SocketId;
186
- username: string;
187
- };
188
- openMenu: "shape" | null;
189
- contextMenu: {
190
- items: import("../components/ContextMenu").ContextMenuItems;
191
- top: number;
192
- left: number;
193
- } | null;
194
- showWelcomeScreen: boolean;
195
- isLoading: boolean;
196
- errorMessage: import("react").ReactNode;
197
- activeEmbeddable: {
198
- element: import("../../element/src/types").NonDeletedExcalidrawElement;
199
- state: "active" | "hover";
200
- } | null;
201
- newElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawNonSelectionElement> | null;
202
- resizingElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
203
- multiElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawLinearElement> | null;
204
- selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
205
- isBindingEnabled: boolean;
206
- startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
207
- suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
208
- frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
209
- frameRendering: {
210
- enabled: boolean;
211
- name: boolean;
212
- outline: boolean;
213
- clip: boolean;
214
- };
215
- editingFrame: string | null;
216
- elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
217
- editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
218
- activeTool: {
219
- lastActiveTool: import("../types").ActiveTool | null;
220
- locked: boolean;
221
- fromSelection: boolean;
222
- } & import("../types").ActiveTool;
223
- penMode: boolean;
224
- penDetected: boolean;
225
- exportBackground: boolean;
226
- exportEmbedScene: boolean;
227
- exportWithDarkMode: boolean;
228
- exportScale: number;
229
- currentItemStrokeColor: string;
230
- currentItemBackgroundColor: string;
231
- currentItemFillStyle: import("../../element/src/types").FillStyle;
232
- currentItemStrokeWidth: number;
233
- currentItemStrokeStyle: import("../../element/src/types").StrokeStyle;
234
- currentItemRoughness: number;
235
- currentItemOpacity: number;
236
- currentItemFontFamily: number;
237
- currentItemFontSize: number;
238
- currentItemTextAlign: string;
239
- currentItemStartArrowhead: import("../../element/src/types").Arrowhead | null;
240
- currentItemEndArrowhead: import("../../element/src/types").Arrowhead | null;
241
- currentHoveredFontFamily: number | null;
242
- currentItemRoundness: import("../../element/src/types").StrokeRoundness;
243
- currentItemArrowType: "round" | "sharp" | "elbow";
244
- viewBackgroundColor: string;
245
- scrollX: number;
246
- scrollY: number;
247
- cursorButton: "up" | "down";
248
- scrolledOutside: boolean;
249
- name: string | null;
250
- isResizing: boolean;
251
- isRotating: boolean;
252
- zoom: Readonly<{
253
- value: import("../types").NormalizedZoomValue;
254
- }>;
255
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
256
- openSidebar: {
257
- name: string;
258
- tab?: string | undefined;
259
- } | null;
260
- openDialog: {
261
- name: "imageExport" | "help" | "jsonExport";
262
- } | {
263
- name: "ttd";
264
- tab: "mermaid" | "text-to-diagram";
265
- } | {
266
- name: "commandPalette";
267
- } | {
268
- name: "elementLinkSelector";
269
- sourceElementId: string;
270
- } | null;
271
- defaultSidebarDockedPreference: boolean;
272
- lastPointerDownWith: import("../../element/src/types").PointerType;
273
- selectedElementIds: Readonly<{
274
- [id: string]: true;
275
- }>;
276
- hoveredElementIds: Readonly<{
277
- [id: string]: true;
278
- }>;
279
- previousSelectedElementIds: {
280
- [id: string]: true;
281
- };
282
- selectedElementsAreBeingDragged: boolean;
283
- shouldCacheIgnoreZoom: boolean;
284
- toast: {
285
- message: string;
286
- closable?: boolean | undefined;
287
- duration?: number | undefined;
288
- } | null;
289
- zenModeEnabled: boolean;
290
- theme: import("../../element/src/types").Theme;
291
- gridSize: number;
292
- gridStep: number;
293
- gridModeEnabled: boolean;
294
- viewModeEnabled: boolean;
295
- selectedGroupIds: {
296
- [groupId: string]: boolean;
297
- };
298
- editingGroupId: string | null;
299
- width: number;
300
- height: number;
301
- offsetTop: number;
302
- offsetLeft: number;
303
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
304
- collaborators: Map<import("../types").SocketId, Readonly<{
305
- pointer?: import("../types").CollaboratorPointer | undefined;
306
- button?: "up" | "down" | undefined;
307
- selectedElementIds?: Readonly<{
308
- [id: string]: true;
309
- }> | undefined;
310
- username?: string | null | undefined;
311
- userState?: import("..").UserIdleState | undefined;
312
- color?: {
313
- background: string;
314
- stroke: string;
315
- } | undefined;
316
- avatarUrl?: string | undefined;
317
- id?: string | undefined;
318
- socketId?: import("../types").SocketId | undefined;
319
- isCurrentUser?: boolean | undefined;
320
- isInCall?: boolean | undefined;
321
- isSpeaking?: boolean | undefined;
322
- isMuted?: boolean | undefined;
323
- }>>;
324
- stats: {
325
- open: boolean;
326
- panels: number;
327
- };
328
- currentChartType: import("../../element/src/types").ChartType;
329
- pasteDialog: {
330
- shown: false;
331
- data: null;
332
- } | {
333
- shown: true;
334
- data: import("../charts").Spreadsheet;
335
- };
336
- showHyperlinkPopup: false | "editor" | "info";
337
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
338
- snapLines: readonly import("../snapping").SnapLine[];
339
- originSnapOffset: {
340
- x: number;
341
- y: number;
342
- } | null;
343
- objectsSnapModeEnabled: boolean;
344
- followedBy: Set<import("../types").SocketId>;
345
- isCropping: boolean;
346
- croppingElementId: string | null;
347
- searchMatches: Readonly<{
348
- focusedId: string | null;
349
- matches: readonly import("../types").SearchMatch[];
350
- }> | null;
351
- activeLockedId: string | null;
352
- lockedMultiSelections: {
353
- [groupId: string]: true;
354
- };
355
- };
356
- captureUpdate: "EVENTUALLY";
357
- };
358
- PanelComponent: ({ updateData, data, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
359
- } & {
360
- keyTest?: undefined;
2
+ export declare const actionGoToCollaborator: import("./types").Action<Readonly<{
3
+ pointer?: import("../types").CollaboratorPointer | undefined;
4
+ button?: "up" | "down" | undefined;
5
+ selectedElementIds?: Readonly<{
6
+ [id: string]: true;
7
+ }> | undefined;
8
+ username?: string | null | undefined;
9
+ userState?: import("@excalidraw/common").UserIdleState | undefined;
10
+ color?: {
11
+ background: string;
12
+ stroke: string;
13
+ } | undefined;
14
+ avatarUrl?: string | undefined;
15
+ id?: string | undefined;
16
+ socketId?: import("../types").SocketId | undefined;
17
+ isCurrentUser?: boolean | undefined;
18
+ isInCall?: boolean | undefined;
19
+ isSpeaking?: boolean | undefined;
20
+ isMuted?: boolean | undefined;
21
+ }>> & {
22
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: import("../types").AppState, elements: readonly import("../../element/src/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
361
23
  };