@zsviczian/excalidraw 0.13.0-obsidian → 0.13.0-obsidian-2

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 (98) hide show
  1. package/README.md +1 -1
  2. package/dist/excalidraw.development.js +1149 -166
  3. package/dist/excalidraw.production.min.js +1 -1
  4. package/dist/excalidraw.production.min.js.LICENSE.txt +104 -0
  5. package/package.json +1 -1
  6. package/types/actions/actionAddToLibrary.d.ts +9 -9
  7. package/types/actions/actionAlign.d.ts +18 -6
  8. package/types/actions/actionBoundText.d.ts +3 -3
  9. package/types/actions/actionCanvas.d.ts +62 -43
  10. package/types/actions/actionClipboard.d.ts +24 -15
  11. package/types/actions/actionDeleteSelected.d.ts +21 -10
  12. package/types/actions/actionDistribute.d.ts +6 -2
  13. package/types/actions/actionDuplicateSelection.d.ts +3 -1
  14. package/types/actions/actionExport.d.ts +61 -44
  15. package/types/actions/actionFinalize.d.ts +9 -7
  16. package/types/actions/actionGroup.d.ts +6 -2
  17. package/types/actions/actionLinearEditor.d.ts +3 -3
  18. package/types/actions/actionMenu.d.ts +20 -12
  19. package/types/actions/actionNavigate.d.ts +4 -1
  20. package/types/actions/actionProperties.d.ts +80 -54
  21. package/types/actions/actionStyles.d.ts +3 -3
  22. package/types/actions/actionToggleGridMode.d.ts +4 -3
  23. package/types/actions/actionToggleLock.d.ts +3 -3
  24. package/types/actions/actionToggleStats.d.ts +4 -3
  25. package/types/actions/actionToggleViewMode.d.ts +4 -3
  26. package/types/actions/actionToggleZenMode.d.ts +4 -3
  27. package/types/actions/actionZindex.d.ts +12 -4
  28. package/types/actions/manager.d.ts +1 -1
  29. package/types/actions/shortcuts.d.ts +1 -1
  30. package/types/actions/types.d.ts +7 -2
  31. package/types/appState.d.ts +11 -11
  32. package/types/bug-issue-template.d.ts +2 -0
  33. package/types/clients.d.ts +1 -1
  34. package/types/clipboard.d.ts +6 -1
  35. package/types/components/Actions.d.ts +1 -0
  36. package/types/components/App.d.ts +47 -1
  37. package/types/components/Avatar.d.ts +1 -1
  38. package/types/components/CollabButton.d.ts +2 -1
  39. package/types/components/ContextMenu.d.ts +9 -10
  40. package/types/components/DialogActionButton.d.ts +10 -0
  41. package/types/components/EncryptedIcon.d.ts +2 -0
  42. package/types/components/Footer.d.ts +2 -1
  43. package/types/components/HelpButton.d.ts +8 -0
  44. package/types/components/ImageExportDialog.d.ts +3 -1
  45. package/types/components/LayerUI.d.ts +2 -1
  46. package/types/components/LibraryButton.d.ts +1 -0
  47. package/types/components/LibraryMenuBrowseButton.d.ts +7 -0
  48. package/types/components/LibraryMenuItems.d.ts +5 -2
  49. package/types/components/MenuItem.d.ts +11 -0
  50. package/types/components/MenuUtils.d.ts +2 -0
  51. package/types/components/MobileMenu.d.ts +2 -1
  52. package/types/components/Sidebar/Sidebar.d.ts +1 -1
  53. package/types/components/Sidebar/common.d.ts +1 -0
  54. package/types/components/TopErrorBoundary.d.ts +15 -0
  55. package/types/components/WelcomeScreen.d.ts +8 -0
  56. package/types/components/WelcomeScreenDecor.d.ts +6 -0
  57. package/types/components/icons.d.ts +83 -124
  58. package/types/constants.d.ts +8 -5
  59. package/types/element/Hyperlink.d.ts +6 -4
  60. package/types/element/bounds.d.ts +3 -2
  61. package/types/element/linearElementEditor.d.ts +34 -6
  62. package/types/element/newElement.d.ts +2 -2
  63. package/types/element/resizeElements.d.ts +0 -1
  64. package/types/element/textElement.d.ts +17 -2
  65. package/types/element/transformHandles.d.ts +3 -4
  66. package/types/element/typeChecks.d.ts +10 -1
  67. package/types/element/types.d.ts +11 -4
  68. package/types/excalidraw-app/CustomStats.d.ts +9 -0
  69. package/types/excalidraw-app/app_constants.d.ts +32 -0
  70. package/types/excalidraw-app/collab/Collab.d.ts +163 -0
  71. package/types/excalidraw-app/collab/Portal.d.ts +28 -0
  72. package/types/excalidraw-app/collab/RoomDialog.d.ts +13 -0
  73. package/types/excalidraw-app/collab/reconciliation.d.ts +10 -0
  74. package/types/excalidraw-app/components/ExportToExcalidrawPlus.d.ts +9 -0
  75. package/types/excalidraw-app/components/LanguageList.d.ts +4 -0
  76. package/types/excalidraw-app/components/icons.d.ts +1 -0
  77. package/types/excalidraw-app/data/FileManager.d.ts +66 -0
  78. package/types/excalidraw-app/data/LocalData.d.ts +32 -0
  79. package/types/excalidraw-app/data/Locker.d.ts +8 -0
  80. package/types/excalidraw-app/data/firebase.d.ts +25 -0
  81. package/types/excalidraw-app/data/index.d.ts +185 -0
  82. package/types/excalidraw-app/data/localStorage.d.ts +111 -0
  83. package/types/excalidraw-app/data/tabSync.d.ts +9 -0
  84. package/types/excalidraw-app/index.d.ts +26 -0
  85. package/types/hooks/useOutsideClick.d.ts +2 -0
  86. package/types/keys.d.ts +10 -0
  87. package/types/math.d.ts +2 -1
  88. package/types/packages/excalidraw/index.d.ts +3 -0
  89. package/types/packages/utils.d.ts +3 -1
  90. package/types/renderer/renderElement.d.ts +4 -3
  91. package/types/renderer/renderScene.d.ts +1 -1
  92. package/types/scene/Fonts.d.ts +21 -0
  93. package/types/scene/Scene.d.ts +15 -0
  94. package/types/scene/comparisons.d.ts +2 -3
  95. package/types/scene/index.d.ts +1 -1
  96. package/types/scene/types.d.ts +1 -0
  97. package/types/shapes.d.ts +27 -3
  98. package/types/types.d.ts +15 -4
@@ -9,6 +9,7 @@ export declare const actionToggleLock: {
9
9
  elements: ExcalidrawElement[];
10
10
  appState: {
11
11
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
12
+ showWelcomeScreen: boolean;
12
13
  isLoading: boolean;
13
14
  errorMessage: string | null;
14
15
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -47,10 +48,9 @@ export declare const actionToggleLock: {
47
48
  currentItemFontFamily: number;
48
49
  currentItemFontSize: number;
49
50
  currentItemTextAlign: string;
50
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
51
51
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
52
52
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
53
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
53
+ currentItemRoundness: import("../element/types").StrokeRoundness;
54
54
  viewBackgroundColor: string;
55
55
  scrollX: number;
56
56
  scrollY: number;
@@ -65,6 +65,7 @@ export declare const actionToggleLock: {
65
65
  openMenu: "canvas" | "shape" | null;
66
66
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
67
67
  openSidebar: "library" | "customSidebar" | null;
68
+ openDialog: "imageExport" | "help" | null;
68
69
  isSidebarDocked: boolean;
69
70
  lastPointerDownWith: import("../element/types").PointerType;
70
71
  selectedElementIds: {
@@ -74,7 +75,6 @@ export declare const actionToggleLock: {
74
75
  [id: string]: boolean;
75
76
  };
76
77
  shouldCacheIgnoreZoom: boolean;
77
- showHelpDialog: boolean;
78
78
  toast: {
79
79
  message: string;
80
80
  closable?: boolean | undefined;
@@ -1,12 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  export declare const actionToggleStats: {
3
3
  name: "stats";
4
+ viewMode: true;
4
5
  trackEvent: {
5
6
  category: "menu";
6
7
  };
7
8
  perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
8
9
  appState: {
9
10
  showStats: boolean;
11
+ showWelcomeScreen: boolean;
10
12
  isLoading: boolean;
11
13
  errorMessage: string | null;
12
14
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -45,10 +47,9 @@ export declare const actionToggleStats: {
45
47
  currentItemFontFamily: number;
46
48
  currentItemFontSize: number;
47
49
  currentItemTextAlign: string;
48
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
49
50
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
50
51
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
51
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
52
+ currentItemRoundness: import("../element/types").StrokeRoundness;
52
53
  viewBackgroundColor: string;
53
54
  scrollX: number;
54
55
  scrollY: number;
@@ -63,6 +64,7 @@ export declare const actionToggleStats: {
63
64
  openMenu: "canvas" | "shape" | null;
64
65
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
65
66
  openSidebar: "library" | "customSidebar" | null;
67
+ openDialog: "imageExport" | "help" | null;
66
68
  isSidebarDocked: boolean;
67
69
  lastPointerDownWith: import("../element/types").PointerType;
68
70
  selectedElementIds: {
@@ -72,7 +74,6 @@ export declare const actionToggleStats: {
72
74
  [id: string]: boolean;
73
75
  };
74
76
  shouldCacheIgnoreZoom: boolean;
75
- showHelpDialog: boolean;
76
77
  toast: {
77
78
  message: string;
78
79
  closable?: boolean | undefined;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export declare const actionToggleViewMode: {
3
3
  name: "viewMode";
4
+ viewMode: true;
4
5
  trackEvent: {
5
6
  category: "canvas";
6
7
  predicate: (appState: Readonly<import("../types").AppState>) => boolean;
@@ -8,6 +9,7 @@ export declare const actionToggleViewMode: {
8
9
  perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties): {
9
10
  appState: {
10
11
  viewModeEnabled: boolean;
12
+ showWelcomeScreen: boolean;
11
13
  isLoading: boolean;
12
14
  errorMessage: string | null;
13
15
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -46,10 +48,9 @@ export declare const actionToggleViewMode: {
46
48
  currentItemFontFamily: number;
47
49
  currentItemFontSize: number;
48
50
  currentItemTextAlign: string;
49
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
50
51
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
51
52
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
52
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
53
+ currentItemRoundness: import("../element/types").StrokeRoundness;
53
54
  viewBackgroundColor: string;
54
55
  scrollX: number;
55
56
  scrollY: number;
@@ -64,6 +65,7 @@ export declare const actionToggleViewMode: {
64
65
  openMenu: "canvas" | "shape" | null;
65
66
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
66
67
  openSidebar: "library" | "customSidebar" | null;
68
+ openDialog: "imageExport" | "help" | null;
67
69
  isSidebarDocked: boolean;
68
70
  lastPointerDownWith: import("../element/types").PointerType;
69
71
  selectedElementIds: {
@@ -73,7 +75,6 @@ export declare const actionToggleViewMode: {
73
75
  [id: string]: boolean;
74
76
  };
75
77
  shouldCacheIgnoreZoom: boolean;
76
- showHelpDialog: boolean;
77
78
  toast: {
78
79
  message: string;
79
80
  closable?: boolean | undefined;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export declare const actionToggleZenMode: {
3
3
  name: "zenMode";
4
+ viewMode: true;
4
5
  trackEvent: {
5
6
  category: "canvas";
6
7
  predicate: (appState: Readonly<import("../types").AppState>) => boolean;
@@ -8,6 +9,7 @@ export declare const actionToggleZenMode: {
8
9
  perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
9
10
  appState: {
10
11
  zenModeEnabled: boolean;
12
+ showWelcomeScreen: boolean;
11
13
  isLoading: boolean;
12
14
  errorMessage: string | null;
13
15
  draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
@@ -46,10 +48,9 @@ export declare const actionToggleZenMode: {
46
48
  currentItemFontFamily: number;
47
49
  currentItemFontSize: number;
48
50
  currentItemTextAlign: string;
49
- currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
50
51
  currentItemStartArrowhead: import("../element/types").Arrowhead | null;
51
52
  currentItemEndArrowhead: import("../element/types").Arrowhead | null;
52
- currentItemLinearStrokeSharpness: import("../element/types").StrokeSharpness;
53
+ currentItemRoundness: import("../element/types").StrokeRoundness;
53
54
  viewBackgroundColor: string;
54
55
  scrollX: number;
55
56
  scrollY: number;
@@ -64,6 +65,7 @@ export declare const actionToggleZenMode: {
64
65
  openMenu: "canvas" | "shape" | null;
65
66
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
66
67
  openSidebar: "library" | "customSidebar" | null;
68
+ openDialog: "imageExport" | "help" | null;
67
69
  isSidebarDocked: boolean;
68
70
  lastPointerDownWith: import("../element/types").PointerType;
69
71
  selectedElementIds: {
@@ -73,7 +75,6 @@ export declare const actionToggleZenMode: {
73
75
  [id: string]: boolean;
74
76
  };
75
77
  shouldCacheIgnoreZoom: boolean;
76
- showHelpDialog: boolean;
77
78
  toast: {
78
79
  message: string;
79
80
  closable?: boolean | undefined;
@@ -12,7 +12,9 @@ export declare const actionSendBackward: {
12
12
  contextItemLabel: string;
13
13
  keyPriority: number;
14
14
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
15
- PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
15
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
16
+ isInHamburgerMenu: boolean;
17
+ }) => JSX.Element;
16
18
  } & {
17
19
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
18
20
  };
@@ -29,7 +31,9 @@ export declare const actionBringForward: {
29
31
  contextItemLabel: string;
30
32
  keyPriority: number;
31
33
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
32
- PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
34
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
35
+ isInHamburgerMenu: boolean;
36
+ }) => JSX.Element;
33
37
  } & {
34
38
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
35
39
  };
@@ -45,7 +49,9 @@ export declare const actionSendToBack: {
45
49
  };
46
50
  contextItemLabel: string;
47
51
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
48
- PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
52
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
53
+ isInHamburgerMenu: boolean;
54
+ }) => JSX.Element;
49
55
  } & {
50
56
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
51
57
  };
@@ -61,7 +67,9 @@ export declare const actionBringToFront: {
61
67
  };
62
68
  contextItemLabel: string;
63
69
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
64
- PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
70
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps & {
71
+ isInHamburgerMenu: boolean;
72
+ }) => JSX.Element;
65
73
  } & {
66
74
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
67
75
  };
@@ -16,5 +16,5 @@ export declare class ActionManager {
16
16
  /**
17
17
  * @param data additional data sent to the PanelComponent
18
18
  */
19
- renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => JSX.Element | null;
19
+ renderAction: (name: ActionName, data?: PanelComponentProps["data"], isInHamburgerMenu?: boolean) => JSX.Element | null;
20
20
  }
@@ -1,3 +1,3 @@
1
1
  import { ActionName } from "./types";
2
- export declare type ShortcutName = SubtypeOf<ActionName, "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleLock">;
2
+ export declare type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleLock"> | "saveScene" | "imageExport";
3
3
  export declare const getShortcutFromShortcutName: (name: ShortcutName) => string;
@@ -14,7 +14,7 @@ export declare type ActionResult = {
14
14
  declare type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
15
15
  export declare type UpdaterFn = (res: ActionResult) => void;
16
16
  export declare type ActionFilterFn = (action: Action) => void;
17
- export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeSharpness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "eraser" | "bindText" | "toggleLock" | "toggleLinearEditor";
17
+ export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "eraser" | "bindText" | "toggleLock" | "toggleLinearEditor";
18
18
  export declare type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: AppState;
@@ -24,7 +24,9 @@ export declare type PanelComponentProps = {
24
24
  };
25
25
  export interface Action {
26
26
  name: ActionName;
27
- PanelComponent?: React.FC<PanelComponentProps>;
27
+ PanelComponent?: React.FC<PanelComponentProps & {
28
+ isInHamburgerMenu: boolean;
29
+ }>;
28
30
  perform: ActionFn;
29
31
  keyPriority?: number;
30
32
  keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
@@ -36,5 +38,8 @@ export interface Action {
36
38
  action?: string;
37
39
  predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
38
40
  };
41
+ /** if set to `true`, allow action to be performed in viewMode.
42
+ * Defaults to `false` */
43
+ viewMode?: boolean;
39
44
  }
40
45
  export {};
@@ -1,6 +1,8 @@
1
1
  import { AppState, NormalizedZoomValue } from "./types";
2
2
  export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
3
3
  export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
4
+ theme?: string | undefined;
5
+ name?: string | undefined;
4
6
  activeTool?: {
5
7
  type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
6
8
  lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
@@ -12,14 +14,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
12
14
  lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
13
15
  locked: boolean;
14
16
  } | undefined;
15
- scrollX?: number | undefined;
16
- scrollY?: number | undefined;
17
- viewBackgroundColor?: string | undefined;
18
- zoom?: Readonly<{
19
- value: NormalizedZoomValue;
20
- }> | undefined;
21
- shouldCacheIgnoreZoom?: boolean | undefined;
22
- theme?: string | undefined;
17
+ showWelcomeScreen?: boolean | undefined;
23
18
  penMode?: boolean | undefined;
24
19
  penDetected?: boolean | undefined;
25
20
  exportBackground?: boolean | undefined;
@@ -36,13 +31,17 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
36
31
  currentItemFontFamily?: number | undefined;
37
32
  currentItemFontSize?: number | undefined;
38
33
  currentItemTextAlign?: string | undefined;
39
- currentItemStrokeSharpness?: import("./element/types").StrokeSharpness | undefined;
40
34
  currentItemStartArrowhead?: import("./element/types").Arrowhead | null | undefined;
41
35
  currentItemEndArrowhead?: import("./element/types").Arrowhead | null | undefined;
42
- currentItemLinearStrokeSharpness?: import("./element/types").StrokeSharpness | undefined;
36
+ currentItemRoundness?: import("./element/types").StrokeRoundness | undefined;
37
+ viewBackgroundColor?: string | undefined;
38
+ scrollX?: number | undefined;
39
+ scrollY?: number | undefined;
43
40
  cursorButton?: "up" | "down" | undefined;
44
41
  scrolledOutside?: boolean | undefined;
45
- name?: string | undefined;
42
+ zoom?: Readonly<{
43
+ value: NormalizedZoomValue;
44
+ }> | undefined;
46
45
  openMenu?: "canvas" | "shape" | null | undefined;
47
46
  openSidebar?: "library" | "customSidebar" | null | undefined;
48
47
  isSidebarDocked?: boolean | undefined;
@@ -53,6 +52,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
53
52
  previousSelectedElementIds?: {
54
53
  [id: string]: boolean;
55
54
  } | undefined;
55
+ shouldCacheIgnoreZoom?: boolean | undefined;
56
56
  zenModeEnabled?: boolean | undefined;
57
57
  gridSize?: number | null | undefined;
58
58
  selectedGroupIds?: {
@@ -0,0 +1,2 @@
1
+ declare function _default(sentryErrorId: any): string;
2
+ export default _default;
@@ -3,4 +3,4 @@ export declare const getClientColors: (clientId: string, appState: AppState) =>
3
3
  background: string;
4
4
  stroke: string;
5
5
  };
6
- export declare const getClientInitials: (username?: string | null) => string;
6
+ export declare const getClientInitials: (userName?: string | null) => string;
@@ -12,9 +12,14 @@ export declare const probablySupportsClipboardReadText: boolean;
12
12
  export declare const probablySupportsClipboardWriteText: boolean;
13
13
  export declare const probablySupportsClipboardBlob: boolean;
14
14
  export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles | null) => Promise<void>;
15
+ /**
16
+ * Retrieves content from system clipboard (either from ClipboardEvent or
17
+ * via async clipboard API if supported)
18
+ */
19
+ export declare const getSystemClipboard: (event: ClipboardEvent | null) => Promise<string>;
15
20
  /**
16
21
  * Attempts to parse clipboard. Prefers system clipboard.
17
22
  */
18
- export declare const parseClipboard: (event: ClipboardEvent | null) => Promise<ClipboardData>;
23
+ export declare const parseClipboard: (event: ClipboardEvent | null, isPlainPaste?: boolean) => Promise<ClipboardData>;
19
24
  export declare const copyBlobToClipboardAsPng: (blob: Blob | Promise<Blob>) => Promise<void>;
20
25
  export declare const copyTextToSystemClipboard: (text: string | null) => Promise<void>;
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import { ActionManager } from "../actions/manager";
3
3
  import { ExcalidrawElement, PointerType } from "../element/types";
4
4
  import { AppState, Zoom } from "../types";
5
+ import "./Actions.scss";
5
6
  export declare const SelectedShapeActions: ({ appState, elements, renderAction, }: {
6
7
  appState: AppState;
7
8
  elements: readonly ExcalidrawElement[];
@@ -9,6 +9,52 @@ import Scene from "../scene/Scene";
9
9
  import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
10
10
  import { FileSystemHandle } from "../data/filesystem";
11
11
  import { ImportedDataState } from "../data/types";
12
+ export declare const isMenuOpenAtom: import("jotai").Atom<boolean> & {
13
+ write: (get: {
14
+ <Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
15
+ <Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
16
+ <Value_2>(atom: import("jotai").Atom<Value_2>): Value_2 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_2;
17
+ } & {
18
+ <Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
19
+ unstable_promise: true;
20
+ }): Value_3 | Promise<Value_3>;
21
+ <Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
22
+ unstable_promise: true;
23
+ }): Value_4 | Promise<Value_4>;
24
+ <Value_5>(atom: import("jotai").Atom<Value_5>, options: {
25
+ unstable_promise: true;
26
+ }): (Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5) | Promise<Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5>;
27
+ }, set: {
28
+ <Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
29
+ <Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
30
+ }, update: boolean | ((prev: boolean) => boolean)) => void;
31
+ onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
32
+ } & {
33
+ init: boolean;
34
+ };
35
+ export declare const isDropdownOpenAtom: import("jotai").Atom<boolean> & {
36
+ write: (get: {
37
+ <Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
38
+ <Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
39
+ <Value_2>(atom: import("jotai").Atom<Value_2>): Value_2 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_2;
40
+ } & {
41
+ <Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
42
+ unstable_promise: true;
43
+ }): Value_3 | Promise<Value_3>;
44
+ <Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
45
+ unstable_promise: true;
46
+ }): Value_4 | Promise<Value_4>;
47
+ <Value_5>(atom: import("jotai").Atom<Value_5>, options: {
48
+ unstable_promise: true;
49
+ }): (Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5) | Promise<Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5>;
50
+ }, set: {
51
+ <Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
52
+ <Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
53
+ }, update: boolean | ((prev: boolean) => boolean)) => void;
54
+ onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
55
+ } & {
56
+ init: boolean;
57
+ };
12
58
  export declare let showFourthFont: boolean;
13
59
  export declare const useDevice: () => Readonly<{
14
60
  isSmScreen: boolean;
@@ -33,6 +79,7 @@ declare class App extends React.Component<AppProps, AppState> {
33
79
  private excalidrawContainerRef;
34
80
  static defaultProps: Partial<AppProps>;
35
81
  scene: Scene;
82
+ private fonts;
36
83
  private resizeObserver;
37
84
  private nearestScrollableContainer;
38
85
  library: AppClassProperties["library"];
@@ -61,7 +108,6 @@ declare class App extends React.Component<AppProps, AppState> {
61
108
  private onBlur;
62
109
  private onUnload;
63
110
  private disableEvent;
64
- private onFontLoaded;
65
111
  private resetHistory;
66
112
  /**
67
113
  * Resets scene & history.
@@ -7,5 +7,5 @@ declare type AvatarProps = {
7
7
  name: string;
8
8
  src?: string;
9
9
  };
10
- export declare const Avatar: ({ color, border, onClick, name, src }: AvatarProps) => JSX.Element;
10
+ export declare const Avatar: ({ color, onClick, name, src }: AvatarProps) => JSX.Element;
11
11
  export {};
@@ -1,7 +1,8 @@
1
1
  import "./CollabButton.scss";
2
- declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick, }: {
2
+ declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick, isInHamburgerMenu, }: {
3
3
  isCollaborating: boolean;
4
4
  collaboratorCount: number;
5
5
  onClick: () => void;
6
+ isInHamburgerMenu?: boolean | undefined;
6
7
  }) => JSX.Element;
7
8
  export default CollabButton;
@@ -13,16 +13,15 @@ declare type ContextMenuProps = {
13
13
  appState: Readonly<AppState>;
14
14
  elements: readonly NonDeletedExcalidrawElement[];
15
15
  };
16
- declare type ContextMenuParams = {
17
- options: (ContextMenuOption | false | null | undefined)[];
18
- top: ContextMenuProps["top"];
19
- left: ContextMenuProps["left"];
20
- actionManager: ContextMenuProps["actionManager"];
21
- appState: Readonly<AppState>;
22
- container: HTMLElement;
23
- elements: readonly NonDeletedExcalidrawElement[];
24
- };
25
16
  declare const _default: {
26
- push(params: ContextMenuParams): void;
17
+ push(params: {
18
+ options: (ContextMenuOption | false | null | undefined)[];
19
+ top: ContextMenuProps["top"];
20
+ left: ContextMenuProps["left"];
21
+ actionManager: ContextMenuProps["actionManager"];
22
+ appState: Readonly<AppState>;
23
+ container: HTMLElement;
24
+ elements: readonly NonDeletedExcalidrawElement[];
25
+ }): void;
27
26
  };
28
27
  export default _default;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ import "./DialogActionButton.scss";
3
+ interface DialogActionButtonProps {
4
+ label: string;
5
+ children?: ReactNode;
6
+ actionType?: "primary" | "danger";
7
+ isLoading?: boolean;
8
+ }
9
+ declare const DialogActionButton: ({ label, onClick, className, children, actionType, type, isLoading, ...rest }: DialogActionButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element;
10
+ export default DialogActionButton;
@@ -0,0 +1,2 @@
1
+ declare const EncryptedIcon: () => JSX.Element;
2
+ export default EncryptedIcon;
@@ -1,9 +1,10 @@
1
1
  import { ActionManager } from "../actions/manager";
2
2
  import { AppState, ExcalidrawProps } from "../types";
3
- declare const Footer: ({ appState, actionManager, renderCustomFooter, showExitZenModeBtn, }: {
3
+ declare const Footer: ({ appState, actionManager, renderCustomFooter, showExitZenModeBtn, renderWelcomeScreen, }: {
4
4
  appState: AppState;
5
5
  actionManager: ActionManager;
6
6
  renderCustomFooter?: ExcalidrawProps["renderFooter"];
7
7
  showExitZenModeBtn: boolean;
8
+ renderWelcomeScreen: boolean;
8
9
  }) => JSX.Element;
9
10
  export default Footer;
@@ -0,0 +1,8 @@
1
+ declare type HelpButtonProps = {
2
+ title?: string;
3
+ name?: string;
4
+ id?: string;
5
+ onClick?(): void;
6
+ };
7
+ export declare const HelpButton: (props: HelpButtonProps) => JSX.Element;
8
+ export {};
@@ -1,11 +1,13 @@
1
+ import React from "react";
1
2
  import { NonDeletedExcalidrawElement } from "../element/types";
2
3
  import { AppState, BinaryFiles } from "../types";
3
4
  import "./ExportDialog.scss";
4
5
  import { ActionManager } from "../actions/manager";
5
6
  export declare const ErrorCanvasPreview: () => JSX.Element;
6
7
  export declare type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
7
- export declare const ImageExportDialog: ({ elements, appState, files, exportPadding, actionManager, onExportToPng, onExportToSvg, onExportToClipboard, }: {
8
+ export declare const ImageExportDialog: ({ elements, appState, setAppState, files, exportPadding, actionManager, onExportToPng, onExportToSvg, onExportToClipboard, }: {
8
9
  appState: AppState;
10
+ setAppState: React.Component<any, AppState>["setState"];
9
11
  elements: readonly NonDeletedExcalidrawElement[];
10
12
  files: BinaryFiles;
11
13
  exportPadding?: number | undefined;
@@ -32,6 +32,7 @@ interface LayerUIProps {
32
32
  onImageAction: (data: {
33
33
  insertOnCanvasDirectly: boolean;
34
34
  }) => void;
35
+ renderWelcomeScreen: boolean;
35
36
  }
36
- declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
37
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, renderWelcomeScreen, }: LayerUIProps) => JSX.Element>;
37
38
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { AppState } from "../types";
3
+ import "./LibraryButton.scss";
3
4
  export declare const LibraryButton: React.FC<{
4
5
  appState: AppState;
5
6
  setAppState: React.Component<any, AppState>["setState"];
@@ -0,0 +1,7 @@
1
+ import { AppState, ExcalidrawProps } from "../types";
2
+ declare const LibraryMenuBrowseButton: ({ theme, id, libraryReturnUrl, }: {
3
+ libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
4
+ theme: AppState["theme"];
5
+ id: string;
6
+ }) => JSX.Element;
7
+ export default LibraryMenuBrowseButton;
@@ -1,6 +1,6 @@
1
- import { LibraryItem, LibraryItems } from "../types";
1
+ import { AppState, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
2
2
  import "./LibraryMenuItems.scss";
3
- declare const LibraryMenuItems: ({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, selectedItems, onSelectItems, }: {
3
+ declare const LibraryMenuItems: ({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, selectedItems, onSelectItems, theme, id, libraryReturnUrl, }: {
4
4
  isLoading: boolean;
5
5
  libraryItems: LibraryItems;
6
6
  pendingElements: LibraryItem["elements"];
@@ -8,5 +8,8 @@ declare const LibraryMenuItems: ({ isLoading, libraryItems, onAddToLibrary, onIn
8
8
  onAddToLibrary: (elements: LibraryItem["elements"]) => void;
9
9
  selectedItems: LibraryItem["id"][];
10
10
  onSelectItems: (id: LibraryItem["id"][]) => void;
11
+ libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
12
+ theme: AppState["theme"];
13
+ id: string;
11
14
  }) => JSX.Element;
12
15
  export default LibraryMenuItems;
@@ -0,0 +1,11 @@
1
+ import "./Menu.scss";
2
+ interface MenuProps {
3
+ icon: JSX.Element;
4
+ onClick: () => void;
5
+ label: string;
6
+ dataTestId: string;
7
+ shortcut?: string;
8
+ isCollaborating?: boolean;
9
+ }
10
+ declare const MenuItem: ({ icon, onClick, label, dataTestId, shortcut, isCollaborating, }: MenuProps) => JSX.Element;
11
+ export default MenuItem;
@@ -0,0 +1,2 @@
1
+ export declare const MenuLinks: () => JSX.Element;
2
+ export declare const Separator: () => JSX.Element;
@@ -22,6 +22,7 @@ declare type MobileMenuProps = {
22
22
  renderCustomStats?: ExcalidrawProps["renderCustomStats"];
23
23
  renderSidebars: () => JSX.Element | null;
24
24
  device: Device;
25
+ renderWelcomeScreen?: boolean;
25
26
  };
26
- export declare const MobileMenu: ({ appState, elements, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, }: MobileMenuProps) => JSX.Element;
27
+ export declare const MobileMenu: ({ appState, elements, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, }: MobileMenuProps) => JSX.Element;
27
28
  export {};
@@ -44,7 +44,6 @@ export declare const hostSidebarCountersAtom: import("jotai").Atom<{
44
44
  docked: number;
45
45
  })) => void>(setAtom: S) => void | (() => void)) | undefined;
46
46
  } & {
47
- /** @private internal */
48
47
  init: {
49
48
  rendered: number;
50
49
  docked: number;
@@ -55,6 +54,7 @@ export declare const Sidebar: import("react").ForwardRefExoticComponent<{
55
54
  onClose?: (() => boolean | void) | undefined;
56
55
  onDock?: ((docked: boolean) => void) | undefined;
57
56
  docked?: boolean | undefined;
57
+ initialDockedState?: boolean | undefined;
58
58
  dockable?: boolean | undefined;
59
59
  className?: string | undefined;
60
60
  } & {
@@ -8,6 +8,7 @@ export declare type SidebarProps<P = {}> = {
8
8
  /** if not supplied, sidebar won't be dockable */
9
9
  onDock?: (docked: boolean) => void;
10
10
  docked?: boolean;
11
+ initialDockedState?: boolean;
11
12
  dockable?: boolean;
12
13
  className?: string;
13
14
  } & P;