@excalidraw/common 0.18.0-2b1c2a9 → 0.18.0-2c3dcc0

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 (164) hide show
  1. package/dist/dev/index.js +108 -20
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/colors.d.ts +3 -0
  5. package/dist/types/common/src/constants.d.ts +56 -0
  6. package/dist/types/common/src/keys.d.ts +4 -0
  7. package/dist/types/common/src/random.d.ts +7 -0
  8. package/dist/types/common/src/utils.d.ts +12 -1
  9. package/dist/types/element/src/Scene.d.ts +1 -1
  10. package/dist/types/element/src/align.d.ts +4 -1
  11. package/dist/types/element/src/binding.d.ts +75 -7
  12. package/dist/types/element/src/bounds.d.ts +10 -2
  13. package/dist/types/element/src/collision.d.ts +21 -5
  14. package/dist/types/element/src/comparisons.d.ts +5 -3
  15. package/dist/types/element/src/cropElement.d.ts +36 -4
  16. package/dist/types/element/src/delta.d.ts +30 -2
  17. package/dist/types/element/src/distribute.d.ts +4 -1
  18. package/dist/types/element/src/dragElements.d.ts +8 -3
  19. package/dist/types/element/src/duplicate.d.ts +60 -0
  20. package/dist/types/element/src/elbowArrow.d.ts +5 -0
  21. package/dist/types/element/src/embeddable.d.ts +2 -1
  22. package/dist/types/element/src/flowchart.d.ts +6 -8
  23. package/dist/types/element/src/frame.d.ts +21 -3
  24. package/dist/types/element/src/groups.d.ts +1 -6
  25. package/dist/types/element/src/image.d.ts +5 -2
  26. package/dist/types/element/src/index.d.ts +3 -0
  27. package/dist/types/element/src/linearElementEditor.d.ts +4 -1
  28. package/dist/types/element/src/listMarker.d.ts +39 -0
  29. package/dist/types/element/src/mutateElement.d.ts +1 -1
  30. package/dist/types/element/src/newElement.d.ts +40 -3
  31. package/dist/types/element/src/renderElement.d.ts +31 -4
  32. package/dist/types/element/src/renderEnvironment.d.ts +66 -0
  33. package/dist/types/element/src/resizeElements.d.ts +15 -5
  34. package/dist/types/element/src/selection.d.ts +4 -10
  35. package/dist/types/element/src/shape.d.ts +17 -1
  36. package/dist/types/element/src/sizeHelpers.d.ts +6 -0
  37. package/dist/types/element/src/stickyNote.d.ts +191 -0
  38. package/dist/types/element/src/textElement.d.ts +10 -2
  39. package/dist/types/element/src/textMeasurements.d.ts +15 -11
  40. package/dist/types/element/src/textWrapping.d.ts +3 -2
  41. package/dist/types/element/src/transform.d.ts +30 -7
  42. package/dist/types/element/src/typeChecks.d.ts +3 -2
  43. package/dist/types/element/src/types.d.ts +28 -6
  44. package/dist/types/element/src/utils.d.ts +8 -1
  45. package/dist/types/element/src/zindex.d.ts +1 -1
  46. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +48 -3
  47. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  48. package/dist/types/excalidraw/actions/actionBoundText.d.ts +62 -208
  49. package/dist/types/excalidraw/actions/actionCanvas.d.ts +124 -19
  50. package/dist/types/excalidraw/actions/actionClipboard.d.ts +32 -2
  51. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +16 -1
  52. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -546
  53. package/dist/types/excalidraw/actions/actionDeselect.d.ts +19 -1
  54. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  55. package/dist/types/excalidraw/actions/actionElementLink.d.ts +16 -1
  56. package/dist/types/excalidraw/actions/actionElementLock.d.ts +32 -2
  57. package/dist/types/excalidraw/actions/actionExport.d.ts +35 -5
  58. package/dist/types/excalidraw/actions/actionFrame.d.ts +92 -479
  59. package/dist/types/excalidraw/actions/actionGroup.d.ts +32 -2
  60. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +66 -2
  61. package/dist/types/excalidraw/actions/actionLink.d.ts +16 -1
  62. package/dist/types/excalidraw/actions/actionMenu.d.ts +16 -1
  63. package/dist/types/excalidraw/actions/actionProperties.d.ts +42 -8
  64. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +16 -1
  65. package/dist/types/excalidraw/actions/actionStyles.d.ts +17 -2
  66. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +452 -6
  67. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +16 -1
  68. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -1
  69. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +16 -1
  70. package/dist/types/excalidraw/actions/actionToggleMinimap.d.ts +201 -0
  71. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +16 -1
  72. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -1
  73. package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +198 -0
  74. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +16 -1
  75. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +16 -1
  76. package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
  77. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +16 -1
  78. package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
  79. package/dist/types/excalidraw/actions/index.d.ts +3 -0
  80. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  81. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  82. package/dist/types/excalidraw/appState.d.ts +24 -6
  83. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -1
  84. package/dist/types/excalidraw/charts/charts.helpers.d.ts +6 -5
  85. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -1
  86. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -1
  87. package/dist/types/excalidraw/charts/index.d.ts +2 -1
  88. package/dist/types/excalidraw/components/Actions.d.ts +10 -2
  89. package/dist/types/excalidraw/components/App.arrowText.d.ts +5 -39
  90. package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
  91. package/dist/types/excalidraw/components/App.d.ts +129 -218
  92. package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
  93. package/dist/types/excalidraw/components/App.host.d.ts +102 -0
  94. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  95. package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
  96. package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
  97. package/dist/types/excalidraw/components/App.selectionTool.d.ts +94 -0
  98. package/dist/types/excalidraw/components/App.text.d.ts +194 -0
  99. package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
  100. package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
  101. package/dist/types/excalidraw/components/App.viewport.d.ts +64 -4
  102. package/dist/types/excalidraw/components/App.wheel.d.ts +30 -0
  103. package/dist/types/excalidraw/components/App.wrap.d.ts +39 -0
  104. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  105. package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
  106. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -1
  107. package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
  108. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +4 -1
  109. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
  110. package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
  111. package/dist/types/excalidraw/components/IconButton.d.ts +2 -0
  112. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
  113. package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
  114. package/dist/types/excalidraw/components/Minimap/Minimap.d.ts +15 -0
  115. package/dist/types/excalidraw/components/Minimap/MinimapAnnouncementDot.d.ts +10 -0
  116. package/dist/types/excalidraw/components/Minimap/minimap-controller.chunk.d.ts +90 -0
  117. package/dist/types/excalidraw/components/Minimap/minimap-shared.chunk.d.ts +122 -0
  118. package/dist/types/excalidraw/components/Minimap/minimap-worker.chunk.d.ts +12 -0
  119. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -2
  120. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +2 -1
  121. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  122. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +5 -2
  123. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
  124. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +4 -1
  125. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +3 -2
  126. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +14 -1
  127. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +16 -0
  128. package/dist/types/excalidraw/components/Tools.d.ts +7 -2
  129. package/dist/types/excalidraw/components/Tooltip.d.ts +26 -2
  130. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
  131. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
  132. package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
  133. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -1
  134. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +2 -0
  135. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  136. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  137. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +13 -2
  138. package/dist/types/excalidraw/components/icons.d.ts +2 -0
  139. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +3 -0
  140. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +2 -2
  141. package/dist/types/excalidraw/data/blob.d.ts +38 -8
  142. package/dist/types/excalidraw/data/index.d.ts +3 -3
  143. package/dist/types/excalidraw/data/json.d.ts +19 -4
  144. package/dist/types/excalidraw/fonts/Fonts.d.ts +9 -6
  145. package/dist/types/excalidraw/history.d.ts +10 -4
  146. package/dist/types/excalidraw/mermaid.d.ts +7 -0
  147. package/dist/types/excalidraw/reactUtils.d.ts +1 -1
  148. package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
  149. package/dist/types/excalidraw/renderer/animation.d.ts +11 -4
  150. package/dist/types/excalidraw/renderer/helpers.d.ts +18 -0
  151. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  152. package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
  153. package/dist/types/excalidraw/scene/Renderer.d.ts +64 -3
  154. package/dist/types/excalidraw/scene/export.d.ts +343 -20
  155. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  156. package/dist/types/excalidraw/scene/types.d.ts +26 -2
  157. package/dist/types/excalidraw/types.d.ts +191 -22
  158. package/dist/types/excalidraw/viewport.d.ts +29 -1
  159. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -1
  160. package/dist/types/utils/src/index.d.ts +3 -1
  161. package/dist/types/utils/src/shape.d.ts +2 -2
  162. package/package.json +1 -1
  163. package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +0 -31
  164. package/dist/types/utils/src/export.d.ts +0 -35
@@ -1,34 +1,25 @@
1
- import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement } from "@excalidraw/element/types";
2
- import type { Mutable } from "@excalidraw/common/utility-types";
3
- import type { AppState } from "../types";
1
+ import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { ActionResult } from "./types";
3
+ import type { AppClassProperties, AppState } from "../types";
4
+ /**
5
+ * Frees the container's text as it rendered (wrapped the same, at a fixed
6
+ * width), the container going back to the height it had without it.
7
+ */
8
+ export declare const unbindTextFromContainer: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, app: AppClassProperties) => void;
4
9
  export declare const actionUnbindText: {
5
10
  name: "unbindText";
6
11
  label: string;
7
12
  trackEvent: {
8
13
  category: "element";
9
14
  };
10
- predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
11
- perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties) => {
15
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
16
+ perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
12
17
  elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
13
- appState: Readonly<AppState>;
14
- captureUpdate: "IMMEDIATELY";
15
- };
16
- } & {
17
- keyTest?: undefined;
18
- };
19
- export declare const actionBindText: {
20
- name: "bindText";
21
- label: string;
22
- trackEvent: {
23
- category: "element";
24
- };
25
- predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
26
- perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties) => {
27
- elements: ExcalidrawElement[];
28
18
  appState: {
29
- selectedElementIds: {
30
- [x: string]: true;
31
- };
19
+ selectedElementIds: AppState["selectedElementIds"];
20
+ selectedGroupIds: AppState["selectedGroupIds"];
21
+ editingGroupId: AppState["editingGroupId"];
22
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
32
23
  contextMenu: {
33
24
  items: import("../components/ContextMenu").ContextMenuItems;
34
25
  top: number;
@@ -38,26 +29,35 @@ export declare const actionBindText: {
38
29
  isLoading: boolean;
39
30
  errorMessage: React.ReactNode;
40
31
  activeEmbeddable: {
41
- element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
32
+ element: NonDeletedExcalidrawElement;
42
33
  state: "hover" | "active";
43
34
  } | null;
44
- newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
45
- resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
46
- multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
47
- selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
35
+ newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
36
+ resizingElement: NonDeletedExcalidrawElement | null;
37
+ multiElement: NonDeleted<ExcalidrawLinearElement> | null;
38
+ selectionElement: NonDeletedExcalidrawElement | null;
48
39
  isBindingEnabled: boolean;
49
40
  boxSelectionMode: import("../types").BoxSelectionMode;
50
41
  bindingPreference: "enabled" | "disabled";
51
42
  isMidpointSnappingEnabled: boolean;
43
+ showHints: boolean;
44
+ inputDevice: import("../types").InputDevice;
52
45
  suggestedBinding: {
53
- element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
46
+ element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
54
47
  midPoint?: import("@excalidraw/math").GlobalPoint;
55
48
  } | null;
56
- hoveredArrowTextAnchor: {
49
+ textToolHover: {
50
+ type: "text";
51
+ elementId: ExcalidrawElement["id"];
52
+ } | {
53
+ type: "container";
54
+ elementId: ExcalidrawElement["id"];
55
+ } | {
56
+ type: "arrow";
57
57
  elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
58
58
  anchor: "start" | "end" | "label";
59
59
  } | null;
60
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
60
+ frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
61
61
  frameRendering: {
62
62
  enabled: boolean;
63
63
  name: boolean;
@@ -65,7 +65,7 @@ export declare const actionBindText: {
65
65
  clip: boolean;
66
66
  };
67
67
  editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
68
- elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
68
+ elementsToHighlight: readonly NonDeletedExcalidrawElement[] | null;
69
69
  editingTextElement: ExcalidrawTextElement | null;
70
70
  activeTool: {
71
71
  lastActiveTool: import("../types").ActiveTool | null;
@@ -83,6 +83,8 @@ export declare const actionBindText: {
83
83
  exportWithDarkMode: boolean;
84
84
  exportScale: number;
85
85
  currentItemStrokeColor: string;
86
+ currentItemStickynoteStrokeColor: string;
87
+ currentItemStickynoteBackgroundColor: string;
86
88
  currentItemBackgroundColor: string;
87
89
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
88
90
  currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
@@ -147,15 +149,12 @@ export declare const actionBindText: {
147
149
  duration?: number;
148
150
  } | null;
149
151
  zenModeEnabled: boolean;
152
+ minimapEnabled: boolean;
150
153
  theme: import("@excalidraw/element/types").Theme;
151
154
  gridSize: number;
152
155
  gridStep: number;
153
156
  gridModeEnabled: boolean;
154
157
  viewModeEnabled: boolean;
155
- selectedGroupIds: {
156
- [groupId: string]: boolean;
157
- };
158
- editingGroupId: import("@excalidraw/element/types").GroupId | null;
159
158
  width: number;
160
159
  height: number;
161
160
  offsetTop: number;
@@ -167,7 +166,6 @@ export declare const actionBindText: {
167
166
  panels: number;
168
167
  };
169
168
  showHyperlinkPopup: false | "info" | "editor";
170
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
171
169
  snapLines: readonly import("../snapping").SnapLine[];
172
170
  originSnapOffset: {
173
171
  x: number;
@@ -189,190 +187,46 @@ export declare const actionBindText: {
189
187
  elementStroke: readonly string[] | null;
190
188
  elementBackground: readonly string[] | null;
191
189
  bucketFill: readonly string[] | null;
190
+ stickyNoteStroke: readonly string[] | null;
191
+ stickyNoteBackground: readonly string[] | null;
192
192
  };
193
+ fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
193
194
  };
194
195
  captureUpdate: "IMMEDIATELY";
195
196
  };
196
197
  } & {
197
198
  keyTest?: undefined;
198
199
  };
200
+ export declare const actionBindText: {
201
+ name: "bindText";
202
+ label: string;
203
+ trackEvent: {
204
+ category: "element";
205
+ };
206
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
207
+ perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => ActionResult;
208
+ } & {
209
+ keyTest?: undefined;
210
+ };
211
+ /**
212
+ * A note and its label share one ink: the text the user styled wins, unless it
213
+ * is transparent (a note's label never is).
214
+ */
215
+ export declare const getStickyNoteInk: (textElement: ExcalidrawTextElement, container: ExcalidrawElement) => string | null;
216
+ /** binds the text to the (label-less) container, selecting the container */
217
+ export declare const bindTextToContainer: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, textElement: ExcalidrawTextElement, container: NonDeleted<ExcalidrawTextContainer>, app: AppClassProperties) => ActionResult;
218
+ export declare const pushTextAboveContainer: (elements: readonly ExcalidrawElement[], container: ExcalidrawElement, textElement: ExcalidrawTextElement) => ExcalidrawElement[];
219
+ export declare const pushContainerBelowText: (elements: readonly ExcalidrawElement[], container: ExcalidrawElement, textElement: ExcalidrawTextElement) => ExcalidrawElement[];
199
220
  export declare const actionWrapTextInContainer: {
200
221
  name: "wrapTextInContainer";
201
222
  label: string;
202
223
  trackEvent: {
203
224
  category: "element";
204
225
  };
205
- predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
206
- perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties) => {
207
- elements: readonly ExcalidrawElement[];
208
- appState: {
209
- selectedElementIds: Mutable<Readonly<{
210
- [id: string]: true;
211
- }>>;
212
- contextMenu: {
213
- items: import("../components/ContextMenu").ContextMenuItems;
214
- top: number;
215
- left: number;
216
- } | null;
217
- showWelcomeScreen: boolean;
218
- isLoading: boolean;
219
- errorMessage: React.ReactNode;
220
- activeEmbeddable: {
221
- element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
222
- state: "hover" | "active";
223
- } | null;
224
- newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
225
- resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
226
- multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
227
- selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
228
- isBindingEnabled: boolean;
229
- boxSelectionMode: import("../types").BoxSelectionMode;
230
- bindingPreference: "enabled" | "disabled";
231
- isMidpointSnappingEnabled: boolean;
232
- suggestedBinding: {
233
- element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
234
- midPoint?: import("@excalidraw/math").GlobalPoint;
235
- } | null;
236
- hoveredArrowTextAnchor: {
237
- elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
238
- anchor: "start" | "end" | "label";
239
- } | null;
240
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
241
- frameRendering: {
242
- enabled: boolean;
243
- name: boolean;
244
- outline: boolean;
245
- clip: boolean;
246
- };
247
- editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
248
- elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
249
- editingTextElement: ExcalidrawTextElement | null;
250
- activeTool: {
251
- lastActiveTool: import("../types").ActiveTool | null;
252
- locked: boolean;
253
- fromSelection: boolean;
254
- } & import("../types").ActiveTool;
255
- preferredSelectionTool: {
256
- type: "selection" | "lasso";
257
- initialized: boolean;
258
- };
259
- penMode: boolean;
260
- penDetected: boolean;
261
- exportBackground: boolean;
262
- exportEmbedScene: boolean;
263
- exportWithDarkMode: boolean;
264
- exportScale: number;
265
- currentItemStrokeColor: string;
266
- currentItemBackgroundColor: string;
267
- currentItemFillStyle: ExcalidrawElement["fillStyle"];
268
- currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
269
- currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
270
- currentItemRoughness: number;
271
- currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
272
- currentItemOpacity: number;
273
- currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
274
- currentItemFontSize: number;
275
- currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
276
- currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
277
- currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
278
- currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
279
- currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
280
- currentItemArrowType: "sharp" | "round" | "elbow";
281
- viewBackgroundColor: string;
282
- scrollX: number;
283
- scrollY: number;
284
- scrollConstraints: import("../types").ScrollConstraints | null;
285
- cursorButton: "up" | "down";
286
- scrolledOutside: boolean;
287
- name: string | null;
288
- isResizing: boolean;
289
- isRotating: boolean;
290
- zoom: import("../types").Zoom;
291
- openMenu: "canvas" | null;
292
- openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
293
- openSidebar: {
294
- name: import("../types").SidebarName;
295
- tab?: import("../types").SidebarTabName;
296
- } | null;
297
- openDialog: null | {
298
- name: "imageExport" | "help" | "jsonExport";
299
- } | {
300
- name: "ttd";
301
- tab: "text-to-diagram" | "mermaid";
302
- } | {
303
- name: "commandPalette";
304
- } | {
305
- name: "settings";
306
- } | {
307
- name: "elementLinkSelector";
308
- sourceElementId: ExcalidrawElement["id"];
309
- } | {
310
- name: "charts";
311
- data: import("../charts").Spreadsheet;
312
- rawText: string;
313
- };
314
- defaultSidebarDockedPreference: boolean;
315
- lastPointerDownWith: import("@excalidraw/element/types").PointerType;
316
- hoveredElementIds: Readonly<{
317
- [id: string]: true;
318
- }>;
319
- previousSelectedElementIds: {
320
- [id: string]: true;
321
- };
322
- selectedElementsAreBeingDragged: boolean;
323
- shouldCacheIgnoreZoom: boolean;
324
- toast: {
325
- message: React.ReactNode;
326
- closable?: boolean;
327
- duration?: number;
328
- } | null;
329
- zenModeEnabled: boolean;
330
- theme: import("@excalidraw/element/types").Theme;
331
- gridSize: number;
332
- gridStep: number;
333
- gridModeEnabled: boolean;
334
- viewModeEnabled: boolean;
335
- selectedGroupIds: {
336
- [groupId: string]: boolean;
337
- };
338
- editingGroupId: import("@excalidraw/element/types").GroupId | null;
339
- width: number;
340
- height: number;
341
- offsetTop: number;
342
- offsetLeft: number;
343
- fileHandle: FileSystemFileHandle | null;
344
- collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
345
- stats: {
346
- open: boolean;
347
- panels: number;
348
- };
349
- showHyperlinkPopup: false | "info" | "editor";
350
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
351
- snapLines: readonly import("../snapping").SnapLine[];
352
- originSnapOffset: {
353
- x: number;
354
- y: number;
355
- } | null;
356
- objectsSnapModeEnabled: boolean;
357
- isCropping: boolean;
358
- croppingElementId: ExcalidrawElement["id"] | null;
359
- searchMatches: Readonly<{
360
- focusedId: ExcalidrawElement["id"] | null;
361
- matches: readonly import("../types").SearchMatch[];
362
- }> | null;
363
- activeLockedId: string | null;
364
- lockedMultiSelections: {
365
- [groupId: string]: true;
366
- };
367
- bindMode: import("@excalidraw/element/types").BindMode;
368
- colorTopPicks: {
369
- elementStroke: readonly string[] | null;
370
- elementBackground: readonly string[] | null;
371
- bucketFill: readonly string[] | null;
372
- };
373
- };
374
- captureUpdate: "IMMEDIATELY";
375
- };
226
+ predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
227
+ perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => ActionResult;
376
228
  } & {
377
229
  keyTest?: undefined;
378
230
  };
231
+ /** wraps each (unbound) text in a new container, selecting the containers */
232
+ export declare const wrapTextsInContainers: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, textElements: readonly ExcalidrawTextElement[], app: AppClassProperties) => ActionResult;