@myoc/excalidraw 0.18.15 → 0.18.17
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-O7OUZ7ZJ.js → chunk-FQEIAL75.js} +14874 -9982
- package/dist/dev/chunk-FQEIAL75.js.map +7 -0
- package/dist/dev/{chunk-PEI7EPYO.js → chunk-KJKC5BJI.js} +10 -4
- package/dist/dev/chunk-KJKC5BJI.js.map +7 -0
- package/dist/dev/{chunk-DJKQZ4KD.js → chunk-XL2I4W52.js} +2 -2
- package/dist/dev/data/{image-NJWLICAS.js → image-WMF622SS.js} +3 -3
- package/dist/dev/index.css +69 -22
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +3104 -6547
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-R455UJTM.js → en-UQFCZXHO.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-NJOW7IOK.js → chunk-5JAQX5EH.js} +1 -1
- package/dist/prod/{chunk-KZWZ7WHC.js → chunk-EJLAYNAE.js} +4 -4
- package/dist/prod/chunk-LSNMPGNI.js +33 -0
- package/dist/prod/data/image-Z433FUMH.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +17 -16
- package/dist/prod/locales/{en-YWERZJD6.js → en-7EHYHCIL.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 +3 -1
- 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/{excalidraw/scene → element/src}/Scene.d.ts +11 -14
- package/dist/types/element/src/ShapeCache.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +3 -3
- package/dist/types/element/src/arrange.d.ts +2 -1
- package/dist/types/element/src/binding.d.ts +18 -10
- 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 +3 -2
- package/dist/types/element/src/elbowArrow.d.ts +1 -1
- package/dist/types/element/src/flowchart.d.ts +3 -2
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +4 -3
- package/dist/types/element/src/index.d.ts +45 -2
- package/dist/types/element/src/linearElementEditor.d.ts +14 -18
- package/dist/types/element/src/mutateElement.d.ts +10 -2
- package/dist/types/element/src/newElement.d.ts +3 -3
- package/dist/types/element/src/resizeElements.d.ts +4 -4
- package/dist/types/element/src/selection.d.ts +1 -6
- package/dist/types/element/src/shapes.d.ts +1 -1
- package/dist/types/element/src/sizeHelpers.d.ts +0 -1
- package/dist/types/element/src/store.d.ts +227 -0
- package/dist/types/element/src/textElement.d.ts +4 -3
- package/dist/types/element/src/typeChecks.d.ts +5 -1
- package/dist/types/element/src/types.d.ts +8 -0
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +30 -48
- package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionArrange.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +20 -32
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +139 -211
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +62 -98
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +28 -46
- 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 +10 -16
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +22 -34
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionExport.d.ts +184 -238
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +18 -30
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +84 -108
- package/dist/types/excalidraw/actions/actionGroup.d.ts +26 -38
- package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +9 -15
- package/dist/types/excalidraw/actions/actionLink.d.ts +10 -16
- package/dist/types/excalidraw/actions/actionMenu.d.ts +30 -48
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +19 -31
- package/dist/types/excalidraw/actions/actionProperties.d.ts +138 -228
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +12 -18
- package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +14 -20
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +12 -18
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +12 -18
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +12 -199
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +12 -18
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +12 -18
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -18
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/types.d.ts +3 -3
- package/dist/types/excalidraw/appState.d.ts +31 -31
- package/dist/types/excalidraw/components/App.d.ts +13 -8
- 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 +23 -0
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.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 +4 -11
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -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/editor-jotai.d.ts +6 -6
- 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 +16 -9
- package/dist/types/excalidraw/visualdebug.d.ts +1 -1
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -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 +5 -4
- package/dist/dev/chunk-O7OUZ7ZJ.js.map +0 -7
- package/dist/dev/chunk-PEI7EPYO.js.map +0 -7
- package/dist/prod/chunk-WGXUBJ4X.js +0 -33
- package/dist/prod/data/image-EKW6RBW7.js +0 -1
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/store.d.ts +0 -129
- /package/dist/dev/{chunk-DJKQZ4KD.js.map → chunk-XL2I4W52.js.map} +0 -0
- /package/dist/dev/data/{image-NJWLICAS.js.map → image-WMF622SS.js.map} +0 -0
- /package/dist/dev/locales/{en-R455UJTM.js.map → en-UQFCZXHO.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
3
|
-
import
|
|
4
|
-
import type { Store } from "@excalidraw/excalidraw/store";
|
|
3
|
+
import type { Store } from "@excalidraw/element";
|
|
5
4
|
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "@excalidraw/excalidraw/types";
|
|
5
|
+
import type { Scene } from "./Scene";
|
|
6
6
|
import type { Bounds } from "./bounds";
|
|
7
|
-
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap,
|
|
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)[];
|
|
@@ -43,7 +43,7 @@ export declare class LinearElementEditor {
|
|
|
43
43
|
readonly hoverPointIndex: number;
|
|
44
44
|
readonly segmentMidPointHoveredCoords: GlobalPoint | null;
|
|
45
45
|
readonly elbowed: boolean;
|
|
46
|
-
constructor(element: NonDeleted<ExcalidrawLinearElement
|
|
46
|
+
constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap);
|
|
47
47
|
static POINT_HANDLE_SIZE: number;
|
|
48
48
|
/**
|
|
49
49
|
* @param id the `elementId` from the instance of this class (so that we can
|
|
@@ -77,7 +77,7 @@ export declare class LinearElementEditor {
|
|
|
77
77
|
linearElementEditor: LinearElementEditor | null;
|
|
78
78
|
};
|
|
79
79
|
static arePointsEqual<Point extends LocalPoint | GlobalPoint>(point1: Point | null, point2: Point | null): boolean;
|
|
80
|
-
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties
|
|
80
|
+
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties): LinearElementEditor | null;
|
|
81
81
|
/** scene coords */
|
|
82
82
|
static getPointGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, p: LocalPoint, elementsMap: ElementsMap): GlobalPoint;
|
|
83
83
|
/** scene coords */
|
|
@@ -97,22 +97,18 @@ export declare class LinearElementEditor {
|
|
|
97
97
|
x: number;
|
|
98
98
|
y: number;
|
|
99
99
|
};
|
|
100
|
-
static normalizePoints(element: NonDeleted<ExcalidrawLinearElement
|
|
101
|
-
static duplicateSelectedPoints(appState: AppState,
|
|
102
|
-
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, pointIndices: readonly number[]): void;
|
|
103
|
-
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, targetPoints: {
|
|
100
|
+
static normalizePoints(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap): void;
|
|
101
|
+
static duplicateSelectedPoints(appState: AppState, scene: Scene): AppState;
|
|
102
|
+
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, pointIndices: readonly number[]): void;
|
|
103
|
+
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, targetPoints: {
|
|
104
104
|
point: LocalPoint;
|
|
105
105
|
}[]): void;
|
|
106
|
-
static movePoints(element: NonDeleted<ExcalidrawLinearElement>,
|
|
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;
|
|
114
110
|
static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
|
|
115
|
-
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean,
|
|
111
|
+
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
|
|
116
112
|
pointerDownState: LinearElementEditor["pointerDownState"];
|
|
117
113
|
selectedPointsIndices: LinearElementEditor["selectedPointsIndices"];
|
|
118
114
|
} | undefined;
|
|
@@ -124,7 +120,7 @@ export declare class LinearElementEditor {
|
|
|
124
120
|
};
|
|
125
121
|
static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, elementBounds: Bounds, boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
|
|
126
122
|
static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
127
|
-
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number,
|
|
128
|
-
static deleteFixedSegment(element: ExcalidrawElbowArrowElement, index: number): void;
|
|
123
|
+
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): LinearElementEditor;
|
|
124
|
+
static deleteFixedSegment(element: ExcalidrawElbowArrowElement, scene: Scene, index: number): void;
|
|
129
125
|
}
|
|
130
126
|
export {};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
2
|
-
import type { ExcalidrawElement } from "./types";
|
|
2
|
+
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
3
3
|
export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "version" | "versionNonce" | "updated">;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* This function tracks updates of text elements for the purposes for collaboration.
|
|
6
|
+
* The version is used to compare updates when more than one user is working in
|
|
7
|
+
* the same drawing.
|
|
8
|
+
*
|
|
9
|
+
* WARNING: this won't trigger the component to update, so if you need to trigger component update,
|
|
10
|
+
* use `scene.mutateElement` or `ExcalidrawImperativeAPI.mutateElement` instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, elementsMap: ElementsMap, updates: ElementUpdate<TElement>, options?: {
|
|
5
13
|
isDragging?: boolean;
|
|
6
14
|
}) => TElement;
|
|
7
15
|
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>, force?: boolean) => TElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
2
|
-
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement,
|
|
2
|
+
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement, ExcalidrawElbowArrowElement } from "./types";
|
|
3
3
|
export type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity" | "customData">;
|
|
4
4
|
export declare const newElement: (opts: {
|
|
5
5
|
type: ExcalidrawGenericElement["type"];
|
|
@@ -50,8 +50,8 @@ export declare const newArrowElement: <T extends boolean>(opts: {
|
|
|
50
50
|
endArrowhead?: Arrowhead | null | undefined;
|
|
51
51
|
points?: readonly import("@excalidraw/math").LocalPoint[] | undefined;
|
|
52
52
|
elbowed?: T | undefined;
|
|
53
|
-
fixedSegments?: FixedSegment[] | null | undefined;
|
|
54
|
-
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "
|
|
53
|
+
fixedSegments?: readonly import("./types").FixedSegment[] | null | undefined;
|
|
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,10 +1,10 @@
|
|
|
1
1
|
import { type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import type Scene from "@excalidraw/excalidraw/scene/Scene";
|
|
3
2
|
import type { PointerDownState } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type { Scene } from "./Scene";
|
|
4
4
|
import type { BoundingBox } from "./bounds";
|
|
5
5
|
import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
|
|
6
|
-
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap
|
|
7
|
-
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[],
|
|
6
|
+
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap } from "./types";
|
|
7
|
+
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], scene: Scene, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
8
8
|
export declare const rescalePointsInElement: (element: NonDeletedExcalidrawElement, width: number, height: number, normalizePoints: boolean) => {
|
|
9
9
|
points: LocalPoint[];
|
|
10
10
|
} | {
|
|
@@ -15,7 +15,7 @@ export declare const measureFontSizeFromWidth: (element: NonDeleted<ExcalidrawTe
|
|
|
15
15
|
} | null;
|
|
16
16
|
export declare const getResizeOffsetXY: (transformHandleType: MaybeTransformHandleType, selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap, x: number, y: number) => [number, number];
|
|
17
17
|
export declare const getResizeArrowDirection: (transformHandleType: MaybeTransformHandleType, element: NonDeleted<ExcalidrawLinearElement>) => "origin" | "end";
|
|
18
|
-
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement,
|
|
18
|
+
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement, originalElementsMap: ElementsMap, scene: Scene, handleDirection: TransformHandleDirection, { shouldInformMutation, shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
|
|
19
19
|
shouldMaintainAspectRatio?: boolean | undefined;
|
|
20
20
|
shouldResizeFromCenter?: boolean | undefined;
|
|
21
21
|
shouldInformMutation?: boolean | undefined;
|
|
@@ -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
|
};
|
|
@@ -75,7 +75,7 @@ export declare const SHAPES: readonly [{
|
|
|
75
75
|
readonly fillable: false;
|
|
76
76
|
readonly myocSimplifiedMode: true;
|
|
77
77
|
}];
|
|
78
|
-
export declare const findShapeByKey: (key: string) => "
|
|
78
|
+
export declare const findShapeByKey: (key: string) => "text" | "line" | "arrow" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "image" | "eraser" | null;
|
|
79
79
|
/**
|
|
80
80
|
* get the pure geometric shape of an excalidraw elementw
|
|
81
81
|
* which is then used for hit detection
|
|
@@ -26,7 +26,6 @@ export declare const getLockedLinearCursorAlignSize: (originX: number, originY:
|
|
|
26
26
|
width: number;
|
|
27
27
|
height: number;
|
|
28
28
|
};
|
|
29
|
-
export declare const resizePerfectLineForNWHandler: (element: ExcalidrawElement, x: number, y: number) => void;
|
|
30
29
|
export declare const getNormalizedDimensions: (element: Pick<ExcalidrawElement, "width" | "height" | "x" | "y">) => {
|
|
31
30
|
width: ExcalidrawElement["width"];
|
|
32
31
|
height: ExcalidrawElement["height"];
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { Emitter } from "@excalidraw/common";
|
|
2
|
+
import type App from "@excalidraw/excalidraw/components/App";
|
|
3
|
+
import type { DTO, ValueOf } from "@excalidraw/common/utility-types";
|
|
4
|
+
import type { AppState, ObservedAppState } from "@excalidraw/excalidraw/types";
|
|
5
|
+
import { ElementsDelta, AppStateDelta } from "./delta";
|
|
6
|
+
import type { OrderedExcalidrawElement, SceneElementsMap } from "./types";
|
|
7
|
+
export declare const CaptureUpdateAction: {
|
|
8
|
+
/**
|
|
9
|
+
* Immediately undoable.
|
|
10
|
+
*
|
|
11
|
+
* Use for updates which should be captured.
|
|
12
|
+
* Should be used for most of the local updates, except ephemerals such as dragging or resizing.
|
|
13
|
+
*
|
|
14
|
+
* These updates will _immediately_ make it to the local undo / redo stacks.
|
|
15
|
+
*/
|
|
16
|
+
readonly IMMEDIATELY: "IMMEDIATELY";
|
|
17
|
+
/**
|
|
18
|
+
* Never undoable.
|
|
19
|
+
*
|
|
20
|
+
* Use for updates which should never be recorded, such as remote updates
|
|
21
|
+
* or scene initialization.
|
|
22
|
+
*
|
|
23
|
+
* These updates will _never_ make it to the local undo / redo stacks.
|
|
24
|
+
*/
|
|
25
|
+
readonly NEVER: "NEVER";
|
|
26
|
+
/**
|
|
27
|
+
* Eventually undoable.
|
|
28
|
+
*
|
|
29
|
+
* Use for updates which should not be captured immediately - likely
|
|
30
|
+
* exceptions which are part of some async multi-step process. Otherwise, all
|
|
31
|
+
* such updates would end up being captured with the next
|
|
32
|
+
* `CaptureUpdateAction.IMMEDIATELY` - triggered either by the next `updateScene`
|
|
33
|
+
* or internally by the editor.
|
|
34
|
+
*
|
|
35
|
+
* These updates will _eventually_ make it to the local undo / redo stacks.
|
|
36
|
+
*/
|
|
37
|
+
readonly EVENTUALLY: "EVENTUALLY";
|
|
38
|
+
};
|
|
39
|
+
export type CaptureUpdateActionType = ValueOf<typeof CaptureUpdateAction>;
|
|
40
|
+
/**
|
|
41
|
+
* Store which captures the observed changes and emits them as `StoreIncrement` events.
|
|
42
|
+
*/
|
|
43
|
+
export declare class Store {
|
|
44
|
+
private readonly app;
|
|
45
|
+
readonly onDurableIncrementEmitter: Emitter<[DurableIncrement]>;
|
|
46
|
+
readonly onStoreIncrementEmitter: Emitter<[DurableIncrement | EphemeralIncrement]>;
|
|
47
|
+
private scheduledMacroActions;
|
|
48
|
+
private scheduledMicroActions;
|
|
49
|
+
private _snapshot;
|
|
50
|
+
get snapshot(): StoreSnapshot;
|
|
51
|
+
set snapshot(snapshot: StoreSnapshot);
|
|
52
|
+
constructor(app: App);
|
|
53
|
+
scheduleAction(action: CaptureUpdateActionType): void;
|
|
54
|
+
/**
|
|
55
|
+
* Use to schedule a delta calculation, which will consquentially be emitted as `DurableStoreIncrement` and pushed in the undo stack.
|
|
56
|
+
*/
|
|
57
|
+
scheduleCapture(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Schedule special "micro" actions, to-be executed before the next commit, before it executes a scheduled "macro" action.
|
|
60
|
+
*/
|
|
61
|
+
scheduleMicroAction(params: {
|
|
62
|
+
action: CaptureUpdateActionType;
|
|
63
|
+
elements: SceneElementsMap | undefined;
|
|
64
|
+
appState: AppState | ObservedAppState | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
action: typeof CaptureUpdateAction.IMMEDIATELY;
|
|
67
|
+
change: StoreChange;
|
|
68
|
+
delta: StoreDelta;
|
|
69
|
+
} | {
|
|
70
|
+
action: typeof CaptureUpdateAction.NEVER | typeof CaptureUpdateAction.EVENTUALLY;
|
|
71
|
+
change: StoreChange;
|
|
72
|
+
}): void;
|
|
73
|
+
/**
|
|
74
|
+
* Performs the incoming `CaptureUpdateAction` and emits the corresponding `StoreIncrement`.
|
|
75
|
+
* Emits `DurableStoreIncrement` when action is "capture", emits `EphemeralStoreIncrement` otherwise.
|
|
76
|
+
*
|
|
77
|
+
* @emits StoreIncrement
|
|
78
|
+
*/
|
|
79
|
+
commit(elements: SceneElementsMap | undefined, appState: AppState | ObservedAppState | undefined): void;
|
|
80
|
+
/**
|
|
81
|
+
* Clears the store instance.
|
|
82
|
+
*/
|
|
83
|
+
clear(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Performs delta & change calculation and emits a durable increment.
|
|
86
|
+
*
|
|
87
|
+
* @emits StoreIncrement.
|
|
88
|
+
*/
|
|
89
|
+
private emitDurableIncrement;
|
|
90
|
+
/**
|
|
91
|
+
* Performs change calculation and emits an ephemeral increment.
|
|
92
|
+
*
|
|
93
|
+
* @emits EphemeralStoreIncrement
|
|
94
|
+
*/
|
|
95
|
+
private emitEphemeralIncrement;
|
|
96
|
+
private applyChangeToSnapshot;
|
|
97
|
+
/**
|
|
98
|
+
* Clones the snapshot if there are changes detected.
|
|
99
|
+
*/
|
|
100
|
+
private maybeCloneSnapshot;
|
|
101
|
+
private flushMicroActions;
|
|
102
|
+
private processAction;
|
|
103
|
+
/**
|
|
104
|
+
* Returns the scheduled macro action.
|
|
105
|
+
*/
|
|
106
|
+
private getScheduledMacroAction;
|
|
107
|
+
/**
|
|
108
|
+
* Ensures that the scheduled actions invariant is satisfied.
|
|
109
|
+
*/
|
|
110
|
+
private satisfiesScheduledActionsInvariant;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Repsents a change to the store containing changed elements and appState.
|
|
114
|
+
*/
|
|
115
|
+
export declare class StoreChange {
|
|
116
|
+
readonly elements: Record<string, OrderedExcalidrawElement>;
|
|
117
|
+
readonly appState: Partial<ObservedAppState>;
|
|
118
|
+
private constructor();
|
|
119
|
+
static create(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): StoreChange;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Encpasulates any change to the store (durable or ephemeral).
|
|
123
|
+
*/
|
|
124
|
+
export declare abstract class StoreIncrement {
|
|
125
|
+
readonly type: "durable" | "ephemeral";
|
|
126
|
+
readonly change: StoreChange;
|
|
127
|
+
protected constructor(type: "durable" | "ephemeral", change: StoreChange);
|
|
128
|
+
static isDurable(increment: StoreIncrement): increment is DurableIncrement;
|
|
129
|
+
static isEphemeral(increment: StoreIncrement): increment is EphemeralIncrement;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Represents a durable change to the store.
|
|
133
|
+
*/
|
|
134
|
+
export declare class DurableIncrement extends StoreIncrement {
|
|
135
|
+
readonly change: StoreChange;
|
|
136
|
+
readonly delta: StoreDelta;
|
|
137
|
+
constructor(change: StoreChange, delta: StoreDelta);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Represents an ephemeral change to the store.
|
|
141
|
+
*/
|
|
142
|
+
export declare class EphemeralIncrement extends StoreIncrement {
|
|
143
|
+
readonly change: StoreChange;
|
|
144
|
+
constructor(change: StoreChange);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Represents a captured delta by the Store.
|
|
148
|
+
*/
|
|
149
|
+
export declare class StoreDelta {
|
|
150
|
+
readonly id: string;
|
|
151
|
+
readonly elements: ElementsDelta;
|
|
152
|
+
readonly appState: AppStateDelta;
|
|
153
|
+
protected constructor(id: string, elements: ElementsDelta, appState: AppStateDelta);
|
|
154
|
+
/**
|
|
155
|
+
* Create a new instance of `StoreDelta`.
|
|
156
|
+
*/
|
|
157
|
+
static create(elements: ElementsDelta, appState: AppStateDelta, opts?: {
|
|
158
|
+
id: string;
|
|
159
|
+
}): StoreDelta;
|
|
160
|
+
/**
|
|
161
|
+
* Restore a store delta instance from a DTO.
|
|
162
|
+
*/
|
|
163
|
+
static restore(storeDeltaDTO: DTO<StoreDelta>): StoreDelta;
|
|
164
|
+
/**
|
|
165
|
+
* Parse and load the delta from the remote payload.
|
|
166
|
+
*/
|
|
167
|
+
static load({ id, elements: { added, removed, updated }, }: DTO<StoreDelta>): StoreDelta;
|
|
168
|
+
/**
|
|
169
|
+
* Inverse store delta, creates new instance of `StoreDelta`.
|
|
170
|
+
*/
|
|
171
|
+
static inverse(delta: StoreDelta): StoreDelta;
|
|
172
|
+
/**
|
|
173
|
+
* Apply latest (remote) changes to the delta, creates new instance of `StoreDelta`.
|
|
174
|
+
*/
|
|
175
|
+
static applyLatestChanges(delta: StoreDelta, elements: SceneElementsMap, modifierOptions: "deleted" | "inserted"): StoreDelta;
|
|
176
|
+
/**
|
|
177
|
+
* Apply the delta to the passed elements and appState, does not modify the snapshot.
|
|
178
|
+
*/
|
|
179
|
+
static applyTo(delta: StoreDelta, elements: SceneElementsMap, appState: AppState, prevSnapshot?: StoreSnapshot): [SceneElementsMap, AppState, boolean];
|
|
180
|
+
isEmpty(): boolean;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Represents a snapshot of the captured or updated changes in the store,
|
|
184
|
+
* used for producing deltas and emitting `DurableStoreIncrement`s.
|
|
185
|
+
*/
|
|
186
|
+
export declare class StoreSnapshot {
|
|
187
|
+
readonly elements: SceneElementsMap;
|
|
188
|
+
readonly appState: ObservedAppState;
|
|
189
|
+
readonly metadata: {
|
|
190
|
+
didElementsChange: boolean;
|
|
191
|
+
didAppStateChange: boolean;
|
|
192
|
+
isEmpty?: boolean;
|
|
193
|
+
};
|
|
194
|
+
private _lastChangedElementsHash;
|
|
195
|
+
private _lastChangedAppStateHash;
|
|
196
|
+
private constructor();
|
|
197
|
+
static create(elements: SceneElementsMap, appState: AppState | ObservedAppState, metadata?: {
|
|
198
|
+
didElementsChange: boolean;
|
|
199
|
+
didAppStateChange: boolean;
|
|
200
|
+
}): StoreSnapshot;
|
|
201
|
+
static empty(): StoreSnapshot;
|
|
202
|
+
getChangedElements(prevSnapshot: StoreSnapshot): Record<string, OrderedExcalidrawElement>;
|
|
203
|
+
getChangedAppState(prevSnapshot: StoreSnapshot): Partial<ObservedAppState>;
|
|
204
|
+
isEmpty(): boolean | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* Apply the change and return a new snapshot instance.
|
|
207
|
+
*/
|
|
208
|
+
applyChange(change: StoreChange): StoreSnapshot;
|
|
209
|
+
/**
|
|
210
|
+
* Efficiently clone the existing snapshot, only if we detected changes.
|
|
211
|
+
*
|
|
212
|
+
* @returns same instance if there are no changes detected, new instance otherwise.
|
|
213
|
+
*/
|
|
214
|
+
maybeClone(action: CaptureUpdateActionType, elements: SceneElementsMap | undefined, appState: AppState | ObservedAppState | undefined): StoreSnapshot;
|
|
215
|
+
private maybeCreateAppStateSnapshot;
|
|
216
|
+
private maybeCreateElementsSnapshot;
|
|
217
|
+
private detectChangedAppState;
|
|
218
|
+
/**
|
|
219
|
+
* Detect if there any changed elements.
|
|
220
|
+
*/
|
|
221
|
+
private detectChangedElements;
|
|
222
|
+
/**
|
|
223
|
+
* Perform structural clone, deep cloning only elements that changed.
|
|
224
|
+
*/
|
|
225
|
+
private createElementsSnapshot;
|
|
226
|
+
}
|
|
227
|
+
export declare const getObservedAppState: (appState: AppState) => ObservedAppState;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { ExtractSetType } from "@excalidraw/common/utility-types";
|
|
3
|
-
import type { Radians } from "
|
|
3
|
+
import type { Radians } from "@excalidraw/math";
|
|
4
|
+
import type { Scene } from "./Scene";
|
|
4
5
|
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
5
6
|
import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
|
|
6
|
-
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null,
|
|
7
|
-
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement,
|
|
7
|
+
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, scene: Scene) => void;
|
|
8
|
+
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, scene: Scene, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
|
|
8
9
|
export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
|
|
9
10
|
x: number;
|
|
10
11
|
y: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { MarkNonNullable } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { Bounds } from "./bounds";
|
|
4
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement } from "./types";
|
|
4
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType } from "./types";
|
|
5
5
|
export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
|
|
6
6
|
export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
|
|
7
7
|
export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
|
|
@@ -16,6 +16,8 @@ export declare const isFreeDrawElementType: (elementType: ExcalidrawElementType)
|
|
|
16
16
|
export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
|
|
17
17
|
export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawArrowElement;
|
|
18
18
|
export declare const isElbowArrow: (element?: ExcalidrawElement) => element is ExcalidrawElbowArrowElement;
|
|
19
|
+
export declare const isSharpArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
20
|
+
export declare const isCurvedArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
19
21
|
export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
|
|
20
22
|
export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
|
|
21
23
|
export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
|
|
@@ -27,6 +29,7 @@ export declare const isExcalidrawElement: (element: any) => element is Excalidra
|
|
|
27
29
|
export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
|
|
28
30
|
export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
|
|
29
31
|
export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
|
|
32
|
+
export declare const isArrowBoundToElement: (element: ExcalidrawArrowElement) => boolean;
|
|
30
33
|
export declare const isUsingAdaptiveRadius: (type: string) => boolean;
|
|
31
34
|
export declare const isUsingProportionalRadius: (type: string) => boolean;
|
|
32
35
|
export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
|
|
@@ -37,3 +40,4 @@ export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElem
|
|
|
37
40
|
} | null;
|
|
38
41
|
export declare const isFixedPointBinding: (binding: PointBinding | FixedPointBinding) => binding is FixedPointBinding;
|
|
39
42
|
export declare const isBounds: (box: unknown) => box is Bounds;
|
|
43
|
+
export declare const getLinearElementSubType: (element: ExcalidrawLinearElement) => ExcalidrawLinearElementSubType;
|
|
@@ -205,6 +205,10 @@ export type PointBinding = {
|
|
|
205
205
|
export type FixedPointBinding = Merge<PointBinding, {
|
|
206
206
|
fixedPoint: FixedPoint;
|
|
207
207
|
}>;
|
|
208
|
+
export type PointsPositionUpdates = Map<number, {
|
|
209
|
+
point: LocalPoint;
|
|
210
|
+
isDragging?: boolean;
|
|
211
|
+
}>;
|
|
208
212
|
export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline" | "crowfoot_one" | "crowfoot_many" | "crowfoot_one_or_many";
|
|
209
213
|
export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
210
214
|
type: "line" | "arrow";
|
|
@@ -280,4 +284,8 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
|
|
|
280
284
|
export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
|
|
281
285
|
export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
|
|
282
286
|
export type ArrangeAlgorithms = "bin-packing";
|
|
287
|
+
export type ExcalidrawLinearElementSubType = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
|
|
288
|
+
export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
|
|
289
|
+
export type ConvertibleLinearTypes = ExcalidrawLinearElementSubType;
|
|
290
|
+
export type ConvertibleTypes = ConvertibleGenericTypes | ConvertibleLinearTypes;
|
|
283
291
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "./Scene";
|
|
3
3
|
import type { ExcalidrawElement } from "./types";
|
|
4
4
|
export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
|
|
5
5
|
export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
|