@excalidraw/excalidraw 0.18.0-58f7d33 → 0.18.0-5fffc47

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 (198) hide show
  1. package/dist/dev/chunk-CP5DND7P.js +7 -0
  2. package/dist/dev/chunk-CP5DND7P.js.map +7 -0
  3. package/dist/dev/{chunk-X3RYHLJU.js → chunk-PWQMCSHA.js} +26 -8
  4. package/dist/dev/chunk-PWQMCSHA.js.map +7 -0
  5. package/dist/dev/chunk-YMRX7R7U.js +5671 -0
  6. package/dist/dev/chunk-YMRX7R7U.js.map +7 -0
  7. package/dist/dev/data/{image-U2IPNUKJ.js → image-L23D26XS.js} +3 -3
  8. package/dist/dev/index.css +964 -501
  9. package/dist/dev/index.css.map +3 -3
  10. package/dist/dev/index.js +11915 -10771
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-CKWC2GMK.js → en-V3NQTBPG.js} +2 -2
  13. package/dist/dev/subset-shared.chunk.js +1 -1
  14. package/dist/dev/subset-worker.chunk.js +1 -1
  15. package/dist/prod/chunk-A66AFZZU.js +7 -0
  16. package/dist/prod/chunk-GF46JCB3.js +12 -0
  17. package/dist/prod/chunk-HT4FKTIQ.js +4 -0
  18. package/dist/prod/data/image-NWF7UX55.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +25 -17
  21. package/dist/prod/locales/{en-SBO6ZHT2.js → en-LQE6K457.js} +1 -1
  22. package/dist/prod/subset-shared.chunk.js +1 -1
  23. package/dist/prod/subset-worker.chunk.js +1 -1
  24. package/dist/types/common/src/constants.d.ts +44 -7
  25. package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
  26. package/dist/types/common/src/font-metadata.d.ts +4 -2
  27. package/dist/types/common/src/index.d.ts +1 -0
  28. package/dist/types/common/src/utility-types.d.ts +5 -0
  29. package/dist/types/common/src/utils.d.ts +20 -4
  30. package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
  31. package/dist/types/element/src/align.d.ts +4 -3
  32. package/dist/types/element/src/binding.d.ts +26 -16
  33. package/dist/types/element/src/bounds.d.ts +14 -6
  34. package/dist/types/element/src/collision.d.ts +18 -12
  35. package/dist/types/element/src/cropElement.d.ts +1 -1
  36. package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
  37. package/dist/types/element/src/distance.d.ts +2 -2
  38. package/dist/types/element/src/distribute.d.ts +2 -1
  39. package/dist/types/element/src/dragElements.d.ts +3 -2
  40. package/dist/types/element/src/duplicate.d.ts +10 -13
  41. package/dist/types/element/src/elbowArrow.d.ts +1 -1
  42. package/dist/types/element/src/flowchart.d.ts +3 -2
  43. package/dist/types/element/src/fractionalIndex.d.ts +9 -3
  44. package/dist/types/element/src/frame.d.ts +5 -4
  45. package/dist/types/element/src/groups.d.ts +1 -0
  46. package/dist/types/element/src/index.d.ts +44 -2
  47. package/dist/types/element/src/linearElementEditor.d.ts +23 -36
  48. package/dist/types/element/src/mutateElement.d.ts +11 -3
  49. package/dist/types/element/src/newElement.d.ts +4 -3
  50. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  51. package/dist/types/element/src/renderElement.d.ts +4 -1
  52. package/dist/types/element/src/resizeElements.d.ts +5 -4
  53. package/dist/types/element/src/selection.d.ts +11 -5
  54. package/dist/types/element/src/shape.d.ts +42 -0
  55. package/dist/types/element/src/sizeHelpers.d.ts +2 -2
  56. package/dist/types/element/src/store.d.ts +237 -0
  57. package/dist/types/element/src/textElement.d.ts +4 -3
  58. package/dist/types/element/src/typeChecks.d.ts +19 -1
  59. package/dist/types/element/src/types.d.ts +15 -2
  60. package/dist/types/element/src/utils.d.ts +16 -6
  61. package/dist/types/element/src/zindex.d.ts +1 -1
  62. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +57 -54
  63. package/dist/types/excalidraw/actions/actionBoundText.d.ts +38 -36
  64. package/dist/types/excalidraw/actions/actionCanvas.d.ts +256 -242
  65. package/dist/types/excalidraw/actions/actionClipboard.d.ts +114 -106
  66. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +19 -18
  67. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +57 -53
  68. package/dist/types/excalidraw/actions/actionElementLink.d.ts +18 -17
  69. package/dist/types/excalidraw/actions/actionElementLock.d.ts +53 -52
  70. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +19 -18
  71. package/dist/types/excalidraw/actions/actionExport.d.ts +181 -172
  72. package/dist/types/excalidraw/actions/actionFinalize.d.ts +85 -42
  73. package/dist/types/excalidraw/actions/actionFrame.d.ts +123 -119
  74. package/dist/types/excalidraw/actions/actionGroup.d.ts +38 -36
  75. package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
  76. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +545 -20
  77. package/dist/types/excalidraw/actions/actionLink.d.ts +18 -17
  78. package/dist/types/excalidraw/actions/actionMenu.d.ts +18 -391
  79. package/dist/types/excalidraw/actions/actionNavigate.d.ts +38 -36
  80. package/dist/types/excalidraw/actions/actionProperties.d.ts +305 -273
  81. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +19 -18
  82. package/dist/types/excalidraw/actions/actionStyles.d.ts +19 -18
  83. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +19 -18
  84. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +19 -18
  85. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +18 -190
  86. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  87. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +19 -18
  88. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +19 -18
  89. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +19 -18
  90. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  91. package/dist/types/excalidraw/actions/types.d.ts +4 -3
  92. package/dist/types/excalidraw/appState.d.ts +23 -10
  93. package/dist/types/excalidraw/clipboard.d.ts +64 -1
  94. package/dist/types/excalidraw/components/Actions.d.ts +17 -7
  95. package/dist/types/excalidraw/components/App.d.ts +35 -22
  96. package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  97. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  98. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +6 -1
  99. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  100. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +4 -3
  101. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +3 -3
  102. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +3 -2
  103. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  104. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  105. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  106. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  107. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  108. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
  109. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  110. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  111. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  112. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  113. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  114. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  115. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  116. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  117. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  118. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  119. package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  120. package/dist/types/excalidraw/components/Range.d.ts +3 -3
  121. package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  122. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  123. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  124. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  125. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  126. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  127. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  128. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  129. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  130. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  131. package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
  132. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
  133. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  134. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  135. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  136. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  137. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  138. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  139. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  140. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  141. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  142. package/dist/types/excalidraw/components/icons.d.ts +8 -0
  143. package/dist/types/excalidraw/components/shapes.d.ts +129 -1
  144. package/dist/types/excalidraw/data/blob.d.ts +3 -7
  145. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  146. package/dist/types/excalidraw/data/restore.d.ts +6 -1
  147. package/dist/types/excalidraw/data/transform.d.ts +1 -1
  148. package/dist/types/excalidraw/data/types.d.ts +4 -1
  149. package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
  150. package/dist/types/excalidraw/eraser/index.d.ts +0 -2
  151. package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
  152. package/dist/types/excalidraw/history.d.ts +30 -22
  153. package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  154. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  155. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  156. package/dist/types/excalidraw/index.d.ts +11 -10
  157. package/dist/types/excalidraw/lasso/index.d.ts +1 -0
  158. package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
  159. package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
  160. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  161. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
  162. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  163. package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
  164. package/dist/types/excalidraw/scene/types.d.ts +2 -0
  165. package/dist/types/excalidraw/snapping.d.ts +2 -2
  166. package/dist/types/excalidraw/types.d.ts +46 -16
  167. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
  168. package/dist/types/math/src/angle.d.ts +2 -0
  169. package/dist/types/math/src/constants.d.ts +3 -0
  170. package/dist/types/math/src/curve.d.ts +34 -0
  171. package/dist/types/math/src/index.d.ts +1 -0
  172. package/dist/types/math/src/point.d.ts +1 -1
  173. package/dist/types/math/src/rectangle.d.ts +2 -0
  174. package/dist/types/math/src/segment.d.ts +1 -0
  175. package/dist/types/math/src/vector.d.ts +8 -2
  176. package/dist/types/utils/src/bbox.d.ts +1 -1
  177. package/dist/types/utils/src/index.d.ts +1 -1
  178. package/dist/types/utils/src/withinBounds.d.ts +1 -1
  179. package/history.ts +146 -109
  180. package/package.json +13 -10
  181. package/dist/dev/chunk-KKJLIRJU.js +0 -7
  182. package/dist/dev/chunk-KKJLIRJU.js.map +0 -7
  183. package/dist/dev/chunk-LEJJ2YZY.js +0 -18711
  184. package/dist/dev/chunk-LEJJ2YZY.js.map +0 -7
  185. package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
  186. package/dist/prod/chunk-IUH5AXLB.js +0 -12
  187. package/dist/prod/chunk-QUX7WTVH.js +0 -7
  188. package/dist/prod/chunk-RQK6WG4F.js +0 -33
  189. package/dist/prod/data/image-UQDATCXC.js +0 -1
  190. package/dist/types/element/src/Shape.d.ts +0 -17
  191. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  192. package/dist/types/element/src/shapes.d.ts +0 -23
  193. package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  194. package/dist/types/excalidraw/store.d.ts +0 -129
  195. package/dist/types/excalidraw/visualdebug.d.ts +0 -41
  196. package/dist/types/utils/src/collision.d.ts +0 -8
  197. /package/dist/dev/data/{image-U2IPNUKJ.js.map → image-L23D26XS.js.map} +0 -0
  198. /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-V3NQTBPG.js.map} +0 -0
@@ -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";
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,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;
@@ -14,6 +14,7 @@ type InteractiveCanvasProps = {
14
14
  selectionNonce: number | undefined;
15
15
  scale: number;
16
16
  appState: InteractiveCanvasAppState;
17
+ renderScrollbars: boolean;
17
18
  device: Device;
18
19
  renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
19
20
  handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
@@ -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;
@@ -219,4 +224,7 @@ export declare const collapseUpIcon: import("react/jsx-runtime").JSX.Element;
219
224
  export declare const upIcon: import("react/jsx-runtime").JSX.Element;
220
225
  export declare const cropIcon: import("react/jsx-runtime").JSX.Element;
221
226
  export declare const elementLinkIcon: import("react/jsx-runtime").JSX.Element;
227
+ export declare const resizeIcon: import("react/jsx-runtime").JSX.Element;
228
+ export declare const adjustmentsIcon: import("react/jsx-runtime").JSX.Element;
229
+ export declare const strokeIcon: import("react/jsx-runtime").JSX.Element;
222
230
  export {};
@@ -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";
@@ -59,4 +60,131 @@ export declare const SHAPES: readonly [{
59
60
  readonly numericKey: "0";
60
61
  readonly fillable: false;
61
62
  }];
62
- export declare const findShapeByKey: (key: string) => "line" | "ellipse" | "text" | "rectangle" | "diamond" | "image" | "selection" | "arrow" | "freedraw" | "eraser" | null;
63
+ export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
64
+ readonly icon: import("react/jsx-runtime").JSX.Element;
65
+ readonly value: "selection";
66
+ readonly key: "v";
67
+ readonly numericKey: "1";
68
+ readonly fillable: true;
69
+ }, {
70
+ readonly icon: import("react/jsx-runtime").JSX.Element;
71
+ readonly value: "rectangle";
72
+ readonly key: "r";
73
+ readonly numericKey: "2";
74
+ readonly fillable: true;
75
+ }, {
76
+ readonly icon: import("react/jsx-runtime").JSX.Element;
77
+ readonly value: "diamond";
78
+ readonly key: "d";
79
+ readonly numericKey: "3";
80
+ readonly fillable: true;
81
+ }, {
82
+ readonly icon: import("react/jsx-runtime").JSX.Element;
83
+ readonly value: "ellipse";
84
+ readonly key: "o";
85
+ readonly numericKey: "4";
86
+ readonly fillable: true;
87
+ }, {
88
+ readonly icon: import("react/jsx-runtime").JSX.Element;
89
+ readonly value: "arrow";
90
+ readonly key: "a";
91
+ readonly numericKey: "5";
92
+ readonly fillable: true;
93
+ }, {
94
+ readonly icon: import("react/jsx-runtime").JSX.Element;
95
+ readonly value: "line";
96
+ readonly key: "l";
97
+ readonly numericKey: "6";
98
+ readonly fillable: true;
99
+ }, {
100
+ readonly icon: import("react/jsx-runtime").JSX.Element;
101
+ readonly value: "freedraw";
102
+ readonly key: readonly ["p", "x"];
103
+ readonly numericKey: "7";
104
+ readonly fillable: false;
105
+ }, {
106
+ readonly icon: import("react/jsx-runtime").JSX.Element;
107
+ readonly value: "text";
108
+ readonly key: "t";
109
+ readonly numericKey: "8";
110
+ readonly fillable: false;
111
+ }, {
112
+ readonly icon: import("react/jsx-runtime").JSX.Element;
113
+ readonly value: "image";
114
+ readonly key: null;
115
+ readonly numericKey: "9";
116
+ readonly fillable: false;
117
+ }, {
118
+ readonly icon: import("react/jsx-runtime").JSX.Element;
119
+ readonly value: "eraser";
120
+ readonly key: "e";
121
+ readonly numericKey: "0";
122
+ readonly fillable: false;
123
+ }] | readonly [{
124
+ readonly value: "lasso";
125
+ readonly icon: import("react/jsx-runtime").JSX.Element;
126
+ readonly key: "v";
127
+ readonly numericKey: "1";
128
+ readonly fillable: true;
129
+ }, ...({
130
+ readonly icon: import("react/jsx-runtime").JSX.Element;
131
+ readonly value: "selection";
132
+ readonly key: "v";
133
+ readonly numericKey: "1";
134
+ readonly fillable: true;
135
+ } | {
136
+ readonly icon: import("react/jsx-runtime").JSX.Element;
137
+ readonly value: "rectangle";
138
+ readonly key: "r";
139
+ readonly numericKey: "2";
140
+ readonly fillable: true;
141
+ } | {
142
+ readonly icon: import("react/jsx-runtime").JSX.Element;
143
+ readonly value: "diamond";
144
+ readonly key: "d";
145
+ readonly numericKey: "3";
146
+ readonly fillable: true;
147
+ } | {
148
+ readonly icon: import("react/jsx-runtime").JSX.Element;
149
+ readonly value: "ellipse";
150
+ readonly key: "o";
151
+ readonly numericKey: "4";
152
+ readonly fillable: true;
153
+ } | {
154
+ readonly icon: import("react/jsx-runtime").JSX.Element;
155
+ readonly value: "arrow";
156
+ readonly key: "a";
157
+ readonly numericKey: "5";
158
+ readonly fillable: true;
159
+ } | {
160
+ readonly icon: import("react/jsx-runtime").JSX.Element;
161
+ readonly value: "line";
162
+ readonly key: "l";
163
+ readonly numericKey: "6";
164
+ readonly fillable: true;
165
+ } | {
166
+ readonly icon: import("react/jsx-runtime").JSX.Element;
167
+ readonly value: "freedraw";
168
+ readonly key: readonly ["p", "x"];
169
+ readonly numericKey: "7";
170
+ readonly fillable: false;
171
+ } | {
172
+ readonly icon: import("react/jsx-runtime").JSX.Element;
173
+ readonly value: "text";
174
+ readonly key: "t";
175
+ readonly numericKey: "8";
176
+ readonly fillable: false;
177
+ } | {
178
+ readonly icon: import("react/jsx-runtime").JSX.Element;
179
+ readonly value: "image";
180
+ readonly key: null;
181
+ readonly numericKey: "9";
182
+ readonly fillable: false;
183
+ } | {
184
+ readonly icon: import("react/jsx-runtime").JSX.Element;
185
+ readonly value: "eraser";
186
+ readonly key: "e";
187
+ readonly numericKey: "0";
188
+ readonly fillable: false;
189
+ })[]];
190
+ export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "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 = {
@@ -1,7 +1,7 @@
1
1
  import type { VERSIONS } from "@excalidraw/common";
2
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
3
  import type { cleanAppStateForExport } from "../appState";
4
- import type { AppState, BinaryFiles, LibraryItems, LibraryItems_anyVersion } from "../types";
4
+ import type { AppState, BinaryFiles, LibraryItem, LibraryItems, LibraryItems_anyVersion } from "../types";
5
5
  export interface ExportedDataState {
6
6
  type: string;
7
7
  version: number;
@@ -43,3 +43,6 @@ export interface ImportedLibraryData extends Partial<ExportedLibraryData> {
43
43
  /** @deprecated v1 */
44
44
  library?: LibraryItems;
45
45
  }
46
+ export type ExcalidrawLibraryIds = {
47
+ itemIds: LibraryItem["id"][];
48
+ };
@@ -1,14 +1,14 @@
1
- import { atom, createStore, type PrimitiveAtom } from "jotai";
1
+ import { atom, createStore, type PrimitiveAtom, type WritableAtom } from "jotai";
2
2
  import { createIsolation } from "jotai-scope";
3
- export { atom, PrimitiveAtom };
3
+ export { atom, PrimitiveAtom, WritableAtom };
4
4
  export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof import("jotai").useSetAtom, useAtomValue: typeof import("jotai").useAtomValue, useStore: (options?: {
5
5
  store?: {
6
6
  get: <Value>(atom: import("jotai").Atom<Value>) => Value;
7
- set: <Value_1, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
7
+ set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
8
8
  sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
9
9
  } | ({
10
10
  get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
11
- set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: import("jotai").WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
11
+ set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
12
12
  sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
13
13
  } & {
14
14
  dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
@@ -29,11 +29,11 @@ export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof
29
29
  }) | undefined;
30
30
  } | undefined) => {
31
31
  get: <Value_3>(atom: import("jotai").Atom<Value_3>) => Value_3;
32
- set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom: import("jotai").WritableAtom<Value_1_2, Args_2, Result_2>, ...args: Args_2) => Result_2;
32
+ set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom: WritableAtom<Value_1_2, Args_2, Result_2>, ...args: Args_2) => Result_2;
33
33
  sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
34
34
  } | ({
35
35
  get: <Value_4>(atom: import("jotai").Atom<Value_4>) => Value_4;
36
- set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom: import("jotai").WritableAtom<Value_1_3, Args_3, Result_3>, ...args: Args_3) => Result_3;
36
+ set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom: WritableAtom<Value_1_3, Args_3, Result_3>, ...args: Args_3) => Result_3;
37
37
  sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
38
38
  } & {
39
39
  dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
@@ -4,8 +4,6 @@ import type App from "../components/App";
4
4
  export declare class EraserTrail extends AnimatedTrail {
5
5
  private elementsToErase;
6
6
  private groupsToErase;
7
- private segmentsCache;
8
- private geometricShapesCache;
9
7
  constructor(animationFrameHandler: AnimationFrameHandler, app: App);
10
8
  startPath(x: number, y: number): void;
11
9
  addPointToPath(x: number, y: number, restore?: boolean): string[];
@@ -1,7 +1,7 @@
1
1
  import { type FontMetadata } from "@excalidraw/common";
2
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
+ import type { Scene } from "@excalidraw/element";
3
4
  import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
4
- import type Scene from "../scene/Scene";
5
5
  export declare class Fonts {
6
6
  static readonly loadedFontsCache: Set<string>;
7
7
  private static _registered;
@@ -1,40 +1,48 @@
1
+ import { Emitter } from "@excalidraw/common";
2
+ import { StoreDelta } from "@excalidraw/element";
3
+ import type { StoreSnapshot, Store } from "@excalidraw/element";
1
4
  import type { SceneElementsMap } from "@excalidraw/element/types";
2
- import { Emitter } from "./emitter";
3
- import type { AppStateChange, ElementsChange } from "./change";
4
- import type { Snapshot } from "./store";
5
5
  import type { AppState } from "./types";
6
+ export declare class HistoryDelta extends StoreDelta {
7
+ /**
8
+ * Apply the delta to the passed elements and appState, does not modify the snapshot.
9
+ */
10
+ applyTo(elements: SceneElementsMap, appState: AppState, snapshot: StoreSnapshot): [SceneElementsMap, AppState, boolean];
11
+ /**
12
+ * Overriding once to avoid type casting everywhere.
13
+ */
14
+ static calculate(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): HistoryDelta;
15
+ /**
16
+ * Overriding once to avoid type casting everywhere.
17
+ */
18
+ static inverse(delta: StoreDelta): HistoryDelta;
19
+ /**
20
+ * Overriding once to avoid type casting everywhere.
21
+ */
22
+ static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): HistoryDelta;
23
+ }
6
24
  export declare class HistoryChangedEvent {
7
25
  readonly isUndoStackEmpty: boolean;
8
26
  readonly isRedoStackEmpty: boolean;
9
27
  constructor(isUndoStackEmpty?: boolean, isRedoStackEmpty?: boolean);
10
28
  }
11
29
  export declare class History {
30
+ private readonly store;
12
31
  readonly onHistoryChangedEmitter: Emitter<[HistoryChangedEvent]>;
13
- private readonly undoStack;
14
- private readonly redoStack;
32
+ readonly undoStack: HistoryDelta[];
33
+ readonly redoStack: HistoryDelta[];
15
34
  get isUndoStackEmpty(): boolean;
16
35
  get isRedoStackEmpty(): boolean;
36
+ constructor(store: Store);
17
37
  clear(): void;
18
38
  /**
19
- * Record a local change which will go into the history
39
+ * Record a non-empty local durable increment, which will go into the undo stack..
40
+ * Do not re-record history entries, which were already pushed to undo / redo stack, as part of history action.
20
41
  */
21
- record(elementsChange: ElementsChange, appStateChange: AppStateChange): void;
22
- undo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>): void | [SceneElementsMap, AppState];
23
- redo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>): void | [SceneElementsMap, AppState];
42
+ record(delta: StoreDelta): void;
43
+ undo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
44
+ redo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
24
45
  private perform;
25
46
  private static pop;
26
47
  private static push;
27
48
  }
28
- export declare class HistoryEntry {
29
- readonly appStateChange: AppStateChange;
30
- readonly elementsChange: ElementsChange;
31
- private constructor();
32
- static create(appStateChange: AppStateChange, elementsChange: ElementsChange): HistoryEntry;
33
- inverse(): HistoryEntry;
34
- applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>): [SceneElementsMap, AppState, boolean];
35
- /**
36
- * Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`.
37
- */
38
- applyLatestChanges(elements: SceneElementsMap): HistoryEntry;
39
- isEmpty(): boolean;
40
- }
@@ -1,2 +1,2 @@
1
- import type { Emitter } from "../emitter";
1
+ import type { Emitter } from "@excalidraw/common";
2
2
  export declare const useEmitter: <TEvent extends unknown>(emitter: Emitter<[TEvent]>, initialState: TEvent) => TEvent;
@@ -3,7 +3,7 @@ export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
3
3
  export declare const libraryItemSvgsCache: import("jotai/vanilla/atom").PrimitiveAtom<SvgCache> & {
4
4
  init: SvgCache;
5
5
  };
6
- export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache) => SVGSVGElement | undefined;
6
+ export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache, ref: React.RefObject<HTMLDivElement | null>) => SVGSVGElement | undefined;
7
7
  export declare const useLibraryCache: () => {
8
8
  clearLibraryCache: () => void;
9
9
  deleteItemsFromLibraryCache: (items: LibraryItem["id"][]) => void;
@@ -0,0 +1,14 @@
1
+ export type CaretPosition = {
2
+ start: number;
3
+ end: number;
4
+ };
5
+ export declare const saveCaretPosition: () => CaretPosition | null;
6
+ export declare const restoreCaretPosition: (position: CaretPosition | null) => void;
7
+ export declare const withCaretPositionPreservation: (callback: () => void, isCompactMode: boolean, isEditingText: boolean, onPreventClose?: () => void) => void;
8
+ export declare const useTextEditorFocus: () => {
9
+ saveCaretPosition: () => void;
10
+ restoreCaretPosition: () => void;
11
+ clearSavedPosition: () => void;
12
+ hasSavedPosition: boolean;
13
+ };
14
+ export declare const temporarilyDisableTextEditorBlur: (duration?: number) => void;
@@ -9,26 +9,27 @@ import "./fonts/fonts.css";
9
9
  import type { ExcalidrawProps } from "./types";
10
10
  export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
11
11
  export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@excalidraw/element";
12
- export { getTextFromElements } from "@excalidraw/element/textElement";
13
- export { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers";
12
+ export { getTextFromElements } from "@excalidraw/element";
13
+ export { isInvisiblySmallElement } from "@excalidraw/element";
14
14
  export { defaultLang, useI18n, languages } from "./i18n";
15
- export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
15
+ export { restore, restoreAppState, restoreElement, restoreElements, restoreLibraryItems, } from "./data/restore";
16
16
  export { reconcileElements } from "./data/reconcile";
17
17
  export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
18
18
  export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
19
19
  export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
20
- export { getFreeDrawSvgPath } from "@excalidraw/element/renderElement";
20
+ export { getFreeDrawSvgPath } from "@excalidraw/element";
21
21
  export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
22
- export { isLinearElement } from "@excalidraw/element/typeChecks";
22
+ export { isLinearElement } from "@excalidraw/element";
23
23
  export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, } from "@excalidraw/common";
24
- export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element/mutateElement";
25
- export { CaptureUpdateAction } from "./store";
24
+ export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
25
+ export { CaptureUpdateAction } from "@excalidraw/element";
26
26
  export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
27
27
  export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "@excalidraw/common";
28
28
  export { Sidebar } from "./components/Sidebar/Sidebar";
29
29
  export { Button } from "./components/Button";
30
30
  export { Footer };
31
31
  export { MainMenu };
32
+ export { Ellipsify } from "./components/Ellipsify";
32
33
  export { useDevice } from "./components/App";
33
34
  export { WelcomeScreen };
34
35
  export { LiveCollaborationTrigger };
@@ -38,9 +39,9 @@ export { TTDDialog } from "./components/TTDDialog/TTDDialog";
38
39
  export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
39
40
  export { zoomToFitBounds } from "./actions/actionCanvas";
40
41
  export { convertToExcalidrawElements } from "./data/transform";
41
- export { getCommonBounds, getVisibleSceneBounds, } from "@excalidraw/element/bounds";
42
+ export { getCommonBounds, getVisibleSceneBounds } from "@excalidraw/element";
42
43
  export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "@excalidraw/utils/withinBounds";
43
44
  export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
44
45
  export { getDataURL } from "./data/blob";
45
- export { isElementLink } from "@excalidraw/element/elementLink";
46
- export { setCustomTextMetricsProvider } from "@excalidraw/element/textMeasurements";
46
+ export { isElementLink } from "@excalidraw/element";
47
+ export { setCustomTextMetricsProvider } from "@excalidraw/element";
@@ -5,6 +5,7 @@ export declare class LassoTrail extends AnimatedTrail {
5
5
  private intersectedElements;
6
6
  private enclosedElements;
7
7
  private elementsSegments;
8
+ private canvasTranslate;
8
9
  private keepPreviousSelection;
9
10
  constructor(animationFrameHandler: AnimationFrameHandler, app: App);
10
11
  startPath(x: number, y: number, keepPreviousSelection?: boolean): void;