@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.
Files changed (89) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/README.md +417 -19
  3. package/dist/excalidraw.development.js +427 -229
  4. package/dist/excalidraw.production.min.js +1 -1
  5. package/package.json +1 -1
  6. package/types/actions/actionAddToLibrary.d.ts +21 -9
  7. package/types/actions/actionAlign.d.ts +6 -18
  8. package/types/actions/actionBoundText.d.ts +9 -5
  9. package/types/actions/actionCanvas.d.ts +69 -45
  10. package/types/actions/actionClipboard.d.ts +54 -16
  11. package/types/actions/actionDeleteSelected.d.ts +22 -12
  12. package/types/actions/actionDistribute.d.ts +2 -6
  13. package/types/actions/actionDuplicateSelection.d.ts +1 -3
  14. package/types/actions/actionExport.d.ts +72 -51
  15. package/types/actions/actionFinalize.d.ts +15 -9
  16. package/types/actions/actionFlip.d.ts +2 -2
  17. package/types/actions/actionGroup.d.ts +4 -8
  18. package/types/actions/actionLinearEditor.d.ts +8 -4
  19. package/types/actions/actionMenu.d.ts +24 -17
  20. package/types/actions/actionNavigate.d.ts +2 -3
  21. package/types/actions/actionProperties.d.ts +106 -80
  22. package/types/actions/actionStyles.d.ts +7 -3
  23. package/types/actions/actionToggleGridMode.d.ts +9 -3
  24. package/types/actions/actionToggleLock.d.ts +7 -3
  25. package/types/actions/actionToggleStats.d.ts +8 -3
  26. package/types/actions/actionToggleViewMode.d.ts +9 -3
  27. package/types/actions/actionToggleZenMode.d.ts +9 -3
  28. package/types/actions/actionZindex.d.ts +4 -12
  29. package/types/actions/manager.d.ts +2 -1
  30. package/types/actions/types.d.ts +6 -5
  31. package/types/appState.d.ts +3 -4
  32. package/types/components/App.d.ts +7 -50
  33. package/types/components/Button.d.ts +15 -0
  34. package/types/components/Card.d.ts +7 -0
  35. package/types/components/ContextMenu.d.ts +8 -21
  36. package/types/components/JSONExportDialog.d.ts +3 -1
  37. package/types/components/LayerUI.d.ts +3 -5
  38. package/types/components/LibraryMenuHeaderContent.d.ts +23 -0
  39. package/types/components/MobileMenu.d.ts +5 -8
  40. package/types/components/UserList.d.ts +0 -2
  41. package/types/components/dropdownMenu/DropdownMenu.d.ts +64 -0
  42. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +11 -0
  43. package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  44. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +13 -0
  45. package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
  46. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
  47. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +12 -0
  48. package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  49. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +9 -0
  50. package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  51. package/types/components/footer/Footer.d.ts +13 -0
  52. package/types/components/footer/FooterCenter.d.ts +8 -0
  53. package/types/components/icons.d.ts +1 -1
  54. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
  55. package/types/components/main-menu/DefaultItems.d.ts +47 -0
  56. package/types/components/main-menu/MainMenu.d.ts +55 -0
  57. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
  58. package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  59. package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
  60. package/types/constants.d.ts +11 -8
  61. package/types/data/index.d.ts +1 -1
  62. package/types/element/Hyperlink.d.ts +9 -7
  63. package/types/element/bounds.d.ts +1 -1
  64. package/types/element/linearElementEditor.d.ts +8 -4
  65. package/types/element/textElement.d.ts +7 -0
  66. package/types/element/textWysiwyg.d.ts +6 -1
  67. package/types/element/typeChecks.d.ts +9 -1
  68. package/types/element/types.d.ts +9 -5
  69. package/types/keys.d.ts +2 -0
  70. package/types/math.d.ts +2 -1
  71. package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
  72. package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
  73. package/types/packages/excalidraw/index.d.ts +12 -1
  74. package/types/packages/utils.d.ts +22 -25
  75. package/types/renderer/renderScene.d.ts +1 -3
  76. package/types/scene/comparisons.d.ts +1 -1
  77. package/types/scene/export.d.ts +143 -9
  78. package/types/scene/index.d.ts +1 -1
  79. package/types/scene/types.d.ts +9 -1
  80. package/types/types.d.ts +44 -24
  81. package/types/utils.d.ts +17 -0
  82. package/types/components/ActiveFile.d.ts +0 -7
  83. package/types/components/ClearCanvas.d.ts +0 -4
  84. package/types/components/CollabButton.d.ts +0 -6
  85. package/types/components/Footer.d.ts +0 -10
  86. package/types/components/MenuItem.d.ts +0 -11
  87. package/types/components/MenuUtils.d.ts +0 -1
  88. package/types/components/WelcomeScreen.d.ts +0 -10
  89. package/types/components/WelcomeScreenDecor.d.ts +0 -6
@@ -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,6 @@
1
+ declare const MenuItemContent: ({ icon, shortcut, children, }: {
2
+ icon?: JSX.Element | undefined;
3
+ shortcut?: string | undefined;
4
+ children: React.ReactNode;
5
+ }) => JSX.Element;
6
+ export default MenuItemContent;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ declare const DropdownMenuItemCustom: ({ children, className, ...rest }: {
3
+ children: React.ReactNode;
4
+ className?: string | undefined;
5
+ } & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
6
+ export default DropdownMenuItemCustom;
@@ -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,5 @@
1
+ declare const MenuSeparator: {
2
+ (): JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default MenuSeparator;
@@ -0,0 +1,9 @@
1
+ declare const MenuTrigger: {
2
+ ({ className, children, onToggle, }: {
3
+ className?: string | undefined;
4
+ children: React.ReactNode;
5
+ onToggle: () => void;
6
+ }): JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export default MenuTrigger;
@@ -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;
@@ -0,0 +1,8 @@
1
+ import "./FooterCenter.scss";
2
+ declare const FooterCenter: {
3
+ ({ children }: {
4
+ children?: React.ReactNode;
5
+ }): JSX.Element;
6
+ displayName: string;
7
+ };
8
+ export default FooterCenter;
@@ -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 UsersIcon: JSX.Element;
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;
@@ -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 COOKIES: {
153
- readonly AUTH_STATE_COOKIE: "excplus-auth";
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 */
@@ -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 exportCanvas: (type: Omit<ExportType, "backend">, elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, }: {
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
- currentItemLinearStrokeSharpness: import("./types").StrokeSharpness;
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
- contextItemPredicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
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
  };
@@ -10,7 +10,7 @@ export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shap
10
10
  export declare const getElementBounds: (element: ExcalidrawElement) => [number, number, number, number];
11
11
  export declare const getCommonBounds: (elements: readonly ExcalidrawElement[]) => [number, number, number, number];
12
12
  export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number, normalizePoints: boolean) => [number, number, number, number];
13
- export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[], sharpness: ExcalidrawElement["strokeSharpness"]) => [number, number, number, number];
13
+ export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[]) => [number, number, number, number];
14
14
  export declare const getClosestElementBounds: (elements: readonly ExcalidrawElement[], from: {
15
15
  x: number;
16
16
  y: number;
@@ -123,6 +123,11 @@ export declare class LinearElementEditor {
123
123
  hoverPointIndex: number;
124
124
  segmentMidPointHoveredCoords: readonly [number, number] | null;
125
125
  };
126
+ contextMenu: {
127
+ items: import("../components/ContextMenu").ContextMenuItems;
128
+ top: number;
129
+ left: number;
130
+ } | null;
126
131
  showWelcomeScreen: boolean;
127
132
  isLoading: boolean;
128
133
  errorMessage: string | null;
@@ -161,10 +166,9 @@ export declare class LinearElementEditor {
161
166
  currentItemFontFamily: number;
162
167
  currentItemFontSize: number;
163
168
  currentItemTextAlign: string;
164
- currentItemStrokeSharpness: import("./types").StrokeSharpness;
165
169
  currentItemStartArrowhead: import("./types").Arrowhead | null;
166
170
  currentItemEndArrowhead: import("./types").Arrowhead | null;
167
- currentItemLinearStrokeSharpness: import("./types").StrokeSharpness;
171
+ currentItemRoundness: import("./types").StrokeRoundness;
168
172
  viewBackgroundColor: string;
169
173
  scrollX: number;
170
174
  scrollY: number;
@@ -179,7 +183,7 @@ export declare class LinearElementEditor {
179
183
  openMenu: "canvas" | "shape" | null;
180
184
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
181
185
  openSidebar: "library" | "customSidebar" | null;
182
- openDialog: "imageExport" | "help" | null;
186
+ openDialog: "imageExport" | "help" | "jsonExport" | null;
183
187
  isSidebarDocked: boolean;
184
188
  lastPointerDownWith: import("./types").PointerType;
185
189
  selectedElementIds: {
@@ -192,7 +196,7 @@ export declare class LinearElementEditor {
192
196
  toast: {
193
197
  message: string;
194
198
  closable?: boolean | undefined;
195
- duration?: number | undefined;
199
+ duration?: number | undefined; /** @returns whether point was dragged */
196
200
  } | null;
197
201
  zenModeEnabled: boolean;
198
202
  theme: string;
@@ -9,8 +9,15 @@ export declare const measureText: (text: string, font: FontString, maxWidth?: nu
9
9
  width: number;
10
10
  height: number;
11
11
  baseline: number;
12
+ container: HTMLDivElement;
13
+ } | {
14
+ width: number;
15
+ height: number;
16
+ baseline: number;
17
+ container?: undefined;
12
18
  };
13
19
  export declare const getApproxLineHeight: (font: FontString) => number;
20
+ export declare const getTextWidth: (text: string, font: FontString) => number;
14
21
  export declare const wrapText: (text: string, font: FontString, maxWidth: number) => string;
15
22
  export declare const charWidth: {
16
23
  calculate: (char: string, font: FontString) => number;
@@ -1,5 +1,10 @@
1
- import { ExcalidrawElement, ExcalidrawTextElement } from "./types";
1
+ import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawTextContainer } from "./types";
2
2
  import App from "../components/App";
3
+ export declare const updateOriginalContainerCache: (id: ExcalidrawTextContainer["id"], height: ExcalidrawTextContainer["height"]) => {
4
+ height: ExcalidrawTextContainer["height"];
5
+ };
6
+ export declare const resetOriginalContainerCache: (id: ExcalidrawTextContainer["id"]) => void;
7
+ export declare const getOriginalContainerHeightFromCache: (id: ExcalidrawTextContainer["id"]) => number | null;
3
8
  export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, }: {
4
9
  id: ExcalidrawElement["id"];
5
10
  onChange?: ((text: string) => void) | undefined;
@@ -1,5 +1,5 @@
1
1
  import { AppState } from "../types";
2
- import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawGenericElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer } from "./types";
2
+ import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawGenericElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, RoundnessType } from "./types";
3
3
  export declare const isGenericElement: (element: ExcalidrawElement | null) => element is ExcalidrawGenericElement;
4
4
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
5
5
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
@@ -16,3 +16,11 @@ export declare const isTextBindableContainer: (element: ExcalidrawElement | null
16
16
  export declare const isExcalidrawElement: (element: any) => boolean;
17
17
  export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is ExcalidrawBindableElement;
18
18
  export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
19
+ export declare const isUsingAdaptiveRadius: (type: string) => boolean;
20
+ export declare const isUsingProportionalRadius: (type: string) => boolean;
21
+ export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
22
+ export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElement) => {
23
+ type: 2;
24
+ } | {
25
+ type: 3;
26
+ } | null;
@@ -1,5 +1,5 @@
1
1
  import { Point } from "../types";
2
- import { FONT_FAMILY, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
2
+ import { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
3
3
  export declare type ChartType = "bar" | "line";
4
4
  export declare type FillStyle = "hachure" | "cross-hatch" | "solid";
5
5
  export declare type FontFamilyKeys = keyof typeof FONT_FAMILY;
@@ -10,7 +10,8 @@ export declare type FontString = string & {
10
10
  };
11
11
  export declare type GroupId = string;
12
12
  export declare type PointerType = "mouse" | "pen" | "touch";
13
- export declare type StrokeSharpness = "round" | "sharp";
13
+ export declare type StrokeRoundness = "round" | "sharp";
14
+ export declare type RoundnessType = ValueOf<typeof ROUNDNESS>;
14
15
  export declare type StrokeStyle = "solid" | "dashed" | "dotted";
15
16
  export declare type TextAlign = typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
16
17
  declare type VerticalAlignKeys = keyof typeof VERTICAL_ALIGN;
@@ -24,7 +25,10 @@ declare type _ExcalidrawElementBase = Readonly<{
24
25
  fillStyle: FillStyle;
25
26
  strokeWidth: number;
26
27
  strokeStyle: StrokeStyle;
27
- strokeSharpness: StrokeSharpness;
28
+ roundness: null | {
29
+ type: RoundnessType;
30
+ value?: number;
31
+ };
28
32
  roughness: number;
29
33
  opacity: number;
30
34
  width: number;
@@ -102,7 +106,7 @@ export declare type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
102
106
  originalText: string;
103
107
  }>;
104
108
  export declare type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement;
105
- export declare type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawImageElement | ExcalidrawArrowEleement;
109
+ export declare type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawImageElement | ExcalidrawArrowElement;
106
110
  export declare type ExcalidrawTextElementWithContainer = {
107
111
  containerId: ExcalidrawTextContainer["id"];
108
112
  } & ExcalidrawTextElement;
@@ -121,7 +125,7 @@ export declare type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<
121
125
  startArrowhead: Arrowhead | null;
122
126
  endArrowhead: Arrowhead | null;
123
127
  }>;
124
- export declare type ExcalidrawArrowEleement = ExcalidrawLinearElement & Readonly<{
128
+ export declare type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
125
129
  type: "arrow";
126
130
  }>;
127
131
  export declare type ExcalidrawFreeDrawElement = _ExcalidrawElementBase & Readonly<{
package/types/keys.d.ts CHANGED
@@ -27,6 +27,8 @@ export declare const KEYS: {
27
27
  readonly ARROW_LEFT: "ArrowLeft";
28
28
  readonly ARROW_RIGHT: "ArrowRight";
29
29
  readonly ARROW_UP: "ArrowUp";
30
+ readonly PAGE_UP: "PageUp";
31
+ readonly PAGE_DOWN: "PageDown";
30
32
  readonly BACKSPACE: "Backspace";
31
33
  readonly ALT: "Alt";
32
34
  readonly CTRL_OR_CMD: "metaKey" | "ctrlKey";