pixi-effects 0.32.0 → 0.33.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 +11 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/lookup.mjs +29 -6
- package/ai/tools/pixi-effects.mjs +1 -1
- package/dist/Composition-7XNPTM7L.js +7 -0
- package/dist/{Composition-RF7QOEXT.js.map → Composition-7XNPTM7L.js.map} +1 -1
- package/dist/Composition-L6OALWHI.cjs +16 -0
- package/dist/{Composition-LNMKWXSL.cjs.map → Composition-L6OALWHI.cjs.map} +1 -1
- package/dist/{Spans-SDXABOV6.js → Spans-KPZ2QDCN.js} +6 -6
- package/dist/{Spans-SDXABOV6.js.map → Spans-KPZ2QDCN.js.map} +1 -1
- package/dist/{Spans-NQGKVMR5.cjs → Spans-VXNQXSI3.cjs} +11 -11
- package/dist/{Spans-NQGKVMR5.cjs.map → Spans-VXNQXSI3.cjs.map} +1 -1
- package/dist/{blendModes-MVRLG3T7.js → blendModes-PP5NPBXY.js} +4 -4
- package/dist/{blendModes-MVRLG3T7.js.map → blendModes-PP5NPBXY.js.map} +1 -1
- package/dist/{blendModes-VTKDXWEN.cjs → blendModes-WIUCYIMC.cjs} +5 -5
- package/dist/{blendModes-VTKDXWEN.cjs.map → blendModes-WIUCYIMC.cjs.map} +1 -1
- package/dist/{chunk-D5BFQVKL.js → chunk-BMH4OCDX.js} +5 -5
- package/dist/{chunk-D5BFQVKL.js.map → chunk-BMH4OCDX.js.map} +1 -1
- package/dist/{chunk-QHDN6TF5.cjs → chunk-BVMZUPDU.cjs} +26 -24
- package/dist/{chunk-QHDN6TF5.cjs.map → chunk-BVMZUPDU.cjs.map} +1 -1
- package/dist/{chunk-AW5NPDE4.js → chunk-E53QWHBK.js} +6 -6
- package/dist/{chunk-AW5NPDE4.js.map → chunk-E53QWHBK.js.map} +1 -1
- package/dist/{chunk-FCGYJCVO.cjs → chunk-GL2AQFLQ.cjs} +23 -5
- package/dist/chunk-GL2AQFLQ.cjs.map +1 -0
- package/dist/{chunk-Z437UWI4.cjs → chunk-IMQJVRMT.cjs} +5 -5
- package/dist/{chunk-Z437UWI4.cjs.map → chunk-IMQJVRMT.cjs.map} +1 -1
- package/dist/{chunk-C5BNHVKK.js → chunk-ITDYFBB6.js} +23 -5
- package/dist/chunk-ITDYFBB6.js.map +1 -0
- package/dist/{chunk-K3MAEKFM.cjs → chunk-LD4VKNPQ.cjs} +78 -45
- package/dist/chunk-LD4VKNPQ.cjs.map +1 -0
- package/dist/{chunk-QFNS6BFL.js → chunk-RTJD3ZSW.js} +4 -4
- package/dist/{chunk-QFNS6BFL.js.map → chunk-RTJD3ZSW.js.map} +1 -1
- package/dist/{chunk-CRUDOKSD.cjs → chunk-SBBXKPBP.cjs} +91 -91
- package/dist/{chunk-CRUDOKSD.cjs.map → chunk-SBBXKPBP.cjs.map} +1 -1
- package/dist/{chunk-FCMOREIS.js → chunk-WST432AP.js} +48 -15
- package/dist/chunk-WST432AP.js.map +1 -0
- package/dist/index.cjs +33 -33
- package/dist/index.js +5 -5
- package/dist/loader.css +1 -1
- package/dist/present.cjs +5 -5
- package/dist/present.js +5 -5
- package/dist/three.cjs +6 -6
- package/dist/three.js +2 -2
- package/docs/dsl.md +2 -0
- package/llms-full.txt +10 -5
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/pitfalls.md +3 -1
- package/skills/pixi-effects/reference/quickstart.md +3 -2
- package/skills/pixi-effects/reference/recipes.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-LNMKWXSL.cjs +0 -16
- package/dist/Composition-RF7QOEXT.js +0 -7
- package/dist/chunk-C5BNHVKK.js.map +0 -1
- package/dist/chunk-FCGYJCVO.cjs.map +0 -1
- package/dist/chunk-FCMOREIS.js.map +0 -1
- package/dist/chunk-K3MAEKFM.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGL2AQFLQ_cjs = require('./chunk-GL2AQFLQ.cjs');
|
|
4
4
|
var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
|
|
5
5
|
var PIXI = require('pixi.js');
|
|
6
6
|
|
|
@@ -2920,7 +2920,7 @@ var TextSequence = class extends Sequence {
|
|
|
2920
2920
|
{ skipKeys: STYLE_OPAQUE_KEYS }
|
|
2921
2921
|
);
|
|
2922
2922
|
const unset = Object.keys(resolved).filter((k) => resolved[k] === void 0);
|
|
2923
|
-
if (unset.length) console.warn(`pixi-effects: ${
|
|
2923
|
+
if (unset.length) console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: ${unset.map((k) => `style.${k}`).join(", ")} ${unset.length > 1 ? "are" : "is"} undefined (a variable that was never set?), so ${unset.length > 1 ? "they are" : "it is"} ignored and the default is used: omit the key instead`);
|
|
2924
2924
|
const outline = resolved.stroke;
|
|
2925
2925
|
if (outline && typeof outline === "object" && !("join" in outline) && !("lineJoin" in outline)) resolved.stroke = { ...outline, join: "round" };
|
|
2926
2926
|
for (const k of Object.keys(resolved)) {
|
|
@@ -2930,7 +2930,7 @@ var TextSequence = class extends Sequence {
|
|
|
2930
2930
|
this.intrinsicWidth = text.width;
|
|
2931
2931
|
this.intrinsicHeight = text.height;
|
|
2932
2932
|
}
|
|
2933
|
-
validateGradientKeyframes(this.spec,
|
|
2933
|
+
validateGradientKeyframes(this.spec, chunkGL2AQFLQ_cjs.describeLayer(this.spec), void 0, "text");
|
|
2934
2934
|
const gradientSpec = this.spec.fillGradient ?? initialProps.fillGradient;
|
|
2935
2935
|
if (gradientSpec) {
|
|
2936
2936
|
this._grad = { grad: gradStateFrom(gradientSpec) };
|
|
@@ -2966,7 +2966,7 @@ var TextSequence = class extends Sequence {
|
|
|
2966
2966
|
bindTextKeyframes(timeline, keyframes, this.duration, origin, () => this._template, (t) => {
|
|
2967
2967
|
this._template = t;
|
|
2968
2968
|
refresh();
|
|
2969
|
-
},
|
|
2969
|
+
}, chunkGL2AQFLQ_cjs.describeLayer(this.spec));
|
|
2970
2970
|
}
|
|
2971
2971
|
};
|
|
2972
2972
|
function runSuperWithStrippedSpec(inst, strippedSpec, timeline, offset) {
|
|
@@ -3416,7 +3416,7 @@ var CameraSequence = class extends Sequence {
|
|
|
3416
3416
|
carrier.fogColor = "#000000";
|
|
3417
3417
|
carrier.fogAmount = 1;
|
|
3418
3418
|
this.target = carrier;
|
|
3419
|
-
const keys =
|
|
3419
|
+
const keys = chunkGL2AQFLQ_cjs.collectPropKeys(this.spec);
|
|
3420
3420
|
this.autoZ = !keys.has("z");
|
|
3421
3421
|
this.dof = keys.has("focus") || keys.has("aperture");
|
|
3422
3422
|
this.fog = keys.has("fogNear") || keys.has("fogFar") || keys.has("fogColor") || keys.has("fogAmount");
|
|
@@ -3737,7 +3737,7 @@ function resolveSpansStyle(style, scope, who, warn = defaultWarn) {
|
|
|
3737
3737
|
var TEXT_ONLY = ["type", "spans", "text", "style", "format", "colorSpace", "fillGradient", "initial", "keyframes"];
|
|
3738
3738
|
var NOT_FOR_A_GROUP = ["fill", "text", "value", "fillGradient"];
|
|
3739
3739
|
function expandSpans(spec, warn = defaultWarn, scope) {
|
|
3740
|
-
const who =
|
|
3740
|
+
const who = chunkGL2AQFLQ_cjs.describeLayer(spec);
|
|
3741
3741
|
const s = spec;
|
|
3742
3742
|
if (s.text !== void 0) warn(`pixi-effects: ${who}: "text" is ignored when the layer has spans: write the text as spans`);
|
|
3743
3743
|
const style = resolveSpansStyle(s.style ?? {}, scope, who, warn);
|
|
@@ -3897,12 +3897,12 @@ var AudioSequence = class extends Sequence {
|
|
|
3897
3897
|
const playable = this._remap && this._remap.timeKfs.length > 0 ? Infinity : (data.duration ?? Infinity) / constant;
|
|
3898
3898
|
if (!spec.loop && Number.isFinite(playable) && this.duration > playable + 0.05) {
|
|
3899
3899
|
console.warn(
|
|
3900
|
-
`pixi-effects: ${
|
|
3900
|
+
`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(spec)}: audio asset "${spec.asset}" plays for ${playable.toFixed(1)}s (${data.duration.toFixed(1)}s at speed ${constant}) but the layer lasts ${this.duration.toFixed(1)}s, so it goes silent after ${playable.toFixed(1)}s. Add loop: true, or shorten the layer's duration.`
|
|
3901
3901
|
);
|
|
3902
3902
|
}
|
|
3903
3903
|
}
|
|
3904
3904
|
async _buildSfx(spec) {
|
|
3905
|
-
const who =
|
|
3905
|
+
const who = chunkGL2AQFLQ_cjs.describeLayer(spec);
|
|
3906
3906
|
const raw = spec;
|
|
3907
3907
|
if (raw.asset !== void 0) console.warn(`pixi-effects: ${who}: has both asset and sfx \u2014 the sfx plays; remove one`);
|
|
3908
3908
|
if (raw.loop) console.warn(`pixi-effects: ${who}: loop has no effect on an sfx \u2014 to repeat it, add one audio layer per hit (a JS loop)`);
|
|
@@ -3921,7 +3921,7 @@ var AudioSequence = class extends Sequence {
|
|
|
3921
3921
|
});
|
|
3922
3922
|
}
|
|
3923
3923
|
async _buildMusic(spec) {
|
|
3924
|
-
const who =
|
|
3924
|
+
const who = chunkGL2AQFLQ_cjs.describeLayer(spec);
|
|
3925
3925
|
const raw = spec;
|
|
3926
3926
|
if (raw.asset !== void 0) console.warn(`pixi-effects: ${who}: has both asset and music \u2014 the music plays; remove one`);
|
|
3927
3927
|
if (raw.sfx !== void 0) console.warn(`pixi-effects: ${who}: has both sfx and music \u2014 the music plays; remove one`);
|
|
@@ -3956,7 +3956,7 @@ var AudioSequence = class extends Sequence {
|
|
|
3956
3956
|
out.push({
|
|
3957
3957
|
...sourceMap ? { sourceMap } : {},
|
|
3958
3958
|
...this._audioBuffer ? { buffer: this._audioBuffer } : { synth: this._synth },
|
|
3959
|
-
layer:
|
|
3959
|
+
layer: chunkGL2AQFLQ_cjs.describeLayer(this.spec),
|
|
3960
3960
|
source: this._source,
|
|
3961
3961
|
...this._music ? { music: this._music } : {},
|
|
3962
3962
|
loop: !this._synth && !!this.spec.loop,
|
|
@@ -4498,7 +4498,7 @@ var VideoSequence = class extends Sequence {
|
|
|
4498
4498
|
out.push({
|
|
4499
4499
|
...sourceMap ? { sourceMap } : {},
|
|
4500
4500
|
buffer: this._audioBuffer,
|
|
4501
|
-
layer:
|
|
4501
|
+
layer: chunkGL2AQFLQ_cjs.describeLayer(this.spec),
|
|
4502
4502
|
source: `video "${this.spec.asset}"`,
|
|
4503
4503
|
loop: !!this.spec.loop,
|
|
4504
4504
|
start: baseTime + this.at,
|
|
@@ -4766,20 +4766,20 @@ var ShapeSequence = class extends Sequence {
|
|
|
4766
4766
|
for (const k of geomKeys) this._liveKeys.add(k);
|
|
4767
4767
|
seedGeometry(this._state, this.spec, scope);
|
|
4768
4768
|
seedStyle(this._state, this.spec.initial ?? {}, scope);
|
|
4769
|
-
seedStrokeStyle(this._state, this.spec, this.spec.initial ?? {},
|
|
4769
|
+
seedStrokeStyle(this._state, this.spec, this.spec.initial ?? {}, chunkGL2AQFLQ_cjs.describeLayer(this.spec));
|
|
4770
4770
|
if (this.spec.shape === "arc") {
|
|
4771
4771
|
this._state.startAngle ??= 0;
|
|
4772
4772
|
this._state.endAngle ??= 360;
|
|
4773
4773
|
const top = this.spec, ini = this.spec.initial ?? {};
|
|
4774
4774
|
if ("trimStart" in top || "trimEnd" in top || "trimStart" in ini || "trimEnd" in ini) {
|
|
4775
|
-
console.warn(`pixi-effects: ${
|
|
4775
|
+
console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: trimStart / trimEnd do not apply to an arc: animate its endAngle (and startAngle) instead`);
|
|
4776
4776
|
}
|
|
4777
4777
|
} else {
|
|
4778
4778
|
this._state.trimStart ??= 0;
|
|
4779
4779
|
this._state.trimEnd ??= 1;
|
|
4780
4780
|
}
|
|
4781
4781
|
const gradientSpec = this.spec.fillGradient ?? this.spec.initial?.fillGradient;
|
|
4782
|
-
validateGradientKeyframes(this.spec,
|
|
4782
|
+
validateGradientKeyframes(this.spec, chunkGL2AQFLQ_cjs.describeLayer(this.spec));
|
|
4783
4783
|
if (gradientSpec) {
|
|
4784
4784
|
if (hasGradientKeys(this.spec.keyframes)) {
|
|
4785
4785
|
this._grad = { grad: gradStateFrom(gradientSpec) };
|
|
@@ -4821,9 +4821,9 @@ var ShapeSequence = class extends Sequence {
|
|
|
4821
4821
|
}
|
|
4822
4822
|
/** The prepared morph between `d` and `morphTo`, or null (and a warning when the spec asked for one that cannot work). */
|
|
4823
4823
|
_setupMorph() {
|
|
4824
|
-
const who =
|
|
4824
|
+
const who = chunkGL2AQFLQ_cjs.describeLayer(this.spec);
|
|
4825
4825
|
const top = this.spec;
|
|
4826
|
-
const wanted = this.spec.shape === "path" && (this._state.morph !== void 0 ||
|
|
4826
|
+
const wanted = this.spec.shape === "path" && (this._state.morph !== void 0 || chunkGL2AQFLQ_cjs.collectPropKeys(this.spec).has("morph"));
|
|
4827
4827
|
if (this.spec.shape !== "path") {
|
|
4828
4828
|
if ("morphTo" in top) console.warn(`pixi-effects: ${who}: morphTo only works on a path shape (shape: 'path'); ignored`);
|
|
4829
4829
|
return null;
|
|
@@ -5433,7 +5433,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5433
5433
|
}
|
|
5434
5434
|
async build() {
|
|
5435
5435
|
const spec = this.shaderSpec;
|
|
5436
|
-
const who =
|
|
5436
|
+
const who = chunkGL2AQFLQ_cjs.describeLayer(spec);
|
|
5437
5437
|
for (const m of shaderProblems(spec)) console.warn(`pixi-effects: ${who}: ${m}`);
|
|
5438
5438
|
if (this.duration === void 0) this.duration = this.parent?.duration ?? this.root.duration;
|
|
5439
5439
|
const scope = buildScope(this, this.parent, this.root);
|
|
@@ -5477,7 +5477,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5477
5477
|
const warn = (why) => {
|
|
5478
5478
|
if (this.warnedPaths.has(path)) return;
|
|
5479
5479
|
this.warnedPaths.add(path);
|
|
5480
|
-
console.warn(`pixi-effects: ${
|
|
5480
|
+
console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: keyframe path uniforms.${path} ${why}; skipped`);
|
|
5481
5481
|
};
|
|
5482
5482
|
if (slot === void 0) {
|
|
5483
5483
|
const guess = chunkTWZNOUM7_cjs.suggestName(name, Object.keys(this.carrier));
|
|
@@ -5512,7 +5512,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5512
5512
|
this.failed = true;
|
|
5513
5513
|
if (!this.warnedNoGl) {
|
|
5514
5514
|
this.warnedNoGl = true;
|
|
5515
|
-
console.warn(`pixi-effects: ${
|
|
5515
|
+
console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: this browser has no WebGL2, so the shader cannot run; the layer is drawn as a checkerboard`);
|
|
5516
5516
|
}
|
|
5517
5517
|
}
|
|
5518
5518
|
compile() {
|
|
@@ -5543,7 +5543,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5543
5543
|
gl.deleteProgram(p);
|
|
5544
5544
|
this.failed = true;
|
|
5545
5545
|
this.prog = null;
|
|
5546
|
-
console.warn(`pixi-effects: ${
|
|
5546
|
+
console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: the fragment shader did not compile (the line numbers are the lines of your code):
|
|
5547
5547
|
${glslErrors(log).join("\n")}
|
|
5548
5548
|
The layer is drawn as a checkerboard until it is fixed.`);
|
|
5549
5549
|
return;
|
|
@@ -5627,13 +5627,13 @@ function resolveDim(v, scope) {
|
|
|
5627
5627
|
var _CompositionSequence = null;
|
|
5628
5628
|
async function getCompositionSequence() {
|
|
5629
5629
|
if (!_CompositionSequence) {
|
|
5630
|
-
_CompositionSequence = (await import('./Composition-
|
|
5630
|
+
_CompositionSequence = (await import('./Composition-L6OALWHI.cjs')).CompositionSequence;
|
|
5631
5631
|
}
|
|
5632
5632
|
return _CompositionSequence;
|
|
5633
5633
|
}
|
|
5634
5634
|
var _SpansSequence = null;
|
|
5635
5635
|
async function getSpansSequence() {
|
|
5636
|
-
if (!_SpansSequence) _SpansSequence = (await import('./Spans-
|
|
5636
|
+
if (!_SpansSequence) _SpansSequence = (await import('./Spans-VXNQXSI3.cjs')).SpansSequence;
|
|
5637
5637
|
return _SpansSequence;
|
|
5638
5638
|
}
|
|
5639
5639
|
var staticTypes = {
|
|
@@ -5719,6 +5719,7 @@ exports.lightLevel = lightLevel;
|
|
|
5719
5719
|
exports.noise = noise;
|
|
5720
5720
|
exports.packLights = packLights;
|
|
5721
5721
|
exports.parseEase = parseEase;
|
|
5722
|
+
exports.parseSpring = parseSpring;
|
|
5722
5723
|
exports.projectLayer = projectLayer;
|
|
5723
5724
|
exports.projectPoint = projectPoint;
|
|
5724
5725
|
exports.rand = rand;
|
|
@@ -5728,6 +5729,7 @@ exports.remapOf = remapOf;
|
|
|
5728
5729
|
exports.resolveAt = resolveAt;
|
|
5729
5730
|
exports.resolveNumber = resolveNumber;
|
|
5730
5731
|
exports.spansMeta = spansMeta;
|
|
5732
|
+
exports.springDuration = springDuration;
|
|
5731
5733
|
exports.timeRemapOf = timeRemapOf;
|
|
5732
|
-
//# sourceMappingURL=chunk-
|
|
5733
|
-
//# sourceMappingURL=chunk-
|
|
5734
|
+
//# sourceMappingURL=chunk-BVMZUPDU.cjs.map
|
|
5735
|
+
//# sourceMappingURL=chunk-BVMZUPDU.cjs.map
|