@zsviczian/excalidraw 0.17.1-obsidian-14 → 0.17.1-obsidian-16

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 (74) hide show
  1. package/dist/excalidraw.development.js +118 -96
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/styles.development.css +405 -357
  4. package/dist/styles.production.css +12 -12
  5. package/package.json +2 -2
  6. package/types/excalidraw/actions/actionAddToLibrary.d.ts +6 -6
  7. package/types/excalidraw/actions/actionBoundText.d.ts +4 -4
  8. package/types/excalidraw/actions/actionCanvas.d.ts +28 -28
  9. package/types/excalidraw/actions/actionClipboard.d.ts +14 -14
  10. package/types/excalidraw/actions/actionDeleteSelected.d.ts +7 -7
  11. package/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
  12. package/types/excalidraw/actions/actionElementLock.d.ts +4 -4
  13. package/types/excalidraw/actions/actionExport.d.ts +18 -18
  14. package/types/excalidraw/actions/actionFinalize.d.ts +4 -4
  15. package/types/excalidraw/actions/actionFrame.d.ts +6 -6
  16. package/types/excalidraw/actions/actionGroup.d.ts +4 -4
  17. package/types/excalidraw/actions/actionLinearEditor.d.ts +2 -2
  18. package/types/excalidraw/actions/actionLink.d.ts +197 -0
  19. package/types/excalidraw/actions/actionMenu.d.ts +6 -6
  20. package/types/excalidraw/actions/actionNavigate.d.ts +4 -4
  21. package/types/excalidraw/actions/actionProperties.d.ts +26 -26
  22. package/types/excalidraw/actions/actionSelectAll.d.ts +2 -2
  23. package/types/excalidraw/actions/actionStyles.d.ts +2 -2
  24. package/types/excalidraw/actions/actionToggleGridMode.d.ts +2 -2
  25. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +2 -2
  26. package/types/excalidraw/actions/actionToggleStats.d.ts +2 -2
  27. package/types/excalidraw/actions/actionToggleViewMode.d.ts +2 -2
  28. package/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -2
  29. package/types/excalidraw/actions/index.d.ts +1 -1
  30. package/types/excalidraw/animated-trail.d.ts +1 -1
  31. package/types/excalidraw/appState.d.ts +1 -1
  32. package/types/excalidraw/components/App.d.ts +3 -0
  33. package/types/excalidraw/components/Button.d.ts +1 -0
  34. package/types/excalidraw/components/FilledButton.d.ts +2 -2
  35. package/types/excalidraw/components/ImageExportDialog.d.ts +2 -1
  36. package/types/excalidraw/components/LaserTool/LaserPathManager.d.ts +28 -0
  37. package/types/excalidraw/components/LaserTool/LaserPointerButton.d.ts +10 -0
  38. package/types/excalidraw/components/LaserTool/LaserTool.d.ts +7 -0
  39. package/types/excalidraw/components/ProjectName.d.ts +0 -1
  40. package/types/excalidraw/components/TextField.d.ts +5 -2
  41. package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +18 -0
  42. package/types/excalidraw/components/hyperlink/helpers.d.ts +7 -0
  43. package/types/excalidraw/constants.d.ts +5 -0
  44. package/types/excalidraw/data/filesystem.d.ts +1 -1
  45. package/types/excalidraw/data/index.d.ts +2 -1
  46. package/types/excalidraw/data/json.d.ts +1 -1
  47. package/types/excalidraw/data/resave.d.ts +1 -1
  48. package/types/excalidraw/element/ElementCanvasButtons.d.ts +3 -2
  49. package/types/excalidraw/element/binding.d.ts +9 -9
  50. package/types/excalidraw/element/bounds.d.ts +6 -6
  51. package/types/excalidraw/element/collision.d.ts +8 -8
  52. package/types/excalidraw/element/embeddable.d.ts +2 -2
  53. package/types/excalidraw/element/linearElementEditor.d.ts +30 -30
  54. package/types/excalidraw/element/newElement.d.ts +4 -4
  55. package/types/excalidraw/element/resizeElements.d.ts +1 -1
  56. package/types/excalidraw/element/resizeTest.d.ts +3 -3
  57. package/types/excalidraw/element/sizeHelpers.d.ts +2 -2
  58. package/types/excalidraw/element/textElement.d.ts +5 -5
  59. package/types/excalidraw/element/transformHandles.d.ts +2 -2
  60. package/types/excalidraw/example/App.d.ts +14 -0
  61. package/types/excalidraw/example/CustomFooter.d.ts +5 -0
  62. package/types/excalidraw/example/MobileFooter.d.ts +5 -0
  63. package/types/excalidraw/example/index.d.ts +1 -0
  64. package/types/excalidraw/example/initialData.d.ts +290 -0
  65. package/types/excalidraw/example/sidebar/ExampleSidebar.d.ts +4 -0
  66. package/types/excalidraw/frame.d.ts +11 -11
  67. package/types/excalidraw/history.d.ts +1 -1
  68. package/types/excalidraw/scene/Scene.d.ts +2 -7
  69. package/types/excalidraw/scene/scrollbars.d.ts +3 -2
  70. package/types/excalidraw/scene/selection.d.ts +3 -3
  71. package/types/excalidraw/snapping.d.ts +7 -7
  72. package/types/excalidraw/types.d.ts +5 -3
  73. package/types/excalidraw/vite.config.d.mts +2 -0
  74. package/types/utils/index.d.ts +1 -0
@@ -0,0 +1,290 @@
1
+ import type { ExcalidrawElementSkeleton } from "../data/transform";
2
+ declare const _default: {
3
+ elements: ExcalidrawElementSkeleton[];
4
+ appState: {
5
+ viewBackgroundColor: string;
6
+ currentItemFontFamily: number;
7
+ };
8
+ scrollToContent: boolean;
9
+ libraryItems: ({
10
+ type: string;
11
+ x: number;
12
+ y: number;
13
+ strokeColor: string;
14
+ backgroundColor: string;
15
+ width: number;
16
+ height: number;
17
+ strokeSharpness: string;
18
+ points: number[][];
19
+ }[] | ({
20
+ type: string;
21
+ fillStyle: string;
22
+ strokeWidth: number;
23
+ strokeStyle: string;
24
+ x: number;
25
+ y: number;
26
+ strokeColor: string;
27
+ backgroundColor: string;
28
+ width: number;
29
+ height: number;
30
+ groupIds: string[];
31
+ points: number[][];
32
+ roughness?: undefined;
33
+ opacity?: undefined;
34
+ angle?: undefined;
35
+ seed?: undefined;
36
+ strokeSharpness?: undefined;
37
+ boundElementIds?: undefined;
38
+ } | {
39
+ type: string;
40
+ fillStyle: string;
41
+ strokeWidth: number;
42
+ strokeStyle: string;
43
+ roughness: number;
44
+ opacity: number;
45
+ angle: number;
46
+ x: number;
47
+ y: number;
48
+ strokeColor: string;
49
+ backgroundColor: string;
50
+ width: number;
51
+ height: number;
52
+ seed: number;
53
+ groupIds: string[];
54
+ strokeSharpness: string;
55
+ points: number[][];
56
+ boundElementIds?: undefined;
57
+ } | {
58
+ type: string;
59
+ fillStyle: string;
60
+ strokeWidth: number;
61
+ strokeStyle: string;
62
+ roughness: number;
63
+ opacity: number;
64
+ angle: number;
65
+ x: number;
66
+ y: number;
67
+ strokeColor: string;
68
+ backgroundColor: string;
69
+ width: number;
70
+ height: number;
71
+ seed: number;
72
+ groupIds: string[];
73
+ strokeSharpness: string;
74
+ boundElementIds: string[];
75
+ points?: undefined;
76
+ } | {
77
+ type: string;
78
+ fillStyle: string;
79
+ strokeWidth: number;
80
+ strokeStyle: string;
81
+ roughness: number;
82
+ opacity: number;
83
+ angle: number;
84
+ x: number;
85
+ y: number;
86
+ strokeColor: string;
87
+ backgroundColor: string;
88
+ width: number;
89
+ height: number;
90
+ seed: number;
91
+ groupIds: string[];
92
+ strokeSharpness: string;
93
+ points?: undefined;
94
+ boundElementIds?: undefined;
95
+ })[] | ({
96
+ type: string;
97
+ fillStyle: string;
98
+ strokeWidth: number;
99
+ strokeStyle: string;
100
+ roughness: number;
101
+ opacity: number;
102
+ angle: number;
103
+ x: number;
104
+ y: number;
105
+ strokeColor: string;
106
+ backgroundColor: string;
107
+ width: number;
108
+ height: number;
109
+ seed: number;
110
+ groupIds: string[];
111
+ strokeSharpness: string;
112
+ points: number[][];
113
+ version?: undefined;
114
+ versionNonce?: undefined;
115
+ isDeleted?: undefined;
116
+ id?: undefined;
117
+ boundElementIds?: undefined;
118
+ } | {
119
+ type: string;
120
+ version: number;
121
+ versionNonce: number;
122
+ isDeleted: boolean;
123
+ id: string;
124
+ fillStyle: string;
125
+ strokeWidth: number;
126
+ strokeStyle: string;
127
+ roughness: number;
128
+ opacity: number;
129
+ angle: number;
130
+ x: number;
131
+ y: number;
132
+ strokeColor: string;
133
+ backgroundColor: string;
134
+ width: number;
135
+ height: number;
136
+ seed: number;
137
+ groupIds: string[];
138
+ strokeSharpness: string;
139
+ points: number[][];
140
+ boundElementIds?: undefined;
141
+ } | {
142
+ type: string;
143
+ fillStyle: string;
144
+ strokeWidth: number;
145
+ strokeStyle: string;
146
+ roughness: number;
147
+ opacity: number;
148
+ angle: number;
149
+ x: number;
150
+ y: number;
151
+ strokeColor: string;
152
+ backgroundColor: string;
153
+ width: number;
154
+ height: number;
155
+ seed: number;
156
+ groupIds: string[];
157
+ strokeSharpness: string;
158
+ boundElementIds: string[];
159
+ points?: undefined;
160
+ version?: undefined;
161
+ versionNonce?: undefined;
162
+ isDeleted?: undefined;
163
+ id?: undefined;
164
+ })[] | ({
165
+ type: string;
166
+ fillStyle: string;
167
+ strokeWidth: number;
168
+ strokeStyle: string;
169
+ roughness: number;
170
+ opacity: number;
171
+ angle: number;
172
+ x: number;
173
+ y: number;
174
+ strokeColor: string;
175
+ backgroundColor: string;
176
+ width: number;
177
+ height: number;
178
+ seed: number;
179
+ groupIds: string[];
180
+ strokeSharpness: string;
181
+ points?: undefined;
182
+ } | {
183
+ type: string;
184
+ fillStyle: string;
185
+ strokeWidth: number;
186
+ strokeStyle: string;
187
+ roughness: number;
188
+ opacity: number;
189
+ angle: number;
190
+ x: number;
191
+ y: number;
192
+ strokeColor: string;
193
+ backgroundColor: string;
194
+ width: number;
195
+ height: number;
196
+ seed: number;
197
+ groupIds: string[];
198
+ strokeSharpness: string;
199
+ points: number[][];
200
+ } | {
201
+ type: string;
202
+ fillStyle: string;
203
+ strokeWidth: number;
204
+ strokeStyle: string;
205
+ x: number;
206
+ y: number;
207
+ strokeColor: string;
208
+ backgroundColor: string;
209
+ width: number;
210
+ height: number;
211
+ groupIds: string[];
212
+ strokeSharpness: string;
213
+ points: number[][];
214
+ roughness?: undefined;
215
+ opacity?: undefined;
216
+ angle?: undefined;
217
+ seed?: undefined;
218
+ } | {
219
+ type: string;
220
+ fillStyle: string;
221
+ strokeWidth: number;
222
+ strokeStyle: string;
223
+ roughness: number;
224
+ opacity: number;
225
+ angle: number;
226
+ x: number;
227
+ y: number;
228
+ strokeColor: string;
229
+ backgroundColor: string;
230
+ width: number;
231
+ height: number;
232
+ groupIds: string[];
233
+ strokeSharpness: string;
234
+ points: number[][];
235
+ seed?: undefined;
236
+ } | {
237
+ type: string;
238
+ fillStyle: string;
239
+ strokeWidth: number;
240
+ strokeStyle: string;
241
+ opacity: number;
242
+ x: number;
243
+ y: number;
244
+ strokeColor: string;
245
+ backgroundColor: string;
246
+ width: number;
247
+ height: number;
248
+ seed: number;
249
+ groupIds: string[];
250
+ strokeSharpness: string;
251
+ points: number[][];
252
+ roughness?: undefined;
253
+ angle?: undefined;
254
+ })[] | ({
255
+ type: string;
256
+ fillStyle: string;
257
+ strokeWidth: number;
258
+ strokeStyle: string;
259
+ roughness: number;
260
+ opacity: number;
261
+ angle: number;
262
+ x: number;
263
+ y: number;
264
+ strokeColor: string;
265
+ backgroundColor: string;
266
+ width: number;
267
+ height: number;
268
+ seed: number;
269
+ groupIds: string[];
270
+ strokeSharpness: string;
271
+ } | {
272
+ type: string;
273
+ fillStyle: string;
274
+ strokeWidth: number;
275
+ strokeStyle: string;
276
+ x: number;
277
+ y: number;
278
+ strokeColor: string;
279
+ backgroundColor: string;
280
+ width: number;
281
+ height: number;
282
+ seed: number;
283
+ groupIds: string[];
284
+ strokeSharpness: string;
285
+ roughness?: undefined;
286
+ opacity?: undefined;
287
+ angle?: undefined;
288
+ })[])[];
289
+ };
290
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import "./ExampleSidebar.scss";
2
+ export default function Sidebar({ children }: {
3
+ children: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,18 @@
1
1
  import { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "./element/types";
2
2
  import { AppClassProperties, AppState, StaticCanvasAppState } from "./types";
3
- import { ExcalidrawElementsIncludingDeleted } from "./scene/Scene";
3
+ import type { ExcalidrawElementsIncludingDeleted } from "./scene/Scene";
4
4
  import { ReadonlySetLike } from "./utility-types";
5
5
  export declare const bindElementsToFramesAfterDuplication: (nextElements: ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
6
- export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement): boolean;
7
- export declare const getElementsCompletelyInFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
8
- export declare const isElementContainingFrame: (elements: readonly ExcalidrawElement[], element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement) => boolean;
6
+ export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap): boolean;
7
+ export declare const getElementsCompletelyInFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => ExcalidrawElement[];
8
+ export declare const isElementContainingFrame: (elements: readonly ExcalidrawElement[], element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => boolean;
9
9
  export declare const getElementsIntersectingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
10
- export declare const elementsAreInFrameBounds: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => boolean;
11
- export declare const elementOverlapsWithFrame: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement) => boolean;
10
+ export declare const elementsAreInFrameBounds: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => boolean;
11
+ export declare const elementOverlapsWithFrame: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => boolean;
12
12
  export declare const isCursorInFrame: (cursorCoords: {
13
13
  x: number;
14
14
  y: number;
15
- }, frame: NonDeleted<ExcalidrawFrameLikeElement>) => boolean;
15
+ }, frame: NonDeleted<ExcalidrawFrameLikeElement>, elementsMap: ElementsMap) => boolean;
16
16
  export declare const groupsAreAtLeastIntersectingTheFrame: (elements: readonly NonDeletedExcalidrawElement[], groupIds: readonly string[], frame: ExcalidrawFrameLikeElement) => boolean;
17
17
  export declare const groupsAreCompletelyOutOfFrame: (elements: readonly NonDeletedExcalidrawElement[], groupIds: readonly string[], frame: ExcalidrawFrameLikeElement) => boolean;
18
18
  /**
@@ -30,9 +30,9 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
30
30
  * Considers non-frame bound elements (container or arrow labels) as root.
31
31
  */
32
32
  export declare const getRootElements: (allElements: ExcalidrawElementsIncludingDeleted) => ExcalidrawElement[];
33
- export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState) => ExcalidrawElement[];
34
- export declare const getElementsInNewFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
35
- export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap?: Map<string, ExcalidrawElement>) => ExcalidrawFrameLikeElement | null;
33
+ export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
34
+ export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => ExcalidrawElement[];
35
+ export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
36
36
  /** */
37
37
  export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
38
38
  /**
@@ -58,6 +58,6 @@ export declare const omitGroupsContainingFrameLikes: (allElements: ElementsMapOr
58
58
  * is going to be added to or remove from
59
59
  */
60
60
  export declare const getTargetFrame: (element: ExcalidrawElement, elementsMap: ElementsMap, appState: StaticCanvasAppState) => import("./element/types").ExcalidrawFrameElement | import("./element/types").ExcalidrawMagicFrameElement | null;
61
- export declare const isElementInFrame: (element: ExcalidrawElement, allElements: ElementsMap, appState: StaticCanvasAppState) => boolean;
61
+ export declare const isElementInFrame: (element: ExcalidrawElement, allElementsMap: ElementsMap, appState: StaticCanvasAppState) => boolean;
62
62
  export declare const getFrameLikeTitle: (element: ExcalidrawFrameLikeElement, frameIdx: number) => string;
63
63
  export declare const getElementsOverlappingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => NonDeletedExcalidrawElement[];
@@ -14,7 +14,7 @@ declare const clearAppStatePropertiesForHistory: (appState: AppState) => {
14
14
  viewBackgroundColor: string;
15
15
  editingLinearElement: import("./element/linearElementEditor").LinearElementEditor | null;
16
16
  editingGroupId: string | null;
17
- name: string;
17
+ name: string | null;
18
18
  };
19
19
  declare class History {
20
20
  private elementCache;
@@ -9,12 +9,7 @@ export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[];
9
9
  declare class Scene {
10
10
  private static sceneMapByElement;
11
11
  private static sceneMapById;
12
- static mapElementToScene(elementKey: ElementKey, scene: Scene,
13
- /**
14
- * needed because of frame exporting hack.
15
- * elementId:Scene mapping will be removed completely, soon.
16
- */
17
- mapElementIds?: boolean): void;
12
+ static mapElementToScene(elementKey: ElementKey, scene: Scene): void;
18
13
  static getScene(elementKey: ElementKey): Scene | null;
19
14
  private callbacks;
20
15
  private nonDeletedElements;
@@ -58,7 +53,7 @@ declare class Scene {
58
53
  * @returns whether a change was made
59
54
  */
60
55
  mapElements(iteratee: (element: ExcalidrawElement) => ExcalidrawElement): boolean;
61
- replaceAllElements(nextElements: ElementsMapOrArray, mapElementIds?: boolean): void;
56
+ replaceAllElements(nextElements: ElementsMapOrArray): void;
62
57
  informMutation(): void;
63
58
  addCallback(cb: SceneStateCallback): SceneStateCallbackRemover;
64
59
  destroy(): void;
@@ -1,9 +1,10 @@
1
1
  import { InteractiveCanvasAppState } from "../types";
2
- import { RenderableElementsMap, ScrollBars } from "./types";
2
+ import { ScrollBars } from "./types";
3
+ import { ExcalidrawElement } from "../element/types";
3
4
  export declare const SCROLLBAR_MARGIN = 4;
4
5
  export declare const SCROLLBAR_WIDTH = 6;
5
6
  export declare const SCROLLBAR_COLOR = "rgba(128,128,128,0.3)";
6
- export declare const getScrollBars: (elements: RenderableElementsMap, viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
7
+ export declare const getScrollBars: (elements: readonly ExcalidrawElement[], viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
7
8
  export declare const isOverScrollBars: (scrollBars: ScrollBars, x: number, y: number) => {
8
9
  isOverEither: boolean;
9
10
  isOverHorizontal: boolean;
@@ -1,4 +1,4 @@
1
- import { ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
1
+ import { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
2
2
  import { AppState, InteractiveCanvasAppState } from "../types";
3
3
  /**
4
4
  * Frames and their containing elements are not to be selected at the same time.
@@ -7,8 +7,8 @@ import { AppState, InteractiveCanvasAppState } from "../types";
7
7
  * @param selectedElements
8
8
  */
9
9
  export declare const excludeElementsInFramesFromSelection: <T extends ExcalidrawElement>(selectedElements: readonly T[]) => T[];
10
- export declare const getElementsWithinSelection: (elements: readonly NonDeletedExcalidrawElement[], selection: NonDeletedExcalidrawElement, excludeElementsInFrames?: boolean) => NonDeletedExcalidrawElement[];
11
- export declare const getVisibleAndNonSelectedElements: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: readonly NonDeletedExcalidrawElement[], appState: AppState) => NonDeletedExcalidrawElement[];
10
+ export declare const getElementsWithinSelection: (elements: readonly NonDeletedExcalidrawElement[], selection: NonDeletedExcalidrawElement, elementsMap: ElementsMap, excludeElementsInFrames?: boolean) => NonDeletedExcalidrawElement[];
11
+ export declare const getVisibleAndNonSelectedElements: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: readonly NonDeletedExcalidrawElement[], appState: AppState, elementsMap: ElementsMap) => NonDeletedExcalidrawElement[];
12
12
  export declare const isSomeElementSelected: {
13
13
  (elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">): boolean;
14
14
  clearCache(): void;
@@ -1,6 +1,6 @@
1
1
  import { Bounds } from "./element/bounds";
2
2
  import { MaybeTransformHandleType } from "./element/transformHandles";
3
- import { ExcalidrawElement, NonDeletedExcalidrawElement } from "./element/types";
3
+ import { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "./element/types";
4
4
  import { AppState, KeyboardModifiersObject, Point } from "./types";
5
5
  export declare const getSnapDistance: (zoomValue: number) => number;
6
6
  type Vector2D = {
@@ -66,17 +66,17 @@ export declare const isSnappingEnabled: ({ event, appState, selectedElements, }:
66
66
  selectedElements: NonDeletedExcalidrawElement[];
67
67
  }) => boolean;
68
68
  export declare const areRoughlyEqual: (a: number, b: number, precision?: number) => boolean;
69
- export declare const getElementsCorners: (elements: ExcalidrawElement[], { omitCenter, boundingBoxCorners, dragOffset, }?: {
69
+ export declare const getElementsCorners: (elements: ExcalidrawElement[], elementsMap: ElementsMap, { omitCenter, boundingBoxCorners, dragOffset, }?: {
70
70
  omitCenter?: boolean | undefined;
71
71
  boundingBoxCorners?: boolean | undefined;
72
72
  dragOffset?: Vector2D | undefined;
73
73
  }) => Point[];
74
- export declare const getVisibleGaps: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: ExcalidrawElement[], appState: AppState) => {
74
+ export declare const getVisibleGaps: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: ExcalidrawElement[], appState: AppState, elementsMap: ElementsMap) => {
75
75
  horizontalGaps: Gap[];
76
76
  verticalGaps: Gap[];
77
77
  };
78
- export declare const getReferenceSnapPoints: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: ExcalidrawElement[], appState: AppState) => (readonly [number, number])[];
79
- export declare const snapDraggedElements: (selectedElements: ExcalidrawElement[], dragOffset: Vector2D, appState: AppState, event: KeyboardModifiersObject) => {
78
+ export declare const getReferenceSnapPoints: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: ExcalidrawElement[], appState: AppState, elementsMap: ElementsMap) => (readonly [number, number])[];
79
+ export declare const snapDraggedElements: (elements: ExcalidrawElement[], dragOffset: Vector2D, appState: AppState, event: KeyboardModifiersObject, elementsMap: ElementsMap) => {
80
80
  snapOffset: {
81
81
  x: number;
82
82
  y: number;
@@ -90,14 +90,14 @@ export declare const snapResizingElements: (selectedElements: ExcalidrawElement[
90
90
  };
91
91
  snapLines: PointSnapLine[];
92
92
  };
93
- export declare const snapNewElement: (draggingElement: ExcalidrawElement, appState: AppState, event: KeyboardModifiersObject, origin: Vector2D, dragOffset: Vector2D) => {
93
+ export declare const snapNewElement: (draggingElement: ExcalidrawElement, appState: AppState, event: KeyboardModifiersObject, origin: Vector2D, dragOffset: Vector2D, elementsMap: ElementsMap) => {
94
94
  snapOffset: {
95
95
  x: number;
96
96
  y: number;
97
97
  };
98
98
  snapLines: PointSnapLine[];
99
99
  };
100
- export declare const getSnapLinesAtPointer: (elements: readonly ExcalidrawElement[], appState: AppState, pointer: Vector2D, event: KeyboardModifiersObject) => {
100
+ export declare const getSnapLinesAtPointer: (elements: readonly ExcalidrawElement[], appState: AppState, pointer: Vector2D, event: KeyboardModifiersObject, elementsMap: ElementsMap) => {
101
101
  originOffset: {
102
102
  x: number;
103
103
  y: number;
@@ -185,7 +185,7 @@ export interface AppState {
185
185
  scrollY: number;
186
186
  cursorButton: "up" | "down";
187
187
  scrolledOutside: boolean;
188
- name: string;
188
+ name: string | null;
189
189
  isResizing: boolean;
190
190
  isRotating: boolean;
191
191
  zoom: Zoom;
@@ -417,7 +417,7 @@ export declare enum UserIdleState {
417
417
  }
418
418
  export type ExportOpts = {
419
419
  saveFileToDisk?: boolean;
420
- onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => void;
420
+ onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles) => void;
421
421
  renderCustomUI?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => JSX.Element;
422
422
  };
423
423
  export type CanvasActions = Partial<{
@@ -480,6 +480,7 @@ export type AppClassProperties = {
480
480
  setOpenDialog: App["setOpenDialog"];
481
481
  insertEmbeddableElement: App["insertEmbeddableElement"];
482
482
  onMagicframeToolSelect: App["onMagicframeToolSelect"];
483
+ getName: App["getName"];
483
484
  };
484
485
  export type PointerDownState = Readonly<{
485
486
  origin: Readonly<{
@@ -543,12 +544,13 @@ export type ExcalidrawImperativeAPI = {
543
544
  history: {
544
545
  clear: InstanceType<typeof App>["resetHistory"];
545
546
  };
546
- scrollToContent: InstanceType<typeof App>["scrollToContent"];
547
547
  zoomToFit: InstanceType<typeof App>["zoomToFit"];
548
548
  startLineEditor: InstanceType<typeof App>["startLineEditor"];
549
549
  getSceneElements: InstanceType<typeof App>["getSceneElements"];
550
550
  getAppState: () => InstanceType<typeof App>["state"];
551
551
  getFiles: () => InstanceType<typeof App>["files"];
552
+ getName: InstanceType<typeof App>["getName"];
553
+ scrollToContent: InstanceType<typeof App>["scrollToContent"];
552
554
  registerAction: (action: Action) => void;
553
555
  refresh: InstanceType<typeof App>["refresh"];
554
556
  setToast: InstanceType<typeof App>["setToast"];
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export * from "./export";