pixi-effects 0.30.1 → 0.32.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +6 -5
  3. package/ai/chat-template.html +3 -3
  4. package/ai/tools/check.mjs +42 -2
  5. package/ai/tools/render.mjs +34 -4
  6. package/ai/tools/varArgs.mjs +75 -0
  7. package/dist/{Base-Ne74ztNl.d.ts → Base-CXsMdmJB.d.ts} +1 -1
  8. package/dist/{Base-CB1_FPZD.d.cts → Base-pNq6sVGl.d.cts} +1 -1
  9. package/dist/Composition-LNMKWXSL.cjs +16 -0
  10. package/dist/{Composition-MUKR3FYD.cjs.map → Composition-LNMKWXSL.cjs.map} +1 -1
  11. package/dist/Composition-RF7QOEXT.js +7 -0
  12. package/dist/{Composition-RJGA7KDU.js.map → Composition-RF7QOEXT.js.map} +1 -1
  13. package/dist/Controller.cjs +42 -1
  14. package/dist/Controller.cjs.map +1 -1
  15. package/dist/Controller.d.cts +10 -2
  16. package/dist/Controller.d.ts +10 -2
  17. package/dist/Controller.js +42 -1
  18. package/dist/Controller.js.map +1 -1
  19. package/dist/{Movie-DdnpLpw1.d.cts → Movie-CL6SsAWe.d.cts} +90 -3
  20. package/dist/{Movie-C2rZFkrO.d.ts → Movie-f0tQG9y5.d.ts} +90 -3
  21. package/dist/Spans-NQGKVMR5.cjs +55 -0
  22. package/dist/Spans-NQGKVMR5.cjs.map +1 -0
  23. package/dist/Spans-SDXABOV6.js +53 -0
  24. package/dist/Spans-SDXABOV6.js.map +1 -0
  25. package/dist/{blendModes-RIVZXL5A.js → blendModes-MVRLG3T7.js} +4 -4
  26. package/dist/{blendModes-RIVZXL5A.js.map → blendModes-MVRLG3T7.js.map} +1 -1
  27. package/dist/{blendModes-ETMYWATF.cjs → blendModes-VTKDXWEN.cjs} +5 -5
  28. package/dist/{blendModes-ETMYWATF.cjs.map → blendModes-VTKDXWEN.cjs.map} +1 -1
  29. package/dist/{chunk-ZAXYPXKW.js → chunk-AW5NPDE4.js} +1367 -1150
  30. package/dist/chunk-AW5NPDE4.js.map +1 -0
  31. package/dist/{chunk-RCVZX2JP.js → chunk-C5BNHVKK.js} +36 -3
  32. package/dist/chunk-C5BNHVKK.js.map +1 -0
  33. package/dist/{chunk-WHNADXXG.cjs → chunk-CRUDOKSD.cjs} +91 -91
  34. package/dist/chunk-CRUDOKSD.cjs.map +1 -0
  35. package/dist/{chunk-A3Q3SDSH.js → chunk-D5BFQVKL.js} +6 -6
  36. package/dist/chunk-D5BFQVKL.js.map +1 -0
  37. package/dist/{chunk-LYOKH7KE.cjs → chunk-FCGYJCVO.cjs} +36 -3
  38. package/dist/chunk-FCGYJCVO.cjs.map +1 -0
  39. package/dist/{chunk-CRQFDY7E.js → chunk-FCMOREIS.js} +467 -58
  40. package/dist/chunk-FCMOREIS.js.map +1 -0
  41. package/dist/{chunk-HREBQAY4.cjs → chunk-K3MAEKFM.cjs} +493 -84
  42. package/dist/chunk-K3MAEKFM.cjs.map +1 -0
  43. package/dist/{chunk-4KB3GUEK.js → chunk-QFNS6BFL.js} +4 -4
  44. package/dist/{chunk-4KB3GUEK.js.map → chunk-QFNS6BFL.js.map} +1 -1
  45. package/dist/{chunk-ZVUO325O.cjs → chunk-QHDN6TF5.cjs} +1382 -1160
  46. package/dist/chunk-QHDN6TF5.cjs.map +1 -0
  47. package/dist/{chunk-2DXPTKQZ.cjs → chunk-Z437UWI4.cjs} +5 -5
  48. package/dist/{chunk-2DXPTKQZ.cjs.map → chunk-Z437UWI4.cjs.map} +1 -1
  49. package/dist/index.cjs +33 -33
  50. package/dist/index.d.cts +5 -5
  51. package/dist/index.d.ts +5 -5
  52. package/dist/index.js +5 -5
  53. package/dist/loader.css +1 -1
  54. package/dist/present.cjs +5 -5
  55. package/dist/present.d.cts +2 -2
  56. package/dist/present.d.ts +2 -2
  57. package/dist/present.js +5 -5
  58. package/dist/three.cjs +6 -6
  59. package/dist/three.d.cts +2 -2
  60. package/dist/three.d.ts +2 -2
  61. package/dist/three.js +2 -2
  62. package/dist/{types-BzIB65Vk.d.ts → types-CavnUvd5.d.cts} +28 -1
  63. package/dist/{types-BzIB65Vk.d.cts → types-CavnUvd5.d.ts} +28 -1
  64. package/docs/api.md +28 -1
  65. package/docs/dsl.md +46 -5
  66. package/llms-full.txt +136 -10
  67. package/package.json +83 -20
  68. package/skills/pixi-effects/SKILL.md +1 -1
  69. package/skills/pixi-effects/reference/cheatsheet.md +5 -2
  70. package/skills/pixi-effects/reference/pitfalls.md +5 -1
  71. package/skills/pixi-effects/reference/recipes.md +52 -0
  72. package/skills/pixi-effects/template.html +6 -6
  73. package/dist/Composition-MUKR3FYD.cjs +0 -16
  74. package/dist/Composition-RJGA7KDU.js +0 -7
  75. package/dist/chunk-A3Q3SDSH.js.map +0 -1
  76. package/dist/chunk-CRQFDY7E.js.map +0 -1
  77. package/dist/chunk-HREBQAY4.cjs.map +0 -1
  78. package/dist/chunk-LYOKH7KE.cjs.map +0 -1
  79. package/dist/chunk-RCVZX2JP.js.map +0 -1
  80. package/dist/chunk-WHNADXXG.cjs.map +0 -1
  81. package/dist/chunk-ZAXYPXKW.js.map +0 -1
  82. package/dist/chunk-ZVUO325O.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLYOKH7KE_cjs = require('./chunk-LYOKH7KE.cjs');
3
+ var chunkFCGYJCVO_cjs = require('./chunk-FCGYJCVO.cjs');
4
4
  var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
5
5
 
6
6
  // src/core/blend.ts
@@ -40,7 +40,7 @@ function usesAdvancedBlend(spec) {
40
40
  };
41
41
  return visit(spec);
42
42
  }
43
- var sayNow = (message, spec) => console.warn(`pixi-effects: ${chunkLYOKH7KE_cjs.describeLayer(spec)}: ${message}`);
43
+ var sayNow = (message, spec) => console.warn(`pixi-effects: ${chunkFCGYJCVO_cjs.describeLayer(spec)}: ${message}`);
44
44
  function blendUnavailableMessage(mode) {
45
45
  return `blendMode "${mode}" could not be set up (the blend filters are not registered); the layer is drawn normal`;
46
46
  }
@@ -85,7 +85,7 @@ function blendFilterFor(mode) {
85
85
  }
86
86
  async function enableAdvancedBlend(renderer) {
87
87
  try {
88
- const { registerBlendModes } = await import('./blendModes-ETMYWATF.cjs');
88
+ const { registerBlendModes } = await import('./blendModes-VTKDXWEN.cjs');
89
89
  registerBlendModes();
90
90
  } catch (e) {
91
91
  const why = e instanceof Error ? e.message : String(e);
@@ -137,5 +137,5 @@ exports.isAdvancedBlend = isAdvancedBlend;
137
137
  exports.maxConcurrentAdvanced = maxConcurrentAdvanced;
138
138
  exports.setBlendFilterFactory = setBlendFilterFactory;
139
139
  exports.usesAdvancedBlend = usesAdvancedBlend;
140
- //# sourceMappingURL=chunk-2DXPTKQZ.cjs.map
141
- //# sourceMappingURL=chunk-2DXPTKQZ.cjs.map
140
+ //# sourceMappingURL=chunk-Z437UWI4.cjs.map
141
+ //# sourceMappingURL=chunk-Z437UWI4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/blend.ts"],"names":["suggestName","describeLayer"],"mappings":";;;;;;AAIO,IAAM,iBAAA,GAAoB,CAAC,QAAA,EAAU,KAAA,EAAO,UAAU,UAAU,CAAA;AAEhE,IAAM,oBAAA,GAAuB;AAAA,EAClC,SAAA;AAAA,EAAW,YAAA;AAAA,EAAc,YAAA;AAAA,EAAc,aAAA;AAAA,EAAe,YAAA;AAAA,EAAc,QAAA;AAAA,EAAU,SAAA;AAAA,EAAW,YAAA;AAAA,EAAc,WAAA;AAAA,EACvG,KAAA;AAAA,EAAO,YAAA;AAAA,EAAc,OAAA;AAAA,EAAS,YAAA;AAAA,EAAc;AAC9C,CAAA;AAEO,IAAM,WAAA,GAAiC,CAAC,GAAG,iBAAA,EAAmB,GAAG,oBAAoB,CAAA;AAErF,SAAS,gBAAgB,IAAA,EAAwB;AACtD,EAAA,OAAO,OAAO,IA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AAG,CAAA,KAAM,EAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,KAAK,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAC,CAAA;AAChD,EAAA,IAAI,GAAA,GAAM,GAAG,IAAA,GAAO,CAAA;AACpB,EAAA,KAAA,MAAW,GAAG,CAAC,CAAA,IAAK,MAAA,EAAQ;AAAE,IAAA,GAAA,IAAO,CAAA;AAAG,IAAA,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,IAAA,EAAM,GAAG,CAAA;AAAA,EAAG;AACpE,EAAA,OAAO,IAAA;AACT","file":"chunk-2DXPTKQZ.cjs","sourcesContent":["import { describeLayer } from './lint';\nimport { suggestName } from './options';\n\n/** The modes Pixi draws itself (`add`, `screen`, `multiply`) and `normal`. */\nexport const BASIC_BLEND_MODES = ['normal', 'add', 'screen', 'multiply'] as const;\n/** The modes that need the backdrop: our own `BlendModeFilter`s (`src/filters/blendModes.ts`), loaded only when a movie uses one. */\nexport const ADVANCED_BLEND_MODES = [\n 'overlay', 'soft-light', 'hard-light', 'color-dodge', 'color-burn', 'darken', 'lighten', 'difference', 'exclusion',\n 'hue', 'saturation', 'color', 'luminosity', 'linear-burn',\n] as const;\n/** Every `blendMode` there is (the one table the warnings, the types and the docs check against). */\nexport const BLEND_MODES: readonly string[] = [...BASIC_BLEND_MODES, ...ADVANCED_BLEND_MODES];\n\nexport function isAdvancedBlend(mode: unknown): boolean {\n return typeof mode === 'string' && (ADVANCED_BLEND_MODES as readonly string[]).includes(mode);\n}\n\n/** Why `mode` is not a blend mode, with the likely name and the choices; null when it is one. */\nexport function blendProblem(mode: unknown): string | null {\n if (typeof mode === 'string' && BLEND_MODES.includes(mode)) return null;\n const guess = typeof mode === 'string' ? suggestName(mode, BLEND_MODES) : null;\n const shown = typeof mode === 'string' ? `\"${mode}\"` : String(mode);\n return `blendMode ${shown} is not supported${guess ? `; did you mean \"${guess}\"?` : ''} (use ${BLEND_MODES.join(', ')})`;\n}\n\n/** Does any layer of this composition (or one nested in it, or a mask layer) use an advanced blend? */\nexport function usesAdvancedBlend(spec: unknown): boolean {\n const visit = (n: unknown): boolean => {\n if (!n || typeof n !== 'object') return false;\n if (Array.isArray(n)) return n.some(visit);\n const o = n as Record<string, unknown>;\n return isAdvancedBlend(o.blendMode) || visit(o.sequences) || visit(o.mask) || visit(o.layer); // (`layer`: a mask written as { layer: <spec>, invert })\n };\n return visit(spec);\n}\n\n/** What to say about a layer's blend mode: `Composition` collects these per build, so the same mistake in 300 particle layers is said once. */\nexport type BlendReport = (message: string, spec: { name?: string; type: string }) => void;\nconst sayNow: BlendReport = (message, spec) => console.warn(`pixi-effects: ${describeLayer(spec)}: ${message}`);\n\n/** The blend filters of an advanced mode were not registered (a movie registers them in `Movie.init`, or loading them failed): the layer is drawn normal. */\nexport function blendUnavailableMessage(mode: string): string {\n return `blendMode \"${mode}\" could not be set up (the blend filters are not registered); the layer is drawn normal`;\n}\n\n/**\n * Apply a layer's `blendMode` to its display object; an unknown mode, or an advanced mode while the blend filters are not registered, says so\n * and the layer is drawn normal. Returns the blend filter it added to the layer's filter chain (the caller destroys it with the layer), if any.\n */\nexport function applyBlendMode(\n spec: { blendMode?: string; name?: string; type: string },\n display: { blendMode?: unknown; filters?: unknown },\n report: BlendReport = sayNow,\n): BlendFilterLike | null {\n const mode = spec.blendMode;\n if (mode === undefined) return null;\n const problem = blendProblem(mode);\n if (problem) { report(problem, spec); return null; }\n if (isAdvancedBlend(mode) && !blendRegistered()) { report(blendUnavailableMessage(mode), spec); return null; }\n // A container's blend mode applies INSIDE a filter's offscreen pass (against transparent black: multiply gave\n // solid black) and not to the filtered result. With filters, the pass that draws onto the backdrop is the last\n // filter's, so the mode goes there; the container stays normal.\n const filters = display.filters;\n if (Array.isArray(filters) && filters.length > 0) {\n if (isAdvancedBlend(mode)) {\n // an advanced mode is a filter of its own (it reads the backdrop): it joins the chain as the last pass\n const blend = blendFilterFor(mode);\n if (!blend) { report(blendUnavailableMessage(mode), spec); return null; }\n display.filters = [...filters, blend];\n return blend;\n }\n (filters[filters.length - 1] as { blendMode?: unknown }).blendMode = mode;\n return null;\n }\n display.blendMode = mode;\n return null;\n}\n\n/** What blend.ts needs of a blend filter (the real ones are Pixi filters; tests use plain objects). */\nexport type BlendFilterLike = { blendMode?: unknown; destroy(): void };\nlet factory: ((mode: string) => BlendFilterLike | null) | null = null;\n\n/** `filters/blendModes.ts` hands its filter maker here when it registers, so this file never imports Pixi. */\nexport function setBlendFilterFactory(f: ((mode: string) => BlendFilterLike | null) | null): void {\n factory = f;\n}\n\n/** Are the blend filters registered (a movie that uses an advanced mode registers them in `Movie.init`)? */\nexport function blendRegistered(): boolean {\n return factory !== null;\n}\n\n/** A fresh blend filter for an advanced mode, or null when the blends are not registered (or the mode is not an advanced one). */\nexport function blendFilterFor(mode: string): BlendFilterLike | null {\n return isAdvancedBlend(mode) && factory ? factory(mode) : null;\n}\n\n/**\n * Called by `Movie.init` when a layer uses an advanced mode, and only then: loads our blend filters (a separate chunk), registers them on\n * the pixi the movie runs on, and on WebGL turns the back buffer on (an advanced blend reads what is already drawn; WebGPU copies the\n * backdrop by itself, and has no such switch). A movie that uses none never reaches this, so nothing about it changes.\n */\nexport async function enableAdvancedBlend(renderer: unknown): Promise<void> {\n try {\n const { registerBlendModes } = await import('../filters/blendModes');\n registerBlendModes();\n } catch (e) {\n // a page that serves dist/index.js without its chunk, a CDN hiccup: the movie still plays, its advanced blends drawn normal\n const why = e instanceof Error ? e.message : String(e);\n console.warn(`pixi-effects: the blend filters could not be loaded (${why}); layers with an advanced blendMode are drawn normal. Serve the whole dist/ folder (the filters are the blendModes-*.js file next to index.js)`);\n return;\n }\n const bb = (renderer as { backBuffer?: { useBackBuffer: boolean } }).backBuffer;\n if (bb) bb.useBackBuffer = true;\n}\n\n/** This many layers with an advanced blend on screen at once is slow: each is a full-frame pass (measured on WebGL: about 1.5–2 ms each at 1080p). */\nexport const MANY_ADVANCED = 10;\n\ntype Counted = { at?: number; duration?: number; blendMode?: unknown; type?: string; sequences?: unknown };\n\n/** The layers a composition draws (its children each blend one by one when it has a mode): null, camera and audio layers draw nothing; nested compositions are walked. */\nfunction drawnLeaves(sequences: unknown): number {\n if (!Array.isArray(sequences)) return 0;\n let n = 0;\n for (const s of sequences as Counted[]) {\n if (!s || s.type === 'null' || s.type === 'camera' || s.type === 'audio') continue;\n n += s.type === 'composition' ? drawnLeaves(s.sequences) : 1;\n }\n return n;\n}\n\n/**\n * The full-frame passes one layer costs while it is on screen: 1 for a layer with an advanced mode; for a composition with one, one for each\n * drawn layer inside it (its children inherit the mode and blend one by one); for a composition without, the most that its own layers add\n * at one instant (a card with three blends in it, on screen with four other cards, is twelve).\n */\nfunction passesOf(l: Counted, span: number): number {\n const isComposition = l.type === 'composition';\n if (isAdvancedBlend(l.blendMode)) return isComposition ? Math.max(1, drawnLeaves(l.sequences)) : 1;\n return isComposition && Array.isArray(l.sequences) ? maxConcurrentAdvanced(l.sequences as Counted[], l.duration ?? span) : 0;\n}\n\n/** The most full-frame advanced-blend passes on screen at one instant, from the layers' `at` and `duration` (a layer with no duration lasts to the end). */\nexport function maxConcurrentAdvanced(layers: ReadonlyArray<Counted>, span: number): number {\n const events: Array<[number, number]> = [];\n for (const l of layers) {\n const w = passesOf(l, span);\n if (w === 0) continue;\n const at = l.at ?? 0;\n const end = l.duration === undefined ? span : at + l.duration;\n const start = Math.max(0, at); // a negative `at` starts before the composition: only what is after 0 is on screen\n if (end > start) events.push([start, w], [end, -w]);\n }\n events.sort((a, b) => a[0] - b[0] || a[1] - b[1]); // at one instant, the layers that end go before the ones that start\n let now = 0, most = 0;\n for (const [, d] of events) { now += d; most = Math.max(most, now); }\n return most;\n}\n"]}
1
+ {"version":3,"sources":["../src/core/blend.ts"],"names":["suggestName","describeLayer"],"mappings":";;;;;;AAIO,IAAM,iBAAA,GAAoB,CAAC,QAAA,EAAU,KAAA,EAAO,UAAU,UAAU,CAAA;AAEhE,IAAM,oBAAA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,EAAA,IAAM,CAAA;AACnB,IAAA,MAAM,MAAM,CAAA,CAAE,QAAA,KAAa,MAAA,GAAY,IAAA,GAAO,KAAK,CAAA,CAAE,QAAA;AACrD,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,EAAE,CAAA;AAC5B,IAAA,IAAI,GAAA,GAAM,KAAA,EAAO,MAAA,CAAO,IAAA,CAAK,CAAC,KAAA,EAAO,CAAC,CAAA,EAAG,CAAC,GAAA,EAAK,CAAC,CAAC,CAAC,CAAA;AAAA,EACpD;AACA,EAAA,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAM,EAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,KAAK,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAC,CAAA;AAChD,EAAA,IAAI,GAAA,GAAM,GAAG,IAAA,GAAO,CAAA;AACpB,EAAA,KAAA,MAAW,GAAG,CAAC,CAAA,IAAK,MAAA,EAAQ;AAAE,IAAA,GAAA,IAAO,CAAA;AAAG,IAAA,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,IAAA,EAAM,GAAG,CAAA;AAAA,EAAG;AACpE,EAAA,OAAO,IAAA;AACT","file":"chunk-Z437UWI4.cjs","sourcesContent":["import { describeLayer } from './lint';\nimport { suggestName } from './options';\n\n/** The modes Pixi draws itself (`add`, `screen`, `multiply`) and `normal`. */\nexport const BASIC_BLEND_MODES = ['normal', 'add', 'screen', 'multiply'] as const;\n/** The modes that need the backdrop: our own `BlendModeFilter`s (`src/filters/blendModes.ts`), loaded only when a movie uses one. */\nexport const ADVANCED_BLEND_MODES = [\n 'overlay', 'soft-light', 'hard-light', 'color-dodge', 'color-burn', 'darken', 'lighten', 'difference', 'exclusion',\n 'hue', 'saturation', 'color', 'luminosity', 'linear-burn',\n] as const;\n/** Every `blendMode` there is (the one table the warnings, the types and the docs check against). */\nexport const BLEND_MODES: readonly string[] = [...BASIC_BLEND_MODES, ...ADVANCED_BLEND_MODES];\n\nexport function isAdvancedBlend(mode: unknown): boolean {\n return typeof mode === 'string' && (ADVANCED_BLEND_MODES as readonly string[]).includes(mode);\n}\n\n/** Why `mode` is not a blend mode, with the likely name and the choices; null when it is one. */\nexport function blendProblem(mode: unknown): string | null {\n if (typeof mode === 'string' && BLEND_MODES.includes(mode)) return null;\n const guess = typeof mode === 'string' ? suggestName(mode, BLEND_MODES) : null;\n const shown = typeof mode === 'string' ? `\"${mode}\"` : String(mode);\n return `blendMode ${shown} is not supported${guess ? `; did you mean \"${guess}\"?` : ''} (use ${BLEND_MODES.join(', ')})`;\n}\n\n/** Does any layer of this composition (or one nested in it, or a mask layer) use an advanced blend? */\nexport function usesAdvancedBlend(spec: unknown): boolean {\n const visit = (n: unknown): boolean => {\n if (!n || typeof n !== 'object') return false;\n if (Array.isArray(n)) return n.some(visit);\n const o = n as Record<string, unknown>;\n return isAdvancedBlend(o.blendMode) || visit(o.sequences) || visit(o.mask) || visit(o.layer); // (`layer`: a mask written as { layer: <spec>, invert })\n };\n return visit(spec);\n}\n\n/** What to say about a layer's blend mode: `Composition` collects these per build, so the same mistake in 300 particle layers is said once. */\nexport type BlendReport = (message: string, spec: { name?: string; type: string }) => void;\nconst sayNow: BlendReport = (message, spec) => console.warn(`pixi-effects: ${describeLayer(spec)}: ${message}`);\n\n/** The blend filters of an advanced mode were not registered (a movie registers them in `Movie.init`, or loading them failed): the layer is drawn normal. */\nexport function blendUnavailableMessage(mode: string): string {\n return `blendMode \"${mode}\" could not be set up (the blend filters are not registered); the layer is drawn normal`;\n}\n\n/**\n * Apply a layer's `blendMode` to its display object; an unknown mode, or an advanced mode while the blend filters are not registered, says so\n * and the layer is drawn normal. Returns the blend filter it added to the layer's filter chain (the caller destroys it with the layer), if any.\n */\nexport function applyBlendMode(\n spec: { blendMode?: string; name?: string; type: string },\n display: { blendMode?: unknown; filters?: unknown },\n report: BlendReport = sayNow,\n): BlendFilterLike | null {\n const mode = spec.blendMode;\n if (mode === undefined) return null;\n const problem = blendProblem(mode);\n if (problem) { report(problem, spec); return null; }\n if (isAdvancedBlend(mode) && !blendRegistered()) { report(blendUnavailableMessage(mode), spec); return null; }\n // A container's blend mode applies INSIDE a filter's offscreen pass (against transparent black: multiply gave\n // solid black) and not to the filtered result. With filters, the pass that draws onto the backdrop is the last\n // filter's, so the mode goes there; the container stays normal.\n const filters = display.filters;\n if (Array.isArray(filters) && filters.length > 0) {\n if (isAdvancedBlend(mode)) {\n // an advanced mode is a filter of its own (it reads the backdrop): it joins the chain as the last pass\n const blend = blendFilterFor(mode);\n if (!blend) { report(blendUnavailableMessage(mode), spec); return null; }\n display.filters = [...filters, blend];\n return blend;\n }\n (filters[filters.length - 1] as { blendMode?: unknown }).blendMode = mode;\n return null;\n }\n display.blendMode = mode;\n return null;\n}\n\n/** What blend.ts needs of a blend filter (the real ones are Pixi filters; tests use plain objects). */\nexport type BlendFilterLike = { blendMode?: unknown; destroy(): void };\nlet factory: ((mode: string) => BlendFilterLike | null) | null = null;\n\n/** `filters/blendModes.ts` hands its filter maker here when it registers, so this file never imports Pixi. */\nexport function setBlendFilterFactory(f: ((mode: string) => BlendFilterLike | null) | null): void {\n factory = f;\n}\n\n/** Are the blend filters registered (a movie that uses an advanced mode registers them in `Movie.init`)? */\nexport function blendRegistered(): boolean {\n return factory !== null;\n}\n\n/** A fresh blend filter for an advanced mode, or null when the blends are not registered (or the mode is not an advanced one). */\nexport function blendFilterFor(mode: string): BlendFilterLike | null {\n return isAdvancedBlend(mode) && factory ? factory(mode) : null;\n}\n\n/**\n * Called by `Movie.init` when a layer uses an advanced mode, and only then: loads our blend filters (a separate chunk), registers them on\n * the pixi the movie runs on, and on WebGL turns the back buffer on (an advanced blend reads what is already drawn; WebGPU copies the\n * backdrop by itself, and has no such switch). A movie that uses none never reaches this, so nothing about it changes.\n */\nexport async function enableAdvancedBlend(renderer: unknown): Promise<void> {\n try {\n const { registerBlendModes } = await import('../filters/blendModes');\n registerBlendModes();\n } catch (e) {\n // a page that serves dist/index.js without its chunk, a CDN hiccup: the movie still plays, its advanced blends drawn normal\n const why = e instanceof Error ? e.message : String(e);\n console.warn(`pixi-effects: the blend filters could not be loaded (${why}); layers with an advanced blendMode are drawn normal. Serve the whole dist/ folder (the filters are the blendModes-*.js file next to index.js)`);\n return;\n }\n const bb = (renderer as { backBuffer?: { useBackBuffer: boolean } }).backBuffer;\n if (bb) bb.useBackBuffer = true;\n}\n\n/** This many layers with an advanced blend on screen at once is slow: each is a full-frame pass (measured on WebGL: about 1.5–2 ms each at 1080p). */\nexport const MANY_ADVANCED = 10;\n\ntype Counted = { at?: number; duration?: number; blendMode?: unknown; type?: string; sequences?: unknown };\n\n/** The layers a composition draws (its children each blend one by one when it has a mode): null, camera and audio layers draw nothing; nested compositions are walked. */\nfunction drawnLeaves(sequences: unknown): number {\n if (!Array.isArray(sequences)) return 0;\n let n = 0;\n for (const s of sequences as Counted[]) {\n if (!s || s.type === 'null' || s.type === 'camera' || s.type === 'audio') continue;\n n += s.type === 'composition' ? drawnLeaves(s.sequences) : 1;\n }\n return n;\n}\n\n/**\n * The full-frame passes one layer costs while it is on screen: 1 for a layer with an advanced mode; for a composition with one, one for each\n * drawn layer inside it (its children inherit the mode and blend one by one); for a composition without, the most that its own layers add\n * at one instant (a card with three blends in it, on screen with four other cards, is twelve).\n */\nfunction passesOf(l: Counted, span: number): number {\n const isComposition = l.type === 'composition';\n if (isAdvancedBlend(l.blendMode)) return isComposition ? Math.max(1, drawnLeaves(l.sequences)) : 1;\n return isComposition && Array.isArray(l.sequences) ? maxConcurrentAdvanced(l.sequences as Counted[], l.duration ?? span) : 0;\n}\n\n/** The most full-frame advanced-blend passes on screen at one instant, from the layers' `at` and `duration` (a layer with no duration lasts to the end). */\nexport function maxConcurrentAdvanced(layers: ReadonlyArray<Counted>, span: number): number {\n const events: Array<[number, number]> = [];\n for (const l of layers) {\n const w = passesOf(l, span);\n if (w === 0) continue;\n const at = l.at ?? 0;\n const end = l.duration === undefined ? span : at + l.duration;\n const start = Math.max(0, at); // a negative `at` starts before the composition: only what is after 0 is on screen\n if (end > start) events.push([start, w], [end, -w]);\n }\n events.sort((a, b) => a[0] - b[0] || a[1] - b[1]); // at one instant, the layers that end go before the ones that start\n let now = 0, most = 0;\n for (const [, d] of events) { now += d; most = Math.max(most, now); }\n return most;\n}\n"]}
package/dist/index.cjs CHANGED
@@ -1,125 +1,125 @@
1
1
  'use strict';
2
2
 
3
- var chunkHREBQAY4_cjs = require('./chunk-HREBQAY4.cjs');
4
- require('./chunk-WHNADXXG.cjs');
5
- var chunkZVUO325O_cjs = require('./chunk-ZVUO325O.cjs');
6
- require('./chunk-2DXPTKQZ.cjs');
7
- require('./chunk-LYOKH7KE.cjs');
3
+ var chunkK3MAEKFM_cjs = require('./chunk-K3MAEKFM.cjs');
4
+ require('./chunk-CRUDOKSD.cjs');
5
+ var chunkQHDN6TF5_cjs = require('./chunk-QHDN6TF5.cjs');
6
+ require('./chunk-Z437UWI4.cjs');
7
+ require('./chunk-FCGYJCVO.cjs');
8
8
  var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
9
9
 
10
10
 
11
11
 
12
12
  Object.defineProperty(exports, "Movie", {
13
13
  enumerable: true,
14
- get: function () { return chunkHREBQAY4_cjs.Movie; }
14
+ get: function () { return chunkK3MAEKFM_cjs.Movie; }
15
15
  });
16
16
  Object.defineProperty(exports, "animateText", {
17
17
  enumerable: true,
18
- get: function () { return chunkHREBQAY4_cjs.animateText; }
18
+ get: function () { return chunkK3MAEKFM_cjs.animateText; }
19
19
  });
20
20
  Object.defineProperty(exports, "audioEnvelope", {
21
21
  enumerable: true,
22
- get: function () { return chunkHREBQAY4_cjs.audioEnvelope; }
22
+ get: function () { return chunkK3MAEKFM_cjs.audioEnvelope; }
23
23
  });
24
24
  Object.defineProperty(exports, "bpmEnvelope", {
25
25
  enumerable: true,
26
- get: function () { return chunkHREBQAY4_cjs.bpmEnvelope; }
26
+ get: function () { return chunkK3MAEKFM_cjs.bpmEnvelope; }
27
27
  });
28
28
  Object.defineProperty(exports, "cameraPath", {
29
29
  enumerable: true,
30
- get: function () { return chunkHREBQAY4_cjs.cameraPath; }
30
+ get: function () { return chunkK3MAEKFM_cjs.cameraPath; }
31
31
  });
32
32
  Object.defineProperty(exports, "computeEnvelope", {
33
33
  enumerable: true,
34
- get: function () { return chunkHREBQAY4_cjs.computeEnvelope; }
34
+ get: function () { return chunkK3MAEKFM_cjs.computeEnvelope; }
35
35
  });
36
36
  Object.defineProperty(exports, "dismissLoader", {
37
37
  enumerable: true,
38
- get: function () { return chunkHREBQAY4_cjs.dismissLoader; }
38
+ get: function () { return chunkK3MAEKFM_cjs.dismissLoader; }
39
39
  });
40
40
  Object.defineProperty(exports, "ease", {
41
41
  enumerable: true,
42
- get: function () { return chunkHREBQAY4_cjs.parseEase; }
42
+ get: function () { return chunkK3MAEKFM_cjs.parseEase; }
43
43
  });
44
44
  Object.defineProperty(exports, "failLoader", {
45
45
  enumerable: true,
46
- get: function () { return chunkHREBQAY4_cjs.failLoader; }
46
+ get: function () { return chunkK3MAEKFM_cjs.failLoader; }
47
47
  });
48
48
  Object.defineProperty(exports, "followPath", {
49
49
  enumerable: true,
50
- get: function () { return chunkHREBQAY4_cjs.followPath; }
50
+ get: function () { return chunkK3MAEKFM_cjs.followPath; }
51
51
  });
52
52
  Object.defineProperty(exports, "kenBurns", {
53
53
  enumerable: true,
54
- get: function () { return chunkHREBQAY4_cjs.kenBurns; }
54
+ get: function () { return chunkK3MAEKFM_cjs.kenBurns; }
55
55
  });
56
56
  Object.defineProperty(exports, "measureText", {
57
57
  enumerable: true,
58
- get: function () { return chunkHREBQAY4_cjs.measureText; }
58
+ get: function () { return chunkK3MAEKFM_cjs.measureText; }
59
59
  });
60
60
  Object.defineProperty(exports, "musicBuffer", {
61
61
  enumerable: true,
62
- get: function () { return chunkHREBQAY4_cjs.musicBuffer; }
62
+ get: function () { return chunkK3MAEKFM_cjs.musicBuffer; }
63
63
  });
64
64
  Object.defineProperty(exports, "musicEnvelope", {
65
65
  enumerable: true,
66
- get: function () { return chunkHREBQAY4_cjs.musicEnvelope; }
66
+ get: function () { return chunkK3MAEKFM_cjs.musicEnvelope; }
67
67
  });
68
68
  Object.defineProperty(exports, "musicEvents", {
69
69
  enumerable: true,
70
- get: function () { return chunkHREBQAY4_cjs.musicEvents; }
70
+ get: function () { return chunkK3MAEKFM_cjs.musicEvents; }
71
71
  });
72
72
  Object.defineProperty(exports, "orbit", {
73
73
  enumerable: true,
74
- get: function () { return chunkHREBQAY4_cjs.orbit; }
74
+ get: function () { return chunkK3MAEKFM_cjs.orbit; }
75
75
  });
76
76
  Object.defineProperty(exports, "particles", {
77
77
  enumerable: true,
78
- get: function () { return chunkHREBQAY4_cjs.particles; }
78
+ get: function () { return chunkK3MAEKFM_cjs.particles; }
79
79
  });
80
80
  Object.defineProperty(exports, "react", {
81
81
  enumerable: true,
82
- get: function () { return chunkHREBQAY4_cjs.react; }
82
+ get: function () { return chunkK3MAEKFM_cjs.react; }
83
83
  });
84
84
  Object.defineProperty(exports, "resolveLoader", {
85
85
  enumerable: true,
86
- get: function () { return chunkHREBQAY4_cjs.resolveLoader; }
86
+ get: function () { return chunkK3MAEKFM_cjs.resolveLoader; }
87
87
  });
88
88
  Object.defineProperty(exports, "splitText", {
89
89
  enumerable: true,
90
- get: function () { return chunkHREBQAY4_cjs.splitText; }
90
+ get: function () { return chunkK3MAEKFM_cjs.splitText; }
91
91
  });
92
92
  Object.defineProperty(exports, "stagger", {
93
93
  enumerable: true,
94
- get: function () { return chunkHREBQAY4_cjs.stagger; }
94
+ get: function () { return chunkK3MAEKFM_cjs.stagger; }
95
95
  });
96
96
  Object.defineProperty(exports, "wiggle", {
97
97
  enumerable: true,
98
- get: function () { return chunkHREBQAY4_cjs.wiggle; }
98
+ get: function () { return chunkK3MAEKFM_cjs.wiggle; }
99
99
  });
100
100
  Object.defineProperty(exports, "withFade", {
101
101
  enumerable: true,
102
- get: function () { return chunkHREBQAY4_cjs.withFade; }
102
+ get: function () { return chunkK3MAEKFM_cjs.withFade; }
103
103
  });
104
104
  Object.defineProperty(exports, "Sequence", {
105
105
  enumerable: true,
106
- get: function () { return chunkZVUO325O_cjs.Sequence; }
106
+ get: function () { return chunkQHDN6TF5_cjs.Sequence; }
107
107
  });
108
108
  Object.defineProperty(exports, "noise", {
109
109
  enumerable: true,
110
- get: function () { return chunkZVUO325O_cjs.noise; }
110
+ get: function () { return chunkQHDN6TF5_cjs.noise; }
111
111
  });
112
112
  Object.defineProperty(exports, "rand", {
113
113
  enumerable: true,
114
- get: function () { return chunkZVUO325O_cjs.rand; }
114
+ get: function () { return chunkQHDN6TF5_cjs.rand; }
115
115
  });
116
116
  Object.defineProperty(exports, "random", {
117
117
  enumerable: true,
118
- get: function () { return chunkZVUO325O_cjs.random; }
118
+ get: function () { return chunkQHDN6TF5_cjs.random; }
119
119
  });
120
120
  Object.defineProperty(exports, "registerSequenceType", {
121
121
  enumerable: true,
122
- get: function () { return chunkZVUO325O_cjs.registerSequenceType; }
122
+ get: function () { return chunkQHDN6TF5_cjs.registerSequenceType; }
123
123
  });
124
124
  Object.defineProperty(exports, "warnUnknownOptions", {
125
125
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { M as MusicEvents } from './Movie-DdnpLpw1.cjs';
2
- export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FontReport, c as FrameEvent, I as InspectOptions, d as InspectReport, e as IssueGroup, L as LayerInfo, f as LoadProgressState, g as LoadStage, h as LoaderOption, i as MotionBlurOptions, j as MotionBlurSpec, k as Movie, l as MovieErrorEvent, m as MovieOptions, n as MusicDrumEvents, o as MusicDrumHit, p as MusicNote, q as MusicSummary, r as MusicTrackEvents, O as OnionSkinOptions, P as ProgressEvent, R as RenderOptions, s as ReviewOptions, t as ReviewReport, S as SnapshotOptions, u as SoundMeasure, T as TimelineData, v as TimelineHtmlOptions, w as TimelineRow, x as TimelineSvgOptions, y as TimelineTransition, V as VolumeEvent, z as dismissLoader, B as failLoader, D as resolveLoader } from './Movie-DdnpLpw1.cjs';
3
- import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, b as SequenceCommon } from './types-BzIB65Vk.cjs';
4
- export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioMusicSpec, f as AudioSequenceSpec, g as AudioSfxSpec, B as BlendModeName, h as ChromaKeyFilterSpec, i as CircleShapeSpec, j as CompositionSequenceSpec, k as CompositionSpec, l as CrossfadeTransition, m as CustomFilterSpec, D as DipTransition, n as DissolveTransition, E as EllipseShapeSpec, o as Expr, F as FilterSpec, G as GradientSpec, p as IrisTransition, L as LightSequenceSpec, q as LineShapeSpec, r as LumaTransition, s as MaskRefSpec, t as MatteRefSpec, u as MusicDrum, v as MusicDrums, w as MusicInstrument, x as MusicLevel, y as MusicTrack, N as NullSequenceSpec, P as PathShapeSpec, z as PolygonShapeSpec, H as PropValue, J as Props, R as RectShapeSpec, O as SfxKnobs, Q as SfxOptions, U as SfxPreset, V as SfxVoice, W as ShaderSequenceSpec, X as ShapeSequenceSpec, Y as SlideTransition, Z as Stop, _ as StopSpec, $ as TransitionCommon, a0 as TransitionSpec, a1 as VideoSequenceSpec, a2 as WipeTransition, a3 as ZoomTransition } from './types-BzIB65Vk.cjs';
5
- import { S as Sequence } from './Base-CB1_FPZD.cjs';
1
+ import { M as MusicEvents } from './Movie-CL6SsAWe.cjs';
2
+ export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FontReport, c as FrameEvent, I as InspectOptions, d as InspectReport, e as IssueGroup, L as LayerInfo, f as LoadProgressState, g as LoadStage, h as LoaderOption, i as LoopEvent, j as MotionBlurOptions, k as MotionBlurSpec, l as Movie, m as MovieErrorEvent, n as MovieOptions, o as MusicDrumEvents, p as MusicDrumHit, q as MusicNote, r as MusicSummary, s as MusicTrackEvents, O as OnionSkinOptions, P as ProgressEvent, R as RebuildOptions, t as RebuildReason, u as RebuildReport, v as RenderOptions, w as ReviewOptions, x as ReviewReport, S as SnapshotOptions, y as SoundMeasure, T as TimelineData, z as TimelineHtmlOptions, B as TimelineRow, D as TimelineSvgOptions, E as TimelineTransition, V as VolumeEvent, G as dismissLoader, H as failLoader, J as resolveLoader } from './Movie-CL6SsAWe.cjs';
3
+ import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, b as SequenceCommon } from './types-CavnUvd5.cjs';
4
+ export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioMusicSpec, f as AudioSequenceSpec, g as AudioSfxSpec, B as BlendModeName, h as ChromaKeyFilterSpec, i as CircleShapeSpec, j as CompositionSequenceSpec, k as CompositionSpec, l as CrossfadeTransition, m as CustomFilterSpec, D as DipTransition, n as DissolveTransition, E as EllipseShapeSpec, o as Expr, F as FilterSpec, G as GradientSpec, p as IrisTransition, L as LightSequenceSpec, q as LineShapeSpec, r as LumaTransition, s as MaskRefSpec, t as MatteRefSpec, u as MusicDrum, v as MusicDrums, w as MusicInstrument, x as MusicLevel, y as MusicTrack, N as NullSequenceSpec, P as PathShapeSpec, z as PolygonShapeSpec, H as PropValue, J as Props, R as RectShapeSpec, O as SfxKnobs, Q as SfxOptions, U as SfxPreset, V as SfxVoice, W as ShaderSequenceSpec, X as ShapeSequenceSpec, Y as SlideTransition, Z as Stop, _ as StopSpec, $ as TextSpan, a0 as TransitionCommon, a1 as TransitionSpec, a2 as VideoSequenceSpec, a3 as WipeTransition, a4 as ZoomTransition } from './types-CavnUvd5.cjs';
5
+ import { S as Sequence } from './Base-pNq6sVGl.cjs';
6
6
  import 'pixi.js';
7
7
 
8
8
  /** A text style as written in a `text` layer's `style` (numbers, not expressions, for the fields that size the text). */
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { M as MusicEvents } from './Movie-C2rZFkrO.js';
2
- export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FontReport, c as FrameEvent, I as InspectOptions, d as InspectReport, e as IssueGroup, L as LayerInfo, f as LoadProgressState, g as LoadStage, h as LoaderOption, i as MotionBlurOptions, j as MotionBlurSpec, k as Movie, l as MovieErrorEvent, m as MovieOptions, n as MusicDrumEvents, o as MusicDrumHit, p as MusicNote, q as MusicSummary, r as MusicTrackEvents, O as OnionSkinOptions, P as ProgressEvent, R as RenderOptions, s as ReviewOptions, t as ReviewReport, S as SnapshotOptions, u as SoundMeasure, T as TimelineData, v as TimelineHtmlOptions, w as TimelineRow, x as TimelineSvgOptions, y as TimelineTransition, V as VolumeEvent, z as dismissLoader, B as failLoader, D as resolveLoader } from './Movie-C2rZFkrO.js';
3
- import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, b as SequenceCommon } from './types-BzIB65Vk.js';
4
- export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioMusicSpec, f as AudioSequenceSpec, g as AudioSfxSpec, B as BlendModeName, h as ChromaKeyFilterSpec, i as CircleShapeSpec, j as CompositionSequenceSpec, k as CompositionSpec, l as CrossfadeTransition, m as CustomFilterSpec, D as DipTransition, n as DissolveTransition, E as EllipseShapeSpec, o as Expr, F as FilterSpec, G as GradientSpec, p as IrisTransition, L as LightSequenceSpec, q as LineShapeSpec, r as LumaTransition, s as MaskRefSpec, t as MatteRefSpec, u as MusicDrum, v as MusicDrums, w as MusicInstrument, x as MusicLevel, y as MusicTrack, N as NullSequenceSpec, P as PathShapeSpec, z as PolygonShapeSpec, H as PropValue, J as Props, R as RectShapeSpec, O as SfxKnobs, Q as SfxOptions, U as SfxPreset, V as SfxVoice, W as ShaderSequenceSpec, X as ShapeSequenceSpec, Y as SlideTransition, Z as Stop, _ as StopSpec, $ as TransitionCommon, a0 as TransitionSpec, a1 as VideoSequenceSpec, a2 as WipeTransition, a3 as ZoomTransition } from './types-BzIB65Vk.js';
5
- import { S as Sequence } from './Base-Ne74ztNl.js';
1
+ import { M as MusicEvents } from './Movie-f0tQG9y5.js';
2
+ export { A as AudioInspectOptions, a as AudioReport, b as AudioSourceReport, C as ContactSheetOptions, F as FontReport, c as FrameEvent, I as InspectOptions, d as InspectReport, e as IssueGroup, L as LayerInfo, f as LoadProgressState, g as LoadStage, h as LoaderOption, i as LoopEvent, j as MotionBlurOptions, k as MotionBlurSpec, l as Movie, m as MovieErrorEvent, n as MovieOptions, o as MusicDrumEvents, p as MusicDrumHit, q as MusicNote, r as MusicSummary, s as MusicTrackEvents, O as OnionSkinOptions, P as ProgressEvent, R as RebuildOptions, t as RebuildReason, u as RebuildReport, v as RenderOptions, w as ReviewOptions, x as ReviewReport, S as SnapshotOptions, y as SoundMeasure, T as TimelineData, z as TimelineHtmlOptions, B as TimelineRow, D as TimelineSvgOptions, E as TimelineTransition, V as VolumeEvent, G as dismissLoader, H as failLoader, J as resolveLoader } from './Movie-f0tQG9y5.js';
3
+ import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, b as SequenceCommon } from './types-CavnUvd5.js';
4
+ export { A as ArcShapeSpec, c as AssetSpec, d as AudioAssetSpec, e as AudioMusicSpec, f as AudioSequenceSpec, g as AudioSfxSpec, B as BlendModeName, h as ChromaKeyFilterSpec, i as CircleShapeSpec, j as CompositionSequenceSpec, k as CompositionSpec, l as CrossfadeTransition, m as CustomFilterSpec, D as DipTransition, n as DissolveTransition, E as EllipseShapeSpec, o as Expr, F as FilterSpec, G as GradientSpec, p as IrisTransition, L as LightSequenceSpec, q as LineShapeSpec, r as LumaTransition, s as MaskRefSpec, t as MatteRefSpec, u as MusicDrum, v as MusicDrums, w as MusicInstrument, x as MusicLevel, y as MusicTrack, N as NullSequenceSpec, P as PathShapeSpec, z as PolygonShapeSpec, H as PropValue, J as Props, R as RectShapeSpec, O as SfxKnobs, Q as SfxOptions, U as SfxPreset, V as SfxVoice, W as ShaderSequenceSpec, X as ShapeSequenceSpec, Y as SlideTransition, Z as Stop, _ as StopSpec, $ as TextSpan, a0 as TransitionCommon, a1 as TransitionSpec, a2 as VideoSequenceSpec, a3 as WipeTransition, a4 as ZoomTransition } from './types-CavnUvd5.js';
5
+ import { S as Sequence } from './Base-CXsMdmJB.js';
6
6
  import 'pixi.js';
7
7
 
8
8
  /** A text style as written in a `text` layer's `style` (numbers, not expressions, for the fields that size the text). */
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, parseEase as ease, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, particles, react, resolveLoader, splitText, stagger, wiggle, withFade } from './chunk-CRQFDY7E.js';
2
- import './chunk-A3Q3SDSH.js';
3
- export { Sequence, noise, rand, random, registerSequenceType } from './chunk-ZAXYPXKW.js';
4
- import './chunk-4KB3GUEK.js';
5
- import './chunk-RCVZX2JP.js';
1
+ export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, parseEase as ease, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, particles, react, resolveLoader, splitText, stagger, wiggle, withFade } from './chunk-FCMOREIS.js';
2
+ import './chunk-D5BFQVKL.js';
3
+ export { Sequence, noise, rand, random, registerSequenceType } from './chunk-AW5NPDE4.js';
4
+ import './chunk-QFNS6BFL.js';
5
+ import './chunk-C5BNHVKK.js';
6
6
  export { warnUnknownOptions } from './chunk-BXOCEZ4U.js';
7
7
  //# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map
package/dist/loader.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * pixi-effects loader: one line of HTML on the page, a few lines of CSS, no JavaScript of your own.
3
3
  *
4
- * <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.30.1/dist/loader.css">
4
+ * <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.32.0/dist/loader.css">
5
5
  * <div class="stage" style="position: relative"> <!-- any box the canvas sits in, with position: relative -->
6
6
  * <canvas id="stage" width="1280" height="720"></canvas>
7
7
  * <div class="pe-loader" data-label="LOADING"></div> <!-- or class="pe-loader pe-loader--bar" -->
package/dist/present.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- require('./chunk-HREBQAY4.cjs');
4
- require('./chunk-WHNADXXG.cjs');
5
- require('./chunk-ZVUO325O.cjs');
6
- require('./chunk-2DXPTKQZ.cjs');
7
- require('./chunk-LYOKH7KE.cjs');
3
+ require('./chunk-K3MAEKFM.cjs');
4
+ require('./chunk-CRUDOKSD.cjs');
5
+ require('./chunk-QHDN6TF5.cjs');
6
+ require('./chunk-Z437UWI4.cjs');
7
+ require('./chunk-FCGYJCVO.cjs');
8
8
  var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
9
9
 
10
10
  // src/present/stops.ts
@@ -1,5 +1,5 @@
1
- import { k as Movie, j as MotionBlurSpec } from './Movie-DdnpLpw1.cjs';
2
- import { S as SequenceSpec, J as Props, K as Keyframe, a0 as TransitionSpec, k as CompositionSpec, Z as Stop } from './types-BzIB65Vk.cjs';
1
+ import { l as Movie, k as MotionBlurSpec } from './Movie-CL6SsAWe.cjs';
2
+ import { S as SequenceSpec, J as Props, K as Keyframe, a1 as TransitionSpec, k as CompositionSpec, Z as Stop } from './types-CavnUvd5.cjs';
3
3
  import 'pixi.js';
4
4
 
5
5
  interface PresenterOptions {
package/dist/present.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { k as Movie, j as MotionBlurSpec } from './Movie-C2rZFkrO.js';
2
- import { S as SequenceSpec, J as Props, K as Keyframe, a0 as TransitionSpec, k as CompositionSpec, Z as Stop } from './types-BzIB65Vk.js';
1
+ import { l as Movie, k as MotionBlurSpec } from './Movie-f0tQG9y5.js';
2
+ import { S as SequenceSpec, J as Props, K as Keyframe, a1 as TransitionSpec, k as CompositionSpec, Z as Stop } from './types-CavnUvd5.js';
3
3
  import 'pixi.js';
4
4
 
5
5
  interface PresenterOptions {
package/dist/present.js CHANGED
@@ -1,8 +1,8 @@
1
- import './chunk-CRQFDY7E.js';
2
- import './chunk-A3Q3SDSH.js';
3
- import './chunk-ZAXYPXKW.js';
4
- import './chunk-4KB3GUEK.js';
5
- import './chunk-RCVZX2JP.js';
1
+ import './chunk-FCMOREIS.js';
2
+ import './chunk-D5BFQVKL.js';
3
+ import './chunk-AW5NPDE4.js';
4
+ import './chunk-QFNS6BFL.js';
5
+ import './chunk-C5BNHVKK.js';
6
6
  import { warnUnknownOptions } from './chunk-BXOCEZ4U.js';
7
7
 
8
8
  // src/present/stops.ts
package/dist/three.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkZVUO325O_cjs = require('./chunk-ZVUO325O.cjs');
4
- require('./chunk-LYOKH7KE.cjs');
3
+ var chunkQHDN6TF5_cjs = require('./chunk-QHDN6TF5.cjs');
4
+ require('./chunk-FCGYJCVO.cjs');
5
5
  require('./chunk-TWZNOUM7.cjs');
6
6
  var pixi_js = require('pixi.js');
7
7
  var three$1 = require('three');
8
8
 
9
- var ThreeSequence = class extends chunkZVUO325O_cjs.Sequence {
9
+ var ThreeSequence = class extends chunkQHDN6TF5_cjs.Sequence {
10
10
  _renderer = null;
11
11
  _scene = null;
12
12
  _camera = null;
@@ -25,7 +25,7 @@ var ThreeSequence = class extends chunkZVUO325O_cjs.Sequence {
25
25
  if (this.duration === void 0) {
26
26
  this.duration = this.parent?.duration ?? this.root.duration;
27
27
  }
28
- const scope = chunkZVUO325O_cjs.buildScope(this, this.parent, this.root);
28
+ const scope = chunkQHDN6TF5_cjs.buildScope(this, this.parent, this.root);
29
29
  const width = resolveDim(spec.width, scope) ?? this.parent?.width ?? this.root.width;
30
30
  const height = resolveDim(spec.height, scope) ?? this.parent?.height ?? this.root.height;
31
31
  const resolution = spec.resolution ?? 1;
@@ -145,12 +145,12 @@ var ThreeSequence = class extends chunkZVUO325O_cjs.Sequence {
145
145
  function resolveDim(v, scope) {
146
146
  if (v === void 0) return void 0;
147
147
  if (typeof v === "number") return v;
148
- return chunkZVUO325O_cjs.evaluateExpr(v, scope);
148
+ return chunkQHDN6TF5_cjs.evaluateExpr(v, scope);
149
149
  }
150
150
 
151
151
  // src/three/index.ts
152
152
  function registerThree() {
153
- chunkZVUO325O_cjs.registerSequenceType("three", ThreeSequence);
153
+ chunkQHDN6TF5_cjs.registerSequenceType("three", ThreeSequence);
154
154
  }
155
155
  function three(spec) {
156
156
  return spec;
package/dist/three.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { b as SequenceCommon, H as PropValue, S as SequenceSpec } from './types-BzIB65Vk.cjs';
1
+ import { b as SequenceCommon, H as PropValue, S as SequenceSpec } from './types-CavnUvd5.cjs';
2
2
  import { Scene, Camera, WebGLRenderer } from 'three';
3
- import { S as Sequence, P as PathRouters } from './Base-CB1_FPZD.cjs';
3
+ import { S as Sequence, P as PathRouters } from './Base-pNq6sVGl.cjs';
4
4
  import 'pixi.js';
5
5
 
6
6
  /** Handed to setup / update / dispose. One per three sequence. */
package/dist/three.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { b as SequenceCommon, H as PropValue, S as SequenceSpec } from './types-BzIB65Vk.js';
1
+ import { b as SequenceCommon, H as PropValue, S as SequenceSpec } from './types-CavnUvd5.js';
2
2
  import { Scene, Camera, WebGLRenderer } from 'three';
3
- import { S as Sequence, P as PathRouters } from './Base-Ne74ztNl.js';
3
+ import { S as Sequence, P as PathRouters } from './Base-CXsMdmJB.js';
4
4
  import 'pixi.js';
5
5
 
6
6
  /** Handed to setup / update / dispose. One per three sequence. */
package/dist/three.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Sequence, buildScope, evaluateExpr, registerSequenceType } from './chunk-ZAXYPXKW.js';
2
- import './chunk-RCVZX2JP.js';
1
+ import { Sequence, buildScope, evaluateExpr, registerSequenceType } from './chunk-AW5NPDE4.js';
2
+ import './chunk-C5BNHVKK.js';
3
3
  import './chunk-BXOCEZ4U.js';
4
4
  import { Texture, Sprite } from 'pixi.js';
5
5
  import { WebGLRenderer, Scene, PerspectiveCamera } from 'three';
@@ -293,6 +293,23 @@ interface ImageSequenceSpec extends SequenceCommon {
293
293
  */
294
294
  colorSpace?: 'rgb' | 'oklab' | 'oklch';
295
295
  }
296
+ /**
297
+ * One piece of a text layer's `spans`: its text and what it changes of the layer's `style`: only what keeps the baseline (colours, weight, slant,
298
+ * letter spacing, a shadow). `\n` in `text` starts a new line. A size, a font or a line height belongs to the layer's `style`.
299
+ */
300
+ interface TextSpan {
301
+ text: string;
302
+ fill?: string | number;
303
+ stroke?: string | {
304
+ color?: PropValue;
305
+ width?: PropValue;
306
+ };
307
+ fontWeight?: string | number;
308
+ fontStyle?: 'normal' | 'italic' | 'oblique';
309
+ fontVariant?: string;
310
+ letterSpacing?: number;
311
+ dropShadow?: boolean | Record<string, PropValue>;
312
+ }
296
313
  interface TextSequenceSpec extends SequenceCommon {
297
314
  type: 'text';
298
315
  /**
@@ -305,6 +322,14 @@ interface TextSequenceSpec extends SequenceCommon {
305
322
  * (a typewriter): `initial: { visibleChars: 0 }`, keyframe `to: { visibleChars: 20 }`. It starts at 0 once it is animated.
306
323
  */
307
324
  text?: string;
325
+ /**
326
+ * Colour and style inside ONE text layer, written instead of `text`: an array of strings (the layer's own `style`) and `{ text, fill, fontWeight … }`
327
+ * objects, shown one after the other (`\n` starts a new line): `spans: [{ text: 'type', fill: '#7fa07f' }, ': ', { text: "'text'", fill: '#ffd166' }]`.
328
+ * At build time the layer becomes a group of plain text layers, so `name`, `at`, `duration`, `initial` (`anchorX` / `anchorY` too), `keyframes`
329
+ * (`x`, `y`, `alpha`, `scale`, `rotation`, `visibleChars` for a typewriter over all the spans), `filters`, `mask` and `blendMode` work as on a text.
330
+ * `style.align` places the lines (default `'center'`, like every text). Measuring needs the fonts loaded (`await document.fonts.load(...)`).
331
+ */
332
+ spans?: Array<string | TextSpan>;
308
333
  /** How `{value}` is printed: `decimals` (default 0) and thousands `grouping` (default false). */
309
334
  format?: {
310
335
  decimals?: number;
@@ -692,6 +717,8 @@ interface CompositionShape {
692
717
  frameRate?: number;
693
718
  /** Called after each layer is built (the root shape only): feeds `loadprogress` and lets the page paint now and then. */
694
719
  onLayerBuilt?: () => void | Promise<void>;
720
+ /** The numbers declared as variables (`movie.init({ vars })`), on the root shape only: an expression reads them as identifiers. */
721
+ vars?: Record<string, number>;
695
722
  }
696
723
 
697
- export type { TransitionCommon as $, ArcShapeSpec as A, BlendModeName as B, CompositionShape as C, DipTransition as D, EllipseShapeSpec as E, FilterSpec as F, GradientSpec as G, PropValue as H, ImageSequenceSpec as I, Props as J, Keyframe as K, LightSequenceSpec as L, MusicOptions as M, NullSequenceSpec as N, SfxKnobs as O, PathShapeSpec as P, SfxOptions as Q, RectShapeSpec as R, SequenceSpec as S, TextSequenceSpec as T, SfxPreset as U, SfxVoice as V, ShaderSequenceSpec as W, ShapeSequenceSpec as X, SlideTransition as Y, Stop as Z, StopSpec as _, CameraSequenceSpec as a, TransitionSpec as a0, VideoSequenceSpec as a1, WipeTransition as a2, ZoomTransition as a3, SequenceCommon as b, AssetSpec as c, AudioAssetSpec as d, AudioMusicSpec as e, AudioSequenceSpec as f, AudioSfxSpec as g, ChromaKeyFilterSpec as h, CircleShapeSpec as i, CompositionSequenceSpec as j, CompositionSpec as k, CrossfadeTransition as l, CustomFilterSpec as m, DissolveTransition as n, Expr as o, IrisTransition as p, LineShapeSpec as q, LumaTransition as r, MaskRefSpec as s, MatteRefSpec as t, MusicDrum as u, MusicDrums as v, MusicInstrument as w, MusicLevel as x, MusicTrack as y, PolygonShapeSpec as z };
724
+ export type { TextSpan as $, ArcShapeSpec as A, BlendModeName as B, CompositionShape as C, DipTransition as D, EllipseShapeSpec as E, FilterSpec as F, GradientSpec as G, PropValue as H, ImageSequenceSpec as I, Props as J, Keyframe as K, LightSequenceSpec as L, MusicOptions as M, NullSequenceSpec as N, SfxKnobs as O, PathShapeSpec as P, SfxOptions as Q, RectShapeSpec as R, SequenceSpec as S, TextSequenceSpec as T, SfxPreset as U, SfxVoice as V, ShaderSequenceSpec as W, ShapeSequenceSpec as X, SlideTransition as Y, Stop as Z, StopSpec as _, CameraSequenceSpec as a, TransitionCommon as a0, TransitionSpec as a1, VideoSequenceSpec as a2, WipeTransition as a3, ZoomTransition as a4, SequenceCommon as b, AssetSpec as c, AudioAssetSpec as d, AudioMusicSpec as e, AudioSequenceSpec as f, AudioSfxSpec as g, ChromaKeyFilterSpec as h, CircleShapeSpec as i, CompositionSequenceSpec as j, CompositionSpec as k, CrossfadeTransition as l, CustomFilterSpec as m, DissolveTransition as n, Expr as o, IrisTransition as p, LineShapeSpec as q, LumaTransition as r, MaskRefSpec as s, MatteRefSpec as t, MusicDrum as u, MusicDrums as v, MusicInstrument as w, MusicLevel as x, MusicTrack as y, PolygonShapeSpec as z };
@@ -293,6 +293,23 @@ interface ImageSequenceSpec extends SequenceCommon {
293
293
  */
294
294
  colorSpace?: 'rgb' | 'oklab' | 'oklch';
295
295
  }
296
+ /**
297
+ * One piece of a text layer's `spans`: its text and what it changes of the layer's `style`: only what keeps the baseline (colours, weight, slant,
298
+ * letter spacing, a shadow). `\n` in `text` starts a new line. A size, a font or a line height belongs to the layer's `style`.
299
+ */
300
+ interface TextSpan {
301
+ text: string;
302
+ fill?: string | number;
303
+ stroke?: string | {
304
+ color?: PropValue;
305
+ width?: PropValue;
306
+ };
307
+ fontWeight?: string | number;
308
+ fontStyle?: 'normal' | 'italic' | 'oblique';
309
+ fontVariant?: string;
310
+ letterSpacing?: number;
311
+ dropShadow?: boolean | Record<string, PropValue>;
312
+ }
296
313
  interface TextSequenceSpec extends SequenceCommon {
297
314
  type: 'text';
298
315
  /**
@@ -305,6 +322,14 @@ interface TextSequenceSpec extends SequenceCommon {
305
322
  * (a typewriter): `initial: { visibleChars: 0 }`, keyframe `to: { visibleChars: 20 }`. It starts at 0 once it is animated.
306
323
  */
307
324
  text?: string;
325
+ /**
326
+ * Colour and style inside ONE text layer, written instead of `text`: an array of strings (the layer's own `style`) and `{ text, fill, fontWeight … }`
327
+ * objects, shown one after the other (`\n` starts a new line): `spans: [{ text: 'type', fill: '#7fa07f' }, ': ', { text: "'text'", fill: '#ffd166' }]`.
328
+ * At build time the layer becomes a group of plain text layers, so `name`, `at`, `duration`, `initial` (`anchorX` / `anchorY` too), `keyframes`
329
+ * (`x`, `y`, `alpha`, `scale`, `rotation`, `visibleChars` for a typewriter over all the spans), `filters`, `mask` and `blendMode` work as on a text.
330
+ * `style.align` places the lines (default `'center'`, like every text). Measuring needs the fonts loaded (`await document.fonts.load(...)`).
331
+ */
332
+ spans?: Array<string | TextSpan>;
308
333
  /** How `{value}` is printed: `decimals` (default 0) and thousands `grouping` (default false). */
309
334
  format?: {
310
335
  decimals?: number;
@@ -692,6 +717,8 @@ interface CompositionShape {
692
717
  frameRate?: number;
693
718
  /** Called after each layer is built (the root shape only): feeds `loadprogress` and lets the page paint now and then. */
694
719
  onLayerBuilt?: () => void | Promise<void>;
720
+ /** The numbers declared as variables (`movie.init({ vars })`), on the root shape only: an expression reads them as identifiers. */
721
+ vars?: Record<string, number>;
695
722
  }
696
723
 
697
- export type { TransitionCommon as $, ArcShapeSpec as A, BlendModeName as B, CompositionShape as C, DipTransition as D, EllipseShapeSpec as E, FilterSpec as F, GradientSpec as G, PropValue as H, ImageSequenceSpec as I, Props as J, Keyframe as K, LightSequenceSpec as L, MusicOptions as M, NullSequenceSpec as N, SfxKnobs as O, PathShapeSpec as P, SfxOptions as Q, RectShapeSpec as R, SequenceSpec as S, TextSequenceSpec as T, SfxPreset as U, SfxVoice as V, ShaderSequenceSpec as W, ShapeSequenceSpec as X, SlideTransition as Y, Stop as Z, StopSpec as _, CameraSequenceSpec as a, TransitionSpec as a0, VideoSequenceSpec as a1, WipeTransition as a2, ZoomTransition as a3, SequenceCommon as b, AssetSpec as c, AudioAssetSpec as d, AudioMusicSpec as e, AudioSequenceSpec as f, AudioSfxSpec as g, ChromaKeyFilterSpec as h, CircleShapeSpec as i, CompositionSequenceSpec as j, CompositionSpec as k, CrossfadeTransition as l, CustomFilterSpec as m, DissolveTransition as n, Expr as o, IrisTransition as p, LineShapeSpec as q, LumaTransition as r, MaskRefSpec as s, MatteRefSpec as t, MusicDrum as u, MusicDrums as v, MusicInstrument as w, MusicLevel as x, MusicTrack as y, PolygonShapeSpec as z };
724
+ export type { TextSpan as $, ArcShapeSpec as A, BlendModeName as B, CompositionShape as C, DipTransition as D, EllipseShapeSpec as E, FilterSpec as F, GradientSpec as G, PropValue as H, ImageSequenceSpec as I, Props as J, Keyframe as K, LightSequenceSpec as L, MusicOptions as M, NullSequenceSpec as N, SfxKnobs as O, PathShapeSpec as P, SfxOptions as Q, RectShapeSpec as R, SequenceSpec as S, TextSequenceSpec as T, SfxPreset as U, SfxVoice as V, ShaderSequenceSpec as W, ShapeSequenceSpec as X, SlideTransition as Y, Stop as Z, StopSpec as _, CameraSequenceSpec as a, TransitionCommon as a0, TransitionSpec as a1, VideoSequenceSpec as a2, WipeTransition as a3, ZoomTransition as a4, SequenceCommon as b, AssetSpec as c, AudioAssetSpec as d, AudioMusicSpec as e, AudioSequenceSpec as f, AudioSfxSpec as g, ChromaKeyFilterSpec as h, CircleShapeSpec as i, CompositionSequenceSpec as j, CompositionSpec as k, CrossfadeTransition as l, CustomFilterSpec as m, DissolveTransition as n, Expr as o, IrisTransition as p, LineShapeSpec as q, LumaTransition as r, MaskRefSpec as s, MatteRefSpec as t, MusicDrum as u, MusicDrums as v, MusicInstrument as w, MusicLevel as x, MusicTrack as y, PolygonShapeSpec as z };