@dwelle/excalidraw 0.4.0-9db4535 → 0.4.0-9fa56da
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 +255 -1
- package/README.md +4 -0
- 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 +2123 -1783
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +7 -2
- package/types/actions/actionAddToLibrary.d.ts +84 -43
- package/types/actions/actionAlign.d.ts +33 -28
- package/types/actions/actionBoundText.d.ts +60 -32
- package/types/actions/actionCanvas.d.ts +436 -164
- package/types/actions/actionClipboard.d.ts +140 -74
- package/types/actions/actionDeleteSelected.d.ts +80 -42
- package/types/actions/actionDistribute.d.ts +11 -12
- package/types/actions/actionDuplicateSelection.d.ts +2 -3
- package/types/actions/actionElementLock.d.ts +58 -30
- package/types/actions/actionExport.d.ts +303 -177
- package/types/actions/actionFinalize.d.ts +56 -32
- package/types/actions/actionFlip.d.ts +8 -9
- package/types/actions/actionFrame.d.ts +423 -0
- package/types/actions/actionGroup.d.ts +250 -13
- package/types/actions/actionLinearEditor.d.ts +30 -17
- package/types/actions/actionMenu.d.ts +87 -47
- package/types/actions/actionNavigate.d.ts +1 -1
- package/types/actions/actionProperties.d.ts +370 -187
- package/types/actions/actionSelectAll.d.ts +123 -4
- package/types/actions/actionStyles.d.ts +32 -19
- package/types/actions/actionToggleGridMode.d.ts +30 -17
- package/types/actions/actionToggleObjectsSnapMode.d.ts +137 -0
- package/types/actions/actionToggleStats.d.ts +30 -17
- package/types/actions/actionToggleViewMode.d.ts +30 -17
- package/types/actions/actionToggleZenMode.d.ts +30 -17
- package/types/actions/actionZindex.d.ts +12 -12
- package/types/actions/index.d.ts +1 -0
- package/types/actions/shortcuts.d.ts +1 -1
- package/types/actions/types.d.ts +4 -3
- package/types/appState.d.ts +10 -15
- package/types/clients.d.ts +1 -5
- package/types/clipboard.d.ts +1 -0
- package/types/colors.d.ts +9 -9
- package/types/components/Actions.d.ts +4 -5
- package/types/components/App.d.ts +61 -28
- package/types/components/Avatar.d.ts +0 -1
- package/types/components/Button.d.ts +0 -1
- package/types/components/Card.d.ts +0 -1
- package/types/components/ColorPicker/ColorInput.d.ts +3 -1
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/types/components/DefaultSidebar.d.ts +0 -1
- package/types/components/Dialog.d.ts +2 -1
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +18 -8
- package/types/components/FilledButton.d.ts +2 -1
- package/types/components/HintViewer.d.ts +3 -4
- package/types/components/JSONExportDialog.d.ts +1 -1
- 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 +6 -2
- package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
- package/types/components/LibraryUnit.d.ts +0 -1
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/MobileMenu.d.ts +4 -3
- 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/Section.d.ts +1 -1
- package/types/components/Sidebar/Sidebar.d.ts +1 -1
- package/types/components/Sidebar/SidebarTab.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
- package/types/components/Stack.d.ts +2 -2
- package/types/components/ToolButton.d.ts +2 -1
- package/types/components/Trans.d.ts +2 -1
- 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 +9 -5
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -2
- package/types/components/dropdownMenu/common.d.ts +1 -1
- package/types/components/icons.d.ts +6 -0
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
- package/types/components/main-menu/MainMenu.d.ts +9 -5
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
- package/types/constants.d.ts +35 -3
- package/types/context/tunnels.d.ts +1 -0
- package/types/data/transform.d.ts +71 -0
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +40 -23
- package/types/element/binding.d.ts +2 -1
- package/types/element/bounds.d.ts +30 -6
- 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/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +33 -20
- package/types/element/newElement.d.ts +15 -6
- package/types/element/resizeElements.d.ts +2 -2
- package/types/element/sizeHelpers.d.ts +8 -1
- package/types/element/textElement.d.ts +5 -7
- package/types/element/textWysiwyg.d.ts +1 -1
- package/types/element/transformHandles.d.ts +10 -3
- package/types/element/typeChecks.d.ts +3 -1
- package/types/element/types.d.ts +19 -3
- package/types/frame.d.ts +40 -0
- package/types/groups.d.ts +15 -11
- package/types/history.d.ts +3 -3
- package/types/hooks/useOutsideClick.d.ts +0 -1
- package/types/hooks/useScrollPosition.d.ts +0 -1
- package/types/hooks/useStable.d.ts +1 -0
- package/types/i18n.d.ts +5 -2
- package/types/keys.d.ts +4 -0
- package/types/math.d.ts +3 -0
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.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 +4 -1
- package/types/renderer/renderElement.d.ts +11 -22
- package/types/renderer/renderScene.d.ts +19 -27
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +23 -1
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/export.d.ts +35 -9
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +26 -5
- package/types/scene/types.d.ts +66 -31
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +130 -25
- package/types/utility-types.d.ts +3 -1
- package/types/utils.d.ts +60 -23
- package/types/zindex.d.ts +4 -4
- /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,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleViewMode: {
|
|
3
2
|
name: "viewMode";
|
|
4
3
|
viewMode: true;
|
|
@@ -17,6 +16,10 @@ export declare const actionToggleViewMode: {
|
|
|
17
16
|
showWelcomeScreen: boolean;
|
|
18
17
|
isLoading: boolean;
|
|
19
18
|
errorMessage: import("react").ReactNode;
|
|
19
|
+
activeEmbeddable: {
|
|
20
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
21
|
+
state: "active" | "hover";
|
|
22
|
+
} | null;
|
|
20
23
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
24
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
25
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -24,18 +27,21 @@ export declare const actionToggleViewMode: {
|
|
|
24
27
|
isBindingEnabled: boolean;
|
|
25
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
26
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;
|
|
27
39
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
28
40
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
29
41
|
activeTool: {
|
|
30
|
-
lastActiveTool: import("../types").
|
|
42
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
31
43
|
locked: boolean;
|
|
32
|
-
} & (
|
|
33
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
34
|
-
customType: null;
|
|
35
|
-
} | {
|
|
36
|
-
type: "custom";
|
|
37
|
-
customType: string;
|
|
38
|
-
});
|
|
44
|
+
} & import("../types").ActiveTool;
|
|
39
45
|
penMode: boolean;
|
|
40
46
|
penDetected: boolean;
|
|
41
47
|
exportBackground: boolean;
|
|
@@ -75,12 +81,13 @@ export declare const actionToggleViewMode: {
|
|
|
75
81
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
76
82
|
defaultSidebarDockedPreference: boolean;
|
|
77
83
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
78
|
-
selectedElementIds: {
|
|
79
|
-
[id: string]:
|
|
80
|
-
}
|
|
84
|
+
selectedElementIds: Readonly<{
|
|
85
|
+
[id: string]: true;
|
|
86
|
+
}>;
|
|
81
87
|
previousSelectedElementIds: {
|
|
82
|
-
[id: string]:
|
|
88
|
+
[id: string]: true;
|
|
83
89
|
};
|
|
90
|
+
selectedElementsAreBeingDragged: boolean;
|
|
84
91
|
shouldCacheIgnoreZoom: boolean;
|
|
85
92
|
toast: {
|
|
86
93
|
message: string;
|
|
@@ -88,7 +95,7 @@ export declare const actionToggleViewMode: {
|
|
|
88
95
|
duration?: number | undefined;
|
|
89
96
|
} | null;
|
|
90
97
|
zenModeEnabled: boolean;
|
|
91
|
-
theme:
|
|
98
|
+
theme: import("../element/types").Theme;
|
|
92
99
|
gridSize: number | null;
|
|
93
100
|
selectedGroupIds: {
|
|
94
101
|
[groupId: string]: boolean;
|
|
@@ -110,15 +117,21 @@ export declare const actionToggleViewMode: {
|
|
|
110
117
|
data: import("../charts").Spreadsheet;
|
|
111
118
|
};
|
|
112
119
|
pendingImageElementId: string | null;
|
|
113
|
-
showHyperlinkPopup: false | "
|
|
120
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
114
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;
|
|
115
128
|
};
|
|
116
129
|
commitToHistory: false;
|
|
117
130
|
};
|
|
118
131
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
119
132
|
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
120
133
|
contextItemLabel: string;
|
|
121
|
-
keyTest: (event:
|
|
134
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
122
135
|
} & {
|
|
123
|
-
keyTest?: ((event:
|
|
136
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
124
137
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleZenMode: {
|
|
3
2
|
name: "zenMode";
|
|
4
3
|
viewMode: true;
|
|
@@ -17,6 +16,10 @@ export declare const actionToggleZenMode: {
|
|
|
17
16
|
showWelcomeScreen: boolean;
|
|
18
17
|
isLoading: boolean;
|
|
19
18
|
errorMessage: import("react").ReactNode;
|
|
19
|
+
activeEmbeddable: {
|
|
20
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
21
|
+
state: "active" | "hover";
|
|
22
|
+
} | null;
|
|
20
23
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
24
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
25
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -24,18 +27,21 @@ export declare const actionToggleZenMode: {
|
|
|
24
27
|
isBindingEnabled: boolean;
|
|
25
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
26
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;
|
|
27
39
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
28
40
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
29
41
|
activeTool: {
|
|
30
|
-
lastActiveTool: import("../types").
|
|
42
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
31
43
|
locked: boolean;
|
|
32
|
-
} & (
|
|
33
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
34
|
-
customType: null;
|
|
35
|
-
} | {
|
|
36
|
-
type: "custom";
|
|
37
|
-
customType: string;
|
|
38
|
-
});
|
|
44
|
+
} & import("../types").ActiveTool;
|
|
39
45
|
penMode: boolean;
|
|
40
46
|
penDetected: boolean;
|
|
41
47
|
exportBackground: boolean;
|
|
@@ -75,19 +81,20 @@ export declare const actionToggleZenMode: {
|
|
|
75
81
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
76
82
|
defaultSidebarDockedPreference: boolean;
|
|
77
83
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
78
|
-
selectedElementIds: {
|
|
79
|
-
[id: string]:
|
|
80
|
-
}
|
|
84
|
+
selectedElementIds: Readonly<{
|
|
85
|
+
[id: string]: true;
|
|
86
|
+
}>;
|
|
81
87
|
previousSelectedElementIds: {
|
|
82
|
-
[id: string]:
|
|
88
|
+
[id: string]: true;
|
|
83
89
|
};
|
|
90
|
+
selectedElementsAreBeingDragged: boolean;
|
|
84
91
|
shouldCacheIgnoreZoom: boolean;
|
|
85
92
|
toast: {
|
|
86
93
|
message: string;
|
|
87
94
|
closable?: boolean | undefined;
|
|
88
95
|
duration?: number | undefined;
|
|
89
96
|
} | null;
|
|
90
|
-
theme:
|
|
97
|
+
theme: import("../element/types").Theme;
|
|
91
98
|
gridSize: number | null;
|
|
92
99
|
viewModeEnabled: boolean;
|
|
93
100
|
selectedGroupIds: {
|
|
@@ -110,15 +117,21 @@ export declare const actionToggleZenMode: {
|
|
|
110
117
|
data: import("../charts").Spreadsheet;
|
|
111
118
|
};
|
|
112
119
|
pendingImageElementId: string | null;
|
|
113
|
-
showHyperlinkPopup: false | "
|
|
120
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
114
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;
|
|
115
128
|
};
|
|
116
129
|
commitToHistory: false;
|
|
117
130
|
};
|
|
118
131
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
119
132
|
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
120
133
|
contextItemLabel: string;
|
|
121
|
-
keyTest: (event:
|
|
134
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
122
135
|
} & {
|
|
123
|
-
keyTest?: ((event:
|
|
136
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
124
137
|
};
|
|
@@ -5,16 +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:
|
|
14
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
15
15
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
16
16
|
} & {
|
|
17
|
-
keyTest?: ((event:
|
|
17
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
18
18
|
};
|
|
19
19
|
export declare const actionBringForward: {
|
|
20
20
|
name: "bringForward";
|
|
@@ -22,16 +22,16 @@ export declare const actionBringForward: {
|
|
|
22
22
|
category: "element";
|
|
23
23
|
};
|
|
24
24
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
25
|
-
elements:
|
|
25
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
26
26
|
appState: Readonly<import("../types").AppState>;
|
|
27
27
|
commitToHistory: true;
|
|
28
28
|
};
|
|
29
29
|
contextItemLabel: string;
|
|
30
30
|
keyPriority: number;
|
|
31
|
-
keyTest: (event:
|
|
31
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
32
32
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
33
33
|
} & {
|
|
34
|
-
keyTest?: ((event:
|
|
34
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
35
35
|
};
|
|
36
36
|
export declare const actionSendToBack: {
|
|
37
37
|
name: "sendToBack";
|
|
@@ -39,15 +39,15 @@ export declare const actionSendToBack: {
|
|
|
39
39
|
category: "element";
|
|
40
40
|
};
|
|
41
41
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
42
|
-
elements:
|
|
42
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
43
43
|
appState: Readonly<import("../types").AppState>;
|
|
44
44
|
commitToHistory: true;
|
|
45
45
|
};
|
|
46
46
|
contextItemLabel: string;
|
|
47
|
-
keyTest: (event:
|
|
47
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
48
48
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
49
49
|
} & {
|
|
50
|
-
keyTest?: ((event:
|
|
50
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
51
51
|
};
|
|
52
52
|
export declare const actionBringToFront: {
|
|
53
53
|
name: "bringToFront";
|
|
@@ -55,13 +55,13 @@ export declare const actionBringToFront: {
|
|
|
55
55
|
category: "element";
|
|
56
56
|
};
|
|
57
57
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
58
|
-
elements:
|
|
58
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
59
59
|
appState: Readonly<import("../types").AppState>;
|
|
60
60
|
commitToHistory: true;
|
|
61
61
|
};
|
|
62
62
|
contextItemLabel: string;
|
|
63
|
-
keyTest: (event:
|
|
63
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
64
64
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
65
65
|
} & {
|
|
66
|
-
keyTest?: ((event:
|
|
66
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
67
67
|
};
|
package/types/actions/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ 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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SubtypeOf } from "../utility-types";
|
|
2
2
|
import { ActionName } from "./types";
|
|
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" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock"> | "saveScene" | "imageExport";
|
|
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";
|
|
4
4
|
export declare const getShortcutFromShortcutName: (name: ShortcutName) => string;
|
package/types/actions/types.d.ts
CHANGED
|
@@ -15,21 +15,22 @@ export type ActionResult = {
|
|
|
15
15
|
type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
16
16
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
17
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" | "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" | "
|
|
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
19
|
export type PanelComponentProps = {
|
|
20
20
|
elements: readonly ExcalidrawElement[];
|
|
21
21
|
appState: AppState;
|
|
22
22
|
updateData: (formData?: any) => void;
|
|
23
23
|
appProps: ExcalidrawProps;
|
|
24
24
|
data?: Record<string, any>;
|
|
25
|
+
app: AppClassProperties;
|
|
25
26
|
};
|
|
26
27
|
export interface Action {
|
|
27
28
|
name: ActionName;
|
|
28
29
|
PanelComponent?: React.FC<PanelComponentProps>;
|
|
29
30
|
perform: ActionFn;
|
|
30
31
|
keyPriority?: number;
|
|
31
|
-
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
|
|
32
|
-
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState
|
|
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);
|
|
33
34
|
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
34
35
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
35
36
|
trackEvent: false | {
|
package/types/appState.d.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { AppState } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
|
-
theme?: string | undefined;
|
|
5
|
-
name?: string | undefined;
|
|
6
4
|
activeTool?: ({
|
|
7
|
-
lastActiveTool: import("./types").
|
|
5
|
+
lastActiveTool: import("./types").ActiveTool | null;
|
|
8
6
|
locked: boolean;
|
|
9
|
-
} & (
|
|
10
|
-
|
|
11
|
-
customType: null;
|
|
12
|
-
} | {
|
|
13
|
-
type: "custom";
|
|
14
|
-
customType: string;
|
|
15
|
-
})) | undefined;
|
|
16
|
-
showWelcomeScreen?: boolean | undefined;
|
|
7
|
+
} & import("./types").ActiveTool) | undefined;
|
|
8
|
+
name?: string | undefined;
|
|
17
9
|
penMode?: boolean | undefined;
|
|
10
|
+
showWelcomeScreen?: boolean | undefined;
|
|
18
11
|
penDetected?: boolean | undefined;
|
|
19
12
|
exportBackground?: boolean | undefined;
|
|
20
13
|
exportEmbedScene?: boolean | undefined;
|
|
@@ -48,14 +41,15 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
48
41
|
} | null | undefined;
|
|
49
42
|
defaultSidebarDockedPreference?: boolean | undefined;
|
|
50
43
|
lastPointerDownWith?: import("./element/types").PointerType | undefined;
|
|
51
|
-
selectedElementIds?: {
|
|
52
|
-
[id: string]:
|
|
53
|
-
} | undefined;
|
|
44
|
+
selectedElementIds?: Readonly<{
|
|
45
|
+
[id: string]: true;
|
|
46
|
+
}> | undefined;
|
|
54
47
|
previousSelectedElementIds?: {
|
|
55
|
-
[id: string]:
|
|
48
|
+
[id: string]: true;
|
|
56
49
|
} | undefined;
|
|
57
50
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
58
51
|
zenModeEnabled?: boolean | undefined;
|
|
52
|
+
theme?: import("./element/types").Theme | undefined;
|
|
59
53
|
gridSize?: number | null | undefined;
|
|
60
54
|
selectedGroupIds?: {
|
|
61
55
|
[groupId: string]: boolean;
|
|
@@ -64,6 +58,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
64
58
|
showStats?: boolean | undefined;
|
|
65
59
|
currentChartType?: import("./element/types").ChartType | undefined;
|
|
66
60
|
selectedLinearElement?: import("./element/linearElementEditor").LinearElementEditor | null | undefined;
|
|
61
|
+
objectsSnapModeEnabled?: boolean | undefined;
|
|
67
62
|
};
|
|
68
63
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
69
64
|
viewBackgroundColor?: string | undefined;
|
package/types/clients.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const getClientColors: (clientId: string, appState: AppState) => {
|
|
3
|
-
background: string;
|
|
4
|
-
stroke: string;
|
|
5
|
-
};
|
|
1
|
+
export declare const getClientColor: (id: string) => string;
|
|
6
2
|
/**
|
|
7
3
|
* returns first char, capitalized
|
|
8
4
|
*/
|
package/types/clipboard.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface ClipboardData {
|
|
|
7
7
|
files?: BinaryFiles;
|
|
8
8
|
text?: string;
|
|
9
9
|
errorMessage?: string;
|
|
10
|
+
programmaticAPI?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare const probablySupportsClipboardReadText: boolean;
|
|
12
13
|
export declare const probablySupportsClipboardWriteText: boolean;
|
package/types/colors.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Merge } from "./utility-types";
|
|
|
3
3
|
export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
|
|
4
4
|
export type ColorTuple = readonly [string, string, string, string, string];
|
|
5
5
|
export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
|
|
6
|
-
black:
|
|
7
|
-
white:
|
|
8
|
-
transparent:
|
|
6
|
+
black: "#1e1e1e";
|
|
7
|
+
white: "#ffffff";
|
|
8
|
+
transparent: "transparent";
|
|
9
9
|
}>;
|
|
10
10
|
export type ColorPaletteCustom = {
|
|
11
11
|
[key: string]: ColorTuple | string;
|
|
@@ -34,10 +34,10 @@ export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
|
|
|
34
34
|
readonly green: ColorTuple;
|
|
35
35
|
readonly yellow: ColorTuple;
|
|
36
36
|
readonly orange: ColorTuple;
|
|
37
|
-
readonly transparent:
|
|
38
|
-
readonly white:
|
|
37
|
+
readonly transparent: "transparent";
|
|
38
|
+
readonly white: "#ffffff";
|
|
39
39
|
readonly gray: ColorTuple;
|
|
40
|
-
readonly black:
|
|
40
|
+
readonly black: "#1e1e1e";
|
|
41
41
|
readonly bronze: ColorTuple;
|
|
42
42
|
};
|
|
43
43
|
export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
@@ -51,10 +51,10 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
|
51
51
|
readonly green: ColorTuple;
|
|
52
52
|
readonly yellow: ColorTuple;
|
|
53
53
|
readonly orange: ColorTuple;
|
|
54
|
-
readonly transparent:
|
|
55
|
-
readonly white:
|
|
54
|
+
readonly transparent: "transparent";
|
|
55
|
+
readonly white: "#ffffff";
|
|
56
56
|
readonly gray: ColorTuple;
|
|
57
|
-
readonly black:
|
|
57
|
+
readonly black: "#1e1e1e";
|
|
58
58
|
readonly bronze: ColorTuple;
|
|
59
59
|
};
|
|
60
60
|
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { ActionManager } from "../actions/manager";
|
|
3
2
|
import { ExcalidrawElement, PointerType } from "../element/types";
|
|
4
|
-
import { UIAppState, Zoom } from "../types";
|
|
3
|
+
import { AppClassProperties, UIAppState, Zoom } from "../types";
|
|
5
4
|
import "./Actions.scss";
|
|
6
5
|
export declare const SelectedShapeActions: ({ appState, elements, renderAction, }: {
|
|
7
6
|
appState: UIAppState;
|
|
8
7
|
elements: readonly ExcalidrawElement[];
|
|
9
8
|
renderAction: ActionManager["renderAction"];
|
|
10
9
|
}) => JSX.Element;
|
|
11
|
-
export declare const ShapesSwitcher: ({
|
|
12
|
-
|
|
10
|
+
export declare const ShapesSwitcher: ({ interactiveCanvas, activeTool, onImageAction, appState, app, }: {
|
|
11
|
+
interactiveCanvas: HTMLCanvasElement | null;
|
|
13
12
|
activeTool: UIAppState["activeTool"];
|
|
14
|
-
setAppState: React.Component<any, UIAppState>["setState"];
|
|
15
13
|
onImageAction: (data: {
|
|
16
14
|
pointerType: PointerType | null;
|
|
17
15
|
}) => void;
|
|
18
16
|
appState: UIAppState;
|
|
17
|
+
app: AppClassProperties;
|
|
19
18
|
}) => JSX.Element;
|
|
20
19
|
export declare const ZoomActions: ({ renderAction, zoom, }: {
|
|
21
20
|
renderAction: ActionManager["renderAction"];
|