@excalidraw/excalidraw 0.18.0-a30e1b2 → 0.18.0-a8acc82

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-6MX365WZ.js +5666 -0
  2. package/dist/dev/chunk-6MX365WZ.js.map +7 -0
  3. package/dist/dev/chunk-CP5DND7P.js +7 -0
  4. package/dist/dev/chunk-CP5DND7P.js.map +7 -0
  5. package/dist/dev/{chunk-CARD3WJZ.js → chunk-QF5FRM6O.js} +7 -2
  6. package/dist/dev/chunk-QF5FRM6O.js.map +7 -0
  7. package/dist/dev/data/{image-AYLHSOBV.js → image-GQCFJKGM.js} +3 -3
  8. package/dist/dev/index.css +187 -21
  9. package/dist/dev/index.css.map +3 -3
  10. package/dist/dev/index.js +15073 -16288
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-E3O5XSXJ.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-I4UNSFV6.js +12 -0
  17. package/dist/prod/chunk-R2M7VUMD.js +4 -0
  18. package/dist/prod/data/image-JWK7QZ22.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +27 -20
  21. package/dist/prod/locales/{en-44IKVKYT.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 +38 -7
  25. package/dist/types/common/src/utils.d.ts +7 -5
  26. package/dist/types/element/src/Scene.d.ts +10 -6
  27. package/dist/types/element/src/align.d.ts +3 -2
  28. package/dist/types/element/src/binding.d.ts +11 -8
  29. package/dist/types/element/src/bounds.d.ts +12 -4
  30. package/dist/types/element/src/collision.d.ts +18 -12
  31. package/dist/types/element/src/cropElement.d.ts +1 -1
  32. package/dist/types/element/src/delta.d.ts +41 -9
  33. package/dist/types/element/src/distance.d.ts +2 -2
  34. package/dist/types/element/src/distribute.d.ts +2 -1
  35. package/dist/types/element/src/dragElements.d.ts +1 -1
  36. package/dist/types/element/src/flowchart.d.ts +1 -1
  37. package/dist/types/element/src/fractionalIndex.d.ts +8 -2
  38. package/dist/types/element/src/frame.d.ts +2 -2
  39. package/dist/types/element/src/groups.d.ts +1 -0
  40. package/dist/types/element/src/index.d.ts +42 -0
  41. package/dist/types/element/src/linearElementEditor.d.ts +15 -24
  42. package/dist/types/element/src/mutateElement.d.ts +1 -1
  43. package/dist/types/element/src/newElement.d.ts +3 -2
  44. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  45. package/dist/types/element/src/renderElement.d.ts +4 -1
  46. package/dist/types/element/src/resizeElements.d.ts +2 -1
  47. package/dist/types/element/src/selection.d.ts +0 -5
  48. package/dist/types/element/src/shape.d.ts +42 -0
  49. package/dist/types/element/src/sizeHelpers.d.ts +2 -1
  50. package/dist/types/element/src/store.d.ts +19 -9
  51. package/dist/types/element/src/textElement.d.ts +2 -2
  52. package/dist/types/element/src/transformHandles.d.ts +2 -2
  53. package/dist/types/element/src/typeChecks.d.ts +16 -1
  54. package/dist/types/element/src/types.d.ts +10 -4
  55. package/dist/types/element/src/utils.d.ts +16 -6
  56. package/dist/types/element/src/zindex.d.ts +3 -3
  57. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +24 -15
  58. package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
  59. package/dist/types/excalidraw/actions/actionBoundText.d.ts +16 -10
  60. package/dist/types/excalidraw/actions/actionCanvas.d.ts +134 -94
  61. package/dist/types/excalidraw/actions/actionClipboard.d.ts +53 -33
  62. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +8 -5
  63. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +27 -17
  64. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
  65. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  66. package/dist/types/excalidraw/actions/actionElementLink.d.ts +8 -5
  67. package/dist/types/excalidraw/actions/actionElementLock.d.ts +31 -26
  68. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +8 -5
  69. package/dist/types/excalidraw/actions/actionExport.d.ts +94 -67
  70. package/dist/types/excalidraw/actions/actionFinalize.d.ts +66 -19
  71. package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
  72. package/dist/types/excalidraw/actions/actionFrame.d.ts +81 -69
  73. package/dist/types/excalidraw/actions/actionGroup.d.ts +20 -14
  74. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +534 -7
  75. package/dist/types/excalidraw/actions/actionLink.d.ts +10 -7
  76. package/dist/types/excalidraw/actions/actionMenu.d.ts +26 -17
  77. package/dist/types/excalidraw/actions/actionNavigate.d.ts +16 -10
  78. package/dist/types/excalidraw/actions/actionProperties.d.ts +145 -83
  79. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +10 -7
  80. package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -9
  81. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +10 -7
  82. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +10 -7
  83. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -7
  84. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +10 -7
  85. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +10 -7
  86. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +10 -7
  87. package/dist/types/excalidraw/actions/actionZindex.d.ts +10 -10
  88. package/dist/types/excalidraw/actions/index.d.ts +1 -1
  89. package/dist/types/excalidraw/actions/types.d.ts +3 -2
  90. package/dist/types/excalidraw/appState.d.ts +20 -10
  91. package/dist/types/excalidraw/clipboard.d.ts +64 -1
  92. package/dist/types/excalidraw/components/Actions.d.ts +8 -5
  93. package/dist/types/excalidraw/components/App.d.ts +22 -21
  94. package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  95. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  96. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +7 -2
  97. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  98. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
  99. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
  100. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
  101. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  102. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  103. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  104. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -28
  105. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  106. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  107. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  108. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +2 -1
  109. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  110. package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  111. package/dist/types/excalidraw/components/Range.d.ts +3 -3
  112. package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  113. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  114. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  115. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  116. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  117. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  118. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  119. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  120. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  121. package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
  122. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  123. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  124. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -1
  125. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  126. package/dist/types/excalidraw/components/icons.d.ts +9 -0
  127. package/dist/types/excalidraw/components/shapes.d.ts +129 -1
  128. package/dist/types/excalidraw/data/blob.d.ts +3 -7
  129. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  130. package/dist/types/excalidraw/data/restore.d.ts +6 -1
  131. package/dist/types/excalidraw/data/transform.d.ts +1 -1
  132. package/dist/types/excalidraw/data/types.d.ts +4 -1
  133. package/dist/types/excalidraw/eraser/index.d.ts +0 -2
  134. package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
  135. package/dist/types/excalidraw/history.d.ts +21 -5
  136. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  137. package/dist/types/excalidraw/index.d.ts +11 -10
  138. package/dist/types/excalidraw/lasso/index.d.ts +1 -0
  139. package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
  140. package/dist/types/excalidraw/renderer/helpers.d.ts +4 -4
  141. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  142. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
  143. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  144. package/dist/types/excalidraw/snapping.d.ts +2 -2
  145. package/dist/types/excalidraw/types.d.ts +24 -13
  146. package/dist/types/math/src/angle.d.ts +2 -0
  147. package/dist/types/math/src/constants.d.ts +3 -0
  148. package/dist/types/math/src/curve.d.ts +32 -0
  149. package/dist/types/math/src/index.d.ts +1 -0
  150. package/dist/types/math/src/point.d.ts +1 -1
  151. package/dist/types/math/src/rectangle.d.ts +2 -0
  152. package/dist/types/math/src/segment.d.ts +1 -0
  153. package/dist/types/math/src/vector.d.ts +4 -2
  154. package/dist/types/utils/src/bbox.d.ts +1 -1
  155. package/dist/types/utils/src/index.d.ts +1 -1
  156. package/dist/types/utils/src/withinBounds.d.ts +1 -1
  157. package/history.ts +108 -45
  158. package/package.json +13 -10
  159. package/dist/dev/chunk-CARD3WJZ.js.map +0 -7
  160. package/dist/dev/chunk-ETWEPOFC.js +0 -18701
  161. package/dist/dev/chunk-ETWEPOFC.js.map +0 -7
  162. package/dist/dev/chunk-RS23HYC4.js +0 -7
  163. package/dist/dev/chunk-RS23HYC4.js.map +0 -7
  164. package/dist/prod/chunk-6BSJPDKJ.js +0 -33
  165. package/dist/prod/chunk-FGHASORR.js +0 -12
  166. package/dist/prod/chunk-SBKTMZM7.js +0 -7
  167. package/dist/prod/data/image-VAYKYPXV.js +0 -1
  168. package/dist/types/element/src/Shape.d.ts +0 -17
  169. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  170. package/dist/types/element/src/shapes.d.ts +0 -23
  171. package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  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-AYLHSOBV.js.map → image-GQCFJKGM.js.map} +0 -0
  175. /package/dist/dev/locales/{en-E3O5XSXJ.js.map → en-SMAPCEOQ.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
- import type Scene from "@excalidraw/element/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,5 +1,5 @@
1
1
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "@excalidraw/element/Scene";
2
+ import type { Scene } from "@excalidraw/element";
3
3
  import type { AtomicUnit } from "./utils";
4
4
  import type { AppState } from "../../types";
5
5
  interface MultiPositionProps {
@@ -1,5 +1,5 @@
1
1
  import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "@excalidraw/element/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,5 +1,5 @@
1
1
  import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type Scene from "@excalidraw/element/Scene";
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;
@@ -0,0 +1,8 @@
1
+ import "./UnlockPopup.scss";
2
+ import type App from "./App";
3
+ import type { AppState } from "../types";
4
+ declare const UnlockPopup: ({ app, activeLockedId, }: {
5
+ app: App;
6
+ activeLockedId: NonNullable<AppState["activeLockedId"]>;
7
+ }) => import("react/jsx-runtime").JSX.Element | null;
8
+ export default UnlockPopup;
@@ -1,4 +1,4 @@
1
- import type Scene from "@excalidraw/element/Scene";
1
+ import type { Scene } from "@excalidraw/element";
2
2
  import type { ElementsMap, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
3
3
  import "./Hyperlink.scss";
4
4
  import type { AppState, ExcalidrawProps, UIAppState } from "../../types";
@@ -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,8 @@ 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 backgroundIcon: import("react/jsx-runtime").JSX.Element;
230
+ export declare const strokeIcon: import("react/jsx-runtime").JSX.Element;
222
231
  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
+ };
@@ -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,6 +1,6 @@
1
1
  import { type FontMetadata } from "@excalidraw/common";
2
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
3
- import type Scene from "@excalidraw/element/Scene";
3
+ import type { Scene } from "@excalidraw/element";
4
4
  import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
5
5
  export declare class Fonts {
6
6
  static readonly loadedFontsCache: Set<string>;
@@ -1,8 +1,25 @@
1
1
  import { Emitter } from "@excalidraw/common";
2
- import { StoreDelta, type Store } from "@excalidraw/element/store";
2
+ import { StoreDelta } from "@excalidraw/element";
3
+ import type { StoreSnapshot, Store } from "@excalidraw/element";
3
4
  import type { SceneElementsMap } from "@excalidraw/element/types";
4
5
  import type { AppState } from "./types";
5
- declare class HistoryEntry extends StoreDelta {
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;
6
23
  }
7
24
  export declare class HistoryChangedEvent {
8
25
  readonly isUndoStackEmpty: boolean;
@@ -12,8 +29,8 @@ export declare class HistoryChangedEvent {
12
29
  export declare class History {
13
30
  private readonly store;
14
31
  readonly onHistoryChangedEmitter: Emitter<[HistoryChangedEvent]>;
15
- readonly undoStack: HistoryEntry[];
16
- readonly redoStack: HistoryEntry[];
32
+ readonly undoStack: HistoryDelta[];
33
+ readonly redoStack: HistoryDelta[];
17
34
  get isUndoStackEmpty(): boolean;
18
35
  get isRedoStackEmpty(): boolean;
19
36
  constructor(store: Store);
@@ -29,4 +46,3 @@ export declare class History {
29
46
  private static pop;
30
47
  private static push;
31
48
  }
32
- export {};
@@ -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 "@excalidraw/element/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,8 +1,9 @@
1
1
  import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
2
- import type { ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
3
3
  export declare const getLassoSelectedElementIds: (input: {
4
4
  lassoPath: GlobalPoint[];
5
5
  elements: readonly ExcalidrawElement[];
6
+ elementsMap: ElementsMap;
6
7
  elementsSegments: ElementsSegmentsMap;
7
8
  intersectedElements: Set<ExcalidrawElement["id"]>;
8
9
  enclosedElements: Set<ExcalidrawElement["id"]>;
@@ -1,7 +1,7 @@
1
- import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "@excalidraw/element/types";
1
+ import type { ElementsMap, ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "@excalidraw/element/types";
2
2
  import type { StaticCanvasRenderConfig } from "../scene/types";
3
3
  import type { AppState, StaticCanvasAppState } from "../types";
4
- export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
4
+ export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
5
5
  export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
6
6
  export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
7
7
  canvas: HTMLCanvasElement;
@@ -12,7 +12,7 @@ export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normali
12
12
  isExporting?: boolean | undefined;
13
13
  viewBackgroundColor?: string | null | undefined;
14
14
  }) => CanvasRenderingContext2D;
15
- export declare const drawHighlightForRectWithRotation: (context: CanvasRenderingContext2D, element: ExcalidrawRectanguloidElement, padding: number) => void;
15
+ export declare const drawHighlightForRectWithRotation: (context: CanvasRenderingContext2D, element: ExcalidrawRectanguloidElement, elementsMap: ElementsMap, padding: number) => void;
16
16
  export declare const strokeEllipseWithRotation: (context: CanvasRenderingContext2D, width: number, height: number, cx: number, cy: number, angle: number) => void;
17
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) => 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 "@excalidraw/element/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,7 +1,7 @@
1
1
  import { type GlobalPoint } from "@excalidraw/math";
2
2
  import type { InclusiveRange } from "@excalidraw/math";
3
- import type { Bounds } from "@excalidraw/element/bounds";
4
- import type { MaybeTransformHandleType } from "@excalidraw/element/transformHandles";
3
+ import type { Bounds } from "@excalidraw/element";
4
+ import type { MaybeTransformHandleType } from "@excalidraw/element";
5
5
  import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
6
6
  import type { AppClassProperties, AppState, KeyboardModifiersObject } from "./types";
7
7
  export declare const getSnapDistance: (zoomValue: number) => number;