@dwelle/excalidraw 0.4.0-d68dd48 → 0.4.0-e03b600
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 +30 -0
- package/README.md +4 -0
- package/dist/excalidraw.development.js +1314 -248
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +2 -2
- package/types/actions/actionAddToLibrary.d.ts +36 -12
- package/types/actions/actionAlign.d.ts +6 -0
- package/types/actions/actionBoundText.d.ts +24 -8
- package/types/actions/actionCanvas.d.ts +235 -41
- package/types/actions/actionClipboard.d.ts +60 -20
- package/types/actions/actionDeleteSelected.d.ts +36 -12
- package/types/actions/actionElementLock.d.ts +254 -0
- package/types/actions/actionExport.d.ts +109 -37
- package/types/actions/actionFinalize.d.ts +24 -8
- package/types/actions/actionFlip.d.ts +2 -4
- package/types/actions/actionFrame.d.ts +397 -0
- package/types/actions/actionGroup.d.ts +2 -2
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +12 -4
- package/types/actions/actionMenu.d.ts +37 -14
- package/types/actions/actionNavigate.d.ts +1 -1
- package/types/actions/actionProperties.d.ts +158 -54
- package/types/actions/actionStyles.d.ts +12 -4
- package/types/actions/actionToggleGridMode.d.ts +12 -4
- package/types/actions/actionToggleStats.d.ts +12 -4
- package/types/actions/actionToggleViewMode.d.ts +12 -4
- package/types/actions/actionToggleZenMode.d.ts +12 -4
- package/types/actions/actionZindex.d.ts +4 -4
- package/types/actions/index.d.ts +1 -1
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +1 -1
- package/types/actions/types.d.ts +7 -7
- package/types/appState.d.ts +6 -3
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +2 -2
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +5 -5
- package/types/components/ActiveConfirmDialog.d.ts +1 -21
- package/types/components/App.d.ts +32 -9
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/Button.d.ts +3 -1
- package/types/components/ColorPicker/ColorInput.d.ts +7 -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 +21 -0
- package/types/components/ContextMenu.d.ts +3 -3
- package/types/components/DefaultSidebar.d.ts +30 -0
- package/types/components/Dialog.d.ts +3 -4
- package/types/components/EyeDropper.d.ts +18 -0
- package/types/components/FilledButton.d.ts +17 -0
- package/types/components/FixedSideContainer.d.ts +1 -1
- package/types/components/HandButton.d.ts +1 -1
- package/types/components/HelpButton.d.ts +1 -1
- package/types/components/HintViewer.d.ts +2 -2
- 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 +4 -4
- package/types/components/LayerUI.d.ts +4 -10
- 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 +11 -28
- package/types/components/LibraryMenuItems.d.ts +6 -7
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +7 -3
- package/types/components/LockButton.d.ts +1 -1
- package/types/components/MobileMenu.d.ts +4 -4
- 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/Sidebar/Sidebar.d.ts +66 -63
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +10 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +7 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +7 -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 +5 -4
- package/types/components/Tooltip.d.ts +1 -1
- package/types/components/Trans.d.ts +8 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +3 -2
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +4 -2
- package/types/components/footer/Footer.d.ts +2 -2
- package/types/components/icons.d.ts +11 -1
- package/types/components/main-menu/MainMenu.d.ts +3 -2
- package/types/constants.d.ts +42 -6
- package/types/context/tunnels.d.ts +19 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/data/blob.d.ts +2 -2
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +2 -2
- package/types/data/types.d.ts +3 -5
- package/types/element/Hyperlink.d.ts +14 -6
- package/types/element/binding.d.ts +3 -3
- package/types/element/bounds.d.ts +31 -6
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +2 -1
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +13 -5
- package/types/element/mutateElement.d.ts +1 -1
- package/types/element/newElement.d.ts +10 -3
- package/types/element/resizeElements.d.ts +1 -0
- package/types/element/showSelectedShapeActions.d.ts +2 -2
- package/types/element/textElement.d.ts +3 -2
- package/types/element/transformHandles.d.ts +12 -5
- package/types/element/typeChecks.d.ts +2 -1
- package/types/element/types.d.ts +40 -35
- package/types/emitter.d.ts +1 -1
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +40 -0
- package/types/ga.d.ts +5 -5
- package/types/groups.d.ts +4 -0
- package/types/hooks/useCreatePortalContainer.d.ts +4 -0
- package/types/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/hooks/useOutsideClick.d.ts +19 -1
- package/types/hooks/useScrollPosition.d.ts +2 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +2 -2
- package/types/jotai.d.ts +16 -104
- package/types/keys.d.ts +2 -1
- package/types/math.d.ts +1 -0
- package/types/packages/excalidraw/example/initialData.d.ts +6 -0
- package/types/packages/excalidraw/index.d.ts +2 -1
- package/types/packages/utils.d.ts +2 -2
- package/types/renderer/renderElement.d.ts +4 -3
- package/types/renderer/renderScene.d.ts +12 -3
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Scene.d.ts +12 -5
- package/types/scene/export.d.ts +3 -2
- package/types/scene/selection.d.ts +15 -5
- package/types/scene/types.d.ts +4 -4
- package/types/types.d.ts +91 -52
- package/types/utility-types.d.ts +13 -13
- package/types/utils.d.ts +20 -25
- package/types/zindex.d.ts +4 -4
- package/types/actions/actionToggleLock.d.ts +0 -119
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/context/tunnels.d.ts +0 -16
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
|
@@ -25,13 +25,17 @@ export declare const actionToggleGridMode: {
|
|
|
25
25
|
isBindingEnabled: boolean;
|
|
26
26
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
27
27
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
28
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
29
|
+
shouldRenderFrames: boolean;
|
|
30
|
+
editingFrame: string | null;
|
|
31
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
28
32
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
29
33
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
30
34
|
activeTool: {
|
|
31
35
|
lastActiveTool: import("../types").LastActiveTool;
|
|
32
36
|
locked: boolean;
|
|
33
37
|
} & ({
|
|
34
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
38
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
35
39
|
customType: null;
|
|
36
40
|
} | {
|
|
37
41
|
type: "custom";
|
|
@@ -68,10 +72,13 @@ export declare const actionToggleGridMode: {
|
|
|
68
72
|
value: import("../types").NormalizedZoomValue;
|
|
69
73
|
}>;
|
|
70
74
|
openMenu: "canvas" | "shape" | null;
|
|
71
|
-
openPopup: "
|
|
72
|
-
openSidebar:
|
|
75
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
76
|
+
openSidebar: {
|
|
77
|
+
name: string;
|
|
78
|
+
tab?: string | undefined;
|
|
79
|
+
} | null;
|
|
73
80
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
74
|
-
|
|
81
|
+
defaultSidebarDockedPreference: boolean;
|
|
75
82
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
76
83
|
selectedElementIds: {
|
|
77
84
|
[id: string]: boolean;
|
|
@@ -79,6 +86,7 @@ export declare const actionToggleGridMode: {
|
|
|
79
86
|
previousSelectedElementIds: {
|
|
80
87
|
[id: string]: boolean;
|
|
81
88
|
};
|
|
89
|
+
selectedElementsAreBeingDragged: boolean;
|
|
82
90
|
shouldCacheIgnoreZoom: boolean;
|
|
83
91
|
toast: {
|
|
84
92
|
message: string;
|
|
@@ -23,13 +23,17 @@ export declare const actionToggleStats: {
|
|
|
23
23
|
isBindingEnabled: boolean;
|
|
24
24
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
25
25
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
26
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
27
|
+
shouldRenderFrames: boolean;
|
|
28
|
+
editingFrame: string | null;
|
|
29
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
26
30
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
27
31
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
28
32
|
activeTool: {
|
|
29
33
|
lastActiveTool: import("../types").LastActiveTool;
|
|
30
34
|
locked: boolean;
|
|
31
35
|
} & ({
|
|
32
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
36
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
33
37
|
customType: null;
|
|
34
38
|
} | {
|
|
35
39
|
type: "custom";
|
|
@@ -66,10 +70,13 @@ export declare const actionToggleStats: {
|
|
|
66
70
|
value: import("../types").NormalizedZoomValue;
|
|
67
71
|
}>;
|
|
68
72
|
openMenu: "canvas" | "shape" | null;
|
|
69
|
-
openPopup: "
|
|
70
|
-
openSidebar:
|
|
73
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
74
|
+
openSidebar: {
|
|
75
|
+
name: string;
|
|
76
|
+
tab?: string | undefined;
|
|
77
|
+
} | null;
|
|
71
78
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
72
|
-
|
|
79
|
+
defaultSidebarDockedPreference: boolean;
|
|
73
80
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
74
81
|
selectedElementIds: {
|
|
75
82
|
[id: string]: boolean;
|
|
@@ -77,6 +84,7 @@ export declare const actionToggleStats: {
|
|
|
77
84
|
previousSelectedElementIds: {
|
|
78
85
|
[id: string]: boolean;
|
|
79
86
|
};
|
|
87
|
+
selectedElementsAreBeingDragged: boolean;
|
|
80
88
|
shouldCacheIgnoreZoom: boolean;
|
|
81
89
|
toast: {
|
|
82
90
|
message: string;
|
|
@@ -24,13 +24,17 @@ export declare const actionToggleViewMode: {
|
|
|
24
24
|
isBindingEnabled: boolean;
|
|
25
25
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
26
26
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
27
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
28
|
+
shouldRenderFrames: boolean;
|
|
29
|
+
editingFrame: string | null;
|
|
30
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
27
31
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
28
32
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
29
33
|
activeTool: {
|
|
30
34
|
lastActiveTool: import("../types").LastActiveTool;
|
|
31
35
|
locked: boolean;
|
|
32
36
|
} & ({
|
|
33
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
37
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
34
38
|
customType: null;
|
|
35
39
|
} | {
|
|
36
40
|
type: "custom";
|
|
@@ -67,10 +71,13 @@ export declare const actionToggleViewMode: {
|
|
|
67
71
|
value: import("../types").NormalizedZoomValue;
|
|
68
72
|
}>;
|
|
69
73
|
openMenu: "canvas" | "shape" | null;
|
|
70
|
-
openPopup: "
|
|
71
|
-
openSidebar:
|
|
74
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
75
|
+
openSidebar: {
|
|
76
|
+
name: string;
|
|
77
|
+
tab?: string | undefined;
|
|
78
|
+
} | null;
|
|
72
79
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
73
|
-
|
|
80
|
+
defaultSidebarDockedPreference: boolean;
|
|
74
81
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
75
82
|
selectedElementIds: {
|
|
76
83
|
[id: string]: boolean;
|
|
@@ -78,6 +85,7 @@ export declare const actionToggleViewMode: {
|
|
|
78
85
|
previousSelectedElementIds: {
|
|
79
86
|
[id: string]: boolean;
|
|
80
87
|
};
|
|
88
|
+
selectedElementsAreBeingDragged: boolean;
|
|
81
89
|
shouldCacheIgnoreZoom: boolean;
|
|
82
90
|
toast: {
|
|
83
91
|
message: string;
|
|
@@ -24,13 +24,17 @@ export declare const actionToggleZenMode: {
|
|
|
24
24
|
isBindingEnabled: boolean;
|
|
25
25
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
26
26
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
27
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
28
|
+
shouldRenderFrames: boolean;
|
|
29
|
+
editingFrame: string | null;
|
|
30
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
27
31
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
28
32
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
29
33
|
activeTool: {
|
|
30
34
|
lastActiveTool: import("../types").LastActiveTool;
|
|
31
35
|
locked: boolean;
|
|
32
36
|
} & ({
|
|
33
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
37
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
34
38
|
customType: null;
|
|
35
39
|
} | {
|
|
36
40
|
type: "custom";
|
|
@@ -67,10 +71,13 @@ export declare const actionToggleZenMode: {
|
|
|
67
71
|
value: import("../types").NormalizedZoomValue;
|
|
68
72
|
}>;
|
|
69
73
|
openMenu: "canvas" | "shape" | null;
|
|
70
|
-
openPopup: "
|
|
71
|
-
openSidebar:
|
|
74
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
75
|
+
openSidebar: {
|
|
76
|
+
name: string;
|
|
77
|
+
tab?: string | undefined;
|
|
78
|
+
} | null;
|
|
72
79
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
73
|
-
|
|
80
|
+
defaultSidebarDockedPreference: boolean;
|
|
74
81
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
75
82
|
selectedElementIds: {
|
|
76
83
|
[id: string]: boolean;
|
|
@@ -78,6 +85,7 @@ export declare const actionToggleZenMode: {
|
|
|
78
85
|
previousSelectedElementIds: {
|
|
79
86
|
[id: string]: boolean;
|
|
80
87
|
};
|
|
88
|
+
selectedElementsAreBeingDragged: boolean;
|
|
81
89
|
shouldCacheIgnoreZoom: boolean;
|
|
82
90
|
toast: {
|
|
83
91
|
message: string;
|
|
@@ -5,7 +5,7 @@ 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
|
};
|
|
@@ -22,7 +22,7 @@ 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
|
};
|
|
@@ -39,7 +39,7 @@ 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
|
};
|
|
@@ -55,7 +55,7 @@ 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
|
};
|
package/types/actions/index.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ export { actionToggleZenMode } from "./actionToggleZenMode";
|
|
|
20
20
|
export { actionToggleStats } from "./actionToggleStats";
|
|
21
21
|
export { actionUnbindText, actionBindText } from "./actionBoundText";
|
|
22
22
|
export { actionLink } from "../element/Hyperlink";
|
|
23
|
-
export {
|
|
23
|
+
export { actionToggleElementLock } from "./actionElementLock";
|
|
24
24
|
export { actionToggleLinearEditor } from "./actionLinearEditor";
|
|
@@ -12,7 +12,7 @@ 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
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SubtypeOf } from "../utility-types";
|
|
2
2
|
import { ActionName } from "./types";
|
|
3
|
-
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" | "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
|
@@ -2,9 +2,9 @@ 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
|
|
5
|
+
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api";
|
|
6
6
|
/** if false, the action should be prevented */
|
|
7
|
-
export
|
|
7
|
+
export type ActionResult = {
|
|
8
8
|
elements?: readonly ExcalidrawElement[] | null;
|
|
9
9
|
appState?: MarkOptional<AppState, "offsetTop" | "offsetLeft" | "width" | "height"> | null;
|
|
10
10
|
files?: BinaryFiles | null;
|
|
@@ -12,11 +12,11 @@ export declare type ActionResult = {
|
|
|
12
12
|
syncHistory?: boolean;
|
|
13
13
|
replaceFiles?: boolean;
|
|
14
14
|
} | false;
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
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" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "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" | "toggleFrameRendering" | "setFrameAsActiveTool" | "createContainerFromText" | "wrapTextInContainer";
|
|
19
|
+
export type PanelComponentProps = {
|
|
20
20
|
elements: readonly ExcalidrawElement[];
|
|
21
21
|
appState: AppState;
|
|
22
22
|
updateData: (formData?: any) => void;
|
package/types/appState.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
7
7
|
lastActiveTool: import("./types").LastActiveTool;
|
|
8
8
|
locked: boolean;
|
|
9
9
|
} & ({
|
|
10
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
10
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
11
11
|
customType: null;
|
|
12
12
|
} | {
|
|
13
13
|
type: "custom";
|
|
@@ -42,8 +42,11 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
42
42
|
value: import("./types").NormalizedZoomValue;
|
|
43
43
|
}> | undefined;
|
|
44
44
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
45
|
-
openSidebar?:
|
|
46
|
-
|
|
45
|
+
openSidebar?: {
|
|
46
|
+
name: string;
|
|
47
|
+
tab?: string | undefined;
|
|
48
|
+
} | null | undefined;
|
|
49
|
+
defaultSidebarDockedPreference?: boolean | undefined;
|
|
47
50
|
lastPointerDownWith?: import("./element/types").PointerType | undefined;
|
|
48
51
|
selectedElementIds?: {
|
|
49
52
|
[id: string]: boolean;
|
package/types/charts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
-
export
|
|
2
|
+
export type ChartElements = readonly NonDeletedExcalidrawElement[];
|
|
3
3
|
export interface Spreadsheet {
|
|
4
4
|
title: string | null;
|
|
5
5
|
labels: string[] | null;
|
|
@@ -7,7 +7,7 @@ export interface Spreadsheet {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const NOT_SPREADSHEET = "NOT_SPREADSHEET";
|
|
9
9
|
export declare const VALID_SPREADSHEET = "VALID_SPREADSHEET";
|
|
10
|
-
|
|
10
|
+
type ParseSpreadsheetResult = {
|
|
11
11
|
type: typeof NOT_SPREADSHEET;
|
|
12
12
|
reason: string;
|
|
13
13
|
} | {
|
package/types/clients.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const getClientInitials: (userName?: string | null) => string;
|
|
1
|
+
export declare const getClientColor: (id: string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* returns first char, capitalized
|
|
4
|
+
*/
|
|
5
|
+
export declare const getNameInitial: (name?: string | null) => string;
|
package/types/clipboard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
-
import {
|
|
2
|
+
import { BinaryFiles } from "./types";
|
|
3
3
|
import { Spreadsheet } from "./charts";
|
|
4
4
|
export interface ClipboardData {
|
|
5
5
|
spreadsheet?: Spreadsheet;
|
|
@@ -11,7 +11,7 @@ export interface ClipboardData {
|
|
|
11
11
|
export declare const probablySupportsClipboardReadText: boolean;
|
|
12
12
|
export declare const probablySupportsClipboardWriteText: boolean;
|
|
13
13
|
export declare const probablySupportsClipboardBlob: boolean;
|
|
14
|
-
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[],
|
|
14
|
+
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], files: BinaryFiles | null) => Promise<string | undefined>;
|
|
15
15
|
/**
|
|
16
16
|
* Retrieves content from system clipboard (either from ClipboardEvent or
|
|
17
17
|
* via async clipboard API if supported)
|
package/types/colors.d.ts
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import oc from "open-color";
|
|
2
|
+
import { Merge } from "./utility-types";
|
|
3
|
+
export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
|
|
4
|
+
export type ColorTuple = readonly [string, string, string, string, string];
|
|
5
|
+
export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
|
|
6
|
+
black: string;
|
|
7
|
+
white: string;
|
|
8
|
+
transparent: string;
|
|
9
|
+
}>;
|
|
10
|
+
export type ColorPaletteCustom = {
|
|
11
|
+
[key: string]: ColorTuple | string;
|
|
5
12
|
};
|
|
6
|
-
export
|
|
13
|
+
export type ColorShadesIndexes = [number, number, number, number, number];
|
|
14
|
+
export declare const MAX_CUSTOM_COLORS_USED_IN_CANVAS = 5;
|
|
15
|
+
export declare const COLORS_PER_ROW = 5;
|
|
16
|
+
export declare const DEFAULT_CHART_COLOR_INDEX = 4;
|
|
17
|
+
export declare const DEFAULT_ELEMENT_STROKE_COLOR_INDEX = 4;
|
|
18
|
+
export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX = 1;
|
|
19
|
+
export declare const ELEMENTS_PALETTE_SHADE_INDEXES: readonly [0, 2, 4, 6, 8];
|
|
20
|
+
export declare const CANVAS_PALETTE_SHADE_INDEXES: readonly [0, 1, 2, 3, 4];
|
|
21
|
+
export declare const getSpecificColorShades: (color: Exclude<ColorPickerColor, "transparent" | "white" | "black" | "bronze">, indexArr: readonly [number, number, number, number, number]) => ColorTuple;
|
|
22
|
+
export declare const COLOR_PALETTE: ColorPalette;
|
|
23
|
+
export declare const DEFAULT_ELEMENT_STROKE_PICKS: ColorTuple;
|
|
24
|
+
export declare const DEFAULT_ELEMENT_BACKGROUND_PICKS: ColorTuple;
|
|
25
|
+
export declare const DEFAULT_CANVAS_BACKGROUND_PICKS: ColorTuple;
|
|
26
|
+
export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
|
|
27
|
+
readonly red: ColorTuple;
|
|
28
|
+
readonly pink: ColorTuple;
|
|
29
|
+
readonly grape: ColorTuple;
|
|
30
|
+
readonly violet: ColorTuple;
|
|
31
|
+
readonly blue: ColorTuple;
|
|
32
|
+
readonly cyan: ColorTuple;
|
|
33
|
+
readonly teal: ColorTuple;
|
|
34
|
+
readonly green: ColorTuple;
|
|
35
|
+
readonly yellow: ColorTuple;
|
|
36
|
+
readonly orange: ColorTuple;
|
|
37
|
+
readonly transparent: string;
|
|
38
|
+
readonly white: string;
|
|
39
|
+
readonly gray: ColorTuple;
|
|
40
|
+
readonly black: string;
|
|
41
|
+
readonly bronze: ColorTuple;
|
|
42
|
+
};
|
|
43
|
+
export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
44
|
+
readonly red: ColorTuple;
|
|
45
|
+
readonly pink: ColorTuple;
|
|
46
|
+
readonly grape: ColorTuple;
|
|
47
|
+
readonly violet: ColorTuple;
|
|
48
|
+
readonly blue: ColorTuple;
|
|
49
|
+
readonly cyan: ColorTuple;
|
|
50
|
+
readonly teal: ColorTuple;
|
|
51
|
+
readonly green: ColorTuple;
|
|
52
|
+
readonly yellow: ColorTuple;
|
|
53
|
+
readonly orange: ColorTuple;
|
|
54
|
+
readonly transparent: string;
|
|
55
|
+
readonly white: string;
|
|
56
|
+
readonly gray: ColorTuple;
|
|
57
|
+
readonly black: string;
|
|
58
|
+
readonly bronze: ColorTuple;
|
|
59
|
+
};
|
|
60
|
+
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
|
|
61
|
+
export declare const rgbToHex: (r: number, g: number, b: number) => string;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ActionManager } from "../actions/manager";
|
|
3
3
|
import { ExcalidrawElement, PointerType } from "../element/types";
|
|
4
|
-
import {
|
|
4
|
+
import { UIAppState, Zoom } from "../types";
|
|
5
5
|
import "./Actions.scss";
|
|
6
6
|
export declare const SelectedShapeActions: ({ appState, elements, renderAction, }: {
|
|
7
|
-
appState:
|
|
7
|
+
appState: UIAppState;
|
|
8
8
|
elements: readonly ExcalidrawElement[];
|
|
9
9
|
renderAction: ActionManager["renderAction"];
|
|
10
10
|
}) => JSX.Element;
|
|
11
11
|
export declare const ShapesSwitcher: ({ canvas, activeTool, setAppState, onImageAction, appState, }: {
|
|
12
12
|
canvas: HTMLCanvasElement | null;
|
|
13
|
-
activeTool:
|
|
14
|
-
setAppState: React.Component<any,
|
|
13
|
+
activeTool: UIAppState["activeTool"];
|
|
14
|
+
setAppState: React.Component<any, UIAppState>["setState"];
|
|
15
15
|
onImageAction: (data: {
|
|
16
16
|
pointerType: PointerType | null;
|
|
17
17
|
}) => void;
|
|
18
|
-
appState:
|
|
18
|
+
appState: UIAppState;
|
|
19
19
|
}) => JSX.Element;
|
|
20
20
|
export declare const ZoomActions: ({ renderAction, zoom, }: {
|
|
21
21
|
renderAction: ActionManager["renderAction"];
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
export declare const activeConfirmDialogAtom: import("jotai").
|
|
2
|
-
write: (get: {
|
|
3
|
-
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
4
|
-
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
5
|
-
<Value_2>(atom: import("jotai").Atom<Value_2>): Value_2 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_2;
|
|
6
|
-
} & {
|
|
7
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
8
|
-
unstable_promise: true;
|
|
9
|
-
}): Value_3 | Promise<Value_3>;
|
|
10
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
11
|
-
unstable_promise: true;
|
|
12
|
-
}): Value_4 | Promise<Value_4>;
|
|
13
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
14
|
-
unstable_promise: true;
|
|
15
|
-
}): (Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5) | Promise<Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5>;
|
|
16
|
-
}, set: {
|
|
17
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
18
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
19
|
-
}, update: "clearCanvas" | ((prev: "clearCanvas" | null) => "clearCanvas" | null) | null) => void;
|
|
20
|
-
onMount?: (<S extends (update: "clearCanvas" | ((prev: "clearCanvas" | null) => "clearCanvas" | null) | null) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
21
|
-
} & {
|
|
1
|
+
export declare const activeConfirmDialogAtom: import("jotai").PrimitiveAtom<"clearCanvas" | null> & {
|
|
22
2
|
init: "clearCanvas" | null;
|
|
23
3
|
};
|
|
24
4
|
export declare const ActiveConfirmDialog: () => JSX.Element | null;
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
|
+
import { EXPORT_IMAGE_TYPES } from "../constants";
|
|
4
5
|
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
5
6
|
import { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "../element/types";
|
|
6
7
|
import History from "../history";
|
|
7
8
|
import Scene from "../scene/Scene";
|
|
8
|
-
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
|
|
9
|
+
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName } from "../types";
|
|
9
10
|
import { FileSystemHandle } from "../data/filesystem";
|
|
10
11
|
import { Emitter } from "../emitter";
|
|
11
12
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
12
13
|
container: HTMLDivElement | null;
|
|
13
14
|
id?: string | null | undefined;
|
|
14
15
|
}>;
|
|
16
|
+
export declare const useApp: () => AppClassProperties;
|
|
17
|
+
export declare const useAppProps: () => AppProps;
|
|
15
18
|
export declare const useDevice: () => Readonly<{
|
|
16
19
|
isSmScreen: boolean;
|
|
17
20
|
isMobile: boolean;
|
|
18
21
|
isTouchScreen: boolean;
|
|
19
22
|
canDeviceFitSidebar: boolean;
|
|
23
|
+
isLandscape: boolean;
|
|
20
24
|
}>;
|
|
21
25
|
export declare const useExcalidrawContainer: () => {
|
|
22
26
|
container: HTMLDivElement | null;
|
|
@@ -41,24 +45,24 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
41
45
|
private nearestScrollableContainer;
|
|
42
46
|
library: AppClassProperties["library"];
|
|
43
47
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
44
|
-
|
|
48
|
+
id: string;
|
|
45
49
|
private history;
|
|
46
50
|
private excalidrawContainerValue;
|
|
47
51
|
files: BinaryFiles;
|
|
48
52
|
imageCache: AppClassProperties["imageCache"];
|
|
49
53
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
50
|
-
lastPointerDown: React.PointerEvent<
|
|
54
|
+
lastPointerDown: React.PointerEvent<HTMLElement> | null;
|
|
51
55
|
lastPointerUp: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
52
|
-
|
|
56
|
+
lastViewportPosition: {
|
|
53
57
|
x: number;
|
|
54
58
|
y: number;
|
|
55
|
-
}
|
|
59
|
+
};
|
|
56
60
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
57
61
|
onPointerDownEmitter: Emitter<[activeTool: {
|
|
58
62
|
lastActiveTool: import("../types").LastActiveTool;
|
|
59
63
|
locked: boolean;
|
|
60
64
|
} & ({
|
|
61
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
65
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
62
66
|
customType: null;
|
|
63
67
|
} | {
|
|
64
68
|
type: "custom";
|
|
@@ -129,12 +133,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
129
133
|
erase: boolean;
|
|
130
134
|
};
|
|
131
135
|
};
|
|
132
|
-
}>, event: React.PointerEvent<
|
|
136
|
+
}>, event: React.PointerEvent<HTMLElement>]>;
|
|
133
137
|
onPointerUpEmitter: Emitter<[activeTool: {
|
|
134
138
|
lastActiveTool: import("../types").LastActiveTool;
|
|
135
139
|
locked: boolean;
|
|
136
140
|
} & ({
|
|
137
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
141
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
138
142
|
customType: null;
|
|
139
143
|
} | {
|
|
140
144
|
type: "custom";
|
|
@@ -208,10 +212,16 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
208
212
|
}>, event: PointerEvent]>;
|
|
209
213
|
constructor(props: AppProps);
|
|
210
214
|
private renderCanvas;
|
|
215
|
+
private getFrameNameDOMId;
|
|
216
|
+
frameNameBoundsCache: FrameNameBoundsCache;
|
|
217
|
+
private renderFrameNames;
|
|
211
218
|
render(): JSX.Element;
|
|
212
219
|
focusContainer: AppClassProperties["focusContainer"];
|
|
213
220
|
getSceneElementsIncludingDeleted: () => readonly ExcalidrawElement[];
|
|
214
221
|
getSceneElements: () => readonly NonDeletedExcalidrawElement[];
|
|
222
|
+
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
223
|
+
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: readonly NonDeletedExcalidrawElement[]) => Promise<void>;
|
|
224
|
+
private openEyeDropper;
|
|
215
225
|
private syncActionResult;
|
|
216
226
|
private onBlur;
|
|
217
227
|
private onUnload;
|
|
@@ -246,6 +256,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
246
256
|
setAppState: React.Component<any, AppState>["setState"];
|
|
247
257
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
248
258
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
259
|
+
toggleFrameRendering: () => void;
|
|
249
260
|
togglePenMode: () => void;
|
|
250
261
|
onHandToolToggle: () => void;
|
|
251
262
|
/**
|
|
@@ -255,6 +266,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
255
266
|
private cancelInProgresAnimation;
|
|
256
267
|
scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[], opts?: {
|
|
257
268
|
fitToContent?: boolean;
|
|
269
|
+
fitToViewport?: never;
|
|
270
|
+
animate?: boolean;
|
|
271
|
+
duration?: number;
|
|
272
|
+
} | {
|
|
273
|
+
fitToContent?: never;
|
|
274
|
+
fitToViewport?: boolean;
|
|
258
275
|
animate?: boolean;
|
|
259
276
|
duration?: number;
|
|
260
277
|
}) => void;
|
|
@@ -278,7 +295,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
278
295
|
/**
|
|
279
296
|
* @returns whether the menu was toggled on or off
|
|
280
297
|
*/
|
|
281
|
-
|
|
298
|
+
toggleSidebar: ({ name, tab, force, }: {
|
|
299
|
+
name: SidebarName;
|
|
300
|
+
tab?: string | undefined;
|
|
301
|
+
force?: boolean | undefined;
|
|
302
|
+
}) => boolean;
|
|
282
303
|
private updateCurrentCursorPosition;
|
|
283
304
|
private onKeyDown;
|
|
284
305
|
private onWheel;
|
|
@@ -305,6 +326,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
305
326
|
private handleCanvasDoubleClick;
|
|
306
327
|
private getElementLinkAtPosition;
|
|
307
328
|
private redirectToLink;
|
|
329
|
+
private getTopLayerFrameAtSceneCoords;
|
|
308
330
|
private handleCanvasPointerMove;
|
|
309
331
|
private handleEraser;
|
|
310
332
|
private handleTouchMove;
|
|
@@ -330,6 +352,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
330
352
|
private createImageElement;
|
|
331
353
|
private handleLinearElementOnPointerDown;
|
|
332
354
|
private createGenericElementOnPointerDown;
|
|
355
|
+
private createFrameElementOnPointerDown;
|
|
333
356
|
private onKeyDownFromPointerDownHandler;
|
|
334
357
|
private onKeyUpFromPointerDownHandler;
|
|
335
358
|
private onPointerMoveFromPointerDownHandler;
|