@excalidraw/math 0.18.0-4e0441e → 0.18.0-4e758db

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 (344) hide show
  1. package/dist/dev/index.js +313 -116
  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/bounds.d.ts +10 -0
  7. package/dist/types/common/src/colors.d.ts +81 -39
  8. package/dist/types/common/src/constants.d.ts +75 -34
  9. package/dist/types/common/src/editorInterface.d.ts +34 -0
  10. package/dist/types/common/src/font-metadata.d.ts +1 -3
  11. package/dist/types/common/src/index.d.ts +5 -0
  12. package/dist/types/common/src/keys.d.ts +5 -1
  13. package/dist/types/common/src/points.d.ts +1 -1
  14. package/dist/types/common/src/random.d.ts +7 -0
  15. package/dist/types/common/src/utility-types.d.ts +0 -1
  16. package/dist/types/common/src/utils.d.ts +45 -77
  17. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  18. package/dist/types/element/src/Scene.d.ts +12 -8
  19. package/dist/types/element/src/align.d.ts +2 -2
  20. package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
  21. package/dist/types/element/src/arrowheads.d.ts +3 -0
  22. package/dist/types/element/src/arrows/focus.d.ts +30 -0
  23. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  24. package/dist/types/element/src/binding.d.ts +79 -51
  25. package/dist/types/element/src/bounds.d.ts +25 -18
  26. package/dist/types/element/src/bucketFill.d.ts +110 -0
  27. package/dist/types/element/src/collision.d.ts +7 -2
  28. package/dist/types/element/src/comparisons.d.ts +10 -7
  29. package/dist/types/element/src/convertToShape.d.ts +23 -0
  30. package/dist/types/element/src/delta.d.ts +23 -1
  31. package/dist/types/element/src/distribute.d.ts +3 -2
  32. package/dist/types/element/src/dragElements.d.ts +30 -3
  33. package/dist/types/element/src/duplicate.d.ts +7 -6
  34. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  35. package/dist/types/element/src/embeddable.d.ts +2 -2
  36. package/dist/types/element/src/flowchart.d.ts +11 -7
  37. package/dist/types/element/src/fractionalIndex.d.ts +4 -4
  38. package/dist/types/element/src/frame.d.ts +16 -11
  39. package/dist/types/element/src/groups.d.ts +9 -9
  40. package/dist/types/element/src/heading.d.ts +2 -1
  41. package/dist/types/element/src/image.d.ts +1 -11
  42. package/dist/types/element/src/index.d.ts +9 -4
  43. package/dist/types/element/src/linearElementEditor.d.ts +48 -30
  44. package/dist/types/element/src/mutateElement.d.ts +6 -2
  45. package/dist/types/element/src/newElement.d.ts +44 -8
  46. package/dist/types/element/src/renderElement.d.ts +1 -10
  47. package/dist/types/element/src/resizeElements.d.ts +12 -12
  48. package/dist/types/element/src/resizeTest.d.ts +6 -5
  49. package/dist/types/element/src/selection.d.ts +14 -14
  50. package/dist/types/element/src/shape.d.ts +21 -8
  51. package/dist/types/element/src/sizeHelpers.d.ts +6 -0
  52. package/dist/types/element/src/sortElements.d.ts +10 -0
  53. package/dist/types/element/src/stickyNote.d.ts +183 -0
  54. package/dist/types/element/src/textElement.d.ts +14 -10
  55. package/dist/types/element/src/textMeasurements.d.ts +1 -3
  56. package/dist/types/element/src/textWrapping.d.ts +26 -0
  57. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +27 -8
  58. package/dist/types/element/src/transformHandles.d.ts +8 -27
  59. package/dist/types/element/src/typeChecks.d.ts +30 -31
  60. package/dist/types/element/src/types.d.ts +55 -20
  61. package/dist/types/element/src/utils.d.ts +15 -6
  62. package/dist/types/element/src/zindex.d.ts +7 -1
  63. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +206 -219
  64. package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
  65. package/dist/types/excalidraw/actions/actionBoundText.d.ts +122 -131
  66. package/dist/types/excalidraw/actions/actionCanvas.d.ts +446 -1594
  67. package/dist/types/excalidraw/actions/actionClipboard.d.ts +149 -919
  68. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +59 -64
  69. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +192 -208
  70. package/dist/types/excalidraw/actions/actionDeselect.d.ts +170 -0
  71. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -6
  72. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -4
  73. package/dist/types/excalidraw/actions/actionElementLink.d.ts +66 -77
  74. package/dist/types/excalidraw/actions/actionElementLock.d.ts +121 -130
  75. package/dist/types/excalidraw/actions/actionExport.d.ts +200 -1449
  76. package/dist/types/excalidraw/actions/actionFinalize.d.ts +11 -404
  77. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
  78. package/dist/types/excalidraw/actions/actionFrame.d.ts +318 -509
  79. package/dist/types/excalidraw/actions/actionGroup.d.ts +132 -149
  80. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +205 -196
  81. package/dist/types/excalidraw/actions/actionLink.d.ts +73 -78
  82. package/dist/types/excalidraw/actions/actionMenu.d.ts +60 -71
  83. package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -369
  84. package/dist/types/excalidraw/actions/actionProperties.d.ts +213 -2610
  85. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +66 -75
  86. package/dist/types/excalidraw/actions/actionStyles.d.ts +60 -64
  87. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +4 -4
  88. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +186 -0
  89. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +74 -80
  90. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +186 -0
  91. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +73 -78
  92. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +62 -74
  93. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
  94. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +72 -77
  95. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +73 -78
  96. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +73 -78
  97. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
  98. package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
  99. package/dist/types/excalidraw/actions/index.d.ts +4 -2
  100. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  101. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  102. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  103. package/dist/types/excalidraw/actions/types.d.ts +11 -7
  104. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  105. package/dist/types/excalidraw/appState.d.ts +50 -25
  106. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  107. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  108. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  109. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  110. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  111. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  112. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  113. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  114. package/dist/types/excalidraw/clipboard.d.ts +13 -38
  115. package/dist/types/excalidraw/components/Actions.d.ts +22 -14
  116. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  117. package/dist/types/excalidraw/components/App.arrowText.d.ts +104 -0
  118. package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
  119. package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
  120. package/dist/types/excalidraw/components/App.d.ts +552 -125
  121. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  122. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  123. package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
  124. package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
  125. package/dist/types/excalidraw/components/App.wheel.d.ts +33 -0
  126. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  127. package/dist/types/excalidraw/components/Card.d.ts +1 -3
  128. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  129. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -5
  130. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  131. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -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 -2
  136. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
  137. package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
  138. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  139. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
  140. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -4
  141. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  142. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  143. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  144. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  145. package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
  146. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  147. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
  148. package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
  149. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  150. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  151. package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
  152. package/dist/types/excalidraw/components/IconButton.d.ts +48 -0
  153. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  154. package/dist/types/excalidraw/components/InlineIcon.d.ts +2 -2
  155. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  156. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  157. package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
  158. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  159. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  160. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  161. package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
  162. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  163. package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
  164. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
  165. package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
  166. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  167. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  168. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  169. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  170. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  171. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  172. package/dist/types/excalidraw/components/Popover.d.ts +1 -3
  173. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  174. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  175. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  176. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  177. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  178. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  179. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  180. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  181. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +16 -22
  182. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  183. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  184. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  185. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  186. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  187. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  188. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  189. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  190. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  191. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  192. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -3
  193. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  194. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  195. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  196. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  197. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  198. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  199. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  200. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  201. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  202. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  203. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  204. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  205. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  206. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  207. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  208. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
  209. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  210. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  211. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  212. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  213. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  214. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  215. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  216. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  217. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  218. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
  219. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  220. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  221. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  222. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  223. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  224. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  225. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  226. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  227. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  228. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  229. package/dist/types/excalidraw/components/Toast.d.ts +11 -7
  230. package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
  231. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  232. package/dist/types/excalidraw/components/Tools.d.ts +151 -0
  233. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  234. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  235. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  236. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +10 -4
  237. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -0
  238. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  239. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +48 -38
  240. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -6
  241. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  242. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
  243. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  244. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
  245. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
  246. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  247. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  248. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  249. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  250. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  251. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  252. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
  253. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  254. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  255. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  256. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +3 -3
  257. package/dist/types/excalidraw/components/icons.d.ts +51 -22
  258. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +25 -3
  259. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
  260. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  261. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  262. package/dist/types/excalidraw/data/blob.d.ts +354 -7
  263. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  264. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  265. package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
  266. package/dist/types/excalidraw/data/index.d.ts +8 -9
  267. package/dist/types/excalidraw/data/json.d.ts +183 -3
  268. package/dist/types/excalidraw/data/library.d.ts +25 -10
  269. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  270. package/dist/types/excalidraw/data/restore.d.ts +25 -10
  271. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  272. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  273. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  274. package/dist/types/excalidraw/errors.d.ts +14 -0
  275. package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
  276. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  277. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  278. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
  279. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  280. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
  281. package/dist/types/excalidraw/i18n.d.ts +2 -2
  282. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  283. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  284. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  285. package/dist/types/excalidraw/renderer/animation.d.ts +16 -0
  286. package/dist/types/excalidraw/renderer/helpers.d.ts +31 -8
  287. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +7 -15
  288. package/dist/types/excalidraw/scene/Renderer.d.ts +477 -18
  289. package/dist/types/excalidraw/scene/export.d.ts +4 -4
  290. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  291. package/dist/types/excalidraw/scene/types.d.ts +27 -8
  292. package/dist/types/excalidraw/snapping.d.ts +12 -12
  293. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  294. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  295. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  296. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  297. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  298. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  299. package/dist/types/excalidraw/types.d.ts +566 -55
  300. package/dist/types/excalidraw/viewport.d.ts +280 -0
  301. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +8 -5
  302. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  303. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  304. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  305. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  306. package/dist/types/laser-pointer/src/state.d.ts +36 -0
  307. package/dist/types/math/src/constants.d.ts +0 -1
  308. package/dist/types/math/src/curve.d.ts +23 -13
  309. package/dist/types/math/src/index.d.ts +1 -0
  310. package/dist/types/math/src/pca.d.ts +79 -0
  311. package/dist/types/math/src/point.d.ts +8 -2
  312. package/dist/types/math/src/polygon.d.ts +26 -2
  313. package/dist/types/math/src/range.d.ts +1 -3
  314. package/dist/types/math/src/segment.d.ts +9 -3
  315. package/dist/types/math/src/types.d.ts +25 -1
  316. package/dist/types/utils/src/export.d.ts +9 -8
  317. package/dist/types/utils/src/index.d.ts +1 -2
  318. package/dist/types/utils/src/shape.d.ts +8 -8
  319. package/package.json +2 -2
  320. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -190
  321. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  322. package/dist/types/excalidraw/charts.d.ts +0 -27
  323. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  324. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
  325. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  326. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  327. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  328. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -11
  329. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  330. package/dist/types/excalidraw/components/ToolButton.d.ts +0 -49
  331. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  332. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -10
  333. package/dist/types/excalidraw/components/shapes.d.ts +0 -190
  334. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  335. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  336. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
  337. package/dist/types/excalidraw/cursor.d.ts +0 -5
  338. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  339. package/dist/types/excalidraw/index.d.ts +0 -47
  340. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  341. package/dist/types/excalidraw/scene/scroll.d.ts +0 -23
  342. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  343. package/dist/types/utils/src/bbox.d.ts +0 -9
  344. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -1,39 +1,68 @@
1
1
  import React from "react";
2
- import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
3
- import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
- import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
2
+ import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
3
+ import { LinearElementEditor, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
+ import type { LocalPoint, Radians } from "@excalidraw/math";
5
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawTextContainer, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
6
+ import type { ArrowEndpoint, TransformHandleDirection } from "@excalidraw/element";
5
7
  import type { Mutable } from "@excalidraw/common/utility-types";
6
8
  import { ActionManager } from "../actions/manager";
7
- import { AnimationFrameHandler } from "../animation-frame-handler";
8
9
  import { History } from "../history";
9
10
  import { Fonts } from "../fonts";
10
11
  import { type WritableAtom } from "../editor-jotai";
11
12
  import { Renderer } from "../scene/Renderer";
12
- import { LaserTrails } from "../laser-trails";
13
+ import { type SetViewportOptions } from "../viewport";
14
+ import { LaserTrails } from "../laserTrails";
15
+ import { isOverScrollBars } from "../scene/scrollbars";
13
16
  import { LassoTrail } from "../lasso";
14
17
  import { EraserTrail } from "../eraser";
18
+ import { AppArrowText } from "./App.arrowText";
19
+ import { AppBucketFill } from "./App.bucketFill";
20
+ import { AppToolDrag } from "./App.toolDrag";
21
+ import { AppCursor } from "./App.cursor";
22
+ import { AppDrawShape } from "./App.drawshape";
23
+ import { AppFlowchart } from "./App.flowchart";
24
+ import { AppViewport } from "./App.viewport";
25
+ import { AppWheel } from "./App.wheel";
26
+ import { CursorHints } from "./CursorHint";
27
+ import { type OnStateChange } from "./AppStateObserver";
15
28
  import type { ExportedElements } from "../data";
16
- import type { FileSystemHandle } from "../data/filesystem";
17
- import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
29
+ import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, UIConfig } from "../types";
18
30
  import type { RoughCanvas } from "roughjs/bin/canvas";
19
31
  import type { ActionResult } from "../actions/types";
32
+ declare const editorLifecycleEventBehavior: {
33
+ readonly "editor:mount": {
34
+ readonly cardinality: "once";
35
+ readonly replay: "last";
36
+ };
37
+ readonly "editor:initialize": {
38
+ readonly cardinality: "once";
39
+ readonly replay: "last";
40
+ };
41
+ readonly "editor:unmount": {
42
+ readonly cardinality: "once";
43
+ readonly replay: "last";
44
+ };
45
+ };
20
46
  export declare const ExcalidrawContainerContext: React.Context<{
21
47
  container: HTMLDivElement | null;
22
48
  id: string | null;
23
49
  }>;
50
+ export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
51
+ export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
24
52
  export declare const useApp: () => AppClassProperties;
25
53
  export declare const useAppProps: () => AppProps;
26
- export declare const useDevice: () => Readonly<{
27
- viewport: {
28
- isMobile: boolean;
29
- isLandscape: boolean;
30
- };
31
- editor: {
32
- isMobile: boolean;
33
- canFitSidebar: boolean;
34
- };
54
+ export declare const useEditorInterface: () => Readonly<{
55
+ formFactor: "phone" | "tablet" | "desktop";
56
+ desktopUIMode: "compact" | "full";
57
+ userAgent: Readonly<{
58
+ isMobileDevice: boolean;
59
+ platform: "ios" | "android" | "other" | "unknown";
60
+ }>;
35
61
  isTouchScreen: boolean;
62
+ canFitSidebar: boolean;
63
+ isLandscape: boolean;
36
64
  }>;
65
+ export declare const useStylesPanelMode: () => StylesPanelMode;
37
66
  export declare const useExcalidrawContainer: () => {
38
67
  container: HTMLDivElement | null;
39
68
  id: string | null;
@@ -42,24 +71,34 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
42
71
  export declare const useExcalidrawAppState: () => AppState;
43
72
  export declare const useExcalidrawSetAppState: () => <K extends keyof AppState>(state: AppState | ((prevState: Readonly<AppState>, props: Readonly<any>) => AppState | Pick<AppState, K> | null) | Pick<AppState, K> | null, callback?: (() => void) | undefined) => void;
44
73
  export declare const useExcalidrawActionManager: () => ActionManager;
74
+ /**
75
+ * Requires wrapping your component in <ExcalidrawAPIContext.Provider>
76
+ */
77
+ export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
45
78
  declare class App extends React.Component<AppProps, AppState> {
46
79
  canvas: AppClassProperties["canvas"];
47
80
  interactiveCanvas: AppClassProperties["interactiveCanvas"];
81
+ sessionExportThemeOverride: AppState["theme"] | undefined;
48
82
  rc: RoughCanvas;
49
83
  unmounted: boolean;
50
84
  actionManager: ActionManager;
51
- device: Device;
85
+ editorInterface: EditorInterface;
86
+ private stylesPanelMode;
52
87
  private excalidrawContainerRef;
88
+ get ownerDocument(): Document;
89
+ get ownerWindow(): Window & typeof globalThis;
53
90
  scene: Scene;
54
91
  fonts: Fonts;
55
92
  renderer: Renderer;
56
93
  visibleElements: readonly NonDeletedExcalidrawElement[];
94
+ /** whether the last render had any renderable elements (excludes e.g. the
95
+ * in-progress `newElement` and the edited text element) */
96
+ private hasRenderableElements;
57
97
  private resizeObserver;
58
- private nearestScrollableContainer;
59
98
  library: AppClassProperties["library"];
60
99
  libraryItemsFromStorage: LibraryItems | undefined;
61
100
  id: string;
62
- private store;
101
+ store: Store;
63
102
  private history;
64
103
  excalidrawContainerValue: {
65
104
  container: HTMLDivElement | null;
@@ -78,26 +117,49 @@ declare class App extends React.Component<AppProps, AppState> {
78
117
  /** embeds that have been inserted to DOM (as a perf optim, we don't want to
79
118
  * insert to DOM before user initially scrolls to them) */
80
119
  private initializedEmbeds;
81
- private handleToastClose;
82
120
  private elementsPendingErasure;
83
- flowChartCreator: FlowChartCreator;
84
- private flowChartNavigator;
121
+ private _initialized;
122
+ private readonly editorLifecycleEvents;
123
+ onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
124
+ private appStateObserver;
125
+ onStateChange: OnStateChange;
126
+ bucketFill: AppBucketFill;
127
+ toolDrag: AppToolDrag;
128
+ flowchart: AppFlowchart;
129
+ cursor: AppCursor;
130
+ arrowText: AppArrowText;
131
+ viewport: AppViewport;
132
+ wheel: AppWheel;
133
+ bindModeHandler: ReturnType<typeof setTimeout> | null;
134
+ private textWysiwygSubmitHandler;
85
135
  hitLinkElement?: NonDeletedExcalidrawElement;
86
136
  lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
137
+ /**
138
+ * the handle of the resize in progress while `state.isResizing` — for UI
139
+ * that words itself by handle (a sticky note's corners resize
140
+ * proportionally, its edges freely); not app state, so it costs no
141
+ * re-render of its own
142
+ */
143
+ activeResizeHandle: TransformHandleDirection | null;
87
144
  lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
145
+ lastPointerUpIsDoubleClick: boolean;
88
146
  lastPointerMoveEvent: PointerEvent | null;
147
+ /** current frame pointer cords */
89
148
  lastPointerMoveCoords: {
90
149
  x: number;
91
150
  y: number;
92
151
  } | null;
93
- lastViewportPosition: {
152
+ private lastCompletedCanvasClicks;
153
+ /** previous frame pointer coords */
154
+ previousPointerMoveCoords: {
94
155
  x: number;
95
156
  y: number;
96
- };
97
- animationFrameHandler: AnimationFrameHandler;
157
+ } | null;
158
+ drawShape: AppDrawShape;
98
159
  laserTrails: LaserTrails;
99
160
  eraserTrail: EraserTrail;
100
161
  lassoTrail: LassoTrail;
162
+ cursorHints: CursorHints;
101
163
  onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
102
164
  onPointerDownEmitter: Emitter<[activeTool: {
103
165
  lastActiveTool: import("../types").ActiveTool | null;
@@ -112,11 +174,7 @@ declare class App extends React.Component<AppProps, AppState> {
112
174
  x: number;
113
175
  y: number;
114
176
  }>;
115
- scrollbars: {
116
- isOverEither: boolean;
117
- isOverHorizontal: boolean;
118
- isOverVertical: boolean;
119
- };
177
+ scrollbars: ReturnType<typeof isOverScrollBars>;
120
178
  lastCoords: {
121
179
  x: number;
122
180
  y: number;
@@ -129,7 +187,7 @@ declare class App extends React.Component<AppProps, AppState> {
129
187
  x: number;
130
188
  y: number;
131
189
  };
132
- arrowDirection: "end" | "origin";
190
+ arrowDirection: "origin" | "end";
133
191
  center: {
134
192
  x: number;
135
193
  y: number;
@@ -141,6 +199,7 @@ declare class App extends React.Component<AppProps, AppState> {
141
199
  wasAddedToSelection: boolean;
142
200
  hasBeenDuplicated: boolean;
143
201
  hasHitCommonBoundingBoxOfSelectedElements: boolean;
202
+ arrowLabel: boolean;
144
203
  };
145
204
  withCmdOrCtrl: boolean;
146
205
  drag: {
@@ -156,14 +215,10 @@ declare class App extends React.Component<AppProps, AppState> {
156
215
  blockDragging: boolean;
157
216
  };
158
217
  eventListeners: {
159
- onMove: {
160
- (...args: any[]): void;
161
- flush(): void;
162
- cancel(): void;
163
- } | null;
164
- onUp: ((event: PointerEvent) => void) | null;
165
- onKeyDown: ((event: KeyboardEvent) => void) | null;
166
- onKeyUp: ((event: KeyboardEvent) => void) | null;
218
+ onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
219
+ onUp: null | ((event: PointerEvent) => void);
220
+ onKeyDown: null | ((event: KeyboardEvent) => void);
221
+ onKeyUp: null | ((event: KeyboardEvent) => void);
167
222
  };
168
223
  boxSelection: {
169
224
  hasOccurred: boolean;
@@ -182,11 +237,7 @@ declare class App extends React.Component<AppProps, AppState> {
182
237
  x: number;
183
238
  y: number;
184
239
  }>;
185
- scrollbars: {
186
- isOverEither: boolean;
187
- isOverHorizontal: boolean;
188
- isOverVertical: boolean;
189
- };
240
+ scrollbars: ReturnType<typeof isOverScrollBars>;
190
241
  lastCoords: {
191
242
  x: number;
192
243
  y: number;
@@ -199,7 +250,7 @@ declare class App extends React.Component<AppProps, AppState> {
199
250
  x: number;
200
251
  y: number;
201
252
  };
202
- arrowDirection: "end" | "origin";
253
+ arrowDirection: "origin" | "end";
203
254
  center: {
204
255
  x: number;
205
256
  y: number;
@@ -211,6 +262,7 @@ declare class App extends React.Component<AppProps, AppState> {
211
262
  wasAddedToSelection: boolean;
212
263
  hasBeenDuplicated: boolean;
213
264
  hasHitCommonBoundingBoxOfSelectedElements: boolean;
265
+ arrowLabel: boolean;
214
266
  };
215
267
  withCmdOrCtrl: boolean;
216
268
  drag: {
@@ -226,14 +278,10 @@ declare class App extends React.Component<AppProps, AppState> {
226
278
  blockDragging: boolean;
227
279
  };
228
280
  eventListeners: {
229
- onMove: {
230
- (...args: any[]): void;
231
- flush(): void;
232
- cancel(): void;
233
- } | null;
234
- onUp: ((event: PointerEvent) => void) | null;
235
- onKeyDown: ((event: KeyboardEvent) => void) | null;
236
- onKeyUp: ((event: KeyboardEvent) => void) | null;
281
+ onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
282
+ onUp: null | ((event: PointerEvent) => void);
283
+ onKeyDown: null | ((event: KeyboardEvent) => void);
284
+ onKeyUp: null | ((event: KeyboardEvent) => void);
237
285
  };
238
286
  boxSelection: {
239
287
  hasOccurred: boolean;
@@ -245,17 +293,101 @@ declare class App extends React.Component<AppProps, AppState> {
245
293
  }>]>;
246
294
  missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
247
295
  onRemoveEventListenersEmitter: Emitter<[]>;
296
+ api: ExcalidrawImperativeAPI;
297
+ private createExcalidrawAPI;
248
298
  constructor(props: AppProps);
299
+ /**
300
+ * Whether the editor accepts user input (pointer, keyboard, wheel, touch,
301
+ * clipboard, drag&drop). When `false`, the editor is fully inert for the
302
+ * user, but remains controllable through the imperative API.
303
+ *
304
+ * All user-input entry points must consult this getter (directly or by
305
+ * not being attached/rendered at all).
306
+ */
307
+ isInteractionEnabled(props?: Pick<AppProps, "interaction">): boolean;
308
+ /**
309
+ * Whether element links render their link icon and are clickable.
310
+ * True when fully interactive, or when `interaction: { enabled: { links:
311
+ * true } }`
312
+ * (in which case clicking anywhere on a linked element opens the link,
313
+ * same as in view mode).
314
+ */
315
+ isLinksEnabled(props?: Pick<AppProps, "interaction">): boolean;
316
+ /**
317
+ * Whether canvas navigation — panning & zooming, view-mode style — is
318
+ * enabled. True when fully interactive, or when `interaction: { enabled:
319
+ * { navigation: true } }`. Respects `appState.scrollConstraints`.
320
+ */
321
+ isNavigationEnabled(props?: Pick<AppProps, "interaction">): boolean;
322
+ /**
323
+ * Whether embeddable & iframe elements are interactive (hover & click to
324
+ * activate, view-mode style). True when fully interactive, or when
325
+ * allowed via `interaction.enabled.embeds` / `.interactiveContent`.
326
+ */
327
+ isEmbedsEnabled(props?: Pick<AppProps, "interaction">): boolean;
328
+ /**
329
+ * Whether the browser's own zoom (ctrl/cmd + wheel, pinch, keyboard
330
+ * shortcuts) stays available over the non-interactive editor.
331
+ * Prevented by default.
332
+ */
333
+ isBrowserZoomEnabled(props?: Pick<AppProps, "interaction">): boolean;
334
+ /**
335
+ * Whether the tool can be activated & driven by user input. False when
336
+ * disabled via `UIOptions.tools`, or when the editor is non-interactive
337
+ * and the tool isn't kept user-driven via `interaction.enabled.tools`.
338
+ *
339
+ * (Once UI tool availability is split from input availability — e.g.
340
+ * `props.ui.tools` vs `interaction.disabled.tools` — the UI axis moves
341
+ * out into its own predicate.)
342
+ *
343
+ * We purposely widen the `tool` type so this helper can be called with
344
+ * any tool without having to type check it.
345
+ */
346
+ isToolSupported: <T extends ToolType | "custom">(tool: T, props?: Pick<AppProps, "interaction" | "UIOptions">) => boolean;
347
+ /**
348
+ * Whether the active tool is locked in place — via the tool lock
349
+ * (padlock / Q) or by being host-forced (`props.activeTool`). A locked
350
+ * tool doesn't revert to the selection tool after use, and elements drawn
351
+ * with it aren't selected. Forcing deliberately does not mutate
352
+ * `activeTool.locked`, which is the user's persisted padlock preference.
353
+ */
354
+ isToolLocked(): boolean;
355
+ /**
356
+ * Whether the active tool captures the primary pointer instead of the
357
+ * view-mode drag-to-pan — the laser and host-implemented custom tools do;
358
+ * while non-interactive, any tool allowed via
359
+ * `interaction.enabled.tools` does. (Editing tools capture the pointer
360
+ * trivially since view mode implies they're not active; this predicate only
361
+ * matters where view-mode gates apply.)
362
+ */
363
+ isActiveToolPointerCapturing(): boolean;
364
+ /** Whether Excalidraw's full default UI is rendered. */
365
+ isDefaultUIEnabled(props?: Pick<AppProps, "ui">): boolean;
366
+ /** Whether an individual default UI control is rendered. */
367
+ isUIControlEnabled(control: keyof UIConfig["enabled"], props?: Pick<AppProps, "ui">): boolean;
249
368
  updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
250
369
  private onWindowMessage;
370
+ private handleSkipBindMode;
371
+ private resetDelayedBindMode;
372
+ private previousHoveredBindableElement;
373
+ private handleDelayedBindModeChange;
251
374
  private cacheEmbeddableRef;
252
375
  /**
253
376
  * Returns gridSize taking into account `gridModeEnabled`.
254
377
  * If disabled, returns null.
255
378
  */
256
379
  getEffectiveGridSize: () => NullableGridSize;
380
+ private getTextCreationGridPoint;
257
381
  private getHTMLIFrameElement;
258
- private handleEmbeddableCenterClick;
382
+ /**
383
+ * AI-generated iframe elements aren't interactive while their generation
384
+ * is still in progress (the partial content is render-only).
385
+ */
386
+ private isIframeLikeInteractive;
387
+ private handleIframeLikeElementHover;
388
+ /** @returns true if iframe-like element click handled */
389
+ private handleIframeLikeCenterClick;
390
+ private isDoubleClick;
259
391
  private isIframeLikeElementCenter;
260
392
  private updateEmbedValidationStatus;
261
393
  private updateEmbeddables;
@@ -268,11 +400,11 @@ declare class App extends React.Component<AppProps, AppState> {
268
400
  render(): import("react/jsx-runtime").JSX.Element;
269
401
  focusContainer: AppClassProperties["focusContainer"];
270
402
  getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
271
- getSceneElementsMapIncludingDeleted: () => Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
403
+ getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
272
404
  getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
273
405
  onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
274
406
  onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
275
- exportingFrame: ExcalidrawFrameLikeElement | null;
407
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
276
408
  }) => Promise<void>;
277
409
  private magicGenerations;
278
410
  private updateMagicGeneration;
@@ -288,9 +420,33 @@ declare class App extends React.Component<AppProps, AppState> {
288
420
  private openEyeDropper;
289
421
  dismissLinearEditor: () => void;
290
422
  syncActionResult: (actionResult: ActionResult) => void;
423
+ scheduleCapture: () => void;
291
424
  private onBlur;
292
425
  private onUnload;
293
426
  private disableEvent;
427
+ private handleNavigationModeKeyDown;
428
+ /**
429
+ * PageUp/PageDown scroll the canvas by a page — vertically, or
430
+ * horizontally with shift. Respects `appState.scrollConstraints`
431
+ * (via `viewport.translate`).
432
+ */
433
+ private maybeHandlePageScrollKeyDown;
434
+ private preventBrowserZoomKeyDown;
435
+ /** Ends active input sessions before switching to a view-mode/non-interactive
436
+ * mode. */
437
+ private terminateActiveInteraction;
438
+ private handleInteractionStateChange;
439
+ /** whether the two values reference the same tool (incl. custom subtype) */
440
+ private isSameForcedTool;
441
+ /**
442
+ * Keeps `state.activeTool` synced to the host-controlled
443
+ * `props.activeTool`. `setActiveTool` refuses non-matching activations
444
+ * while forced (user input, API); this backstop covers the writers that
445
+ * bypass the funnel (`actionFinalize`/`actionDeselect`, `restore()` on
446
+ * scene load, ...) and re-applies the tool once it becomes activatable
447
+ * (e.g. `interaction` config changes).
448
+ */
449
+ private handleForcedToolChange;
294
450
  private resetHistory;
295
451
  private resetStore;
296
452
  /**
@@ -299,10 +455,11 @@ declare class App extends React.Component<AppProps, AppState> {
299
455
  */
300
456
  private resetScene;
301
457
  private initializeScene;
302
- private isMobileBreakpoint;
303
- private isTabletBreakpoint;
304
- private refreshViewportBreakpoints;
305
- private refreshEditorBreakpoints;
458
+ private getFormFactor;
459
+ refreshEditorInterface: () => void;
460
+ private reconcileStylesPanelMode;
461
+ /** TO BE USED LATER */
462
+ private setDesktopUIMode;
306
463
  private clearImageShapeCache;
307
464
  componentDidMount(): Promise<void>;
308
465
  componentWillUnmount(): void;
@@ -329,54 +486,25 @@ declare class App extends React.Component<AppProps, AppState> {
329
486
  clientY: number;
330
487
  } | "cursor" | "center";
331
488
  retainSeed?: boolean;
332
- fitToContent?: boolean;
489
+ fit?: SetViewportOptions["fit"];
490
+ preserveFrameChildrenOrder?: boolean;
333
491
  }) => void;
334
492
  private addElementsFromMixedContentPaste;
335
493
  private addTextFromPaste;
336
494
  setAppState: React.Component<any, AppState>["setState"];
337
495
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
338
496
  toggleLock: (source?: "keyboard" | "ui") => void;
339
- updateFrameRendering: (opts: Partial<{
340
- enabled: boolean;
341
- name: boolean;
342
- outline: boolean;
343
- clip: boolean;
344
- }> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
497
+ updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
345
498
  togglePenMode: (force: boolean | null) => void;
346
- onHandToolToggle: () => void;
347
- /**
348
- * Zooms on canvas viewport center
349
- */
350
- zoomCanvas: (value: number) => void;
351
- private cancelInProgressAnimation;
352
- scrollToContent: (target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
353
- fitToContent?: boolean;
354
- fitToViewport?: never;
355
- viewportZoomFactor?: number;
356
- animate?: boolean;
357
- duration?: number;
358
- } | {
359
- fitToContent?: never;
360
- fitToViewport?: boolean;
361
- /** when fitToViewport=true, how much screen should the content cover,
362
- * between 0.1 (10%) and 1 (100%)
363
- */
364
- viewportZoomFactor?: number;
365
- animate?: boolean;
366
- duration?: number;
367
- }) & {
368
- minZoom?: number;
369
- maxZoom?: number;
370
- canvasOffsets?: Offsets;
371
- }) => void;
372
- private maybeUnfollowRemoteUser;
373
- /** use when changing scrollX/scrollY/zoom based on user interaction */
374
- private translateCanvas;
375
- setToast: (toast: {
376
- message: string;
377
- closable?: boolean;
378
- duration?: number;
379
- } | null) => void;
499
+ revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
500
+ /** emits a follow/unfollow intent to the host (which owns the
501
+ * `userToFollow` state) via both the `onUserFollow` prop and the
502
+ * imperative API emitter */
503
+ emitUserFollowIntent: (payload: OnUserFollowedPayload) => void;
504
+ /** emits an UNFOLLOW intent if currently following someone — use on
505
+ * user-initiated viewport changes which should break follow mode */
506
+ requestUnfollow: () => void;
507
+ setToast: (toast: AppState["toast"]) => void;
380
508
  restoreFileFromShare: () => Promise<void>;
381
509
  /**
382
510
  * adds supplied files to existing files in the appState.
@@ -386,7 +514,7 @@ declare class App extends React.Component<AppProps, AppState> {
386
514
  private addMissingFiles;
387
515
  updateScene: <K extends keyof AppState>(sceneData: {
388
516
  elements?: SceneData["elements"];
389
- appState?: Pick<AppState, K> | null | undefined;
517
+ appState?: Pick<AppState, K> | null;
390
518
  collaborators?: SceneData["collaborators"];
391
519
  /**
392
520
  * Controls which updates should be captured by the `Store`. Captured updates are emmitted and listened to by other components, such as `History` for undo / redo purposes.
@@ -403,20 +531,20 @@ declare class App extends React.Component<AppProps, AppState> {
403
531
  }) => void;
404
532
  applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
405
533
  mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
406
- private triggerRender;
534
+ triggerRender: (
535
+ /** force always re-renders canvas even if no change */
536
+ force?: boolean) => void;
407
537
  /**
408
538
  * @returns whether the menu was toggled on or off
409
539
  */
410
540
  toggleSidebar: ({ name, tab, force, }: {
411
541
  name: SidebarName | null;
412
- tab?: string | undefined;
413
- force?: boolean | undefined;
542
+ tab?: SidebarTabName;
543
+ force?: boolean;
414
544
  }) => boolean;
415
545
  private updateCurrentCursorPosition;
416
- getEditorUIOffsets: () => Offsets;
417
546
  private onKeyDown;
418
547
  private onKeyUp;
419
- private isToolSupported;
420
548
  setActiveTool: (tool: ({
421
549
  type: ToolType;
422
550
  } | {
@@ -425,10 +553,18 @@ declare class App extends React.Component<AppProps, AppState> {
425
553
  }) & {
426
554
  locked?: boolean;
427
555
  fromSelection?: boolean;
428
- }, keepSelection?: boolean) => void;
556
+ }, opts?: {
557
+ keepSelection?: boolean;
558
+ /**
559
+ * When `true`, re-activating an already-active toggle tool (see
560
+ * `TOGGLE_TOOLS`) switches back to the previously active tool.
561
+ * Activation is idempotent by default; toggle tools always record the
562
+ * previously active tool regardless (so ESC and the next `toggle`
563
+ * activation can switch back to it).
564
+ */
565
+ toggle?: boolean;
566
+ }) => void;
429
567
  setOpenDialog: (dialogType: AppState["openDialog"]) => void;
430
- private setCursor;
431
- private resetCursor;
432
568
  /**
433
569
  * returns whether user is making a gesture with >= 2 fingers (points)
434
570
  * on o touch screen (not on a trackpad). Currently only relates to Darwin
@@ -442,22 +578,297 @@ declare class App extends React.Component<AppProps, AppState> {
442
578
  private onGestureEnd;
443
579
  private handleTextWysiwyg;
444
580
  private deselectElements;
445
- private getTextElementAtPosition;
446
- private getElementAtPosition;
447
- private getElementsAtPosition;
581
+ private getSelectedTextElement;
582
+ private getSelectedTextEditingContainerAtPosition;
583
+ getTextElementAtPosition(x: number, y: number): NonDeleted<ExcalidrawTextElement> | null;
584
+ private isHittingTextAutoResizeHandle;
585
+ private handleTextAutoResizeHandlePointerDown;
586
+ getElementAtPosition(x: number, y: number, opts?: ({
587
+ includeBoundTextElement?: boolean;
588
+ includeLockedElements?: boolean;
589
+ } | {
590
+ allHitElements: NonDeleted<ExcalidrawElement>[];
591
+ }) & {
592
+ preferSelected?: boolean;
593
+ }): NonDeleted<ExcalidrawElement> | null;
594
+ getElementsAtPosition(x: number, y: number, opts?: {
595
+ includeBoundTextElement?: boolean;
596
+ includeLockedElements?: boolean;
597
+ }): NonDeleted<ExcalidrawElement>[];
448
598
  getElementHitThreshold(element: ExcalidrawElement): number;
449
- private hitElement;
450
- private getTextBindableContainerAtPosition;
451
- private startTextEditing;
599
+ hitElement(x: number, y: number, element: NonDeletedExcalidrawElement, considerBoundingBox?: boolean): boolean;
600
+ getTextBindableContainerAtPosition(x: number, y: number): (Readonly<{
601
+ id: string;
602
+ x: number;
603
+ y: number;
604
+ strokeColor: string;
605
+ backgroundColor: string;
606
+ fillStyle: import("@excalidraw/element/types").FillStyle;
607
+ strokeWidth: number;
608
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
609
+ roundness: null | {
610
+ type: import("@excalidraw/element/types").RoundnessType;
611
+ value?: number;
612
+ };
613
+ roughness: number;
614
+ opacity: number;
615
+ width: number;
616
+ height: number;
617
+ angle: Radians;
618
+ seed: number;
619
+ version: number;
620
+ versionNonce: number;
621
+ index: import("@excalidraw/element/types").FractionalIndex | null;
622
+ isDeleted: boolean;
623
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
624
+ frameId: string | null;
625
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
626
+ updated: number;
627
+ created: number | null;
628
+ link: string | null;
629
+ locked: boolean;
630
+ customData?: Record<string, any>;
631
+ }> & {
632
+ type: "rectangle";
633
+ } & {
634
+ isDeleted: false;
635
+ }) | (Readonly<{
636
+ id: string;
637
+ x: number;
638
+ y: number;
639
+ strokeColor: string;
640
+ backgroundColor: string;
641
+ fillStyle: import("@excalidraw/element/types").FillStyle;
642
+ strokeWidth: number;
643
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
644
+ roundness: null | {
645
+ type: import("@excalidraw/element/types").RoundnessType;
646
+ value?: number;
647
+ };
648
+ roughness: number;
649
+ opacity: number;
650
+ width: number;
651
+ height: number;
652
+ angle: Radians;
653
+ seed: number;
654
+ version: number;
655
+ versionNonce: number;
656
+ index: import("@excalidraw/element/types").FractionalIndex | null;
657
+ isDeleted: boolean;
658
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
659
+ frameId: string | null;
660
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
661
+ updated: number;
662
+ created: number | null;
663
+ link: string | null;
664
+ locked: boolean;
665
+ customData?: Record<string, any>;
666
+ }> & Readonly<{
667
+ type: "stickynote";
668
+ baseHeight: number;
669
+ }> & {
670
+ isDeleted: false;
671
+ }) | (Readonly<{
672
+ id: string;
673
+ x: number;
674
+ y: number;
675
+ strokeColor: string;
676
+ backgroundColor: string;
677
+ fillStyle: import("@excalidraw/element/types").FillStyle;
678
+ strokeWidth: number;
679
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
680
+ roundness: null | {
681
+ type: import("@excalidraw/element/types").RoundnessType;
682
+ value?: number;
683
+ };
684
+ roughness: number;
685
+ opacity: number;
686
+ width: number;
687
+ height: number;
688
+ angle: Radians;
689
+ seed: number;
690
+ version: number;
691
+ versionNonce: number;
692
+ index: import("@excalidraw/element/types").FractionalIndex | null;
693
+ isDeleted: boolean;
694
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
695
+ frameId: string | null;
696
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
697
+ updated: number;
698
+ created: number | null;
699
+ link: string | null;
700
+ locked: boolean;
701
+ customData?: Record<string, any>;
702
+ }> & {
703
+ type: "diamond";
704
+ } & {
705
+ isDeleted: false;
706
+ }) | (Readonly<{
707
+ id: string;
708
+ x: number;
709
+ y: number;
710
+ strokeColor: string;
711
+ backgroundColor: string;
712
+ fillStyle: import("@excalidraw/element/types").FillStyle;
713
+ strokeWidth: number;
714
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
715
+ roundness: null | {
716
+ type: import("@excalidraw/element/types").RoundnessType;
717
+ value?: number;
718
+ };
719
+ roughness: number;
720
+ opacity: number;
721
+ width: number;
722
+ height: number;
723
+ angle: Radians;
724
+ seed: number;
725
+ version: number;
726
+ versionNonce: number;
727
+ index: import("@excalidraw/element/types").FractionalIndex | null;
728
+ isDeleted: boolean;
729
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
730
+ frameId: string | null;
731
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
732
+ updated: number;
733
+ created: number | null;
734
+ link: string | null;
735
+ locked: boolean;
736
+ customData?: Record<string, any>;
737
+ }> & {
738
+ type: "ellipse";
739
+ } & {
740
+ isDeleted: false;
741
+ }) | (Readonly<{
742
+ id: string;
743
+ x: number;
744
+ y: number;
745
+ strokeColor: string;
746
+ backgroundColor: string;
747
+ fillStyle: import("@excalidraw/element/types").FillStyle;
748
+ strokeWidth: number;
749
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
750
+ roundness: null | {
751
+ type: import("@excalidraw/element/types").RoundnessType;
752
+ value?: number;
753
+ };
754
+ roughness: number;
755
+ opacity: number;
756
+ width: number;
757
+ height: number;
758
+ angle: Radians;
759
+ seed: number;
760
+ version: number;
761
+ versionNonce: number;
762
+ index: import("@excalidraw/element/types").FractionalIndex | null;
763
+ isDeleted: boolean;
764
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
765
+ frameId: string | null;
766
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
767
+ updated: number;
768
+ created: number | null;
769
+ link: string | null;
770
+ locked: boolean;
771
+ customData?: Record<string, any>;
772
+ }> & Readonly<{
773
+ type: "line" | "arrow";
774
+ points: readonly LocalPoint[];
775
+ startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
776
+ endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
777
+ startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
778
+ endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
779
+ }> & Readonly<{
780
+ type: "arrow";
781
+ elbowed: boolean;
782
+ }> & {
783
+ isDeleted: false;
784
+ }) | null;
785
+ /**
786
+ * Whether a text element's content is still being authored.
787
+ *
788
+ * Creating a text reverts the tool to selection during pointerdown, so the
789
+ * pointerup that follows looks like an ordinary canvas click and would
790
+ * capture the still-empty element as a history entry of its own. Undo would
791
+ * then rewind only the typing, restoring an invisible, zero-content element
792
+ * (and, for an endpoint label, leaving the arrow bound to it) rather than
793
+ * removing it. The editor's own submit captures the finished text instead,
794
+ * so the whole create-and-type lands in a single entry.
795
+ */
796
+ private isEditingTextContent;
797
+ startTextEditing: ({ sceneX, sceneY, insertAtParentCenter, container, autoEdit, initialCaretSceneCoords, arrowEndpoint, }: {
798
+ /** X position to insert text at */
799
+ sceneX: number;
800
+ /** Y position to insert text at */
801
+ sceneY: number;
802
+ /** whether to attempt to insert at element center if applicable */
803
+ insertAtParentCenter?: boolean;
804
+ container?: ExcalidrawTextContainer | null;
805
+ autoEdit?: boolean;
806
+ initialCaretSceneCoords?: {
807
+ x: number;
808
+ y: number;
809
+ };
810
+ /**
811
+ * creates the text as a label for this arrow endpoint: the binding then
812
+ * dictates the text's position and alignment, overriding (sceneX, sceneY)
813
+ */
814
+ arrowEndpoint?: ArrowEndpoint | null;
815
+ }) => void;
452
816
  private startImageCropping;
453
817
  private finishImageCropping;
818
+ private shouldHandleBrowserCanvasDoubleClick;
454
819
  private handleCanvasDoubleClick;
820
+ private handleCanvasClick;
455
821
  private getElementLinkAtPosition;
456
- private redirectToLink;
457
- private getTopLayerFrameAtSceneCoords;
822
+ private handleElementLinkClick;
823
+ /**
824
+ * Applies (or clears) the element-link hover affordances — pointer cursor
825
+ * and tooltip — based on the current `hitLinkElement`. Returns whether a
826
+ * link is being hovered.
827
+ */
828
+ private applyElementLinkHoverAffordance;
829
+ /**
830
+ * On touchscreens (where no hover precedes the tap) re-derives
831
+ * `hitLinkElement`, then opens the hit element link, if any.
832
+ * Returns whether a link click was handled.
833
+ */
834
+ private maybeHandleElementLinkClick;
835
+ /**
836
+ * Restricted pointer handling for the non-interactive editor with links
837
+ * and/or embeds allowed (`interaction.enabled.links` / `.embeds` /
838
+ * `.interactiveContent`) — runs only the element-link & embed concerns
839
+ * (shared with the full pointer handlers above) so they behave like in
840
+ * view mode without the rest of the canvas pointer machinery.
841
+ */
842
+ private handleInteractiveContentPointerMove;
843
+ private handleInteractiveContentPointerUp;
844
+ /**
845
+ * finds candidate frame under cursor (when dragging frame children/elements
846
+ * inside frames)
847
+ */
848
+ getTopLayerFrameAtSceneCoords: (
849
+ /**
850
+ * should be already grid aligned (basically should be what the call site
851
+ * sets the element's coords to, if applicable)
852
+ */
853
+ sceneCoords: {
854
+ x: number;
855
+ y: number;
856
+ }, opts?: {
857
+ /** to exclude selected elements when dragging, etc. */
858
+ excludeElementIds?: AppState["selectedElementIds"];
859
+ currentFrameId?: ExcalidrawElement["frameId"];
860
+ }) => NonDeleted<ExcalidrawFrameLikeElement> | null;
861
+ private updateFrameToHighlight;
862
+ private maybeUpdateFrameToHighlightOnPointerMove;
863
+ insertNewElements: (elements: readonly ExcalidrawElement[]) => void;
864
+ insertNewElement: (element: ExcalidrawElement) => void;
458
865
  private handleCanvasPointerMove;
459
866
  private handleEraser;
460
867
  private handleTouchMove;
868
+ /**
869
+ * Applies the hover affordances of a selected linear element: the cursor,
870
+ * plus the hovered-handle state that renders them highlighted.
871
+ */
461
872
  handleHoverSelectedLinearElement(linearElementEditor: LinearElementEditor, scenePointerX: number, scenePointerY: number): void;
462
873
  private handleCanvasPointerDown;
463
874
  private handleCanvasPointerUp;
@@ -471,6 +882,11 @@ declare class App extends React.Component<AppProps, AppState> {
471
882
  private maybeCleanupAfterMissingPointerUp;
472
883
  handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
473
884
  private updateGestureOnPointerDown;
885
+ /**
886
+ * Tracks the pointer within the ongoing multi-touch gesture and applies
887
+ * the two-finger pinch zoom/pan, if any.
888
+ */
889
+ private updateMultiTouchGesture;
474
890
  private initialPointerDownState;
475
891
  private handleDraggingScrollBar;
476
892
  private clearSelectionIfNotUsingSelection;
@@ -495,7 +911,10 @@ declare class App extends React.Component<AppProps, AppState> {
495
911
  }) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
496
912
  private newImagePlaceholder;
497
913
  private handleLinearElementOnPointerDown;
498
- private getCurrentItemRoundness;
914
+ getCurrentItemRoundness(elementType: "selection" | "rectangle" | "stickynote" | "diamond" | "ellipse" | "iframe" | "embeddable"): {
915
+ type: 2 | 3;
916
+ } | null;
917
+ getCurrentItemStrokeWidth(elementType: ExcalidrawElement["type"]): number;
499
918
  private createGenericElementOnPointerDown;
500
919
  private createFrameElementOnPointerDown;
501
920
  private maybeCacheReferenceSnapPoints;
@@ -524,25 +943,32 @@ declare class App extends React.Component<AppProps, AppState> {
524
943
  /** generally you should use `addNewImagesToImageCache()` directly if you need
525
944
  * to render new images. This is just a failsafe */
526
945
  private scheduleImageRefresh;
527
- private updateBindingEnabledOnPointerMove;
528
- private maybeSuggestBindingAtCursor;
529
946
  private clearSelection;
530
947
  private handleInteractiveCanvasRef;
531
948
  private insertImages;
532
949
  private handleAppOnDrop;
533
- loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
950
+ loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
534
951
  private handleCanvasContextMenu;
535
952
  private maybeDragNewGenericElement;
536
953
  private maybeHandleCrop;
537
954
  private maybeHandleResize;
538
955
  private getContextMenuItems;
539
- private handleWheel;
540
- private getTextWysiwygSnappedToCenterPosition;
956
+ getTextWysiwygSnappedToCenterPosition(x: number, y: number, appState: AppState, container?: ExcalidrawTextContainer | null): {
957
+ viewportX: number;
958
+ viewportY: number;
959
+ elementCenterX: number;
960
+ elementCenterY: number;
961
+ } | undefined;
541
962
  private savePointer;
542
- private resetShouldCacheIgnoreZoomDebounced;
963
+ resetShouldCacheIgnoreZoomDebounced: {
964
+ (): void;
965
+ flush(): void;
966
+ cancel(): void;
967
+ };
543
968
  private updateDOMRect;
544
969
  refresh: () => void;
545
970
  private getCanvasOffsets;
971
+ watchState: () => void;
546
972
  private updateLanguage;
547
973
  }
548
974
  declare global {
@@ -552,6 +978,7 @@ declare global {
552
978
  elements: readonly ExcalidrawElement[];
553
979
  state: AppState;
554
980
  setState: React.Component<any, AppState>["setState"];
981
+ watchState: (prev: any, next: any) => void | undefined;
555
982
  app: InstanceType<typeof App>;
556
983
  history: History;
557
984
  store: Store;