@excalidraw-modify/common 0.18.0-8b71db27 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +19 -19
  2. package/dist/dev/index.js +1121 -302
  3. package/dist/dev/index.js.map +4 -4
  4. package/dist/prod/index.js +3 -3
  5. package/dist/types/common/src/colors.d.ts +59 -39
  6. package/dist/types/common/src/constants.d.ts +5 -2
  7. package/dist/types/common/src/editorInterface.d.ts +1 -1
  8. package/dist/types/common/src/index.d.ts +0 -1
  9. package/dist/types/common/src/utils.d.ts +12 -9
  10. package/dist/types/element/src/Scene.d.ts +4 -4
  11. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  12. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  13. package/dist/types/element/src/binding.d.ts +9 -3
  14. package/dist/types/element/src/collision.d.ts +4 -3
  15. package/dist/types/element/src/comparisons.d.ts +5 -5
  16. package/dist/types/element/src/distribute.d.ts +2 -1
  17. package/dist/types/element/src/frame.d.ts +2 -2
  18. package/dist/types/element/src/index.d.ts +2 -0
  19. package/dist/types/element/src/linearElementEditor.d.ts +2 -0
  20. package/dist/types/element/src/renderElement.d.ts +0 -6
  21. package/dist/types/element/src/shape.d.ts +5 -4
  22. package/dist/types/element/src/typeChecks.d.ts +2 -2
  23. package/dist/types/element/src/zindex.d.ts +1 -1
  24. package/dist/types/excalidraw/actions/actionCanvas.d.ts +2 -2
  25. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +2 -0
  26. package/dist/types/excalidraw/actions/actionExport.d.ts +1 -1
  27. package/dist/types/excalidraw/actions/actionFrame.d.ts +35 -35
  28. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +37 -35
  29. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  30. package/dist/types/excalidraw/appState.d.ts +1 -1
  31. package/dist/types/excalidraw/clipboard.d.ts +4 -2
  32. package/dist/types/excalidraw/components/App.d.ts +16 -19
  33. package/dist/types/excalidraw/components/Card.d.ts +1 -2
  34. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  35. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
  36. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -1
  37. package/dist/types/excalidraw/components/FilledButton.d.ts +1 -0
  38. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  39. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  40. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  41. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  42. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  43. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  44. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  45. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  46. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  47. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -28
  48. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +2 -1
  49. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  50. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  51. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  52. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  53. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +14 -13
  54. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  55. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  56. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  57. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  58. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  59. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +24 -0
  60. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  61. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  62. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -16
  63. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
  64. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -12
  65. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  66. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
  67. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  68. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  69. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  70. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  71. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  72. package/dist/types/excalidraw/components/icons.d.ts +8 -1
  73. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +15 -0
  74. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -12
  75. package/dist/types/excalidraw/components/shapes.d.ts +1 -1
  76. package/dist/types/excalidraw/data/blob.d.ts +314 -2
  77. package/dist/types/excalidraw/data/json.d.ts +157 -1
  78. package/dist/types/excalidraw/data/restore.d.ts +22 -16
  79. package/dist/types/excalidraw/errors.d.ts +14 -0
  80. package/dist/types/excalidraw/index.d.ts +4 -2
  81. package/dist/types/excalidraw/scene/Renderer.d.ts +2 -1
  82. package/dist/types/excalidraw/scene/normalize.d.ts +1 -1
  83. package/dist/types/excalidraw/scene/types.d.ts +7 -2
  84. package/dist/types/excalidraw/snapping.d.ts +1 -1
  85. package/dist/types/excalidraw/types.d.ts +11 -3
  86. package/dist/types/math/src/range.d.ts +1 -3
  87. package/package.json +7 -1
  88. package/dist/types/common/src/visualdebug.d.ts +0 -41
@@ -1,10 +1,9 @@
1
1
  import React from "react";
2
2
  import "./DropdownMenu.scss";
3
3
  declare const DropdownMenu: {
4
- ({ children, open, placement, }: {
4
+ ({ children, open, }: {
5
5
  children?: React.ReactNode;
6
6
  open: boolean;
7
- placement?: "top" | "bottom";
8
7
  }): import("react/jsx-runtime").JSX.Element;
9
8
  Trigger: {
10
9
  ({ className, children, onToggle, title, ...rest }: {
@@ -16,29 +15,19 @@ declare const DropdownMenu: {
16
15
  displayName: string;
17
16
  };
18
17
  Content: {
19
- ({ children, onClickOutside, className, onSelect, style, placement, }: {
18
+ ({ children, onClickOutside, className, onSelect, open, align, style, }: {
20
19
  children?: React.ReactNode;
21
20
  onClickOutside?: () => void;
22
21
  className?: string;
23
22
  onSelect?: (event: Event) => void;
23
+ open?: boolean;
24
24
  style?: React.CSSProperties;
25
- placement?: "top" | "bottom";
25
+ align?: "start" | "center" | "end";
26
26
  }): import("react/jsx-runtime").JSX.Element;
27
27
  displayName: string;
28
28
  };
29
29
  Item: {
30
- ({ icon, value, order, children, shortcut, className, hovered, selected, textStyle, onSelect, onClick, ...rest }: {
31
- icon?: React.JSX.Element;
32
- value?: string | number | undefined;
33
- order?: number;
34
- onSelect?: (event: Event) => void;
35
- children: React.ReactNode;
36
- shortcut?: string;
37
- hovered?: boolean;
38
- selected?: boolean;
39
- textStyle?: React.CSSProperties;
40
- className?: string;
41
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
30
+ ({ icon, badge, value, children, shortcut, className, selected, onSelect, ...rest }: import("./DropdownMenuItem").DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
42
31
  displayName: string;
43
32
  Badge: {
44
33
  ({ type, children, }: {
@@ -48,6 +37,9 @@ declare const DropdownMenu: {
48
37
  displayName: string;
49
38
  };
50
39
  };
40
+ ItemCheckbox: (props: Omit<import("./DropdownMenuItem").DropdownMenuItemProps, "icon"> & {
41
+ checked: boolean;
42
+ }) => import("react/jsx-runtime").JSX.Element;
51
43
  ItemLink: {
52
44
  ({ icon, shortcut, href, children, onSelect, className, selected, rel, ...rest }: {
53
45
  href: string;
@@ -79,6 +71,28 @@ declare const DropdownMenu: {
79
71
  (): import("react/jsx-runtime").JSX.Element;
80
72
  displayName: string;
81
73
  };
74
+ Sub: {
75
+ ({ children }: {
76
+ children?: React.ReactNode;
77
+ }): import("react/jsx-runtime").JSX.Element;
78
+ Trigger: {
79
+ ({ children, icon, shortcut, className, }: {
80
+ children: React.ReactNode;
81
+ icon?: React.JSX.Element;
82
+ shortcut?: string;
83
+ className?: string;
84
+ }): import("react/jsx-runtime").JSX.Element;
85
+ displayName: string;
86
+ };
87
+ Content: {
88
+ ({ children, className, }: {
89
+ children?: React.ReactNode;
90
+ className?: string;
91
+ }): import("react/jsx-runtime").JSX.Element;
92
+ displayName: string;
93
+ };
94
+ displayName: string;
95
+ };
82
96
  displayName: string;
83
97
  };
84
98
  export default DropdownMenu;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  declare const MenuContent: {
3
- ({ children, onClickOutside, className, onSelect, style, placement, }: {
3
+ ({ children, onClickOutside, className, onSelect, open, align, style, }: {
4
4
  children?: React.ReactNode;
5
5
  onClickOutside?: () => void;
6
6
  className?: string;
@@ -8,8 +8,9 @@ declare const MenuContent: {
8
8
  * Called when any menu item is selected (clicked on).
9
9
  */
10
10
  onSelect?: (event: Event) => void;
11
+ open?: boolean;
11
12
  style?: React.CSSProperties;
12
- placement?: "top" | "bottom";
13
+ align?: "start" | "center" | "end";
13
14
  }): import("react/jsx-runtime").JSX.Element;
14
15
  displayName: string;
15
16
  };
@@ -1,19 +1,18 @@
1
1
  import React from "react";
2
2
  import type { ValueOf } from "@excalidraw-modify/common/utility-types";
3
3
  import type { JSX } from "react";
4
+ export type DropdownMenuItemProps = {
5
+ icon?: JSX.Element;
6
+ badge?: React.ReactNode;
7
+ value?: string | number | undefined;
8
+ onSelect?: (event: Event) => void;
9
+ children: React.ReactNode;
10
+ shortcut?: string;
11
+ selected?: boolean;
12
+ className?: string;
13
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">;
4
14
  declare const DropdownMenuItem: {
5
- ({ icon, value, order, children, shortcut, className, hovered, selected, textStyle, onSelect, onClick, ...rest }: {
6
- icon?: JSX.Element;
7
- value?: string | number | undefined;
8
- order?: number;
9
- onSelect?: (event: Event) => void;
10
- children: React.ReactNode;
11
- shortcut?: string;
12
- hovered?: boolean;
13
- selected?: boolean;
14
- textStyle?: React.CSSProperties;
15
- className?: string;
16
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
15
+ ({ icon, badge, value, children, shortcut, className, selected, onSelect, ...rest }: DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
17
16
  displayName: string;
18
17
  Badge: {
19
18
  ({ type, children, }: {
@@ -0,0 +1,5 @@
1
+ import type { DropdownMenuItemProps } from "./DropdownMenuItem";
2
+ declare const DropdownMenuItemCheckbox: (props: Omit<DropdownMenuItemProps, "icon"> & {
3
+ checked: boolean;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default DropdownMenuItemCheckbox;
@@ -1,8 +1,9 @@
1
1
  import type { JSX } from "react";
2
- declare const MenuItemContent: ({ textStyle, icon, shortcut, children, }: {
2
+ declare const MenuItemContent: ({ textStyle, icon, shortcut, children, badge, }: {
3
3
  icon?: JSX.Element;
4
4
  shortcut?: string;
5
5
  textStyle?: React.CSSProperties;
6
6
  children: React.ReactNode;
7
+ badge?: React.ReactNode;
7
8
  }) => import("react/jsx-runtime").JSX.Element;
8
9
  export default MenuItemContent;
@@ -0,0 +1,23 @@
1
+ declare const DropdownMenuSub: {
2
+ ({ children }: {
3
+ children?: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ Trigger: {
6
+ ({ children, icon, shortcut, className, }: {
7
+ children: React.ReactNode;
8
+ icon?: import("react").JSX.Element;
9
+ shortcut?: string;
10
+ className?: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ Content: {
15
+ ({ children, className, }: {
16
+ children?: React.ReactNode;
17
+ className?: string;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ displayName: string;
20
+ };
21
+ displayName: string;
22
+ };
23
+ export default DropdownMenuSub;
@@ -0,0 +1,8 @@
1
+ declare const DropdownMenuSubContent: {
2
+ ({ children, className, }: {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ export default DropdownMenuSubContent;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import type { JSX } from "react";
3
+ declare const DropdownMenuSubTrigger: {
4
+ ({ children, icon, shortcut, className, }: {
5
+ children: React.ReactNode;
6
+ icon?: JSX.Element;
7
+ shortcut?: string;
8
+ className?: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ export default DropdownMenuSubTrigger;
@@ -3,4 +3,4 @@ export declare const DropdownMenuContentPropsContext: React.Context<{
3
3
  onSelect?: (event: Event) => void;
4
4
  }>;
5
5
  export declare const getDropdownMenuItemClassName: (className?: string, selected?: boolean, hovered?: boolean) => string;
6
- export declare const useHandleDropdownMenuItemClick: (origOnClick: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | undefined, onSelect: ((event: Event) => void) | undefined) => (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void;
6
+ export declare const useHandleDropdownMenuItemSelect: (onSelect: ((event: Event) => void) | undefined) => (event: Event) => void;
@@ -1,3 +1,5 @@
1
1
  import React from "react";
2
2
  export declare const getMenuTriggerComponent: (children: React.ReactNode) => string | number | bigint | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
3
3
  export declare const getMenuContentComponent: (children: React.ReactNode) => string | number | bigint | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
4
+ export declare const getSubMenuTriggerComponent: (children: React.ReactNode) => string | number | bigint | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
5
+ export declare const getSubMenuContentComponent: (children: React.ReactNode) => string | number | bigint | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
@@ -157,6 +157,7 @@ export declare const FontSizeExtraLargeIcon: import("react/jsx-runtime").JSX.Ele
157
157
  export declare const fontSizeIcon: import("react/jsx-runtime").JSX.Element;
158
158
  export declare const FontFamilyHeadingIcon: import("react/jsx-runtime").JSX.Element;
159
159
  export declare const FontFamilyNormalIcon: import("react/jsx-runtime").JSX.Element;
160
+ export declare const codeIcon: import("react/jsx-runtime").JSX.Element;
160
161
  export declare const FontFamilyCodeIcon: import("react/jsx-runtime").JSX.Element;
161
162
  export declare const TextAlignLeftIcon: import("react/jsx-runtime").JSX.Element;
162
163
  export declare const TextAlignCenterIcon: import("react/jsx-runtime").JSX.Element;
@@ -186,6 +187,8 @@ export declare const eyeDropperIcon: import("react/jsx-runtime").JSX.Element;
186
187
  export declare const extraToolsIcon: import("react/jsx-runtime").JSX.Element;
187
188
  export declare const frameToolIcon: import("react/jsx-runtime").JSX.Element;
188
189
  export declare const mermaidLogoIcon: import("react/jsx-runtime").JSX.Element;
190
+ export declare const RetryIcon: import("react/jsx-runtime").JSX.Element;
191
+ export declare const stackPushIcon: import("react/jsx-runtime").JSX.Element;
189
192
  export declare const ArrowRightIcon: import("react/jsx-runtime").JSX.Element;
190
193
  export declare const laserPointerToolIcon: import("react/jsx-runtime").JSX.Element;
191
194
  export declare const MagicIcon: import("react/jsx-runtime").JSX.Element;
@@ -197,7 +200,8 @@ export declare const eyeClosedIcon: import("react/jsx-runtime").JSX.Element;
197
200
  export declare const brainIcon: import("react/jsx-runtime").JSX.Element;
198
201
  export declare const brainIconThin: import("react/jsx-runtime").JSX.Element;
199
202
  export declare const searchIcon: import("react/jsx-runtime").JSX.Element;
200
- export declare const clockIcon: import("react/jsx-runtime").JSX.Element;
203
+ export declare const historyCommandIcon: import("react/jsx-runtime").JSX.Element;
204
+ export declare const historyIcon: import("react/jsx-runtime").JSX.Element;
201
205
  export declare const microphoneIcon: import("react/jsx-runtime").JSX.Element;
202
206
  export declare const microphoneMutedIcon: import("react/jsx-runtime").JSX.Element;
203
207
  export declare const boltIcon: import("react/jsx-runtime").JSX.Element;
@@ -232,4 +236,7 @@ export declare const chevronLeftIcon: import("react/jsx-runtime").JSX.Element;
232
236
  export declare const sidebarRightIcon: import("react/jsx-runtime").JSX.Element;
233
237
  export declare const messageCircleIcon: import("react/jsx-runtime").JSX.Element;
234
238
  export declare const presentationIcon: import("react/jsx-runtime").JSX.Element;
239
+ export declare const emptyIcon: import("react/jsx-runtime").JSX.Element;
240
+ export declare const chevronRight: import("react/jsx-runtime").JSX.Element;
241
+ export declare const settingsIcon: import("react/jsx-runtime").JSX.Element;
235
242
  export {};
@@ -62,3 +62,18 @@ export declare const LiveCollaborationTrigger: {
62
62
  }): import("react/jsx-runtime").JSX.Element;
63
63
  displayName: string;
64
64
  };
65
+ export declare const PreferencesToggleGridModeItem: () => import("react/jsx-runtime").JSX.Element;
66
+ export declare const PreferencesToggleZenModeItem: () => import("react/jsx-runtime").JSX.Element;
67
+ export declare const Preferences: {
68
+ ({ children, additionalItems, }: {
69
+ children?: React.ReactNode;
70
+ additionalItems?: React.ReactNode;
71
+ }): import("react/jsx-runtime").JSX.Element;
72
+ ToggleToolLock: () => import("react/jsx-runtime").JSX.Element;
73
+ ToggleSnapMode: () => import("react/jsx-runtime").JSX.Element;
74
+ ToggleGridMode: () => import("react/jsx-runtime").JSX.Element;
75
+ ToggleZenMode: () => import("react/jsx-runtime").JSX.Element;
76
+ ToggleViewMode: () => import("react/jsx-runtime").JSX.Element;
77
+ ToggleElementProperties: () => import("react/jsx-runtime").JSX.Element;
78
+ displayName: string;
79
+ };
@@ -19,18 +19,7 @@ declare const MainMenu: React.FC<{
19
19
  displayName: string;
20
20
  };
21
21
  Item: {
22
- ({ icon, value, order, children, shortcut, className, hovered, selected, textStyle, onSelect, onClick, ...rest }: {
23
- icon?: React.JSX.Element;
24
- value?: string | number | undefined;
25
- order?: number;
26
- onSelect?: (event: Event) => void;
27
- children: React.ReactNode;
28
- shortcut?: string;
29
- hovered?: boolean;
30
- selected?: boolean;
31
- textStyle?: React.CSSProperties;
32
- className?: string;
33
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
22
+ ({ icon, badge, value, children, shortcut, className, selected, onSelect, ...rest }: import("../dropdownMenu/DropdownMenuItem").DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
34
23
  displayName: string;
35
24
  Badge: {
36
25
  ({ type, children, }: {
@@ -71,6 +60,28 @@ declare const MainMenu: React.FC<{
71
60
  (): import("react/jsx-runtime").JSX.Element;
72
61
  displayName: string;
73
62
  };
63
+ Sub: {
64
+ ({ children }: {
65
+ children?: React.ReactNode;
66
+ }): import("react/jsx-runtime").JSX.Element;
67
+ Trigger: {
68
+ ({ children, icon, shortcut, className, }: {
69
+ children: React.ReactNode;
70
+ icon?: React.JSX.Element;
71
+ shortcut?: string;
72
+ className?: string;
73
+ }): import("react/jsx-runtime").JSX.Element;
74
+ displayName: string;
75
+ };
76
+ Content: {
77
+ ({ children, className, }: {
78
+ children?: React.ReactNode;
79
+ className?: string;
80
+ }): import("react/jsx-runtime").JSX.Element;
81
+ displayName: string;
82
+ };
83
+ displayName: string;
84
+ };
74
85
  DefaultItems: typeof DefaultItems;
75
86
  };
76
87
  export default MainMenu;
@@ -187,4 +187,4 @@ export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
187
187
  readonly numericKey: "0";
188
188
  readonly fillable: false;
189
189
  })[]];
190
- export declare const findShapeByKey: (key: string, app: AppClassProperties) => "text" | "line" | "ellipse" | "rectangle" | "diamond" | "image" | "selection" | "arrow" | "freedraw" | "lasso" | "eraser" | null;
190
+ export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "lasso" | "eraser" | null;
@@ -18,7 +18,163 @@ localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | nu
18
18
  /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
19
19
  fileHandle?: FileSystemHandle | null) => Promise<{
20
20
  type: "application/vnd.excalidraw+json";
21
- data: import("./restore").RestoredDataState;
21
+ data: {
22
+ elements: import("@excalidraw-modify/element/types").OrderedExcalidrawElement[];
23
+ appState: {
24
+ viewBackgroundColor: string;
25
+ theme: import("@excalidraw-modify/element/types").Theme;
26
+ frameRendering: {
27
+ enabled: boolean;
28
+ name: boolean;
29
+ outline: boolean;
30
+ clip: boolean;
31
+ };
32
+ name: string | null;
33
+ zoom: import("../types").Zoom;
34
+ scrollX: number;
35
+ scrollY: number;
36
+ viewModeEnabled: boolean;
37
+ openDialog: null | {
38
+ name: "imageExport" | "help" | "jsonExport";
39
+ } | {
40
+ name: "ttd";
41
+ tab: "text-to-diagram" | "mermaid";
42
+ } | {
43
+ name: "commandPalette";
44
+ } | {
45
+ name: "settings";
46
+ } | {
47
+ name: "elementLinkSelector";
48
+ sourceElementId: ExcalidrawElement["id"];
49
+ };
50
+ editingGroupId: import("@excalidraw-modify/element/types").GroupId | null;
51
+ selectedElementIds: Readonly<{
52
+ [id: string]: true;
53
+ }>;
54
+ frameToHighlight: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawFrameLikeElement> | null;
55
+ activeEmbeddable: {
56
+ element: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement;
57
+ state: "hover" | "active";
58
+ } | null;
59
+ selectionElement: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement | null;
60
+ selectedGroupIds: {
61
+ [groupId: string]: boolean;
62
+ };
63
+ selectedLinearElement: import("@excalidraw-modify/element").LinearElementEditor | null;
64
+ multiElement: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawLinearElement> | null;
65
+ newElement: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawNonSelectionElement> | null;
66
+ isBindingEnabled: boolean;
67
+ suggestedBinding: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawBindableElement> | null;
68
+ isRotating: boolean;
69
+ elementsToHighlight: import("@excalidraw-modify/element/types").NonDeleted<ExcalidrawElement>[] | null;
70
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
71
+ snapLines: readonly import("../snapping").SnapLine[];
72
+ zenModeEnabled: boolean;
73
+ editingTextElement: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement | null;
74
+ isCropping: boolean;
75
+ croppingElementId: ExcalidrawElement["id"] | null;
76
+ searchMatches: Readonly<{
77
+ focusedId: ExcalidrawElement["id"] | null;
78
+ matches: readonly import("../types").SearchMatch[];
79
+ }> | null;
80
+ activeLockedId: string | null;
81
+ hoveredElementIds: Readonly<{
82
+ [id: string]: true;
83
+ }>;
84
+ shouldCacheIgnoreZoom: boolean;
85
+ exportScale: number;
86
+ bindMode: import("@excalidraw-modify/element/types").BindMode;
87
+ gridSize: number;
88
+ contextMenu: {
89
+ items: import("../components/ContextMenu").ContextMenuItems;
90
+ top: number;
91
+ left: number;
92
+ } | null;
93
+ showWelcomeScreen: boolean;
94
+ isLoading: boolean;
95
+ errorMessage: React.ReactNode;
96
+ resizingElement: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement | null;
97
+ startBoundElement: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawBindableElement> | null;
98
+ editingFrame: string | null;
99
+ activeTool: {
100
+ lastActiveTool: import("../types").ActiveTool | null;
101
+ locked: boolean;
102
+ fromSelection: boolean;
103
+ } & import("../types").ActiveTool;
104
+ preferredSelectionTool: {
105
+ type: "selection" | "lasso";
106
+ initialized: boolean;
107
+ };
108
+ penMode: boolean;
109
+ penDetected: boolean;
110
+ exportBackground: boolean;
111
+ exportEmbedScene: boolean;
112
+ exportWithDarkMode: boolean;
113
+ currentItemStrokeColor: string;
114
+ currentItemBackgroundColor: string;
115
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
116
+ currentItemStrokeWidth: number;
117
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
118
+ currentItemRoughness: number;
119
+ currentItemOpacity: number;
120
+ currentItemFontFamily: import("@excalidraw-modify/element/types").FontFamilyValues;
121
+ currentItemFontSize: number;
122
+ currentItemTextAlign: import("@excalidraw-modify/element/types").TextAlign;
123
+ currentItemStartArrowhead: import("@excalidraw-modify/element/types").Arrowhead | null;
124
+ currentItemEndArrowhead: import("@excalidraw-modify/element/types").Arrowhead | null;
125
+ currentHoveredFontFamily: import("@excalidraw-modify/element/types").FontFamilyValues | null;
126
+ currentItemRoundness: import("@excalidraw-modify/element/types").StrokeRoundness;
127
+ currentItemArrowType: "sharp" | "round" | "elbow";
128
+ cursorButton: "up" | "down";
129
+ scrolledOutside: boolean;
130
+ isResizing: boolean;
131
+ isPanning: boolean;
132
+ openMenu: "canvas" | null;
133
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
134
+ openSidebar: {
135
+ name: import("../types").SidebarName;
136
+ tab?: import("../types").SidebarTabName;
137
+ } | null;
138
+ defaultSidebarDockedPreference: boolean;
139
+ lastPointerDownWith: import("@excalidraw-modify/element/types").PointerType;
140
+ previousSelectedElementIds: {
141
+ [id: string]: true;
142
+ };
143
+ selectedElementsAreBeingDragged: boolean;
144
+ toast: {
145
+ message: string;
146
+ closable?: boolean;
147
+ duration?: number;
148
+ } | null;
149
+ gridStep: number;
150
+ gridModeEnabled: boolean;
151
+ fileHandle: FileSystemHandle | null;
152
+ stats: {
153
+ open: boolean;
154
+ panels: number;
155
+ };
156
+ currentChartType: import("@excalidraw-modify/element/types").ChartType;
157
+ pasteDialog: {
158
+ shown: false;
159
+ data: null;
160
+ } | {
161
+ shown: true;
162
+ data: import("../charts").Spreadsheet;
163
+ };
164
+ showHyperlinkPopup: false | "info" | "editor";
165
+ originSnapOffset: {
166
+ x: number;
167
+ y: number;
168
+ } | null;
169
+ objectsSnapModeEnabled: boolean;
170
+ userToFollow: import("../types").UserToFollow | null;
171
+ followedBy: Set<import("../types").SocketId>;
172
+ lockedMultiSelections: {
173
+ [groupId: string]: true;
174
+ };
175
+ };
176
+ files: import("../types").BinaryFiles;
177
+ };
22
178
  } | {
23
179
  type: "application/vnd.excalidrawlib+json";
24
180
  data: ImportedLibraryData;
@@ -27,7 +183,163 @@ export declare const loadFromBlob: (blob: Blob,
27
183
  /** @see restore.localAppState */
28
184
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
29
185
  /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
30
- fileHandle?: FileSystemHandle | null) => Promise<import("./restore").RestoredDataState>;
186
+ fileHandle?: FileSystemHandle | null) => Promise<{
187
+ elements: import("@excalidraw-modify/element/types").OrderedExcalidrawElement[];
188
+ appState: {
189
+ viewBackgroundColor: string;
190
+ theme: import("@excalidraw-modify/element/types").Theme;
191
+ frameRendering: {
192
+ enabled: boolean;
193
+ name: boolean;
194
+ outline: boolean;
195
+ clip: boolean;
196
+ };
197
+ name: string | null;
198
+ zoom: import("../types").Zoom;
199
+ scrollX: number;
200
+ scrollY: number;
201
+ viewModeEnabled: boolean;
202
+ openDialog: null | {
203
+ name: "imageExport" | "help" | "jsonExport";
204
+ } | {
205
+ name: "ttd";
206
+ tab: "text-to-diagram" | "mermaid";
207
+ } | {
208
+ name: "commandPalette";
209
+ } | {
210
+ name: "settings";
211
+ } | {
212
+ name: "elementLinkSelector";
213
+ sourceElementId: ExcalidrawElement["id"];
214
+ };
215
+ editingGroupId: import("@excalidraw-modify/element/types").GroupId | null;
216
+ selectedElementIds: Readonly<{
217
+ [id: string]: true;
218
+ }>;
219
+ frameToHighlight: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawFrameLikeElement> | null;
220
+ activeEmbeddable: {
221
+ element: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement;
222
+ state: "hover" | "active";
223
+ } | null;
224
+ selectionElement: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement | null;
225
+ selectedGroupIds: {
226
+ [groupId: string]: boolean;
227
+ };
228
+ selectedLinearElement: import("@excalidraw-modify/element").LinearElementEditor | null;
229
+ multiElement: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawLinearElement> | null;
230
+ newElement: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawNonSelectionElement> | null;
231
+ isBindingEnabled: boolean;
232
+ suggestedBinding: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawBindableElement> | null;
233
+ isRotating: boolean;
234
+ elementsToHighlight: import("@excalidraw-modify/element/types").NonDeleted<ExcalidrawElement>[] | null;
235
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
236
+ snapLines: readonly import("../snapping").SnapLine[];
237
+ zenModeEnabled: boolean;
238
+ editingTextElement: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement | null;
239
+ isCropping: boolean;
240
+ croppingElementId: ExcalidrawElement["id"] | null;
241
+ searchMatches: Readonly<{
242
+ focusedId: ExcalidrawElement["id"] | null;
243
+ matches: readonly import("../types").SearchMatch[];
244
+ }> | null;
245
+ activeLockedId: string | null;
246
+ hoveredElementIds: Readonly<{
247
+ [id: string]: true;
248
+ }>;
249
+ shouldCacheIgnoreZoom: boolean;
250
+ exportScale: number;
251
+ bindMode: import("@excalidraw-modify/element/types").BindMode;
252
+ gridSize: number;
253
+ contextMenu: {
254
+ items: import("../components/ContextMenu").ContextMenuItems;
255
+ top: number;
256
+ left: number;
257
+ } | null;
258
+ showWelcomeScreen: boolean;
259
+ isLoading: boolean;
260
+ errorMessage: React.ReactNode;
261
+ resizingElement: import("@excalidraw-modify/element/types").NonDeletedExcalidrawElement | null;
262
+ startBoundElement: import("@excalidraw-modify/element/types").NonDeleted<import("@excalidraw-modify/element/types").ExcalidrawBindableElement> | null;
263
+ editingFrame: string | null;
264
+ activeTool: {
265
+ lastActiveTool: import("../types").ActiveTool | null;
266
+ locked: boolean;
267
+ fromSelection: boolean;
268
+ } & import("../types").ActiveTool;
269
+ preferredSelectionTool: {
270
+ type: "selection" | "lasso";
271
+ initialized: boolean;
272
+ };
273
+ penMode: boolean;
274
+ penDetected: boolean;
275
+ exportBackground: boolean;
276
+ exportEmbedScene: boolean;
277
+ exportWithDarkMode: boolean;
278
+ currentItemStrokeColor: string;
279
+ currentItemBackgroundColor: string;
280
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
281
+ currentItemStrokeWidth: number;
282
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
283
+ currentItemRoughness: number;
284
+ currentItemOpacity: number;
285
+ currentItemFontFamily: import("@excalidraw-modify/element/types").FontFamilyValues;
286
+ currentItemFontSize: number;
287
+ currentItemTextAlign: import("@excalidraw-modify/element/types").TextAlign;
288
+ currentItemStartArrowhead: import("@excalidraw-modify/element/types").Arrowhead | null;
289
+ currentItemEndArrowhead: import("@excalidraw-modify/element/types").Arrowhead | null;
290
+ currentHoveredFontFamily: import("@excalidraw-modify/element/types").FontFamilyValues | null;
291
+ currentItemRoundness: import("@excalidraw-modify/element/types").StrokeRoundness;
292
+ currentItemArrowType: "sharp" | "round" | "elbow";
293
+ cursorButton: "up" | "down";
294
+ scrolledOutside: boolean;
295
+ isResizing: boolean;
296
+ isPanning: boolean;
297
+ openMenu: "canvas" | null;
298
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
299
+ openSidebar: {
300
+ name: import("../types").SidebarName;
301
+ tab?: import("../types").SidebarTabName;
302
+ } | null;
303
+ defaultSidebarDockedPreference: boolean;
304
+ lastPointerDownWith: import("@excalidraw-modify/element/types").PointerType;
305
+ previousSelectedElementIds: {
306
+ [id: string]: true;
307
+ };
308
+ selectedElementsAreBeingDragged: boolean;
309
+ toast: {
310
+ message: string;
311
+ closable?: boolean;
312
+ duration?: number;
313
+ } | null;
314
+ gridStep: number;
315
+ gridModeEnabled: boolean;
316
+ fileHandle: FileSystemHandle | null;
317
+ stats: {
318
+ open: boolean;
319
+ panels: number;
320
+ };
321
+ currentChartType: import("@excalidraw-modify/element/types").ChartType;
322
+ pasteDialog: {
323
+ shown: false;
324
+ data: null;
325
+ } | {
326
+ shown: true;
327
+ data: import("../charts").Spreadsheet;
328
+ };
329
+ showHyperlinkPopup: false | "info" | "editor";
330
+ originSnapOffset: {
331
+ x: number;
332
+ y: number;
333
+ } | null;
334
+ objectsSnapModeEnabled: boolean;
335
+ userToFollow: import("../types").UserToFollow | null;
336
+ followedBy: Set<import("../types").SocketId>;
337
+ lockedMultiSelections: {
338
+ [groupId: string]: true;
339
+ };
340
+ };
341
+ files: import("../types").BinaryFiles;
342
+ }>;
31
343
  export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
32
344
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
33
345
  export declare const canvasToBlob: (canvas: HTMLCanvasElement | Promise<HTMLCanvasElement>) => Promise<Blob>;