@dwelle/excalidraw 0.5.0-ef89e88 → 0.5.0-efddbb7
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 +81 -0
- package/README.md +111 -14
- package/dist/dev/{chunk-UPL5GSGP.js → chunk-AVAC6BVM.js} +11 -2
- package/dist/dev/chunk-AVAC6BVM.js.map +7 -0
- package/dist/dev/{chunk-VLJRILK3.js → chunk-OKDHCI5V.js} +1844 -1440
- package/dist/dev/chunk-OKDHCI5V.js.map +7 -0
- package/dist/dev/{chunk-H5SL5I5R.js → chunk-UEBEBUE2.js} +2 -2
- package/dist/dev/components/TTDDialog/{CodeMirrorEditor-65RQRK4A.js → CodeMirrorEditor-2YIEAZU7.js} +2 -2
- package/dist/dev/data/{image-JR54FB4B.js → image-O7OJXMIJ.js} +3 -3
- package/dist/dev/index.css +85 -43
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +2939 -2010
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-IZ5JJCQN.js → en-XVKSJYG2.js} +4 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-5EYFVTC7.js +34 -0
- package/dist/prod/{chunk-MYTKOPOQ.js → chunk-T6UH5ZKV.js} +5 -5
- package/dist/prod/{chunk-B47HEJUH.js → chunk-Y6NXDCR7.js} +1 -1
- package/dist/prod/components/TTDDialog/{CodeMirrorEditor-B64TEOC3.js → CodeMirrorEditor-JV2LT6ZS.js} +1 -1
- package/dist/prod/data/image-XRO5552B.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +28 -28
- package/dist/prod/locales/en-BNQNBQ43.js +1 -0
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/index.d.ts +2 -0
- package/dist/types/common/src/utils.d.ts +1 -3
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +5 -3
- package/dist/types/element/src/bounds.d.ts +4 -2
- package/dist/types/element/src/duplicate.d.ts +1 -0
- package/dist/types/element/src/frame.d.ts +7 -6
- package/dist/types/element/src/linearElementEditor.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +2 -2
- package/dist/types/element/src/shape.d.ts +1 -1
- package/dist/types/element/src/typeChecks.d.ts +1 -0
- package/dist/types/element/src/utils.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +30 -30
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +9 -9
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionExport.d.ts +48 -323
- package/dist/types/excalidraw/actions/actionFrame.d.ts +12 -12
- package/dist/types/excalidraw/actions/actionGroup.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionLink.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionMenu.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionProperties.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +3 -3
- package/dist/types/excalidraw/actions/index.d.ts +1 -0
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +1 -0
- package/dist/types/excalidraw/clipboard.d.ts +2 -3
- package/dist/types/excalidraw/components/App.d.ts +41 -10
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +1 -1
- package/dist/types/excalidraw/components/Toast.d.ts +8 -4
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
- package/dist/types/excalidraw/components/shapes.d.ts +7 -0
- package/dist/types/excalidraw/data/blob.d.ts +13 -14
- package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
- package/dist/types/excalidraw/data/index.d.ts +2 -3
- package/dist/types/excalidraw/data/json.d.ts +21 -13
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/index.d.ts +23 -3
- package/dist/types/excalidraw/scene/Renderer.d.ts +425 -19
- package/dist/types/excalidraw/types.d.ts +76 -5
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +4 -1
- package/package.json +4 -5
- package/dist/dev/chunk-UPL5GSGP.js.map +0 -7
- package/dist/dev/chunk-VLJRILK3.js.map +0 -7
- package/dist/prod/chunk-ZTGTHG3M.js +0 -34
- package/dist/prod/data/image-I4FBW6ZT.js +0 -1
- package/dist/prod/locales/en-4R6EP6SP.js +0 -1
- package/dist/types/utils/src/index.d.ts +0 -4
- /package/dist/dev/{chunk-H5SL5I5R.js.map → chunk-UEBEBUE2.js.map} +0 -0
- /package/dist/dev/components/TTDDialog/{CodeMirrorEditor-65RQRK4A.js.map → CodeMirrorEditor-2YIEAZU7.js.map} +0 -0
- /package/dist/dev/data/{image-JR54FB4B.js.map → image-O7OJXMIJ.js.map} +0 -0
- /package/dist/dev/locales/{en-IZ5JJCQN.js.map → en-XVKSJYG2.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-T6UH5ZKV.js";import"../chunk-SRAX5OIU.js";export{f as alerts,e as buttons,l as canvasError,H as chat,t as clearCanvasDialog,D as colorPicker,B as colors,L as commandPalette,w as confirmDialog,N as default,i as element,b as elementLink,y as encrypted,p as errorDialog,m as errorSplash,g as errors,r as exportDialog,J as fontList,j as headings,s as helpDialog,k as hints,x as imageExportDialog,M as keys,a as labels,c as library,F as mermaid,E as overwriteConfirm,q as progressDialog,u as publishDialog,v as publishSuccessDialog,I as quickSearch,o as roomDialog,d as search,n as shareDialog,z as stats,A as toast,h as toolBar,G as ttd,K as userList,C as welcomeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-Y6NXDCR7.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-Y6NXDCR7.js";import"./chunk-SRAX5OIU.js";var s=import.meta.url?new URL(import.meta.url):void 0;typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{switch(e.data.command){case r.Subset:let a=await t(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]});break}});export{s as WorkerUrl};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UnsubscribeCallback } from "@excalidraw/excalidraw/types";
|
|
2
|
+
export type AppEventPayloadMap = Record<string, unknown[]>;
|
|
3
|
+
export type AppEventBehavior = {
|
|
4
|
+
cardinality: "once" | "many";
|
|
5
|
+
replay: "none" | "last";
|
|
6
|
+
};
|
|
7
|
+
export type AppEventBehaviorMap<Events extends AppEventPayloadMap> = {
|
|
8
|
+
[K in keyof Events]: AppEventBehavior;
|
|
9
|
+
};
|
|
10
|
+
type AwaitableAppEventKeys<Events extends AppEventPayloadMap, Behavior extends AppEventBehaviorMap<Events>> = {
|
|
11
|
+
[K in keyof Events]: Behavior[K]["cardinality"] extends "once" ? Behavior[K]["replay"] extends "last" ? K : never : never;
|
|
12
|
+
}[keyof Events];
|
|
13
|
+
type AppEventPromiseValue<Args extends any[]> = Args extends [infer Only] ? Only : Args;
|
|
14
|
+
export declare class AppEventBus<Events extends AppEventPayloadMap, Behavior extends AppEventBehaviorMap<Events>> {
|
|
15
|
+
private readonly behavior;
|
|
16
|
+
private readonly emitters;
|
|
17
|
+
private readonly lastPayload;
|
|
18
|
+
private readonly emittedOnce;
|
|
19
|
+
constructor(behavior: Behavior);
|
|
20
|
+
private getEmitter;
|
|
21
|
+
private toPromiseValue;
|
|
22
|
+
on<K extends keyof Events>(name: K, callback: (...args: Events[K]) => void): UnsubscribeCallback;
|
|
23
|
+
on<K extends AwaitableAppEventKeys<Events, Behavior>>(name: K): Promise<AppEventPromiseValue<Events[K]>>;
|
|
24
|
+
emit<K extends keyof Events>(name: K, ...args: Events[K]): void;
|
|
25
|
+
clear(): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -11,5 +11,7 @@ export * from "./random";
|
|
|
11
11
|
export * from "./url";
|
|
12
12
|
export * from "./utils";
|
|
13
13
|
export * from "./emitter";
|
|
14
|
+
export * from "./appEventBus";
|
|
14
15
|
export * from "./editorInterface";
|
|
16
|
+
export * from "./versionedSnapshotStore";
|
|
15
17
|
export { Debug } from "../debug";
|
|
@@ -25,9 +25,7 @@ export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeo
|
|
|
25
25
|
flush(): void;
|
|
26
26
|
cancel(): void;
|
|
27
27
|
};
|
|
28
|
-
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void
|
|
29
|
-
trailing?: boolean;
|
|
30
|
-
}) => {
|
|
28
|
+
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void) => {
|
|
31
29
|
(...args: T): void;
|
|
32
30
|
flush(): void;
|
|
33
31
|
cancel(): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type VersionedSnapshot<T> = Readonly<{
|
|
2
|
+
version: number;
|
|
3
|
+
value: T;
|
|
4
|
+
}>;
|
|
5
|
+
export declare class VersionedSnapshotStore<T> {
|
|
6
|
+
private readonly isEqual;
|
|
7
|
+
private version;
|
|
8
|
+
private value;
|
|
9
|
+
private readonly waiters;
|
|
10
|
+
private readonly subscribers;
|
|
11
|
+
constructor(initialValue: T, isEqual?: (prev: T, next: T) => boolean);
|
|
12
|
+
getSnapshot(): VersionedSnapshot<T>;
|
|
13
|
+
set(nextValue: T): boolean;
|
|
14
|
+
update(updater: (prev: T) => T): boolean;
|
|
15
|
+
subscribe(subscriber: (snapshot: VersionedSnapshot<T>) => void): () => void;
|
|
16
|
+
pull(sinceVersion?: number): Promise<VersionedSnapshot<T>>;
|
|
17
|
+
}
|
|
@@ -63,10 +63,12 @@ export declare class Scene {
|
|
|
63
63
|
triggerUpdate(): void;
|
|
64
64
|
onUpdate(cb: SceneStateCallback): SceneStateCallbackRemover;
|
|
65
65
|
destroy(): void;
|
|
66
|
-
|
|
67
|
-
insertElementsAtIndex(elements: ExcalidrawElement[],
|
|
66
|
+
/** low-level - generally use app.insertNewElements() */
|
|
67
|
+
insertElementsAtIndex(elements: ExcalidrawElement[],
|
|
68
|
+
/** null indicates end of the array */
|
|
69
|
+
index: number | null): void;
|
|
70
|
+
/** low-level - generally use app.insertNewElement() */
|
|
68
71
|
insertElement: (element: ExcalidrawElement) => void;
|
|
69
|
-
insertElements: (elements: ExcalidrawElement[]) => void;
|
|
70
72
|
getElementIndex(elementId: string): number;
|
|
71
73
|
getContainerElement: (element: (ExcalidrawElement & {
|
|
72
74
|
containerId: ExcalidrawElement["id"] | null;
|
|
@@ -2,7 +2,7 @@ import { type Bounds } from "@excalidraw/common";
|
|
|
2
2
|
import type { Degrees, GlobalPoint, LineSegment, LocalPoint } from "@excalidraw/math";
|
|
3
3
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
4
4
|
import type { Drawable, Op } from "roughjs/bin/core";
|
|
5
|
-
import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement,
|
|
5
|
+
import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./types";
|
|
6
6
|
export type RectangleBox = {
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
@@ -38,7 +38,7 @@ export declare const getRectangleBoxAbsoluteCoords: (boxSceneCoords: RectangleBo
|
|
|
38
38
|
export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
|
|
39
39
|
export declare const getCubicBezierCurveBound: (p0: GlobalPoint, p1: GlobalPoint, p2: GlobalPoint, p3: GlobalPoint) => Bounds;
|
|
40
40
|
export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: (p: GlobalPoint) => GlobalPoint) => Bounds;
|
|
41
|
-
export declare const getBoundsFromPoints: (points:
|
|
41
|
+
export declare const getBoundsFromPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], padding?: number) => Bounds;
|
|
42
42
|
/** @returns number in pixels */
|
|
43
43
|
export declare const getArrowheadSize: (arrowhead: Arrowhead) => number;
|
|
44
44
|
/** @returns number in degrees */
|
|
@@ -77,5 +77,7 @@ export declare const getCenterForBounds: (bounds: Bounds) => GlobalPoint;
|
|
|
77
77
|
*/
|
|
78
78
|
export declare const aabbForElement: (element: Readonly<ExcalidrawElement>, elementsMap: ElementsMap, offset?: [number, number, number, number]) => Bounds;
|
|
79
79
|
export declare const pointInsideBounds: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
|
|
80
|
+
export declare const pointInsideBoundsInclusive: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
|
|
80
81
|
export declare const doBoundsIntersect: (bounds1: Bounds | null, bounds2: Bounds | null) => boolean;
|
|
82
|
+
export declare const boundsContainBounds: (outerBounds: Bounds, innerBounds: Bounds) => boolean;
|
|
81
83
|
export declare const elementCenterPoint: (element: ExcalidrawElement, elementsMap: ElementsMap, xOffset?: number, yOffset?: number) => GlobalPoint;
|
|
@@ -36,17 +36,18 @@ export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: E
|
|
|
36
36
|
export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
|
|
37
37
|
/** */
|
|
38
38
|
export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
|
|
39
|
+
export declare const getCommonFrameId: (elements: readonly ExcalidrawElement[]) => string | null;
|
|
40
|
+
export declare const getFrameChildrenInsertionIndex: (elements: readonly ExcalidrawElement[], frameId: ExcalidrawFrameLikeElement["id"]) => number | null;
|
|
39
41
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* [el, el, child, child, frame, el]
|
|
42
|
+
* Adds elements and their bound elements to frame. Reorders added elements to
|
|
43
|
+
* be just below frame, or just above its highest child (whichever is higher).
|
|
43
44
|
*
|
|
44
45
|
* @returns mutated allElements (same data structure)
|
|
45
46
|
*/
|
|
46
|
-
export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd: NonDeletedExcalidrawElement[], frame: ExcalidrawFrameLikeElement
|
|
47
|
+
export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd: NonDeletedExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => T;
|
|
47
48
|
export declare const removeElementsFromFrame: (elementsToRemove: ReadonlySetLike<NonDeletedExcalidrawElement>, elementsMap: ElementsMap) => void;
|
|
48
49
|
export declare const removeAllElementsFromFrame: <T extends ExcalidrawElement>(allElements: readonly T[], frame: ExcalidrawFrameLikeElement) => readonly T[];
|
|
49
|
-
export declare const replaceAllElementsInFrame: <T extends ExcalidrawElement>(allElements: readonly T[], nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement
|
|
50
|
+
export declare const replaceAllElementsInFrame: <T extends ExcalidrawElement>(allElements: readonly T[], nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => T[];
|
|
50
51
|
/** does not mutate elements, but returns new ones */
|
|
51
52
|
export declare const updateFrameMembershipOfSelectedElements: <T extends ElementsMapOrArray>(allElements: T, appState: AppState, app: AppClassProperties) => T;
|
|
52
53
|
/**
|
|
@@ -70,5 +71,5 @@ export declare const isElementInFrame: (element: ExcalidrawElement, allElementsM
|
|
|
70
71
|
export declare const shouldApplyFrameClip: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, appState: StaticCanvasAppState, elementsMap: ElementsMap, checkedGroups?: Map<string, boolean>) => boolean;
|
|
71
72
|
export declare const getDefaultFrameName: (element: ExcalidrawFrameLikeElement) => "Frame" | "AI Frame";
|
|
72
73
|
export declare const getFrameLikeTitle: (element: ExcalidrawFrameLikeElement) => string;
|
|
73
|
-
export declare const getElementsOverlappingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) =>
|
|
74
|
+
export declare const getElementsOverlappingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => ExcalidrawElement[];
|
|
74
75
|
export declare const frameAndChildrenSelectedTogether: (selectedElements: readonly ExcalidrawElement[]) => boolean;
|
|
@@ -55,8 +55,8 @@ export declare class LinearElementEditor {
|
|
|
55
55
|
x: number;
|
|
56
56
|
y: number;
|
|
57
57
|
}, appState: AppState, elementsMap: ElementsMap) => GlobalPoint | null;
|
|
58
|
-
static isSegmentTooShort<P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, startPoint: P, endPoint: P, index: number, zoom: Zoom): boolean;
|
|
59
|
-
static getSegmentMidPoint(element: NonDeleted<ExcalidrawLinearElement>, index: number): GlobalPoint;
|
|
58
|
+
static isSegmentTooShort<P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, startPoint: P, endPoint: P, index: number, zoom: Zoom, elementsMap: ElementsMap): boolean;
|
|
59
|
+
static getSegmentMidPoint(element: NonDeleted<ExcalidrawLinearElement>, index: number, elementsMap: ElementsMap): GlobalPoint;
|
|
60
60
|
static getSegmentMidPointIndex(linearElementEditor: LinearElementEditor, appState: AppState, midPoint: GlobalPoint, elementsMap: ElementsMap): number;
|
|
61
61
|
static handlePointerDown(event: React.PointerEvent<HTMLElement>, app: AppClassProperties, store: Store, scenePointer: {
|
|
62
62
|
x: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppState, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
1
|
+
import type { AppState, BoxSelectionMode, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import { LinearElementEditor } from "./linearElementEditor";
|
|
3
3
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
|
|
4
4
|
/**
|
|
@@ -8,7 +8,7 @@ import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeleted, No
|
|
|
8
8
|
* @param selectedElements
|
|
9
9
|
*/
|
|
10
10
|
export declare const excludeElementsInFramesFromSelection: <T extends ExcalidrawElement>(selectedElements: readonly T[]) => T[];
|
|
11
|
-
export declare const getElementsWithinSelection: (elements: readonly NonDeletedExcalidrawElement[], selection: NonDeletedExcalidrawElement, elementsMap: ElementsMap, excludeElementsInFrames?: boolean) => NonDeletedExcalidrawElement[];
|
|
11
|
+
export declare const getElementsWithinSelection: (elements: readonly NonDeletedExcalidrawElement[], selection: NonDeletedExcalidrawElement, elementsMap: ElementsMap, excludeElementsInFrames?: boolean, boxSelectionMode?: BoxSelectionMode) => NonDeletedExcalidrawElement[];
|
|
12
12
|
export declare const getVisibleAndNonSelectedElements: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: readonly NonDeletedExcalidrawElement[], appState: AppState, elementsMap: ElementsMap) => NonDeletedExcalidrawElement[];
|
|
13
13
|
export declare const isSomeElementSelected: {
|
|
14
14
|
(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">): boolean;
|
|
@@ -27,7 +27,7 @@ export declare class ShapeCache {
|
|
|
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
29
|
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean, isDarkMode?: boolean) => Options;
|
|
30
|
-
export declare const generateLinearCollisionShape: (element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement) => {
|
|
30
|
+
export declare const generateLinearCollisionShape: (element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement, elementsMap: ElementsMap) => {
|
|
31
31
|
op: string;
|
|
32
32
|
data: number[];
|
|
33
33
|
}[];
|
|
@@ -52,3 +52,4 @@ export declare const getLinearElementSubType: (element: ExcalidrawLinearElement)
|
|
|
52
52
|
*/
|
|
53
53
|
export declare const isValidPolygon: (points: ExcalidrawLineElement["points"]) => boolean;
|
|
54
54
|
export declare const canBecomePolygon: (points: ExcalidrawLineElement["points"]) => boolean;
|
|
55
|
+
export declare const isEligibleFrameChildType: (type: ElementOrToolType) => boolean;
|
|
@@ -8,7 +8,7 @@ import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, Ex
|
|
|
8
8
|
* @param element The linear element to deconstruct
|
|
9
9
|
* @returns The rotated in components.
|
|
10
10
|
*/
|
|
11
|
-
export declare function deconstructLinearOrFreeDrawElement(element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
|
|
11
|
+
export declare function deconstructLinearOrFreeDrawElement(element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement, elementsMap: ElementsMap): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
|
|
12
12
|
/**
|
|
13
13
|
* Get the building components of a rectanguloid element in the form of
|
|
14
14
|
* line segments and curves **unrotated**.
|
|
@@ -26,9 +26,9 @@ export declare const actionAddToLibrary: {
|
|
|
26
26
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
27
27
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
28
28
|
isBindingEnabled: boolean;
|
|
29
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
29
30
|
bindingPreference: "enabled" | "disabled";
|
|
30
31
|
isMidpointSnappingEnabled: boolean;
|
|
31
|
-
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
32
32
|
suggestedBinding: {
|
|
33
33
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
34
34
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
@@ -132,7 +132,7 @@ export declare const actionAddToLibrary: {
|
|
|
132
132
|
height: number;
|
|
133
133
|
offsetTop: number;
|
|
134
134
|
offsetLeft: number;
|
|
135
|
-
fileHandle:
|
|
135
|
+
fileHandle: FileSystemFileHandle | null;
|
|
136
136
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
137
137
|
stats: {
|
|
138
138
|
open: boolean;
|
|
@@ -181,9 +181,9 @@ export declare const actionAddToLibrary: {
|
|
|
181
181
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
182
182
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
183
183
|
isBindingEnabled: boolean;
|
|
184
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
184
185
|
bindingPreference: "enabled" | "disabled";
|
|
185
186
|
isMidpointSnappingEnabled: boolean;
|
|
186
|
-
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
187
187
|
suggestedBinding: {
|
|
188
188
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
189
189
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
@@ -274,7 +274,7 @@ export declare const actionAddToLibrary: {
|
|
|
274
274
|
selectedElementsAreBeingDragged: boolean;
|
|
275
275
|
shouldCacheIgnoreZoom: boolean;
|
|
276
276
|
toast: {
|
|
277
|
-
message:
|
|
277
|
+
message: React.ReactNode;
|
|
278
278
|
closable?: boolean;
|
|
279
279
|
duration?: number;
|
|
280
280
|
} | null;
|
|
@@ -292,7 +292,7 @@ export declare const actionAddToLibrary: {
|
|
|
292
292
|
height: number;
|
|
293
293
|
offsetTop: number;
|
|
294
294
|
offsetLeft: number;
|
|
295
|
-
fileHandle:
|
|
295
|
+
fileHandle: FileSystemFileHandle | null;
|
|
296
296
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
297
297
|
stats: {
|
|
298
298
|
open: boolean;
|
|
@@ -341,9 +341,9 @@ export declare const actionAddToLibrary: {
|
|
|
341
341
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
342
342
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
343
343
|
isBindingEnabled: boolean;
|
|
344
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
344
345
|
bindingPreference: "enabled" | "disabled";
|
|
345
346
|
isMidpointSnappingEnabled: boolean;
|
|
346
|
-
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
347
347
|
suggestedBinding: {
|
|
348
348
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
349
349
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
@@ -434,7 +434,7 @@ export declare const actionAddToLibrary: {
|
|
|
434
434
|
selectedElementsAreBeingDragged: boolean;
|
|
435
435
|
shouldCacheIgnoreZoom: boolean;
|
|
436
436
|
toast: {
|
|
437
|
-
message:
|
|
437
|
+
message: React.ReactNode;
|
|
438
438
|
closable?: boolean;
|
|
439
439
|
duration?: number;
|
|
440
440
|
} | null;
|
|
@@ -452,7 +452,7 @@ export declare const actionAddToLibrary: {
|
|
|
452
452
|
height: number;
|
|
453
453
|
offsetTop: number;
|
|
454
454
|
offsetLeft: number;
|
|
455
|
-
fileHandle:
|
|
455
|
+
fileHandle: FileSystemFileHandle | null;
|
|
456
456
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
457
457
|
stats: {
|
|
458
458
|
open: boolean;
|
|
@@ -46,9 +46,9 @@ export declare const actionBindText: {
|
|
|
46
46
|
multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
47
47
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
48
48
|
isBindingEnabled: boolean;
|
|
49
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
49
50
|
bindingPreference: "enabled" | "disabled";
|
|
50
51
|
isMidpointSnappingEnabled: boolean;
|
|
51
|
-
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
52
52
|
suggestedBinding: {
|
|
53
53
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
54
54
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
@@ -136,7 +136,7 @@ export declare const actionBindText: {
|
|
|
136
136
|
selectedElementsAreBeingDragged: boolean;
|
|
137
137
|
shouldCacheIgnoreZoom: boolean;
|
|
138
138
|
toast: {
|
|
139
|
-
message:
|
|
139
|
+
message: React.ReactNode;
|
|
140
140
|
closable?: boolean;
|
|
141
141
|
duration?: number;
|
|
142
142
|
} | null;
|
|
@@ -154,7 +154,7 @@ export declare const actionBindText: {
|
|
|
154
154
|
height: number;
|
|
155
155
|
offsetTop: number;
|
|
156
156
|
offsetLeft: number;
|
|
157
|
-
fileHandle:
|
|
157
|
+
fileHandle: FileSystemFileHandle | null;
|
|
158
158
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
159
159
|
stats: {
|
|
160
160
|
open: boolean;
|
|
@@ -218,9 +218,9 @@ export declare const actionWrapTextInContainer: {
|
|
|
218
218
|
multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
219
219
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
220
220
|
isBindingEnabled: boolean;
|
|
221
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
221
222
|
bindingPreference: "enabled" | "disabled";
|
|
222
223
|
isMidpointSnappingEnabled: boolean;
|
|
223
|
-
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
224
224
|
suggestedBinding: {
|
|
225
225
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
226
226
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
@@ -308,7 +308,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
308
308
|
selectedElementsAreBeingDragged: boolean;
|
|
309
309
|
shouldCacheIgnoreZoom: boolean;
|
|
310
310
|
toast: {
|
|
311
|
-
message:
|
|
311
|
+
message: React.ReactNode;
|
|
312
312
|
closable?: boolean;
|
|
313
313
|
duration?: number;
|
|
314
314
|
} | null;
|
|
@@ -326,7 +326,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
326
326
|
height: number;
|
|
327
327
|
offsetTop: number;
|
|
328
328
|
offsetLeft: number;
|
|
329
|
-
fileHandle:
|
|
329
|
+
fileHandle: FileSystemFileHandle | null;
|
|
330
330
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
331
331
|
stats: {
|
|
332
332
|
open: boolean;
|