@zsviczian/excalidraw 0.12.0-obsidian-4 → 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 +23 -12
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionClipboard.d.ts +1 -0
- package/types/actions/actionDeleteSelected.d.ts +1 -0
- package/types/element/linearElementEditor.d.ts +20 -12
- package/types/element/transformHandles.d.ts +4 -3
- package/types/polyfill.d.ts +2 -0
- package/types/renderer/renderScene.d.ts +1 -0
package/package.json
CHANGED
|
@@ -4,26 +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";
|
|
26
|
-
hoverPointIndex: number;
|
|
24
|
+
readonly startBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
25
|
+
readonly endBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
26
|
+
readonly hoverPointIndex: number;
|
|
27
|
+
readonly midPointHovered: boolean;
|
|
27
28
|
constructor(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene);
|
|
28
29
|
static POINT_HANDLE_SIZE: number;
|
|
29
30
|
/**
|
|
@@ -33,11 +34,16 @@ export declare class LinearElementEditor {
|
|
|
33
34
|
static getElement(id: InstanceType<typeof LinearElementEditor>["elementId"]): NonDeleted<ExcalidrawLinearElement> | null;
|
|
34
35
|
static handleBoxSelection(event: PointerEvent, appState: AppState, setState: React.Component<any, AppState>["setState"]): false | undefined;
|
|
35
36
|
/** @returns whether point was dragged */
|
|
36
|
-
static handlePointDragging(appState: AppState, scenePointerX: number, scenePointerY: number, maybeSuggestBinding: (element: NonDeleted<ExcalidrawLinearElement>, pointSceneCoords: {
|
|
37
|
+
static handlePointDragging(event: PointerEvent, appState: AppState, scenePointerX: number, scenePointerY: number, maybeSuggestBinding: (element: NonDeleted<ExcalidrawLinearElement>, pointSceneCoords: {
|
|
37
38
|
x: number;
|
|
38
39
|
y: number;
|
|
39
40
|
}[]) => void, linearElementEditor: LinearElementEditor): boolean;
|
|
40
41
|
static handlePointerUp(event: PointerEvent, editingLinearElement: LinearElementEditor, appState: AppState): LinearElementEditor;
|
|
42
|
+
static isHittingMidPoint: (linearElementEditor: LinearElementEditor, scenePointer: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}, appState: AppState) => boolean;
|
|
46
|
+
static getMidPoint(linearElementEditor: LinearElementEditor): readonly [number, number] | null;
|
|
41
47
|
static handlePointerDown(event: React.PointerEvent<HTMLCanvasElement>, appState: AppState, history: History, scenePointer: {
|
|
42
48
|
x: number;
|
|
43
49
|
y: number;
|
|
@@ -45,12 +51,13 @@ export declare class LinearElementEditor {
|
|
|
45
51
|
didAddPoint: boolean;
|
|
46
52
|
hitElement: NonDeleted<ExcalidrawElement> | null;
|
|
47
53
|
linearElementEditor: LinearElementEditor | null;
|
|
54
|
+
isMidPoint: boolean;
|
|
48
55
|
};
|
|
49
56
|
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor, gridSize: number | null): LinearElementEditor;
|
|
50
57
|
/** scene coords */
|
|
51
58
|
static getPointGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, point: Point): readonly [number, number];
|
|
52
59
|
/** scene coords */
|
|
53
|
-
static getPointsGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>):
|
|
60
|
+
static getPointsGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>): Point[];
|
|
54
61
|
static getPointAtIndexGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, indexMaybeFromEnd: number): Point;
|
|
55
62
|
static pointFromAbsoluteCoords(element: NonDeleted<ExcalidrawLinearElement>, absoluteCoords: Point): Point;
|
|
56
63
|
static getPointIndexUnderCursor(element: NonDeleted<ExcalidrawLinearElement>, zoom: AppState["zoom"], x: number, y: number): number;
|
|
@@ -78,7 +85,6 @@ export declare class LinearElementEditor {
|
|
|
78
85
|
/** index */
|
|
79
86
|
lastClickedPoint: number;
|
|
80
87
|
}>;
|
|
81
|
-
/** whether you're dragging a point */
|
|
82
88
|
isDragging: boolean;
|
|
83
89
|
lastUncommittedPoint: readonly [number, number] | null;
|
|
84
90
|
pointerOffset: Readonly<{
|
|
@@ -88,6 +94,7 @@ export declare class LinearElementEditor {
|
|
|
88
94
|
startBindingElement: ExcalidrawBindableElement | "keep" | null;
|
|
89
95
|
endBindingElement: ExcalidrawBindableElement | "keep" | null;
|
|
90
96
|
hoverPointIndex: number;
|
|
97
|
+
midPointHovered: boolean;
|
|
91
98
|
};
|
|
92
99
|
isLoading: boolean;
|
|
93
100
|
errorMessage: string | null;
|
|
@@ -207,4 +214,5 @@ export declare class LinearElementEditor {
|
|
|
207
214
|
endBinding?: PointBinding;
|
|
208
215
|
}): void;
|
|
209
216
|
private static _updatePoints;
|
|
217
|
+
private static _getShiftLockedDelta;
|
|
210
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;
|