@dwelle/excalidraw 0.4.0-d8d86cf → 0.4.0-e3bee83
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 +189 -0
- package/README.md +417 -19
- package/dist/excalidraw.development.js +427 -229
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +21 -9
- package/types/actions/actionAlign.d.ts +6 -18
- package/types/actions/actionBoundText.d.ts +9 -5
- package/types/actions/actionCanvas.d.ts +69 -45
- package/types/actions/actionClipboard.d.ts +54 -16
- package/types/actions/actionDeleteSelected.d.ts +22 -12
- package/types/actions/actionDistribute.d.ts +2 -6
- package/types/actions/actionDuplicateSelection.d.ts +1 -3
- package/types/actions/actionExport.d.ts +72 -51
- package/types/actions/actionFinalize.d.ts +15 -9
- package/types/actions/actionFlip.d.ts +2 -2
- package/types/actions/actionGroup.d.ts +4 -8
- package/types/actions/actionLinearEditor.d.ts +8 -4
- package/types/actions/actionMenu.d.ts +24 -17
- package/types/actions/actionNavigate.d.ts +2 -3
- package/types/actions/actionProperties.d.ts +106 -80
- package/types/actions/actionStyles.d.ts +7 -3
- package/types/actions/actionToggleGridMode.d.ts +9 -3
- package/types/actions/actionToggleLock.d.ts +7 -3
- package/types/actions/actionToggleStats.d.ts +8 -3
- package/types/actions/actionToggleViewMode.d.ts +9 -3
- package/types/actions/actionToggleZenMode.d.ts +9 -3
- package/types/actions/actionZindex.d.ts +4 -12
- package/types/actions/manager.d.ts +2 -1
- package/types/actions/types.d.ts +6 -5
- package/types/appState.d.ts +3 -4
- package/types/components/App.d.ts +7 -50
- package/types/components/Button.d.ts +15 -0
- package/types/components/Card.d.ts +7 -0
- package/types/components/ContextMenu.d.ts +8 -21
- package/types/components/JSONExportDialog.d.ts +3 -1
- package/types/components/LayerUI.d.ts +3 -5
- package/types/components/LibraryMenuHeaderContent.d.ts +23 -0
- package/types/components/MobileMenu.d.ts +5 -8
- 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 +47 -0
- package/types/components/main-menu/MainMenu.d.ts +55 -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 +11 -8
- package/types/data/index.d.ts +1 -1
- package/types/element/Hyperlink.d.ts +9 -7
- package/types/element/bounds.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +8 -4
- package/types/element/textElement.d.ts +7 -0
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/element/typeChecks.d.ts +9 -1
- package/types/element/types.d.ts +9 -5
- package/types/keys.d.ts +2 -0
- package/types/math.d.ts +2 -1
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/index.d.ts +12 -1
- package/types/packages/utils.d.ts +22 -25
- package/types/renderer/renderScene.d.ts +1 -3
- package/types/scene/comparisons.d.ts +1 -1
- package/types/scene/export.d.ts +143 -9
- package/types/scene/index.d.ts +1 -1
- package/types/scene/types.d.ts +9 -1
- package/types/types.d.ts +44 -24
- package/types/utils.d.ts +17 -0
- package/types/components/ActiveFile.d.ts +0 -7
- package/types/components/ClearCanvas.d.ts +0 -4
- package/types/components/CollabButton.d.ts +0 -6
- package/types/components/Footer.d.ts +0 -10
- package/types/components/MenuItem.d.ts +0 -11
- package/types/components/MenuUtils.d.ts +0 -1
- package/types/components/WelcomeScreen.d.ts +0 -10
- package/types/components/WelcomeScreenDecor.d.ts +0 -6
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const actionToggleStats: {
|
|
3
3
|
name: "stats";
|
|
4
|
+
viewMode: true;
|
|
4
5
|
trackEvent: {
|
|
5
6
|
category: "menu";
|
|
6
7
|
};
|
|
7
8
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
8
9
|
appState: {
|
|
9
10
|
showStats: boolean;
|
|
11
|
+
contextMenu: {
|
|
12
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
13
|
+
top: number;
|
|
14
|
+
left: number;
|
|
15
|
+
} | null;
|
|
10
16
|
showWelcomeScreen: boolean;
|
|
11
17
|
isLoading: boolean;
|
|
12
18
|
errorMessage: string | null;
|
|
@@ -46,10 +52,9 @@ export declare const actionToggleStats: {
|
|
|
46
52
|
currentItemFontFamily: number;
|
|
47
53
|
currentItemFontSize: number;
|
|
48
54
|
currentItemTextAlign: string;
|
|
49
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
50
55
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
51
56
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
52
|
-
|
|
57
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
53
58
|
viewBackgroundColor: string;
|
|
54
59
|
scrollX: number;
|
|
55
60
|
scrollY: number;
|
|
@@ -64,7 +69,7 @@ export declare const actionToggleStats: {
|
|
|
64
69
|
openMenu: "canvas" | "shape" | null;
|
|
65
70
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
66
71
|
openSidebar: "library" | "customSidebar" | null;
|
|
67
|
-
openDialog: "imageExport" | "help" | null;
|
|
72
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
68
73
|
isSidebarDocked: boolean;
|
|
69
74
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
70
75
|
selectedElementIds: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const actionToggleViewMode: {
|
|
3
3
|
name: "viewMode";
|
|
4
|
+
viewMode: true;
|
|
4
5
|
trackEvent: {
|
|
5
6
|
category: "canvas";
|
|
6
7
|
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
@@ -8,6 +9,11 @@ export declare const actionToggleViewMode: {
|
|
|
8
9
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
9
10
|
appState: {
|
|
10
11
|
viewModeEnabled: boolean;
|
|
12
|
+
contextMenu: {
|
|
13
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
} | null;
|
|
11
17
|
showWelcomeScreen: boolean;
|
|
12
18
|
isLoading: boolean;
|
|
13
19
|
errorMessage: string | null;
|
|
@@ -47,10 +53,9 @@ export declare const actionToggleViewMode: {
|
|
|
47
53
|
currentItemFontFamily: number;
|
|
48
54
|
currentItemFontSize: number;
|
|
49
55
|
currentItemTextAlign: string;
|
|
50
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
51
56
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
52
57
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
53
|
-
|
|
58
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
54
59
|
viewBackgroundColor: string;
|
|
55
60
|
scrollX: number;
|
|
56
61
|
scrollY: number;
|
|
@@ -65,7 +70,7 @@ export declare const actionToggleViewMode: {
|
|
|
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: {
|
|
@@ -109,6 +114,7 @@ export declare const actionToggleViewMode: {
|
|
|
109
114
|
commitToHistory: false;
|
|
110
115
|
};
|
|
111
116
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
117
|
+
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
112
118
|
contextItemLabel: string;
|
|
113
119
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
114
120
|
} & {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const actionToggleZenMode: {
|
|
3
3
|
name: "zenMode";
|
|
4
|
+
viewMode: true;
|
|
4
5
|
trackEvent: {
|
|
5
6
|
category: "canvas";
|
|
6
7
|
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
@@ -8,6 +9,11 @@ export declare const actionToggleZenMode: {
|
|
|
8
9
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
9
10
|
appState: {
|
|
10
11
|
zenModeEnabled: boolean;
|
|
12
|
+
contextMenu: {
|
|
13
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
} | null;
|
|
11
17
|
showWelcomeScreen: boolean;
|
|
12
18
|
isLoading: boolean;
|
|
13
19
|
errorMessage: string | null;
|
|
@@ -47,10 +53,9 @@ export declare const actionToggleZenMode: {
|
|
|
47
53
|
currentItemFontFamily: number;
|
|
48
54
|
currentItemFontSize: number;
|
|
49
55
|
currentItemTextAlign: string;
|
|
50
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
51
56
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
52
57
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
53
|
-
|
|
58
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
54
59
|
viewBackgroundColor: string;
|
|
55
60
|
scrollX: number;
|
|
56
61
|
scrollY: number;
|
|
@@ -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: {
|
|
@@ -109,6 +114,7 @@ export declare const actionToggleZenMode: {
|
|
|
109
114
|
commitToHistory: false;
|
|
110
115
|
};
|
|
111
116
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
117
|
+
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
112
118
|
contextItemLabel: string;
|
|
113
119
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
114
120
|
} & {
|
|
@@ -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
|
@@ -14,7 +14,7 @@ export declare type ActionResult = {
|
|
|
14
14
|
declare type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export declare type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export declare type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export declare 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" | "
|
|
17
|
+
export declare 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" | "eraser" | "bindText" | "toggleLock" | "toggleLinearEditor";
|
|
18
18
|
export declare type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -24,19 +24,20 @@ 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";
|
|
38
36
|
action?: string;
|
|
39
37
|
predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
|
|
40
38
|
};
|
|
39
|
+
/** if set to `true`, allow action to be performed in viewMode.
|
|
40
|
+
* Defaults to `false` */
|
|
41
|
+
viewMode?: boolean;
|
|
41
42
|
}
|
|
42
43
|
export {};
|
package/types/appState.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppState
|
|
1
|
+
import { AppState } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
4
|
theme?: string | undefined;
|
|
@@ -31,17 +31,16 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
31
31
|
currentItemFontFamily?: number | undefined;
|
|
32
32
|
currentItemFontSize?: number | undefined;
|
|
33
33
|
currentItemTextAlign?: string | undefined;
|
|
34
|
-
currentItemStrokeSharpness?: import("./element/types").StrokeSharpness | undefined;
|
|
35
34
|
currentItemStartArrowhead?: import("./element/types").Arrowhead | null | undefined;
|
|
36
35
|
currentItemEndArrowhead?: import("./element/types").Arrowhead | null | undefined;
|
|
37
|
-
|
|
36
|
+
currentItemRoundness?: import("./element/types").StrokeRoundness | undefined;
|
|
38
37
|
viewBackgroundColor?: string | undefined;
|
|
39
38
|
scrollX?: number | undefined;
|
|
40
39
|
scrollY?: number | undefined;
|
|
41
40
|
cursorButton?: "up" | "down" | undefined;
|
|
42
41
|
scrolledOutside?: boolean | undefined;
|
|
43
42
|
zoom?: Readonly<{
|
|
44
|
-
value: NormalizedZoomValue;
|
|
43
|
+
value: import("./types").NormalizedZoomValue;
|
|
45
44
|
}> | undefined;
|
|
46
45
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
47
46
|
openSidebar?: "library" | "customSidebar" | null | undefined;
|
|
@@ -8,52 +8,10 @@ import Scene from "../scene/Scene";
|
|
|
8
8
|
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
|
|
9
9
|
import { FileSystemHandle } from "../data/filesystem";
|
|
10
10
|
import { Emitter } from "../emitter";
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<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;
|
|
16
|
-
} & {
|
|
17
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
18
|
-
unstable_promise: true;
|
|
19
|
-
}): Value_3 | Promise<Value_3>;
|
|
20
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
21
|
-
unstable_promise: true;
|
|
22
|
-
}): Value_4 | Promise<Value_4>;
|
|
23
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
24
|
-
unstable_promise: true;
|
|
25
|
-
}): (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>;
|
|
26
|
-
}, set: {
|
|
27
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
28
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
29
|
-
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
30
|
-
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
31
|
-
} & {
|
|
32
|
-
init: boolean;
|
|
33
|
-
};
|
|
34
|
-
export declare const isDropdownOpenAtom: import("jotai").Atom<boolean> & {
|
|
35
|
-
write: (get: {
|
|
36
|
-
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
37
|
-
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
38
|
-
<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;
|
|
39
|
-
} & {
|
|
40
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
41
|
-
unstable_promise: true;
|
|
42
|
-
}): Value_3 | Promise<Value_3>;
|
|
43
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
44
|
-
unstable_promise: true;
|
|
45
|
-
}): Value_4 | Promise<Value_4>;
|
|
46
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
47
|
-
unstable_promise: true;
|
|
48
|
-
}): (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>;
|
|
49
|
-
}, set: {
|
|
50
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
51
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
52
|
-
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
53
|
-
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
54
|
-
} & {
|
|
55
|
-
init: boolean;
|
|
56
|
-
};
|
|
11
|
+
export declare const ExcalidrawContainerContext: React.Context<{
|
|
12
|
+
container: HTMLDivElement | null;
|
|
13
|
+
id?: string | null | undefined;
|
|
14
|
+
}>;
|
|
57
15
|
export declare const useDevice: () => Readonly<{
|
|
58
16
|
isSmScreen: boolean;
|
|
59
17
|
isMobile: boolean;
|
|
@@ -67,6 +25,7 @@ export declare const useExcalidrawContainer: () => {
|
|
|
67
25
|
export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawElement[];
|
|
68
26
|
export declare const useExcalidrawAppState: () => AppState;
|
|
69
27
|
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;
|
|
28
|
+
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
70
29
|
declare class App extends React.Component<AppProps, AppState> {
|
|
71
30
|
canvas: AppClassProperties["canvas"];
|
|
72
31
|
rc: RoughCanvas | null;
|
|
@@ -90,7 +49,6 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
90
49
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
91
50
|
lastPointerDown: React.PointerEvent<HTMLCanvasElement> | null;
|
|
92
51
|
lastPointerUp: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
93
|
-
contextMenuOpen: boolean;
|
|
94
52
|
lastScenePointer: {
|
|
95
53
|
x: number;
|
|
96
54
|
y: number;
|
|
@@ -284,7 +242,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
284
242
|
private static resetTapTwice;
|
|
285
243
|
private onTapStart;
|
|
286
244
|
private onTapEnd;
|
|
287
|
-
|
|
245
|
+
pasteFromClipboard: (event: ClipboardEvent | null) => Promise<void>;
|
|
288
246
|
private addElementsFromPasteOrLibrary;
|
|
289
247
|
private addTextFromPaste;
|
|
290
248
|
setAppState: React.Component<any, AppState>["setState"];
|
|
@@ -396,8 +354,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
396
354
|
private handleCanvasContextMenu;
|
|
397
355
|
private maybeDragNewGenericElement;
|
|
398
356
|
private maybeHandleResize;
|
|
399
|
-
|
|
400
|
-
private _openContextMenu;
|
|
357
|
+
private getContextMenuItems;
|
|
401
358
|
private handleWheel;
|
|
402
359
|
private getTextWysiwygSnappedToCenterPosition;
|
|
403
360
|
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,28 +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 type ContextMenuParams = {
|
|
17
|
-
options: (ContextMenuOption | false | null | undefined)[];
|
|
18
|
-
top: ContextMenuProps["top"];
|
|
19
|
-
left: ContextMenuProps["left"];
|
|
20
|
-
actionManager: ContextMenuProps["actionManager"];
|
|
21
|
-
appState: Readonly<AppState>;
|
|
22
|
-
container: HTMLElement;
|
|
23
|
-
elements: readonly NonDeletedExcalidrawElement[];
|
|
24
|
-
};
|
|
25
|
-
declare const _default: {
|
|
26
|
-
push(params: ContextMenuParams): void;
|
|
27
12
|
};
|
|
28
|
-
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ActionManager } from "../actions/manager";
|
|
3
|
-
import { NonDeletedExcalidrawElement
|
|
3
|
+
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
4
4
|
import { Language } from "../i18n";
|
|
5
5
|
import { AppProps, AppState, ExcalidrawProps, BinaryFiles } from "../types";
|
|
6
6
|
import Library from "../data/library";
|
|
@@ -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"];
|
|
@@ -34,7 +32,7 @@ interface LayerUIProps {
|
|
|
34
32
|
}) => void;
|
|
35
33
|
renderWelcomeScreen: boolean;
|
|
36
34
|
onHomeButtonClick: () => void;
|
|
37
|
-
|
|
35
|
+
children?: React.ReactNode;
|
|
38
36
|
}
|
|
39
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas,
|
|
37
|
+
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, onHomeButtonClick, children, }: LayerUIProps) => JSX.Element>;
|
|
40
38
|
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,7 +1,7 @@
|
|
|
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
|
-
import { NonDeletedExcalidrawElement
|
|
4
|
+
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
declare type MobileMenuProps = {
|
|
6
6
|
appState: AppState;
|
|
7
7
|
actionManager: ActionManager;
|
|
@@ -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,9 +19,9 @@ 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
|
onHomeButtonClick: () => void;
|
|
27
|
-
onThemeToggle: (theme: Theme) => void;
|
|
28
25
|
};
|
|
29
|
-
export declare const MobileMenu: ({ appState, elements, actionManager,
|
|
26
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderMenu, welcomeScreenCenter, onHomeButtonClick, }: MobileMenuProps) => JSX.Element;
|
|
30
27
|
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;
|