@zsviczian/excalidraw 0.18.0-5 → 0.18.0-51

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 (191) hide show
  1. package/dist/excalidraw.development.js +746 -504
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/excalidraw.production.min.js.LICENSE.txt +0 -2
  4. package/dist/styles.development.css +1080 -437
  5. package/dist/styles.production.css +26 -22
  6. package/package.json +14 -3
  7. package/types/common/src/commonObsidianUtils.d.ts +13 -0
  8. package/types/common/src/constants.d.ts +42 -18
  9. package/types/common/src/editorInterface.d.ts +35 -0
  10. package/types/{excalidraw → common/src}/emitter.d.ts +1 -1
  11. package/types/common/src/font-metadata.d.ts +4 -2
  12. package/types/common/src/index.d.ts +2 -0
  13. package/types/common/src/utility-types.d.ts +5 -0
  14. package/types/common/src/utils.d.ts +20 -5
  15. package/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
  16. package/types/element/src/align.d.ts +4 -3
  17. package/types/element/src/binding.d.ts +27 -17
  18. package/types/element/src/bounds.d.ts +14 -6
  19. package/types/element/src/collision.d.ts +18 -12
  20. package/types/element/src/cropElement.d.ts +1 -1
  21. package/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
  22. package/types/element/src/distance.d.ts +2 -2
  23. package/types/element/src/distribute.d.ts +2 -1
  24. package/types/element/src/dragElements.d.ts +3 -2
  25. package/types/element/src/duplicate.d.ts +10 -13
  26. package/types/element/src/elbowArrow.d.ts +1 -1
  27. package/types/element/src/flowchart.d.ts +3 -2
  28. package/types/element/src/fractionalIndex.d.ts +9 -3
  29. package/types/element/src/frame.d.ts +5 -4
  30. package/types/element/src/groups.d.ts +1 -0
  31. package/types/element/src/index.d.ts +44 -2
  32. package/types/element/src/linearElementEditor.d.ts +23 -36
  33. package/types/element/src/mutateElement.d.ts +11 -3
  34. package/types/element/src/newElement.d.ts +6 -4
  35. package/types/element/src/positionElementsOnGrid.d.ts +2 -0
  36. package/types/element/src/renderElement.d.ts +4 -1
  37. package/types/element/src/resizeElements.d.ts +6 -5
  38. package/types/element/src/resizeTest.d.ts +5 -4
  39. package/types/element/src/selection.d.ts +11 -5
  40. package/types/element/src/shape.d.ts +42 -0
  41. package/types/element/src/sizeHelpers.d.ts +2 -2
  42. package/types/element/src/store.d.ts +237 -0
  43. package/types/element/src/textElement.d.ts +5 -3
  44. package/types/element/src/transformHandles.d.ts +5 -4
  45. package/types/element/src/typeChecks.d.ts +19 -1
  46. package/types/element/src/types.d.ts +25 -2
  47. package/types/element/src/utils.d.ts +16 -6
  48. package/types/element/src/zindex.d.ts +1 -1
  49. package/types/excalidraw/actions/actionAddToLibrary.d.ts +75 -54
  50. package/types/excalidraw/actions/actionBoundText.d.ts +50 -36
  51. package/types/excalidraw/actions/actionCanvas.d.ts +388 -282
  52. package/types/excalidraw/actions/actionClipboard.d.ts +151 -107
  53. package/types/excalidraw/actions/actionCropEditor.d.ts +25 -18
  54. package/types/excalidraw/actions/actionDeleteSelected.d.ts +77 -55
  55. package/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
  56. package/types/excalidraw/actions/actionElementLink.d.ts +25 -18
  57. package/types/excalidraw/actions/actionElementLock.d.ts +65 -52
  58. package/types/excalidraw/actions/actionEmbeddable.d.ts +25 -18
  59. package/types/excalidraw/actions/actionExport.d.ts +237 -174
  60. package/types/excalidraw/actions/actionFinalize.d.ts +307 -43
  61. package/types/excalidraw/actions/actionFrame.d.ts +157 -120
  62. package/types/excalidraw/actions/actionGroup.d.ts +50 -36
  63. package/types/excalidraw/actions/actionHistory.d.ts +1 -2
  64. package/types/excalidraw/actions/actionLinearEditor.d.ts +563 -20
  65. package/types/excalidraw/actions/actionLink.d.ts +23 -16
  66. package/types/excalidraw/actions/actionMenu.d.ts +25 -456
  67. package/types/excalidraw/actions/actionNavigate.d.ts +49 -35
  68. package/types/excalidraw/actions/actionProperties.d.ts +629 -273
  69. package/types/excalidraw/actions/actionSelectAll.d.ts +25 -18
  70. package/types/excalidraw/actions/actionStyles.d.ts +25 -18
  71. package/types/excalidraw/actions/actionToggleGridMode.d.ts +25 -18
  72. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +25 -18
  73. package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +25 -223
  74. package/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  75. package/types/excalidraw/actions/actionToggleStats.d.ts +25 -18
  76. package/types/excalidraw/actions/actionToggleViewMode.d.ts +25 -18
  77. package/types/excalidraw/actions/actionToggleZenMode.d.ts +26 -19
  78. package/types/excalidraw/actions/actionTrayMenu.d.ts +226 -0
  79. package/types/excalidraw/actions/index.d.ts +4 -2
  80. package/types/excalidraw/actions/types.d.ts +4 -3
  81. package/types/excalidraw/appState.d.ts +24 -10
  82. package/types/excalidraw/clipboard.d.ts +68 -5
  83. package/types/excalidraw/components/Actions.d.ts +20 -7
  84. package/types/excalidraw/components/App.d.ts +63 -38
  85. package/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  86. package/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  87. package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
  88. package/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  89. package/types/excalidraw/components/ColorPicker/Picker.d.ts +4 -3
  90. package/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +3 -3
  91. package/types/excalidraw/components/ColorPicker/ShadeList.d.ts +3 -2
  92. package/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  93. package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  94. package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  95. package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  96. package/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  97. package/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
  98. package/types/excalidraw/components/Ellipsify.d.ts +3 -0
  99. package/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  100. package/types/excalidraw/components/FilledButton.d.ts +1 -1
  101. package/types/excalidraw/components/FixedSideContainer.d.ts +2 -1
  102. package/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  103. package/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  104. package/types/excalidraw/components/HintViewer.d.ts +4 -3
  105. package/types/excalidraw/components/InlineIcon.d.ts +3 -1
  106. package/types/excalidraw/components/LayerUI.d.ts +2 -1
  107. package/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  108. package/types/excalidraw/components/LinkButton.d.ts +4 -0
  109. package/types/excalidraw/components/MobileMenu.d.ts +4 -5
  110. package/types/excalidraw/components/MobileToolBar.d.ts +10 -0
  111. package/types/excalidraw/components/Popover.d.ts +2 -1
  112. package/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  113. package/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  114. package/types/excalidraw/components/Range.d.ts +3 -3
  115. package/types/excalidraw/components/Section.d.ts +1 -0
  116. package/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  117. package/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  118. package/types/excalidraw/components/Stats/CanvasGridSize.d.ts +1 -1
  119. package/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  120. package/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  121. package/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  122. package/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  123. package/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  124. package/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  125. package/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  126. package/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  127. package/types/excalidraw/components/Stats/Position.d.ts +1 -1
  128. package/types/excalidraw/components/Stats/utils.d.ts +4 -11
  129. package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  130. package/types/excalidraw/components/TextField.d.ts +1 -0
  131. package/types/excalidraw/components/ToolPopover.d.ts +25 -0
  132. package/types/excalidraw/components/TrayMenu.d.ts +26 -0
  133. package/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  134. package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +4 -2
  135. package/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  136. package/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  137. package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  138. package/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  139. package/types/excalidraw/components/icons.d.ts +17 -0
  140. package/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +14 -1
  141. package/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
  142. package/types/excalidraw/components/shapes.d.ts +115 -5
  143. package/types/excalidraw/data/blob.d.ts +3 -7
  144. package/types/excalidraw/data/reconcile.d.ts +1 -0
  145. package/types/excalidraw/data/restore.d.ts +6 -1
  146. package/types/excalidraw/data/transform.d.ts +1 -1
  147. package/types/excalidraw/data/types.d.ts +4 -1
  148. package/types/excalidraw/editor-jotai.d.ts +6 -6
  149. package/types/excalidraw/eraser/index.d.ts +12 -0
  150. package/types/excalidraw/fonts/Fonts.d.ts +1 -1
  151. package/types/excalidraw/history.d.ts +30 -22
  152. package/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  153. package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  154. package/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
  155. package/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  156. package/types/excalidraw/index.d.ts +15 -14
  157. package/types/excalidraw/lasso/index.d.ts +1 -0
  158. package/types/excalidraw/lasso/utils.d.ts +3 -3
  159. package/types/excalidraw/obsidianUtils.d.ts +22 -4
  160. package/types/excalidraw/renderer/helpers.d.ts +7 -2
  161. package/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  162. package/types/excalidraw/renderer/staticScene.d.ts +4 -1
  163. package/types/excalidraw/scene/Renderer.d.ts +1 -2
  164. package/types/excalidraw/scene/index.d.ts +2 -2
  165. package/types/excalidraw/scene/scrollbars.d.ts +2 -3
  166. package/types/excalidraw/scene/types.d.ts +5 -3
  167. package/types/excalidraw/shortcut.d.ts +1 -0
  168. package/types/excalidraw/snapping.d.ts +2 -2
  169. package/types/excalidraw/types.d.ts +68 -30
  170. package/types/excalidraw/webpack.dev.config.d.ts +2 -0
  171. package/types/excalidraw/webpack.prod.config.d.ts +2 -0
  172. package/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
  173. package/types/math/src/angle.d.ts +2 -0
  174. package/types/math/src/constants.d.ts +3 -0
  175. package/types/math/src/curve.d.ts +34 -0
  176. package/types/math/src/index.d.ts +1 -0
  177. package/types/math/src/point.d.ts +1 -1
  178. package/types/math/src/rectangle.d.ts +2 -0
  179. package/types/math/src/segment.d.ts +1 -0
  180. package/types/math/src/types.d.ts +1 -0
  181. package/types/math/src/vector.d.ts +8 -2
  182. package/types/utils/src/bbox.d.ts +1 -1
  183. package/types/utils/src/index.d.ts +1 -1
  184. package/types/utils/src/withinBounds.d.ts +1 -1
  185. package/types/element/src/Shape.d.ts +0 -17
  186. package/types/element/src/ShapeCache.d.ts +0 -25
  187. package/types/element/src/shapes.d.ts +0 -23
  188. package/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  189. package/types/excalidraw/store.d.ts +0 -129
  190. package/types/excalidraw/visualdebug.d.ts +0 -41
  191. package/types/utils/src/collision.d.ts +0 -8
@@ -1,8 +1,8 @@
1
1
  import "./Range.scss";
2
+ import type { AppClassProperties } from "../types";
2
3
  export type RangeProps = {
3
4
  updateData: (value: number) => void;
4
- appState: any;
5
- elements: any;
5
+ app: AppClassProperties;
6
6
  testId?: string;
7
7
  };
8
- export declare const Range: ({ updateData, appState, elements, testId, }: RangeProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Range: ({ updateData, app, testId }: RangeProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,4 +3,5 @@ export declare const Section: React.FC<{
3
3
  heading: "canvasActions" | "selectedShapeActions" | "shapes";
4
4
  children?: React.ReactNode | ((heading: React.ReactNode) => React.ReactNode);
5
5
  className?: string;
6
+ style?: React.CSSProperties;
6
7
  }>;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../../types";
4
4
  interface AngleProps {
5
5
  element: ExcalidrawElement;
@@ -1,4 +1,4 @@
1
- import type Scene from "../../scene/Scene";
1
+ import type { Scene } from "@excalidraw/element";
2
2
  import type { AppState } from "../../types";
3
3
  interface PositionProps {
4
4
  property: "gridStep";
@@ -1,4 +1,4 @@
1
- import type Scene from "../../scene/Scene";
1
+ import type { Scene } from "@excalidraw/element";
2
2
  import type { AppState } from "../../types";
3
3
  interface PositionProps {
4
4
  property: "gridSize";
@@ -4,6 +4,7 @@ interface CollapsibleProps {
4
4
  openTrigger: () => void;
5
5
  children: React.ReactNode;
6
6
  className?: string;
7
+ showCollapsedIcon?: boolean;
7
8
  }
8
- declare const Collapsible: ({ label, open, openTrigger, children, className, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const Collapsible: ({ label, open, openTrigger, children, className, showCollapsedIcon, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
9
10
  export default Collapsible;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../../types";
4
4
  interface DimensionDragInputProps {
5
5
  property: "width" | "height";
@@ -1,7 +1,8 @@
1
1
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
3
+ import { useApp, useExcalidrawSetAppState } from "../App";
2
4
  import "./DragInput.scss";
3
5
  import type { StatsInputProperty } from "./utils";
4
- import type Scene from "../../scene/Scene";
5
6
  import type { AppState } from "../../types";
6
7
  export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawElement> = (props: {
7
8
  accumulatedChange: number;
@@ -15,6 +16,14 @@ export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawEl
15
16
  property: P;
16
17
  originalAppState: AppState;
17
18
  setInputValue: (value: number) => void;
19
+ app: ReturnType<typeof useApp>;
20
+ setAppState: ReturnType<typeof useExcalidrawSetAppState>;
21
+ }) => void;
22
+ export type DragFinishedCallbackType<E = ExcalidrawElement> = (props: {
23
+ app: ReturnType<typeof useApp>;
24
+ setAppState: ReturnType<typeof useExcalidrawSetAppState>;
25
+ originalElements: readonly E[] | null;
26
+ originalAppState: AppState;
18
27
  }) => void;
19
28
  interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElement> {
20
29
  label: string | React.ReactNode;
@@ -29,6 +38,7 @@ interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElemen
29
38
  appState: AppState;
30
39
  /** how many px you need to drag to get 1 unit change */
31
40
  sensitivity?: number;
41
+ dragFinishedCallback?: DragFinishedCallbackType;
32
42
  }
33
- declare const StatsDragInput: <T extends StatsInputProperty, E extends ExcalidrawElement = ExcalidrawElement>({ label, icon, dragInputCallback, value, elements, editable, shouldKeepAspectRatio, property, scene, appState, sensitivity, }: StatsDragInputProps<T, E>) => import("react/jsx-runtime").JSX.Element | null;
43
+ declare const StatsDragInput: <T extends StatsInputProperty, E extends ExcalidrawElement = ExcalidrawElement>({ label, icon, dragInputCallback, value, elements, editable, shouldKeepAspectRatio, property, scene, appState, sensitivity, dragFinishedCallback, }: StatsDragInputProps<T, E>) => import("react/jsx-runtime").JSX.Element | null;
34
44
  export default StatsDragInput;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../../types";
4
4
  interface FontSizeProps {
5
5
  element: ExcalidrawElement;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../../types";
4
4
  interface MultiAngleProps {
5
5
  elements: readonly ExcalidrawElement[];
@@ -1,6 +1,6 @@
1
1
  import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
2
3
  import type { AtomicUnit } from "./utils";
3
- import type Scene from "../../scene/Scene";
4
4
  import type { AppState } from "../../types";
5
5
  interface MultiDimensionProps {
6
6
  property: "width" | "height";
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../../types";
4
4
  interface MultiFontSizeProps {
5
5
  elements: readonly ExcalidrawElement[];
@@ -1,6 +1,6 @@
1
1
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
2
3
  import type { AtomicUnit } from "./utils";
3
- import type Scene from "../../scene/Scene";
4
4
  import type { AppState } from "../../types";
5
5
  interface MultiPositionProps {
6
6
  property: "x" | "y";
@@ -1,5 +1,5 @@
1
1
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../../types";
4
4
  interface PositionProps {
5
5
  property: "x" | "y";
@@ -1,8 +1,9 @@
1
- import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
- import type Scene from "../../scene/Scene";
1
+ import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../../types";
4
4
  export type StatsInputProperty = "x" | "y" | "width" | "height" | "angle" | "fontSize" | "gridStep" | "gridSize";
5
5
  export declare const SMALLEST_DELTA = 0.01;
6
+ export declare const STEP_SIZE = 10;
6
7
  export declare const isPropertyEditable: (element: ExcalidrawElement, property: keyof ExcalidrawElement) => boolean;
7
8
  export declare const getStepSizedValue: (value: number, stepSize: number) => number;
8
9
  export type AtomicUnit = Record<string, true>;
@@ -14,13 +15,5 @@ export declare const newOrigin: (x1: number, y1: number, w1: number, h1: number,
14
15
  x: number;
15
16
  y: number;
16
17
  };
17
- export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement, elementsMap: NonDeletedSceneElementsMap, elements: readonly NonDeletedExcalidrawElement[], scene: Scene, originalElementsMap: ElementsMap, shouldInformMutation?: boolean) => void;
18
+ export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement, scene: Scene, originalElementsMap: ElementsMap, shouldInformMutation?: boolean) => void;
18
19
  export declare const getAtomicUnits: (targetElements: readonly ExcalidrawElement[], appState: AppState) => AtomicUnit[];
19
- export declare const updateBindings: (latestElement: ExcalidrawElement, elementsMap: NonDeletedSceneElementsMap, elements: readonly NonDeletedExcalidrawElement[], scene: Scene, options?: {
20
- simultaneouslyUpdated?: readonly ExcalidrawElement[];
21
- newSize?: {
22
- width: number;
23
- height: number;
24
- };
25
- zoom?: AppState["zoom"];
26
- }) => void;
@@ -1,5 +1,4 @@
1
- import type { ReactNode } from "react";
2
- import type { JSX } from "react";
1
+ import type { JSX, ReactNode } from "react";
3
2
  export declare const TTDDialogTrigger: {
4
3
  ({ children, icon, }: {
5
4
  children?: ReactNode;
@@ -12,6 +12,7 @@ type TextFieldProps = {
12
12
  className?: string;
13
13
  placeholder?: string;
14
14
  isRedacted?: boolean;
15
+ type?: "text" | "search";
15
16
  } & ({
16
17
  value: string;
17
18
  } | {
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import "./ToolPopover.scss";
3
+ import type { AppClassProperties } from "../types";
4
+ type ToolOption = {
5
+ type: string;
6
+ icon: React.ReactNode;
7
+ title?: string;
8
+ };
9
+ type ToolPopoverProps = {
10
+ app: AppClassProperties;
11
+ options: readonly ToolOption[];
12
+ activeTool: {
13
+ type: string;
14
+ };
15
+ defaultOption: string;
16
+ className?: string;
17
+ namePrefix: string;
18
+ title: string;
19
+ "data-testid": string;
20
+ onToolChange: (type: string) => void;
21
+ displayedOption: ToolOption;
22
+ fillable?: boolean;
23
+ };
24
+ export declare const ToolPopover: ({ app, options, activeTool, defaultOption, className, namePrefix, title, "data-testid": dataTestId, onToolChange, displayedOption, fillable, }: ToolPopoverProps) => import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
3
+ import type { EditorInterface } from "@excalidraw/common";
4
+ import type { ActionManager } from "../actions/manager";
5
+ import type { AppClassProperties, AppProps, AppState, ExcalidrawProps, UIAppState } from "../types";
6
+ import type { JSX } from "react";
7
+ type TrayMenuProps = {
8
+ appState: UIAppState;
9
+ actionManager: ActionManager;
10
+ renderJSONExportDialog: () => React.ReactNode;
11
+ renderImageExportDialog: () => React.ReactNode;
12
+ setAppState: React.Component<any, AppState>["setState"];
13
+ elements: readonly NonDeletedExcalidrawElement[];
14
+ onLockToggle: () => void;
15
+ onHandToolToggle: () => void;
16
+ onPenModeToggle: AppClassProperties["togglePenMode"];
17
+ renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
18
+ renderCustomStats?: ExcalidrawProps["renderCustomStats"];
19
+ renderSidebars: () => JSX.Element | null;
20
+ editorInterface: EditorInterface;
21
+ renderWelcomeScreen: boolean;
22
+ UIOptions: AppProps["UIOptions"];
23
+ app: AppClassProperties;
24
+ };
25
+ export declare const TrayMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, renderTopRightUI, renderCustomStats, renderSidebars, editorInterface, renderWelcomeScreen, UIOptions, app, }: TrayMenuProps) => import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,8 @@
1
+ import "./UnlockPopup.scss";
2
+ import type App from "./App";
3
+ import type { AppState } from "../types";
4
+ declare const UnlockPopup: ({ app, activeLockedId, }: {
5
+ app: App;
6
+ activeLockedId: NonNullable<AppState["activeLockedId"]>;
7
+ }) => import("react/jsx-runtime").JSX.Element | null;
8
+ export default UnlockPopup;
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
+ import { type EditorInterface } from "@excalidraw/common";
2
3
  import type { NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
3
4
  import type { RenderableElementsMap, RenderInteractiveSceneCallback } from "../../scene/types";
4
- import type { Device, InteractiveCanvasAppState } from "../../types";
5
+ import type { InteractiveCanvasAppState } from "../../types";
5
6
  import type { DOMAttributes } from "react";
6
7
  type InteractiveCanvasProps = {
7
8
  containerRef: React.RefObject<HTMLDivElement | null>;
@@ -14,7 +15,8 @@ type InteractiveCanvasProps = {
14
15
  selectionNonce: number | undefined;
15
16
  scale: number;
16
17
  appState: InteractiveCanvasAppState;
17
- device: Device;
18
+ renderScrollbars: boolean;
19
+ editorInterface: EditorInterface;
18
20
  renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
19
21
  handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
20
22
  onContextMenu: Exclude<DOMAttributes<HTMLCanvasElement | HTMLDivElement>["onContextMenu"], undefined>;
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import "./DropdownMenu.scss";
3
3
  declare const DropdownMenu: {
4
- ({ children, open, }: {
4
+ ({ children, open, placement, }: {
5
5
  children?: React.ReactNode;
6
6
  open: boolean;
7
+ placement?: "top" | "bottom" | undefined;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
9
  Trigger: {
9
10
  ({ className, children, onToggle, title, ...rest }: {
@@ -15,12 +16,13 @@ declare const DropdownMenu: {
15
16
  displayName: string;
16
17
  };
17
18
  Content: {
18
- ({ children, onClickOutside, className, onSelect, style, }: {
19
+ ({ children, onClickOutside, className, onSelect, style, placement, }: {
19
20
  children?: React.ReactNode;
20
21
  onClickOutside?: (() => void) | undefined;
21
22
  className?: string | undefined;
22
23
  onSelect?: ((event: Event) => void) | undefined;
23
24
  style?: React.CSSProperties | undefined;
25
+ placement?: "top" | "bottom" | undefined;
24
26
  }): import("react/jsx-runtime").JSX.Element;
25
27
  displayName: string;
26
28
  };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  declare const MenuContent: {
3
- ({ children, onClickOutside, className, onSelect, style, }: {
3
+ ({ children, onClickOutside, className, onSelect, style, placement, }: {
4
4
  children?: React.ReactNode;
5
5
  onClickOutside?: (() => void) | undefined;
6
6
  className?: string | undefined;
@@ -9,6 +9,7 @@ declare const MenuContent: {
9
9
  */
10
10
  onSelect?: ((event: Event) => void) | undefined;
11
11
  style?: React.CSSProperties | undefined;
12
+ placement?: "top" | "bottom" | undefined;
12
13
  }): import("react/jsx-runtime").JSX.Element;
13
14
  displayName: string;
14
15
  };
@@ -1,9 +1,10 @@
1
+ import type { Scene } from "@excalidraw/element";
1
2
  import type { ElementsMap, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
3
  import "./Hyperlink.scss";
3
4
  import type { AppState, ExcalidrawProps, UIAppState } from "../../types";
4
- export declare const Hyperlink: ({ element, elementsMap, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
5
+ export declare const Hyperlink: ({ element, scene, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
5
6
  element: NonDeletedExcalidrawElement;
6
- elementsMap: ElementsMap;
7
+ scene: Scene;
7
8
  setAppState: React.Component<any, AppState>["setState"];
8
9
  onLinkOpen: ExcalidrawProps["onLinkOpen"];
9
10
  setToast: (toast: {
@@ -1,7 +1,8 @@
1
1
  import type { GlobalPoint, Radians } from "@excalidraw/math";
2
- import type { Bounds } from "@excalidraw/element/bounds";
2
+ import type { Bounds } from "@excalidraw/element";
3
3
  import type { ElementsMap, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
4
4
  import type { AppState, UIAppState } from "../../types";
5
+ export declare const DEFAULT_LINK_SIZE = 12;
5
6
  export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
6
7
  export declare const ELEMENT_LINK_IMG: HTMLImageElement;
7
8
  export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: Radians, appState: Pick<UIAppState, "zoom">) => Bounds;
@@ -11,9 +11,12 @@ export declare const PlusPromoIcon: import("react/jsx-runtime").JSX.Element;
11
11
  export declare const LibraryIcon: import("react/jsx-runtime").JSX.Element;
12
12
  export declare const PlusIcon: import("react/jsx-runtime").JSX.Element;
13
13
  export declare const DotsIcon: import("react/jsx-runtime").JSX.Element;
14
+ export declare const DotsHorizontalIcon: import("react/jsx-runtime").JSX.Element;
14
15
  export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
16
+ export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
15
17
  export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
16
18
  export declare const LockedIcon: import("react/jsx-runtime").JSX.Element;
19
+ export declare const LockedIconFilled: import("react/jsx-runtime").JSX.Element;
17
20
  export declare const WelcomeScreenMenuArrow: import("react/jsx-runtime").JSX.Element;
18
21
  export declare const WelcomeScreenHelpArrow: import("react/jsx-runtime").JSX.Element;
19
22
  export declare const WelcomeScreenTopToolbarArrow: import("react/jsx-runtime").JSX.Element;
@@ -28,6 +31,7 @@ export declare const LineIcon: import("react/jsx-runtime").JSX.Element;
28
31
  export declare const PenModeIcon: import("react/jsx-runtime").JSX.Element;
29
32
  export declare const FreedrawIcon: import("react/jsx-runtime").JSX.Element;
30
33
  export declare const TextIcon: import("react/jsx-runtime").JSX.Element;
34
+ export declare const TextSizeIcon: import("react/jsx-runtime").JSX.Element;
31
35
  export declare const ImageIcon: import("react/jsx-runtime").JSX.Element;
32
36
  export declare const EraserIcon: import("react/jsx-runtime").JSX.Element;
33
37
  export declare const ZoomInIcon: import("react/jsx-runtime").JSX.Element;
@@ -54,6 +58,7 @@ export declare const LoadIcon: import("react/jsx-runtime").JSX.Element;
54
58
  export declare const clipboard: import("react/jsx-runtime").JSX.Element;
55
59
  export declare const palette: import("react/jsx-runtime").JSX.Element;
56
60
  export declare const bucketFillIcon: import("react/jsx-runtime").JSX.Element;
61
+ export declare const slashIcon: import("react/jsx-runtime").JSX.Element;
57
62
  export declare const ExportImageIcon: import("react/jsx-runtime").JSX.Element;
58
63
  export declare const exportToFileIcon: import("react/jsx-runtime").JSX.Element;
59
64
  export declare const zoomIn: import("react/jsx-runtime").JSX.Element;
@@ -221,4 +226,16 @@ export declare const collapseUpIcon: import("react/jsx-runtime").JSX.Element;
221
226
  export declare const upIcon: import("react/jsx-runtime").JSX.Element;
222
227
  export declare const cropIcon: import("react/jsx-runtime").JSX.Element;
223
228
  export declare const elementLinkIcon: import("react/jsx-runtime").JSX.Element;
229
+ export declare const markerFrameIcon: import("react/jsx-runtime").JSX.Element;
230
+ export declare const LaTeXIcon: import("react/jsx-runtime").JSX.Element;
231
+ export declare const InsertAnyFileIcon: import("react/jsx-runtime").JSX.Element;
232
+ export declare const Card: import("react/jsx-runtime").JSX.Element;
233
+ export declare const resizeIcon: import("react/jsx-runtime").JSX.Element;
234
+ export declare const adjustmentsIcon: import("react/jsx-runtime").JSX.Element;
235
+ export declare const strokeIcon: import("react/jsx-runtime").JSX.Element;
236
+ export declare const pencilIcon: import("react/jsx-runtime").JSX.Element;
237
+ export declare const chevronLeftIcon: import("react/jsx-runtime").JSX.Element;
238
+ export declare const sidebarRightIcon: import("react/jsx-runtime").JSX.Element;
239
+ export declare const messageCircleIcon: import("react/jsx-runtime").JSX.Element;
240
+ export declare const presentationIcon: import("react/jsx-runtime").JSX.Element;
224
241
  export {};
@@ -1,8 +1,21 @@
1
+ import { type EditorInterface } from "@excalidraw/common";
1
2
  import "./LiveCollaborationTrigger.scss";
2
3
  declare const LiveCollaborationTrigger: {
3
- ({ isCollaborating, onSelect, ...rest }: {
4
+ ({ isCollaborating, onSelect, editorInterface, ...rest }: {
4
5
  isCollaborating: boolean;
5
6
  onSelect: () => void;
7
+ editorInterface?: Readonly<{
8
+ formFactor: "phone" | "tablet" | "desktop";
9
+ desktopUIMode: "compact" | "full" | "tray";
10
+ userAgent: Readonly<{
11
+ isMobileDevice: boolean;
12
+ platform: "other" | "unknown" | "ios" | "android";
13
+ }>;
14
+ isTouchScreen: boolean;
15
+ canFitSidebar: boolean;
16
+ isLandscape: boolean;
17
+ preferTrayMode: boolean;
18
+ }> | undefined;
6
19
  } & import("react").ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
7
20
  displayName: string;
8
21
  };
@@ -25,9 +25,6 @@ declare const MainMenu: React.FC<{
25
25
  order?: number | undefined;
26
26
  onSelect?: ((event: Event) => void) | undefined;
27
27
  children: React.ReactNode;
28
- /**
29
- * Called when any menu item is selected (clicked on).
30
- */
31
28
  shortcut?: string | undefined;
32
29
  hovered?: boolean | undefined;
33
30
  selected?: boolean | undefined;
@@ -1,3 +1,4 @@
1
+ import type { AppClassProperties } from "../types";
1
2
  export declare const SHAPES: readonly [{
2
3
  readonly icon: import("react/jsx-runtime").JSX.Element;
3
4
  readonly value: "selection";
@@ -48,9 +49,58 @@ export declare const SHAPES: readonly [{
48
49
  readonly fillable: false;
49
50
  }, {
50
51
  readonly icon: import("react/jsx-runtime").JSX.Element;
51
- readonly value: "image";
52
- readonly key: null;
53
- readonly numericKey: "9";
52
+ readonly value: "eraser";
53
+ readonly key: "e";
54
+ readonly numericKey: "0";
55
+ readonly fillable: false;
56
+ }];
57
+ export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
58
+ readonly icon: import("react/jsx-runtime").JSX.Element;
59
+ readonly value: "selection";
60
+ readonly key: "v";
61
+ readonly numericKey: "1";
62
+ readonly fillable: true;
63
+ }, {
64
+ readonly icon: import("react/jsx-runtime").JSX.Element;
65
+ readonly value: "rectangle";
66
+ readonly key: "r";
67
+ readonly numericKey: "2";
68
+ readonly fillable: true;
69
+ }, {
70
+ readonly icon: import("react/jsx-runtime").JSX.Element;
71
+ readonly value: "diamond";
72
+ readonly key: "d";
73
+ readonly numericKey: "3";
74
+ readonly fillable: true;
75
+ }, {
76
+ readonly icon: import("react/jsx-runtime").JSX.Element;
77
+ readonly value: "ellipse";
78
+ readonly key: "o";
79
+ readonly numericKey: "4";
80
+ readonly fillable: true;
81
+ }, {
82
+ readonly icon: import("react/jsx-runtime").JSX.Element;
83
+ readonly value: "arrow";
84
+ readonly key: "a";
85
+ readonly numericKey: "5";
86
+ readonly fillable: true;
87
+ }, {
88
+ readonly icon: import("react/jsx-runtime").JSX.Element;
89
+ readonly value: "line";
90
+ readonly key: "l";
91
+ readonly numericKey: "6";
92
+ readonly fillable: true;
93
+ }, {
94
+ readonly icon: import("react/jsx-runtime").JSX.Element;
95
+ readonly value: "freedraw";
96
+ readonly key: readonly ["p", "x"];
97
+ readonly numericKey: "7";
98
+ readonly fillable: false;
99
+ }, {
100
+ readonly icon: import("react/jsx-runtime").JSX.Element;
101
+ readonly value: "text";
102
+ readonly key: "t";
103
+ readonly numericKey: "8";
54
104
  readonly fillable: false;
55
105
  }, {
56
106
  readonly icon: import("react/jsx-runtime").JSX.Element;
@@ -58,5 +108,65 @@ export declare const SHAPES: readonly [{
58
108
  readonly key: "e";
59
109
  readonly numericKey: "0";
60
110
  readonly fillable: false;
61
- }];
62
- export declare const findShapeByKey: (key: string) => "line" | "ellipse" | "text" | "rectangle" | "diamond" | "image" | "selection" | "arrow" | "freedraw" | "eraser" | null;
111
+ }] | readonly [{
112
+ readonly value: "lasso";
113
+ readonly icon: import("react/jsx-runtime").JSX.Element;
114
+ readonly key: "v";
115
+ readonly numericKey: "1";
116
+ readonly fillable: true;
117
+ }, ...({
118
+ readonly icon: import("react/jsx-runtime").JSX.Element;
119
+ readonly value: "selection";
120
+ readonly key: "v";
121
+ readonly numericKey: "1";
122
+ readonly fillable: true;
123
+ } | {
124
+ readonly icon: import("react/jsx-runtime").JSX.Element;
125
+ readonly value: "rectangle";
126
+ readonly key: "r";
127
+ readonly numericKey: "2";
128
+ readonly fillable: true;
129
+ } | {
130
+ readonly icon: import("react/jsx-runtime").JSX.Element;
131
+ readonly value: "diamond";
132
+ readonly key: "d";
133
+ readonly numericKey: "3";
134
+ readonly fillable: true;
135
+ } | {
136
+ readonly icon: import("react/jsx-runtime").JSX.Element;
137
+ readonly value: "ellipse";
138
+ readonly key: "o";
139
+ readonly numericKey: "4";
140
+ readonly fillable: true;
141
+ } | {
142
+ readonly icon: import("react/jsx-runtime").JSX.Element;
143
+ readonly value: "arrow";
144
+ readonly key: "a";
145
+ readonly numericKey: "5";
146
+ readonly fillable: true;
147
+ } | {
148
+ readonly icon: import("react/jsx-runtime").JSX.Element;
149
+ readonly value: "line";
150
+ readonly key: "l";
151
+ readonly numericKey: "6";
152
+ readonly fillable: true;
153
+ } | {
154
+ readonly icon: import("react/jsx-runtime").JSX.Element;
155
+ readonly value: "freedraw";
156
+ readonly key: readonly ["p", "x"];
157
+ readonly numericKey: "7";
158
+ readonly fillable: false;
159
+ } | {
160
+ readonly icon: import("react/jsx-runtime").JSX.Element;
161
+ readonly value: "text";
162
+ readonly key: "t";
163
+ readonly numericKey: "8";
164
+ readonly fillable: false;
165
+ } | {
166
+ readonly icon: import("react/jsx-runtime").JSX.Element;
167
+ readonly value: "eraser";
168
+ readonly key: "e";
169
+ readonly numericKey: "0";
170
+ readonly fillable: false;
171
+ })[]];
172
+ export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "lasso" | "eraser" | null;
@@ -2,7 +2,7 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
2
2
  import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
4
  import type { AppState, DataURL, LibraryItem } from "../types";
5
- import type { FileSystemHandle } from "./filesystem";
5
+ import type { FileSystemHandle } from "browser-fs-access";
6
6
  import type { ImportedLibraryData } from "./types";
7
7
  export declare const getMimeType: (blob: Blob | string) => string;
8
8
  export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
@@ -40,12 +40,8 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
40
40
  type: typeof MIME_TYPES.svg;
41
41
  };
42
42
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
43
- export declare const getFileFromEvent: (event: React.DragEvent<HTMLDivElement>) => Promise<{
44
- file: File | null;
45
- fileHandle: FileSystemHandle | null;
46
- }>;
47
- export declare const getFileHandle: (event: React.DragEvent<HTMLDivElement>) => Promise<FileSystemHandle | null>;
48
- export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, name: string | undefined) => File;
43
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
44
+ export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
49
45
  /** attempts to detect correct mimeType if none is set, or if an image
50
46
  * has an incorrect extension.
51
47
  * Note: doesn't handle missing .excalidraw/.excalidrawlib extension */
@@ -3,4 +3,5 @@ import type { MakeBrand } from "@excalidraw/common/utility-types";
3
3
  import type { AppState } from "../types";
4
4
  export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
5
5
  export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
6
+ export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
6
7
  export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
@@ -1,4 +1,4 @@
1
- import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { ExcalidrawArrowElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawSelectionElement, ExcalidrawTextElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
2
2
  import type { AppState, BinaryFiles, LibraryItem } from "../types";
3
3
  import type { ImportedDataState } from "./types";
4
4
  type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
@@ -8,14 +8,19 @@ export type RestoredDataState = {
8
8
  appState: RestoredAppState;
9
9
  files: BinaryFiles;
10
10
  };
11
+ export declare const restoreElement: (element: Exclude<ExcalidrawElement, ExcalidrawSelectionElement>, opts?: {
12
+ deleteInvisibleElements?: boolean;
13
+ }) => ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | ExcalidrawArrowElement | null;
11
14
  export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, opts?: {
12
15
  refreshDimensions?: boolean;
13
16
  repairBindings?: boolean;
17
+ deleteInvisibleElements?: boolean;
14
18
  } | undefined) => OrderedExcalidrawElement[];
15
19
  export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
16
20
  export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined, elementsConfig?: {
17
21
  refreshDimensions?: boolean;
18
22
  repairBindings?: boolean;
23
+ deleteInvisibleElements?: boolean;
19
24
  }) => RestoredDataState;
20
25
  export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
21
26
  export {};
@@ -1,4 +1,4 @@
1
- import type { ElementConstructorOpts } from "@excalidraw/element/newElement";
1
+ import type { ElementConstructorOpts } from "@excalidraw/element";
2
2
  import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "@excalidraw/element/types";
3
3
  import type { MarkOptional } from "@excalidraw/common/utility-types";
4
4
  export type ValidLinearElement = {