pixi-effects 0.48.0 → 0.48.1

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +5 -5
  3. package/ai/chat-template.html +3 -3
  4. package/dist/Composition-BOLWGT2R.js +7 -0
  5. package/dist/{Composition-ZCRJHBB5.js.map → Composition-BOLWGT2R.js.map} +1 -1
  6. package/dist/Composition-ZZEOEETS.cjs +16 -0
  7. package/dist/{Composition-PMWLJQPI.cjs.map → Composition-ZZEOEETS.cjs.map} +1 -1
  8. package/dist/{Spans-KTUPDFSR.cjs → Spans-MWYFG7RI.cjs} +9 -9
  9. package/dist/{Spans-KTUPDFSR.cjs.map → Spans-MWYFG7RI.cjs.map} +1 -1
  10. package/dist/{Spans-FMAVPATS.js → Spans-PGXRMD6J.js} +4 -4
  11. package/dist/{Spans-FMAVPATS.js.map → Spans-PGXRMD6J.js.map} +1 -1
  12. package/dist/{chunk-UI7CEUTP.js → chunk-AJWUCFGM.js} +3 -3
  13. package/dist/{chunk-UI7CEUTP.js.map → chunk-AJWUCFGM.js.map} +1 -1
  14. package/dist/{chunk-GX2WQV4A.js → chunk-IY5YTIK3.js} +15 -10
  15. package/dist/chunk-IY5YTIK3.js.map +1 -0
  16. package/dist/{chunk-4PYVHLIK.js → chunk-L3MEZZAV.js} +17 -14
  17. package/dist/chunk-L3MEZZAV.js.map +1 -0
  18. package/dist/{chunk-NGK4E536.cjs → chunk-L3XC464G.cjs} +56 -51
  19. package/dist/chunk-L3XC464G.cjs.map +1 -0
  20. package/dist/{chunk-OGLRSR6C.cjs → chunk-M2LFQY2E.cjs} +63 -63
  21. package/dist/{chunk-OGLRSR6C.cjs.map → chunk-M2LFQY2E.cjs.map} +1 -1
  22. package/dist/{chunk-ECLBZV4N.cjs → chunk-V3VBHSK6.cjs} +17 -14
  23. package/dist/chunk-V3VBHSK6.cjs.map +1 -0
  24. package/dist/index.cjs +33 -33
  25. package/dist/index.js +3 -3
  26. package/dist/loader.css +1 -1
  27. package/dist/present.cjs +3 -3
  28. package/dist/present.js +3 -3
  29. package/dist/three.cjs +5 -5
  30. package/dist/three.js +1 -1
  31. package/llms-full.txt +2 -2
  32. package/package.json +1 -1
  33. package/skills/pixi-effects/SKILL.md +1 -1
  34. package/skills/pixi-effects/reference/pitfalls.md +1 -1
  35. package/skills/pixi-effects/template.html +6 -6
  36. package/dist/Composition-PMWLJQPI.cjs +0 -16
  37. package/dist/Composition-ZCRJHBB5.js +0 -7
  38. package/dist/chunk-4PYVHLIK.js.map +0 -1
  39. package/dist/chunk-ECLBZV4N.cjs.map +0 -1
  40. package/dist/chunk-GX2WQV4A.js.map +0 -1
  41. package/dist/chunk-NGK4E536.cjs.map +0 -1
@@ -2267,11 +2267,11 @@ function registerFilterLibrary(mod) {
2267
2267
  if (key.endsWith("Filter") && typeof value === "function") library.set(lower(key.slice(0, -"Filter".length)), value);
2268
2268
  }
2269
2269
  }
2270
- var MISSING = (type, why) => new Error(
2271
- `pixi-effects: the filter "${type}" comes from the pixi-filters package${why ? ` (${why})` : ""}. Add it to your import map ("pixi-filters": "https://esm.sh/pixi-filters@6.1.5?external=pixi.js") or run \`npm i pixi-filters\`.`
2270
+ var MISSING = (what, why, many = false) => new Error(
2271
+ `pixi-effects: the ${many ? "filters" : "filter"} ${what} ${many ? "come" : "comes"} from the pixi-filters package${why ? ` (${why})` : ""}. Add it to your import map ("pixi-filters": "https://esm.sh/pixi-filters@6.1.5?external=pixi.js") or run \`npm i pixi-filters\`.`
2272
2272
  );
2273
- function needsFilterLibrary(spec) {
2274
- let needs = false;
2273
+ function libraryFilters(spec) {
2274
+ const found = /* @__PURE__ */ new Map();
2275
2275
  const visit = (node) => {
2276
2276
  if (!node || typeof node !== "object") return;
2277
2277
  if (Array.isArray(node)) {
@@ -2282,21 +2282,24 @@ function needsFilterLibrary(spec) {
2282
2282
  if (Array.isArray(o.filters)) {
2283
2283
  for (const f of o.filters) {
2284
2284
  if (typeof f?.type !== "string" || !isNamedFilterType(f.type)) continue;
2285
- if (isLibraryType(f.type)) needs = true;
2286
- else if (!isCoreType(f.type)) throw unknownType(f.type);
2285
+ if (isLibraryType(f.type)) {
2286
+ if (!found.get(f.type)) found.set(f.type, typeof o.name === "string" && o.name ? o.name : void 0);
2287
+ } else if (!isCoreType(f.type)) throw unknownType(f.type);
2287
2288
  }
2288
2289
  }
2289
2290
  for (const key of ["sequences", "mask", "layer"]) visit(o[key]);
2290
2291
  };
2291
2292
  visit(spec);
2292
- return needs;
2293
+ return found;
2293
2294
  }
2294
2295
  async function ensureFilterLibrary(spec, load = () => import('pixi-filters')) {
2295
- if (!needsFilterLibrary(spec) || library) return;
2296
+ const used = libraryFilters(spec);
2297
+ if (!used.size || library) return;
2296
2298
  try {
2297
2299
  registerFilterLibrary(await load());
2298
2300
  } catch (e) {
2299
- throw MISSING("(see the type in your filters)", e.message);
2301
+ const what = [...used].map(([type, layer]) => `"${type}"${layer ? ` (layer "${layer}")` : ""}`).join(", ");
2302
+ throw MISSING(what, e.message, used.size > 1);
2300
2303
  }
2301
2304
  }
2302
2305
  var SINGLE_VALUE = { pixelate: "size", emboss: "strength" };
@@ -2346,7 +2349,7 @@ function createNamedFilter(type, params) {
2346
2349
  if (core) return new PIXI__namespace[core[1]](params);
2347
2350
  if (!isLibraryType(type)) throw unknownType(type);
2348
2351
  const Ctor = library?.get(lower(type));
2349
- if (!Ctor) throw MISSING(type, library ? "not found in the loaded package" : "not loaded yet");
2352
+ if (!Ctor) throw MISSING(`"${type}"`, library ? "not found in the loaded package" : "not loaded yet");
2350
2353
  const single = SINGLE_VALUE[Object.keys(SINGLE_VALUE).find((k) => lower(k) === lower(type)) ?? ""];
2351
2354
  if (single) return new Ctor(params[single]);
2352
2355
  const made = new Ctor(lower(type) === "colorgradient" ? colorGradientParams(params) : params);
@@ -6090,13 +6093,13 @@ var CanvasSequence = class extends Sequence {
6090
6093
  var _CompositionSequence = null;
6091
6094
  async function getCompositionSequence() {
6092
6095
  if (!_CompositionSequence) {
6093
- _CompositionSequence = (await import('./Composition-PMWLJQPI.cjs')).CompositionSequence;
6096
+ _CompositionSequence = (await import('./Composition-ZZEOEETS.cjs')).CompositionSequence;
6094
6097
  }
6095
6098
  return _CompositionSequence;
6096
6099
  }
6097
6100
  var _SpansSequence = null;
6098
6101
  async function getSpansSequence() {
6099
- if (!_SpansSequence) _SpansSequence = (await import('./Spans-KTUPDFSR.cjs')).SpansSequence;
6102
+ if (!_SpansSequence) _SpansSequence = (await import('./Spans-MWYFG7RI.cjs')).SpansSequence;
6100
6103
  return _SpansSequence;
6101
6104
  }
6102
6105
  var staticTypes = {
@@ -6196,5 +6199,5 @@ exports.spansMeta = spansMeta;
6196
6199
  exports.springDuration = springDuration;
6197
6200
  exports.timeRemapOf = timeRemapOf;
6198
6201
  exports.trimPolylines = trimPolylines;
6199
- //# sourceMappingURL=chunk-ECLBZV4N.cjs.map
6200
- //# sourceMappingURL=chunk-ECLBZV4N.cjs.map
6202
+ //# sourceMappingURL=chunk-V3VBHSK6.cjs.map
6203
+ //# sourceMappingURL=chunk-V3VBHSK6.cjs.map