@zsviczian/excalidraw 0.11.0-obsidian-14 → 0.11.0-obsidian-17
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 +27 -27
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +2 -2
- package/types/actions/actionAddToLibrary.d.ts +21 -3
- package/types/actions/actionBoundText.d.ts +7 -1
- package/types/actions/actionCanvas.d.ts +64 -10
- package/types/actions/actionClipboard.d.ts +36 -6
- package/types/actions/actionDeleteSelected.d.ts +22 -4
- package/types/actions/actionDuplicateSelection.d.ts +1 -1
- package/types/actions/actionExport.d.ts +64 -10
- package/types/actions/actionFinalize.d.ts +18 -5
- package/types/actions/actionMenu.d.ts +21 -3
- package/types/actions/actionProperties.d.ts +91 -13
- package/types/actions/actionStyles.d.ts +7 -1
- package/types/actions/actionToggleGridMode.d.ts +7 -1
- package/types/actions/actionToggleStats.d.ts +7 -1
- package/types/actions/actionToggleViewMode.d.ts +7 -1
- package/types/actions/actionToggleZenMode.d.ts +7 -1
- package/types/appState.d.ts +8 -2
- package/types/clipboard.d.ts +1 -1
- package/types/components/App.d.ts +3 -1
- package/types/components/Avatar.d.ts +3 -2
- package/types/components/LibraryMenuItems.d.ts +2 -1
- package/types/data/library.d.ts +37 -49
- package/types/element/Hyperlink.d.ts +7 -1
- package/types/element/linearElementEditor.d.ts +7 -1
- package/types/packages/excalidraw/entry.d.ts +1 -1
- package/types/packages/excalidraw/index.d.ts +3 -2
- package/types/packages/utils.d.ts +7 -1
- package/types/types.d.ts +16 -1
- package/types/utils.d.ts +10 -1
|
@@ -37,7 +37,13 @@ export declare const actionChangeFillStyle: {
|
|
|
37
37
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
38
38
|
activeTool: {
|
|
39
39
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
40
|
-
lastActiveToolBeforeEraser: "
|
|
40
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
41
|
+
locked: boolean;
|
|
42
|
+
customType: null;
|
|
43
|
+
} | {
|
|
44
|
+
type: "custom";
|
|
45
|
+
customType: string;
|
|
46
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
41
47
|
locked: boolean;
|
|
42
48
|
};
|
|
43
49
|
penMode: boolean;
|
|
@@ -142,7 +148,13 @@ export declare const actionChangeStrokeWidth: {
|
|
|
142
148
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
143
149
|
activeTool: {
|
|
144
150
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
145
|
-
lastActiveToolBeforeEraser: "
|
|
151
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
152
|
+
locked: boolean;
|
|
153
|
+
customType: null;
|
|
154
|
+
} | {
|
|
155
|
+
type: "custom";
|
|
156
|
+
customType: string;
|
|
157
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
146
158
|
locked: boolean;
|
|
147
159
|
};
|
|
148
160
|
penMode: boolean;
|
|
@@ -247,7 +259,13 @@ export declare const actionChangeSloppiness: {
|
|
|
247
259
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
248
260
|
activeTool: {
|
|
249
261
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
250
|
-
lastActiveToolBeforeEraser: "
|
|
262
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
263
|
+
locked: boolean;
|
|
264
|
+
customType: null;
|
|
265
|
+
} | {
|
|
266
|
+
type: "custom";
|
|
267
|
+
customType: string;
|
|
268
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
251
269
|
locked: boolean;
|
|
252
270
|
};
|
|
253
271
|
penMode: boolean;
|
|
@@ -352,7 +370,13 @@ export declare const actionChangeStrokeStyle: {
|
|
|
352
370
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
353
371
|
activeTool: {
|
|
354
372
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
355
|
-
lastActiveToolBeforeEraser: "
|
|
373
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
374
|
+
locked: boolean;
|
|
375
|
+
customType: null;
|
|
376
|
+
} | {
|
|
377
|
+
type: "custom";
|
|
378
|
+
customType: string;
|
|
379
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
356
380
|
locked: boolean;
|
|
357
381
|
};
|
|
358
382
|
penMode: boolean;
|
|
@@ -457,7 +481,13 @@ export declare const actionChangeOpacity: {
|
|
|
457
481
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
458
482
|
activeTool: {
|
|
459
483
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
460
|
-
lastActiveToolBeforeEraser: "
|
|
484
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
485
|
+
locked: boolean;
|
|
486
|
+
customType: null;
|
|
487
|
+
} | {
|
|
488
|
+
type: "custom";
|
|
489
|
+
customType: string;
|
|
490
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
461
491
|
locked: boolean;
|
|
462
492
|
};
|
|
463
493
|
penMode: boolean;
|
|
@@ -562,7 +592,13 @@ export declare const actionChangeFontSize: {
|
|
|
562
592
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
563
593
|
activeTool: {
|
|
564
594
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
565
|
-
lastActiveToolBeforeEraser: "
|
|
595
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
596
|
+
locked: boolean;
|
|
597
|
+
customType: null;
|
|
598
|
+
} | {
|
|
599
|
+
type: "custom";
|
|
600
|
+
customType: string;
|
|
601
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
566
602
|
locked: boolean;
|
|
567
603
|
};
|
|
568
604
|
penMode: boolean;
|
|
@@ -667,7 +703,13 @@ export declare const actionDecreaseFontSize: {
|
|
|
667
703
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
668
704
|
activeTool: {
|
|
669
705
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
670
|
-
lastActiveToolBeforeEraser: "
|
|
706
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
707
|
+
locked: boolean;
|
|
708
|
+
customType: null;
|
|
709
|
+
} | {
|
|
710
|
+
type: "custom";
|
|
711
|
+
customType: string;
|
|
712
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
671
713
|
locked: boolean;
|
|
672
714
|
};
|
|
673
715
|
penMode: boolean;
|
|
@@ -772,7 +814,13 @@ export declare const actionIncreaseFontSize: {
|
|
|
772
814
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
773
815
|
activeTool: {
|
|
774
816
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
775
|
-
lastActiveToolBeforeEraser: "
|
|
817
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
818
|
+
locked: boolean;
|
|
819
|
+
customType: null;
|
|
820
|
+
} | {
|
|
821
|
+
type: "custom";
|
|
822
|
+
customType: string;
|
|
823
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
776
824
|
locked: boolean;
|
|
777
825
|
};
|
|
778
826
|
penMode: boolean;
|
|
@@ -877,7 +925,13 @@ export declare const actionChangeFontFamily: {
|
|
|
877
925
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
878
926
|
activeTool: {
|
|
879
927
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
880
|
-
lastActiveToolBeforeEraser: "
|
|
928
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
929
|
+
locked: boolean;
|
|
930
|
+
customType: null;
|
|
931
|
+
} | {
|
|
932
|
+
type: "custom";
|
|
933
|
+
customType: string;
|
|
934
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
881
935
|
locked: boolean;
|
|
882
936
|
};
|
|
883
937
|
penMode: boolean;
|
|
@@ -982,7 +1036,13 @@ export declare const actionChangeTextAlign: {
|
|
|
982
1036
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
983
1037
|
activeTool: {
|
|
984
1038
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
985
|
-
lastActiveToolBeforeEraser: "
|
|
1039
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
1040
|
+
locked: boolean;
|
|
1041
|
+
customType: null;
|
|
1042
|
+
} | {
|
|
1043
|
+
type: "custom";
|
|
1044
|
+
customType: string;
|
|
1045
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
986
1046
|
locked: boolean;
|
|
987
1047
|
};
|
|
988
1048
|
penMode: boolean;
|
|
@@ -1088,7 +1148,13 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1088
1148
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1089
1149
|
activeTool: {
|
|
1090
1150
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
1091
|
-
lastActiveToolBeforeEraser: "
|
|
1151
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
1152
|
+
locked: boolean;
|
|
1153
|
+
customType: null;
|
|
1154
|
+
} | {
|
|
1155
|
+
type: "custom";
|
|
1156
|
+
customType: string;
|
|
1157
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
1092
1158
|
locked: boolean;
|
|
1093
1159
|
};
|
|
1094
1160
|
penMode: boolean;
|
|
@@ -1195,7 +1261,13 @@ export declare const actionChangeSharpness: {
|
|
|
1195
1261
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1196
1262
|
activeTool: {
|
|
1197
1263
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
1198
|
-
lastActiveToolBeforeEraser: "
|
|
1264
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
1265
|
+
locked: boolean;
|
|
1266
|
+
customType: null;
|
|
1267
|
+
} | {
|
|
1268
|
+
type: "custom";
|
|
1269
|
+
customType: string;
|
|
1270
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
1199
1271
|
locked: boolean;
|
|
1200
1272
|
};
|
|
1201
1273
|
penMode: boolean;
|
|
@@ -1301,7 +1373,13 @@ export declare const actionChangeArrowhead: {
|
|
|
1301
1373
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1302
1374
|
activeTool: {
|
|
1303
1375
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
1304
|
-
lastActiveToolBeforeEraser: "
|
|
1376
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
1377
|
+
locked: boolean;
|
|
1378
|
+
customType: null;
|
|
1379
|
+
} | {
|
|
1380
|
+
type: "custom";
|
|
1381
|
+
customType: string;
|
|
1382
|
+
lastActiveToolBeforeEraser: import("../../src/types").LastActiveToolBeforeEraser;
|
|
1305
1383
|
locked: boolean;
|
|
1306
1384
|
};
|
|
1307
1385
|
penMode: boolean;
|
|
@@ -21,7 +21,13 @@ export declare const actionCopyStyles: {
|
|
|
21
21
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
22
22
|
activeTool: {
|
|
23
23
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
24
|
-
lastActiveToolBeforeEraser: "
|
|
24
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
customType: null;
|
|
27
|
+
} | {
|
|
28
|
+
type: "custom";
|
|
29
|
+
customType: string;
|
|
30
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
25
31
|
locked: boolean;
|
|
26
32
|
};
|
|
27
33
|
penMode: boolean;
|
|
@@ -22,7 +22,13 @@ export declare const actionToggleGridMode: {
|
|
|
22
22
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
23
23
|
activeTool: {
|
|
24
24
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
25
|
-
lastActiveToolBeforeEraser: "
|
|
25
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
26
|
+
locked: boolean;
|
|
27
|
+
customType: null;
|
|
28
|
+
} | {
|
|
29
|
+
type: "custom";
|
|
30
|
+
customType: string;
|
|
31
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
26
32
|
locked: boolean;
|
|
27
33
|
};
|
|
28
34
|
penMode: boolean;
|
|
@@ -20,7 +20,13 @@ export declare const actionToggleStats: {
|
|
|
20
20
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
21
21
|
activeTool: {
|
|
22
22
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
23
|
-
lastActiveToolBeforeEraser: "
|
|
23
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
24
|
+
locked: boolean;
|
|
25
|
+
customType: null;
|
|
26
|
+
} | {
|
|
27
|
+
type: "custom";
|
|
28
|
+
customType: string;
|
|
29
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
24
30
|
locked: boolean;
|
|
25
31
|
};
|
|
26
32
|
penMode: boolean;
|
|
@@ -21,7 +21,13 @@ export declare const actionToggleViewMode: {
|
|
|
21
21
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
22
22
|
activeTool: {
|
|
23
23
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
24
|
-
lastActiveToolBeforeEraser: "
|
|
24
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
customType: null;
|
|
27
|
+
} | {
|
|
28
|
+
type: "custom";
|
|
29
|
+
customType: string;
|
|
30
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
25
31
|
locked: boolean;
|
|
26
32
|
};
|
|
27
33
|
penMode: boolean;
|
|
@@ -21,7 +21,13 @@ export declare const actionToggleZenMode: {
|
|
|
21
21
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
22
22
|
activeTool: {
|
|
23
23
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
24
|
-
lastActiveToolBeforeEraser: "
|
|
24
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
customType: null;
|
|
27
|
+
} | {
|
|
28
|
+
type: "custom";
|
|
29
|
+
customType: string;
|
|
30
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
25
31
|
locked: boolean;
|
|
26
32
|
};
|
|
27
33
|
penMode: boolean;
|
package/types/appState.d.ts
CHANGED
|
@@ -3,7 +3,13 @@ export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "off
|
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
4
|
activeTool?: {
|
|
5
5
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
6
|
-
lastActiveToolBeforeEraser: "
|
|
6
|
+
lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser; /** whether to keep when exporting to file/database */
|
|
7
|
+
locked: boolean;
|
|
8
|
+
customType: null;
|
|
9
|
+
} | {
|
|
10
|
+
type: "custom";
|
|
11
|
+
customType: string;
|
|
12
|
+
lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
|
|
7
13
|
locked: boolean;
|
|
8
14
|
} | undefined;
|
|
9
15
|
scrollX?: number | undefined;
|
|
@@ -14,7 +20,6 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
14
20
|
}> | undefined;
|
|
15
21
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
16
22
|
theme?: string | undefined;
|
|
17
|
-
name?: string | undefined;
|
|
18
23
|
penMode?: boolean | undefined;
|
|
19
24
|
penDetected?: boolean | undefined;
|
|
20
25
|
exportBackground?: boolean | undefined;
|
|
@@ -37,6 +42,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
37
42
|
currentItemLinearStrokeSharpness?: import("./element/types").StrokeSharpness | undefined;
|
|
38
43
|
cursorButton?: "up" | "down" | undefined;
|
|
39
44
|
scrolledOutside?: boolean | undefined;
|
|
45
|
+
name?: string | undefined;
|
|
40
46
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
41
47
|
lastPointerDownWith?: import("./element/types").PointerType | undefined;
|
|
42
48
|
selectedElementIds?: {
|
package/types/clipboard.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ClipboardData {
|
|
|
11
11
|
export declare const probablySupportsClipboardReadText: boolean;
|
|
12
12
|
export declare const probablySupportsClipboardWriteText: boolean;
|
|
13
13
|
export declare const probablySupportsClipboardBlob: boolean;
|
|
14
|
-
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles) => Promise<void>;
|
|
14
|
+
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles | null) => Promise<void>;
|
|
15
15
|
/**
|
|
16
16
|
* Attempts to parse clipboard. Prefers system clipboard.
|
|
17
17
|
*/
|
|
@@ -39,6 +39,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
39
39
|
x: number;
|
|
40
40
|
y: number;
|
|
41
41
|
} | null;
|
|
42
|
+
allowMobileMode: boolean;
|
|
42
43
|
constructor(props: AppProps);
|
|
43
44
|
private renderCanvas;
|
|
44
45
|
render(): JSX.Element;
|
|
@@ -90,6 +91,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
90
91
|
restoreFileFromShare: () => Promise<void>;
|
|
91
92
|
/** adds supplied files to existing files in the appState */
|
|
92
93
|
addFiles: ExcalidrawImperativeAPI["addFiles"];
|
|
94
|
+
setMobileModeAllowed: ExcalidrawImperativeAPI["setMobileModeAllowed"];
|
|
93
95
|
setLocalFont: ExcalidrawImperativeAPI["setLocalFont"];
|
|
94
96
|
selectElements: ExcalidrawImperativeAPI["selectElements"];
|
|
95
97
|
bringToFront: ExcalidrawImperativeAPI["bringToFront"];
|
|
@@ -101,7 +103,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
101
103
|
appState?: Pick<AppState, K> | null | undefined;
|
|
102
104
|
collaborators?: SceneData["collaborators"];
|
|
103
105
|
commitToHistory?: SceneData["commitToHistory"];
|
|
104
|
-
libraryItems?: LibraryItems | import("../types").LibraryItems_v1 | Promise<LibraryItems | import("../types").LibraryItems_v1> | undefined;
|
|
106
|
+
libraryItems?: LibraryItems | import("../types").LibraryItems_v1 | Promise<LibraryItems | import("../types").LibraryItems_v1> | ((currentLibraryItems: LibraryItems) => Required<SceneData>["libraryItems"] | Promise<Required<SceneData>["libraryItems"]>) | undefined;
|
|
105
107
|
}) => void;
|
|
106
108
|
private onSceneUpdated;
|
|
107
109
|
private updateCurrentCursorPosition;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./Avatar.scss";
|
|
2
2
|
import React from "react";
|
|
3
3
|
declare type AvatarProps = {
|
|
4
|
-
children: string;
|
|
5
4
|
onClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
6
5
|
color: string;
|
|
7
6
|
border: string;
|
|
7
|
+
name: string;
|
|
8
|
+
src?: string;
|
|
8
9
|
};
|
|
9
|
-
export declare const Avatar: ({
|
|
10
|
+
export declare const Avatar: ({ color, border, onClick, name, src }: AvatarProps) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import Library from "../data/library";
|
|
3
3
|
import { AppState, BinaryFiles, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
|
|
4
4
|
import "./LibraryMenuItems.scss";
|
|
5
|
-
declare const LibraryMenuItems: ({ libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertShape, pendingElements, theme, setAppState, libraryReturnUrl, library, files, id, selectedItems, onToggle, onPublish, resetLibrary, }: {
|
|
5
|
+
declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertShape, pendingElements, theme, setAppState, libraryReturnUrl, library, files, id, selectedItems, onToggle, onPublish, resetLibrary, }: {
|
|
6
|
+
isLoading: boolean;
|
|
6
7
|
libraryItems: LibraryItems;
|
|
7
8
|
pendingElements: LibraryItem["elements"];
|
|
8
9
|
onRemoveFromLibrary: () => void;
|
package/types/data/library.d.ts
CHANGED
|
@@ -2,11 +2,8 @@ import { LibraryItems, LibraryItem } from "../types";
|
|
|
2
2
|
import type App from "../components/App";
|
|
3
3
|
import { ImportedDataState } from "./types";
|
|
4
4
|
export declare const libraryItemsAtom: import("jotai").Atom<{
|
|
5
|
-
status: "loading";
|
|
6
|
-
|
|
7
|
-
promise: Promise<LibraryItems>;
|
|
8
|
-
} | {
|
|
9
|
-
status: "loaded";
|
|
5
|
+
status: "loading" | "loaded";
|
|
6
|
+
isInitialized: boolean;
|
|
10
7
|
libraryItems: LibraryItems;
|
|
11
8
|
}> & {
|
|
12
9
|
write: (get: {
|
|
@@ -27,71 +24,62 @@ export declare const libraryItemsAtom: import("jotai").Atom<{
|
|
|
27
24
|
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
28
25
|
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
29
26
|
}, update: {
|
|
30
|
-
status: "loading";
|
|
31
|
-
|
|
32
|
-
promise: Promise<LibraryItems>;
|
|
33
|
-
} | {
|
|
34
|
-
status: "loaded";
|
|
27
|
+
status: "loading" | "loaded";
|
|
28
|
+
isInitialized: boolean;
|
|
35
29
|
libraryItems: LibraryItems;
|
|
36
30
|
} | ((prev: {
|
|
37
|
-
status: "loading";
|
|
38
|
-
|
|
39
|
-
promise: Promise<LibraryItems>;
|
|
40
|
-
} | {
|
|
41
|
-
status: "loaded";
|
|
31
|
+
status: "loading" | "loaded";
|
|
32
|
+
isInitialized: boolean;
|
|
42
33
|
libraryItems: LibraryItems;
|
|
43
34
|
}) => {
|
|
44
|
-
status: "loading";
|
|
45
|
-
|
|
46
|
-
promise: Promise<LibraryItems>;
|
|
47
|
-
} | {
|
|
48
|
-
status: "loaded";
|
|
35
|
+
status: "loading" | "loaded";
|
|
36
|
+
isInitialized: boolean;
|
|
49
37
|
libraryItems: LibraryItems;
|
|
50
38
|
})) => void;
|
|
51
39
|
onMount?: (<S extends (update: {
|
|
52
|
-
status: "loading";
|
|
53
|
-
|
|
54
|
-
promise: Promise<LibraryItems>;
|
|
55
|
-
} | {
|
|
56
|
-
status: "loaded";
|
|
40
|
+
status: "loading" | "loaded";
|
|
41
|
+
isInitialized: boolean;
|
|
57
42
|
libraryItems: LibraryItems;
|
|
58
43
|
} | ((prev: {
|
|
59
|
-
status: "loading";
|
|
60
|
-
|
|
61
|
-
promise: Promise<LibraryItems>;
|
|
62
|
-
} | {
|
|
63
|
-
status: "loaded";
|
|
44
|
+
status: "loading" | "loaded";
|
|
45
|
+
isInitialized: boolean;
|
|
64
46
|
libraryItems: LibraryItems;
|
|
65
47
|
}) => {
|
|
66
|
-
status: "loading";
|
|
67
|
-
|
|
68
|
-
promise: Promise<LibraryItems>;
|
|
69
|
-
} | {
|
|
70
|
-
status: "loaded";
|
|
48
|
+
status: "loading" | "loaded";
|
|
49
|
+
isInitialized: boolean;
|
|
71
50
|
libraryItems: LibraryItems;
|
|
72
51
|
})) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
73
52
|
} & {
|
|
74
53
|
init: {
|
|
75
|
-
status: "loading";
|
|
76
|
-
|
|
77
|
-
promise: Promise<LibraryItems>;
|
|
78
|
-
} | {
|
|
79
|
-
status: "loaded";
|
|
54
|
+
status: "loading" | "loaded";
|
|
55
|
+
isInitialized: boolean;
|
|
80
56
|
libraryItems: LibraryItems;
|
|
81
57
|
};
|
|
82
58
|
};
|
|
59
|
+
/** Merges otherItems into localItems. Unique items in otherItems array are
|
|
60
|
+
sorted first. */
|
|
61
|
+
export declare const mergeLibraryItems: (localItems: LibraryItems, otherItems: LibraryItems) => LibraryItems;
|
|
83
62
|
declare class Library {
|
|
84
|
-
/**
|
|
85
|
-
asynchronously */
|
|
86
|
-
private libraryItemsPromise;
|
|
87
|
-
/** last resolved libraryItems */
|
|
63
|
+
/** latest libraryItems */
|
|
88
64
|
private lastLibraryItems;
|
|
65
|
+
/** indicates whether library is initialized with library items (has gone
|
|
66
|
+
* though at least one update) */
|
|
67
|
+
private isInitialized;
|
|
89
68
|
private app;
|
|
90
69
|
constructor(app: App);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
70
|
+
private updateQueue;
|
|
71
|
+
private getLastUpdateTask;
|
|
72
|
+
private notifyListeners;
|
|
73
|
+
resetLibrary: () => Promise<LibraryItems>;
|
|
74
|
+
/**
|
|
75
|
+
* imports library (from blob or libraryItems), merging with current library
|
|
76
|
+
* (attempting to remove duplicates)
|
|
77
|
+
*/
|
|
78
|
+
importLibrary(library: Blob | Required<ImportedDataState>["libraryItems"] | Promise<Required<ImportedDataState>["libraryItems"]>, defaultStatus?: LibraryItem["status"]): Promise<LibraryItems>;
|
|
79
|
+
/**
|
|
80
|
+
* @returns latest cloned libraryItems. Awaits all in-progress updates first.
|
|
81
|
+
*/
|
|
82
|
+
getLatestLibrary: () => Promise<LibraryItems>;
|
|
83
|
+
setLibrary: (libraryItems: LibraryItems | Promise<LibraryItems> | ((latestLibraryItems: LibraryItems) => LibraryItems | Promise<LibraryItems>)) => Promise<LibraryItems>;
|
|
96
84
|
}
|
|
97
85
|
export default Library;
|
|
@@ -32,7 +32,13 @@ export declare const actionLink: {
|
|
|
32
32
|
editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
33
33
|
activeTool: {
|
|
34
34
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
35
|
-
lastActiveToolBeforeEraser: "
|
|
35
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
36
|
+
locked: boolean;
|
|
37
|
+
customType: null;
|
|
38
|
+
} | {
|
|
39
|
+
type: "custom";
|
|
40
|
+
customType: string;
|
|
41
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
36
42
|
locked: boolean;
|
|
37
43
|
};
|
|
38
44
|
penMode: boolean;
|
|
@@ -98,7 +98,13 @@ export declare class LinearElementEditor {
|
|
|
98
98
|
editingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
99
99
|
activeTool: {
|
|
100
100
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
101
|
-
lastActiveToolBeforeEraser: "
|
|
101
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
102
|
+
locked: boolean;
|
|
103
|
+
customType: null;
|
|
104
|
+
} | {
|
|
105
|
+
type: "custom";
|
|
106
|
+
customType: string;
|
|
107
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
102
108
|
locked: boolean;
|
|
103
109
|
};
|
|
104
110
|
penMode: boolean;
|
|
@@ -12,7 +12,8 @@ export { exportToCanvas, exportToBlob, exportToSvg, serializeAsJSON, serializeLi
|
|
|
12
12
|
getMaximumGroups, //zsviczian
|
|
13
13
|
intersectElementWithLine, //zsviczian
|
|
14
14
|
determineFocusDistance, //zsviczian
|
|
15
|
-
measureText,
|
|
15
|
+
measureText, //zsviczian
|
|
16
|
+
exportToClipboard, mergeLibraryItems, } from "../../packages/utils";
|
|
16
17
|
export { isLinearElement } from "../../element/typeChecks";
|
|
17
|
-
export { FONT_FAMILY, THEME } from "../../constants";
|
|
18
|
+
export { FONT_FAMILY, THEME, MIME_TYPES } from "../../constants";
|
|
18
19
|
export { mutateElement, newElementWith, bumpVersion, } from "../../element/mutateElement";
|
|
@@ -15,10 +15,15 @@ export declare const exportToCanvas: ({ elements, appState, files, maxWidthOrHei
|
|
|
15
15
|
export declare const exportToBlob: (opts: ExportOpts & {
|
|
16
16
|
mimeType?: string;
|
|
17
17
|
quality?: number;
|
|
18
|
-
}) => Promise<Blob
|
|
18
|
+
}) => Promise<Blob>;
|
|
19
19
|
export declare const exportToSvg: ({ elements, appState, files, exportPadding, }: Omit<ExportOpts, "getDimensions"> & {
|
|
20
20
|
exportPadding?: number | undefined;
|
|
21
21
|
}) => Promise<SVGSVGElement>;
|
|
22
|
+
export declare const exportToClipboard: (opts: ExportOpts & {
|
|
23
|
+
mimeType?: string;
|
|
24
|
+
quality?: number;
|
|
25
|
+
type: "png" | "svg" | "json";
|
|
26
|
+
}) => Promise<void>;
|
|
22
27
|
export { serializeAsJSON, serializeLibraryAsJSON } from "../data/json";
|
|
23
28
|
export { loadFromBlob, loadLibraryFromBlob } from "../data/blob";
|
|
24
29
|
export { getFreeDrawSvgPath } from "../renderer/renderElement";
|
|
@@ -27,3 +32,4 @@ export { getMaximumGroups } from "../groups";
|
|
|
27
32
|
export { intersectElementWithLine } from "../element/collision";
|
|
28
33
|
export { determineFocusDistance } from "../element/collision";
|
|
29
34
|
export { measureText } from "../element/textElement";
|
|
35
|
+
export { mergeLibraryItems } from "../data/library";
|
package/types/types.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare type Collaborator = {
|
|
|
29
29
|
background: string;
|
|
30
30
|
stroke: string;
|
|
31
31
|
};
|
|
32
|
+
src?: string;
|
|
32
33
|
};
|
|
33
34
|
export declare type DataURL = string & {
|
|
34
35
|
_brand: "DataURL";
|
|
@@ -41,6 +42,13 @@ export declare type BinaryFileData = {
|
|
|
41
42
|
};
|
|
42
43
|
export declare type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
|
|
43
44
|
export declare type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
|
|
45
|
+
export declare type LastActiveToolBeforeEraser = {
|
|
46
|
+
type: typeof SHAPES[number]["value"] | "eraser";
|
|
47
|
+
customType: null;
|
|
48
|
+
} | {
|
|
49
|
+
type: "custom";
|
|
50
|
+
customType: string;
|
|
51
|
+
} | null;
|
|
44
52
|
export declare type AppState = {
|
|
45
53
|
isLoading: boolean;
|
|
46
54
|
errorMessage: string | null;
|
|
@@ -55,7 +63,13 @@ export declare type AppState = {
|
|
|
55
63
|
editingLinearElement: LinearElementEditor | null;
|
|
56
64
|
activeTool: {
|
|
57
65
|
type: typeof SHAPES[number]["value"] | "eraser";
|
|
58
|
-
lastActiveToolBeforeEraser:
|
|
66
|
+
lastActiveToolBeforeEraser: LastActiveToolBeforeEraser;
|
|
67
|
+
locked: boolean;
|
|
68
|
+
customType: null;
|
|
69
|
+
} | {
|
|
70
|
+
type: "custom";
|
|
71
|
+
customType: string;
|
|
72
|
+
lastActiveToolBeforeEraser: LastActiveToolBeforeEraser;
|
|
59
73
|
locked: boolean;
|
|
60
74
|
};
|
|
61
75
|
penMode: boolean;
|
|
@@ -363,6 +377,7 @@ export declare type ExcalidrawImperativeAPI = {
|
|
|
363
377
|
sendToBack: (elements: readonly ExcalidrawElement[]) => void;
|
|
364
378
|
bringToFront: (elements: readonly ExcalidrawElement[]) => void;
|
|
365
379
|
restore: InstanceType<typeof App>["restore"];
|
|
380
|
+
setMobileModeAllowed: (allow: boolean) => void;
|
|
366
381
|
};
|
|
367
382
|
export declare type DeviceType = {
|
|
368
383
|
isMobile: boolean;
|
package/types/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EVENT } from "./constants";
|
|
2
2
|
import { FontFamilyValues, FontString } from "./element/types";
|
|
3
|
-
import { AppState, Zoom } from "./types";
|
|
3
|
+
import { AppState, LastActiveToolBeforeEraser, Zoom } from "./types";
|
|
4
|
+
import { SHAPES } from "./shapes";
|
|
4
5
|
export declare const setDateTimeForTests: (dateTime: string) => void;
|
|
5
6
|
export declare const getDateTime: () => string;
|
|
6
7
|
export declare const capitalizeString: (str: string) => string;
|
|
@@ -29,6 +30,14 @@ export declare const chunk: <T extends unknown>(array: readonly T[], size: numbe
|
|
|
29
30
|
export declare const selectNode: (node: Element) => void;
|
|
30
31
|
export declare const removeSelection: () => void;
|
|
31
32
|
export declare const distance: (x: number, y: number) => number;
|
|
33
|
+
export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: ({
|
|
34
|
+
type: typeof SHAPES[number]["value"] | "eraser";
|
|
35
|
+
} | {
|
|
36
|
+
type: "custom";
|
|
37
|
+
customType: string;
|
|
38
|
+
}) & {
|
|
39
|
+
lastActiveToolBeforeEraser?: LastActiveToolBeforeEraser;
|
|
40
|
+
}) => AppState["activeTool"];
|
|
32
41
|
export declare const resetCursor: (canvas: HTMLCanvasElement | null) => void;
|
|
33
42
|
export declare const setCursor: (canvas: HTMLCanvasElement | null, cursor: string) => void;
|
|
34
43
|
export declare const setEraserCursor: (canvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
|