@dwelle/excalidraw 0.3.74 → 0.3.75
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
|
-
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
4
|
+
import { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
import History from "../history";
|
|
6
6
|
import Scene from "../scene/Scene";
|
|
7
7
|
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
|
|
@@ -45,6 +45,84 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
45
45
|
y: number;
|
|
46
46
|
} | null;
|
|
47
47
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
48
|
+
onPointerDownEmitter: Emitter<[activeTool: {
|
|
49
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
50
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
51
|
+
locked: boolean;
|
|
52
|
+
customType: null;
|
|
53
|
+
} | {
|
|
54
|
+
type: "custom";
|
|
55
|
+
customType: string;
|
|
56
|
+
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
57
|
+
locked: boolean;
|
|
58
|
+
}, pointerDownState: Readonly<{
|
|
59
|
+
origin: Readonly<{
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
}>;
|
|
63
|
+
originInGrid: Readonly<{
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
}>;
|
|
67
|
+
scrollbars: {
|
|
68
|
+
isOverEither: boolean;
|
|
69
|
+
isOverHorizontal: boolean;
|
|
70
|
+
isOverVertical: boolean;
|
|
71
|
+
};
|
|
72
|
+
lastCoords: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
|
|
77
|
+
resize: {
|
|
78
|
+
handleType: import("../element/transformHandles").MaybeTransformHandleType;
|
|
79
|
+
isResizing: boolean;
|
|
80
|
+
offset: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
};
|
|
84
|
+
arrowDirection: "end" | "origin";
|
|
85
|
+
center: {
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
hit: {
|
|
91
|
+
element: NonDeleted<ExcalidrawElement> | null;
|
|
92
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
93
|
+
wasAddedToSelection: boolean;
|
|
94
|
+
hasBeenDuplicated: boolean;
|
|
95
|
+
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
96
|
+
hasHitElementInside: boolean;
|
|
97
|
+
};
|
|
98
|
+
withCmdOrCtrl: boolean;
|
|
99
|
+
drag: {
|
|
100
|
+
hasOccurred: boolean;
|
|
101
|
+
offset: {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
} | null;
|
|
105
|
+
};
|
|
106
|
+
eventListeners: {
|
|
107
|
+
onMove: {
|
|
108
|
+
(...args: any[]): void;
|
|
109
|
+
flush(): void;
|
|
110
|
+
cancel(): void;
|
|
111
|
+
} | null;
|
|
112
|
+
onUp: ((event: PointerEvent) => void) | null;
|
|
113
|
+
onKeyDown: ((event: KeyboardEvent) => void) | null;
|
|
114
|
+
onKeyUp: ((event: KeyboardEvent) => void) | null;
|
|
115
|
+
};
|
|
116
|
+
boxSelection: {
|
|
117
|
+
hasOccurred: boolean;
|
|
118
|
+
};
|
|
119
|
+
elementIdsToErase: {
|
|
120
|
+
[key: string]: {
|
|
121
|
+
opacity: number;
|
|
122
|
+
erase: boolean;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
}>, event: React.PointerEvent<HTMLCanvasElement>]>;
|
|
48
126
|
constructor(props: AppProps);
|
|
49
127
|
private renderCanvas;
|
|
50
128
|
render(): JSX.Element;
|
package/types/types.d.ts
CHANGED
|
@@ -380,6 +380,7 @@ export declare type ExcalidrawImperativeAPI = {
|
|
|
380
380
|
resetCursor: InstanceType<typeof App>["resetCursor"];
|
|
381
381
|
app: InstanceType<typeof App>;
|
|
382
382
|
onChange: (callback: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => void) => UnsubscribeCallback;
|
|
383
|
+
onPointerDown: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: React.PointerEvent<HTMLCanvasElement>) => void) => UnsubscribeCallback;
|
|
383
384
|
};
|
|
384
385
|
export declare type Device = Readonly<{
|
|
385
386
|
isSmScreen: boolean;
|