@excalidraw/common 0.18.0-f0063e113 → 0.18.0-f2600fe

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 (96) hide show
  1. package/dist/dev/index.js +180 -44
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/constants.d.ts +19 -15
  5. package/dist/types/common/src/editorInterface.d.ts +34 -0
  6. package/dist/types/common/src/index.d.ts +1 -0
  7. package/dist/types/common/src/utils.d.ts +2 -1
  8. package/dist/types/element/src/Scene.d.ts +6 -2
  9. package/dist/types/element/src/align.d.ts +2 -1
  10. package/dist/types/element/src/bounds.d.ts +1 -1
  11. package/dist/types/element/src/delta.d.ts +16 -4
  12. package/dist/types/element/src/distribute.d.ts +2 -1
  13. package/dist/types/element/src/groups.d.ts +1 -0
  14. package/dist/types/element/src/index.d.ts +1 -0
  15. package/dist/types/element/src/linearElementEditor.d.ts +2 -1
  16. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  17. package/dist/types/element/src/renderElement.d.ts +4 -1
  18. package/dist/types/element/src/resizeTest.d.ts +5 -4
  19. package/dist/types/element/src/store.d.ts +8 -2
  20. package/dist/types/element/src/textElement.d.ts +1 -1
  21. package/dist/types/element/src/transformHandles.d.ts +5 -4
  22. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -12
  23. package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -8
  24. package/dist/types/excalidraw/actions/actionCanvas.d.ts +94 -54
  25. package/dist/types/excalidraw/actions/actionClipboard.d.ts +45 -26
  26. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -4
  27. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +25 -16
  28. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
  29. package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -4
  30. package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -8
  31. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -4
  32. package/dist/types/excalidraw/actions/actionExport.d.ts +63 -36
  33. package/dist/types/excalidraw/actions/actionFinalize.d.ts +16 -9
  34. package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -16
  35. package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -8
  36. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +41 -7
  37. package/dist/types/excalidraw/actions/actionLink.d.ts +5 -2
  38. package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -372
  39. package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -8
  40. package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -68
  41. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -4
  42. package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -4
  43. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -4
  44. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -4
  45. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -4
  46. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -4
  47. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -4
  48. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +8 -5
  49. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  50. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  51. package/dist/types/excalidraw/appState.d.ts +5 -1
  52. package/dist/types/excalidraw/clipboard.d.ts +64 -1
  53. package/dist/types/excalidraw/components/Actions.d.ts +20 -7
  54. package/dist/types/excalidraw/components/App.d.ts +29 -23
  55. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  56. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
  57. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  58. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  59. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  60. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  61. package/dist/types/excalidraw/components/FilledButton.d.ts +1 -1
  62. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  63. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  64. package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
  65. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  66. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  67. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  68. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  69. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  70. package/dist/types/excalidraw/components/Popover.d.ts +2 -1
  71. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  72. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  73. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  74. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  75. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -2
  76. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  77. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  78. package/dist/types/excalidraw/components/icons.d.ts +10 -0
  79. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +13 -1
  80. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
  81. package/dist/types/excalidraw/components/shapes.d.ts +129 -1
  82. package/dist/types/excalidraw/data/blob.d.ts +3 -7
  83. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  84. package/dist/types/excalidraw/data/restore.d.ts +6 -1
  85. package/dist/types/excalidraw/data/types.d.ts +4 -1
  86. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  87. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
  88. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  89. package/dist/types/excalidraw/index.d.ts +4 -4
  90. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  91. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  92. package/dist/types/excalidraw/scene/types.d.ts +3 -3
  93. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  94. package/dist/types/excalidraw/types.d.ts +23 -19
  95. package/dist/types/math/src/segment.d.ts +1 -0
  96. package/package.json +5 -2
@@ -1,5 +1,6 @@
1
+ import { type EditorInterface } from "@excalidraw/common";
1
2
  import type { Radians } from "@excalidraw/math";
2
- import type { Device, InteractiveCanvasAppState, Zoom } from "@excalidraw/excalidraw/types";
3
+ import type { InteractiveCanvasAppState, Zoom } from "@excalidraw/excalidraw/types";
3
4
  import type { Bounds } from "./bounds";
4
5
  import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
5
6
  export type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
@@ -28,8 +29,8 @@ export declare const OMIT_SIDES_FOR_FRAME: {
28
29
  w: boolean;
29
30
  rotation: boolean;
30
31
  };
31
- export declare const canResizeFromSides: (device: Device) => boolean;
32
- export declare const getOmitSidesForDevice: (device: Device) => {};
32
+ export declare const canResizeFromSides: (editorInterface: EditorInterface) => boolean;
33
+ export declare const getOmitSidesForEditorInterface: (editorInterface: EditorInterface) => {};
33
34
  export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: Radians, zoom: Zoom, pointerType: PointerType, omitSides?: {
34
35
  s?: boolean | undefined;
35
36
  e?: boolean | undefined;
@@ -52,4 +53,4 @@ export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoo
52
53
  se?: boolean | undefined;
53
54
  rotation?: boolean | undefined;
54
55
  }) => TransformHandles;
55
- export declare const shouldShowBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
56
+ export declare const hasBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState, editorInterface: EditorInterface) => boolean;
@@ -39,12 +39,15 @@ export declare const actionAddToLibrary: {
39
39
  editingFrame: string | null;
40
40
  elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
41
41
  editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
42
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
43
42
  activeTool: {
44
43
  lastActiveTool: import("../types").ActiveTool | null;
45
44
  locked: boolean;
46
45
  fromSelection: boolean;
47
46
  } & import("../types").ActiveTool;
47
+ preferredSelectionTool: {
48
+ type: "selection" | "lasso";
49
+ initialized: boolean;
50
+ };
48
51
  penMode: boolean;
49
52
  penDetected: boolean;
50
53
  exportBackground: boolean;
@@ -77,8 +80,8 @@ export declare const actionAddToLibrary: {
77
80
  zoom: Readonly<{
78
81
  value: import("../types").NormalizedZoomValue;
79
82
  }>;
80
- openMenu: "canvas" | "shape" | null;
81
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
83
+ openMenu: "canvas" | null;
84
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
82
85
  openSidebar: {
83
86
  name: string;
84
87
  tab?: string | undefined;
@@ -154,7 +157,7 @@ export declare const actionAddToLibrary: {
154
157
  shown: true;
155
158
  data: import("../charts").Spreadsheet;
156
159
  };
157
- showHyperlinkPopup: false | "editor" | "info";
160
+ showHyperlinkPopup: false | "info" | "editor";
158
161
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
159
162
  snapLines: readonly import("../snapping").SnapLine[];
160
163
  originSnapOffset: {
@@ -207,12 +210,15 @@ export declare const actionAddToLibrary: {
207
210
  editingFrame: string | null;
208
211
  elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
209
212
  editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
210
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
211
213
  activeTool: {
212
214
  lastActiveTool: import("../types").ActiveTool | null;
213
215
  locked: boolean;
214
216
  fromSelection: boolean;
215
217
  } & import("../types").ActiveTool;
218
+ preferredSelectionTool: {
219
+ type: "selection" | "lasso";
220
+ initialized: boolean;
221
+ };
216
222
  penMode: boolean;
217
223
  penDetected: boolean;
218
224
  exportBackground: boolean;
@@ -245,8 +251,8 @@ export declare const actionAddToLibrary: {
245
251
  zoom: Readonly<{
246
252
  value: import("../types").NormalizedZoomValue;
247
253
  }>;
248
- openMenu: "canvas" | "shape" | null;
249
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
254
+ openMenu: "canvas" | null;
255
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
250
256
  openSidebar: {
251
257
  name: string;
252
258
  tab?: string | undefined;
@@ -327,7 +333,7 @@ export declare const actionAddToLibrary: {
327
333
  shown: true;
328
334
  data: import("../charts").Spreadsheet;
329
335
  };
330
- showHyperlinkPopup: false | "editor" | "info";
336
+ showHyperlinkPopup: false | "info" | "editor";
331
337
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
332
338
  snapLines: readonly import("../snapping").SnapLine[];
333
339
  originSnapOffset: {
@@ -380,12 +386,15 @@ export declare const actionAddToLibrary: {
380
386
  editingFrame: string | null;
381
387
  elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
382
388
  editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
383
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
384
389
  activeTool: {
385
390
  lastActiveTool: import("../types").ActiveTool | null;
386
391
  locked: boolean;
387
392
  fromSelection: boolean;
388
393
  } & import("../types").ActiveTool;
394
+ preferredSelectionTool: {
395
+ type: "selection" | "lasso";
396
+ initialized: boolean;
397
+ };
389
398
  penMode: boolean;
390
399
  penDetected: boolean;
391
400
  exportBackground: boolean;
@@ -418,8 +427,8 @@ export declare const actionAddToLibrary: {
418
427
  zoom: Readonly<{
419
428
  value: import("../types").NormalizedZoomValue;
420
429
  }>;
421
- openMenu: "canvas" | "shape" | null;
422
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
430
+ openMenu: "canvas" | null;
431
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
423
432
  openSidebar: {
424
433
  name: string;
425
434
  tab?: string | undefined;
@@ -500,7 +509,7 @@ export declare const actionAddToLibrary: {
500
509
  shown: true;
501
510
  data: import("../charts").Spreadsheet;
502
511
  };
503
- showHyperlinkPopup: false | "editor" | "info";
512
+ showHyperlinkPopup: false | "info" | "editor";
504
513
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
505
514
  snapLines: readonly import("../snapping").SnapLine[];
506
515
  originSnapOffset: {
@@ -59,12 +59,15 @@ export declare const actionBindText: {
59
59
  editingFrame: string | null;
60
60
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
61
61
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
62
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
63
62
  activeTool: {
64
63
  lastActiveTool: import("../types").ActiveTool | null;
65
64
  locked: boolean;
66
65
  fromSelection: boolean;
67
66
  } & import("../types").ActiveTool;
67
+ preferredSelectionTool: {
68
+ type: "selection" | "lasso";
69
+ initialized: boolean;
70
+ };
68
71
  penMode: boolean;
69
72
  penDetected: boolean;
70
73
  exportBackground: boolean;
@@ -97,8 +100,8 @@ export declare const actionBindText: {
97
100
  zoom: Readonly<{
98
101
  value: import("../types").NormalizedZoomValue;
99
102
  }>;
100
- openMenu: "canvas" | "shape" | null;
101
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
103
+ openMenu: "canvas" | null;
104
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
102
105
  openSidebar: {
103
106
  name: string;
104
107
  tab?: string | undefined;
@@ -176,7 +179,7 @@ export declare const actionBindText: {
176
179
  shown: true;
177
180
  data: import("../charts").Spreadsheet;
178
181
  };
179
- showHyperlinkPopup: false | "editor" | "info";
182
+ showHyperlinkPopup: false | "info" | "editor";
180
183
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
181
184
  snapLines: readonly import("../snapping").SnapLine[];
182
185
  originSnapOffset: {
@@ -244,12 +247,15 @@ export declare const actionWrapTextInContainer: {
244
247
  editingFrame: string | null;
245
248
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
246
249
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
247
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
248
250
  activeTool: {
249
251
  lastActiveTool: import("../types").ActiveTool | null;
250
252
  locked: boolean;
251
253
  fromSelection: boolean;
252
254
  } & import("../types").ActiveTool;
255
+ preferredSelectionTool: {
256
+ type: "selection" | "lasso";
257
+ initialized: boolean;
258
+ };
253
259
  penMode: boolean;
254
260
  penDetected: boolean;
255
261
  exportBackground: boolean;
@@ -282,8 +288,8 @@ export declare const actionWrapTextInContainer: {
282
288
  zoom: Readonly<{
283
289
  value: import("../types").NormalizedZoomValue;
284
290
  }>;
285
- openMenu: "canvas" | "shape" | null;
286
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
291
+ openMenu: "canvas" | null;
292
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
287
293
  openSidebar: {
288
294
  name: string;
289
295
  tab?: string | undefined;
@@ -361,7 +367,7 @@ export declare const actionWrapTextInContainer: {
361
367
  shown: true;
362
368
  data: import("../charts").Spreadsheet;
363
369
  };
364
- showHyperlinkPopup: false | "editor" | "info";
370
+ showHyperlinkPopup: false | "info" | "editor";
365
371
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
366
372
  snapLines: readonly import("../snapping").SnapLine[];
367
373
  originSnapOffset: {