@excalidraw/excalidraw 0.18.0-6fc8502 → 0.18.0-7b8a5f54c

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 (175) 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-CRKRRBMD.js +5677 -0
  4. package/dist/dev/chunk-CRKRRBMD.js.map +7 -0
  5. package/dist/dev/{chunk-X3RYHLJU.js → chunk-QF5FRM6O.js} +15 -5
  6. package/dist/dev/chunk-QF5FRM6O.js.map +7 -0
  7. package/dist/dev/data/{image-NKFINVKH.js → image-IWGLHPIX.js} +3 -3
  8. package/dist/dev/index.css +104 -22
  9. package/dist/dev/index.css.map +3 -3
  10. package/dist/dev/index.js +15051 -15792
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-CKWC2GMK.js → en-SMAPCEOQ.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-HHV2PJKY.js +4 -0
  17. package/dist/prod/chunk-I4UNSFV6.js +12 -0
  18. package/dist/prod/data/image-4SM4COIL.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-TYY6KWIJ.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 +23 -3
  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 +17 -1
  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 +13 -5
  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 +43 -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/resizeElements.d.ts +5 -4
  51. package/dist/types/element/src/selection.d.ts +11 -5
  52. package/dist/types/element/src/shape.d.ts +42 -0
  53. package/dist/types/element/src/sizeHelpers.d.ts +2 -2
  54. package/dist/types/element/src/store.d.ts +236 -0
  55. package/dist/types/element/src/textElement.d.ts +5 -3
  56. package/dist/types/element/src/typeChecks.d.ts +19 -1
  57. package/dist/types/element/src/types.d.ts +15 -2
  58. package/dist/types/element/src/utils.d.ts +16 -6
  59. package/dist/types/element/src/zindex.d.ts +1 -1
  60. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +39 -51
  61. package/dist/types/excalidraw/actions/actionBoundText.d.ts +26 -34
  62. package/dist/types/excalidraw/actions/actionCanvas.d.ts +175 -227
  63. package/dist/types/excalidraw/actions/actionClipboard.d.ts +78 -100
  64. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -17
  65. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +39 -50
  66. package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -16
  67. package/dist/types/excalidraw/actions/actionElementLock.d.ts +41 -50
  68. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -17
  69. package/dist/types/excalidraw/actions/actionExport.d.ts +127 -163
  70. package/dist/types/excalidraw/actions/actionFinalize.d.ts +73 -40
  71. package/dist/types/excalidraw/actions/actionFrame.d.ts +99 -115
  72. package/dist/types/excalidraw/actions/actionGroup.d.ts +26 -34
  73. package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
  74. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +538 -18
  75. package/dist/types/excalidraw/actions/actionLink.d.ts +12 -16
  76. package/dist/types/excalidraw/actions/actionMenu.d.ts +36 -48
  77. package/dist/types/excalidraw/actions/actionNavigate.d.ts +25 -33
  78. package/dist/types/excalidraw/actions/actionProperties.d.ts +203 -255
  79. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +13 -17
  80. package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -17
  81. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +13 -17
  82. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -17
  83. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +12 -189
  84. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  85. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -17
  86. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +13 -17
  87. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -17
  88. package/dist/types/excalidraw/actions/types.d.ts +4 -3
  89. package/dist/types/excalidraw/appState.d.ts +19 -10
  90. package/dist/types/excalidraw/components/Actions.d.ts +0 -4
  91. package/dist/types/excalidraw/components/App.d.ts +34 -22
  92. package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  93. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  94. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
  95. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  96. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
  97. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
  98. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
  99. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  100. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  101. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  102. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  103. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
  104. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  105. package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  106. package/dist/types/excalidraw/components/Range.d.ts +3 -3
  107. package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  108. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  109. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  110. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  111. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  112. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  113. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  114. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  115. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  116. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  117. package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
  118. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
  119. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  120. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  121. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  122. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  123. package/dist/types/excalidraw/components/icons.d.ts +3 -0
  124. package/dist/types/excalidraw/components/shapes.d.ts +1 -1
  125. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  126. package/dist/types/excalidraw/data/restore.d.ts +6 -1
  127. package/dist/types/excalidraw/data/transform.d.ts +1 -1
  128. package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
  129. package/dist/types/excalidraw/eraser/index.d.ts +12 -0
  130. package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
  131. package/dist/types/excalidraw/history.d.ts +30 -22
  132. package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  133. package/dist/types/excalidraw/index.d.ts +11 -10
  134. package/dist/types/excalidraw/lasso/index.d.ts +1 -0
  135. package/dist/types/excalidraw/lasso/utils.d.ts +3 -3
  136. package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
  137. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  138. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
  139. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  140. package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
  141. package/dist/types/excalidraw/scene/types.d.ts +2 -0
  142. package/dist/types/excalidraw/snapping.d.ts +2 -2
  143. package/dist/types/excalidraw/types.d.ts +35 -14
  144. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
  145. package/dist/types/math/src/angle.d.ts +2 -0
  146. package/dist/types/math/src/constants.d.ts +3 -0
  147. package/dist/types/math/src/curve.d.ts +34 -0
  148. package/dist/types/math/src/index.d.ts +1 -0
  149. package/dist/types/math/src/point.d.ts +1 -1
  150. package/dist/types/math/src/rectangle.d.ts +2 -0
  151. package/dist/types/math/src/types.d.ts +1 -0
  152. package/dist/types/math/src/vector.d.ts +8 -2
  153. package/dist/types/utils/src/bbox.d.ts +1 -1
  154. package/dist/types/utils/src/index.d.ts +1 -1
  155. package/dist/types/utils/src/withinBounds.d.ts +1 -1
  156. package/history.ts +146 -109
  157. package/package.json +12 -9
  158. package/dist/dev/chunk-H7XJ5UVD.js +0 -7
  159. package/dist/dev/chunk-H7XJ5UVD.js.map +0 -7
  160. package/dist/dev/chunk-KYBDXI6F.js +0 -18739
  161. package/dist/dev/chunk-KYBDXI6F.js.map +0 -7
  162. package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
  163. package/dist/prod/chunk-CAN5RS4P.js +0 -31
  164. package/dist/prod/chunk-IUH5AXLB.js +0 -12
  165. package/dist/prod/chunk-KJYFYP64.js +0 -7
  166. package/dist/prod/data/image-5XD47O4X.js +0 -1
  167. package/dist/types/element/src/Shape.d.ts +0 -17
  168. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  169. package/dist/types/element/src/shapes.d.ts +0 -23
  170. package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  171. package/dist/types/excalidraw/store.d.ts +0 -129
  172. package/dist/types/excalidraw/visualdebug.d.ts +0 -41
  173. package/dist/types/utils/src/collision.d.ts +0 -8
  174. /package/dist/dev/data/{image-NKFINVKH.js.map → image-IWGLHPIX.js.map} +0 -0
  175. /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-SMAPCEOQ.js.map} +0 -0
@@ -0,0 +1,23 @@
1
+ import type { ConvertibleTypes, ExcalidrawElement, ExcalidrawTextContainer, ExcalidrawTextElementWithContainer } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
3
+ import "./ConvertElementTypePopup.scss";
4
+ import type App from "./App";
5
+ export declare const convertElementTypePopupAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
6
+ type: "panel";
7
+ } | null> & {
8
+ init: {
9
+ type: "panel";
10
+ } | null;
11
+ };
12
+ declare const ConvertElementTypePopup: ({ app }: {
13
+ app: App;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const adjustBoundTextSize: (container: ExcalidrawTextContainer, boundText: ExcalidrawTextElementWithContainer, scene: Scene) => void;
16
+ type ConversionType = "generic" | "linear" | null;
17
+ export declare const convertElementTypes: (app: App, { conversionType, nextType, direction, }: {
18
+ conversionType: ConversionType;
19
+ nextType?: ConvertibleTypes | undefined;
20
+ direction?: "left" | "right" | undefined;
21
+ }) => boolean;
22
+ export declare const getConversionTypeFromElements: (elements: ExcalidrawElement[]) => ConversionType;
23
+ export default ConvertElementTypePopup;
@@ -1,10 +1,11 @@
1
- import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
2
3
  import "./ElementLinkDialog.scss";
3
4
  import type { AppProps, UIAppState } from "../types";
4
- declare const ElementLinkDialog: ({ sourceElementId, onClose, elementsMap, appState, generateLinkForSelection, }: {
5
+ declare const ElementLinkDialog: ({ sourceElementId, onClose, appState, scene, generateLinkForSelection, }: {
5
6
  sourceElementId: ExcalidrawElement["id"];
6
- elementsMap: ElementsMap;
7
7
  appState: UIAppState;
8
+ scene: Scene;
8
9
  onClose?: (() => void) | undefined;
9
10
  generateLinkForSelection: AppProps["generateLinkForSelection"];
10
11
  }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const Ellipsify: ({ children, ...rest }: {
3
+ children: React.ReactNode;
4
+ } & import("react").HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type { JSX } from "react";
2
- export declare const ButtonIconSelect: <T extends Object>(props: {
2
+ export declare const RadioSelection: <T extends Object>(props: {
3
3
  options: {
4
4
  value: T;
5
5
  text: string;
@@ -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;
@@ -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,5 +1,5 @@
1
1
  /// <reference types="react" />
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: "gridStep";
@@ -5,6 +5,7 @@ interface CollapsibleProps {
5
5
  openTrigger: () => void;
6
6
  children: React.ReactNode;
7
7
  className?: string;
8
+ showCollapsedIcon?: boolean;
8
9
  }
9
- declare const Collapsible: ({ label, open, openTrigger, children, className, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
10
+ declare const Collapsible: ({ label, open, openTrigger, children, className, showCollapsedIcon, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
10
11
  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,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
3
+ import type { Scene } from "@excalidraw/element";
4
+ import { useApp, useExcalidrawSetAppState } from "../App";
3
5
  import "./DragInput.scss";
4
6
  import type { StatsInputProperty } from "./utils";
5
- import type Scene from "../../scene/Scene";
6
7
  import type { AppState } from "../../types";
7
8
  export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawElement> = (props: {
8
9
  accumulatedChange: number;
@@ -16,6 +17,14 @@ export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawEl
16
17
  property: P;
17
18
  originalAppState: AppState;
18
19
  setInputValue: (value: number) => void;
20
+ app: ReturnType<typeof useApp>;
21
+ setAppState: ReturnType<typeof useExcalidrawSetAppState>;
22
+ }) => void;
23
+ export type DragFinishedCallbackType<E = ExcalidrawElement> = (props: {
24
+ app: ReturnType<typeof useApp>;
25
+ setAppState: ReturnType<typeof useExcalidrawSetAppState>;
26
+ originalElements: readonly E[] | null;
27
+ originalAppState: AppState;
19
28
  }) => void;
20
29
  interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElement> {
21
30
  label: string | React.ReactNode;
@@ -30,6 +39,7 @@ interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElemen
30
39
  appState: AppState;
31
40
  /** how many px you need to drag to get 1 unit change */
32
41
  sensitivity?: number;
42
+ dragFinishedCallback?: DragFinishedCallbackType;
33
43
  }
34
- 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;
44
+ 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;
35
45
  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";
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;
@@ -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
+ 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;
@@ -12,8 +12,10 @@ 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
14
  export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
15
+ export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
15
16
  export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
16
17
  export declare const LockedIcon: import("react/jsx-runtime").JSX.Element;
18
+ export declare const LockedIconFilled: import("react/jsx-runtime").JSX.Element;
17
19
  export declare const WelcomeScreenMenuArrow: import("react/jsx-runtime").JSX.Element;
18
20
  export declare const WelcomeScreenHelpArrow: import("react/jsx-runtime").JSX.Element;
19
21
  export declare const WelcomeScreenTopToolbarArrow: import("react/jsx-runtime").JSX.Element;
@@ -54,6 +56,7 @@ export declare const LoadIcon: import("react/jsx-runtime").JSX.Element;
54
56
  export declare const clipboard: import("react/jsx-runtime").JSX.Element;
55
57
  export declare const palette: import("react/jsx-runtime").JSX.Element;
56
58
  export declare const bucketFillIcon: import("react/jsx-runtime").JSX.Element;
59
+ export declare const slashIcon: import("react/jsx-runtime").JSX.Element;
57
60
  export declare const ExportImageIcon: import("react/jsx-runtime").JSX.Element;
58
61
  export declare const exportToFileIcon: import("react/jsx-runtime").JSX.Element;
59
62
  export declare const zoomIn: import("react/jsx-runtime").JSX.Element;
@@ -59,4 +59,4 @@ export declare const SHAPES: readonly [{
59
59
  readonly numericKey: "0";
60
60
  readonly fillable: false;
61
61
  }];
62
- export declare const findShapeByKey: (key: string) => "line" | "ellipse" | "text" | "rectangle" | "diamond" | "image" | "selection" | "arrow" | "freedraw" | "eraser" | null;
62
+ export declare const findShapeByKey: (key: string) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | null;
@@ -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,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>, {
@@ -0,0 +1,12 @@
1
+ import { AnimatedTrail } from "../animated-trail";
2
+ import type { AnimationFrameHandler } from "../animation-frame-handler";
3
+ import type App from "../components/App";
4
+ export declare class EraserTrail extends AnimatedTrail {
5
+ private elementsToErase;
6
+ private groupsToErase;
7
+ constructor(animationFrameHandler: AnimationFrameHandler, app: App);
8
+ startPath(x: number, y: number): void;
9
+ addPointToPath(x: number, y: number, restore?: boolean): string[];
10
+ private updateElementsToBeErased;
11
+ endPath(): void;
12
+ }
@@ -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;
@@ -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;
@@ -1,9 +1,9 @@
1
- import type { GlobalPoint, LineSegment } from "@excalidraw/math/types";
2
- import type { ExcalidrawElement } from "@excalidraw/element/types";
3
- export type ElementsSegmentsMap = Map<string, LineSegment<GlobalPoint>[]>;
1
+ import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
2
+ import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
4
3
  export declare const getLassoSelectedElementIds: (input: {
5
4
  lassoPath: GlobalPoint[];
6
5
  elements: readonly ExcalidrawElement[];
6
+ elementsMap: ElementsMap;
7
7
  elementsSegments: ElementsSegmentsMap;
8
8
  intersectedElements: Set<ExcalidrawElement["id"]>;
9
9
  enclosedElements: Set<ExcalidrawElement["id"]>;
@@ -1,6 +1,7 @@
1
+ import type { ElementsMap, ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "@excalidraw/element/types";
1
2
  import type { StaticCanvasRenderConfig } from "../scene/types";
2
- import type { StaticCanvasAppState, AppState } from "../types";
3
- export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
3
+ import type { AppState, StaticCanvasAppState } from "../types";
4
+ export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
4
5
  export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
5
6
  export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
6
7
  canvas: HTMLCanvasElement;
@@ -11,3 +12,7 @@ export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normali
11
12
  isExporting?: boolean | undefined;
12
13
  viewBackgroundColor?: string | null | undefined;
13
14
  }) => CanvasRenderingContext2D;
15
+ export declare const drawHighlightForRectWithRotation: (context: CanvasRenderingContext2D, element: ExcalidrawRectanguloidElement, elementsMap: ElementsMap, padding: number) => void;
16
+ export declare const strokeEllipseWithRotation: (context: CanvasRenderingContext2D, width: number, height: number, cx: number, cy: number, angle: number) => void;
17
+ export declare const strokeRectWithRotation: (context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, cx: number, cy: number, angle: number, fill?: boolean, radius?: number) => void;
18
+ export declare const drawHighlightForDiamondWithRotation: (context: CanvasRenderingContext2D, padding: number, element: ExcalidrawDiamondElement, elementsMap: ElementsMap) => void;
@@ -1,4 +1,7 @@
1
- import type { StaticSceneRenderConfig } from "../scene/types";
1
+ import type { ExcalidrawFrameLikeElement } from "@excalidraw/element/types";
2
+ import type { StaticCanvasRenderConfig, StaticSceneRenderConfig } from "../scene/types";
3
+ import type { StaticCanvasAppState } from "../types";
4
+ export declare const frameClip: (frame: ExcalidrawFrameLikeElement, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState) => void;
2
5
  /** throttled to animation framerate */
3
6
  export declare const renderStaticSceneThrottled: {
4
7
  (config: StaticSceneRenderConfig): void;
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "./Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AppState } from "../types";
4
4
  export declare class Renderer {
5
5
  private scene;
@@ -16,7 +16,6 @@ export declare class Renderer {
16
16
  /** note: first render of newElement will always bust the cache
17
17
  * (we'd have to prefilter elements outside of this function) */
18
18
  newElementId: ExcalidrawElement["id"] | undefined;
19
- pendingImageElementId: AppState["pendingImageElementId"];
20
19
  sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
21
20
  }) => {
22
21
  elementsMap: Map<string, NonDeletedExcalidrawElement> & import("@excalidraw/common/utility-types").MakeBrand<"NonDeletedElementsMap"> & import("@excalidraw/common/utility-types").MakeBrand<"RenderableElementsMap">;
@@ -1,4 +1,4 @@
1
- export { isSomeElementSelected, getElementsWithinSelection, getCommonAttributeOfSelectedElements, getSelectedElements, getTargetElements, } from "@excalidraw/element/selection";
1
+ export { isSomeElementSelected, getElementsWithinSelection, getSelectedElements, getTargetElements, } from "@excalidraw/element";
2
2
  export { calculateScrollCenter } from "./scroll";
3
- export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element/comparisons";
3
+ export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element";
4
4
  export { getNormalizedZoom, getNormalizedGridSize, getNormalizedGridStep, } from "./normalize";
@@ -1,10 +1,9 @@
1
- import type { ExcalidrawElement } from "@excalidraw/element/types";
2
1
  import type { InteractiveCanvasAppState } from "../types";
3
- import type { ScrollBars } from "./types";
2
+ import type { RenderableElementsMap, ScrollBars } from "./types";
4
3
  export declare const SCROLLBAR_MARGIN = 4;
5
4
  export declare const SCROLLBAR_WIDTH = 6;
6
5
  export declare const SCROLLBAR_COLOR = "rgba(0,0,0,0.3)";
7
- export declare const getScrollBars: (elements: readonly ExcalidrawElement[], viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
6
+ export declare const getScrollBars: (elements: RenderableElementsMap, viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
8
7
  export declare const isOverScrollBars: (scrollBars: ScrollBars, x: number, y: number) => {
9
8
  isOverEither: boolean;
10
9
  isOverHorizontal: boolean;