@excalidraw/math 0.18.0-b1c6bfc → 0.18.0-b2b2815
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.map +2 -2
- package/dist/prod/index.js +1 -1
- package/dist/types/element/src/Scene.d.ts +5 -3
- package/dist/types/element/src/duplicate.d.ts +1 -0
- package/dist/types/element/src/frame.d.ts +6 -5
- package/dist/types/element/src/typeChecks.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +0 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +0 -12
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +0 -3
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +0 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +0 -1
- package/dist/types/excalidraw/components/App.d.ts +9 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/shapes.d.ts +7 -0
- package/dist/types/excalidraw/data/blob.d.ts +0 -2
- package/dist/types/excalidraw/data/json.d.ts +0 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +425 -19
- package/dist/types/excalidraw/types.d.ts +5 -2
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/package.json +2 -2
|
@@ -1,30 +1,436 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { RenderableElementsMap } from "./types";
|
|
4
4
|
import type { AppState } from "../types";
|
|
5
|
+
type GetRenderableElementsOpts = {
|
|
6
|
+
zoom: AppState["zoom"];
|
|
7
|
+
offsetLeft: AppState["offsetLeft"];
|
|
8
|
+
offsetTop: AppState["offsetTop"];
|
|
9
|
+
scrollX: AppState["scrollX"];
|
|
10
|
+
scrollY: AppState["scrollY"];
|
|
11
|
+
height: AppState["height"];
|
|
12
|
+
width: AppState["width"];
|
|
13
|
+
editingTextElement: AppState["editingTextElement"];
|
|
14
|
+
newElement: AppState["newElement"];
|
|
15
|
+
selectedElements: readonly NonDeletedExcalidrawElement[];
|
|
16
|
+
selectedElementsAreBeingDragged: AppState["selectedElementsAreBeingDragged"];
|
|
17
|
+
frameToHighlight: AppState["frameToHighlight"];
|
|
18
|
+
};
|
|
5
19
|
export declare class Renderer {
|
|
6
20
|
private scene;
|
|
7
21
|
constructor(scene: Scene);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
offsetTop: AppState["offsetTop"];
|
|
14
|
-
scrollX: AppState["scrollX"];
|
|
15
|
-
scrollY: AppState["scrollY"];
|
|
16
|
-
height: AppState["height"];
|
|
17
|
-
width: AppState["width"];
|
|
18
|
-
editingTextElement: AppState["editingTextElement"];
|
|
19
|
-
/** note: first render of newElement will always bust the cache
|
|
20
|
-
* (we'd have to prefilter elements outside of this function) */
|
|
21
|
-
newElementId: ExcalidrawElement["id"] | undefined;
|
|
22
|
-
sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
|
|
23
|
-
}) => {
|
|
22
|
+
private getVisibleCanvasElements;
|
|
23
|
+
private getRenderableElementsMap;
|
|
24
|
+
private sortSelectedElementsIntoHighlightedFrame;
|
|
25
|
+
private _getRenderableElements;
|
|
26
|
+
getRenderableElements: (opts: GetRenderableElementsOpts) => {
|
|
24
27
|
elementsMap: RenderableElementsMap;
|
|
25
28
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
newElementCanvasElement: (Readonly<{
|
|
30
|
+
id: string;
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
strokeColor: string;
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
36
|
+
strokeWidth: number;
|
|
37
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
38
|
+
roundness: null | {
|
|
39
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
40
|
+
value?: number;
|
|
41
|
+
};
|
|
42
|
+
roughness: number;
|
|
43
|
+
opacity: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
angle: import("@excalidraw/math").Radians;
|
|
47
|
+
seed: number;
|
|
48
|
+
version: number;
|
|
49
|
+
versionNonce: number;
|
|
50
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
51
|
+
isDeleted: boolean;
|
|
52
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
53
|
+
frameId: string | null;
|
|
54
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
55
|
+
updated: number;
|
|
56
|
+
link: string | null;
|
|
57
|
+
locked: boolean;
|
|
58
|
+
customData?: Record<string, any>;
|
|
59
|
+
}> & Readonly<{
|
|
60
|
+
type: "line" | "arrow";
|
|
61
|
+
points: readonly import("@excalidraw/math").LocalPoint[];
|
|
62
|
+
startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
63
|
+
endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
64
|
+
startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
65
|
+
endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
66
|
+
}> & {
|
|
67
|
+
isDeleted: boolean;
|
|
68
|
+
}) | (Readonly<{
|
|
69
|
+
id: string;
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
strokeColor: string;
|
|
73
|
+
backgroundColor: string;
|
|
74
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
75
|
+
strokeWidth: number;
|
|
76
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
77
|
+
roundness: null | {
|
|
78
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
79
|
+
value?: number;
|
|
80
|
+
};
|
|
81
|
+
roughness: number;
|
|
82
|
+
opacity: number;
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
angle: import("@excalidraw/math").Radians;
|
|
86
|
+
seed: number;
|
|
87
|
+
version: number;
|
|
88
|
+
versionNonce: number;
|
|
89
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
90
|
+
isDeleted: boolean;
|
|
91
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
92
|
+
frameId: string | null;
|
|
93
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
94
|
+
updated: number;
|
|
95
|
+
link: string | null;
|
|
96
|
+
locked: boolean;
|
|
97
|
+
customData?: Record<string, any>;
|
|
98
|
+
}> & {
|
|
99
|
+
type: "rectangle";
|
|
100
|
+
} & {
|
|
101
|
+
isDeleted: boolean;
|
|
102
|
+
}) | (Readonly<{
|
|
103
|
+
id: string;
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
strokeColor: string;
|
|
107
|
+
backgroundColor: string;
|
|
108
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
109
|
+
strokeWidth: number;
|
|
110
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
111
|
+
roundness: null | {
|
|
112
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
113
|
+
value?: number;
|
|
114
|
+
};
|
|
115
|
+
roughness: number;
|
|
116
|
+
opacity: number;
|
|
117
|
+
width: number;
|
|
118
|
+
height: number;
|
|
119
|
+
angle: import("@excalidraw/math").Radians;
|
|
120
|
+
seed: number;
|
|
121
|
+
version: number;
|
|
122
|
+
versionNonce: number;
|
|
123
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
124
|
+
isDeleted: boolean;
|
|
125
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
126
|
+
frameId: string | null;
|
|
127
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
128
|
+
updated: number;
|
|
129
|
+
link: string | null;
|
|
130
|
+
locked: boolean;
|
|
131
|
+
customData?: Record<string, any>;
|
|
132
|
+
}> & {
|
|
133
|
+
type: "diamond";
|
|
134
|
+
} & {
|
|
135
|
+
isDeleted: boolean;
|
|
136
|
+
}) | (Readonly<{
|
|
137
|
+
id: string;
|
|
138
|
+
x: number;
|
|
139
|
+
y: number;
|
|
140
|
+
strokeColor: string;
|
|
141
|
+
backgroundColor: string;
|
|
142
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
143
|
+
strokeWidth: number;
|
|
144
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
145
|
+
roundness: null | {
|
|
146
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
147
|
+
value?: number;
|
|
148
|
+
};
|
|
149
|
+
roughness: number;
|
|
150
|
+
opacity: number;
|
|
151
|
+
width: number;
|
|
152
|
+
height: number;
|
|
153
|
+
angle: import("@excalidraw/math").Radians;
|
|
154
|
+
seed: number;
|
|
155
|
+
version: number;
|
|
156
|
+
versionNonce: number;
|
|
157
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
158
|
+
isDeleted: boolean;
|
|
159
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
160
|
+
frameId: string | null;
|
|
161
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
162
|
+
updated: number;
|
|
163
|
+
link: string | null;
|
|
164
|
+
locked: boolean;
|
|
165
|
+
customData?: Record<string, any>;
|
|
166
|
+
}> & {
|
|
167
|
+
type: "ellipse";
|
|
168
|
+
} & {
|
|
169
|
+
isDeleted: boolean;
|
|
170
|
+
}) | (Readonly<{
|
|
171
|
+
id: string;
|
|
172
|
+
x: number;
|
|
173
|
+
y: number;
|
|
174
|
+
strokeColor: string;
|
|
175
|
+
backgroundColor: string;
|
|
176
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
177
|
+
strokeWidth: number;
|
|
178
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
179
|
+
roundness: null | {
|
|
180
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
181
|
+
value?: number;
|
|
182
|
+
};
|
|
183
|
+
roughness: number;
|
|
184
|
+
opacity: number;
|
|
185
|
+
width: number;
|
|
186
|
+
height: number;
|
|
187
|
+
angle: import("@excalidraw/math").Radians;
|
|
188
|
+
seed: number;
|
|
189
|
+
version: number;
|
|
190
|
+
versionNonce: number;
|
|
191
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
192
|
+
isDeleted: boolean;
|
|
193
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
194
|
+
frameId: string | null;
|
|
195
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
196
|
+
updated: number;
|
|
197
|
+
link: string | null;
|
|
198
|
+
locked: boolean;
|
|
199
|
+
customData?: Record<string, any>;
|
|
200
|
+
}> & Readonly<{
|
|
201
|
+
type: "embeddable";
|
|
202
|
+
}> & {
|
|
203
|
+
isDeleted: boolean;
|
|
204
|
+
}) | (Readonly<{
|
|
205
|
+
id: string;
|
|
206
|
+
x: number;
|
|
207
|
+
y: number;
|
|
208
|
+
strokeColor: string;
|
|
209
|
+
backgroundColor: string;
|
|
210
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
211
|
+
strokeWidth: number;
|
|
212
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
213
|
+
roundness: null | {
|
|
214
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
215
|
+
value?: number;
|
|
216
|
+
};
|
|
217
|
+
roughness: number;
|
|
218
|
+
opacity: number;
|
|
219
|
+
width: number;
|
|
220
|
+
height: number;
|
|
221
|
+
angle: import("@excalidraw/math").Radians;
|
|
222
|
+
seed: number;
|
|
223
|
+
version: number;
|
|
224
|
+
versionNonce: number;
|
|
225
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
226
|
+
isDeleted: boolean;
|
|
227
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
228
|
+
frameId: string | null;
|
|
229
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
230
|
+
updated: number;
|
|
231
|
+
link: string | null;
|
|
232
|
+
locked: boolean;
|
|
233
|
+
customData?: Record<string, any>;
|
|
234
|
+
}> & Readonly<{
|
|
235
|
+
type: "iframe";
|
|
236
|
+
customData?: {
|
|
237
|
+
generationData?: import("@excalidraw/element/types").MagicGenerationData;
|
|
238
|
+
};
|
|
239
|
+
}> & {
|
|
240
|
+
isDeleted: boolean;
|
|
241
|
+
}) | (Readonly<{
|
|
242
|
+
id: string;
|
|
243
|
+
x: number;
|
|
244
|
+
y: number;
|
|
245
|
+
strokeColor: string;
|
|
246
|
+
backgroundColor: string;
|
|
247
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
248
|
+
strokeWidth: number;
|
|
249
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
250
|
+
roundness: null | {
|
|
251
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
252
|
+
value?: number;
|
|
253
|
+
};
|
|
254
|
+
roughness: number;
|
|
255
|
+
opacity: number;
|
|
256
|
+
width: number;
|
|
257
|
+
height: number;
|
|
258
|
+
angle: import("@excalidraw/math").Radians;
|
|
259
|
+
seed: number;
|
|
260
|
+
version: number;
|
|
261
|
+
versionNonce: number;
|
|
262
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
263
|
+
isDeleted: boolean;
|
|
264
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
265
|
+
frameId: string | null;
|
|
266
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
267
|
+
updated: number;
|
|
268
|
+
link: string | null;
|
|
269
|
+
locked: boolean;
|
|
270
|
+
customData?: Record<string, any>;
|
|
271
|
+
}> & Readonly<{
|
|
272
|
+
type: "image";
|
|
273
|
+
fileId: import("@excalidraw/element/types").FileId | null;
|
|
274
|
+
status: "pending" | "saved" | "error";
|
|
275
|
+
scale: [number, number];
|
|
276
|
+
crop: import("@excalidraw/element/types").ImageCrop | null;
|
|
277
|
+
}> & {
|
|
278
|
+
isDeleted: boolean;
|
|
279
|
+
}) | (Readonly<{
|
|
280
|
+
id: string;
|
|
281
|
+
x: number;
|
|
282
|
+
y: number;
|
|
283
|
+
strokeColor: string;
|
|
284
|
+
backgroundColor: string;
|
|
285
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
286
|
+
strokeWidth: number;
|
|
287
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
288
|
+
roundness: null | {
|
|
289
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
290
|
+
value?: number;
|
|
291
|
+
};
|
|
292
|
+
roughness: number;
|
|
293
|
+
opacity: number;
|
|
294
|
+
width: number;
|
|
295
|
+
height: number;
|
|
296
|
+
angle: import("@excalidraw/math").Radians;
|
|
297
|
+
seed: number;
|
|
298
|
+
version: number;
|
|
299
|
+
versionNonce: number;
|
|
300
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
301
|
+
isDeleted: boolean;
|
|
302
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
303
|
+
frameId: string | null;
|
|
304
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
305
|
+
updated: number;
|
|
306
|
+
link: string | null;
|
|
307
|
+
locked: boolean;
|
|
308
|
+
customData?: Record<string, any>;
|
|
309
|
+
}> & {
|
|
310
|
+
type: "frame";
|
|
311
|
+
name: string | null;
|
|
312
|
+
} & {
|
|
313
|
+
isDeleted: boolean;
|
|
314
|
+
}) | (Readonly<{
|
|
315
|
+
id: string;
|
|
316
|
+
x: number;
|
|
317
|
+
y: number;
|
|
318
|
+
strokeColor: string;
|
|
319
|
+
backgroundColor: string;
|
|
320
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
321
|
+
strokeWidth: number;
|
|
322
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
323
|
+
roundness: null | {
|
|
324
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
325
|
+
value?: number;
|
|
326
|
+
};
|
|
327
|
+
roughness: number;
|
|
328
|
+
opacity: number;
|
|
329
|
+
width: number;
|
|
330
|
+
height: number;
|
|
331
|
+
angle: import("@excalidraw/math").Radians;
|
|
332
|
+
seed: number;
|
|
333
|
+
version: number;
|
|
334
|
+
versionNonce: number;
|
|
335
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
336
|
+
isDeleted: boolean;
|
|
337
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
338
|
+
frameId: string | null;
|
|
339
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
340
|
+
updated: number;
|
|
341
|
+
link: string | null;
|
|
342
|
+
locked: boolean;
|
|
343
|
+
customData?: Record<string, any>;
|
|
344
|
+
}> & {
|
|
345
|
+
type: "magicframe";
|
|
346
|
+
name: string | null;
|
|
347
|
+
} & {
|
|
348
|
+
isDeleted: boolean;
|
|
349
|
+
}) | (Readonly<{
|
|
350
|
+
id: string;
|
|
351
|
+
x: number;
|
|
352
|
+
y: number;
|
|
353
|
+
strokeColor: string;
|
|
354
|
+
backgroundColor: string;
|
|
355
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
356
|
+
strokeWidth: number;
|
|
357
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
358
|
+
roundness: null | {
|
|
359
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
360
|
+
value?: number;
|
|
361
|
+
};
|
|
362
|
+
roughness: number;
|
|
363
|
+
opacity: number;
|
|
364
|
+
width: number;
|
|
365
|
+
height: number;
|
|
366
|
+
angle: import("@excalidraw/math").Radians;
|
|
367
|
+
seed: number;
|
|
368
|
+
version: number;
|
|
369
|
+
versionNonce: number;
|
|
370
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
371
|
+
isDeleted: boolean;
|
|
372
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
373
|
+
frameId: string | null;
|
|
374
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
375
|
+
updated: number;
|
|
376
|
+
link: string | null;
|
|
377
|
+
locked: boolean;
|
|
378
|
+
customData?: Record<string, any>;
|
|
379
|
+
}> & Readonly<{
|
|
380
|
+
type: "text";
|
|
381
|
+
fontSize: number;
|
|
382
|
+
fontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
383
|
+
text: string;
|
|
384
|
+
textAlign: import("@excalidraw/element/types").TextAlign;
|
|
385
|
+
verticalAlign: import("@excalidraw/element/types").VerticalAlign;
|
|
386
|
+
containerId: import("@excalidraw/element/types").ExcalidrawGenericElement["id"] | null;
|
|
387
|
+
originalText: string;
|
|
388
|
+
autoResize: boolean;
|
|
389
|
+
lineHeight: number & {
|
|
390
|
+
_brand: "unitlessLineHeight";
|
|
391
|
+
};
|
|
392
|
+
}> & {
|
|
393
|
+
isDeleted: boolean;
|
|
394
|
+
}) | (Readonly<{
|
|
395
|
+
id: string;
|
|
396
|
+
x: number;
|
|
397
|
+
y: number;
|
|
398
|
+
strokeColor: string;
|
|
399
|
+
backgroundColor: string;
|
|
400
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
401
|
+
strokeWidth: number;
|
|
402
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
403
|
+
roundness: null | {
|
|
404
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
405
|
+
value?: number;
|
|
406
|
+
};
|
|
407
|
+
roughness: number;
|
|
408
|
+
opacity: number;
|
|
409
|
+
width: number;
|
|
410
|
+
height: number;
|
|
411
|
+
angle: import("@excalidraw/math").Radians;
|
|
412
|
+
seed: number;
|
|
413
|
+
version: number;
|
|
414
|
+
versionNonce: number;
|
|
415
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
416
|
+
isDeleted: boolean;
|
|
417
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
418
|
+
frameId: string | null;
|
|
419
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
420
|
+
updated: number;
|
|
421
|
+
link: string | null;
|
|
422
|
+
locked: boolean;
|
|
423
|
+
customData?: Record<string, any>;
|
|
424
|
+
}> & Readonly<{
|
|
425
|
+
type: "freedraw";
|
|
426
|
+
points: readonly import("@excalidraw/math").LocalPoint[];
|
|
427
|
+
pressures: readonly number[];
|
|
428
|
+
simulatePressure: boolean;
|
|
429
|
+
}> & {
|
|
430
|
+
isDeleted: boolean;
|
|
431
|
+
}) | null;
|
|
432
|
+
canvasNonce: string;
|
|
28
433
|
};
|
|
29
434
|
destroy(): void;
|
|
30
435
|
}
|
|
436
|
+
export {};
|
|
@@ -217,7 +217,10 @@ export interface AppState {
|
|
|
217
217
|
bindingPreference: "enabled" | "disabled";
|
|
218
218
|
/** user preference whether arrow snap to midpoints while binding */
|
|
219
219
|
isMidpointSnappingEnabled: boolean;
|
|
220
|
-
|
|
220
|
+
/**
|
|
221
|
+
* The bindable element the UI highlights for the user when an arrow is
|
|
222
|
+
* dragged or otherwise its endpoint being close to said element.
|
|
223
|
+
*/
|
|
221
224
|
suggestedBinding: {
|
|
222
225
|
element: NonDeleted<ExcalidrawBindableElement>;
|
|
223
226
|
midPoint?: GlobalPoint;
|
|
@@ -389,7 +392,7 @@ export type SearchMatch = {
|
|
|
389
392
|
showOnCanvas: boolean;
|
|
390
393
|
}[];
|
|
391
394
|
};
|
|
392
|
-
export type UIAppState = Omit<AppState, "
|
|
395
|
+
export type UIAppState = Omit<AppState, "cursorButton" | "scrollX" | "scrollY">;
|
|
393
396
|
export type NormalizedZoomValue = number & {
|
|
394
397
|
_brand: "normalizedZoom";
|
|
395
398
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const BASE_62_DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} key
|
|
4
|
+
* @param {string} digits
|
|
5
|
+
* @return {void}
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateOrderKey(key: string, digits?: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* @param {string | null | undefined} a
|
|
10
|
+
* @param {string | null | undefined} b
|
|
11
|
+
* @param {string=} digits
|
|
12
|
+
* @return {string}
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateKeyBetween(a: string | null | undefined, b: string | null | undefined, digits?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* same preconditions as generateKeysBetween.
|
|
17
|
+
* n >= 0.
|
|
18
|
+
* Returns an array of n distinct keys in sorted order.
|
|
19
|
+
* If a and b are both null, returns [a0, a1, ...]
|
|
20
|
+
* If one or the other is null, returns consecutive "integer"
|
|
21
|
+
* keys. Otherwise, returns relatively short keys between
|
|
22
|
+
* a and b.
|
|
23
|
+
* @param {string | null | undefined} a
|
|
24
|
+
* @param {string | null | undefined} b
|
|
25
|
+
* @param {number} n
|
|
26
|
+
* @param {string} digits
|
|
27
|
+
* @return {string[]}
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateNKeysBetween(a: string | null | undefined, b: string | null | undefined, n: number, digits?: string): string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@excalidraw/math",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-b2b2815",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/math/src/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@excalidraw/common": "0.18.0-
|
|
64
|
+
"@excalidraw/common": "0.18.0-b2b2815"
|
|
65
65
|
}
|
|
66
66
|
}
|