pixi-effects 0.45.0 → 0.46.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/CHANGELOG.md +5 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Composition-NSY7A32Y.js +7 -0
- package/dist/{Composition-YGBQX3HZ.js.map → Composition-NSY7A32Y.js.map} +1 -1
- package/dist/Composition-PME3P5LP.cjs +16 -0
- package/dist/{Composition-N6BOROJ2.cjs.map → Composition-PME3P5LP.cjs.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/{Movie-C-d4zN-N.d.cts → Movie-BqrAWN0g.d.cts} +6 -1
- package/dist/{Movie-lMSS9JwX.d.ts → Movie-sV8nJr_f.d.ts} +6 -1
- package/dist/{Spans-XTIWYSNO.cjs → Spans-2TZCNREQ.cjs} +9 -9
- package/dist/{Spans-XTIWYSNO.cjs.map → Spans-2TZCNREQ.cjs.map} +1 -1
- package/dist/{Spans-6L2ZVECX.js → Spans-TESJPQKX.js} +4 -4
- package/dist/{Spans-6L2ZVECX.js.map → Spans-TESJPQKX.js.map} +1 -1
- package/dist/{chunk-Z6JQO7GX.js → chunk-2E74SP63.js} +47 -13
- package/dist/chunk-2E74SP63.js.map +1 -0
- package/dist/{chunk-3IO5RWE4.cjs → chunk-7M63Y6MO.cjs} +85 -51
- package/dist/chunk-7M63Y6MO.cjs.map +1 -0
- package/dist/{chunk-3HZV3UHU.cjs → chunk-DKCMJILW.cjs} +67 -65
- package/dist/chunk-DKCMJILW.cjs.map +1 -0
- package/dist/{chunk-4QVQ5UJJ.js → chunk-DM2OLQOJ.js} +5 -6
- package/dist/chunk-DM2OLQOJ.js.map +1 -0
- package/dist/{chunk-ICI6ACHY.js → chunk-FPV3NPYC.js} +8 -6
- package/dist/chunk-FPV3NPYC.js.map +1 -0
- package/dist/{chunk-X62H3RBG.cjs → chunk-LALEBV63.cjs} +5 -6
- package/dist/chunk-LALEBV63.cjs.map +1 -0
- package/dist/index.cjs +33 -33
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/loader.css +1 -1
- package/dist/present.cjs +3 -3
- package/dist/present.d.cts +2 -2
- package/dist/present.d.ts +2 -2
- package/dist/present.js +3 -3
- package/dist/three.cjs +194 -15
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +75 -4
- package/dist/three.d.ts +75 -4
- package/dist/three.js +191 -13
- package/dist/three.js.map +1 -1
- package/dist/{types-C5xo0fzb.d.ts → types-CTSrPvY3.d.cts} +64 -58
- package/dist/{types-C5xo0fzb.d.cts → types-CTSrPvY3.d.ts} +64 -58
- package/docs/api.md +1 -0
- package/docs/dsl.md +24 -0
- package/llms-full.txt +61 -2
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +1 -1
- package/skills/pixi-effects/reference/recipes.md +34 -0
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-N6BOROJ2.cjs +0 -16
- package/dist/Composition-YGBQX3HZ.js +0 -7
- package/dist/chunk-3HZV3UHU.cjs.map +0 -1
- package/dist/chunk-3IO5RWE4.cjs.map +0 -1
- package/dist/chunk-4QVQ5UJJ.js.map +0 -1
- package/dist/chunk-ICI6ACHY.js.map +0 -1
- package/dist/chunk-X62H3RBG.cjs.map +0 -1
- package/dist/chunk-Z6JQO7GX.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDKCMJILW_cjs = require('./chunk-DKCMJILW.cjs');
|
|
4
|
+
var chunkLALEBV63_cjs = require('./chunk-LALEBV63.cjs');
|
|
5
5
|
var chunkO66JGPVV_cjs = require('./chunk-O66JGPVV.cjs');
|
|
6
6
|
var chunkJN7JHNZR_cjs = require('./chunk-JN7JHNZR.cjs');
|
|
7
7
|
var chunk3SAS3ZE5_cjs = require('./chunk-3SAS3ZE5.cjs');
|
|
@@ -1134,8 +1134,8 @@ function expandTransitions(spec) {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
const transitions = out.transitions;
|
|
1136
1136
|
const sequences = out.sequences ?? [];
|
|
1137
|
-
const remap = out.duration !== void 0 ?
|
|
1138
|
-
const parentDuration = remap ?
|
|
1137
|
+
const remap = out.duration !== void 0 ? chunkLALEBV63_cjs.timeRemapOf(out) : null;
|
|
1138
|
+
const parentDuration = remap ? chunkLALEBV63_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1139
1139
|
const compW = out.width;
|
|
1140
1140
|
const compH = out.height;
|
|
1141
1141
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1203,16 +1203,16 @@ function expandTransitions(spec) {
|
|
|
1203
1203
|
if (toUses > 1) {
|
|
1204
1204
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1205
1205
|
}
|
|
1206
|
-
const tStart =
|
|
1206
|
+
const tStart = chunkLALEBV63_cjs.resolveAt(t.at, parentDuration);
|
|
1207
1207
|
const tEnd = tStart + t.duration;
|
|
1208
1208
|
const fromSeq = fromEntry.seq;
|
|
1209
|
-
const fromStart =
|
|
1209
|
+
const fromStart = chunkLALEBV63_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1210
1210
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1211
1211
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1212
1212
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1213
1213
|
}
|
|
1214
1214
|
const toSeq = toEntry.seq;
|
|
1215
|
-
const toStart =
|
|
1215
|
+
const toStart = chunkLALEBV63_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1216
1216
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1217
1217
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1218
1218
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1272,7 +1272,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1272
1272
|
delete inner.at;
|
|
1273
1273
|
delete inner.duration;
|
|
1274
1274
|
const m = inner.mask;
|
|
1275
|
-
const carriesMatte = m !== void 0 &&
|
|
1275
|
+
const carriesMatte = m !== void 0 && chunkDKCMJILW_cjs.maskSourceOf(m).kind === "refs";
|
|
1276
1276
|
if (carriesMatte) delete inner.mask;
|
|
1277
1277
|
return {
|
|
1278
1278
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1542,7 +1542,7 @@ function canvasReport(root) {
|
|
|
1542
1542
|
const problem = threw.length ? `${name} could not draw at ${threw.map((t) => `${t} s`).join(", ")} (its ${kind === "three" ? "update or render threw" : "draw threw"}, or the layer failed to build): ${kind === "three" ? "the warning above says why" : "it shows a magenta checkerboard there; the warning above says why"}, so the layer cannot be called deterministic` : differs.length ? `${name} does not draw the same picture for the same time (checked at ${differs.map(describeDiff).join(", ")}; drawn in two orders after one draw that was thrown away): ` + (kind === "three" ? "usually its update uses Math.random, Date.now, a clock, or state that builds up from call to call: a mixer advanced with mixer.update(dt) is one (pose a clip with mixer.setTime(t), or threeGltf(url).pose(t)), and so is a value moved by the time since the last call. A skinned model of your own (not loaded by threeGltf) that moves and casts a shadow does it too: three culls a skinned mesh by a bounding sphere that does not follow it, so set mesh.frustumCulled = false. Set every object from t, so playback, a seek and an export agree" : "usually its draw uses Math.random, Date.now or state that outlives the call (a value it keeps from the last call), so playback, a seek and an export would not agree: use info.random() (seeded) and derive everything from t. If it uses none of these, look at the canvases it draws from: make sprites and masks with info.canvas(w, h) (not document.createElement) and draw them into the picture before the strokes that depend on them") : "";
|
|
1543
1543
|
out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem, kind });
|
|
1544
1544
|
}
|
|
1545
|
-
if (seq instanceof
|
|
1545
|
+
if (seq instanceof chunkDKCMJILW_cjs.CompositionSequence) walk3(seq);
|
|
1546
1546
|
};
|
|
1547
1547
|
const walk3 = (comp) => {
|
|
1548
1548
|
for (const { seq } of comp.layers()) {
|
|
@@ -1594,8 +1594,8 @@ function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
|
1594
1594
|
let length = 0;
|
|
1595
1595
|
if (typeof kf.duration === "number") length = kf.duration;
|
|
1596
1596
|
else if (kf.duration === "auto") {
|
|
1597
|
-
const sp =
|
|
1598
|
-
length = sp ? Math.round(
|
|
1597
|
+
const sp = chunkLALEBV63_cjs.parseSpring(kf.ease);
|
|
1598
|
+
length = sp ? Math.round(chunkLALEBV63_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1599
1599
|
}
|
|
1600
1600
|
if (!(length > 0)) continue;
|
|
1601
1601
|
const kat = kf.at ?? 0;
|
|
@@ -1634,7 +1634,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1634
1634
|
const name = seq.spec.name;
|
|
1635
1635
|
const label = name ?? `${seq.spec.type}#${i}`;
|
|
1636
1636
|
const alpha = (t?.alpha ?? 1) * carriers.reduce((a, c) => a * (c.target?.alpha ?? 1), 1);
|
|
1637
|
-
const alive = (threeD ? display.visible : t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1637
|
+
const alive = (threeD ? display.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1638
1638
|
const visible = parentVisible && alive && alpha > 0;
|
|
1639
1639
|
let bounds = null;
|
|
1640
1640
|
if (!insideThreeD) {
|
|
@@ -1675,7 +1675,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1675
1675
|
if (motion.ever) hasMotion.add(info);
|
|
1676
1676
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1677
1677
|
const maskTarget = seq.maskSequence?.target;
|
|
1678
|
-
const maskSrc =
|
|
1678
|
+
const maskSrc = chunkDKCMJILW_cjs.maskSourceOf(seq.spec.mask);
|
|
1679
1679
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1680
1680
|
const m = maskTarget.getBounds();
|
|
1681
1681
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1684,7 +1684,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1684
1684
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1685
1685
|
if (group) scene.set(info, group);
|
|
1686
1686
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1687
|
-
if (seq instanceof
|
|
1687
|
+
if (seq instanceof chunkDKCMJILW_cjs.CompositionSequence) walk3(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero, parentAlpha * alpha);
|
|
1688
1688
|
});
|
|
1689
1689
|
};
|
|
1690
1690
|
walk3(root, "", false, true);
|
|
@@ -1814,7 +1814,22 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1814
1814
|
return true;
|
|
1815
1815
|
};
|
|
1816
1816
|
const inside = (b, p) => p.x >= b.x && p.x <= b.x + b.width && p.y >= b.y && p.y <= b.y + b.height;
|
|
1817
|
-
const
|
|
1817
|
+
const hiddenSources = /* @__PURE__ */ new Map();
|
|
1818
|
+
const forwards = [];
|
|
1819
|
+
const rays = /* @__PURE__ */ new Map();
|
|
1820
|
+
const rayOf = (seq, d, local, lb) => {
|
|
1821
|
+
if (typeof seq.pickAt !== "function") return null;
|
|
1822
|
+
if (!rays.has(seq)) rays.set(seq, seq.pickAt((local.x - lb.x) / lb.width, (local.y - lb.y) / lb.height));
|
|
1823
|
+
return rays.get(seq);
|
|
1824
|
+
};
|
|
1825
|
+
const forwardThrough = (seq, d, path, local, lb) => {
|
|
1826
|
+
const shows = seq.screenOf;
|
|
1827
|
+
if (!shows || !inside(lb, local)) return;
|
|
1828
|
+
const r = rayOf(seq, d, local, lb);
|
|
1829
|
+
const shown = r?.uv ? shows.call(seq, r.material) : null;
|
|
1830
|
+
if (r?.uv && shown) forwards.push({ source: shown.source, uv: r.uv, via: { path, object: String(r.object) }, order: orderOf(d) });
|
|
1831
|
+
};
|
|
1832
|
+
const walk3 = (comp, prefix, parentVisible, at = { x, y }, orderBase, via) => {
|
|
1818
1833
|
comp.layers().forEach(({ seq, display, threeD, carriers, quad }, i) => {
|
|
1819
1834
|
const d = display;
|
|
1820
1835
|
if (!d) return;
|
|
@@ -1822,16 +1837,25 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1822
1837
|
const name = seq.spec.name;
|
|
1823
1838
|
const path = prefix + (name ?? `${seq.spec.type}#${i}`);
|
|
1824
1839
|
const alpha = (t?.alpha ?? 1) * carriers.reduce((a, c) => a * (c.target?.alpha ?? 1), 1);
|
|
1825
|
-
const alive = (threeD ? d.visible : t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1840
|
+
const alive = (threeD ? d.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1826
1841
|
const visible = parentVisible && alive && alpha > 0;
|
|
1827
|
-
if (!visible)
|
|
1828
|
-
|
|
1842
|
+
if (!visible) {
|
|
1843
|
+
if (seq instanceof chunkDKCMJILW_cjs.CompositionSequence && !threeD && parentVisible && alpha > 0 && t?.visible === false && (t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true)) hiddenSources.set(seq, path);
|
|
1844
|
+
return;
|
|
1845
|
+
}
|
|
1846
|
+
const isComposition = seq instanceof chunkDKCMJILW_cjs.CompositionSequence;
|
|
1829
1847
|
if (isComposition && !threeD) {
|
|
1830
|
-
walk3(seq, path + "/", visible);
|
|
1848
|
+
walk3(seq, path + "/", visible, at, orderBase, via);
|
|
1831
1849
|
return;
|
|
1832
1850
|
}
|
|
1833
|
-
if (!wanted(name, path))
|
|
1834
|
-
|
|
1851
|
+
if (!wanted(name, path)) {
|
|
1852
|
+
if (!threeD) {
|
|
1853
|
+
const lp = d.toLocal(at);
|
|
1854
|
+
forwardThrough(seq, d, path, lp, d.getLocalBounds());
|
|
1855
|
+
}
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
const point = at;
|
|
1835
1859
|
let hit = null;
|
|
1836
1860
|
if (threeD) {
|
|
1837
1861
|
if (quad && pointInQuad(quad, d.toLocal(point).x, d.toLocal(point).y)) hit = { name, path, type: seq.spec.type, kind: "card", point };
|
|
@@ -1839,7 +1863,10 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1839
1863
|
const local = d.toLocal(point);
|
|
1840
1864
|
const lb = d.getLocalBounds();
|
|
1841
1865
|
if (inside(lb, local)) {
|
|
1842
|
-
const
|
|
1866
|
+
const isThree = typeof seq.pickAt === "function";
|
|
1867
|
+
const ray = isThree ? rayOf(seq, d, local, lb) : void 0;
|
|
1868
|
+
if (isThree) forwardThrough(seq, d, path, local, lb);
|
|
1869
|
+
const three = ray ? { object: ray.object, point: ray.point, distance: ray.distance, object3d: ray.object3d } : isThree ? null : void 0;
|
|
1843
1870
|
if (three) {
|
|
1844
1871
|
const planeOf = seq.dragPlane;
|
|
1845
1872
|
if (planeOf) {
|
|
@@ -1872,12 +1899,18 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1872
1899
|
}
|
|
1873
1900
|
if (!hit) return;
|
|
1874
1901
|
const maskTarget = seq.maskSequence?.target;
|
|
1875
|
-
const maskSrc =
|
|
1902
|
+
const maskSrc = chunkDKCMJILW_cjs.maskSourceOf(seq.spec.mask);
|
|
1876
1903
|
if (maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert) && !inside(maskTarget.getBounds(), point)) return;
|
|
1877
|
-
found.push({ hit, order: orderOf(d) });
|
|
1904
|
+
found.push({ hit: via ? { ...hit, point: { x, y }, via } : hit, order: orderBase ? [...orderBase, ...orderOf(d)] : orderOf(d) });
|
|
1878
1905
|
});
|
|
1879
1906
|
};
|
|
1880
1907
|
walk3(root, "", true);
|
|
1908
|
+
for (const f of forwards) {
|
|
1909
|
+
const path = hiddenSources.get(f.source);
|
|
1910
|
+
if (path === void 0) continue;
|
|
1911
|
+
const g = f.source.target.toGlobal({ x: f.uv.u * f.source.intrinsicWidth, y: (1 - f.uv.v) * f.source.intrinsicHeight });
|
|
1912
|
+
walk3(f.source, path + "/", true, g, f.order, f.via);
|
|
1913
|
+
}
|
|
1881
1914
|
return found.sort((a, b) => above(a.order, b.order)).map((f) => f.hit);
|
|
1882
1915
|
}
|
|
1883
1916
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
@@ -1910,7 +1943,7 @@ function walk(root, visit) {
|
|
|
1910
1943
|
visit(seq);
|
|
1911
1944
|
const mask = seq.maskSequence;
|
|
1912
1945
|
if (mask) visit(mask);
|
|
1913
|
-
if (seq instanceof
|
|
1946
|
+
if (seq instanceof chunkDKCMJILW_cjs.CompositionSequence) walk(seq, visit);
|
|
1914
1947
|
}
|
|
1915
1948
|
}
|
|
1916
1949
|
function reusePoolOf(old) {
|
|
@@ -2011,7 +2044,7 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
2011
2044
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
2012
2045
|
function detailOf(seq) {
|
|
2013
2046
|
const s = seq.spec;
|
|
2014
|
-
const spans =
|
|
2047
|
+
const spans = chunkLALEBV63_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2015
2048
|
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2016
2049
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2017
2050
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
@@ -2027,10 +2060,10 @@ function walk2(comp, parentStart, parentEnd, depth, prefix, rows, transitions, l
|
|
|
2027
2060
|
const start = parentStart + (seq.at ?? 0);
|
|
2028
2061
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2029
2062
|
const span = end - start;
|
|
2030
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2063
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkLALEBV63_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2031
2064
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2032
2065
|
const inner = [];
|
|
2033
|
-
const isComp = seq instanceof
|
|
2066
|
+
const isComp = seq instanceof chunkDKCMJILW_cjs.CompositionSequence;
|
|
2034
2067
|
if (isComp) {
|
|
2035
2068
|
const label = seq.remapLabel();
|
|
2036
2069
|
walk2(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2189,7 +2222,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2189
2222
|
}
|
|
2190
2223
|
|
|
2191
2224
|
// src/core/vars.ts
|
|
2192
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2225
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkLALEBV63_cjs.EXPRESSION_NAMES];
|
|
2193
2226
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2194
2227
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2195
2228
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2733,8 +2766,8 @@ var Movie = class {
|
|
|
2733
2766
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2734
2767
|
this._posterFrame = poster.frame;
|
|
2735
2768
|
this.background = options.background ?? "#000000";
|
|
2736
|
-
this.timeline =
|
|
2737
|
-
|
|
2769
|
+
this.timeline = chunkLALEBV63_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2770
|
+
chunkLALEBV63_cjs.lengthen(this.timeline, this.duration);
|
|
2738
2771
|
const baseAppOptions = {
|
|
2739
2772
|
width: this.width,
|
|
2740
2773
|
height: this.height,
|
|
@@ -2820,6 +2853,7 @@ var Movie = class {
|
|
|
2820
2853
|
frameRate: this.frameRate,
|
|
2821
2854
|
vars: numericVars(vars),
|
|
2822
2855
|
...gpuField,
|
|
2856
|
+
...this.app?.renderer ? { pixiRenderer: this.app.renderer } : {},
|
|
2823
2857
|
...reuse ? { reuse } : {},
|
|
2824
2858
|
...lp ? { onLayerBuilt: async () => {
|
|
2825
2859
|
lp.tick();
|
|
@@ -2832,7 +2866,7 @@ var Movie = class {
|
|
|
2832
2866
|
height: sizeWins ? height : spec.height ?? height,
|
|
2833
2867
|
duration: spec.duration ?? this.duration
|
|
2834
2868
|
} : void 0;
|
|
2835
|
-
await
|
|
2869
|
+
await chunkLALEBV63_cjs.ensureFilterLibrary(seededComposition);
|
|
2836
2870
|
if (chunkJN7JHNZR_cjs.usesAdvancedBlend(seededComposition)) await chunkJN7JHNZR_cjs.enableAdvancedBlend(this.app.renderer);
|
|
2837
2871
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
2838
2872
|
const rootSeqSpec = {
|
|
@@ -2843,7 +2877,7 @@ var Movie = class {
|
|
|
2843
2877
|
...userComposition
|
|
2844
2878
|
};
|
|
2845
2879
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
2846
|
-
const sequence = new
|
|
2880
|
+
const sequence = new chunkDKCMJILW_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
2847
2881
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
2848
2882
|
try {
|
|
2849
2883
|
await sequence.build();
|
|
@@ -2981,8 +3015,8 @@ var Movie = class {
|
|
|
2981
3015
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
2982
3016
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged, reusePoolOf(this._rootSequence));
|
|
2983
3017
|
alive();
|
|
2984
|
-
const timeline =
|
|
2985
|
-
|
|
3018
|
+
const timeline = chunkLALEBV63_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
3019
|
+
chunkLALEBV63_cjs.lengthen(timeline, this.duration);
|
|
2986
3020
|
sequence.bindTimeline(timeline);
|
|
2987
3021
|
const hadSound = this.audioBuffer !== null;
|
|
2988
3022
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3751,7 +3785,7 @@ function countLayers(spec) {
|
|
|
3751
3785
|
n += 1 + countLayers(s);
|
|
3752
3786
|
const spans = s.spans;
|
|
3753
3787
|
if (Array.isArray(spans)) n += spans.length;
|
|
3754
|
-
const src =
|
|
3788
|
+
const src = chunkDKCMJILW_cjs.maskSourceOf(mask);
|
|
3755
3789
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3756
3790
|
}
|
|
3757
3791
|
return n;
|
|
@@ -3840,8 +3874,8 @@ function splitVertical(text, style, ts, right, top, align, by) {
|
|
|
3840
3874
|
|
|
3841
3875
|
// src/presets/_ease.ts
|
|
3842
3876
|
function parseEase2(name) {
|
|
3843
|
-
|
|
3844
|
-
return
|
|
3877
|
+
chunkLALEBV63_cjs.checkEase(name, "a preset");
|
|
3878
|
+
return chunkLALEBV63_cjs.parseEase(name);
|
|
3845
3879
|
}
|
|
3846
3880
|
|
|
3847
3881
|
// src/presets/kenBurns.ts
|
|
@@ -3976,17 +4010,17 @@ function orbit(opts) {
|
|
|
3976
4010
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
3977
4011
|
}
|
|
3978
4012
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
3979
|
-
const fixedR = opts.radius ??
|
|
4013
|
+
const fixedR = opts.radius ?? chunkLALEBV63_cjs.homeDistance(height, fov ?? chunkLALEBV63_cjs.DEFAULT_FOV);
|
|
3980
4014
|
const start = opts.start ?? -degrees / 2;
|
|
3981
4015
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
3982
4016
|
const easeFn = parseEase2(ease);
|
|
3983
4017
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
3984
4018
|
const pos = (i) => {
|
|
3985
4019
|
const p = i / steps;
|
|
3986
|
-
const a = (start + degrees * easeFn(p)) *
|
|
4020
|
+
const a = (start + degrees * easeFn(p)) * chunkLALEBV63_cjs.DEG;
|
|
3987
4021
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
3988
4022
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
3989
|
-
const R =
|
|
4023
|
+
const R = chunkLALEBV63_cjs.homeDistance(height, f);
|
|
3990
4024
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
3991
4025
|
};
|
|
3992
4026
|
const keyframes = [];
|
|
@@ -4041,7 +4075,7 @@ function particles(opts) {
|
|
|
4041
4075
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
4042
4076
|
const out = [];
|
|
4043
4077
|
for (let i = 0; i < count; i++) {
|
|
4044
|
-
const r =
|
|
4078
|
+
const r = chunkLALEBV63_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
4045
4079
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
4046
4080
|
const born = at + r() * emit;
|
|
4047
4081
|
const lifetime = pick(life);
|
|
@@ -4054,7 +4088,7 @@ function particles(opts) {
|
|
|
4054
4088
|
const turn = spin ? pick(spin) : 0;
|
|
4055
4089
|
const startAngle = spin ? r() * 360 : 0;
|
|
4056
4090
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
4057
|
-
const n0 = sway ?
|
|
4091
|
+
const n0 = sway ? chunkLALEBV63_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
4058
4092
|
const at_ = (t) => {
|
|
4059
4093
|
const axis = (p0, v0, acc) => {
|
|
4060
4094
|
if (drag > 0) {
|
|
@@ -4063,7 +4097,7 @@ function particles(opts) {
|
|
|
4063
4097
|
}
|
|
4064
4098
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
4065
4099
|
};
|
|
4066
|
-
const sw = sway ? swayAmp * (
|
|
4100
|
+
const sw = sway ? swayAmp * (chunkLALEBV63_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
4067
4101
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
4068
4102
|
};
|
|
4069
4103
|
const kfs = [];
|
|
@@ -4125,7 +4159,7 @@ function followPath(opts) {
|
|
|
4125
4159
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
4126
4160
|
const segments = [];
|
|
4127
4161
|
let total = 0;
|
|
4128
|
-
for (const line of
|
|
4162
|
+
for (const line of chunkLALEBV63_cjs.flattenSvgPath(d)) {
|
|
4129
4163
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
4130
4164
|
for (let i = 2; i < p.length; i += 2) {
|
|
4131
4165
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4178,7 +4212,7 @@ function followPath(opts) {
|
|
|
4178
4212
|
// src/core/pathSample.ts
|
|
4179
4213
|
function samplePath(d) {
|
|
4180
4214
|
if (typeof d !== "string" || d.trim() === "") throw new Error('samplePath(): d must be SVG path data, e.g. "M 40 300 C 200 20 400 20 560 300"');
|
|
4181
|
-
const lines =
|
|
4215
|
+
const lines = chunkLALEBV63_cjs.flattenSvgPath(d);
|
|
4182
4216
|
const segments = [];
|
|
4183
4217
|
let length = 0;
|
|
4184
4218
|
for (const line of lines) {
|
|
@@ -4209,7 +4243,7 @@ function samplePath(d) {
|
|
|
4209
4243
|
return { x: g.x0 + (g.x1 - g.x0) * t, y: g.y0 + (g.y1 - g.y0) * t, angle: Math.atan2(g.y1 - g.y0, g.x1 - g.x0) };
|
|
4210
4244
|
},
|
|
4211
4245
|
trim(start = 0, end = 1) {
|
|
4212
|
-
return
|
|
4246
|
+
return chunkLALEBV63_cjs.trimPolylines(lines, start, end).map((l) => l.closed ? [...l.pts, l.pts[0], l.pts[1]] : l.pts);
|
|
4213
4247
|
}
|
|
4214
4248
|
};
|
|
4215
4249
|
}
|
|
@@ -4318,7 +4352,7 @@ function distances(n, from, grid, seed) {
|
|
|
4318
4352
|
if (n === 0) return [];
|
|
4319
4353
|
if (from === "random") {
|
|
4320
4354
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4321
|
-
const r =
|
|
4355
|
+
const r = chunkLALEBV63_cjs.random(seed);
|
|
4322
4356
|
for (let i = n - 1; i > 0; i--) {
|
|
4323
4357
|
const j = Math.floor(r() * (i + 1));
|
|
4324
4358
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4380,7 +4414,7 @@ function wiggle(opts) {
|
|
|
4380
4414
|
to[n] = p.around;
|
|
4381
4415
|
return;
|
|
4382
4416
|
}
|
|
4383
|
-
const off = (
|
|
4417
|
+
const off = (chunkLALEBV63_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4384
4418
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4385
4419
|
});
|
|
4386
4420
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -4839,5 +4873,5 @@ exports.splitText = splitText;
|
|
|
4839
4873
|
exports.stagger = stagger;
|
|
4840
4874
|
exports.wiggle = wiggle;
|
|
4841
4875
|
exports.withFade = withFade;
|
|
4842
|
-
//# sourceMappingURL=chunk-
|
|
4843
|
-
//# sourceMappingURL=chunk-
|
|
4876
|
+
//# sourceMappingURL=chunk-7M63Y6MO.cjs.map
|
|
4877
|
+
//# sourceMappingURL=chunk-7M63Y6MO.cjs.map
|