pixi-effects 0.45.0 → 0.46.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 (60) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +5 -5
  3. package/ai/chat-template.html +3 -3
  4. package/dist/Composition-NSY7A32Y.js +7 -0
  5. package/dist/{Composition-YGBQX3HZ.js.map → Composition-NSY7A32Y.js.map} +1 -1
  6. package/dist/Composition-PME3P5LP.cjs +16 -0
  7. package/dist/{Composition-N6BOROJ2.cjs.map → Composition-PME3P5LP.cjs.map} +1 -1
  8. package/dist/Controller.d.cts +2 -2
  9. package/dist/Controller.d.ts +2 -2
  10. package/dist/{Movie-C-d4zN-N.d.cts → Movie-BqrAWN0g.d.cts} +6 -1
  11. package/dist/{Movie-lMSS9JwX.d.ts → Movie-sV8nJr_f.d.ts} +6 -1
  12. package/dist/{Spans-XTIWYSNO.cjs → Spans-2TZCNREQ.cjs} +9 -9
  13. package/dist/{Spans-XTIWYSNO.cjs.map → Spans-2TZCNREQ.cjs.map} +1 -1
  14. package/dist/{Spans-6L2ZVECX.js → Spans-TESJPQKX.js} +4 -4
  15. package/dist/{Spans-6L2ZVECX.js.map → Spans-TESJPQKX.js.map} +1 -1
  16. package/dist/{chunk-Z6JQO7GX.js → chunk-2E74SP63.js} +47 -13
  17. package/dist/chunk-2E74SP63.js.map +1 -0
  18. package/dist/{chunk-3IO5RWE4.cjs → chunk-7M63Y6MO.cjs} +85 -51
  19. package/dist/chunk-7M63Y6MO.cjs.map +1 -0
  20. package/dist/{chunk-3HZV3UHU.cjs → chunk-DKCMJILW.cjs} +67 -65
  21. package/dist/chunk-DKCMJILW.cjs.map +1 -0
  22. package/dist/{chunk-4QVQ5UJJ.js → chunk-DM2OLQOJ.js} +5 -6
  23. package/dist/chunk-DM2OLQOJ.js.map +1 -0
  24. package/dist/{chunk-ICI6ACHY.js → chunk-FPV3NPYC.js} +8 -6
  25. package/dist/chunk-FPV3NPYC.js.map +1 -0
  26. package/dist/{chunk-X62H3RBG.cjs → chunk-LALEBV63.cjs} +5 -6
  27. package/dist/chunk-LALEBV63.cjs.map +1 -0
  28. package/dist/index.cjs +33 -33
  29. package/dist/index.d.cts +3 -3
  30. package/dist/index.d.ts +3 -3
  31. package/dist/index.js +3 -3
  32. package/dist/loader.css +1 -1
  33. package/dist/present.cjs +3 -3
  34. package/dist/present.d.cts +2 -2
  35. package/dist/present.d.ts +2 -2
  36. package/dist/present.js +3 -3
  37. package/dist/three.cjs +194 -15
  38. package/dist/three.cjs.map +1 -1
  39. package/dist/three.d.cts +75 -4
  40. package/dist/three.d.ts +75 -4
  41. package/dist/three.js +191 -13
  42. package/dist/three.js.map +1 -1
  43. package/dist/{types-C5xo0fzb.d.ts → types-CTSrPvY3.d.cts} +64 -58
  44. package/dist/{types-C5xo0fzb.d.cts → types-CTSrPvY3.d.ts} +64 -58
  45. package/docs/api.md +1 -0
  46. package/docs/dsl.md +24 -0
  47. package/llms-full.txt +61 -2
  48. package/package.json +1 -1
  49. package/skills/pixi-effects/SKILL.md +1 -1
  50. package/skills/pixi-effects/reference/cheatsheet.md +1 -1
  51. package/skills/pixi-effects/reference/recipes.md +34 -0
  52. package/skills/pixi-effects/template.html +6 -6
  53. package/dist/Composition-N6BOROJ2.cjs +0 -16
  54. package/dist/Composition-YGBQX3HZ.js +0 -7
  55. package/dist/chunk-3HZV3UHU.cjs.map +0 -1
  56. package/dist/chunk-3IO5RWE4.cjs.map +0 -1
  57. package/dist/chunk-4QVQ5UJJ.js.map +0 -1
  58. package/dist/chunk-ICI6ACHY.js.map +0 -1
  59. package/dist/chunk-X62H3RBG.cjs.map +0 -1
  60. package/dist/chunk-Z6JQO7GX.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.46.0
4
+
5
+ A live 2D layer can be the picture on a mesh of a `three` layer (a phone screen with an app running, a television, a label), clicks and hovers reach it, and a hidden source layer is no longer left culled. Nothing breaks.
6
+
7
+ - **New: `threeLayerTexture(ctx, 'screen')` puts a live 2D layer on a mesh of a `three` layer.** A phone or laptop screen with an app running, a television, a billboard, a label on a bottle: a `composition` listed before the three layer is drawn into a texture just before the three layer draws, and `screen.material` shows it on any mesh (or one face of a box). The 2D layer keeps its timeline, keyframes and filters and is no longer drawn on the stage. Colours equal the 2D layer channel for channel, on both routes: when the three layer is on PixiJS's GPU device the texture is PixiJS's own GPU texture used through three's `ExternalTexture` (no copy, 0.3 ms a frame), otherwise the pixels are read back (1.6 ms at 480 x 270, 4 ms at 1280 x 720). A function of the time (seek, export, `check`), kept across `setVars`. `{ transparent: true }` lets the empty and half-transparent parts show what is behind the mesh (same colours as the 2D layer over the same background, on every route); a texture seen small or at a slant is filtered, not aliased (mipmaps made after every draw on the shared GPU, anisotropy 4: 1-pixel stripes at a quarter size went from black and white stripes, spread 127, to one even grey, spread 0). **A click or hover on the mesh reaches the 2D layer:** `movie.pick(x, y)` on a point of the mesh answers for the layers inside the screen at the point of its picture under the pointer (`screen/button`, `local` in the layer's own pixels, `via` naming the three layer and the mesh), above the mesh itself; `only` / `ignore`, `movie.hover` and a page's click handler work through it. Found while reading the PixiJS 3D beta (its `ContainerTexture`). `tests/films/three-layer-texture`, recipe `three-screen`, `docs/dsl.md` "A 2D layer on a mesh".
3
8
  ## 0.45.0
4
9
 
5
10
  `check` stops waiting in silence when a page cannot load, says how the picture moves and ends, and the whole mix can be set to a loudness in one line. Nothing breaks.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pixi-effects
2
2
 
3
- > **Status**: experimental — current release `0.45.0`. The API may still change between minor versions; see the [CHANGELOG](./CHANGELOG.md) for what each release changed.
3
+ > **Status**: experimental — current release `0.46.0`. The API may still change between minor versions; see the [CHANGELOG](./CHANGELOG.md) for what each release changed.
4
4
 
5
5
  **[Gallery →](https://yjmtmtk.github.io/pixi-effects/examples/gallery/)** · 43 pieces written as plain data by AI models · **[For AI →](https://yjmtmtk.github.io/pixi-effects/for-ai.html)** · what an AI reads and runs · **[Playground →](https://yjmtmtk.github.io/pixi-effects/examples/playground.html)** in the browser.
6
6
 
@@ -49,8 +49,8 @@ Drop the imports into an [importmap](https://developer.mozilla.org/docs/Web/HTML
49
49
  "imports": {
50
50
  "pixi.js": "https://esm.sh/pixi.js@8.22.0?bundle-deps",
51
51
  "mediabunny": "https://esm.sh/mediabunny",
52
- "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.45.0/dist/index.js",
53
- "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.45.0/dist/Controller.js"
52
+ "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.46.0/dist/index.js",
53
+ "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.46.0/dist/Controller.js"
54
54
  }
55
55
  }
56
56
  </script>
@@ -61,7 +61,7 @@ Drop the imports into an [importmap](https://developer.mozilla.org/docs/Web/HTML
61
61
  </script>
62
62
  ```
63
63
 
64
- Load the `dist/` files **as they are** (jsDelivr's `/npm/…/dist/…`, or unpkg's `https://unpkg.com/pixi-effects@0.45.0/dist/index.js`) rather than a CDN-rebundled build such as `esm.sh/pixi-effects` or jsDelivr's `+esm`: the entries (`pixi-effects`, `…/controller`, `…/three`) share internal chunks, which only works when each file is served untouched.
64
+ Load the `dist/` files **as they are** (jsDelivr's `/npm/…/dist/…`, or unpkg's `https://unpkg.com/pixi-effects@0.46.0/dist/index.js`) rather than a CDN-rebundled build such as `esm.sh/pixi-effects` or jsDelivr's `+esm`: the entries (`pixi-effects`, `…/controller`, `…/three`) share internal chunks, which only works when each file is served untouched.
65
65
 
66
66
  > **Using three.js?** Add two more entries (`three` and `pixi-effects/three`) to this importmap — see [Adding three.js](#adding-threejs-optional) below.
67
67
  >
@@ -78,7 +78,7 @@ Add two more entries to the importmap above: three.js itself, and the `pixi-effe
78
78
  "...": "(everything from the importmap above)",
79
79
  "three": "https://esm.sh/three@0.178.0",
80
80
  "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.178.0/examples/jsm/",
81
- "pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.45.0/dist/three.js"
81
+ "pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.46.0/dist/three.js"
82
82
  }
83
83
  }
84
84
  </script>
@@ -59,9 +59,9 @@
59
59
  "imports": {
60
60
  "pixi.js": "https://cdn.jsdelivr.net/npm/pixi.js@8.22.0/dist/pixi.min.mjs",
61
61
  "mediabunny": "https://cdn.jsdelivr.net/npm/mediabunny@1.61.3/+esm",
62
- "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.45.0/dist/index.js",
63
- "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.45.0/dist/Controller.js",
64
- "pixi-effects/present": "https://cdn.jsdelivr.net/npm/pixi-effects@0.45.0/dist/present.js"
62
+ "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.46.0/dist/index.js",
63
+ "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.46.0/dist/Controller.js",
64
+ "pixi-effects/present": "https://cdn.jsdelivr.net/npm/pixi-effects@0.46.0/dist/present.js"
65
65
  }
66
66
  }
67
67
  </script>
@@ -0,0 +1,7 @@
1
+ export { CompositionSequence } from './chunk-FPV3NPYC.js';
2
+ import './chunk-DM2OLQOJ.js';
3
+ import './chunk-VNP7QCJE.js';
4
+ import './chunk-32MMNDDN.js';
5
+ import './chunk-BXOCEZ4U.js';
6
+ //# sourceMappingURL=Composition-NSY7A32Y.js.map
7
+ //# sourceMappingURL=Composition-NSY7A32Y.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"Composition-YGBQX3HZ.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"Composition-NSY7A32Y.js"}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var chunkDKCMJILW_cjs = require('./chunk-DKCMJILW.cjs');
4
+ require('./chunk-LALEBV63.cjs');
5
+ require('./chunk-JN7JHNZR.cjs');
6
+ require('./chunk-3SAS3ZE5.cjs');
7
+ require('./chunk-TWZNOUM7.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "CompositionSequence", {
12
+ enumerable: true,
13
+ get: function () { return chunkDKCMJILW_cjs.CompositionSequence; }
14
+ });
15
+ //# sourceMappingURL=Composition-PME3P5LP.cjs.map
16
+ //# sourceMappingURL=Composition-PME3P5LP.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"Composition-N6BOROJ2.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"Composition-PME3P5LP.cjs"}
@@ -1,7 +1,7 @@
1
- import { M as Movie } from './Movie-C-d4zN-N.cjs';
1
+ import { M as Movie } from './Movie-BqrAWN0g.cjs';
2
2
  import 'pixi.js';
3
3
  import './soundEntry-DT13DNt8.cjs';
4
- import './types-C5xo0fzb.cjs';
4
+ import './types-CTSrPvY3.cjs';
5
5
 
6
6
  /**
7
7
  * The look of the bar. Each key sets a CSS custom property on the bar (so you can also set `--mc-accent` … in your own CSS, on the
@@ -1,7 +1,7 @@
1
- import { M as Movie } from './Movie-lMSS9JwX.js';
1
+ import { M as Movie } from './Movie-sV8nJr_f.js';
2
2
  import 'pixi.js';
3
3
  import './soundEntry-DT13DNt8.js';
4
- import './types-C5xo0fzb.js';
4
+ import './types-CTSrPvY3.js';
5
5
 
6
6
  /**
7
7
  * The look of the bar. Each key sets a CSS custom property on the bar (so you can also set `--mc-accent` … in your own CSS, on the
@@ -1,6 +1,6 @@
1
1
  import { Application } from 'pixi.js';
2
2
  import { A as AudioReport, a as AudioInspectOptions } from './soundEntry-DT13DNt8.cjs';
3
- import { a as Stop, A as AssetSpec, C as CompositionSpec } from './types-C5xo0fzb.cjs';
3
+ import { a as Stop, A as AssetSpec, C as CompositionSpec } from './types-CTSrPvY3.cjs';
4
4
 
5
5
  type EaseFn = (p: number) => number;
6
6
 
@@ -255,6 +255,11 @@ interface PickHit {
255
255
  x: number;
256
256
  y: number;
257
257
  };
258
+ /** The layer is shown on a mesh of a `three` layer (`threeLayerTexture`) and the point is on that mesh: the layer (`path` of the three layer) and the object (its name) it came through. `point` is still the canvas point; `local` is the point in the layer's own pixels. */
259
+ via?: {
260
+ path: string;
261
+ object: string;
262
+ };
258
263
  /** A `three` layer: what the ray through that point met first: the object (its name, or `''`), where (three's own units), and how far from the camera. */
259
264
  three?: {
260
265
  object: unknown;
@@ -1,6 +1,6 @@
1
1
  import { Application } from 'pixi.js';
2
2
  import { A as AudioReport, a as AudioInspectOptions } from './soundEntry-DT13DNt8.js';
3
- import { a as Stop, A as AssetSpec, C as CompositionSpec } from './types-C5xo0fzb.js';
3
+ import { a as Stop, A as AssetSpec, C as CompositionSpec } from './types-CTSrPvY3.js';
4
4
 
5
5
  type EaseFn = (p: number) => number;
6
6
 
@@ -255,6 +255,11 @@ interface PickHit {
255
255
  x: number;
256
256
  y: number;
257
257
  };
258
+ /** The layer is shown on a mesh of a `three` layer (`threeLayerTexture`) and the point is on that mesh: the layer (`path` of the three layer) and the object (its name) it came through. `point` is still the canvas point; `local` is the point in the layer's own pixels. */
259
+ via?: {
260
+ path: string;
261
+ object: string;
262
+ };
258
263
  /** A `three` layer: what the ray through that point met first: the object (its name, or `''`), where (three's own units), and how far from the camera. */
259
264
  three?: {
260
265
  object: unknown;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk3HZV3UHU_cjs = require('./chunk-3HZV3UHU.cjs');
4
- var chunkX62H3RBG_cjs = require('./chunk-X62H3RBG.cjs');
3
+ var chunkDKCMJILW_cjs = require('./chunk-DKCMJILW.cjs');
4
+ var chunkLALEBV63_cjs = require('./chunk-LALEBV63.cjs');
5
5
  require('./chunk-JN7JHNZR.cjs');
6
6
  require('./chunk-3SAS3ZE5.cjs');
7
7
  require('./chunk-TWZNOUM7.cjs');
@@ -12,12 +12,12 @@ var strip = (props) => {
12
12
  const { visibleChars: _gone, ...rest } = props;
13
13
  return rest;
14
14
  };
15
- var SpansSequence = class extends chunk3HZV3UHU_cjs.CompositionSequence {
15
+ var SpansSequence = class extends chunkDKCMJILW_cjs.CompositionSequence {
16
16
  _meta;
17
17
  _count = { value: 0, visibleChars: 0 };
18
18
  constructor(spec, parent, root) {
19
19
  super(spec, parent, root);
20
- this._meta = chunkX62H3RBG_cjs.spansMeta.get(spec);
20
+ this._meta = chunkLALEBV63_cjs.spansMeta.get(spec);
21
21
  }
22
22
  /** `visibleChars` is the group's own counter, not a property to write on the container. */
23
23
  displayProps() {
@@ -33,8 +33,8 @@ var SpansSequence = class extends chunk3HZV3UHU_cjs.CompositionSequence {
33
33
  if (!this._meta?.typed) return;
34
34
  const scope = this.scope();
35
35
  const first = this.spec.initial?.visibleChars;
36
- this._count.visibleChars = first === void 0 ? 0 : chunkX62H3RBG_cjs.resolveNumber(first, scope);
37
- chunkX62H3RBG_cjs.bindCounterKeyframes(timeline, this._count, "visibleChars", () => this._distribute(), this.spec.keyframes ?? [], this.duration, offset + this.at, scope);
36
+ this._count.visibleChars = first === void 0 ? 0 : chunkLALEBV63_cjs.resolveNumber(first, scope);
37
+ chunkLALEBV63_cjs.bindCounterKeyframes(timeline, this._count, "visibleChars", () => this._distribute(), this.spec.keyframes ?? [], this.duration, offset + this.at, scope);
38
38
  this._distribute();
39
39
  }
40
40
  /** Every piece shows its part of the first N characters of the whole text. */
@@ -43,7 +43,7 @@ var SpansSequence = class extends chunk3HZV3UHU_cjs.CompositionSequence {
43
43
  const total = Math.max(0, Math.floor(this._count.visibleChars));
44
44
  let i = 0;
45
45
  for (const child of this._children) {
46
- if (!(child instanceof chunkX62H3RBG_cjs.TextSequence)) continue;
46
+ if (!(child instanceof chunkLALEBV63_cjs.TextSequence)) continue;
47
47
  const p = pieces[i++];
48
48
  if (p) child.setVisibleChars(Math.min(p.length, Math.max(0, total - p.start)));
49
49
  }
@@ -51,5 +51,5 @@ var SpansSequence = class extends chunk3HZV3UHU_cjs.CompositionSequence {
51
51
  };
52
52
 
53
53
  exports.SpansSequence = SpansSequence;
54
- //# sourceMappingURL=Spans-XTIWYSNO.cjs.map
55
- //# sourceMappingURL=Spans-XTIWYSNO.cjs.map
54
+ //# sourceMappingURL=Spans-2TZCNREQ.cjs.map
55
+ //# sourceMappingURL=Spans-2TZCNREQ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sequences/Spans.ts"],"names":["CompositionSequence","spansMeta","resolveNumber","bindCounterKeyframes","TextSequence"],"mappings":";;;;;;;;;AAQA,IAAM,KAAA,GAAQ,CAAC,KAAA,KAAgD;AAC7D,EAAA,IAAI,CAAC,KAAA,IAAS,EAAE,cAAA,IAAkB,QAAQ,OAAO,KAAA;AACjD,EAAA,MAAM,EAAE,YAAA,EAAc,KAAA,EAAO,GAAG,MAAK,GAAI,KAAA;AACzC,EAAA,OAAO,IAAA;AACT,CAAA;AAEO,IAAM,aAAA,GAAN,cAA4BA,qCAAA,CAAoB;AAAA,EACpC,KAAA;AAAA,EACA,MAAA,GAAuB,EAAE,KAAA,EAAO,CAAA,EAAG,cAAc,CAAA,EAAE;AAAA,EAEpE,WAAA,CAAY,IAAA,EAAoB,MAAA,EAAiC,IAAA,EAAwB;AACvF,IAAA,KAAA,CAAM,IAAA,EAAM,QAAQ,IAAI,CAAA;AACxB,IAAA,IAAA,CAAK,KAAA,GAAQC,2BAAA,CAAU,GAAA,CAAI,IAAI,CAAA;AAAA,EACjC;AAAA;AAAA,EAGmB,YAAA,GAAyH;AAC1I,IAAA,MAAM,CAAA,GAAI,MAAM,YAAA,EAAa;AAC7B,IAAA,IAAI,CAAC,IAAA,CAAK,KAAA,EAAO,KAAA,EAAO,OAAO,CAAA;AAC/B,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,KAAA,CAAM,CAAA,CAAE,OAA4B,CAAA;AAAA,MAC7C,SAAA,EAAW,EAAE,SAAA,EAAW,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AAA,EAAe;AACtC,MAAA,MAAM,CAAA,GAAI,OAAO,CAAA,EAAG,CAAA;AACpB,MAAA,IAAI,CAAA,EAAG,KAAA,CAAM,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAA,CAAE,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,KAAA,GAAQ,CAAA,CAAE,KAAK,CAAC,CAAC,CAAA;AAAA,IAC/E;AAAA,EACF;AACF","file":"Spans-XTIWYSNO.cjs","sourcesContent":["// The sequence behind a text layer with `spans`: a composition of ordinary text layers (see src/text/spans.ts) that also owns the typewriter\n// (`visibleChars`) of the whole text: it counts over every character of every piece, and tells each piece how many of its own to show.\nimport { CompositionSequence } from './Composition';\nimport { TextSequence, bindCounterKeyframes, resolveNumber, type CounterState } from './Text';\nimport { spansMeta, type SpansMeta } from '../text/spans';\nimport type { CompositionShape, SequenceSpec, Props } from '../types';\nimport type { Timeline } from '../core/timelineEngine';\n\nconst strip = (props: Props | undefined): Props | undefined => {\n if (!props || !('visibleChars' in props)) return props;\n const { visibleChars: _gone, ...rest } = props as Record<string, unknown>;\n return rest as unknown as Props;\n};\n\nexport class SpansSequence extends CompositionSequence {\n private readonly _meta: SpansMeta | undefined;\n private readonly _count: CounterState = { value: 0, visibleChars: 0 };\n\n constructor(spec: SequenceSpec, parent: CompositionShape | null, root: CompositionShape) {\n super(spec, parent, root);\n this._meta = spansMeta.get(spec);\n }\n\n /** `visibleChars` is the group's own counter, not a property to write on the container. */\n protected override displayProps(): { initial: CompositionSequence['spec']['initial']; keyframes: CompositionSequence['spec']['keyframes'] } {\n const p = super.displayProps();\n if (!this._meta?.typed) return p;\n return {\n initial: strip(p.initial as Props | undefined) as never,\n keyframes: p.keyframes?.map(kf => ({ ...kf, set: strip(kf.set), to: strip(kf.to), from: strip(kf.from) })),\n };\n }\n\n override bindTimeline(timeline: Timeline, offset = 0): void {\n super.bindTimeline(timeline, offset);\n if (!this._meta?.typed) return;\n const scope = this.scope();\n const first = (this.spec.initial as Record<string, unknown> | undefined)?.visibleChars;\n this._count.visibleChars = first === undefined ? 0 : resolveNumber(first, scope); // like a text: it starts at 0 once it is animated\n bindCounterKeyframes(timeline, this._count, 'visibleChars', () => this._distribute(), this.spec.keyframes ?? [], this.duration!, offset + this.at, scope);\n this._distribute();\n }\n\n /** Every piece shows its part of the first N characters of the whole text. */\n private _distribute(): void {\n const pieces = this._meta!.pieces;\n const total = Math.max(0, Math.floor(this._count.visibleChars));\n let i = 0;\n for (const child of this._children) {\n if (!(child instanceof TextSequence)) continue;\n const p = pieces[i++];\n if (p) child.setVisibleChars(Math.min(p.length, Math.max(0, total - p.start)));\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/sequences/Spans.ts"],"names":["CompositionSequence","spansMeta","resolveNumber","bindCounterKeyframes","TextSequence"],"mappings":";;;;;;;;;AAQA,IAAM,KAAA,GAAQ,CAAC,KAAA,KAAgD;AAC7D,EAAA,IAAI,CAAC,KAAA,IAAS,EAAE,cAAA,IAAkB,QAAQ,OAAO,KAAA;AACjD,EAAA,MAAM,EAAE,YAAA,EAAc,KAAA,EAAO,GAAG,MAAK,GAAI,KAAA;AACzC,EAAA,OAAO,IAAA;AACT,CAAA;AAEO,IAAM,aAAA,GAAN,cAA4BA,qCAAA,CAAoB;AAAA,EACpC,KAAA;AAAA,EACA,MAAA,GAAuB,EAAE,KAAA,EAAO,CAAA,EAAG,cAAc,CAAA,EAAE;AAAA,EAEpE,WAAA,CAAY,IAAA,EAAoB,MAAA,EAAiC,IAAA,EAAwB;AACvF,IAAA,KAAA,CAAM,IAAA,EAAM,QAAQ,IAAI,CAAA;AACxB,IAAA,IAAA,CAAK,KAAA,GAAQC,2BAAA,CAAU,GAAA,CAAI,IAAI,CAAA;AAAA,EACjC;AAAA;AAAA,EAGmB,YAAA,GAAyH;AAC1I,IAAA,MAAM,CAAA,GAAI,MAAM,YAAA,EAAa;AAC7B,IAAA,IAAI,CAAC,IAAA,CAAK,KAAA,EAAO,KAA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AAC,CAAA;AAC9D,IAAA,IAAI,CAAA,GAAI,CAAA;AACR,IAAA,KAAA,MAAW,KAAA,IAAS,KAAK,SAAA,EAAW;AAClC,MAAA,IAAI,EAAE,iBAAiBC,8BAAA,CAAA,EAAe;AACtC,MAAA,MAAM,CAAA,GAAI,OAAO,CAAA,EAAG,CAAA;AACpB,MAAA,IAAI,CAAA,EAAG,KAAA,CAAM,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAA,CAAE,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,KAAA,GAAQ,CAAA,CAAE,KAAK,CAAC,CAAC,CAAA;AAAA,IAC/E;AAAA,EACF;AACF","file":"Spans-2TZCNREQ.cjs","sourcesContent":["// The sequence behind a text layer with `spans`: a composition of ordinary text layers (see src/text/spans.ts) that also owns the typewriter\n// (`visibleChars`) of the whole text: it counts over every character of every piece, and tells each piece how many of its own to show.\nimport { CompositionSequence } from './Composition';\nimport { TextSequence, bindCounterKeyframes, resolveNumber, type CounterState } from './Text';\nimport { spansMeta, type SpansMeta } from '../text/spans';\nimport type { CompositionShape, SequenceSpec, Props } from '../types';\nimport type { Timeline } from '../core/timelineEngine';\n\nconst strip = (props: Props | undefined): Props | undefined => {\n if (!props || !('visibleChars' in props)) return props;\n const { visibleChars: _gone, ...rest } = props as Record<string, unknown>;\n return rest as unknown as Props;\n};\n\nexport class SpansSequence extends CompositionSequence {\n private readonly _meta: SpansMeta | undefined;\n private readonly _count: CounterState = { value: 0, visibleChars: 0 };\n\n constructor(spec: SequenceSpec, parent: CompositionShape | null, root: CompositionShape) {\n super(spec, parent, root);\n this._meta = spansMeta.get(spec);\n }\n\n /** `visibleChars` is the group's own counter, not a property to write on the container. */\n protected override displayProps(): { initial: CompositionSequence['spec']['initial']; keyframes: CompositionSequence['spec']['keyframes'] } {\n const p = super.displayProps();\n if (!this._meta?.typed) return p;\n return {\n initial: strip(p.initial as Props | undefined) as never,\n keyframes: p.keyframes?.map(kf => ({ ...kf, set: strip(kf.set), to: strip(kf.to), from: strip(kf.from) })),\n };\n }\n\n override bindTimeline(timeline: Timeline, offset = 0): void {\n super.bindTimeline(timeline, offset);\n if (!this._meta?.typed) return;\n const scope = this.scope();\n const first = (this.spec.initial as Record<string, unknown> | undefined)?.visibleChars;\n this._count.visibleChars = first === undefined ? 0 : resolveNumber(first, scope); // like a text: it starts at 0 once it is animated\n bindCounterKeyframes(timeline, this._count, 'visibleChars', () => this._distribute(), this.spec.keyframes ?? [], this.duration!, offset + this.at, scope);\n this._distribute();\n }\n\n /** Every piece shows its part of the first N characters of the whole text. */\n private _distribute(): void {\n const pieces = this._meta!.pieces;\n const total = Math.max(0, Math.floor(this._count.visibleChars));\n let i = 0;\n for (const child of this._children) {\n if (!(child instanceof TextSequence)) continue;\n const p = pieces[i++];\n if (p) child.setVisibleChars(Math.min(p.length, Math.max(0, total - p.start)));\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { CompositionSequence } from './chunk-ICI6ACHY.js';
2
- import { spansMeta, resolveNumber, bindCounterKeyframes, TextSequence } from './chunk-4QVQ5UJJ.js';
1
+ import { CompositionSequence } from './chunk-FPV3NPYC.js';
2
+ import { spansMeta, resolveNumber, bindCounterKeyframes, TextSequence } from './chunk-DM2OLQOJ.js';
3
3
  import './chunk-VNP7QCJE.js';
4
4
  import './chunk-32MMNDDN.js';
5
5
  import './chunk-BXOCEZ4U.js';
@@ -49,5 +49,5 @@ var SpansSequence = class extends CompositionSequence {
49
49
  };
50
50
 
51
51
  export { SpansSequence };
52
- //# sourceMappingURL=Spans-6L2ZVECX.js.map
53
- //# sourceMappingURL=Spans-6L2ZVECX.js.map
52
+ //# sourceMappingURL=Spans-TESJPQKX.js.map
53
+ //# sourceMappingURL=Spans-TESJPQKX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sequences/Spans.ts"],"names":[],"mappings":";;;;;;;AAQA,IAAM,KAAA,GAAQ,CAAC,KAAA,KAAgD;AAC7D,EAAA,IAA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,EAAM;AACzB,IAAA,MAAM,KAAA,GAAS,IAAA,CAAK,IAAA,CAAK,OAAA,EAAiD,YAAA;AAC1E,IAAA,IAAA,CAAK,OAAO,YAAA,GAAe,KAAA,KAAU,SAAY,CAAA,GAAI,aAAA,CAAc,OAAO,KAAK,CAAA;AAC/E,IAAA,oBAAA,CAAqB,UAAU,IAAA,CAAK,MAAA,EAAQ,gBAAgB,MAAM,IAAA,CAAK,aAAY,EAAG,IAAA,CAAK,IAAA,CAAK,SAAA,IAAa,EAAC,EAAG,IAAA,CAAK,UAAW,MAAA,GAAS,IAAA,CAAK,IAAI,KAAK,CAAA;AACxJ,IAAA,IAAA,CAAK,WAAA,EAAY;AAAA,EACnB;AAAA;AAAA,EAGQ,WAAA,GAAoB;AAC1B,IAAA,MAAM,MAAA,GAAS,KAAK,KAAA,CAAO,MAAA;AAC3B,IAAA,MAAM,KAAA,GAAQ,KAAK,GAAA,CAAI,CAAA,EAAG,KAAK,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,YAAY,CAAC,CAAA;AAC9D,IAAA,IAAI,CAAA,GAAI,CAAA;AACR,IAAA,KAAA,MAAW,KAAA,IAAS,KAAK,SAAA,EAAW;AAClC,MAAA,IAAI,EAAE,iBAAiB,YAAA,CAAA,EAAe;AACtC,MAAA,MAAM,CAAA,GAAI,OAAO,CAAA,EAAG,CAAA;AACpB,MAAA,IAAI,CAAA,EAAG,KAAA,CAAM,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAA,CAAE,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,KAAA,GAAQ,CAAA,CAAE,KAAK,CAAC,CAAC,CAAA;AAAA,IAC/E;AAAA,EACF;AACF","file":"Spans-6L2ZVECX.js","sourcesContent":["// The sequence behind a text layer with `spans`: a composition of ordinary text layers (see src/text/spans.ts) that also owns the typewriter\n// (`visibleChars`) of the whole text: it counts over every character of every piece, and tells each piece how many of its own to show.\nimport { CompositionSequence } from './Composition';\nimport { TextSequence, bindCounterKeyframes, resolveNumber, type CounterState } from './Text';\nimport { spansMeta, type SpansMeta } from '../text/spans';\nimport type { CompositionShape, SequenceSpec, Props } from '../types';\nimport type { Timeline } from '../core/timelineEngine';\n\nconst strip = (props: Props | undefined): Props | undefined => {\n if (!props || !('visibleChars' in props)) return props;\n const { visibleChars: _gone, ...rest } = props as Record<string, unknown>;\n return rest as unknown as Props;\n};\n\nexport class SpansSequence extends CompositionSequence {\n private readonly _meta: SpansMeta | undefined;\n private readonly _count: CounterState = { value: 0, visibleChars: 0 };\n\n constructor(spec: SequenceSpec, parent: CompositionShape | null, root: CompositionShape) {\n super(spec, parent, root);\n this._meta = spansMeta.get(spec);\n }\n\n /** `visibleChars` is the group's own counter, not a property to write on the container. */\n protected override displayProps(): { initial: CompositionSequence['spec']['initial']; keyframes: CompositionSequence['spec']['keyframes'] } {\n const p = super.displayProps();\n if (!this._meta?.typed) return p;\n return {\n initial: strip(p.initial as Props | undefined) as never,\n keyframes: p.keyframes?.map(kf => ({ ...kf, set: strip(kf.set), to: strip(kf.to), from: strip(kf.from) })),\n };\n }\n\n override bindTimeline(timeline: Timeline, offset = 0): void {\n super.bindTimeline(timeline, offset);\n if (!this._meta?.typed) return;\n const scope = this.scope();\n const first = (this.spec.initial as Record<string, unknown> | undefined)?.visibleChars;\n this._count.visibleChars = first === undefined ? 0 : resolveNumber(first, scope); // like a text: it starts at 0 once it is animated\n bindCounterKeyframes(timeline, this._count, 'visibleChars', () => this._distribute(), this.spec.keyframes ?? [], this.duration!, offset + this.at, scope);\n this._distribute();\n }\n\n /** Every piece shows its part of the first N characters of the whole text. */\n private _distribute(): void {\n const pieces = this._meta!.pieces;\n const total = Math.max(0, Math.floor(this._count.visibleChars));\n let i = 0;\n for (const child of this._children) {\n if (!(child instanceof TextSequence)) continue;\n const p = pieces[i++];\n if (p) child.setVisibleChars(Math.min(p.length, Math.max(0, total - p.start)));\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/sequences/Spans.ts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CAAC,IAAA,CAAK,KAAA,EAAO,KAAA,EAAO;AACxB,IAAA,MAAM,KAAA,GAAQ,KAAK,KAAA,EAAM;AACzB,IAAA,MAAM,KAAA,GAAS,IAAA,CAAK,IAAA,CAAK,OAAA,EAAiD,YAAA;AAC1E,IAAA,IAAA,CAAK,OAAO,YAAA,GAAe,KAAA,KAAU,SAAY,CAAA,GAAI,aAAA,CAAc,OAAO,KAAK,CAAA;AAC/E,IAAA,oBAAA,CAAqB,UAAU,IAAA,CAAK,MAAA,EAAQ,gBAAgB,MAAM,IAAA,CAAK,aAAY,EAAG,IAAA,CAAK,IAAA,CAAK,SAAA,IAAa,EAAC,EAAG,IAAA,CAAK,UAAW,MAAA,GAAS,IAAA,CAAK,IAAI,KAAK,CAAA;AACxJ,IAAA,IAAA,CAAK,WAAA,EAAY;AAAA,EACnB;AAAA;AAAA,EAGQ,WAAA,GAAoB;AAC1B,IAAA,MAAM,MAAA,GAAS,KAAK,KAAA,CAAO,MAAA;AAC3B,IAAA,MAAM,KAAA,GAAQ,KAAK,GAAA,CAAI,CAAA,EAAG,KAAK,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,YAAY,CAAC,CAAA;AAC9D,IAAA,IAAI,CAAA,GAAI,CAAA;AACR,IAAA,KAAA,MAAW,KAAA,IAAS,KAAK,SAAA,EAAW;AAClC,MAAA,IAAI,EAAE,iBAAiB,YAAA,CAAA,EAAe;AACtC,MAAA,MAAM,CAAA,GAAI,OAAO,CAAA,EAAG,CAAA;AACpB,MAAA,IAAI,CAAA,EAAG,KAAA,CAAM,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAA,CAAE,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,KAAA,GAAQ,CAAA,CAAE,KAAK,CAAC,CAAC,CAAA;AAAA,IAC/E;AAAA,EACF;AACF","file":"Spans-TESJPQKX.js","sourcesContent":["// The sequence behind a text layer with `spans`: a composition of ordinary text layers (see src/text/spans.ts) that also owns the typewriter\n// (`visibleChars`) of the whole text: it counts over every character of every piece, and tells each piece how many of its own to show.\nimport { CompositionSequence } from './Composition';\nimport { TextSequence, bindCounterKeyframes, resolveNumber, type CounterState } from './Text';\nimport { spansMeta, type SpansMeta } from '../text/spans';\nimport type { CompositionShape, SequenceSpec, Props } from '../types';\nimport type { Timeline } from '../core/timelineEngine';\n\nconst strip = (props: Props | undefined): Props | undefined => {\n if (!props || !('visibleChars' in props)) return props;\n const { visibleChars: _gone, ...rest } = props as Record<string, unknown>;\n return rest as unknown as Props;\n};\n\nexport class SpansSequence extends CompositionSequence {\n private readonly _meta: SpansMeta | undefined;\n private readonly _count: CounterState = { value: 0, visibleChars: 0 };\n\n constructor(spec: SequenceSpec, parent: CompositionShape | null, root: CompositionShape) {\n super(spec, parent, root);\n this._meta = spansMeta.get(spec);\n }\n\n /** `visibleChars` is the group's own counter, not a property to write on the container. */\n protected override displayProps(): { initial: CompositionSequence['spec']['initial']; keyframes: CompositionSequence['spec']['keyframes'] } {\n const p = super.displayProps();\n if (!this._meta?.typed) return p;\n return {\n initial: strip(p.initial as Props | undefined) as never,\n keyframes: p.keyframes?.map(kf => ({ ...kf, set: strip(kf.set), to: strip(kf.to), from: strip(kf.from) })),\n };\n }\n\n override bindTimeline(timeline: Timeline, offset = 0): void {\n super.bindTimeline(timeline, offset);\n if (!this._meta?.typed) return;\n const scope = this.scope();\n const first = (this.spec.initial as Record<string, unknown> | undefined)?.visibleChars;\n this._count.visibleChars = first === undefined ? 0 : resolveNumber(first, scope); // like a text: it starts at 0 once it is animated\n bindCounterKeyframes(timeline, this._count, 'visibleChars', () => this._distribute(), this.spec.keyframes ?? [], this.duration!, offset + this.at, scope);\n this._distribute();\n }\n\n /** Every piece shows its part of the first N characters of the whole text. */\n private _distribute(): void {\n const pieces = this._meta!.pieces;\n const total = Math.max(0, Math.floor(this._count.visibleChars));\n let i = 0;\n for (const child of this._children) {\n if (!(child instanceof TextSequence)) continue;\n const p = pieces[i++];\n if (p) child.setVisibleChars(Math.min(p.length, Math.max(0, total - p.start)));\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { CompositionSequence, maskSourceOf } from './chunk-ICI6ACHY.js';
2
- import { EXPRESSION_NAMES, createTimeline, lengthen, ensureFilterLibrary, checkEase, parseEase, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, trimPolylines, rand, DEG, timeRemapOf, contentLength, resolveAt, parseSpring, springDuration, spansMeta } from './chunk-4QVQ5UJJ.js';
1
+ import { CompositionSequence, maskSourceOf } from './chunk-FPV3NPYC.js';
2
+ import { EXPRESSION_NAMES, createTimeline, lengthen, ensureFilterLibrary, checkEase, parseEase, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, trimPolylines, rand, DEG, timeRemapOf, contentLength, resolveAt, parseSpring, springDuration, spansMeta } from './chunk-DM2OLQOJ.js';
3
3
  import { analyzeAudio, fft, resampleThrough, measureLoudness, playSpan } from './chunk-K24FF4BT.js';
4
4
  import { usesAdvancedBlend, enableAdvancedBlend } from './chunk-VNP7QCJE.js';
5
5
  import { describeLayer } from './chunk-32MMNDDN.js';
@@ -1632,7 +1632,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
1632
1632
  const name = seq.spec.name;
1633
1633
  const label = name ?? `${seq.spec.type}#${i}`;
1634
1634
  const alpha = (t?.alpha ?? 1) * carriers.reduce((a, c) => a * (c.target?.alpha ?? 1), 1);
1635
- const alive = (threeD ? display.visible : t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true);
1635
+ const alive = (threeD ? display.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
1636
1636
  const visible = parentVisible && alive && alpha > 0;
1637
1637
  let bounds = null;
1638
1638
  if (!insideThreeD) {
@@ -1812,7 +1812,22 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
1812
1812
  return true;
1813
1813
  };
1814
1814
  const inside = (b, p) => p.x >= b.x && p.x <= b.x + b.width && p.y >= b.y && p.y <= b.y + b.height;
1815
- const walk3 = (comp, prefix, parentVisible) => {
1815
+ const hiddenSources = /* @__PURE__ */ new Map();
1816
+ const forwards = [];
1817
+ const rays = /* @__PURE__ */ new Map();
1818
+ const rayOf = (seq, d, local, lb) => {
1819
+ if (typeof seq.pickAt !== "function") return null;
1820
+ if (!rays.has(seq)) rays.set(seq, seq.pickAt((local.x - lb.x) / lb.width, (local.y - lb.y) / lb.height));
1821
+ return rays.get(seq);
1822
+ };
1823
+ const forwardThrough = (seq, d, path, local, lb) => {
1824
+ const shows = seq.screenOf;
1825
+ if (!shows || !inside(lb, local)) return;
1826
+ const r = rayOf(seq, d, local, lb);
1827
+ const shown = r?.uv ? shows.call(seq, r.material) : null;
1828
+ if (r?.uv && shown) forwards.push({ source: shown.source, uv: r.uv, via: { path, object: String(r.object) }, order: orderOf(d) });
1829
+ };
1830
+ const walk3 = (comp, prefix, parentVisible, at = { x, y }, orderBase, via) => {
1816
1831
  comp.layers().forEach(({ seq, display, threeD, carriers, quad }, i) => {
1817
1832
  const d = display;
1818
1833
  if (!d) return;
@@ -1820,16 +1835,25 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
1820
1835
  const name = seq.spec.name;
1821
1836
  const path = prefix + (name ?? `${seq.spec.type}#${i}`);
1822
1837
  const alpha = (t?.alpha ?? 1) * carriers.reduce((a, c) => a * (c.target?.alpha ?? 1), 1);
1823
- const alive = (threeD ? d.visible : t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true);
1838
+ const alive = (threeD ? d.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
1824
1839
  const visible = parentVisible && alive && alpha > 0;
1825
- if (!visible) return;
1840
+ if (!visible) {
1841
+ if (seq instanceof CompositionSequence && !threeD && parentVisible && alpha > 0 && t?.visible === false && (t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true)) hiddenSources.set(seq, path);
1842
+ return;
1843
+ }
1826
1844
  const isComposition = seq instanceof CompositionSequence;
1827
1845
  if (isComposition && !threeD) {
1828
- walk3(seq, path + "/", visible);
1846
+ walk3(seq, path + "/", visible, at, orderBase, via);
1829
1847
  return;
1830
1848
  }
1831
- if (!wanted(name, path)) return;
1832
- const point = { x, y };
1849
+ if (!wanted(name, path)) {
1850
+ if (!threeD) {
1851
+ const lp = d.toLocal(at);
1852
+ forwardThrough(seq, d, path, lp, d.getLocalBounds());
1853
+ }
1854
+ return;
1855
+ }
1856
+ const point = at;
1833
1857
  let hit = null;
1834
1858
  if (threeD) {
1835
1859
  if (quad && pointInQuad(quad, d.toLocal(point).x, d.toLocal(point).y)) hit = { name, path, type: seq.spec.type, kind: "card", point };
@@ -1837,7 +1861,10 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
1837
1861
  const local = d.toLocal(point);
1838
1862
  const lb = d.getLocalBounds();
1839
1863
  if (inside(lb, local)) {
1840
- const three = typeof seq.pickAt === "function" ? seq.pickAt((local.x - lb.x) / lb.width, (local.y - lb.y) / lb.height) : void 0;
1864
+ const isThree = typeof seq.pickAt === "function";
1865
+ const ray = isThree ? rayOf(seq, d, local, lb) : void 0;
1866
+ if (isThree) forwardThrough(seq, d, path, local, lb);
1867
+ const three = ray ? { object: ray.object, point: ray.point, distance: ray.distance, object3d: ray.object3d } : isThree ? null : void 0;
1841
1868
  if (three) {
1842
1869
  const planeOf = seq.dragPlane;
1843
1870
  if (planeOf) {
@@ -1872,10 +1899,16 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
1872
1899
  const maskTarget = seq.maskSequence?.target;
1873
1900
  const maskSrc = maskSourceOf(seq.spec.mask);
1874
1901
  if (maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert) && !inside(maskTarget.getBounds(), point)) return;
1875
- found.push({ hit, order: orderOf(d) });
1902
+ found.push({ hit: via ? { ...hit, point: { x, y }, via } : hit, order: orderBase ? [...orderBase, ...orderOf(d)] : orderOf(d) });
1876
1903
  });
1877
1904
  };
1878
1905
  walk3(root, "", true);
1906
+ for (const f of forwards) {
1907
+ const path = hiddenSources.get(f.source);
1908
+ if (path === void 0) continue;
1909
+ const g = f.source.target.toGlobal({ x: f.uv.u * f.source.intrinsicWidth, y: (1 - f.uv.v) * f.source.intrinsicHeight });
1910
+ walk3(f.source, path + "/", true, g, f.order, f.via);
1911
+ }
1879
1912
  return found.sort((a, b) => above(a.order, b.order)).map((f) => f.hit);
1880
1913
  }
1881
1914
  var cache = /* @__PURE__ */ new WeakMap();
@@ -2818,6 +2851,7 @@ var Movie = class {
2818
2851
  frameRate: this.frameRate,
2819
2852
  vars: numericVars(vars),
2820
2853
  ...gpuField,
2854
+ ...this.app?.renderer ? { pixiRenderer: this.app.renderer } : {},
2821
2855
  ...reuse ? { reuse } : {},
2822
2856
  ...lp ? { onLayerBuilt: async () => {
2823
2857
  lp.tick();
@@ -4814,5 +4848,5 @@ function withFade(spec, opts) {
4814
4848
  }
4815
4849
 
4816
4850
  export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, parseEase2 as parseEase, particles, react, resolveLoader, samplePath, splitText, stagger, wiggle, withFade };
4817
- //# sourceMappingURL=chunk-Z6JQO7GX.js.map
4818
- //# sourceMappingURL=chunk-Z6JQO7GX.js.map
4851
+ //# sourceMappingURL=chunk-2E74SP63.js.map
4852
+ //# sourceMappingURL=chunk-2E74SP63.js.map