@zsviczian/excalidraw 0.17.1-obsidian-47 → 0.17.1-obsidian-48
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 +248 -127
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
- package/types/excalidraw/actions/actionBoundText.d.ts +2 -2
- package/types/excalidraw/actions/actionCanvas.d.ts +18 -18
- package/types/excalidraw/actions/actionClipboard.d.ts +10 -10
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +6 -6
- package/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
- package/types/excalidraw/actions/actionElementLock.d.ts +2 -2
- package/types/excalidraw/actions/actionExport.d.ts +15 -15
- package/types/excalidraw/actions/actionFinalize.d.ts +2 -2
- package/types/excalidraw/actions/actionFrame.d.ts +4 -4
- package/types/excalidraw/actions/actionGroup.d.ts +2 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
- package/types/excalidraw/actions/actionLink.d.ts +1 -1
- package/types/excalidraw/actions/actionMenu.d.ts +3 -3
- package/types/excalidraw/actions/actionNavigate.d.ts +2 -2
- package/types/excalidraw/actions/actionProperties.d.ts +14 -14
- package/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/types/excalidraw/actions/actionStyles.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
- package/types/excalidraw/actions/actionZindex.d.ts +2 -2
- package/types/excalidraw/appState.d.ts +8 -8
- package/types/excalidraw/clipboard.d.ts +2 -2
- package/types/excalidraw/components/App.d.ts +2 -2
- package/types/excalidraw/components/hyperlink/helpers.d.ts +4 -3
- package/types/excalidraw/element/binding.d.ts +12 -10
- package/types/excalidraw/element/bounds.d.ts +6 -4
- package/types/excalidraw/element/collision.d.ts +6 -5
- package/types/excalidraw/element/embeddable.d.ts +1 -1
- package/types/excalidraw/element/heading.d.ts +5 -4
- package/types/excalidraw/element/linearElementEditor.d.ts +20 -237
- package/types/excalidraw/element/resizeElements.d.ts +1 -2
- package/types/excalidraw/element/resizeTest.d.ts +3 -2
- package/types/excalidraw/element/routing.d.ts +2 -2
- package/types/excalidraw/element/textElement.d.ts +1 -1
- package/types/excalidraw/element/transformHandles.d.ts +4 -3
- package/types/excalidraw/element/typeChecks.d.ts +0 -3
- package/types/excalidraw/element/types.d.ts +7 -6
- package/types/excalidraw/obsidianUtils.d.ts +1 -0
- package/types/excalidraw/points.d.ts +3 -3
- package/types/excalidraw/shapes.d.ts +19 -4
- package/types/excalidraw/snapping.d.ts +13 -10
- package/types/excalidraw/types.d.ts +0 -2
- package/types/excalidraw/utils.d.ts +3 -4
- package/types/excalidraw/visualdebug.d.ts +4 -3
- package/types/excalidraw/zindex.d.ts +2 -2
- package/types/math/angle.d.ts +17 -0
- package/types/math/arc.d.ts +6 -0
- package/types/math/curve.d.ts +32 -0
- package/types/math/ga/ga.d.ts +63 -0
- package/types/math/ga/gadirections.d.ts +8 -0
- package/types/math/ga/galines.d.ts +22 -0
- package/types/math/ga/gapoints.d.ts +7 -0
- package/types/math/ga/gatransforms.d.ts +10 -0
- package/types/math/index.d.ts +12 -0
- package/types/math/line.d.ts +26 -0
- package/types/math/point.d.ts +140 -0
- package/types/math/polygon.d.ts +5 -0
- package/types/math/range.d.ts +44 -0
- package/types/math/segment.d.ts +32 -0
- package/types/math/triangle.d.ts +11 -0
- package/types/math/types.d.ts +96 -0
- package/types/math/utils.d.ts +5 -0
- package/types/math/vector.d.ts +88 -0
- package/types/utils/bbox.d.ts +7 -9
- package/types/utils/collision.d.ts +9 -4
- package/types/utils/geometry/shape.d.ts +38 -23
|
@@ -82,7 +82,7 @@ export declare const actionChangeFillStyle: {
|
|
|
82
82
|
currentItemEndArrowhead: Arrowhead | null;
|
|
83
83
|
currentHoveredFontFamily: number | null;
|
|
84
84
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
85
|
-
currentItemArrowType: "
|
|
85
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
86
86
|
viewBackgroundColor: string;
|
|
87
87
|
scrollX: number;
|
|
88
88
|
scrollY: number;
|
|
@@ -281,7 +281,7 @@ export declare const actionChangeStrokeWidth: {
|
|
|
281
281
|
currentItemEndArrowhead: Arrowhead | null;
|
|
282
282
|
currentHoveredFontFamily: number | null;
|
|
283
283
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
284
|
-
currentItemArrowType: "
|
|
284
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
285
285
|
viewBackgroundColor: string;
|
|
286
286
|
scrollX: number;
|
|
287
287
|
scrollY: number;
|
|
@@ -480,7 +480,7 @@ export declare const actionChangeSloppiness: {
|
|
|
480
480
|
currentItemEndArrowhead: Arrowhead | null;
|
|
481
481
|
currentHoveredFontFamily: number | null;
|
|
482
482
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
483
|
-
currentItemArrowType: "
|
|
483
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
484
484
|
viewBackgroundColor: string;
|
|
485
485
|
scrollX: number;
|
|
486
486
|
scrollY: number;
|
|
@@ -679,7 +679,7 @@ export declare const actionChangeStrokeStyle: {
|
|
|
679
679
|
currentItemEndArrowhead: Arrowhead | null;
|
|
680
680
|
currentHoveredFontFamily: number | null;
|
|
681
681
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
682
|
-
currentItemArrowType: "
|
|
682
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
683
683
|
viewBackgroundColor: string;
|
|
684
684
|
scrollX: number;
|
|
685
685
|
scrollY: number;
|
|
@@ -878,7 +878,7 @@ export declare const actionChangeOpacity: {
|
|
|
878
878
|
currentItemEndArrowhead: Arrowhead | null;
|
|
879
879
|
currentHoveredFontFamily: number | null;
|
|
880
880
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
881
|
-
currentItemArrowType: "
|
|
881
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
882
882
|
viewBackgroundColor: string;
|
|
883
883
|
scrollX: number;
|
|
884
884
|
scrollY: number;
|
|
@@ -1078,7 +1078,7 @@ export declare const actionChangeFontSize: {
|
|
|
1078
1078
|
currentItemEndArrowhead: Arrowhead | null;
|
|
1079
1079
|
currentHoveredFontFamily: number | null;
|
|
1080
1080
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
1081
|
-
currentItemArrowType: "
|
|
1081
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
1082
1082
|
viewBackgroundColor: string;
|
|
1083
1083
|
scrollX: number;
|
|
1084
1084
|
scrollY: number;
|
|
@@ -1278,7 +1278,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
1278
1278
|
currentItemEndArrowhead: Arrowhead | null;
|
|
1279
1279
|
currentHoveredFontFamily: number | null;
|
|
1280
1280
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
1281
|
-
currentItemArrowType: "
|
|
1281
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
1282
1282
|
viewBackgroundColor: string;
|
|
1283
1283
|
scrollX: number;
|
|
1284
1284
|
scrollY: number;
|
|
@@ -1478,7 +1478,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
1478
1478
|
currentItemEndArrowhead: Arrowhead | null;
|
|
1479
1479
|
currentHoveredFontFamily: number | null;
|
|
1480
1480
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
1481
|
-
currentItemArrowType: "
|
|
1481
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
1482
1482
|
viewBackgroundColor: string;
|
|
1483
1483
|
scrollX: number;
|
|
1484
1484
|
scrollY: number;
|
|
@@ -1677,7 +1677,7 @@ export declare const actionChangeFontFamily: {
|
|
|
1677
1677
|
currentItemStartArrowhead: Arrowhead | null;
|
|
1678
1678
|
currentItemEndArrowhead: Arrowhead | null;
|
|
1679
1679
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
1680
|
-
currentItemArrowType: "
|
|
1680
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
1681
1681
|
viewBackgroundColor: string;
|
|
1682
1682
|
scrollX: number;
|
|
1683
1683
|
scrollY: number;
|
|
@@ -1867,7 +1867,7 @@ export declare const actionChangeFontFamily: {
|
|
|
1867
1867
|
currentItemStartArrowhead: Arrowhead | null;
|
|
1868
1868
|
currentItemEndArrowhead: Arrowhead | null;
|
|
1869
1869
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
1870
|
-
currentItemArrowType: "
|
|
1870
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
1871
1871
|
viewBackgroundColor: string;
|
|
1872
1872
|
scrollX: number;
|
|
1873
1873
|
scrollY: number;
|
|
@@ -2065,7 +2065,7 @@ export declare const actionChangeTextAlign: {
|
|
|
2065
2065
|
currentItemEndArrowhead: Arrowhead | null;
|
|
2066
2066
|
currentHoveredFontFamily: number | null;
|
|
2067
2067
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
2068
|
-
currentItemArrowType: "
|
|
2068
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
2069
2069
|
viewBackgroundColor: string;
|
|
2070
2070
|
scrollX: number;
|
|
2071
2071
|
scrollY: number;
|
|
@@ -2266,7 +2266,7 @@ export declare const actionChangeVerticalAlign: {
|
|
|
2266
2266
|
currentItemEndArrowhead: Arrowhead | null;
|
|
2267
2267
|
currentHoveredFontFamily: number | null;
|
|
2268
2268
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
2269
|
-
currentItemArrowType: "
|
|
2269
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
2270
2270
|
viewBackgroundColor: string;
|
|
2271
2271
|
scrollX: number;
|
|
2272
2272
|
scrollY: number;
|
|
@@ -2465,7 +2465,7 @@ export declare const actionChangeRoundness: {
|
|
|
2465
2465
|
currentItemStartArrowhead: Arrowhead | null;
|
|
2466
2466
|
currentItemEndArrowhead: Arrowhead | null;
|
|
2467
2467
|
currentHoveredFontFamily: number | null;
|
|
2468
|
-
currentItemArrowType: "
|
|
2468
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
2469
2469
|
viewBackgroundColor: string;
|
|
2470
2470
|
scrollX: number;
|
|
2471
2471
|
scrollY: number;
|
|
@@ -2667,7 +2667,7 @@ export declare const actionChangeArrowhead: {
|
|
|
2667
2667
|
currentItemEndArrowhead: Arrowhead | null;
|
|
2668
2668
|
currentHoveredFontFamily: number | null;
|
|
2669
2669
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
2670
|
-
currentItemArrowType: "
|
|
2670
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
2671
2671
|
viewBackgroundColor: string;
|
|
2672
2672
|
scrollX: number;
|
|
2673
2673
|
scrollY: number;
|
|
@@ -72,7 +72,7 @@ export declare const actionSelectAll: {
|
|
|
72
72
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
73
73
|
currentHoveredFontFamily: number | null;
|
|
74
74
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
75
|
-
currentItemArrowType: "
|
|
75
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
76
76
|
viewBackgroundColor: string;
|
|
77
77
|
scrollX: number;
|
|
78
78
|
scrollY: number;
|
|
@@ -65,7 +65,7 @@ export declare const actionCopyStyles: {
|
|
|
65
65
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
66
66
|
currentHoveredFontFamily: number | null;
|
|
67
67
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
68
|
-
currentItemArrowType: "
|
|
68
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
69
69
|
viewBackgroundColor: string;
|
|
70
70
|
scrollX: number;
|
|
71
71
|
scrollY: number;
|
|
@@ -67,7 +67,7 @@ export declare const actionToggleGridMode: {
|
|
|
67
67
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
68
68
|
currentHoveredFontFamily: number | null;
|
|
69
69
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
70
|
-
currentItemArrowType: "
|
|
70
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
71
71
|
viewBackgroundColor: string;
|
|
72
72
|
scrollX: number;
|
|
73
73
|
scrollY: number;
|
|
@@ -65,7 +65,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
65
65
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
66
66
|
currentHoveredFontFamily: number | null;
|
|
67
67
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
68
|
-
currentItemArrowType: "
|
|
68
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
69
69
|
viewBackgroundColor: string;
|
|
70
70
|
scrollX: number;
|
|
71
71
|
scrollY: number;
|
|
@@ -68,7 +68,7 @@ export declare const actionToggleStats: {
|
|
|
68
68
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
69
69
|
currentHoveredFontFamily: number | null;
|
|
70
70
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
71
|
-
currentItemArrowType: "
|
|
71
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
72
72
|
viewBackgroundColor: string;
|
|
73
73
|
scrollX: number;
|
|
74
74
|
scrollY: number;
|
|
@@ -65,7 +65,7 @@ export declare const actionToggleViewMode: {
|
|
|
65
65
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
66
66
|
currentHoveredFontFamily: number | null;
|
|
67
67
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
68
|
-
currentItemArrowType: "
|
|
68
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
69
69
|
viewBackgroundColor: string;
|
|
70
70
|
scrollX: number;
|
|
71
71
|
scrollY: number;
|
|
@@ -65,7 +65,7 @@ export declare const actionToggleZenMode: {
|
|
|
65
65
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
66
66
|
currentHoveredFontFamily: number | null;
|
|
67
67
|
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
68
|
-
currentItemArrowType: "
|
|
68
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
69
69
|
viewBackgroundColor: string;
|
|
70
70
|
scrollX: number;
|
|
71
71
|
scrollY: number;
|
|
@@ -45,7 +45,7 @@ export declare const actionSendToBack: {
|
|
|
45
45
|
category: "element";
|
|
46
46
|
};
|
|
47
47
|
perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
48
|
-
elements:
|
|
48
|
+
elements: import("../element/types").ExcalidrawElement[] | readonly import("../element/types").ExcalidrawElement[];
|
|
49
49
|
appState: Readonly<import("../types").AppState>;
|
|
50
50
|
storeAction: "capture";
|
|
51
51
|
};
|
|
@@ -63,7 +63,7 @@ export declare const actionBringToFront: {
|
|
|
63
63
|
category: "element";
|
|
64
64
|
};
|
|
65
65
|
perform: (elements: readonly import("../element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
66
|
-
elements:
|
|
66
|
+
elements: import("../element/types").ExcalidrawElement[] | readonly import("../element/types").ExcalidrawElement[];
|
|
67
67
|
appState: Readonly<import("../types").AppState>;
|
|
68
68
|
storeAction: "capture";
|
|
69
69
|
};
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { AppState, NormalizedZoomValue } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
|
-
zenModeEnabled?: boolean | undefined;
|
|
5
|
-
gridModeEnabled?: boolean | undefined;
|
|
6
|
-
objectsSnapModeEnabled?: boolean | undefined;
|
|
7
|
-
theme?: import("./element/types").Theme | undefined;
|
|
8
|
-
name?: string | null | undefined;
|
|
9
|
-
currentItemArrowType?: "sharp" | "round" | "elbow" | undefined;
|
|
10
4
|
showWelcomeScreen?: boolean | undefined;
|
|
11
5
|
activeTool?: ({
|
|
12
6
|
lastActiveTool: import("./types").ActiveTool | null;
|
|
@@ -31,11 +25,13 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
31
25
|
currentItemStartArrowhead?: import("./element/types").Arrowhead | null | undefined;
|
|
32
26
|
currentItemEndArrowhead?: import("./element/types").Arrowhead | null | undefined;
|
|
33
27
|
currentItemRoundness?: import("./element/types").StrokeRoundness | undefined;
|
|
28
|
+
currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
|
|
34
29
|
viewBackgroundColor?: string | undefined;
|
|
35
30
|
scrollX?: number | undefined;
|
|
36
31
|
scrollY?: number | undefined;
|
|
37
32
|
cursorButton?: "up" | "down" | undefined;
|
|
38
33
|
scrolledOutside?: boolean | undefined;
|
|
34
|
+
name?: string | null | undefined;
|
|
39
35
|
zoom?: Readonly<{
|
|
40
36
|
value: NormalizedZoomValue;
|
|
41
37
|
}> | undefined;
|
|
@@ -53,8 +49,11 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
53
49
|
[id: string]: true;
|
|
54
50
|
} | undefined;
|
|
55
51
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
52
|
+
zenModeEnabled?: boolean | undefined;
|
|
53
|
+
theme?: import("./element/types").Theme | undefined;
|
|
56
54
|
gridSize?: number | undefined;
|
|
57
55
|
gridStep?: number | undefined;
|
|
56
|
+
gridModeEnabled?: boolean | undefined;
|
|
58
57
|
selectedGroupIds?: {
|
|
59
58
|
[groupId: string]: boolean;
|
|
60
59
|
} | undefined;
|
|
@@ -65,18 +64,19 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
65
64
|
} | undefined;
|
|
66
65
|
currentChartType?: import("./element/types").ChartType | undefined;
|
|
67
66
|
selectedLinearElement?: import("./element/linearElementEditor").LinearElementEditor | null | undefined;
|
|
67
|
+
objectsSnapModeEnabled?: boolean | undefined;
|
|
68
68
|
};
|
|
69
69
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
70
|
-
gridModeEnabled?: boolean | undefined;
|
|
71
70
|
viewBackgroundColor?: string | undefined;
|
|
72
71
|
gridSize?: number | undefined;
|
|
73
72
|
gridStep?: number | undefined;
|
|
73
|
+
gridModeEnabled?: boolean | undefined;
|
|
74
74
|
};
|
|
75
75
|
export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
|
|
76
|
-
gridModeEnabled?: boolean | undefined;
|
|
77
76
|
viewBackgroundColor?: string | undefined;
|
|
78
77
|
gridSize?: number | undefined;
|
|
79
78
|
gridStep?: number | undefined;
|
|
79
|
+
gridModeEnabled?: boolean | undefined;
|
|
80
80
|
};
|
|
81
81
|
export declare const isEraserActive: ({ activeTool, }: {
|
|
82
82
|
activeTool: AppState["activeTool"];
|
|
@@ -21,8 +21,8 @@ export declare const probablySupportsClipboardWriteText: boolean;
|
|
|
21
21
|
export declare const probablySupportsClipboardBlob: boolean;
|
|
22
22
|
export declare const createPasteEvent: ({ types, files, }: {
|
|
23
23
|
types?: {
|
|
24
|
-
"text/plain"?: string | undefined;
|
|
25
24
|
"text/html"?: string | undefined;
|
|
25
|
+
"text/plain"?: string | undefined;
|
|
26
26
|
} | undefined;
|
|
27
27
|
files?: File[] | undefined;
|
|
28
28
|
}) => ClipboardEvent;
|
|
@@ -32,8 +32,8 @@ export declare const serializeAsClipboardJSON: ({ elements, files, }: {
|
|
|
32
32
|
}) => string;
|
|
33
33
|
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], files: BinaryFiles | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
|
|
34
34
|
export declare const readSystemClipboard: () => Promise<{
|
|
35
|
-
"text/plain"?: string | undefined;
|
|
36
35
|
"text/html"?: string | undefined;
|
|
36
|
+
"text/plain"?: string | undefined;
|
|
37
37
|
}>;
|
|
38
38
|
/**
|
|
39
39
|
* Attempts to parse clipboard. Prefers system clipboard.
|
|
@@ -120,7 +120,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
120
120
|
x: number;
|
|
121
121
|
y: number;
|
|
122
122
|
};
|
|
123
|
-
arrowDirection: "
|
|
123
|
+
arrowDirection: "end" | "origin";
|
|
124
124
|
center: {
|
|
125
125
|
x: number;
|
|
126
126
|
y: number;
|
|
@@ -184,7 +184,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
184
184
|
x: number;
|
|
185
185
|
y: number;
|
|
186
186
|
};
|
|
187
|
-
arrowDirection: "
|
|
187
|
+
arrowDirection: "end" | "origin";
|
|
188
188
|
center: {
|
|
189
189
|
x: number;
|
|
190
190
|
y: number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { GlobalPoint, Radians } from "../../../math";
|
|
1
2
|
import type { Bounds } from "../../element/bounds";
|
|
2
3
|
import type { ElementsMap, NonDeletedExcalidrawElement } from "../../element/types";
|
|
3
4
|
import type { AppState, UIAppState } from "../../types";
|
|
4
5
|
export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
|
|
5
|
-
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle:
|
|
6
|
-
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, [x, y]:
|
|
7
|
-
export declare const isPointHittingLink: (element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, [x, y]:
|
|
6
|
+
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: Radians, appState: Pick<UIAppState, "zoom">) => Bounds;
|
|
7
|
+
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, [x, y]: GlobalPoint) => boolean;
|
|
8
|
+
export declare const isPointHittingLink: (element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, [x, y]: GlobalPoint, isMobile: boolean) => boolean;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, ExcalidrawLinearElement, NonDeletedExcalidrawElement, ElementsMap, NonDeletedSceneElementsMap, OrderedExcalidrawElement, ExcalidrawElbowArrowElement, FixedPoint, SceneElementsMap } from "./types";
|
|
2
2
|
import type { Bounds } from "./bounds";
|
|
3
|
-
import type { AppState
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
4
|
import type { ElementUpdate } from "./mutateElement";
|
|
5
5
|
import type Scene from "../scene/Scene";
|
|
6
6
|
import { type Heading } from "./heading";
|
|
7
|
+
import type { LocalPoint } from "../../math";
|
|
8
|
+
import { type GlobalPoint } from "../../math";
|
|
7
9
|
export type SuggestedBinding = NonDeleted<ExcalidrawBindableElement> | SuggestedPointBinding;
|
|
8
10
|
export type SuggestedPointBinding = [
|
|
9
11
|
NonDeleted<ExcalidrawLinearElement>,
|
|
@@ -34,10 +36,10 @@ export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawE
|
|
|
34
36
|
};
|
|
35
37
|
changedElements?: Map<string, OrderedExcalidrawElement>;
|
|
36
38
|
}) => void;
|
|
37
|
-
export declare const getHeadingForElbowArrowSnap: (
|
|
38
|
-
export declare const bindPointToSnapToElementOutline: (
|
|
39
|
-
export declare const avoidRectangularCorner: (element: ExcalidrawBindableElement, p:
|
|
40
|
-
export declare const snapToMid: (element: ExcalidrawBindableElement, p:
|
|
39
|
+
export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, elementsMap: ElementsMap, origPoint: GlobalPoint) => Heading;
|
|
40
|
+
export declare const bindPointToSnapToElementOutline: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined, elementsMap: ElementsMap) => GlobalPoint;
|
|
41
|
+
export declare const avoidRectangularCorner: (element: ExcalidrawBindableElement, p: GlobalPoint) => GlobalPoint;
|
|
42
|
+
export declare const snapToMid: (element: ExcalidrawBindableElement, p: GlobalPoint, tolerance?: number) => GlobalPoint;
|
|
41
43
|
export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => {
|
|
42
44
|
fixedPoint: FixedPoint;
|
|
43
45
|
};
|
|
@@ -48,9 +50,9 @@ export declare const bindingBorderTest: (element: NonDeleted<ExcalidrawBindableE
|
|
|
48
50
|
y: number;
|
|
49
51
|
}, elementsMap: NonDeletedSceneElementsMap, fullShape?: boolean) => boolean;
|
|
50
52
|
export declare const maxBindingGap: (element: ExcalidrawElement, elementWidth: number, elementHeight: number) => number;
|
|
51
|
-
export declare const distanceToBindableElement: (element: ExcalidrawBindableElement, point:
|
|
52
|
-
export declare const determineFocusDistance: (element: ExcalidrawBindableElement, a:
|
|
53
|
-
export declare const intersectElementWithLine: (element: ExcalidrawBindableElement, a:
|
|
53
|
+
export declare const distanceToBindableElement: (element: ExcalidrawBindableElement, point: GlobalPoint, elementsMap: ElementsMap) => number;
|
|
54
|
+
export declare const determineFocusDistance: (element: ExcalidrawBindableElement, a: GlobalPoint, b: GlobalPoint, elementsMap: ElementsMap) => number;
|
|
55
|
+
export declare const intersectElementWithLine: (element: ExcalidrawBindableElement, a: GlobalPoint, b: GlobalPoint, gap: number | undefined, elementsMap: ElementsMap) => GlobalPoint[] | undefined;
|
|
54
56
|
export declare const bindingProperties: Set<BindableProp | BindingProp>;
|
|
55
57
|
export type BindableProp = "boundElements";
|
|
56
58
|
export type BindingProp = "frameId" | "containerId" | "startBinding" | "endBinding";
|
|
@@ -92,6 +94,6 @@ export declare class BindableElement {
|
|
|
92
94
|
*/
|
|
93
95
|
static rebindAffected: (elements: ElementsMap, bindableElement: ExcalidrawElement | undefined, updateElementWith: (affected: ExcalidrawElement, updates: ElementUpdate<ExcalidrawElement>) => void) => void;
|
|
94
96
|
}
|
|
95
|
-
export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio: [number, number], element: ExcalidrawBindableElement) =>
|
|
96
|
-
export declare const getArrowLocalFixedPoints: (arrow: ExcalidrawElbowArrowElement, elementsMap: ElementsMap) =>
|
|
97
|
+
export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio: [number, number], element: ExcalidrawBindableElement) => GlobalPoint;
|
|
98
|
+
export declare const getArrowLocalFixedPoints: (arrow: ExcalidrawElbowArrowElement, elementsMap: ElementsMap) => LocalPoint[];
|
|
97
99
|
export declare const normalizeFixedPoint: <T extends FixedPoint | null>(fixedPoint: T) => T extends null ? null : FixedPoint;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, ExcalidrawFreeDrawElement, NonDeleted, ElementsMap } from "./types";
|
|
2
2
|
import type { Drawable, Op } from "roughjs/bin/core";
|
|
3
|
-
import type { AppState
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
|
+
import type { Degrees, GlobalPoint, LineSegment } from "../../math";
|
|
4
5
|
export type RectangleBox = {
|
|
5
6
|
x: number;
|
|
6
7
|
y: number;
|
|
@@ -29,7 +30,7 @@ export declare class ElementBounds {
|
|
|
29
30
|
private static calculateBounds;
|
|
30
31
|
}
|
|
31
32
|
export declare const getElementAbsoluteCoords: (element: ExcalidrawElement, elementsMap: ElementsMap, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
32
|
-
export declare const getElementLineSegments: (element: ExcalidrawElement, elementsMap: ElementsMap) => [
|
|
33
|
+
export declare const getElementLineSegments: (element: ExcalidrawElement, elementsMap: ElementsMap) => LineSegment<GlobalPoint>[];
|
|
33
34
|
/**
|
|
34
35
|
* Scene -> Scene coords, but in x1,x2,y1,y2 format.
|
|
35
36
|
*
|
|
@@ -38,12 +39,12 @@ export declare const getElementLineSegments: (element: ExcalidrawElement, elemen
|
|
|
38
39
|
export declare const getRectangleBoxAbsoluteCoords: (boxSceneCoords: RectangleBox) => number[];
|
|
39
40
|
export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
|
|
40
41
|
export declare const getCurvePathOps: (shape: Drawable) => Op[];
|
|
41
|
-
export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((
|
|
42
|
+
export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((p: GlobalPoint) => GlobalPoint) | undefined) => Bounds;
|
|
42
43
|
export declare const getBoundsFromPoints: (points: ExcalidrawFreeDrawElement["points"]) => Bounds;
|
|
43
44
|
/** @returns number in pixels */
|
|
44
45
|
export declare const getArrowheadSize: (arrowhead: Arrowhead) => number;
|
|
45
46
|
/** @returns number in degrees */
|
|
46
|
-
export declare const getArrowheadAngle: (arrowhead: Arrowhead) =>
|
|
47
|
+
export declare const getArrowheadAngle: (arrowhead: Arrowhead) => Degrees;
|
|
47
48
|
export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
|
|
48
49
|
export declare const getElementBounds: (element: ExcalidrawElement, elementsMap: ElementsMap) => Bounds;
|
|
49
50
|
export declare const getCommonBounds: (elements: readonly ExcalidrawElement[], elementsMap?: ElementsMap) => Bounds;
|
|
@@ -72,3 +73,4 @@ export declare const getCommonBoundingBox: (elements: ExcalidrawElement[] | read
|
|
|
72
73
|
* returns scene coords of user's editor viewport (visible canvas area) bounds
|
|
73
74
|
*/
|
|
74
75
|
export declare const getVisibleSceneBounds: ({ scrollX, scrollY, width, height, zoom, }: AppState) => SceneBounds;
|
|
76
|
+
export declare const getCenterForBounds: (bounds: Bounds) => GlobalPoint;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
2
2
|
import type { FrameNameBounds } from "../types";
|
|
3
3
|
import type { GeometricShape } from "../../utils/geometry/shape";
|
|
4
|
+
import type { GlobalPoint, LocalPoint } from "../../math";
|
|
4
5
|
export declare const shouldTestInside: (element: ExcalidrawElement) => boolean;
|
|
5
|
-
export type HitTestArgs = {
|
|
6
|
+
export type HitTestArgs<Point extends GlobalPoint | LocalPoint> = {
|
|
6
7
|
x: number;
|
|
7
8
|
y: number;
|
|
8
9
|
element: ExcalidrawElement;
|
|
9
|
-
shape: GeometricShape
|
|
10
|
+
shape: GeometricShape<Point>;
|
|
10
11
|
threshold?: number;
|
|
11
12
|
frameNameBound?: FrameNameBounds | null;
|
|
12
13
|
};
|
|
13
|
-
export declare const hitElementItself: ({ x, y, element, shape, threshold, frameNameBound, }: HitTestArgs) => boolean;
|
|
14
|
+
export declare const hitElementItself: <Point extends GlobalPoint | LocalPoint>({ x, y, element, shape, threshold, frameNameBound, }: HitTestArgs<Point>) => boolean;
|
|
14
15
|
export declare const hitElementBoundingBox: (x: number, y: number, element: ExcalidrawElement, elementsMap: ElementsMap, tolerance?: number) => boolean;
|
|
15
|
-
export declare const hitElementBoundingBoxOnly: (hitArgs: HitTestArgs
|
|
16
|
-
export declare const hitElementBoundText: (x: number, y: number, textShape: GeometricShape | null) => boolean;
|
|
16
|
+
export declare const hitElementBoundingBoxOnly: <Point extends GlobalPoint | LocalPoint>(hitArgs: HitTestArgs<Point>, elementsMap: ElementsMap) => boolean;
|
|
17
|
+
export declare const hitElementBoundText: <Point extends GlobalPoint | LocalPoint>(x: number, y: number, textShape: GeometricShape<Point> | null) => boolean;
|
|
@@ -69,7 +69,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
|
|
|
69
69
|
currentItemEndArrowhead: import("./types").Arrowhead | null;
|
|
70
70
|
currentHoveredFontFamily: number | null;
|
|
71
71
|
currentItemRoundness: import("./types").StrokeRoundness;
|
|
72
|
-
currentItemArrowType: "
|
|
72
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
73
73
|
viewBackgroundColor: string;
|
|
74
74
|
scrollX: number;
|
|
75
75
|
scrollY: number;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalPoint, GlobalPoint, Vector } from "../../math";
|
|
2
2
|
import type { ExcalidrawBindableElement } from "./types";
|
|
3
3
|
export declare const HEADING_RIGHT: Heading;
|
|
4
4
|
export declare const HEADING_DOWN: Heading;
|
|
5
5
|
export declare const HEADING_LEFT: Heading;
|
|
6
6
|
export declare const HEADING_UP: Heading;
|
|
7
7
|
export type Heading = [1, 0] | [0, 1] | [-1, 0] | [0, -1];
|
|
8
|
-
export declare const headingForDiamond: (a: Point, b: Point) => Heading;
|
|
9
|
-
export declare const vectorToHeading: (vec:
|
|
8
|
+
export declare const headingForDiamond: <Point extends GlobalPoint | LocalPoint>(a: Point, b: Point) => Heading;
|
|
9
|
+
export declare const vectorToHeading: (vec: Vector) => Heading;
|
|
10
10
|
export declare const compareHeading: (a: Heading, b: Heading) => boolean;
|
|
11
|
-
export declare const headingForPointFromElement: (element: Readonly<ExcalidrawBindableElement>, aabb: readonly [minX: number, minY: number, maxX: number, maxY: number],
|
|
11
|
+
export declare const headingForPointFromElement: <Point extends GlobalPoint | LocalPoint>(element: Readonly<ExcalidrawBindableElement>, aabb: readonly [minX: number, minY: number, maxX: number, maxY: number], p: Readonly<LocalPoint | GlobalPoint>) => Heading;
|
|
12
|
+
export declare const flipHeading: (h: Heading) => Heading;
|