@zsviczian/excalidraw 0.11.0-obsidian-24 → 0.12.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 +352 -42
- package/dist/excalidraw.development.js +117 -112
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +2 -1
- package/package.json +22 -24
- package/types/actions/actionAddToLibrary.d.ts +13 -3
- package/types/actions/actionAlign.d.ts +6 -6
- package/types/actions/actionBoundText.d.ts +5 -1
- package/types/actions/actionCanvas.d.ts +52 -16
- package/types/actions/actionClipboard.d.ts +25 -5
- package/types/actions/actionDeleteSelected.d.ts +16 -4
- package/types/actions/actionDistribute.d.ts +2 -2
- package/types/actions/actionDuplicateSelection.d.ts +1 -1
- package/types/actions/actionExport.d.ts +51 -17
- package/types/actions/actionFinalize.d.ts +11 -3
- package/types/actions/actionGroup.d.ts +2 -2
- package/types/actions/actionMenu.d.ts +18 -6
- package/types/actions/actionNavigate.d.ts +1 -2
- package/types/actions/actionProperties.d.ts +78 -26
- package/types/actions/actionSelectAll.d.ts +2 -1
- package/types/actions/actionStyles.d.ts +3 -1
- package/types/actions/actionToggleGridMode.d.ts +5 -1
- package/types/actions/actionToggleStats.d.ts +5 -1
- package/types/actions/actionToggleViewMode.d.ts +5 -1
- package/types/actions/actionToggleZenMode.d.ts +5 -1
- package/types/actions/actionZindex.d.ts +4 -4
- package/types/analytics.d.ts +1 -1
- package/types/appState.d.ts +1 -0
- package/types/clients.d.ts +1 -1
- package/types/components/ActiveFile.d.ts +0 -1
- package/types/components/App.d.ts +8 -3
- package/types/components/ButtonIconSelect.d.ts +0 -1
- package/types/components/Card.d.ts +1 -0
- package/types/components/CheckboxItem.d.ts +1 -0
- package/types/components/ClearCanvas.d.ts +0 -1
- package/types/components/CollabButton.d.ts +0 -1
- package/types/components/ColorPicker.d.ts +0 -1
- package/types/components/ConfirmDialog.d.ts +0 -1
- package/types/components/DarkModeToggle.d.ts +0 -1
- package/types/components/ErrorDialog.d.ts +0 -1
- package/types/components/HelpDialog.d.ts +0 -1
- package/types/components/HelpIcon.d.ts +0 -1
- package/types/components/HintViewer.d.ts +0 -1
- package/types/components/IconPicker.d.ts +0 -1
- package/types/components/ImageExportDialog.d.ts +0 -1
- package/types/components/JSONExportDialog.d.ts +0 -1
- package/types/components/LayerUI.d.ts +1 -4
- package/types/components/LibraryMenu.d.ts +0 -1
- package/types/components/LibraryUnit.d.ts +0 -1
- package/types/components/LockButton.d.ts +0 -1
- package/types/components/MobileMenu.d.ts +1 -2
- package/types/components/Modal.d.ts +2 -2
- package/types/components/PenModeButton.d.ts +0 -1
- package/types/components/ProjectName.d.ts +0 -1
- package/types/components/PublishLibrary.d.ts +0 -1
- package/types/components/Section.d.ts +4 -5
- package/types/components/SidebarLockButton.d.ts +0 -1
- package/types/components/SingleLibraryItem.d.ts +0 -1
- package/types/components/Spinner.d.ts +0 -1
- package/types/components/Toast.d.ts +4 -3
- package/types/constants.d.ts +0 -1
- package/types/data/blob.d.ts +4 -4
- package/types/data/filesystem.d.ts +2 -2
- package/types/data/json.d.ts +1 -1
- package/types/element/Hyperlink.d.ts +6 -2
- package/types/element/binding.d.ts +3 -3
- package/types/element/dragElements.d.ts +1 -1
- package/types/element/index.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +5 -1
- package/types/element/mutateElement.d.ts +1 -1
- package/types/element/sizeHelpers.d.ts +4 -0
- package/types/element/textElement.d.ts +1 -1
- package/types/element/typeChecks.d.ts +3 -3
- package/types/jotai.d.ts +5 -3
- package/types/keys.d.ts +1 -1
- package/types/packages/excalidraw/example/App.d.ts +0 -1
- package/types/renderer/renderElement.d.ts +1 -1
- package/types/renderer/renderScene.d.ts +9 -1
- package/types/shapes.d.ts +0 -1
- package/types/types.d.ts +8 -2
- package/types/utils.d.ts +7 -5
|
@@ -72,7 +72,11 @@ export declare const actionToggleZenMode: {
|
|
|
72
72
|
};
|
|
73
73
|
shouldCacheIgnoreZoom: boolean;
|
|
74
74
|
showHelpDialog: boolean;
|
|
75
|
-
|
|
75
|
+
toast: {
|
|
76
|
+
message: string;
|
|
77
|
+
closable?: boolean | undefined;
|
|
78
|
+
duration?: number | undefined;
|
|
79
|
+
} | null;
|
|
76
80
|
theme: string;
|
|
77
81
|
gridSize: number | null;
|
|
78
82
|
viewModeEnabled: boolean;
|
|
@@ -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 }:
|
|
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 }:
|
|
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 }:
|
|
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 }:
|
|
64
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
65
65
|
} & {
|
|
66
66
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
67
67
|
};
|
package/types/analytics.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const trackEvent: (category: string, action: string, label?: string
|
|
1
|
+
export declare const trackEvent: (category: string, action: string, label?: string, value?: number) => void;
|
package/types/appState.d.ts
CHANGED
|
@@ -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
|
} | {
|
package/types/clients.d.ts
CHANGED
|
@@ -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
|
|
6
|
+
export declare const getClientInitials: (username?: string | null) => string;
|
|
@@ -46,6 +46,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
46
46
|
x: number;
|
|
47
47
|
y: number;
|
|
48
48
|
} | null;
|
|
49
|
+
allowMobileMode: boolean;
|
|
49
50
|
constructor(props: AppProps);
|
|
50
51
|
private renderCanvas;
|
|
51
52
|
render(): JSX.Element;
|
|
@@ -86,16 +87,19 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
86
87
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
87
88
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
88
89
|
togglePenMode: () => void;
|
|
89
|
-
toggleZenMode: () => void;
|
|
90
90
|
scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[]) => void;
|
|
91
91
|
zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
|
|
92
92
|
updateContainerSize: (containers: NonDeletedExcalidrawElement[]) => void;
|
|
93
93
|
restore: (data: ImportedDataState) => RestoredDataState;
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
setToast: (toast: {
|
|
95
|
+
message: string;
|
|
96
|
+
closable?: boolean;
|
|
97
|
+
duration?: number;
|
|
98
|
+
} | null) => void;
|
|
96
99
|
restoreFileFromShare: () => Promise<void>;
|
|
97
100
|
/** adds supplied files to existing files in the appState */
|
|
98
101
|
addFiles: ExcalidrawImperativeAPI["addFiles"];
|
|
102
|
+
setMobileModeAllowed: ExcalidrawImperativeAPI["setMobileModeAllowed"];
|
|
99
103
|
setLocalFont: ExcalidrawImperativeAPI["setLocalFont"];
|
|
100
104
|
selectElements: ExcalidrawImperativeAPI["selectElements"];
|
|
101
105
|
bringToFront: ExcalidrawImperativeAPI["bringToFront"];
|
|
@@ -111,6 +115,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
111
115
|
private onSceneUpdated;
|
|
112
116
|
private updateCurrentCursorPosition;
|
|
113
117
|
private onKeyDown;
|
|
118
|
+
private onWheel;
|
|
114
119
|
private onKeyUp;
|
|
115
120
|
private setActiveTool;
|
|
116
121
|
private setCursor;
|
|
@@ -17,16 +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
24
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
27
25
|
renderCustomFooter?: ExcalidrawProps["renderFooter"];
|
|
28
26
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
29
|
-
viewModeEnabled: boolean;
|
|
30
27
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
31
28
|
UIOptions: AppProps["UIOptions"];
|
|
32
29
|
focusContainer: () => void;
|
|
@@ -36,5 +33,5 @@ interface LayerUIProps {
|
|
|
36
33
|
insertOnCanvasDirectly: boolean;
|
|
37
34
|
}) => void;
|
|
38
35
|
}
|
|
39
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, canvas, elements, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements,
|
|
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>;
|
|
40
37
|
export default _default;
|
|
@@ -16,7 +16,6 @@ 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;
|
|
@@ -24,5 +23,5 @@ declare type MobileMenuProps = {
|
|
|
24
23
|
renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
25
24
|
renderStats: () => JSX.Element | null;
|
|
26
25
|
};
|
|
27
|
-
export declare const MobileMenu: ({ appState, elements, libraryMenu, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter,
|
|
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;
|
|
28
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:
|
|
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
|
-
}
|
|
12
|
+
}>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
export declare const Section: React.FC<{
|
|
3
3
|
heading: string;
|
|
4
|
-
children
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {};
|
|
4
|
+
children?: React.ReactNode | ((heading: React.ReactNode) => React.ReactNode);
|
|
5
|
+
className?: string;
|
|
6
|
+
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import "./Toast.scss";
|
|
3
|
-
export declare const Toast: ({ message,
|
|
2
|
+
export declare const Toast: ({ message, onClose, closable, duration, }: {
|
|
4
3
|
message: string;
|
|
5
|
-
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
closable?: boolean | undefined;
|
|
6
|
+
duration?: number | undefined;
|
|
6
7
|
}) => JSX.Element;
|
package/types/constants.d.ts
CHANGED
|
@@ -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;
|
package/types/data/blob.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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 {
|
|
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 ?
|
|
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;
|
package/types/data/json.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const isValidExcalidrawData: (data?: {
|
|
|
10
10
|
type?: any;
|
|
11
11
|
elements?: any;
|
|
12
12
|
appState?: any;
|
|
13
|
-
}
|
|
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
|
-
|
|
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;
|
|
@@ -126,7 +130,7 @@ export declare const actionLink: {
|
|
|
126
130
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
127
131
|
contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
|
|
128
132
|
contextItemPredicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
|
|
129
|
-
PanelComponent: ({ elements, appState, updateData }: import("
|
|
133
|
+
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
|
|
130
134
|
} & {
|
|
131
135
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
132
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[]
|
|
25
|
+
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
26
26
|
newSize?: {
|
|
27
27
|
width: number;
|
|
28
28
|
height: number;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
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
|
|
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;
|
package/types/element/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { dragSelectedElements, getDragOffsetXY, dragNewElement, } from "./dragEl
|
|
|
9
9
|
export { isTextElement, isExcalidrawElement } from "./typeChecks";
|
|
10
10
|
export { textWysiwyg } from "./textWysiwyg";
|
|
11
11
|
export { redrawTextBoundingBox } from "./textElement";
|
|
12
|
-
export { getPerfectElementSize, isInvisiblySmallElement, resizePerfectLineForNWHandler, getNormalizedDimensions, } from "./sizeHelpers";
|
|
12
|
+
export { getPerfectElementSize, getLockedLinearCursorAlignSize, isInvisiblySmallElement, resizePerfectLineForNWHandler, getNormalizedDimensions, } from "./sizeHelpers";
|
|
13
13
|
export { showSelectedShapeActions } from "./showSelectedShapeActions";
|
|
14
14
|
export declare const getSceneVersion: (elements: readonly ExcalidrawElement[]) => number;
|
|
15
15
|
export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
|
|
@@ -149,7 +149,11 @@ export declare class LinearElementEditor {
|
|
|
149
149
|
};
|
|
150
150
|
shouldCacheIgnoreZoom: boolean;
|
|
151
151
|
showHelpDialog: boolean;
|
|
152
|
-
|
|
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;
|
|
@@ -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?:
|
|
10
|
+
export declare const bumpVersion: (element: Mutable<ExcalidrawElement>, version?: ExcalidrawElement["version"]) => Mutable<ExcalidrawElement>;
|
|
11
11
|
export {};
|
|
@@ -8,6 +8,10 @@ export declare const getPerfectElementSize: (elementType: AppState["activeTool"]
|
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
10
|
};
|
|
11
|
+
export declare const getLockedLinearCursorAlignSize: (originX: number, originY: number, x: number, y: number) => {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
11
15
|
export declare const resizePerfectLineForNWHandler: (element: ExcalidrawElement, x: number, y: number) => void;
|
|
12
16
|
export declare const getNormalizedDimensions: (element: Pick<ExcalidrawElement, "width" | "height" | "x" | "y">) => {
|
|
13
17
|
width: ExcalidrawElement["width"];
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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;
|
package/types/jotai.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { WritableAtom } from "jotai";
|
|
1
2
|
export declare const jotaiScope: unique symbol;
|
|
2
3
|
export declare const jotaiStore: {
|
|
3
4
|
get: <Value>(atom: import("jotai").Atom<Value>) => (Value 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) | undefined;
|
|
4
5
|
asyncGet: <Value_1>(atom: import("jotai").Atom<Value_1>) => Promise<Value_1 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_1>;
|
|
5
|
-
set: <Value_2, Update, Result extends void | Promise<void>>(atom:
|
|
6
|
+
set: <Value_2, Update, Result extends void | Promise<void>>(atom: WritableAtom<Value_2, Update, Result>, update: Update) => Result;
|
|
6
7
|
sub: (atom: {
|
|
7
8
|
toString: () => string;
|
|
8
9
|
debugLabel?: string | undefined;
|
|
@@ -14,7 +15,7 @@ export declare const jotaiStore: {
|
|
|
14
15
|
}, callback: () => void) => () => void;
|
|
15
16
|
SECRET_INTERNAL_store: {
|
|
16
17
|
r: <Value_6>(readingAtom: import("jotai").Atom<Value_6>, version?: import("jotai/core/store").VersionObject | undefined) => import("jotai/core/store").AtomState<Value_6>;
|
|
17
|
-
w: <Value_1_1, Update_1, Result_1 extends void | Promise<void>>(writingAtom:
|
|
18
|
+
w: <Value_1_1, Update_1, Result_1 extends void | Promise<void>>(writingAtom: WritableAtom<Value_1_1, Update_1, Result_1>, update: Update_1, version?: import("jotai/core/store").VersionObject | undefined) => Result_1;
|
|
18
19
|
c: (_atom: {
|
|
19
20
|
toString: () => string;
|
|
20
21
|
debugLabel?: string | undefined;
|
|
@@ -84,7 +85,7 @@ export declare const jotaiStore: {
|
|
|
84
85
|
} | undefined;
|
|
85
86
|
} | {
|
|
86
87
|
r: <Value_7>(readingAtom: import("jotai").Atom<Value_7>, version?: import("jotai/core/store").VersionObject | undefined) => import("jotai/core/store").AtomState<Value_7>;
|
|
87
|
-
w: <Value_1_2, Update_2, Result_2 extends void | Promise<void>>(writingAtom:
|
|
88
|
+
w: <Value_1_2, Update_2, Result_2 extends void | Promise<void>>(writingAtom: WritableAtom<Value_1_2, Update_2, Result_2>, update: Update_2, version?: import("jotai/core/store").VersionObject | undefined) => Result_2;
|
|
88
89
|
c: (_atom: {
|
|
89
90
|
toString: () => string;
|
|
90
91
|
debugLabel?: string | undefined;
|
|
@@ -118,3 +119,4 @@ export declare const jotaiStore: {
|
|
|
118
119
|
m?: undefined;
|
|
119
120
|
};
|
|
120
121
|
};
|
|
122
|
+
export declare const useAtomWithInitialValue: <T extends unknown, A extends WritableAtom<T, T, void>>(atom: A, initialValue: T | (() => T)) => readonly [T 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 : T, import("jotai/core/atom").SetAtom<T, void>];
|
package/types/keys.d.ts
CHANGED
|
@@ -65,4 +65,4 @@ export declare type Key = keyof typeof KEYS;
|
|
|
65
65
|
export declare const isArrowKey: (key: string) => boolean;
|
|
66
66
|
export declare const shouldResizeFromCenter: (event: MouseEvent | KeyboardEvent) => boolean;
|
|
67
67
|
export declare const shouldMaintainAspectRatio: (event: MouseEvent | KeyboardEvent) => boolean;
|
|
68
|
-
export declare const shouldRotateWithDiscreteAngle: (event: MouseEvent | KeyboardEvent) => boolean;
|
|
68
|
+
export declare const shouldRotateWithDiscreteAngle: (event: MouseEvent | KeyboardEvent | React.PointerEvent<HTMLCanvasElement>) => boolean;
|
|
@@ -26,7 +26,7 @@ export declare const setShapeForElement: <T extends ExcalidrawElement>(element:
|
|
|
26
26
|
export declare const invalidateShapeForElement: (element: ExcalidrawElement) => boolean;
|
|
27
27
|
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
28
28
|
export declare const renderElement: (element: NonDeletedExcalidrawElement, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: RenderConfig) => void;
|
|
29
|
-
export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX?: number
|
|
29
|
+
export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX?: number, offsetY?: number, exportWithDarkMode?: boolean) => void;
|
|
30
30
|
export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
|
|
31
31
|
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
32
32
|
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|