@excalidraw/common 0.18.0-b1c6bfc → 0.18.0-b55c9ee

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