@excalidraw/math 0.18.0-b9d27d3 → 0.18.0-c0a0ca3

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 (384) hide show
  1. package/dist/dev/index.js +363 -163
  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 +94 -31
  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 +7 -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 +58 -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 +5 -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 +145 -49
  25. package/dist/types/element/src/bounds.d.ts +34 -19
  26. package/dist/types/element/src/bucketFill.d.ts +110 -0
  27. package/dist/types/element/src/collision.d.ts +24 -3
  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/cropElement.d.ts +36 -4
  31. package/dist/types/element/src/delta.d.ts +30 -2
  32. package/dist/types/element/src/distribute.d.ts +6 -2
  33. package/dist/types/element/src/dragElements.d.ts +37 -5
  34. package/dist/types/element/src/duplicate.d.ts +67 -6
  35. package/dist/types/element/src/elbowArrow.d.ts +7 -0
  36. package/dist/types/element/src/embeddable.d.ts +3 -2
  37. package/dist/types/element/src/flowchart.d.ts +9 -11
  38. package/dist/types/element/src/fractionalIndex.d.ts +4 -4
  39. package/dist/types/element/src/frame.d.ts +35 -12
  40. package/dist/types/element/src/groups.d.ts +10 -15
  41. package/dist/types/element/src/heading.d.ts +2 -1
  42. package/dist/types/element/src/image.d.ts +6 -13
  43. package/dist/types/element/src/index.d.ts +11 -4
  44. package/dist/types/element/src/linearElementEditor.d.ts +51 -30
  45. package/dist/types/element/src/listMarker.d.ts +39 -0
  46. package/dist/types/element/src/mutateElement.d.ts +6 -2
  47. package/dist/types/element/src/newElement.d.ts +61 -9
  48. package/dist/types/element/src/renderElement.d.ts +33 -12
  49. package/dist/types/element/src/renderEnvironment.d.ts +66 -0
  50. package/dist/types/element/src/resizeElements.d.ts +24 -14
  51. package/dist/types/element/src/resizeTest.d.ts +6 -5
  52. package/dist/types/element/src/selection.d.ts +11 -17
  53. package/dist/types/element/src/shape.d.ts +38 -9
  54. package/dist/types/element/src/sizeHelpers.d.ts +6 -0
  55. package/dist/types/element/src/sortElements.d.ts +10 -0
  56. package/dist/types/element/src/stickyNote.d.ts +191 -0
  57. package/dist/types/element/src/textElement.d.ts +23 -11
  58. package/dist/types/element/src/textMeasurements.d.ts +16 -14
  59. package/dist/types/element/src/textWrapping.d.ts +28 -1
  60. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +32 -9
  61. package/dist/types/element/src/transformHandles.d.ts +8 -27
  62. package/dist/types/element/src/typeChecks.d.ts +30 -31
  63. package/dist/types/element/src/types.d.ts +55 -20
  64. package/dist/types/element/src/utils.d.ts +22 -6
  65. package/dist/types/element/src/zindex.d.ts +7 -1
  66. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +251 -219
  67. package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
  68. package/dist/types/excalidraw/actions/actionBoundText.d.ts +117 -272
  69. package/dist/types/excalidraw/actions/actionCanvas.d.ts +556 -1582
  70. package/dist/types/excalidraw/actions/actionClipboard.d.ts +179 -899
  71. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +74 -64
  72. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -562
  73. package/dist/types/excalidraw/actions/actionDeselect.d.ts +183 -0
  74. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -6
  75. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -4
  76. package/dist/types/excalidraw/actions/actionElementLink.d.ts +81 -77
  77. package/dist/types/excalidraw/actions/actionElementLock.d.ts +151 -130
  78. package/dist/types/excalidraw/actions/actionExport.d.ts +232 -1416
  79. package/dist/types/excalidraw/actions/actionFinalize.d.ts +11 -394
  80. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
  81. package/dist/types/excalidraw/actions/actionFrame.d.ts +253 -875
  82. package/dist/types/excalidraw/actions/actionGroup.d.ts +162 -149
  83. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +221 -197
  84. package/dist/types/excalidraw/actions/actionLink.d.ts +87 -77
  85. package/dist/types/excalidraw/actions/actionMenu.d.ts +76 -438
  86. package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -359
  87. package/dist/types/excalidraw/actions/actionProperties.d.ts +240 -2533
  88. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +81 -75
  89. package/dist/types/excalidraw/actions/actionStyles.d.ts +75 -64
  90. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +452 -6
  91. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +196 -0
  92. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +89 -80
  93. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +196 -0
  94. package/dist/types/excalidraw/actions/actionToggleMinimap.d.ts +201 -0
  95. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +88 -78
  96. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +77 -74
  97. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
  98. package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +198 -0
  99. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +87 -77
  100. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +88 -78
  101. package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
  102. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +88 -78
  103. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
  104. package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
  105. package/dist/types/excalidraw/actions/index.d.ts +8 -3
  106. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  107. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  108. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  109. package/dist/types/excalidraw/actions/types.d.ts +11 -7
  110. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  111. package/dist/types/excalidraw/appState.d.ts +60 -28
  112. package/dist/types/excalidraw/charts/charts.bar.d.ts +3 -0
  113. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  114. package/dist/types/excalidraw/charts/charts.helpers.d.ts +33 -0
  115. package/dist/types/excalidraw/charts/charts.line.d.ts +3 -0
  116. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  117. package/dist/types/excalidraw/charts/charts.radar.d.ts +3 -0
  118. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  119. package/dist/types/excalidraw/charts/index.d.ts +8 -0
  120. package/dist/types/excalidraw/clipboard.d.ts +13 -36
  121. package/dist/types/excalidraw/components/Actions.d.ts +41 -11
  122. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  123. package/dist/types/excalidraw/components/App.arrowText.d.ts +70 -0
  124. package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
  125. package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
  126. package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
  127. package/dist/types/excalidraw/components/App.d.ts +418 -154
  128. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  129. package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
  130. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  131. package/dist/types/excalidraw/components/App.host.d.ts +102 -0
  132. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  133. package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
  134. package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
  135. package/dist/types/excalidraw/components/App.selectionTool.d.ts +94 -0
  136. package/dist/types/excalidraw/components/App.text.d.ts +197 -0
  137. package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
  138. package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
  139. package/dist/types/excalidraw/components/App.viewport.d.ts +133 -0
  140. package/dist/types/excalidraw/components/App.wheel.d.ts +30 -0
  141. package/dist/types/excalidraw/components/App.wrap.d.ts +39 -0
  142. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  143. package/dist/types/excalidraw/components/Card.d.ts +1 -3
  144. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  145. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -4
  146. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  147. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +7 -1
  148. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -2
  149. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +5 -2
  150. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
  151. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
  152. package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
  153. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
  154. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  155. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  156. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
  157. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +6 -5
  158. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  159. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  160. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  161. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  162. package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
  163. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  164. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
  165. package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
  166. package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
  167. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +5 -1
  168. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
  169. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  170. package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
  171. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  172. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  173. package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
  174. package/dist/types/excalidraw/components/IconButton.d.ts +48 -0
  175. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  176. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  177. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  178. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  179. package/dist/types/excalidraw/components/LayerUI.d.ts +6 -2
  180. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  181. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  182. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  183. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +7 -3
  184. package/dist/types/excalidraw/components/LibraryUnit.d.ts +9 -5
  185. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  186. package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
  187. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
  188. package/dist/types/excalidraw/components/Minimap/Minimap.d.ts +15 -0
  189. package/dist/types/excalidraw/components/Minimap/MinimapAnnouncementDot.d.ts +10 -0
  190. package/dist/types/excalidraw/components/Minimap/minimap-controller.chunk.d.ts +90 -0
  191. package/dist/types/excalidraw/components/Minimap/minimap-shared.chunk.d.ts +122 -0
  192. package/dist/types/excalidraw/components/Minimap/minimap-worker.chunk.d.ts +12 -0
  193. package/dist/types/excalidraw/components/MobileMenu.d.ts +5 -7
  194. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  195. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  196. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  197. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  198. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  199. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  200. package/dist/types/excalidraw/components/Popover.d.ts +2 -3
  201. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
  202. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  203. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  204. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  205. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  206. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  207. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  208. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  209. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +16 -22
  210. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  211. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  212. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  213. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  214. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  215. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  216. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  217. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  218. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  219. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  220. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -3
  221. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  222. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  223. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  224. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  225. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  226. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -2
  227. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  228. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  229. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  230. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  231. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  232. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  233. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  234. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +4 -2
  235. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  236. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
  237. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  238. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +9 -3
  239. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  240. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  241. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  242. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  243. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +12 -0
  244. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  245. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +10 -0
  246. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +19 -16
  247. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  248. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  249. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +8 -0
  250. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  251. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +108 -0
  252. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  253. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  254. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  255. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +26 -0
  256. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  257. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  258. package/dist/types/excalidraw/components/Toast.d.ts +11 -7
  259. package/dist/types/excalidraw/components/ToolPopover.d.ts +22 -0
  260. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  261. package/dist/types/excalidraw/components/Tools.d.ts +151 -0
  262. package/dist/types/excalidraw/components/Tooltip.d.ts +26 -2
  263. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
  264. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
  265. package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
  266. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  267. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  268. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  269. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +11 -4
  270. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -0
  271. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  272. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +47 -35
  273. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -5
  274. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  275. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
  276. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  277. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
  278. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
  279. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  280. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  281. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  282. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  283. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  284. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  285. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
  286. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  287. package/dist/types/excalidraw/components/footer/Footer.d.ts +5 -1
  288. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  289. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  290. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +16 -5
  291. package/dist/types/excalidraw/components/icons.d.ts +57 -22
  292. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +27 -3
  293. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
  294. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  295. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  296. package/dist/types/excalidraw/data/blob.d.ts +375 -8
  297. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  298. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  299. package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
  300. package/dist/types/excalidraw/data/index.d.ts +11 -12
  301. package/dist/types/excalidraw/data/json.d.ts +193 -3
  302. package/dist/types/excalidraw/data/library.d.ts +25 -10
  303. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  304. package/dist/types/excalidraw/data/restore.d.ts +25 -10
  305. package/dist/types/excalidraw/data/types.d.ts +4 -1
  306. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  307. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  308. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  309. package/dist/types/excalidraw/errors.d.ts +14 -0
  310. package/dist/types/excalidraw/fonts/Fonts.d.ts +12 -8
  311. package/dist/types/excalidraw/history.d.ts +10 -4
  312. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  313. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +2 -2
  314. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
  315. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  316. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  317. package/dist/types/excalidraw/i18n.d.ts +2 -2
  318. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  319. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  320. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  321. package/dist/types/excalidraw/mermaid.d.ts +7 -0
  322. package/dist/types/excalidraw/reactUtils.d.ts +1 -1
  323. package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
  324. package/dist/types/excalidraw/renderer/animation.d.ts +23 -0
  325. package/dist/types/excalidraw/renderer/helpers.d.ts +31 -8
  326. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +7 -15
  327. package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
  328. package/dist/types/excalidraw/scene/Renderer.d.ts +492 -20
  329. package/dist/types/excalidraw/scene/export.d.ts +344 -21
  330. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  331. package/dist/types/excalidraw/scene/types.d.ts +51 -9
  332. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  333. package/dist/types/excalidraw/snapping.d.ts +12 -12
  334. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  335. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  336. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  337. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  338. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  339. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  340. package/dist/types/excalidraw/types.d.ts +728 -61
  341. package/dist/types/excalidraw/viewport.d.ts +303 -0
  342. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +19 -5
  343. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  344. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  345. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  346. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  347. package/dist/types/laser-pointer/src/state.d.ts +36 -0
  348. package/dist/types/math/src/constants.d.ts +0 -1
  349. package/dist/types/math/src/curve.d.ts +23 -13
  350. package/dist/types/math/src/index.d.ts +1 -0
  351. package/dist/types/math/src/pca.d.ts +79 -0
  352. package/dist/types/math/src/point.d.ts +8 -2
  353. package/dist/types/math/src/polygon.d.ts +26 -2
  354. package/dist/types/math/src/range.d.ts +1 -3
  355. package/dist/types/math/src/segment.d.ts +10 -3
  356. package/dist/types/math/src/types.d.ts +25 -1
  357. package/dist/types/utils/src/index.d.ts +4 -3
  358. package/dist/types/utils/src/shape.d.ts +8 -8
  359. package/package.json +2 -2
  360. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -185
  361. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  362. package/dist/types/excalidraw/charts.d.ts +0 -27
  363. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  364. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
  365. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  366. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  367. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  368. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -9
  369. package/dist/types/excalidraw/components/ToolButton.d.ts +0 -49
  370. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  371. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -10
  372. package/dist/types/excalidraw/components/shapes.d.ts +0 -190
  373. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  374. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  375. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
  376. package/dist/types/excalidraw/cursor.d.ts +0 -5
  377. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  378. package/dist/types/excalidraw/index.d.ts +0 -47
  379. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  380. package/dist/types/excalidraw/scene/scroll.d.ts +0 -23
  381. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  382. package/dist/types/utils/src/bbox.d.ts +0 -9
  383. package/dist/types/utils/src/export.d.ts +0 -35
  384. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -1,15 +1,20 @@
1
1
  import "./IconPicker.scss";
2
2
  import type { JSX } from "react";
3
- export declare function IconPicker<T>({ value, label, options, onChange, group, numberOfOptionsToAlwaysShow, }: {
3
+ type Option<T> = {
4
+ value: T;
5
+ text: string;
6
+ icon: JSX.Element;
7
+ keyBinding: string | null;
8
+ };
9
+ type PickerSection<T> = {
10
+ name: string;
11
+ options: readonly Option<T>[];
12
+ };
13
+ export declare function IconPicker<T>({ value, label, visibleSections, hiddenSections, onChange, }: {
4
14
  label: string;
5
15
  value: T;
6
- options: readonly {
7
- value: T;
8
- text: string;
9
- icon: JSX.Element;
10
- keyBinding: string | null;
11
- }[];
16
+ visibleSections: readonly PickerSection<T>[];
17
+ hiddenSections?: readonly PickerSection<T>[];
12
18
  onChange: (value: T) => void;
13
- numberOfOptionsToAlwaysShow?: number;
14
- group?: string;
15
19
  }): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -1,3 +1,5 @@
1
- export declare const InlineIcon: ({ icon }: {
1
+ export declare const InlineIcon: ({ className, icon, size, }: {
2
+ className?: string;
2
3
  icon: React.ReactNode;
4
+ size?: string;
3
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,17 @@
1
1
  import React from "react";
2
2
  import "./Island.scss";
3
+ import type { ViewportUIDock, ViewportUIName } from "../types";
3
4
  type IslandProps = {
4
5
  children: React.ReactNode;
5
6
  padding?: number;
6
7
  className?: string | boolean;
7
8
  style?: object;
9
+ /** marks the island as a canvas-occluding UI surface measured by
10
+ * `getViewportOffsets` (see {@link ViewportUIDock}) */
11
+ "data-viewport-ui"?: ViewportUIDock;
12
+ /** identifies the surface so `getViewportOffsets` can reserve space for
13
+ * it while hidden (see {@link ViewportUIName}) */
14
+ "data-viewport-ui-name"?: ViewportUIName;
8
15
  };
9
16
  export declare const Island: React.ForwardRefExoticComponent<IslandProps & React.RefAttributes<HTMLDivElement>>;
10
17
  export {};
@@ -1,10 +1,8 @@
1
- import "./ToolIcon.scss";
2
- type LaserPointerIconProps = {
1
+ type LaserPointerButtonProps = {
3
2
  title?: string;
4
- name?: string;
5
3
  checked: boolean;
6
4
  onChange?(): void;
7
5
  isMobile?: boolean;
8
6
  };
9
- export declare const LaserPointerButton: (props: LaserPointerIconProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const LaserPointerButton: (props: LaserPointerButtonProps) => import("react/jsx-runtime").JSX.Element;
10
8
  export {};
@@ -13,10 +13,10 @@ interface LayerUIProps {
13
13
  setAppState: React.Component<any, AppState>["setState"];
14
14
  elements: readonly NonDeletedExcalidrawElement[];
15
15
  onLockToggle: () => void;
16
- onHandToolToggle: () => void;
17
16
  onPenModeToggle: AppClassProperties["togglePenMode"];
18
17
  showExitZenModeBtn: boolean;
19
18
  langCode: Language["code"];
19
+ renderTopLeftUI?: ExcalidrawProps["renderTopLeftUI"];
20
20
  renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
21
21
  renderCustomStats?: ExcalidrawProps["renderCustomStats"];
22
22
  UIOptions: AppProps["UIOptions"];
@@ -24,8 +24,12 @@ interface LayerUIProps {
24
24
  renderWelcomeScreen: boolean;
25
25
  children?: React.ReactNode;
26
26
  app: AppClassProperties;
27
+ defaultUIEnabled: boolean;
28
+ zoomUIEnabled: boolean;
29
+ scrollBackToContentUIEnabled: boolean;
27
30
  isCollaborating: boolean;
28
31
  generateLinkForSelection?: AppProps["generateLinkForSelection"];
32
+ currentUserControls?: ExcalidrawProps["currentUserControls"];
29
33
  }
30
- declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, isCollaborating, generateLinkForSelection, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
34
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onPenModeToggle, showExitZenModeBtn, renderTopLeftUI, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, defaultUIEnabled, zoomUIEnabled, scrollBackToContentUIEnabled, isCollaborating, generateLinkForSelection, currentUserControls, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
31
35
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import "./LibraryMenu.scss";
3
- export declare const isLibraryMenuOpenAtom: import("jotai/vanilla/atom").PrimitiveAtom<boolean> & {
3
+ export declare const isLibraryMenuOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
4
4
  init: boolean;
5
5
  };
6
6
  /**
@@ -5,5 +5,5 @@ export declare const LibraryMenuControlButtons: ({ libraryReturnUrl, theme, id,
5
5
  id: string;
6
6
  style: React.CSSProperties;
7
7
  children?: React.ReactNode;
8
- className?: string | undefined;
8
+ className?: string;
9
9
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type Library from "../data/library";
3
2
  import type { LibraryItem, UIAppState } from "../types";
4
3
  export declare const LibraryDropdownMenuButton: React.FC<{
@@ -14,5 +13,5 @@ export declare const LibraryDropdownMenuButton: React.FC<{
14
13
  export declare const LibraryDropdownMenu: ({ selectedItems, onSelectItems, className, }: {
15
14
  selectedItems: LibraryItem["id"][];
16
15
  onSelectItems: (id: LibraryItem["id"][]) => void;
17
- className?: string | undefined;
16
+ className?: string;
18
17
  }) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import type { ExcalidrawElement, NonDeleted } from "@excalidraw/element/types";
3
3
  import type { SvgCache } from "../hooks/useLibraryItemSvg";
4
4
  import type { LibraryItem } from "../types";
5
5
  import type { ReactNode } from "react";
6
- type LibraryOrPendingItem = (LibraryItem | /* pending library item */ {
6
+ type LibraryOrPendingItem = readonly (LibraryItem | /* pending library item */ {
7
7
  id: null;
8
8
  elements: readonly NonDeleted<ExcalidrawElement>[];
9
9
  })[];
@@ -15,9 +15,13 @@ interface Props {
15
15
  isItemSelected: (id: LibraryItem["id"] | null) => boolean;
16
16
  svgCache: SvgCache;
17
17
  itemsRenderedPerBatch: number;
18
+ /** larger items with their name below */
19
+ showNames?: boolean;
18
20
  }
19
- export declare const LibraryMenuSectionGrid: ({ children, }: {
21
+ export declare const LibraryMenuSectionGrid: ({ children, showNames, }: {
20
22
  children: ReactNode;
23
+ /** fewer columns, for items rendered with `showNames` */
24
+ showNames?: boolean;
21
25
  }) => import("react/jsx-runtime").JSX.Element;
22
- export declare const LibraryMenuSection: React.MemoExoticComponent<({ items, onItemSelectToggle, onItemDrag, isItemSelected, onClick, svgCache, itemsRenderedPerBatch, }: Props) => import("react/jsx-runtime").JSX.Element>;
26
+ export declare const LibraryMenuSection: React.MemoExoticComponent<({ items, onItemSelectToggle, onItemDrag, isItemSelected, onClick, svgCache, itemsRenderedPerBatch, showNames, }: Props) => import("react/jsx-runtime").JSX.Element>;
23
27
  export {};
@@ -1,15 +1,19 @@
1
- /// <reference types="react" />
2
1
  import "./LibraryUnit.scss";
3
2
  import type { LibraryItem } from "../types";
4
3
  import type { SvgCache } from "../hooks/useLibraryItemSvg";
5
- export declare const LibraryUnit: import("react").MemoExoticComponent<({ id, elements, isPending, onClick, selected, onToggle, onDrag, svgCache, }: {
4
+ export declare const LibraryUnit: import("react").MemoExoticComponent<({ id, name, showName, elements, isPending, onClick, selected, onToggle, onDrag, svgCache, }: {
6
5
  id: LibraryItem["id"] | /** for pending item */ null;
7
- elements?: readonly import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | undefined;
8
- isPending?: boolean | undefined;
6
+ name?: LibraryItem["name"];
7
+ /** render larger, with the name below the item */
8
+ showName?: boolean;
9
+ elements?: LibraryItem["elements"];
10
+ isPending?: boolean;
9
11
  onClick: (id: LibraryItem["id"] | null) => void;
10
12
  selected: boolean;
11
13
  onToggle: (id: string, event: React.MouseEvent) => void;
12
14
  onDrag: (id: string, event: React.DragEvent) => void;
13
15
  svgCache: SvgCache;
14
16
  }) => import("react/jsx-runtime").JSX.Element>;
15
- export declare const EmptyLibraryUnit: () => import("react/jsx-runtime").JSX.Element;
17
+ export declare const EmptyLibraryUnit: ({ showName }: {
18
+ showName?: boolean;
19
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Theme } from "@excalidraw/element/types";
3
2
  export declare const LoadingMessage: React.FC<{
4
3
  delay?: number;
@@ -1,10 +1,9 @@
1
- import "./ToolIcon.scss";
2
- type LockIconProps = {
1
+ type LockButtonProps = {
3
2
  title?: string;
4
- name?: string;
5
3
  checked: boolean;
6
4
  onChange?(): void;
7
5
  isMobile?: boolean;
6
+ disabled?: boolean;
8
7
  };
9
- export declare const LockButton: (props: LockIconProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const LockButton: (props: LockButtonProps) => import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,9 +1,7 @@
1
- import "./ToolIcon.scss";
2
1
  import type { JSX } from "react";
3
2
  export declare const ElementCanvasButton: (props: {
4
3
  title?: string;
5
4
  icon: JSX.Element;
6
- name?: string;
7
5
  checked: boolean;
8
6
  onChange?(): void;
9
7
  isMobile?: boolean;
@@ -0,0 +1,15 @@
1
+ import "./Minimap.scss";
2
+ /**
3
+ * The vertical space (px) the UI above the minimap gives up for it: its
4
+ * height + the gap below it (see Minimap.scss), less a part of the clearance
5
+ * that UI keeps from the footer anyway — the minimap can sit closer to it.
6
+ */
7
+ export declare const MINIMAP_RESERVED_HEIGHT = 138;
8
+ /**
9
+ * The minimap isn't available in editors shorter than this (px): it shares
10
+ * the left edge with the styles panel, which would be left with no room.
11
+ */
12
+ export declare const MINIMAP_MIN_EDITOR_HEIGHT = 500;
13
+ export declare const Minimap: ({ className }: {
14
+ className?: string;
15
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * TEMPORARY: a pulsing dot on the minimap toggle announcing the (new)
3
+ * minimap. Stops showing on its own after `ANNOUNCEMENT_END` — remove this
4
+ * file (and its uses) any time after.
5
+ */
6
+ import type { AppClassProperties } from "../../types";
7
+ export declare const MinimapAnnouncementDot: ({ app, minimapEnabled, }: {
8
+ app: AppClassProperties;
9
+ minimapEnabled: boolean;
10
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * The minimap's logic on the editor's side, loaded once the minimap is first
3
+ * shown.
4
+ *
5
+ * DON'T depend on anything from the outside (types aside), so that this
6
+ * lazy-loaded chunk stays self-contained.
7
+ */
8
+ import type { AppClassProperties } from "../../types";
9
+ /**
10
+ * Drives the minimap canvas. All the main thread does is to copy a few
11
+ * numbers per element (throttled, and only when the scene changes) and to
12
+ * forward the viewport — bounds, layout and drawing happen in a worker
13
+ * rendering to an OffscreenCanvas. Falls back to the main thread where
14
+ * that's not supported.
15
+ */
16
+ export declare class MinimapController {
17
+ private app;
18
+ private container;
19
+ private canvas;
20
+ private worker;
21
+ private fallback;
22
+ private shared;
23
+ private isDestroyed;
24
+ private cleanups;
25
+ private config;
26
+ /** the transform of the last rendered frame */
27
+ private transform;
28
+ /** bounds of the elements of the last rendered frame */
29
+ private contentBounds;
30
+ private scratch;
31
+ private elementsSeq;
32
+ private isElementsDirty;
33
+ private isAwaitingFrame;
34
+ private nextEncodingAt;
35
+ private encodingTimer;
36
+ private encodingFrame;
37
+ private drag;
38
+ /** @see unlockOnceSettled */
39
+ private unlockFrame;
40
+ constructor(app: AppClassProperties, container: HTMLElement);
41
+ private init;
42
+ private subscribe;
43
+ /** tears down everything but the instance itself, so it can be restarted */
44
+ private teardown;
45
+ private restartOnMainThread;
46
+ destroy(): void;
47
+ private send;
48
+ private getConfig;
49
+ private syncConfig;
50
+ private getViewport;
51
+ private syncViewport;
52
+ private scheduleEncoding;
53
+ private sendElements;
54
+ /** @see MinimapRecord for the format */
55
+ private encodeElements;
56
+ private onFrame;
57
+ /** the position of the pointer in the minimap (CSS px) */
58
+ private getPointerPosition;
59
+ private onPointerDown;
60
+ /**
61
+ * The viewport can be dragged up to its own size past the content, i.e.
62
+ * until the content is just out of view (or as far as it already is).
63
+ */
64
+ private getDragBounds;
65
+ private onPointerMove;
66
+ /** moves the viewport where the pointer drags it */
67
+ private moveViewport;
68
+ /**
69
+ * Keeps panning the viewport for as long as the pointer is held outside of
70
+ * the minimap, the faster the further out it is — the pointer may have
71
+ * nowhere further to go (the minimap sits in the corner of the screen).
72
+ */
73
+ private autoPan;
74
+ /**
75
+ * Zooms the canvas around the center of its viewport, wherever in the
76
+ * minimap the pointer (or the viewport) is — as opposed to over the canvas,
77
+ * wheeling over the minimap never pans.
78
+ */
79
+ private onWheel;
80
+ private onPointerUp;
81
+ private endDrag;
82
+ /**
83
+ * Ending the drag may leave the viewport animating (the rubberband
84
+ * overscroll of a locked viewport snapping back). The minimap is kept as is
85
+ * until that settles, so that only the viewport moves, instead of the
86
+ * minimap refitting itself under it on each frame.
87
+ */
88
+ private unlockOnceSettled;
89
+ private cancelUnlock;
90
+ }
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Minimap renderer & message protocol, shared by the worker and by the
3
+ * main-thread fallback.
4
+ *
5
+ * DON'T depend on anything from the outside, as this module is part of a
6
+ * separate lazy-loaded chunk that's also loaded by the worker — including
7
+ * anything from the main chunk would pull the whole editor into the worker.
8
+ */
9
+ /**
10
+ * Elements are sent as a flat Float32Array of records, so that the main
11
+ * thread only copies a few numbers per element and everything else (bounds,
12
+ * transform, drawing) happens off the main thread. Each record starts with
13
+ * its kind:
14
+ *
15
+ * - `BOX` & `FRAME`: `kind, x, y, width, height, angle`
16
+ * - `PATH`: `kind, x, y, angle, pointsCount, ...[pointX, pointY]` (points
17
+ * are relative to `x`/`y`, same as on linear elements)
18
+ */
19
+ export declare const MinimapRecord: {
20
+ /** drawn as a filled block */
21
+ readonly BOX: 0;
22
+ /** drawn as an outline, so that it doesn't cover its children */
23
+ readonly FRAME: 1;
24
+ /** drawn as a polyline */
25
+ readonly PATH: 2;
26
+ };
27
+ export declare const MINIMAP_BOX_RECORD_SIZE = 6;
28
+ export declare const MINIMAP_PATH_RECORD_HEADER_SIZE = 5;
29
+ /** scene → minimap (CSS pixels): `minimap = scene * scale + translate` */
30
+ export type MinimapTransform = {
31
+ scale: number;
32
+ translateX: number;
33
+ translateY: number;
34
+ };
35
+ /** in scene coordinates */
36
+ export type MinimapViewport = {
37
+ x: number;
38
+ y: number;
39
+ width: number;
40
+ height: number;
41
+ };
42
+ export type MinimapColors = {
43
+ element: string;
44
+ viewport: string;
45
+ };
46
+ export type MinimapConfig = {
47
+ /** CSS pixels */
48
+ width: number;
49
+ /** CSS pixels */
50
+ height: number;
51
+ devicePixelRatio: number;
52
+ colors: MinimapColors;
53
+ };
54
+ type MinimapCanvas = OffscreenCanvas | HTMLCanvasElement;
55
+ export type MinimapInMessage = {
56
+ type: "init";
57
+ canvas: MinimapCanvas;
58
+ config: MinimapConfig;
59
+ } | {
60
+ type: "config";
61
+ config: MinimapConfig;
62
+ } | {
63
+ type: "elements";
64
+ seq: number;
65
+ records: Float32Array;
66
+ } | {
67
+ type: "viewport";
68
+ viewport: MinimapViewport;
69
+ }
70
+ /**
71
+ * While a transform is supplied, it's used as is instead of being fitted
72
+ * to the content. Used while dragging the viewport of a locked (scroll-
73
+ * constrained) editor, so that the minimap doesn't rescale as the viewport
74
+ * rubberbands past the lock.
75
+ */
76
+ | {
77
+ type: "lock";
78
+ transform: MinimapTransform | null;
79
+ };
80
+ export type MinimapOutMessage = {
81
+ type: "frame";
82
+ /** the transform the frame was rendered with */
83
+ transform: MinimapTransform;
84
+ /** `seq` of the elements the frame was rendered with */
85
+ elementsSeq: number;
86
+ /** bounds of those elements, in scene coordinates (null if there are none) */
87
+ contentBounds: MinimapBounds | null;
88
+ };
89
+ /** CSS pixels. Keeps the viewport visible (and grabbable) when tiny. */
90
+ export declare const MINIMAP_MIN_VIEWPORT_SIZE = 6;
91
+ export type MinimapBounds = [
92
+ minX: number,
93
+ minY: number,
94
+ maxX: number,
95
+ maxY: number
96
+ ];
97
+ /**
98
+ * The on-minimap rect of the viewport, grown to the minimum size around its
99
+ * center.
100
+ */
101
+ export declare const getMinimapViewportRect: (viewport: MinimapViewport, transform: MinimapTransform) => {
102
+ x: number;
103
+ y: number;
104
+ width: number;
105
+ height: number;
106
+ };
107
+ export type MinimapScheduler = {
108
+ requestFrame: (callback: () => void) => number;
109
+ cancelFrame: (id: number) => void;
110
+ };
111
+ /**
112
+ * Receives the messages of the editor and renders at most once per frame.
113
+ * Runs in the worker, or on the main thread where workers (or
114
+ * OffscreenCanvas) aren't available — there, supply the scheduler of the
115
+ * window the minimap is rendered in, which may not be the one the code runs
116
+ * in (an editor mounted into a pop-out window).
117
+ */
118
+ export declare const createMinimapEndpoint: (postMessage: (message: MinimapOutMessage) => void, { requestFrame, cancelFrame }?: MinimapScheduler) => {
119
+ handle: (message: MinimapInMessage) => void;
120
+ destroy: () => void;
121
+ };
122
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * DON'T depend on anything from the outside, as this module is part of a
3
+ * separate lazy-loaded chunk (see `subset-worker.chunk.ts` for details).
4
+ */
5
+ /**
6
+ * Due to this export (and related dynamic import), this worker code will be
7
+ * included in the bundle automatically (as a separate chunk), without the
8
+ * need for esbuild / vite / rollup plugins.
9
+ *
10
+ * `import.meta.url` is undefined in nodejs
11
+ */
12
+ export declare const WorkerUrl: URL | undefined;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
3
3
  import type { ActionManager } from "../actions/manager";
4
- import type { AppClassProperties, AppProps, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
4
+ import type { AppClassProperties, AppState, UIAppState } from "../types";
5
5
  import type { JSX } from "react";
6
6
  type MobileMenuProps = {
7
7
  appState: UIAppState;
@@ -10,16 +10,14 @@ type MobileMenuProps = {
10
10
  renderImageExportDialog: () => React.ReactNode;
11
11
  setAppState: React.Component<any, AppState>["setState"];
12
12
  elements: readonly NonDeletedExcalidrawElement[];
13
- onLockToggle: () => void;
14
- onHandToolToggle: () => void;
15
13
  onPenModeToggle: AppClassProperties["togglePenMode"];
16
14
  renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
17
- renderCustomStats?: ExcalidrawProps["renderCustomStats"];
15
+ renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
18
16
  renderSidebars: () => JSX.Element | null;
19
- device: Device;
20
17
  renderWelcomeScreen: boolean;
21
- UIOptions: AppProps["UIOptions"];
18
+ defaultUIEnabled: boolean;
19
+ scrollBackToContentUIEnabled: boolean;
22
20
  app: AppClassProperties;
23
21
  };
24
- export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, UIOptions, app, }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, renderTopLeftUI, renderTopRightUI, renderSidebars, renderWelcomeScreen, defaultUIEnabled, scrollBackToContentUIEnabled, app, onPenModeToggle, }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
25
23
  export {};
@@ -0,0 +1,9 @@
1
+ import "./ToolIcon.scss";
2
+ import "./MobileToolbar.scss";
3
+ import type { AppClassProperties, UIAppState } from "../types";
4
+ type MobileToolbarProps = {
5
+ app: AppClassProperties;
6
+ setAppState: React.Component<any, UIAppState>["setState"];
7
+ };
8
+ export declare const MobileToolbar: ({ app, setAppState }: MobileToolbarProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./Modal.scss";
3
2
  import type { AppState } from "../types";
4
3
  export declare const Modal: React.FC<{
@@ -4,7 +4,7 @@ export type OverwriteConfirmDialogProps = {
4
4
  children: React.ReactNode;
5
5
  };
6
6
  declare const OverwriteConfirmDialog: React.FC<OverwriteConfirmDialogProps & {
7
- __fallback?: boolean | undefined;
7
+ __fallback?: boolean;
8
8
  }> & {
9
9
  Actions: (({ children }: {
10
10
  children: React.ReactNode;
@@ -11,7 +11,7 @@ export type OverwriteConfirmState = {
11
11
  } | {
12
12
  active: false;
13
13
  };
14
- export declare const overwriteConfirmStateAtom: import("jotai/vanilla/atom").PrimitiveAtom<OverwriteConfirmState> & {
14
+ export declare const overwriteConfirmStateAtom: import("jotai").PrimitiveAtom<OverwriteConfirmState> & {
15
15
  init: OverwriteConfirmState;
16
16
  };
17
17
  export declare function openConfirmModal({ title, description, actionLabel, color, }: {
@@ -1,8 +1,7 @@
1
- import React from "react";
2
1
  import "./PasteChartDialog.scss";
3
- import type { UIAppState } from "../types";
4
- export declare const PasteChartDialog: ({ setAppState, appState, onClose, }: {
5
- appState: UIAppState;
2
+ import type { Spreadsheet } from "../charts";
3
+ export declare const PasteChartDialog: ({ data, rawText, onClose, }: {
4
+ data: Spreadsheet;
5
+ rawText: string;
6
6
  onClose: () => void;
7
- setAppState: React.Component<any, UIAppState>["setState"];
8
7
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,9 @@
1
- import "./ToolIcon.scss";
2
- type PenModeIconProps = {
1
+ type PenModeButtonProps = {
3
2
  title?: string;
4
- name?: string;
5
3
  checked: boolean;
6
4
  onChange?(): void;
7
- zenModeEnabled?: boolean;
8
5
  isMobile?: boolean;
9
6
  penDetected: boolean;
10
7
  };
11
- export declare const PenModeButton: (props: PenModeIconProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const PenModeButton: (props: PenModeButtonProps) => import("react/jsx-runtime").JSX.Element | null;
12
9
  export {};
@@ -6,10 +6,9 @@ type Props = {
6
6
  children?: React.ReactNode;
7
7
  onCloseRequest?(event: PointerEvent): void;
8
8
  fitInViewport?: boolean;
9
- offsetLeft?: number;
10
- offsetTop?: number;
11
9
  viewportWidth?: number;
12
10
  viewportHeight?: number;
11
+ className?: string;
13
12
  };
14
- export declare const Popover: ({ children, left, top, onCloseRequest, fitInViewport, offsetLeft, offsetTop, viewportWidth, viewportHeight, }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Popover: ({ children, left, top, onCloseRequest, fitInViewport, viewportWidth, viewportHeight, className, }: Props) => import("react/jsx-runtime").JSX.Element;
15
14
  export {};
@@ -1,4 +1,4 @@
1
- import * as Popover from "@radix-ui/react-popover";
1
+ import { Popover } from "radix-ui";
2
2
  import React, { type ReactNode } from "react";
3
3
  interface PropertiesPopoverProps {
4
4
  className?: string;
@@ -10,6 +10,7 @@ interface PropertiesPopoverProps {
10
10
  onPointerLeave?: React.PointerEventHandler<HTMLDivElement>;
11
11
  onFocusOutside?: Popover.PopoverContentProps["onFocusOutside"];
12
12
  onPointerDownOutside?: Popover.PopoverContentProps["onPointerDownOutside"];
13
+ preventAutoFocusOnTouch?: boolean;
13
14
  }
14
15
  export declare const PropertiesPopover: React.ForwardRefExoticComponent<PropertiesPopoverProps & React.RefAttributes<HTMLDivElement>>;
15
16
  export {};
@@ -1,16 +1,13 @@
1
- import "./ButtonIcon.scss";
2
1
  import type { JSX } from "react";
3
- interface ButtonIconProps {
2
+ interface RadioButtonProps {
4
3
  icon: JSX.Element;
5
4
  title: string;
6
5
  className?: string;
7
6
  testId?: string;
8
7
  /** if not supplied, defaults to value identity check */
9
8
  active?: boolean;
10
- /** include standalone style (could interfere with parent styles) */
11
- standalone?: boolean;
12
9
  onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
13
10
  style?: React.CSSProperties;
14
11
  }
15
- export declare const ButtonIcon: import("react").ForwardRefExoticComponent<ButtonIconProps & import("react").RefAttributes<HTMLButtonElement>>;
12
+ export declare const RadioButton: import("react").ForwardRefExoticComponent<RadioButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
16
13
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./RadioGroup.scss";
3
2
  export type RadioGroupChoice<T> = {
4
3
  value: T;
@@ -4,14 +4,14 @@ export declare const RadioSelection: <T extends Object>(props: {
4
4
  value: T;
5
5
  text: string;
6
6
  icon: JSX.Element;
7
- testId?: string | undefined;
7
+ testId?: string;
8
8
  /** if not supplied, defaults to value identity check */
9
- active?: boolean | undefined;
9
+ active?: boolean;
10
10
  }[];
11
11
  value: T | null;
12
- type?: "button" | "radio" | undefined;
12
+ type?: "radio" | "button";
13
13
  } & ({
14
- type?: "radio" | undefined;
14
+ type?: "radio";
15
15
  group: string;
16
16
  onChange: (value: T) => void;
17
17
  } | {