@inditextech/weave-sdk 5.4.0 → 5.4.1
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/sdk.js +292 -78
- package/dist/sdk.node.js +293 -79
- package/dist/sdk.node.stats.html +1 -1
- package/dist/sdk.stats.html +1 -1
- package/dist/types.d.ts +124 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +292 -78
- package/dist/types.js.map +1 -1
- package/dist/types.stats.html +1 -1
- package/package.json +2 -2
package/dist/types.js
CHANGED
|
@@ -9466,7 +9466,7 @@ var WeaveRegisterManager = class {
|
|
|
9466
9466
|
};
|
|
9467
9467
|
//#endregion
|
|
9468
9468
|
//#region package.json
|
|
9469
|
-
var version = "5.4.
|
|
9469
|
+
var version = "5.4.1";
|
|
9470
9470
|
//#endregion
|
|
9471
9471
|
//#region src/managers/setup.ts
|
|
9472
9472
|
var WeaveSetupManager = class {
|
|
@@ -18068,21 +18068,29 @@ var WeaveFrameNode = class extends WeaveNode {
|
|
|
18068
18068
|
const WEAVE_STROKE_NODE_TYPE = "stroke";
|
|
18069
18069
|
const WEAVE_STROKE_NODE_DEFAULT_CONFIG = {
|
|
18070
18070
|
splineResolution: 8,
|
|
18071
|
+
splineTargetEdge: 1,
|
|
18072
|
+
splineMaxSteps: 48,
|
|
18071
18073
|
resamplingSpacing: 2,
|
|
18072
18074
|
isEraser: false
|
|
18073
18075
|
};
|
|
18074
18076
|
//#endregion
|
|
18075
18077
|
//#region src/nodes/stroke/stroke.ts
|
|
18076
|
-
var WeaveStrokeNode = class extends WeaveNode {
|
|
18078
|
+
var WeaveStrokeNode = class WeaveStrokeNode extends WeaveNode {
|
|
18077
18079
|
config;
|
|
18078
18080
|
nodeType = WEAVE_STROKE_NODE_TYPE;
|
|
18079
18081
|
initialize = void 0;
|
|
18082
|
+
/**
|
|
18083
|
+
* Below this chord deviation (in canvas units) a spline span is treated as
|
|
18084
|
+
* straight and emitted as a single edge. Subdividing a straight span costs
|
|
18085
|
+
* vertices without changing any pixel.
|
|
18086
|
+
*/
|
|
18087
|
+
static SPLINE_FLATNESS_EPSILON = .08;
|
|
18080
18088
|
constructor(params) {
|
|
18081
18089
|
super();
|
|
18082
18090
|
const { config } = params ?? {};
|
|
18083
18091
|
this.config = mergeExceptArrays(WEAVE_STROKE_NODE_DEFAULT_CONFIG, config);
|
|
18084
18092
|
}
|
|
18085
|
-
resamplePoints(pts, minDist =
|
|
18093
|
+
resamplePoints(pts, minDist = this.config.resamplingSpacing) {
|
|
18086
18094
|
if (pts.length < 2) return pts;
|
|
18087
18095
|
const result = [pts[0]];
|
|
18088
18096
|
let last = pts[0];
|
|
@@ -18096,29 +18104,73 @@ var WeaveStrokeNode = class extends WeaveNode {
|
|
|
18096
18104
|
}
|
|
18097
18105
|
return result;
|
|
18098
18106
|
}
|
|
18099
|
-
|
|
18107
|
+
/** Perpendicular distance from `p` to the segment `a`-`b`. */
|
|
18108
|
+
distanceToSegment(p, a, b) {
|
|
18109
|
+
const dx = b.x - a.x;
|
|
18110
|
+
const dy = b.y - a.y;
|
|
18111
|
+
const lengthSq = dx * dx + dy * dy;
|
|
18112
|
+
let t = lengthSq ? ((p.x - a.x) * dx + (p.y - a.y) * dy) / lengthSq : 0;
|
|
18113
|
+
t = Math.max(0, Math.min(1, t));
|
|
18114
|
+
return Math.hypot(p.x - (a.x + dx * t), p.y - (a.y + dy * t));
|
|
18115
|
+
}
|
|
18116
|
+
/**
|
|
18117
|
+
* Evaluates the uniform Catmull-Rom basis for one 4-point window at `t`.
|
|
18118
|
+
*/
|
|
18119
|
+
catmullRomAt(p0, p1, p2, p3, t) {
|
|
18120
|
+
const tt = t * t;
|
|
18121
|
+
const ttt = tt * t;
|
|
18122
|
+
const q1 = -ttt + 2 * tt - t;
|
|
18123
|
+
const q2 = 3 * ttt - 5 * tt + 2;
|
|
18124
|
+
const q3 = -3 * ttt + 4 * tt + t;
|
|
18125
|
+
const q4 = ttt - tt;
|
|
18126
|
+
return {
|
|
18127
|
+
x: (q1 * p0.x + q2 * p1.x + q3 * p2.x + q4 * p3.x) / 2,
|
|
18128
|
+
y: (q1 * p0.y + q2 * p1.y + q3 * p2.y + q4 * p3.y) / 2,
|
|
18129
|
+
pressure: (q1 * p0.pressure + q2 * p1.pressure + q3 * p2.pressure + q4 * p3.pressure) / 2
|
|
18130
|
+
};
|
|
18131
|
+
}
|
|
18132
|
+
/**
|
|
18133
|
+
* Samples a Catmull-Rom spline through `pts`, subdividing each span by its
|
|
18134
|
+
* ARC LENGTH rather than by a fixed step count.
|
|
18135
|
+
*
|
|
18136
|
+
* A fixed count is the reason a finished stroke looks faceted while the
|
|
18137
|
+
* one being drawn looks smooth: both render with the same number of
|
|
18138
|
+
* subdivisions per span, but a live stroke's control points sit ~1-2px
|
|
18139
|
+
* apart while a finalized stroke's - after Douglas-Peucker simplification
|
|
18140
|
+
* - sit a median 9-28px apart. The same 8 subdivisions therefore produce
|
|
18141
|
+
* sub-pixel edges live and edges up to ~15px long once finalized, with
|
|
18142
|
+
* visible turns between them.
|
|
18143
|
+
*
|
|
18144
|
+
* `resolution` is now the MINIMUM number of subdivisions for a curved
|
|
18145
|
+
* span (so dense, live-drawn spans behave exactly as before); long spans
|
|
18146
|
+
* get proportionally more, capped so pathological input cannot explode
|
|
18147
|
+
* the vertex count. Spans whose midpoint deviates from their chord by
|
|
18148
|
+
* less than `SPLINE_FLATNESS_EPSILON` are effectively straight and are
|
|
18149
|
+
* emitted as a single edge - subdividing a straight line adds vertices
|
|
18150
|
+
* without changing a pixel.
|
|
18151
|
+
*/
|
|
18152
|
+
getSplinePoints(pts, resolution = this.config.splineResolution) {
|
|
18153
|
+
if (pts.length < 2) return [...pts];
|
|
18154
|
+
const targetEdge = this.config.splineTargetEdge;
|
|
18155
|
+
const maxSteps = this.config.splineMaxSteps;
|
|
18100
18156
|
const result = [];
|
|
18101
18157
|
for (let i = -1; i < pts.length - 2; i++) {
|
|
18102
18158
|
const p0 = pts[Math.max(i, 0)];
|
|
18103
18159
|
const p1 = pts[i + 1];
|
|
18104
18160
|
const p2 = pts[i + 2];
|
|
18105
18161
|
const p3 = pts[Math.min(i + 3, pts.length - 1)];
|
|
18106
|
-
|
|
18107
|
-
|
|
18108
|
-
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
const
|
|
18114
|
-
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
y,
|
|
18119
|
-
pressure
|
|
18120
|
-
});
|
|
18121
|
-
}
|
|
18162
|
+
const chord = Math.hypot(p2.x - p1.x, p2.y - p1.y);
|
|
18163
|
+
let deviation = 0;
|
|
18164
|
+
for (const probe of [
|
|
18165
|
+
.25,
|
|
18166
|
+
.5,
|
|
18167
|
+
.75
|
|
18168
|
+
]) {
|
|
18169
|
+
const at = this.catmullRomAt(p0, p1, p2, p3, probe);
|
|
18170
|
+
deviation = Math.max(deviation, this.distanceToSegment(at, p1, p2));
|
|
18171
|
+
}
|
|
18172
|
+
const steps = deviation < WeaveStrokeNode.SPLINE_FLATNESS_EPSILON ? 1 : Math.min(Math.max(Math.ceil(chord / targetEdge), resolution), maxSteps);
|
|
18173
|
+
for (let s = 0; s < steps; s++) result.push(this.catmullRomAt(p0, p1, p2, p3, s / steps));
|
|
18122
18174
|
}
|
|
18123
18175
|
result.push(pts[pts.length - 1]);
|
|
18124
18176
|
return result;
|
|
@@ -18136,19 +18188,26 @@ var WeaveStrokeNode = class extends WeaveNode {
|
|
|
18136
18188
|
* Draws a filled polygon from the accumulated left/right outline points of a
|
|
18137
18189
|
* dash segment and adds round caps at both ends.
|
|
18138
18190
|
* NOTE: mutates `rightSide` via Array.reverse() — callers must not reuse it after this call.
|
|
18191
|
+
*
|
|
18192
|
+
* The outline is NOT re-smoothed here. It used to be, back when the
|
|
18193
|
+
* centerline was sampled at a fixed subdivision count and could be coarse;
|
|
18194
|
+
* now that the centerline is subdivided by arc length, its offset curves
|
|
18195
|
+
* are already smooth, and measurement showed the extra spline pass cost
|
|
18196
|
+
* roughly half of the node's total render time while changing the drawn
|
|
18197
|
+
* result by well under a pixel (95th-percentile outline edge 1.72px vs
|
|
18198
|
+
* 1.76px; byte-identical on long, gently-curved strokes).
|
|
18139
18199
|
*/
|
|
18140
18200
|
drawDashPolygon(ctx, leftSide, rightSide, color) {
|
|
18141
18201
|
const capStartL = leftSide[0];
|
|
18142
18202
|
const capStartR = rightSide[0];
|
|
18143
18203
|
const capEndL = leftSide.at(-1);
|
|
18144
18204
|
const capEndR = rightSide.at(-1);
|
|
18145
|
-
const
|
|
18146
|
-
const smoothRight = this.getSplinePoints(rightSide.reverse(), 4);
|
|
18205
|
+
const outlineRight = rightSide.reverse();
|
|
18147
18206
|
ctx.beginPath();
|
|
18148
18207
|
ctx.fillStyle = color;
|
|
18149
|
-
ctx.moveTo(
|
|
18150
|
-
for (const p of
|
|
18151
|
-
for (const p of
|
|
18208
|
+
ctx.moveTo(leftSide[0].x, leftSide[0].y);
|
|
18209
|
+
for (const p of leftSide) ctx.lineTo(p.x, p.y);
|
|
18210
|
+
for (const p of outlineRight) ctx.lineTo(p.x, p.y);
|
|
18152
18211
|
ctx.closePath();
|
|
18153
18212
|
ctx.fill();
|
|
18154
18213
|
this.drawRoundCap(ctx, capStartL, capStartR, color);
|
|
@@ -18165,13 +18224,23 @@ var WeaveStrokeNode = class extends WeaveNode {
|
|
|
18165
18224
|
ctx.fill();
|
|
18166
18225
|
return;
|
|
18167
18226
|
}
|
|
18168
|
-
const filtered = this.resamplePoints(pts,
|
|
18169
|
-
const centerline = this.getSplinePoints(filtered,
|
|
18227
|
+
const filtered = this.resamplePoints(pts, this.config.resamplingSpacing);
|
|
18228
|
+
const centerline = this.getSplinePoints(filtered, this.config.splineResolution);
|
|
18170
18229
|
let dashIndex = 0;
|
|
18171
18230
|
let dashOn = true;
|
|
18172
18231
|
let dashRemaining = dash.length ? dash[0] : Infinity;
|
|
18173
18232
|
let leftSide = [];
|
|
18174
18233
|
let rightSide = [];
|
|
18234
|
+
let pendingEndLeft = null;
|
|
18235
|
+
let pendingEndRight = null;
|
|
18236
|
+
const flushRun = () => {
|
|
18237
|
+
if (!dashOn || !leftSide.length || !rightSide.length) return;
|
|
18238
|
+
if (pendingEndLeft && pendingEndRight) {
|
|
18239
|
+
leftSide.push(pendingEndLeft);
|
|
18240
|
+
rightSide.push(pendingEndRight);
|
|
18241
|
+
}
|
|
18242
|
+
this.drawDashPolygon(ctx, leftSide, rightSide, color);
|
|
18243
|
+
};
|
|
18175
18244
|
for (let i = 0; i < centerline.length - 1; i++) {
|
|
18176
18245
|
const p0 = centerline[i];
|
|
18177
18246
|
const p1 = centerline[i + 1];
|
|
@@ -18204,22 +18273,24 @@ var WeaveStrokeNode = class extends WeaveNode {
|
|
|
18204
18273
|
y: y0 - ny * pw0,
|
|
18205
18274
|
pressure: 1
|
|
18206
18275
|
});
|
|
18207
|
-
|
|
18276
|
+
pendingEndLeft = {
|
|
18208
18277
|
x: x1 + nx * pw1,
|
|
18209
18278
|
y: y1 + ny * pw1,
|
|
18210
18279
|
pressure: 1
|
|
18211
|
-
}
|
|
18212
|
-
|
|
18280
|
+
};
|
|
18281
|
+
pendingEndRight = {
|
|
18213
18282
|
x: x1 - nx * pw1,
|
|
18214
18283
|
y: y1 - ny * pw1,
|
|
18215
18284
|
pressure: 1
|
|
18216
|
-
}
|
|
18285
|
+
};
|
|
18217
18286
|
}
|
|
18218
18287
|
dashRemaining -= step;
|
|
18219
18288
|
if (dashRemaining <= 0) {
|
|
18220
|
-
|
|
18289
|
+
flushRun();
|
|
18221
18290
|
leftSide = [];
|
|
18222
18291
|
rightSide = [];
|
|
18292
|
+
pendingEndLeft = null;
|
|
18293
|
+
pendingEndRight = null;
|
|
18223
18294
|
dashOn = !dashOn;
|
|
18224
18295
|
dashIndex = (dashIndex + 1) % dash.length;
|
|
18225
18296
|
dashRemaining = dash[dashIndex];
|
|
@@ -18227,7 +18298,7 @@ var WeaveStrokeNode = class extends WeaveNode {
|
|
|
18227
18298
|
traveled += step;
|
|
18228
18299
|
}
|
|
18229
18300
|
}
|
|
18230
|
-
|
|
18301
|
+
flushRun();
|
|
18231
18302
|
}
|
|
18232
18303
|
drawShape(ctx, shape) {
|
|
18233
18304
|
const strokeElements = shape.getAttrs().strokeElements;
|
|
@@ -24231,7 +24302,22 @@ const BRUSH_TOOL_STATE = {
|
|
|
24231
24302
|
["IDLE"]: "idle",
|
|
24232
24303
|
["DEFINE_STROKE"]: "defineStroke"
|
|
24233
24304
|
};
|
|
24234
|
-
|
|
24305
|
+
/**
|
|
24306
|
+
* Suffix applied to a finished stroke's preview node while it is briefly
|
|
24307
|
+
* kept on screen alongside the persisted node, so the two cannot collide on
|
|
24308
|
+
* the same id.
|
|
24309
|
+
*/
|
|
24310
|
+
const PREVIEW_ID_SUFFIX = "--preview";
|
|
24311
|
+
/**
|
|
24312
|
+
* How many frames the preview of a finished stroke may wait for its
|
|
24313
|
+
* persisted counterpart to be rendered before it is removed regardless.
|
|
24314
|
+
* Bounds the handover so a preview can never be orphaned on screen.
|
|
24315
|
+
*/
|
|
24316
|
+
const PREVIEW_HANDOVER_MAX_FRAMES = 30;
|
|
24317
|
+
const BRUSH_TOOL_DEFAULT_CONFIG = {
|
|
24318
|
+
interpolationSteps: 10,
|
|
24319
|
+
simplifyTolerance: .5
|
|
24320
|
+
};
|
|
24235
24321
|
//#endregion
|
|
24236
24322
|
//#region src/actions/brush-tool/brush-tool.ts
|
|
24237
24323
|
var WeaveBrushToolAction = class extends WeaveAction {
|
|
@@ -24248,6 +24334,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24248
24334
|
prevTouchAction;
|
|
24249
24335
|
penActive = false;
|
|
24250
24336
|
lastSmoothedPressure = .5;
|
|
24337
|
+
hasPressureSample = false;
|
|
24251
24338
|
lastPointerPos = null;
|
|
24252
24339
|
lastPointerTime = 0;
|
|
24253
24340
|
predictedCount = 0;
|
|
@@ -24279,26 +24366,84 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24279
24366
|
opacity: 1
|
|
24280
24367
|
};
|
|
24281
24368
|
}
|
|
24282
|
-
|
|
24369
|
+
/**
|
|
24370
|
+
* Velocity-adaptive exponential smoothing of a single raw pressure sample.
|
|
24371
|
+
*
|
|
24372
|
+
* This is the one place pressure smoothing happens. Every sample that
|
|
24373
|
+
* becomes a stroke point must go through it - including the
|
|
24374
|
+
* high-frequency coalesced samples a stylus reports (see
|
|
24375
|
+
* `handlePointerMove`), which previously bypassed it entirely and so
|
|
24376
|
+
* landed in the stroke with their raw value, no pressure floor, and
|
|
24377
|
+
* without advancing the smoothing state for later samples.
|
|
24378
|
+
*
|
|
24379
|
+
* Timing intentionally uses `performance.now()` (not the event's own
|
|
24380
|
+
* `timeStamp`), matching the original behaviour: the two are not
|
|
24381
|
+
* guaranteed to share a time origin, and mixing them corrupts the
|
|
24382
|
+
* velocity term that drives `alpha`.
|
|
24383
|
+
*
|
|
24384
|
+
* The first sample of a stroke SEEDS the filter with its own value
|
|
24385
|
+
* rather than being blended toward the neutral 0.5 baseline. Blending
|
|
24386
|
+
* from a constant gives every stroke a warm-up transient: the filter
|
|
24387
|
+
* starts at 0.5 and converges toward the pressure actually being
|
|
24388
|
+
* applied, so a stroke drawn lighter than 0.5 renders visibly fatter at
|
|
24389
|
+
* its start (and heavier than 0.5, thinner) until the filter catches
|
|
24390
|
+
* up. Seeding removes that transient entirely - smoothing then only
|
|
24391
|
+
* ever acts between real samples, which is its actual purpose.
|
|
24392
|
+
*/
|
|
24393
|
+
smoothPressureSample(raw, clientX, clientY) {
|
|
24283
24394
|
const now = performance.now();
|
|
24284
24395
|
let velocity = 0;
|
|
24285
|
-
|
|
24286
|
-
|
|
24287
|
-
const
|
|
24396
|
+
const hasPosition = Number.isFinite(clientX) && Number.isFinite(clientY);
|
|
24397
|
+
if (hasPosition && this.lastPointerPos && now - this.lastPointerTime > 0) {
|
|
24398
|
+
const dx = clientX - this.lastPointerPos.x;
|
|
24399
|
+
const dy = clientY - this.lastPointerPos.y;
|
|
24288
24400
|
velocity = Math.hypot(dx, dy) / (now - this.lastPointerTime) * 1e3;
|
|
24289
24401
|
}
|
|
24290
|
-
this.lastPointerPos = {
|
|
24291
|
-
x:
|
|
24292
|
-
y:
|
|
24402
|
+
if (hasPosition) this.lastPointerPos = {
|
|
24403
|
+
x: clientX,
|
|
24404
|
+
y: clientY
|
|
24293
24405
|
};
|
|
24294
24406
|
this.lastPointerTime = now;
|
|
24407
|
+
const safeRaw = Number.isFinite(raw) ? raw : .5;
|
|
24408
|
+
if (!this.hasPressureSample) {
|
|
24409
|
+
this.hasPressureSample = true;
|
|
24410
|
+
this.lastSmoothedPressure = safeRaw;
|
|
24411
|
+
return Math.max(this.lastSmoothedPressure, .15);
|
|
24412
|
+
}
|
|
24295
24413
|
const alpha = Math.min(Math.max(velocity / 1500, .15), .6);
|
|
24296
|
-
|
|
24297
|
-
|
|
24298
|
-
else raw = .5;
|
|
24299
|
-
this.lastSmoothedPressure = alpha * raw + (1 - alpha) * this.lastSmoothedPressure;
|
|
24414
|
+
const smoothed = alpha * safeRaw + (1 - alpha) * this.lastSmoothedPressure;
|
|
24415
|
+
this.lastSmoothedPressure = Number.isFinite(smoothed) ? smoothed : safeRaw;
|
|
24300
24416
|
return Math.max(this.lastSmoothedPressure, .15);
|
|
24301
24417
|
}
|
|
24418
|
+
/**
|
|
24419
|
+
* Raw pressure a pointer sample reports: the device's own reading for a
|
|
24420
|
+
* pen, a neutral constant for devices that do not sense pressure.
|
|
24421
|
+
*/
|
|
24422
|
+
getRawPressure(pointerType, pressure) {
|
|
24423
|
+
if (pointerType === "pen") return (typeof pressure === "number" ? pressure : 0) || .5;
|
|
24424
|
+
return .5;
|
|
24425
|
+
}
|
|
24426
|
+
getEventPressure(e) {
|
|
24427
|
+
return this.smoothPressureSample(this.getRawPressure(e.evt.pointerType, e.evt.pressure), e.evt.clientX, e.evt.clientY);
|
|
24428
|
+
}
|
|
24429
|
+
/**
|
|
24430
|
+
* Resets the pressure-smoothing state (smoothed pressure, last known pointer
|
|
24431
|
+
* position/time, and predicted-point bookkeeping) to a neutral baseline.
|
|
24432
|
+
*
|
|
24433
|
+
* This state is scoped to a single stroke: it must be reset before the
|
|
24434
|
+
* first pressure sample of a new stroke is computed (in `handlePointerDown`,
|
|
24435
|
+
* ahead of the `getEventPressure` call for point 0), not only afterwards -
|
|
24436
|
+
* otherwise that first sample can inherit smoothing state left behind by
|
|
24437
|
+
* the previous stroke (its ending pressure, pointer position and time),
|
|
24438
|
+
* inflating the very first point's pressure.
|
|
24439
|
+
*/
|
|
24440
|
+
resetPressureSmoothingState() {
|
|
24441
|
+
this.lastSmoothedPressure = .5;
|
|
24442
|
+
this.hasPressureSample = false;
|
|
24443
|
+
this.lastPointerPos = null;
|
|
24444
|
+
this.lastPointerTime = 0;
|
|
24445
|
+
this.predictedCount = 0;
|
|
24446
|
+
}
|
|
24302
24447
|
setupEvents() {
|
|
24303
24448
|
const stage = this.instance.getStage();
|
|
24304
24449
|
this.prevTouchAction = stage.container().style.touchAction;
|
|
@@ -24330,6 +24475,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24330
24475
|
if (e?.evt?.button !== 0) return;
|
|
24331
24476
|
if (e.evt.pointerType === "touch" && this.penActive) return;
|
|
24332
24477
|
if (e.evt.pointerType === "pen") this.penActive = true;
|
|
24478
|
+
this.resetPressureSmoothingState();
|
|
24333
24479
|
const pointPressure = this.getEventPressure(e);
|
|
24334
24480
|
this.handleStartStroke(pointPressure);
|
|
24335
24481
|
e.evt.stopPropagation();
|
|
@@ -24342,16 +24488,21 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24342
24488
|
if (this.getZoomPlugin()?.isPinching()) return;
|
|
24343
24489
|
const coalescedEvents = e.evt.getCoalescedEvents ? e.evt.getCoalescedEvents() : [];
|
|
24344
24490
|
if (coalescedEvents.length > 1) {
|
|
24345
|
-
|
|
24346
|
-
|
|
24347
|
-
|
|
24348
|
-
}
|
|
24491
|
+
const samples = coalescedEvents.map((ce) => ({
|
|
24492
|
+
pressure: this.smoothPressureSample(this.getRawPressure(ce.pointerType, ce.pressure), ce.clientX, ce.clientY),
|
|
24493
|
+
isPredicted: false
|
|
24494
|
+
}));
|
|
24349
24495
|
const predictedEvents = e.evt.getPredictedEvents ? e.evt.getPredictedEvents() : [];
|
|
24350
24496
|
if (predictedEvents.length > 0) {
|
|
24351
24497
|
const last = predictedEvents[predictedEvents.length - 1];
|
|
24352
|
-
const predPressure = last.pointerType
|
|
24353
|
-
|
|
24498
|
+
const predPressure = Math.max(.15 * this.getRawPressure(last.pointerType, last.pressure) + .85 * this.lastSmoothedPressure, .15);
|
|
24499
|
+
samples.push({
|
|
24500
|
+
pressure: predPressure,
|
|
24501
|
+
sourceEvent: last,
|
|
24502
|
+
isPredicted: true
|
|
24503
|
+
});
|
|
24354
24504
|
}
|
|
24505
|
+
this.applyMovementSamples(samples);
|
|
24355
24506
|
} else {
|
|
24356
24507
|
const pointPressure = this.getEventPressure(e);
|
|
24357
24508
|
this.handleMovement(pointPressure, void 0, false);
|
|
@@ -24397,10 +24548,7 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24397
24548
|
};
|
|
24398
24549
|
}
|
|
24399
24550
|
handleStartStroke(pressure) {
|
|
24400
|
-
this.
|
|
24401
|
-
this.lastPointerPos = null;
|
|
24402
|
-
this.lastPointerTime = 0;
|
|
24403
|
-
this.predictedCount = 0;
|
|
24551
|
+
this.resetPressureSmoothingState();
|
|
24404
24552
|
const { mousePoint, container, measureContainer } = this.instance.getMousePointer();
|
|
24405
24553
|
this.clickPoint = mousePoint;
|
|
24406
24554
|
this.container = container;
|
|
@@ -24429,36 +24577,60 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24429
24577
|
}
|
|
24430
24578
|
this.setState(BRUSH_TOOL_STATE.DEFINE_STROKE);
|
|
24431
24579
|
}
|
|
24432
|
-
|
|
24580
|
+
/**
|
|
24581
|
+
* Appends one or more pointer samples to the stroke in a single
|
|
24582
|
+
* read-modify-write, then renders once.
|
|
24583
|
+
*
|
|
24584
|
+
* Batching matters: a stylus reports a burst of coalesced samples per
|
|
24585
|
+
* frame, and applying them one at a time meant copying the whole point
|
|
24586
|
+
* array, recomputing the whole bounding box and issuing a full redraw
|
|
24587
|
+
* once PER SAMPLE. That is O(n) work repeated ~10x a frame, i.e.
|
|
24588
|
+
* quadratic in stroke length - which is why drawing fast could stall for
|
|
24589
|
+
* seconds. Here that O(n) work happens once per event instead.
|
|
24590
|
+
*/
|
|
24591
|
+
applyMovementSamples(samples) {
|
|
24433
24592
|
if (this.state !== BRUSH_TOOL_STATE.DEFINE_STROKE) return;
|
|
24593
|
+
if (samples.length === 0) return;
|
|
24434
24594
|
const stage = this.instance.getStage();
|
|
24435
|
-
const tempStroke =
|
|
24436
|
-
if (this.measureContainer
|
|
24437
|
-
|
|
24595
|
+
const tempStroke = stage.findOne(`#${this.strokeId}`);
|
|
24596
|
+
if (!this.measureContainer || !tempStroke) return;
|
|
24597
|
+
let newStrokeElements = [...tempStroke.getAttrs().strokeElements];
|
|
24598
|
+
for (const sample of samples) {
|
|
24599
|
+
if (sample.sourceEvent) stage.setPointersPositions(sample.sourceEvent);
|
|
24438
24600
|
const { mousePoint } = this.instance.getMousePointerRelativeToContainer(this.measureContainer);
|
|
24439
24601
|
const currentPoint = {
|
|
24440
24602
|
x: mousePoint.x - tempStroke.x(),
|
|
24441
24603
|
y: mousePoint.y - tempStroke.y(),
|
|
24442
|
-
pressure
|
|
24604
|
+
pressure: sample.pressure
|
|
24443
24605
|
};
|
|
24444
|
-
|
|
24445
|
-
if (!isPredicted && this.predictedCount > 0) {
|
|
24606
|
+
if (!sample.isPredicted && this.predictedCount > 0) {
|
|
24446
24607
|
newStrokeElements = newStrokeElements.slice(0, -1 * this.predictedCount);
|
|
24447
24608
|
this.predictedCount = 0;
|
|
24448
24609
|
}
|
|
24610
|
+
if (!sample.isPredicted && newStrokeElements.length === 1) newStrokeElements[0] = {
|
|
24611
|
+
...newStrokeElements[0],
|
|
24612
|
+
pressure: currentPoint.pressure
|
|
24613
|
+
};
|
|
24449
24614
|
newStrokeElements.push(currentPoint);
|
|
24450
|
-
if (isPredicted) this.predictedCount++;
|
|
24451
|
-
const box = this.getBoundingBox(newStrokeElements);
|
|
24452
|
-
tempStroke.setAttrs({
|
|
24453
|
-
width: box.width,
|
|
24454
|
-
height: box.height,
|
|
24455
|
-
x: 0,
|
|
24456
|
-
y: 0,
|
|
24457
|
-
strokeElements: newStrokeElements
|
|
24458
|
-
});
|
|
24459
|
-
const nodeHandler = this.instance.getNodeHandler("stroke");
|
|
24460
|
-
if (nodeHandler) nodeHandler.onUpdate(tempStroke, tempStroke.getAttrs());
|
|
24615
|
+
if (sample.isPredicted) this.predictedCount++;
|
|
24461
24616
|
}
|
|
24617
|
+
const box = this.getBoundingBox(newStrokeElements);
|
|
24618
|
+
tempStroke.setAttrs({
|
|
24619
|
+
width: box.width,
|
|
24620
|
+
height: box.height,
|
|
24621
|
+
x: 0,
|
|
24622
|
+
y: 0,
|
|
24623
|
+
strokeElements: newStrokeElements
|
|
24624
|
+
});
|
|
24625
|
+
const nodeHandler = this.instance.getNodeHandler("stroke");
|
|
24626
|
+
if (nodeHandler) nodeHandler.onUpdate(tempStroke, tempStroke.getAttrs());
|
|
24627
|
+
}
|
|
24628
|
+
handleMovement(pressure, predictedEvent, isPredicted = false) {
|
|
24629
|
+
this.applyMovementSamples([{
|
|
24630
|
+
pressure,
|
|
24631
|
+
sourceEvent: predictedEvent,
|
|
24632
|
+
isPredicted
|
|
24633
|
+
}]);
|
|
24462
24634
|
}
|
|
24463
24635
|
finalizeStroke(tempStroke, nodeHandler) {
|
|
24464
24636
|
const box = this.getBoundingBox(tempStroke.getAttrs().strokeElements);
|
|
@@ -24467,12 +24639,19 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24467
24639
|
newStrokeElements = newStrokeElements.slice(0, -1 * this.predictedCount);
|
|
24468
24640
|
this.predictedCount = 0;
|
|
24469
24641
|
}
|
|
24642
|
+
if (newStrokeElements.length >= 2) {
|
|
24643
|
+
const lastIndex = newStrokeElements.length - 1;
|
|
24644
|
+
newStrokeElements[lastIndex] = {
|
|
24645
|
+
...newStrokeElements[lastIndex],
|
|
24646
|
+
pressure: newStrokeElements[lastIndex - 1].pressure
|
|
24647
|
+
};
|
|
24648
|
+
}
|
|
24470
24649
|
newStrokeElements = newStrokeElements.map((point) => ({
|
|
24471
24650
|
...point,
|
|
24472
24651
|
x: point.x - box.x,
|
|
24473
24652
|
y: point.y - box.y
|
|
24474
24653
|
}));
|
|
24475
|
-
const compressedPoints = simplify(newStrokeElements,
|
|
24654
|
+
const compressedPoints = simplify(newStrokeElements, this.config.simplifyTolerance, true);
|
|
24476
24655
|
const sw = tempStroke.getAttrs().strokeWidth ?? 1;
|
|
24477
24656
|
const finalWidth = Math.max(box.width, sw);
|
|
24478
24657
|
const finalHeight = Math.max(box.height, sw);
|
|
@@ -24485,9 +24664,44 @@ var WeaveBrushToolAction = class extends WeaveAction {
|
|
|
24485
24664
|
y: finalY,
|
|
24486
24665
|
strokeElements: compressedPoints
|
|
24487
24666
|
});
|
|
24488
|
-
const
|
|
24489
|
-
|
|
24490
|
-
|
|
24667
|
+
const strokeNodeId = tempStroke.getAttrs().id ?? "";
|
|
24668
|
+
const serializedNode = nodeHandler.serialize(tempStroke);
|
|
24669
|
+
const hasPoints = tempStroke.getAttrs().strokeElements.length >= 1;
|
|
24670
|
+
const preview = this.instance.getStage().findOne(`#${strokeNodeId}`);
|
|
24671
|
+
if (!hasPoints) {
|
|
24672
|
+
preview?.destroy();
|
|
24673
|
+
return;
|
|
24674
|
+
}
|
|
24675
|
+
if (preview) preview.setAttrs({ id: `${strokeNodeId}${PREVIEW_ID_SUFFIX}` });
|
|
24676
|
+
this.instance.addNode(serializedNode, this.container?.getAttrs().id);
|
|
24677
|
+
this.removePreviewWhenRendered(preview, strokeNodeId);
|
|
24678
|
+
}
|
|
24679
|
+
/**
|
|
24680
|
+
* Destroys the finished stroke's preview node once its persisted
|
|
24681
|
+
* counterpart has actually been rendered onto the stage, so the stroke is
|
|
24682
|
+
* never absent from the canvas between the two.
|
|
24683
|
+
*
|
|
24684
|
+
* Falls back to destroying immediately where no frame scheduler exists
|
|
24685
|
+
* (non-browser hosts), and gives up waiting after a bounded number of
|
|
24686
|
+
* frames so a preview can never be orphaned if the node never arrives.
|
|
24687
|
+
*/
|
|
24688
|
+
removePreviewWhenRendered(preview, realNodeId) {
|
|
24689
|
+
if (!preview) return;
|
|
24690
|
+
const scheduleFrame = typeof requestAnimationFrame === "function" ? requestAnimationFrame : void 0;
|
|
24691
|
+
if (!scheduleFrame) {
|
|
24692
|
+
preview.destroy();
|
|
24693
|
+
return;
|
|
24694
|
+
}
|
|
24695
|
+
let framesWaited = 0;
|
|
24696
|
+
const check = () => {
|
|
24697
|
+
if (this.instance.getStage().findOne(`#${realNodeId}`) || framesWaited >= 30) {
|
|
24698
|
+
preview.destroy();
|
|
24699
|
+
return;
|
|
24700
|
+
}
|
|
24701
|
+
framesWaited++;
|
|
24702
|
+
scheduleFrame(check);
|
|
24703
|
+
};
|
|
24704
|
+
check();
|
|
24491
24705
|
}
|
|
24492
24706
|
handleEndStroke() {
|
|
24493
24707
|
const tempStroke = this.instance.getStage().findOne(`#${this.strokeId}`);
|
|
@@ -33099,6 +33313,6 @@ var WeaveNodesSnappingPlugin = class extends WeavePlugin {
|
|
|
33099
33313
|
}
|
|
33100
33314
|
};
|
|
33101
33315
|
//#endregion
|
|
33102
|
-
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, DEFAULT_GUIDE_TOOL_ACTION_CONFIG, DEFAULT_SNAPPING_MANAGER_CONFIG, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_NAME, GUIDE_DISTANCE_ORIGIN, GUIDE_KIND, GUIDE_NAME, GUIDE_ORIENTATION, GUIDE_STATE, GUIDE_TOOL_ACTION_NAME, GUIDE_TOOL_STATE, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_ORIENTATION, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, POLYGON_TOOL_ACTION_NAME, POLYGON_TOOL_STATE, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_PLUGIN_KEY, WEAVE_POLYGON_NODE_TYPE, WEAVE_POLYGON_PRESETS, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_SHAPE_LABEL_DEFAULTS, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_SHAPE_LABEL_EDITION_MODE, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_LINK_ALLOWED_PROTOCOLS, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveGuideToolAction, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeavePolygonNode, WeavePolygonToolAction, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStateManipulation, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, buildAncestorGroupIds, canComposite, clearContainerTargets, computeEllipseLabelMinSize, computePolygonLabelMinSize, computeRectangleLabelMinSize, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getSelectedNodesMetadata, getShapeLabelSchemaFields, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, instantiatePreset, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isNumber, isObject, isServer, labelId, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, sleep, spreadLabelProps, weavejsToYjsBinary };
|
|
33316
|
+
export { ALIGN_NODES_ALIGN_TO, ALIGN_NODES_TOOL_ACTION_NAME, ALIGN_NODES_TOOL_STATE, BRUSH_TOOL_ACTION_NAME, BRUSH_TOOL_DEFAULT_CONFIG, BRUSH_TOOL_STATE, CONNECTOR_TOOL_ACTION_NAME, CONNECTOR_TOOL_DEFAULT_CONFIG, CONNECTOR_TOOL_STATE, COPY_PASTE_NODES_PLUGIN_STATE, DEFAULT_GUIDE_TOOL_ACTION_CONFIG, DEFAULT_SNAPPING_MANAGER_CONFIG, ELLIPSE_TOOL_ACTION_NAME, ELLIPSE_TOOL_STATE, ERASER_TOOL_ACTION_NAME, ERASER_TOOL_STATE, FRAME_TOOL_ACTION_NAME, FRAME_TOOL_STATE, GUIDE_DISTANCE_NAME, GUIDE_DISTANCE_ORIGIN, GUIDE_KIND, GUIDE_NAME, GUIDE_ORIENTATION, GUIDE_STATE, GUIDE_TOOL_ACTION_NAME, GUIDE_TOOL_STATE, LINE_TOOL_ACTION_NAME, LINE_TOOL_DEFAULT_CONFIG, LINE_TOOL_STATE, MEASURE_TOOL_ACTION_NAME, MEASURE_TOOL_STATE, MOVE_ORIENTATION, MOVE_TOOL_ACTION_NAME, MOVE_TOOL_STATE, PEN_TOOL_ACTION_NAME, PEN_TOOL_STATE, POLYGON_TOOL_ACTION_NAME, POLYGON_TOOL_STATE, PREVIEW_HANDOVER_MAX_FRAMES, PREVIEW_ID_SUFFIX, RECTANGLE_TOOL_ACTION_NAME, RECTANGLE_TOOL_STATE, REGULAR_POLYGON_TOOL_ACTION_NAME, REGULAR_POLYGON_TOOL_STATE, SELECTION_TOOL_ACTION_NAME, SELECTION_TOOL_STATE, STAGE_MINIMAP_DEFAULT_CONFIG, STAR_TOOL_ACTION_NAME, STAR_TOOL_STATE, TEXT_LAYOUT, TEXT_TOOL_ACTION_NAME, TEXT_TOOL_STATE, VIDEO_TOOL_ACTION_NAME, VIDEO_TOOL_STATE, WEAVE_ARROW_NODE_TYPE, WEAVE_ARROW_TOOL_ACTION_NAME, WEAVE_ARROW_TOOL_STATE, WEAVE_COMMENTS_RENDERER_KEY, WEAVE_COMMENTS_TOOL_LAYER_ID, WEAVE_COMMENT_CREATE_ACTION, WEAVE_COMMENT_NODE_ACTION, WEAVE_COMMENT_NODE_DEFAULTS, WEAVE_COMMENT_NODE_TYPE, WEAVE_COMMENT_STATUS, WEAVE_COMMENT_TOOL_ACTION_NAME, WEAVE_COMMENT_TOOL_DEFAULT_CONFIG, WEAVE_COMMENT_TOOL_STATE, WEAVE_COMMENT_VIEW_ACTION, WEAVE_CONNECTOR_NODE_ANCHOR_ORIGIN, WEAVE_CONNECTOR_NODE_DECORATOR_TYPE, WEAVE_CONNECTOR_NODE_DEFAULT_CONFIG, WEAVE_CONNECTOR_NODE_LINE_ORIGIN, WEAVE_CONNECTOR_NODE_LINE_TYPE, WEAVE_CONNECTOR_NODE_TYPE, WEAVE_COPY_PASTE_CONFIG_DEFAULT, WEAVE_COPY_PASTE_NODES_KEY, WEAVE_COPY_PASTE_PASTE_CATCHER_ID, WEAVE_COPY_PASTE_PASTE_MODES, WEAVE_DEFAULT_USER_INFO_FUNCTION, WEAVE_ELLIPSE_NODE_TYPE, WEAVE_FRAME_DEFAULT_BACKGROUND_COLOR, WEAVE_FRAME_NODE_DEFAULT_CONFIG, WEAVE_FRAME_NODE_DEFAULT_PROPS, WEAVE_FRAME_NODE_TYPE, WEAVE_GRID_DEFAULT_CONFIG, WEAVE_GRID_DOT_TYPES, WEAVE_GRID_LAYER_ID, WEAVE_GRID_TYPES, WEAVE_GROUP_NODE_TYPE, WEAVE_IMAGES_TOOL_ACTION_NAME, WEAVE_IMAGES_TOOL_DEFAULT_CONFIG, WEAVE_IMAGES_TOOL_STATE, WEAVE_IMAGES_TOOL_UPLOAD_TYPE, WEAVE_IMAGE_CROP_ANCHOR_POSITION, WEAVE_IMAGE_CROP_END_TYPE, WEAVE_IMAGE_DEFAULT_CONFIG, WEAVE_IMAGE_NODE_TYPE, WEAVE_IMAGE_TOOL_ACTION_NAME, WEAVE_IMAGE_TOOL_CONFIG_DEFAULT, WEAVE_IMAGE_TOOL_STATE, WEAVE_IMAGE_TOOL_UPLOAD_TYPE, WEAVE_LAYER_NODE_TYPE, WEAVE_LINE_NODE_DEFAULT_CONFIG, WEAVE_LINE_NODE_TYPE, WEAVE_MEASURE_NODE_DEFAULT_CONFIG, WEAVE_MEASURE_NODE_TYPE, WEAVE_MEASURE_TOOL_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_DEFAULT_CONFIG, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_KEY, WEAVE_NODES_MULTI_SELECTION_FEEDBACK_PLUGIN_LAYER_ID, WEAVE_NODES_SELECTION_DEFAULT_CONFIG, WEAVE_NODES_SELECTION_KEY, WEAVE_NODES_SELECTION_LAYER_ID, WEAVE_NODES_SNAPPING_PLUGIN_KEY, WEAVE_POLYGON_NODE_TYPE, WEAVE_POLYGON_PRESETS, WEAVE_RECTANGLE_NODE_TYPE, WEAVE_REGULAR_POLYGON_NODE_TYPE, WEAVE_SHAPE_LABEL_DEFAULTS, WEAVE_STAGE_DEFAULT_MODE, WEAVE_STAGE_DROP_AREA_KEY, WEAVE_STAGE_GRID_PLUGIN_KEY, WEAVE_STAGE_IMAGE_CROPPING_MODE, WEAVE_STAGE_KEYBOARD_MOVE_DEFAULT_CONFIG, WEAVE_STAGE_KEYBOARD_MOVE_KEY, WEAVE_STAGE_KEYBOARD_MOVE_ORIENTATION, WEAVE_STAGE_MINIMAP_KEY, WEAVE_STAGE_NODE_TYPE, WEAVE_STAGE_PANNING_DEFAULT_CONFIG, WEAVE_STAGE_PANNING_KEY, WEAVE_STAGE_PANNING_THROTTLE_MS, WEAVE_STAGE_SHAPE_LABEL_EDITION_MODE, WEAVE_STAGE_TEXT_EDITION_MODE, WEAVE_STAGE_ZOOM_DEFAULT_CONFIG, WEAVE_STAGE_ZOOM_KEY, WEAVE_STAGE_ZOOM_TYPE, WEAVE_STAR_NODE_TYPE, WEAVE_STROKE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_NODE_TYPE, WEAVE_STROKE_SINGLE_NODE_DEFAULT_CONFIG, WEAVE_STROKE_SINGLE_NODE_TIP_SIDE, WEAVE_STROKE_SINGLE_NODE_TIP_TYPE, WEAVE_STROKE_SINGLE_NODE_TYPE, WEAVE_STROKE_TOOL_ACTION_NAME, WEAVE_STROKE_TOOL_ACTION_NAME_ALIASES, WEAVE_STROKE_TOOL_DEFAULT_CONFIG, WEAVE_STROKE_TOOL_STATE, WEAVE_TEXT_LINK_ALLOWED_PROTOCOLS, WEAVE_TEXT_NODE_DEFAULT_CONFIG, WEAVE_TEXT_NODE_TYPE, WEAVE_USERS_POINTERS_CONFIG_DEFAULT_PROPS, WEAVE_USERS_POINTERS_KEY, WEAVE_USERS_PRESENCE_CONFIG_DEFAULT_PROPS, WEAVE_USERS_PRESENCE_PLUGIN_KEY, WEAVE_USERS_SELECTION_KEY, WEAVE_USER_POINTER_KEY, WEAVE_USER_PRESENCE_KEY, WEAVE_USER_SELECTION_KEY, WEAVE_VIDEO_DEFAULT_CONFIG, WEAVE_VIDEO_NODE_TYPE, Weave, WeaveAction, WeaveAlignNodesToolAction, WeaveArrowNode, WeaveArrowToolAction, WeaveBrushToolAction, WeaveCommentNode, WeaveCommentToolAction, WeaveCommentsRendererPlugin, WeaveConnectedUsersPlugin, WeaveConnectorNode, WeaveConnectorToolAction, WeaveContextMenuPlugin, WeaveCopyPasteNodesPlugin, WeaveEllipseNode, WeaveEllipseToolAction, WeaveEraserToolAction, WeaveExportNodesToolAction, WeaveExportStageToolAction, WeaveFitToScreenToolAction, WeaveFitToSelectionToolAction, WeaveFrameNode, WeaveFrameToolAction, WeaveGroupNode, WeaveGuideToolAction, WeaveImageNode, WeaveImageToolAction, WeaveImagesToolAction, WeaveLayerNode, WeaveLineNode, WeaveLineToolAction, WeaveMeasureNode, WeaveMeasureToolAction, WeaveMoveToolAction, WeaveNode, WeaveNodesMultiSelectionFeedbackPlugin, WeaveNodesSelectionPlugin, WeaveNodesSnappingPlugin, WeavePenToolAction, WeavePlugin, WeavePolygonNode, WeavePolygonToolAction, WeaveRectangleNode, WeaveRectangleToolAction, WeaveRegularPolygonNode, WeaveRegularPolygonToolAction, WeaveRenderer, WeaveSelectionToolAction, WeaveStageDropAreaPlugin, WeaveStageGridPlugin, WeaveStageKeyboardMovePlugin, WeaveStageMinimapPlugin, WeaveStageNode, WeaveStagePanningPlugin, WeaveStageResizePlugin, WeaveStageZoomPlugin, WeaveStarNode, WeaveStarToolAction, WeaveStateManipulation, WeaveStore, WeaveStrokeNode, WeaveStrokeSingleNode, WeaveStrokeToolAction, WeaveTextNode, WeaveTextToolAction, WeaveUsersPointersPlugin, WeaveUsersPresencePlugin, WeaveUsersSelectionPlugin, WeaveVideoNode, WeaveVideoToolAction, WeaveZoomInToolAction, WeaveZoomOutToolAction, buildAncestorGroupIds, canComposite, clearContainerTargets, computeEllipseLabelMinSize, computePolygonLabelMinSize, computeRectangleLabelMinSize, containerOverCursor, containsNodeDeep, defaultInitialState, downscaleImageFile, downscaleImageFromURL, getBoundingBox, getDownscaleRatio, getExportBoundingBox, getImageSizeFromFile, getJSONFromYjsBinary, getSelectedNodesMetadata, getShapeLabelSchemaFields, getStageClickPoint, getTargetAndSkipNodes, getTargetedNode, getTopmostShadowHost, getVisibleNodes, getVisibleNodesInViewport, hasFrames, hasImages, instantiatePreset, intersectArrays, isArray, isIOS, isInShadowDOM, isNodeInSelection, isNumber, isObject, isServer, labelId, loadImageSource, mapJsonToYjsArray, mapJsonToYjsElements, mapJsonToYjsMap, memoize, mergeExceptArrays, moveNodeToContainer, moveNodeToContainerNT, resetScale, setupCanvasBackend, setupSkiaBackend, sleep, spreadLabelProps, weavejsToYjsBinary };
|
|
33103
33317
|
|
|
33104
33318
|
//# sourceMappingURL=types.js.map
|