@zsviczian/excalidraw 0.13.0-obsidian-2 → 0.14.0-obsidian
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 +417 -19
- package/dist/excalidraw.development.js +491 -1096
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +0 -102
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +18 -3
- package/types/actions/actionAlign.d.ts +6 -18
- package/types/actions/actionBoundText.d.ts +8 -3
- package/types/actions/actionCanvas.d.ts +62 -30
- package/types/actions/actionClipboard.d.ts +49 -6
- package/types/actions/actionDeleteSelected.d.ts +19 -6
- package/types/actions/actionDistribute.d.ts +2 -6
- package/types/actions/actionDuplicateSelection.d.ts +1 -3
- package/types/actions/actionExport.d.ts +62 -33
- package/types/actions/actionFinalize.d.ts +13 -5
- package/types/actions/actionFlip.d.ts +2 -2
- package/types/actions/actionGroup.d.ts +4 -8
- package/types/actions/actionLinearEditor.d.ts +7 -2
- package/types/actions/actionMenu.d.ts +19 -11
- package/types/actions/actionNavigate.d.ts +1 -3
- package/types/actions/actionProperties.d.ts +91 -52
- package/types/actions/actionStyles.d.ts +6 -1
- package/types/actions/actionToggleGridMode.d.ts +7 -1
- package/types/actions/actionToggleLock.d.ts +6 -1
- package/types/actions/actionToggleStats.d.ts +6 -1
- package/types/actions/actionToggleViewMode.d.ts +7 -1
- package/types/actions/actionToggleZenMode.d.ts +7 -1
- package/types/actions/actionZindex.d.ts +4 -12
- package/types/actions/manager.d.ts +2 -1
- package/types/actions/types.d.ts +2 -4
- package/types/components/App.d.ts +7 -50
- package/types/components/Button.d.ts +15 -0
- package/types/components/CollabButton.d.ts +1 -2
- package/types/components/ContextMenu.d.ts +8 -20
- package/types/components/JSONExportDialog.d.ts +3 -1
- package/types/components/LayerUI.d.ts +2 -3
- package/types/components/LibraryMenuHeaderContent.d.ts +23 -0
- package/types/components/MobileMenu.d.ts +4 -6
- package/types/components/UserList.d.ts +0 -2
- package/types/components/dropdownMenu/DropdownMenu.d.ts +64 -0
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +13 -0
- package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +12 -0
- package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +9 -0
- package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/components/footer/Footer.d.ts +13 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/icons.d.ts +1 -1
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
- package/types/components/main-menu/DefaultItems.d.ts +44 -0
- package/types/components/main-menu/MainMenu.d.ts +55 -0
- package/types/components/mainMenu/DefaultItems.d.ts +44 -0
- package/types/components/mainMenu/MainMenu.d.ts +63 -0
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
- package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
- package/types/constants.d.ts +0 -3
- package/types/element/Hyperlink.d.ts +8 -5
- package/types/element/linearElementEditor.d.ts +6 -1
- package/types/element/textElement.d.ts +7 -0
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/excalidraw-app/data/index.d.ts +5 -0
- package/types/excalidraw-app/data/localStorage.d.ts +5 -0
- package/types/keys.d.ts +2 -0
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/index.d.ts +10 -0
- package/types/renderer/easingFunctions.d.ts +6 -0
- package/types/types.d.ts +41 -19
- package/types/utils.d.ts +17 -0
|
@@ -9,6 +9,11 @@ export declare const actionToggleZenMode: {
|
|
|
9
9
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
10
10
|
appState: {
|
|
11
11
|
zenModeEnabled: boolean;
|
|
12
|
+
contextMenu: {
|
|
13
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
} | null;
|
|
12
17
|
showWelcomeScreen: boolean;
|
|
13
18
|
isLoading: boolean;
|
|
14
19
|
errorMessage: string | null;
|
|
@@ -65,7 +70,7 @@ export declare const actionToggleZenMode: {
|
|
|
65
70
|
openMenu: "canvas" | "shape" | null;
|
|
66
71
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
72
|
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
-
openDialog: "imageExport" | "help" | null;
|
|
73
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
69
74
|
isSidebarDocked: boolean;
|
|
70
75
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
71
76
|
selectedElementIds: {
|
|
@@ -116,6 +121,7 @@ export declare const actionToggleZenMode: {
|
|
|
116
121
|
commitToHistory: false;
|
|
117
122
|
};
|
|
118
123
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
124
|
+
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
119
125
|
contextItemLabel: string;
|
|
120
126
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
121
127
|
} & {
|
|
@@ -12,9 +12,7 @@ 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
|
|
16
|
-
isInHamburgerMenu: boolean;
|
|
17
|
-
}) => JSX.Element;
|
|
15
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
18
16
|
} & {
|
|
19
17
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
20
18
|
};
|
|
@@ -31,9 +29,7 @@ export declare const actionBringForward: {
|
|
|
31
29
|
contextItemLabel: string;
|
|
32
30
|
keyPriority: number;
|
|
33
31
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
34
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
35
|
-
isInHamburgerMenu: boolean;
|
|
36
|
-
}) => JSX.Element;
|
|
32
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
37
33
|
} & {
|
|
38
34
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
39
35
|
};
|
|
@@ -49,9 +45,7 @@ export declare const actionSendToBack: {
|
|
|
49
45
|
};
|
|
50
46
|
contextItemLabel: string;
|
|
51
47
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
52
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
53
|
-
isInHamburgerMenu: boolean;
|
|
54
|
-
}) => JSX.Element;
|
|
48
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
55
49
|
} & {
|
|
56
50
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
57
51
|
};
|
|
@@ -67,9 +61,7 @@ export declare const actionBringToFront: {
|
|
|
67
61
|
};
|
|
68
62
|
contextItemLabel: string;
|
|
69
63
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
70
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
71
|
-
isInHamburgerMenu: boolean;
|
|
72
|
-
}) => JSX.Element;
|
|
64
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
73
65
|
} & {
|
|
74
66
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
75
67
|
};
|
|
@@ -16,5 +16,6 @@ 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"]
|
|
19
|
+
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => JSX.Element | null;
|
|
20
|
+
isActionEnabled: (action: Action) => boolean;
|
|
20
21
|
}
|
package/types/actions/types.d.ts
CHANGED
|
@@ -24,14 +24,12 @@ export declare type PanelComponentProps = {
|
|
|
24
24
|
};
|
|
25
25
|
export interface Action {
|
|
26
26
|
name: ActionName;
|
|
27
|
-
PanelComponent?: React.FC<PanelComponentProps
|
|
28
|
-
isInHamburgerMenu: boolean;
|
|
29
|
-
}>;
|
|
27
|
+
PanelComponent?: React.FC<PanelComponentProps>;
|
|
30
28
|
perform: ActionFn;
|
|
31
29
|
keyPriority?: number;
|
|
32
30
|
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
|
|
33
31
|
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => string);
|
|
34
|
-
|
|
32
|
+
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
35
33
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
36
34
|
trackEvent: false | {
|
|
37
35
|
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink";
|
|
@@ -9,53 +9,11 @@ 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
|
-
};
|
|
58
12
|
export declare let showFourthFont: boolean;
|
|
13
|
+
export declare const ExcalidrawContainerContext: React.Context<{
|
|
14
|
+
container: HTMLDivElement | null;
|
|
15
|
+
id: string | null;
|
|
16
|
+
}>;
|
|
59
17
|
export declare const useDevice: () => Readonly<{
|
|
60
18
|
isSmScreen: boolean;
|
|
61
19
|
isMobile: boolean;
|
|
@@ -69,6 +27,7 @@ export declare const useExcalidrawContainer: () => {
|
|
|
69
27
|
export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawElement[];
|
|
70
28
|
export declare const useExcalidrawAppState: () => AppState;
|
|
71
29
|
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;
|
|
30
|
+
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
72
31
|
declare class App extends React.Component<AppProps, AppState> {
|
|
73
32
|
canvas: AppClassProperties["canvas"];
|
|
74
33
|
rc: RoughCanvas | null;
|
|
@@ -92,7 +51,6 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
92
51
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
93
52
|
lastPointerDown: React.PointerEvent<HTMLCanvasElement> | null;
|
|
94
53
|
lastPointerUp: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
95
|
-
contextMenuOpen: boolean;
|
|
96
54
|
lastScenePointer: {
|
|
97
55
|
x: number;
|
|
98
56
|
y: number;
|
|
@@ -131,7 +89,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
131
89
|
private static resetTapTwice;
|
|
132
90
|
private onTapStart;
|
|
133
91
|
private onTapEnd;
|
|
134
|
-
|
|
92
|
+
pasteFromClipboard: (event: ClipboardEvent | null) => Promise<void>;
|
|
135
93
|
private addElementsFromPasteOrLibrary;
|
|
136
94
|
private addTextFromPaste;
|
|
137
95
|
setAppState: React.Component<any, AppState>["setState"];
|
|
@@ -253,8 +211,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
253
211
|
private handleCanvasContextMenu;
|
|
254
212
|
private maybeDragNewGenericElement;
|
|
255
213
|
private maybeHandleResize;
|
|
256
|
-
|
|
257
|
-
private _openContextMenu;
|
|
214
|
+
private getContextMenuItems;
|
|
258
215
|
private handleWheel;
|
|
259
216
|
private getTextWysiwygSnappedToCenterPosition;
|
|
260
217
|
private savePointer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./Button.scss";
|
|
3
|
+
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
type?: "button" | "submit" | "reset";
|
|
5
|
+
onSelect: () => any;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A generic button component that follows Excalidraw's design system.
|
|
11
|
+
* Style can be customised using `className` or `style` prop.
|
|
12
|
+
* Accepts all props that a regular `button` element accepts.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Button: ({ type, onSelect, children, className, ...rest }: ButtonProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "./CollabButton.scss";
|
|
2
|
-
declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick,
|
|
2
|
+
declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick, }: {
|
|
3
3
|
isCollaborating: boolean;
|
|
4
4
|
collaboratorCount: number;
|
|
5
5
|
onClick: () => void;
|
|
6
|
-
isInHamburgerMenu?: boolean | undefined;
|
|
7
6
|
}) => JSX.Element;
|
|
8
7
|
export default CollabButton;
|
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
import "./ContextMenu.scss";
|
|
2
2
|
import { Action } from "../actions/types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
export declare type
|
|
4
|
+
import React from "react";
|
|
5
|
+
export declare type ContextMenuItem = typeof CONTEXT_MENU_SEPARATOR | Action;
|
|
6
|
+
export declare type ContextMenuItems = (ContextMenuItem | false | null | undefined)[];
|
|
7
7
|
declare type ContextMenuProps = {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
actionManager: ActionManager;
|
|
9
|
+
items: ContextMenuItems;
|
|
10
10
|
top: number;
|
|
11
11
|
left: number;
|
|
12
|
-
actionManager: ActionManager;
|
|
13
|
-
appState: Readonly<AppState>;
|
|
14
|
-
elements: readonly NonDeletedExcalidrawElement[];
|
|
15
|
-
};
|
|
16
|
-
declare const _default: {
|
|
17
|
-
push(params: {
|
|
18
|
-
options: (ContextMenuOption | false | null | undefined)[];
|
|
19
|
-
top: ContextMenuProps["top"];
|
|
20
|
-
left: ContextMenuProps["left"];
|
|
21
|
-
actionManager: ContextMenuProps["actionManager"];
|
|
22
|
-
appState: Readonly<AppState>;
|
|
23
|
-
container: HTMLElement;
|
|
24
|
-
elements: readonly NonDeletedExcalidrawElement[];
|
|
25
|
-
}): void;
|
|
26
12
|
};
|
|
27
|
-
export
|
|
13
|
+
export declare const CONTEXT_MENU_SEPARATOR = "separator";
|
|
14
|
+
export declare const ContextMenu: React.MemoExoticComponent<({ actionManager, items, top, left }: ContextMenuProps) => JSX.Element>;
|
|
15
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
2
3
|
import { AppState, ExportOpts, BinaryFiles } from "../types";
|
|
3
4
|
import "./ExportDialog.scss";
|
|
4
5
|
import { ActionManager } from "../actions/manager";
|
|
5
6
|
export declare type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
|
|
6
|
-
export declare const JSONExportDialog: ({ elements, appState, files, actionManager, exportOpts, canvas, }: {
|
|
7
|
+
export declare const JSONExportDialog: ({ elements, appState, files, actionManager, exportOpts, canvas, setAppState, }: {
|
|
7
8
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
8
9
|
appState: AppState;
|
|
9
10
|
files: BinaryFiles;
|
|
10
11
|
actionManager: ActionManager;
|
|
11
12
|
exportOpts: ExportOpts;
|
|
12
13
|
canvas: HTMLCanvasElement | null;
|
|
14
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
13
15
|
}) => JSX.Element;
|
|
@@ -13,7 +13,6 @@ interface LayerUIProps {
|
|
|
13
13
|
canvas: HTMLCanvasElement | null;
|
|
14
14
|
setAppState: React.Component<any, AppState>["setState"];
|
|
15
15
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
16
|
-
onCollabButtonClick?: () => void;
|
|
17
16
|
onLockToggle: () => void;
|
|
18
17
|
onPenModeToggle: () => void;
|
|
19
18
|
onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
|
|
@@ -21,7 +20,6 @@ interface LayerUIProps {
|
|
|
21
20
|
langCode: Language["code"];
|
|
22
21
|
isCollaborating: boolean;
|
|
23
22
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
24
|
-
renderCustomFooter?: ExcalidrawProps["renderFooter"];
|
|
25
23
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
26
24
|
renderCustomSidebar?: ExcalidrawProps["renderSidebar"];
|
|
27
25
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
@@ -33,6 +31,7 @@ interface LayerUIProps {
|
|
|
33
31
|
insertOnCanvasDirectly: boolean;
|
|
34
32
|
}) => void;
|
|
35
33
|
renderWelcomeScreen: boolean;
|
|
34
|
+
children?: React.ReactNode;
|
|
36
35
|
}
|
|
37
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas,
|
|
36
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
|
|
38
37
|
export default _default;
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Library from "../data/library";
|
|
3
3
|
import { AppState, LibraryItem } from "../types";
|
|
4
|
+
export declare const isLibraryMenuOpenAtom: import("jotai").Atom<boolean> & {
|
|
5
|
+
write: (get: {
|
|
6
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
7
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
8
|
+
<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;
|
|
9
|
+
} & {
|
|
10
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
11
|
+
unstable_promise: true;
|
|
12
|
+
}): Value_3 | Promise<Value_3>;
|
|
13
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
14
|
+
unstable_promise: true;
|
|
15
|
+
}): Value_4 | Promise<Value_4>;
|
|
16
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
17
|
+
unstable_promise: true;
|
|
18
|
+
}): (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>;
|
|
19
|
+
}, set: {
|
|
20
|
+
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
21
|
+
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
22
|
+
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
23
|
+
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
init: boolean;
|
|
26
|
+
};
|
|
4
27
|
export declare const LibraryMenuHeader: React.FC<{
|
|
5
28
|
setAppState: React.Component<any, AppState>["setState"];
|
|
6
29
|
selectedItems: LibraryItem["id"][];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppState, Device, ExcalidrawProps } from "../types";
|
|
2
|
+
import { AppState, Device, ExcalidrawProps, UIWelcomeScreenComponents } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
declare type MobileMenuProps = {
|
|
@@ -9,12 +9,9 @@ declare type MobileMenuProps = {
|
|
|
9
9
|
renderImageExportDialog: () => React.ReactNode;
|
|
10
10
|
setAppState: React.Component<any, AppState>["setState"];
|
|
11
11
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
12
|
-
onCollabButtonClick?: () => void;
|
|
13
12
|
onLockToggle: () => void;
|
|
14
13
|
onPenModeToggle: () => void;
|
|
15
14
|
canvas: HTMLCanvasElement | null;
|
|
16
|
-
isCollaborating: boolean;
|
|
17
|
-
renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
18
15
|
onImageAction: (data: {
|
|
19
16
|
insertOnCanvasDirectly: boolean;
|
|
20
17
|
}) => void;
|
|
@@ -22,7 +19,8 @@ declare type MobileMenuProps = {
|
|
|
22
19
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
23
20
|
renderSidebars: () => JSX.Element | null;
|
|
24
21
|
device: Device;
|
|
25
|
-
|
|
22
|
+
renderMenu: () => React.ReactNode;
|
|
23
|
+
welcomeScreenCenter: UIWelcomeScreenComponents["Center"];
|
|
26
24
|
};
|
|
27
|
-
export declare const MobileMenu: ({ appState, elements, actionManager,
|
|
25
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderMenu, welcomeScreenCenter, }: MobileMenuProps) => JSX.Element;
|
|
28
26
|
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import "./UserList.scss";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { AppState } from "../types";
|
|
4
|
-
import { ActionManager } from "../actions/manager";
|
|
5
4
|
export declare const UserList: React.FC<{
|
|
6
5
|
className?: string;
|
|
7
6
|
mobile?: boolean;
|
|
8
7
|
collaborators: AppState["collaborators"];
|
|
9
|
-
actionManager: ActionManager;
|
|
10
8
|
}>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./DropdownMenu.scss";
|
|
3
|
+
declare const DropdownMenu: {
|
|
4
|
+
({ children, open, }: {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
open: boolean;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
Trigger: {
|
|
9
|
+
({ className, children, onToggle, }: {
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
onToggle: () => void;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
Content: {
|
|
17
|
+
({ children, onClickOutside, className, style, }: {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
onClickOutside?: (() => void) | undefined;
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: React.CSSProperties | undefined;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
Item: {
|
|
26
|
+
({ icon, onSelect, children, shortcut, className, ...rest }: {
|
|
27
|
+
icon?: JSX.Element | undefined;
|
|
28
|
+
onSelect: () => void;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
shortcut?: string | undefined;
|
|
31
|
+
className?: string | undefined;
|
|
32
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
ItemLink: {
|
|
36
|
+
({ icon, shortcut, href, children, className, ...rest }: {
|
|
37
|
+
icon?: JSX.Element | undefined;
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
shortcut?: string | undefined;
|
|
40
|
+
className?: string | undefined;
|
|
41
|
+
href: string;
|
|
42
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
ItemCustom: ({ children, className, ...rest }: {
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
className?: string | undefined;
|
|
48
|
+
} & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
49
|
+
Group: {
|
|
50
|
+
({ children, className, style, title, }: {
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
className?: string | undefined;
|
|
53
|
+
style?: React.CSSProperties | undefined;
|
|
54
|
+
title?: string | undefined;
|
|
55
|
+
}): JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
Separator: {
|
|
59
|
+
(): JSX.Element;
|
|
60
|
+
displayName: string;
|
|
61
|
+
};
|
|
62
|
+
displayName: string;
|
|
63
|
+
};
|
|
64
|
+
export default DropdownMenu;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const MenuContent: {
|
|
3
|
+
({ children, onClickOutside, className, style, }: {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
onClickOutside?: (() => void) | undefined;
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
style?: import("react").CSSProperties | undefined;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default MenuContent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const MenuGroup: {
|
|
3
|
+
({ children, className, style, title, }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
style?: React.CSSProperties | undefined;
|
|
7
|
+
title?: string | undefined;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default MenuGroup;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const getDrodownMenuItemClassName: (className?: string) => string;
|
|
3
|
+
declare const DropdownMenuItem: {
|
|
4
|
+
({ icon, onSelect, children, shortcut, className, ...rest }: {
|
|
5
|
+
icon?: JSX.Element | undefined;
|
|
6
|
+
onSelect: () => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
shortcut?: string | undefined;
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default DropdownMenuItem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const DropdownMenuItemLink: {
|
|
3
|
+
({ icon, shortcut, href, children, className, ...rest }: {
|
|
4
|
+
icon?: JSX.Element | undefined;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
shortcut?: string | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
href: string;
|
|
9
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default DropdownMenuItemLink;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const getMenuTriggerComponent: (children: React.ReactNode) => string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null;
|
|
3
|
+
export declare const getMenuContentComponent: (children: React.ReactNode) => string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActionManager } from "../../actions/manager";
|
|
2
|
+
import { AppState, UIChildrenComponents, UIWelcomeScreenComponents } from "../../types";
|
|
3
|
+
declare const Footer: {
|
|
4
|
+
({ appState, actionManager, showExitZenModeBtn, footerCenter, welcomeScreenHelp, }: {
|
|
5
|
+
appState: AppState;
|
|
6
|
+
actionManager: ActionManager;
|
|
7
|
+
showExitZenModeBtn: boolean;
|
|
8
|
+
footerCenter: UIChildrenComponents["FooterCenter"];
|
|
9
|
+
welcomeScreenHelp: UIWelcomeScreenComponents["HelpHint"];
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default Footer;
|
|
@@ -73,7 +73,7 @@ export declare const DistributeHorizontallyIcon: JSX.Element;
|
|
|
73
73
|
export declare const DistributeVerticallyIcon: JSX.Element;
|
|
74
74
|
export declare const CenterVerticallyIcon: JSX.Element;
|
|
75
75
|
export declare const CenterHorizontallyIcon: JSX.Element;
|
|
76
|
-
export declare const
|
|
76
|
+
export declare const usersIcon: JSX.Element;
|
|
77
77
|
export declare const start: JSX.Element;
|
|
78
78
|
export declare const stop: JSX.Element;
|
|
79
79
|
export declare const CloseIcon: JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./LiveCollaborationTrigger.scss";
|
|
3
|
+
declare const LiveCollaborationTrigger: {
|
|
4
|
+
({ isCollaborating, onSelect, ...rest }: {
|
|
5
|
+
isCollaborating: boolean;
|
|
6
|
+
onSelect: () => void;
|
|
7
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export default LiveCollaborationTrigger;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "./DefaultItems.scss";
|
|
2
|
+
export declare const LoadScene: {
|
|
3
|
+
(): JSX.Element | null;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const SaveToActiveFile: {
|
|
7
|
+
(): JSX.Element | null;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const SaveAsImage: {
|
|
11
|
+
(): JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const Help: {
|
|
15
|
+
(): JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const ClearCanvas: {
|
|
19
|
+
(): JSX.Element | null;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const ToggleTheme: {
|
|
23
|
+
(): JSX.Element | null;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const ChangeCanvasBackground: {
|
|
27
|
+
(): JSX.Element | null;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const Export: {
|
|
31
|
+
(): JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const Socials: {
|
|
35
|
+
(): JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const LiveCollaborationTrigger: {
|
|
39
|
+
({ onSelect, isCollaborating, }: {
|
|
40
|
+
onSelect: () => void;
|
|
41
|
+
isCollaborating: boolean;
|
|
42
|
+
}): JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|