@excalidraw/element 0.18.0-4e471c107 → 0.18.0-5fffc47
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/index.js +1048 -613
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +14 -14
- package/dist/types/common/src/constants.d.ts +24 -4
- package/dist/types/common/src/utils.d.ts +3 -0
- package/dist/types/element/src/Scene.d.ts +6 -2
- package/dist/types/element/src/align.d.ts +2 -1
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/delta.d.ts +16 -4
- package/dist/types/element/src/distribute.d.ts +2 -1
- package/dist/types/element/src/groups.d.ts +1 -0
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/linearElementEditor.d.ts +2 -1
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -1
- package/dist/types/element/src/store.d.ts +6 -1
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -9
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +94 -41
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +45 -20
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +24 -12
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionExport.d.ts +63 -27
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +16 -7
- package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -12
- package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +41 -6
- package/dist/types/excalidraw/actions/actionLink.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -371
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -53
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +5 -1
- package/dist/types/excalidraw/clipboard.d.ts +64 -1
- package/dist/types/excalidraw/components/Actions.d.ts +17 -7
- package/dist/types/excalidraw/components/App.d.ts +10 -8
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -0
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +5 -0
- package/dist/types/excalidraw/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/data/blob.d.ts +3 -7
- package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
- package/dist/types/excalidraw/data/restore.d.ts +6 -1
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/index.d.ts +2 -1
- package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
- package/dist/types/excalidraw/types.d.ts +16 -6
- package/dist/types/math/src/segment.d.ts +1 -0
- package/package.json +3 -3
|
@@ -8,10 +8,12 @@ export declare const isChrome: boolean;
|
|
|
8
8
|
export declare const isSafari: boolean;
|
|
9
9
|
export declare const isIOS: boolean;
|
|
10
10
|
export declare const isBrave: () => boolean;
|
|
11
|
+
export declare const isMobile: boolean;
|
|
11
12
|
export declare const supportsResizeObserver: boolean;
|
|
12
13
|
export declare const APP_NAME = "Excalidraw";
|
|
13
14
|
export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
|
|
14
15
|
export declare const DRAGGING_THRESHOLD = 10;
|
|
16
|
+
export declare const MINIMUM_ARROW_SIZE = 20;
|
|
15
17
|
export declare const LINE_CONFIRM_THRESHOLD = 8;
|
|
16
18
|
export declare const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
|
|
17
19
|
export declare const ELEMENT_TRANSLATE_AMOUNT = 1;
|
|
@@ -85,10 +87,12 @@ export declare const ENV: {
|
|
|
85
87
|
PRODUCTION: string;
|
|
86
88
|
};
|
|
87
89
|
export declare const CLASSES: {
|
|
90
|
+
SIDEBAR: string;
|
|
88
91
|
SHAPE_ACTIONS_MENU: string;
|
|
89
92
|
ZOOM_ACTIONS: string;
|
|
90
93
|
SEARCH_MENU_INPUT_WRAPPER: string;
|
|
91
94
|
CONVERT_ELEMENT_TYPE_POPUP: string;
|
|
95
|
+
SHAPE_ACTIONS_THEME_SCOPE: string;
|
|
92
96
|
};
|
|
93
97
|
export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
|
|
94
98
|
export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
@@ -174,6 +178,14 @@ export declare const IMAGE_MIME_TYPES: {
|
|
|
174
178
|
readonly avif: "image/avif";
|
|
175
179
|
readonly jfif: "image/jfif";
|
|
176
180
|
};
|
|
181
|
+
export declare const STRING_MIME_TYPES: {
|
|
182
|
+
readonly text: "text/plain";
|
|
183
|
+
readonly html: "text/html";
|
|
184
|
+
readonly json: "application/json";
|
|
185
|
+
readonly excalidraw: "application/vnd.excalidraw+json";
|
|
186
|
+
readonly excalidrawlib: "application/vnd.excalidrawlib+json";
|
|
187
|
+
readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
|
|
188
|
+
};
|
|
177
189
|
export declare const MIME_TYPES: {
|
|
178
190
|
readonly svg: "image/svg+xml";
|
|
179
191
|
readonly png: "image/png";
|
|
@@ -184,14 +196,15 @@ export declare const MIME_TYPES: {
|
|
|
184
196
|
readonly ico: "image/x-icon";
|
|
185
197
|
readonly avif: "image/avif";
|
|
186
198
|
readonly jfif: "image/jfif";
|
|
199
|
+
readonly "excalidraw.svg": "image/svg+xml";
|
|
200
|
+
readonly "excalidraw.png": "image/png";
|
|
201
|
+
readonly binary: "application/octet-stream";
|
|
187
202
|
readonly text: "text/plain";
|
|
188
203
|
readonly html: "text/html";
|
|
189
204
|
readonly json: "application/json";
|
|
190
205
|
readonly excalidraw: "application/vnd.excalidraw+json";
|
|
191
206
|
readonly excalidrawlib: "application/vnd.excalidrawlib+json";
|
|
192
|
-
readonly
|
|
193
|
-
readonly "excalidraw.png": "image/png";
|
|
194
|
-
readonly binary: "application/octet-stream";
|
|
207
|
+
readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
|
|
195
208
|
};
|
|
196
209
|
export declare const ALLOWED_PASTE_MIME_TYPES: readonly ["text/plain", "text/html", ...("image/svg+xml" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/bmp" | "image/x-icon" | "image/avif" | "image/jfif")[]];
|
|
197
210
|
export declare const EXPORT_IMAGE_TYPES: {
|
|
@@ -226,9 +239,12 @@ export declare const URL_HASH_KEYS: {
|
|
|
226
239
|
readonly addLibrary: "addLibrary";
|
|
227
240
|
};
|
|
228
241
|
export declare const DEFAULT_UI_OPTIONS: AppProps["UIOptions"];
|
|
229
|
-
export declare const
|
|
242
|
+
export declare const MQ_MAX_MOBILE = 599;
|
|
230
243
|
export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
|
|
231
244
|
export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
|
|
245
|
+
export declare const MQ_MIN_TABLET: number;
|
|
246
|
+
export declare const MQ_MAX_TABLET = 1400;
|
|
247
|
+
export declare const MQ_MIN_WIDTH_DESKTOP = 1440;
|
|
232
248
|
export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
|
|
233
249
|
export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
|
|
234
250
|
export declare const EXPORT_SCALES: number[];
|
|
@@ -341,3 +357,7 @@ export declare enum UserIdleState {
|
|
|
341
357
|
* the start and end points)
|
|
342
358
|
*/
|
|
343
359
|
export declare const LINE_POLYGON_POINT_MERGE_DISTANCE = 20;
|
|
360
|
+
export declare const DOUBLE_TAP_POSITION_THRESHOLD = 35;
|
|
361
|
+
export declare const MOBILE_ACTION_BUTTON_BG: {
|
|
362
|
+
readonly background: "var(--mobile-action-button-bg)";
|
|
363
|
+
};
|
|
@@ -17,6 +17,8 @@ export declare const getFontString: ({ fontSize, fontFamily, }: {
|
|
|
17
17
|
fontSize: number;
|
|
18
18
|
fontFamily: FontFamilyValues;
|
|
19
19
|
}) => FontString;
|
|
20
|
+
/** executes callback in the frame that's after the current one */
|
|
21
|
+
export declare const nextAnimationFrame: (cb: () => any) => Promise<void>;
|
|
20
22
|
export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeout: number) => {
|
|
21
23
|
(...args: T): void;
|
|
22
24
|
flush(): void;
|
|
@@ -264,4 +266,5 @@ export declare const castArray: <T>(value: T | T[]) => T[];
|
|
|
264
266
|
export declare const isReadonlyArray: (value?: any) => value is readonly any[];
|
|
265
267
|
export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
|
|
266
268
|
export declare const reduceToCommonValue: <T, R = T>(collection: ReadonlySet<T> | readonly T[], getValue?: ((item: T) => R) | undefined) => R | null;
|
|
269
|
+
export declare const isMobileOrTablet: () => boolean;
|
|
267
270
|
export {};
|
|
@@ -27,7 +27,9 @@ export declare class Scene {
|
|
|
27
27
|
getElementsMapIncludingDeleted(): Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
|
|
28
28
|
getNonDeletedElements(): readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
29
29
|
getFramesIncludingDeleted(): readonly ExcalidrawFrameLikeElement[];
|
|
30
|
-
constructor(elements?: ElementsMapOrArray | null
|
|
30
|
+
constructor(elements?: ElementsMapOrArray | null, options?: {
|
|
31
|
+
skipValidation?: true;
|
|
32
|
+
});
|
|
31
33
|
getSelectedElements(opts: {
|
|
32
34
|
selectedElementIds: AppState["selectedElementIds"];
|
|
33
35
|
/**
|
|
@@ -55,7 +57,9 @@ export declare class Scene {
|
|
|
55
57
|
* @returns whether a change was made
|
|
56
58
|
*/
|
|
57
59
|
mapElements(iteratee: (element: ExcalidrawElement) => ExcalidrawElement): boolean;
|
|
58
|
-
replaceAllElements(nextElements: ElementsMapOrArray
|
|
60
|
+
replaceAllElements(nextElements: ElementsMapOrArray, options?: {
|
|
61
|
+
skipValidation?: true;
|
|
62
|
+
}): void;
|
|
59
63
|
triggerUpdate(): void;
|
|
60
64
|
onUpdate(cb: SceneStateCallback): SceneStateCallbackRemover;
|
|
61
65
|
destroy(): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
1
2
|
import type { Scene } from "./Scene";
|
|
2
3
|
import type { ExcalidrawElement } from "./types";
|
|
3
4
|
export interface Alignment {
|
|
4
5
|
position: "start" | "center" | "end";
|
|
5
6
|
axis: "x" | "y";
|
|
6
7
|
}
|
|
7
|
-
export declare const alignElements: (selectedElements: ExcalidrawElement[], alignment: Alignment, scene: Scene) => ExcalidrawElement[];
|
|
8
|
+
export declare const alignElements: (selectedElements: ExcalidrawElement[], alignment: Alignment, scene: Scene, appState: Readonly<AppState>) => ExcalidrawElement[];
|
|
@@ -74,7 +74,7 @@ export interface BoundingBox {
|
|
|
74
74
|
width: number;
|
|
75
75
|
height: number;
|
|
76
76
|
}
|
|
77
|
-
export declare const getCommonBoundingBox: (elements: ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) => BoundingBox;
|
|
77
|
+
export declare const getCommonBoundingBox: (elements: readonly ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) => BoundingBox;
|
|
78
78
|
/**
|
|
79
79
|
* returns scene coords of user's editor viewport (visible canvas area) bounds
|
|
80
80
|
*/
|
|
@@ -29,12 +29,16 @@ export declare class Delta<T> {
|
|
|
29
29
|
}>(prevObject: T, nextObject: T, modifier?: (partial: Partial<T>) => Partial<T>, postProcess?: (deleted: Partial<T>, inserted: Partial<T>) => [Partial<T>, Partial<T>]): Delta<T>;
|
|
30
30
|
static empty(): Delta<unknown>;
|
|
31
31
|
static isEmpty<T>(delta: Delta<T>): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Merges two deltas into a new one.
|
|
34
|
+
*/
|
|
35
|
+
static merge<T>(delta1: Delta<T>, delta2: Delta<T>, delta3?: Delta<T>): Delta<T>;
|
|
32
36
|
/**
|
|
33
37
|
* Merges deleted and inserted object partials.
|
|
34
38
|
*/
|
|
35
39
|
static mergeObjects<T extends {
|
|
36
40
|
[key: string]: unknown;
|
|
37
|
-
}>(prev: T, added: T, removed
|
|
41
|
+
}>(prev: T, added: T, removed?: T): T;
|
|
38
42
|
/**
|
|
39
43
|
* Merges deleted and inserted array partials.
|
|
40
44
|
*/
|
|
@@ -102,18 +106,24 @@ export interface DeltaContainer<T> {
|
|
|
102
106
|
* @returns a tuple of the next object `T` with applied `Delta`s, and `boolean`, indicating whether the applied deltas resulted in a visible change.
|
|
103
107
|
*/
|
|
104
108
|
applyTo(previous: T, ...options: unknown[]): [T, boolean];
|
|
109
|
+
/**
|
|
110
|
+
* Squashes the current delta with the given one.
|
|
111
|
+
*/
|
|
112
|
+
squash(delta: DeltaContainer<T>): this;
|
|
105
113
|
/**
|
|
106
114
|
* Checks whether all `Delta`s are empty.
|
|
107
115
|
*/
|
|
108
116
|
isEmpty(): boolean;
|
|
109
117
|
}
|
|
110
118
|
export declare class AppStateDelta implements DeltaContainer<AppState> {
|
|
111
|
-
|
|
119
|
+
delta: Delta<ObservedAppState>;
|
|
112
120
|
private constructor();
|
|
121
|
+
static create(delta: Delta<ObservedAppState>): AppStateDelta;
|
|
113
122
|
static calculate<T extends ObservedAppState>(prevAppState: T, nextAppState: T): AppStateDelta;
|
|
114
123
|
static restore(appStateDeltaDTO: DTO<AppStateDelta>): AppStateDelta;
|
|
115
124
|
static empty(): AppStateDelta;
|
|
116
125
|
inverse(): AppStateDelta;
|
|
126
|
+
squash(delta: AppStateDelta): this;
|
|
117
127
|
applyTo(appState: AppState, nextElements: SceneElementsMap): [AppState, boolean];
|
|
118
128
|
isEmpty(): boolean;
|
|
119
129
|
/**
|
|
@@ -122,7 +132,6 @@ export declare class AppStateDelta implements DeltaContainer<AppState> {
|
|
|
122
132
|
* @returns `true` if a visible change is found, `false` otherwise.
|
|
123
133
|
*/
|
|
124
134
|
private filterInvisibleChanges;
|
|
125
|
-
private static convertToAppStateKey;
|
|
126
135
|
private static filterSelectedElements;
|
|
127
136
|
private static filterSelectedGroups;
|
|
128
137
|
private static stripElementsProps;
|
|
@@ -136,7 +145,7 @@ export declare class AppStateDelta implements DeltaContainer<AppState> {
|
|
|
136
145
|
}
|
|
137
146
|
type ElementPartial<TElement extends ExcalidrawElement = ExcalidrawElement> = Omit<Partial<Ordered<TElement>>, "id" | "updated" | "seed">;
|
|
138
147
|
export type ApplyToOptions = {
|
|
139
|
-
excludedProperties
|
|
148
|
+
excludedProperties?: Set<keyof ElementPartial>;
|
|
140
149
|
};
|
|
141
150
|
/**
|
|
142
151
|
* Elements change is a low level primitive to capture a change between two sets of elements.
|
|
@@ -155,6 +164,7 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
|
|
|
155
164
|
private static satisfiesRemoval;
|
|
156
165
|
private static satisfiesUpdate;
|
|
157
166
|
private static satisfiesCommmonInvariants;
|
|
167
|
+
private static satisfiesUniqueInvariants;
|
|
158
168
|
private static validate;
|
|
159
169
|
/**
|
|
160
170
|
* Calculates the `Delta`s between the previous and next set of elements.
|
|
@@ -177,6 +187,7 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
|
|
|
177
187
|
*/
|
|
178
188
|
applyLatestChanges(prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): ElementsDelta;
|
|
179
189
|
applyTo(elements: SceneElementsMap, snapshot?: StoreSnapshot["elements"], options?: ApplyToOptions): [SceneElementsMap, boolean];
|
|
190
|
+
squash(delta: ElementsDelta): this;
|
|
180
191
|
private static createApplier;
|
|
181
192
|
private static createGetter;
|
|
182
193
|
private static applyDelta;
|
|
@@ -203,6 +214,7 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
|
|
|
203
214
|
* should be rebound (if possible) with the current element ~ bindings should be bidirectional.
|
|
204
215
|
*/
|
|
205
216
|
private static rebindAffected;
|
|
217
|
+
static redrawElements(nextElements: SceneElementsMap, changedElements: Map<string, OrderedExcalidrawElement>): SceneElementsMap;
|
|
206
218
|
private static redrawTextBoundingBoxes;
|
|
207
219
|
private static redrawBoundArrows;
|
|
208
220
|
private static reorderElements;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
1
2
|
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
2
3
|
export interface Distribution {
|
|
3
4
|
space: "between";
|
|
4
5
|
axis: "x" | "y";
|
|
5
6
|
}
|
|
6
|
-
export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution) => ExcalidrawElement[];
|
|
7
|
+
export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>) => ExcalidrawElement[];
|
|
@@ -31,3 +31,4 @@ export declare const getNonDeletedGroupIds: (elements: ElementsMap) => Set<strin
|
|
|
31
31
|
export declare const elementsAreInSameGroup: (elements: readonly ExcalidrawElement[]) => boolean;
|
|
32
32
|
export declare const isInGroup: (element: NonDeletedExcalidrawElement) => boolean;
|
|
33
33
|
export declare const getNewGroupIdsForDuplication: (groupIds: ExcalidrawElement["groupIds"], editingGroupId: AppState["editingGroupId"], mapper: (groupId: GroupId) => GroupId) => string[];
|
|
34
|
+
export declare const getSelectedElementsByGroup: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, appState: Readonly<AppState>) => ExcalidrawElement[][];
|
|
@@ -38,6 +38,7 @@ export * from "./image";
|
|
|
38
38
|
export * from "./linearElementEditor";
|
|
39
39
|
export * from "./mutateElement";
|
|
40
40
|
export * from "./newElement";
|
|
41
|
+
export * from "./positionElementsOnGrid";
|
|
41
42
|
export * from "./renderElement";
|
|
42
43
|
export * from "./resizeElements";
|
|
43
44
|
export * from "./resizeTest";
|
|
@@ -39,7 +39,8 @@ export declare class LinearElementEditor {
|
|
|
39
39
|
readonly segmentMidPointHoveredCoords: GlobalPoint | null;
|
|
40
40
|
readonly elbowed: boolean;
|
|
41
41
|
readonly customLineAngle: number | null;
|
|
42
|
-
|
|
42
|
+
readonly isEditing: boolean;
|
|
43
|
+
constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, isEditing?: boolean);
|
|
43
44
|
static POINT_HANDLE_SIZE: number;
|
|
44
45
|
/**
|
|
45
46
|
* @param id the `elementId` from the instance of this class (so that we can
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
1
2
|
import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
|
|
2
3
|
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
|
|
3
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "./types";
|
|
4
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
|
|
4
5
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
5
6
|
export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
|
6
7
|
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
|
|
@@ -26,3 +27,5 @@ export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
|
|
|
26
27
|
export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
|
|
27
28
|
export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
|
|
28
29
|
export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
|
|
30
|
+
export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
|
|
31
|
+
export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
|
|
@@ -169,7 +169,11 @@ export declare class StoreDelta {
|
|
|
169
169
|
/**
|
|
170
170
|
* Parse and load the delta from the remote payload.
|
|
171
171
|
*/
|
|
172
|
-
static load({ id, elements: { added, removed, updated }, }: DTO<StoreDelta>): StoreDelta;
|
|
172
|
+
static load({ id, elements: { added, removed, updated }, appState: { delta: appStateDelta }, }: DTO<StoreDelta>): StoreDelta;
|
|
173
|
+
/**
|
|
174
|
+
* Squash the passed deltas into the aggregated delta instance.
|
|
175
|
+
*/
|
|
176
|
+
static squash(...deltas: StoreDelta[]): StoreDelta;
|
|
173
177
|
/**
|
|
174
178
|
* Inverse store delta, creates new instance of `StoreDelta`.
|
|
175
179
|
*/
|
|
@@ -182,6 +186,7 @@ export declare class StoreDelta {
|
|
|
182
186
|
* Apply latest (remote) changes to the delta, creates new instance of `StoreDelta`.
|
|
183
187
|
*/
|
|
184
188
|
static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): StoreDelta;
|
|
189
|
+
static empty(): StoreDelta;
|
|
185
190
|
isEmpty(): boolean;
|
|
186
191
|
}
|
|
187
192
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type Radians } from "@excalidraw/math";
|
|
1
2
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
3
|
import type { ExtractSetType } from "@excalidraw/common/utility-types";
|
|
3
|
-
import type { Radians } from "@excalidraw/math";
|
|
4
4
|
import type { Scene } from "./Scene";
|
|
5
5
|
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
6
6
|
import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
|
|
@@ -39,12 +39,15 @@ export declare const actionAddToLibrary: {
|
|
|
39
39
|
editingFrame: string | null;
|
|
40
40
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
41
41
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
42
|
-
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
43
42
|
activeTool: {
|
|
44
43
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
45
44
|
locked: boolean;
|
|
46
45
|
fromSelection: boolean;
|
|
47
46
|
} & import("../types").ActiveTool;
|
|
47
|
+
preferredSelectionTool: {
|
|
48
|
+
type: "selection" | "lasso";
|
|
49
|
+
initialized: boolean;
|
|
50
|
+
};
|
|
48
51
|
penMode: boolean;
|
|
49
52
|
penDetected: boolean;
|
|
50
53
|
exportBackground: boolean;
|
|
@@ -77,8 +80,8 @@ export declare const actionAddToLibrary: {
|
|
|
77
80
|
zoom: Readonly<{
|
|
78
81
|
value: import("../types").NormalizedZoomValue;
|
|
79
82
|
}>;
|
|
80
|
-
openMenu: "canvas" |
|
|
81
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
83
|
+
openMenu: "canvas" | null;
|
|
84
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
82
85
|
openSidebar: {
|
|
83
86
|
name: string;
|
|
84
87
|
tab?: string | undefined;
|
|
@@ -174,6 +177,7 @@ export declare const actionAddToLibrary: {
|
|
|
174
177
|
lockedMultiSelections: {
|
|
175
178
|
[groupId: string]: true;
|
|
176
179
|
};
|
|
180
|
+
stylesPanelMode: "compact" | "full" | "mobile";
|
|
177
181
|
};
|
|
178
182
|
} | {
|
|
179
183
|
captureUpdate: "EVENTUALLY";
|
|
@@ -207,12 +211,15 @@ export declare const actionAddToLibrary: {
|
|
|
207
211
|
editingFrame: string | null;
|
|
208
212
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
209
213
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
210
|
-
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
211
214
|
activeTool: {
|
|
212
215
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
213
216
|
locked: boolean;
|
|
214
217
|
fromSelection: boolean;
|
|
215
218
|
} & import("../types").ActiveTool;
|
|
219
|
+
preferredSelectionTool: {
|
|
220
|
+
type: "selection" | "lasso";
|
|
221
|
+
initialized: boolean;
|
|
222
|
+
};
|
|
216
223
|
penMode: boolean;
|
|
217
224
|
penDetected: boolean;
|
|
218
225
|
exportBackground: boolean;
|
|
@@ -245,8 +252,8 @@ export declare const actionAddToLibrary: {
|
|
|
245
252
|
zoom: Readonly<{
|
|
246
253
|
value: import("../types").NormalizedZoomValue;
|
|
247
254
|
}>;
|
|
248
|
-
openMenu: "canvas" |
|
|
249
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
255
|
+
openMenu: "canvas" | null;
|
|
256
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
250
257
|
openSidebar: {
|
|
251
258
|
name: string;
|
|
252
259
|
tab?: string | undefined;
|
|
@@ -347,6 +354,7 @@ export declare const actionAddToLibrary: {
|
|
|
347
354
|
lockedMultiSelections: {
|
|
348
355
|
[groupId: string]: true;
|
|
349
356
|
};
|
|
357
|
+
stylesPanelMode: "compact" | "full" | "mobile";
|
|
350
358
|
};
|
|
351
359
|
}> | {
|
|
352
360
|
captureUpdate: "EVENTUALLY";
|
|
@@ -380,12 +388,15 @@ export declare const actionAddToLibrary: {
|
|
|
380
388
|
editingFrame: string | null;
|
|
381
389
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
382
390
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
383
|
-
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
384
391
|
activeTool: {
|
|
385
392
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
386
393
|
locked: boolean;
|
|
387
394
|
fromSelection: boolean;
|
|
388
395
|
} & import("../types").ActiveTool;
|
|
396
|
+
preferredSelectionTool: {
|
|
397
|
+
type: "selection" | "lasso";
|
|
398
|
+
initialized: boolean;
|
|
399
|
+
};
|
|
389
400
|
penMode: boolean;
|
|
390
401
|
penDetected: boolean;
|
|
391
402
|
exportBackground: boolean;
|
|
@@ -418,8 +429,8 @@ export declare const actionAddToLibrary: {
|
|
|
418
429
|
zoom: Readonly<{
|
|
419
430
|
value: import("../types").NormalizedZoomValue;
|
|
420
431
|
}>;
|
|
421
|
-
openMenu: "canvas" |
|
|
422
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
432
|
+
openMenu: "canvas" | null;
|
|
433
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
423
434
|
openSidebar: {
|
|
424
435
|
name: string;
|
|
425
436
|
tab?: string | undefined;
|
|
@@ -520,6 +531,7 @@ export declare const actionAddToLibrary: {
|
|
|
520
531
|
lockedMultiSelections: {
|
|
521
532
|
[groupId: string]: true;
|
|
522
533
|
};
|
|
534
|
+
stylesPanelMode: "compact" | "full" | "mobile";
|
|
523
535
|
};
|
|
524
536
|
};
|
|
525
537
|
label: string;
|
|
@@ -59,12 +59,15 @@ export declare const actionBindText: {
|
|
|
59
59
|
editingFrame: string | null;
|
|
60
60
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
61
61
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
62
|
-
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
63
62
|
activeTool: {
|
|
64
63
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
65
64
|
locked: boolean;
|
|
66
65
|
fromSelection: boolean;
|
|
67
66
|
} & import("../types").ActiveTool;
|
|
67
|
+
preferredSelectionTool: {
|
|
68
|
+
type: "selection" | "lasso";
|
|
69
|
+
initialized: boolean;
|
|
70
|
+
};
|
|
68
71
|
penMode: boolean;
|
|
69
72
|
penDetected: boolean;
|
|
70
73
|
exportBackground: boolean;
|
|
@@ -97,8 +100,8 @@ export declare const actionBindText: {
|
|
|
97
100
|
zoom: Readonly<{
|
|
98
101
|
value: import("../types").NormalizedZoomValue;
|
|
99
102
|
}>;
|
|
100
|
-
openMenu: "canvas" |
|
|
101
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
103
|
+
openMenu: "canvas" | null;
|
|
104
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
102
105
|
openSidebar: {
|
|
103
106
|
name: string;
|
|
104
107
|
tab?: string | undefined;
|
|
@@ -196,6 +199,7 @@ export declare const actionBindText: {
|
|
|
196
199
|
lockedMultiSelections: {
|
|
197
200
|
[groupId: string]: true;
|
|
198
201
|
};
|
|
202
|
+
stylesPanelMode: "compact" | "full" | "mobile";
|
|
199
203
|
};
|
|
200
204
|
captureUpdate: "IMMEDIATELY";
|
|
201
205
|
};
|
|
@@ -244,12 +248,15 @@ export declare const actionWrapTextInContainer: {
|
|
|
244
248
|
editingFrame: string | null;
|
|
245
249
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
246
250
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
247
|
-
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
248
251
|
activeTool: {
|
|
249
252
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
250
253
|
locked: boolean;
|
|
251
254
|
fromSelection: boolean;
|
|
252
255
|
} & import("../types").ActiveTool;
|
|
256
|
+
preferredSelectionTool: {
|
|
257
|
+
type: "selection" | "lasso";
|
|
258
|
+
initialized: boolean;
|
|
259
|
+
};
|
|
253
260
|
penMode: boolean;
|
|
254
261
|
penDetected: boolean;
|
|
255
262
|
exportBackground: boolean;
|
|
@@ -282,8 +289,8 @@ export declare const actionWrapTextInContainer: {
|
|
|
282
289
|
zoom: Readonly<{
|
|
283
290
|
value: import("../types").NormalizedZoomValue;
|
|
284
291
|
}>;
|
|
285
|
-
openMenu: "canvas" |
|
|
286
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
292
|
+
openMenu: "canvas" | null;
|
|
293
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
287
294
|
openSidebar: {
|
|
288
295
|
name: string;
|
|
289
296
|
tab?: string | undefined;
|
|
@@ -381,6 +388,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
381
388
|
lockedMultiSelections: {
|
|
382
389
|
[groupId: string]: true;
|
|
383
390
|
};
|
|
391
|
+
stylesPanelMode: "compact" | "full" | "mobile";
|
|
384
392
|
};
|
|
385
393
|
captureUpdate: "IMMEDIATELY";
|
|
386
394
|
};
|