@dwelle/excalidraw 0.4.0-e1bdbb6 → 0.4.0-e587816
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/CHANGELOG.md +714 -0
- package/README.md +18 -1422
- package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js → vendor-d415b28e9024dee4bb1b.js} +2 -2
- package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
- package/dist/excalidraw.development.js +3257 -1444
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
- package/main.js +1 -8
- package/package.json +9 -4
- package/types/actions/actionAddToLibrary.d.ts +124 -64
- package/types/actions/actionAlign.d.ts +33 -40
- package/types/actions/actionBoundText.d.ts +182 -25
- package/types/actions/actionCanvas.d.ts +754 -220
- package/types/actions/actionClipboard.d.ts +236 -115
- package/types/actions/actionDeleteSelected.d.ts +133 -72
- package/types/actions/actionDistribute.d.ts +11 -16
- package/types/actions/actionDuplicateSelection.d.ts +4 -7
- package/types/actions/actionElementLock.d.ts +271 -0
- package/types/actions/actionExport.d.ts +440 -277
- package/types/actions/actionFinalize.d.ts +85 -51
- package/types/actions/actionFlip.d.ts +8 -11
- package/types/actions/actionFrame.d.ts +423 -0
- package/types/actions/actionGroup.d.ts +252 -19
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +44 -24
- package/types/actions/actionMenu.d.ts +132 -79
- package/types/actions/actionNavigate.d.ts +2 -3
- package/types/actions/actionProperties.d.ts +569 -334
- package/types/actions/actionSelectAll.d.ts +123 -4
- package/types/actions/actionStyles.d.ts +46 -27
- package/types/actions/actionToggleGridMode.d.ts +46 -25
- package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +56 -35
- package/types/actions/actionToggleStats.d.ts +45 -25
- package/types/actions/actionToggleViewMode.d.ts +46 -25
- package/types/actions/actionToggleZenMode.d.ts +46 -25
- package/types/actions/actionZindex.d.ts +16 -24
- package/types/actions/index.d.ts +2 -1
- package/types/actions/manager.d.ts +3 -2
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +16 -13
- package/types/appState.d.ts +27 -28
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +9 -3
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +7 -12
- package/types/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/components/App.d.ts +102 -86
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +16 -0
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +6 -0
- package/types/components/ColorPicker/ColorInput.d.ts +9 -0
- package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
- package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
- package/types/components/ColorPicker/Picker.d.ts +18 -0
- package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/types/components/ColorPicker/ShadeList.d.ts +8 -0
- package/types/components/ColorPicker/TopPicks.d.ts +9 -0
- package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/types/components/ContextMenu.d.ts +9 -22
- package/types/components/DefaultSidebar.d.ts +29 -0
- package/types/components/Dialog.d.ts +3 -4
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +28 -0
- package/types/components/FilledButton.d.ts +17 -0
- package/types/components/FixedSideContainer.d.ts +1 -1
- package/types/components/HandButton.d.ts +10 -0
- package/types/components/HelpButton.d.ts +1 -2
- package/types/components/HintViewer.d.ts +4 -5
- package/types/components/HomeButton.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +8 -13
- package/types/components/Island.d.ts +1 -1
- package/types/components/JSONExportDialog.d.ts +7 -5
- package/types/components/LaserTool/LaserPathManager.d.ts +28 -0
- package/types/components/LaserTool/LaserPointerButton.d.ts +10 -0
- package/types/components/LaserTool/LaserTool.d.ts +7 -0
- package/types/components/LayerUI.d.ts +11 -19
- package/types/components/LibraryMenu.d.ts +13 -14
- package/types/components/LibraryMenuBrowseButton.d.ts +2 -2
- package/types/components/LibraryMenuControlButtons.d.ts +9 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +10 -5
- package/types/components/LibraryMenuItems.d.ts +6 -7
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +6 -3
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/LockButton.d.ts +1 -2
- package/types/components/MobileMenu.d.ts +9 -15
- package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/types/components/PasteChartDialog.d.ts +4 -5
- package/types/components/PenModeButton.d.ts +1 -1
- package/types/components/Popover.d.ts +1 -1
- package/types/components/ProjectName.d.ts +2 -1
- package/types/components/PublishLibrary.d.ts +2 -2
- package/types/components/RadioGroup.d.ts +12 -0
- package/types/components/Section.d.ts +1 -1
- package/types/components/Sidebar/Sidebar.d.ts +66 -63
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +8 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/types/components/Sidebar/common.d.ts +24 -7
- package/types/components/Spinner.d.ts +2 -1
- package/types/components/Stack.d.ts +4 -3
- package/types/components/Stats.d.ts +3 -3
- package/types/components/Switch.d.ts +9 -0
- package/types/components/ToolButton.d.ts +6 -5
- package/types/components/Tooltip.d.ts +1 -1
- package/types/components/Trans.d.ts +9 -0
- package/types/components/UserList.d.ts +0 -2
- package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
- package/types/components/canvases/StaticCanvas.d.ts +18 -0
- package/types/components/canvases/index.d.ts +3 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +70 -0
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
- package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +13 -0
- package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +7 -0
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +14 -0
- package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/components/footer/Footer.d.ts +12 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +17 -2
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +9 -0
- package/types/components/main-menu/DefaultItems.d.ts +47 -0
- package/types/components/main-menu/MainMenu.d.ts +64 -0
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +57 -0
- package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/components/welcome-screen/WelcomeScreen.d.ts +84 -0
- package/types/constants.d.ts +105 -18
- package/types/context/tunnels.d.ts +19 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/cursor.d.ts +5 -0
- package/types/data/blob.d.ts +5 -3
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/index.d.ts +1 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +10 -4
- package/types/data/transform.d.ts +73 -0
- package/types/data/types.d.ts +3 -5
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +57 -36
- package/types/element/binding.d.ts +4 -3
- package/types/element/bounds.d.ts +41 -10
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +12 -2
- package/types/element/embeddable.d.ts +153 -0
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +77 -30
- package/types/element/mutateElement.d.ts +3 -2
- package/types/element/newElement.d.ts +48 -15
- package/types/element/resizeElements.d.ts +3 -3
- package/types/element/resizeTest.d.ts +2 -1
- package/types/element/showSelectedShapeActions.d.ts +2 -2
- package/types/element/sizeHelpers.d.ts +8 -1
- package/types/element/sortElements.d.ts +2 -0
- package/types/element/textElement.d.ts +57 -9
- package/types/element/textWysiwyg.d.ts +7 -2
- package/types/element/transformHandles.d.ts +15 -8
- package/types/element/typeChecks.d.ts +14 -2
- package/types/element/types.d.ts +66 -35
- package/types/emitter.d.ts +1 -2
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +46 -0
- package/types/ga.d.ts +5 -5
- package/types/groups.d.ts +15 -11
- package/types/history.d.ts +3 -3
- package/types/hooks/useCreatePortalContainer.d.ts +4 -0
- package/types/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/hooks/useOutsideClick.d.ts +19 -2
- package/types/hooks/useScrollPosition.d.ts +1 -0
- package/types/hooks/useStable.d.ts +1 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +11 -2
- package/types/jotai.d.ts +20 -108
- package/types/keys.d.ts +7 -4
- package/types/math.d.ts +7 -1
- package/types/packages/bbox.d.ts +11 -0
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.d.ts +22 -4
- package/types/packages/excalidraw/main.d.ts +3 -1
- package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
- package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
- package/types/packages/utils.d.ts +30 -24
- package/types/packages/withinBounds.d.ts +19 -0
- package/types/renderer/renderElement.d.ts +13 -22
- package/types/renderer/renderScene.d.ts +19 -29
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Fonts.d.ts +21 -0
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +42 -5
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/comparisons.d.ts +2 -4
- package/types/scene/export.d.ts +183 -10
- package/types/scene/index.d.ts +1 -1
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +27 -6
- package/types/scene/types.d.ts +70 -26
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +227 -91
- package/types/utility-types.d.ts +24 -0
- package/types/utils.d.ts +75 -14
- package/types/zindex.d.ts +4 -4
- package/types/components/ActiveFile.d.ts +0 -7
- package/types/components/ClearCanvas.d.ts +0 -4
- package/types/components/CollabButton.d.ts +0 -6
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/Footer.d.ts +0 -10
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/MenuItem.d.ts +0 -11
- package/types/components/MenuUtils.d.ts +0 -1
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/WelcomeScreen.d.ts +0 -10
- package/types/components/WelcomeScreenDecor.d.ts +0 -6
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
- /package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleStats: {
|
|
3
2
|
name: "stats";
|
|
3
|
+
viewMode: true;
|
|
4
4
|
trackEvent: {
|
|
5
5
|
category: "menu";
|
|
6
6
|
};
|
|
7
7
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
8
8
|
appState: {
|
|
9
9
|
showStats: boolean;
|
|
10
|
+
contextMenu: {
|
|
11
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
} | null;
|
|
10
15
|
showWelcomeScreen: boolean;
|
|
11
16
|
isLoading: boolean;
|
|
12
|
-
errorMessage:
|
|
17
|
+
errorMessage: import("react").ReactNode;
|
|
18
|
+
activeEmbeddable: {
|
|
19
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
20
|
+
state: "active" | "hover";
|
|
21
|
+
} | null;
|
|
13
22
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
14
23
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
15
24
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -17,19 +26,21 @@ export declare const actionToggleStats: {
|
|
|
17
26
|
isBindingEnabled: boolean;
|
|
18
27
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
19
28
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
29
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
30
|
+
frameRendering: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
name: boolean;
|
|
33
|
+
outline: boolean;
|
|
34
|
+
clip: boolean;
|
|
35
|
+
};
|
|
36
|
+
editingFrame: string | null;
|
|
37
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
20
38
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
39
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
22
40
|
activeTool: {
|
|
23
|
-
|
|
24
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
25
|
-
locked: boolean;
|
|
26
|
-
customType: null;
|
|
27
|
-
} | {
|
|
28
|
-
type: "custom";
|
|
29
|
-
customType: string;
|
|
30
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
41
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
31
42
|
locked: boolean;
|
|
32
|
-
};
|
|
43
|
+
} & import("../types").ActiveTool;
|
|
33
44
|
penMode: boolean;
|
|
34
45
|
penDetected: boolean;
|
|
35
46
|
exportBackground: boolean;
|
|
@@ -46,10 +57,9 @@ export declare const actionToggleStats: {
|
|
|
46
57
|
currentItemFontFamily: number;
|
|
47
58
|
currentItemFontSize: number;
|
|
48
59
|
currentItemTextAlign: string;
|
|
49
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
50
60
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
51
61
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
52
|
-
|
|
62
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
53
63
|
viewBackgroundColor: string;
|
|
54
64
|
scrollX: number;
|
|
55
65
|
scrollY: number;
|
|
@@ -62,17 +72,21 @@ export declare const actionToggleStats: {
|
|
|
62
72
|
value: import("../types").NormalizedZoomValue;
|
|
63
73
|
}>;
|
|
64
74
|
openMenu: "canvas" | "shape" | null;
|
|
65
|
-
openPopup: "
|
|
66
|
-
openSidebar:
|
|
67
|
-
|
|
68
|
-
|
|
75
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
76
|
+
openSidebar: {
|
|
77
|
+
name: string;
|
|
78
|
+
tab?: string | undefined;
|
|
79
|
+
} | null;
|
|
80
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
81
|
+
defaultSidebarDockedPreference: boolean;
|
|
69
82
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
70
|
-
selectedElementIds: {
|
|
71
|
-
[id: string]:
|
|
72
|
-
}
|
|
83
|
+
selectedElementIds: Readonly<{
|
|
84
|
+
[id: string]: true;
|
|
85
|
+
}>;
|
|
73
86
|
previousSelectedElementIds: {
|
|
74
|
-
[id: string]:
|
|
87
|
+
[id: string]: true;
|
|
75
88
|
};
|
|
89
|
+
selectedElementsAreBeingDragged: boolean;
|
|
76
90
|
shouldCacheIgnoreZoom: boolean;
|
|
77
91
|
toast: {
|
|
78
92
|
message: string;
|
|
@@ -80,7 +94,7 @@ export declare const actionToggleStats: {
|
|
|
80
94
|
duration?: number | undefined;
|
|
81
95
|
} | null;
|
|
82
96
|
zenModeEnabled: boolean;
|
|
83
|
-
theme:
|
|
97
|
+
theme: import("../element/types").Theme;
|
|
84
98
|
gridSize: number | null;
|
|
85
99
|
viewModeEnabled: boolean;
|
|
86
100
|
selectedGroupIds: {
|
|
@@ -102,14 +116,20 @@ export declare const actionToggleStats: {
|
|
|
102
116
|
data: import("../charts").Spreadsheet;
|
|
103
117
|
};
|
|
104
118
|
pendingImageElementId: string | null;
|
|
105
|
-
showHyperlinkPopup: false | "
|
|
119
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
106
120
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
121
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
122
|
+
originSnapOffset: {
|
|
123
|
+
x: number;
|
|
124
|
+
y: number;
|
|
125
|
+
} | null;
|
|
126
|
+
objectsSnapModeEnabled: boolean;
|
|
107
127
|
};
|
|
108
128
|
commitToHistory: false;
|
|
109
129
|
};
|
|
110
130
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
111
131
|
contextItemLabel: string;
|
|
112
|
-
keyTest: (event:
|
|
132
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
113
133
|
} & {
|
|
114
|
-
keyTest?: ((event:
|
|
134
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
115
135
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleViewMode: {
|
|
3
2
|
name: "viewMode";
|
|
3
|
+
viewMode: true;
|
|
4
4
|
trackEvent: {
|
|
5
5
|
category: "canvas";
|
|
6
6
|
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
@@ -8,9 +8,18 @@ export declare const actionToggleViewMode: {
|
|
|
8
8
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
9
9
|
appState: {
|
|
10
10
|
viewModeEnabled: boolean;
|
|
11
|
+
contextMenu: {
|
|
12
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
13
|
+
top: number;
|
|
14
|
+
left: number;
|
|
15
|
+
} | null;
|
|
11
16
|
showWelcomeScreen: boolean;
|
|
12
17
|
isLoading: boolean;
|
|
13
|
-
errorMessage:
|
|
18
|
+
errorMessage: import("react").ReactNode;
|
|
19
|
+
activeEmbeddable: {
|
|
20
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
21
|
+
state: "active" | "hover";
|
|
22
|
+
} | null;
|
|
14
23
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
15
24
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
16
25
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -18,19 +27,21 @@ export declare const actionToggleViewMode: {
|
|
|
18
27
|
isBindingEnabled: boolean;
|
|
19
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
20
29
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
30
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
31
|
+
frameRendering: {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
name: boolean;
|
|
34
|
+
outline: boolean;
|
|
35
|
+
clip: boolean;
|
|
36
|
+
};
|
|
37
|
+
editingFrame: string | null;
|
|
38
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
21
39
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
40
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
23
41
|
activeTool: {
|
|
24
|
-
|
|
25
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
26
|
-
locked: boolean;
|
|
27
|
-
customType: null;
|
|
28
|
-
} | {
|
|
29
|
-
type: "custom";
|
|
30
|
-
customType: string;
|
|
31
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
42
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
32
43
|
locked: boolean;
|
|
33
|
-
};
|
|
44
|
+
} & import("../types").ActiveTool;
|
|
34
45
|
penMode: boolean;
|
|
35
46
|
penDetected: boolean;
|
|
36
47
|
exportBackground: boolean;
|
|
@@ -47,10 +58,9 @@ export declare const actionToggleViewMode: {
|
|
|
47
58
|
currentItemFontFamily: number;
|
|
48
59
|
currentItemFontSize: number;
|
|
49
60
|
currentItemTextAlign: string;
|
|
50
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
51
61
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
52
62
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
53
|
-
|
|
63
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
54
64
|
viewBackgroundColor: string;
|
|
55
65
|
scrollX: number;
|
|
56
66
|
scrollY: number;
|
|
@@ -63,17 +73,21 @@ export declare const actionToggleViewMode: {
|
|
|
63
73
|
value: import("../types").NormalizedZoomValue;
|
|
64
74
|
}>;
|
|
65
75
|
openMenu: "canvas" | "shape" | null;
|
|
66
|
-
openPopup: "
|
|
67
|
-
openSidebar:
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
77
|
+
openSidebar: {
|
|
78
|
+
name: string;
|
|
79
|
+
tab?: string | undefined;
|
|
80
|
+
} | null;
|
|
81
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
82
|
+
defaultSidebarDockedPreference: boolean;
|
|
70
83
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
71
|
-
selectedElementIds: {
|
|
72
|
-
[id: string]:
|
|
73
|
-
}
|
|
84
|
+
selectedElementIds: Readonly<{
|
|
85
|
+
[id: string]: true;
|
|
86
|
+
}>;
|
|
74
87
|
previousSelectedElementIds: {
|
|
75
|
-
[id: string]:
|
|
88
|
+
[id: string]: true;
|
|
76
89
|
};
|
|
90
|
+
selectedElementsAreBeingDragged: boolean;
|
|
77
91
|
shouldCacheIgnoreZoom: boolean;
|
|
78
92
|
toast: {
|
|
79
93
|
message: string;
|
|
@@ -81,7 +95,7 @@ export declare const actionToggleViewMode: {
|
|
|
81
95
|
duration?: number | undefined;
|
|
82
96
|
} | null;
|
|
83
97
|
zenModeEnabled: boolean;
|
|
84
|
-
theme:
|
|
98
|
+
theme: import("../element/types").Theme;
|
|
85
99
|
gridSize: number | null;
|
|
86
100
|
selectedGroupIds: {
|
|
87
101
|
[groupId: string]: boolean;
|
|
@@ -103,14 +117,21 @@ export declare const actionToggleViewMode: {
|
|
|
103
117
|
data: import("../charts").Spreadsheet;
|
|
104
118
|
};
|
|
105
119
|
pendingImageElementId: string | null;
|
|
106
|
-
showHyperlinkPopup: false | "
|
|
120
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
107
121
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
122
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
123
|
+
originSnapOffset: {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
} | null;
|
|
127
|
+
objectsSnapModeEnabled: boolean;
|
|
108
128
|
};
|
|
109
129
|
commitToHistory: false;
|
|
110
130
|
};
|
|
111
131
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
132
|
+
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
112
133
|
contextItemLabel: string;
|
|
113
|
-
keyTest: (event:
|
|
134
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
114
135
|
} & {
|
|
115
|
-
keyTest?: ((event:
|
|
136
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
116
137
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleZenMode: {
|
|
3
2
|
name: "zenMode";
|
|
3
|
+
viewMode: true;
|
|
4
4
|
trackEvent: {
|
|
5
5
|
category: "canvas";
|
|
6
6
|
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
@@ -8,9 +8,18 @@ export declare const actionToggleZenMode: {
|
|
|
8
8
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
9
9
|
appState: {
|
|
10
10
|
zenModeEnabled: boolean;
|
|
11
|
+
contextMenu: {
|
|
12
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
13
|
+
top: number;
|
|
14
|
+
left: number;
|
|
15
|
+
} | null;
|
|
11
16
|
showWelcomeScreen: boolean;
|
|
12
17
|
isLoading: boolean;
|
|
13
|
-
errorMessage:
|
|
18
|
+
errorMessage: import("react").ReactNode;
|
|
19
|
+
activeEmbeddable: {
|
|
20
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
21
|
+
state: "active" | "hover";
|
|
22
|
+
} | null;
|
|
14
23
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
15
24
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
16
25
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -18,19 +27,21 @@ export declare const actionToggleZenMode: {
|
|
|
18
27
|
isBindingEnabled: boolean;
|
|
19
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
20
29
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
30
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
31
|
+
frameRendering: {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
name: boolean;
|
|
34
|
+
outline: boolean;
|
|
35
|
+
clip: boolean;
|
|
36
|
+
};
|
|
37
|
+
editingFrame: string | null;
|
|
38
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
21
39
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
40
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
23
41
|
activeTool: {
|
|
24
|
-
|
|
25
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
26
|
-
locked: boolean;
|
|
27
|
-
customType: null;
|
|
28
|
-
} | {
|
|
29
|
-
type: "custom";
|
|
30
|
-
customType: string;
|
|
31
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
42
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
32
43
|
locked: boolean;
|
|
33
|
-
};
|
|
44
|
+
} & import("../types").ActiveTool;
|
|
34
45
|
penMode: boolean;
|
|
35
46
|
penDetected: boolean;
|
|
36
47
|
exportBackground: boolean;
|
|
@@ -47,10 +58,9 @@ export declare const actionToggleZenMode: {
|
|
|
47
58
|
currentItemFontFamily: number;
|
|
48
59
|
currentItemFontSize: number;
|
|
49
60
|
currentItemTextAlign: string;
|
|
50
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
51
61
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
52
62
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
53
|
-
|
|
63
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
54
64
|
viewBackgroundColor: string;
|
|
55
65
|
scrollX: number;
|
|
56
66
|
scrollY: number;
|
|
@@ -63,24 +73,28 @@ export declare const actionToggleZenMode: {
|
|
|
63
73
|
value: import("../types").NormalizedZoomValue;
|
|
64
74
|
}>;
|
|
65
75
|
openMenu: "canvas" | "shape" | null;
|
|
66
|
-
openPopup: "
|
|
67
|
-
openSidebar:
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
77
|
+
openSidebar: {
|
|
78
|
+
name: string;
|
|
79
|
+
tab?: string | undefined;
|
|
80
|
+
} | null;
|
|
81
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
82
|
+
defaultSidebarDockedPreference: boolean;
|
|
70
83
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
71
|
-
selectedElementIds: {
|
|
72
|
-
[id: string]:
|
|
73
|
-
}
|
|
84
|
+
selectedElementIds: Readonly<{
|
|
85
|
+
[id: string]: true;
|
|
86
|
+
}>;
|
|
74
87
|
previousSelectedElementIds: {
|
|
75
|
-
[id: string]:
|
|
88
|
+
[id: string]: true;
|
|
76
89
|
};
|
|
90
|
+
selectedElementsAreBeingDragged: boolean;
|
|
77
91
|
shouldCacheIgnoreZoom: boolean;
|
|
78
92
|
toast: {
|
|
79
93
|
message: string;
|
|
80
94
|
closable?: boolean | undefined;
|
|
81
95
|
duration?: number | undefined;
|
|
82
96
|
} | null;
|
|
83
|
-
theme:
|
|
97
|
+
theme: import("../element/types").Theme;
|
|
84
98
|
gridSize: number | null;
|
|
85
99
|
viewModeEnabled: boolean;
|
|
86
100
|
selectedGroupIds: {
|
|
@@ -103,14 +117,21 @@ export declare const actionToggleZenMode: {
|
|
|
103
117
|
data: import("../charts").Spreadsheet;
|
|
104
118
|
};
|
|
105
119
|
pendingImageElementId: string | null;
|
|
106
|
-
showHyperlinkPopup: false | "
|
|
120
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
107
121
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
122
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
123
|
+
originSnapOffset: {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
} | null;
|
|
127
|
+
objectsSnapModeEnabled: boolean;
|
|
108
128
|
};
|
|
109
129
|
commitToHistory: false;
|
|
110
130
|
};
|
|
111
131
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
132
|
+
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
112
133
|
contextItemLabel: string;
|
|
113
|
-
keyTest: (event:
|
|
134
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
114
135
|
} & {
|
|
115
|
-
keyTest?: ((event:
|
|
136
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
116
137
|
};
|
|
@@ -5,18 +5,16 @@ export declare const actionSendBackward: {
|
|
|
5
5
|
category: "element";
|
|
6
6
|
};
|
|
7
7
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
8
|
-
elements:
|
|
8
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
9
9
|
appState: Readonly<import("../types").AppState>;
|
|
10
10
|
commitToHistory: true;
|
|
11
11
|
};
|
|
12
12
|
contextItemLabel: string;
|
|
13
13
|
keyPriority: number;
|
|
14
|
-
keyTest: (event:
|
|
15
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
16
|
-
isInHamburgerMenu: boolean;
|
|
17
|
-
}) => JSX.Element;
|
|
14
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
15
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
18
16
|
} & {
|
|
19
|
-
keyTest?: ((event:
|
|
17
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
20
18
|
};
|
|
21
19
|
export declare const actionBringForward: {
|
|
22
20
|
name: "bringForward";
|
|
@@ -24,18 +22,16 @@ export declare const actionBringForward: {
|
|
|
24
22
|
category: "element";
|
|
25
23
|
};
|
|
26
24
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
27
|
-
elements:
|
|
25
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
28
26
|
appState: Readonly<import("../types").AppState>;
|
|
29
27
|
commitToHistory: true;
|
|
30
28
|
};
|
|
31
29
|
contextItemLabel: string;
|
|
32
30
|
keyPriority: number;
|
|
33
|
-
keyTest: (event:
|
|
34
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
35
|
-
isInHamburgerMenu: boolean;
|
|
36
|
-
}) => JSX.Element;
|
|
31
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
32
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
37
33
|
} & {
|
|
38
|
-
keyTest?: ((event:
|
|
34
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
39
35
|
};
|
|
40
36
|
export declare const actionSendToBack: {
|
|
41
37
|
name: "sendToBack";
|
|
@@ -43,17 +39,15 @@ export declare const actionSendToBack: {
|
|
|
43
39
|
category: "element";
|
|
44
40
|
};
|
|
45
41
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
46
|
-
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
42
|
+
elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
|
|
47
43
|
appState: Readonly<import("../types").AppState>;
|
|
48
44
|
commitToHistory: true;
|
|
49
45
|
};
|
|
50
46
|
contextItemLabel: string;
|
|
51
|
-
keyTest: (event:
|
|
52
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
53
|
-
isInHamburgerMenu: boolean;
|
|
54
|
-
}) => JSX.Element;
|
|
47
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
48
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
55
49
|
} & {
|
|
56
|
-
keyTest?: ((event:
|
|
50
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
57
51
|
};
|
|
58
52
|
export declare const actionBringToFront: {
|
|
59
53
|
name: "bringToFront";
|
|
@@ -61,15 +55,13 @@ export declare const actionBringToFront: {
|
|
|
61
55
|
category: "element";
|
|
62
56
|
};
|
|
63
57
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
64
|
-
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
58
|
+
elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
|
|
65
59
|
appState: Readonly<import("../types").AppState>;
|
|
66
60
|
commitToHistory: true;
|
|
67
61
|
};
|
|
68
62
|
contextItemLabel: string;
|
|
69
|
-
keyTest: (event:
|
|
70
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
71
|
-
isInHamburgerMenu: boolean;
|
|
72
|
-
}) => JSX.Element;
|
|
63
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
64
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
73
65
|
} & {
|
|
74
|
-
keyTest?: ((event:
|
|
66
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
75
67
|
};
|
package/types/actions/index.d.ts
CHANGED
|
@@ -17,8 +17,9 @@ export { actionFlipHorizontal, actionFlipVertical } from "./actionFlip";
|
|
|
17
17
|
export { actionCopy, actionCut, actionCopyAsPng, actionCopyAsSvg, copyText, } from "./actionClipboard";
|
|
18
18
|
export { actionToggleGridMode } from "./actionToggleGridMode";
|
|
19
19
|
export { actionToggleZenMode } from "./actionToggleZenMode";
|
|
20
|
+
export { actionToggleObjectsSnapMode } from "./actionToggleObjectsSnapMode";
|
|
20
21
|
export { actionToggleStats } from "./actionToggleStats";
|
|
21
22
|
export { actionUnbindText, actionBindText } from "./actionBoundText";
|
|
22
23
|
export { actionLink } from "../element/Hyperlink";
|
|
23
|
-
export {
|
|
24
|
+
export { actionToggleElementLock } from "./actionElementLock";
|
|
24
25
|
export { actionToggleLinearEditor } from "./actionLinearEditor";
|
|
@@ -12,9 +12,10 @@ export declare class ActionManager {
|
|
|
12
12
|
registerAction(action: Action): void;
|
|
13
13
|
registerAll(actions: readonly Action[]): void;
|
|
14
14
|
handleKeyDown(event: React.KeyboardEvent | KeyboardEvent): boolean;
|
|
15
|
-
executeAction(action: Action, source?: ActionSource): void;
|
|
15
|
+
executeAction(action: Action, source?: ActionSource, value?: any): void;
|
|
16
16
|
/**
|
|
17
17
|
* @param data additional data sent to the PanelComponent
|
|
18
18
|
*/
|
|
19
|
-
renderAction: (name: ActionName, data?: PanelComponentProps["data"]
|
|
19
|
+
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => JSX.Element | null;
|
|
20
|
+
isActionEnabled: (action: Action) => boolean;
|
|
20
21
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SubtypeOf } from "../utility-types";
|
|
1
2
|
import { ActionName } from "./types";
|
|
2
|
-
export
|
|
3
|
+
export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock"> | "saveScene" | "imageExport";
|
|
3
4
|
export declare const getShortcutFromShortcutName: (name: ShortcutName) => string;
|
package/types/actions/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ExcalidrawElement } from "../element/types";
|
|
3
3
|
import { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles } from "../types";
|
|
4
|
-
|
|
4
|
+
import { MarkOptional } from "../utility-types";
|
|
5
|
+
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api";
|
|
5
6
|
/** if false, the action should be prevented */
|
|
6
|
-
export
|
|
7
|
+
export type ActionResult = {
|
|
7
8
|
elements?: readonly ExcalidrawElement[] | null;
|
|
8
9
|
appState?: MarkOptional<AppState, "offsetTop" | "offsetLeft" | "width" | "height"> | null;
|
|
9
10
|
files?: BinaryFiles | null;
|
|
@@ -11,32 +12,34 @@ export declare type ActionResult = {
|
|
|
11
12
|
syncHistory?: boolean;
|
|
12
13
|
replaceFiles?: boolean;
|
|
13
14
|
} | false;
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
15
|
+
type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
16
|
+
export type UpdaterFn = (res: ActionResult) => void;
|
|
17
|
+
export type ActionFilterFn = (action: Action) => void;
|
|
18
|
+
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" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "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";
|
|
19
|
+
export type PanelComponentProps = {
|
|
19
20
|
elements: readonly ExcalidrawElement[];
|
|
20
21
|
appState: AppState;
|
|
21
22
|
updateData: (formData?: any) => void;
|
|
22
23
|
appProps: ExcalidrawProps;
|
|
23
24
|
data?: Record<string, any>;
|
|
25
|
+
app: AppClassProperties;
|
|
24
26
|
};
|
|
25
27
|
export interface Action {
|
|
26
28
|
name: ActionName;
|
|
27
|
-
PanelComponent?: React.FC<PanelComponentProps
|
|
28
|
-
isInHamburgerMenu: boolean;
|
|
29
|
-
}>;
|
|
29
|
+
PanelComponent?: React.FC<PanelComponentProps>;
|
|
30
30
|
perform: ActionFn;
|
|
31
31
|
keyPriority?: number;
|
|
32
|
-
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
|
|
33
|
-
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState
|
|
34
|
-
|
|
32
|
+
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean;
|
|
33
|
+
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, app: AppClassProperties) => string);
|
|
34
|
+
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
35
35
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
36
36
|
trackEvent: false | {
|
|
37
37
|
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink";
|
|
38
38
|
action?: string;
|
|
39
39
|
predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
|
|
40
40
|
};
|
|
41
|
+
/** if set to `true`, allow action to be performed in viewMode.
|
|
42
|
+
* Defaults to `false` */
|
|
43
|
+
viewMode?: boolean;
|
|
41
44
|
}
|
|
42
45
|
export {};
|