@zsviczian/excalidraw 0.16.1-obsidian-6 → 0.16.1-obsidian-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/excalidraw.development.js +83 -39
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +24 -6
- package/types/actions/actionBoundText.d.ts +16 -4
- package/types/actions/actionCanvas.d.ts +104 -26
- package/types/actions/actionClipboard.d.ts +355 -18
- package/types/actions/actionDeleteSelected.d.ts +24 -6
- package/types/actions/actionElementLock.d.ts +16 -4
- package/types/actions/actionExport.d.ts +71 -17
- package/types/actions/actionFinalize.d.ts +16 -4
- package/types/actions/actionFrame.d.ts +24 -6
- package/types/actions/actionGroup.d.ts +16 -4
- package/types/actions/actionLinearEditor.d.ts +8 -2
- package/types/actions/actionMenu.d.ts +23 -5
- package/types/actions/actionProperties.d.ts +104 -26
- package/types/actions/actionSelectAll.d.ts +8 -2
- package/types/actions/actionStyles.d.ts +8 -2
- package/types/actions/actionToggleGridMode.d.ts +8 -2
- package/types/actions/actionToggleObjectsSnapMode.d.ts +8 -2
- package/types/actions/actionToggleStats.d.ts +8 -2
- package/types/actions/actionToggleViewMode.d.ts +8 -2
- package/types/actions/actionToggleZenMode.d.ts +8 -2
- package/types/actions/actionZindex.d.ts +2 -2
- package/types/actions/manager.d.ts +1 -1
- package/types/clipboard.d.ts +21 -3
- package/types/components/App.d.ts +2 -3
- package/types/components/ContextMenu.d.ts +2 -1
- package/types/components/MermaidToExcalidraw.d.ts +1 -1
- package/types/components/Modal.d.ts +3 -1
- package/types/constants.d.ts +2 -0
- package/types/data/transform.d.ts +7 -3
- package/types/element/Hyperlink.d.ts +9 -3
- package/types/element/bounds.d.ts +11 -5
- package/types/element/embeddable.d.ts +8 -2
- package/types/element/linearElementEditor.d.ts +10 -3
- package/types/element/newElement.d.ts +3 -1
- package/types/element/resizeTest.d.ts +2 -1
- package/types/element/transformHandles.d.ts +2 -1
- package/types/frame.d.ts +1 -0
- package/types/hooks/useCreatePortalContainer.d.ts +6 -4
- package/types/math.d.ts +1 -0
- package/types/packages/bbox.d.ts +11 -0
- package/types/packages/excalidraw/index.d.ts +1 -0
- package/types/packages/utils.d.ts +2 -0
- package/types/packages/withinBounds.d.ts +19 -0
- package/types/scene/export.d.ts +0 -1
- package/types/types.d.ts +11 -3
- package/types/utils.d.ts +2 -0
- package/types/zindex.d.ts +4 -4
|
@@ -89,7 +89,7 @@ export declare const actionLink: {
|
|
|
89
89
|
name: string;
|
|
90
90
|
tab?: string | undefined;
|
|
91
91
|
} | null;
|
|
92
|
-
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
92
|
+
openDialog: "mermaid" | "imageExport" | "help" | "jsonExport" | null;
|
|
93
93
|
defaultSidebarDockedPreference: boolean;
|
|
94
94
|
lastPointerDownWith: import("./types").PointerType;
|
|
95
95
|
selectedElementIds: Readonly<{
|
|
@@ -153,7 +153,13 @@ export declare const actionLink: {
|
|
|
153
153
|
Regular: string;
|
|
154
154
|
MajorGridFrequency?: number | undefined;
|
|
155
155
|
};
|
|
156
|
-
dynamicStyle:
|
|
156
|
+
dynamicStyle: {
|
|
157
|
+
[x: string]: string;
|
|
158
|
+
};
|
|
159
|
+
frameColor: {
|
|
160
|
+
stroke: string;
|
|
161
|
+
fill: string;
|
|
162
|
+
};
|
|
157
163
|
invertBindingBehaviour: boolean;
|
|
158
164
|
selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
159
165
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
@@ -177,7 +183,7 @@ export declare const actionLink: {
|
|
|
177
183
|
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
178
184
|
};
|
|
179
185
|
export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
|
|
180
|
-
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: Pick<UIAppState, "zoom">) =>
|
|
186
|
+
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: Pick<UIAppState, "zoom">) => Bounds;
|
|
181
187
|
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]) => boolean;
|
|
182
188
|
export declare const isPointHittingLink: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number], isMobile: boolean) => boolean;
|
|
183
189
|
export declare const showHyperlinkTooltip: (element: NonDeletedExcalidrawElement, appState: AppState) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, NonDeleted } from "./types";
|
|
1
|
+
import { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, ExcalidrawFreeDrawElement, NonDeleted } from "./types";
|
|
2
2
|
import { Drawable, Op } from "roughjs/bin/core";
|
|
3
3
|
import { Point } from "../types";
|
|
4
4
|
export type RectangleBox = {
|
|
@@ -8,7 +8,12 @@ export type RectangleBox = {
|
|
|
8
8
|
height: number;
|
|
9
9
|
angle: number;
|
|
10
10
|
};
|
|
11
|
-
export type Bounds = readonly [
|
|
11
|
+
export type Bounds = readonly [
|
|
12
|
+
minX: number,
|
|
13
|
+
minY: number,
|
|
14
|
+
maxX: number,
|
|
15
|
+
maxY: number
|
|
16
|
+
];
|
|
12
17
|
export declare class ElementBounds {
|
|
13
18
|
private static boundsCache;
|
|
14
19
|
static getBounds(element: ExcalidrawElement): Bounds;
|
|
@@ -25,7 +30,8 @@ export declare const getRectangleBoxAbsoluteCoords: (boxSceneCoords: RectangleBo
|
|
|
25
30
|
export declare const pointRelativeTo: (element: ExcalidrawElement, absoluteCoords: readonly [number, number]) => readonly [number, number];
|
|
26
31
|
export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
|
|
27
32
|
export declare const getCurvePathOps: (shape: Drawable) => Op[];
|
|
28
|
-
export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((x: number, y: number) => [number, number]) | undefined) =>
|
|
33
|
+
export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((x: number, y: number) => [number, number]) | undefined) => Bounds;
|
|
34
|
+
export declare const getBoundsFromPoints: (points: ExcalidrawFreeDrawElement["points"]) => Bounds;
|
|
29
35
|
export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
|
|
30
36
|
export declare const getElementBounds: (element: ExcalidrawElement) => Bounds;
|
|
31
37
|
export declare const getCommonBounds: (elements: readonly ExcalidrawElement[]) => Bounds;
|
|
@@ -33,8 +39,8 @@ export declare const getDraggedElementsBounds: (elements: ExcalidrawElement[], d
|
|
|
33
39
|
x: number;
|
|
34
40
|
y: number;
|
|
35
41
|
}) => number[];
|
|
36
|
-
export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number, normalizePoints: boolean) =>
|
|
37
|
-
export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[]) =>
|
|
42
|
+
export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number, normalizePoints: boolean) => Bounds;
|
|
43
|
+
export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[]) => Bounds;
|
|
38
44
|
export declare const getClosestElementBounds: (elements: readonly ExcalidrawElement[], from: {
|
|
39
45
|
x: number;
|
|
40
46
|
y: number;
|
|
@@ -94,7 +94,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
|
|
|
94
94
|
name: string;
|
|
95
95
|
tab?: string | undefined;
|
|
96
96
|
} | null;
|
|
97
|
-
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
97
|
+
openDialog: "mermaid" | "imageExport" | "help" | "jsonExport" | null;
|
|
98
98
|
defaultSidebarDockedPreference: boolean;
|
|
99
99
|
lastPointerDownWith: import("./types").PointerType;
|
|
100
100
|
selectedElementIds: Readonly<{
|
|
@@ -159,7 +159,13 @@ export declare const actionSetEmbeddableAsActiveTool: {
|
|
|
159
159
|
Regular: string;
|
|
160
160
|
MajorGridFrequency?: number | undefined;
|
|
161
161
|
};
|
|
162
|
-
dynamicStyle:
|
|
162
|
+
dynamicStyle: {
|
|
163
|
+
[x: string]: string;
|
|
164
|
+
};
|
|
165
|
+
frameColor: {
|
|
166
|
+
stroke: string;
|
|
167
|
+
fill: string;
|
|
168
|
+
};
|
|
163
169
|
invertBindingBehaviour: boolean;
|
|
164
170
|
selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
165
171
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer } from "./types";
|
|
2
|
+
import { Bounds } from "./bounds";
|
|
2
3
|
import { Point, AppState, PointerCoords, InteractiveCanvasAppState } from "../types";
|
|
3
4
|
import History from "../history";
|
|
4
5
|
import Scene from "../scene/Scene";
|
|
@@ -191,7 +192,7 @@ export declare class LinearElementEditor {
|
|
|
191
192
|
name: string;
|
|
192
193
|
tab?: string | undefined;
|
|
193
194
|
} | null;
|
|
194
|
-
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
195
|
+
openDialog: "mermaid" | "imageExport" | "help" | "jsonExport" | null;
|
|
195
196
|
defaultSidebarDockedPreference: boolean;
|
|
196
197
|
lastPointerDownWith: import("./types").PointerType;
|
|
197
198
|
selectedElementIds: Readonly<{
|
|
@@ -256,7 +257,13 @@ export declare class LinearElementEditor {
|
|
|
256
257
|
Regular: string;
|
|
257
258
|
MajorGridFrequency?: number | undefined;
|
|
258
259
|
};
|
|
259
|
-
dynamicStyle:
|
|
260
|
+
dynamicStyle: {
|
|
261
|
+
[x: string]: string;
|
|
262
|
+
};
|
|
263
|
+
frameColor: {
|
|
264
|
+
stroke: string;
|
|
265
|
+
fill: string;
|
|
266
|
+
};
|
|
260
267
|
invertBindingBehaviour: boolean;
|
|
261
268
|
selectedLinearElement: LinearElementEditor | null;
|
|
262
269
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
@@ -290,7 +297,7 @@ export declare class LinearElementEditor {
|
|
|
290
297
|
x: number;
|
|
291
298
|
y: number;
|
|
292
299
|
};
|
|
293
|
-
static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementBounds:
|
|
300
|
+
static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementBounds: Bounds, boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
|
|
294
301
|
static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
295
302
|
}
|
|
296
303
|
export {};
|
|
@@ -9,7 +9,9 @@ export declare const newEmbeddableElement: (opts: {
|
|
|
9
9
|
type: "embeddable";
|
|
10
10
|
validated: ExcalidrawEmbeddableElement["validated"];
|
|
11
11
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawEmbeddableElement>;
|
|
12
|
-
export declare const newFrameElement: (opts:
|
|
12
|
+
export declare const newFrameElement: (opts: {
|
|
13
|
+
name?: string;
|
|
14
|
+
} & ElementConstructorOpts) => NonDeleted<ExcalidrawFrameElement>;
|
|
13
15
|
export declare const newTextElement: (opts: {
|
|
14
16
|
text: string;
|
|
15
17
|
rawText: string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement } from "./types";
|
|
2
2
|
import { MaybeTransformHandleType } from "./transformHandles";
|
|
3
3
|
import { AppState, Zoom } from "../types";
|
|
4
|
+
import { Bounds } from "./bounds";
|
|
4
5
|
export declare const resizeTest: (element: NonDeletedExcalidrawElement, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType) => MaybeTransformHandleType;
|
|
5
6
|
export declare const getElementWithTransformHandleType: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType) => {
|
|
6
7
|
element: NonDeletedExcalidrawElement;
|
|
7
8
|
transformHandleType: MaybeTransformHandleType;
|
|
8
9
|
} | null;
|
|
9
|
-
export declare const getTransformHandleTypeFromCoords: ([x1, y1, x2, y2]:
|
|
10
|
+
export declare const getTransformHandleTypeFromCoords: ([x1, y1, x2, y2]: Bounds, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType) => MaybeTransformHandleType;
|
|
10
11
|
export declare const getCursorForResizingElement: (resizingElement: {
|
|
11
12
|
element?: ExcalidrawElement;
|
|
12
13
|
transformHandleType: MaybeTransformHandleType;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
|
|
2
|
+
import { Bounds } from "./bounds";
|
|
2
3
|
import { InteractiveCanvasAppState, Zoom } from "../types";
|
|
3
4
|
export type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
|
|
4
5
|
export type TransformHandleType = TransformHandleDirection | "rotation";
|
|
5
|
-
export type TransformHandle =
|
|
6
|
+
export type TransformHandle = Bounds;
|
|
6
7
|
export type TransformHandles = Partial<{
|
|
7
8
|
[T in TransformHandleType]: TransformHandle;
|
|
8
9
|
}>;
|
package/types/frame.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ExcalidrawElement, ExcalidrawFrameElement, NonDeleted, NonDeletedExcali
|
|
|
2
2
|
import { AppClassProperties, AppState, StaticCanvasAppState } from "./types";
|
|
3
3
|
import { ExcalidrawElementsIncludingDeleted } from "./scene/Scene";
|
|
4
4
|
export declare const bindElementsToFramesAfterDuplication: (nextElements: ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
5
|
+
export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameElement): boolean;
|
|
5
6
|
export declare const getElementsCompletelyInFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameElement) => ExcalidrawElement[];
|
|
6
7
|
export declare const isElementContainingFrame: (elements: readonly ExcalidrawElement[], element: ExcalidrawElement, frame: ExcalidrawFrameElement) => boolean;
|
|
7
8
|
export declare const getElementsIntersectingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameElement) => ExcalidrawElement[];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const useCreatePortalContainer: (opts?: {
|
|
2
|
-
className?: string;
|
|
3
|
-
parentSelector?: string;
|
|
4
|
-
style?:
|
|
5
|
-
|
|
2
|
+
className?: string | undefined;
|
|
3
|
+
parentSelector?: string | undefined;
|
|
4
|
+
style?: {
|
|
5
|
+
[x: string]: string;
|
|
6
|
+
} | undefined;
|
|
7
|
+
} | undefined) => HTMLDivElement | null;
|
package/types/math.d.ts
CHANGED
|
@@ -30,3 +30,4 @@ export declare const arePointsEqual: (p1: readonly [number, number], p2: readonl
|
|
|
30
30
|
export declare const isRightAngle: (angle: number) => boolean;
|
|
31
31
|
export declare const rangesOverlap: ([a0, a1]: [number, number], [b0, b1]: [number, number]) => boolean;
|
|
32
32
|
export declare const rangeIntersection: (rangeA: [number, number], rangeB: [number, number]) => [number, number] | null;
|
|
33
|
+
export declare const isValueInRange: (value: number, min: number, max: number) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Bounds } from "../element/bounds";
|
|
2
|
+
import { Point } from "../types";
|
|
3
|
+
export type LineSegment = [Point, Point];
|
|
4
|
+
export declare function getBBox(line: LineSegment): Bounds;
|
|
5
|
+
export declare function crossProduct(a: Point, b: Point): number;
|
|
6
|
+
export declare function doBBoxesIntersect(a: Bounds, b: Bounds): boolean;
|
|
7
|
+
export declare function translate(a: Point, b: Point): Point;
|
|
8
|
+
export declare function isPointOnLine(l: LineSegment, p: Point): boolean;
|
|
9
|
+
export declare function isPointRightOfLine(l: LineSegment, p: Point): boolean;
|
|
10
|
+
export declare function isLineSegmentTouchingOrCrossingLine(a: LineSegment, b: LineSegment): boolean;
|
|
11
|
+
export declare function doLineSegmentsIntersect(a: LineSegment, b: LineSegment): boolean;
|
|
@@ -37,3 +37,4 @@ export { LiveCollaborationTrigger };
|
|
|
37
37
|
export { DefaultSidebar } from "../../components/DefaultSidebar";
|
|
38
38
|
export { normalizeLink } from "../../data/url";
|
|
39
39
|
export { convertToExcalidrawElements } from "../../data/transform";
|
|
40
|
+
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "../withinBounds";
|
|
@@ -30,6 +30,8 @@ export declare const exportToClipboard: (opts: ExportOpts & {
|
|
|
30
30
|
quality?: number;
|
|
31
31
|
type: "png" | "svg" | "json";
|
|
32
32
|
}) => Promise<void>;
|
|
33
|
+
export * from "./bbox";
|
|
34
|
+
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "./withinBounds";
|
|
33
35
|
export { serializeAsJSON, serializeLibraryAsJSON } from "../data/json";
|
|
34
36
|
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "../data/blob";
|
|
35
37
|
export { getFreeDrawSvgPath } from "../renderer/renderElement";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NonDeletedExcalidrawElement } from "../element/types";
|
|
2
|
+
import { Bounds } from "../element/bounds";
|
|
3
|
+
type Element = NonDeletedExcalidrawElement;
|
|
4
|
+
type Elements = readonly NonDeletedExcalidrawElement[];
|
|
5
|
+
export declare const isElementInsideBBox: (element: Element, bbox: Bounds, eitherDirection?: boolean) => boolean;
|
|
6
|
+
export declare const elementPartiallyOverlapsWithOrContainsBBox: (element: Element, bbox: Bounds) => boolean;
|
|
7
|
+
export declare const elementsOverlappingBBox: ({ elements, bounds, type, errorMargin, }: {
|
|
8
|
+
elements: Elements;
|
|
9
|
+
bounds: Bounds;
|
|
10
|
+
/** safety offset. Defaults to 0. */
|
|
11
|
+
errorMargin?: number | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* - overlap: elements overlapping or inside bounds
|
|
14
|
+
* - contain: elements inside bounds or bounds inside elements
|
|
15
|
+
* - inside: elements inside bounds
|
|
16
|
+
**/
|
|
17
|
+
type: "overlap" | "contain" | "inside";
|
|
18
|
+
}) => NonDeletedExcalidrawElement[];
|
|
19
|
+
export {};
|
package/types/scene/export.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
2
2
|
import { AppState, BinaryFiles } from "../types";
|
|
3
3
|
import { serializeAsJSON } from "../data/json";
|
|
4
|
-
export declare const SVG_EXPORT_TAG = "<!-- svg-source:excalidraw -->";
|
|
5
4
|
export declare const exportToCanvas: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, }: {
|
|
6
5
|
exportBackground: boolean;
|
|
7
6
|
exportPadding?: number | undefined;
|
package/types/types.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export type StaticCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
|
94
94
|
frameRendering: AppState["frameRendering"];
|
|
95
95
|
linkOpacity: AppState["linkOpacity"];
|
|
96
96
|
gridColor: AppState["gridColor"];
|
|
97
|
+
frameColor: AppState["frameColor"];
|
|
97
98
|
}>;
|
|
98
99
|
export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
99
100
|
activeEmbeddable: AppState["activeEmbeddable"];
|
|
@@ -185,7 +186,7 @@ export type AppState = {
|
|
|
185
186
|
name: SidebarName;
|
|
186
187
|
tab?: SidebarTabName;
|
|
187
188
|
} | null;
|
|
188
|
-
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
189
|
+
openDialog: "imageExport" | "help" | "jsonExport" | "mermaid" | null;
|
|
189
190
|
/**
|
|
190
191
|
* Reflects user preference for whether the default sidebar should be docked.
|
|
191
192
|
*
|
|
@@ -261,7 +262,13 @@ export type AppState = {
|
|
|
261
262
|
Regular: string;
|
|
262
263
|
MajorGridFrequency?: number;
|
|
263
264
|
};
|
|
264
|
-
dynamicStyle:
|
|
265
|
+
dynamicStyle: {
|
|
266
|
+
[x: string]: string;
|
|
267
|
+
};
|
|
268
|
+
frameColor: {
|
|
269
|
+
stroke: string;
|
|
270
|
+
fill: string;
|
|
271
|
+
};
|
|
265
272
|
invertBindingBehaviour: boolean;
|
|
266
273
|
selectedLinearElement: LinearElementEditor | null;
|
|
267
274
|
snapLines: readonly SnapLine[];
|
|
@@ -434,10 +441,11 @@ export type AppClassProperties = {
|
|
|
434
441
|
lastViewportPosition: App["lastViewportPosition"];
|
|
435
442
|
scrollToContent: App["scrollToContent"];
|
|
436
443
|
addFiles: App["addFiles"];
|
|
437
|
-
setSelection: App["setSelection"];
|
|
438
444
|
addElementsFromPasteOrLibrary: App["addElementsFromPasteOrLibrary"];
|
|
445
|
+
setSelection: App["setSelection"];
|
|
439
446
|
togglePenMode: App["togglePenMode"];
|
|
440
447
|
setActiveTool: App["setActiveTool"];
|
|
448
|
+
setOpenDialog: App["setOpenDialog"];
|
|
441
449
|
};
|
|
442
450
|
export type PointerDownState = Readonly<{
|
|
443
451
|
origin: Readonly<{
|
package/types/utils.d.ts
CHANGED
|
@@ -195,3 +195,5 @@ export declare const memoize: <T extends Record<string, any>, R extends unknown>
|
|
|
195
195
|
clear: () => void;
|
|
196
196
|
};
|
|
197
197
|
export declare const isRenderThrottlingEnabled: () => boolean;
|
|
198
|
+
/** Checks if value is inside given collection. Useful for type-safety. */
|
|
199
|
+
export declare const isMemberOf: <T extends string>(collection: Set<T> | Record<T, any> | Map<T, any> | readonly T[], value: string) => value is T;
|
package/types/zindex.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExcalidrawElement } from "./element/types";
|
|
2
2
|
import { AppState } from "./types";
|
|
3
|
-
export declare const moveOneLeft: (
|
|
4
|
-
export declare const moveOneRight: (
|
|
5
|
-
export declare const moveAllLeft: (
|
|
6
|
-
export declare const moveAllRight: (
|
|
3
|
+
export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[];
|
|
4
|
+
export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[];
|
|
5
|
+
export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
|
|
6
|
+
export declare const moveAllRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
|