@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
|
@@ -3,7 +3,15 @@ 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
|
|
6
|
+
export declare const _renderScene: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, selectionElement: NonDeletedExcalidrawElement | null, scale: number, rc: RoughCanvas, canvas: HTMLCanvasElement, renderConfig: RenderConfig) => {
|
|
7
|
+
atLeastOneVisibleElement: boolean;
|
|
8
|
+
scrollBars?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
atLeastOneVisibleElement: boolean;
|
|
11
|
+
scrollBars: import("../scene/types").ScrollBars | undefined;
|
|
12
|
+
};
|
|
13
|
+
/** renderScene throttled to animation framerate */
|
|
14
|
+
export declare const renderScene: <T extends boolean = false>(elements: readonly NonDeletedExcalidrawElement[], appState: AppState, selectionElement: NonDeletedExcalidrawElement | null, scale: number, rc: RoughCanvas, canvas: HTMLCanvasElement, renderConfig: RenderConfig, callback?: ((data: ReturnType<typeof _renderScene>) => void) | undefined, throttle?: T | undefined) => T extends true ? void : {
|
|
7
15
|
atLeastOneVisibleElement: boolean;
|
|
8
16
|
scrollBars?: undefined;
|
|
9
17
|
} | {
|
package/types/shapes.d.ts
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -113,7 +113,11 @@ export declare type AppState = {
|
|
|
113
113
|
};
|
|
114
114
|
shouldCacheIgnoreZoom: boolean;
|
|
115
115
|
showHelpDialog: boolean;
|
|
116
|
-
|
|
116
|
+
toast: {
|
|
117
|
+
message: string;
|
|
118
|
+
closable?: boolean;
|
|
119
|
+
duration?: number;
|
|
120
|
+
} | null;
|
|
117
121
|
zenModeEnabled: boolean;
|
|
118
122
|
theme: Theme;
|
|
119
123
|
gridSize: number | null;
|
|
@@ -223,6 +227,7 @@ export interface ExcalidrawProps {
|
|
|
223
227
|
zenModeEnabled?: boolean;
|
|
224
228
|
gridModeEnabled?: boolean;
|
|
225
229
|
libraryReturnUrl?: string;
|
|
230
|
+
trayModeEnabled?: boolean;
|
|
226
231
|
theme?: Theme;
|
|
227
232
|
name?: string;
|
|
228
233
|
renderCustomStats?: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => JSX.Element;
|
|
@@ -371,7 +376,7 @@ export declare type ExcalidrawImperativeAPI = {
|
|
|
371
376
|
getAppState: () => InstanceType<typeof App>["state"];
|
|
372
377
|
getFiles: () => InstanceType<typeof App>["files"];
|
|
373
378
|
refresh: InstanceType<typeof App>["refresh"];
|
|
374
|
-
|
|
379
|
+
setToast: InstanceType<typeof App>["setToast"];
|
|
375
380
|
addFiles: (data: BinaryFileData[]) => void;
|
|
376
381
|
updateContainerSize: InstanceType<typeof App>["updateContainerSize"];
|
|
377
382
|
readyPromise: ResolvablePromise<ExcalidrawImperativeAPI>;
|
|
@@ -384,6 +389,7 @@ export declare type ExcalidrawImperativeAPI = {
|
|
|
384
389
|
sendToBack: (elements: readonly ExcalidrawElement[]) => void;
|
|
385
390
|
bringToFront: (elements: readonly ExcalidrawElement[]) => void;
|
|
386
391
|
restore: InstanceType<typeof App>["restore"];
|
|
392
|
+
setMobileModeAllowed: (allow: boolean) => void;
|
|
387
393
|
setActiveTool: InstanceType<typeof App>["setActiveTool"];
|
|
388
394
|
setCursor: InstanceType<typeof App>["setCursor"];
|
|
389
395
|
resetCursor: InstanceType<typeof App>["resetCursor"];
|
package/types/utils.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare const setDateTimeForTests: (dateTime: string) => void;
|
|
|
6
6
|
export declare const getDateTime: () => string;
|
|
7
7
|
export declare const capitalizeString: (str: string) => string;
|
|
8
8
|
export declare const isToolIcon: (target: Element | EventTarget | null) => target is HTMLElement;
|
|
9
|
-
export declare const isInputLike: (target: Element | EventTarget | null) => target is
|
|
10
|
-
export declare const isWritableElement: (target: Element | EventTarget | null) => target is
|
|
9
|
+
export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
10
|
+
export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLTextAreaElement;
|
|
11
11
|
export declare const getFontFamilyString: ({ fontFamily, }: {
|
|
12
12
|
fontFamily: FontFamilyValues;
|
|
13
13
|
}) => string;
|
|
@@ -21,7 +21,9 @@ export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeo
|
|
|
21
21
|
flush(): void;
|
|
22
22
|
cancel(): void;
|
|
23
23
|
};
|
|
24
|
-
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void
|
|
24
|
+
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void, opts?: {
|
|
25
|
+
trailing?: boolean;
|
|
26
|
+
}) => {
|
|
25
27
|
(...args: T): void;
|
|
26
28
|
flush(): void;
|
|
27
29
|
cancel(): void;
|
|
@@ -31,7 +33,7 @@ export declare const selectNode: (node: Element) => void;
|
|
|
31
33
|
export declare const removeSelection: () => void;
|
|
32
34
|
export declare const distance: (x: number, y: number) => number;
|
|
33
35
|
export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: ({
|
|
34
|
-
type: typeof SHAPES[number]["value"] | "eraser";
|
|
36
|
+
type: (typeof SHAPES)[number]["value"] | "eraser";
|
|
35
37
|
} | {
|
|
36
38
|
type: "custom";
|
|
37
39
|
customType: string;
|
|
@@ -85,7 +87,7 @@ export declare const tupleToCoors: (xyTuple: readonly [number, number]) => {
|
|
|
85
87
|
y: number;
|
|
86
88
|
};
|
|
87
89
|
/** use as a rejectionHandler to mute filesystem Abort errors */
|
|
88
|
-
export declare const muteFSAbortError: (error?: Error
|
|
90
|
+
export declare const muteFSAbortError: (error?: Error) => void;
|
|
89
91
|
export declare const findIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
|
|
90
92
|
export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
|
|
91
93
|
export declare const isTransparent: (color: string) => boolean;
|