@zsviczian/excalidraw 0.11.0-obsidian-21-namedexport → 0.12.0-obsidian-0

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 (81) hide show
  1. package/README.md +352 -42
  2. package/dist/excalidraw.development.js +186 -149
  3. package/dist/excalidraw.production.min.js +1 -1
  4. package/dist/excalidraw.production.min.js.LICENSE.txt +2 -1
  5. package/package.json +22 -24
  6. package/types/actions/actionAddToLibrary.d.ts +19 -6
  7. package/types/actions/actionAlign.d.ts +6 -6
  8. package/types/actions/actionBoundText.d.ts +7 -2
  9. package/types/actions/actionCanvas.d.ts +70 -25
  10. package/types/actions/actionClipboard.d.ts +35 -10
  11. package/types/actions/actionDeleteSelected.d.ts +22 -7
  12. package/types/actions/actionDistribute.d.ts +2 -2
  13. package/types/actions/actionDuplicateSelection.d.ts +1 -1
  14. package/types/actions/actionExport.d.ts +69 -26
  15. package/types/actions/actionFinalize.d.ts +16 -6
  16. package/types/actions/actionGroup.d.ts +2 -2
  17. package/types/actions/actionMenu.d.ts +24 -9
  18. package/types/actions/actionNavigate.d.ts +1 -2
  19. package/types/actions/actionProperties.d.ts +104 -39
  20. package/types/actions/actionSelectAll.d.ts +2 -1
  21. package/types/actions/actionStyles.d.ts +5 -2
  22. package/types/actions/actionToggleGridMode.d.ts +7 -2
  23. package/types/actions/actionToggleStats.d.ts +7 -2
  24. package/types/actions/actionToggleViewMode.d.ts +7 -2
  25. package/types/actions/actionToggleZenMode.d.ts +7 -2
  26. package/types/actions/actionZindex.d.ts +4 -4
  27. package/types/analytics.d.ts +1 -1
  28. package/types/appState.d.ts +3 -0
  29. package/types/clients.d.ts +1 -1
  30. package/types/components/ActiveFile.d.ts +0 -1
  31. package/types/components/App.d.ts +17 -8
  32. package/types/components/ButtonIconSelect.d.ts +0 -1
  33. package/types/components/Card.d.ts +1 -0
  34. package/types/components/CheckboxItem.d.ts +1 -0
  35. package/types/components/ClearCanvas.d.ts +0 -1
  36. package/types/components/CollabButton.d.ts +0 -1
  37. package/types/components/ColorPicker.d.ts +0 -1
  38. package/types/components/ConfirmDialog.d.ts +0 -1
  39. package/types/components/DarkModeToggle.d.ts +0 -1
  40. package/types/components/ErrorDialog.d.ts +0 -1
  41. package/types/components/HelpDialog.d.ts +0 -1
  42. package/types/components/HelpIcon.d.ts +0 -1
  43. package/types/components/HintViewer.d.ts +0 -1
  44. package/types/components/IconPicker.d.ts +0 -1
  45. package/types/components/ImageExportDialog.d.ts +0 -1
  46. package/types/components/JSONExportDialog.d.ts +0 -1
  47. package/types/components/LayerUI.d.ts +4 -6
  48. package/types/components/LibraryMenu.d.ts +0 -1
  49. package/types/components/LibraryMenuItems.d.ts +2 -1
  50. package/types/components/LibraryUnit.d.ts +0 -1
  51. package/types/components/LockButton.d.ts +0 -1
  52. package/types/components/MobileMenu.d.ts +2 -2
  53. package/types/components/Modal.d.ts +2 -2
  54. package/types/components/PenModeButton.d.ts +0 -1
  55. package/types/components/ProjectName.d.ts +0 -1
  56. package/types/components/PublishLibrary.d.ts +0 -1
  57. package/types/components/Section.d.ts +4 -5
  58. package/types/components/SidebarLockButton.d.ts +8 -0
  59. package/types/components/SingleLibraryItem.d.ts +0 -1
  60. package/types/components/Spinner.d.ts +0 -1
  61. package/types/components/Stack.d.ts +1 -1
  62. package/types/components/Toast.d.ts +4 -3
  63. package/types/constants.d.ts +3 -1
  64. package/types/data/blob.d.ts +4 -4
  65. package/types/data/filesystem.d.ts +2 -2
  66. package/types/data/json.d.ts +1 -1
  67. package/types/element/Hyperlink.d.ts +8 -3
  68. package/types/element/binding.d.ts +3 -3
  69. package/types/element/dragElements.d.ts +1 -1
  70. package/types/element/linearElementEditor.d.ts +7 -2
  71. package/types/element/mutateElement.d.ts +1 -1
  72. package/types/element/textElement.d.ts +1 -1
  73. package/types/element/typeChecks.d.ts +3 -3
  74. package/types/jotai.d.ts +5 -3
  75. package/types/keys.d.ts +1 -1
  76. package/types/packages/excalidraw/example/App.d.ts +0 -1
  77. package/types/renderer/renderElement.d.ts +1 -1
  78. package/types/renderer/renderScene.d.ts +9 -1
  79. package/types/shapes.d.ts +0 -1
  80. package/types/types.d.ts +21 -12
  81. package/types/utils.d.ts +8 -5
@@ -12,7 +12,7 @@ export declare const actionSendBackward: {
12
12
  contextItemLabel: string;
13
13
  keyPriority: number;
14
14
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
15
- PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
15
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
16
16
  } & {
17
17
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
18
18
  };
@@ -29,7 +29,7 @@ export declare const actionBringForward: {
29
29
  contextItemLabel: string;
30
30
  keyPriority: number;
31
31
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
32
- PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
32
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
33
33
  } & {
34
34
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
35
35
  };
@@ -45,7 +45,7 @@ export declare const actionSendToBack: {
45
45
  };
46
46
  contextItemLabel: string;
47
47
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
48
- PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
48
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
49
49
  } & {
50
50
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
51
51
  };
@@ -61,7 +61,7 @@ export declare const actionBringToFront: {
61
61
  };
62
62
  contextItemLabel: string;
63
63
  keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
64
- PanelComponent: ({ updateData, appState }: React.PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
64
+ PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
65
65
  } & {
66
66
  keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
67
67
  };
@@ -1 +1 @@
1
- export declare const trackEvent: (category: string, action: string, label?: string | undefined, value?: number | undefined) => void;
1
+ export declare const trackEvent: (category: string, action: string, label?: string, value?: number) => void;
@@ -4,6 +4,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
4
4
  activeTool?: {
5
5
  type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
6
6
  lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
7
+ /** server (shareLink/collab/...) */
7
8
  locked: boolean;
8
9
  customType: null;
9
10
  } | {
@@ -57,6 +58,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
57
58
  [groupId: string]: boolean;
58
59
  } | undefined;
59
60
  editingGroupId?: string | null | undefined;
61
+ isLibraryOpen?: boolean | undefined;
62
+ isLibraryMenuDocked?: boolean | undefined;
60
63
  showStats?: boolean | undefined;
61
64
  currentChartType?: import("./element/types").ChartType | undefined;
62
65
  };
@@ -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 | undefined) => string;
6
+ export declare const getClientInitials: (username?: string | null) => string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ActiveFile.scss";
3
2
  declare type ActiveFileProps = {
4
3
  fileName?: string;
@@ -4,11 +4,17 @@ import { ActionManager } from "../actions/manager";
4
4
  import { RestoredDataState } from "../data/restore";
5
5
  import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
6
6
  import History from "../history";
7
- import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, DeviceType } from "../types";
7
+ import Scene from "../scene/Scene";
8
+ import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
8
9
  import { FileSystemHandle } from "../data/filesystem";
9
10
  import { ImportedDataState } from "../data/types";
10
11
  export declare let showFourthFont: boolean;
11
- export declare const useDeviceType: () => DeviceType;
12
+ export declare const useDevice: () => Readonly<{
13
+ isSmScreen: boolean;
14
+ isMobile: boolean;
15
+ isTouchScreen: boolean;
16
+ canDeviceFitSidebar: boolean;
17
+ }>;
12
18
  export declare const useExcalidrawContainer: () => {
13
19
  container: HTMLDivElement | null;
14
20
  id: string | null;
@@ -18,11 +24,11 @@ declare class App extends React.Component<AppProps, AppState> {
18
24
  rc: RoughCanvas | null;
19
25
  unmounted: boolean;
20
26
  actionManager: ActionManager;
21
- deviceType: DeviceType;
27
+ device: Device;
22
28
  detachIsMobileMqHandler?: () => void;
23
29
  private excalidrawContainerRef;
24
30
  static defaultProps: Partial<AppProps>;
25
- private scene;
31
+ scene: Scene;
26
32
  private resizeObserver;
27
33
  private nearestScrollableContainer;
28
34
  library: AppClassProperties["library"];
@@ -59,6 +65,7 @@ declare class App extends React.Component<AppProps, AppState> {
59
65
  */
60
66
  private resetScene;
61
67
  private initializeScene;
68
+ private refreshDeviceState;
62
69
  componentDidMount(): Promise<void>;
63
70
  componentWillUnmount(): void;
64
71
  private onResize;
@@ -80,14 +87,15 @@ declare class App extends React.Component<AppProps, AppState> {
80
87
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
81
88
  toggleLock: (source?: "keyboard" | "ui") => void;
82
89
  togglePenMode: () => void;
83
- toggleZenMode: () => void;
84
- toggleStats: () => void;
85
90
  scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[]) => void;
86
91
  zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
87
92
  updateContainerSize: (containers: NonDeletedExcalidrawElement[]) => void;
88
93
  restore: (data: ImportedDataState) => RestoredDataState;
89
- clearToast: () => void;
90
- setToastMessage: (toastMessage: string) => void;
94
+ setToast: (toast: {
95
+ message: string;
96
+ closable?: boolean;
97
+ duration?: number;
98
+ } | null) => void;
91
99
  restoreFileFromShare: () => Promise<void>;
92
100
  /** adds supplied files to existing files in the appState */
93
101
  addFiles: ExcalidrawImperativeAPI["addFiles"];
@@ -107,6 +115,7 @@ declare class App extends React.Component<AppProps, AppState> {
107
115
  private onSceneUpdated;
108
116
  private updateCurrentCursorPosition;
109
117
  private onKeyDown;
118
+ private onWheel;
110
119
  private onKeyUp;
111
120
  private setActiveTool;
112
121
  private setCursor;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ButtonIconSelect: <T extends Object>({ options, value, onChange, group, }: {
3
2
  options: {
4
3
  value: T;
@@ -3,4 +3,5 @@ import OpenColor from "open-color";
3
3
  import "./Card.scss";
4
4
  export declare const Card: React.FC<{
5
5
  color: keyof OpenColor | "primary";
6
+ children?: React.ReactNode;
6
7
  }>;
@@ -4,4 +4,5 @@ export declare const CheckboxItem: React.FC<{
4
4
  checked: boolean;
5
5
  onChange: (checked: boolean, event: React.MouseEvent) => void;
6
6
  className?: string;
7
+ children?: React.ReactNode;
7
8
  }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ClearCanvas: ({ onConfirm }: {
3
2
  onConfirm: () => void;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./CollabButton.scss";
3
2
  declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick, }: {
4
3
  isCollaborating: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ColorPicker.scss";
3
2
  import { ExcalidrawElement } from "../element/types";
4
3
  import { AppState } from "../types";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DialogProps } from "./Dialog";
3
2
  import "./ConfirmDialog.scss";
4
3
  interface Props extends Omit<DialogProps, "onCloseRequest"> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  import { Theme } from "../element/types";
4
3
  export declare const DarkModeToggle: (props: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ErrorDialog: ({ message, onClose, }: {
3
2
  message: string;
4
3
  onClose?: (() => void) | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./HelpDialog.scss";
3
2
  export declare const HelpDialog: ({ onClose }: {
4
3
  onClose?: (() => void) | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type HelpIconProps = {
3
2
  title?: string;
4
3
  name?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NonDeletedExcalidrawElement } from "../element/types";
3
2
  import "./HintViewer.scss";
4
3
  import { AppState } from "../types";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./IconPicker.scss";
3
2
  export declare function IconPicker<T>({ value, label, options, onChange, group, }: {
4
3
  label: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NonDeletedExcalidrawElement } from "../element/types";
3
2
  import { AppState, BinaryFiles } from "../types";
4
3
  import "./ExportDialog.scss";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NonDeletedExcalidrawElement } from "../element/types";
3
2
  import { AppState, ExportOpts, BinaryFiles } from "../types";
4
3
  import "./ExportDialog.scss";
@@ -17,15 +17,13 @@ interface LayerUIProps {
17
17
  onLockToggle: () => void;
18
18
  onPenModeToggle: () => void;
19
19
  onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
20
- zenModeEnabled: boolean;
21
20
  showExitZenModeBtn: boolean;
22
21
  showThemeBtn: boolean;
23
- toggleZenMode: () => void;
24
22
  langCode: Language["code"];
25
23
  isCollaborating: boolean;
26
- renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
27
- renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
28
- viewModeEnabled: boolean;
24
+ renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
25
+ renderCustomFooter?: ExcalidrawProps["renderFooter"];
26
+ renderCustomStats?: ExcalidrawProps["renderCustomStats"];
29
27
  libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
30
28
  UIOptions: AppProps["UIOptions"];
31
29
  focusContainer: () => void;
@@ -35,5 +33,5 @@ interface LayerUIProps {
35
33
  insertOnCanvasDirectly: boolean;
36
34
  }) => void;
37
35
  }
38
- declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, canvas, elements, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, zenModeEnabled, showExitZenModeBtn, showThemeBtn, toggleZenMode, isCollaborating, renderTopRightUI, renderCustomFooter, viewModeEnabled, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
36
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, canvas, elements, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, showThemeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
39
37
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import Library from "../data/library";
3
2
  import { LibraryItems, LibraryItem, AppState, BinaryFiles, ExcalidrawProps } from "../types";
4
3
  import "./LibraryMenu.scss";
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import Library from "../data/library";
3
3
  import { AppState, BinaryFiles, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
4
4
  import "./LibraryMenuItems.scss";
5
- declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, setAppState, libraryReturnUrl, library, files, id, selectedItems, onSelectItems, onPublish, resetLibrary, }: {
5
+ declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, setAppState, appState, libraryReturnUrl, library, files, id, selectedItems, onSelectItems, onPublish, resetLibrary, }: {
6
6
  isLoading: boolean;
7
7
  libraryItems: LibraryItems;
8
8
  pendingElements: LibraryItem["elements"];
@@ -12,6 +12,7 @@ declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary,
12
12
  theme: AppState["theme"];
13
13
  files: BinaryFiles;
14
14
  setAppState: React.Component<any, AppState>["setState"];
15
+ appState: AppState;
15
16
  libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
16
17
  library: Library;
17
18
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BinaryFiles, LibraryItem } from "../types";
3
2
  import "./LibraryUnit.scss";
4
3
  export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, selected, onToggle, onDrag, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  declare type LockIconProps = {
4
3
  title?: string;
@@ -16,12 +16,12 @@ declare type MobileMenuProps = {
16
16
  canvas: HTMLCanvasElement | null;
17
17
  isCollaborating: boolean;
18
18
  renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
19
- viewModeEnabled: boolean;
20
19
  showThemeBtn: boolean;
21
20
  onImageAction: (data: {
22
21
  insertOnCanvasDirectly: boolean;
23
22
  }) => void;
24
23
  renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
24
+ renderStats: () => JSX.Element | null;
25
25
  };
26
- export declare const MobileMenu: ({ appState, elements, libraryMenu, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, viewModeEnabled, showThemeBtn, onImageAction, renderTopRightUI, }: MobileMenuProps) => JSX.Element;
26
+ export declare const MobileMenu: ({ appState, elements, libraryMenu, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, showThemeBtn, onImageAction, renderTopRightUI, renderStats, }: MobileMenuProps) => JSX.Element;
27
27
  export {};
@@ -1,7 +1,7 @@
1
1
  import "./Modal.scss";
2
2
  import React from "react";
3
3
  import { AppState } from "../types";
4
- export declare const Modal: (props: {
4
+ export declare const Modal: React.FC<{
5
5
  className?: string;
6
6
  children: React.ReactNode;
7
7
  maxWidth?: number;
@@ -9,4 +9,4 @@ export declare const Modal: (props: {
9
9
  labelledBy: string;
10
10
  theme?: AppState["theme"];
11
11
  closeOnClickOutside?: boolean;
12
- }) => React.ReactPortal | null;
12
+ }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  declare type PenModeIconProps = {
4
3
  title?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./TextInput.scss";
3
2
  import "./ProjectName.scss";
4
3
  declare type Props = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState, LibraryItems } from "../types";
3
2
  import "./PublishLibrary.scss";
4
3
  declare const PublishLibrary: ({ onClose, libraryItems, appState, onSuccess, onError, updateItemsInStorage, onRemove, }: {
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
- interface SectionProps extends React.HTMLProps<HTMLElement> {
2
+ export declare const Section: React.FC<{
3
3
  heading: string;
4
- children: React.ReactNode | ((header: React.ReactNode) => React.ReactNode);
5
- }
6
- export declare const Section: ({ heading, children, ...props }: SectionProps) => JSX.Element;
7
- export {};
4
+ children?: React.ReactNode | ((heading: React.ReactNode) => React.ReactNode);
5
+ className?: string;
6
+ }>;
@@ -0,0 +1,8 @@
1
+ import "./ToolIcon.scss";
2
+ import "./SidebarLockButton.scss";
3
+ declare type SidebarLockIconProps = {
4
+ checked: boolean;
5
+ onChange?(): void;
6
+ };
7
+ export declare const SidebarLockButton: (props: SidebarLockIconProps) => JSX.Element;
8
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState, LibraryItem } from "../types";
3
2
  import "./SingleLibraryItem.scss";
4
3
  declare const SingleLibraryItem: ({ libItem, appState, index, onChange, onRemove, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./Spinner.scss";
3
2
  declare const Spinner: ({ size, circleWidth, }: {
4
3
  size?: string | number | undefined;
@@ -10,6 +10,6 @@ declare type StackProps = {
10
10
  };
11
11
  declare const _default: {
12
12
  Row: ({ children, gap, align, justifyContent, className, style, }: StackProps) => JSX.Element;
13
- Col: ({ children, gap, align, justifyContent, className, }: StackProps) => JSX.Element;
13
+ Col: ({ children, gap, align, justifyContent, className, style, }: StackProps) => JSX.Element;
14
14
  };
15
15
  export default _default;
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
2
1
  import "./Toast.scss";
3
- export declare const Toast: ({ message, clearToast, }: {
2
+ export declare const Toast: ({ message, onClose, closable, duration, }: {
4
3
  message: string;
5
- clearToast: () => void;
4
+ onClose: () => void;
5
+ closable?: boolean | undefined;
6
+ duration?: number | undefined;
6
7
  }) => JSX.Element;
@@ -99,7 +99,6 @@ export declare const IMAGE_RENDER_TIMEOUT = 500;
99
99
  export declare const TAP_TWICE_TIMEOUT = 300;
100
100
  export declare const TOUCH_CTX_MENU_TIMEOUT = 500;
101
101
  export declare const TITLE_TIMEOUT = 10000;
102
- export declare const TOAST_TIMEOUT = 5000;
103
102
  export declare const VERSION_TIMEOUT = 30000;
104
103
  export declare const SCROLL_TIMEOUT = 100;
105
104
  export declare const ZOOM_STEP = 0.1;
@@ -119,9 +118,12 @@ export declare const URL_HASH_KEYS: {
119
118
  readonly addLibrary: "addLibrary";
120
119
  };
121
120
  export declare const DEFAULT_UI_OPTIONS: AppProps["UIOptions"];
121
+ export declare const MQ_SM_MAX_WIDTH = 640;
122
122
  export declare const MQ_MAX_WIDTH_PORTRAIT = 730;
123
123
  export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
124
124
  export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
125
+ export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
126
+ export declare const LIBRARY_SIDEBAR_WIDTH: number;
125
127
  export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
126
128
  export declare const EXPORT_SCALES: number[];
127
129
  export declare const DEFAULT_EXPORT_PADDING = 10;
@@ -8,16 +8,16 @@ export declare const getFileHandleType: (handle: FileSystemHandle | null) => str
8
8
  export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
9
9
  export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
10
10
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
11
- type: typeof ALLOWED_IMAGE_MIME_TYPES[number];
11
+ type: (typeof ALLOWED_IMAGE_MIME_TYPES)[number];
12
12
  };
13
- export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<{
13
+ export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<{
14
14
  type: "application/vnd.excalidraw+json";
15
15
  data: import("./restore").RestoredDataState;
16
16
  } | {
17
17
  type: "application/vnd.excalidrawlib+json";
18
18
  data: ImportedLibraryData;
19
19
  }>;
20
- export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<import("./restore").RestoredDataState>;
20
+ export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<import("./restore").RestoredDataState>;
21
21
  export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
22
22
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
23
23
  export declare const canvasToBlob: (canvas: HTMLCanvasElement) => Promise<Blob>;
@@ -28,7 +28,7 @@ export declare const getDataURL: (file: Blob | File) => Promise<DataURL>;
28
28
  export declare const dataURLToFile: (dataURL: DataURL, filename?: string) => File;
29
29
  export declare const resizeImageFile: (file: File, opts: {
30
30
  /** undefined indicates auto */
31
- outputType?: typeof MIME_TYPES["jpg"];
31
+ outputType?: (typeof MIME_TYPES)["jpg"];
32
32
  maxWidthOrHeight: number;
33
33
  }) => Promise<File>;
34
34
  export declare const SVGStringToFile: (SVGString: string, filename?: string) => File & {
@@ -1,10 +1,10 @@
1
- import { FileWithHandle, FileSystemHandle, supported as nativeFileSystemSupported } from "browser-fs-access";
1
+ import { FileSystemHandle, supported as nativeFileSystemSupported } from "browser-fs-access";
2
2
  declare type FILE_EXTENSION = "gif" | "jpg" | "png" | "excalidraw.png" | "svg" | "excalidraw.svg" | "json" | "excalidraw" | "excalidrawlib";
3
3
  export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
4
4
  extensions?: FILE_EXTENSION[] | undefined;
5
5
  description: string;
6
6
  multiple?: M | undefined;
7
- }) => Promise<M extends false | undefined ? FileWithHandle : FileWithHandle[]>;
7
+ }) => Promise<M extends false | undefined ? File : File[]>;
8
8
  export declare const fileSave: (blob: Blob, opts: {
9
9
  /** supply without the extension */
10
10
  name: string;
@@ -10,7 +10,7 @@ export declare const isValidExcalidrawData: (data?: {
10
10
  type?: any;
11
11
  elements?: any;
12
12
  appState?: any;
13
- } | undefined) => data is ImportedDataState;
13
+ }) => data is ImportedDataState;
14
14
  export declare const isValidLibrary: (json: any) => json is ImportedLibraryData;
15
15
  export declare const serializeLibraryAsJSON: (libraryItems: LibraryItems) => string;
16
16
  export declare const saveLibraryAsJSON: (libraryItems: LibraryItems) => Promise<void>;
@@ -82,7 +82,11 @@ export declare const actionLink: {
82
82
  };
83
83
  shouldCacheIgnoreZoom: boolean;
84
84
  showHelpDialog: boolean;
85
- toastMessage: string | null;
85
+ toast: {
86
+ message: string;
87
+ closable?: boolean | undefined;
88
+ duration?: number | undefined;
89
+ } | null;
86
90
  zenModeEnabled: boolean;
87
91
  theme: string;
88
92
  gridSize: number | null;
@@ -96,6 +100,7 @@ export declare const actionLink: {
96
100
  offsetTop: number;
97
101
  offsetLeft: number;
98
102
  isLibraryOpen: boolean;
103
+ isLibraryMenuDocked: boolean;
99
104
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
100
105
  collaborators: Map<string, import("../types").Collaborator>;
101
106
  showStats: boolean;
@@ -107,7 +112,7 @@ export declare const actionLink: {
107
112
  shown: true;
108
113
  data: import("../charts").Spreadsheet;
109
114
  };
110
- pendingImageElement: import("./types").NonDeleted<import("./types").ExcalidrawImageElement> | null;
115
+ pendingImageElementId: string | null;
111
116
  linkOpacity: number;
112
117
  trayModeEnabled: boolean;
113
118
  colorPalette: {
@@ -125,7 +130,7 @@ export declare const actionLink: {
125
130
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
126
131
  contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
127
132
  contextItemPredicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
128
- PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("../actions/types").PanelComponentProps>) => JSX.Element;
133
+ PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
129
134
  } & {
130
135
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
131
136
  };
@@ -22,12 +22,12 @@ export declare const getHoveredElementForBinding: (pointerCoords: {
22
22
  y: number;
23
23
  }, scene: Scene) => NonDeleted<ExcalidrawBindableElement> | null;
24
24
  export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, options?: {
25
- simultaneouslyUpdated?: readonly ExcalidrawElement[] | undefined;
25
+ simultaneouslyUpdated?: readonly ExcalidrawElement[];
26
26
  newSize?: {
27
27
  width: number;
28
28
  height: number;
29
- } | undefined;
30
- } | undefined) => void;
29
+ };
30
+ }) => void;
31
31
  export declare const getEligibleElementsForBinding: (elements: NonDeleted<ExcalidrawElement>[]) => SuggestedBinding[];
32
32
  export declare const fixBindingsAfterDuplication: (sceneElements: readonly ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>, duplicatesServeAsOld?: "duplicatesServeAsOld" | undefined) => void;
33
33
  export declare const fixBindingsAfterDeletion: (sceneElements: readonly ExcalidrawElement[], deletedElements: readonly ExcalidrawElement[]) => void;
@@ -2,4 +2,4 @@ import { NonDeletedExcalidrawElement } from "./types";
2
2
  import { AppState, PointerDownState } from "../types";
3
3
  export declare const dragSelectedElements: (pointerDownState: PointerDownState, selectedElements: NonDeletedExcalidrawElement[], pointerX: number, pointerY: number, lockDirection: boolean | undefined, distanceX: number | undefined, distanceY: number | undefined, appState: AppState) => void;
4
4
  export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
5
- export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: AppState["activeTool"]["type"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, widthAspectRatio?: number | null | undefined) => void;
5
+ export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: AppState["activeTool"]["type"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, widthAspectRatio?: number | null) => void;
@@ -149,7 +149,11 @@ export declare class LinearElementEditor {
149
149
  };
150
150
  shouldCacheIgnoreZoom: boolean;
151
151
  showHelpDialog: boolean;
152
- toastMessage: string | null;
152
+ toast: {
153
+ message: string;
154
+ closable?: boolean | undefined;
155
+ duration?: number | undefined;
156
+ } | null;
153
157
  zenModeEnabled: boolean;
154
158
  theme: string;
155
159
  gridSize: number | null;
@@ -163,6 +167,7 @@ export declare class LinearElementEditor {
163
167
  offsetTop: number;
164
168
  offsetLeft: number;
165
169
  isLibraryOpen: boolean;
170
+ isLibraryMenuDocked: boolean;
166
171
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
167
172
  collaborators: Map<string, import("../types").Collaborator>;
168
173
  showStats: boolean;
@@ -174,7 +179,7 @@ export declare class LinearElementEditor {
174
179
  shown: true;
175
180
  data: import("../charts").Spreadsheet;
176
181
  };
177
- pendingImageElement: NonDeleted<import("./types").ExcalidrawImageElement> | null;
182
+ pendingImageElementId: string | null;
178
183
  showHyperlinkPopup: false | "info" | "editor";
179
184
  linkOpacity: number;
180
185
  trayModeEnabled: boolean;
@@ -7,5 +7,5 @@ export declare const newElementWith: <TElement extends ExcalidrawElement>(elemen
7
7
  *
8
8
  * NOTE: does not trigger re-render.
9
9
  */
10
- export declare const bumpVersion: (element: Mutable<ExcalidrawElement>, version?: number | undefined) => Mutable<ExcalidrawElement>;
10
+ export declare const bumpVersion: (element: Mutable<ExcalidrawElement>, version?: ExcalidrawElement["version"]) => Mutable<ExcalidrawElement>;
11
11
  export {};
@@ -3,7 +3,7 @@ import { MaybeTransformHandleType } from "./transformHandles";
3
3
  export declare const redrawTextBoundingBox: (element: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
4
4
  export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
5
5
  export declare const handleBindTextResize: (element: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
6
- export declare const measureText: (text: string, font: FontString, maxWidth?: number | null | undefined) => {
6
+ export declare const measureText: (text: string, font: FontString, maxWidth?: number | null) => {
7
7
  width: number;
8
8
  height: number;
9
9
  baseline: number;
@@ -4,11 +4,11 @@ export declare const isGenericElement: (element: ExcalidrawElement | null) => el
4
4
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
5
5
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
6
6
  export declare const isTextElement: (element: ExcalidrawElement | null) => element is ExcalidrawTextElement;
7
- export declare const isFreeDrawElement: (element?: ExcalidrawElement | null | undefined) => element is ExcalidrawFreeDrawElement;
7
+ export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
8
8
  export declare const isFreeDrawElementType: (elementType: ExcalidrawElement["type"]) => boolean;
9
- export declare const isLinearElement: (element?: ExcalidrawElement | null | undefined) => element is ExcalidrawLinearElement;
9
+ export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
10
10
  export declare const isLinearElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
11
- export declare const isBindingElement: (element?: ExcalidrawElement | null | undefined, includeLocked?: boolean) => element is ExcalidrawLinearElement;
11
+ export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
12
12
  export declare const isBindingElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
13
13
  export declare const isBindableElement: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawBindableElement;
14
14
  export declare const isTextBindableContainer: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawTextContainer;