@zsviczian/excalidraw 0.12.0-obsidian-11 → 0.13.0-obsidian-1
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/README.md +68 -14
- package/dist/excalidraw.development.js +1192 -154
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +104 -0
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +12 -9
- package/types/actions/actionAlign.d.ts +18 -6
- package/types/actions/actionBoundText.d.ts +4 -3
- package/types/actions/actionCanvas.d.ts +59 -36
- package/types/actions/actionClipboard.d.ts +20 -15
- package/types/actions/actionDeleteSelected.d.ts +15 -10
- package/types/actions/actionDistribute.d.ts +6 -2
- package/types/actions/actionDuplicateSelection.d.ts +3 -1
- package/types/actions/actionExport.d.ts +62 -37
- package/types/actions/actionFinalize.d.ts +11 -7
- package/types/actions/actionGroup.d.ts +6 -2
- package/types/actions/actionLinearEditor.d.ts +4 -3
- package/types/actions/actionMenu.d.ts +21 -12
- package/types/actions/actionNavigate.d.ts +3 -1
- package/types/actions/actionProperties.d.ts +91 -52
- package/types/actions/actionStyles.d.ts +4 -3
- package/types/actions/actionToggleGridMode.d.ts +4 -3
- package/types/actions/actionToggleLock.d.ts +4 -3
- package/types/actions/actionToggleStats.d.ts +4 -3
- package/types/actions/actionToggleViewMode.d.ts +4 -3
- package/types/actions/actionToggleZenMode.d.ts +4 -3
- package/types/actions/actionZindex.d.ts +12 -4
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +1 -1
- package/types/actions/types.d.ts +3 -1
- package/types/appState.d.ts +5 -4
- package/types/bug-issue-template.d.ts +2 -0
- package/types/clients.d.ts +1 -1
- package/types/components/Actions.d.ts +1 -0
- package/types/components/App.d.ts +52 -1
- package/types/components/Avatar.d.ts +1 -1
- package/types/components/CollabButton.d.ts +2 -1
- package/types/components/DialogActionButton.d.ts +10 -0
- package/types/components/EncryptedIcon.d.ts +2 -0
- package/types/components/Footer.d.ts +2 -1
- package/types/components/HelpButton.d.ts +8 -0
- package/types/components/HintViewer.d.ts +3 -2
- package/types/components/ImageExportDialog.d.ts +3 -1
- package/types/components/LayerUI.d.ts +3 -1
- package/types/components/LibraryButton.d.ts +1 -0
- package/types/components/LibraryMenu.d.ts +14 -5
- package/types/components/LibraryMenuBrowseButton.d.ts +7 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +12 -0
- package/types/components/LibraryMenuItems.d.ts +5 -14
- package/types/components/LibraryUnit.d.ts +2 -3
- package/types/components/MenuItem.d.ts +11 -0
- package/types/components/MenuUtils.d.ts +2 -0
- package/types/components/MobileMenu.d.ts +5 -3
- package/types/components/Sidebar/Sidebar.d.ts +73 -0
- package/types/components/Sidebar/SidebarHeader.d.ts +20 -0
- package/types/components/Sidebar/common.d.ts +16 -0
- package/types/components/TopErrorBoundary.d.ts +15 -0
- package/types/components/WelcomeScreen.d.ts +8 -0
- package/types/components/WelcomeScreenDecor.d.ts +6 -0
- package/types/components/hoc/withUpstreamOverride.d.ts +10 -0
- package/types/components/icons.d.ts +83 -124
- package/types/constants.d.ts +1 -0
- package/types/data/restore.d.ts +1 -1
- package/types/data/types.d.ts +16 -1
- package/types/element/Hyperlink.d.ts +7 -4
- package/types/element/index.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +4 -3
- package/types/element/newElement.d.ts +8 -0
- package/types/element/transformHandles.d.ts +1 -1
- package/types/excalidraw-app/CustomStats.d.ts +9 -0
- package/types/excalidraw-app/app_constants.d.ts +32 -0
- package/types/excalidraw-app/collab/Collab.d.ts +163 -0
- package/types/excalidraw-app/collab/Portal.d.ts +28 -0
- package/types/excalidraw-app/collab/RoomDialog.d.ts +13 -0
- package/types/excalidraw-app/collab/reconciliation.d.ts +10 -0
- package/types/excalidraw-app/components/ExportToExcalidrawPlus.d.ts +9 -0
- package/types/excalidraw-app/components/LanguageList.d.ts +4 -0
- package/types/excalidraw-app/components/icons.d.ts +1 -0
- package/types/excalidraw-app/data/FileManager.d.ts +66 -0
- package/types/excalidraw-app/data/LocalData.d.ts +32 -0
- package/types/excalidraw-app/data/Locker.d.ts +8 -0
- package/types/excalidraw-app/data/firebase.d.ts +25 -0
- package/types/excalidraw-app/data/index.d.ts +186 -0
- package/types/excalidraw-app/data/localStorage.d.ts +112 -0
- package/types/excalidraw-app/data/tabSync.d.ts +9 -0
- package/types/excalidraw-app/index.d.ts +26 -0
- package/types/hooks/useOutsideClick.d.ts +2 -0
- package/types/keys.d.ts +13 -3
- package/types/packages/excalidraw/example/App.d.ts +2 -1
- package/types/packages/excalidraw/example/sidebar/ExampleSidebar.d.ts +5 -0
- package/types/packages/excalidraw/index.d.ts +4 -0
- package/types/packages/utils.d.ts +3 -1
- package/types/renderer/renderScene.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +1 -1
- package/types/scene/types.d.ts +1 -0
- package/types/shapes.d.ts +27 -3
- package/types/types.d.ts +21 -3
|
@@ -7,6 +7,7 @@ export declare const actionToggleStats: {
|
|
|
7
7
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
8
8
|
appState: {
|
|
9
9
|
showStats: boolean;
|
|
10
|
+
showWelcomeScreen: boolean;
|
|
10
11
|
isLoading: boolean;
|
|
11
12
|
errorMessage: string | null;
|
|
12
13
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -62,6 +63,9 @@ export declare const actionToggleStats: {
|
|
|
62
63
|
}>;
|
|
63
64
|
openMenu: "canvas" | "shape" | null;
|
|
64
65
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
66
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
67
|
+
openDialog: "imageExport" | "help" | null;
|
|
68
|
+
isSidebarDocked: boolean;
|
|
65
69
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
66
70
|
selectedElementIds: {
|
|
67
71
|
[id: string]: boolean;
|
|
@@ -70,7 +74,6 @@ export declare const actionToggleStats: {
|
|
|
70
74
|
[id: string]: boolean;
|
|
71
75
|
};
|
|
72
76
|
shouldCacheIgnoreZoom: boolean;
|
|
73
|
-
showHelpDialog: boolean;
|
|
74
77
|
toast: {
|
|
75
78
|
message: string;
|
|
76
79
|
closable?: boolean | undefined;
|
|
@@ -88,8 +91,6 @@ export declare const actionToggleStats: {
|
|
|
88
91
|
height: number;
|
|
89
92
|
offsetTop: number;
|
|
90
93
|
offsetLeft: number;
|
|
91
|
-
isLibraryOpen: boolean;
|
|
92
|
-
isLibraryMenuDocked: boolean;
|
|
93
94
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
94
95
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
95
96
|
currentChartType: import("../element/types").ChartType;
|
|
@@ -8,6 +8,7 @@ export declare const actionToggleViewMode: {
|
|
|
8
8
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties): {
|
|
9
9
|
appState: {
|
|
10
10
|
viewModeEnabled: boolean;
|
|
11
|
+
showWelcomeScreen: boolean;
|
|
11
12
|
isLoading: boolean;
|
|
12
13
|
errorMessage: string | null;
|
|
13
14
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -63,6 +64,9 @@ export declare const actionToggleViewMode: {
|
|
|
63
64
|
}>;
|
|
64
65
|
openMenu: "canvas" | "shape" | null;
|
|
65
66
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
+
openDialog: "imageExport" | "help" | null;
|
|
69
|
+
isSidebarDocked: boolean;
|
|
66
70
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
67
71
|
selectedElementIds: {
|
|
68
72
|
[id: string]: boolean;
|
|
@@ -71,7 +75,6 @@ export declare const actionToggleViewMode: {
|
|
|
71
75
|
[id: string]: boolean;
|
|
72
76
|
};
|
|
73
77
|
shouldCacheIgnoreZoom: boolean;
|
|
74
|
-
showHelpDialog: boolean;
|
|
75
78
|
toast: {
|
|
76
79
|
message: string;
|
|
77
80
|
closable?: boolean | undefined;
|
|
@@ -88,8 +91,6 @@ export declare const actionToggleViewMode: {
|
|
|
88
91
|
height: number;
|
|
89
92
|
offsetTop: number;
|
|
90
93
|
offsetLeft: number;
|
|
91
|
-
isLibraryOpen: boolean;
|
|
92
|
-
isLibraryMenuDocked: boolean;
|
|
93
94
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
94
95
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
95
96
|
showStats: boolean;
|
|
@@ -8,6 +8,7 @@ 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
|
+
showWelcomeScreen: boolean;
|
|
11
12
|
isLoading: boolean;
|
|
12
13
|
errorMessage: string | null;
|
|
13
14
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -63,6 +64,9 @@ export declare const actionToggleZenMode: {
|
|
|
63
64
|
}>;
|
|
64
65
|
openMenu: "canvas" | "shape" | null;
|
|
65
66
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
+
openDialog: "imageExport" | "help" | null;
|
|
69
|
+
isSidebarDocked: boolean;
|
|
66
70
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
67
71
|
selectedElementIds: {
|
|
68
72
|
[id: string]: boolean;
|
|
@@ -71,7 +75,6 @@ export declare const actionToggleZenMode: {
|
|
|
71
75
|
[id: string]: boolean;
|
|
72
76
|
};
|
|
73
77
|
shouldCacheIgnoreZoom: boolean;
|
|
74
|
-
showHelpDialog: boolean;
|
|
75
78
|
toast: {
|
|
76
79
|
message: string;
|
|
77
80
|
closable?: boolean | undefined;
|
|
@@ -88,8 +91,6 @@ export declare const actionToggleZenMode: {
|
|
|
88
91
|
height: number;
|
|
89
92
|
offsetTop: number;
|
|
90
93
|
offsetLeft: number;
|
|
91
|
-
isLibraryOpen: boolean;
|
|
92
|
-
isLibraryMenuDocked: boolean;
|
|
93
94
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
94
95
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
95
96
|
showStats: boolean;
|
|
@@ -12,7 +12,9 @@ export declare const actionSendBackward: {
|
|
|
12
12
|
contextItemLabel: string;
|
|
13
13
|
keyPriority: number;
|
|
14
14
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
15
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
15
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
|
|
16
|
+
isInHamburgerMenu: boolean;
|
|
17
|
+
}) => JSX.Element;
|
|
16
18
|
} & {
|
|
17
19
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
18
20
|
};
|
|
@@ -29,7 +31,9 @@ export declare const actionBringForward: {
|
|
|
29
31
|
contextItemLabel: string;
|
|
30
32
|
keyPriority: number;
|
|
31
33
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
32
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
34
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
|
|
35
|
+
isInHamburgerMenu: boolean;
|
|
36
|
+
}) => JSX.Element;
|
|
33
37
|
} & {
|
|
34
38
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
35
39
|
};
|
|
@@ -45,7 +49,9 @@ export declare const actionSendToBack: {
|
|
|
45
49
|
};
|
|
46
50
|
contextItemLabel: string;
|
|
47
51
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
48
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
52
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
|
|
53
|
+
isInHamburgerMenu: boolean;
|
|
54
|
+
}) => JSX.Element;
|
|
49
55
|
} & {
|
|
50
56
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
51
57
|
};
|
|
@@ -61,7 +67,9 @@ export declare const actionBringToFront: {
|
|
|
61
67
|
};
|
|
62
68
|
contextItemLabel: string;
|
|
63
69
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
64
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
70
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
|
|
71
|
+
isInHamburgerMenu: boolean;
|
|
72
|
+
}) => JSX.Element;
|
|
65
73
|
} & {
|
|
66
74
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
67
75
|
};
|
|
@@ -16,5 +16,5 @@ export declare class ActionManager {
|
|
|
16
16
|
/**
|
|
17
17
|
* @param data additional data sent to the PanelComponent
|
|
18
18
|
*/
|
|
19
|
-
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => JSX.Element | null;
|
|
19
|
+
renderAction: (name: ActionName, data?: PanelComponentProps["data"], isInHamburgerMenu?: boolean) => JSX.Element | null;
|
|
20
20
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ActionName } from "./types";
|
|
2
|
-
export declare type ShortcutName = SubtypeOf<ActionName, "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleLock"
|
|
2
|
+
export declare type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleLock"> | "saveScene" | "imageExport";
|
|
3
3
|
export declare const getShortcutFromShortcutName: (name: ShortcutName) => string;
|
package/types/actions/types.d.ts
CHANGED
|
@@ -24,7 +24,9 @@ export declare type PanelComponentProps = {
|
|
|
24
24
|
};
|
|
25
25
|
export interface Action {
|
|
26
26
|
name: ActionName;
|
|
27
|
-
PanelComponent?: React.FC<PanelComponentProps
|
|
27
|
+
PanelComponent?: React.FC<PanelComponentProps & {
|
|
28
|
+
isInHamburgerMenu: boolean;
|
|
29
|
+
}>;
|
|
28
30
|
perform: ActionFn;
|
|
29
31
|
keyPriority?: number;
|
|
30
32
|
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
|
package/types/appState.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AppState, NormalizedZoomValue } 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;
|
|
4
6
|
activeTool?: {
|
|
5
7
|
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
6
8
|
lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
|
|
@@ -19,7 +21,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
19
21
|
value: NormalizedZoomValue;
|
|
20
22
|
}> | undefined;
|
|
21
23
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
22
|
-
|
|
24
|
+
showWelcomeScreen?: boolean | undefined;
|
|
23
25
|
penMode?: boolean | undefined;
|
|
24
26
|
penDetected?: boolean | undefined;
|
|
25
27
|
exportBackground?: boolean | undefined;
|
|
@@ -42,8 +44,9 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
42
44
|
currentItemLinearStrokeSharpness?: import("./element/types").StrokeSharpness | undefined;
|
|
43
45
|
cursorButton?: "up" | "down" | undefined;
|
|
44
46
|
scrolledOutside?: boolean | undefined;
|
|
45
|
-
name?: string | undefined;
|
|
46
47
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
48
|
+
openSidebar?: "library" | "customSidebar" | null | undefined;
|
|
49
|
+
isSidebarDocked?: boolean | undefined;
|
|
47
50
|
lastPointerDownWith?: import("./element/types").PointerType | undefined;
|
|
48
51
|
selectedElementIds?: {
|
|
49
52
|
[id: string]: boolean;
|
|
@@ -57,8 +60,6 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
57
60
|
[groupId: string]: boolean;
|
|
58
61
|
} | undefined;
|
|
59
62
|
editingGroupId?: string | null | undefined;
|
|
60
|
-
isLibraryOpen?: boolean | undefined;
|
|
61
|
-
isLibraryMenuDocked?: boolean | undefined;
|
|
62
63
|
showStats?: boolean | undefined;
|
|
63
64
|
currentChartType?: import("./element/types").ChartType | undefined;
|
|
64
65
|
selectedLinearElement?: import("./element/linearElementEditor").LinearElementEditor | null | undefined;
|
package/types/clients.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare const getClientColors: (clientId: string, appState: AppState) =>
|
|
|
3
3
|
background: string;
|
|
4
4
|
stroke: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const getClientInitials: (
|
|
6
|
+
export declare const getClientInitials: (userName?: string | null) => string;
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ActionManager } from "../actions/manager";
|
|
3
3
|
import { ExcalidrawElement, PointerType } from "../element/types";
|
|
4
4
|
import { AppState, Zoom } from "../types";
|
|
5
|
+
import "./Actions.scss";
|
|
5
6
|
export declare const SelectedShapeActions: ({ appState, elements, renderAction, }: {
|
|
6
7
|
appState: AppState;
|
|
7
8
|
elements: readonly ExcalidrawElement[];
|
|
@@ -9,6 +9,52 @@ import Scene from "../scene/Scene";
|
|
|
9
9
|
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
|
|
10
10
|
import { FileSystemHandle } from "../data/filesystem";
|
|
11
11
|
import { ImportedDataState } from "../data/types";
|
|
12
|
+
export declare const isMenuOpenAtom: import("jotai").Atom<boolean> & {
|
|
13
|
+
write: (get: {
|
|
14
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
15
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
16
|
+
<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;
|
|
17
|
+
} & {
|
|
18
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
19
|
+
unstable_promise: true;
|
|
20
|
+
}): Value_3 | Promise<Value_3>;
|
|
21
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
22
|
+
unstable_promise: true;
|
|
23
|
+
}): Value_4 | Promise<Value_4>;
|
|
24
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
25
|
+
unstable_promise: true;
|
|
26
|
+
}): (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>;
|
|
27
|
+
}, set: {
|
|
28
|
+
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
29
|
+
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
30
|
+
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
31
|
+
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
32
|
+
} & {
|
|
33
|
+
init: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const isDropdownOpenAtom: import("jotai").Atom<boolean> & {
|
|
36
|
+
write: (get: {
|
|
37
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
38
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
39
|
+
<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;
|
|
40
|
+
} & {
|
|
41
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
42
|
+
unstable_promise: true;
|
|
43
|
+
}): Value_3 | Promise<Value_3>;
|
|
44
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
45
|
+
unstable_promise: true;
|
|
46
|
+
}): Value_4 | Promise<Value_4>;
|
|
47
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
48
|
+
unstable_promise: true;
|
|
49
|
+
}): (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>;
|
|
50
|
+
}, set: {
|
|
51
|
+
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
52
|
+
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
53
|
+
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
54
|
+
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
55
|
+
} & {
|
|
56
|
+
init: boolean;
|
|
57
|
+
};
|
|
12
58
|
export declare let showFourthFont: boolean;
|
|
13
59
|
export declare const useDevice: () => Readonly<{
|
|
14
60
|
isSmScreen: boolean;
|
|
@@ -22,6 +68,7 @@ export declare const useExcalidrawContainer: () => {
|
|
|
22
68
|
};
|
|
23
69
|
export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawElement[];
|
|
24
70
|
export declare const useExcalidrawAppState: () => AppState;
|
|
71
|
+
export declare const useExcalidrawSetAppState: () => <K extends keyof AppState>(state: AppState | ((prevState: Readonly<AppState>, props: Readonly<any>) => AppState | Pick<AppState, K> | null) | Pick<AppState, K> | null, callback?: (() => void) | undefined) => void;
|
|
25
72
|
declare class App extends React.Component<AppProps, AppState> {
|
|
26
73
|
canvas: AppClassProperties["canvas"];
|
|
27
74
|
rc: RoughCanvas | null;
|
|
@@ -87,7 +134,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
87
134
|
private pasteFromClipboard;
|
|
88
135
|
private addElementsFromPasteOrLibrary;
|
|
89
136
|
private addTextFromPaste;
|
|
90
|
-
setAppState:
|
|
137
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
91
138
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
92
139
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
93
140
|
togglePenMode: () => void;
|
|
@@ -117,6 +164,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
117
164
|
commitToHistory?: SceneData["commitToHistory"];
|
|
118
165
|
}) => void;
|
|
119
166
|
private onSceneUpdated;
|
|
167
|
+
/**
|
|
168
|
+
* @returns whether the menu was toggled on or off
|
|
169
|
+
*/
|
|
170
|
+
toggleMenu: (type: "library" | "customSidebar", force?: boolean) => boolean;
|
|
120
171
|
private updateCurrentCursorPosition;
|
|
121
172
|
private onKeyDown;
|
|
122
173
|
private onWheel;
|
|
@@ -7,5 +7,5 @@ declare type AvatarProps = {
|
|
|
7
7
|
name: string;
|
|
8
8
|
src?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const Avatar: ({ color,
|
|
10
|
+
export declare const Avatar: ({ color, onClick, name, src }: AvatarProps) => JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "./CollabButton.scss";
|
|
2
|
-
declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick, }: {
|
|
2
|
+
declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick, isInHamburgerMenu, }: {
|
|
3
3
|
isCollaborating: boolean;
|
|
4
4
|
collaboratorCount: number;
|
|
5
5
|
onClick: () => void;
|
|
6
|
+
isInHamburgerMenu?: boolean | undefined;
|
|
6
7
|
}) => JSX.Element;
|
|
7
8
|
export default CollabButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import "./DialogActionButton.scss";
|
|
3
|
+
interface DialogActionButtonProps {
|
|
4
|
+
label: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
actionType?: "primary" | "danger";
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const DialogActionButton: ({ label, onClick, className, children, actionType, type, isLoading, ...rest }: DialogActionButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element;
|
|
10
|
+
export default DialogActionButton;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ActionManager } from "../actions/manager";
|
|
2
2
|
import { AppState, ExcalidrawProps } from "../types";
|
|
3
|
-
declare const Footer: ({ appState, actionManager, renderCustomFooter, showExitZenModeBtn, }: {
|
|
3
|
+
declare const Footer: ({ appState, actionManager, renderCustomFooter, showExitZenModeBtn, renderWelcomeScreen, }: {
|
|
4
4
|
appState: AppState;
|
|
5
5
|
actionManager: ActionManager;
|
|
6
6
|
renderCustomFooter?: ExcalidrawProps["renderFooter"];
|
|
7
7
|
showExitZenModeBtn: boolean;
|
|
8
|
+
renderWelcomeScreen: boolean;
|
|
8
9
|
}) => JSX.Element;
|
|
9
10
|
export default Footer;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
2
2
|
import "./HintViewer.scss";
|
|
3
|
-
import { AppState } from "../types";
|
|
3
|
+
import { AppState, Device } from "../types";
|
|
4
4
|
interface HintViewerProps {
|
|
5
5
|
appState: AppState;
|
|
6
6
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
7
7
|
isMobile: boolean;
|
|
8
|
+
device: Device;
|
|
8
9
|
}
|
|
9
|
-
export declare const HintViewer: ({ appState, elements, isMobile, }: HintViewerProps) => JSX.Element | null;
|
|
10
|
+
export declare const HintViewer: ({ appState, elements, isMobile, device, }: HintViewerProps) => JSX.Element | null;
|
|
10
11
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
2
3
|
import { AppState, BinaryFiles } from "../types";
|
|
3
4
|
import "./ExportDialog.scss";
|
|
4
5
|
import { ActionManager } from "../actions/manager";
|
|
5
6
|
export declare const ErrorCanvasPreview: () => JSX.Element;
|
|
6
7
|
export declare type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
|
|
7
|
-
export declare const ImageExportDialog: ({ elements, appState, files, exportPadding, actionManager, onExportToPng, onExportToSvg, onExportToClipboard, }: {
|
|
8
|
+
export declare const ImageExportDialog: ({ elements, appState, setAppState, files, exportPadding, actionManager, onExportToPng, onExportToSvg, onExportToClipboard, }: {
|
|
8
9
|
appState: AppState;
|
|
10
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
9
11
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
10
12
|
files: BinaryFiles;
|
|
11
13
|
exportPadding?: number | undefined;
|
|
@@ -23,6 +23,7 @@ interface LayerUIProps {
|
|
|
23
23
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
24
24
|
renderCustomFooter?: ExcalidrawProps["renderFooter"];
|
|
25
25
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
26
|
+
renderCustomSidebar?: ExcalidrawProps["renderSidebar"];
|
|
26
27
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
27
28
|
UIOptions: AppProps["UIOptions"];
|
|
28
29
|
focusContainer: () => void;
|
|
@@ -31,6 +32,7 @@ interface LayerUIProps {
|
|
|
31
32
|
onImageAction: (data: {
|
|
32
33
|
insertOnCanvasDirectly: boolean;
|
|
33
34
|
}) => void;
|
|
35
|
+
renderWelcomeScreen: boolean;
|
|
34
36
|
}
|
|
35
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
|
|
37
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, renderWelcomeScreen, }: LayerUIProps) => JSX.Element>;
|
|
36
38
|
export default _default;
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import Library from "../data/library";
|
|
2
|
-
import { LibraryItems, LibraryItem, AppState,
|
|
3
|
+
import { LibraryItems, LibraryItem, AppState, ExcalidrawProps } from "../types";
|
|
3
4
|
import "./LibraryMenu.scss";
|
|
4
|
-
|
|
5
|
+
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
6
|
+
export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElements, onAddToLibrary, setAppState, libraryReturnUrl, library, id, appState, selectedItems, onSelectItems, }: {
|
|
5
7
|
pendingElements: LibraryItem["elements"];
|
|
6
|
-
onClose: () => void;
|
|
7
8
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
8
9
|
onAddToLibrary: () => void;
|
|
9
|
-
files: BinaryFiles;
|
|
10
10
|
setAppState: React.Component<any, AppState>["setState"];
|
|
11
11
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
12
|
-
focusContainer: () => void;
|
|
13
12
|
library: Library;
|
|
14
13
|
id: string;
|
|
15
14
|
appState: AppState;
|
|
15
|
+
selectedItems: LibraryItem["id"][];
|
|
16
|
+
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
16
17
|
}) => JSX.Element;
|
|
18
|
+
export declare const LibraryMenu: React.FC<{
|
|
19
|
+
appState: AppState;
|
|
20
|
+
onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
|
|
21
|
+
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
22
|
+
focusContainer: () => void;
|
|
23
|
+
library: Library;
|
|
24
|
+
id: string;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AppState, ExcalidrawProps } from "../types";
|
|
2
|
+
declare const LibraryMenuBrowseButton: ({ theme, id, libraryReturnUrl, }: {
|
|
3
|
+
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
4
|
+
theme: AppState["theme"];
|
|
5
|
+
id: string;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
export default LibraryMenuBrowseButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Library from "../data/library";
|
|
3
|
+
import { AppState, LibraryItem } from "../types";
|
|
4
|
+
export declare const LibraryMenuHeader: React.FC<{
|
|
5
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
6
|
+
selectedItems: LibraryItem["id"][];
|
|
7
|
+
library: Library;
|
|
8
|
+
onRemoveFromLibrary: () => void;
|
|
9
|
+
resetLibrary: () => void;
|
|
10
|
+
onSelectItems: (items: LibraryItem["id"][]) => void;
|
|
11
|
+
appState: AppState;
|
|
12
|
+
}>;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Library from "../data/library";
|
|
3
|
-
import { AppState, BinaryFiles, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
|
|
1
|
+
import { AppState, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
|
|
4
2
|
import "./LibraryMenuItems.scss";
|
|
5
|
-
declare const LibraryMenuItems: ({ isLoading, libraryItems,
|
|
3
|
+
declare const LibraryMenuItems: ({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, selectedItems, onSelectItems, theme, id, libraryReturnUrl, }: {
|
|
6
4
|
isLoading: boolean;
|
|
7
5
|
libraryItems: LibraryItems;
|
|
8
6
|
pendingElements: LibraryItem["elements"];
|
|
9
|
-
onRemoveFromLibrary: () => void;
|
|
10
7
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
11
8
|
onAddToLibrary: (elements: LibraryItem["elements"]) => void;
|
|
12
|
-
theme: AppState["theme"];
|
|
13
|
-
files: BinaryFiles;
|
|
14
|
-
setAppState: React.Component<any, AppState>["setState"];
|
|
15
|
-
appState: AppState;
|
|
16
|
-
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
17
|
-
library: Library;
|
|
18
|
-
id: string;
|
|
19
9
|
selectedItems: LibraryItem["id"][];
|
|
20
10
|
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
12
|
+
theme: AppState["theme"];
|
|
13
|
+
id: string;
|
|
23
14
|
}) => JSX.Element;
|
|
24
15
|
export default LibraryMenuItems;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LibraryItem } from "../types";
|
|
2
2
|
import "./LibraryUnit.scss";
|
|
3
|
-
export declare const LibraryUnit: ({ id, elements,
|
|
3
|
+
export declare const LibraryUnit: ({ id, elements, isPending, onClick, selected, onToggle, onDrag, }: {
|
|
4
4
|
id: LibraryItem["id"] | /** for pending item */ null;
|
|
5
5
|
elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
|
|
6
|
-
files: BinaryFiles;
|
|
7
6
|
isPending?: boolean | undefined;
|
|
8
7
|
onClick: () => void;
|
|
9
8
|
selected: boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./Menu.scss";
|
|
2
|
+
interface MenuProps {
|
|
3
|
+
icon: JSX.Element;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
label: string;
|
|
6
|
+
dataTestId: string;
|
|
7
|
+
shortcut?: string;
|
|
8
|
+
isCollaborating?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const MenuItem: ({ icon, onClick, label, dataTestId, shortcut, isCollaborating, }: MenuProps) => JSX.Element;
|
|
11
|
+
export default MenuItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppState, ExcalidrawProps } from "../types";
|
|
2
|
+
import { AppState, Device, ExcalidrawProps } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
declare type MobileMenuProps = {
|
|
@@ -9,7 +9,6 @@ declare type MobileMenuProps = {
|
|
|
9
9
|
renderImageExportDialog: () => React.ReactNode;
|
|
10
10
|
setAppState: React.Component<any, AppState>["setState"];
|
|
11
11
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
12
|
-
libraryMenu: JSX.Element | null;
|
|
13
12
|
onCollabButtonClick?: () => void;
|
|
14
13
|
onLockToggle: () => void;
|
|
15
14
|
onPenModeToggle: () => void;
|
|
@@ -21,6 +20,9 @@ declare type MobileMenuProps = {
|
|
|
21
20
|
}) => void;
|
|
22
21
|
renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
23
22
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
23
|
+
renderSidebars: () => JSX.Element | null;
|
|
24
|
+
device: Device;
|
|
25
|
+
renderWelcomeScreen?: boolean;
|
|
24
26
|
};
|
|
25
|
-
export declare const MobileMenu: ({ appState, elements,
|
|
27
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, }: MobileMenuProps) => JSX.Element;
|
|
26
28
|
export {};
|