@zsviczian/excalidraw 0.10.0-obsidian-29 → 0.10.0-obsidian-34
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 +140 -118
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +15 -12
- package/types/actions/actionAddToLibrary.d.ts +268 -1
- package/types/actions/actionAlign.d.ts +73 -6
- package/types/actions/actionCanvas.d.ts +671 -8
- package/types/actions/actionClipboard.d.ts +493 -4
- package/types/actions/actionDeleteSelected.d.ts +292 -1
- package/types/actions/actionDistribute.d.ts +27 -2
- package/types/actions/actionDuplicateSelection.d.ts +19 -1
- package/types/actions/actionExport.d.ts +849 -8
- package/types/actions/actionFinalize.d.ts +186 -1
- package/types/actions/actionFlip.d.ts +29 -2
- package/types/actions/actionGroup.d.ts +39 -2
- package/types/actions/actionMenu.d.ts +293 -4
- package/types/actions/actionNavigate.d.ts +11 -1
- package/types/actions/actionProperties.d.ts +1160 -12
- package/types/actions/actionSelectAll.d.ts +12 -1
- package/types/actions/actionStyles.d.ts +110 -2
- package/types/actions/actionToggleGridMode.d.ts +98 -1
- package/types/actions/actionToggleStats.d.ts +97 -1
- package/types/actions/actionToggleViewMode.d.ts +97 -1
- package/types/actions/actionToggleZenMode.d.ts +97 -1
- package/types/actions/actionZindex.d.ts +55 -4
- package/types/actions/register.d.ts +3 -1
- package/types/actions/types.d.ts +1 -1
- package/types/align.d.ts +0 -1
- package/types/components/App.d.ts +4 -1
- package/types/components/icons.d.ts +3 -0
- package/types/constants.d.ts +2 -4
- package/types/disitrubte.d.ts +0 -1
- package/types/element/bounds.d.ts +4 -0
- package/types/element/dragElements.d.ts +2 -2
- package/types/element/newElement.d.ts +1 -1
- package/types/element/textElement.d.ts +7 -4
- package/types/element/textWysiwyg.d.ts +5 -3
- package/types/groups.d.ts +1 -0
- package/types/keys.d.ts +4 -0
- package/types/packages/excalidraw/example/App.d.ts +1 -0
- package/types/packages/excalidraw/example/index.d.ts +1 -0
- package/types/packages/excalidraw/example/initialData.d.ts +138 -0
- package/types/packages/excalidraw/example/sidebar/Sidebar.d.ts +1 -0
- package/types/packages/excalidraw/webpack.dev-server.config.d.ts +19 -0
- package/types/packages/excalidraw/webpack.prod.config.d.ts +2 -1
- package/types/packages/utils.d.ts +1 -1
- package/types/scene/comparisons.d.ts +1 -1
- package/types/shapes.d.ts +1 -1
- package/types/types.d.ts +2 -1
- package/types/utils.d.ts +1 -0
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const actionSelectAll: {
|
|
3
|
+
name: "selectAll";
|
|
4
|
+
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => false | {
|
|
5
|
+
appState: import("../types").AppState;
|
|
6
|
+
commitToHistory: true;
|
|
7
|
+
};
|
|
8
|
+
contextItemLabel: string;
|
|
9
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
10
|
+
} & {
|
|
11
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
12
|
+
};
|
|
@@ -1,3 +1,111 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare let copiedStyles: string;
|
|
2
|
-
export declare const actionCopyStyles:
|
|
3
|
-
|
|
3
|
+
export declare const actionCopyStyles: {
|
|
4
|
+
name: "copyStyles";
|
|
5
|
+
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
6
|
+
appState: {
|
|
7
|
+
toastMessage: string;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
errorMessage: string | null;
|
|
10
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
11
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
12
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
13
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
14
|
+
isBindingEnabled: boolean;
|
|
15
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
16
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
17
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
18
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
19
|
+
elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
|
|
20
|
+
elementLocked: boolean;
|
|
21
|
+
exportBackground: boolean;
|
|
22
|
+
exportEmbedScene: boolean;
|
|
23
|
+
exportWithDarkMode: boolean;
|
|
24
|
+
exportScale: number;
|
|
25
|
+
currentItemStrokeColor: string;
|
|
26
|
+
currentItemBackgroundColor: string;
|
|
27
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
28
|
+
currentItemStrokeWidth: number;
|
|
29
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
30
|
+
currentItemRoughness: number;
|
|
31
|
+
currentItemOpacity: number;
|
|
32
|
+
currentItemFontFamily: number;
|
|
33
|
+
currentItemFontSize: number;
|
|
34
|
+
currentItemTextAlign: import("../element/types").TextAlign;
|
|
35
|
+
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
36
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
37
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
38
|
+
currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
39
|
+
viewBackgroundColor: string;
|
|
40
|
+
scrollX: number;
|
|
41
|
+
scrollY: number;
|
|
42
|
+
cursorButton: "up" | "down";
|
|
43
|
+
scrolledOutside: boolean;
|
|
44
|
+
name: string;
|
|
45
|
+
isResizing: boolean;
|
|
46
|
+
isRotating: boolean;
|
|
47
|
+
zoom: Readonly<{
|
|
48
|
+
value: import("../types").NormalizedZoomValue;
|
|
49
|
+
translation: Readonly<{
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
54
|
+
openMenu: "canvas" | "shape" | null;
|
|
55
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
56
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
57
|
+
selectedElementIds: {
|
|
58
|
+
[id: string]: boolean;
|
|
59
|
+
};
|
|
60
|
+
previousSelectedElementIds: {
|
|
61
|
+
[id: string]: boolean;
|
|
62
|
+
};
|
|
63
|
+
shouldCacheIgnoreZoom: boolean;
|
|
64
|
+
showHelpDialog: boolean;
|
|
65
|
+
zenModeEnabled: boolean;
|
|
66
|
+
theme: string;
|
|
67
|
+
gridSize: number | null;
|
|
68
|
+
viewModeEnabled: boolean;
|
|
69
|
+
selectedGroupIds: {
|
|
70
|
+
[groupId: string]: boolean;
|
|
71
|
+
};
|
|
72
|
+
editingGroupId: string | null;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
offsetTop: number;
|
|
76
|
+
offsetLeft: number;
|
|
77
|
+
isLibraryOpen: boolean;
|
|
78
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
79
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
80
|
+
showStats: boolean;
|
|
81
|
+
currentChartType: import("../element/types").ChartType;
|
|
82
|
+
pasteDialog: {
|
|
83
|
+
shown: false;
|
|
84
|
+
data: null;
|
|
85
|
+
} | {
|
|
86
|
+
shown: true;
|
|
87
|
+
data: import("../charts").Spreadsheet;
|
|
88
|
+
};
|
|
89
|
+
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
90
|
+
};
|
|
91
|
+
commitToHistory: false;
|
|
92
|
+
};
|
|
93
|
+
contextItemLabel: string;
|
|
94
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
95
|
+
} & {
|
|
96
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
97
|
+
};
|
|
98
|
+
export declare const actionPasteStyles: {
|
|
99
|
+
name: "pasteStyles";
|
|
100
|
+
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
101
|
+
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
102
|
+
commitToHistory: false;
|
|
103
|
+
} | {
|
|
104
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
105
|
+
commitToHistory: true;
|
|
106
|
+
};
|
|
107
|
+
contextItemLabel: string;
|
|
108
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
109
|
+
} & {
|
|
110
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
111
|
+
};
|
|
@@ -1 +1,98 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AppState } from "../types";
|
|
3
|
+
export declare const actionToggleGridMode: {
|
|
4
|
+
name: "gridMode";
|
|
5
|
+
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<AppState>): {
|
|
6
|
+
appState: {
|
|
7
|
+
gridSize: number | null;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
errorMessage: string | null;
|
|
10
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
11
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
12
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
13
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
14
|
+
isBindingEnabled: boolean;
|
|
15
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
16
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
17
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
18
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
19
|
+
elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
|
|
20
|
+
elementLocked: boolean;
|
|
21
|
+
exportBackground: boolean;
|
|
22
|
+
exportEmbedScene: boolean;
|
|
23
|
+
exportWithDarkMode: boolean;
|
|
24
|
+
exportScale: number;
|
|
25
|
+
currentItemStrokeColor: string;
|
|
26
|
+
currentItemBackgroundColor: string;
|
|
27
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
28
|
+
currentItemStrokeWidth: number;
|
|
29
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
30
|
+
currentItemRoughness: number;
|
|
31
|
+
currentItemOpacity: number;
|
|
32
|
+
currentItemFontFamily: number;
|
|
33
|
+
currentItemFontSize: number;
|
|
34
|
+
currentItemTextAlign: import("../element/types").TextAlign;
|
|
35
|
+
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
36
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
37
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
38
|
+
currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
39
|
+
viewBackgroundColor: string;
|
|
40
|
+
scrollX: number;
|
|
41
|
+
scrollY: number;
|
|
42
|
+
cursorButton: "up" | "down";
|
|
43
|
+
scrolledOutside: boolean;
|
|
44
|
+
name: string;
|
|
45
|
+
isResizing: boolean;
|
|
46
|
+
isRotating: boolean;
|
|
47
|
+
zoom: Readonly<{
|
|
48
|
+
value: import("../types").NormalizedZoomValue;
|
|
49
|
+
translation: Readonly<{
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
54
|
+
openMenu: "canvas" | "shape" | null;
|
|
55
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
56
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
57
|
+
selectedElementIds: {
|
|
58
|
+
[id: string]: boolean;
|
|
59
|
+
};
|
|
60
|
+
previousSelectedElementIds: {
|
|
61
|
+
[id: string]: boolean;
|
|
62
|
+
};
|
|
63
|
+
shouldCacheIgnoreZoom: boolean;
|
|
64
|
+
showHelpDialog: boolean;
|
|
65
|
+
toastMessage: string | null;
|
|
66
|
+
zenModeEnabled: boolean;
|
|
67
|
+
theme: string;
|
|
68
|
+
viewModeEnabled: boolean;
|
|
69
|
+
selectedGroupIds: {
|
|
70
|
+
[groupId: string]: boolean;
|
|
71
|
+
};
|
|
72
|
+
editingGroupId: string | null;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
offsetTop: number;
|
|
76
|
+
offsetLeft: number;
|
|
77
|
+
isLibraryOpen: boolean;
|
|
78
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
79
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
80
|
+
showStats: boolean;
|
|
81
|
+
currentChartType: import("../element/types").ChartType;
|
|
82
|
+
pasteDialog: {
|
|
83
|
+
shown: false;
|
|
84
|
+
data: null;
|
|
85
|
+
} | {
|
|
86
|
+
shown: true;
|
|
87
|
+
data: import("../charts").Spreadsheet;
|
|
88
|
+
};
|
|
89
|
+
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
90
|
+
};
|
|
91
|
+
commitToHistory: false;
|
|
92
|
+
};
|
|
93
|
+
checked: (appState: AppState) => boolean;
|
|
94
|
+
contextItemLabel: string;
|
|
95
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
96
|
+
} & {
|
|
97
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
98
|
+
};
|
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const actionToggleStats: {
|
|
3
|
+
name: "stats";
|
|
4
|
+
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
5
|
+
appState: {
|
|
6
|
+
showStats: boolean;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
errorMessage: string | null;
|
|
9
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
10
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
11
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
12
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
13
|
+
isBindingEnabled: boolean;
|
|
14
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
15
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
16
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
17
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
18
|
+
elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
|
|
19
|
+
elementLocked: boolean;
|
|
20
|
+
exportBackground: boolean;
|
|
21
|
+
exportEmbedScene: boolean;
|
|
22
|
+
exportWithDarkMode: boolean;
|
|
23
|
+
exportScale: number;
|
|
24
|
+
currentItemStrokeColor: string;
|
|
25
|
+
currentItemBackgroundColor: string;
|
|
26
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
27
|
+
currentItemStrokeWidth: number;
|
|
28
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
29
|
+
currentItemRoughness: number;
|
|
30
|
+
currentItemOpacity: number;
|
|
31
|
+
currentItemFontFamily: number;
|
|
32
|
+
currentItemFontSize: number;
|
|
33
|
+
currentItemTextAlign: import("../element/types").TextAlign;
|
|
34
|
+
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
35
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
36
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
37
|
+
currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
38
|
+
viewBackgroundColor: string;
|
|
39
|
+
scrollX: number;
|
|
40
|
+
scrollY: number;
|
|
41
|
+
cursorButton: "up" | "down";
|
|
42
|
+
scrolledOutside: boolean;
|
|
43
|
+
name: string;
|
|
44
|
+
isResizing: boolean;
|
|
45
|
+
isRotating: boolean;
|
|
46
|
+
zoom: Readonly<{
|
|
47
|
+
value: import("../types").NormalizedZoomValue;
|
|
48
|
+
translation: Readonly<{
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
openMenu: "canvas" | "shape" | null;
|
|
54
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
55
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
56
|
+
selectedElementIds: {
|
|
57
|
+
[id: string]: boolean;
|
|
58
|
+
};
|
|
59
|
+
previousSelectedElementIds: {
|
|
60
|
+
[id: string]: boolean;
|
|
61
|
+
};
|
|
62
|
+
shouldCacheIgnoreZoom: boolean;
|
|
63
|
+
showHelpDialog: boolean;
|
|
64
|
+
toastMessage: string | null;
|
|
65
|
+
zenModeEnabled: boolean;
|
|
66
|
+
theme: string;
|
|
67
|
+
gridSize: number | null;
|
|
68
|
+
viewModeEnabled: boolean;
|
|
69
|
+
selectedGroupIds: {
|
|
70
|
+
[groupId: string]: boolean;
|
|
71
|
+
};
|
|
72
|
+
editingGroupId: string | null;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
offsetTop: number;
|
|
76
|
+
offsetLeft: number;
|
|
77
|
+
isLibraryOpen: boolean;
|
|
78
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
79
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
80
|
+
currentChartType: import("../element/types").ChartType;
|
|
81
|
+
pasteDialog: {
|
|
82
|
+
shown: false;
|
|
83
|
+
data: null;
|
|
84
|
+
} | {
|
|
85
|
+
shown: true;
|
|
86
|
+
data: import("../charts").Spreadsheet;
|
|
87
|
+
};
|
|
88
|
+
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
89
|
+
};
|
|
90
|
+
commitToHistory: false;
|
|
91
|
+
};
|
|
92
|
+
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
93
|
+
contextItemLabel: string;
|
|
94
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
95
|
+
} & {
|
|
96
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
97
|
+
};
|
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const actionToggleViewMode: {
|
|
3
|
+
name: "viewMode";
|
|
4
|
+
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
5
|
+
appState: {
|
|
6
|
+
viewModeEnabled: boolean;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
errorMessage: string | null;
|
|
9
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
10
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
11
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
12
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
13
|
+
isBindingEnabled: boolean;
|
|
14
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
15
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
16
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
17
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
18
|
+
elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
|
|
19
|
+
elementLocked: boolean;
|
|
20
|
+
exportBackground: boolean;
|
|
21
|
+
exportEmbedScene: boolean;
|
|
22
|
+
exportWithDarkMode: boolean;
|
|
23
|
+
exportScale: number;
|
|
24
|
+
currentItemStrokeColor: string;
|
|
25
|
+
currentItemBackgroundColor: string;
|
|
26
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
27
|
+
currentItemStrokeWidth: number;
|
|
28
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
29
|
+
currentItemRoughness: number;
|
|
30
|
+
currentItemOpacity: number;
|
|
31
|
+
currentItemFontFamily: number;
|
|
32
|
+
currentItemFontSize: number;
|
|
33
|
+
currentItemTextAlign: import("../element/types").TextAlign;
|
|
34
|
+
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
35
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
36
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
37
|
+
currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
38
|
+
viewBackgroundColor: string;
|
|
39
|
+
scrollX: number;
|
|
40
|
+
scrollY: number;
|
|
41
|
+
cursorButton: "up" | "down";
|
|
42
|
+
scrolledOutside: boolean;
|
|
43
|
+
name: string;
|
|
44
|
+
isResizing: boolean;
|
|
45
|
+
isRotating: boolean;
|
|
46
|
+
zoom: Readonly<{
|
|
47
|
+
value: import("../types").NormalizedZoomValue;
|
|
48
|
+
translation: Readonly<{
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
openMenu: "canvas" | "shape" | null;
|
|
54
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
55
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
56
|
+
selectedElementIds: {
|
|
57
|
+
[id: string]: boolean;
|
|
58
|
+
};
|
|
59
|
+
previousSelectedElementIds: {
|
|
60
|
+
[id: string]: boolean;
|
|
61
|
+
};
|
|
62
|
+
shouldCacheIgnoreZoom: boolean;
|
|
63
|
+
showHelpDialog: boolean;
|
|
64
|
+
toastMessage: string | null;
|
|
65
|
+
zenModeEnabled: boolean;
|
|
66
|
+
theme: string;
|
|
67
|
+
gridSize: number | null;
|
|
68
|
+
selectedGroupIds: {
|
|
69
|
+
[groupId: string]: boolean;
|
|
70
|
+
};
|
|
71
|
+
editingGroupId: string | null;
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
offsetTop: number;
|
|
75
|
+
offsetLeft: number;
|
|
76
|
+
isLibraryOpen: boolean;
|
|
77
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
78
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
79
|
+
showStats: boolean;
|
|
80
|
+
currentChartType: import("../element/types").ChartType;
|
|
81
|
+
pasteDialog: {
|
|
82
|
+
shown: false;
|
|
83
|
+
data: null;
|
|
84
|
+
} | {
|
|
85
|
+
shown: true;
|
|
86
|
+
data: import("../charts").Spreadsheet;
|
|
87
|
+
};
|
|
88
|
+
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
89
|
+
};
|
|
90
|
+
commitToHistory: false;
|
|
91
|
+
};
|
|
92
|
+
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
93
|
+
contextItemLabel: string;
|
|
94
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
95
|
+
} & {
|
|
96
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
97
|
+
};
|
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const actionToggleZenMode: {
|
|
3
|
+
name: "zenMode";
|
|
4
|
+
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
5
|
+
appState: {
|
|
6
|
+
zenModeEnabled: boolean;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
errorMessage: string | null;
|
|
9
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
10
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
11
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
12
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
13
|
+
isBindingEnabled: boolean;
|
|
14
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
15
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
16
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
17
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
18
|
+
elementType: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw";
|
|
19
|
+
elementLocked: boolean;
|
|
20
|
+
exportBackground: boolean;
|
|
21
|
+
exportEmbedScene: boolean;
|
|
22
|
+
exportWithDarkMode: boolean;
|
|
23
|
+
exportScale: number;
|
|
24
|
+
currentItemStrokeColor: string;
|
|
25
|
+
currentItemBackgroundColor: string;
|
|
26
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
27
|
+
currentItemStrokeWidth: number;
|
|
28
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
29
|
+
currentItemRoughness: number;
|
|
30
|
+
currentItemOpacity: number;
|
|
31
|
+
currentItemFontFamily: number;
|
|
32
|
+
currentItemFontSize: number;
|
|
33
|
+
currentItemTextAlign: import("../element/types").TextAlign;
|
|
34
|
+
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
35
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
36
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
37
|
+
currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
38
|
+
viewBackgroundColor: string;
|
|
39
|
+
scrollX: number;
|
|
40
|
+
scrollY: number;
|
|
41
|
+
cursorButton: "up" | "down";
|
|
42
|
+
scrolledOutside: boolean;
|
|
43
|
+
name: string;
|
|
44
|
+
isResizing: boolean;
|
|
45
|
+
isRotating: boolean;
|
|
46
|
+
zoom: Readonly<{
|
|
47
|
+
value: import("../types").NormalizedZoomValue;
|
|
48
|
+
translation: Readonly<{
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
openMenu: "canvas" | "shape" | null;
|
|
54
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
55
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
56
|
+
selectedElementIds: {
|
|
57
|
+
[id: string]: boolean;
|
|
58
|
+
};
|
|
59
|
+
previousSelectedElementIds: {
|
|
60
|
+
[id: string]: boolean;
|
|
61
|
+
};
|
|
62
|
+
shouldCacheIgnoreZoom: boolean;
|
|
63
|
+
showHelpDialog: boolean;
|
|
64
|
+
toastMessage: string | null;
|
|
65
|
+
theme: string;
|
|
66
|
+
gridSize: number | null;
|
|
67
|
+
viewModeEnabled: boolean;
|
|
68
|
+
selectedGroupIds: {
|
|
69
|
+
[groupId: string]: boolean;
|
|
70
|
+
};
|
|
71
|
+
editingGroupId: string | null;
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
offsetTop: number;
|
|
75
|
+
offsetLeft: number;
|
|
76
|
+
isLibraryOpen: boolean;
|
|
77
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
78
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
79
|
+
showStats: boolean;
|
|
80
|
+
currentChartType: import("../element/types").ChartType;
|
|
81
|
+
pasteDialog: {
|
|
82
|
+
shown: false;
|
|
83
|
+
data: null;
|
|
84
|
+
} | {
|
|
85
|
+
shown: true;
|
|
86
|
+
data: import("../charts").Spreadsheet;
|
|
87
|
+
};
|
|
88
|
+
pendingImageElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawImageElement> | null;
|
|
89
|
+
};
|
|
90
|
+
commitToHistory: false;
|
|
91
|
+
};
|
|
92
|
+
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
93
|
+
contextItemLabel: string;
|
|
94
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
95
|
+
} & {
|
|
96
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
97
|
+
};
|
|
@@ -1,4 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const actionSendBackward: {
|
|
3
|
+
name: "sendBackward";
|
|
4
|
+
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
5
|
+
elements: (import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawSelectionElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawFreeDrawElement)[];
|
|
6
|
+
appState: Readonly<import("../types").AppState>;
|
|
7
|
+
commitToHistory: true;
|
|
8
|
+
};
|
|
9
|
+
contextItemLabel: string;
|
|
10
|
+
keyPriority: number;
|
|
11
|
+
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
12
|
+
PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
13
|
+
} & {
|
|
14
|
+
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
15
|
+
};
|
|
16
|
+
export declare const actionBringForward: {
|
|
17
|
+
name: "bringForward";
|
|
18
|
+
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
19
|
+
elements: (import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawSelectionElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawFreeDrawElement)[];
|
|
20
|
+
appState: Readonly<import("../types").AppState>;
|
|
21
|
+
commitToHistory: true;
|
|
22
|
+
};
|
|
23
|
+
contextItemLabel: string;
|
|
24
|
+
keyPriority: number;
|
|
25
|
+
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
26
|
+
PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
27
|
+
} & {
|
|
28
|
+
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
29
|
+
};
|
|
30
|
+
export declare const actionSendToBack: {
|
|
31
|
+
name: "sendToBack";
|
|
32
|
+
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
33
|
+
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
34
|
+
appState: Readonly<import("../types").AppState>;
|
|
35
|
+
commitToHistory: true;
|
|
36
|
+
};
|
|
37
|
+
contextItemLabel: string;
|
|
38
|
+
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
39
|
+
PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
40
|
+
} & {
|
|
41
|
+
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
42
|
+
};
|
|
43
|
+
export declare const actionBringToFront: {
|
|
44
|
+
name: "bringToFront";
|
|
45
|
+
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
46
|
+
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
47
|
+
appState: Readonly<import("../types").AppState>;
|
|
48
|
+
commitToHistory: true;
|
|
49
|
+
};
|
|
50
|
+
contextItemLabel: string;
|
|
51
|
+
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
52
|
+
PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
53
|
+
} & {
|
|
54
|
+
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
55
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { Action } from "./types";
|
|
2
2
|
export declare let actions: readonly Action[];
|
|
3
|
-
export declare const register: (action:
|
|
3
|
+
export declare const register: <T extends Action>(action: T) => T & {
|
|
4
|
+
keyTest?: (unknown extends T["keyTest"] ? never : T["keyTest"]) | undefined;
|
|
5
|
+
};
|
package/types/actions/types.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare type ActionResult = {
|
|
|
14
14
|
declare type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export declare type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export declare type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeSharpness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme";
|
|
17
|
+
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeSharpness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize";
|
|
18
18
|
export declare type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
package/types/align.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ActionManager } from "../actions/manager";
|
|
|
4
4
|
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
import History from "../history";
|
|
6
6
|
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData } from "../types";
|
|
7
|
+
export declare let showFourthFont: boolean;
|
|
7
8
|
export declare const useIsMobile: () => boolean;
|
|
8
9
|
export declare const useExcalidrawContainer: () => {
|
|
9
10
|
container: HTMLDivElement | null;
|
|
@@ -71,18 +72,20 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
71
72
|
toggleStats: () => void;
|
|
72
73
|
scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[]) => void;
|
|
73
74
|
zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
|
|
74
|
-
handleBindTextResize: (containerElements: NonDeletedExcalidrawElement[]) => void;
|
|
75
75
|
updateContainerSize: (containers: NonDeletedExcalidrawElement[]) => void;
|
|
76
76
|
clearToast: () => void;
|
|
77
77
|
setToastMessage: (toastMessage: string) => void;
|
|
78
78
|
restoreFileFromShare: () => Promise<void>;
|
|
79
79
|
/** adds supplied files to existing files in the appState */
|
|
80
80
|
addFiles: ExcalidrawImperativeAPI["addFiles"];
|
|
81
|
+
setLocalFont: ExcalidrawImperativeAPI["setLocalFont"];
|
|
82
|
+
private setLocalFontUrl;
|
|
81
83
|
updateScene: <K extends keyof AppState>(sceneData: {
|
|
82
84
|
elements?: SceneData["elements"];
|
|
83
85
|
appState?: Pick<AppState, K> | null | undefined;
|
|
84
86
|
collaborators?: SceneData["collaborators"];
|
|
85
87
|
commitToHistory?: SceneData["commitToHistory"];
|
|
88
|
+
libraryItems?: SceneData["libraryItems"];
|
|
86
89
|
}) => void;
|
|
87
90
|
private onSceneUpdated;
|
|
88
91
|
private updateCurrentCursorPosition;
|