pixi-effects 0.33.0 → 0.34.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 +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Composition-NDXKQHB4.js +7 -0
- package/dist/{Composition-7XNPTM7L.js.map → Composition-NDXKQHB4.js.map} +1 -1
- package/dist/Composition-OLH7RC5Z.cjs +16 -0
- package/dist/{Composition-L6OALWHI.cjs.map → Composition-OLH7RC5Z.cjs.map} +1 -1
- package/dist/{Spans-KPZ2QDCN.js → Spans-QHHWC2PB.js} +4 -4
- package/dist/{Spans-KPZ2QDCN.js.map → Spans-QHHWC2PB.js.map} +1 -1
- package/dist/{Spans-VXNQXSI3.cjs → Spans-QRMN2EZO.cjs} +9 -9
- package/dist/{Spans-VXNQXSI3.cjs.map → Spans-QRMN2EZO.cjs.map} +1 -1
- package/dist/{chunk-SBBXKPBP.cjs → chunk-5IJENZOG.cjs} +62 -62
- package/dist/{chunk-SBBXKPBP.cjs.map → chunk-5IJENZOG.cjs.map} +1 -1
- package/dist/{chunk-WST432AP.js → chunk-67LG7MN5.js} +4 -4
- package/dist/{chunk-WST432AP.js.map → chunk-67LG7MN5.js.map} +1 -1
- package/dist/{chunk-LD4VKNPQ.cjs → chunk-FVZEBYLW.cjs} +36 -36
- package/dist/{chunk-LD4VKNPQ.cjs.map → chunk-FVZEBYLW.cjs.map} +1 -1
- package/dist/{chunk-BVMZUPDU.cjs → chunk-LEECUCTG.cjs} +22 -5
- package/dist/chunk-LEECUCTG.cjs.map +1 -0
- package/dist/{chunk-BMH4OCDX.js → chunk-XV4L72FW.js} +3 -3
- package/dist/{chunk-BMH4OCDX.js.map → chunk-XV4L72FW.js.map} +1 -1
- package/dist/{chunk-E53QWHBK.js → chunk-Y253JQOH.js} +22 -5
- package/dist/chunk-Y253JQOH.js.map +1 -0
- package/dist/index.cjs +31 -31
- package/dist/index.js +3 -3
- package/dist/loader.css +1 -1
- package/dist/present.cjs +3 -3
- package/dist/present.js +3 -3
- package/dist/three.cjs +5 -5
- package/dist/three.js +1 -1
- package/docs/dsl.md +7 -2
- package/llms-full.txt +10 -3
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/pitfalls.md +2 -0
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-7XNPTM7L.js +0 -7
- package/dist/Composition-L6OALWHI.cjs +0 -16
- package/dist/chunk-BVMZUPDU.cjs.map +0 -1
- package/dist/chunk-E53QWHBK.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk5IJENZOG_cjs = require('./chunk-5IJENZOG.cjs');
|
|
4
|
+
var chunkLEECUCTG_cjs = require('./chunk-LEECUCTG.cjs');
|
|
5
5
|
var chunkIMQJVRMT_cjs = require('./chunk-IMQJVRMT.cjs');
|
|
6
6
|
var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
|
|
7
7
|
var pixi_js = require('pixi.js');
|
|
@@ -1490,8 +1490,8 @@ function expandTransitions(spec) {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
const transitions = out.transitions;
|
|
1492
1492
|
const sequences = out.sequences ?? [];
|
|
1493
|
-
const remap = out.duration !== void 0 ?
|
|
1494
|
-
const parentDuration = remap ?
|
|
1493
|
+
const remap = out.duration !== void 0 ? chunkLEECUCTG_cjs.timeRemapOf(out) : null;
|
|
1494
|
+
const parentDuration = remap ? chunkLEECUCTG_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1495
1495
|
const compW = out.width;
|
|
1496
1496
|
const compH = out.height;
|
|
1497
1497
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1559,16 +1559,16 @@ function expandTransitions(spec) {
|
|
|
1559
1559
|
if (toUses > 1) {
|
|
1560
1560
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1561
1561
|
}
|
|
1562
|
-
const tStart =
|
|
1562
|
+
const tStart = chunkLEECUCTG_cjs.resolveAt(t.at, parentDuration);
|
|
1563
1563
|
const tEnd = tStart + t.duration;
|
|
1564
1564
|
const fromSeq = fromEntry.seq;
|
|
1565
|
-
const fromStart =
|
|
1565
|
+
const fromStart = chunkLEECUCTG_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1566
1566
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1567
1567
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1568
1568
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1569
1569
|
}
|
|
1570
1570
|
const toSeq = toEntry.seq;
|
|
1571
|
-
const toStart =
|
|
1571
|
+
const toStart = chunkLEECUCTG_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1572
1572
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1573
1573
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1574
1574
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1628,7 +1628,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1628
1628
|
delete inner.at;
|
|
1629
1629
|
delete inner.duration;
|
|
1630
1630
|
const m = inner.mask;
|
|
1631
|
-
const carriesMatte = m !== void 0 &&
|
|
1631
|
+
const carriesMatte = m !== void 0 && chunk5IJENZOG_cjs.maskSourceOf(m).kind === "refs";
|
|
1632
1632
|
if (carriesMatte) delete inner.mask;
|
|
1633
1633
|
return {
|
|
1634
1634
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1907,8 +1907,8 @@ function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
|
1907
1907
|
let length = 0;
|
|
1908
1908
|
if (typeof kf.duration === "number") length = kf.duration;
|
|
1909
1909
|
else if (kf.duration === "auto") {
|
|
1910
|
-
const sp =
|
|
1911
|
-
length = sp ? Math.round(
|
|
1910
|
+
const sp = chunkLEECUCTG_cjs.parseSpring(kf.ease);
|
|
1911
|
+
length = sp ? Math.round(chunkLEECUCTG_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1912
1912
|
}
|
|
1913
1913
|
if (!(length > 0)) continue;
|
|
1914
1914
|
const kat = kf.at ?? 0;
|
|
@@ -1974,7 +1974,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1974
1974
|
if (motion.ever) hasMotion.add(info);
|
|
1975
1975
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1976
1976
|
const maskTarget = seq.maskSequence?.target;
|
|
1977
|
-
const maskSrc =
|
|
1977
|
+
const maskSrc = chunk5IJENZOG_cjs.maskSourceOf(seq.spec.mask);
|
|
1978
1978
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1979
1979
|
const m = maskTarget.getBounds();
|
|
1980
1980
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1983,7 +1983,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1983
1983
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1984
1984
|
if (group) scene.set(info, group);
|
|
1985
1985
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1986
|
-
if (seq instanceof
|
|
1986
|
+
if (seq instanceof chunk5IJENZOG_cjs.CompositionSequence) walk2(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero);
|
|
1987
1987
|
});
|
|
1988
1988
|
};
|
|
1989
1989
|
walk2(root, "", false, true);
|
|
@@ -2031,7 +2031,7 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
2031
2031
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
2032
2032
|
function detailOf(seq) {
|
|
2033
2033
|
const s = seq.spec;
|
|
2034
|
-
const spans =
|
|
2034
|
+
const spans = chunkLEECUCTG_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2035
2035
|
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2036
2036
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2037
2037
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
@@ -2047,10 +2047,10 @@ function walk(comp, parentStart, parentEnd, depth, prefix, rows, transitions, lo
|
|
|
2047
2047
|
const start = parentStart + (seq.at ?? 0);
|
|
2048
2048
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2049
2049
|
const span = end - start;
|
|
2050
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2050
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkLEECUCTG_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2051
2051
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2052
2052
|
const inner = [];
|
|
2053
|
-
const isComp = seq instanceof
|
|
2053
|
+
const isComp = seq instanceof chunk5IJENZOG_cjs.CompositionSequence;
|
|
2054
2054
|
if (isComp) {
|
|
2055
2055
|
const label = seq.remapLabel();
|
|
2056
2056
|
walk(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2209,7 +2209,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2209
2209
|
}
|
|
2210
2210
|
|
|
2211
2211
|
// src/core/vars.ts
|
|
2212
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2212
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkLEECUCTG_cjs.EXPRESSION_NAMES];
|
|
2213
2213
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2214
2214
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2215
2215
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2742,8 +2742,8 @@ var Movie = class {
|
|
|
2742
2742
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2743
2743
|
this._posterFrame = poster.frame;
|
|
2744
2744
|
this.background = options.background ?? "#000000";
|
|
2745
|
-
this.timeline =
|
|
2746
|
-
|
|
2745
|
+
this.timeline = chunkLEECUCTG_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2746
|
+
chunkLEECUCTG_cjs.lengthen(this.timeline, this.duration);
|
|
2747
2747
|
const baseAppOptions = {
|
|
2748
2748
|
width: this.width,
|
|
2749
2749
|
height: this.height,
|
|
@@ -2837,7 +2837,7 @@ var Movie = class {
|
|
|
2837
2837
|
height: sizeWins ? height : spec.height ?? height,
|
|
2838
2838
|
duration: spec.duration ?? this.duration
|
|
2839
2839
|
} : void 0;
|
|
2840
|
-
await
|
|
2840
|
+
await chunkLEECUCTG_cjs.ensureFilterLibrary(seededComposition);
|
|
2841
2841
|
if (chunkIMQJVRMT_cjs.usesAdvancedBlend(seededComposition)) await chunkIMQJVRMT_cjs.enableAdvancedBlend(this.app.renderer);
|
|
2842
2842
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
2843
2843
|
const rootSeqSpec = {
|
|
@@ -2848,7 +2848,7 @@ var Movie = class {
|
|
|
2848
2848
|
...userComposition
|
|
2849
2849
|
};
|
|
2850
2850
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
2851
|
-
const sequence = new
|
|
2851
|
+
const sequence = new chunk5IJENZOG_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
2852
2852
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
2853
2853
|
try {
|
|
2854
2854
|
await sequence.build();
|
|
@@ -2984,8 +2984,8 @@ var Movie = class {
|
|
|
2984
2984
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
2985
2985
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged);
|
|
2986
2986
|
alive();
|
|
2987
|
-
const timeline =
|
|
2988
|
-
|
|
2987
|
+
const timeline = chunkLEECUCTG_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2988
|
+
chunkLEECUCTG_cjs.lengthen(timeline, this.duration);
|
|
2989
2989
|
sequence.bindTimeline(timeline);
|
|
2990
2990
|
const hadSound = this.audioBuffer !== null;
|
|
2991
2991
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3627,7 +3627,7 @@ function countLayers(spec) {
|
|
|
3627
3627
|
n += 1 + countLayers(s);
|
|
3628
3628
|
const spans = s.spans;
|
|
3629
3629
|
if (Array.isArray(spans)) n += spans.length;
|
|
3630
|
-
const src =
|
|
3630
|
+
const src = chunk5IJENZOG_cjs.maskSourceOf(mask);
|
|
3631
3631
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3632
3632
|
}
|
|
3633
3633
|
return n;
|
|
@@ -3685,8 +3685,8 @@ function splitText(text, style = {}, opts = {}) {
|
|
|
3685
3685
|
|
|
3686
3686
|
// src/presets/_ease.ts
|
|
3687
3687
|
function parseEase2(name) {
|
|
3688
|
-
|
|
3689
|
-
return
|
|
3688
|
+
chunkLEECUCTG_cjs.checkEase(name, "a preset");
|
|
3689
|
+
return chunkLEECUCTG_cjs.parseEase(name);
|
|
3690
3690
|
}
|
|
3691
3691
|
|
|
3692
3692
|
// src/presets/kenBurns.ts
|
|
@@ -3821,17 +3821,17 @@ function orbit(opts) {
|
|
|
3821
3821
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
3822
3822
|
}
|
|
3823
3823
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
3824
|
-
const fixedR = opts.radius ??
|
|
3824
|
+
const fixedR = opts.radius ?? chunkLEECUCTG_cjs.homeDistance(height, fov ?? chunkLEECUCTG_cjs.DEFAULT_FOV);
|
|
3825
3825
|
const start = opts.start ?? -degrees / 2;
|
|
3826
3826
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
3827
3827
|
const easeFn = parseEase2(ease);
|
|
3828
3828
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
3829
3829
|
const pos = (i) => {
|
|
3830
3830
|
const p = i / steps;
|
|
3831
|
-
const a = (start + degrees * easeFn(p)) *
|
|
3831
|
+
const a = (start + degrees * easeFn(p)) * chunkLEECUCTG_cjs.DEG;
|
|
3832
3832
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
3833
3833
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
3834
|
-
const R =
|
|
3834
|
+
const R = chunkLEECUCTG_cjs.homeDistance(height, f);
|
|
3835
3835
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
3836
3836
|
};
|
|
3837
3837
|
const keyframes = [];
|
|
@@ -3886,7 +3886,7 @@ function particles(opts) {
|
|
|
3886
3886
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
3887
3887
|
const out = [];
|
|
3888
3888
|
for (let i = 0; i < count; i++) {
|
|
3889
|
-
const r =
|
|
3889
|
+
const r = chunkLEECUCTG_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
3890
3890
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
3891
3891
|
const born = at + r() * emit;
|
|
3892
3892
|
const lifetime = pick(life);
|
|
@@ -3899,7 +3899,7 @@ function particles(opts) {
|
|
|
3899
3899
|
const turn = spin ? pick(spin) : 0;
|
|
3900
3900
|
const startAngle = spin ? r() * 360 : 0;
|
|
3901
3901
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
3902
|
-
const n0 = sway ?
|
|
3902
|
+
const n0 = sway ? chunkLEECUCTG_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
3903
3903
|
const at_ = (t) => {
|
|
3904
3904
|
const axis = (p0, v0, acc) => {
|
|
3905
3905
|
if (drag > 0) {
|
|
@@ -3908,7 +3908,7 @@ function particles(opts) {
|
|
|
3908
3908
|
}
|
|
3909
3909
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
3910
3910
|
};
|
|
3911
|
-
const sw = sway ? swayAmp * (
|
|
3911
|
+
const sw = sway ? swayAmp * (chunkLEECUCTG_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
3912
3912
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
3913
3913
|
};
|
|
3914
3914
|
const kfs = [];
|
|
@@ -3970,7 +3970,7 @@ function followPath(opts) {
|
|
|
3970
3970
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
3971
3971
|
const segments = [];
|
|
3972
3972
|
let total = 0;
|
|
3973
|
-
for (const line of
|
|
3973
|
+
for (const line of chunkLEECUCTG_cjs.flattenSvgPath(d)) {
|
|
3974
3974
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
3975
3975
|
for (let i = 2; i < p.length; i += 2) {
|
|
3976
3976
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4124,7 +4124,7 @@ function distances(n, from, grid, seed) {
|
|
|
4124
4124
|
if (n === 0) return [];
|
|
4125
4125
|
if (from === "random") {
|
|
4126
4126
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4127
|
-
const r =
|
|
4127
|
+
const r = chunkLEECUCTG_cjs.random(seed);
|
|
4128
4128
|
for (let i = n - 1; i > 0; i--) {
|
|
4129
4129
|
const j = Math.floor(r() * (i + 1));
|
|
4130
4130
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4186,7 +4186,7 @@ function wiggle(opts) {
|
|
|
4186
4186
|
to[n] = p.around;
|
|
4187
4187
|
return;
|
|
4188
4188
|
}
|
|
4189
|
-
const off = (
|
|
4189
|
+
const off = (chunkLEECUCTG_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4190
4190
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4191
4191
|
});
|
|
4192
4192
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -4644,5 +4644,5 @@ exports.splitText = splitText;
|
|
|
4644
4644
|
exports.stagger = stagger;
|
|
4645
4645
|
exports.wiggle = wiggle;
|
|
4646
4646
|
exports.withFade = withFade;
|
|
4647
|
-
//# sourceMappingURL=chunk-
|
|
4648
|
-
//# sourceMappingURL=chunk-
|
|
4647
|
+
//# sourceMappingURL=chunk-FVZEBYLW.cjs.map
|
|
4648
|
+
//# sourceMappingURL=chunk-FVZEBYLW.cjs.map
|