@zsviczian/excalidraw 0.14.2-obsidian-2 → 0.14.2-obsidian-3
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 +49 -38
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +2 -2
- package/types/actions/actionAddToLibrary.d.ts +5 -1
- package/types/actions/actionBoundText.d.ts +3 -1
- package/types/actions/actionCanvas.d.ts +20 -10
- package/types/actions/actionClipboard.d.ts +8 -3
- package/types/actions/actionDeleteSelected.d.ts +6 -3
- package/types/actions/actionDuplicateSelection.d.ts +1 -1
- package/types/actions/actionExport.d.ts +17 -8
- package/types/actions/actionFinalize.d.ts +4 -2
- package/types/actions/actionLinearEditor.d.ts +3 -1
- package/types/actions/actionMenu.d.ts +6 -3
- package/types/actions/actionProperties.d.ts +26 -13
- package/types/actions/actionStyles.d.ts +2 -1
- package/types/actions/actionToggleGridMode.d.ts +2 -1
- package/types/actions/actionToggleLock.d.ts +2 -1
- package/types/actions/actionToggleStats.d.ts +2 -1
- package/types/actions/actionToggleViewMode.d.ts +2 -1
- package/types/actions/actionToggleZenMode.d.ts +2 -1
- package/types/actions/shortcuts.d.ts +1 -0
- package/types/actions/types.d.ts +1 -0
- package/types/components/App.d.ts +12 -1
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/constants.d.ts +1 -0
- package/types/data/blob.d.ts +1 -0
- package/types/element/Hyperlink.d.ts +2 -1
- package/types/element/linearElementEditor.d.ts +6 -3
- package/types/element/mutateElement.d.ts +1 -0
- package/types/element/newElement.d.ts +2 -0
- package/types/element/textElement.d.ts +24 -6
- package/types/element/typeChecks.d.ts +1 -0
- package/types/element/types.d.ts +8 -0
- package/types/packages/excalidraw/index.d.ts +1 -0
- package/types/packages/utils.d.ts +1 -1
- package/types/types.d.ts +4 -2
- package/types/utility-types.d.ts +22 -0
- package/types/utils.d.ts +20 -0
|
@@ -31,7 +31,7 @@ export declare const actionChangeFillStyle: {
|
|
|
31
31
|
} | null;
|
|
32
32
|
showWelcomeScreen: boolean;
|
|
33
33
|
isLoading: boolean;
|
|
34
|
-
errorMessage:
|
|
34
|
+
errorMessage: import("react").ReactNode;
|
|
35
35
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
36
36
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
37
37
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -137,6 +137,7 @@ export declare const actionChangeFillStyle: {
|
|
|
137
137
|
customPens?: any[] | undefined;
|
|
138
138
|
currentStrokeOptions?: any;
|
|
139
139
|
resetCustomPen?: any;
|
|
140
|
+
gridColor: string;
|
|
140
141
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
141
142
|
};
|
|
142
143
|
commitToHistory: true;
|
|
@@ -159,7 +160,7 @@ export declare const actionChangeStrokeWidth: {
|
|
|
159
160
|
} | null;
|
|
160
161
|
showWelcomeScreen: boolean;
|
|
161
162
|
isLoading: boolean;
|
|
162
|
-
errorMessage:
|
|
163
|
+
errorMessage: import("react").ReactNode;
|
|
163
164
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
164
165
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
165
166
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -265,6 +266,7 @@ export declare const actionChangeStrokeWidth: {
|
|
|
265
266
|
customPens?: any[] | undefined;
|
|
266
267
|
currentStrokeOptions?: any;
|
|
267
268
|
resetCustomPen?: any;
|
|
269
|
+
gridColor: string;
|
|
268
270
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
269
271
|
};
|
|
270
272
|
commitToHistory: true;
|
|
@@ -287,7 +289,7 @@ export declare const actionChangeSloppiness: {
|
|
|
287
289
|
} | null;
|
|
288
290
|
showWelcomeScreen: boolean;
|
|
289
291
|
isLoading: boolean;
|
|
290
|
-
errorMessage:
|
|
292
|
+
errorMessage: import("react").ReactNode;
|
|
291
293
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
292
294
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
293
295
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -393,6 +395,7 @@ export declare const actionChangeSloppiness: {
|
|
|
393
395
|
customPens?: any[] | undefined;
|
|
394
396
|
currentStrokeOptions?: any;
|
|
395
397
|
resetCustomPen?: any;
|
|
398
|
+
gridColor: string;
|
|
396
399
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
397
400
|
};
|
|
398
401
|
commitToHistory: true;
|
|
@@ -415,7 +418,7 @@ export declare const actionChangeStrokeStyle: {
|
|
|
415
418
|
} | null;
|
|
416
419
|
showWelcomeScreen: boolean;
|
|
417
420
|
isLoading: boolean;
|
|
418
|
-
errorMessage:
|
|
421
|
+
errorMessage: import("react").ReactNode;
|
|
419
422
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
420
423
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
421
424
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -521,6 +524,7 @@ export declare const actionChangeStrokeStyle: {
|
|
|
521
524
|
customPens?: any[] | undefined;
|
|
522
525
|
currentStrokeOptions?: any;
|
|
523
526
|
resetCustomPen?: any;
|
|
527
|
+
gridColor: string;
|
|
524
528
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
525
529
|
};
|
|
526
530
|
commitToHistory: true;
|
|
@@ -543,7 +547,7 @@ export declare const actionChangeOpacity: {
|
|
|
543
547
|
} | null;
|
|
544
548
|
showWelcomeScreen: boolean;
|
|
545
549
|
isLoading: boolean;
|
|
546
|
-
errorMessage:
|
|
550
|
+
errorMessage: import("react").ReactNode;
|
|
547
551
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
548
552
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
549
553
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -649,6 +653,7 @@ export declare const actionChangeOpacity: {
|
|
|
649
653
|
customPens?: any[] | undefined;
|
|
650
654
|
currentStrokeOptions?: any;
|
|
651
655
|
resetCustomPen?: any;
|
|
656
|
+
gridColor: string;
|
|
652
657
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
653
658
|
};
|
|
654
659
|
commitToHistory: true;
|
|
@@ -671,7 +676,7 @@ export declare const actionChangeFontSize: {
|
|
|
671
676
|
} | null;
|
|
672
677
|
showWelcomeScreen: boolean;
|
|
673
678
|
isLoading: boolean;
|
|
674
|
-
errorMessage:
|
|
679
|
+
errorMessage: import("react").ReactNode;
|
|
675
680
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
676
681
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
677
682
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -777,6 +782,7 @@ export declare const actionChangeFontSize: {
|
|
|
777
782
|
customPens?: any[] | undefined;
|
|
778
783
|
currentStrokeOptions?: any;
|
|
779
784
|
resetCustomPen?: any;
|
|
785
|
+
gridColor: string;
|
|
780
786
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
781
787
|
};
|
|
782
788
|
commitToHistory: boolean;
|
|
@@ -799,7 +805,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
799
805
|
} | null;
|
|
800
806
|
showWelcomeScreen: boolean;
|
|
801
807
|
isLoading: boolean;
|
|
802
|
-
errorMessage:
|
|
808
|
+
errorMessage: import("react").ReactNode;
|
|
803
809
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
804
810
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
805
811
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -905,6 +911,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
905
911
|
customPens?: any[] | undefined;
|
|
906
912
|
currentStrokeOptions?: any;
|
|
907
913
|
resetCustomPen?: any;
|
|
914
|
+
gridColor: string;
|
|
908
915
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
909
916
|
};
|
|
910
917
|
commitToHistory: boolean;
|
|
@@ -927,7 +934,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
927
934
|
} | null;
|
|
928
935
|
showWelcomeScreen: boolean;
|
|
929
936
|
isLoading: boolean;
|
|
930
|
-
errorMessage:
|
|
937
|
+
errorMessage: import("react").ReactNode;
|
|
931
938
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
932
939
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
933
940
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -1033,6 +1040,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
1033
1040
|
customPens?: any[] | undefined;
|
|
1034
1041
|
currentStrokeOptions?: any;
|
|
1035
1042
|
resetCustomPen?: any;
|
|
1043
|
+
gridColor: string;
|
|
1036
1044
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1037
1045
|
};
|
|
1038
1046
|
commitToHistory: boolean;
|
|
@@ -1055,7 +1063,7 @@ export declare const actionChangeFontFamily: {
|
|
|
1055
1063
|
} | null;
|
|
1056
1064
|
showWelcomeScreen: boolean;
|
|
1057
1065
|
isLoading: boolean;
|
|
1058
|
-
errorMessage:
|
|
1066
|
+
errorMessage: import("react").ReactNode;
|
|
1059
1067
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1060
1068
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1061
1069
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -1161,6 +1169,7 @@ export declare const actionChangeFontFamily: {
|
|
|
1161
1169
|
customPens?: any[] | undefined;
|
|
1162
1170
|
currentStrokeOptions?: any;
|
|
1163
1171
|
resetCustomPen?: any;
|
|
1172
|
+
gridColor: string;
|
|
1164
1173
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1165
1174
|
};
|
|
1166
1175
|
commitToHistory: true;
|
|
@@ -1183,7 +1192,7 @@ export declare const actionChangeTextAlign: {
|
|
|
1183
1192
|
} | null;
|
|
1184
1193
|
showWelcomeScreen: boolean;
|
|
1185
1194
|
isLoading: boolean;
|
|
1186
|
-
errorMessage:
|
|
1195
|
+
errorMessage: import("react").ReactNode;
|
|
1187
1196
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1188
1197
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1189
1198
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -1289,6 +1298,7 @@ export declare const actionChangeTextAlign: {
|
|
|
1289
1298
|
customPens?: any[] | undefined;
|
|
1290
1299
|
currentStrokeOptions?: any;
|
|
1291
1300
|
resetCustomPen?: any;
|
|
1301
|
+
gridColor: string;
|
|
1292
1302
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1293
1303
|
};
|
|
1294
1304
|
commitToHistory: true;
|
|
@@ -1312,7 +1322,7 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1312
1322
|
} | null;
|
|
1313
1323
|
showWelcomeScreen: boolean;
|
|
1314
1324
|
isLoading: boolean;
|
|
1315
|
-
errorMessage:
|
|
1325
|
+
errorMessage: import("react").ReactNode;
|
|
1316
1326
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1317
1327
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1318
1328
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -1419,6 +1429,7 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1419
1429
|
customPens?: any[] | undefined;
|
|
1420
1430
|
currentStrokeOptions?: any;
|
|
1421
1431
|
resetCustomPen?: any;
|
|
1432
|
+
gridColor: string;
|
|
1422
1433
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1423
1434
|
};
|
|
1424
1435
|
commitToHistory: true;
|
|
@@ -1441,7 +1452,7 @@ export declare const actionChangeRoundness: {
|
|
|
1441
1452
|
} | null;
|
|
1442
1453
|
showWelcomeScreen: boolean;
|
|
1443
1454
|
isLoading: boolean;
|
|
1444
|
-
errorMessage:
|
|
1455
|
+
errorMessage: import("react").ReactNode;
|
|
1445
1456
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1446
1457
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1447
1458
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -1547,6 +1558,7 @@ export declare const actionChangeRoundness: {
|
|
|
1547
1558
|
customPens?: any[] | undefined;
|
|
1548
1559
|
currentStrokeOptions?: any;
|
|
1549
1560
|
resetCustomPen?: any;
|
|
1561
|
+
gridColor: string;
|
|
1550
1562
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1551
1563
|
};
|
|
1552
1564
|
commitToHistory: true;
|
|
@@ -1571,7 +1583,7 @@ export declare const actionChangeArrowhead: {
|
|
|
1571
1583
|
} | null;
|
|
1572
1584
|
showWelcomeScreen: boolean;
|
|
1573
1585
|
isLoading: boolean;
|
|
1574
|
-
errorMessage:
|
|
1586
|
+
errorMessage: import("react").ReactNode;
|
|
1575
1587
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1576
1588
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1577
1589
|
multiElement: import("../element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -1678,6 +1690,7 @@ export declare const actionChangeArrowhead: {
|
|
|
1678
1690
|
customPens?: any[] | undefined;
|
|
1679
1691
|
currentStrokeOptions?: any;
|
|
1680
1692
|
resetCustomPen?: any;
|
|
1693
|
+
gridColor: string;
|
|
1681
1694
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1682
1695
|
};
|
|
1683
1696
|
commitToHistory: true;
|
|
@@ -17,7 +17,7 @@ export declare const actionCopyStyles: {
|
|
|
17
17
|
} | null;
|
|
18
18
|
showWelcomeScreen: boolean;
|
|
19
19
|
isLoading: boolean;
|
|
20
|
-
errorMessage:
|
|
20
|
+
errorMessage: import("react").ReactNode;
|
|
21
21
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
22
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
23
23
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -119,6 +119,7 @@ export declare const actionCopyStyles: {
|
|
|
119
119
|
customPens?: any[] | undefined;
|
|
120
120
|
currentStrokeOptions?: any;
|
|
121
121
|
resetCustomPen?: any;
|
|
122
|
+
gridColor: string;
|
|
122
123
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
123
124
|
};
|
|
124
125
|
commitToHistory: false;
|
|
@@ -17,7 +17,7 @@ export declare const actionToggleGridMode: {
|
|
|
17
17
|
} | null;
|
|
18
18
|
showWelcomeScreen: boolean;
|
|
19
19
|
isLoading: boolean;
|
|
20
|
-
errorMessage:
|
|
20
|
+
errorMessage: import("react").ReactNode;
|
|
21
21
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
22
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
23
23
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -123,6 +123,7 @@ export declare const actionToggleGridMode: {
|
|
|
123
123
|
customPens?: any[] | undefined;
|
|
124
124
|
currentStrokeOptions?: any;
|
|
125
125
|
resetCustomPen?: any;
|
|
126
|
+
gridColor: string;
|
|
126
127
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
127
128
|
};
|
|
128
129
|
commitToHistory: false;
|
|
@@ -16,7 +16,7 @@ export declare const actionToggleLock: {
|
|
|
16
16
|
} | null;
|
|
17
17
|
showWelcomeScreen: boolean;
|
|
18
18
|
isLoading: boolean;
|
|
19
|
-
errorMessage:
|
|
19
|
+
errorMessage: import("react").ReactNode;
|
|
20
20
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
21
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
22
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -123,6 +123,7 @@ export declare const actionToggleLock: {
|
|
|
123
123
|
customPens?: any[] | undefined;
|
|
124
124
|
currentStrokeOptions?: any;
|
|
125
125
|
resetCustomPen?: any;
|
|
126
|
+
gridColor: string;
|
|
126
127
|
};
|
|
127
128
|
commitToHistory: true;
|
|
128
129
|
};
|
|
@@ -15,7 +15,7 @@ export declare const actionToggleStats: {
|
|
|
15
15
|
} | null;
|
|
16
16
|
showWelcomeScreen: boolean;
|
|
17
17
|
isLoading: boolean;
|
|
18
|
-
errorMessage:
|
|
18
|
+
errorMessage: import("react").ReactNode;
|
|
19
19
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
20
20
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
21
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -121,6 +121,7 @@ export declare const actionToggleStats: {
|
|
|
121
121
|
customPens?: any[] | undefined;
|
|
122
122
|
currentStrokeOptions?: any;
|
|
123
123
|
resetCustomPen?: any;
|
|
124
|
+
gridColor: string;
|
|
124
125
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
125
126
|
};
|
|
126
127
|
commitToHistory: false;
|
|
@@ -16,7 +16,7 @@ export declare const actionToggleViewMode: {
|
|
|
16
16
|
} | null;
|
|
17
17
|
showWelcomeScreen: boolean;
|
|
18
18
|
isLoading: boolean;
|
|
19
|
-
errorMessage:
|
|
19
|
+
errorMessage: import("react").ReactNode;
|
|
20
20
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
21
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
22
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -122,6 +122,7 @@ export declare const actionToggleViewMode: {
|
|
|
122
122
|
customPens?: any[] | undefined;
|
|
123
123
|
currentStrokeOptions?: any;
|
|
124
124
|
resetCustomPen?: any;
|
|
125
|
+
gridColor: string;
|
|
125
126
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
126
127
|
};
|
|
127
128
|
commitToHistory: false;
|
|
@@ -16,7 +16,7 @@ export declare const actionToggleZenMode: {
|
|
|
16
16
|
} | null;
|
|
17
17
|
showWelcomeScreen: boolean;
|
|
18
18
|
isLoading: boolean;
|
|
19
|
-
errorMessage:
|
|
19
|
+
errorMessage: import("react").ReactNode;
|
|
20
20
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
21
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
22
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -122,6 +122,7 @@ export declare const actionToggleZenMode: {
|
|
|
122
122
|
customPens?: any[] | undefined;
|
|
123
123
|
currentStrokeOptions?: any;
|
|
124
124
|
resetCustomPen?: any;
|
|
125
|
+
gridColor: string;
|
|
125
126
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
126
127
|
};
|
|
127
128
|
commitToHistory: false;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SubtypeOf } from "../utility-types";
|
|
1
2
|
import { ActionName } from "./types";
|
|
2
3
|
export declare type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleLock"> | "saveScene" | "imageExport";
|
|
3
4
|
export declare const getShortcutFromShortcutName: (name: ShortcutName) => string;
|
package/types/actions/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ExcalidrawElement } from "../element/types";
|
|
3
3
|
import { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles } from "../types";
|
|
4
|
+
import { MarkOptional } from "../utility-types";
|
|
4
5
|
export declare type ActionSource = "ui" | "keyboard" | "contextMenu" | "api";
|
|
5
6
|
/** if false, the action should be prevented */
|
|
6
7
|
export declare type ActionResult = {
|
|
@@ -97,7 +97,18 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
97
97
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
98
98
|
togglePenMode: () => void;
|
|
99
99
|
onHandToolToggle: () => void;
|
|
100
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Zooms on canvas viewport center
|
|
102
|
+
*/
|
|
103
|
+
zoomCanvas: (value: number) => void;
|
|
104
|
+
private cancelInProgresAnimation;
|
|
105
|
+
scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[], opts?: {
|
|
106
|
+
fitToContent?: boolean;
|
|
107
|
+
animate?: boolean;
|
|
108
|
+
duration?: number;
|
|
109
|
+
}) => void;
|
|
110
|
+
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
111
|
+
private translateCanvas;
|
|
101
112
|
zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
|
|
102
113
|
startLineEditor: (el: ExcalidrawLinearElement, selectedPointsIndices?: number[] | null) => void;
|
|
103
114
|
updateContainerSize: (containers: NonDeletedExcalidrawElement[]) => void;
|
package/types/constants.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const isAndroid: boolean;
|
|
|
6
6
|
export declare const isFirefox: boolean;
|
|
7
7
|
export declare const isChrome: boolean;
|
|
8
8
|
export declare const isSafari: boolean;
|
|
9
|
+
export declare const isBrave: () => boolean;
|
|
9
10
|
export declare const APP_NAME = "Excalidraw";
|
|
10
11
|
export declare const DRAGGING_THRESHOLD = 10;
|
|
11
12
|
export declare const LINE_CONFIRM_THRESHOLD = 8;
|
package/types/data/blob.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ALLOWED_IMAGE_MIME_TYPES, MIME_TYPES } from "../constants";
|
|
2
2
|
import { ExcalidrawElement, FileId } from "../element/types";
|
|
3
3
|
import { AppState, DataURL, LibraryItem } from "../types";
|
|
4
|
+
import { ValueOf } from "../utility-types";
|
|
4
5
|
import { FileSystemHandle } from "./filesystem";
|
|
5
6
|
import { ImportedLibraryData } from "./types";
|
|
6
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
@@ -25,7 +25,7 @@ export declare const actionLink: {
|
|
|
25
25
|
} | null;
|
|
26
26
|
showWelcomeScreen: boolean;
|
|
27
27
|
isLoading: boolean;
|
|
28
|
-
errorMessage:
|
|
28
|
+
errorMessage: import("react").ReactNode;
|
|
29
29
|
draggingElement: NonDeletedExcalidrawElement | null;
|
|
30
30
|
resizingElement: NonDeletedExcalidrawElement | null;
|
|
31
31
|
multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
|
|
@@ -130,6 +130,7 @@ export declare const actionLink: {
|
|
|
130
130
|
customPens?: any[] | undefined;
|
|
131
131
|
currentStrokeOptions?: any;
|
|
132
132
|
resetCustomPen?: any;
|
|
133
|
+
gridColor: string;
|
|
133
134
|
selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
134
135
|
};
|
|
135
136
|
commitToHistory: true;
|
|
@@ -130,7 +130,7 @@ export declare class LinearElementEditor {
|
|
|
130
130
|
} | null;
|
|
131
131
|
showWelcomeScreen: boolean;
|
|
132
132
|
isLoading: boolean;
|
|
133
|
-
errorMessage:
|
|
133
|
+
errorMessage: import("react").ReactNode;
|
|
134
134
|
draggingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
135
135
|
resizingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
136
136
|
multiElement: NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -138,7 +138,10 @@ export declare class LinearElementEditor {
|
|
|
138
138
|
isBindingEnabled: boolean;
|
|
139
139
|
startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
|
|
140
140
|
suggestedBindings: import("./binding").SuggestedBinding[];
|
|
141
|
-
editingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
141
|
+
editingElement: import("./types").NonDeletedExcalidrawElement | null; /**
|
|
142
|
+
* @param id the `elementId` from the instance of this class (so that we can
|
|
143
|
+
* statically guarantee this method returns an ExcalidrawLinearElement)
|
|
144
|
+
*/
|
|
142
145
|
activeTool: {
|
|
143
146
|
lastActiveTool: import("../types").LastActiveTool;
|
|
144
147
|
locked: boolean;
|
|
@@ -191,7 +194,6 @@ export declare class LinearElementEditor {
|
|
|
191
194
|
previousSelectedElementIds: {
|
|
192
195
|
[id: string]: boolean;
|
|
193
196
|
};
|
|
194
|
-
/** @returns whether point was dragged */
|
|
195
197
|
shouldCacheIgnoreZoom: boolean;
|
|
196
198
|
toast: {
|
|
197
199
|
message: string;
|
|
@@ -237,6 +239,7 @@ export declare class LinearElementEditor {
|
|
|
237
239
|
customPens?: any[] | undefined;
|
|
238
240
|
currentStrokeOptions?: any;
|
|
239
241
|
resetCustomPen?: any;
|
|
242
|
+
gridColor: string;
|
|
240
243
|
selectedLinearElement: LinearElementEditor | null;
|
|
241
244
|
};
|
|
242
245
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExcalidrawElement } from "./types";
|
|
2
|
+
import { Mutable } from "../utility-types";
|
|
2
3
|
declare type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "version" | "versionNonce">;
|
|
3
4
|
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
4
5
|
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>) => TElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer } from "../element/types";
|
|
2
2
|
import { AppState } from "../types";
|
|
3
|
+
import { MarkOptional, Mutable } from "../utility-types";
|
|
3
4
|
declare type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "boundElements" | "seed" | "version" | "versionNonce" | "link">;
|
|
4
5
|
export declare const newElement: (opts: {
|
|
5
6
|
type: ExcalidrawGenericElement["type"];
|
|
@@ -12,6 +13,7 @@ export declare const newTextElement: (opts: {
|
|
|
12
13
|
textAlign: TextAlign;
|
|
13
14
|
verticalAlign: VerticalAlign;
|
|
14
15
|
containerId?: ExcalidrawTextContainer["id"];
|
|
16
|
+
lineHeight?: ExcalidrawTextElement["lineHeight"];
|
|
15
17
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
|
|
16
18
|
export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement, text?: string) => {
|
|
17
19
|
x: number;
|
|
@@ -1,24 +1,37 @@
|
|
|
1
|
-
import { ExcalidrawElement, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontString, NonDeletedExcalidrawElement } from "./types";
|
|
1
|
+
import { ExcalidrawElement, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontFamilyValues, FontString, NonDeletedExcalidrawElement } from "./types";
|
|
2
2
|
import { MaybeTransformHandleType } from "./transformHandles";
|
|
3
3
|
import { AppState } from "../types";
|
|
4
|
+
import { ExtractSetType } from "../utility-types";
|
|
4
5
|
export declare const normalizeText: (text: string) => string;
|
|
6
|
+
export declare const splitIntoLines: (text: string) => string[];
|
|
5
7
|
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
|
|
6
8
|
export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
7
9
|
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
|
|
8
|
-
export declare const measureText: (text: string, font: FontString) => {
|
|
10
|
+
export declare const measureText: (text: string, font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"]) => {
|
|
9
11
|
width: number;
|
|
10
12
|
height: number;
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
/**
|
|
15
|
+
* To get unitless line-height (if unknown) we can calculate it by dividing
|
|
16
|
+
* height-per-line by fontSize.
|
|
17
|
+
*/
|
|
18
|
+
export declare const detectLineHeight: (textElement: ExcalidrawTextElement) => number & {
|
|
19
|
+
_brand: "unitlessLineHeight";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* We calculate the line height from the font size and the unitless line height,
|
|
23
|
+
* aligning with the W3C spec.
|
|
24
|
+
*/
|
|
25
|
+
export declare const getLineHeightInPx: (fontSize: ExcalidrawTextElement["fontSize"], lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
26
|
+
export declare const getApproxMinLineHeight: (fontSize: ExcalidrawTextElement["fontSize"], lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
13
27
|
export declare const getTextWidth: (text: string, font: FontString) => number;
|
|
14
|
-
export declare const getTextHeight: (text: string,
|
|
28
|
+
export declare const getTextHeight: (text: string, fontSize: number, lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
15
29
|
export declare const wrapText: (text: string, font: FontString, maxWidth: number) => string;
|
|
16
30
|
export declare const charWidth: {
|
|
17
31
|
calculate: (char: string, font: FontString) => number;
|
|
18
32
|
getCache: (font: FontString) => number[];
|
|
19
33
|
};
|
|
20
|
-
export declare const getApproxMinLineWidth: (font: FontString) => number;
|
|
21
|
-
export declare const getApproxMinLineHeight: (font: FontString) => number;
|
|
34
|
+
export declare const getApproxMinLineWidth: (font: FontString, lineHeight: ExcalidrawTextElement["lineHeight"]) => number;
|
|
22
35
|
export declare const getMinCharWidth: (font: FontString) => number;
|
|
23
36
|
export declare const getMaxCharWidth: (font: FontString) => number;
|
|
24
37
|
export declare const getApproxCharsToFitInWidth: (font: FontString, width: number) => number;
|
|
@@ -46,10 +59,15 @@ export declare const getBoundTextElementPosition: (container: ExcalidrawElement,
|
|
|
46
59
|
y: number;
|
|
47
60
|
} | undefined;
|
|
48
61
|
export declare const shouldAllowVerticalAlign: (selectedElements: NonDeletedExcalidrawElement[]) => boolean;
|
|
62
|
+
export declare const suppportsHorizontalAlign: (selectedElements: NonDeletedExcalidrawElement[]) => boolean;
|
|
49
63
|
export declare const getTextBindableContainerAtPosition: (elements: readonly ExcalidrawElement[], appState: AppState, x: number, y: number) => ExcalidrawTextContainer | null;
|
|
50
64
|
declare const VALID_CONTAINER_TYPES: Set<string>;
|
|
51
65
|
export declare const isValidTextContainer: (element: ExcalidrawElement) => boolean;
|
|
52
66
|
export declare const computeContainerDimensionForBoundText: (dimension: number, containerType: ExtractSetType<typeof VALID_CONTAINER_TYPES>, legacy?: boolean) => number;
|
|
53
67
|
export declare const getMaxContainerWidth: (container: ExcalidrawElement) => number;
|
|
54
68
|
export declare const getMaxContainerHeight: (container: ExcalidrawElement) => number;
|
|
69
|
+
export declare const isMeasureTextSupported: () => boolean;
|
|
70
|
+
export declare const getDefaultLineHeight: (fontFamily: FontFamilyValues) => number & {
|
|
71
|
+
_brand: "unitlessLineHeight";
|
|
72
|
+
};
|
|
55
73
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AppState } from "../types";
|
|
2
|
+
import { MarkNonNullable } from "../utility-types";
|
|
2
3
|
import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawGenericElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, RoundnessType } from "./types";
|
|
3
4
|
export declare const isGenericElement: (element: ExcalidrawElement | null) => element is ExcalidrawGenericElement;
|
|
4
5
|
export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
|
package/types/element/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Point } from "../types";
|
|
2
2
|
import { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
|
|
3
|
+
import { MarkNonNullable, ValueOf } from "../utility-types";
|
|
3
4
|
export declare type ChartType = "bar" | "line";
|
|
4
5
|
export declare type FillStyle = "hachure" | "cross-hatch" | "solid";
|
|
5
6
|
export declare type FontFamilyKeys = keyof typeof FONT_FAMILY;
|
|
@@ -104,6 +105,13 @@ export declare type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
|
|
|
104
105
|
verticalAlign: VerticalAlign;
|
|
105
106
|
containerId: ExcalidrawGenericElement["id"] | null;
|
|
106
107
|
originalText: string;
|
|
108
|
+
/**
|
|
109
|
+
* Unitless line height (aligned to W3C). To get line height in px, multiply
|
|
110
|
+
* with font size (using `getLineHeightInPx` helper).
|
|
111
|
+
*/
|
|
112
|
+
lineHeight: number & {
|
|
113
|
+
_brand: "unitlessLineHeight";
|
|
114
|
+
};
|
|
107
115
|
}>;
|
|
108
116
|
export declare type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement;
|
|
109
117
|
export declare type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawImageElement | ExcalidrawArrowElement;
|
|
@@ -16,6 +16,7 @@ getMaximumGroups, //zsviczian
|
|
|
16
16
|
intersectElementWithLine, //zsviczian
|
|
17
17
|
determineFocusDistance, //zsviczian
|
|
18
18
|
measureText, //zsviczian
|
|
19
|
+
getDefaultLineHeight, //zsviczian
|
|
19
20
|
wrapText, //zsviczian
|
|
20
21
|
getFontString, //zsviczian
|
|
21
22
|
getMaxContainerWidth, //zsviczian
|
|
@@ -36,7 +36,7 @@ export { getCommonBoundingBox } from "../element/bounds";
|
|
|
36
36
|
export { getMaximumGroups } from "../groups";
|
|
37
37
|
export { intersectElementWithLine } from "../element/collision";
|
|
38
38
|
export { determineFocusDistance } from "../element/collision";
|
|
39
|
-
export { measureText, wrapText } from "../element/textElement";
|
|
39
|
+
export { measureText, wrapText, getDefaultLineHeight } from "../element/textElement";
|
|
40
40
|
export { getFontString } from "../utils";
|
|
41
41
|
export { getMaxContainerWidth } from "../element/textElement";
|
|
42
42
|
export { mergeLibraryItems } from "../data/library";
|
package/types/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, ExcalidrawTextElement, FileId, ExcalidrawImageElement, Theme, StrokeRoundness } from "./element/types";
|
|
3
2
|
import { SHAPES } from "./shapes";
|
|
4
3
|
import { Point as RoughPoint } from "roughjs/bin/geometry";
|
|
@@ -16,6 +15,8 @@ import Library from "./data/library";
|
|
|
16
15
|
import type { FileSystemHandle } from "./data/filesystem";
|
|
17
16
|
import type { ALLOWED_IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
|
|
18
17
|
import { ContextMenuItems } from "./components/ContextMenu";
|
|
18
|
+
import { Merge, ForwardRef } from "./utility-types";
|
|
19
|
+
import React from "react";
|
|
19
20
|
export declare type Point = Readonly<RoughPoint>;
|
|
20
21
|
export declare type Collaborator = {
|
|
21
22
|
pointer?: {
|
|
@@ -70,7 +71,7 @@ export declare type AppState = {
|
|
|
70
71
|
} | null;
|
|
71
72
|
showWelcomeScreen: boolean;
|
|
72
73
|
isLoading: boolean;
|
|
73
|
-
errorMessage:
|
|
74
|
+
errorMessage: React.ReactNode;
|
|
74
75
|
draggingElement: NonDeletedExcalidrawElement | null;
|
|
75
76
|
resizingElement: NonDeletedExcalidrawElement | null;
|
|
76
77
|
multiElement: NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -183,6 +184,7 @@ export declare type AppState = {
|
|
|
183
184
|
customPens?: any[];
|
|
184
185
|
currentStrokeOptions?: any;
|
|
185
186
|
resetCustomPen?: any;
|
|
187
|
+
gridColor: string;
|
|
186
188
|
selectedLinearElement: LinearElementEditor | null;
|
|
187
189
|
};
|
|
188
190
|
export declare type NormalizedZoomValue = number & {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type Mutable<T> = {
|
|
3
|
+
-readonly [P in keyof T]: T[P];
|
|
4
|
+
};
|
|
5
|
+
export declare type ValueOf<T> = T[keyof T];
|
|
6
|
+
export declare type Merge<M, N> = Omit<M, keyof N> & N;
|
|
7
|
+
/** utility type to assert that the second type is a subtype of the first type.
|
|
8
|
+
* Returns the subtype. */
|
|
9
|
+
export declare type SubtypeOf<Supertype, Subtype extends Supertype> = Subtype;
|
|
10
|
+
export declare type ResolutionType<T extends (...args: any) => any> = T extends (...args: any) => Promise<infer R> ? R : any;
|
|
11
|
+
export declare type MarkOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
12
|
+
export declare type MarkRequired<T, RK extends keyof T> = Exclude<T, RK> & Required<Pick<T, RK>>;
|
|
13
|
+
export declare type MarkNonNullable<T, K extends keyof T> = {
|
|
14
|
+
[P in K]-?: P extends K ? NonNullable<T[P]> : T[P];
|
|
15
|
+
} & {
|
|
16
|
+
[P in keyof T]: T[P];
|
|
17
|
+
};
|
|
18
|
+
export declare type NonOptional<T> = Exclude<T, undefined>;
|
|
19
|
+
export declare type SignatureType<T> = T extends (...args: infer R) => any ? R : never;
|
|
20
|
+
export declare type CallableType<T extends (...args: any[]) => any> = (...args: SignatureType<T>) => ReturnType<T>;
|
|
21
|
+
export declare type ForwardRef<T, P = any> = Parameters<CallableType<React.ForwardRefRenderFunction<T, P>>>[1];
|
|
22
|
+
export declare type ExtractSetType<T extends Set<any>> = T extends Set<infer U> ? U : never;
|