@dwelle/excalidraw 0.3.17 → 0.3.21
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/CHANGELOG.md +11 -0
- package/README_NEXT.md +2 -17
- package/dist/excalidraw-assets/image-0db17e06143a31f9772b.js +1 -0
- package/dist/excalidraw-assets/image-6f8d3b9873832b5f7a67.js +1 -0
- package/dist/excalidraw-assets/image-a26261fb8a718f15853e.js +1 -0
- package/dist/excalidraw-assets/vendor-64ea3ed78bc76a895e61.js +2 -0
- package/dist/excalidraw-assets/vendor-64ea3ed78bc76a895e61.js.LICENSE.txt +14 -0
- package/dist/excalidraw-assets/vendor-ce466849186c701b6c48.js +2 -0
- package/dist/excalidraw-assets/vendor-ce466849186c701b6c48.js.LICENSE.txt +14 -0
- package/dist/excalidraw-assets/vendor-e5c6cd57013e8e575a61.js +1 -0
- package/dist/excalidraw-assets-dev/image-469d5bd946743969995a.js +42 -0
- package/dist/excalidraw-assets-dev/image-821afe7d20de2d2ca898.js +42 -0
- package/dist/excalidraw-assets-dev/vendor-a449655791956f151f51.js +344 -0
- package/dist/excalidraw.development.js +252 -91
- package/dist/excalidraw.production.min.js +1 -2
- package/dist/excalidraw.production.min.js.LICENSE.txt +9 -0
- package/package.json +11 -8
- package/types/actions/manager.d.ts +0 -1
- package/types/actions/types.d.ts +0 -1
- package/types/appState.d.ts +5 -5
- package/types/clipboard.d.ts +0 -2
- package/types/components/Actions.d.ts +0 -1
- package/types/components/App.d.ts +0 -1
- package/types/components/Avatar.d.ts +0 -1
- package/types/components/ButtonIconSelect.d.ts +0 -1
- package/types/components/CheckboxItem.d.ts +2 -1
- package/types/components/ClearCanvas.d.ts +0 -1
- package/types/components/ConfirmDialog.d.ts +11 -0
- package/types/components/ContextMenu.d.ts +0 -2
- package/types/components/Dialog.d.ts +4 -2
- package/types/components/Island.d.ts +0 -1
- package/types/components/JSONExportDialog.d.ts +0 -1
- package/types/components/LayerUI.d.ts +0 -1
- package/types/components/LibraryMenu.d.ts +18 -0
- package/types/components/LibraryMenuItems.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +6 -4
- package/types/components/MobileMenu.d.ts +0 -1
- package/types/components/Modal.d.ts +1 -0
- package/types/components/PasteChartDialog.d.ts +1 -1
- package/types/components/Popover.d.ts +0 -1
- package/types/components/PublishLibrary.d.ts +17 -0
- package/types/components/Section.d.ts +0 -1
- package/types/components/SingleLibraryItem.d.ts +11 -0
- package/types/components/ToolButton.d.ts +5 -0
- package/types/components/Tooltip.d.ts +2 -1
- package/types/components/icons.d.ts +1 -1
- package/types/constants.d.ts +5 -0
- package/types/data/blob.d.ts +5 -3
- package/types/data/encryption.d.ts +3 -4
- package/types/data/filesystem.d.ts +2 -3
- package/types/data/json.d.ts +2 -2
- package/types/data/library.d.ts +1 -1
- package/types/data/restore.d.ts +2 -1
- package/types/data/types.d.ts +7 -4
- package/types/element/binding.d.ts +0 -2
- package/types/element/bounds.d.ts +8 -1
- package/types/element/image.d.ts +0 -2
- package/types/element/index.d.ts +0 -3
- package/types/element/linearElementEditor.d.ts +0 -1
- package/types/element/mutateElement.d.ts +1 -1
- package/types/element/newElement.d.ts +1 -1
- package/types/element/textWysiwyg.d.ts +0 -2
- package/types/element/types.d.ts +2 -0
- package/types/errors.d.ts +0 -1
- package/types/i18n.d.ts +1 -1
- package/types/keys.d.ts +0 -2
- package/types/packages/excalidraw/dist/excalidraw-assets/image-0db17e06143a31f9772b.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/image-6f8d3b9873832b5f7a67.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/image-a26261fb8a718f15853e.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/vendor-64ea3ed78bc76a895e61.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/vendor-ce466849186c701b6c48.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/vendor-e5c6cd57013e8e575a61.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-469d5bd946743969995a.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-821afe7d20de2d2ca898.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-a449655791956f151f51.d.ts +0 -0
- package/types/packages/excalidraw/env.d.ts +1 -0
- package/types/packages/excalidraw/index.d.ts +1 -1
- package/types/packages/excalidraw/webpack.dev.config.d.ts +1 -1
- package/types/packages/excalidraw/webpack.prod.config.d.ts +0 -2
- package/types/packages/utils.d.ts +5 -6
- package/types/renderer/renderElement.d.ts +4 -6
- package/types/renderer/renderScene.d.ts +4 -11
- package/types/renderer/roundRect.d.ts +0 -1
- package/types/scene/export.d.ts +0 -2
- package/types/scene/scroll.d.ts +0 -2
- package/types/scene/types.d.ts +15 -8
- package/types/scene/zoom.d.ts +0 -1
- package/types/types.d.ts +14 -2
- package/types/utils.d.ts +10 -2
package/types/i18n.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export declare const languages: Language[];
|
|
|
11
11
|
export declare const setLanguage: (lang: Language) => Promise<void>;
|
|
12
12
|
export declare const getLanguage: () => Language;
|
|
13
13
|
export declare const t: (path: string, replacement?: {
|
|
14
|
-
[key: string]: string;
|
|
14
|
+
[key: string]: string | number;
|
|
15
15
|
} | undefined) => string;
|
package/types/keys.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function parseEnvVariables(filepath: any): {};
|
|
@@ -6,7 +6,7 @@ import { ExcalidrawAPIRefValue, ExcalidrawProps } from "../../types";
|
|
|
6
6
|
declare type PublicExcalidrawProps = Omit<ExcalidrawProps, "forwardedRef">;
|
|
7
7
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<PublicExcalidrawProps & React.RefAttributes<ExcalidrawAPIRefValue>>>;
|
|
8
8
|
export default _default;
|
|
9
|
-
export { getSceneVersion,
|
|
9
|
+
export { getSceneVersion, isInvisiblySmallElement, getNonDeletedElements, } from "../../element";
|
|
10
10
|
export { defaultLang, languages } from "../../i18n";
|
|
11
11
|
export { restore, restoreElements, restoreAppState } from "../../data/restore";
|
|
12
12
|
export { exportToBlob, exportToCanvas, exportToSvg, serializeAsJSON, loadLibraryFromBlob, loadFromBlob, getFreeDrawSvgPath, } from "../../packages/utils";
|
|
@@ -64,8 +64,6 @@ export namespace module {
|
|
|
64
64
|
})[];
|
|
65
65
|
}
|
|
66
66
|
export namespace optimization {
|
|
67
|
-
const minimize: boolean;
|
|
68
|
-
const minimizer: import("terser-webpack-plugin/types").default<import("terser").MinifyOptions>[];
|
|
69
67
|
namespace splitChunks {
|
|
70
68
|
const chunks: string;
|
|
71
69
|
namespace cacheGroups {
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
1
|
import { AppState, BinaryFiles } from "../types";
|
|
4
|
-
import { ExcalidrawElement } from "../element/types";
|
|
2
|
+
import { ExcalidrawElement, NonDeleted } from "../element/types";
|
|
5
3
|
declare type ExportOpts = {
|
|
6
|
-
elements: readonly ExcalidrawElement[];
|
|
4
|
+
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
7
5
|
appState?: Partial<Omit<AppState, "offsetTop" | "offsetLeft">>;
|
|
8
6
|
files: BinaryFiles | null;
|
|
7
|
+
maxWidthOrHeight?: number;
|
|
9
8
|
getDimensions?: (width: number, height: number) => {
|
|
10
9
|
width: number;
|
|
11
10
|
height: number;
|
|
12
|
-
scale
|
|
11
|
+
scale?: number;
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
|
-
export declare const exportToCanvas: ({ elements, appState, files, getDimensions, }: ExportOpts) => Promise<HTMLCanvasElement>;
|
|
14
|
+
export declare const exportToCanvas: ({ elements, appState, files, maxWidthOrHeight, getDimensions, }: ExportOpts) => Promise<HTMLCanvasElement>;
|
|
16
15
|
export declare const exportToBlob: (opts: ExportOpts & {
|
|
17
16
|
mimeType?: string;
|
|
18
17
|
quality?: number;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
1
|
import { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement } from "../element/types";
|
|
4
2
|
import { RoughCanvas } from "roughjs/bin/canvas";
|
|
5
3
|
import { Drawable, Options } from "roughjs/bin/core";
|
|
6
4
|
import { RoughSVG } from "roughjs/bin/svg";
|
|
7
|
-
import {
|
|
5
|
+
import { RenderConfig } from "../scene/types";
|
|
8
6
|
import { BinaryFiles, Zoom } from "../types";
|
|
9
7
|
export interface ExcalidrawElementWithCanvas {
|
|
10
8
|
element: ExcalidrawElement | ExcalidrawTextElement;
|
|
11
9
|
canvas: HTMLCanvasElement;
|
|
12
|
-
theme:
|
|
10
|
+
theme: RenderConfig["theme"];
|
|
13
11
|
canvasZoom: Zoom["value"];
|
|
14
12
|
canvasOffsetX: number;
|
|
15
13
|
canvasOffsetY: number;
|
|
@@ -18,8 +16,8 @@ export declare const getShapeForElement: (element: ExcalidrawElement) => Drawabl
|
|
|
18
16
|
export declare const invalidateShapeForElement: (element: ExcalidrawElement) => boolean;
|
|
19
17
|
export declare const clearRenderCache: () => void;
|
|
20
18
|
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
21
|
-
export declare const renderElement: (element: NonDeletedExcalidrawElement, rc: RoughCanvas, context: CanvasRenderingContext2D,
|
|
22
|
-
export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX?: number | undefined, offsetY?: number | undefined) => void;
|
|
19
|
+
export declare const renderElement: (element: NonDeletedExcalidrawElement, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: RenderConfig) => void;
|
|
20
|
+
export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX?: number | undefined, offsetY?: number | undefined, exportWithDarkMode?: boolean | undefined) => void;
|
|
23
21
|
export declare let pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
|
|
24
22
|
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
25
23
|
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
1
|
import { RoughCanvas } from "roughjs/bin/canvas";
|
|
4
2
|
import { RoughSVG } from "roughjs/bin/svg";
|
|
5
3
|
import { AppState, BinaryFiles } from "../types";
|
|
6
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
7
|
-
import {
|
|
8
|
-
export declare const renderScene: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, selectionElement: NonDeletedExcalidrawElement | null, scale: number, rc: RoughCanvas, canvas: HTMLCanvasElement,
|
|
9
|
-
renderScrollbars?: boolean | undefined;
|
|
10
|
-
renderSelection?: boolean | undefined;
|
|
11
|
-
renderOptimizations?: boolean | undefined;
|
|
12
|
-
renderGrid?: boolean | undefined;
|
|
13
|
-
isExport?: boolean | undefined;
|
|
14
|
-
}) => {
|
|
5
|
+
import { RenderConfig } from "../scene/types";
|
|
6
|
+
export declare const renderScene: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, selectionElement: NonDeletedExcalidrawElement | null, scale: number, rc: RoughCanvas, canvas: HTMLCanvasElement, renderConfig: RenderConfig) => {
|
|
15
7
|
atLeastOneVisibleElement: boolean;
|
|
16
8
|
scrollBars?: undefined;
|
|
17
9
|
} | {
|
|
18
10
|
atLeastOneVisibleElement: boolean;
|
|
19
11
|
scrollBars: import("../scene/types").ScrollBars | undefined;
|
|
20
12
|
};
|
|
21
|
-
export declare const renderSceneToSvg: (elements: readonly NonDeletedExcalidrawElement[], rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, { offsetX, offsetY, }?: {
|
|
13
|
+
export declare const renderSceneToSvg: (elements: readonly NonDeletedExcalidrawElement[], rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, { offsetX, offsetY, exportWithDarkMode, }?: {
|
|
22
14
|
offsetX?: number | undefined;
|
|
23
15
|
offsetY?: number | undefined;
|
|
16
|
+
exportWithDarkMode?: boolean | undefined;
|
|
24
17
|
}) => void;
|
package/types/scene/export.d.ts
CHANGED
package/types/scene/scroll.d.ts
CHANGED
package/types/scene/types.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ExcalidrawTextElement } from "../element/types";
|
|
2
|
-
import { AppClassProperties, AppState
|
|
3
|
-
export declare type
|
|
4
|
-
scrollX:
|
|
5
|
-
scrollY:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { AppClassProperties, AppState } from "../types";
|
|
3
|
+
export declare type RenderConfig = {
|
|
4
|
+
scrollX: AppState["scrollX"];
|
|
5
|
+
scrollY: AppState["scrollY"];
|
|
6
|
+
/** null indicates transparent bg */
|
|
7
|
+
viewBackgroundColor: AppState["viewBackgroundColor"] | null;
|
|
8
|
+
zoom: AppState["zoom"];
|
|
9
|
+
shouldCacheIgnoreZoom: AppState["shouldCacheIgnoreZoom"];
|
|
10
|
+
theme: AppState["theme"];
|
|
9
11
|
remotePointerViewportCoords: {
|
|
10
12
|
[id: string]: {
|
|
11
13
|
x: number;
|
|
@@ -24,8 +26,13 @@ export declare type SceneState = {
|
|
|
24
26
|
remotePointerUserStates: {
|
|
25
27
|
[id: string]: string;
|
|
26
28
|
};
|
|
27
|
-
theme: AppState["theme"];
|
|
28
29
|
imageCache: AppClassProperties["imageCache"];
|
|
30
|
+
renderScrollbars?: boolean;
|
|
31
|
+
renderSelection?: boolean;
|
|
32
|
+
renderGrid?: boolean;
|
|
33
|
+
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
34
|
+
CSS filters), and we disable render optimizations for best output */
|
|
35
|
+
isExporting: boolean;
|
|
29
36
|
};
|
|
30
37
|
export declare type SceneScroll = {
|
|
31
38
|
scrollX: number;
|
package/types/scene/zoom.d.ts
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
2
|
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme } from "./element/types";
|
|
4
3
|
import { SHAPES } from "./shapes";
|
|
5
4
|
import { Point as RoughPoint } from "roughjs/bin/geometry";
|
|
@@ -153,7 +152,20 @@ export declare class GestureEvent extends UIEvent {
|
|
|
153
152
|
readonly rotation: number;
|
|
154
153
|
readonly scale: number;
|
|
155
154
|
}
|
|
156
|
-
|
|
155
|
+
/** @deprecated legacy: do not use outside of migration paths */
|
|
156
|
+
export declare type LibraryItem_v1 = readonly NonDeleted<ExcalidrawElement>[];
|
|
157
|
+
/** @deprecated legacy: do not use outside of migration paths */
|
|
158
|
+
export declare type LibraryItems_v1 = readonly LibraryItem_v1[];
|
|
159
|
+
/** v2 library item */
|
|
160
|
+
export declare type LibraryItem = {
|
|
161
|
+
id: string;
|
|
162
|
+
status: "published" | "unpublished";
|
|
163
|
+
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
164
|
+
/** timestamp in epoch (ms) */
|
|
165
|
+
created: number;
|
|
166
|
+
name?: string;
|
|
167
|
+
error?: string;
|
|
168
|
+
};
|
|
157
169
|
export declare type LibraryItems = readonly LibraryItem[];
|
|
158
170
|
export declare type ExcalidrawAPIRefValue = ExcalidrawImperativeAPI | {
|
|
159
171
|
readyPromise?: ResolvablePromise<ExcalidrawImperativeAPI>;
|
package/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="web" />
|
|
3
1
|
import { FontFamilyValues, FontString } from "./element/types";
|
|
4
2
|
import { Zoom } from "./types";
|
|
5
3
|
export declare const setDateTimeForTests: (dateTime: string) => void;
|
|
@@ -26,6 +24,7 @@ export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeo
|
|
|
26
24
|
flush(): void;
|
|
27
25
|
cancel(): void;
|
|
28
26
|
};
|
|
27
|
+
export declare const chunk: <T extends unknown>(array: readonly T[], size: number) => T[][];
|
|
29
28
|
export declare const selectNode: (node: Element) => void;
|
|
30
29
|
export declare const removeSelection: () => void;
|
|
31
30
|
export declare const distance: (x: number, y: number) => number;
|
|
@@ -94,3 +93,12 @@ export declare const supportsEmoji: () => boolean;
|
|
|
94
93
|
export declare const getNearestScrollableContainer: (element: HTMLElement) => HTMLElement | Document;
|
|
95
94
|
export declare const focusNearestParent: (element: HTMLInputElement) => void;
|
|
96
95
|
export declare const preventUnload: (event: BeforeUnloadEvent) => void;
|
|
96
|
+
export declare const bytesToHexString: (bytes: Uint8Array) => string;
|
|
97
|
+
export declare const getUpdatedTimestamp: () => number;
|
|
98
|
+
/**
|
|
99
|
+
* Transforms array of objects containing `id` attribute,
|
|
100
|
+
* or array of ids (strings), into a Map, keyd by `id`.
|
|
101
|
+
*/
|
|
102
|
+
export declare const arrayToMap: <T extends string | {
|
|
103
|
+
id: string;
|
|
104
|
+
}>(items: readonly T[]) => Map<string, T>;
|