pixi-effects 0.49.0 → 0.50.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 +9 -0
- package/README.md +8 -7
- package/ai/chat-template.html +4 -4
- package/ai/tools/check.mjs +6 -6
- package/dist/3d.cjs +17 -13
- package/dist/3d.cjs.map +1 -1
- package/dist/3d.d.cts +3 -1
- package/dist/3d.d.ts +3 -1
- package/dist/3d.js +9 -5
- package/dist/3d.js.map +1 -1
- package/dist/Composition-47U5U637.cjs +16 -0
- package/dist/{Composition-464AWDV6.cjs.map → Composition-47U5U637.cjs.map} +1 -1
- package/dist/Composition-GVWWLFDL.js +7 -0
- package/dist/{Composition-5U63LMPX.js.map → Composition-GVWWLFDL.js.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/{Movie-BxB7bauG.d.cts → Movie-DogzDBuW.d.cts} +20 -5
- package/dist/{Movie-6EWOz6Yw.d.ts → Movie-Y7iHg2V8.d.ts} +20 -5
- package/dist/{Spans-W5VJRMGC.js → Spans-3SEZSTQV.js} +6 -6
- package/dist/{Spans-W5VJRMGC.js.map → Spans-3SEZSTQV.js.map} +1 -1
- package/dist/{Spans-DUR2W5EH.cjs → Spans-R426NVY3.cjs} +11 -11
- package/dist/{Spans-DUR2W5EH.cjs.map → Spans-R426NVY3.cjs.map} +1 -1
- package/dist/{blendModes-NC76DNVX.cjs → blendModes-2IDILRN6.cjs} +5 -5
- package/dist/{blendModes-NC76DNVX.cjs.map → blendModes-2IDILRN6.cjs.map} +1 -1
- package/dist/{blendModes-ZOBLPSR3.js → blendModes-4QH44GOL.js} +4 -4
- package/dist/{blendModes-ZOBLPSR3.js.map → blendModes-4QH44GOL.js.map} +1 -1
- package/dist/{chunk-ABWRISRK.cjs → chunk-3FCDRLW3.cjs} +4 -3
- package/dist/chunk-3FCDRLW3.cjs.map +1 -0
- package/dist/{chunk-MXACRKAN.js → chunk-C2HL5236.js} +4 -4
- package/dist/{chunk-MXACRKAN.js.map → chunk-C2HL5236.js.map} +1 -1
- package/dist/{chunk-5YNME6AH.cjs → chunk-GXGIISFS.cjs} +5 -5
- package/dist/{chunk-5YNME6AH.cjs.map → chunk-GXGIISFS.cjs.map} +1 -1
- package/dist/{chunk-H363KMJR.js → chunk-J4ZP76IL.js} +4 -3
- package/dist/chunk-J4ZP76IL.js.map +1 -0
- package/dist/{chunk-BSFWVTSR.cjs → chunk-O2MD3L4J.cjs} +92 -92
- package/dist/{chunk-BSFWVTSR.cjs.map → chunk-O2MD3L4J.cjs.map} +1 -1
- package/dist/{chunk-DOGY3EAW.js → chunk-SSVHAF3Q.js} +470 -17
- package/dist/chunk-SSVHAF3Q.js.map +1 -0
- package/dist/{chunk-USUUAYTE.js → chunk-TXNQLMRT.js} +5 -5
- package/dist/{chunk-USUUAYTE.js.map → chunk-TXNQLMRT.js.map} +1 -1
- package/dist/{chunk-PBMDZT2T.js → chunk-UTUUOQ47.js} +39 -16
- package/dist/chunk-UTUUOQ47.js.map +1 -0
- package/dist/{chunk-33USHRV5.cjs → chunk-VVUSZVP7.cjs} +493 -39
- package/dist/chunk-VVUSZVP7.cjs.map +1 -0
- package/dist/{chunk-GUDLIAIG.cjs → chunk-YOKRPAKA.cjs} +82 -59
- package/dist/chunk-YOKRPAKA.cjs.map +1 -0
- package/dist/index.cjs +35 -35
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/loader.css +1 -1
- package/dist/present.cjs +5 -5
- package/dist/present.d.cts +2 -2
- package/dist/present.d.ts +2 -2
- package/dist/present.js +5 -5
- package/dist/three.cjs +13 -9
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +3 -1
- package/dist/three.d.ts +3 -1
- package/dist/three.js +8 -4
- package/dist/three.js.map +1 -1
- package/dist/{types-kt7DQKfO.d.cts → types-BZngm4nT.d.cts} +48 -5
- package/dist/{types-kt7DQKfO.d.ts → types-BZngm4nT.d.ts} +48 -5
- package/docs/api.md +4 -1
- package/docs/dsl.md +35 -1
- package/llms-full.txt +91 -3
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +2 -1
- package/skills/pixi-effects/reference/cheatsheet.md +2 -0
- package/skills/pixi-effects/reference/pitfalls.md +6 -0
- package/skills/pixi-effects/reference/recipes.md +42 -0
- package/skills/pixi-effects/template.html +8 -7
- package/dist/Composition-464AWDV6.cjs +0 -16
- package/dist/Composition-5U63LMPX.js +0 -7
- package/dist/chunk-33USHRV5.cjs.map +0 -1
- package/dist/chunk-ABWRISRK.cjs.map +0 -1
- package/dist/chunk-DOGY3EAW.js.map +0 -1
- package/dist/chunk-GUDLIAIG.cjs.map +0 -1
- package/dist/chunk-H363KMJR.js.map +0 -1
- package/dist/chunk-PBMDZT2T.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO2MD3L4J_cjs = require('./chunk-O2MD3L4J.cjs');
|
|
4
4
|
var chunkVQXZ2NOI_cjs = require('./chunk-VQXZ2NOI.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkVVUSZVP7_cjs = require('./chunk-VVUSZVP7.cjs');
|
|
6
6
|
var chunkZAHCGFGC_cjs = require('./chunk-ZAHCGFGC.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var chunkGXGIISFS_cjs = require('./chunk-GXGIISFS.cjs');
|
|
8
|
+
var chunk3FCDRLW3_cjs = require('./chunk-3FCDRLW3.cjs');
|
|
9
9
|
var chunkDOLTCXCL_cjs = require('./chunk-DOLTCXCL.cjs');
|
|
10
10
|
var pixi_js = require('pixi.js');
|
|
11
11
|
|
|
@@ -1268,8 +1268,8 @@ function expandTransitions(spec) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
const transitions = out.transitions;
|
|
1270
1270
|
const sequences = out.sequences ?? [];
|
|
1271
|
-
const remap = out.duration !== void 0 ?
|
|
1272
|
-
const parentDuration = remap ?
|
|
1271
|
+
const remap = out.duration !== void 0 ? chunkVVUSZVP7_cjs.timeRemapOf(out) : null;
|
|
1272
|
+
const parentDuration = remap ? chunkVVUSZVP7_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1273
1273
|
const compW = out.width;
|
|
1274
1274
|
const compH = out.height;
|
|
1275
1275
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1337,16 +1337,16 @@ function expandTransitions(spec) {
|
|
|
1337
1337
|
if (toUses > 1) {
|
|
1338
1338
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1339
1339
|
}
|
|
1340
|
-
const tStart =
|
|
1340
|
+
const tStart = chunkVVUSZVP7_cjs.resolveAt(t.at, parentDuration);
|
|
1341
1341
|
const tEnd = tStart + t.duration;
|
|
1342
1342
|
const fromSeq = fromEntry.seq;
|
|
1343
|
-
const fromStart =
|
|
1343
|
+
const fromStart = chunkVVUSZVP7_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1344
1344
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1345
1345
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1346
1346
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1347
1347
|
}
|
|
1348
1348
|
const toSeq = toEntry.seq;
|
|
1349
|
-
const toStart =
|
|
1349
|
+
const toStart = chunkVVUSZVP7_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1350
1350
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1351
1351
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1352
1352
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1406,7 +1406,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1406
1406
|
delete inner.at;
|
|
1407
1407
|
delete inner.duration;
|
|
1408
1408
|
const m = inner.mask;
|
|
1409
|
-
const carriesMatte = m !== void 0 &&
|
|
1409
|
+
const carriesMatte = m !== void 0 && chunkO2MD3L4J_cjs.maskSourceOf(m).kind === "refs";
|
|
1410
1410
|
if (carriesMatte) delete inner.mask;
|
|
1411
1411
|
return {
|
|
1412
1412
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1671,14 +1671,14 @@ function canvasReport(root) {
|
|
|
1671
1671
|
const length = seq.duration ?? 0;
|
|
1672
1672
|
const moments = [0.15, 0.4, 0.65, 0.9].map((f) => Math.round(f * length * 1e3) / 1e3);
|
|
1673
1673
|
const { differs, drawMs, threw } = seq.checkDeterminism(moments);
|
|
1674
|
-
const name =
|
|
1674
|
+
const name = chunk3FCDRLW3_cjs.describeLayer(seq.spec);
|
|
1675
1675
|
const type = seq.spec.type;
|
|
1676
|
-
const kind = type === "three" ? "three" : type === "scene3d" ? "scene3d" : "canvas";
|
|
1676
|
+
const kind = type === "three" ? "three" : type === "scene3d" ? "scene3d" : type === "scene2d" ? "scene2d" : "canvas";
|
|
1677
1677
|
const drawn = kind === "canvas" ? "draw threw" : "update or render threw";
|
|
1678
|
-
const problem = threw.length ? `${name} could not draw at ${threw.map((t) => `${t} s`).join(", ")} (its ${drawn}, or the layer failed to build): ${kind === "canvas" ? "it shows a magenta checkerboard there; the warning above says why" : "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" : kind === "scene3d" ? "usually its update keeps state from call to call (a value moved by the time since the last call), uses Math.random or a clock, or a model's player or a particle system runs on its own clock (pose a clip with model.player.getState(name).gotoAndStop(t)), or a MotionBlurEffect reads the camera of the frame drawn before. 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") : "";
|
|
1678
|
+
const problem = threw.length ? `${name} could not draw at ${threw.map((t) => `${t} s`).join(", ")} (its ${drawn}, or the layer failed to build): ${kind === "canvas" ? "it shows a magenta checkerboard there; the warning above says why" : "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" : kind === "scene3d" ? "usually its update keeps state from call to call (a value moved by the time since the last call), uses Math.random or a clock, or a model's player or a particle system runs on its own clock (pose a clip with model.player.getState(name).gotoAndStop(t)), or a MotionBlurEffect reads the camera of the frame drawn before. Set every object from t, so playback, a seek and an export agree" : kind === "scene2d" ? "usually its update keeps state from call to call (a value moved by the time since the last call, a position added to instead of set), uses Math.random or a clock, or something runs on PixiJS's ticker (a Ticker.shared.add of your own, a video texture). 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") : "";
|
|
1679
1679
|
out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem, kind });
|
|
1680
1680
|
}
|
|
1681
|
-
if (seq instanceof
|
|
1681
|
+
if (seq instanceof chunkO2MD3L4J_cjs.CompositionSequence) walk3(seq);
|
|
1682
1682
|
};
|
|
1683
1683
|
const walk3 = (comp) => {
|
|
1684
1684
|
for (const { seq } of comp.layers()) {
|
|
@@ -1730,8 +1730,8 @@ function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
|
1730
1730
|
let length = 0;
|
|
1731
1731
|
if (typeof kf.duration === "number") length = kf.duration;
|
|
1732
1732
|
else if (kf.duration === "auto") {
|
|
1733
|
-
const sp =
|
|
1734
|
-
length = sp ? Math.round(
|
|
1733
|
+
const sp = chunkVVUSZVP7_cjs.parseSpring(kf.ease);
|
|
1734
|
+
length = sp ? Math.round(chunkVVUSZVP7_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1735
1735
|
}
|
|
1736
1736
|
if (!(length > 0)) continue;
|
|
1737
1737
|
const kat = kf.at ?? 0;
|
|
@@ -1811,7 +1811,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1811
1811
|
if (motion.ever) hasMotion.add(info);
|
|
1812
1812
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1813
1813
|
const maskTarget = seq.maskSequence?.target;
|
|
1814
|
-
const maskSrc =
|
|
1814
|
+
const maskSrc = chunkO2MD3L4J_cjs.maskSourceOf(seq.spec.mask);
|
|
1815
1815
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1816
1816
|
const m = maskTarget.getBounds();
|
|
1817
1817
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1820,7 +1820,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1820
1820
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1821
1821
|
if (group) scene.set(info, group);
|
|
1822
1822
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1823
|
-
if (seq instanceof
|
|
1823
|
+
if (seq instanceof chunkO2MD3L4J_cjs.CompositionSequence) walk3(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero, parentAlpha * alpha);
|
|
1824
1824
|
});
|
|
1825
1825
|
};
|
|
1826
1826
|
walk3(root, "", false, true);
|
|
@@ -1992,12 +1992,12 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1992
1992
|
const alive = (threeD ? d.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1993
1993
|
const visible = parentVisible && alive && alpha > 0;
|
|
1994
1994
|
if (!visible) {
|
|
1995
|
-
if (seq instanceof
|
|
1995
|
+
if (seq instanceof chunkO2MD3L4J_cjs.CompositionSequence && !threeD && parentVisible && alpha > 0 && t?.visible === false && (t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true)) hiddenSources.set(seq, path);
|
|
1996
1996
|
return;
|
|
1997
1997
|
}
|
|
1998
|
-
const isComposition = seq instanceof
|
|
1998
|
+
const isComposition = seq instanceof chunkO2MD3L4J_cjs.CompositionSequence;
|
|
1999
1999
|
if (isComposition && !threeD) {
|
|
2000
|
-
const gm = seq.maskSequence?.target, gs =
|
|
2000
|
+
const gm = seq.maskSequence?.target, gs = chunkO2MD3L4J_cjs.maskSourceOf(seq.spec.mask);
|
|
2001
2001
|
if (gm && gs.kind === "inline" && !gs.invert && !inMask(gm, at)) return;
|
|
2002
2002
|
walk3(seq, path + "/", visible, at, orderBase, via);
|
|
2003
2003
|
return;
|
|
@@ -2011,7 +2011,14 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
const point = at;
|
|
2013
2013
|
let hit = null;
|
|
2014
|
-
|
|
2014
|
+
const scene2d = seq.pick2d;
|
|
2015
|
+
if (typeof scene2d === "function" && !threeD) {
|
|
2016
|
+
const found2 = scene2d.call(seq, point);
|
|
2017
|
+
if (found2) {
|
|
2018
|
+
const s2 = seq;
|
|
2019
|
+
hit = { name, path, type: seq.spec.type, kind: "scene2d", point, scene2d: { object: found2.object, node: found2.node, point: found2.point, grab: () => ({ move: s2.dragFrom(found2.node, point) }) } };
|
|
2020
|
+
}
|
|
2021
|
+
} else if (threeD) {
|
|
2015
2022
|
if (quad && pointInQuad(quad, d.toLocal(point).x, d.toLocal(point).y)) hit = { name, path, type: seq.spec.type, kind: "card", point };
|
|
2016
2023
|
} else {
|
|
2017
2024
|
const local = d.toLocal(point);
|
|
@@ -2054,7 +2061,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2054
2061
|
}
|
|
2055
2062
|
if (!hit) return;
|
|
2056
2063
|
const maskTarget = seq.maskSequence?.target;
|
|
2057
|
-
const maskSrc =
|
|
2064
|
+
const maskSrc = chunkO2MD3L4J_cjs.maskSourceOf(seq.spec.mask);
|
|
2058
2065
|
if (maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert) && !(maskSrc.kind === "inline" ? inMask(maskTarget, point) : inside(maskTarget.getBounds(), point))) return;
|
|
2059
2066
|
found.push({ hit: via ? { ...hit, point: { x, y }, via } : hit, order: orderBase ? [...orderBase, ...orderOf(d)] : orderOf(d) });
|
|
2060
2067
|
});
|
|
@@ -2064,7 +2071,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2064
2071
|
const path = hiddenSources.get(f.source);
|
|
2065
2072
|
if (path === void 0) continue;
|
|
2066
2073
|
const g = f.source.target.toGlobal({ x: f.at.x * f.source.intrinsicWidth, y: f.at.y * f.source.intrinsicHeight });
|
|
2067
|
-
const sm = f.source.maskSequence?.target, ss =
|
|
2074
|
+
const sm = f.source.maskSequence?.target, ss = chunkO2MD3L4J_cjs.maskSourceOf(f.source.spec.mask);
|
|
2068
2075
|
if (sm && ss.kind === "inline" && !ss.invert && !inMask(sm, g)) continue;
|
|
2069
2076
|
walk3(f.source, path + "/", true, g, f.order, f.via);
|
|
2070
2077
|
}
|
|
@@ -2100,7 +2107,7 @@ function walk(root, visit) {
|
|
|
2100
2107
|
visit(seq);
|
|
2101
2108
|
const mask = seq.maskSequence;
|
|
2102
2109
|
if (mask) visit(mask);
|
|
2103
|
-
if (seq instanceof
|
|
2110
|
+
if (seq instanceof chunkO2MD3L4J_cjs.CompositionSequence) walk(seq, visit);
|
|
2104
2111
|
}
|
|
2105
2112
|
}
|
|
2106
2113
|
function reusePoolOf(old) {
|
|
@@ -2110,12 +2117,26 @@ function reusePoolOf(old) {
|
|
|
2110
2117
|
const key = seq.reuseKey();
|
|
2111
2118
|
if (key !== null) free.set(key, [...free.get(key) ?? [], seq]);
|
|
2112
2119
|
});
|
|
2113
|
-
|
|
2120
|
+
const borrowers = [];
|
|
2121
|
+
return {
|
|
2122
|
+
claim: (key, by) => {
|
|
2123
|
+
const d = free.get(key)?.shift() ?? null;
|
|
2124
|
+
if (d && by) borrowers.push(by);
|
|
2125
|
+
return d;
|
|
2126
|
+
},
|
|
2127
|
+
borrowers
|
|
2128
|
+
};
|
|
2114
2129
|
}
|
|
2115
|
-
function commitReuse(root) {
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2130
|
+
function commitReuse(root, pool) {
|
|
2131
|
+
const done = /* @__PURE__ */ new Set();
|
|
2132
|
+
const commit = (seq) => {
|
|
2133
|
+
if (!done.has(seq) && borrower(seq)) {
|
|
2134
|
+
done.add(seq);
|
|
2135
|
+
seq.commitReuse();
|
|
2136
|
+
}
|
|
2137
|
+
};
|
|
2138
|
+
walk(root, commit);
|
|
2139
|
+
for (const seq of pool?.borrowers ?? []) commit(seq);
|
|
2119
2140
|
}
|
|
2120
2141
|
|
|
2121
2142
|
// src/core/hover.ts
|
|
@@ -2201,7 +2222,7 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
2201
2222
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
2202
2223
|
function detailOf(seq) {
|
|
2203
2224
|
const s = seq.spec;
|
|
2204
|
-
const spans =
|
|
2225
|
+
const spans = chunkVVUSZVP7_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2205
2226
|
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2206
2227
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2207
2228
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
@@ -2217,10 +2238,10 @@ function walk2(comp, parentStart, parentEnd, depth, prefix, rows, transitions, l
|
|
|
2217
2238
|
const start = parentStart + (seq.at ?? 0);
|
|
2218
2239
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2219
2240
|
const span = end - start;
|
|
2220
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2241
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkVVUSZVP7_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2221
2242
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2222
2243
|
const inner = [];
|
|
2223
|
-
const isComp = seq instanceof
|
|
2244
|
+
const isComp = seq instanceof chunkO2MD3L4J_cjs.CompositionSequence;
|
|
2224
2245
|
if (isComp) {
|
|
2225
2246
|
const label = seq.remapLabel();
|
|
2226
2247
|
walk2(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2379,7 +2400,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2379
2400
|
}
|
|
2380
2401
|
|
|
2381
2402
|
// src/core/vars.ts
|
|
2382
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2403
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkVVUSZVP7_cjs.EXPRESSION_NAMES];
|
|
2383
2404
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2384
2405
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2385
2406
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2923,8 +2944,8 @@ var Movie = class {
|
|
|
2923
2944
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2924
2945
|
this._posterFrame = poster.frame;
|
|
2925
2946
|
this.background = options.background ?? "#000000";
|
|
2926
|
-
this.timeline =
|
|
2927
|
-
|
|
2947
|
+
this.timeline = chunkVVUSZVP7_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2948
|
+
chunkVVUSZVP7_cjs.lengthen(this.timeline, this.duration);
|
|
2928
2949
|
const baseAppOptions = {
|
|
2929
2950
|
width: this.width,
|
|
2930
2951
|
height: this.height,
|
|
@@ -3024,8 +3045,8 @@ var Movie = class {
|
|
|
3024
3045
|
height: sizeWins ? height : spec.height ?? height,
|
|
3025
3046
|
duration: spec.duration ?? this.duration
|
|
3026
3047
|
} : void 0;
|
|
3027
|
-
await
|
|
3028
|
-
if (
|
|
3048
|
+
await chunkVVUSZVP7_cjs.ensureFilterLibrary(seededComposition);
|
|
3049
|
+
if (chunkGXGIISFS_cjs.usesAdvancedBlend(seededComposition)) await chunkGXGIISFS_cjs.enableAdvancedBlend(this.app.renderer);
|
|
3029
3050
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
3030
3051
|
const rootSeqSpec = {
|
|
3031
3052
|
type: "composition",
|
|
@@ -3035,7 +3056,7 @@ var Movie = class {
|
|
|
3035
3056
|
...userComposition
|
|
3036
3057
|
};
|
|
3037
3058
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
3038
|
-
const sequence = new
|
|
3059
|
+
const sequence = new chunkO2MD3L4J_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
3039
3060
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
3040
3061
|
try {
|
|
3041
3062
|
await sequence.build();
|
|
@@ -3143,6 +3164,7 @@ var Movie = class {
|
|
|
3143
3164
|
if (!root || !app) throw new Error("pixi-effects: movie.rebuild() needs a ready movie \u2014 await movie.init(...) first");
|
|
3144
3165
|
const who = `movie.${reason === "vars" ? "setVars" : "rebuild"}()`;
|
|
3145
3166
|
let sequence = null;
|
|
3167
|
+
let reusePool = null;
|
|
3146
3168
|
const alive = () => {
|
|
3147
3169
|
if (this._initState !== "ready") throw new Error("pixi-effects: the movie was destroyed while it was being rebuilt");
|
|
3148
3170
|
};
|
|
@@ -3172,10 +3194,11 @@ var Movie = class {
|
|
|
3172
3194
|
if (change.composition !== void 0) for (const w of lintVars(change.composition, vars)) console.warn(w);
|
|
3173
3195
|
changed = changed || sizeChanged || change.composition !== void 0 || reason === "rebuild";
|
|
3174
3196
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
3175
|
-
|
|
3197
|
+
reusePool = reusePoolOf(this._rootSequence);
|
|
3198
|
+
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged, reusePool);
|
|
3176
3199
|
alive();
|
|
3177
|
-
const timeline =
|
|
3178
|
-
|
|
3200
|
+
const timeline = chunkVVUSZVP7_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
3201
|
+
chunkVVUSZVP7_cjs.lengthen(timeline, this.duration);
|
|
3179
3202
|
sequence.bindTimeline(timeline);
|
|
3180
3203
|
const hadSound = this.audioBuffer !== null;
|
|
3181
3204
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3212,7 +3235,7 @@ var Movie = class {
|
|
|
3212
3235
|
if (old?.target) root.removeChild(old.target);
|
|
3213
3236
|
if (sequence.target) root.addChild(sequence.target);
|
|
3214
3237
|
this._rootSequence = sequence;
|
|
3215
|
-
commitReuse(sequence);
|
|
3238
|
+
commitReuse(sequence, reusePool);
|
|
3216
3239
|
this.timeline = timeline;
|
|
3217
3240
|
this._timeFilters = collectTimeFilters(sequence);
|
|
3218
3241
|
const loud = quietUnbind();
|
|
@@ -3974,7 +3997,7 @@ function countLayers(spec) {
|
|
|
3974
3997
|
n += 1 + countLayers(s);
|
|
3975
3998
|
const spans = s.spans;
|
|
3976
3999
|
if (Array.isArray(spans)) n += spans.length;
|
|
3977
|
-
const src =
|
|
4000
|
+
const src = chunkO2MD3L4J_cjs.maskSourceOf(mask);
|
|
3978
4001
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3979
4002
|
}
|
|
3980
4003
|
return n;
|
|
@@ -4063,8 +4086,8 @@ function splitVertical(text, style, ts, right, top, align, by) {
|
|
|
4063
4086
|
|
|
4064
4087
|
// src/presets/_ease.ts
|
|
4065
4088
|
function parseEase2(name) {
|
|
4066
|
-
|
|
4067
|
-
return
|
|
4089
|
+
chunkVVUSZVP7_cjs.checkEase(name, "a preset");
|
|
4090
|
+
return chunkVVUSZVP7_cjs.parseEase(name);
|
|
4068
4091
|
}
|
|
4069
4092
|
|
|
4070
4093
|
// src/presets/kenBurns.ts
|
|
@@ -4199,17 +4222,17 @@ function orbit(opts) {
|
|
|
4199
4222
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
4200
4223
|
}
|
|
4201
4224
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
4202
|
-
const fixedR = opts.radius ??
|
|
4225
|
+
const fixedR = opts.radius ?? chunkVVUSZVP7_cjs.homeDistance(height, fov ?? chunkVVUSZVP7_cjs.DEFAULT_FOV);
|
|
4203
4226
|
const start = opts.start ?? -degrees / 2;
|
|
4204
4227
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
4205
4228
|
const easeFn = parseEase2(ease);
|
|
4206
4229
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
4207
4230
|
const pos = (i) => {
|
|
4208
4231
|
const p = i / steps;
|
|
4209
|
-
const a = (start + degrees * easeFn(p)) *
|
|
4232
|
+
const a = (start + degrees * easeFn(p)) * chunkVVUSZVP7_cjs.DEG;
|
|
4210
4233
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
4211
4234
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
4212
|
-
const R =
|
|
4235
|
+
const R = chunkVVUSZVP7_cjs.homeDistance(height, f);
|
|
4213
4236
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
4214
4237
|
};
|
|
4215
4238
|
const keyframes = [];
|
|
@@ -4264,7 +4287,7 @@ function particles(opts) {
|
|
|
4264
4287
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
4265
4288
|
const out = [];
|
|
4266
4289
|
for (let i = 0; i < count; i++) {
|
|
4267
|
-
const r =
|
|
4290
|
+
const r = chunkVVUSZVP7_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
4268
4291
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
4269
4292
|
const born = at + r() * emit;
|
|
4270
4293
|
const lifetime = pick(life);
|
|
@@ -4277,7 +4300,7 @@ function particles(opts) {
|
|
|
4277
4300
|
const turn = spin ? pick(spin) : 0;
|
|
4278
4301
|
const startAngle = spin ? r() * 360 : 0;
|
|
4279
4302
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
4280
|
-
const n0 = sway ?
|
|
4303
|
+
const n0 = sway ? chunkVVUSZVP7_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
4281
4304
|
const at_ = (t) => {
|
|
4282
4305
|
const axis = (p0, v0, acc) => {
|
|
4283
4306
|
if (drag > 0) {
|
|
@@ -4286,7 +4309,7 @@ function particles(opts) {
|
|
|
4286
4309
|
}
|
|
4287
4310
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
4288
4311
|
};
|
|
4289
|
-
const sw = sway ? swayAmp * (
|
|
4312
|
+
const sw = sway ? swayAmp * (chunkVVUSZVP7_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
4290
4313
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
4291
4314
|
};
|
|
4292
4315
|
const kfs = [];
|
|
@@ -4348,7 +4371,7 @@ function followPath(opts) {
|
|
|
4348
4371
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
4349
4372
|
const segments = [];
|
|
4350
4373
|
let total = 0;
|
|
4351
|
-
for (const line of
|
|
4374
|
+
for (const line of chunkVVUSZVP7_cjs.flattenSvgPath(d)) {
|
|
4352
4375
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
4353
4376
|
for (let i = 2; i < p.length; i += 2) {
|
|
4354
4377
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4401,7 +4424,7 @@ function followPath(opts) {
|
|
|
4401
4424
|
// src/core/pathSample.ts
|
|
4402
4425
|
function samplePath(d) {
|
|
4403
4426
|
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"');
|
|
4404
|
-
const lines =
|
|
4427
|
+
const lines = chunkVVUSZVP7_cjs.flattenSvgPath(d);
|
|
4405
4428
|
const segments = [];
|
|
4406
4429
|
let length = 0;
|
|
4407
4430
|
for (const line of lines) {
|
|
@@ -4432,7 +4455,7 @@ function samplePath(d) {
|
|
|
4432
4455
|
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) };
|
|
4433
4456
|
},
|
|
4434
4457
|
trim(start = 0, end = 1) {
|
|
4435
|
-
return
|
|
4458
|
+
return chunkVVUSZVP7_cjs.trimPolylines(lines, start, end).map((l) => l.closed ? [...l.pts, l.pts[0], l.pts[1]] : l.pts);
|
|
4436
4459
|
}
|
|
4437
4460
|
};
|
|
4438
4461
|
}
|
|
@@ -4543,7 +4566,7 @@ function distances(n, from, grid, seed) {
|
|
|
4543
4566
|
if (n === 0) return [];
|
|
4544
4567
|
if (from === "random") {
|
|
4545
4568
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4546
|
-
const r =
|
|
4569
|
+
const r = chunkVVUSZVP7_cjs.random(seed);
|
|
4547
4570
|
for (let i = n - 1; i > 0; i--) {
|
|
4548
4571
|
const j = Math.floor(r() * (i + 1));
|
|
4549
4572
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4605,7 +4628,7 @@ function wiggle(opts) {
|
|
|
4605
4628
|
to[n] = p.around;
|
|
4606
4629
|
return;
|
|
4607
4630
|
}
|
|
4608
|
-
const off = (
|
|
4631
|
+
const off = (chunkVVUSZVP7_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4609
4632
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4610
4633
|
});
|
|
4611
4634
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -5076,5 +5099,5 @@ exports.splitText = splitText;
|
|
|
5076
5099
|
exports.stagger = stagger;
|
|
5077
5100
|
exports.wiggle = wiggle;
|
|
5078
5101
|
exports.withFade = withFade;
|
|
5079
|
-
//# sourceMappingURL=chunk-
|
|
5080
|
-
//# sourceMappingURL=chunk-
|
|
5102
|
+
//# sourceMappingURL=chunk-YOKRPAKA.cjs.map
|
|
5103
|
+
//# sourceMappingURL=chunk-YOKRPAKA.cjs.map
|