@excalidraw/common 0.18.0-508de2f3a → 0.18.0-51ad895
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/dev/index.js +327 -46
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/constants.d.ts +20 -15
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/index.d.ts +2 -0
- package/dist/types/common/src/utils.d.ts +9 -3
- package/dist/types/common/src/visualdebug.d.ts +41 -0
- package/dist/types/element/src/binding.d.ts +55 -43
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/collision.d.ts +6 -2
- package/dist/types/element/src/delta.d.ts +4 -5
- package/dist/types/element/src/index.d.ts +1 -3
- package/dist/types/element/src/linearElementEditor.d.ts +15 -18
- package/dist/types/element/src/mutateElement.d.ts +0 -1
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +5 -2
- package/dist/types/element/src/resizeTest.d.ts +5 -4
- package/dist/types/element/src/store.d.ts +5 -0
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/transformHandles.d.ts +5 -4
- package/dist/types/element/src/typeChecks.d.ts +2 -3
- package/dist/types/element/src/types.d.ts +7 -11
- package/dist/types/element/src/utils.d.ts +2 -1
- package/dist/types/element/src/zindex.d.ts +7 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +34 -13
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +25 -11
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +153 -262
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +46 -773
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -5
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +42 -23
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +11 -6
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +23 -9
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +12 -5
- package/dist/types/excalidraw/actions/actionExport.d.ts +68 -943
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -393
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +50 -24
- package/dist/types/excalidraw/actions/actionGroup.d.ts +24 -10
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +22 -19
- package/dist/types/excalidraw/actions/actionLink.d.ts +9 -2
- package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -371
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +21 -359
- package/dist/types/excalidraw/actions/actionProperties.d.ts +87 -2403
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +12 -5
- package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -6
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +11 -4
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +11 -4
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -5
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +11 -4
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +11 -4
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -5
- package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -1
- package/dist/types/excalidraw/actions/register.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +4 -4
- package/dist/types/excalidraw/appState.d.ts +9 -4
- package/dist/types/excalidraw/clipboard.d.ts +64 -1
- package/dist/types/excalidraw/components/Actions.d.ts +21 -4
- package/dist/types/excalidraw/components/App.d.ts +36 -27
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -2
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FilledButton.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/excalidraw/components/Popover.d.ts +2 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +6 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +10 -0
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +13 -1
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
- package/dist/types/excalidraw/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/data/blob.d.ts +3 -7
- package/dist/types/excalidraw/data/restore.d.ts +3 -3
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +2 -6
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +5 -13
- package/dist/types/excalidraw/scene/types.d.ts +15 -3
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +32 -21
- package/dist/types/math/src/segment.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export declare const actionSelectAll: {
|
|
|
9
9
|
category: "canvas";
|
|
10
10
|
};
|
|
11
11
|
viewMode: false;
|
|
12
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, value:
|
|
12
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, value: unknown, app: import("../types").AppClassProperties) => false | {
|
|
13
13
|
appState: {
|
|
14
14
|
selectedLinearElement: LinearElementEditor | null;
|
|
15
15
|
editingGroupId: string | null;
|
|
@@ -37,7 +37,7 @@ export declare const actionSelectAll: {
|
|
|
37
37
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
38
38
|
isBindingEnabled: boolean;
|
|
39
39
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
40
|
-
|
|
40
|
+
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
41
41
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
42
42
|
frameRendering: {
|
|
43
43
|
enabled: boolean;
|
|
@@ -53,6 +53,10 @@ export declare const actionSelectAll: {
|
|
|
53
53
|
locked: boolean;
|
|
54
54
|
fromSelection: boolean;
|
|
55
55
|
} & import("../types").ActiveTool;
|
|
56
|
+
preferredSelectionTool: {
|
|
57
|
+
type: "selection" | "lasso";
|
|
58
|
+
initialized: boolean;
|
|
59
|
+
};
|
|
56
60
|
penMode: boolean;
|
|
57
61
|
penDetected: boolean;
|
|
58
62
|
exportBackground: boolean;
|
|
@@ -85,8 +89,8 @@ export declare const actionSelectAll: {
|
|
|
85
89
|
zoom: Readonly<{
|
|
86
90
|
value: import("../types").NormalizedZoomValue;
|
|
87
91
|
}>;
|
|
88
|
-
openMenu: "canvas" |
|
|
89
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
92
|
+
openMenu: "canvas" | null;
|
|
93
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
90
94
|
openSidebar: {
|
|
91
95
|
name: string;
|
|
92
96
|
tab?: string | undefined;
|
|
@@ -98,6 +102,8 @@ export declare const actionSelectAll: {
|
|
|
98
102
|
tab: "mermaid" | "text-to-diagram";
|
|
99
103
|
} | {
|
|
100
104
|
name: "commandPalette";
|
|
105
|
+
} | {
|
|
106
|
+
name: "settings";
|
|
101
107
|
} | {
|
|
102
108
|
name: "elementLinkSelector";
|
|
103
109
|
sourceElementId: string;
|
|
@@ -160,7 +166,7 @@ export declare const actionSelectAll: {
|
|
|
160
166
|
shown: true;
|
|
161
167
|
data: import("../charts").Spreadsheet;
|
|
162
168
|
};
|
|
163
|
-
showHyperlinkPopup: false | "
|
|
169
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
164
170
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
165
171
|
originSnapOffset: {
|
|
166
172
|
x: number;
|
|
@@ -179,6 +185,7 @@ export declare const actionSelectAll: {
|
|
|
179
185
|
lockedMultiSelections: {
|
|
180
186
|
[groupId: string]: true;
|
|
181
187
|
};
|
|
188
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
182
189
|
};
|
|
183
190
|
captureUpdate: "IMMEDIATELY";
|
|
184
191
|
};
|
|
@@ -7,7 +7,7 @@ export declare const actionCopyStyles: {
|
|
|
7
7
|
trackEvent: {
|
|
8
8
|
category: "element";
|
|
9
9
|
};
|
|
10
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, formData:
|
|
10
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, formData: unknown, app: import("../types").AppClassProperties) => {
|
|
11
11
|
appState: {
|
|
12
12
|
toast: {
|
|
13
13
|
message: string;
|
|
@@ -30,7 +30,7 @@ export declare const actionCopyStyles: {
|
|
|
30
30
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
31
31
|
isBindingEnabled: boolean;
|
|
32
32
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
33
|
-
|
|
33
|
+
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
34
34
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
35
35
|
frameRendering: {
|
|
36
36
|
enabled: boolean;
|
|
@@ -46,6 +46,10 @@ export declare const actionCopyStyles: {
|
|
|
46
46
|
locked: boolean;
|
|
47
47
|
fromSelection: boolean;
|
|
48
48
|
} & import("../types").ActiveTool;
|
|
49
|
+
preferredSelectionTool: {
|
|
50
|
+
type: "selection" | "lasso";
|
|
51
|
+
initialized: boolean;
|
|
52
|
+
};
|
|
49
53
|
penMode: boolean;
|
|
50
54
|
penDetected: boolean;
|
|
51
55
|
exportBackground: boolean;
|
|
@@ -78,8 +82,8 @@ export declare const actionCopyStyles: {
|
|
|
78
82
|
zoom: Readonly<{
|
|
79
83
|
value: import("../types").NormalizedZoomValue;
|
|
80
84
|
}>;
|
|
81
|
-
openMenu: "canvas" |
|
|
82
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
85
|
+
openMenu: "canvas" | null;
|
|
86
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
83
87
|
openSidebar: {
|
|
84
88
|
name: string;
|
|
85
89
|
tab?: string | undefined;
|
|
@@ -91,6 +95,8 @@ export declare const actionCopyStyles: {
|
|
|
91
95
|
tab: "mermaid" | "text-to-diagram";
|
|
92
96
|
} | {
|
|
93
97
|
name: "commandPalette";
|
|
98
|
+
} | {
|
|
99
|
+
name: "settings";
|
|
94
100
|
} | {
|
|
95
101
|
name: "elementLinkSelector";
|
|
96
102
|
sourceElementId: string;
|
|
@@ -155,7 +161,7 @@ export declare const actionCopyStyles: {
|
|
|
155
161
|
shown: true;
|
|
156
162
|
data: import("../charts").Spreadsheet;
|
|
157
163
|
};
|
|
158
|
-
showHyperlinkPopup: false | "
|
|
164
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
159
165
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
160
166
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
161
167
|
originSnapOffset: {
|
|
@@ -175,6 +181,7 @@ export declare const actionCopyStyles: {
|
|
|
175
181
|
lockedMultiSelections: {
|
|
176
182
|
[groupId: string]: true;
|
|
177
183
|
};
|
|
184
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
178
185
|
};
|
|
179
186
|
captureUpdate: "EVENTUALLY";
|
|
180
187
|
};
|
|
@@ -189,7 +196,7 @@ export declare const actionPasteStyles: {
|
|
|
189
196
|
trackEvent: {
|
|
190
197
|
category: "element";
|
|
191
198
|
};
|
|
192
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, formData:
|
|
199
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, formData: unknown, app: import("../types").AppClassProperties) => {
|
|
193
200
|
elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
194
201
|
captureUpdate: "EVENTUALLY";
|
|
195
202
|
} | {
|
|
@@ -7,7 +7,7 @@ export declare const actionTextAutoResize: {
|
|
|
7
7
|
category: "element";
|
|
8
8
|
};
|
|
9
9
|
predicate: (elements: readonly import("../../element/src/types").ExcalidrawElement[], appState: import("../types").AppState, _: unknown, app: AppClassProperties) => boolean;
|
|
10
|
-
perform: (elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _:
|
|
10
|
+
perform: (elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: AppClassProperties) => {
|
|
11
11
|
appState: Readonly<import("../types").AppState>;
|
|
12
12
|
elements: import("../../element/src/types").OrderedExcalidrawElement[];
|
|
13
13
|
captureUpdate: "IMMEDIATELY";
|
|
@@ -32,7 +32,7 @@ export declare const actionToggleGridMode: {
|
|
|
32
32
|
selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
|
|
33
33
|
isBindingEnabled: boolean;
|
|
34
34
|
startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
35
|
-
|
|
35
|
+
suggestedBinding: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
36
36
|
frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
|
|
37
37
|
frameRendering: {
|
|
38
38
|
enabled: boolean;
|
|
@@ -48,6 +48,10 @@ export declare const actionToggleGridMode: {
|
|
|
48
48
|
locked: boolean;
|
|
49
49
|
fromSelection: boolean;
|
|
50
50
|
} & import("../types").ActiveTool;
|
|
51
|
+
preferredSelectionTool: {
|
|
52
|
+
type: "selection" | "lasso";
|
|
53
|
+
initialized: boolean;
|
|
54
|
+
};
|
|
51
55
|
penMode: boolean;
|
|
52
56
|
penDetected: boolean;
|
|
53
57
|
exportBackground: boolean;
|
|
@@ -80,8 +84,8 @@ export declare const actionToggleGridMode: {
|
|
|
80
84
|
zoom: Readonly<{
|
|
81
85
|
value: import("../types").NormalizedZoomValue;
|
|
82
86
|
}>;
|
|
83
|
-
openMenu: "canvas" |
|
|
84
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
87
|
+
openMenu: "canvas" | null;
|
|
88
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
85
89
|
openSidebar: {
|
|
86
90
|
name: string;
|
|
87
91
|
tab?: string | undefined;
|
|
@@ -93,6 +97,8 @@ export declare const actionToggleGridMode: {
|
|
|
93
97
|
tab: "mermaid" | "text-to-diagram";
|
|
94
98
|
} | {
|
|
95
99
|
name: "commandPalette";
|
|
100
|
+
} | {
|
|
101
|
+
name: "settings";
|
|
96
102
|
} | {
|
|
97
103
|
name: "elementLinkSelector";
|
|
98
104
|
sourceElementId: string;
|
|
@@ -161,7 +167,7 @@ export declare const actionToggleGridMode: {
|
|
|
161
167
|
shown: true;
|
|
162
168
|
data: import("../charts").Spreadsheet;
|
|
163
169
|
};
|
|
164
|
-
showHyperlinkPopup: false | "
|
|
170
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
165
171
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
166
172
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
167
173
|
originSnapOffset: {
|
|
@@ -180,6 +186,7 @@ export declare const actionToggleGridMode: {
|
|
|
180
186
|
lockedMultiSelections: {
|
|
181
187
|
[groupId: string]: true;
|
|
182
188
|
};
|
|
189
|
+
bindMode: import("../../element/src/types").BindMode;
|
|
183
190
|
};
|
|
184
191
|
captureUpdate: "EVENTUALLY";
|
|
185
192
|
};
|
|
@@ -30,7 +30,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
30
30
|
selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
|
|
31
31
|
isBindingEnabled: boolean;
|
|
32
32
|
startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
33
|
-
|
|
33
|
+
suggestedBinding: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
34
34
|
frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
|
|
35
35
|
frameRendering: {
|
|
36
36
|
enabled: boolean;
|
|
@@ -46,6 +46,10 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
46
46
|
locked: boolean;
|
|
47
47
|
fromSelection: boolean;
|
|
48
48
|
} & import("../types").ActiveTool;
|
|
49
|
+
preferredSelectionTool: {
|
|
50
|
+
type: "selection" | "lasso";
|
|
51
|
+
initialized: boolean;
|
|
52
|
+
};
|
|
49
53
|
penMode: boolean;
|
|
50
54
|
penDetected: boolean;
|
|
51
55
|
exportBackground: boolean;
|
|
@@ -78,8 +82,8 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
78
82
|
zoom: Readonly<{
|
|
79
83
|
value: import("../types").NormalizedZoomValue;
|
|
80
84
|
}>;
|
|
81
|
-
openMenu: "canvas" |
|
|
82
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
85
|
+
openMenu: "canvas" | null;
|
|
86
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
83
87
|
openSidebar: {
|
|
84
88
|
name: string;
|
|
85
89
|
tab?: string | undefined;
|
|
@@ -91,6 +95,8 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
91
95
|
tab: "mermaid" | "text-to-diagram";
|
|
92
96
|
} | {
|
|
93
97
|
name: "commandPalette";
|
|
98
|
+
} | {
|
|
99
|
+
name: "settings";
|
|
94
100
|
} | {
|
|
95
101
|
name: "elementLinkSelector";
|
|
96
102
|
sourceElementId: string;
|
|
@@ -159,7 +165,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
159
165
|
shown: true;
|
|
160
166
|
data: import("../charts").Spreadsheet;
|
|
161
167
|
};
|
|
162
|
-
showHyperlinkPopup: false | "
|
|
168
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
163
169
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
164
170
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
165
171
|
originSnapOffset: {
|
|
@@ -178,6 +184,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
178
184
|
lockedMultiSelections: {
|
|
179
185
|
[groupId: string]: true;
|
|
180
186
|
};
|
|
187
|
+
bindMode: import("../../element/src/types").BindMode;
|
|
181
188
|
};
|
|
182
189
|
captureUpdate: "EVENTUALLY";
|
|
183
190
|
};
|
|
@@ -11,7 +11,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
11
11
|
action: string;
|
|
12
12
|
predicate: (appState: Readonly<AppState>) => boolean;
|
|
13
13
|
};
|
|
14
|
-
perform(elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _:
|
|
14
|
+
perform(elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties): false | {
|
|
15
15
|
appState: {
|
|
16
16
|
openSidebar: {
|
|
17
17
|
name: "default";
|
|
@@ -36,7 +36,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
36
36
|
selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
|
|
37
37
|
isBindingEnabled: boolean;
|
|
38
38
|
startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
39
|
-
|
|
39
|
+
suggestedBinding: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
40
40
|
frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
|
|
41
41
|
frameRendering: {
|
|
42
42
|
enabled: boolean;
|
|
@@ -52,6 +52,10 @@ export declare const actionToggleSearchMenu: {
|
|
|
52
52
|
locked: boolean;
|
|
53
53
|
fromSelection: boolean;
|
|
54
54
|
} & import("../types").ActiveTool;
|
|
55
|
+
preferredSelectionTool: {
|
|
56
|
+
type: "selection" | "lasso";
|
|
57
|
+
initialized: boolean;
|
|
58
|
+
};
|
|
55
59
|
penMode: boolean;
|
|
56
60
|
penDetected: boolean;
|
|
57
61
|
exportBackground: boolean;
|
|
@@ -84,8 +88,8 @@ export declare const actionToggleSearchMenu: {
|
|
|
84
88
|
zoom: Readonly<{
|
|
85
89
|
value: import("../types").NormalizedZoomValue;
|
|
86
90
|
}>;
|
|
87
|
-
openMenu: "canvas" |
|
|
88
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
91
|
+
openMenu: "canvas" | null;
|
|
92
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
89
93
|
defaultSidebarDockedPreference: boolean;
|
|
90
94
|
lastPointerDownWith: import("../../element/src/types").PointerType;
|
|
91
95
|
selectedElementIds: Readonly<{
|
|
@@ -151,7 +155,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
151
155
|
shown: true;
|
|
152
156
|
data: import("../charts").Spreadsheet;
|
|
153
157
|
};
|
|
154
|
-
showHyperlinkPopup: false | "
|
|
158
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
155
159
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
156
160
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
157
161
|
originSnapOffset: {
|
|
@@ -171,6 +175,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
171
175
|
lockedMultiSelections: {
|
|
172
176
|
[groupId: string]: true;
|
|
173
177
|
};
|
|
178
|
+
bindMode: import("../../element/src/types").BindMode;
|
|
174
179
|
};
|
|
175
180
|
captureUpdate: "EVENTUALLY";
|
|
176
181
|
};
|
|
@@ -9,7 +9,7 @@ export declare const actionToggleShapeSwitch: {
|
|
|
9
9
|
action: string;
|
|
10
10
|
};
|
|
11
11
|
keywords: string[];
|
|
12
|
-
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _:
|
|
12
|
+
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties): {
|
|
13
13
|
captureUpdate: "NEVER";
|
|
14
14
|
};
|
|
15
15
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
@@ -32,7 +32,7 @@ export declare const actionToggleStats: {
|
|
|
32
32
|
selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
|
|
33
33
|
isBindingEnabled: boolean;
|
|
34
34
|
startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
35
|
-
|
|
35
|
+
suggestedBinding: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
36
36
|
frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
|
|
37
37
|
frameRendering: {
|
|
38
38
|
enabled: boolean;
|
|
@@ -48,6 +48,10 @@ export declare const actionToggleStats: {
|
|
|
48
48
|
locked: boolean;
|
|
49
49
|
fromSelection: boolean;
|
|
50
50
|
} & import("../types").ActiveTool;
|
|
51
|
+
preferredSelectionTool: {
|
|
52
|
+
type: "selection" | "lasso";
|
|
53
|
+
initialized: boolean;
|
|
54
|
+
};
|
|
51
55
|
penMode: boolean;
|
|
52
56
|
penDetected: boolean;
|
|
53
57
|
exportBackground: boolean;
|
|
@@ -80,8 +84,8 @@ export declare const actionToggleStats: {
|
|
|
80
84
|
zoom: Readonly<{
|
|
81
85
|
value: import("../types").NormalizedZoomValue;
|
|
82
86
|
}>;
|
|
83
|
-
openMenu: "canvas" |
|
|
84
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
87
|
+
openMenu: "canvas" | null;
|
|
88
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
85
89
|
openSidebar: {
|
|
86
90
|
name: string;
|
|
87
91
|
tab?: string | undefined;
|
|
@@ -93,6 +97,8 @@ export declare const actionToggleStats: {
|
|
|
93
97
|
tab: "mermaid" | "text-to-diagram";
|
|
94
98
|
} | {
|
|
95
99
|
name: "commandPalette";
|
|
100
|
+
} | {
|
|
101
|
+
name: "settings";
|
|
96
102
|
} | {
|
|
97
103
|
name: "elementLinkSelector";
|
|
98
104
|
sourceElementId: string;
|
|
@@ -158,7 +164,7 @@ export declare const actionToggleStats: {
|
|
|
158
164
|
shown: true;
|
|
159
165
|
data: import("../charts").Spreadsheet;
|
|
160
166
|
};
|
|
161
|
-
showHyperlinkPopup: false | "
|
|
167
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
162
168
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
163
169
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
164
170
|
originSnapOffset: {
|
|
@@ -178,6 +184,7 @@ export declare const actionToggleStats: {
|
|
|
178
184
|
lockedMultiSelections: {
|
|
179
185
|
[groupId: string]: true;
|
|
180
186
|
};
|
|
187
|
+
bindMode: import("../../element/src/types").BindMode;
|
|
181
188
|
};
|
|
182
189
|
captureUpdate: "EVENTUALLY";
|
|
183
190
|
};
|
|
@@ -29,7 +29,7 @@ export declare const actionToggleViewMode: {
|
|
|
29
29
|
selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
|
|
30
30
|
isBindingEnabled: boolean;
|
|
31
31
|
startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
32
|
-
|
|
32
|
+
suggestedBinding: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
33
33
|
frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
|
|
34
34
|
frameRendering: {
|
|
35
35
|
enabled: boolean;
|
|
@@ -45,6 +45,10 @@ export declare const actionToggleViewMode: {
|
|
|
45
45
|
locked: boolean;
|
|
46
46
|
fromSelection: boolean;
|
|
47
47
|
} & import("../types").ActiveTool;
|
|
48
|
+
preferredSelectionTool: {
|
|
49
|
+
type: "selection" | "lasso";
|
|
50
|
+
initialized: boolean;
|
|
51
|
+
};
|
|
48
52
|
penMode: boolean;
|
|
49
53
|
penDetected: boolean;
|
|
50
54
|
exportBackground: boolean;
|
|
@@ -77,8 +81,8 @@ export declare const actionToggleViewMode: {
|
|
|
77
81
|
zoom: Readonly<{
|
|
78
82
|
value: import("../types").NormalizedZoomValue;
|
|
79
83
|
}>;
|
|
80
|
-
openMenu: "canvas" |
|
|
81
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
84
|
+
openMenu: "canvas" | null;
|
|
85
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
82
86
|
openSidebar: {
|
|
83
87
|
name: string;
|
|
84
88
|
tab?: string | undefined;
|
|
@@ -90,6 +94,8 @@ export declare const actionToggleViewMode: {
|
|
|
90
94
|
tab: "mermaid" | "text-to-diagram";
|
|
91
95
|
} | {
|
|
92
96
|
name: "commandPalette";
|
|
97
|
+
} | {
|
|
98
|
+
name: "settings";
|
|
93
99
|
} | {
|
|
94
100
|
name: "elementLinkSelector";
|
|
95
101
|
sourceElementId: string;
|
|
@@ -158,7 +164,7 @@ export declare const actionToggleViewMode: {
|
|
|
158
164
|
shown: true;
|
|
159
165
|
data: import("../charts").Spreadsheet;
|
|
160
166
|
};
|
|
161
|
-
showHyperlinkPopup: false | "
|
|
167
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
162
168
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
163
169
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
164
170
|
originSnapOffset: {
|
|
@@ -178,6 +184,7 @@ export declare const actionToggleViewMode: {
|
|
|
178
184
|
lockedMultiSelections: {
|
|
179
185
|
[groupId: string]: true;
|
|
180
186
|
};
|
|
187
|
+
bindMode: import("../../element/src/types").BindMode;
|
|
181
188
|
};
|
|
182
189
|
captureUpdate: "EVENTUALLY";
|
|
183
190
|
};
|
|
@@ -29,7 +29,7 @@ export declare const actionToggleZenMode: {
|
|
|
29
29
|
selectionElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
|
|
30
30
|
isBindingEnabled: boolean;
|
|
31
31
|
startBoundElement: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
32
|
-
|
|
32
|
+
suggestedBinding: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawBindableElement> | null;
|
|
33
33
|
frameToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawFrameLikeElement> | null;
|
|
34
34
|
frameRendering: {
|
|
35
35
|
enabled: boolean;
|
|
@@ -45,6 +45,10 @@ export declare const actionToggleZenMode: {
|
|
|
45
45
|
locked: boolean;
|
|
46
46
|
fromSelection: boolean;
|
|
47
47
|
} & import("../types").ActiveTool;
|
|
48
|
+
preferredSelectionTool: {
|
|
49
|
+
type: "selection" | "lasso";
|
|
50
|
+
initialized: boolean;
|
|
51
|
+
};
|
|
48
52
|
penMode: boolean;
|
|
49
53
|
penDetected: boolean;
|
|
50
54
|
exportBackground: boolean;
|
|
@@ -77,8 +81,8 @@ export declare const actionToggleZenMode: {
|
|
|
77
81
|
zoom: Readonly<{
|
|
78
82
|
value: import("../types").NormalizedZoomValue;
|
|
79
83
|
}>;
|
|
80
|
-
openMenu: "canvas" |
|
|
81
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
84
|
+
openMenu: "canvas" | null;
|
|
85
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
82
86
|
openSidebar: {
|
|
83
87
|
name: string;
|
|
84
88
|
tab?: string | undefined;
|
|
@@ -90,6 +94,8 @@ export declare const actionToggleZenMode: {
|
|
|
90
94
|
tab: "mermaid" | "text-to-diagram";
|
|
91
95
|
} | {
|
|
92
96
|
name: "commandPalette";
|
|
97
|
+
} | {
|
|
98
|
+
name: "settings";
|
|
93
99
|
} | {
|
|
94
100
|
name: "elementLinkSelector";
|
|
95
101
|
sourceElementId: string;
|
|
@@ -158,7 +164,7 @@ export declare const actionToggleZenMode: {
|
|
|
158
164
|
shown: true;
|
|
159
165
|
data: import("../charts").Spreadsheet;
|
|
160
166
|
};
|
|
161
|
-
showHyperlinkPopup: false | "
|
|
167
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
162
168
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
163
169
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
164
170
|
originSnapOffset: {
|
|
@@ -178,11 +184,12 @@ export declare const actionToggleZenMode: {
|
|
|
178
184
|
lockedMultiSelections: {
|
|
179
185
|
[groupId: string]: true;
|
|
180
186
|
};
|
|
187
|
+
bindMode: import("../../element/src/types").BindMode;
|
|
181
188
|
};
|
|
182
189
|
captureUpdate: "EVENTUALLY";
|
|
183
190
|
};
|
|
184
191
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
185
|
-
predicate: (elements: readonly import("../../element/src/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
192
|
+
predicate: (elements: readonly import("../../element/src/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
|
|
186
193
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
187
194
|
} & {
|
|
188
195
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
@@ -7,7 +7,7 @@ export declare const actionSendBackward: {
|
|
|
7
7
|
trackEvent: {
|
|
8
8
|
category: "element";
|
|
9
9
|
};
|
|
10
|
-
perform: (elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, value:
|
|
10
|
+
perform: (elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, value: unknown, app: import("../types").AppClassProperties) => {
|
|
11
11
|
elements: readonly import("../../element/src/types").ExcalidrawElement[];
|
|
12
12
|
appState: Readonly<import("../types").AppState>;
|
|
13
13
|
captureUpdate: "IMMEDIATELY";
|
|
@@ -26,7 +26,7 @@ export declare const actionBringForward: {
|
|
|
26
26
|
trackEvent: {
|
|
27
27
|
category: "element";
|
|
28
28
|
};
|
|
29
|
-
perform: (elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, value:
|
|
29
|
+
perform: (elements: readonly import("../../element/src/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, value: unknown, app: import("../types").AppClassProperties) => {
|
|
30
30
|
elements: readonly import("../../element/src/types").ExcalidrawElement[];
|
|
31
31
|
appState: Readonly<import("../types").AppState>;
|
|
32
32
|
captureUpdate: "IMMEDIATELY";
|
|
@@ -2,13 +2,13 @@ export { actionDeleteSelected } from "./actionDeleteSelected";
|
|
|
2
2
|
export { actionBringForward, actionBringToFront, actionSendBackward, actionSendToBack, } from "./actionZindex";
|
|
3
3
|
export { actionSelectAll } from "./actionSelectAll";
|
|
4
4
|
export { actionDuplicateSelection } from "./actionDuplicateSelection";
|
|
5
|
-
export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, } from "./actionProperties";
|
|
5
|
+
export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, actionChangeArrowProperties, } from "./actionProperties";
|
|
6
6
|
export { actionChangeViewBackgroundColor, actionClearCanvas, actionZoomIn, actionZoomOut, actionResetZoom, actionZoomToFit, actionToggleTheme, } from "./actionCanvas";
|
|
7
7
|
export { actionSetEmbeddableAsActiveTool } from "./actionEmbeddable";
|
|
8
8
|
export { actionFinalize } from "./actionFinalize";
|
|
9
9
|
export { actionChangeProjectName, actionChangeExportBackground, actionSaveToActiveFile, actionSaveFileToDisk, actionLoadScene, } from "./actionExport";
|
|
10
10
|
export { actionCopyStyles, actionPasteStyles } from "./actionStyles";
|
|
11
|
-
export {
|
|
11
|
+
export { actionShortcuts } from "./actionMenu";
|
|
12
12
|
export { actionGroup, actionUngroup } from "./actionGroup";
|
|
13
13
|
export { actionGoToCollaborator } from "./actionNavigate";
|
|
14
14
|
export { actionAddToLibrary } from "./actionAddToLibrary";
|
|
@@ -3,7 +3,7 @@ import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
|
3
3
|
import type { AppClassProperties, AppState } from "../types";
|
|
4
4
|
import type { Action, UpdaterFn, ActionName, ActionResult, PanelComponentProps, ActionSource } from "./types";
|
|
5
5
|
export declare class ActionManager {
|
|
6
|
-
actions: Record<ActionName, Action
|
|
6
|
+
actions: Record<ActionName, Action<any>>;
|
|
7
7
|
updater: (actionResult: ActionResult | Promise<ActionResult>) => void;
|
|
8
8
|
getAppState: () => Readonly<AppState>;
|
|
9
9
|
getElementsIncludingDeleted: () => readonly OrderedExcalidrawElement[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Action } from "./types";
|
|
2
2
|
export declare let actions: readonly Action[];
|
|
3
|
-
export declare const register: <T extends Action>(action: T) => T & {
|
|
3
|
+
export declare const register: <TData extends unknown, T extends Action<TData> = Action<TData>>(action: T) => T & {
|
|
4
4
|
keyTest?: (unknown extends T["keyTest"] ? never : T["keyTest"]) | undefined;
|
|
5
5
|
};
|
|
@@ -11,10 +11,10 @@ export type ActionResult = {
|
|
|
11
11
|
captureUpdate: CaptureUpdateActionType;
|
|
12
12
|
replaceFiles?: boolean;
|
|
13
13
|
} | false;
|
|
14
|
-
type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData:
|
|
14
|
+
type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -24,13 +24,13 @@ export type PanelComponentProps = {
|
|
|
24
24
|
app: AppClassProperties;
|
|
25
25
|
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => React.JSX.Element | null;
|
|
26
26
|
};
|
|
27
|
-
export interface Action {
|
|
27
|
+
export interface Action<TData = any> {
|
|
28
28
|
name: ActionName;
|
|
29
29
|
label: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, app: AppClassProperties) => string);
|
|
30
30
|
keywords?: string[];
|
|
31
31
|
icon?: React.ReactNode | ((appState: UIAppState, elements: readonly ExcalidrawElement[]) => React.ReactNode);
|
|
32
32
|
PanelComponent?: React.FC<PanelComponentProps>;
|
|
33
|
-
perform: ActionFn
|
|
33
|
+
perform: ActionFn<TData>;
|
|
34
34
|
keyPriority?: number;
|
|
35
35
|
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean;
|
|
36
36
|
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|