pixi-effects 0.47.2 → 0.47.4
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 +20 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Composition-HTHQ2RLF.js +7 -0
- package/dist/{Composition-ZYMQ7ZRC.js.map → Composition-HTHQ2RLF.js.map} +1 -1
- package/dist/Composition-ZYRDRLYB.cjs +16 -0
- package/dist/{Composition-X6MCEFRH.cjs.map → Composition-ZYRDRLYB.cjs.map} +1 -1
- package/dist/Controller.cjs +3 -3
- package/dist/Controller.js +1 -1
- package/dist/{Spans-6HSLKR5Q.cjs → Spans-I7P7ZVZO.cjs} +12 -12
- package/dist/{Spans-6HSLKR5Q.cjs.map → Spans-I7P7ZVZO.cjs.map} +1 -1
- package/dist/{Spans-LCCZ4PW7.js → Spans-JYCTJV4V.js} +7 -7
- package/dist/{Spans-LCCZ4PW7.js.map → Spans-JYCTJV4V.js.map} +1 -1
- package/dist/{blendModes-EMANEHZS.js → blendModes-535EMYGK.js} +5 -5
- package/dist/{blendModes-EMANEHZS.js.map → blendModes-535EMYGK.js.map} +1 -1
- package/dist/{blendModes-JUISKPCA.cjs → blendModes-V5XHC7U4.cjs} +6 -6
- package/dist/{blendModes-JUISKPCA.cjs.map → blendModes-V5XHC7U4.cjs.map} +1 -1
- package/dist/{chunk-YF4JC2AL.js → chunk-34YNRCMT.js} +15 -8
- package/dist/chunk-34YNRCMT.js.map +1 -0
- package/dist/{chunk-UXPTDNNA.cjs → chunk-AES2L75M.cjs} +93 -93
- package/dist/chunk-AES2L75M.cjs.map +1 -0
- package/dist/{chunk-P2P7C2KZ.js → chunk-BFRWSV3R.js} +4 -4
- package/dist/chunk-BFRWSV3R.js.map +1 -0
- package/dist/{chunk-TVVC4GVK.cjs → chunk-CJS2S5XU.cjs} +50 -43
- package/dist/chunk-CJS2S5XU.cjs.map +1 -0
- package/dist/{chunk-TWZNOUM7.cjs → chunk-DOLTCXCL.cjs} +7 -2
- package/dist/chunk-DOLTCXCL.cjs.map +1 -0
- package/dist/{chunk-4RC4GXEM.cjs → chunk-DS2EWRV4.cjs} +96 -96
- package/dist/{chunk-4RC4GXEM.cjs.map → chunk-DS2EWRV4.cjs.map} +1 -1
- package/dist/{chunk-R43646JP.js → chunk-JBDBICS2.js} +5 -5
- package/dist/{chunk-R43646JP.js.map → chunk-JBDBICS2.js.map} +1 -1
- package/dist/{chunk-M5P7TXZ2.js → chunk-NCM2WU7R.js} +11 -11
- package/dist/chunk-NCM2WU7R.js.map +1 -0
- package/dist/{chunk-2YV7ISX6.cjs → chunk-NGJXVJB7.cjs} +7 -7
- package/dist/chunk-NGJXVJB7.cjs.map +1 -0
- package/dist/{chunk-AOQRB6AU.js → chunk-RTZ5MW3E.js} +6 -6
- package/dist/{chunk-AOQRB6AU.js.map → chunk-RTZ5MW3E.js.map} +1 -1
- package/dist/{chunk-BXOCEZ4U.js → chunk-WGRWFQOB.js} +7 -2
- package/dist/chunk-WGRWFQOB.js.map +1 -0
- package/dist/{chunk-DQVUKP5G.cjs → chunk-WYR2AU4W.cjs} +7 -7
- package/dist/{chunk-DQVUKP5G.cjs.map → chunk-WYR2AU4W.cjs.map} +1 -1
- package/dist/index.cjs +37 -37
- package/dist/index.js +6 -6
- package/dist/loader.css +1 -1
- package/dist/{music-JKOM5YK6.js → music-P4JRT73P.js} +3 -3
- package/dist/{music-JKOM5YK6.js.map → music-P4JRT73P.js.map} +1 -1
- package/dist/{music-6WFTPVHU.cjs → music-XQEPBIDT.cjs} +7 -7
- package/dist/{music-6WFTPVHU.cjs.map → music-XQEPBIDT.cjs.map} +1 -1
- package/dist/present.cjs +13 -13
- package/dist/present.js +6 -6
- package/dist/{sfx-2O6UQEUP.cjs → sfx-G2XAMD7K.cjs} +8 -8
- package/dist/{sfx-2O6UQEUP.cjs.map → sfx-G2XAMD7K.cjs.map} +1 -1
- package/dist/{sfx-VUKARHDX.js → sfx-Z7OQIKHG.js} +3 -3
- package/dist/{sfx-VUKARHDX.js.map → sfx-Z7OQIKHG.js.map} +1 -1
- package/dist/three.cjs +7 -7
- package/dist/three.js +3 -3
- package/docs/api.md +2 -2
- package/docs/dsl.md +6 -5
- package/llms-full.txt +11 -10
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +2 -2
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-X6MCEFRH.cjs +0 -16
- package/dist/Composition-ZYMQ7ZRC.js +0 -7
- package/dist/chunk-2YV7ISX6.cjs.map +0 -1
- package/dist/chunk-BXOCEZ4U.js.map +0 -1
- package/dist/chunk-M5P7TXZ2.js.map +0 -1
- package/dist/chunk-P2P7C2KZ.js.map +0 -1
- package/dist/chunk-TVVC4GVK.cjs.map +0 -1
- package/dist/chunk-TWZNOUM7.cjs.map +0 -1
- package/dist/chunk-UXPTDNNA.cjs.map +0 -1
- package/dist/chunk-YF4JC2AL.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDS2EWRV4_cjs = require('./chunk-DS2EWRV4.cjs');
|
|
4
|
+
var chunkCJS2S5XU_cjs = require('./chunk-CJS2S5XU.cjs');
|
|
5
5
|
var chunkZAHCGFGC_cjs = require('./chunk-ZAHCGFGC.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var chunkWYR2AU4W_cjs = require('./chunk-WYR2AU4W.cjs');
|
|
7
|
+
var chunkNGJXVJB7_cjs = require('./chunk-NGJXVJB7.cjs');
|
|
8
|
+
var chunkDOLTCXCL_cjs = require('./chunk-DOLTCXCL.cjs');
|
|
9
9
|
var pixi_js = require('pixi.js');
|
|
10
10
|
var mediabunny = require('mediabunny');
|
|
11
11
|
|
|
@@ -460,7 +460,7 @@ var DEFAULTS = { samples: 8, shutter: 0.5 };
|
|
|
460
460
|
function resolveMotionBlur(spec, where) {
|
|
461
461
|
if (spec === void 0 || spec === null || spec === false) return null;
|
|
462
462
|
const o = spec === true ? {} : typeof spec === "number" ? { samples: spec } : spec;
|
|
463
|
-
if (typeof spec === "object")
|
|
463
|
+
if (typeof spec === "object") chunkDOLTCXCL_cjs.warnUnknownOptions(`${where} motionBlur`, o, ["samples", "shutter"]);
|
|
464
464
|
const samples = o.samples ?? DEFAULTS.samples, shutter = o.shutter ?? DEFAULTS.shutter;
|
|
465
465
|
if (!(Number.isInteger(samples) && samples >= 2 && samples <= 64)) throw new Error(`pixi-effects: ${where}: motionBlur samples must be a whole number from 2 to 64, got ${samples}`);
|
|
466
466
|
if (!(Number.isFinite(shutter) && shutter > 0 && shutter <= 1)) throw new Error(`pixi-effects: ${where}: motionBlur shutter must be a fraction of the frame time above 0 and up to 1 (0.5 is a 180\xB0 shutter), got ${shutter}`);
|
|
@@ -665,8 +665,8 @@ async function exportFrames(movie, options = {}) {
|
|
|
665
665
|
const range2 = resolveRange(options.range, { frameRate: movie.frameRate, totalFrames: movie.totalFrames, duration: movie.duration, rows: typeof options.range === "string" ? movie.timelineData().rows : void 0 });
|
|
666
666
|
if (isAudioFormat(fmt)) return exportAudioOnly(movie, options, fmt, range2);
|
|
667
667
|
if (!["mp4", "mov", "webm", "mkv"].includes(fmt)) throw new Error(`pixi-effects: render({ format: "${String(fmt)}" }): use mp4, mov, webm, mkv (a picture) or wav, ogg (only the sound)`);
|
|
668
|
-
|
|
669
|
-
|
|
668
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.render({ video })", options.video, ["codec", "bitrate", "hardware", "keyFrameInterval"]);
|
|
669
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.render({ audio })", options.audio, ["codec", "bitrate"]);
|
|
670
670
|
const videoBitrate = bitrateOf(eff.bitrate ?? "high", mediabunny.QUALITY_HIGH);
|
|
671
671
|
const opts = {
|
|
672
672
|
format: fmt,
|
|
@@ -1198,7 +1198,7 @@ var LumaWipeFilter = class extends pixi_js.Filter {
|
|
|
1198
1198
|
this._resolved = true;
|
|
1199
1199
|
} else if (!this._warned) {
|
|
1200
1200
|
this._warned = true;
|
|
1201
|
-
const guess =
|
|
1201
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(this._mapName, LUMA_MAPS);
|
|
1202
1202
|
console.warn(`pixi-effects: luma transition map "${this._mapName}" is not a built-in map (${LUMA_MAPS.join(", ")}) and no image asset has that name${guess ? `; did you mean "${guess}"?` : ""}; the wipe follows a white map (everything changes at once)`);
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
@@ -1245,8 +1245,8 @@ function expandTransitions(spec) {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
const transitions = out.transitions;
|
|
1247
1247
|
const sequences = out.sequences ?? [];
|
|
1248
|
-
const remap = out.duration !== void 0 ?
|
|
1249
|
-
const parentDuration = remap ?
|
|
1248
|
+
const remap = out.duration !== void 0 ? chunkCJS2S5XU_cjs.timeRemapOf(out) : null;
|
|
1249
|
+
const parentDuration = remap ? chunkCJS2S5XU_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1250
1250
|
const compW = out.width;
|
|
1251
1251
|
const compH = out.height;
|
|
1252
1252
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1314,16 +1314,16 @@ function expandTransitions(spec) {
|
|
|
1314
1314
|
if (toUses > 1) {
|
|
1315
1315
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1316
1316
|
}
|
|
1317
|
-
const tStart =
|
|
1317
|
+
const tStart = chunkCJS2S5XU_cjs.resolveAt(t.at, parentDuration);
|
|
1318
1318
|
const tEnd = tStart + t.duration;
|
|
1319
1319
|
const fromSeq = fromEntry.seq;
|
|
1320
|
-
const fromStart =
|
|
1320
|
+
const fromStart = chunkCJS2S5XU_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1321
1321
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1322
1322
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1323
1323
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1324
1324
|
}
|
|
1325
1325
|
const toSeq = toEntry.seq;
|
|
1326
|
-
const toStart =
|
|
1326
|
+
const toStart = chunkCJS2S5XU_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1327
1327
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1328
1328
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1329
1329
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1383,7 +1383,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1383
1383
|
delete inner.at;
|
|
1384
1384
|
delete inner.duration;
|
|
1385
1385
|
const m = inner.mask;
|
|
1386
|
-
const carriesMatte = m !== void 0 &&
|
|
1386
|
+
const carriesMatte = m !== void 0 && chunkDS2EWRV4_cjs.maskSourceOf(m).kind === "refs";
|
|
1387
1387
|
if (carriesMatte) delete inner.mask;
|
|
1388
1388
|
return {
|
|
1389
1389
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1648,12 +1648,12 @@ function canvasReport(root) {
|
|
|
1648
1648
|
const length = seq.duration ?? 0;
|
|
1649
1649
|
const moments = [0.15, 0.4, 0.65, 0.9].map((f) => Math.round(f * length * 1e3) / 1e3);
|
|
1650
1650
|
const { differs, drawMs, threw } = seq.checkDeterminism(moments);
|
|
1651
|
-
const name =
|
|
1651
|
+
const name = chunkNGJXVJB7_cjs.describeLayer(seq.spec);
|
|
1652
1652
|
const kind = seq.spec.type === "three" ? "three" : "canvas";
|
|
1653
1653
|
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") : "";
|
|
1654
1654
|
out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem, kind });
|
|
1655
1655
|
}
|
|
1656
|
-
if (seq instanceof
|
|
1656
|
+
if (seq instanceof chunkDS2EWRV4_cjs.CompositionSequence) walk3(seq);
|
|
1657
1657
|
};
|
|
1658
1658
|
const walk3 = (comp) => {
|
|
1659
1659
|
for (const { seq } of comp.layers()) {
|
|
@@ -1705,8 +1705,8 @@ function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
|
1705
1705
|
let length = 0;
|
|
1706
1706
|
if (typeof kf.duration === "number") length = kf.duration;
|
|
1707
1707
|
else if (kf.duration === "auto") {
|
|
1708
|
-
const sp =
|
|
1709
|
-
length = sp ? Math.round(
|
|
1708
|
+
const sp = chunkCJS2S5XU_cjs.parseSpring(kf.ease);
|
|
1709
|
+
length = sp ? Math.round(chunkCJS2S5XU_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1710
1710
|
}
|
|
1711
1711
|
if (!(length > 0)) continue;
|
|
1712
1712
|
const kat = kf.at ?? 0;
|
|
@@ -1786,7 +1786,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1786
1786
|
if (motion.ever) hasMotion.add(info);
|
|
1787
1787
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1788
1788
|
const maskTarget = seq.maskSequence?.target;
|
|
1789
|
-
const maskSrc =
|
|
1789
|
+
const maskSrc = chunkDS2EWRV4_cjs.maskSourceOf(seq.spec.mask);
|
|
1790
1790
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1791
1791
|
const m = maskTarget.getBounds();
|
|
1792
1792
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1795,7 +1795,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1795
1795
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1796
1796
|
if (group) scene.set(info, group);
|
|
1797
1797
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1798
|
-
if (seq instanceof
|
|
1798
|
+
if (seq instanceof chunkDS2EWRV4_cjs.CompositionSequence) walk3(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero, parentAlpha * alpha);
|
|
1799
1799
|
});
|
|
1800
1800
|
};
|
|
1801
1801
|
walk3(root, "", false, true);
|
|
@@ -1967,12 +1967,12 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1967
1967
|
const alive = (threeD ? d.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1968
1968
|
const visible = parentVisible && alive && alpha > 0;
|
|
1969
1969
|
if (!visible) {
|
|
1970
|
-
if (seq instanceof
|
|
1970
|
+
if (seq instanceof chunkDS2EWRV4_cjs.CompositionSequence && !threeD && parentVisible && alpha > 0 && t?.visible === false && (t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true)) hiddenSources.set(seq, path);
|
|
1971
1971
|
return;
|
|
1972
1972
|
}
|
|
1973
|
-
const isComposition = seq instanceof
|
|
1973
|
+
const isComposition = seq instanceof chunkDS2EWRV4_cjs.CompositionSequence;
|
|
1974
1974
|
if (isComposition && !threeD) {
|
|
1975
|
-
const gm = seq.maskSequence?.target, gs =
|
|
1975
|
+
const gm = seq.maskSequence?.target, gs = chunkDS2EWRV4_cjs.maskSourceOf(seq.spec.mask);
|
|
1976
1976
|
if (gm && gs.kind === "inline" && !gs.invert && !inMask(gm, at)) return;
|
|
1977
1977
|
walk3(seq, path + "/", visible, at, orderBase, via);
|
|
1978
1978
|
return;
|
|
@@ -2028,7 +2028,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
if (!hit) return;
|
|
2030
2030
|
const maskTarget = seq.maskSequence?.target;
|
|
2031
|
-
const maskSrc =
|
|
2031
|
+
const maskSrc = chunkDS2EWRV4_cjs.maskSourceOf(seq.spec.mask);
|
|
2032
2032
|
if (maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert) && !(maskSrc.kind === "inline" ? inMask(maskTarget, point) : inside(maskTarget.getBounds(), point))) return;
|
|
2033
2033
|
found.push({ hit: via ? { ...hit, point: { x, y }, via } : hit, order: orderBase ? [...orderBase, ...orderOf(d)] : orderOf(d) });
|
|
2034
2034
|
});
|
|
@@ -2038,7 +2038,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2038
2038
|
const path = hiddenSources.get(f.source);
|
|
2039
2039
|
if (path === void 0) continue;
|
|
2040
2040
|
const g = f.source.target.toGlobal({ x: f.at.x * f.source.intrinsicWidth, y: f.at.y * f.source.intrinsicHeight });
|
|
2041
|
-
const sm = f.source.maskSequence?.target, ss =
|
|
2041
|
+
const sm = f.source.maskSequence?.target, ss = chunkDS2EWRV4_cjs.maskSourceOf(f.source.spec.mask);
|
|
2042
2042
|
if (sm && ss.kind === "inline" && !ss.invert && !inMask(sm, g)) continue;
|
|
2043
2043
|
walk3(f.source, path + "/", true, g, f.order, f.via);
|
|
2044
2044
|
}
|
|
@@ -2074,7 +2074,7 @@ function walk(root, visit) {
|
|
|
2074
2074
|
visit(seq);
|
|
2075
2075
|
const mask = seq.maskSequence;
|
|
2076
2076
|
if (mask) visit(mask);
|
|
2077
|
-
if (seq instanceof
|
|
2077
|
+
if (seq instanceof chunkDS2EWRV4_cjs.CompositionSequence) walk(seq, visit);
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
2080
|
function reusePoolOf(old) {
|
|
@@ -2175,7 +2175,7 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
2175
2175
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
2176
2176
|
function detailOf(seq) {
|
|
2177
2177
|
const s = seq.spec;
|
|
2178
|
-
const spans =
|
|
2178
|
+
const spans = chunkCJS2S5XU_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2179
2179
|
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2180
2180
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2181
2181
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
@@ -2191,10 +2191,10 @@ function walk2(comp, parentStart, parentEnd, depth, prefix, rows, transitions, l
|
|
|
2191
2191
|
const start = parentStart + (seq.at ?? 0);
|
|
2192
2192
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2193
2193
|
const span = end - start;
|
|
2194
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2194
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkCJS2S5XU_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2195
2195
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2196
2196
|
const inner = [];
|
|
2197
|
-
const isComp = seq instanceof
|
|
2197
|
+
const isComp = seq instanceof chunkDS2EWRV4_cjs.CompositionSequence;
|
|
2198
2198
|
if (isComp) {
|
|
2199
2199
|
const label = seq.remapLabel();
|
|
2200
2200
|
walk2(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2353,7 +2353,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2353
2353
|
}
|
|
2354
2354
|
|
|
2355
2355
|
// src/core/vars.ts
|
|
2356
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2356
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkCJS2S5XU_cjs.EXPRESSION_NAMES];
|
|
2357
2357
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2358
2358
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2359
2359
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2426,7 +2426,7 @@ function lintVars(spec, vars) {
|
|
|
2426
2426
|
const name = m[1];
|
|
2427
2427
|
if (seen.has(name) || Object.prototype.hasOwnProperty.call(vars, name) || RESERVED_NAMES.includes(name) || declared.length === 0) continue;
|
|
2428
2428
|
seen.add(name);
|
|
2429
|
-
const guess =
|
|
2429
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(name, declared);
|
|
2430
2430
|
out.push(`pixi-effects: vars: {${name}} is not a declared variable${guess ? ` \u2014 did you mean "${guess}"?` : ` (declared: ${declared.join(", ")})`}`);
|
|
2431
2431
|
}
|
|
2432
2432
|
}
|
|
@@ -2529,7 +2529,7 @@ function normalizeStops(raw, duration, frameRate) {
|
|
|
2529
2529
|
console.warn(`pixi-effects: stops[${i}] ${JSON.stringify(r)} is not a time in seconds (or { at, page?, notes?, advance?, pdf? }); ignored`);
|
|
2530
2530
|
return;
|
|
2531
2531
|
}
|
|
2532
|
-
if (typeof r === "object")
|
|
2532
|
+
if (typeof r === "object") chunkDOLTCXCL_cjs.warnUnknownOptions(`stops[${i}]`, r, KEYS);
|
|
2533
2533
|
const at = spec.at < 0 ? duration + spec.at : spec.at;
|
|
2534
2534
|
if (at < -1e-9 || at > duration + 1e-9) {
|
|
2535
2535
|
console.warn(`pixi-effects: stops[${i}] at ${spec.at} s is outside the movie (0 to ${duration} s); ignored`);
|
|
@@ -2872,7 +2872,7 @@ var Movie = class {
|
|
|
2872
2872
|
return this._audioContext;
|
|
2873
2873
|
}
|
|
2874
2874
|
async init(options = {}) {
|
|
2875
|
-
|
|
2875
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.init()", options, ["width", "height", "duration", "frameRate", "background", "canvas", "assets", "composition", "vars", "poster", "motionBlur", "loader", "loop", "loudness"]);
|
|
2876
2876
|
if (options.loudness !== void 0 && options.loudness !== false && !(typeof options.loudness === "number" && Number.isFinite(options.loudness) && options.loudness <= 0 && options.loudness >= -70)) {
|
|
2877
2877
|
throw new Error(`pixi-effects: movie.init({ loudness }) is the loudness of the whole mix in LUFS: a number from -70 to 0 (-16 is usual for web video: loudness: -16), or false for no change; got ${JSON.stringify(options.loudness)}`);
|
|
2878
2878
|
}
|
|
@@ -2897,8 +2897,8 @@ var Movie = class {
|
|
|
2897
2897
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2898
2898
|
this._posterFrame = poster.frame;
|
|
2899
2899
|
this.background = options.background ?? "#000000";
|
|
2900
|
-
this.timeline =
|
|
2901
|
-
|
|
2900
|
+
this.timeline = chunkCJS2S5XU_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2901
|
+
chunkCJS2S5XU_cjs.lengthen(this.timeline, this.duration);
|
|
2902
2902
|
const baseAppOptions = {
|
|
2903
2903
|
width: this.width,
|
|
2904
2904
|
height: this.height,
|
|
@@ -2997,8 +2997,8 @@ var Movie = class {
|
|
|
2997
2997
|
height: sizeWins ? height : spec.height ?? height,
|
|
2998
2998
|
duration: spec.duration ?? this.duration
|
|
2999
2999
|
} : void 0;
|
|
3000
|
-
await
|
|
3001
|
-
if (
|
|
3000
|
+
await chunkCJS2S5XU_cjs.ensureFilterLibrary(seededComposition);
|
|
3001
|
+
if (chunkWYR2AU4W_cjs.usesAdvancedBlend(seededComposition)) await chunkWYR2AU4W_cjs.enableAdvancedBlend(this.app.renderer);
|
|
3002
3002
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
3003
3003
|
const rootSeqSpec = {
|
|
3004
3004
|
type: "composition",
|
|
@@ -3008,7 +3008,7 @@ var Movie = class {
|
|
|
3008
3008
|
...userComposition
|
|
3009
3009
|
};
|
|
3010
3010
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
3011
|
-
const sequence = new
|
|
3011
|
+
const sequence = new chunkDS2EWRV4_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
3012
3012
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
3013
3013
|
try {
|
|
3014
3014
|
await sequence.build();
|
|
@@ -3076,7 +3076,7 @@ var Movie = class {
|
|
|
3076
3076
|
*/
|
|
3077
3077
|
async rebuild(change = {}, reason = "rebuild") {
|
|
3078
3078
|
this._requireReady("rebuild");
|
|
3079
|
-
|
|
3079
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.rebuild()", change, ["composition", "vars", "width", "height"]);
|
|
3080
3080
|
if (this._rebuildRun) {
|
|
3081
3081
|
if (!this._rebuildNext) {
|
|
3082
3082
|
let resolve, reject;
|
|
@@ -3126,7 +3126,7 @@ var Movie = class {
|
|
|
3126
3126
|
const given = normalizeVars(change.vars, who);
|
|
3127
3127
|
for (const [name, value] of Object.entries(given)) {
|
|
3128
3128
|
if (!this._declared.has(name)) {
|
|
3129
|
-
const guess =
|
|
3129
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(name, [...this._declared]);
|
|
3130
3130
|
console.warn(`pixi-effects: ${who}: "${name}" is not a declared variable${guess ? ` \u2014 did you mean "${guess}"?` : ""} (declared in movie.init({ vars }): ${[...this._declared].join(", ") || "none"}); ignored`);
|
|
3131
3131
|
continue;
|
|
3132
3132
|
}
|
|
@@ -3147,8 +3147,8 @@ var Movie = class {
|
|
|
3147
3147
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
3148
3148
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged, reusePoolOf(this._rootSequence));
|
|
3149
3149
|
alive();
|
|
3150
|
-
const timeline =
|
|
3151
|
-
|
|
3150
|
+
const timeline = chunkCJS2S5XU_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
3151
|
+
chunkCJS2S5XU_cjs.lengthen(timeline, this.duration);
|
|
3152
3152
|
sequence.bindTimeline(timeline);
|
|
3153
3153
|
const hadSound = this.audioBuffer !== null;
|
|
3154
3154
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3298,7 +3298,7 @@ var Movie = class {
|
|
|
3298
3298
|
}
|
|
3299
3299
|
}
|
|
3300
3300
|
async snapshot(frame = this.currentFrame, opts = {}) {
|
|
3301
|
-
|
|
3301
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.snapshot()", opts, ["scale", "type", "quality", "as", "motionBlur"]);
|
|
3302
3302
|
this._requireReady("snapshot");
|
|
3303
3303
|
return this._captureFrame(clampFrame(frame, this.totalFrames), { scale: opts.scale ?? 1, type: opts.type ?? "image/png", quality: opts.quality, as: opts.as ?? "blob", motionBlur: opts.motionBlur });
|
|
3304
3304
|
}
|
|
@@ -3340,7 +3340,7 @@ var Movie = class {
|
|
|
3340
3340
|
* (a seek, a render, a peek), or is another thumbnail's turn. It is the picture `snapshot()` gives at that size (without motion blur).
|
|
3341
3341
|
*/
|
|
3342
3342
|
async thumbnail(frame, opts = {}) {
|
|
3343
|
-
|
|
3343
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.thumbnail()", opts, ["width", "scale"]);
|
|
3344
3344
|
this._requireReady("thumbnail");
|
|
3345
3345
|
if (opts.width !== void 0 && !(opts.width > 0 && opts.width <= this.width * 4)) throw new Error(`pixi-effects: movie.thumbnail(): width must be above 0 and at most ${this.width * 4} px, got ${opts.width}`);
|
|
3346
3346
|
if (opts.scale !== void 0 && !(opts.scale > 0 && opts.scale <= 4)) throw new Error(`pixi-effects: movie.thumbnail(): scale must be above 0 and at most 4, got ${opts.scale}`);
|
|
@@ -3386,7 +3386,7 @@ var Movie = class {
|
|
|
3386
3386
|
return out;
|
|
3387
3387
|
}
|
|
3388
3388
|
async onionSkin(opts = {}) {
|
|
3389
|
-
|
|
3389
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.onionSkin()", opts, ["from", "to", "count", "scale", "as", "motionBlur"]);
|
|
3390
3390
|
this._requireReady("onionSkin");
|
|
3391
3391
|
const from = opts.from ?? 0, to = opts.to ?? this.duration, count = opts.count ?? 8, scale = opts.scale ?? 1;
|
|
3392
3392
|
if (!(Number.isInteger(count) && count >= 1 && count <= 64)) throw new Error(`pixi-effects: movie.onionSkin(): count must be a whole number from 1 to 64, got ${count}`);
|
|
@@ -3417,7 +3417,7 @@ var Movie = class {
|
|
|
3417
3417
|
return encodeCanvas(out, "image/png", opts.as ?? "blob");
|
|
3418
3418
|
}
|
|
3419
3419
|
async contactSheet(opts = {}) {
|
|
3420
|
-
|
|
3420
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.contactSheet()", opts, ["frames", "times", "count", "columns", "cellWidth", "as", "motionBlur"]);
|
|
3421
3421
|
this._requireReady("contactSheet");
|
|
3422
3422
|
const mb = this._blurFor(opts.motionBlur, "movie.contactSheet()");
|
|
3423
3423
|
const blurred = mb ? this._blurCanvas() : null;
|
|
@@ -3463,7 +3463,7 @@ var Movie = class {
|
|
|
3463
3463
|
}
|
|
3464
3464
|
/** Every layer under the canvas point, the one on top first (see `pick`). */
|
|
3465
3465
|
pickAll(x, y, opts = {}) {
|
|
3466
|
-
|
|
3466
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.pick()", opts, ["only", "ignore", "alpha"]);
|
|
3467
3467
|
this._requireReady("pick");
|
|
3468
3468
|
if (!Number.isFinite(x) || !Number.isFinite(y)) throw new Error(`pixi-effects: movie.pick(x, y) needs two numbers (canvas pixels), got ${x}, ${y}. For a pointer event: movie.pick(...movie.canvasPoint(event))`);
|
|
3469
3469
|
const textureOf = textPictureOf;
|
|
@@ -3475,7 +3475,7 @@ var Movie = class {
|
|
|
3475
3475
|
* `{ only, ignore }` as for `pick`; `cursor: true` (or a CSS cursor) shows it while something is hovered. Returns the function that stops it. A page-side tool: an exported video has no pointer.
|
|
3476
3476
|
*/
|
|
3477
3477
|
hover(opts = {}) {
|
|
3478
|
-
|
|
3478
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.hover()", opts, ["onEnter", "onLeave", "cursor", "only", "ignore"]);
|
|
3479
3479
|
this._requireReady("hover");
|
|
3480
3480
|
const canvas = this.app?.canvas;
|
|
3481
3481
|
if (!canvas) throw new Error("pixi-effects: movie.hover needs the movie's canvas");
|
|
@@ -3490,7 +3490,7 @@ var Movie = class {
|
|
|
3490
3490
|
return [(event.clientX - r.left) * this.width / (r.width || this.width), (event.clientY - r.top) * this.height / (r.height || this.height)];
|
|
3491
3491
|
}
|
|
3492
3492
|
async inspect(frame = this.currentFrame, opts = { layers: "visible" }) {
|
|
3493
|
-
|
|
3493
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.inspect()", opts, ["layers"]);
|
|
3494
3494
|
this._requireReady("inspect");
|
|
3495
3495
|
const f = clampFrame(frame, this.totalFrames);
|
|
3496
3496
|
await this.gotoFrame(f, true);
|
|
@@ -3516,12 +3516,12 @@ var Movie = class {
|
|
|
3516
3516
|
}
|
|
3517
3517
|
/** The timeline as one self-contained HTML page (an inline SVG, no scripts): layers as bars on a time axis, ◆ keyframes, transition bands. Open it in a browser. */
|
|
3518
3518
|
timelineChart(opts = {}) {
|
|
3519
|
-
|
|
3519
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.timelineChart()", opts, ["title"]);
|
|
3520
3520
|
return timelineHtml(this.timelineData(), opts);
|
|
3521
3521
|
}
|
|
3522
3522
|
/** Just the chart: one `<svg>` whose geometry is in `data-*` attributes (a viewer puts a playhead on it: `pixi-effects view`). */
|
|
3523
3523
|
timelineSvg(opts = {}) {
|
|
3524
|
-
|
|
3524
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.timelineSvg()", opts, ["chartWidth", "labels"]);
|
|
3525
3525
|
return timelineSvg(this.timelineData(), opts);
|
|
3526
3526
|
}
|
|
3527
3527
|
/**
|
|
@@ -3538,7 +3538,7 @@ var Movie = class {
|
|
|
3538
3538
|
* scene's first and last frame and a frame every 0.25 s), fonts and the sound. See `ReviewReport`. Page warnings are in `window.__logs`. The movie is left as it was.
|
|
3539
3539
|
*/
|
|
3540
3540
|
async review(opts = {}) {
|
|
3541
|
-
|
|
3541
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.review()", opts, ["at", "strict"]);
|
|
3542
3542
|
this._requireReady("review");
|
|
3543
3543
|
const back = this.currentFrame, wasAtPoster = this._atPoster;
|
|
3544
3544
|
try {
|
|
@@ -3558,7 +3558,7 @@ var Movie = class {
|
|
|
3558
3558
|
return inspectFonts(this._rootSequence);
|
|
3559
3559
|
}
|
|
3560
3560
|
inspectAudio(opts = {}) {
|
|
3561
|
-
|
|
3561
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.inspectAudio()", opts, ["window", "scenes"]);
|
|
3562
3562
|
this._requireReady("inspectAudio");
|
|
3563
3563
|
const scenes = opts.scenes ?? namedScenes(this.timelineData().rows);
|
|
3564
3564
|
return chunkZAHCGFGC_cjs.analyzeAudio(this.audioBuffer, this._audioSources, this._mixStats, this.duration, { ...opts, scenes });
|
|
@@ -3854,7 +3854,7 @@ var Movie = class {
|
|
|
3854
3854
|
return this._loop;
|
|
3855
3855
|
}
|
|
3856
3856
|
async render(options) {
|
|
3857
|
-
|
|
3857
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.render()", options, ["format", "video", "audio", "motionBlur", "range", "scale", "draft"]);
|
|
3858
3858
|
try {
|
|
3859
3859
|
return await this._exclusive(() => this._quietly(() => exportFrames(this, options)));
|
|
3860
3860
|
} catch (err) {
|
|
@@ -3923,7 +3923,7 @@ function countLayers(spec) {
|
|
|
3923
3923
|
n += 1 + countLayers(s);
|
|
3924
3924
|
const spans = s.spans;
|
|
3925
3925
|
if (Array.isArray(spans)) n += spans.length;
|
|
3926
|
-
const src =
|
|
3926
|
+
const src = chunkDS2EWRV4_cjs.maskSourceOf(mask);
|
|
3927
3927
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3928
3928
|
}
|
|
3929
3929
|
return n;
|
|
@@ -3933,19 +3933,19 @@ var ALIGN = ["left", "center", "right"];
|
|
|
3933
3933
|
var widthOf = (text, style) => pixi_js.CanvasTextMetrics.measureText(text, style).width;
|
|
3934
3934
|
function measureText(text, style = {}) {
|
|
3935
3935
|
const m = pixi_js.CanvasTextMetrics.measureText(text, new pixi_js.TextStyle(style));
|
|
3936
|
-
return { width: m.width, height: m.height, lines: text.split("\n").length };
|
|
3936
|
+
return { width: m.width, height: m.height, lines: m.lines?.length ?? text.split("\n").length };
|
|
3937
3937
|
}
|
|
3938
3938
|
function splitText(text, style = {}, opts = {}) {
|
|
3939
|
-
|
|
3939
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("splitText()", opts, ["by", "x", "y", "align", "vertical"]);
|
|
3940
3940
|
let by = opts.by ?? "chars";
|
|
3941
3941
|
if (!BY.includes(by)) {
|
|
3942
|
-
const g =
|
|
3942
|
+
const g = chunkDOLTCXCL_cjs.suggestName(String(by), BY);
|
|
3943
3943
|
console.warn(`pixi-effects: splitText(): by "${by}" is not one of ${BY.map((b) => `"${b}"`).join(", ")}${g ? ` \u2014 did you mean "${g}"?` : ""}; using "chars"`);
|
|
3944
3944
|
by = "chars";
|
|
3945
3945
|
}
|
|
3946
3946
|
let align = opts.align ?? "left";
|
|
3947
3947
|
if (!ALIGN.includes(align)) {
|
|
3948
|
-
const g =
|
|
3948
|
+
const g = chunkDOLTCXCL_cjs.suggestName(String(align), ALIGN);
|
|
3949
3949
|
console.warn(`pixi-effects: splitText(): align "${align}" is not one of ${ALIGN.join(", ")}${g ? ` \u2014 did you mean "${g}"?` : ""}; using "left"`);
|
|
3950
3950
|
align = "left";
|
|
3951
3951
|
}
|
|
@@ -4012,14 +4012,14 @@ function splitVertical(text, style, ts, right, top, align, by) {
|
|
|
4012
4012
|
|
|
4013
4013
|
// src/presets/_ease.ts
|
|
4014
4014
|
function parseEase2(name) {
|
|
4015
|
-
|
|
4016
|
-
return
|
|
4015
|
+
chunkCJS2S5XU_cjs.checkEase(name, "a preset");
|
|
4016
|
+
return chunkCJS2S5XU_cjs.parseEase(name);
|
|
4017
4017
|
}
|
|
4018
4018
|
|
|
4019
4019
|
// src/presets/kenBurns.ts
|
|
4020
4020
|
var KEN_BURNS_KEYS = ["asset", "name", "at", "duration", "fit", "ease", "motion", "origin", "zoom", "direction", "angle", "from", "to"];
|
|
4021
4021
|
function kenBurns(opts) {
|
|
4022
|
-
|
|
4022
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("kenBurns()", opts, KEN_BURNS_KEYS);
|
|
4023
4023
|
const {
|
|
4024
4024
|
asset,
|
|
4025
4025
|
name,
|
|
@@ -4132,7 +4132,7 @@ function clamp(v, lo, hi) {
|
|
|
4132
4132
|
// src/presets/orbit.ts
|
|
4133
4133
|
var ORBIT_KEYS = ["duration", "degrees", "start", "radius", "center", "width", "height", "fov", "ease", "dollyZoom", "at", "name", "stepsPerSecond"];
|
|
4134
4134
|
function orbit(opts) {
|
|
4135
|
-
|
|
4135
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("orbit()", opts, ORBIT_KEYS);
|
|
4136
4136
|
const {
|
|
4137
4137
|
duration,
|
|
4138
4138
|
degrees,
|
|
@@ -4148,17 +4148,17 @@ function orbit(opts) {
|
|
|
4148
4148
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
4149
4149
|
}
|
|
4150
4150
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
4151
|
-
const fixedR = opts.radius ??
|
|
4151
|
+
const fixedR = opts.radius ?? chunkCJS2S5XU_cjs.homeDistance(height, fov ?? chunkCJS2S5XU_cjs.DEFAULT_FOV);
|
|
4152
4152
|
const start = opts.start ?? -degrees / 2;
|
|
4153
4153
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
4154
4154
|
const easeFn = parseEase2(ease);
|
|
4155
4155
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
4156
4156
|
const pos = (i) => {
|
|
4157
4157
|
const p = i / steps;
|
|
4158
|
-
const a = (start + degrees * easeFn(p)) *
|
|
4158
|
+
const a = (start + degrees * easeFn(p)) * chunkCJS2S5XU_cjs.DEG;
|
|
4159
4159
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
4160
4160
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
4161
|
-
const R =
|
|
4161
|
+
const R = chunkCJS2S5XU_cjs.homeDistance(height, f);
|
|
4162
4162
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
4163
4163
|
};
|
|
4164
4164
|
const keyframes = [];
|
|
@@ -4190,7 +4190,7 @@ var KEYS2 = ["count", "at", "emit", "life", "area", "angle", "speed", "gravity",
|
|
|
4190
4190
|
var SHAPES = ["circle", "rect", "star"];
|
|
4191
4191
|
var MAX_KEYFRAMES = 3e4;
|
|
4192
4192
|
function particles(opts) {
|
|
4193
|
-
|
|
4193
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("particles()", opts, KEYS2);
|
|
4194
4194
|
const { count, at = 0, emit = 0, gravity = 0, wind = 0, drag = 0, sway, fade, colors = ["#ffffff"], shape = "circle", seed = 0, name = "particle", template, sampleRate = 20 } = opts;
|
|
4195
4195
|
if (!(Number.isInteger(count) && count > 0)) throw new Error(`particles(): count must be a whole number of particles (at least 1), got ${count}`);
|
|
4196
4196
|
const life = range("life", opts.life, 1e-6);
|
|
@@ -4198,7 +4198,7 @@ function particles(opts) {
|
|
|
4198
4198
|
if (!(Number.isFinite(emit) && emit >= 0)) throw new Error(`particles(): emit must be a number of seconds >= 0, got ${emit}`);
|
|
4199
4199
|
if (!(Number.isFinite(sampleRate) && sampleRate > 0)) throw new Error(`particles(): sampleRate must be a positive number (samples per second), got ${sampleRate}`);
|
|
4200
4200
|
if (!SHAPES.includes(shape)) {
|
|
4201
|
-
const g =
|
|
4201
|
+
const g = chunkDOLTCXCL_cjs.suggestName(String(shape), SHAPES);
|
|
4202
4202
|
throw new Error(`particles(): shape "${shape}" is not one of ${SHAPES.map((s) => `"${s}"`).join(", ")}${g ? `; did you mean "${g}"?` : ""}`);
|
|
4203
4203
|
}
|
|
4204
4204
|
const angle = range("angle", opts.angle ?? [0, 360], -Infinity);
|
|
@@ -4213,7 +4213,7 @@ function particles(opts) {
|
|
|
4213
4213
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
4214
4214
|
const out = [];
|
|
4215
4215
|
for (let i = 0; i < count; i++) {
|
|
4216
|
-
const r =
|
|
4216
|
+
const r = chunkCJS2S5XU_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
4217
4217
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
4218
4218
|
const born = at + r() * emit;
|
|
4219
4219
|
const lifetime = pick(life);
|
|
@@ -4226,7 +4226,7 @@ function particles(opts) {
|
|
|
4226
4226
|
const turn = spin ? pick(spin) : 0;
|
|
4227
4227
|
const startAngle = spin ? r() * 360 : 0;
|
|
4228
4228
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
4229
|
-
const n0 = sway ?
|
|
4229
|
+
const n0 = sway ? chunkCJS2S5XU_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
4230
4230
|
const at_ = (t) => {
|
|
4231
4231
|
const axis = (p0, v0, acc) => {
|
|
4232
4232
|
if (drag > 0) {
|
|
@@ -4235,7 +4235,7 @@ function particles(opts) {
|
|
|
4235
4235
|
}
|
|
4236
4236
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
4237
4237
|
};
|
|
4238
|
-
const sw = sway ? swayAmp * (
|
|
4238
|
+
const sw = sway ? swayAmp * (chunkCJS2S5XU_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
4239
4239
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
4240
4240
|
};
|
|
4241
4241
|
const kfs = [];
|
|
@@ -4285,7 +4285,7 @@ function range(name, v, min) {
|
|
|
4285
4285
|
var KEYS3 = ["d", "at", "duration", "ease", "from", "to", "orient", "rotate", "frameRate"];
|
|
4286
4286
|
var MAX_STEPS = 2e3;
|
|
4287
4287
|
function followPath(opts) {
|
|
4288
|
-
|
|
4288
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("followPath()", opts, KEYS3);
|
|
4289
4289
|
const { d, at = 0, duration, ease = "none", from = 0, to = 1, orient = false, rotate = 0, frameRate = 30 } = opts;
|
|
4290
4290
|
if (typeof d !== "string" || d.trim() === "") throw new Error('followPath(): d must be SVG path data, e.g. "M 100 600 C 300 100 900 100 1180 600"');
|
|
4291
4291
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`followPath(): duration must be a positive number of seconds, got ${duration}`);
|
|
@@ -4297,7 +4297,7 @@ function followPath(opts) {
|
|
|
4297
4297
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
4298
4298
|
const segments = [];
|
|
4299
4299
|
let total = 0;
|
|
4300
|
-
for (const line of
|
|
4300
|
+
for (const line of chunkCJS2S5XU_cjs.flattenSvgPath(d)) {
|
|
4301
4301
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
4302
4302
|
for (let i = 2; i < p.length; i += 2) {
|
|
4303
4303
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4350,7 +4350,7 @@ function followPath(opts) {
|
|
|
4350
4350
|
// src/core/pathSample.ts
|
|
4351
4351
|
function samplePath(d) {
|
|
4352
4352
|
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"');
|
|
4353
|
-
const lines =
|
|
4353
|
+
const lines = chunkCJS2S5XU_cjs.flattenSvgPath(d);
|
|
4354
4354
|
const segments = [];
|
|
4355
4355
|
let length = 0;
|
|
4356
4356
|
for (const line of lines) {
|
|
@@ -4381,7 +4381,7 @@ function samplePath(d) {
|
|
|
4381
4381
|
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) };
|
|
4382
4382
|
},
|
|
4383
4383
|
trim(start = 0, end = 1) {
|
|
4384
|
-
return
|
|
4384
|
+
return chunkCJS2S5XU_cjs.trimPolylines(lines, start, end).map((l) => l.closed ? [...l.pts, l.pts[0], l.pts[1]] : l.pts);
|
|
4385
4385
|
}
|
|
4386
4386
|
};
|
|
4387
4387
|
}
|
|
@@ -4391,7 +4391,7 @@ var KEYS4 = ["points", "at", "duration", "ease", "look", "lookAhead", "smooth",
|
|
|
4391
4391
|
var MAX_STEPS2 = 4e3;
|
|
4392
4392
|
var PER_SPAN = 48;
|
|
4393
4393
|
function cameraPath(opts) {
|
|
4394
|
-
|
|
4394
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("cameraPath()", opts, KEYS4);
|
|
4395
4395
|
const { points, at = 0, duration, ease = "none", look = "ahead", lookAhead = 0.08, smooth = true, from = 0, to = 1, frameRate = 30 } = opts;
|
|
4396
4396
|
if (!Array.isArray(points) || points.length < 2) throw new Error("cameraPath(): points needs at least two points: [[x, y, z], [x, y, z], \u2026]");
|
|
4397
4397
|
points.forEach((p, i) => {
|
|
@@ -4467,7 +4467,7 @@ function stagger(items, spec = {}) {
|
|
|
4467
4467
|
const isCount = typeof items === "number";
|
|
4468
4468
|
const n = isCount ? items : items.length;
|
|
4469
4469
|
if (!Number.isInteger(n) || n < 0) throw new Error(`stagger(): count must be a whole number of items, got ${n}`);
|
|
4470
|
-
|
|
4470
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("stagger()", options, STAGGER_KEYS);
|
|
4471
4471
|
const { each, amount, from = "start", grid, ease = "none", seed = 0 } = options;
|
|
4472
4472
|
if (each !== void 0 && amount !== void 0) throw new Error("stagger(): give `each` (seconds between neighbours) or `amount` (seconds in total), not both");
|
|
4473
4473
|
if (each !== void 0 && !(Number.isFinite(each) && each >= 0)) throw new Error(`stagger(): each must be a number of seconds >= 0, got ${each}`);
|
|
@@ -4492,7 +4492,7 @@ function distances(n, from, grid, seed) {
|
|
|
4492
4492
|
if (n === 0) return [];
|
|
4493
4493
|
if (from === "random") {
|
|
4494
4494
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4495
|
-
const r =
|
|
4495
|
+
const r = chunkCJS2S5XU_cjs.random(seed);
|
|
4496
4496
|
for (let i = n - 1; i > 0; i--) {
|
|
4497
4497
|
const j = Math.floor(r() * (i + 1));
|
|
4498
4498
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4529,7 +4529,7 @@ function distances(n, from, grid, seed) {
|
|
|
4529
4529
|
var WIGGLE_KEYS = ["at", "duration", "freq", "seed", "ease", "props"];
|
|
4530
4530
|
var MAX_STEPS3 = 2e3;
|
|
4531
4531
|
function wiggle(opts) {
|
|
4532
|
-
|
|
4532
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("wiggle()", opts, WIGGLE_KEYS);
|
|
4533
4533
|
const { at = 0, duration, freq = 3, seed = 0, ease = "sine.inOut", props } = opts;
|
|
4534
4534
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`wiggle(): duration must be a positive number of seconds, got ${duration}`);
|
|
4535
4535
|
if (!(Number.isFinite(freq) && freq > 0)) throw new Error(`wiggle(): freq must be a positive number (steps per second), got ${freq}`);
|
|
@@ -4554,7 +4554,7 @@ function wiggle(opts) {
|
|
|
4554
4554
|
to[n] = p.around;
|
|
4555
4555
|
return;
|
|
4556
4556
|
}
|
|
4557
|
-
const off = (
|
|
4557
|
+
const off = (chunkCJS2S5XU_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4558
4558
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4559
4559
|
});
|
|
4560
4560
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -4577,7 +4577,7 @@ var PRESETS = {
|
|
|
4577
4577
|
};
|
|
4578
4578
|
var PRESET_NAMES = Object.keys(PRESETS);
|
|
4579
4579
|
function animateText(text, style, options) {
|
|
4580
|
-
|
|
4580
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("animateText()", options, KEYS5);
|
|
4581
4581
|
const { by = "chars", x = 0, y = 0, align = "left", vertical = false, name = "text", at = 0, duration, idle, styleFor } = options;
|
|
4582
4582
|
for (const [n, v] of [["x", x], ["y", y]]) {
|
|
4583
4583
|
if (typeof v !== "number" || !Number.isFinite(v)) {
|
|
@@ -4673,11 +4673,11 @@ function resolveTween(spec, which) {
|
|
|
4673
4673
|
}
|
|
4674
4674
|
if (TIME_KEYS.includes(key)) {
|
|
4675
4675
|
console.warn(`pixi-effects: animateText(): ${which}.${key} ("${key}") is ignored: ${which === "out" ? "an exit starts at out.at (composition seconds); without it it leaves from the END of the layer (at + duration)" : "the entrance starts when the piece starts (the options' `at`, plus the stagger), and the layer lasts `duration`"}`);
|
|
4676
|
-
} else
|
|
4676
|
+
} else chunkDOLTCXCL_cjs.warnUnknownOptions(`animateText() ${which}`, { [key]: 1 }, TWEEN_KEYS);
|
|
4677
4677
|
}
|
|
4678
4678
|
}
|
|
4679
4679
|
if (t.preset !== void 0 && !(t.preset in PRESETS)) {
|
|
4680
|
-
const guess =
|
|
4680
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(String(t.preset), PRESET_NAMES);
|
|
4681
4681
|
throw new Error(`animateText(): ${which} "${t.preset}" is not a preset${guess ? `; did you mean "${guess}"?` : ""} (presets: ${PRESET_NAMES.map((n) => `"${n}"`).join(", ")}; for no ${which === "out" ? "exit: omit `out` or write out: false (the pieces stay until the layer ends)" : "entrance: in: false"})`);
|
|
4682
4682
|
}
|
|
4683
4683
|
const base = t.preset ? PRESETS[t.preset] : void 0;
|
|
@@ -4702,7 +4702,7 @@ var KEYS6 = ["at", "duration", "props", "audioOffset", "loop", "frameRate"];
|
|
|
4702
4702
|
var PROP_KEYS = ["base", "amount", "band", "beats", "decay", "attack", "release", "invert", "curve"];
|
|
4703
4703
|
var MAX_STEPS4 = 4e3;
|
|
4704
4704
|
function react(env, options) {
|
|
4705
|
-
|
|
4705
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("react()", options, KEYS6);
|
|
4706
4706
|
const { at = 0, duration, props, audioOffset = 0, loop = false } = options;
|
|
4707
4707
|
const frameRate = options.frameRate ?? env.frameRate;
|
|
4708
4708
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`react(): duration must be a positive number of seconds, got ${duration}`);
|
|
@@ -4711,7 +4711,7 @@ function react(env, options) {
|
|
|
4711
4711
|
if (names.length === 0) throw new Error("react(): props is empty; name at least one property, e.g. props: { scale: { base: 1, amount: 0.3 } }");
|
|
4712
4712
|
for (const n of names) {
|
|
4713
4713
|
const p = props[n];
|
|
4714
|
-
|
|
4714
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions(`react() props.${n}`, p, PROP_KEYS);
|
|
4715
4715
|
if (!Number.isFinite(p.amount)) throw new Error(`react(): props.${n}.amount must be a number, got ${p.amount}`);
|
|
4716
4716
|
if (!p.beats && p.band !== void 0 && !env.series[p.band]) throw new Error(`react(): props.${n}: band "${p.band}" is not in this envelope (it has: ${Object.keys(env.series).join(", ")})`);
|
|
4717
4717
|
if (p.beats && !(p.decay === void 0 || Number.isFinite(p.decay) && p.decay > 0)) throw new Error(`react(): props.${n}.decay must be a positive number of seconds, got ${p.decay}`);
|
|
@@ -4818,7 +4818,7 @@ function tempo(beats) {
|
|
|
4818
4818
|
return Math.round(60 / median * 10) / 10;
|
|
4819
4819
|
}
|
|
4820
4820
|
function computeEnvelope(audio, options = {}) {
|
|
4821
|
-
|
|
4821
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("audioEnvelope()", options, OPTION_KEYS);
|
|
4822
4822
|
const frameRate = options.frameRate ?? 30;
|
|
4823
4823
|
if (!(Number.isFinite(frameRate) && frameRate > 0)) throw new Error(`pixi-effects: audioEnvelope(): frameRate must be a positive number, got ${frameRate}`);
|
|
4824
4824
|
const bands = options.bands ?? DEFAULT_BANDS;
|
|
@@ -4942,7 +4942,7 @@ async function audioEnvelope(source, options = {}) {
|
|
|
4942
4942
|
|
|
4943
4943
|
// src/audio/musicEnvelope.ts
|
|
4944
4944
|
async function musicEnvelope(music, options = {}) {
|
|
4945
|
-
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-
|
|
4945
|
+
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-XQEPBIDT.cjs');
|
|
4946
4946
|
const messages = [];
|
|
4947
4947
|
const m = resolveMusic(music, "musicEnvelope()", (msg) => messages.push(msg));
|
|
4948
4948
|
if (!m) throw new Error(`pixi-effects: musicEnvelope(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -4955,7 +4955,7 @@ async function musicEnvelope(music, options = {}) {
|
|
|
4955
4955
|
|
|
4956
4956
|
// src/audio/musicBuffer.ts
|
|
4957
4957
|
async function musicBuffer(music, options = {}) {
|
|
4958
|
-
const { resolveMusic, renderMusic, musicLength } = await import('./music-
|
|
4958
|
+
const { resolveMusic, renderMusic, musicLength } = await import('./music-XQEPBIDT.cjs');
|
|
4959
4959
|
const messages = [];
|
|
4960
4960
|
const m = resolveMusic(music, "musicBuffer()", (msg) => messages.push(msg));
|
|
4961
4961
|
if (!m) throw new Error(`pixi-effects: musicBuffer(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -4972,7 +4972,7 @@ async function musicBuffer(music, options = {}) {
|
|
|
4972
4972
|
|
|
4973
4973
|
// src/audio/musicEvents.ts
|
|
4974
4974
|
async function musicEvents(music) {
|
|
4975
|
-
const { resolveMusic } = await import('./music-
|
|
4975
|
+
const { resolveMusic } = await import('./music-XQEPBIDT.cjs');
|
|
4976
4976
|
const { describeEvents } = await import('./events-EE3SM5LM.cjs');
|
|
4977
4977
|
const messages = [];
|
|
4978
4978
|
const m = resolveMusic(music, "musicEvents()", (msg) => messages.push(msg));
|
|
@@ -4983,7 +4983,7 @@ async function musicEvents(music) {
|
|
|
4983
4983
|
|
|
4984
4984
|
// src/transforms/withFade.ts
|
|
4985
4985
|
function withFade(spec, opts) {
|
|
4986
|
-
|
|
4986
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("withFade()", opts, ["in", "out"]);
|
|
4987
4987
|
if (opts.in != null && opts.in > 0) {
|
|
4988
4988
|
spec.initial = { ...spec.initial ?? {}, alpha: 0 };
|
|
4989
4989
|
const kf = { at: 0, to: { alpha: 1 }, duration: opts.in };
|
|
@@ -5025,5 +5025,5 @@ exports.splitText = splitText;
|
|
|
5025
5025
|
exports.stagger = stagger;
|
|
5026
5026
|
exports.wiggle = wiggle;
|
|
5027
5027
|
exports.withFade = withFade;
|
|
5028
|
-
//# sourceMappingURL=chunk-
|
|
5029
|
-
//# sourceMappingURL=chunk-
|
|
5028
|
+
//# sourceMappingURL=chunk-AES2L75M.cjs.map
|
|
5029
|
+
//# sourceMappingURL=chunk-AES2L75M.cjs.map
|