@zsviczian/excalidraw 0.18.0-37 → 0.18.0-38
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/excalidraw.development.js +171 -149
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/styles.development.css +690 -499
- package/dist/styles.production.css +12 -12
- package/package.json +2 -2
- package/types/common/src/constants.d.ts +20 -4
- package/types/common/src/utils.d.ts +3 -0
- package/types/element/src/bounds.d.ts +1 -1
- package/types/element/src/delta.d.ts +0 -1
- package/types/element/src/index.d.ts +1 -0
- package/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/types/element/src/renderElement.d.ts +4 -1
- package/types/element/src/textElement.d.ts +1 -1
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +6 -3
- package/types/excalidraw/actions/actionBoundText.d.ts +4 -2
- package/types/excalidraw/actions/actionCanvas.d.ts +63 -32
- package/types/excalidraw/actions/actionClipboard.d.ts +12 -6
- package/types/excalidraw/actions/actionCropEditor.d.ts +2 -1
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +6 -3
- package/types/excalidraw/actions/actionElementLink.d.ts +2 -1
- package/types/excalidraw/actions/actionElementLock.d.ts +4 -2
- package/types/excalidraw/actions/actionEmbeddable.d.ts +2 -1
- package/types/excalidraw/actions/actionExport.d.ts +18 -9
- package/types/excalidraw/actions/actionFinalize.d.ts +6 -3
- package/types/excalidraw/actions/actionFrame.d.ts +8 -4
- package/types/excalidraw/actions/actionGroup.d.ts +4 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +3 -2
- package/types/excalidraw/actions/actionLink.d.ts +2 -1
- package/types/excalidraw/actions/actionMenu.d.ts +6 -3
- package/types/excalidraw/actions/actionNavigate.d.ts +4 -2
- package/types/excalidraw/actions/actionProperties.d.ts +50 -25
- package/types/excalidraw/actions/actionSelectAll.d.ts +2 -1
- package/types/excalidraw/actions/actionStyles.d.ts +2 -1
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +2 -1
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +2 -1
- package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -1
- package/types/excalidraw/actions/actionToggleStats.d.ts +2 -1
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +2 -1
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -1
- package/types/excalidraw/actions/index.d.ts +1 -1
- package/types/excalidraw/actions/types.d.ts +1 -1
- package/types/excalidraw/appState.d.ts +1 -0
- package/types/excalidraw/clipboard.d.ts +64 -1
- package/types/excalidraw/components/Actions.d.ts +8 -1
- package/types/excalidraw/components/App.d.ts +8 -6
- package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +2 -1
- package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +2 -1
- package/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/types/excalidraw/components/TextField.d.ts +1 -0
- package/types/excalidraw/components/icons.d.ts +6 -0
- package/types/excalidraw/components/shapes.d.ts +117 -1
- package/types/excalidraw/data/blob.d.ts +3 -7
- package/types/excalidraw/data/types.d.ts +4 -1
- package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/types/excalidraw/types.d.ts +5 -1
- package/types/math/src/segment.d.ts +1 -0
|
@@ -154,6 +154,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
154
154
|
x: number;
|
|
155
155
|
y: number;
|
|
156
156
|
};
|
|
157
|
+
blockDragging: boolean;
|
|
157
158
|
};
|
|
158
159
|
eventListeners: {
|
|
159
160
|
onMove: {
|
|
@@ -223,6 +224,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
223
224
|
x: number;
|
|
224
225
|
y: number;
|
|
225
226
|
};
|
|
227
|
+
blockDragging: boolean;
|
|
226
228
|
};
|
|
227
229
|
eventListeners: {
|
|
228
230
|
onMove: {
|
|
@@ -244,6 +246,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
244
246
|
}>]>;
|
|
245
247
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
246
248
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
249
|
+
defaultSelectionTool: "selection" | "lasso";
|
|
247
250
|
constructor(props: AppProps);
|
|
248
251
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
249
252
|
private onWindowMessage;
|
|
@@ -299,6 +302,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
299
302
|
private resetScene;
|
|
300
303
|
private initializeScene;
|
|
301
304
|
private isMobileBreakpoint;
|
|
305
|
+
private isTabletBreakpoint;
|
|
302
306
|
private refreshViewportBreakpoints;
|
|
303
307
|
private refreshEditorBreakpoints;
|
|
304
308
|
private clearImageShapeCache;
|
|
@@ -317,6 +321,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
317
321
|
private static resetTapTwice;
|
|
318
322
|
private onTouchStart;
|
|
319
323
|
private onTouchEnd;
|
|
324
|
+
private insertClipboardContent;
|
|
320
325
|
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
321
326
|
addElementsFromPasteOrLibrary: (opts: {
|
|
322
327
|
elements: readonly ExcalidrawElement[];
|
|
@@ -510,7 +515,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
510
515
|
sceneY: number;
|
|
511
516
|
link: string;
|
|
512
517
|
}) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
|
|
513
|
-
private
|
|
518
|
+
private newImagePlaceholder;
|
|
514
519
|
private handleLinearElementOnPointerDown;
|
|
515
520
|
private getCurrentItemRoundness;
|
|
516
521
|
private createGenericElementOnPointerDown;
|
|
@@ -531,11 +536,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
531
536
|
* and when you don't want to loose those modifications
|
|
532
537
|
*/
|
|
533
538
|
private getLatestInitializedImageElement;
|
|
534
|
-
|
|
535
|
-
* inserts image into elements array and rerenders
|
|
536
|
-
*/
|
|
537
|
-
private insertImageElement;
|
|
538
|
-
private onImageAction;
|
|
539
|
+
private onImageToolbarButtonClick;
|
|
539
540
|
private getImageNaturalDimensions;
|
|
540
541
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
541
542
|
to error for images that fail during <img> element creation */
|
|
@@ -550,6 +551,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
550
551
|
setSelection(elements: readonly NonDeletedExcalidrawElement[]): void;
|
|
551
552
|
private clearSelection;
|
|
552
553
|
private handleInteractiveCanvasRef;
|
|
554
|
+
private insertImages;
|
|
553
555
|
private handleAppOnDrop;
|
|
554
556
|
loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
|
|
555
557
|
private handleCanvasContextMenu;
|
|
@@ -18,6 +18,7 @@ interface ColorPickerProps {
|
|
|
18
18
|
palette?: ColorPaletteCustom | null;
|
|
19
19
|
topPicks?: ColorTuple;
|
|
20
20
|
updateData: (formData?: any) => void;
|
|
21
|
+
compactMode?: boolean;
|
|
21
22
|
}
|
|
22
|
-
export declare const ColorPicker: ({ type, color, onChange, label, elements, palette, topPicks, updateData, appState, }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const ColorPicker: ({ type, color, onChange, label, elements, palette, topPicks, updateData, appState, compactMode, }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -16,6 +16,7 @@ interface FontPickerProps {
|
|
|
16
16
|
onHover: (fontFamily: FontFamilyValues) => void;
|
|
17
17
|
onLeave: () => void;
|
|
18
18
|
onPopupChange: (open: boolean) => void;
|
|
19
|
+
compactMode?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare const FontPicker: React.MemoExoticComponent<({ isOpened, selectedFontFamily, hoveredFontFamily, onSelect, onHover, onLeave, onPopupChange, }: FontPickerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
21
|
+
export declare const FontPicker: React.MemoExoticComponent<({ isOpened, selectedFontFamily, hoveredFontFamily, onSelect, onHover, onLeave, onPopupChange, compactMode, }: FontPickerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
21
22
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FontFamilyValues } from "@excalidraw/element/types";
|
|
2
2
|
interface FontPickerTriggerProps {
|
|
3
3
|
selectedFontFamily: FontFamilyValues | null;
|
|
4
|
+
isOpened?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare const FontPickerTrigger: ({ selectedFontFamily, }: FontPickerTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const FontPickerTrigger: ({ selectedFontFamily, isOpened, }: FontPickerTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { ExcalidrawElement, NonDeleted } from "@excalidraw/element/types";
|
|
|
3
3
|
import type { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
4
4
|
import type { LibraryItem } from "../types";
|
|
5
5
|
import type { ReactNode } from "react";
|
|
6
|
-
type LibraryOrPendingItem = (LibraryItem | /* pending library item */ {
|
|
6
|
+
type LibraryOrPendingItem = readonly (LibraryItem | /* pending library item */ {
|
|
7
7
|
id: null;
|
|
8
8
|
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
9
9
|
})[];
|
|
@@ -10,6 +10,7 @@ interface PropertiesPopoverProps {
|
|
|
10
10
|
onPointerLeave?: React.PointerEventHandler<HTMLDivElement>;
|
|
11
11
|
onFocusOutside?: Popover.PopoverContentProps["onFocusOutside"];
|
|
12
12
|
onPointerDownOutside?: Popover.PopoverContentProps["onPointerDownOutside"];
|
|
13
|
+
preventAutoFocusOnTouch?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare const PropertiesPopover: React.ForwardRefExoticComponent<PropertiesPopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
16
|
export {};
|
|
@@ -11,6 +11,7 @@ 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;
|
|
15
16
|
export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -30,6 +31,7 @@ export declare const LineIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
30
31
|
export declare const PenModeIcon: import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
export declare const FreedrawIcon: import("react/jsx-runtime").JSX.Element;
|
|
32
33
|
export declare const TextIcon: import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const TextSizeIcon: import("react/jsx-runtime").JSX.Element;
|
|
33
35
|
export declare const ImageIcon: import("react/jsx-runtime").JSX.Element;
|
|
34
36
|
export declare const EraserIcon: import("react/jsx-runtime").JSX.Element;
|
|
35
37
|
export declare const ZoomInIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -228,4 +230,8 @@ export declare const markerFrameIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
228
230
|
export declare const LaTeXIcon: import("react/jsx-runtime").JSX.Element;
|
|
229
231
|
export declare const InsertAnyFileIcon: import("react/jsx-runtime").JSX.Element;
|
|
230
232
|
export declare const Card: import("react/jsx-runtime").JSX.Element;
|
|
233
|
+
export declare const resizeIcon: import("react/jsx-runtime").JSX.Element;
|
|
234
|
+
export declare const adjustmentsIcon: import("react/jsx-runtime").JSX.Element;
|
|
235
|
+
export declare const backgroundIcon: import("react/jsx-runtime").JSX.Element;
|
|
236
|
+
export declare const strokeIcon: import("react/jsx-runtime").JSX.Element;
|
|
231
237
|
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";
|
|
@@ -53,4 +54,119 @@ export declare const SHAPES: readonly [{
|
|
|
53
54
|
readonly numericKey: "0";
|
|
54
55
|
readonly fillable: false;
|
|
55
56
|
}];
|
|
56
|
-
export declare const
|
|
57
|
+
export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
|
|
58
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
readonly value: "selection";
|
|
60
|
+
readonly key: "v";
|
|
61
|
+
readonly numericKey: "1";
|
|
62
|
+
readonly fillable: true;
|
|
63
|
+
}, {
|
|
64
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
readonly value: "rectangle";
|
|
66
|
+
readonly key: "r";
|
|
67
|
+
readonly numericKey: "2";
|
|
68
|
+
readonly fillable: true;
|
|
69
|
+
}, {
|
|
70
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
readonly value: "diamond";
|
|
72
|
+
readonly key: "d";
|
|
73
|
+
readonly numericKey: "3";
|
|
74
|
+
readonly fillable: true;
|
|
75
|
+
}, {
|
|
76
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
readonly value: "ellipse";
|
|
78
|
+
readonly key: "o";
|
|
79
|
+
readonly numericKey: "4";
|
|
80
|
+
readonly fillable: true;
|
|
81
|
+
}, {
|
|
82
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
readonly value: "arrow";
|
|
84
|
+
readonly key: "a";
|
|
85
|
+
readonly numericKey: "5";
|
|
86
|
+
readonly fillable: true;
|
|
87
|
+
}, {
|
|
88
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
readonly value: "line";
|
|
90
|
+
readonly key: "l";
|
|
91
|
+
readonly numericKey: "6";
|
|
92
|
+
readonly fillable: true;
|
|
93
|
+
}, {
|
|
94
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
readonly value: "freedraw";
|
|
96
|
+
readonly key: readonly ["p", "x"];
|
|
97
|
+
readonly numericKey: "7";
|
|
98
|
+
readonly fillable: false;
|
|
99
|
+
}, {
|
|
100
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
readonly value: "text";
|
|
102
|
+
readonly key: "t";
|
|
103
|
+
readonly numericKey: "8";
|
|
104
|
+
readonly fillable: false;
|
|
105
|
+
}, {
|
|
106
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
readonly value: "eraser";
|
|
108
|
+
readonly key: "e";
|
|
109
|
+
readonly numericKey: "0";
|
|
110
|
+
readonly fillable: false;
|
|
111
|
+
}] | readonly [{
|
|
112
|
+
readonly value: "lasso";
|
|
113
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
readonly key: "v";
|
|
115
|
+
readonly numericKey: "1";
|
|
116
|
+
readonly fillable: true;
|
|
117
|
+
}, ...({
|
|
118
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
readonly value: "selection";
|
|
120
|
+
readonly key: "v";
|
|
121
|
+
readonly numericKey: "1";
|
|
122
|
+
readonly fillable: true;
|
|
123
|
+
} | {
|
|
124
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
readonly value: "rectangle";
|
|
126
|
+
readonly key: "r";
|
|
127
|
+
readonly numericKey: "2";
|
|
128
|
+
readonly fillable: true;
|
|
129
|
+
} | {
|
|
130
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
131
|
+
readonly value: "diamond";
|
|
132
|
+
readonly key: "d";
|
|
133
|
+
readonly numericKey: "3";
|
|
134
|
+
readonly fillable: true;
|
|
135
|
+
} | {
|
|
136
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
137
|
+
readonly value: "ellipse";
|
|
138
|
+
readonly key: "o";
|
|
139
|
+
readonly numericKey: "4";
|
|
140
|
+
readonly fillable: true;
|
|
141
|
+
} | {
|
|
142
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
143
|
+
readonly value: "arrow";
|
|
144
|
+
readonly key: "a";
|
|
145
|
+
readonly numericKey: "5";
|
|
146
|
+
readonly fillable: true;
|
|
147
|
+
} | {
|
|
148
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
readonly value: "line";
|
|
150
|
+
readonly key: "l";
|
|
151
|
+
readonly numericKey: "6";
|
|
152
|
+
readonly fillable: true;
|
|
153
|
+
} | {
|
|
154
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
readonly value: "freedraw";
|
|
156
|
+
readonly key: readonly ["p", "x"];
|
|
157
|
+
readonly numericKey: "7";
|
|
158
|
+
readonly fillable: false;
|
|
159
|
+
} | {
|
|
160
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
161
|
+
readonly value: "text";
|
|
162
|
+
readonly key: "t";
|
|
163
|
+
readonly numericKey: "8";
|
|
164
|
+
readonly fillable: false;
|
|
165
|
+
} | {
|
|
166
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
167
|
+
readonly value: "eraser";
|
|
168
|
+
readonly key: "e";
|
|
169
|
+
readonly numericKey: "0";
|
|
170
|
+
readonly fillable: false;
|
|
171
|
+
})[]];
|
|
172
|
+
export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "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 "
|
|
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
|
|
44
|
-
|
|
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 */
|
|
@@ -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
|
+
};
|
|
@@ -3,7 +3,7 @@ export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
|
|
|
3
3
|
export declare const libraryItemSvgsCache: import("jotai/vanilla/atom").PrimitiveAtom<SvgCache> & {
|
|
4
4
|
init: SvgCache;
|
|
5
5
|
};
|
|
6
|
-
export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache) => SVGSVGElement | undefined;
|
|
6
|
+
export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache, ref: React.RefObject<HTMLDivElement | null>) => SVGSVGElement | undefined;
|
|
7
7
|
export declare const useLibraryCache: () => {
|
|
8
8
|
clearLibraryCache: () => void;
|
|
9
9
|
deleteItemsFromLibraryCache: (items: LibraryItem["id"][]) => void;
|
|
@@ -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;
|
|
@@ -262,7 +262,7 @@ export interface AppState {
|
|
|
262
262
|
isRotating: boolean;
|
|
263
263
|
zoom: Zoom;
|
|
264
264
|
openMenu: "canvas" | "shape" | null;
|
|
265
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | null;
|
|
265
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
266
266
|
openSidebar: {
|
|
267
267
|
name: SidebarName;
|
|
268
268
|
tab?: SidebarTabName;
|
|
@@ -397,6 +397,8 @@ export interface AppState {
|
|
|
397
397
|
lockedMultiSelections: {
|
|
398
398
|
[groupId: string]: true;
|
|
399
399
|
};
|
|
400
|
+
/** properties sidebar mode - determines whether to show compact or complete sidebar */
|
|
401
|
+
stylesPanelMode: "compact" | "full";
|
|
400
402
|
}
|
|
401
403
|
export type SearchMatch = {
|
|
402
404
|
id: string;
|
|
@@ -620,6 +622,7 @@ export type AppClassProperties = {
|
|
|
620
622
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
621
623
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
622
624
|
updateEditorAtom: App["updateEditorAtom"];
|
|
625
|
+
defaultSelectionTool: "selection" | "lasso";
|
|
623
626
|
};
|
|
624
627
|
export type PointerDownState = Readonly<{
|
|
625
628
|
origin: Readonly<{
|
|
@@ -667,6 +670,7 @@ export type PointerDownState = Readonly<{
|
|
|
667
670
|
x: number;
|
|
668
671
|
y: number;
|
|
669
672
|
};
|
|
673
|
+
blockDragging: boolean;
|
|
670
674
|
};
|
|
671
675
|
eventListeners: {
|
|
672
676
|
onMove: null | ReturnType<typeof throttleRAF>;
|
|
@@ -37,3 +37,4 @@ export declare const distanceToLineSegment: <Point extends GlobalPoint | LocalPo
|
|
|
37
37
|
* @returns
|
|
38
38
|
*/
|
|
39
39
|
export declare function lineSegmentIntersectionPoints<Point extends GlobalPoint | LocalPoint>(l: LineSegment<Point>, s: LineSegment<Point>, threshold?: number): Point | null;
|
|
40
|
+
export declare function lineSegmentsDistance<Point extends GlobalPoint | LocalPoint>(s1: LineSegment<Point>, s2: LineSegment<Point>): number;
|