@excalidraw/excalidraw 0.18.0-b16b6f8fd → 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-OKO5QCIZ.js → chunk-CP5DND7P.js} +2 -2
- package/dist/dev/{chunk-OKO5QCIZ.js.map → chunk-CP5DND7P.js.map} +1 -1
- package/dist/dev/{chunk-EOSXEDPQ.js → chunk-WWDIUJ2Q.js} +34 -30
- package/dist/dev/chunk-WWDIUJ2Q.js.map +7 -0
- package/dist/dev/data/{image-LZHZW6U3.js → image-VTYIFRQE.js} +3 -3
- package/dist/dev/index.js +956 -736
- package/dist/dev/index.js.map +3 -3
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-FBK55PRF.js → chunk-A66AFZZU.js} +1 -1
- package/dist/prod/{chunk-PXWC4GXH.js → chunk-VTWWEYSQ.js} +3 -3
- package/dist/prod/data/image-YQ6UXXDA.js +1 -0
- package/dist/prod/index.js +22 -22
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +12 -3
- package/dist/types/element/src/Scene.d.ts +6 -2
- 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/index.d.ts +1 -0
- 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/actionCanvas.d.ts +15 -14
- package/dist/types/excalidraw/clipboard.d.ts +62 -1
- package/dist/types/excalidraw/components/App.d.ts +11 -8
- 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 +1 -1
- package/dist/types/excalidraw/types.d.ts +7 -2
- package/history.ts +1 -1
- package/package.json +5 -5
- package/dist/dev/chunk-EOSXEDPQ.js.map +0 -7
- package/dist/prod/data/image-LFNJBNDB.js +0 -1
- /package/dist/dev/data/{image-LZHZW6U3.js.map → image-VTYIFRQE.js.map} +0 -0
|
@@ -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";
|
|
@@ -155,8 +155,10 @@ export type ObservedElementsAppState = {
|
|
|
155
155
|
editingGroupId: AppState["editingGroupId"];
|
|
156
156
|
selectedElementIds: AppState["selectedElementIds"];
|
|
157
157
|
selectedGroupIds: AppState["selectedGroupIds"];
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
selectedLinearElement: {
|
|
159
|
+
elementId: LinearElementEditor["elementId"];
|
|
160
|
+
isEditing: boolean;
|
|
161
|
+
} | null;
|
|
160
162
|
croppingElementId: AppState["croppingElementId"];
|
|
161
163
|
lockedMultiSelections: AppState["lockedMultiSelections"];
|
|
162
164
|
activeLockedId: AppState["activeLockedId"];
|
|
@@ -555,6 +557,7 @@ export type AppClassProperties = {
|
|
|
555
557
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
556
558
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
557
559
|
updateEditorAtom: App["updateEditorAtom"];
|
|
560
|
+
defaultSelectionTool: "selection" | "lasso";
|
|
558
561
|
};
|
|
559
562
|
export type PointerDownState = Readonly<{
|
|
560
563
|
origin: Readonly<{
|
|
@@ -602,6 +605,7 @@ export type PointerDownState = Readonly<{
|
|
|
602
605
|
x: number;
|
|
603
606
|
y: number;
|
|
604
607
|
};
|
|
608
|
+
blockDragging: boolean;
|
|
605
609
|
};
|
|
606
610
|
eventListeners: {
|
|
607
611
|
onMove: null | ReturnType<typeof throttleRAF>;
|
|
@@ -616,6 +620,7 @@ export type PointerDownState = Readonly<{
|
|
|
616
620
|
export type UnsubscribeCallback = () => void;
|
|
617
621
|
export interface ExcalidrawImperativeAPI {
|
|
618
622
|
updateScene: InstanceType<typeof App>["updateScene"];
|
|
623
|
+
applyDeltas: InstanceType<typeof App>["applyDeltas"];
|
|
619
624
|
mutateElement: InstanceType<typeof App>["mutateElement"];
|
|
620
625
|
updateLibrary: InstanceType<typeof Library>["updateLibrary"];
|
|
621
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",
|