@zsviczian/excalidraw 0.12.0-obsidian-11 → 0.13.0-obsidian-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -14
- package/dist/excalidraw.development.js +1192 -154
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +104 -0
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +12 -9
- package/types/actions/actionAlign.d.ts +18 -6
- package/types/actions/actionBoundText.d.ts +4 -3
- package/types/actions/actionCanvas.d.ts +59 -36
- package/types/actions/actionClipboard.d.ts +20 -15
- package/types/actions/actionDeleteSelected.d.ts +15 -10
- package/types/actions/actionDistribute.d.ts +6 -2
- package/types/actions/actionDuplicateSelection.d.ts +3 -1
- package/types/actions/actionExport.d.ts +62 -37
- package/types/actions/actionFinalize.d.ts +11 -7
- package/types/actions/actionGroup.d.ts +6 -2
- package/types/actions/actionLinearEditor.d.ts +4 -3
- package/types/actions/actionMenu.d.ts +21 -12
- package/types/actions/actionNavigate.d.ts +3 -1
- package/types/actions/actionProperties.d.ts +91 -52
- package/types/actions/actionStyles.d.ts +4 -3
- package/types/actions/actionToggleGridMode.d.ts +4 -3
- package/types/actions/actionToggleLock.d.ts +4 -3
- package/types/actions/actionToggleStats.d.ts +4 -3
- package/types/actions/actionToggleViewMode.d.ts +4 -3
- package/types/actions/actionToggleZenMode.d.ts +4 -3
- package/types/actions/actionZindex.d.ts +12 -4
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +1 -1
- package/types/actions/types.d.ts +3 -1
- package/types/appState.d.ts +5 -4
- package/types/bug-issue-template.d.ts +2 -0
- package/types/clients.d.ts +1 -1
- package/types/components/Actions.d.ts +1 -0
- package/types/components/App.d.ts +52 -1
- package/types/components/Avatar.d.ts +1 -1
- package/types/components/CollabButton.d.ts +2 -1
- package/types/components/DialogActionButton.d.ts +10 -0
- package/types/components/EncryptedIcon.d.ts +2 -0
- package/types/components/Footer.d.ts +2 -1
- package/types/components/HelpButton.d.ts +8 -0
- package/types/components/HintViewer.d.ts +3 -2
- package/types/components/ImageExportDialog.d.ts +3 -1
- package/types/components/LayerUI.d.ts +3 -1
- package/types/components/LibraryButton.d.ts +1 -0
- package/types/components/LibraryMenu.d.ts +14 -5
- package/types/components/LibraryMenuBrowseButton.d.ts +7 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +12 -0
- package/types/components/LibraryMenuItems.d.ts +5 -14
- package/types/components/LibraryUnit.d.ts +2 -3
- package/types/components/MenuItem.d.ts +11 -0
- package/types/components/MenuUtils.d.ts +2 -0
- package/types/components/MobileMenu.d.ts +5 -3
- package/types/components/Sidebar/Sidebar.d.ts +73 -0
- package/types/components/Sidebar/SidebarHeader.d.ts +20 -0
- package/types/components/Sidebar/common.d.ts +16 -0
- package/types/components/TopErrorBoundary.d.ts +15 -0
- package/types/components/WelcomeScreen.d.ts +8 -0
- package/types/components/WelcomeScreenDecor.d.ts +6 -0
- package/types/components/hoc/withUpstreamOverride.d.ts +10 -0
- package/types/components/icons.d.ts +83 -124
- package/types/constants.d.ts +1 -0
- package/types/data/restore.d.ts +1 -1
- package/types/data/types.d.ts +16 -1
- package/types/element/Hyperlink.d.ts +7 -4
- package/types/element/index.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +4 -3
- package/types/element/newElement.d.ts +8 -0
- package/types/element/transformHandles.d.ts +1 -1
- package/types/excalidraw-app/CustomStats.d.ts +9 -0
- package/types/excalidraw-app/app_constants.d.ts +32 -0
- package/types/excalidraw-app/collab/Collab.d.ts +163 -0
- package/types/excalidraw-app/collab/Portal.d.ts +28 -0
- package/types/excalidraw-app/collab/RoomDialog.d.ts +13 -0
- package/types/excalidraw-app/collab/reconciliation.d.ts +10 -0
- package/types/excalidraw-app/components/ExportToExcalidrawPlus.d.ts +9 -0
- package/types/excalidraw-app/components/LanguageList.d.ts +4 -0
- package/types/excalidraw-app/components/icons.d.ts +1 -0
- package/types/excalidraw-app/data/FileManager.d.ts +66 -0
- package/types/excalidraw-app/data/LocalData.d.ts +32 -0
- package/types/excalidraw-app/data/Locker.d.ts +8 -0
- package/types/excalidraw-app/data/firebase.d.ts +25 -0
- package/types/excalidraw-app/data/index.d.ts +186 -0
- package/types/excalidraw-app/data/localStorage.d.ts +112 -0
- package/types/excalidraw-app/data/tabSync.d.ts +9 -0
- package/types/excalidraw-app/index.d.ts +26 -0
- package/types/hooks/useOutsideClick.d.ts +2 -0
- package/types/keys.d.ts +13 -3
- package/types/packages/excalidraw/example/App.d.ts +2 -1
- package/types/packages/excalidraw/example/sidebar/ExampleSidebar.d.ts +5 -0
- package/types/packages/excalidraw/index.d.ts +4 -0
- package/types/packages/utils.d.ts +3 -1
- package/types/renderer/renderScene.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +1 -1
- package/types/scene/types.d.ts +1 -0
- package/types/shapes.d.ts +27 -3
- package/types/types.d.ts +21 -3
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ExcalidrawElement } from "../../element/types";
|
|
2
|
+
export declare const saveUsernameToLocalStorage: (username: string) => void;
|
|
3
|
+
export declare const importUsernameFromLocalStorage: () => string | null;
|
|
4
|
+
export declare const importFromLocalStorage: () => {
|
|
5
|
+
elements: ExcalidrawElement[];
|
|
6
|
+
appState: {
|
|
7
|
+
theme: string;
|
|
8
|
+
name: string;
|
|
9
|
+
activeTool: {
|
|
10
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
11
|
+
lastActiveToolBeforeEraser: import("../../types").LastActiveToolBeforeEraser;
|
|
12
|
+
locked: boolean;
|
|
13
|
+
customType: null;
|
|
14
|
+
} | {
|
|
15
|
+
type: "custom";
|
|
16
|
+
customType: string;
|
|
17
|
+
lastActiveToolBeforeEraser: import("../../types").LastActiveToolBeforeEraser;
|
|
18
|
+
locked: boolean;
|
|
19
|
+
};
|
|
20
|
+
scrollX: number;
|
|
21
|
+
scrollY: number;
|
|
22
|
+
viewBackgroundColor: string;
|
|
23
|
+
zoom: Readonly<{
|
|
24
|
+
value: import("../../types").NormalizedZoomValue;
|
|
25
|
+
}>;
|
|
26
|
+
shouldCacheIgnoreZoom: boolean;
|
|
27
|
+
showWelcomeScreen: boolean;
|
|
28
|
+
penMode: boolean;
|
|
29
|
+
penDetected: boolean;
|
|
30
|
+
exportBackground: boolean;
|
|
31
|
+
exportEmbedScene: boolean;
|
|
32
|
+
exportWithDarkMode: boolean;
|
|
33
|
+
exportScale: number;
|
|
34
|
+
currentItemStrokeColor: string;
|
|
35
|
+
currentItemBackgroundColor: string;
|
|
36
|
+
currentItemFillStyle: import("../../element/types").FillStyle;
|
|
37
|
+
currentItemStrokeWidth: number;
|
|
38
|
+
currentItemStrokeStyle: import("../../element/types").StrokeStyle;
|
|
39
|
+
currentItemRoughness: number;
|
|
40
|
+
currentItemOpacity: number;
|
|
41
|
+
currentItemFontFamily: number;
|
|
42
|
+
currentItemFontSize: number;
|
|
43
|
+
currentItemTextAlign: string;
|
|
44
|
+
currentItemStrokeSharpness: import("../../element/types").StrokeSharpness;
|
|
45
|
+
currentItemStartArrowhead: import("../../element/types").Arrowhead | null;
|
|
46
|
+
currentItemEndArrowhead: import("../../element/types").Arrowhead | null;
|
|
47
|
+
currentItemLinearStrokeSharpness: import("../../element/types").StrokeSharpness;
|
|
48
|
+
cursorButton: "up" | "down";
|
|
49
|
+
scrolledOutside: boolean;
|
|
50
|
+
openMenu: "canvas" | "shape" | null;
|
|
51
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
52
|
+
isSidebarDocked: boolean;
|
|
53
|
+
lastPointerDownWith: import("../../element/types").PointerType;
|
|
54
|
+
selectedElementIds: {
|
|
55
|
+
[id: string]: boolean;
|
|
56
|
+
};
|
|
57
|
+
previousSelectedElementIds: {
|
|
58
|
+
[id: string]: boolean;
|
|
59
|
+
};
|
|
60
|
+
zenModeEnabled: boolean;
|
|
61
|
+
gridSize: number | null;
|
|
62
|
+
selectedGroupIds: {
|
|
63
|
+
[groupId: string]: boolean;
|
|
64
|
+
};
|
|
65
|
+
editingGroupId: string | null;
|
|
66
|
+
showStats: boolean;
|
|
67
|
+
currentChartType: import("../../element/types").ChartType;
|
|
68
|
+
selectedLinearElement: import("../../element/linearElementEditor").LinearElementEditor | null;
|
|
69
|
+
isLoading: boolean;
|
|
70
|
+
errorMessage: string | null;
|
|
71
|
+
draggingElement: import("../../element/types").NonDeletedExcalidrawElement | null;
|
|
72
|
+
resizingElement: import("../../element/types").NonDeletedExcalidrawElement | null;
|
|
73
|
+
multiElement: import("../../element/types").NonDeleted<import("../../element/types").ExcalidrawLinearElement> | null;
|
|
74
|
+
selectionElement: import("../../element/types").NonDeletedExcalidrawElement | null;
|
|
75
|
+
isBindingEnabled: boolean;
|
|
76
|
+
startBoundElement: import("../../element/types").NonDeleted<import("../../element/types").ExcalidrawBindableElement> | null;
|
|
77
|
+
suggestedBindings: import("../../element/binding").SuggestedBinding[];
|
|
78
|
+
editingElement: import("../../element/types").NonDeletedExcalidrawElement | null;
|
|
79
|
+
editingLinearElement: import("../../element/linearElementEditor").LinearElementEditor | null;
|
|
80
|
+
isResizing: boolean;
|
|
81
|
+
isRotating: boolean;
|
|
82
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
83
|
+
openDialog: "imageExport" | "help" | null;
|
|
84
|
+
toast: {
|
|
85
|
+
message: string;
|
|
86
|
+
closable?: boolean | undefined;
|
|
87
|
+
duration?: number | undefined;
|
|
88
|
+
} | null;
|
|
89
|
+
viewModeEnabled: boolean;
|
|
90
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
91
|
+
collaborators: Map<string, import("../../types").Collaborator>;
|
|
92
|
+
pasteDialog: {
|
|
93
|
+
shown: false;
|
|
94
|
+
data: null;
|
|
95
|
+
} | {
|
|
96
|
+
shown: true;
|
|
97
|
+
data: import("../../charts").Spreadsheet;
|
|
98
|
+
};
|
|
99
|
+
pendingImageElementId: string | null;
|
|
100
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
101
|
+
linkOpacity: number;
|
|
102
|
+
trayModeEnabled: boolean;
|
|
103
|
+
colorPalette: {
|
|
104
|
+
canvasBackground?: string[] | undefined;
|
|
105
|
+
elementBackground?: string[] | undefined;
|
|
106
|
+
elementStroke?: string[] | undefined;
|
|
107
|
+
};
|
|
108
|
+
} | null;
|
|
109
|
+
};
|
|
110
|
+
export declare const getElementsStorageSize: () => number;
|
|
111
|
+
export declare const getTotalStorageSize: () => number;
|
|
112
|
+
export declare const getLibraryItemsFromStorage: () => import("../../types").LibraryItems_anyVersion;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const LOCAL_STATE_VERSIONS: {
|
|
2
|
+
"version-dataState": number;
|
|
3
|
+
"version-files": number;
|
|
4
|
+
};
|
|
5
|
+
declare type BrowserStateTypes = keyof typeof LOCAL_STATE_VERSIONS;
|
|
6
|
+
export declare const isBrowserStorageStateNewer: (type: BrowserStateTypes) => boolean;
|
|
7
|
+
export declare const updateBrowserStateVersion: (type: BrowserStateTypes) => void;
|
|
8
|
+
export declare const resetBrowserStateVersions: () => void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./index.scss";
|
|
2
|
+
export declare const langCodeAtom: import("jotai").Atom<string> & {
|
|
3
|
+
write: (get: {
|
|
4
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
5
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
6
|
+
<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;
|
|
7
|
+
} & {
|
|
8
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
9
|
+
unstable_promise: true;
|
|
10
|
+
}): Value_3 | Promise<Value_3>;
|
|
11
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
12
|
+
unstable_promise: true;
|
|
13
|
+
}): Value_4 | Promise<Value_4>;
|
|
14
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
15
|
+
unstable_promise: true;
|
|
16
|
+
}): (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>;
|
|
17
|
+
}, set: {
|
|
18
|
+
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
19
|
+
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
20
|
+
}, update: string | ((prev: string) => string)) => void;
|
|
21
|
+
onMount?: (<S extends (update: string | ((prev: string) => string)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
22
|
+
} & {
|
|
23
|
+
init: string;
|
|
24
|
+
};
|
|
25
|
+
declare const ExcalidrawApp: () => JSX.Element;
|
|
26
|
+
export default ExcalidrawApp;
|
package/types/keys.d.ts
CHANGED
|
@@ -17,11 +17,8 @@ export declare const CODES: {
|
|
|
17
17
|
readonly SLASH: "Slash";
|
|
18
18
|
readonly C: "KeyC";
|
|
19
19
|
readonly D: "KeyD";
|
|
20
|
-
readonly G: "KeyG";
|
|
21
|
-
readonly F: "KeyF";
|
|
22
20
|
readonly H: "KeyH";
|
|
23
21
|
readonly V: "KeyV";
|
|
24
|
-
readonly X: "KeyX";
|
|
25
22
|
readonly Z: "KeyZ";
|
|
26
23
|
readonly R: "KeyR";
|
|
27
24
|
};
|
|
@@ -44,9 +41,12 @@ export declare const KEYS: {
|
|
|
44
41
|
readonly PERIOD: ".";
|
|
45
42
|
readonly COMMA: ",";
|
|
46
43
|
readonly A: "a";
|
|
44
|
+
readonly C: "c";
|
|
47
45
|
readonly D: "d";
|
|
48
46
|
readonly E: "e";
|
|
47
|
+
readonly F: "f";
|
|
49
48
|
readonly G: "g";
|
|
49
|
+
readonly H: "h";
|
|
50
50
|
readonly I: "i";
|
|
51
51
|
readonly L: "l";
|
|
52
52
|
readonly O: "o";
|
|
@@ -60,6 +60,16 @@ export declare const KEYS: {
|
|
|
60
60
|
readonly Y: "y";
|
|
61
61
|
readonly Z: "z";
|
|
62
62
|
readonly K: "k";
|
|
63
|
+
readonly 0: "0";
|
|
64
|
+
readonly 1: "1";
|
|
65
|
+
readonly 2: "2";
|
|
66
|
+
readonly 3: "3";
|
|
67
|
+
readonly 4: "4";
|
|
68
|
+
readonly 5: "5";
|
|
69
|
+
readonly 6: "6";
|
|
70
|
+
readonly 7: "7";
|
|
71
|
+
readonly 8: "8";
|
|
72
|
+
readonly 9: "9";
|
|
63
73
|
};
|
|
64
74
|
export declare type Key = keyof typeof KEYS;
|
|
65
75
|
export declare const isArrowKey: (key: string) => boolean;
|
|
@@ -12,9 +12,13 @@ getMaximumGroups, //zsviczian
|
|
|
12
12
|
intersectElementWithLine, //zsviczian
|
|
13
13
|
determineFocusDistance, //zsviczian
|
|
14
14
|
measureText, //zsviczian
|
|
15
|
+
wrapText, //zsviczian
|
|
16
|
+
getFontString, //zsviczian
|
|
17
|
+
getMaxContainerWidth, //zsviczian
|
|
15
18
|
exportToClipboard, mergeLibraryItems, } from "../../packages/utils";
|
|
16
19
|
export { isLinearElement } from "../../element/typeChecks";
|
|
17
20
|
export { FONT_FAMILY, THEME, MIME_TYPES } from "../../constants";
|
|
18
21
|
export { mutateElement, newElementWith, bumpVersion, } from "../../element/mutateElement";
|
|
19
22
|
export { parseLibraryTokensFromUrl, useHandleLibrary, } from "../../data/library";
|
|
20
23
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "../../utils";
|
|
24
|
+
export { Sidebar } from "../../components/Sidebar/Sidebar";
|
|
@@ -36,5 +36,7 @@ export { getCommonBoundingBox } from "../element/bounds";
|
|
|
36
36
|
export { getMaximumGroups } from "../groups";
|
|
37
37
|
export { intersectElementWithLine } from "../element/collision";
|
|
38
38
|
export { determineFocusDistance } from "../element/collision";
|
|
39
|
-
export { measureText } from "../element/textElement";
|
|
39
|
+
export { measureText, wrapText } from "../element/textElement";
|
|
40
|
+
export { getFontString } from "../utils";
|
|
41
|
+
export { getMaxContainerWidth } from "../element/newElement";
|
|
40
42
|
export { mergeLibraryItems } from "../data/library";
|
|
@@ -3,7 +3,7 @@ import { RoughSVG } from "roughjs/bin/svg";
|
|
|
3
3
|
import { AppState, BinaryFiles } from "../types";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
import { RenderConfig } from "../scene/types";
|
|
6
|
-
export declare const DEFAULT_SPACING =
|
|
6
|
+
export declare const DEFAULT_SPACING = 2;
|
|
7
7
|
export declare const _renderScene: ({ elements, appState, scale, rc, canvas, renderConfig, }: {
|
|
8
8
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
9
9
|
appState: AppState;
|
|
@@ -3,7 +3,7 @@ import { Zoom } from "../types";
|
|
|
3
3
|
import { ScrollBars } from "./types";
|
|
4
4
|
export declare const SCROLLBAR_MARGIN = 4;
|
|
5
5
|
export declare const SCROLLBAR_WIDTH = 6;
|
|
6
|
-
export declare const SCROLLBAR_COLOR = "rgba(
|
|
6
|
+
export declare const SCROLLBAR_COLOR = "rgba(128,128,128,0.3)";
|
|
7
7
|
export declare const getScrollBars: (elements: readonly ExcalidrawElement[], viewportWidth: number, viewportHeight: number, { scrollX, scrollY, zoom, }: {
|
|
8
8
|
scrollX: number;
|
|
9
9
|
scrollY: number;
|
package/types/scene/types.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare type RenderConfig = {
|
|
|
33
33
|
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
34
34
|
CSS filters), and we disable render optimizations for best output */
|
|
35
35
|
isExporting: boolean;
|
|
36
|
+
selectionColor?: string;
|
|
36
37
|
};
|
|
37
38
|
export declare type SceneScroll = {
|
|
38
39
|
scrollX: number;
|
package/types/shapes.d.ts
CHANGED
|
@@ -2,37 +2,61 @@ export declare const SHAPES: readonly [{
|
|
|
2
2
|
readonly icon: JSX.Element;
|
|
3
3
|
readonly value: "selection";
|
|
4
4
|
readonly key: "v";
|
|
5
|
+
readonly numericKey: "1";
|
|
6
|
+
readonly fillable: true;
|
|
5
7
|
}, {
|
|
6
8
|
readonly icon: JSX.Element;
|
|
7
9
|
readonly value: "rectangle";
|
|
8
10
|
readonly key: "r";
|
|
11
|
+
readonly numericKey: "2";
|
|
12
|
+
readonly fillable: true;
|
|
9
13
|
}, {
|
|
10
14
|
readonly icon: JSX.Element;
|
|
11
15
|
readonly value: "diamond";
|
|
12
16
|
readonly key: "d";
|
|
17
|
+
readonly numericKey: "3";
|
|
18
|
+
readonly fillable: true;
|
|
13
19
|
}, {
|
|
14
20
|
readonly icon: JSX.Element;
|
|
15
21
|
readonly value: "ellipse";
|
|
16
22
|
readonly key: "o";
|
|
23
|
+
readonly numericKey: "4";
|
|
24
|
+
readonly fillable: true;
|
|
17
25
|
}, {
|
|
18
26
|
readonly icon: JSX.Element;
|
|
19
27
|
readonly value: "arrow";
|
|
20
28
|
readonly key: "a";
|
|
29
|
+
readonly numericKey: "5";
|
|
30
|
+
readonly fillable: true;
|
|
21
31
|
}, {
|
|
22
32
|
readonly icon: JSX.Element;
|
|
23
33
|
readonly value: "line";
|
|
24
|
-
readonly key:
|
|
34
|
+
readonly key: "l";
|
|
35
|
+
readonly numericKey: "6";
|
|
36
|
+
readonly fillable: true;
|
|
25
37
|
}, {
|
|
26
38
|
readonly icon: JSX.Element;
|
|
27
39
|
readonly value: "freedraw";
|
|
28
|
-
readonly key: readonly ["
|
|
40
|
+
readonly key: readonly ["p", "x"];
|
|
41
|
+
readonly numericKey: "7";
|
|
42
|
+
readonly fillable: false;
|
|
29
43
|
}, {
|
|
30
44
|
readonly icon: JSX.Element;
|
|
31
45
|
readonly value: "text";
|
|
32
46
|
readonly key: "t";
|
|
47
|
+
readonly numericKey: "8";
|
|
48
|
+
readonly fillable: false;
|
|
33
49
|
}, {
|
|
34
50
|
readonly icon: JSX.Element;
|
|
35
51
|
readonly value: "image";
|
|
36
52
|
readonly key: null;
|
|
53
|
+
readonly numericKey: "9";
|
|
54
|
+
readonly fillable: false;
|
|
55
|
+
}, {
|
|
56
|
+
readonly icon: JSX.Element;
|
|
57
|
+
readonly value: "eraser";
|
|
58
|
+
readonly key: "e";
|
|
59
|
+
readonly numericKey: "0";
|
|
60
|
+
readonly fillable: false;
|
|
37
61
|
}];
|
|
38
|
-
export declare const findShapeByKey: (key: string) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
62
|
+
export declare const findShapeByKey: (key: string) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | null;
|
package/types/types.d.ts
CHANGED
|
@@ -39,7 +39,18 @@ export declare type BinaryFileData = {
|
|
|
39
39
|
mimeType: typeof ALLOWED_IMAGE_MIME_TYPES[number] | typeof MIME_TYPES.binary;
|
|
40
40
|
id: FileId;
|
|
41
41
|
dataURL: DataURL;
|
|
42
|
+
/**
|
|
43
|
+
* Epoch timestamp in milliseconds
|
|
44
|
+
*/
|
|
42
45
|
created: number;
|
|
46
|
+
/**
|
|
47
|
+
* Indicates when the file was last retrieved from storage to be loaded
|
|
48
|
+
* onto the scene. We use this flag to determine whether to delete unused
|
|
49
|
+
* files from storage.
|
|
50
|
+
*
|
|
51
|
+
* Epoch timestamp in milliseconds.
|
|
52
|
+
*/
|
|
53
|
+
lastRetrieved?: number;
|
|
43
54
|
};
|
|
44
55
|
export declare type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
|
|
45
56
|
export declare type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
|
|
@@ -51,6 +62,7 @@ export declare type LastActiveToolBeforeEraser = {
|
|
|
51
62
|
customType: string;
|
|
52
63
|
} | null;
|
|
53
64
|
export declare type AppState = {
|
|
65
|
+
showWelcomeScreen: boolean;
|
|
54
66
|
isLoading: boolean;
|
|
55
67
|
errorMessage: string | null;
|
|
56
68
|
draggingElement: NonDeletedExcalidrawElement | null;
|
|
@@ -104,6 +116,9 @@ export declare type AppState = {
|
|
|
104
116
|
zoom: Zoom;
|
|
105
117
|
openMenu: "canvas" | "shape" | null;
|
|
106
118
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
119
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
120
|
+
openDialog: "imageExport" | "help" | null;
|
|
121
|
+
isSidebarDocked: boolean;
|
|
107
122
|
lastPointerDownWith: PointerType;
|
|
108
123
|
selectedElementIds: {
|
|
109
124
|
[id: string]: boolean;
|
|
@@ -112,7 +127,6 @@ export declare type AppState = {
|
|
|
112
127
|
[id: string]: boolean;
|
|
113
128
|
};
|
|
114
129
|
shouldCacheIgnoreZoom: boolean;
|
|
115
|
-
showHelpDialog: boolean;
|
|
116
130
|
toast: {
|
|
117
131
|
message: string;
|
|
118
132
|
closable?: boolean;
|
|
@@ -133,8 +147,6 @@ export declare type AppState = {
|
|
|
133
147
|
height: number;
|
|
134
148
|
offsetTop: number;
|
|
135
149
|
offsetLeft: number;
|
|
136
|
-
isLibraryOpen: boolean;
|
|
137
|
-
isLibraryMenuDocked: boolean;
|
|
138
150
|
fileHandle: FileSystemHandle | null;
|
|
139
151
|
collaborators: Map<string, Collaborator>;
|
|
140
152
|
showStats: boolean;
|
|
@@ -251,6 +263,10 @@ export interface ExcalidrawProps {
|
|
|
251
263
|
onLinkHover?: (element: NonDeletedExcalidrawElement, event: React.PointerEvent<HTMLCanvasElement>) => void;
|
|
252
264
|
onPointerDown?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
|
|
253
265
|
onScrollChange?: (scrollX: number, scrollY: number) => void;
|
|
266
|
+
/**
|
|
267
|
+
* Render function that renders custom <Sidebar /> component.
|
|
268
|
+
*/
|
|
269
|
+
renderSidebar?: () => JSX.Element | null;
|
|
254
270
|
}
|
|
255
271
|
export declare type SceneData = {
|
|
256
272
|
elements?: ImportedDataState["elements"];
|
|
@@ -287,6 +303,7 @@ export declare type AppProps = Merge<ExcalidrawProps, {
|
|
|
287
303
|
detectScroll: boolean;
|
|
288
304
|
handleKeyboardGlobally: boolean;
|
|
289
305
|
isCollaborating: boolean;
|
|
306
|
+
children?: React.ReactNode;
|
|
290
307
|
}>;
|
|
291
308
|
/** A subset of App class properties that we need to use elsewhere
|
|
292
309
|
* in the app, eg Manager. Factored out into a separate type to keep DRY. */
|
|
@@ -393,6 +410,7 @@ export declare type ExcalidrawImperativeAPI = {
|
|
|
393
410
|
setActiveTool: InstanceType<typeof App>["setActiveTool"];
|
|
394
411
|
setCursor: InstanceType<typeof App>["setCursor"];
|
|
395
412
|
resetCursor: InstanceType<typeof App>["resetCursor"];
|
|
413
|
+
toggleMenu: InstanceType<typeof App>["toggleMenu"];
|
|
396
414
|
};
|
|
397
415
|
export declare type Device = Readonly<{
|
|
398
416
|
isSmScreen: boolean;
|