@excalidraw/element 0.18.0-d1f3982 → 0.18.0-d9e8a33

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 (255) hide show
  1. package/dist/dev/index.js +5200 -2663
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +19 -18
  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 -0
  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 +7 -13
  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 +6 -2
  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 +23 -22
  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 +10 -10
  40. package/dist/types/element/src/shape.d.ts +9 -8
  41. package/dist/types/element/src/textElement.d.ts +1 -1
  42. package/dist/types/element/src/textMeasurements.d.ts +1 -3
  43. package/dist/types/element/src/textWrapping.d.ts +26 -0
  44. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
  45. package/dist/types/element/src/transformHandles.d.ts +3 -23
  46. package/dist/types/element/src/typeChecks.d.ts +4 -7
  47. package/dist/types/element/src/types.d.ts +12 -13
  48. package/dist/types/element/src/utils.d.ts +9 -4
  49. package/dist/types/element/src/visualdebug.d.ts +59 -0
  50. package/dist/types/element/src/zindex.d.ts +7 -1
  51. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +113 -162
  52. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -7
  53. package/dist/types/excalidraw/actions/actionBoundText.d.ts +82 -115
  54. package/dist/types/excalidraw/actions/actionCanvas.d.ts +484 -869
  55. package/dist/types/excalidraw/actions/actionClipboard.d.ts +100 -890
  56. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +39 -56
  57. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +132 -185
  58. package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
  59. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  60. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -2
  61. package/dist/types/excalidraw/actions/actionElementLink.d.ts +31 -54
  62. package/dist/types/excalidraw/actions/actionElementLock.d.ts +80 -113
  63. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +40 -57
  64. package/dist/types/excalidraw/actions/actionExport.d.ts +161 -1427
  65. package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -402
  66. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
  67. package/dist/types/excalidraw/actions/actionFrame.d.ts +255 -358
  68. package/dist/types/excalidraw/actions/actionGroup.d.ts +85 -126
  69. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +148 -203
  70. package/dist/types/excalidraw/actions/actionLink.d.ts +39 -56
  71. package/dist/types/excalidraw/actions/actionMenu.d.ts +29 -52
  72. package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -367
  73. package/dist/types/excalidraw/actions/actionProperties.d.ts +142 -2566
  74. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +42 -63
  75. package/dist/types/excalidraw/actions/actionStyles.d.ts +39 -55
  76. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  77. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +173 -0
  78. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +39 -56
  79. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +173 -0
  80. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +39 -56
  81. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +28 -51
  82. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  83. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +39 -56
  84. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +39 -56
  85. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +40 -57
  86. package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -3
  87. package/dist/types/excalidraw/actions/index.d.ts +3 -0
  88. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  89. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  90. package/dist/types/excalidraw/actions/types.d.ts +4 -4
  91. package/dist/types/excalidraw/appState.d.ts +17 -13
  92. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  93. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  94. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  95. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  96. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  97. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  98. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  99. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  100. package/dist/types/excalidraw/clipboard.d.ts +13 -38
  101. package/dist/types/excalidraw/components/Actions.d.ts +5 -2
  102. package/dist/types/excalidraw/components/App.d.ts +93 -56
  103. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  104. package/dist/types/excalidraw/components/Card.d.ts +1 -3
  105. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  106. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
  107. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -1
  108. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  109. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
  110. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
  111. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  112. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  113. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  114. package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
  115. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  116. package/dist/types/excalidraw/components/EyeDropper.d.ts +0 -1
  117. package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
  118. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  119. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  120. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  121. package/dist/types/excalidraw/components/InlineIcon.d.ts +2 -2
  122. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  123. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  124. package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
  125. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  126. package/dist/types/excalidraw/components/MobileMenu.d.ts +1 -1
  127. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -1
  128. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  129. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  130. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  131. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  132. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  133. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  134. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  135. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  136. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +15 -21
  137. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  138. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  139. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  140. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  141. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  142. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  143. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  144. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  145. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +0 -1
  146. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  147. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  148. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  149. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  150. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  151. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  152. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  153. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  154. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  155. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  156. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  157. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
  158. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  159. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  160. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  161. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  162. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  163. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  164. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  165. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  166. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  167. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
  168. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  169. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  170. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  171. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  172. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  173. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  174. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  175. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  176. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  177. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  178. package/dist/types/excalidraw/components/Toast.d.ts +11 -7
  179. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  180. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +5 -2
  181. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +48 -38
  182. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -6
  183. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  184. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
  185. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  186. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
  187. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
  188. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  189. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  190. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  191. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  192. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  193. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  194. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
  195. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  196. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  197. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -1
  198. package/dist/types/excalidraw/components/icons.d.ts +44 -21
  199. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +20 -2
  200. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -32
  201. package/dist/types/excalidraw/components/shapes.d.ts +74 -1
  202. package/dist/types/excalidraw/data/blob.d.ts +328 -7
  203. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  204. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  205. package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
  206. package/dist/types/excalidraw/data/index.d.ts +4 -5
  207. package/dist/types/excalidraw/data/json.d.ts +171 -4
  208. package/dist/types/excalidraw/data/library.d.ts +24 -9
  209. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  210. package/dist/types/excalidraw/data/restore.d.ts +25 -10
  211. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  212. package/dist/types/excalidraw/errors.d.ts +14 -0
  213. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
  214. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  215. package/dist/types/excalidraw/i18n.d.ts +2 -2
  216. package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
  217. package/dist/types/excalidraw/renderer/helpers.d.ts +6 -8
  218. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +8 -14
  219. package/dist/types/excalidraw/scene/Renderer.d.ts +5 -2
  220. package/dist/types/excalidraw/scene/export.d.ts +2 -2
  221. package/dist/types/excalidraw/scene/scroll.d.ts +1 -6
  222. package/dist/types/excalidraw/scene/types.d.ts +19 -2
  223. package/dist/types/excalidraw/snapping.d.ts +5 -5
  224. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  225. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  226. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  227. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  228. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  229. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  230. package/dist/types/excalidraw/types.d.ts +109 -21
  231. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +7 -3
  232. package/dist/types/math/src/curve.d.ts +4 -1
  233. package/dist/types/math/src/point.d.ts +7 -2
  234. package/dist/types/math/src/polygon.d.ts +2 -2
  235. package/dist/types/math/src/range.d.ts +1 -3
  236. package/dist/types/math/src/segment.d.ts +3 -3
  237. package/dist/types/math/src/types.d.ts +25 -1
  238. package/dist/types/utils/src/bbox.d.ts +1 -1
  239. package/dist/types/utils/src/export.d.ts +5 -5
  240. package/dist/types/utils/src/shape.d.ts +6 -6
  241. package/dist/types/utils/src/withinBounds.d.ts +2 -2
  242. package/package.json +9 -3
  243. package/dist/types/excalidraw/charts.d.ts +0 -27
  244. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  245. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
  246. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  247. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  248. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  249. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -22
  250. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  251. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  252. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
  253. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  254. package/dist/types/excalidraw/index.d.ts +0 -46
  255. package/dist/types/excalidraw/polyfill.d.ts +0 -2
@@ -36,9 +36,12 @@ export declare const ZoomActions: ({ renderAction, zoom, }: {
36
36
  }) => import("react/jsx-runtime").JSX.Element;
37
37
  export declare const UndoRedoActions: ({ renderAction, className, }: {
38
38
  renderAction: ActionManager["renderAction"];
39
- className?: string | undefined;
39
+ className?: string;
40
40
  }) => import("react/jsx-runtime").JSX.Element;
41
- export declare const ExitZenModeAction: ({ actionManager, showExitZenModeBtn, }: {
41
+ export declare const ExitZenModeButton: ({ actionManager, showExitZenModeBtn, }: {
42
42
  actionManager: ActionManager;
43
43
  showExitZenModeBtn: boolean;
44
44
  }) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const ExitViewModeButton: ({ actionManager, }: {
46
+ actionManager: ActionManager;
47
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -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,31 @@ 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;
116
+ lastPointerUpIsDoubleClick: boolean;
90
117
  lastPointerMoveEvent: PointerEvent | null;
118
+ /** current frame pointer cords */
91
119
  lastPointerMoveCoords: {
92
120
  x: number;
93
121
  y: number;
94
122
  } | null;
123
+ private lastCompletedCanvasClicks;
124
+ /** previous frame pointer coords */
125
+ previousPointerMoveCoords: {
126
+ x: number;
127
+ y: number;
128
+ } | null;
95
129
  lastViewportPosition: {
96
130
  x: number;
97
131
  y: number;
@@ -114,11 +148,7 @@ declare class App extends React.Component<AppProps, AppState> {
114
148
  x: number;
115
149
  y: number;
116
150
  }>;
117
- scrollbars: {
118
- isOverEither: boolean;
119
- isOverHorizontal: boolean;
120
- isOverVertical: boolean;
121
- };
151
+ scrollbars: ReturnType<typeof isOverScrollBars>;
122
152
  lastCoords: {
123
153
  x: number;
124
154
  y: number;
@@ -131,7 +161,7 @@ declare class App extends React.Component<AppProps, AppState> {
131
161
  x: number;
132
162
  y: number;
133
163
  };
134
- arrowDirection: "end" | "origin";
164
+ arrowDirection: "origin" | "end";
135
165
  center: {
136
166
  x: number;
137
167
  y: number;
@@ -158,14 +188,10 @@ declare class App extends React.Component<AppProps, AppState> {
158
188
  blockDragging: boolean;
159
189
  };
160
190
  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;
191
+ onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
192
+ onUp: null | ((event: PointerEvent) => void);
193
+ onKeyDown: null | ((event: KeyboardEvent) => void);
194
+ onKeyUp: null | ((event: KeyboardEvent) => void);
169
195
  };
170
196
  boxSelection: {
171
197
  hasOccurred: boolean;
@@ -184,11 +210,7 @@ declare class App extends React.Component<AppProps, AppState> {
184
210
  x: number;
185
211
  y: number;
186
212
  }>;
187
- scrollbars: {
188
- isOverEither: boolean;
189
- isOverHorizontal: boolean;
190
- isOverVertical: boolean;
191
- };
213
+ scrollbars: ReturnType<typeof isOverScrollBars>;
192
214
  lastCoords: {
193
215
  x: number;
194
216
  y: number;
@@ -201,7 +223,7 @@ declare class App extends React.Component<AppProps, AppState> {
201
223
  x: number;
202
224
  y: number;
203
225
  };
204
- arrowDirection: "end" | "origin";
226
+ arrowDirection: "origin" | "end";
205
227
  center: {
206
228
  x: number;
207
229
  y: number;
@@ -228,14 +250,10 @@ declare class App extends React.Component<AppProps, AppState> {
228
250
  blockDragging: boolean;
229
251
  };
230
252
  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;
253
+ onMove: null | ReturnType<typeof import("@excalidraw/common").throttleRAF>;
254
+ onUp: null | ((event: PointerEvent) => void);
255
+ onKeyDown: null | ((event: KeyboardEvent) => void);
256
+ onKeyUp: null | ((event: KeyboardEvent) => void);
239
257
  };
240
258
  boxSelection: {
241
259
  hasOccurred: boolean;
@@ -247,17 +265,27 @@ declare class App extends React.Component<AppProps, AppState> {
247
265
  }>]>;
248
266
  missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
249
267
  onRemoveEventListenersEmitter: Emitter<[]>;
268
+ api: ExcalidrawImperativeAPI;
269
+ private createExcalidrawAPI;
250
270
  constructor(props: AppProps);
251
271
  updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
252
272
  private onWindowMessage;
273
+ private handleSkipBindMode;
274
+ private resetDelayedBindMode;
275
+ private previousHoveredBindableElement;
276
+ private handleDelayedBindModeChange;
253
277
  private cacheEmbeddableRef;
254
278
  /**
255
279
  * Returns gridSize taking into account `gridModeEnabled`.
256
280
  * If disabled, returns null.
257
281
  */
258
282
  getEffectiveGridSize: () => NullableGridSize;
283
+ private getTextCreationGridPoint;
259
284
  private getHTMLIFrameElement;
260
- private handleEmbeddableCenterClick;
285
+ private handleIframeLikeElementHover;
286
+ /** @returns true if iframe-like element click handled */
287
+ private handleIframeLikeCenterClick;
288
+ private isDoubleClick;
261
289
  private isIframeLikeElementCenter;
262
290
  private updateEmbedValidationStatus;
263
291
  private updateEmbeddables;
@@ -270,7 +298,7 @@ declare class App extends React.Component<AppProps, AppState> {
270
298
  render(): import("react/jsx-runtime").JSX.Element;
271
299
  focusContainer: AppClassProperties["focusContainer"];
272
300
  getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
273
- getSceneElementsMapIncludingDeleted: () => Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
301
+ getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
274
302
  getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
275
303
  onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
276
304
  onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
@@ -339,20 +367,27 @@ declare class App extends React.Component<AppProps, AppState> {
339
367
  setAppState: React.Component<any, AppState>["setState"];
340
368
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
341
369
  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;
370
+ updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
348
371
  togglePenMode: (force: boolean | null) => void;
349
372
  onHandToolToggle: () => void;
350
373
  /**
351
374
  * Zooms on canvas viewport center
352
375
  */
353
- zoomCanvas: (value: number) => void;
376
+ zoomCanvas: (
377
+ /**
378
+ * Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.
379
+ * 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom
380
+ */
381
+ value: number) => void;
354
382
  private cancelInProgressAnimation;
355
- scrollToContent: (target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
383
+ scrollToContent: (
384
+ /**
385
+ * target to scroll to
386
+ *
387
+ * - string - id of element or group, or url containing elementLink
388
+ * - ExcalidrawElement | ExcalidrawElement[] - element(s) objects
389
+ */
390
+ target?: string | ExcalidrawElement | readonly ExcalidrawElement[], opts?: ({
356
391
  fitToContent?: boolean;
357
392
  fitToViewport?: never;
358
393
  viewportZoomFactor?: number;
@@ -375,11 +410,7 @@ declare class App extends React.Component<AppProps, AppState> {
375
410
  private maybeUnfollowRemoteUser;
376
411
  /** use when changing scrollX/scrollY/zoom based on user interaction */
377
412
  private translateCanvas;
378
- setToast: (toast: {
379
- message: string;
380
- closable?: boolean;
381
- duration?: number;
382
- } | null) => void;
413
+ setToast: (toast: AppState["toast"]) => void;
383
414
  restoreFileFromShare: () => Promise<void>;
384
415
  /**
385
416
  * adds supplied files to existing files in the appState.
@@ -389,7 +420,7 @@ declare class App extends React.Component<AppProps, AppState> {
389
420
  private addMissingFiles;
390
421
  updateScene: <K extends keyof AppState>(sceneData: {
391
422
  elements?: SceneData["elements"];
392
- appState?: Pick<AppState, K> | null | undefined;
423
+ appState?: Pick<AppState, K> | null;
393
424
  collaborators?: SceneData["collaborators"];
394
425
  /**
395
426
  * 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 +443,8 @@ declare class App extends React.Component<AppProps, AppState> {
412
443
  */
413
444
  toggleSidebar: ({ name, tab, force, }: {
414
445
  name: SidebarName | null;
415
- tab?: string | undefined;
416
- force?: boolean | undefined;
446
+ tab?: SidebarTabName;
447
+ force?: boolean;
417
448
  }) => boolean;
418
449
  private updateCurrentCursorPosition;
419
450
  getEditorUIOffsets: () => Offsets;
@@ -445,7 +476,11 @@ declare class App extends React.Component<AppProps, AppState> {
445
476
  private onGestureEnd;
446
477
  private handleTextWysiwyg;
447
478
  private deselectElements;
479
+ private getSelectedTextElement;
480
+ private getSelectedTextEditingContainerAtPosition;
448
481
  private getTextElementAtPosition;
482
+ private isHittingTextAutoResizeHandle;
483
+ private handleTextAutoResizeHandlePointerDown;
449
484
  private getElementAtPosition;
450
485
  private getElementsAtPosition;
451
486
  getElementHitThreshold(element: ExcalidrawElement): number;
@@ -454,9 +489,11 @@ declare class App extends React.Component<AppProps, AppState> {
454
489
  private startTextEditing;
455
490
  private startImageCropping;
456
491
  private finishImageCropping;
492
+ private shouldHandleBrowserCanvasDoubleClick;
457
493
  private handleCanvasDoubleClick;
494
+ private handleCanvasClick;
458
495
  private getElementLinkAtPosition;
459
- private redirectToLink;
496
+ private handleElementLinkClick;
460
497
  private getTopLayerFrameAtSceneCoords;
461
498
  private handleCanvasPointerMove;
462
499
  private handleEraser;
@@ -527,13 +564,11 @@ declare class App extends React.Component<AppProps, AppState> {
527
564
  /** generally you should use `addNewImagesToImageCache()` directly if you need
528
565
  * to render new images. This is just a failsafe */
529
566
  private scheduleImageRefresh;
530
- private updateBindingEnabledOnPointerMove;
531
- private maybeSuggestBindingAtCursor;
532
567
  private clearSelection;
533
568
  private handleInteractiveCanvasRef;
534
569
  private insertImages;
535
570
  private handleAppOnDrop;
536
- loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
571
+ loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
537
572
  private handleCanvasContextMenu;
538
573
  private maybeDragNewGenericElement;
539
574
  private maybeHandleCrop;
@@ -546,6 +581,7 @@ declare class App extends React.Component<AppProps, AppState> {
546
581
  private updateDOMRect;
547
582
  refresh: () => void;
548
583
  private getCanvasOffsets;
584
+ watchState: () => void;
549
585
  private updateLanguage;
550
586
  }
551
587
  declare global {
@@ -555,6 +591,7 @@ declare global {
555
591
  elements: readonly ExcalidrawElement[];
556
592
  state: AppState;
557
593
  setState: React.Component<any, AppState>["setState"];
594
+ watchState: (prev: any, next: any) => void | undefined;
558
595
  app: InstanceType<typeof App>;
559
596
  history: History;
560
597
  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";
@@ -4,7 +4,7 @@ export type ButtonVariant = "filled" | "outlined" | "icon";
4
4
  export type ButtonColor = "primary" | "danger" | "warning" | "muted" | "success";
5
5
  export type ButtonSize = "medium" | "large";
6
6
  export type FilledButtonProps = {
7
- label: string;
7
+ label?: string;
8
8
  children?: React.ReactNode;
9
9
  onClick?: (event: React.MouseEvent) => void;
10
10
  status?: null | "loading" | "success";
@@ -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;