pixi-effects 0.48.2 → 0.49.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 +8 -0
- package/README.md +51 -7
- package/ai/chat-template.html +8 -4
- package/ai/tools/check.mjs +6 -6
- package/dist/3d.cjs +963 -0
- package/dist/3d.cjs.map +1 -0
- package/dist/3d.d.cts +303 -0
- package/dist/3d.d.ts +303 -0
- package/dist/3d.js +956 -0
- package/dist/3d.js.map +1 -0
- package/dist/Canvas-BfZkAFJm.d.cts +12 -0
- package/dist/Canvas-BfZkAFJm.d.ts +12 -0
- package/dist/Composition-464AWDV6.cjs +16 -0
- package/dist/{Composition-TJ5D7Z63.cjs.map → Composition-464AWDV6.cjs.map} +1 -1
- package/dist/Composition-5U63LMPX.js +7 -0
- package/dist/{Composition-5FKV2IBP.js.map → Composition-5U63LMPX.js.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/{Movie--qSYKgAQ.d.ts → Movie-6EWOz6Yw.d.ts} +21 -5
- package/dist/{Movie-svZQF-9Z.d.cts → Movie-BxB7bauG.d.cts} +21 -5
- package/dist/{Spans-5ENZ3XGS.cjs → Spans-DUR2W5EH.cjs} +11 -11
- package/dist/{Spans-5ENZ3XGS.cjs.map → Spans-DUR2W5EH.cjs.map} +1 -1
- package/dist/{Spans-6A3VLHRH.js → Spans-W5VJRMGC.js} +6 -6
- package/dist/{Spans-6A3VLHRH.js.map → Spans-W5VJRMGC.js.map} +1 -1
- package/dist/{blendModes-V5XHC7U4.cjs → blendModes-NC76DNVX.cjs} +5 -5
- package/dist/{blendModes-V5XHC7U4.cjs.map → blendModes-NC76DNVX.cjs.map} +1 -1
- package/dist/{blendModes-535EMYGK.js → blendModes-ZOBLPSR3.js} +4 -4
- package/dist/{blendModes-535EMYGK.js.map → blendModes-ZOBLPSR3.js.map} +1 -1
- package/dist/{chunk-Z3DM4ETD.cjs → chunk-33USHRV5.cjs} +43 -32
- package/dist/chunk-33USHRV5.cjs.map +1 -0
- package/dist/{chunk-WYR2AU4W.cjs → chunk-5YNME6AH.cjs} +5 -5
- package/dist/{chunk-WYR2AU4W.cjs.map → chunk-5YNME6AH.cjs.map} +1 -1
- package/dist/{chunk-NGJXVJB7.cjs → chunk-ABWRISRK.cjs} +3 -2
- package/dist/chunk-ABWRISRK.cjs.map +1 -0
- package/dist/{chunk-CCPJD76D.cjs → chunk-BSFWVTSR.cjs} +93 -93
- package/dist/chunk-BSFWVTSR.cjs.map +1 -0
- package/dist/{chunk-IVKI6CPH.js → chunk-DOGY3EAW.js} +19 -9
- package/dist/chunk-DOGY3EAW.js.map +1 -0
- package/dist/{chunk-45ALIMAF.cjs → chunk-GUDLIAIG.cjs} +58 -55
- package/dist/chunk-GUDLIAIG.cjs.map +1 -0
- package/dist/{chunk-BFRWSV3R.js → chunk-H363KMJR.js} +3 -3
- package/dist/chunk-H363KMJR.js.map +1 -0
- package/dist/{chunk-JBDBICS2.js → chunk-MXACRKAN.js} +4 -4
- package/dist/{chunk-JBDBICS2.js.map → chunk-MXACRKAN.js.map} +1 -1
- package/dist/{chunk-RCKLUCB7.js → chunk-PBMDZT2T.js} +15 -12
- package/dist/chunk-PBMDZT2T.js.map +1 -0
- package/dist/{chunk-6D4W2KZQ.js → chunk-USUUAYTE.js} +6 -6
- package/dist/chunk-USUUAYTE.js.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/{music-P4JRT73P.js → music-ATX22VAT.js} +3 -3
- package/dist/{music-P4JRT73P.js.map → music-ATX22VAT.js.map} +1 -1
- package/dist/{music-XQEPBIDT.cjs → music-OFVM3PYH.cjs} +3 -3
- package/dist/{music-XQEPBIDT.cjs.map → music-OFVM3PYH.cjs.map} +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 +7 -8
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +2 -12
- package/dist/three.d.ts +2 -12
- package/dist/three.js +2 -3
- package/dist/three.js.map +1 -1
- package/dist/{types-CTSrPvY3.d.cts → types-kt7DQKfO.d.cts} +1 -1
- package/dist/{types-CTSrPvY3.d.ts → types-kt7DQKfO.d.ts} +1 -1
- package/docs/api.md +41 -1
- package/docs/dsl.md +81 -1
- package/llms-full.txt +218 -5
- package/package.json +19 -3
- package/skills/pixi-effects/SKILL.md +3 -2
- package/skills/pixi-effects/reference/cheatsheet.md +2 -0
- package/skills/pixi-effects/reference/pitfalls.md +14 -0
- package/skills/pixi-effects/reference/recipes.md +77 -1
- package/skills/pixi-effects/template.html +13 -8
- package/dist/Composition-5FKV2IBP.js +0 -7
- package/dist/Composition-TJ5D7Z63.cjs +0 -16
- package/dist/chunk-45ALIMAF.cjs.map +0 -1
- package/dist/chunk-6D4W2KZQ.js.map +0 -1
- package/dist/chunk-BFRWSV3R.js.map +0 -1
- package/dist/chunk-CCPJD76D.cjs.map +0 -1
- package/dist/chunk-IVKI6CPH.js.map +0 -1
- package/dist/chunk-NGJXVJB7.cjs.map +0 -1
- package/dist/chunk-RCKLUCB7.js.map +0 -1
- package/dist/chunk-Z3DM4ETD.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkBSFWVTSR_cjs = require('./chunk-BSFWVTSR.cjs');
|
|
4
4
|
var chunkVQXZ2NOI_cjs = require('./chunk-VQXZ2NOI.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk33USHRV5_cjs = require('./chunk-33USHRV5.cjs');
|
|
6
6
|
var chunkZAHCGFGC_cjs = require('./chunk-ZAHCGFGC.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var chunk5YNME6AH_cjs = require('./chunk-5YNME6AH.cjs');
|
|
8
|
+
var chunkABWRISRK_cjs = require('./chunk-ABWRISRK.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 ? chunk33USHRV5_cjs.timeRemapOf(out) : null;
|
|
1272
|
+
const parentDuration = remap ? chunk33USHRV5_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 = chunk33USHRV5_cjs.resolveAt(t.at, parentDuration);
|
|
1341
1341
|
const tEnd = tStart + t.duration;
|
|
1342
1342
|
const fromSeq = fromEntry.seq;
|
|
1343
|
-
const fromStart =
|
|
1343
|
+
const fromStart = chunk33USHRV5_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 = chunk33USHRV5_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 && chunkBSFWVTSR_cjs.maskSourceOf(m).kind === "refs";
|
|
1410
1410
|
if (carriesMatte) delete inner.mask;
|
|
1411
1411
|
return {
|
|
1412
1412
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1671,12 +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 =
|
|
1675
|
-
const
|
|
1676
|
-
const
|
|
1674
|
+
const name = chunkABWRISRK_cjs.describeLayer(seq.spec);
|
|
1675
|
+
const type = seq.spec.type;
|
|
1676
|
+
const kind = type === "three" ? "three" : type === "scene3d" ? "scene3d" : "canvas";
|
|
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") : "";
|
|
1677
1679
|
out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem, kind });
|
|
1678
1680
|
}
|
|
1679
|
-
if (seq instanceof
|
|
1681
|
+
if (seq instanceof chunkBSFWVTSR_cjs.CompositionSequence) walk3(seq);
|
|
1680
1682
|
};
|
|
1681
1683
|
const walk3 = (comp) => {
|
|
1682
1684
|
for (const { seq } of comp.layers()) {
|
|
@@ -1728,8 +1730,8 @@ function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
|
1728
1730
|
let length = 0;
|
|
1729
1731
|
if (typeof kf.duration === "number") length = kf.duration;
|
|
1730
1732
|
else if (kf.duration === "auto") {
|
|
1731
|
-
const sp =
|
|
1732
|
-
length = sp ? Math.round(
|
|
1733
|
+
const sp = chunk33USHRV5_cjs.parseSpring(kf.ease);
|
|
1734
|
+
length = sp ? Math.round(chunk33USHRV5_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1733
1735
|
}
|
|
1734
1736
|
if (!(length > 0)) continue;
|
|
1735
1737
|
const kat = kf.at ?? 0;
|
|
@@ -1809,7 +1811,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1809
1811
|
if (motion.ever) hasMotion.add(info);
|
|
1810
1812
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1811
1813
|
const maskTarget = seq.maskSequence?.target;
|
|
1812
|
-
const maskSrc =
|
|
1814
|
+
const maskSrc = chunkBSFWVTSR_cjs.maskSourceOf(seq.spec.mask);
|
|
1813
1815
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1814
1816
|
const m = maskTarget.getBounds();
|
|
1815
1817
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1818,7 +1820,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1818
1820
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1819
1821
|
if (group) scene.set(info, group);
|
|
1820
1822
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1821
|
-
if (seq instanceof
|
|
1823
|
+
if (seq instanceof chunkBSFWVTSR_cjs.CompositionSequence) walk3(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero, parentAlpha * alpha);
|
|
1822
1824
|
});
|
|
1823
1825
|
};
|
|
1824
1826
|
walk3(root, "", false, true);
|
|
@@ -1990,12 +1992,12 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1990
1992
|
const alive = (threeD ? d.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1991
1993
|
const visible = parentVisible && alive && alpha > 0;
|
|
1992
1994
|
if (!visible) {
|
|
1993
|
-
if (seq instanceof
|
|
1995
|
+
if (seq instanceof chunkBSFWVTSR_cjs.CompositionSequence && !threeD && parentVisible && alpha > 0 && t?.visible === false && (t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true)) hiddenSources.set(seq, path);
|
|
1994
1996
|
return;
|
|
1995
1997
|
}
|
|
1996
|
-
const isComposition = seq instanceof
|
|
1998
|
+
const isComposition = seq instanceof chunkBSFWVTSR_cjs.CompositionSequence;
|
|
1997
1999
|
if (isComposition && !threeD) {
|
|
1998
|
-
const gm = seq.maskSequence?.target, gs =
|
|
2000
|
+
const gm = seq.maskSequence?.target, gs = chunkBSFWVTSR_cjs.maskSourceOf(seq.spec.mask);
|
|
1999
2001
|
if (gm && gs.kind === "inline" && !gs.invert && !inMask(gm, at)) return;
|
|
2000
2002
|
walk3(seq, path + "/", visible, at, orderBase, via);
|
|
2001
2003
|
return;
|
|
@@ -2031,7 +2033,8 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2031
2033
|
} };
|
|
2032
2034
|
};
|
|
2033
2035
|
}
|
|
2034
|
-
|
|
2036
|
+
const type = seq.spec.type;
|
|
2037
|
+
hit = type === "scene3d" ? { name, path, type, kind: "scene3d", point, scene3d: { object: String(three.object), point: three.point, distance: three.distance, node: three.object3d, ...three.grab ? { grab: three.grab } : {} } } : { name, path, type, kind: "three", point, three };
|
|
2035
2038
|
} else if (three === void 0 && (typeof d.containsPoint !== "function" || d.containsPoint(local))) {
|
|
2036
2039
|
let opaque = true;
|
|
2037
2040
|
const tex = opts.alpha !== void 0 && seq.spec.type !== "shader" ? d.texture ?? deps.textureOf?.(d) : void 0;
|
|
@@ -2051,7 +2054,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2051
2054
|
}
|
|
2052
2055
|
if (!hit) return;
|
|
2053
2056
|
const maskTarget = seq.maskSequence?.target;
|
|
2054
|
-
const maskSrc =
|
|
2057
|
+
const maskSrc = chunkBSFWVTSR_cjs.maskSourceOf(seq.spec.mask);
|
|
2055
2058
|
if (maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert) && !(maskSrc.kind === "inline" ? inMask(maskTarget, point) : inside(maskTarget.getBounds(), point))) return;
|
|
2056
2059
|
found.push({ hit: via ? { ...hit, point: { x, y }, via } : hit, order: orderBase ? [...orderBase, ...orderOf(d)] : orderOf(d) });
|
|
2057
2060
|
});
|
|
@@ -2061,7 +2064,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2061
2064
|
const path = hiddenSources.get(f.source);
|
|
2062
2065
|
if (path === void 0) continue;
|
|
2063
2066
|
const g = f.source.target.toGlobal({ x: f.at.x * f.source.intrinsicWidth, y: f.at.y * f.source.intrinsicHeight });
|
|
2064
|
-
const sm = f.source.maskSequence?.target, ss =
|
|
2067
|
+
const sm = f.source.maskSequence?.target, ss = chunkBSFWVTSR_cjs.maskSourceOf(f.source.spec.mask);
|
|
2065
2068
|
if (sm && ss.kind === "inline" && !ss.invert && !inMask(sm, g)) continue;
|
|
2066
2069
|
walk3(f.source, path + "/", true, g, f.order, f.via);
|
|
2067
2070
|
}
|
|
@@ -2097,7 +2100,7 @@ function walk(root, visit) {
|
|
|
2097
2100
|
visit(seq);
|
|
2098
2101
|
const mask = seq.maskSequence;
|
|
2099
2102
|
if (mask) visit(mask);
|
|
2100
|
-
if (seq instanceof
|
|
2103
|
+
if (seq instanceof chunkBSFWVTSR_cjs.CompositionSequence) walk(seq, visit);
|
|
2101
2104
|
}
|
|
2102
2105
|
}
|
|
2103
2106
|
function reusePoolOf(old) {
|
|
@@ -2198,7 +2201,7 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
2198
2201
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
2199
2202
|
function detailOf(seq) {
|
|
2200
2203
|
const s = seq.spec;
|
|
2201
|
-
const spans =
|
|
2204
|
+
const spans = chunk33USHRV5_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2202
2205
|
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2203
2206
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2204
2207
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
@@ -2214,10 +2217,10 @@ function walk2(comp, parentStart, parentEnd, depth, prefix, rows, transitions, l
|
|
|
2214
2217
|
const start = parentStart + (seq.at ?? 0);
|
|
2215
2218
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2216
2219
|
const span = end - start;
|
|
2217
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2220
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunk33USHRV5_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2218
2221
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2219
2222
|
const inner = [];
|
|
2220
|
-
const isComp = seq instanceof
|
|
2223
|
+
const isComp = seq instanceof chunkBSFWVTSR_cjs.CompositionSequence;
|
|
2221
2224
|
if (isComp) {
|
|
2222
2225
|
const label = seq.remapLabel();
|
|
2223
2226
|
walk2(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2376,7 +2379,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2376
2379
|
}
|
|
2377
2380
|
|
|
2378
2381
|
// src/core/vars.ts
|
|
2379
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2382
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunk33USHRV5_cjs.EXPRESSION_NAMES];
|
|
2380
2383
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2381
2384
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2382
2385
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2920,8 +2923,8 @@ var Movie = class {
|
|
|
2920
2923
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2921
2924
|
this._posterFrame = poster.frame;
|
|
2922
2925
|
this.background = options.background ?? "#000000";
|
|
2923
|
-
this.timeline =
|
|
2924
|
-
|
|
2926
|
+
this.timeline = chunk33USHRV5_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2927
|
+
chunk33USHRV5_cjs.lengthen(this.timeline, this.duration);
|
|
2925
2928
|
const baseAppOptions = {
|
|
2926
2929
|
width: this.width,
|
|
2927
2930
|
height: this.height,
|
|
@@ -3021,8 +3024,8 @@ var Movie = class {
|
|
|
3021
3024
|
height: sizeWins ? height : spec.height ?? height,
|
|
3022
3025
|
duration: spec.duration ?? this.duration
|
|
3023
3026
|
} : void 0;
|
|
3024
|
-
await
|
|
3025
|
-
if (
|
|
3027
|
+
await chunk33USHRV5_cjs.ensureFilterLibrary(seededComposition);
|
|
3028
|
+
if (chunk5YNME6AH_cjs.usesAdvancedBlend(seededComposition)) await chunk5YNME6AH_cjs.enableAdvancedBlend(this.app.renderer);
|
|
3026
3029
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
3027
3030
|
const rootSeqSpec = {
|
|
3028
3031
|
type: "composition",
|
|
@@ -3032,7 +3035,7 @@ var Movie = class {
|
|
|
3032
3035
|
...userComposition
|
|
3033
3036
|
};
|
|
3034
3037
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
3035
|
-
const sequence = new
|
|
3038
|
+
const sequence = new chunkBSFWVTSR_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
3036
3039
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
3037
3040
|
try {
|
|
3038
3041
|
await sequence.build();
|
|
@@ -3171,8 +3174,8 @@ var Movie = class {
|
|
|
3171
3174
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
3172
3175
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged, reusePoolOf(this._rootSequence));
|
|
3173
3176
|
alive();
|
|
3174
|
-
const timeline =
|
|
3175
|
-
|
|
3177
|
+
const timeline = chunk33USHRV5_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
3178
|
+
chunk33USHRV5_cjs.lengthen(timeline, this.duration);
|
|
3176
3179
|
sequence.bindTimeline(timeline);
|
|
3177
3180
|
const hadSound = this.audioBuffer !== null;
|
|
3178
3181
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3971,7 +3974,7 @@ function countLayers(spec) {
|
|
|
3971
3974
|
n += 1 + countLayers(s);
|
|
3972
3975
|
const spans = s.spans;
|
|
3973
3976
|
if (Array.isArray(spans)) n += spans.length;
|
|
3974
|
-
const src =
|
|
3977
|
+
const src = chunkBSFWVTSR_cjs.maskSourceOf(mask);
|
|
3975
3978
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3976
3979
|
}
|
|
3977
3980
|
return n;
|
|
@@ -4060,8 +4063,8 @@ function splitVertical(text, style, ts, right, top, align, by) {
|
|
|
4060
4063
|
|
|
4061
4064
|
// src/presets/_ease.ts
|
|
4062
4065
|
function parseEase2(name) {
|
|
4063
|
-
|
|
4064
|
-
return
|
|
4066
|
+
chunk33USHRV5_cjs.checkEase(name, "a preset");
|
|
4067
|
+
return chunk33USHRV5_cjs.parseEase(name);
|
|
4065
4068
|
}
|
|
4066
4069
|
|
|
4067
4070
|
// src/presets/kenBurns.ts
|
|
@@ -4196,17 +4199,17 @@ function orbit(opts) {
|
|
|
4196
4199
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
4197
4200
|
}
|
|
4198
4201
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
4199
|
-
const fixedR = opts.radius ??
|
|
4202
|
+
const fixedR = opts.radius ?? chunk33USHRV5_cjs.homeDistance(height, fov ?? chunk33USHRV5_cjs.DEFAULT_FOV);
|
|
4200
4203
|
const start = opts.start ?? -degrees / 2;
|
|
4201
4204
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
4202
4205
|
const easeFn = parseEase2(ease);
|
|
4203
4206
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
4204
4207
|
const pos = (i) => {
|
|
4205
4208
|
const p = i / steps;
|
|
4206
|
-
const a = (start + degrees * easeFn(p)) *
|
|
4209
|
+
const a = (start + degrees * easeFn(p)) * chunk33USHRV5_cjs.DEG;
|
|
4207
4210
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
4208
4211
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
4209
|
-
const R =
|
|
4212
|
+
const R = chunk33USHRV5_cjs.homeDistance(height, f);
|
|
4210
4213
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
4211
4214
|
};
|
|
4212
4215
|
const keyframes = [];
|
|
@@ -4261,7 +4264,7 @@ function particles(opts) {
|
|
|
4261
4264
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
4262
4265
|
const out = [];
|
|
4263
4266
|
for (let i = 0; i < count; i++) {
|
|
4264
|
-
const r =
|
|
4267
|
+
const r = chunk33USHRV5_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
4265
4268
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
4266
4269
|
const born = at + r() * emit;
|
|
4267
4270
|
const lifetime = pick(life);
|
|
@@ -4274,7 +4277,7 @@ function particles(opts) {
|
|
|
4274
4277
|
const turn = spin ? pick(spin) : 0;
|
|
4275
4278
|
const startAngle = spin ? r() * 360 : 0;
|
|
4276
4279
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
4277
|
-
const n0 = sway ?
|
|
4280
|
+
const n0 = sway ? chunk33USHRV5_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
4278
4281
|
const at_ = (t) => {
|
|
4279
4282
|
const axis = (p0, v0, acc) => {
|
|
4280
4283
|
if (drag > 0) {
|
|
@@ -4283,7 +4286,7 @@ function particles(opts) {
|
|
|
4283
4286
|
}
|
|
4284
4287
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
4285
4288
|
};
|
|
4286
|
-
const sw = sway ? swayAmp * (
|
|
4289
|
+
const sw = sway ? swayAmp * (chunk33USHRV5_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
4287
4290
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
4288
4291
|
};
|
|
4289
4292
|
const kfs = [];
|
|
@@ -4345,7 +4348,7 @@ function followPath(opts) {
|
|
|
4345
4348
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
4346
4349
|
const segments = [];
|
|
4347
4350
|
let total = 0;
|
|
4348
|
-
for (const line of
|
|
4351
|
+
for (const line of chunk33USHRV5_cjs.flattenSvgPath(d)) {
|
|
4349
4352
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
4350
4353
|
for (let i = 2; i < p.length; i += 2) {
|
|
4351
4354
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4398,7 +4401,7 @@ function followPath(opts) {
|
|
|
4398
4401
|
// src/core/pathSample.ts
|
|
4399
4402
|
function samplePath(d) {
|
|
4400
4403
|
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"');
|
|
4401
|
-
const lines =
|
|
4404
|
+
const lines = chunk33USHRV5_cjs.flattenSvgPath(d);
|
|
4402
4405
|
const segments = [];
|
|
4403
4406
|
let length = 0;
|
|
4404
4407
|
for (const line of lines) {
|
|
@@ -4429,7 +4432,7 @@ function samplePath(d) {
|
|
|
4429
4432
|
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) };
|
|
4430
4433
|
},
|
|
4431
4434
|
trim(start = 0, end = 1) {
|
|
4432
|
-
return
|
|
4435
|
+
return chunk33USHRV5_cjs.trimPolylines(lines, start, end).map((l) => l.closed ? [...l.pts, l.pts[0], l.pts[1]] : l.pts);
|
|
4433
4436
|
}
|
|
4434
4437
|
};
|
|
4435
4438
|
}
|
|
@@ -4540,7 +4543,7 @@ function distances(n, from, grid, seed) {
|
|
|
4540
4543
|
if (n === 0) return [];
|
|
4541
4544
|
if (from === "random") {
|
|
4542
4545
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4543
|
-
const r =
|
|
4546
|
+
const r = chunk33USHRV5_cjs.random(seed);
|
|
4544
4547
|
for (let i = n - 1; i > 0; i--) {
|
|
4545
4548
|
const j = Math.floor(r() * (i + 1));
|
|
4546
4549
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4602,7 +4605,7 @@ function wiggle(opts) {
|
|
|
4602
4605
|
to[n] = p.around;
|
|
4603
4606
|
return;
|
|
4604
4607
|
}
|
|
4605
|
-
const off = (
|
|
4608
|
+
const off = (chunk33USHRV5_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4606
4609
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4607
4610
|
});
|
|
4608
4611
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -4990,7 +4993,7 @@ async function audioEnvelope(source, options = {}) {
|
|
|
4990
4993
|
|
|
4991
4994
|
// src/audio/musicEnvelope.ts
|
|
4992
4995
|
async function musicEnvelope(music, options = {}) {
|
|
4993
|
-
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-
|
|
4996
|
+
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-OFVM3PYH.cjs');
|
|
4994
4997
|
const messages = [];
|
|
4995
4998
|
const m = resolveMusic(music, "musicEnvelope()", (msg) => messages.push(msg));
|
|
4996
4999
|
if (!m) throw new Error(`pixi-effects: musicEnvelope(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -5003,7 +5006,7 @@ async function musicEnvelope(music, options = {}) {
|
|
|
5003
5006
|
|
|
5004
5007
|
// src/audio/musicBuffer.ts
|
|
5005
5008
|
async function musicBuffer(music, options = {}) {
|
|
5006
|
-
const { resolveMusic, renderMusic, musicLength } = await import('./music-
|
|
5009
|
+
const { resolveMusic, renderMusic, musicLength } = await import('./music-OFVM3PYH.cjs');
|
|
5007
5010
|
const messages = [];
|
|
5008
5011
|
const m = resolveMusic(music, "musicBuffer()", (msg) => messages.push(msg));
|
|
5009
5012
|
if (!m) throw new Error(`pixi-effects: musicBuffer(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -5020,7 +5023,7 @@ async function musicBuffer(music, options = {}) {
|
|
|
5020
5023
|
|
|
5021
5024
|
// src/audio/musicEvents.ts
|
|
5022
5025
|
async function musicEvents(music) {
|
|
5023
|
-
const { resolveMusic } = await import('./music-
|
|
5026
|
+
const { resolveMusic } = await import('./music-OFVM3PYH.cjs');
|
|
5024
5027
|
const { describeEvents } = await import('./events-EE3SM5LM.cjs');
|
|
5025
5028
|
const messages = [];
|
|
5026
5029
|
const m = resolveMusic(music, "musicEvents()", (msg) => messages.push(msg));
|
|
@@ -5073,5 +5076,5 @@ exports.splitText = splitText;
|
|
|
5073
5076
|
exports.stagger = stagger;
|
|
5074
5077
|
exports.wiggle = wiggle;
|
|
5075
5078
|
exports.withFade = withFade;
|
|
5076
|
-
//# sourceMappingURL=chunk-
|
|
5077
|
-
//# sourceMappingURL=chunk-
|
|
5079
|
+
//# sourceMappingURL=chunk-GUDLIAIG.cjs.map
|
|
5080
|
+
//# sourceMappingURL=chunk-GUDLIAIG.cjs.map
|