@excalidraw/excalidraw 0.18.0-195a743 → 0.18.0-298812e
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/dev/{chunk-T3M44BFV.js → chunk-JCUIYZXF.js} +7 -3
- package/dist/dev/chunk-JCUIYZXF.js.map +7 -0
- package/dist/dev/{chunk-WMGEUIQQ.js → chunk-RQWTCZLD.js} +2 -2
- package/dist/dev/{chunk-H3EW23X2.js → chunk-ZPGIVNNG.js} +14840 -9652
- package/dist/dev/chunk-ZPGIVNNG.js.map +7 -0
- package/dist/dev/data/{image-TTQKTTOH.js → image-CB4ZYE3A.js} +3 -3
- package/dist/dev/index.css +38 -2
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +857 -5250
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-I23TB6DJ.js → en-ZDTPSZNL.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-GK4XUKZB.js → chunk-7TMLMBQX.js} +1 -1
- package/dist/prod/{chunk-2Z7RPVPO.js → chunk-GCFVWREF.js} +3 -3
- package/dist/prod/chunk-WFJFO6F4.js +33 -0
- package/dist/prod/data/image-XJI4SWH2.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +18 -18
- package/dist/prod/locales/{en-TC3OFDA6.js → en-MHZ26NAR.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +1 -0
- package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/common/src/font-metadata.d.ts +4 -2
- package/dist/types/common/src/index.d.ts +1 -0
- package/dist/types/common/src/utility-types.d.ts +5 -0
- package/dist/types/common/src/utils.d.ts +16 -4
- package/dist/types/element/src/Scene.d.ts +4 -4
- package/dist/types/element/src/ShapeCache.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +1 -1
- package/dist/types/element/src/binding.d.ts +1 -1
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +40 -35
- package/dist/types/element/src/dragElements.d.ts +1 -1
- package/dist/types/element/src/flowchart.d.ts +1 -1
- package/dist/types/element/src/frame.d.ts +3 -2
- package/dist/types/element/src/index.d.ts +45 -2
- package/dist/types/element/src/linearElementEditor.d.ts +4 -8
- package/dist/types/element/src/newElement.d.ts +1 -1
- package/dist/types/element/src/resizeElements.d.ts +1 -1
- package/dist/types/element/src/selection.d.ts +1 -6
- package/dist/types/element/src/store.d.ts +227 -0
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/transformHandles.d.ts +4 -4
- package/dist/types/element/src/typeChecks.d.ts +2 -1
- package/dist/types/element/src/types.d.ts +6 -1
- package/dist/types/element/src/zindex.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +24 -42
- package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +16 -28
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +194 -272
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +50 -86
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +8 -14
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +22 -40
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +8 -14
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +18 -30
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +8 -14
- package/dist/types/excalidraw/actions/actionExport.d.ts +159 -213
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +14 -26
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +76 -100
- package/dist/types/excalidraw/actions/actionGroup.d.ts +22 -34
- package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +7 -13
- package/dist/types/excalidraw/actions/actionLink.d.ts +9 -15
- package/dist/types/excalidraw/actions/actionMenu.d.ts +26 -44
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +16 -28
- package/dist/types/excalidraw/actions/actionProperties.d.ts +106 -196
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -18
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -189
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionZindex.d.ts +10 -10
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +23 -23
- package/dist/types/excalidraw/components/App.d.ts +9 -9
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -28
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/utils.d.ts +2 -1
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -1
- package/dist/types/excalidraw/components/icons.d.ts +1 -0
- package/dist/types/excalidraw/components/shapes.d.ts +1 -1
- package/dist/types/excalidraw/data/blob.d.ts +1 -1
- package/dist/types/excalidraw/data/transform.d.ts +1 -1
- package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/dist/types/excalidraw/history.d.ts +14 -22
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +9 -9
- package/dist/types/excalidraw/lasso/index.d.ts +1 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +6 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -1
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/snapping.d.ts +2 -2
- package/dist/types/excalidraw/types.d.ts +13 -6
- package/dist/types/excalidraw/visualdebug.d.ts +1 -1
- package/dist/types/math/src/curve.d.ts +2 -0
- package/dist/types/math/src/vector.d.ts +4 -0
- package/dist/types/utils/src/bbox.d.ts +1 -1
- package/dist/types/utils/src/index.d.ts +1 -1
- package/dist/types/utils/src/withinBounds.d.ts +1 -1
- package/history.ts +68 -94
- package/package.json +3 -3
- package/dist/dev/chunk-H3EW23X2.js.map +0 -7
- package/dist/dev/chunk-T3M44BFV.js.map +0 -7
- package/dist/prod/chunk-7M43VNIB.js +0 -33
- package/dist/prod/data/image-7YYIWLVQ.js +0 -1
- package/dist/types/excalidraw/store.d.ts +0 -129
- /package/dist/dev/{chunk-WMGEUIQQ.js.map → chunk-RQWTCZLD.js.map} +0 -0
- /package/dist/dev/data/{image-TTQKTTOH.js.map → image-CB4ZYE3A.js.map} +0 -0
- /package/dist/dev/locales/{en-I23TB6DJ.js.map → en-ZDTPSZNL.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,H,I,J,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-
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,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-GCFVWREF.js";import"../chunk-SRAX5OIU.js";export{f as alerts,e as buttons,l as canvasError,s as clearCanvasDialog,C as colorPicker,A as colors,I as commandPalette,v as confirmDialog,J as default,i as element,b as elementLink,x as encrypted,p as errorDialog,m as errorSplash,g as errors,q as exportDialog,G as fontList,j as headings,r as helpDialog,k as hints,w as imageExportDialog,a as labels,c as library,E as mermaid,D as overwriteConfirm,t as publishDialog,u as publishSuccessDialog,F as quickSearch,o as roomDialog,d as search,n as shareDialog,y as stats,z as toast,h as toolBar,H as userList,B as welcomeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-LS7FJGPW.js";import"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-LS7FJGPW.js";import"./chunk-7TMLMBQX.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-LS7FJGPW.js";import"./chunk-
|
|
1
|
+
import{a as r,c as t}from"./chunk-LS7FJGPW.js";import"./chunk-7TMLMBQX.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UnsubscribeCallback } from "
|
|
1
|
+
import type { UnsubscribeCallback } from "@excalidraw/excalidraw/types";
|
|
2
2
|
type Subscriber<T extends any[]> = (...payload: T) => void;
|
|
3
3
|
export declare class Emitter<T extends any[] = []> {
|
|
4
4
|
subscribers: Subscriber<T>[];
|
|
@@ -16,8 +16,10 @@ export interface FontMetadata {
|
|
|
16
16
|
};
|
|
17
17
|
/** flag to indicate a deprecated font */
|
|
18
18
|
deprecated?: true;
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* whether this is a font that users can use (= shown in font picker)
|
|
21
|
+
*/
|
|
22
|
+
private?: true;
|
|
21
23
|
/** flag to indiccate a local-only font */
|
|
22
24
|
local?: true;
|
|
23
25
|
/** flag to indicate a fallback font */
|
|
@@ -31,3 +31,8 @@ export type MakeBrand<T extends string> = {
|
|
|
31
31
|
/** Maybe just promise or already fulfilled one! */
|
|
32
32
|
export type MaybePromise<T> = T | Promise<T>;
|
|
33
33
|
export type AllPossibleKeys<T> = T extends any ? keyof T : never;
|
|
34
|
+
/** Strip all the methods or functions from a type */
|
|
35
|
+
export type DTO<T> = {
|
|
36
|
+
[K in keyof T as T[K] extends Function ? never : K]: T[K];
|
|
37
|
+
};
|
|
38
|
+
export type MapEntry<M extends Map<any, any>> = M extends Map<infer K, infer V> ? [K, V] : never;
|
|
@@ -7,9 +7,9 @@ export declare const setDateTimeForTests: (dateTime: string) => void;
|
|
|
7
7
|
export declare const getDateTime: () => string;
|
|
8
8
|
export declare const capitalizeString: (str: string) => string;
|
|
9
9
|
export declare const isToolIcon: (target: Element | EventTarget | null) => target is HTMLElement;
|
|
10
|
-
export declare const isInputLike: (target: Element | EventTarget | null) => target is
|
|
10
|
+
export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLSelectElement | HTMLBRElement | HTMLDivElement | HTMLTextAreaElement;
|
|
11
11
|
export declare const isInteractive: (target: Element | EventTarget | null) => boolean;
|
|
12
|
-
export declare const isWritableElement: (target: Element | EventTarget | null) => target is
|
|
12
|
+
export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLBRElement | HTMLDivElement | HTMLTextAreaElement;
|
|
13
13
|
export declare const getFontFamilyString: ({ fontFamily, }: {
|
|
14
14
|
fontFamily: FontFamilyValues;
|
|
15
15
|
}) => string;
|
|
@@ -138,6 +138,8 @@ export declare const tupleToCoors: (xyTuple: readonly [number, number]) => {
|
|
|
138
138
|
export declare const muteFSAbortError: (error?: Error) => void;
|
|
139
139
|
export declare const findIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
|
|
140
140
|
export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
|
|
141
|
+
/** returns the first non-null mapped value */
|
|
142
|
+
export declare const mapFind: <T, K>(collection: readonly T[], iteratee: (value: T, index: number) => K | null | undefined) => K | undefined;
|
|
141
143
|
export declare const isTransparent: (color: string) => boolean;
|
|
142
144
|
export declare const isBindingFallthroughEnabled: (el: ExcalidrawBindableElement) => boolean;
|
|
143
145
|
export type ResolvablePromise<T> = Promise<T> & {
|
|
@@ -178,6 +180,15 @@ export type Node<T> = T & {
|
|
|
178
180
|
* Creates a circular doubly linked list by adding `prev` and `next` props to the existing array nodes.
|
|
179
181
|
*/
|
|
180
182
|
export declare const arrayToList: <T>(array: readonly T[]) => Node<T>[];
|
|
183
|
+
/**
|
|
184
|
+
* Converts a readonly array or map into an iterable.
|
|
185
|
+
* Useful for avoiding entry allocations when iterating object / map on each iteration.
|
|
186
|
+
*/
|
|
187
|
+
export declare const toIterable: <T>(values: ReadonlyMap<string, T> | readonly T[]) => Iterable<T>;
|
|
188
|
+
/**
|
|
189
|
+
* Converts a readonly array or map into an array.
|
|
190
|
+
*/
|
|
191
|
+
export declare const toArray: <T>(values: ReadonlyMap<string, T> | readonly T[]) => T[];
|
|
181
192
|
export declare const isTestEnv: () => boolean;
|
|
182
193
|
export declare const isDevEnv: () => boolean;
|
|
183
194
|
export declare const isProdEnv: () => boolean;
|
|
@@ -187,7 +198,7 @@ export declare const wrapEvent: <T extends Event>(name: EVENT, nativeEvent: T) =
|
|
|
187
198
|
}>;
|
|
188
199
|
export declare const updateObject: <T extends Record<string, any>>(obj: T, updates: Partial<T>) => T;
|
|
189
200
|
export declare const isPrimitive: (val: any) => boolean;
|
|
190
|
-
export declare const getFrame: () => "
|
|
201
|
+
export declare const getFrame: () => "top" | "iframe";
|
|
191
202
|
export declare const isRunningInIframe: () => boolean;
|
|
192
203
|
export declare const isPromiseLike: (value: any) => value is Promise<any>;
|
|
193
204
|
export declare const queryFocusableElements: (container: HTMLElement | null) => HTMLElement[];
|
|
@@ -253,5 +264,6 @@ export declare const castArray: <T>(value: T | T[]) => T[];
|
|
|
253
264
|
export declare const elementCenterPoint: (element: ExcalidrawElement, xOffset?: number, yOffset?: number) => GlobalPoint;
|
|
254
265
|
/** hack for Array.isArray type guard not working with readonly value[] */
|
|
255
266
|
export declare const isReadonlyArray: (value?: any) => value is readonly any[];
|
|
256
|
-
export declare const sizeOf: (value: readonly
|
|
267
|
+
export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
|
|
268
|
+
export declare const reduceToCommonValue: <T, R = T>(collection: ReadonlySet<T> | readonly T[], getValue?: ((item: T) => R) | undefined) => R | null;
|
|
257
269
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type ElementUpdate } from "@excalidraw/element
|
|
1
|
+
import { type ElementUpdate } from "@excalidraw/element";
|
|
2
2
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, 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;
|
|
6
6
|
type SceneStateCallbackRemover = () => void;
|
|
7
7
|
export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[];
|
|
8
|
-
declare class Scene {
|
|
8
|
+
export declare class Scene {
|
|
9
9
|
private callbacks;
|
|
10
10
|
private nonDeletedElements;
|
|
11
11
|
private nonDeletedElementsMap;
|
|
@@ -66,11 +66,11 @@ declare class Scene {
|
|
|
66
66
|
getElementIndex(elementId: string): number;
|
|
67
67
|
getContainerElement: (element: (ExcalidrawElement & {
|
|
68
68
|
containerId: ExcalidrawElement["id"] | null;
|
|
69
|
-
}) | null) => import("@excalidraw/element/types").
|
|
69
|
+
}) | null) => import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | null;
|
|
70
70
|
getElementsFromId: (id: string) => ExcalidrawElement[];
|
|
71
71
|
mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
|
|
72
72
|
informMutation: boolean;
|
|
73
73
|
isDragging: boolean;
|
|
74
74
|
}): TElement;
|
|
75
75
|
}
|
|
76
|
-
export
|
|
76
|
+
export {};
|
|
@@ -17,7 +17,7 @@ export declare class ShapeCache {
|
|
|
17
17
|
* Generates & caches shape for element if not already cached, otherwise
|
|
18
18
|
* returns cached shape.
|
|
19
19
|
*/
|
|
20
|
-
static generateElementShape: <T extends import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").
|
|
20
|
+
static generateElementShape: <T extends import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawArrowElement | import("./types").ExcalidrawFreeDrawElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawEmbeddableElement>(element: T, renderConfig: {
|
|
21
21
|
isExporting: boolean;
|
|
22
22
|
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
23
23
|
embedsValidationStatus: EmbedsValidationStatus;
|
|
@@ -2,7 +2,7 @@ import { type GlobalPoint } from "@excalidraw/math";
|
|
|
2
2
|
import type { LocalPoint } from "@excalidraw/math";
|
|
3
3
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
4
4
|
import { type Heading } from "./heading";
|
|
5
|
-
import type Scene from "./Scene";
|
|
5
|
+
import type { Scene } from "./Scene";
|
|
6
6
|
import type { Bounds } from "./bounds";
|
|
7
7
|
import type { ElementUpdate } from "./mutateElement";
|
|
8
8
|
import type { ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, ExcalidrawLinearElement, NonDeletedExcalidrawElement, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, FixedPoint } from "./types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Degrees, GlobalPoint, LineSegment } from "@excalidraw/math";
|
|
2
2
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
3
|
-
import type { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, ExcalidrawFreeDrawElement, NonDeleted, ElementsMap, ElementsMapOrArray } from "./types";
|
|
4
3
|
import type { Drawable, Op } from "roughjs/bin/core";
|
|
4
|
+
import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, NonDeleted } from "./types";
|
|
5
5
|
export type RectangleBox = {
|
|
6
6
|
x: number;
|
|
7
7
|
y: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ElementUpdate } from "@excalidraw/element/mutateElement";
|
|
2
1
|
import type { ExcalidrawElement, Ordered, OrderedExcalidrawElement, SceneElementsMap } from "@excalidraw/element/types";
|
|
3
|
-
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
4
|
-
import type { AppState, ObservedAppState } from "
|
|
2
|
+
import type { DTO, ValueOf } from "@excalidraw/common/utility-types";
|
|
3
|
+
import type { AppState, ObservedAppState } from "@excalidraw/excalidraw/types";
|
|
4
|
+
import type { ElementUpdate } from "./mutateElement";
|
|
5
5
|
/**
|
|
6
6
|
* Represents the difference between two objects of the same type.
|
|
7
7
|
*
|
|
@@ -11,7 +11,7 @@ import type { AppState, ObservedAppState } from "./types";
|
|
|
11
11
|
*
|
|
12
12
|
* Keeping it as pure object (without transient state, side-effects, etc.), so we won't have to instantiate it on load.
|
|
13
13
|
*/
|
|
14
|
-
declare class Delta<T> {
|
|
14
|
+
export declare class Delta<T> {
|
|
15
15
|
readonly deleted: Partial<T>;
|
|
16
16
|
readonly inserted: Partial<T>;
|
|
17
17
|
private constructor();
|
|
@@ -56,11 +56,11 @@ declare class Delta<T> {
|
|
|
56
56
|
*/
|
|
57
57
|
static isRightDifferent<T extends {}>(object1: T, object2: T, skipShallowCompare?: boolean): boolean;
|
|
58
58
|
/**
|
|
59
|
-
* Returns
|
|
59
|
+
* Returns sorted object1 keys that have distinct values.
|
|
60
60
|
*/
|
|
61
61
|
static getLeftDifferences<T extends {}>(object1: T, object2: T, skipShallowCompare?: boolean): string[];
|
|
62
62
|
/**
|
|
63
|
-
* Returns
|
|
63
|
+
* Returns sorted object2 keys that have distinct values.
|
|
64
64
|
*/
|
|
65
65
|
static getRightDifferences<T extends {}>(object1: T, object2: T, skipShallowCompare?: boolean): string[];
|
|
66
66
|
/**
|
|
@@ -73,37 +73,33 @@ declare class Delta<T> {
|
|
|
73
73
|
private static distinctKeysIterator;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
|
-
* Encapsulates
|
|
76
|
+
* Encapsulates a set of application-level `Delta`s.
|
|
77
77
|
*/
|
|
78
|
-
interface
|
|
78
|
+
export interface DeltaContainer<T> {
|
|
79
79
|
/**
|
|
80
|
-
* Inverses the `Delta`s
|
|
80
|
+
* Inverses the `Delta`s while creating a new `DeltaContainer` instance.
|
|
81
81
|
*/
|
|
82
|
-
inverse():
|
|
82
|
+
inverse(): DeltaContainer<T>;
|
|
83
83
|
/**
|
|
84
|
-
* Applies the `
|
|
84
|
+
* Applies the `Delta`s to the previous object.
|
|
85
85
|
*
|
|
86
|
-
* @returns a tuple of the next object `T` with applied
|
|
86
|
+
* @returns a tuple of the next object `T` with applied `Delta`s, and `boolean`, indicating whether the applied deltas resulted in a visible change.
|
|
87
87
|
*/
|
|
88
88
|
applyTo(previous: T, ...options: unknown[]): [T, boolean];
|
|
89
89
|
/**
|
|
90
|
-
* Checks whether
|
|
90
|
+
* Checks whether all `Delta`s are empty.
|
|
91
91
|
*/
|
|
92
92
|
isEmpty(): boolean;
|
|
93
93
|
}
|
|
94
|
-
export declare class
|
|
95
|
-
|
|
94
|
+
export declare class AppStateDelta implements DeltaContainer<AppState> {
|
|
95
|
+
readonly delta: Delta<ObservedAppState>;
|
|
96
96
|
private constructor();
|
|
97
|
-
static calculate<T extends ObservedAppState>(prevAppState: T, nextAppState: T):
|
|
98
|
-
static
|
|
99
|
-
|
|
97
|
+
static calculate<T extends ObservedAppState>(prevAppState: T, nextAppState: T): AppStateDelta;
|
|
98
|
+
static restore(appStateDeltaDTO: DTO<AppStateDelta>): AppStateDelta;
|
|
99
|
+
static empty(): AppStateDelta;
|
|
100
|
+
inverse(): AppStateDelta;
|
|
100
101
|
applyTo(appState: AppState, nextElements: SceneElementsMap): [AppState, boolean];
|
|
101
102
|
isEmpty(): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* It is necessary to post process the partials in case of reference values,
|
|
104
|
-
* for which we need to calculate the real diff between `deleted` and `inserted`.
|
|
105
|
-
*/
|
|
106
|
-
private static postProcess;
|
|
107
103
|
/**
|
|
108
104
|
* Mutates `nextAppState` be filtering out state related to deleted elements.
|
|
109
105
|
*
|
|
@@ -115,20 +111,27 @@ export declare class AppStateChange implements Change<AppState> {
|
|
|
115
111
|
private static filterSelectedGroups;
|
|
116
112
|
private static stripElementsProps;
|
|
117
113
|
private static stripStandaloneProps;
|
|
114
|
+
/**
|
|
115
|
+
* It is necessary to post process the partials in case of reference values,
|
|
116
|
+
* for which we need to calculate the real diff between `deleted` and `inserted`.
|
|
117
|
+
*/
|
|
118
|
+
private static postProcess;
|
|
119
|
+
private static orderAppStateKeys;
|
|
118
120
|
}
|
|
119
121
|
type ElementPartial<T extends ExcalidrawElement = ExcalidrawElement> = Omit<ElementUpdate<Ordered<T>>, "seed">;
|
|
120
122
|
/**
|
|
121
123
|
* Elements change is a low level primitive to capture a change between two sets of elements.
|
|
122
124
|
* It does so by encapsulating forward and backward `Delta`s, allowing to time-travel in both directions.
|
|
123
125
|
*/
|
|
124
|
-
export declare class
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
|
|
127
|
+
readonly added: Record<string, Delta<ElementPartial>>;
|
|
128
|
+
readonly removed: Record<string, Delta<ElementPartial>>;
|
|
129
|
+
readonly updated: Record<string, Delta<ElementPartial>>;
|
|
128
130
|
private constructor();
|
|
129
|
-
static create(added:
|
|
131
|
+
static create(added: Record<string, Delta<ElementPartial>>, removed: Record<string, Delta<ElementPartial>>, updated: Record<string, Delta<ElementPartial>>, options?: {
|
|
130
132
|
shouldRedistribute: boolean;
|
|
131
|
-
}):
|
|
133
|
+
}): ElementsDelta;
|
|
134
|
+
static restore(elementsDeltaDTO: DTO<ElementsDelta>): ElementsDelta;
|
|
132
135
|
private static satisfiesAddition;
|
|
133
136
|
private static satisfiesRemoval;
|
|
134
137
|
private static satisfiesUpdate;
|
|
@@ -139,11 +142,11 @@ export declare class ElementsChange implements Change<SceneElementsMap> {
|
|
|
139
142
|
* @param prevElements - Map representing the previous state of elements.
|
|
140
143
|
* @param nextElements - Map representing the next state of elements.
|
|
141
144
|
*
|
|
142
|
-
* @returns `
|
|
145
|
+
* @returns `ElementsDelta` instance representing the `Delta` changes between the two sets of elements.
|
|
143
146
|
*/
|
|
144
|
-
static calculate<T extends OrderedExcalidrawElement>(prevElements: Map<string, T>, nextElements: Map<string, T>):
|
|
145
|
-
static empty():
|
|
146
|
-
inverse():
|
|
147
|
+
static calculate<T extends OrderedExcalidrawElement>(prevElements: Map<string, T>, nextElements: Map<string, T>): ElementsDelta;
|
|
148
|
+
static empty(): ElementsDelta;
|
|
149
|
+
inverse(): ElementsDelta;
|
|
147
150
|
isEmpty(): boolean;
|
|
148
151
|
/**
|
|
149
152
|
* Update delta/s based on the existing elements.
|
|
@@ -152,8 +155,8 @@ export declare class ElementsChange implements Change<SceneElementsMap> {
|
|
|
152
155
|
* @param modifierOptions defines which of the delta (`deleted` or `inserted`) will be updated
|
|
153
156
|
* @returns new instance with modified delta/s
|
|
154
157
|
*/
|
|
155
|
-
applyLatestChanges(elements: SceneElementsMap):
|
|
156
|
-
applyTo(elements: SceneElementsMap,
|
|
158
|
+
applyLatestChanges(elements: SceneElementsMap, modifierOptions: "deleted" | "inserted"): ElementsDelta;
|
|
159
|
+
applyTo(elements: SceneElementsMap, elementsSnapshot: Map<string, OrderedExcalidrawElement>): [SceneElementsMap, boolean];
|
|
157
160
|
private static createApplier;
|
|
158
161
|
private static createGetter;
|
|
159
162
|
private static applyDelta;
|
|
@@ -165,6 +168,8 @@ export declare class ElementsChange implements Change<SceneElementsMap> {
|
|
|
165
168
|
* Resolves conflicts for all previously added, removed and updated elements.
|
|
166
169
|
* Updates the previous deltas with all the changes after conflict resolution.
|
|
167
170
|
*
|
|
171
|
+
* // TODO: revisit since some bound arrows seem to be often redrawn incorrectly
|
|
172
|
+
*
|
|
168
173
|
* @returns all elements affected by the conflict resolution
|
|
169
174
|
*/
|
|
170
175
|
private resolveConflicts;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppState, NormalizedZoomValue, NullableGridSize, PointerDownState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
-
import type Scene from "./Scene";
|
|
3
|
+
import type { Scene } from "./Scene";
|
|
4
4
|
export declare const dragSelectedElements: (pointerDownState: PointerDownState, _selectedElements: NonDeletedExcalidrawElement[], offset: {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppState, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import { type ElementsMap, type ExcalidrawBindableElement, type ExcalidrawElement, type ExcalidrawFlowchartNodeElement } from "./types";
|
|
3
|
-
import type Scene from "./Scene";
|
|
3
|
+
import type { Scene } from "./Scene";
|
|
4
4
|
type LinkDirection = "up" | "right" | "down" | "left";
|
|
5
5
|
export declare const getLinkDirectionFromKey: (key: string) => LinkDirection;
|
|
6
6
|
export declare const getPredecessors: (node: ExcalidrawBindableElement, elementsMap: ElementsMap, direction: LinkDirection) => ExcalidrawBindableElement[];
|
|
@@ -31,8 +31,8 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const getRootElements: (allElements: ExcalidrawElementsIncludingDeleted) => ExcalidrawElement[];
|
|
33
33
|
export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
|
|
34
|
-
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").
|
|
35
|
-
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").
|
|
34
|
+
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawFreeDrawElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawEmbeddableElement)[];
|
|
35
|
+
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawFreeDrawElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawEmbeddableElement)[];
|
|
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[];
|
|
@@ -64,6 +64,7 @@ export declare const isElementInFrame: (element: ExcalidrawElement, allElementsM
|
|
|
64
64
|
checkedGroups?: Map<string, boolean>;
|
|
65
65
|
}) => boolean;
|
|
66
66
|
export declare const shouldApplyFrameClip: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, appState: StaticCanvasAppState, elementsMap: ElementsMap, checkedGroups?: Map<string, boolean>) => boolean;
|
|
67
|
+
export declare const getDefaultFrameName: (element: ExcalidrawFrameLikeElement) => "Frame" | "AI Frame";
|
|
67
68
|
export declare const getFrameLikeTitle: (element: ExcalidrawFrameLikeElement) => string;
|
|
68
69
|
export declare const getElementsOverlappingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => NonDeletedExcalidrawElement[];
|
|
69
70
|
export declare const frameAndChildrenSelectedTogether: (selectedElements: readonly ExcalidrawElement[]) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted } from "./types";
|
|
1
|
+
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ElementsMapOrArray } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated unsafe, use hashElementsVersion instead
|
|
4
4
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const getSceneVersion: (elements: readonly ExcalidrawElement[]) =
|
|
|
6
6
|
/**
|
|
7
7
|
* Hashes elements' versionNonce (using djb2 algo). Order of elements matters.
|
|
8
8
|
*/
|
|
9
|
-
export declare const hashElementsVersion: (elements:
|
|
9
|
+
export declare const hashElementsVersion: (elements: ElementsMapOrArray) => number;
|
|
10
10
|
export declare const hashString: (s: string) => number;
|
|
11
11
|
export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
|
|
12
12
|
export declare const getNonDeletedElements: <T extends ExcalidrawElement>(elements: readonly T[]) => readonly NonDeleted<T>[];
|
|
@@ -14,3 +14,46 @@ export declare const isNonDeletedElement: <T extends ExcalidrawElement>(element:
|
|
|
14
14
|
export declare const clearElementsForDatabase: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
15
15
|
export declare const clearElementsForExport: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
16
16
|
export declare const clearElementsForLocalStorage: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
17
|
+
export * from "./align";
|
|
18
|
+
export * from "./binding";
|
|
19
|
+
export * from "./bounds";
|
|
20
|
+
export * from "./collision";
|
|
21
|
+
export * from "./comparisons";
|
|
22
|
+
export * from "./containerCache";
|
|
23
|
+
export * from "./cropElement";
|
|
24
|
+
export * from "./delta";
|
|
25
|
+
export * from "./distance";
|
|
26
|
+
export * from "./distribute";
|
|
27
|
+
export * from "./dragElements";
|
|
28
|
+
export * from "./duplicate";
|
|
29
|
+
export * from "./elbowArrow";
|
|
30
|
+
export * from "./elementLink";
|
|
31
|
+
export * from "./embeddable";
|
|
32
|
+
export * from "./flowchart";
|
|
33
|
+
export * from "./fractionalIndex";
|
|
34
|
+
export * from "./frame";
|
|
35
|
+
export * from "./groups";
|
|
36
|
+
export * from "./heading";
|
|
37
|
+
export * from "./image";
|
|
38
|
+
export * from "./linearElementEditor";
|
|
39
|
+
export * from "./mutateElement";
|
|
40
|
+
export * from "./newElement";
|
|
41
|
+
export * from "./renderElement";
|
|
42
|
+
export * from "./resizeElements";
|
|
43
|
+
export * from "./resizeTest";
|
|
44
|
+
export * from "./Scene";
|
|
45
|
+
export * from "./selection";
|
|
46
|
+
export * from "./Shape";
|
|
47
|
+
export * from "./ShapeCache";
|
|
48
|
+
export * from "./shapes";
|
|
49
|
+
export * from "./showSelectedShapeActions";
|
|
50
|
+
export * from "./sizeHelpers";
|
|
51
|
+
export * from "./sortElements";
|
|
52
|
+
export * from "./store";
|
|
53
|
+
export * from "./textElement";
|
|
54
|
+
export * from "./textMeasurements";
|
|
55
|
+
export * from "./textWrapping";
|
|
56
|
+
export * from "./transformHandles";
|
|
57
|
+
export * from "./typeChecks";
|
|
58
|
+
export * from "./utils";
|
|
59
|
+
export * from "./zindex";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
3
|
-
import type { Store } from "@excalidraw/
|
|
3
|
+
import type { Store } from "@excalidraw/element";
|
|
4
4
|
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "@excalidraw/excalidraw/types";
|
|
5
|
-
import type Scene from "./Scene";
|
|
5
|
+
import type { Scene } from "./Scene";
|
|
6
6
|
import type { Bounds } from "./bounds";
|
|
7
|
-
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement } from "./types";
|
|
7
|
+
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, PointsPositionUpdates } from "./types";
|
|
8
8
|
declare const editorMidPointsCache: {
|
|
9
9
|
version: number | null;
|
|
10
10
|
points: (GlobalPoint | null)[];
|
|
@@ -103,11 +103,7 @@ export declare class LinearElementEditor {
|
|
|
103
103
|
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, targetPoints: {
|
|
104
104
|
point: LocalPoint;
|
|
105
105
|
}[]): void;
|
|
106
|
-
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene,
|
|
107
|
-
index: number;
|
|
108
|
-
point: LocalPoint;
|
|
109
|
-
isDragging?: boolean;
|
|
110
|
-
}[], otherUpdates?: {
|
|
106
|
+
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, pointUpdates: PointsPositionUpdates, otherUpdates?: {
|
|
111
107
|
startBinding?: PointBinding | null;
|
|
112
108
|
endBinding?: PointBinding | null;
|
|
113
109
|
}): void;
|
|
@@ -51,7 +51,7 @@ export declare const newArrowElement: <T extends boolean>(opts: {
|
|
|
51
51
|
points?: readonly import("@excalidraw/math").LocalPoint[] | undefined;
|
|
52
52
|
elbowed?: T | undefined;
|
|
53
53
|
fixedSegments?: readonly import("./types").FixedSegment[] | null | undefined;
|
|
54
|
-
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "
|
|
54
|
+
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData"> & Partial<Pick<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData">>) => T extends true ? NonDeleted<ExcalidrawElbowArrowElement> : NonDeleted<ExcalidrawArrowElement>;
|
|
55
55
|
export declare const newImageElement: (opts: {
|
|
56
56
|
type: ExcalidrawImageElement["type"];
|
|
57
57
|
status?: ExcalidrawImageElement["status"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LocalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { PointerDownState } from "@excalidraw/excalidraw/types";
|
|
3
|
-
import type Scene from "./Scene";
|
|
3
|
+
import type { Scene } from "./Scene";
|
|
4
4
|
import type { BoundingBox } from "./bounds";
|
|
5
5
|
import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
|
|
6
6
|
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap } from "./types";
|
|
@@ -14,11 +14,6 @@ export declare const isSomeElementSelected: {
|
|
|
14
14
|
(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">): boolean;
|
|
15
15
|
clearCache(): void;
|
|
16
16
|
};
|
|
17
|
-
/**
|
|
18
|
-
* Returns common attribute (picked by `getAttribute` callback) of selected
|
|
19
|
-
* elements. If elements don't share the same value, returns `null`.
|
|
20
|
-
*/
|
|
21
|
-
export declare const getCommonAttributeOfSelectedElements: <T>(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">, getAttribute: (element: ExcalidrawElement) => T) => T | null;
|
|
22
17
|
export declare const getSelectedElements: (elements: ElementsMapOrArray, appState: Pick<InteractiveCanvasAppState, "selectedElementIds">, opts?: {
|
|
23
18
|
includeBoundTextElement?: boolean;
|
|
24
19
|
includeElementsInFrames?: boolean;
|
|
@@ -32,12 +27,12 @@ export declare const makeNextSelectedElementIds: (nextSelectedElementIds: AppSta
|
|
|
32
27
|
[id: string]: true;
|
|
33
28
|
}>;
|
|
34
29
|
export declare const getSelectionStateForElements: (targetElements: readonly ExcalidrawElement[], allElements: readonly NonDeletedExcalidrawElement[], appState: AppState) => {
|
|
35
|
-
editingGroupId: string | null;
|
|
36
30
|
selectedElementIds: Readonly<{
|
|
37
31
|
[id: string]: true;
|
|
38
32
|
}>;
|
|
39
33
|
selectedGroupIds: {
|
|
40
34
|
[groupId: string]: boolean;
|
|
41
35
|
};
|
|
36
|
+
editingGroupId: string | null;
|
|
42
37
|
selectedLinearElement: LinearElementEditor | null;
|
|
43
38
|
};
|