@excalidraw/excalidraw 0.18.0-b7aac689a → 0.18.0-b9d27d3
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.
- package/dist/dev/{chunk-CBGOW5JB.js → chunk-WWDIUJ2Q.js} +34 -31
- package/dist/dev/chunk-WWDIUJ2Q.js.map +7 -0
- package/dist/dev/data/{image-SURZSZNX.js → image-VTYIFRQE.js} +2 -2
- package/dist/dev/index.css +4 -0
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +2183 -1916
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/chunk-VTWWEYSQ.js +4 -0
- package/dist/prod/data/{image-HXEZYJPQ.js → image-YQ6UXXDA.js} +1 -1
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +22 -22
- package/dist/types/common/src/constants.d.ts +13 -3
- package/dist/types/element/src/Scene.d.ts +6 -2
- package/dist/types/element/src/align.d.ts +2 -1
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/delta.d.ts +16 -4
- package/dist/types/element/src/distribute.d.ts +2 -1
- package/dist/types/element/src/groups.d.ts +1 -0
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/linearElementEditor.d.ts +2 -1
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/store.d.ts +6 -1
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +0 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +15 -14
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +3 -8
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -6
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +0 -9
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +33 -3
- package/dist/types/excalidraw/actions/actionLink.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +0 -3
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionProperties.d.ts +0 -15
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +0 -1
- package/dist/types/excalidraw/clipboard.d.ts +62 -1
- package/dist/types/excalidraw/components/Actions.d.ts +0 -4
- package/dist/types/excalidraw/components/App.d.ts +11 -8
- package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
- package/dist/types/excalidraw/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/data/blob.d.ts +1 -5
- package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
- package/dist/types/excalidraw/data/restore.d.ts +6 -1
- package/dist/types/excalidraw/index.d.ts +2 -1
- package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
- package/dist/types/excalidraw/types.d.ts +7 -4
- package/history.ts +1 -1
- package/package.json +5 -5
- package/dist/dev/chunk-CBGOW5JB.js.map +0 -7
- package/dist/prod/chunk-IRHK23LL.js +0 -4
- /package/dist/dev/data/{image-SURZSZNX.js.map → image-VTYIFRQE.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate } from "@excalidraw/element";
|
|
4
|
-
import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered } from "@excalidraw/element/types";
|
|
3
|
+
import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
|
|
4
|
+
import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
|
|
5
5
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
6
|
import { ActionManager } from "../actions/manager";
|
|
7
7
|
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
@@ -153,6 +153,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
153
153
|
x: number;
|
|
154
154
|
y: number;
|
|
155
155
|
};
|
|
156
|
+
blockDragging: boolean;
|
|
156
157
|
};
|
|
157
158
|
eventListeners: {
|
|
158
159
|
onMove: {
|
|
@@ -222,6 +223,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
222
223
|
x: number;
|
|
223
224
|
y: number;
|
|
224
225
|
};
|
|
226
|
+
blockDragging: boolean;
|
|
225
227
|
};
|
|
226
228
|
eventListeners: {
|
|
227
229
|
onMove: {
|
|
@@ -243,6 +245,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
243
245
|
}>]>;
|
|
244
246
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
245
247
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
248
|
+
defaultSelectionTool: "selection" | "lasso";
|
|
246
249
|
constructor(props: AppProps);
|
|
247
250
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
248
251
|
private onWindowMessage;
|
|
@@ -297,6 +300,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
297
300
|
*/
|
|
298
301
|
private resetScene;
|
|
299
302
|
private initializeScene;
|
|
303
|
+
private isMobileOrTablet;
|
|
300
304
|
private isMobileBreakpoint;
|
|
301
305
|
private refreshViewportBreakpoints;
|
|
302
306
|
private refreshEditorBreakpoints;
|
|
@@ -316,6 +320,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
316
320
|
private static resetTapTwice;
|
|
317
321
|
private onTouchStart;
|
|
318
322
|
private onTouchEnd;
|
|
323
|
+
private insertClipboardContent;
|
|
319
324
|
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
320
325
|
addElementsFromPasteOrLibrary: (opts: {
|
|
321
326
|
elements: readonly ExcalidrawElement[];
|
|
@@ -397,6 +402,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
397
402
|
*/
|
|
398
403
|
captureUpdate?: SceneData["captureUpdate"];
|
|
399
404
|
}) => void;
|
|
405
|
+
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
400
406
|
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
401
407
|
private triggerRender;
|
|
402
408
|
/**
|
|
@@ -488,7 +494,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
488
494
|
sceneY: number;
|
|
489
495
|
link: string;
|
|
490
496
|
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
491
|
-
private
|
|
497
|
+
private newImagePlaceholder;
|
|
492
498
|
private handleLinearElementOnPointerDown;
|
|
493
499
|
private getCurrentItemRoundness;
|
|
494
500
|
private createGenericElementOnPointerDown;
|
|
@@ -509,11 +515,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
509
515
|
* and when you don't want to loose those modifications
|
|
510
516
|
*/
|
|
511
517
|
private getLatestInitializedImageElement;
|
|
512
|
-
|
|
513
|
-
* inserts image into elements array and rerenders
|
|
514
|
-
*/
|
|
515
|
-
private insertImageElement;
|
|
516
|
-
private onImageAction;
|
|
518
|
+
private onImageToolbarButtonClick;
|
|
517
519
|
private getImageNaturalDimensions;
|
|
518
520
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
519
521
|
to error for images that fail during <img> element creation */
|
|
@@ -527,6 +529,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
527
529
|
private maybeSuggestBindingAtCursor;
|
|
528
530
|
private clearSelection;
|
|
529
531
|
private handleInteractiveCanvasRef;
|
|
532
|
+
private insertImages;
|
|
530
533
|
private handleAppOnDrop;
|
|
531
534
|
loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
|
|
532
535
|
private handleCanvasContextMenu;
|
|
@@ -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
|
|
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;
|
|
@@ -40,11 +40,7 @@ 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
|
|
44
|
-
file: File | null;
|
|
45
|
-
fileHandle: FileSystemHandle | null;
|
|
46
|
-
}>;
|
|
47
|
-
export declare const getFileHandle: (event: React.DragEvent<HTMLDivElement>) => Promise<FileSystemHandle | null>;
|
|
43
|
+
export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
|
|
48
44
|
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, 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.
|
|
@@ -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 {};
|
|
@@ -12,7 +12,7 @@ export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements
|
|
|
12
12
|
export { getTextFromElements } from "@excalidraw/element";
|
|
13
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";
|
|
@@ -29,6 +29,7 @@ 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 };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
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;
|
|
@@ -129,7 +129,6 @@ export type StaticCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
|
129
129
|
}>;
|
|
130
130
|
export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
131
131
|
activeEmbeddable: AppState["activeEmbeddable"];
|
|
132
|
-
editingLinearElement: AppState["editingLinearElement"];
|
|
133
132
|
selectionElement: AppState["selectionElement"];
|
|
134
133
|
selectedGroupIds: AppState["selectedGroupIds"];
|
|
135
134
|
selectedLinearElement: AppState["selectedLinearElement"];
|
|
@@ -156,8 +155,10 @@ export type ObservedElementsAppState = {
|
|
|
156
155
|
editingGroupId: AppState["editingGroupId"];
|
|
157
156
|
selectedElementIds: AppState["selectedElementIds"];
|
|
158
157
|
selectedGroupIds: AppState["selectedGroupIds"];
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
selectedLinearElement: {
|
|
159
|
+
elementId: LinearElementEditor["elementId"];
|
|
160
|
+
isEditing: boolean;
|
|
161
|
+
} | null;
|
|
161
162
|
croppingElementId: AppState["croppingElementId"];
|
|
162
163
|
lockedMultiSelections: AppState["lockedMultiSelections"];
|
|
163
164
|
activeLockedId: AppState["activeLockedId"];
|
|
@@ -211,7 +212,6 @@ export interface AppState {
|
|
|
211
212
|
* set when a new text is created or when an existing text is being edited
|
|
212
213
|
*/
|
|
213
214
|
editingTextElement: NonDeletedExcalidrawElement | null;
|
|
214
|
-
editingLinearElement: LinearElementEditor | null;
|
|
215
215
|
activeTool: {
|
|
216
216
|
/**
|
|
217
217
|
* indicates a previous tool we should revert back to if we deselect the
|
|
@@ -557,6 +557,7 @@ export type AppClassProperties = {
|
|
|
557
557
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
558
558
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
559
559
|
updateEditorAtom: App["updateEditorAtom"];
|
|
560
|
+
defaultSelectionTool: "selection" | "lasso";
|
|
560
561
|
};
|
|
561
562
|
export type PointerDownState = Readonly<{
|
|
562
563
|
origin: Readonly<{
|
|
@@ -604,6 +605,7 @@ export type PointerDownState = Readonly<{
|
|
|
604
605
|
x: number;
|
|
605
606
|
y: number;
|
|
606
607
|
};
|
|
608
|
+
blockDragging: boolean;
|
|
607
609
|
};
|
|
608
610
|
eventListeners: {
|
|
609
611
|
onMove: null | ReturnType<typeof throttleRAF>;
|
|
@@ -618,6 +620,7 @@ export type PointerDownState = Readonly<{
|
|
|
618
620
|
export type UnsubscribeCallback = () => void;
|
|
619
621
|
export interface ExcalidrawImperativeAPI {
|
|
620
622
|
updateScene: InstanceType<typeof App>["updateScene"];
|
|
623
|
+
applyDeltas: InstanceType<typeof App>["applyDeltas"];
|
|
621
624
|
mutateElement: InstanceType<typeof App>["mutateElement"];
|
|
622
625
|
updateLibrary: InstanceType<typeof Library>["updateLibrary"];
|
|
623
626
|
resetScene: InstanceType<typeof App>["resetScene"];
|
package/history.ts
CHANGED
|
@@ -175,7 +175,7 @@ export class History {
|
|
|
175
175
|
let nextAppState = appState;
|
|
176
176
|
let containsVisibleChange = false;
|
|
177
177
|
|
|
178
|
-
// iterate through the history entries in case
|
|
178
|
+
// iterate through the history entries in case they result in no visible changes
|
|
179
179
|
while (historyDelta) {
|
|
180
180
|
try {
|
|
181
181
|
[nextElements, nextAppState, containsVisibleChange] =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@excalidraw/excalidraw",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-b9d27d3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/excalidraw/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@braintree/sanitize-url": "6.0.2",
|
|
82
|
-
"@excalidraw/common": "0.18.0-
|
|
83
|
-
"@excalidraw/element": "0.18.0-
|
|
84
|
-
"@excalidraw/math": "0.18.0-
|
|
82
|
+
"@excalidraw/common": "0.18.0-b9d27d3",
|
|
83
|
+
"@excalidraw/element": "0.18.0-b9d27d3",
|
|
84
|
+
"@excalidraw/math": "0.18.0-b9d27d3",
|
|
85
85
|
"@excalidraw/laser-pointer": "1.3.1",
|
|
86
|
-
"@excalidraw/mermaid-to-excalidraw": "1.1.
|
|
86
|
+
"@excalidraw/mermaid-to-excalidraw": "1.1.3",
|
|
87
87
|
"@excalidraw/random-username": "1.1.0",
|
|
88
88
|
"@radix-ui/react-popover": "1.1.6",
|
|
89
89
|
"@radix-ui/react-tabs": "1.1.3",
|