@excalidraw/math 0.18.0-3a5ef40 → 0.18.0-3c916c5

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