@dwelle/excalidraw 0.4.0-e1bdbb6 → 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 +418 -20
- package/dist/excalidraw.development.js +649 -341
- 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 +76 -52
- package/types/actions/actionClipboard.d.ts +63 -16
- package/types/actions/actionDeleteSelected.d.ts +31 -12
- package/types/actions/actionDistribute.d.ts +2 -6
- package/types/actions/actionDuplicateSelection.d.ts +1 -3
- package/types/actions/actionExport.d.ts +79 -58
- 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 +9 -10
- package/types/clipboard.d.ts +6 -1
- package/types/components/App.d.ts +9 -51
- 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 +3 -2
- package/types/element/linearElementEditor.d.ts +39 -8
- package/types/element/newElement.d.ts +2 -2
- package/types/element/resizeElements.d.ts +0 -1
- package/types/element/textElement.d.ts +24 -2
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/element/transformHandles.d.ts +2 -3
- package/types/element/typeChecks.d.ts +10 -1
- package/types/element/types.d.ts +11 -4
- 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/renderElement.d.ts +4 -3
- package/types/renderer/renderScene.d.ts +1 -3
- package/types/scene/Fonts.d.ts +21 -0
- package/types/scene/Scene.d.ts +15 -0
- package/types/scene/comparisons.d.ts +2 -3
- 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
|
@@ -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,47 @@
|
|
|
1
|
+
import "./DefaultItems.scss";
|
|
2
|
+
import { Theme } from "../../element/types";
|
|
3
|
+
export declare const LoadScene: {
|
|
4
|
+
(): JSX.Element | null;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const SaveToActiveFile: {
|
|
8
|
+
(): JSX.Element | null;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const SaveAsImage: {
|
|
12
|
+
(): JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const Help: {
|
|
16
|
+
(): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const ClearCanvas: {
|
|
20
|
+
(): JSX.Element | null;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const ToggleTheme: {
|
|
24
|
+
(props?: {
|
|
25
|
+
onSelect?: ((theme: Theme) => void | boolean) | undefined;
|
|
26
|
+
} | undefined): JSX.Element | null;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const ChangeCanvasBackground: {
|
|
30
|
+
(): JSX.Element | null;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const Export: {
|
|
34
|
+
(): JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const Socials: {
|
|
38
|
+
(): JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const LiveCollaborationTrigger: {
|
|
42
|
+
({ onSelect, isCollaborating, }: {
|
|
43
|
+
onSelect: () => void;
|
|
44
|
+
isCollaborating: boolean;
|
|
45
|
+
}): JSX.Element;
|
|
46
|
+
displayName: string;
|
|
47
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as DefaultItems from "./DefaultItems";
|
|
3
|
+
declare const MainMenu: {
|
|
4
|
+
({ children }: {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
Trigger: {
|
|
8
|
+
({ className, children, onToggle, }: {
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
onToggle: () => void;
|
|
12
|
+
}): JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Item: {
|
|
16
|
+
({ icon, onSelect, children, shortcut, className, ...rest }: {
|
|
17
|
+
icon?: JSX.Element | undefined;
|
|
18
|
+
onSelect: () => void;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
shortcut?: string | undefined;
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
ItemLink: {
|
|
26
|
+
({ icon, shortcut, href, children, className, ...rest }: {
|
|
27
|
+
icon?: JSX.Element | undefined;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
shortcut?: string | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
href: string;
|
|
32
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
ItemCustom: ({ children, className, ...rest }: {
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
} & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
39
|
+
Group: {
|
|
40
|
+
({ children, className, style, title, }: {
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
style?: React.CSSProperties | undefined;
|
|
44
|
+
title?: string | undefined;
|
|
45
|
+
}): JSX.Element;
|
|
46
|
+
displayName: string;
|
|
47
|
+
};
|
|
48
|
+
Separator: {
|
|
49
|
+
(): JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
DefaultItems: typeof DefaultItems;
|
|
53
|
+
displayName: string;
|
|
54
|
+
};
|
|
55
|
+
export default MainMenu;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Center: {
|
|
3
|
+
({ children }: {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
Logo: {
|
|
8
|
+
({ children }: {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
Heading: {
|
|
14
|
+
({ children }: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Menu: {
|
|
20
|
+
({ children }: {
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
MenuItem: {
|
|
26
|
+
({ onSelect, children, icon, shortcut, className, ...props }: {
|
|
27
|
+
onSelect: () => void;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
icon?: JSX.Element | undefined;
|
|
30
|
+
shortcut?: string | null | undefined;
|
|
31
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
MenuItemLink: {
|
|
35
|
+
({ children, href, icon, shortcut, className, ...props }: {
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
href: string;
|
|
38
|
+
icon?: JSX.Element | undefined;
|
|
39
|
+
shortcut?: string | null | undefined;
|
|
40
|
+
} & import("react").AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
MenuItemHelp: {
|
|
44
|
+
(): JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
MenuItemLoadScene: {
|
|
48
|
+
(): JSX.Element | null;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
MenuItemLiveCollaborationTrigger: {
|
|
52
|
+
({ onSelect, }: {
|
|
53
|
+
onSelect: () => any;
|
|
54
|
+
}): JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export { Center };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const MenuHint: {
|
|
2
|
+
({ children }: {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
}): JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
declare const ToolbarHint: {
|
|
8
|
+
({ children }: {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const HelpHint: {
|
|
14
|
+
({ children }: {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
export { HelpHint, MenuHint, ToolbarHint };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./WelcomeScreen.scss";
|
|
3
|
+
declare const WelcomeScreen: {
|
|
4
|
+
(props: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): null;
|
|
7
|
+
displayName: string;
|
|
8
|
+
Center: {
|
|
9
|
+
({ children }: {
|
|
10
|
+
children?: import("react").ReactNode;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
Logo: {
|
|
14
|
+
({ children }: {
|
|
15
|
+
children?: import("react").ReactNode;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Heading: {
|
|
20
|
+
({ children }: {
|
|
21
|
+
children: import("react").ReactNode;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
Menu: {
|
|
26
|
+
({ children }: {
|
|
27
|
+
children?: import("react").ReactNode;
|
|
28
|
+
}): JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
MenuItem: {
|
|
32
|
+
({ onSelect, children, icon, shortcut, className, ...props }: {
|
|
33
|
+
onSelect: () => void;
|
|
34
|
+
children: import("react").ReactNode;
|
|
35
|
+
icon?: JSX.Element | undefined;
|
|
36
|
+
shortcut?: string | null | undefined;
|
|
37
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
MenuItemLink: {
|
|
41
|
+
({ children, href, icon, shortcut, className, ...props }: {
|
|
42
|
+
children: import("react").ReactNode;
|
|
43
|
+
href: string;
|
|
44
|
+
icon?: JSX.Element | undefined;
|
|
45
|
+
shortcut?: string | null | undefined;
|
|
46
|
+
} & import("react").AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
MenuItemHelp: {
|
|
50
|
+
(): JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
MenuItemLoadScene: {
|
|
54
|
+
(): JSX.Element | null;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
MenuItemLiveCollaborationTrigger: {
|
|
58
|
+
({ onSelect, }: {
|
|
59
|
+
onSelect: () => any;
|
|
60
|
+
}): JSX.Element;
|
|
61
|
+
displayName: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
Hints: {
|
|
65
|
+
MenuHint: {
|
|
66
|
+
({ children }: {
|
|
67
|
+
children?: import("react").ReactNode;
|
|
68
|
+
}): JSX.Element;
|
|
69
|
+
displayName: string;
|
|
70
|
+
};
|
|
71
|
+
ToolbarHint: {
|
|
72
|
+
({ children }: {
|
|
73
|
+
children?: import("react").ReactNode;
|
|
74
|
+
}): JSX.Element;
|
|
75
|
+
displayName: string;
|
|
76
|
+
};
|
|
77
|
+
HelpHint: {
|
|
78
|
+
({ children }: {
|
|
79
|
+
children?: import("react").ReactNode;
|
|
80
|
+
}): JSX.Element;
|
|
81
|
+
displayName: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export default WelcomeScreen;
|
package/types/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppProps } from "./types";
|
|
1
|
+
import { AppProps, NormalizedZoomValue } from "./types";
|
|
2
2
|
import { FontFamilyValues } from "./element/types";
|
|
3
3
|
export declare const APP_NAME = "Excalidraw";
|
|
4
4
|
export declare const DRAGGING_THRESHOLD = 10;
|
|
@@ -53,6 +53,7 @@ export declare enum EVENT {
|
|
|
53
53
|
export declare const ENV: {
|
|
54
54
|
TEST: string;
|
|
55
55
|
DEVELOPMENT: string;
|
|
56
|
+
PRODUCTION: string;
|
|
56
57
|
};
|
|
57
58
|
export declare const CLASSES: {
|
|
58
59
|
SHAPE_ACTIONS_MENU: string;
|
|
@@ -72,6 +73,9 @@ export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
|
|
|
72
73
|
export declare const DEFAULT_TEXT_ALIGN = "left";
|
|
73
74
|
export declare const DEFAULT_VERTICAL_ALIGN = "top";
|
|
74
75
|
export declare const DEFAULT_VERSION = "{version}";
|
|
76
|
+
export declare const DEFAULT_BACKGROUND_COLOR = "#ffffff";
|
|
77
|
+
export declare const DEFAULT_STROKE_COLOR = "#000000";
|
|
78
|
+
export declare const DEFAULT_ZOOM_VALUE: NormalizedZoomValue;
|
|
75
79
|
export declare const CANVAS_ONLY_ACTIONS: string[];
|
|
76
80
|
export declare const GRID_SIZE = 20;
|
|
77
81
|
export declare const MIME_TYPES: {
|
|
@@ -106,11 +110,6 @@ export declare const MIN_ZOOM = 0.1;
|
|
|
106
110
|
export declare const HYPERLINK_TOOLTIP_DELAY = 300;
|
|
107
111
|
export declare const IDLE_THRESHOLD = 60000;
|
|
108
112
|
export declare const ACTIVE_THRESHOLD = 3000;
|
|
109
|
-
export declare const MODES: {
|
|
110
|
-
VIEW: string;
|
|
111
|
-
ZEN: string;
|
|
112
|
-
GRID: string;
|
|
113
|
-
};
|
|
114
113
|
export declare const THEME_FILTER: any;
|
|
115
114
|
export declare const URL_QUERY_KEYS: {
|
|
116
115
|
readonly addLibrary: "addLibrary";
|
|
@@ -149,8 +148,12 @@ export declare const TEXT_ALIGN: {
|
|
|
149
148
|
RIGHT: string;
|
|
150
149
|
};
|
|
151
150
|
export declare const ELEMENT_READY_TO_ERASE_OPACITY = 20;
|
|
152
|
-
export declare const
|
|
153
|
-
|
|
151
|
+
export declare const DEFAULT_PROPORTIONAL_RADIUS = 0.25;
|
|
152
|
+
export declare const DEFAULT_ADAPTIVE_RADIUS = 32;
|
|
153
|
+
export declare const ROUNDNESS: {
|
|
154
|
+
readonly LEGACY: 1;
|
|
155
|
+
readonly PROPORTIONAL_RADIUS: 2;
|
|
156
|
+
readonly ADAPTIVE_RADIUS: 3;
|
|
154
157
|
};
|
|
155
158
|
/** key containt id of precedeing elemnt id we use in reconciliation during
|
|
156
159
|
* collaboration */
|
package/types/data/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { AppState, BinaryFiles } from "../types";
|
|
|
4
4
|
import { FileSystemHandle } from "./filesystem";
|
|
5
5
|
export { loadFromBlob } from "./blob";
|
|
6
6
|
export { loadFromJSON, saveAsJSON } from "./json";
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const exportAsImage: (type: Omit<ExportType, "backend">, elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, }: {
|
|
8
8
|
exportBackground: boolean;
|
|
9
9
|
exportPadding?: number | undefined;
|
|
10
10
|
viewBackgroundColor: string;
|
|
@@ -18,6 +18,11 @@ export declare const actionLink: {
|
|
|
18
18
|
appState: {
|
|
19
19
|
showHyperlinkPopup: "editor";
|
|
20
20
|
openMenu: null;
|
|
21
|
+
contextMenu: {
|
|
22
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
23
|
+
top: number;
|
|
24
|
+
left: number;
|
|
25
|
+
} | null;
|
|
21
26
|
showWelcomeScreen: boolean;
|
|
22
27
|
isLoading: boolean;
|
|
23
28
|
errorMessage: string | null;
|
|
@@ -57,10 +62,9 @@ export declare const actionLink: {
|
|
|
57
62
|
currentItemFontFamily: number;
|
|
58
63
|
currentItemFontSize: number;
|
|
59
64
|
currentItemTextAlign: string;
|
|
60
|
-
currentItemStrokeSharpness: import("./types").StrokeSharpness;
|
|
61
65
|
currentItemStartArrowhead: import("./types").Arrowhead | null;
|
|
62
66
|
currentItemEndArrowhead: import("./types").Arrowhead | null;
|
|
63
|
-
|
|
67
|
+
currentItemRoundness: import("./types").StrokeRoundness;
|
|
64
68
|
viewBackgroundColor: string;
|
|
65
69
|
scrollX: number;
|
|
66
70
|
scrollY: number;
|
|
@@ -74,7 +78,7 @@ export declare const actionLink: {
|
|
|
74
78
|
}>;
|
|
75
79
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
76
80
|
openSidebar: "library" | "customSidebar" | null;
|
|
77
|
-
openDialog: "imageExport" | "help" | null;
|
|
81
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
78
82
|
isSidebarDocked: boolean;
|
|
79
83
|
lastPointerDownWith: import("./types").PointerType;
|
|
80
84
|
selectedElementIds: {
|
|
@@ -123,10 +127,8 @@ export declare const actionLink: {
|
|
|
123
127
|
};
|
|
124
128
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
125
129
|
contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
|
|
126
|
-
|
|
127
|
-
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps
|
|
128
|
-
isInHamburgerMenu: boolean;
|
|
129
|
-
}) => JSX.Element;
|
|
130
|
+
predicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
|
|
131
|
+
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
|
|
130
132
|
} & {
|
|
131
133
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
132
134
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, NonDeleted } from "./types";
|
|
2
2
|
import { Drawable, Op } from "roughjs/bin/core";
|
|
3
3
|
export declare type Bounds = readonly [number, number, number, number];
|
|
4
|
-
export declare const getElementAbsoluteCoords: (element: ExcalidrawElement) =>
|
|
4
|
+
export declare const getElementAbsoluteCoords: (element: ExcalidrawElement, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
5
5
|
export declare const pointRelativeTo: (element: ExcalidrawElement, absoluteCoords: readonly [number, number]) => readonly [number, number];
|
|
6
6
|
export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
|
|
7
7
|
export declare const getCurvePathOps: (shape: Drawable) => Op[];
|
|
8
|
+
export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((x: number, y: number) => [number, number]) | undefined) => [number, number, number, number];
|
|
8
9
|
export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
|
|
9
10
|
export declare const getElementBounds: (element: ExcalidrawElement) => [number, number, number, number];
|
|
10
11
|
export declare const getCommonBounds: (elements: readonly ExcalidrawElement[]) => [number, number, number, number];
|
|
11
12
|
export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number, normalizePoints: boolean) => [number, number, number, number];
|
|
12
|
-
export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[]
|
|
13
|
+
export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[]) => [number, number, number, number];
|
|
13
14
|
export declare const getClosestElementBounds: (elements: readonly ExcalidrawElement[], from: {
|
|
14
15
|
x: number;
|
|
15
16
|
y: number;
|