@excalidraw/math 0.18.0-7f66e1f → 0.18.0-816c81c

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 (246) hide show
  1. package/dist/dev/index.js +3 -3
  2. package/dist/dev/index.js.map +2 -2
  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 +59 -39
  8. package/dist/types/common/src/constants.d.ts +19 -11
  9. package/dist/types/common/src/editorInterface.d.ts +1 -1
  10. package/dist/types/common/src/font-metadata.d.ts +1 -3
  11. package/dist/types/common/src/index.d.ts +4 -1
  12. package/dist/types/common/src/keys.d.ts +1 -1
  13. package/dist/types/common/src/utility-types.d.ts +0 -1
  14. package/dist/types/common/src/utils.d.ts +51 -40
  15. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  16. package/dist/types/element/src/Scene.d.ts +5 -3
  17. package/dist/types/element/src/arrowheads.d.ts +3 -0
  18. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  19. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  20. package/dist/types/element/src/binding.d.ts +67 -48
  21. package/dist/types/element/src/bounds.d.ts +3 -11
  22. package/dist/types/element/src/collision.d.ts +7 -2
  23. package/dist/types/element/src/comparisons.d.ts +7 -7
  24. package/dist/types/element/src/distribute.d.ts +2 -1
  25. package/dist/types/element/src/dragElements.d.ts +3 -3
  26. package/dist/types/element/src/duplicate.d.ts +3 -3
  27. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  28. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  29. package/dist/types/element/src/frame.d.ts +5 -1
  30. package/dist/types/element/src/heading.d.ts +2 -1
  31. package/dist/types/element/src/image.d.ts +1 -11
  32. package/dist/types/element/src/index.d.ts +4 -3
  33. package/dist/types/element/src/linearElementEditor.d.ts +21 -20
  34. package/dist/types/element/src/mutateElement.d.ts +5 -1
  35. package/dist/types/element/src/newElement.d.ts +6 -6
  36. package/dist/types/element/src/renderElement.d.ts +1 -7
  37. package/dist/types/element/src/resizeElements.d.ts +10 -10
  38. package/dist/types/element/src/resizeTest.d.ts +1 -1
  39. package/dist/types/element/src/selection.d.ts +3 -7
  40. package/dist/types/element/src/shape.d.ts +8 -7
  41. package/dist/types/element/src/textMeasurements.d.ts +1 -3
  42. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
  43. package/dist/types/element/src/transformHandles.d.ts +3 -23
  44. package/dist/types/element/src/typeChecks.d.ts +4 -7
  45. package/dist/types/element/src/types.d.ts +12 -13
  46. package/dist/types/element/src/utils.d.ts +8 -3
  47. package/dist/types/element/src/zindex.d.ts +7 -1
  48. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +149 -201
  49. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -7
  50. package/dist/types/excalidraw/actions/actionBoundText.d.ts +77 -112
  51. package/dist/types/excalidraw/actions/actionCanvas.d.ts +460 -857
  52. package/dist/types/excalidraw/actions/actionClipboard.d.ts +111 -903
  53. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +37 -55
  54. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +123 -179
  55. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  56. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -3
  57. package/dist/types/excalidraw/actions/actionElementLink.d.ts +47 -71
  58. package/dist/types/excalidraw/actions/actionElementLock.d.ts +76 -111
  59. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +53 -71
  60. package/dist/types/excalidraw/actions/actionExport.d.ts +157 -1425
  61. package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -402
  62. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
  63. package/dist/types/excalidraw/actions/actionFrame.d.ts +233 -340
  64. package/dist/types/excalidraw/actions/actionGroup.d.ts +80 -123
  65. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +129 -185
  66. package/dist/types/excalidraw/actions/actionLink.d.ts +55 -73
  67. package/dist/types/excalidraw/actions/actionMenu.d.ts +41 -65
  68. package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -367
  69. package/dist/types/excalidraw/actions/actionProperties.d.ts +137 -2563
  70. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +40 -62
  71. package/dist/types/excalidraw/actions/actionStyles.d.ts +36 -54
  72. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  73. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +172 -0
  74. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +53 -71
  75. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +172 -0
  76. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +53 -71
  77. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +41 -65
  78. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  79. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +52 -70
  80. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +53 -71
  81. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +53 -71
  82. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
  83. package/dist/types/excalidraw/actions/index.d.ts +2 -0
  84. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  85. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  86. package/dist/types/excalidraw/actions/types.d.ts +4 -4
  87. package/dist/types/excalidraw/appState.d.ts +23 -20
  88. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  89. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  90. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  91. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  92. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  93. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  94. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  95. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  96. package/dist/types/excalidraw/clipboard.d.ts +13 -38
  97. package/dist/types/excalidraw/components/Actions.d.ts +1 -1
  98. package/dist/types/excalidraw/components/App.d.ts +83 -56
  99. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  100. package/dist/types/excalidraw/components/Card.d.ts +1 -3
  101. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  102. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
  103. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -1
  104. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  105. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
  106. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
  107. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  108. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  109. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  110. package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
  111. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  112. package/dist/types/excalidraw/components/EyeDropper.d.ts +0 -1
  113. package/dist/types/excalidraw/components/FilledButton.d.ts +1 -0
  114. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  115. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  116. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  117. package/dist/types/excalidraw/components/InlineIcon.d.ts +2 -2
  118. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  119. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  120. package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
  121. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  122. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -1
  123. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  124. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  125. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  126. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  127. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  128. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  129. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  130. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +15 -21
  131. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  132. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  133. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  134. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  135. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  136. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  137. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  138. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  139. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +0 -1
  140. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  141. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  142. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  143. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  144. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  145. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  146. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  147. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  148. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  149. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  150. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  151. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
  152. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  153. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  154. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  155. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  156. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  157. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  158. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  159. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  160. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  161. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
  162. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  163. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  164. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  165. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  166. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  167. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  168. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  169. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  170. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  171. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  172. package/dist/types/excalidraw/components/Toast.d.ts +11 -7
  173. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  174. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +48 -38
  175. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -6
  176. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  177. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
  178. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  179. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
  180. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +0 -1
  181. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  182. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  183. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  184. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  185. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  186. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  187. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
  188. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  189. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  190. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -1
  191. package/dist/types/excalidraw/components/icons.d.ts +39 -21
  192. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +19 -2
  193. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -32
  194. package/dist/types/excalidraw/components/shapes.d.ts +74 -1
  195. package/dist/types/excalidraw/data/blob.d.ts +326 -7
  196. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  197. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  198. package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
  199. package/dist/types/excalidraw/data/index.d.ts +4 -5
  200. package/dist/types/excalidraw/data/json.d.ts +170 -4
  201. package/dist/types/excalidraw/data/library.d.ts +24 -9
  202. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  203. package/dist/types/excalidraw/data/restore.d.ts +25 -10
  204. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  205. package/dist/types/excalidraw/errors.d.ts +14 -0
  206. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +1 -2
  207. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  208. package/dist/types/excalidraw/i18n.d.ts +2 -2
  209. package/dist/types/excalidraw/renderer/helpers.d.ts +6 -8
  210. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +8 -6
  211. package/dist/types/excalidraw/scene/Renderer.d.ts +5 -2
  212. package/dist/types/excalidraw/scene/export.d.ts +2 -2
  213. package/dist/types/excalidraw/scene/scroll.d.ts +1 -6
  214. package/dist/types/excalidraw/scene/types.d.ts +11 -2
  215. package/dist/types/excalidraw/snapping.d.ts +5 -5
  216. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  217. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  218. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  219. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  220. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  221. package/dist/types/excalidraw/types.d.ts +105 -20
  222. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -2
  223. package/dist/types/math/src/point.d.ts +6 -1
  224. package/dist/types/math/src/polygon.d.ts +2 -2
  225. package/dist/types/math/src/range.d.ts +1 -3
  226. package/dist/types/math/src/segment.d.ts +3 -3
  227. package/dist/types/math/src/types.d.ts +25 -1
  228. package/dist/types/utils/src/bbox.d.ts +1 -1
  229. package/dist/types/utils/src/export.d.ts +5 -5
  230. package/dist/types/utils/src/shape.d.ts +6 -6
  231. package/dist/types/utils/src/withinBounds.d.ts +2 -2
  232. package/package.json +2 -2
  233. package/dist/types/common/src/visualdebug.d.ts +0 -41
  234. package/dist/types/excalidraw/charts.d.ts +0 -27
  235. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  236. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
  237. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  238. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  239. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  240. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -22
  241. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  242. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  243. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
  244. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  245. package/dist/types/excalidraw/index.d.ts +0 -46
  246. package/dist/types/excalidraw/polyfill.d.ts +0 -2
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
2
+ import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
3
3
  import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
4
  import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
5
5
  import type { Mutable } from "@excalidraw/common/utility-types";
@@ -10,17 +10,34 @@ import { Fonts } from "../fonts";
10
10
  import { type WritableAtom } from "../editor-jotai";
11
11
  import { Renderer } from "../scene/Renderer";
12
12
  import { LaserTrails } from "../laser-trails";
13
+ import { isOverScrollBars } from "../scene/scrollbars";
13
14
  import { LassoTrail } from "../lasso";
14
15
  import { EraserTrail } from "../eraser";
16
+ import { type OnStateChange } from "./AppStateObserver";
15
17
  import type { ExportedElements } from "../data";
16
- import type { FileSystemHandle } from "../data/filesystem";
17
- import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
18
+ import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
18
19
  import type { RoughCanvas } from "roughjs/bin/canvas";
19
20
  import type { ActionResult } from "../actions/types";
21
+ declare const editorLifecycleEventBehavior: {
22
+ readonly "editor:mount": {
23
+ readonly cardinality: "once";
24
+ readonly replay: "last";
25
+ };
26
+ readonly "editor:initialize": {
27
+ readonly cardinality: "once";
28
+ readonly replay: "last";
29
+ };
30
+ readonly "editor:unmount": {
31
+ readonly cardinality: "once";
32
+ readonly replay: "last";
33
+ };
34
+ };
20
35
  export declare const ExcalidrawContainerContext: React.Context<{
21
36
  container: HTMLDivElement | null;
22
37
  id: string | null;
23
38
  }>;
39
+ export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
40
+ export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
24
41
  export declare const useApp: () => AppClassProperties;
25
42
  export declare const useAppProps: () => AppProps;
26
43
  export declare const useEditorInterface: () => Readonly<{
@@ -28,7 +45,7 @@ export declare const useEditorInterface: () => Readonly<{
28
45
  desktopUIMode: "compact" | "full";
29
46
  userAgent: Readonly<{
30
47
  isMobileDevice: boolean;
31
- platform: "other" | "ios" | "android" | "unknown";
48
+ platform: "ios" | "android" | "other" | "unknown";
32
49
  }>;
33
50
  isTouchScreen: boolean;
34
51
  canFitSidebar: boolean;
@@ -43,9 +60,14 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
43
60
  export declare const useExcalidrawAppState: () => AppState;
44
61
  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;
45
62
  export declare const useExcalidrawActionManager: () => ActionManager;
63
+ /**
64
+ * Requires wrapping your component in <ExcalidrawAPIContext.Provider>
65
+ */
66
+ export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
46
67
  declare class App extends React.Component<AppProps, AppState> {
47
68
  canvas: AppClassProperties["canvas"];
48
69
  interactiveCanvas: AppClassProperties["interactiveCanvas"];
70
+ sessionExportThemeOverride: AppState["theme"] | undefined;
49
71
  rc: RoughCanvas;
50
72
  unmounted: boolean;
51
73
  actionManager: ActionManager;
@@ -57,7 +79,6 @@ declare class App extends React.Component<AppProps, AppState> {
57
79
  renderer: Renderer;
58
80
  visibleElements: readonly NonDeletedExcalidrawElement[];
59
81
  private resizeObserver;
60
- private nearestScrollableContainer;
61
82
  library: AppClassProperties["library"];
62
83
  libraryItemsFromStorage: LibraryItems | undefined;
63
84
  id: string;
@@ -80,18 +101,29 @@ declare class App extends React.Component<AppProps, AppState> {
80
101
  /** embeds that have been inserted to DOM (as a perf optim, we don't want to
81
102
  * insert to DOM before user initially scrolls to them) */
82
103
  private initializedEmbeds;
83
- private handleToastClose;
84
104
  private elementsPendingErasure;
105
+ private _initialized;
106
+ private readonly editorLifecycleEvents;
107
+ onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
108
+ private appStateObserver;
109
+ onStateChange: OnStateChange;
85
110
  flowChartCreator: FlowChartCreator;
86
111
  private flowChartNavigator;
112
+ bindModeHandler: ReturnType<typeof setTimeout> | null;
87
113
  hitLinkElement?: NonDeletedExcalidrawElement;
88
114
  lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
89
115
  lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
90
116
  lastPointerMoveEvent: PointerEvent | null;
117
+ /** current frame pointer cords */
91
118
  lastPointerMoveCoords: {
92
119
  x: number;
93
120
  y: number;
94
121
  } | null;
122
+ /** previous frame pointer coords */
123
+ previousPointerMoveCoords: {
124
+ x: number;
125
+ y: number;
126
+ } | null;
95
127
  lastViewportPosition: {
96
128
  x: number;
97
129
  y: number;
@@ -114,11 +146,7 @@ declare class App extends React.Component<AppProps, AppState> {
114
146
  x: number;
115
147
  y: number;
116
148
  }>;
117
- scrollbars: {
118
- isOverEither: boolean;
119
- isOverHorizontal: boolean;
120
- isOverVertical: boolean;
121
- };
149
+ scrollbars: ReturnType<typeof isOverScrollBars>;
122
150
  lastCoords: {
123
151
  x: number;
124
152
  y: number;
@@ -131,7 +159,7 @@ declare class App extends React.Component<AppProps, AppState> {
131
159
  x: number;
132
160
  y: number;
133
161
  };
134
- arrowDirection: "end" | "origin";
162
+ arrowDirection: "origin" | "end";
135
163
  center: {
136
164
  x: number;
137
165
  y: number;
@@ -158,14 +186,10 @@ declare class App extends React.Component<AppProps, AppState> {
158
186
  blockDragging: boolean;
159
187
  };
160
188
  eventListeners: {
161
- onMove: {
162
- (...args: any[]): void;
163
- flush(): void;
164
- cancel(): void;
165
- } | null;
166
- onUp: ((event: PointerEvent) => void) | null;
167
- onKeyDown: ((event: KeyboardEvent) => void) | null;
168
- onKeyUp: ((event: KeyboardEvent) => void) | null;
189
+ onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
190
+ onUp: null | ((event: PointerEvent) => void);
191
+ onKeyDown: null | ((event: KeyboardEvent) => void);
192
+ onKeyUp: null | ((event: KeyboardEvent) => void);
169
193
  };
170
194
  boxSelection: {
171
195
  hasOccurred: boolean;
@@ -184,11 +208,7 @@ declare class App extends React.Component<AppProps, AppState> {
184
208
  x: number;
185
209
  y: number;
186
210
  }>;
187
- scrollbars: {
188
- isOverEither: boolean;
189
- isOverHorizontal: boolean;
190
- isOverVertical: boolean;
191
- };
211
+ scrollbars: ReturnType<typeof isOverScrollBars>;
192
212
  lastCoords: {
193
213
  x: number;
194
214
  y: number;
@@ -201,7 +221,7 @@ declare class App extends React.Component<AppProps, AppState> {
201
221
  x: number;
202
222
  y: number;
203
223
  };
204
- arrowDirection: "end" | "origin";
224
+ arrowDirection: "origin" | "end";
205
225
  center: {
206
226
  x: number;
207
227
  y: number;
@@ -228,14 +248,10 @@ declare class App extends React.Component<AppProps, AppState> {
228
248
  blockDragging: boolean;
229
249
  };
230
250
  eventListeners: {
231
- onMove: {
232
- (...args: any[]): void;
233
- flush(): void;
234
- cancel(): void;
235
- } | null;
236
- onUp: ((event: PointerEvent) => void) | null;
237
- onKeyDown: ((event: KeyboardEvent) => void) | null;
238
- onKeyUp: ((event: KeyboardEvent) => void) | null;
251
+ onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
252
+ onUp: null | ((event: PointerEvent) => void);
253
+ onKeyDown: null | ((event: KeyboardEvent) => void);
254
+ onKeyUp: null | ((event: KeyboardEvent) => void);
239
255
  };
240
256
  boxSelection: {
241
257
  hasOccurred: boolean;
@@ -247,9 +263,15 @@ declare class App extends React.Component<AppProps, AppState> {
247
263
  }>]>;
248
264
  missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
249
265
  onRemoveEventListenersEmitter: Emitter<[]>;
266
+ api: ExcalidrawImperativeAPI;
267
+ private createExcalidrawAPI;
250
268
  constructor(props: AppProps);
251
269
  updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
252
270
  private onWindowMessage;
271
+ private handleSkipBindMode;
272
+ private resetDelayedBindMode;
273
+ private previousHoveredBindableElement;
274
+ private handleDelayedBindModeChange;
253
275
  private cacheEmbeddableRef;
254
276
  /**
255
277
  * Returns gridSize taking into account `gridModeEnabled`.
@@ -257,7 +279,9 @@ declare class App extends React.Component<AppProps, AppState> {
257
279
  */
258
280
  getEffectiveGridSize: () => NullableGridSize;
259
281
  private getHTMLIFrameElement;
260
- private handleEmbeddableCenterClick;
282
+ private handleIframeLikeElementHover;
283
+ /** @returns true if iframe-like element click handled */
284
+ private handleIframeLikeCenterClick;
261
285
  private isIframeLikeElementCenter;
262
286
  private updateEmbedValidationStatus;
263
287
  private updateEmbeddables;
@@ -270,7 +294,7 @@ declare class App extends React.Component<AppProps, AppState> {
270
294
  render(): import("react/jsx-runtime").JSX.Element;
271
295
  focusContainer: AppClassProperties["focusContainer"];
272
296
  getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
273
- getSceneElementsMapIncludingDeleted: () => Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
297
+ getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
274
298
  getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
275
299
  onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
276
300
  onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
@@ -339,20 +363,27 @@ declare class App extends React.Component<AppProps, AppState> {
339
363
  setAppState: React.Component<any, AppState>["setState"];
340
364
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
341
365
  toggleLock: (source?: "keyboard" | "ui") => void;
342
- updateFrameRendering: (opts: Partial<{
343
- enabled: boolean;
344
- name: boolean;
345
- outline: boolean;
346
- clip: boolean;
347
- }> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
366
+ updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
348
367
  togglePenMode: (force: boolean | null) => void;
349
368
  onHandToolToggle: () => void;
350
369
  /**
351
370
  * Zooms on canvas viewport center
352
371
  */
353
- zoomCanvas: (value: number) => void;
372
+ zoomCanvas: (
373
+ /**
374
+ * Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.
375
+ * 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom
376
+ */
377
+ value: number) => void;
354
378
  private cancelInProgressAnimation;
355
- scrollToContent: (target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
379
+ scrollToContent: (
380
+ /**
381
+ * target to scroll to
382
+ *
383
+ * - string - id of element or group, or url containing elementLink
384
+ * - ExcalidrawElement | ExcalidrawElement[] - element(s) objects
385
+ */
386
+ target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
356
387
  fitToContent?: boolean;
357
388
  fitToViewport?: never;
358
389
  viewportZoomFactor?: number;
@@ -375,11 +406,7 @@ declare class App extends React.Component<AppProps, AppState> {
375
406
  private maybeUnfollowRemoteUser;
376
407
  /** use when changing scrollX/scrollY/zoom based on user interaction */
377
408
  private translateCanvas;
378
- setToast: (toast: {
379
- message: string;
380
- closable?: boolean;
381
- duration?: number;
382
- } | null) => void;
409
+ setToast: (toast: AppState["toast"]) => void;
383
410
  restoreFileFromShare: () => Promise<void>;
384
411
  /**
385
412
  * adds supplied files to existing files in the appState.
@@ -389,7 +416,7 @@ declare class App extends React.Component<AppProps, AppState> {
389
416
  private addMissingFiles;
390
417
  updateScene: <K extends keyof AppState>(sceneData: {
391
418
  elements?: SceneData["elements"];
392
- appState?: Pick<AppState, K> | null | undefined;
419
+ appState?: Pick<AppState, K> | null;
393
420
  collaborators?: SceneData["collaborators"];
394
421
  /**
395
422
  * 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.
@@ -412,8 +439,8 @@ declare class App extends React.Component<AppProps, AppState> {
412
439
  */
413
440
  toggleSidebar: ({ name, tab, force, }: {
414
441
  name: SidebarName | null;
415
- tab?: string | undefined;
416
- force?: boolean | undefined;
442
+ tab?: SidebarTabName;
443
+ force?: boolean;
417
444
  }) => boolean;
418
445
  private updateCurrentCursorPosition;
419
446
  getEditorUIOffsets: () => Offsets;
@@ -456,7 +483,7 @@ declare class App extends React.Component<AppProps, AppState> {
456
483
  private finishImageCropping;
457
484
  private handleCanvasDoubleClick;
458
485
  private getElementLinkAtPosition;
459
- private redirectToLink;
486
+ private handleElementLinkClick;
460
487
  private getTopLayerFrameAtSceneCoords;
461
488
  private handleCanvasPointerMove;
462
489
  private handleEraser;
@@ -527,13 +554,11 @@ declare class App extends React.Component<AppProps, AppState> {
527
554
  /** generally you should use `addNewImagesToImageCache()` directly if you need
528
555
  * to render new images. This is just a failsafe */
529
556
  private scheduleImageRefresh;
530
- private updateBindingEnabledOnPointerMove;
531
- private maybeSuggestBindingAtCursor;
532
557
  private clearSelection;
533
558
  private handleInteractiveCanvasRef;
534
559
  private insertImages;
535
560
  private handleAppOnDrop;
536
- loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
561
+ loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
537
562
  private handleCanvasContextMenu;
538
563
  private maybeDragNewGenericElement;
539
564
  private maybeHandleCrop;
@@ -546,6 +571,7 @@ declare class App extends React.Component<AppProps, AppState> {
546
571
  private updateDOMRect;
547
572
  refresh: () => void;
548
573
  private getCanvasOffsets;
574
+ watchState: () => void;
549
575
  private updateLanguage;
550
576
  }
551
577
  declare global {
@@ -555,6 +581,7 @@ declare global {
555
581
  elements: readonly ExcalidrawElement[];
556
582
  state: AppState;
557
583
  setState: React.Component<any, AppState>["setState"];
584
+ watchState: (prev: any, next: any) => void | undefined;
558
585
  app: InstanceType<typeof App>;
559
586
  history: History;
560
587
  store: Store;
@@ -0,0 +1,37 @@
1
+ import type { AppState, UnsubscribeCallback } from "../types";
2
+ type StateChangeSelector = keyof AppState | (keyof AppState)[] | ((appState: AppState) => unknown);
3
+ export type OnStateChange = {
4
+ <K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void, opts?: {
5
+ once: boolean;
6
+ }): UnsubscribeCallback;
7
+ <K extends keyof AppState>(prop: K): Promise<AppState[K]>;
8
+ (prop: (keyof AppState)[], callback: (appState: AppState, appState2: AppState) => void, opts?: {
9
+ once: boolean;
10
+ }): UnsubscribeCallback;
11
+ (prop: (keyof AppState)[]): Promise<AppState>;
12
+ <T>(prop: (appState: AppState) => T, callback: (value: T, appState: AppState) => void, opts?: {
13
+ once: boolean;
14
+ }): UnsubscribeCallback;
15
+ <T>(prop: (appState: AppState) => T): Promise<T>;
16
+ (opts: {
17
+ predicate: (appState: AppState) => boolean;
18
+ callback: (appState: AppState) => void;
19
+ once?: boolean;
20
+ }): UnsubscribeCallback;
21
+ (opts: {
22
+ predicate: (appState: AppState) => boolean;
23
+ }): Promise<AppState>;
24
+ (selector: StateChangeSelector, callback: (value: any, appState: AppState) => void): any;
25
+ };
26
+ export declare class AppStateObserver {
27
+ private readonly getState;
28
+ private listeners;
29
+ constructor(getState: () => AppState);
30
+ private isStateChangePredicateOptions;
31
+ private subscribe;
32
+ private normalize;
33
+ onStateChange: OnStateChange;
34
+ flush(prevState: AppState): void;
35
+ clear(): void;
36
+ }
37
+ export {};
@@ -1,7 +1,5 @@
1
- /// <reference types="react" />
2
- import OpenColor from "open-color";
3
1
  import "./Card.scss";
4
2
  export declare const Card: React.FC<{
5
- color: keyof OpenColor | "primary";
3
+ color: "primary" | "lime" | "pink";
6
4
  children?: React.ReactNode;
7
5
  }>;
@@ -1,10 +1,8 @@
1
1
  import type { ColorPickerType } from "./colorPickerUtils";
2
- interface ColorInputProps {
2
+ export declare const ColorInput: ({ color, onChange, label, colorPickerType, placeholder, }: {
3
3
  color: string;
4
4
  onChange: (color: string) => void;
5
5
  label: string;
6
6
  colorPickerType: ColorPickerType;
7
7
  placeholder?: string;
8
- }
9
- export declare const ColorInput: ({ color, onChange, label, colorPickerType, placeholder, }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
10
- export {};
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,6 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
3
3
  import "./ColorPicker.scss";
4
4
  import type { ColorPickerType } from "./colorPickerUtils";
5
5
  import type { AppState } from "../../types";
6
- export declare const getColor: (color: string) => string | null;
7
6
  interface ColorPickerProps {
8
7
  type: ColorPickerType;
9
8
  /**
@@ -17,5 +17,4 @@ export type ActiveColorPickerSectionAtomType = "custom" | "baseColors" | "shades
17
17
  export declare const activeColorPickerSectionAtom: import("jotai/vanilla/atom").PrimitiveAtom<ActiveColorPickerSectionAtomType> & {
18
18
  init: ActiveColorPickerSectionAtomType;
19
19
  };
20
- export declare const isColorDark: (color: string, threshold?: number) => boolean;
21
20
  export type ColorPickerType = "canvasBackground" | "elementBackground" | "elementStroke";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ColorPaletteCustom } from "@excalidraw/common";
3
2
  import type { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
4
3
  interface ColorPickerKeyNavHandlerProps {
@@ -1,7 +1,5 @@
1
- /// <reference types="react" />
2
1
  import type { ActionManager } from "../../actions/manager";
3
2
  import type { Action } from "../../actions/types";
4
- import type { UIAppState } from "../../types";
5
3
  export type CommandPaletteItem = {
6
4
  label: string;
7
5
  /** additional keywords to match against
@@ -12,11 +10,11 @@ export type CommandPaletteItem = {
12
10
  * (deburred name + keywords)
13
11
  */
14
12
  haystack?: string;
15
- icon?: React.ReactNode | ((appState: UIAppState) => React.ReactNode);
13
+ icon?: Action["icon"];
16
14
  category: string;
17
15
  order?: number;
18
16
  predicate?: boolean | Action["predicate"];
19
- shortcut?: string;
17
+ shortcut?: string | null;
20
18
  /** if false, command will not show while in view mode */
21
19
  viewMode?: boolean;
22
20
  perform: (data: {
@@ -16,8 +16,8 @@ export declare const adjustBoundTextSize: (container: ExcalidrawTextContainer, b
16
16
  type ConversionType = "generic" | "linear" | null;
17
17
  export declare const convertElementTypes: (app: App, { conversionType, nextType, direction, }: {
18
18
  conversionType: ConversionType;
19
- nextType?: ConvertibleTypes | undefined;
20
- direction?: "left" | "right" | undefined;
19
+ nextType?: ConvertibleTypes;
20
+ direction?: "left" | "right";
21
21
  }) => boolean;
22
22
  export declare const getConversionTypeFromElements: (elements: ExcalidrawElement[]) => ConversionType;
23
23
  export default ConvertElementTypePopup;
@@ -3,5 +3,5 @@ import "./ToolIcon.scss";
3
3
  export declare const DarkModeToggle: (props: {
4
4
  value: Theme;
5
5
  onChange: (value: Theme) => void;
6
- title?: string | undefined;
6
+ title?: string;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,26 +1,22 @@
1
- /// <reference types="react" />
2
1
  import type { MarkOptional } from "@excalidraw/common/utility-types";
3
2
  import "../components/dropdownMenu/DropdownMenu.scss";
4
3
  import type { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
5
4
  export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
6
- name: string;
7
- children: import("react").ReactNode;
8
- onStateChange?: ((state: {
9
- name: string;
10
- tab?: string | undefined;
11
- } | null) => void) | undefined;
12
- onDock?: ((docked: boolean) => void) | undefined;
13
- docked?: boolean | undefined;
14
- className?: string | undefined;
15
- __fallback?: boolean | undefined;
5
+ name: import("../types").SidebarName;
6
+ children: React.ReactNode;
7
+ onStateChange?: (state: import("../types").AppState["openSidebar"]) => void;
8
+ onDock?: (docked: boolean) => void;
9
+ docked?: boolean;
10
+ className?: string;
11
+ __fallback?: boolean;
16
12
  }, "name">, "children">, "onDock"> & {
17
13
  /** pass `false` to disable docking */
18
14
  onDock?: SidebarProps["onDock"] | false;
19
15
  } & {
20
- __fallback?: boolean | undefined;
16
+ __fallback?: boolean;
21
17
  }> & {
22
18
  Trigger: import("react").FC<Omit<SidebarTriggerProps, "name"> & import("react").HTMLAttributes<HTMLDivElement> & {
23
- __fallback?: boolean | undefined;
19
+ __fallback?: boolean;
24
20
  }>;
25
21
  TabTriggers: {
26
22
  ({ children }: {
@@ -6,7 +6,7 @@ declare const ElementLinkDialog: ({ sourceElementId, onClose, appState, scene, g
6
6
  sourceElementId: ExcalidrawElement["id"];
7
7
  appState: UIAppState;
8
8
  scene: Scene;
9
- onClose?: (() => void) | undefined;
9
+ onClose?: () => void;
10
10
  generateLinkForSelection: AppProps["generateLinkForSelection"];
11
11
  }) => import("react/jsx-runtime").JSX.Element;
12
12
  export default ElementLinkDialog;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Ellipsify: ({ children, ...rest }: {
3
2
  children: React.ReactNode;
4
- } & import("react").HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
3
+ } & React.HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  export declare const ErrorDialog: ({ children, onClose, }: {
3
3
  children?: React.ReactNode;
4
- onClose?: (() => void) | undefined;
4
+ onClose?: () => void;
5
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
2
  import "./EyeDropper.scss";
4
3
  import type { ColorPickerType } from "./ColorPicker/colorPickerUtils";
@@ -14,5 +14,6 @@ export type FilledButtonProps = {
14
14
  className?: string;
15
15
  fullWidth?: boolean;
16
16
  icon?: React.ReactNode;
17
+ disabled?: boolean;
17
18
  };
18
19
  export declare const FilledButton: React.ForwardRefExoticComponent<FilledButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Node } from "@excalidraw/common";
3
2
  import { type FontDescriptor } from "./FontPickerList";
4
3
  interface FontPickerKeyNavHandlerProps {
@@ -1,4 +1,4 @@
1
1
  import "./HelpDialog.scss";
2
2
  export declare const HelpDialog: ({ onClose }: {
3
- onClose?: (() => void) | undefined;
3
+ onClose?: () => void;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -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,5 +1,5 @@
1
1
  export declare const InlineIcon: ({ className, icon, size, }: {
2
- className?: string | undefined;
2
+ className?: string;
3
3
  icon: React.ReactNode;
4
- size?: string | undefined;
4
+ size?: string;
5
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -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;
@@ -1,11 +1,10 @@
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
4
  export declare const LibraryUnit: import("react").MemoExoticComponent<({ id, 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
+ elements?: LibraryItem["elements"];
7
+ isPending?: boolean;
9
8
  onClick: (id: LibraryItem["id"] | null) => void;
10
9
  selected: boolean;
11
10
  onToggle: (id: string, event: React.MouseEvent) => void;
@@ -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,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  import "./MobileToolBar.scss";
4
3
  import type { AppClassProperties, UIAppState } from "../types";
@@ -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;