@pixerate/editor 0.269.2 → 0.271.0
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/README.md +5 -2
- package/dist/agent/index.cjs +30 -30
- package/dist/agent/index.js +3 -3
- package/dist/animation-editor/index.cjs +62 -62
- package/dist/animation-editor/index.js +4 -4
- package/dist/canvas/editorDocument.d.cts +3 -1
- package/dist/canvas/editorDocument.d.ts +3 -1
- package/dist/canvas/index.cjs +53 -27
- package/dist/canvas/index.js +34 -8
- package/dist/chart/index.cjs +21 -21
- package/dist/chart/index.js +2 -2
- package/dist/{chunk-GBEF2D4P.js → chunk-23YL2EAB.js} +1 -1
- package/dist/{chunk-QGVTOCNB.js → chunk-6ZSFRRJI.js} +1 -1
- package/dist/{chunk-4YSPQGZW.js → chunk-B5W677L7.js} +1 -1
- package/dist/{chunk-4NMPUJUK.cjs → chunk-DDL3ZBHK.cjs} +86 -86
- package/dist/{chunk-T4JPGBW3.cjs → chunk-DGITFN73.cjs} +8 -8
- package/dist/{chunk-PY4GWSE2.cjs → chunk-EBFPMSJO.cjs} +27 -5
- package/dist/{chunk-NS62CQ2B.js → chunk-GAZPHCTV.js} +23 -2
- package/dist/{chunk-YYBW6DF2.cjs → chunk-GSLOH2IN.cjs} +2 -2
- package/dist/{chunk-56RHCIJV.cjs → chunk-JJ2H25JG.cjs} +237 -170
- package/dist/{chunk-CBVNCWJM.cjs → chunk-LBDC5434.cjs} +2 -2
- package/dist/{chunk-BENSE3VX.cjs → chunk-M2ZVPU7L.cjs} +23 -23
- package/dist/{chunk-MQ6MGIQM.js → chunk-NMZQMPFZ.js} +1 -1
- package/dist/{chunk-AI4F33IV.cjs → chunk-NQUKTRKN.cjs} +45 -45
- package/dist/{chunk-4CPOKP27.js → chunk-QYXUE37Q.js} +1 -1
- package/dist/{chunk-MWUZCEFT.js → chunk-S2XPXA47.js} +1 -1
- package/dist/{chunk-EHLOCVWB.js → chunk-T2URHAJX.js} +27 -5
- package/dist/{chunk-FUDP5QBB.js → chunk-TNHDCP4R.js} +70 -3
- package/dist/{chunk-VBRHE4AM.cjs → chunk-U2ASNGO6.cjs} +35 -35
- package/dist/{chunk-WKPXOGZZ.cjs → chunk-WPLGZBNE.cjs} +23 -2
- package/dist/{chunk-N3UMQVKX.js → chunk-X4FTNFIA.js} +1 -1
- package/dist/{chunk-2OQGPEHH.cjs → chunk-XUDMRMXQ.cjs} +2 -2
- package/dist/{chunk-THBJHPUL.js → chunk-YNFSH72F.js} +1 -1
- package/dist/diagram/index.cjs +2 -2
- package/dist/diagram/index.js +1 -1
- package/dist/effects/index.cjs +8 -5
- package/dist/effects/index.js +6 -3
- package/dist/effects/pool.d.cts +9 -0
- package/dist/effects/pool.d.ts +9 -0
- package/dist/effects/types.d.cts +2 -0
- package/dist/effects/types.d.ts +2 -0
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.js +4 -4
- package/dist/gradient/index.cjs +2 -2
- package/dist/gradient/index.js +1 -1
- package/dist/history/HistoryManager.d.cts +9 -0
- package/dist/history/HistoryManager.d.ts +9 -0
- package/dist/history/index.cjs +2 -2
- package/dist/history/index.js +1 -1
- package/dist/history/types.d.cts +5 -2
- package/dist/history/types.d.ts +5 -2
- package/dist/image-editor/index.cjs +784 -784
- package/dist/image-editor/index.js +4 -4
- package/dist/index.cjs +10 -10
- package/dist/index.js +4 -4
- package/dist/paint-editor/controller.d.cts +75 -4
- package/dist/paint-editor/controller.d.ts +75 -4
- package/dist/paint-editor/effect-paint.d.cts +33 -8
- package/dist/paint-editor/effect-paint.d.ts +33 -8
- package/dist/paint-editor/effects.d.cts +4 -0
- package/dist/paint-editor/effects.d.ts +4 -0
- package/dist/paint-editor/index.cjs +692 -398
- package/dist/paint-editor/index.js +362 -68
- package/dist/paint-editor/stroke.d.cts +13 -5
- package/dist/paint-editor/stroke.d.ts +13 -5
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/vector/index.cjs +998 -998
- package/dist/vector/index.js +4 -4
- package/dist/video-editor/index.cjs +321 -321
- package/dist/video-editor/index.js +4 -4
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +2 -2
- package/skills/pixerate-paint-editor/references/effect-paint.md +28 -6
|
@@ -2601,13 +2601,76 @@ function vectorExtrudeFaces(path, params) {
|
|
|
2601
2601
|
// src/paint-editor/effect-paint.ts
|
|
2602
2602
|
var EFFECT_STRIP_HEIGHT = 256;
|
|
2603
2603
|
var EFFECT_MAP_REPEATS = ["repeat", "mirror", "clamp"];
|
|
2604
|
+
var MAX_EFFECT_PATH_POINTS = 256;
|
|
2605
|
+
var roundPathCoord = (v2) => Math.round(v2 * 100) / 100;
|
|
2606
|
+
function strokePathPoints(points, maxPoints = MAX_EFFECT_PATH_POINTS) {
|
|
2607
|
+
if (!points.length) return [];
|
|
2608
|
+
const clean2 = [points[0]];
|
|
2609
|
+
for (let i = 1; i < points.length; i++) {
|
|
2610
|
+
const p = points[i];
|
|
2611
|
+
const prev = clean2[clean2.length - 1];
|
|
2612
|
+
if (p.x !== prev.x || p.y !== prev.y) clean2.push(p);
|
|
2613
|
+
}
|
|
2614
|
+
if (clean2.length === 1) {
|
|
2615
|
+
const x = roundPathCoord(clean2[0].x);
|
|
2616
|
+
const y = roundPathCoord(clean2[0].y);
|
|
2617
|
+
return [x, y, x, y];
|
|
2618
|
+
}
|
|
2619
|
+
if (clean2.length <= maxPoints) {
|
|
2620
|
+
const out2 = [];
|
|
2621
|
+
for (const p of clean2) out2.push(roundPathCoord(p.x), roundPathCoord(p.y));
|
|
2622
|
+
return out2;
|
|
2623
|
+
}
|
|
2624
|
+
const lengths = [0];
|
|
2625
|
+
for (let i = 1; i < clean2.length; i++) {
|
|
2626
|
+
lengths.push(lengths[i - 1] + Math.hypot(clean2[i].x - clean2[i - 1].x, clean2[i].y - clean2[i - 1].y));
|
|
2627
|
+
}
|
|
2628
|
+
const total = lengths[lengths.length - 1];
|
|
2629
|
+
if (total <= 0) {
|
|
2630
|
+
const x = roundPathCoord(clean2[0].x);
|
|
2631
|
+
const y = roundPathCoord(clean2[0].y);
|
|
2632
|
+
return [x, y, x, y];
|
|
2633
|
+
}
|
|
2634
|
+
const out = [];
|
|
2635
|
+
let j = 0;
|
|
2636
|
+
for (let k = 0; k < maxPoints; k++) {
|
|
2637
|
+
const at2 = total * k / (maxPoints - 1);
|
|
2638
|
+
while (j < clean2.length - 2 && lengths[j + 1] < at2) j++;
|
|
2639
|
+
const span = lengths[j + 1] - lengths[j] || 1;
|
|
2640
|
+
const f = Math.min(1, Math.max(0, (at2 - lengths[j]) / span));
|
|
2641
|
+
const a = clean2[j];
|
|
2642
|
+
const b = clean2[j + 1];
|
|
2643
|
+
out.push(roundPathCoord(a.x + (b.x - a.x) * f), roundPathCoord(a.y + (b.y - a.y) * f));
|
|
2644
|
+
}
|
|
2645
|
+
return out;
|
|
2646
|
+
}
|
|
2647
|
+
function inferEffectPathControl(values) {
|
|
2648
|
+
if ("path" in values) return "path";
|
|
2649
|
+
for (const [k, v2] of Object.entries(values)) {
|
|
2650
|
+
if (Array.isArray(v2) && v2.length >= 4 && v2.every((n) => typeof n === "number")) return k;
|
|
2651
|
+
}
|
|
2652
|
+
for (const [k, v2] of Object.entries(values)) {
|
|
2653
|
+
if (typeof v2 === "string") return k;
|
|
2654
|
+
}
|
|
2655
|
+
return "path";
|
|
2656
|
+
}
|
|
2657
|
+
function withStrokePath(paint, points, control) {
|
|
2658
|
+
if (paint.map?.by !== "path") return paint;
|
|
2659
|
+
const key = control ?? inferEffectPathControl(paint.values);
|
|
2660
|
+
return {
|
|
2661
|
+
...paint,
|
|
2662
|
+
values: { ...paint.values, [key]: strokePathPoints(points) }
|
|
2663
|
+
};
|
|
2664
|
+
}
|
|
2604
2665
|
function effectPaintSize(p, canvas) {
|
|
2605
|
-
return p.map ? { width: p.map.length, height: EFFECT_STRIP_HEIGHT } : { width: canvas.width, height: canvas.height };
|
|
2666
|
+
return p.map?.by === "stroke" ? { width: p.map.length, height: EFFECT_STRIP_HEIGHT } : { width: canvas.width, height: canvas.height };
|
|
2606
2667
|
}
|
|
2607
2668
|
function readEffectStrokeMap(raw) {
|
|
2608
|
-
if (raw === void 0 || raw === null || raw.by === "canvas") return void 0;
|
|
2669
|
+
if (raw === void 0 || raw === null || raw === "canvas" || raw.by === "canvas") return void 0;
|
|
2670
|
+
if (raw === "path") return { by: "path" };
|
|
2609
2671
|
const r = raw;
|
|
2610
|
-
if (r.by
|
|
2672
|
+
if (r.by === "path") return { by: "path" };
|
|
2673
|
+
if (r.by !== "stroke") throw new Error(`map.by ${JSON.stringify(r.by)} is not a mapping; use "canvas" (fixed to the canvas), "stroke" (along each stroke) or "path" (native path control).`);
|
|
2611
2674
|
const length2 = r.length === void 0 ? 300 : Number(r.length);
|
|
2612
2675
|
if (!(Number.isFinite(length2) && length2 >= 16 && length2 <= 4096)) throw new Error(`map.length ${JSON.stringify(r.length)} is out of range; use 16..4096 px of stroke per repeat.`);
|
|
2613
2676
|
const repeat = r.repeat === void 0 ? "repeat" : r.repeat;
|
|
@@ -13066,6 +13129,10 @@ export {
|
|
|
13066
13129
|
vectorExtrudeFaces,
|
|
13067
13130
|
EFFECT_STRIP_HEIGHT,
|
|
13068
13131
|
EFFECT_MAP_REPEATS,
|
|
13132
|
+
MAX_EFFECT_PATH_POINTS,
|
|
13133
|
+
strokePathPoints,
|
|
13134
|
+
inferEffectPathControl,
|
|
13135
|
+
withStrokePath,
|
|
13069
13136
|
effectPaintSize,
|
|
13070
13137
|
readEffectStrokeMap,
|
|
13071
13138
|
effectPaintKey,
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkJJ2H25JGcjs = require('./chunk-JJ2H25JG.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -37,7 +37,7 @@ var lerpP = (a, b, t) => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
|
|
|
37
37
|
var toP = (v) => [v.x, v.y];
|
|
38
38
|
var mapP = (m, p) => [m[0] * p[0] + m[2] * p[1] + m[4], m[1] * p[0] + m[3] * p[1] + m[5]];
|
|
39
39
|
var curvesOf = (c) => Math.max(0, (c.pts.length - 1) / 3) | 0;
|
|
40
|
-
function subpathToMorphContour(sp, m =
|
|
40
|
+
function subpathToMorphContour(sp, m = _chunkJJ2H25JGcjs.IDENTITY_MATRIX) {
|
|
41
41
|
const n = sp.anchors.length;
|
|
42
42
|
if (!n) return null;
|
|
43
43
|
const first = mapP(m, toP(sp.anchors[0]));
|
|
@@ -67,8 +67,8 @@ function isStraight(p0, p1, p2, p3) {
|
|
|
67
67
|
const u2 = along(p2);
|
|
68
68
|
return off(p1) < tol && off(p2) < tol && u1 >= -1e-9 && u1 <= 1 + 1e-9 && u2 >= -1e-9 && u2 <= 1 + 1e-9;
|
|
69
69
|
}
|
|
70
|
-
function morphContourToSubpath(c, m =
|
|
71
|
-
const pts =
|
|
70
|
+
function morphContourToSubpath(c, m = _chunkJJ2H25JGcjs.IDENTITY_MATRIX, closed = c.closed) {
|
|
71
|
+
const pts = _chunkJJ2H25JGcjs.isIdentityMatrix.call(void 0, m) ? c.pts : c.pts.map((p) => mapP(m, p));
|
|
72
72
|
const curves = curvesOf(c);
|
|
73
73
|
const dropLast = closed && c.closed && curves > 0;
|
|
74
74
|
const count = dropLast ? curves : curves + 1;
|
|
@@ -84,7 +84,7 @@ function morphContourToSubpath(c, m = _chunk56RHCIJVcjs.IDENTITY_MATRIX, closed
|
|
|
84
84
|
anchors[(k + 1) % count].in = { x: p2[0], y: p2[1] };
|
|
85
85
|
}
|
|
86
86
|
for (const a of anchors) {
|
|
87
|
-
const type =
|
|
87
|
+
const type = _chunkJJ2H25JGcjs.inferAnchorType.call(void 0, a);
|
|
88
88
|
if (type !== "corner") a.type = type;
|
|
89
89
|
}
|
|
90
90
|
const isClosed = closed && curves > 0;
|
|
@@ -267,7 +267,7 @@ function bestStart(fixed, free, useShapeContext) {
|
|
|
267
267
|
return best;
|
|
268
268
|
}
|
|
269
269
|
function placeIn(c, from, to) {
|
|
270
|
-
const b =
|
|
270
|
+
const b = _chunkJJ2H25JGcjs.unionBounds.call(void 0, [boundsOfPoints(c.pts)]);
|
|
271
271
|
const p = b ? [b.x + b.width / 2, b.y + b.height / 2] : c.pts[0];
|
|
272
272
|
if (!from || !to) return p;
|
|
273
273
|
const fx = from.width > 0 ? (p[0] - from.x) / from.width : 0.5;
|
|
@@ -456,7 +456,7 @@ function interpolateVectorColor(a, b, t) {
|
|
|
456
456
|
}
|
|
457
457
|
function resampleGradientStops(g, offsets) {
|
|
458
458
|
return offsets.map((offset) => {
|
|
459
|
-
const s =
|
|
459
|
+
const s = _chunkJJ2H25JGcjs.sampleVectorGradient.call(void 0, g, offset);
|
|
460
460
|
return s.opacity < 1 ? { offset, color: s.color, opacity: Math.round(s.opacity * 1e4) / 1e4 } : { offset, color: s.color };
|
|
461
461
|
});
|
|
462
462
|
}
|
|
@@ -467,11 +467,11 @@ function lerpAngle(a, b, t) {
|
|
|
467
467
|
var lerpPoint = (a, b, t) => ({ x: lerpN(a.x, b.x, t), y: lerpN(a.y, b.y, t) });
|
|
468
468
|
var sameColourModel = (a, b) => (_nullishCoalesce(a.interpolation, () => ( "srgb"))) === (_nullishCoalesce(b.interpolation, () => ( "srgb"))) && (_nullishCoalesce(a.smoothness, () => ( 0))) === (_nullishCoalesce(b.smoothness, () => ( 0)));
|
|
469
469
|
function lerpStops(a, b, t) {
|
|
470
|
-
let stopsA =
|
|
471
|
-
let stopsB =
|
|
470
|
+
let stopsA = _chunkJJ2H25JGcjs.sortedVectorGradientStops.call(void 0, a);
|
|
471
|
+
let stopsB = _chunkJJ2H25JGcjs.sortedVectorGradientStops.call(void 0, b);
|
|
472
472
|
const resampled = stopsA.length !== stopsB.length || !sameColourModel(a, b);
|
|
473
473
|
if (resampled) {
|
|
474
|
-
const offs = [...
|
|
474
|
+
const offs = [..._chunkJJ2H25JGcjs.expandVectorGradientStops.call(void 0, a), ..._chunkJJ2H25JGcjs.expandVectorGradientStops.call(void 0, b), ...stopsA, ...stopsB].map((s) => s.offset).filter(Number.isFinite).sort((x, y) => x - y);
|
|
475
475
|
const common = offs.filter((o, i) => i === 0 || o - offs[i - 1] > 1e-4);
|
|
476
476
|
stopsA = resampleGradientStops(a, common);
|
|
477
477
|
stopsB = resampleGradientStops(b, common);
|
|
@@ -498,8 +498,8 @@ function lerpGradient(a, b, t) {
|
|
|
498
498
|
}
|
|
499
499
|
if (near.spread && near.spread !== "pad") out.spread = near.spread;
|
|
500
500
|
if (near.strokeMode && near.strokeMode !== "within") out.strokeMode = near.strokeMode;
|
|
501
|
-
const ea =
|
|
502
|
-
const eb =
|
|
501
|
+
const ea = _chunkJJ2H25JGcjs.hasExplicitGradientGeometry.call(void 0, a);
|
|
502
|
+
const eb = _chunkJJ2H25JGcjs.hasExplicitGradientGeometry.call(void 0, b);
|
|
503
503
|
if (!ea && !eb) {
|
|
504
504
|
if (a.angle !== void 0 || b.angle !== void 0 || a.type === "linear" || a.type === "reflected") {
|
|
505
505
|
const fallback = a.type === "linear" || a.type === "reflected" ? 180 : 90;
|
|
@@ -512,10 +512,10 @@ function lerpGradient(a, b, t) {
|
|
|
512
512
|
}
|
|
513
513
|
return out;
|
|
514
514
|
}
|
|
515
|
-
const pa =
|
|
516
|
-
const pb =
|
|
515
|
+
const pa = _chunkJJ2H25JGcjs.vectorGradientPoints.call(void 0, a);
|
|
516
|
+
const pb = _chunkJJ2H25JGcjs.vectorGradientPoints.call(void 0, b);
|
|
517
517
|
if (pa.units !== pb.units) {
|
|
518
|
-
const src =
|
|
518
|
+
const src = _chunkJJ2H25JGcjs.explicitVectorGradient.call(void 0, near);
|
|
519
519
|
return { ...src, stops: out.stops, ...out.interpolation ? { interpolation: out.interpolation } : {}, ...out.smoothness ? { smoothness: out.smoothness } : {} };
|
|
520
520
|
}
|
|
521
521
|
out.start = lerpPoint(pa.start, pb.start, t);
|
|
@@ -535,14 +535,14 @@ function solidLike(color, like) {
|
|
|
535
535
|
function interpolateVectorPaint(a, b, t) {
|
|
536
536
|
if (t <= 0) return a;
|
|
537
537
|
if (t >= 1) return b;
|
|
538
|
-
const pa =
|
|
539
|
-
const pb =
|
|
538
|
+
const pa = _chunkJJ2H25JGcjs.hasPaint.call(void 0, a);
|
|
539
|
+
const pb = _chunkJJ2H25JGcjs.hasPaint.call(void 0, b);
|
|
540
540
|
if (!pa && !pb) return t < 0.5 ? a : b;
|
|
541
541
|
if (typeof a === "string" && pa && typeof b === "string" && pb) return interpolateVectorColor(a, b, t);
|
|
542
542
|
if (!pa && typeof b === "string") return interpolateVectorColor("transparent", b, t);
|
|
543
543
|
if (!pb && typeof a === "string") return interpolateVectorColor(a, "transparent", t);
|
|
544
|
-
const ga = pa &&
|
|
545
|
-
const gb = pb &&
|
|
544
|
+
const ga = pa && _chunkJJ2H25JGcjs.isVectorGradient.call(void 0, a) ? a : null;
|
|
545
|
+
const gb = pb && _chunkJJ2H25JGcjs.isVectorGradient.call(void 0, b) ? b : null;
|
|
546
546
|
if (ga && gb) return _nullishCoalesce(lerpGradient(ga, gb, t), () => ( (t < 0.5 ? a : b)));
|
|
547
547
|
if (gb) return _nullishCoalesce(lerpGradient(solidLike(pa ? a : null, gb), gb, t), () => ( b));
|
|
548
548
|
if (ga) return _nullishCoalesce(lerpGradient(ga, solidLike(pb ? b : null, ga), t), () => ( a));
|
|
@@ -553,8 +553,8 @@ function interpolateWidthProfiles(a, b, t) {
|
|
|
553
553
|
const at = [..._nullishCoalesce(a, () => ( [])), ..._nullishCoalesce(b, () => ( [])), { t: 0 }, { t: 1 }].map((p) => p.t).sort((x, y) => x - y);
|
|
554
554
|
const ts = at.filter((v, i) => i === 0 || v - at[i - 1] > 1e-6);
|
|
555
555
|
return ts.map((pos) => {
|
|
556
|
-
const x =
|
|
557
|
-
const y =
|
|
556
|
+
const x = _chunkJJ2H25JGcjs.widthProfileAt.call(void 0, a, pos);
|
|
557
|
+
const y = _chunkJJ2H25JGcjs.widthProfileAt.call(void 0, b, pos);
|
|
558
558
|
return { t: pos, left: lerpN(x.left, y.left, t), right: lerpN(x.right, y.right, t) };
|
|
559
559
|
});
|
|
560
560
|
}
|
|
@@ -597,7 +597,7 @@ function reversedStyle(s) {
|
|
|
597
597
|
out.endArrow = s.startArrow;
|
|
598
598
|
out.startArrowScale = s.endArrowScale;
|
|
599
599
|
out.endArrowScale = s.startArrowScale;
|
|
600
|
-
if (_optionalChain([s, 'access', _6 => _6.strokeWidthProfile, 'optionalAccess', _7 => _7.length])) out.strokeWidthProfile =
|
|
600
|
+
if (_optionalChain([s, 'access', _6 => _6.strokeWidthProfile, 'optionalAccess', _7 => _7.length])) out.strokeWidthProfile = _chunkJJ2H25JGcjs.reverseWidthProfile.call(void 0, s.strokeWidthProfile);
|
|
601
601
|
for (const k of ["startArrow", "endArrow", "startArrowScale", "endArrowScale"]) if (out[k] === void 0) delete out[k];
|
|
602
602
|
return out;
|
|
603
603
|
}
|
|
@@ -623,19 +623,19 @@ function styleOf(n) {
|
|
|
623
623
|
return out;
|
|
624
624
|
}
|
|
625
625
|
function contoursOf(node, m) {
|
|
626
|
-
return
|
|
626
|
+
return _chunkJJ2H25JGcjs.expandVectorCorners.call(void 0, node.subpaths).map((sp) => subpathToMorphContour(sp, m)).filter((c) => !!c);
|
|
627
627
|
}
|
|
628
|
-
function preparePathMorph(a, b, options, ma =
|
|
628
|
+
function preparePathMorph(a, b, options, ma = _chunkJJ2H25JGcjs.nodeMatrix.call(void 0, a), mb = _chunkJJ2H25JGcjs.nodeMatrix.call(void 0, b)) {
|
|
629
629
|
const corr = correspondMorphContours(contoursOf(a, ma), contoursOf(b, mb), options);
|
|
630
630
|
const sim = procrustes(corr.a, corr.b);
|
|
631
631
|
const styleA = styleOf(a);
|
|
632
632
|
const styleB = corr.reversed ? reversedStyle(styleOf(b)) : styleOf(b);
|
|
633
|
-
const rigid = !
|
|
633
|
+
const rigid = !_chunkJJ2H25JGcjs.isIdentityMatrix.call(void 0, ma) || !_chunkJJ2H25JGcjs.isIdentityMatrix.call(void 0, mb);
|
|
634
634
|
const id = _nullishCoalesce(options.id, () => ( a.id));
|
|
635
635
|
return (t) => {
|
|
636
636
|
const contours = interpolateMorphContours(corr.a, corr.b, t, { linear: options.linear, rigidity: options.rigidity, similarity: sim });
|
|
637
|
-
const m = rigid ? interpolateRigidMatrix(ma, mb, t) :
|
|
638
|
-
const back = rigid ?
|
|
637
|
+
const m = rigid ? interpolateRigidMatrix(ma, mb, t) : _chunkJJ2H25JGcjs.IDENTITY_MATRIX;
|
|
638
|
+
const back = rigid ? _chunkJJ2H25JGcjs.invertMatrix.call(void 0, m) : _chunkJJ2H25JGcjs.IDENTITY_MATRIX;
|
|
639
639
|
const subpaths = contours.map((c, k) => {
|
|
640
640
|
const closed = t <= 0 ? corr.a[k].closed : t >= 1 ? corr.b[k].closed : corr.a[k].closed && corr.b[k].closed;
|
|
641
641
|
return morphContourToSubpath({ closed: corr.a[k].closed && corr.b[k].closed, pts: c.pts }, back, closed);
|
|
@@ -643,14 +643,14 @@ function preparePathMorph(a, b, options, ma = _chunk56RHCIJVcjs.nodeMatrix.call(
|
|
|
643
643
|
const node = { id, type: "path", subpaths, ...interpolateVectorStyle(styleA, styleB, t) };
|
|
644
644
|
const opacity = lerpN(_nullishCoalesce(a.opacity, () => ( 1)), _nullishCoalesce(b.opacity, () => ( 1)), t);
|
|
645
645
|
if (opacity < 1) node.opacity = opacity;
|
|
646
|
-
if (rigid && !
|
|
646
|
+
if (rigid && !_chunkJJ2H25JGcjs.isIdentityMatrix.call(void 0, m)) node.transform = m;
|
|
647
647
|
return node;
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
|
-
function flattenPaths(node, parent =
|
|
651
|
-
const m =
|
|
650
|
+
function flattenPaths(node, parent = _chunkJJ2H25JGcjs.IDENTITY_MATRIX) {
|
|
651
|
+
const m = _chunkJJ2H25JGcjs.multiplyMatrices.call(void 0, _chunkJJ2H25JGcjs.nodeMatrix.call(void 0, node), parent);
|
|
652
652
|
if (node.type === "path") return [{ path: node, m, opacity: 1 }];
|
|
653
|
-
if (node.type === "text" || node.type === "instance") return flattenPaths(
|
|
653
|
+
if (node.type === "text" || node.type === "instance") return flattenPaths(_chunkJJ2H25JGcjs.expandVectorAppearance.call(void 0, node), parent);
|
|
654
654
|
const o = _nullishCoalesce(node.opacity, () => ( 1));
|
|
655
655
|
return node.children.filter((c) => c.visible !== false).flatMap((c) => flattenPaths(c, m)).map((e) => ({ ...e, opacity: e.opacity * o }));
|
|
656
656
|
}
|
|
@@ -672,8 +672,8 @@ function createVectorMorph(a, b, options = {}) {
|
|
|
672
672
|
}
|
|
673
673
|
const pa = flattenPaths(a);
|
|
674
674
|
const pb = flattenPaths(b);
|
|
675
|
-
const ba =
|
|
676
|
-
const bb =
|
|
675
|
+
const ba = _chunkJJ2H25JGcjs.unionBounds.call(void 0, pa.map((e) => placedBounds(e.path, e.m)));
|
|
676
|
+
const bb = _chunkJJ2H25JGcjs.unionBounds.call(void 0, pb.map((e) => placedBounds(e.path, e.m)));
|
|
677
677
|
const id = _nullishCoalesce(options.id, () => ( a.id));
|
|
678
678
|
const parts = [];
|
|
679
679
|
const opacities = [];
|
|
@@ -685,10 +685,10 @@ function createVectorMorph(a, b, options = {}) {
|
|
|
685
685
|
parts.push(preparePathMorph(x.path, y.path, sub, x.m, y.m));
|
|
686
686
|
opacities.push([x.opacity, y.opacity]);
|
|
687
687
|
} else if (x) {
|
|
688
|
-
parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub, x.m,
|
|
688
|
+
parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub, x.m, _chunkJJ2H25JGcjs.IDENTITY_MATRIX));
|
|
689
689
|
opacities.push([x.opacity, x.opacity]);
|
|
690
690
|
} else if (y) {
|
|
691
|
-
parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub,
|
|
691
|
+
parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub, _chunkJJ2H25JGcjs.IDENTITY_MATRIX, y.m));
|
|
692
692
|
opacities.push([y.opacity, y.opacity]);
|
|
693
693
|
}
|
|
694
694
|
}
|
|
@@ -468,7 +468,8 @@ var HistoryManager = (_class = class {
|
|
|
468
468
|
index,
|
|
469
469
|
current: index === u - 1,
|
|
470
470
|
undone: false,
|
|
471
|
-
origin: e.origin
|
|
471
|
+
origin: e.origin,
|
|
472
|
+
...e.tag !== void 0 ? { tag: e.tag } : {}
|
|
472
473
|
}));
|
|
473
474
|
for (let i = this.redoStack.length - 1; i >= 0; i--) {
|
|
474
475
|
const e = this.redoStack[i];
|
|
@@ -478,7 +479,8 @@ var HistoryManager = (_class = class {
|
|
|
478
479
|
index: entries.length,
|
|
479
480
|
current: false,
|
|
480
481
|
undone: true,
|
|
481
|
-
origin: e.origin
|
|
482
|
+
origin: e.origin,
|
|
483
|
+
...e.tag !== void 0 ? { tag: e.tag } : {}
|
|
482
484
|
});
|
|
483
485
|
}
|
|
484
486
|
this.cachedEntries = entries;
|
|
@@ -513,6 +515,25 @@ var HistoryManager = (_class = class {
|
|
|
513
515
|
}
|
|
514
516
|
return n;
|
|
515
517
|
}
|
|
518
|
+
/**
|
|
519
|
+
* Removes the steps `match` picks from the undo and redo stacks without running them, e.g.
|
|
520
|
+
* steps whose changes no longer apply because remote content replaced what they change. The
|
|
521
|
+
* other steps keep their order, a gesture merging into a removed step ends, and a mark whose
|
|
522
|
+
* step was removed is no longer valid. `match` gets each step as `getEntries` lists it (with
|
|
523
|
+
* its `tag`). Does nothing while a step is being applied or a batch is open. Returns how many
|
|
524
|
+
* steps were removed.
|
|
525
|
+
*/
|
|
526
|
+
dropSteps(match) {
|
|
527
|
+
if (this.isApplying || this.batchDepth > 0) return 0;
|
|
528
|
+
const ids = new Set(this.getEntries().filter((e) => match(e)).map((e) => e.id));
|
|
529
|
+
if (ids.size === 0) return 0;
|
|
530
|
+
this.undoStack = this.undoStack.filter((e) => !ids.has(e.id));
|
|
531
|
+
this.redoStack = this.redoStack.filter((e) => !ids.has(e.id));
|
|
532
|
+
if (this.gestureEntryId !== null && ids.has(this.gestureEntryId)) this.resetGesture();
|
|
533
|
+
this.notify();
|
|
534
|
+
this.emit("drop");
|
|
535
|
+
return ids.size;
|
|
536
|
+
}
|
|
516
537
|
/**
|
|
517
538
|
* Clears both undo and redo stacks.
|
|
518
539
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var _chunkL2JTLW6Bcjs = require('./chunk-L2JTLW6B.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkWPLGZBNEcjs = require('./chunk-WPLGZBNE.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -162,7 +162,7 @@ function isDocumentSource(source) {
|
|
|
162
162
|
return "document" in source && typeof source.document === "object" && source.document !== null;
|
|
163
163
|
}
|
|
164
164
|
async function createEffectAuthoringSession(source, options) {
|
|
165
|
-
const { provider, history = new (0,
|
|
165
|
+
const { provider, history = new (0, _chunkWPLGZBNEcjs.HistoryManager)(), mergeWindowMs = 400 } = options;
|
|
166
166
|
const scheduleFn = _nullishCoalesce(options.schedule, () => ( defaultSchedule));
|
|
167
167
|
let effectId;
|
|
168
168
|
let requestedPreset;
|
package/dist/diagram/index.cjs
CHANGED
|
@@ -137,7 +137,7 @@ var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
|
|
|
137
137
|
require('../chunk-2BSBFBOA.cjs');
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
var
|
|
140
|
+
var _chunkWPLGZBNEcjs = require('../chunk-WPLGZBNE.cjs');
|
|
141
141
|
|
|
142
142
|
// src/diagram/types.ts
|
|
143
143
|
var DIRECTIONS = ["TB", "TD", "BT", "LR", "RL"];
|
|
@@ -1257,7 +1257,7 @@ var DiagramController = (_class = class {
|
|
|
1257
1257
|
|
|
1258
1258
|
|
|
1259
1259
|
constructor(options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);
|
|
1260
|
-
this.history = _nullishCoalesce(options.history, () => ( new (0,
|
|
1260
|
+
this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkWPLGZBNEcjs.HistoryManager)()));
|
|
1261
1261
|
this.onChange = options.onChange;
|
|
1262
1262
|
this.readOnly = _nullishCoalesce(options.readOnly, () => ( false));
|
|
1263
1263
|
this.doc = _chunk3FSUJIXNcjs.parseMermaid.call(void 0, _nullishCoalesce(options.source, () => ( "flowchart TD\n")));
|
package/dist/diagram/index.js
CHANGED
package/dist/effects/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk4XSBOGMKcjs = require('../chunk-4XSBOGMK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkXUDMRMXQcjs = require('../chunk-XUDMRMXQ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -31,7 +31,7 @@ var _chunk2OQGPEHHcjs = require('../chunk-2OQGPEHH.cjs');
|
|
|
31
31
|
var _chunk557BDWKOcjs = require('../chunk-557BDWKO.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkEBFPMSJOcjs = require('../chunk-EBFPMSJO.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -90,7 +90,7 @@ var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
|
90
90
|
|
|
91
91
|
var _chunkL2JTLW6Bcjs = require('../chunk-L2JTLW6B.cjs');
|
|
92
92
|
require('../chunk-WOFXZ3XU.cjs');
|
|
93
|
-
require('../chunk-
|
|
93
|
+
require('../chunk-WPLGZBNE.cjs');
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
var _chunkDWJJI6RTcjs = require('../chunk-DWJJI6RT.cjs');
|
|
@@ -1289,6 +1289,9 @@ function createFakeEffectProvider(options = {}) {
|
|
|
1289
1289
|
height,
|
|
1290
1290
|
depth,
|
|
1291
1291
|
async render(request) {
|
|
1292
|
+
return this.renderSync(request);
|
|
1293
|
+
},
|
|
1294
|
+
renderSync(request) {
|
|
1292
1295
|
if (disposed) throw new (0, _chunkL2JTLW6Bcjs.EffectDisposedError)(id);
|
|
1293
1296
|
if (!Number.isFinite(request.time) || request.time < 0) {
|
|
1294
1297
|
throw new (0, _chunkL2JTLW6Bcjs.EffectUnsupportedError)(`time must be a finite number of ms \u2265 0, got ${request.time}.`, id);
|
|
@@ -1356,7 +1359,7 @@ function createFakeEffectProvider(options = {}) {
|
|
|
1356
1359
|
...options.timing ? { timingLength, timingSample } : {},
|
|
1357
1360
|
...options.templates ? fakeTemplateMethods() : {},
|
|
1358
1361
|
...supportsAuthoring ? {
|
|
1359
|
-
openAuthoring: (from) =>
|
|
1362
|
+
openAuthoring: (from) => _chunkXUDMRMXQcjs.createEffectAuthoringSession.call(void 0, from, { provider })
|
|
1360
1363
|
} : {}
|
|
1361
1364
|
};
|
|
1362
1365
|
return provider;
|
|
@@ -1974,4 +1977,4 @@ function createEffectAuthoringToolProvider(host, options) {
|
|
|
1974
1977
|
|
|
1975
1978
|
|
|
1976
1979
|
|
|
1977
|
-
exports.CAMERA_MOVE_MAX_MS = _chunkL2JTLW6Bcjs.CAMERA_MOVE_MAX_MS; exports.CAMERA_MOVE_ROLES = _chunkL2JTLW6Bcjs.CAMERA_MOVE_ROLES; exports.EFFECT_ACCEPTS = _chunkL2JTLW6Bcjs.EFFECT_ACCEPTS; exports.EFFECT_ERROR_CODES = _chunkL2JTLW6Bcjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_KINDS; exports.EFFECT_LAYER_ROLES = _chunkL2JTLW6Bcjs.EFFECT_LAYER_ROLES; exports.EFFECT_LAYER_USES = _chunk557BDWKOcjs.EFFECT_LAYER_USES; exports.EFFECT_PATH_FORMAT = _chunkL2JTLW6Bcjs.EFFECT_PATH_FORMAT; exports.EFFECT_SEQUENCE_NAME = _chunk557BDWKOcjs.EFFECT_SEQUENCE_NAME; exports.EFFECT_SUBJECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_SUBJECT_KINDS; exports.EFFECT_TEMPLATE_SLOT_TYPES = _chunkL2JTLW6Bcjs.EFFECT_TEMPLATE_SLOT_TYPES; exports.EFFECT_TRANSITION_MS = _chunkL2JTLW6Bcjs.EFFECT_TRANSITION_MS; exports.EFFECT_USES = _chunkL2JTLW6Bcjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkL2JTLW6Bcjs.EffectControlError; exports.EffectDisposedError = _chunkL2JTLW6Bcjs.EffectDisposedError; exports.EffectError = _chunkL2JTLW6Bcjs.EffectError; exports.EffectRendererPool =
|
|
1980
|
+
exports.CAMERA_MOVE_MAX_MS = _chunkL2JTLW6Bcjs.CAMERA_MOVE_MAX_MS; exports.CAMERA_MOVE_ROLES = _chunkL2JTLW6Bcjs.CAMERA_MOVE_ROLES; exports.EFFECT_ACCEPTS = _chunkL2JTLW6Bcjs.EFFECT_ACCEPTS; exports.EFFECT_ERROR_CODES = _chunkL2JTLW6Bcjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_KINDS; exports.EFFECT_LAYER_ROLES = _chunkL2JTLW6Bcjs.EFFECT_LAYER_ROLES; exports.EFFECT_LAYER_USES = _chunk557BDWKOcjs.EFFECT_LAYER_USES; exports.EFFECT_PATH_FORMAT = _chunkL2JTLW6Bcjs.EFFECT_PATH_FORMAT; exports.EFFECT_SEQUENCE_NAME = _chunk557BDWKOcjs.EFFECT_SEQUENCE_NAME; exports.EFFECT_SUBJECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_SUBJECT_KINDS; exports.EFFECT_TEMPLATE_SLOT_TYPES = _chunkL2JTLW6Bcjs.EFFECT_TEMPLATE_SLOT_TYPES; exports.EFFECT_TRANSITION_MS = _chunkL2JTLW6Bcjs.EFFECT_TRANSITION_MS; exports.EFFECT_USES = _chunkL2JTLW6Bcjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkL2JTLW6Bcjs.EffectControlError; exports.EffectDisposedError = _chunkL2JTLW6Bcjs.EffectDisposedError; exports.EffectError = _chunkL2JTLW6Bcjs.EffectError; exports.EffectRendererPool = _chunkEBFPMSJOcjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkL2JTLW6Bcjs.EffectUnsupportedError; exports.EffectsSlot = _chunkL2JTLW6Bcjs.EffectsSlot; exports.NoEffectsProviderError = _chunkL2JTLW6Bcjs.NoEffectsProviderError; exports.TIMING_BLENDS = _chunkL2JTLW6Bcjs.TIMING_BLENDS; exports.TIMING_DEFAULT_FPS = _chunkL2JTLW6Bcjs.TIMING_DEFAULT_FPS; exports.TIMING_MAX_FPS = _chunkL2JTLW6Bcjs.TIMING_MAX_FPS; exports.TIMING_MAX_FRAMES = _chunkL2JTLW6Bcjs.TIMING_MAX_FRAMES; exports.UnknownEffectError = _chunkL2JTLW6Bcjs.UnknownEffectError; exports.UnknownTemplateError = _chunkL2JTLW6Bcjs.UnknownTemplateError; exports.applyEffectMask = _chunkL2JTLW6Bcjs.applyEffectMask; exports.blendTimingFrames = _chunkL2JTLW6Bcjs.blendTimingFrames; exports.cameraBoxOfView = _chunkL2JTLW6Bcjs.cameraBoxOfView; exports.cameraMoveField = _chunkL2JTLW6Bcjs.cameraMoveField; exports.cameraMoveIdList = _chunkL2JTLW6Bcjs.cameraMoveIdList; exports.cameraMoveParts = _chunkL2JTLW6Bcjs.cameraMoveParts; exports.cameraMovesFor = _chunkL2JTLW6Bcjs.cameraMovesFor; exports.cameraViewOfBox = _chunkL2JTLW6Bcjs.cameraViewOfBox; exports.checkEffectProvider = checkEffectProvider; exports.checkEffectSequence = _chunk557BDWKOcjs.checkEffectSequence; exports.checkTemplateValues = _chunk557BDWKOcjs.checkTemplateValues; exports.checkTimingFootage = _chunkL2JTLW6Bcjs.checkTimingFootage; exports.checkTimingRequest = _chunkL2JTLW6Bcjs.checkTimingRequest; exports.countEffectTags = _chunkL2JTLW6Bcjs.countEffectTags; exports.createEffectAuthoringSession = _chunkXUDMRMXQcjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkL2JTLW6Bcjs.createEffectPixels; exports.createEffectToolProvider = _chunkL2JTLW6Bcjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectLayerInput = _chunk557BDWKOcjs.effectLayerInput; exports.effectLayerOffered = _chunk557BDWKOcjs.effectLayerOffered; exports.effectLayerRole = _chunk557BDWKOcjs.effectLayerRole; exports.effectLayerSpan = _chunk557BDWKOcjs.effectLayerSpan; exports.effectOffered = _chunkL2JTLW6Bcjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectSequenceEffects = _chunk557BDWKOcjs.effectSequenceEffects; exports.effectSequenceSlots = _chunk557BDWKOcjs.effectSequenceSlots; exports.effectSequenceTiming = _chunk557BDWKOcjs.effectSequenceTiming; exports.effectSubjectKind = _chunk557BDWKOcjs.effectSubjectKind; exports.effectSubjectProblem = _chunk557BDWKOcjs.effectSubjectProblem; exports.effectTemplateTools = _chunk557BDWKOcjs.effectTemplateTools; exports.effectValueErrors = _chunkL2JTLW6Bcjs.effectValueErrors; exports.encodeEffectFloat = _chunkL2JTLW6Bcjs.encodeEffectFloat; exports.fillEffectTemplate = _chunk557BDWKOcjs.fillEffectTemplate; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkL2JTLW6Bcjs.hasEffectTags; exports.isCameraView = _chunkL2JTLW6Bcjs.isCameraView; exports.isEffectError = _chunkL2JTLW6Bcjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkL2JTLW6Bcjs.isEffectPixels; exports.isSubjectTemplateSlot = _chunk557BDWKOcjs.isSubjectTemplateSlot; exports.layerImageInput = _chunkL2JTLW6Bcjs.layerImageInput; exports.linearToSrgb = _chunkL2JTLW6Bcjs.linearToSrgb; exports.normaliseEffectTag = _chunkL2JTLW6Bcjs.normaliseEffectTag; exports.normaliseTimingSample = _chunkL2JTLW6Bcjs.normaliseTimingSample; exports.pathControlsOf = _chunkL2JTLW6Bcjs.pathControlsOf; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveCameraMoveSpec = _chunkL2JTLW6Bcjs.resolveCameraMoveSpec; exports.resolveEffectValues = _chunkL2JTLW6Bcjs.resolveEffectValues; exports.sampleCameraViews = _chunkL2JTLW6Bcjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkL2JTLW6Bcjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkL2JTLW6Bcjs.searchEffectSummaries; exports.searchTemplateSummaries = _chunk557BDWKOcjs.searchTemplateSummaries; exports.srgbToLinear = _chunkL2JTLW6Bcjs.srgbToLinear; exports.templateDefaultValues = _chunk557BDWKOcjs.templateDefaultValues; exports.templateSlotSchema = _chunk557BDWKOcjs.templateSlotSchema; exports.templateSlotSummary = _chunk557BDWKOcjs.templateSlotSummary; exports.templateSlotTakes = _chunk557BDWKOcjs.templateSlotTakes; exports.templateValueProblem = _chunk557BDWKOcjs.templateValueProblem; exports.templateValuesSchema = _chunk557BDWKOcjs.templateValuesSchema; exports.timingSampleProblems = _chunkL2JTLW6Bcjs.timingSampleProblems;
|
package/dist/effects/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../chunk-N4ZXW3WB.js";
|
|
4
4
|
import {
|
|
5
5
|
createEffectAuthoringSession
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-23YL2EAB.js";
|
|
7
7
|
import {
|
|
8
8
|
EFFECT_LAYER_USES,
|
|
9
9
|
EFFECT_SEQUENCE_NAME,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "../chunk-DHQPRKXF.js";
|
|
32
32
|
import {
|
|
33
33
|
EffectRendererPool
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-T2URHAJX.js";
|
|
35
35
|
import {
|
|
36
36
|
CAMERA_MOVE_MAX_MS,
|
|
37
37
|
CAMERA_MOVE_ROLES,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
timingSampleProblems
|
|
91
91
|
} from "../chunk-MV7CYFMJ.js";
|
|
92
92
|
import "../chunk-V2ZCJRDM.js";
|
|
93
|
-
import "../chunk-
|
|
93
|
+
import "../chunk-GAZPHCTV.js";
|
|
94
94
|
import {
|
|
95
95
|
ANIMATION_EASING_PRESETS
|
|
96
96
|
} from "../chunk-5UJHB3BW.js";
|
|
@@ -1289,6 +1289,9 @@ function createFakeEffectProvider(options = {}) {
|
|
|
1289
1289
|
height,
|
|
1290
1290
|
depth,
|
|
1291
1291
|
async render(request) {
|
|
1292
|
+
return this.renderSync(request);
|
|
1293
|
+
},
|
|
1294
|
+
renderSync(request) {
|
|
1292
1295
|
if (disposed) throw new EffectDisposedError(id);
|
|
1293
1296
|
if (!Number.isFinite(request.time) || request.time < 0) {
|
|
1294
1297
|
throw new EffectUnsupportedError(`time must be a finite number of ms \u2265 0, got ${request.time}.`, id);
|
package/dist/effects/pool.d.cts
CHANGED
|
@@ -17,6 +17,15 @@ export declare class EffectRendererPool {
|
|
|
17
17
|
constructor(options?: EffectRendererPoolOptions);
|
|
18
18
|
/** Live renderers now. */
|
|
19
19
|
get size(): number;
|
|
20
|
+
/**
|
|
21
|
+
* Renders `request` on the caller's stack when this size's renderer is warm, idle and has
|
|
22
|
+
* `renderSync`; otherwise `null`, and nothing is rendered (an asynchronous provider never pays for it).
|
|
23
|
+
*/
|
|
24
|
+
renderSync(provider: EffectProvider, id: string, size: {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
depth?: 8 | 16 | 32;
|
|
28
|
+
}, request: EffectRenderRequest): EffectPixels | null;
|
|
20
29
|
/** Renders `request` with the provider's renderer for this effect, size and depth (made on first use). */
|
|
21
30
|
render(provider: EffectProvider, id: string, size: {
|
|
22
31
|
width: number;
|
package/dist/effects/pool.d.ts
CHANGED
|
@@ -17,6 +17,15 @@ export declare class EffectRendererPool {
|
|
|
17
17
|
constructor(options?: EffectRendererPoolOptions);
|
|
18
18
|
/** Live renderers now. */
|
|
19
19
|
get size(): number;
|
|
20
|
+
/**
|
|
21
|
+
* Renders `request` on the caller's stack when this size's renderer is warm, idle and has
|
|
22
|
+
* `renderSync`; otherwise `null`, and nothing is rendered (an asynchronous provider never pays for it).
|
|
23
|
+
*/
|
|
24
|
+
renderSync(provider: EffectProvider, id: string, size: {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
depth?: 8 | 16 | 32;
|
|
28
|
+
}, request: EffectRenderRequest): EffectPixels | null;
|
|
20
29
|
/** Renders `request` with the provider's renderer for this effect, size and depth (made on first use). */
|
|
21
30
|
render(provider: EffectProvider, id: string, size: {
|
|
22
31
|
width: number;
|
package/dist/effects/types.d.cts
CHANGED
|
@@ -200,6 +200,8 @@ export interface EffectRenderer {
|
|
|
200
200
|
readonly height: number;
|
|
201
201
|
readonly depth: 8 | 16 | 32;
|
|
202
202
|
render(request: EffectRenderRequest): Promise<EffectPixels>;
|
|
203
|
+
/** Optional: renders on the caller's stack, for renderers that can (a CPU one). Throws what `render` rejects with. */
|
|
204
|
+
renderSync?(request: EffectRenderRequest): EffectPixels;
|
|
203
205
|
/** Frees GPU or worker resources. Rendering afterwards rejects. */
|
|
204
206
|
dispose(): void;
|
|
205
207
|
}
|
package/dist/effects/types.d.ts
CHANGED
|
@@ -200,6 +200,8 @@ export interface EffectRenderer {
|
|
|
200
200
|
readonly height: number;
|
|
201
201
|
readonly depth: 8 | 16 | 32;
|
|
202
202
|
render(request: EffectRenderRequest): Promise<EffectPixels>;
|
|
203
|
+
/** Optional: renders on the caller's stack, for renderers that can (a CPU one). Throws what `render` rejects with. */
|
|
204
|
+
renderSync?(request: EffectRenderRequest): EffectPixels;
|
|
203
205
|
/** Frees GPU or worker resources. Rendering afterwards rejects. */
|
|
204
206
|
dispose(): void;
|
|
205
207
|
}
|