@wildmio/excalidraw-math 0.18.0-custom.1 → 0.18.0-custom.8
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/dist/types/common/src/colors.d.ts +4 -1
- package/dist/types/common/src/constants.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +11 -7
- package/dist/types/element/src/Scene.d.ts +3 -3
- package/dist/types/element/src/renderElement.d.ts +0 -6
- package/dist/types/element/src/shape.d.ts +5 -4
- package/dist/types/element/src/utils.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +2 -1
- package/dist/types/excalidraw/components/App.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +7 -4
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
- package/dist/types/excalidraw/data/blob.d.ts +314 -2
- package/dist/types/excalidraw/data/json.d.ts +157 -1
- package/dist/types/excalidraw/data/restore.d.ts +22 -16
- package/dist/types/excalidraw/index.d.ts +1 -2
- package/dist/types/excalidraw/scene/Renderer.d.ts +2 -1
- package/dist/types/excalidraw/scene/types.d.ts +7 -2
- package/dist/types/math/src/range.d.ts +1 -3
- package/package.json +4 -4
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import oc from "open-color";
|
|
2
|
+
import tinycolor from "tinycolor2";
|
|
2
3
|
import type { Merge } from "./utility-types";
|
|
4
|
+
export { tinycolor };
|
|
5
|
+
export declare const applyDarkModeFilter: (color: string) => string;
|
|
3
6
|
export declare const COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
|
|
4
7
|
export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
|
|
5
8
|
export type ColorTuple = readonly [string, string, string, string, string];
|
|
@@ -59,4 +62,4 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
|
59
62
|
readonly bronze: ColorTuple;
|
|
60
63
|
};
|
|
61
64
|
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
|
|
62
|
-
export declare const rgbToHex: (r: number, g: number, b: number) => string;
|
|
65
|
+
export declare const rgbToHex: (r: number, g: number, b: number, a?: number) => string;
|
|
@@ -226,7 +226,6 @@ export declare const MAX_ZOOM = 30;
|
|
|
226
226
|
export declare const HYPERLINK_TOOLTIP_DELAY = 300;
|
|
227
227
|
export declare const IDLE_THRESHOLD = 60000;
|
|
228
228
|
export declare const ACTIVE_THRESHOLD = 3000;
|
|
229
|
-
export declare const THEME_FILTER = "invert(93%) hue-rotate(180deg)";
|
|
230
229
|
export declare const URL_QUERY_KEYS: {
|
|
231
230
|
readonly addLibrary: "addLibrary";
|
|
232
231
|
};
|
|
@@ -244,20 +244,24 @@ export declare function addEventListener<K extends keyof FontFaceSetEventMap>(ta
|
|
|
244
244
|
export declare function addEventListener<K extends keyof HTMLElementEventMap>(target: Document | (Window & typeof globalThis) | HTMLElement | undefined | null | false, type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): UnsubscribeCallback;
|
|
245
245
|
export declare function getSvgPathFromStroke(points: number[][], closed?: boolean): string;
|
|
246
246
|
export declare const normalizeEOL: (str: string) => string;
|
|
247
|
-
type HasBrand<T> = {
|
|
248
|
-
[K in keyof T]: K extends `~brand${infer _}` ? true : never;
|
|
247
|
+
export type HasBrand<T> = {
|
|
248
|
+
[K in keyof T]: K extends `~brand${infer _}` | "_brand" ? true : never;
|
|
249
249
|
}[keyof T];
|
|
250
250
|
type RemoveAllBrands<T> = HasBrand<T> extends true ? {
|
|
251
|
-
[K in keyof T as K extends `~brand~${infer _}` ? never : K]: T[K];
|
|
252
|
-
} :
|
|
253
|
-
type
|
|
251
|
+
[K in keyof T as K extends `~brand~${infer _}` | "_brand" ? never : K]: T[K];
|
|
252
|
+
} : T;
|
|
253
|
+
type UnbrandForValue<T> = T extends Map<infer E, infer F> ? Map<UnbrandForValue<E>, UnbrandForValue<F>> : T extends Set<infer E> ? Set<UnbrandForValue<E>> : T extends readonly any[] ? T extends any[] ? unknown[] : readonly unknown[] : RemoveAllBrands<T>;
|
|
254
|
+
export type Unbrand<T> = T extends Map<infer E, infer F> ? Map<Unbrand<E>, Unbrand<F>> : T extends Set<infer E> ? Set<Unbrand<E>> : T extends readonly (infer E)[] ? Array<Unbrand<E>> : RemoveAllBrands<T>;
|
|
255
|
+
export type CombineBrands<BrandedType, CurrentType> = BrandedType extends readonly (infer BE)[] ? CurrentType extends readonly (infer CE)[] ? Array<CE & BE> : CurrentType & BrandedType : CurrentType & BrandedType;
|
|
256
|
+
export type CombineBrandsIfNeeded<T, Required> = [T] extends [Required] ? T[] : HasBrand<T> extends true ? CombineBrands<T, Required>[] : Required[];
|
|
254
257
|
/**
|
|
255
258
|
* Makes type into a branded type, ensuring that value is assignable to
|
|
256
|
-
* the base
|
|
259
|
+
* the base unbranded type. Optionally you can explicitly supply current value
|
|
257
260
|
* type to combine both (useful for composite branded types. Make sure you
|
|
258
261
|
* compose branded types which are not composite themselves.)
|
|
259
262
|
*/
|
|
260
|
-
export declare
|
|
263
|
+
export declare function toBrandedType<BrandedType>(value: UnbrandForValue<BrandedType>): BrandedType;
|
|
264
|
+
export declare function toBrandedType<BrandedType, CurrentType>(value: CurrentType): CombineBrands<BrandedType, CurrentType>;
|
|
261
265
|
export declare const promiseTry: <TValue, TArgs extends unknown[]>(fn: (...args: TArgs) => PromiseLike<TValue> | TValue, ...args: TArgs) => Promise<TValue>;
|
|
262
266
|
export declare const isAnyTrue: (...args: boolean[]) => boolean;
|
|
263
267
|
export declare const safelyParseJSON: (json: string) => Record<string, any> | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ElementUpdate } from "@excalidraw/element";
|
|
2
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, OrderedExcalidrawElement, Ordered } from "@excalidraw/element/types";
|
|
2
|
+
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, SceneElementsMap, NonDeletedSceneElementsMap, OrderedExcalidrawElement, Ordered } from "@excalidraw/element/types";
|
|
3
3
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
4
4
|
import type { AppState } from "../../excalidraw/types";
|
|
5
5
|
type SceneStateCallback = () => void;
|
|
@@ -22,9 +22,9 @@ export declare class Scene {
|
|
|
22
22
|
*/
|
|
23
23
|
private sceneNonce;
|
|
24
24
|
getSceneNonce(): number | undefined;
|
|
25
|
-
getNonDeletedElementsMap():
|
|
25
|
+
getNonDeletedElementsMap(): NonDeletedSceneElementsMap;
|
|
26
26
|
getElementsIncludingDeleted(): readonly OrderedExcalidrawElement[];
|
|
27
|
-
getElementsMapIncludingDeleted():
|
|
27
|
+
getElementsMapIncludingDeleted(): SceneElementsMap;
|
|
28
28
|
getNonDeletedElements(): readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
29
29
|
getFramesIncludingDeleted(): readonly ExcalidrawFrameLikeElement[];
|
|
30
30
|
constructor(elements?: ElementsMapOrArray | null, options?: {
|
|
@@ -3,7 +3,6 @@ import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, Element
|
|
|
3
3
|
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
|
|
4
4
|
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
|
|
5
5
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
6
|
-
export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
|
7
6
|
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
|
|
8
7
|
export interface ExcalidrawElementWithCanvas {
|
|
9
8
|
element: ExcalidrawElement | ExcalidrawTextElement;
|
|
@@ -23,9 +22,4 @@ export declare const DEFAULT_LINK_SIZE = 14;
|
|
|
23
22
|
export declare const elementWithCanvasCache: WeakMap<ExcalidrawElement, ExcalidrawElementWithCanvas>;
|
|
24
23
|
export declare const renderSelectionElement: (element: NonDeletedExcalidrawElement, context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState, selectionColor: InteractiveCanvasRenderConfig["selectionColor"]) => void;
|
|
25
24
|
export declare const renderElement: (element: NonDeletedExcalidrawElement, elementsMap: RenderableElementsMap, allElementsMap: NonDeletedSceneElementsMap, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState | InteractiveCanvasAppState) => void;
|
|
26
|
-
export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
|
|
27
|
-
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
28
|
-
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|
|
29
|
-
export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
|
|
30
25
|
export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
|
|
31
|
-
export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
|
|
@@ -12,9 +12,8 @@ export declare class ShapeCache {
|
|
|
12
12
|
* Retrieves shape from cache if available. Use this only if shape
|
|
13
13
|
* is optional and you have a fallback in case it's not cached.
|
|
14
14
|
*/
|
|
15
|
-
static get: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined;
|
|
16
|
-
static
|
|
17
|
-
static delete: (element: ExcalidrawElement) => boolean;
|
|
15
|
+
static get: <T extends ExcalidrawElement>(element: T, theme: AppState["theme"] | null) => (T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined) | undefined;
|
|
16
|
+
static delete: (element: ExcalidrawElement) => void;
|
|
18
17
|
static destroy: () => void;
|
|
19
18
|
/**
|
|
20
19
|
* Generates & caches shape for element if not already cached, otherwise
|
|
@@ -24,9 +23,10 @@ export declare class ShapeCache {
|
|
|
24
23
|
isExporting: boolean;
|
|
25
24
|
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
26
25
|
embedsValidationStatus: EmbedsValidationStatus;
|
|
26
|
+
theme: AppState["theme"];
|
|
27
27
|
} | null) => ((T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined) & {}) | (T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable | null);
|
|
28
28
|
}
|
|
29
|
-
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
29
|
+
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean, isDarkMode?: boolean) => Options;
|
|
30
30
|
export declare const generateLinearCollisionShape: (element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement) => {
|
|
31
31
|
op: string;
|
|
32
32
|
data: number[];
|
|
@@ -40,3 +40,4 @@ export declare const toggleLinePolygonState: (element: ExcalidrawLineElement, ne
|
|
|
40
40
|
polygon: ExcalidrawLineElement["polygon"];
|
|
41
41
|
points: ExcalidrawLineElement["points"];
|
|
42
42
|
} | null;
|
|
43
|
+
export declare const getFreedrawOutlinePoints: (element: ExcalidrawFreeDrawElement) => [number, number][];
|
|
@@ -32,3 +32,4 @@ export declare const isPathALoop: (points: ExcalidrawLinearElement["points"],
|
|
|
32
32
|
zoomValue?: Zoom["value"]) => boolean;
|
|
33
33
|
export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
|
|
34
34
|
export declare const projectFixedPointOntoDiagonal: (arrow: ExcalidrawArrowElement, point: GlobalPoint, element: ExcalidrawElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => GlobalPoint | null;
|
|
35
|
+
export declare const isGhostElement: (element: ExcalidrawElement) => boolean;
|
|
@@ -359,6 +359,7 @@ export declare const actionLoadScene: {
|
|
|
359
359
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
360
360
|
appState: {
|
|
361
361
|
viewBackgroundColor: string;
|
|
362
|
+
theme: Theme;
|
|
362
363
|
frameRendering: {
|
|
363
364
|
enabled: boolean;
|
|
364
365
|
name: boolean;
|
|
@@ -389,7 +390,6 @@ export declare const actionLoadScene: {
|
|
|
389
390
|
[id: string]: true;
|
|
390
391
|
}>;
|
|
391
392
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
392
|
-
theme: Theme;
|
|
393
393
|
activeEmbeddable: {
|
|
394
394
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
395
395
|
state: "hover" | "active";
|
|
@@ -2,6 +2,7 @@ import type { AppState, NormalizedZoomValue } from "./types";
|
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
4
|
viewBackgroundColor?: string | undefined;
|
|
5
|
+
theme?: import("@excalidraw/element/types").Theme | undefined;
|
|
5
6
|
name?: string | null | undefined;
|
|
6
7
|
zoom?: Readonly<{
|
|
7
8
|
value: NormalizedZoomValue;
|
|
@@ -13,7 +14,6 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
13
14
|
selectedElementIds?: Readonly<{
|
|
14
15
|
[id: string]: true;
|
|
15
16
|
}> | undefined;
|
|
16
|
-
theme?: import("@excalidraw/element/types").Theme | undefined;
|
|
17
17
|
selectedGroupIds?: {
|
|
18
18
|
[groupId: string]: boolean;
|
|
19
19
|
} | undefined;
|
|
@@ -100,3 +100,4 @@ export declare const isEraserActive: ({ activeTool, }: {
|
|
|
100
100
|
export declare const isHandToolActive: ({ activeTool, }: {
|
|
101
101
|
activeTool: AppState["activeTool"];
|
|
102
102
|
}) => boolean;
|
|
103
|
+
export declare const isViewModeActive: (appState: Pick<AppState, "viewModeEnabled" | "hideAnnotations">) => boolean;
|
|
@@ -260,7 +260,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
260
260
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
261
261
|
focusContainer: AppClassProperties["focusContainer"];
|
|
262
262
|
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
263
|
-
getSceneElementsMapIncludingDeleted: () =>
|
|
263
|
+
getSceneElementsMapIncludingDeleted: () => SceneElementsMap;
|
|
264
264
|
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
265
265
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
266
266
|
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { ColorPickerType } from "./colorPickerUtils";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* tries to keep the input color as-is if it's valid, making minimal adjustments
|
|
4
|
+
* (trimming whitespace or adding `#` to hex colors)
|
|
5
|
+
*/
|
|
6
|
+
export declare const normalizeInputColor: (color: string) => string | null;
|
|
7
|
+
export declare const ColorInput: ({ color, onChange, label, colorPickerType, placeholder, }: {
|
|
3
8
|
color: string;
|
|
4
9
|
onChange: (color: string) => void;
|
|
5
10
|
label: string;
|
|
6
11
|
colorPickerType: ColorPickerType;
|
|
7
12
|
placeholder?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const ColorInput: ({ color, onChange, label, colorPickerType, placeholder, }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,6 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
|
3
3
|
import "./ColorPicker.scss";
|
|
4
4
|
import type { ColorPickerType } from "./colorPickerUtils";
|
|
5
5
|
import type { AppState } from "../../types";
|
|
6
|
-
export declare const getColor: (color: string) => string | null;
|
|
7
6
|
interface ColorPickerProps {
|
|
8
7
|
type: ColorPickerType;
|
|
9
8
|
/**
|
|
@@ -18,7 +18,163 @@ localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | nu
|
|
|
18
18
|
/** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
19
19
|
fileHandle?: FileSystemHandle | null) => Promise<{
|
|
20
20
|
type: "application/vnd.excalidraw+json";
|
|
21
|
-
data:
|
|
21
|
+
data: {
|
|
22
|
+
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
23
|
+
appState: {
|
|
24
|
+
viewBackgroundColor: string;
|
|
25
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
26
|
+
frameRendering: {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
name: boolean;
|
|
29
|
+
outline: boolean;
|
|
30
|
+
clip: boolean;
|
|
31
|
+
};
|
|
32
|
+
name: string | null;
|
|
33
|
+
zoom: import("../types").Zoom;
|
|
34
|
+
scrollX: number;
|
|
35
|
+
scrollY: number;
|
|
36
|
+
hideAnnotations: boolean;
|
|
37
|
+
viewModeEnabled: boolean;
|
|
38
|
+
openDialog: null | {
|
|
39
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
40
|
+
} | {
|
|
41
|
+
name: "ttd";
|
|
42
|
+
tab: "text-to-diagram" | "mermaid";
|
|
43
|
+
} | {
|
|
44
|
+
name: "commandPalette";
|
|
45
|
+
} | {
|
|
46
|
+
name: "settings";
|
|
47
|
+
} | {
|
|
48
|
+
name: "elementLinkSelector";
|
|
49
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
50
|
+
};
|
|
51
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
52
|
+
selectedElementIds: Readonly<{
|
|
53
|
+
[id: string]: true;
|
|
54
|
+
}>;
|
|
55
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
56
|
+
activeEmbeddable: {
|
|
57
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
58
|
+
state: "hover" | "active";
|
|
59
|
+
} | null;
|
|
60
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
61
|
+
selectedGroupIds: {
|
|
62
|
+
[groupId: string]: boolean;
|
|
63
|
+
};
|
|
64
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
65
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
66
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
67
|
+
isBindingEnabled: boolean;
|
|
68
|
+
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
69
|
+
isRotating: boolean;
|
|
70
|
+
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
71
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
72
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
73
|
+
zenModeEnabled: boolean;
|
|
74
|
+
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
75
|
+
isCropping: boolean;
|
|
76
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
77
|
+
searchMatches: Readonly<{
|
|
78
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
79
|
+
matches: readonly import("../types").SearchMatch[];
|
|
80
|
+
}> | null;
|
|
81
|
+
activeLockedId: string | null;
|
|
82
|
+
hoveredElementIds: Readonly<{
|
|
83
|
+
[id: string]: true;
|
|
84
|
+
}>;
|
|
85
|
+
shouldCacheIgnoreZoom: boolean;
|
|
86
|
+
exportScale: number;
|
|
87
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
88
|
+
gridSize: number;
|
|
89
|
+
contextMenu: {
|
|
90
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
91
|
+
top: number;
|
|
92
|
+
left: number;
|
|
93
|
+
} | null;
|
|
94
|
+
showWelcomeScreen: boolean;
|
|
95
|
+
isLoading: boolean;
|
|
96
|
+
errorMessage: React.ReactNode;
|
|
97
|
+
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
98
|
+
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
99
|
+
editingFrame: string | null;
|
|
100
|
+
activeTool: {
|
|
101
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
102
|
+
locked: boolean;
|
|
103
|
+
fromSelection: boolean;
|
|
104
|
+
} & import("../types").ActiveTool;
|
|
105
|
+
preferredSelectionTool: {
|
|
106
|
+
type: "selection" | "lasso";
|
|
107
|
+
initialized: boolean;
|
|
108
|
+
};
|
|
109
|
+
penMode: boolean;
|
|
110
|
+
penDetected: boolean;
|
|
111
|
+
exportBackground: boolean;
|
|
112
|
+
exportEmbedScene: boolean;
|
|
113
|
+
exportWithDarkMode: boolean;
|
|
114
|
+
currentItemStrokeColor: string;
|
|
115
|
+
currentItemBackgroundColor: string;
|
|
116
|
+
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
117
|
+
currentItemStrokeWidth: number;
|
|
118
|
+
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
119
|
+
currentItemRoughness: number;
|
|
120
|
+
currentItemOpacity: number;
|
|
121
|
+
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
122
|
+
currentItemFontSize: number;
|
|
123
|
+
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
124
|
+
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
125
|
+
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
126
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
127
|
+
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
128
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
129
|
+
cursorButton: "up" | "down";
|
|
130
|
+
scrolledOutside: boolean;
|
|
131
|
+
isResizing: boolean;
|
|
132
|
+
openMenu: "canvas" | null;
|
|
133
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
134
|
+
openSidebar: {
|
|
135
|
+
name: import("../types").SidebarName;
|
|
136
|
+
tab?: import("../types").SidebarTabName;
|
|
137
|
+
} | null;
|
|
138
|
+
defaultSidebarDockedPreference: boolean;
|
|
139
|
+
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
140
|
+
previousSelectedElementIds: {
|
|
141
|
+
[id: string]: true;
|
|
142
|
+
};
|
|
143
|
+
selectedElementsAreBeingDragged: boolean;
|
|
144
|
+
toast: {
|
|
145
|
+
message: string;
|
|
146
|
+
closable?: boolean;
|
|
147
|
+
duration?: number;
|
|
148
|
+
} | null;
|
|
149
|
+
gridStep: number;
|
|
150
|
+
gridModeEnabled: boolean;
|
|
151
|
+
fileHandle: FileSystemHandle | null;
|
|
152
|
+
stats: {
|
|
153
|
+
open: boolean;
|
|
154
|
+
panels: number;
|
|
155
|
+
};
|
|
156
|
+
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
157
|
+
pasteDialog: {
|
|
158
|
+
shown: false;
|
|
159
|
+
data: null;
|
|
160
|
+
} | {
|
|
161
|
+
shown: true;
|
|
162
|
+
data: import("../charts").Spreadsheet;
|
|
163
|
+
};
|
|
164
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
165
|
+
originSnapOffset: {
|
|
166
|
+
x: number;
|
|
167
|
+
y: number;
|
|
168
|
+
} | null;
|
|
169
|
+
objectsSnapModeEnabled: boolean;
|
|
170
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
171
|
+
followedBy: Set<import("../types").SocketId>;
|
|
172
|
+
lockedMultiSelections: {
|
|
173
|
+
[groupId: string]: true;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
files: import("../types").BinaryFiles;
|
|
177
|
+
};
|
|
22
178
|
} | {
|
|
23
179
|
type: "application/vnd.excalidrawlib+json";
|
|
24
180
|
data: ImportedLibraryData;
|
|
@@ -27,7 +183,163 @@ export declare const loadFromBlob: (blob: Blob,
|
|
|
27
183
|
/** @see restore.localAppState */
|
|
28
184
|
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
29
185
|
/** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
30
|
-
fileHandle?: FileSystemHandle | null) => Promise<
|
|
186
|
+
fileHandle?: FileSystemHandle | null) => Promise<{
|
|
187
|
+
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
188
|
+
appState: {
|
|
189
|
+
viewBackgroundColor: string;
|
|
190
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
191
|
+
frameRendering: {
|
|
192
|
+
enabled: boolean;
|
|
193
|
+
name: boolean;
|
|
194
|
+
outline: boolean;
|
|
195
|
+
clip: boolean;
|
|
196
|
+
};
|
|
197
|
+
name: string | null;
|
|
198
|
+
zoom: import("../types").Zoom;
|
|
199
|
+
scrollX: number;
|
|
200
|
+
scrollY: number;
|
|
201
|
+
hideAnnotations: boolean;
|
|
202
|
+
viewModeEnabled: boolean;
|
|
203
|
+
openDialog: null | {
|
|
204
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
205
|
+
} | {
|
|
206
|
+
name: "ttd";
|
|
207
|
+
tab: "text-to-diagram" | "mermaid";
|
|
208
|
+
} | {
|
|
209
|
+
name: "commandPalette";
|
|
210
|
+
} | {
|
|
211
|
+
name: "settings";
|
|
212
|
+
} | {
|
|
213
|
+
name: "elementLinkSelector";
|
|
214
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
215
|
+
};
|
|
216
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
217
|
+
selectedElementIds: Readonly<{
|
|
218
|
+
[id: string]: true;
|
|
219
|
+
}>;
|
|
220
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
221
|
+
activeEmbeddable: {
|
|
222
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
223
|
+
state: "hover" | "active";
|
|
224
|
+
} | null;
|
|
225
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
226
|
+
selectedGroupIds: {
|
|
227
|
+
[groupId: string]: boolean;
|
|
228
|
+
};
|
|
229
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
230
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
231
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
232
|
+
isBindingEnabled: boolean;
|
|
233
|
+
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
234
|
+
isRotating: boolean;
|
|
235
|
+
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
236
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
237
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
238
|
+
zenModeEnabled: boolean;
|
|
239
|
+
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
240
|
+
isCropping: boolean;
|
|
241
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
242
|
+
searchMatches: Readonly<{
|
|
243
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
244
|
+
matches: readonly import("../types").SearchMatch[];
|
|
245
|
+
}> | null;
|
|
246
|
+
activeLockedId: string | null;
|
|
247
|
+
hoveredElementIds: Readonly<{
|
|
248
|
+
[id: string]: true;
|
|
249
|
+
}>;
|
|
250
|
+
shouldCacheIgnoreZoom: boolean;
|
|
251
|
+
exportScale: number;
|
|
252
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
253
|
+
gridSize: number;
|
|
254
|
+
contextMenu: {
|
|
255
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
256
|
+
top: number;
|
|
257
|
+
left: number;
|
|
258
|
+
} | null;
|
|
259
|
+
showWelcomeScreen: boolean;
|
|
260
|
+
isLoading: boolean;
|
|
261
|
+
errorMessage: React.ReactNode;
|
|
262
|
+
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
263
|
+
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
264
|
+
editingFrame: string | null;
|
|
265
|
+
activeTool: {
|
|
266
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
267
|
+
locked: boolean;
|
|
268
|
+
fromSelection: boolean;
|
|
269
|
+
} & import("../types").ActiveTool;
|
|
270
|
+
preferredSelectionTool: {
|
|
271
|
+
type: "selection" | "lasso";
|
|
272
|
+
initialized: boolean;
|
|
273
|
+
};
|
|
274
|
+
penMode: boolean;
|
|
275
|
+
penDetected: boolean;
|
|
276
|
+
exportBackground: boolean;
|
|
277
|
+
exportEmbedScene: boolean;
|
|
278
|
+
exportWithDarkMode: boolean;
|
|
279
|
+
currentItemStrokeColor: string;
|
|
280
|
+
currentItemBackgroundColor: string;
|
|
281
|
+
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
282
|
+
currentItemStrokeWidth: number;
|
|
283
|
+
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
284
|
+
currentItemRoughness: number;
|
|
285
|
+
currentItemOpacity: number;
|
|
286
|
+
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
287
|
+
currentItemFontSize: number;
|
|
288
|
+
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
289
|
+
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
290
|
+
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
291
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
292
|
+
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
293
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
294
|
+
cursorButton: "up" | "down";
|
|
295
|
+
scrolledOutside: boolean;
|
|
296
|
+
isResizing: boolean;
|
|
297
|
+
openMenu: "canvas" | null;
|
|
298
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
299
|
+
openSidebar: {
|
|
300
|
+
name: import("../types").SidebarName;
|
|
301
|
+
tab?: import("../types").SidebarTabName;
|
|
302
|
+
} | null;
|
|
303
|
+
defaultSidebarDockedPreference: boolean;
|
|
304
|
+
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
305
|
+
previousSelectedElementIds: {
|
|
306
|
+
[id: string]: true;
|
|
307
|
+
};
|
|
308
|
+
selectedElementsAreBeingDragged: boolean;
|
|
309
|
+
toast: {
|
|
310
|
+
message: string;
|
|
311
|
+
closable?: boolean;
|
|
312
|
+
duration?: number;
|
|
313
|
+
} | null;
|
|
314
|
+
gridStep: number;
|
|
315
|
+
gridModeEnabled: boolean;
|
|
316
|
+
fileHandle: FileSystemHandle | null;
|
|
317
|
+
stats: {
|
|
318
|
+
open: boolean;
|
|
319
|
+
panels: number;
|
|
320
|
+
};
|
|
321
|
+
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
322
|
+
pasteDialog: {
|
|
323
|
+
shown: false;
|
|
324
|
+
data: null;
|
|
325
|
+
} | {
|
|
326
|
+
shown: true;
|
|
327
|
+
data: import("../charts").Spreadsheet;
|
|
328
|
+
};
|
|
329
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
330
|
+
originSnapOffset: {
|
|
331
|
+
x: number;
|
|
332
|
+
y: number;
|
|
333
|
+
} | null;
|
|
334
|
+
objectsSnapModeEnabled: boolean;
|
|
335
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
336
|
+
followedBy: Set<import("../types").SocketId>;
|
|
337
|
+
lockedMultiSelections: {
|
|
338
|
+
[groupId: string]: true;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
files: import("../types").BinaryFiles;
|
|
342
|
+
}>;
|
|
31
343
|
export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
|
|
32
344
|
export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
|
|
33
345
|
export declare const canvasToBlob: (canvas: HTMLCanvasElement | Promise<HTMLCanvasElement>) => Promise<Blob>;
|
|
@@ -7,7 +7,163 @@ export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appSta
|
|
|
7
7
|
name?: string) => Promise<{
|
|
8
8
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
9
9
|
}>;
|
|
10
|
-
export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<
|
|
10
|
+
export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<{
|
|
11
|
+
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
12
|
+
appState: {
|
|
13
|
+
viewBackgroundColor: string;
|
|
14
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
15
|
+
frameRendering: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
name: boolean;
|
|
18
|
+
outline: boolean;
|
|
19
|
+
clip: boolean;
|
|
20
|
+
};
|
|
21
|
+
name: string | null;
|
|
22
|
+
zoom: import("../types").Zoom;
|
|
23
|
+
scrollX: number;
|
|
24
|
+
scrollY: number;
|
|
25
|
+
hideAnnotations: boolean;
|
|
26
|
+
viewModeEnabled: boolean;
|
|
27
|
+
openDialog: null | {
|
|
28
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
29
|
+
} | {
|
|
30
|
+
name: "ttd";
|
|
31
|
+
tab: "text-to-diagram" | "mermaid";
|
|
32
|
+
} | {
|
|
33
|
+
name: "commandPalette";
|
|
34
|
+
} | {
|
|
35
|
+
name: "settings";
|
|
36
|
+
} | {
|
|
37
|
+
name: "elementLinkSelector";
|
|
38
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
39
|
+
};
|
|
40
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
41
|
+
selectedElementIds: Readonly<{
|
|
42
|
+
[id: string]: true;
|
|
43
|
+
}>;
|
|
44
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
45
|
+
activeEmbeddable: {
|
|
46
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
47
|
+
state: "hover" | "active";
|
|
48
|
+
} | null;
|
|
49
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
50
|
+
selectedGroupIds: {
|
|
51
|
+
[groupId: string]: boolean;
|
|
52
|
+
};
|
|
53
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
54
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
55
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
56
|
+
isBindingEnabled: boolean;
|
|
57
|
+
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
58
|
+
isRotating: boolean;
|
|
59
|
+
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
60
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
61
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
62
|
+
zenModeEnabled: boolean;
|
|
63
|
+
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
64
|
+
isCropping: boolean;
|
|
65
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
66
|
+
searchMatches: Readonly<{
|
|
67
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
68
|
+
matches: readonly import("../types").SearchMatch[];
|
|
69
|
+
}> | null;
|
|
70
|
+
activeLockedId: string | null;
|
|
71
|
+
hoveredElementIds: Readonly<{
|
|
72
|
+
[id: string]: true;
|
|
73
|
+
}>;
|
|
74
|
+
shouldCacheIgnoreZoom: boolean;
|
|
75
|
+
exportScale: number;
|
|
76
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
77
|
+
gridSize: number;
|
|
78
|
+
contextMenu: {
|
|
79
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
80
|
+
top: number;
|
|
81
|
+
left: number;
|
|
82
|
+
} | null;
|
|
83
|
+
showWelcomeScreen: boolean;
|
|
84
|
+
isLoading: boolean;
|
|
85
|
+
errorMessage: React.ReactNode;
|
|
86
|
+
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
87
|
+
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
88
|
+
editingFrame: string | null;
|
|
89
|
+
activeTool: {
|
|
90
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
91
|
+
locked: boolean;
|
|
92
|
+
fromSelection: boolean;
|
|
93
|
+
} & import("../types").ActiveTool;
|
|
94
|
+
preferredSelectionTool: {
|
|
95
|
+
type: "selection" | "lasso";
|
|
96
|
+
initialized: boolean;
|
|
97
|
+
};
|
|
98
|
+
penMode: boolean;
|
|
99
|
+
penDetected: boolean;
|
|
100
|
+
exportBackground: boolean;
|
|
101
|
+
exportEmbedScene: boolean;
|
|
102
|
+
exportWithDarkMode: boolean;
|
|
103
|
+
currentItemStrokeColor: string;
|
|
104
|
+
currentItemBackgroundColor: string;
|
|
105
|
+
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
106
|
+
currentItemStrokeWidth: number;
|
|
107
|
+
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
108
|
+
currentItemRoughness: number;
|
|
109
|
+
currentItemOpacity: number;
|
|
110
|
+
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
111
|
+
currentItemFontSize: number;
|
|
112
|
+
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
113
|
+
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
114
|
+
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
115
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
116
|
+
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
117
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
118
|
+
cursorButton: "up" | "down";
|
|
119
|
+
scrolledOutside: boolean;
|
|
120
|
+
isResizing: boolean;
|
|
121
|
+
openMenu: "canvas" | null;
|
|
122
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
123
|
+
openSidebar: {
|
|
124
|
+
name: import("../types").SidebarName;
|
|
125
|
+
tab?: import("../types").SidebarTabName;
|
|
126
|
+
} | null;
|
|
127
|
+
defaultSidebarDockedPreference: boolean;
|
|
128
|
+
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
129
|
+
previousSelectedElementIds: {
|
|
130
|
+
[id: string]: true;
|
|
131
|
+
};
|
|
132
|
+
selectedElementsAreBeingDragged: boolean;
|
|
133
|
+
toast: {
|
|
134
|
+
message: string;
|
|
135
|
+
closable?: boolean;
|
|
136
|
+
duration?: number;
|
|
137
|
+
} | null;
|
|
138
|
+
gridStep: number;
|
|
139
|
+
gridModeEnabled: boolean;
|
|
140
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
141
|
+
stats: {
|
|
142
|
+
open: boolean;
|
|
143
|
+
panels: number;
|
|
144
|
+
};
|
|
145
|
+
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
146
|
+
pasteDialog: {
|
|
147
|
+
shown: false;
|
|
148
|
+
data: null;
|
|
149
|
+
} | {
|
|
150
|
+
shown: true;
|
|
151
|
+
data: import("../charts").Spreadsheet;
|
|
152
|
+
};
|
|
153
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
154
|
+
originSnapOffset: {
|
|
155
|
+
x: number;
|
|
156
|
+
y: number;
|
|
157
|
+
} | null;
|
|
158
|
+
objectsSnapModeEnabled: boolean;
|
|
159
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
160
|
+
followedBy: Set<import("../types").SocketId>;
|
|
161
|
+
lockedMultiSelections: {
|
|
162
|
+
[groupId: string]: true;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
files: BinaryFiles;
|
|
166
|
+
}>;
|
|
11
167
|
export declare const isValidExcalidrawData: (data?: {
|
|
12
168
|
type?: any;
|
|
13
169
|
elements?: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CombineBrandsIfNeeded } from "@excalidraw/common";
|
|
1
2
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawSelectionElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
3
|
import type { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
4
|
import type { ImportedDataState } from "./types";
|
|
@@ -8,28 +9,33 @@ export type RestoredDataState = {
|
|
|
8
9
|
appState: RestoredAppState;
|
|
9
10
|
files: BinaryFiles;
|
|
10
11
|
};
|
|
11
|
-
export declare const restoreElement: (
|
|
12
|
+
export declare const restoreElement: (
|
|
13
|
+
/** element to be restored */
|
|
14
|
+
element: Exclude<ExcalidrawElement, ExcalidrawSelectionElement>,
|
|
15
|
+
/** all elements to be restored */
|
|
16
|
+
targetElementsMap: Readonly<ElementsMap>,
|
|
17
|
+
/** used for additional context */
|
|
18
|
+
existingElementsMap: Readonly<ElementsMap> | null | undefined, opts?: {
|
|
12
19
|
deleteInvisibleElements?: boolean;
|
|
13
20
|
}) => typeof element | null;
|
|
14
|
-
export declare const restoreElements: (targetElements:
|
|
15
|
-
/**
|
|
16
|
-
|
|
21
|
+
export declare const restoreElements: <T extends ExcalidrawElement>(targetElements: readonly T[] | undefined | null,
|
|
22
|
+
/** used for additional context (e.g. repairing arrow bindings) */
|
|
23
|
+
existingElements: Readonly<ElementsMapOrArray> | null | undefined, opts?: {
|
|
17
24
|
refreshDimensions?: boolean;
|
|
18
25
|
repairBindings?: boolean;
|
|
19
26
|
deleteInvisibleElements?: boolean;
|
|
20
|
-
} | undefined) => OrderedExcalidrawElement
|
|
21
|
-
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
22
|
-
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null,
|
|
27
|
+
} | undefined) => CombineBrandsIfNeeded<T, OrderedExcalidrawElement>;
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
29
|
+
* When replacing elements that may exist locally, this bumps their versions
|
|
30
|
+
* to the local version + 1. Mainly for later reconciliation to work properly.
|
|
31
|
+
*
|
|
32
|
+
* See https://github.com/excalidraw/excalidraw/issues/3795
|
|
33
|
+
*
|
|
34
|
+
* Generally use this on editor boundaries (importing from file etc.), though
|
|
35
|
+
* it does not apply universally (e.g. we don't want to do this for collab
|
|
36
|
+
* updates).
|
|
28
37
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
repairBindings?: boolean;
|
|
32
|
-
deleteInvisibleElements?: boolean;
|
|
33
|
-
}) => RestoredDataState;
|
|
38
|
+
export declare const bumpElementVersions: <T extends ExcalidrawElement>(targetElements: readonly T[], localElements: Readonly<ElementsMapOrArray> | null | undefined) => T[];
|
|
39
|
+
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
34
40
|
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
|
35
41
|
export {};
|
|
@@ -12,12 +12,11 @@ export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements
|
|
|
12
12
|
export { getTextFromElements } from "@excalidraw/element";
|
|
13
13
|
export { isInvisiblySmallElement } from "@excalidraw/element";
|
|
14
14
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
15
|
-
export {
|
|
15
|
+
export { restoreAppState, restoreElement, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
16
16
|
export { reconcileElements } from "./data/reconcile";
|
|
17
17
|
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
|
|
18
18
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
19
19
|
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
20
|
-
export { getFreeDrawSvgPath } from "@excalidraw/element";
|
|
21
20
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
22
21
|
export { isLinearElement } from "@excalidraw/element";
|
|
23
22
|
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, getFormFactor, } from "@excalidraw/common";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { Scene } from "@excalidraw/element";
|
|
3
|
+
import type { RenderableElementsMap } from "./types";
|
|
3
4
|
import type { AppState } from "../types";
|
|
4
5
|
export declare class Renderer {
|
|
5
6
|
private scene;
|
|
@@ -21,7 +22,7 @@ export declare class Renderer {
|
|
|
21
22
|
sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
|
|
22
23
|
hideAnnotations: AppState["hideAnnotations"];
|
|
23
24
|
}) => {
|
|
24
|
-
elementsMap:
|
|
25
|
+
elementsMap: RenderableElementsMap;
|
|
25
26
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
26
27
|
}) & {
|
|
27
28
|
clear: () => void;
|
|
@@ -15,6 +15,7 @@ export type StaticCanvasRenderConfig = {
|
|
|
15
15
|
embedsValidationStatus: EmbedsValidationStatus;
|
|
16
16
|
elementsPendingErasure: ElementsPendingErasure;
|
|
17
17
|
pendingFlowchartNodes: PendingExcalidrawElements | null;
|
|
18
|
+
theme: AppState["theme"];
|
|
18
19
|
};
|
|
19
20
|
export type SVGRenderConfig = {
|
|
20
21
|
offsetX: number;
|
|
@@ -32,6 +33,7 @@ export type SVGRenderConfig = {
|
|
|
32
33
|
* @default true
|
|
33
34
|
*/
|
|
34
35
|
reuseImages: boolean;
|
|
36
|
+
theme: AppState["theme"];
|
|
35
37
|
};
|
|
36
38
|
export type InteractiveCanvasRenderConfig = {
|
|
37
39
|
remoteSelectedElementIds: Map<ExcalidrawElement["id"], SocketId[]>;
|
|
@@ -115,14 +117,17 @@ export type ScrollBars = {
|
|
|
115
117
|
deltaMultiplier: number;
|
|
116
118
|
} | null;
|
|
117
119
|
};
|
|
118
|
-
export type
|
|
120
|
+
export type SVGPathString = string & {
|
|
121
|
+
__brand: "SVGPathString";
|
|
122
|
+
};
|
|
123
|
+
export type ElementShape = Drawable | Drawable[] | Path2D | (Drawable | SVGPathString)[] | null;
|
|
119
124
|
export type ElementShapes = {
|
|
120
125
|
rectangle: Drawable;
|
|
121
126
|
ellipse: Drawable;
|
|
122
127
|
diamond: Drawable;
|
|
123
128
|
iframe: Drawable;
|
|
124
129
|
embeddable: Drawable;
|
|
125
|
-
freedraw: Drawable |
|
|
130
|
+
freedraw: (Drawable | SVGPathString)[];
|
|
126
131
|
arrow: Drawable[];
|
|
127
132
|
line: Drawable[];
|
|
128
133
|
text: null;
|
|
@@ -13,9 +13,7 @@ export declare function rangeInclusive(start: number, end: number): InclusiveRan
|
|
|
13
13
|
* @param pair The number pair to convert to an inclusive range
|
|
14
14
|
* @returns The new inclusive range
|
|
15
15
|
*/
|
|
16
|
-
export declare function rangeInclusiveFromPair(pair: [start: number, end: number]):
|
|
17
|
-
_brand: "excalimath_degree";
|
|
18
|
-
};
|
|
16
|
+
export declare function rangeInclusiveFromPair(pair: [start: number, end: number]): InclusiveRange;
|
|
19
17
|
/**
|
|
20
18
|
* Given two ranges, return if the two ranges overlap with each other e.g.
|
|
21
19
|
* [1, 3] overlaps with [2, 4] while [1, 3] does not overlap with [4, 5].
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildmio/excalidraw-math",
|
|
3
|
-
"version": "0.18.0-custom.
|
|
3
|
+
"version": "0.18.0-custom.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/math/src/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"last 1 safari version"
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
|
-
"bugs": "https://github.com/
|
|
58
|
-
"repository": "https://github.com/
|
|
57
|
+
"bugs": "https://github.com/wildMio/excalidraw/issues",
|
|
58
|
+
"repository": "https://github.com/wildMio/excalidraw",
|
|
59
59
|
"scripts": {
|
|
60
60
|
"gen:types": "rimraf types && tsc",
|
|
61
61
|
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@excalidraw/common": "0.18.0"
|
|
64
|
+
"@excalidraw/common": "0.18.0-custom.8"
|
|
65
65
|
}
|
|
66
66
|
}
|