@zsviczian/excalidraw 0.14.0-obsidian → 0.14.2-1-obsidian

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 (60) hide show
  1. package/README.md +16 -1823
  2. package/dist/excalidraw.development.js +282 -139
  3. package/dist/excalidraw.production.min.js +1 -1
  4. package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
  5. package/package.json +1 -1
  6. package/types/actions/actionAddToLibrary.d.ts +33 -15
  7. package/types/actions/actionBoundText.d.ts +11 -5
  8. package/types/actions/actionCanvas.d.ts +225 -47
  9. package/types/actions/actionClipboard.d.ts +55 -25
  10. package/types/actions/actionDeleteSelected.d.ts +35 -17
  11. package/types/actions/actionExport.d.ts +99 -45
  12. package/types/actions/actionFinalize.d.ts +22 -10
  13. package/types/actions/actionLinearEditor.d.ts +11 -5
  14. package/types/actions/actionMenu.d.ts +33 -15
  15. package/types/actions/actionProperties.d.ts +143 -65
  16. package/types/actions/actionStyles.d.ts +11 -5
  17. package/types/actions/actionToggleGridMode.d.ts +11 -5
  18. package/types/actions/actionToggleLock.d.ts +11 -5
  19. package/types/actions/actionToggleStats.d.ts +11 -5
  20. package/types/actions/actionToggleViewMode.d.ts +11 -5
  21. package/types/actions/actionToggleZenMode.d.ts +11 -5
  22. package/types/actions/shortcuts.d.ts +1 -1
  23. package/types/actions/types.d.ts +1 -1
  24. package/types/appState.d.ts +8 -6
  25. package/types/components/ActiveConfirmDialog.d.ts +24 -0
  26. package/types/components/App.d.ts +3 -1
  27. package/types/components/HandButton.d.ts +10 -0
  28. package/types/components/LayerUI.d.ts +2 -2
  29. package/types/components/LockButton.d.ts +0 -1
  30. package/types/components/MobileMenu.d.ts +4 -4
  31. package/types/components/ToolButton.d.ts +1 -1
  32. package/types/components/context/tunnels.d.ts +16 -0
  33. package/types/components/dropdownMenu/DropdownMenu.d.ts +7 -5
  34. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +7 -3
  35. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +2 -3
  36. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +3 -2
  37. package/types/components/dropdownMenu/common.d.ts +6 -0
  38. package/types/components/footer/Footer.d.ts +3 -4
  39. package/types/components/hoc/withInternalFallback.d.ts +4 -0
  40. package/types/components/icons.d.ts +1 -0
  41. package/types/components/main-menu/MainMenu.d.ts +14 -9
  42. package/types/components/welcome-screen/WelcomeScreen.d.ts +2 -2
  43. package/types/constants.d.ts +11 -1
  44. package/types/data/restore.d.ts +8 -2
  45. package/types/element/Hyperlink.d.ts +11 -5
  46. package/types/element/linearElementEditor.d.ts +12 -5
  47. package/types/element/newElement.d.ts +0 -3
  48. package/types/element/sortElements.d.ts +2 -0
  49. package/types/element/textElement.d.ts +9 -8
  50. package/types/element/typeChecks.d.ts +1 -1
  51. package/types/element/types.d.ts +0 -1
  52. package/types/i18n.d.ts +6 -0
  53. package/types/jotai.d.ts +5 -5
  54. package/types/keys.d.ts +0 -3
  55. package/types/math.d.ts +1 -0
  56. package/types/packages/excalidraw/example/App.d.ts +7 -1
  57. package/types/packages/excalidraw/index.d.ts +1 -1
  58. package/types/packages/utils.d.ts +1 -1
  59. package/types/types.d.ts +21 -24
  60. package/types/utils.d.ts +9 -19
@@ -26,16 +26,15 @@ export declare const actionToggleStats: {
26
26
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
27
27
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
28
28
  activeTool: {
29
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
30
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
29
+ lastActiveTool: import("../types").LastActiveTool;
31
30
  locked: boolean;
31
+ } & ({
32
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
32
33
  customType: null;
33
34
  } | {
34
35
  type: "custom";
35
36
  customType: string;
36
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
37
- locked: boolean;
38
- };
37
+ });
39
38
  penMode: boolean;
40
39
  penDetected: boolean;
41
40
  exportBackground: boolean;
@@ -87,6 +86,7 @@ export declare const actionToggleStats: {
87
86
  zenModeEnabled: boolean;
88
87
  theme: string;
89
88
  gridSize: number | null;
89
+ previousGridSize: number | null;
90
90
  viewModeEnabled: boolean;
91
91
  selectedGroupIds: {
92
92
  [groupId: string]: boolean;
@@ -115,6 +115,12 @@ export declare const actionToggleStats: {
115
115
  elementBackground?: string[] | undefined;
116
116
  elementStroke?: string[] | undefined;
117
117
  };
118
+ allowWheelZoom?: boolean | undefined;
119
+ allowPinchZoom?: boolean | undefined;
120
+ pinnedScripts?: string[] | undefined;
121
+ customPens?: any[] | undefined;
122
+ currentStrokeOptions?: any;
123
+ resetCustomPen?: any;
118
124
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
119
125
  };
120
126
  commitToHistory: false;
@@ -27,16 +27,15 @@ export declare const actionToggleViewMode: {
27
27
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
28
28
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
29
29
  activeTool: {
30
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
31
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
30
+ lastActiveTool: import("../types").LastActiveTool;
32
31
  locked: boolean;
32
+ } & ({
33
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
33
34
  customType: null;
34
35
  } | {
35
36
  type: "custom";
36
37
  customType: string;
37
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
38
- locked: boolean;
39
- };
38
+ });
40
39
  penMode: boolean;
41
40
  penDetected: boolean;
42
41
  exportBackground: boolean;
@@ -88,6 +87,7 @@ export declare const actionToggleViewMode: {
88
87
  zenModeEnabled: boolean;
89
88
  theme: string;
90
89
  gridSize: number | null;
90
+ previousGridSize: number | null;
91
91
  selectedGroupIds: {
92
92
  [groupId: string]: boolean;
93
93
  };
@@ -116,6 +116,12 @@ export declare const actionToggleViewMode: {
116
116
  elementBackground?: string[] | undefined;
117
117
  elementStroke?: string[] | undefined;
118
118
  };
119
+ allowWheelZoom?: boolean | undefined;
120
+ allowPinchZoom?: boolean | undefined;
121
+ pinnedScripts?: string[] | undefined;
122
+ customPens?: any[] | undefined;
123
+ currentStrokeOptions?: any;
124
+ resetCustomPen?: any;
119
125
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
120
126
  };
121
127
  commitToHistory: false;
@@ -27,16 +27,15 @@ export declare const actionToggleZenMode: {
27
27
  editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
28
28
  editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
29
29
  activeTool: {
30
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
31
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
30
+ lastActiveTool: import("../types").LastActiveTool;
32
31
  locked: boolean;
32
+ } & ({
33
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
33
34
  customType: null;
34
35
  } | {
35
36
  type: "custom";
36
37
  customType: string;
37
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
38
- locked: boolean;
39
- };
38
+ });
40
39
  penMode: boolean;
41
40
  penDetected: boolean;
42
41
  exportBackground: boolean;
@@ -87,6 +86,7 @@ export declare const actionToggleZenMode: {
87
86
  } | null;
88
87
  theme: string;
89
88
  gridSize: number | null;
89
+ previousGridSize: number | null;
90
90
  viewModeEnabled: boolean;
91
91
  selectedGroupIds: {
92
92
  [groupId: string]: boolean;
@@ -116,6 +116,12 @@ export declare const actionToggleZenMode: {
116
116
  elementBackground?: string[] | undefined;
117
117
  elementStroke?: string[] | undefined;
118
118
  };
119
+ allowWheelZoom?: boolean | undefined;
120
+ allowPinchZoom?: boolean | undefined;
121
+ pinnedScripts?: string[] | undefined;
122
+ customPens?: any[] | undefined;
123
+ currentStrokeOptions?: any;
124
+ resetCustomPen?: any;
119
125
  selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
120
126
  };
121
127
  commitToHistory: false;
@@ -1,3 +1,3 @@
1
1
  import { ActionName } from "./types";
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";
2
+ export declare type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "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" | "changeRoundness" | "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" | "bindText" | "toggleLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool";
18
18
  export declare type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: AppState;
@@ -3,17 +3,16 @@ export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "off
3
3
  export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
4
4
  theme?: string | undefined;
5
5
  name?: string | undefined;
6
- activeTool?: {
7
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
8
- lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
6
+ activeTool?: ({
7
+ lastActiveTool: import("./types").LastActiveTool;
9
8
  locked: boolean;
9
+ } & ({
10
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
10
11
  customType: null;
11
12
  } | {
12
13
  type: "custom";
13
14
  customType: string;
14
- lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
15
- locked: boolean;
16
- } | undefined;
15
+ })) | undefined;
17
16
  showWelcomeScreen?: boolean | undefined;
18
17
  penMode?: boolean | undefined;
19
18
  penDetected?: boolean | undefined;
@@ -74,3 +73,6 @@ export declare const clearAppStateForDatabase: (appState: Partial<AppState>) =>
74
73
  export declare const isEraserActive: ({ activeTool, }: {
75
74
  activeTool: AppState["activeTool"];
76
75
  }) => boolean;
76
+ export declare const isHandToolActive: ({ activeTool, }: {
77
+ activeTool: AppState["activeTool"];
78
+ }) => boolean;
@@ -0,0 +1,24 @@
1
+ export declare const activeConfirmDialogAtom: import("jotai").Atom<"clearCanvas" | null> & {
2
+ write: (get: {
3
+ <Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
4
+ <Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
5
+ <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;
6
+ } & {
7
+ <Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
8
+ unstable_promise: true;
9
+ }): Value_3 | Promise<Value_3>;
10
+ <Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
11
+ unstable_promise: true;
12
+ }): Value_4 | Promise<Value_4>;
13
+ <Value_5>(atom: import("jotai").Atom<Value_5>, options: {
14
+ unstable_promise: true;
15
+ }): (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>;
16
+ }, set: {
17
+ <Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
18
+ <Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
19
+ }, update: "clearCanvas" | ((prev: "clearCanvas" | null) => "clearCanvas" | null) | null) => void;
20
+ onMount?: (<S extends (update: "clearCanvas" | ((prev: "clearCanvas" | null) => "clearCanvas" | null) | null) => void>(setAtom: S) => void | (() => void)) | undefined;
21
+ } & {
22
+ init: "clearCanvas" | null;
23
+ };
24
+ export declare const ActiveConfirmDialog: () => JSX.Element | null;
@@ -3,7 +3,7 @@ import { RoughCanvas } from "roughjs/bin/canvas";
3
3
  import { ActionManager } from "../actions/manager";
4
4
  import { RestoredDataState } from "../data/restore";
5
5
  import { LinearElementEditor } from "../element/linearElementEditor";
6
- import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
6
+ import { ExcalidrawElement, ExcalidrawLinearElement, NonDeletedExcalidrawElement } from "../element/types";
7
7
  import History from "../history";
8
8
  import Scene from "../scene/Scene";
9
9
  import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
@@ -96,8 +96,10 @@ declare class App extends React.Component<AppProps, AppState> {
96
96
  removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
97
97
  toggleLock: (source?: "keyboard" | "ui") => void;
98
98
  togglePenMode: () => void;
99
+ onHandToolToggle: () => void;
99
100
  scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[]) => void;
100
101
  zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
102
+ startLineEditor: (el: ExcalidrawLinearElement, selectedPointsIndices?: number[] | null) => void;
101
103
  updateContainerSize: (containers: NonDeletedExcalidrawElement[]) => void;
102
104
  restore: (data: ImportedDataState) => RestoredDataState;
103
105
  setToast: (toast: {
@@ -0,0 +1,10 @@
1
+ import "./ToolIcon.scss";
2
+ declare type LockIconProps = {
3
+ title?: string;
4
+ name?: string;
5
+ checked: boolean;
6
+ onChange?(): void;
7
+ isMobile?: boolean;
8
+ };
9
+ export declare const HandButton: (props: LockIconProps) => JSX.Element;
10
+ export {};
@@ -14,11 +14,11 @@ interface LayerUIProps {
14
14
  setAppState: React.Component<any, AppState>["setState"];
15
15
  elements: readonly NonDeletedExcalidrawElement[];
16
16
  onLockToggle: () => void;
17
+ onHandToolToggle: () => void;
17
18
  onPenModeToggle: () => void;
18
19
  onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
19
20
  showExitZenModeBtn: boolean;
20
21
  langCode: Language["code"];
21
- isCollaborating: boolean;
22
22
  renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
23
23
  renderCustomStats?: ExcalidrawProps["renderCustomStats"];
24
24
  renderCustomSidebar?: ExcalidrawProps["renderSidebar"];
@@ -33,5 +33,5 @@ interface LayerUIProps {
33
33
  renderWelcomeScreen: boolean;
34
34
  children?: React.ReactNode;
35
35
  }
36
- declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
36
+ declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, renderTopRightUI, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
37
37
  export default _default;
@@ -4,7 +4,6 @@ declare type LockIconProps = {
4
4
  name?: string;
5
5
  checked: boolean;
6
6
  onChange?(): void;
7
- zenModeEnabled?: boolean;
8
7
  isMobile?: boolean;
9
8
  };
10
9
  export declare const LockButton: (props: LockIconProps) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AppState, Device, ExcalidrawProps, UIWelcomeScreenComponents } from "../types";
2
+ import { AppState, Device, ExcalidrawProps } from "../types";
3
3
  import { ActionManager } from "../actions/manager";
4
4
  import { NonDeletedExcalidrawElement } from "../element/types";
5
5
  declare type MobileMenuProps = {
@@ -10,6 +10,7 @@ declare type MobileMenuProps = {
10
10
  setAppState: React.Component<any, AppState>["setState"];
11
11
  elements: readonly NonDeletedExcalidrawElement[];
12
12
  onLockToggle: () => void;
13
+ onHandToolToggle: () => void;
13
14
  onPenModeToggle: () => void;
14
15
  canvas: HTMLCanvasElement | null;
15
16
  onImageAction: (data: {
@@ -19,8 +20,7 @@ declare type MobileMenuProps = {
19
20
  renderCustomStats?: ExcalidrawProps["renderCustomStats"];
20
21
  renderSidebars: () => JSX.Element | null;
21
22
  device: Device;
22
- renderMenu: () => React.ReactNode;
23
- welcomeScreenCenter: UIWelcomeScreenComponents["Center"];
23
+ renderWelcomeScreen: boolean;
24
24
  };
25
- export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderMenu, welcomeScreenCenter, }: MobileMenuProps) => JSX.Element;
25
+ export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, canvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, }: MobileMenuProps) => JSX.Element;
26
26
  export {};
@@ -12,7 +12,7 @@ declare type ToolButtonBaseProps = {
12
12
  name?: string;
13
13
  id?: string;
14
14
  size?: ToolButtonSize;
15
- keyBindingLabel?: string;
15
+ keyBindingLabel?: string | null;
16
16
  showAriaLabel?: boolean;
17
17
  hidden?: boolean;
18
18
  visible?: boolean;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import tunnel from "@dwelle/tunnel-rat";
3
+ declare type Tunnel = ReturnType<typeof tunnel>;
4
+ declare type TunnelsContextValue = {
5
+ mainMenuTunnel: Tunnel;
6
+ welcomeScreenMenuHintTunnel: Tunnel;
7
+ welcomeScreenToolbarHintTunnel: Tunnel;
8
+ welcomeScreenHelpHintTunnel: Tunnel;
9
+ welcomeScreenCenterTunnel: Tunnel;
10
+ footerCenterTunnel: Tunnel;
11
+ jotaiScope: symbol;
12
+ };
13
+ export declare const TunnelsContext: React.Context<TunnelsContextValue>;
14
+ export declare const useTunnels: () => TunnelsContextValue;
15
+ export declare const useInitializeTunnels: () => TunnelsContextValue;
16
+ export {};
@@ -14,10 +14,11 @@ declare const DropdownMenu: {
14
14
  displayName: string;
15
15
  };
16
16
  Content: {
17
- ({ children, onClickOutside, className, style, }: {
17
+ ({ children, onClickOutside, className, onSelect, style, }: {
18
18
  children?: React.ReactNode;
19
19
  onClickOutside?: (() => void) | undefined;
20
20
  className?: string | undefined;
21
+ onSelect?: ((event: Event) => void) | undefined;
21
22
  style?: React.CSSProperties | undefined;
22
23
  }): JSX.Element;
23
24
  displayName: string;
@@ -25,20 +26,21 @@ declare const DropdownMenu: {
25
26
  Item: {
26
27
  ({ icon, onSelect, children, shortcut, className, ...rest }: {
27
28
  icon?: JSX.Element | undefined;
28
- onSelect: () => void;
29
+ onSelect: (event: Event) => void;
29
30
  children: React.ReactNode;
30
31
  shortcut?: string | undefined;
31
32
  className?: string | undefined;
32
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
33
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
33
34
  displayName: string;
34
35
  };
35
36
  ItemLink: {
36
- ({ icon, shortcut, href, children, className, ...rest }: {
37
+ ({ icon, shortcut, href, children, onSelect, className, ...rest }: {
38
+ href: string;
37
39
  icon?: JSX.Element | undefined;
38
40
  children: React.ReactNode;
39
41
  shortcut?: string | undefined;
40
42
  className?: string | undefined;
41
- href: string;
43
+ onSelect?: ((event: Event) => void) | undefined;
42
44
  } & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
43
45
  displayName: string;
44
46
  };
@@ -1,10 +1,14 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  declare const MenuContent: {
3
- ({ children, onClickOutside, className, style, }: {
3
+ ({ children, onClickOutside, className, onSelect, style, }: {
4
4
  children?: React.ReactNode;
5
5
  onClickOutside?: (() => void) | undefined;
6
6
  className?: string | undefined;
7
- style?: import("react").CSSProperties | undefined;
7
+ /**
8
+ * Called when any menu item is selected (clicked on).
9
+ */
10
+ onSelect?: ((event: Event) => void) | undefined;
11
+ style?: React.CSSProperties | undefined;
8
12
  }): JSX.Element;
9
13
  displayName: string;
10
14
  };
@@ -1,13 +1,12 @@
1
1
  import React from "react";
2
- export declare const getDrodownMenuItemClassName: (className?: string) => string;
3
2
  declare const DropdownMenuItem: {
4
3
  ({ icon, onSelect, children, shortcut, className, ...rest }: {
5
4
  icon?: JSX.Element | undefined;
6
- onSelect: () => void;
5
+ onSelect: (event: Event) => void;
7
6
  children: React.ReactNode;
8
7
  shortcut?: string | undefined;
9
8
  className?: string | undefined;
10
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
9
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
11
10
  displayName: string;
12
11
  };
13
12
  export default DropdownMenuItem;
@@ -1,11 +1,12 @@
1
1
  import React from "react";
2
2
  declare const DropdownMenuItemLink: {
3
- ({ icon, shortcut, href, children, className, ...rest }: {
3
+ ({ icon, shortcut, href, children, onSelect, className, ...rest }: {
4
+ href: string;
4
5
  icon?: JSX.Element | undefined;
5
6
  children: React.ReactNode;
6
7
  shortcut?: string | undefined;
7
8
  className?: string | undefined;
8
- href: string;
9
+ onSelect?: ((event: Event) => void) | undefined;
9
10
  } & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
10
11
  displayName: string;
11
12
  };
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export declare const DropdownMenuContentPropsContext: React.Context<{
3
+ onSelect?: ((event: Event) => void) | undefined;
4
+ }>;
5
+ export declare const getDropdownMenuItemClassName: (className?: string) => string;
6
+ export declare const useHandleDropdownMenuItemClick: (origOnClick: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | undefined, onSelect: ((event: Event) => void) | undefined) => (event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement, MouseEvent>) => void;
@@ -1,12 +1,11 @@
1
1
  import { ActionManager } from "../../actions/manager";
2
- import { AppState, UIChildrenComponents, UIWelcomeScreenComponents } from "../../types";
2
+ import { AppState } from "../../types";
3
3
  declare const Footer: {
4
- ({ appState, actionManager, showExitZenModeBtn, footerCenter, welcomeScreenHelp, }: {
4
+ ({ appState, actionManager, showExitZenModeBtn, renderWelcomeScreen, }: {
5
5
  appState: AppState;
6
6
  actionManager: ActionManager;
7
7
  showExitZenModeBtn: boolean;
8
- footerCenter: UIChildrenComponents["FooterCenter"];
9
- welcomeScreenHelp: UIWelcomeScreenComponents["HelpHint"];
8
+ renderWelcomeScreen: boolean;
10
9
  }): JSX.Element;
11
10
  displayName: string;
12
11
  };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare const withInternalFallback: <P>(componentName: string, Component: React.FC<P>) => React.FC<P & {
3
+ __fallback?: boolean | undefined;
4
+ }>;
@@ -138,4 +138,5 @@ export declare const TextAlignMiddleIcon: React.MemoExoticComponent<({ theme }:
138
138
  }) => JSX.Element>;
139
139
  export declare const publishIcon: JSX.Element;
140
140
  export declare const eraser: JSX.Element;
141
+ export declare const handIcon: JSX.Element;
141
142
  export {};
@@ -1,9 +1,14 @@
1
1
  import React from "react";
2
2
  import * as DefaultItems from "./DefaultItems";
3
- declare const MainMenu: {
4
- ({ children }: {
5
- children?: React.ReactNode;
6
- }): JSX.Element;
3
+ declare const MainMenu: React.FC<{
4
+ children?: React.ReactNode;
5
+ /**
6
+ * Called when any menu item is selected (clicked on).
7
+ */
8
+ onSelect?: ((event: Event) => void) | undefined;
9
+ } & {
10
+ __fallback?: boolean | undefined;
11
+ }> & {
7
12
  Trigger: {
8
13
  ({ className, children, onToggle, }: {
9
14
  className?: string | undefined;
@@ -15,20 +20,21 @@ declare const MainMenu: {
15
20
  Item: {
16
21
  ({ icon, onSelect, children, shortcut, className, ...rest }: {
17
22
  icon?: JSX.Element | undefined;
18
- onSelect: () => void;
23
+ onSelect: (event: Event) => void;
19
24
  children: React.ReactNode;
20
25
  shortcut?: string | undefined;
21
26
  className?: string | undefined;
22
- } & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
27
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
23
28
  displayName: string;
24
29
  };
25
30
  ItemLink: {
26
- ({ icon, shortcut, href, children, className, ...rest }: {
31
+ ({ icon, shortcut, href, children, onSelect, className, ...rest }: {
32
+ href: string;
27
33
  icon?: JSX.Element | undefined;
28
34
  children: React.ReactNode;
29
35
  shortcut?: string | undefined;
30
36
  className?: string | undefined;
31
- href: string;
37
+ onSelect?: ((event: Event) => void) | undefined;
32
38
  } & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
33
39
  displayName: string;
34
40
  };
@@ -50,6 +56,5 @@ declare const MainMenu: {
50
56
  displayName: string;
51
57
  };
52
58
  DefaultItems: typeof DefaultItems;
53
- displayName: string;
54
59
  };
55
60
  export default MainMenu;
@@ -2,8 +2,8 @@
2
2
  import "./WelcomeScreen.scss";
3
3
  declare const WelcomeScreen: {
4
4
  (props: {
5
- children: React.ReactNode;
6
- }): null;
5
+ children?: React.ReactNode;
6
+ }): JSX.Element;
7
7
  displayName: string;
8
8
  Center: {
9
9
  ({ children }: {
@@ -1,5 +1,11 @@
1
1
  import { AppProps } from "./types";
2
2
  import { FontFamilyValues } from "./element/types";
3
+ export declare const isDarwin: boolean;
4
+ export declare const isWindows: boolean;
5
+ export declare const isAndroid: boolean;
6
+ export declare const isFirefox: boolean;
7
+ export declare const isChrome: boolean;
8
+ export declare const isSafari: boolean;
3
9
  export declare const APP_NAME = "Excalidraw";
4
10
  export declare const DRAGGING_THRESHOLD = 10;
5
11
  export declare const LINE_CONFIRM_THRESHOLD = 8;
@@ -48,7 +54,8 @@ export declare enum EVENT {
48
54
  HASHCHANGE = "hashchange",
49
55
  VISIBILITY_CHANGE = "visibilitychange",
50
56
  SCROLL = "scroll",
51
- EXCALIDRAW_LINK = "excalidraw-link"
57
+ EXCALIDRAW_LINK = "excalidraw-link",
58
+ MENU_ITEM_SELECT = "menu.itemSelect"
52
59
  }
53
60
  export declare const ENV: {
54
61
  TEST: string;
@@ -157,3 +164,6 @@ export declare const ROUNDNESS: {
157
164
  /** key containt id of precedeing elemnt id we use in reconciliation during
158
165
  * collaboration */
159
166
  export declare const PRECEDING_ELEMENT_KEY = "__precedingElement__";
167
+ export declare const COLOR_NAMES: {
168
+ [key: string]: string;
169
+ };
@@ -8,8 +8,14 @@ export declare type RestoredDataState = {
8
8
  appState: RestoredAppState;
9
9
  files: BinaryFiles;
10
10
  };
11
- export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, refreshDimensions?: boolean) => ExcalidrawElement[];
11
+ export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, opts?: {
12
+ refreshDimensions?: boolean;
13
+ repairBindings?: boolean;
14
+ } | undefined) => ExcalidrawElement[];
12
15
  export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
13
- export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined) => RestoredDataState;
16
+ export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined, elementsConfig?: {
17
+ refreshDimensions?: boolean;
18
+ repairBindings?: boolean;
19
+ }) => RestoredDataState;
14
20
  export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
15
21
  export {};
@@ -36,16 +36,15 @@ export declare const actionLink: {
36
36
  editingElement: NonDeletedExcalidrawElement | null;
37
37
  editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
38
38
  activeTool: {
39
- type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
40
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
39
+ lastActiveTool: import("../types").LastActiveTool;
41
40
  locked: boolean;
41
+ } & ({
42
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
42
43
  customType: null;
43
44
  } | {
44
45
  type: "custom";
45
46
  customType: string;
46
- lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
47
- locked: boolean;
48
- };
47
+ });
49
48
  penMode: boolean;
50
49
  penDetected: boolean;
51
50
  exportBackground: boolean;
@@ -96,6 +95,7 @@ export declare const actionLink: {
96
95
  zenModeEnabled: boolean;
97
96
  theme: string;
98
97
  gridSize: number | null;
98
+ previousGridSize: number | null;
99
99
  viewModeEnabled: boolean;
100
100
  selectedGroupIds: {
101
101
  [groupId: string]: boolean;
@@ -124,6 +124,12 @@ export declare const actionLink: {
124
124
  elementBackground?: string[] | undefined;
125
125
  elementStroke?: string[] | undefined;
126
126
  };
127
+ allowWheelZoom?: boolean | undefined;
128
+ allowPinchZoom?: boolean | undefined;
129
+ pinnedScripts?: string[] | undefined;
130
+ customPens?: any[] | undefined;
131
+ currentStrokeOptions?: any;
132
+ resetCustomPen?: any;
127
133
  selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
128
134
  };
129
135
  commitToHistory: true;