@zsviczian/excalidraw 0.12.0-obsidian-2 → 0.12.0-obsidian-5
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 +30 -19
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +3 -0
- package/types/actions/actionBoundText.d.ts +1 -0
- package/types/actions/actionCanvas.d.ts +9 -0
- package/types/actions/actionClipboard.d.ts +7 -0
- package/types/actions/actionDeleteSelected.d.ts +5 -0
- package/types/actions/actionExport.d.ts +9 -0
- package/types/actions/actionFinalize.d.ts +2 -0
- package/types/actions/actionMenu.d.ts +3 -0
- package/types/actions/actionProperties.d.ts +13 -0
- package/types/actions/actionSelectAll.d.ts +1 -1
- package/types/actions/actionStyles.d.ts +1 -0
- package/types/actions/actionToggleGridMode.d.ts +1 -0
- package/types/actions/actionToggleLock.d.ts +106 -1
- package/types/actions/actionToggleStats.d.ts +1 -0
- package/types/actions/actionToggleViewMode.d.ts +1 -0
- package/types/actions/actionToggleZenMode.d.ts +1 -0
- package/types/appState.d.ts +1 -1
- package/types/components/App.d.ts +2 -0
- package/types/element/Hyperlink.d.ts +1 -0
- package/types/element/linearElementEditor.d.ts +27 -15
- package/types/element/transformHandles.d.ts +4 -3
- package/types/polyfill.d.ts +2 -0
- package/types/renderer/renderScene.d.ts +1 -0
- package/types/types.d.ts +1 -0
|
@@ -4,25 +4,27 @@ import { Point, AppState } from "../types";
|
|
|
4
4
|
import History from "../history";
|
|
5
5
|
import Scene from "../scene/Scene";
|
|
6
6
|
export declare class LinearElementEditor {
|
|
7
|
-
elementId: ExcalidrawElement["id"] & {
|
|
7
|
+
readonly elementId: ExcalidrawElement["id"] & {
|
|
8
8
|
_brand: "excalidrawLinearElementId";
|
|
9
9
|
};
|
|
10
10
|
/** indices */
|
|
11
|
-
selectedPointsIndices: readonly number[] | null;
|
|
12
|
-
pointerDownState: Readonly<{
|
|
11
|
+
readonly selectedPointsIndices: readonly number[] | null;
|
|
12
|
+
readonly pointerDownState: Readonly<{
|
|
13
13
|
prevSelectedPointsIndices: readonly number[] | null;
|
|
14
14
|
/** index */
|
|
15
15
|
lastClickedPoint: number;
|
|
16
16
|
}>;
|
|
17
17
|
/** whether you're dragging a point */
|
|
18
|
-
isDragging: boolean;
|
|
19
|
-
lastUncommittedPoint: Point | null;
|
|
20
|
-
pointerOffset: Readonly<{
|
|
18
|
+
readonly isDragging: boolean;
|
|
19
|
+
readonly lastUncommittedPoint: Point | null;
|
|
20
|
+
readonly pointerOffset: Readonly<{
|
|
21
21
|
x: number;
|
|
22
22
|
y: number;
|
|
23
23
|
}>;
|
|
24
|
-
startBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
25
|
-
endBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
24
|
+
readonly startBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
25
|
+
readonly endBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
26
|
+
readonly hoverPointIndex: number;
|
|
27
|
+
readonly midPointHovered: boolean;
|
|
26
28
|
constructor(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene);
|
|
27
29
|
static POINT_HANDLE_SIZE: number;
|
|
28
30
|
/**
|
|
@@ -32,23 +34,30 @@ export declare class LinearElementEditor {
|
|
|
32
34
|
static getElement(id: InstanceType<typeof LinearElementEditor>["elementId"]): NonDeleted<ExcalidrawLinearElement> | null;
|
|
33
35
|
static handleBoxSelection(event: PointerEvent, appState: AppState, setState: React.Component<any, AppState>["setState"]): false | undefined;
|
|
34
36
|
/** @returns whether point was dragged */
|
|
35
|
-
static handlePointDragging(
|
|
37
|
+
static handlePointDragging(event: PointerEvent, appState: AppState, scenePointerX: number, scenePointerY: number, maybeSuggestBinding: (element: NonDeleted<ExcalidrawLinearElement>, pointSceneCoords: {
|
|
36
38
|
x: number;
|
|
37
39
|
y: number;
|
|
38
|
-
}[]) => void): boolean;
|
|
40
|
+
}[]) => void, linearElementEditor: LinearElementEditor): boolean;
|
|
39
41
|
static handlePointerUp(event: PointerEvent, editingLinearElement: LinearElementEditor, appState: AppState): LinearElementEditor;
|
|
40
|
-
static
|
|
42
|
+
static isHittingMidPoint: (linearElementEditor: LinearElementEditor, scenePointer: {
|
|
41
43
|
x: number;
|
|
42
44
|
y: number;
|
|
43
|
-
}
|
|
45
|
+
}, appState: AppState) => boolean;
|
|
46
|
+
static getMidPoint(linearElementEditor: LinearElementEditor): readonly [number, number] | null;
|
|
47
|
+
static handlePointerDown(event: React.PointerEvent<HTMLCanvasElement>, appState: AppState, history: History, scenePointer: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}, linearElementEditor: LinearElementEditor): {
|
|
44
51
|
didAddPoint: boolean;
|
|
45
52
|
hitElement: NonDeleted<ExcalidrawElement> | null;
|
|
53
|
+
linearElementEditor: LinearElementEditor | null;
|
|
54
|
+
isMidPoint: boolean;
|
|
46
55
|
};
|
|
47
|
-
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number,
|
|
56
|
+
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor, gridSize: number | null): LinearElementEditor;
|
|
48
57
|
/** scene coords */
|
|
49
58
|
static getPointGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, point: Point): readonly [number, number];
|
|
50
59
|
/** scene coords */
|
|
51
|
-
static getPointsGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>):
|
|
60
|
+
static getPointsGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>): Point[];
|
|
52
61
|
static getPointAtIndexGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, indexMaybeFromEnd: number): Point;
|
|
53
62
|
static pointFromAbsoluteCoords(element: NonDeleted<ExcalidrawLinearElement>, absoluteCoords: Point): Point;
|
|
54
63
|
static getPointIndexUnderCursor(element: NonDeleted<ExcalidrawLinearElement>, zoom: AppState["zoom"], x: number, y: number): number;
|
|
@@ -76,7 +85,6 @@ export declare class LinearElementEditor {
|
|
|
76
85
|
/** index */
|
|
77
86
|
lastClickedPoint: number;
|
|
78
87
|
}>;
|
|
79
|
-
/** whether you're dragging a point */
|
|
80
88
|
isDragging: boolean;
|
|
81
89
|
lastUncommittedPoint: readonly [number, number] | null;
|
|
82
90
|
pointerOffset: Readonly<{
|
|
@@ -85,6 +93,8 @@ export declare class LinearElementEditor {
|
|
|
85
93
|
}>;
|
|
86
94
|
startBindingElement: ExcalidrawBindableElement | "keep" | null;
|
|
87
95
|
endBindingElement: ExcalidrawBindableElement | "keep" | null;
|
|
96
|
+
hoverPointIndex: number;
|
|
97
|
+
midPointHovered: boolean;
|
|
88
98
|
};
|
|
89
99
|
isLoading: boolean;
|
|
90
100
|
errorMessage: string | null;
|
|
@@ -188,6 +198,7 @@ export declare class LinearElementEditor {
|
|
|
188
198
|
elementBackground?: string[] | undefined;
|
|
189
199
|
elementStroke?: string[] | undefined;
|
|
190
200
|
};
|
|
201
|
+
selectedLinearElement: LinearElementEditor | null;
|
|
191
202
|
};
|
|
192
203
|
};
|
|
193
204
|
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, pointIndices: readonly number[]): void;
|
|
@@ -203,4 +214,5 @@ export declare class LinearElementEditor {
|
|
|
203
214
|
endBinding?: PointBinding;
|
|
204
215
|
}): void;
|
|
205
216
|
private static _updatePoints;
|
|
217
|
+
private static _getShiftLockedDelta;
|
|
206
218
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExcalidrawElement, PointerType } from "./types";
|
|
1
|
+
import { ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
|
|
2
2
|
import { Bounds } from "./bounds";
|
|
3
3
|
import { Zoom } from "../types";
|
|
4
4
|
export declare type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
|
|
@@ -17,12 +17,13 @@ export declare const OMIT_SIDES_FOR_MULTIPLE_ELEMENTS: {
|
|
|
17
17
|
export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, zoom: Zoom, pointerType: PointerType, omitSides?: {
|
|
18
18
|
e?: boolean | undefined;
|
|
19
19
|
s?: boolean | undefined;
|
|
20
|
-
n?: boolean | undefined;
|
|
21
20
|
w?: boolean | undefined;
|
|
21
|
+
n?: boolean | undefined;
|
|
22
22
|
nw?: boolean | undefined;
|
|
23
23
|
ne?: boolean | undefined;
|
|
24
24
|
sw?: boolean | undefined;
|
|
25
25
|
se?: boolean | undefined;
|
|
26
26
|
rotation?: boolean | undefined;
|
|
27
|
-
}) => TransformHandles;
|
|
27
|
+
}, margin?: number) => TransformHandles;
|
|
28
28
|
export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoom, pointerType?: PointerType) => TransformHandles;
|
|
29
|
+
export declare const shouldShowBoundingBox: (elements: NonDeletedExcalidrawElement[]) => boolean;
|
|
@@ -3,6 +3,7 @@ import { RoughSVG } from "roughjs/bin/svg";
|
|
|
3
3
|
import { AppState, BinaryFiles } from "../types";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
import { RenderConfig } from "../scene/types";
|
|
6
|
+
export declare const DEFAULT_SPACING = 4;
|
|
6
7
|
export declare const _renderScene: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, selectionElement: NonDeletedExcalidrawElement | null, scale: number, rc: RoughCanvas, canvas: HTMLCanvasElement, renderConfig: RenderConfig) => {
|
|
7
8
|
atLeastOneVisibleElement: boolean;
|
|
8
9
|
scrollBars?: undefined;
|
package/types/types.d.ts
CHANGED