pixi-effects 0.26.3 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +12 -10
  3. package/ai/CHAT.md +1 -1
  4. package/ai/chat-template.html +4 -6
  5. package/dist/{Base-CpdDs4HT.d.ts → Base-CKGl6jCo.d.ts} +2 -4
  6. package/dist/{Base-TbBhHPrG.d.cts → Base-DjhdL8B1.d.cts} +2 -4
  7. package/dist/Composition-BJVY5HP7.js +7 -0
  8. package/dist/{Composition-3O7L2VL5.js.map → Composition-BJVY5HP7.js.map} +1 -1
  9. package/dist/Composition-YW2G6EXL.cjs +16 -0
  10. package/dist/{Composition-EE3KEE2L.cjs.map → Composition-YW2G6EXL.cjs.map} +1 -1
  11. package/dist/Controller.d.cts +2 -3
  12. package/dist/Controller.d.ts +2 -3
  13. package/dist/{Movie-BkP82KXS.d.ts → Movie-CbYwTs6U.d.cts} +2 -3
  14. package/dist/{Movie-BWLLWRRe.d.cts → Movie-ILKq2fw_.d.ts} +2 -3
  15. package/dist/Presenter.d.cts +2 -3
  16. package/dist/Presenter.d.ts +2 -3
  17. package/dist/{blendModes-YV43K6E7.cjs → blendModes-HDOP6R7T.cjs} +5 -5
  18. package/dist/{blendModes-YV43K6E7.cjs.map → blendModes-HDOP6R7T.cjs.map} +1 -1
  19. package/dist/{blendModes-G3NOAU3T.js → blendModes-PAVTW3BO.js} +4 -4
  20. package/dist/{blendModes-G3NOAU3T.js.map → blendModes-PAVTW3BO.js.map} +1 -1
  21. package/dist/{chunk-TLYTYBWX.js → chunk-45QKLD6M.js} +9 -11
  22. package/dist/chunk-45QKLD6M.js.map +1 -0
  23. package/dist/{chunk-WMMZDPWK.js → chunk-AR3HVHKF.js} +7 -11
  24. package/dist/chunk-AR3HVHKF.js.map +1 -0
  25. package/dist/{chunk-A225HYSY.cjs → chunk-ETKTRQL2.cjs} +970 -258
  26. package/dist/chunk-ETKTRQL2.cjs.map +1 -0
  27. package/dist/{chunk-3DLYAPK7.cjs → chunk-P4GY3Z4G.cjs} +5 -5
  28. package/dist/{chunk-3DLYAPK7.cjs.map → chunk-P4GY3Z4G.cjs.map} +1 -1
  29. package/dist/{chunk-AXZUKNXF.js → chunk-TYWFKCPY.js} +4 -4
  30. package/dist/{chunk-AXZUKNXF.js.map → chunk-TYWFKCPY.js.map} +1 -1
  31. package/dist/{chunk-IIDBEYQH.cjs → chunk-VH5R473P.cjs} +91 -95
  32. package/dist/chunk-VH5R473P.cjs.map +1 -0
  33. package/dist/{chunk-FXAHNPBP.js → chunk-X42BGR6P.js} +950 -241
  34. package/dist/chunk-X42BGR6P.js.map +1 -0
  35. package/dist/{chunk-ECA2WNRX.cjs → chunk-ZMAD3KJU.cjs} +9 -11
  36. package/dist/chunk-ZMAD3KJU.cjs.map +1 -0
  37. package/dist/index.cjs +102 -105
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +16 -14
  40. package/dist/index.d.ts +16 -14
  41. package/dist/index.js +48 -33
  42. package/dist/index.js.map +1 -1
  43. package/dist/loader.css +1 -1
  44. package/dist/{music-3O5MDQXY.js → music-JVRNXHQ5.js} +34 -7
  45. package/dist/music-JVRNXHQ5.js.map +1 -0
  46. package/dist/{music-4O367SPR.cjs → music-YPUZTWTN.cjs} +34 -6
  47. package/dist/music-YPUZTWTN.cjs.map +1 -0
  48. package/dist/three.cjs +6 -6
  49. package/dist/three.d.cts +2 -3
  50. package/dist/three.d.ts +2 -3
  51. package/dist/three.js +2 -2
  52. package/dist/{types-DSGwN5w1.d.cts → types-BNVsBBZf.d.cts} +130 -3
  53. package/dist/{types-DSGwN5w1.d.ts → types-BNVsBBZf.d.ts} +130 -3
  54. package/docs/api.md +5 -1
  55. package/docs/dsl.md +13 -15
  56. package/llms-full.txt +24 -22
  57. package/llms.txt +1 -1
  58. package/package.json +4 -5
  59. package/skills/pixi-effects/SKILL.md +1 -1
  60. package/skills/pixi-effects/reference/cheatsheet.md +1 -1
  61. package/skills/pixi-effects/reference/pitfalls.md +3 -3
  62. package/skills/pixi-effects/reference/recipes.md +1 -1
  63. package/skills/pixi-effects/template.html +6 -8
  64. package/dist/Composition-3O7L2VL5.js +0 -7
  65. package/dist/Composition-EE3KEE2L.cjs +0 -16
  66. package/dist/chunk-A225HYSY.cjs.map +0 -1
  67. package/dist/chunk-ECA2WNRX.cjs.map +0 -1
  68. package/dist/chunk-FXAHNPBP.js.map +0 -1
  69. package/dist/chunk-IIDBEYQH.cjs.map +0 -1
  70. package/dist/chunk-TLYTYBWX.js.map +0 -1
  71. package/dist/chunk-WMMZDPWK.js.map +0 -1
  72. package/dist/music-3O5MDQXY.js.map +0 -1
  73. package/dist/music-4O367SPR.cjs.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,9 +1,8 @@
1
- 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, M as MotionBlurOptions, i as MotionBlurSpec, j as Movie, k as MovieErrorEvent, l as MovieOptions, O as OnionSkinOptions, P as ProgressEvent, R as RenderOptions, m as ReviewOptions, n as ReviewReport, S as SnapshotOptions, o as SoundMeasure, p as StopEvent, q as StopImage, r as StopImagesOptions, T as TimelineData, s as TimelineHtmlOptions, t as TimelineRow, u as TimelineSvgOptions, v as TimelineTransition, V as VolumeEvent, w as dismissLoader, x as failLoader, y as resolveLoader } from './Movie-BWLLWRRe.cjs';
2
- import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, P as Props, b as TransitionSpec, c as CompositionSpec, d as SequenceCommon } from './types-DSGwN5w1.cjs';
3
- export { A as ArcShapeSpec, e as AssetSpec, f as AudioAssetSpec, g as AudioMusicSpec, h as AudioSequenceSpec, i as AudioSfxSpec, B as BlendModeName, j as ChromaKeyFilterSpec, k as CircleShapeSpec, l as CompositionSequenceSpec, m as CrossfadeTransition, n as CustomFilterSpec, D as DipTransition, o as DissolveTransition, E as EllipseShapeSpec, p as Expr, F as FilterSpec, G as GradientSpec, q as IrisTransition, L as LightSequenceSpec, r as LineShapeSpec, s as LumaTransition, t as MaskRefSpec, u as MatteRefSpec, v as MusicDrum, w as MusicDrums, x as MusicInstrument, y as MusicLevel, z as MusicTrack, N as NullSequenceSpec, H as PathShapeSpec, J as PolygonShapeSpec, O as PropValue, R as RectShapeSpec, Q as SfxKnobs, U as SfxOptions, V as SfxPreset, W as SfxVoice, X as ShaderSequenceSpec, Y as ShapeSequenceSpec, Z as SlideTransition, _ as Stop, $ as StopSpec, a0 as TransitionCommon, a1 as VideoSequenceSpec, a2 as WipeTransition, a3 as ZoomTransition, a4 as normalizeStops, a5 as pictureStops } from './types-DSGwN5w1.cjs';
4
- import { S as Sequence } from './Base-TbBhHPrG.cjs';
1
+ 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, M as MotionBlurOptions, i as MotionBlurSpec, j as Movie, k as MovieErrorEvent, l as MovieOptions, O as OnionSkinOptions, P as ProgressEvent, R as RenderOptions, m as ReviewOptions, n as ReviewReport, S as SnapshotOptions, o as SoundMeasure, p as StopEvent, q as StopImage, r as StopImagesOptions, T as TimelineData, s as TimelineHtmlOptions, t as TimelineRow, u as TimelineSvgOptions, v as TimelineTransition, V as VolumeEvent, w as dismissLoader, x as failLoader, y as resolveLoader } from './Movie-CbYwTs6U.cjs';
2
+ import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, P as Props, b as TransitionSpec, c as CompositionSpec, d as SequenceCommon } from './types-BNVsBBZf.cjs';
3
+ export { A as ArcShapeSpec, e as AssetSpec, f as AudioAssetSpec, g as AudioMusicSpec, h as AudioSequenceSpec, i as AudioSfxSpec, B as BlendModeName, j as ChromaKeyFilterSpec, k as CircleShapeSpec, l as CompositionSequenceSpec, m as CrossfadeTransition, n as CustomFilterSpec, D as DipTransition, o as DissolveTransition, E as EllipseShapeSpec, p as Expr, F as FilterSpec, G as GradientSpec, q as IrisTransition, L as LightSequenceSpec, r as LineShapeSpec, s as LumaTransition, t as MaskRefSpec, u as MatteRefSpec, v as MusicDrum, w as MusicDrums, x as MusicInstrument, y as MusicLevel, z as MusicTrack, N as NullSequenceSpec, H as PathShapeSpec, J as PolygonShapeSpec, O as PropValue, R as RectShapeSpec, Q as SfxKnobs, U as SfxOptions, V as SfxPreset, W as SfxVoice, X as ShaderSequenceSpec, Y as ShapeSequenceSpec, Z as SlideTransition, _ as Stop, $ as StopSpec, a0 as TransitionCommon, a1 as VideoSequenceSpec, a2 as WipeTransition, a3 as ZoomTransition, a4 as normalizeStops, a5 as pictureStops } from './types-BNVsBBZf.cjs';
4
+ import { S as Sequence } from './Base-DjhdL8B1.cjs';
5
5
  import 'pixi.js';
6
- import 'gsap';
7
6
 
8
7
  /** A text style as written in a `text` layer's `style` (numbers, not expressions, for the fields that size the text). */
9
8
  type MeasureStyle = Record<string, unknown>;
@@ -60,6 +59,9 @@ type SequenceCtor = {
60
59
  /** Register an external sequence type. Later registrations overwrite earlier ones. */
61
60
  declare function registerSequenceType(type: string, ctor: SequenceCtor): void;
62
61
 
62
+ /** Resolve an ease name to a function (0–1 → 0–1). An unknown name warns once and runs as the default ease, `power1.out`. */
63
+ declare function parseEase(name: string): (p: number) => number;
64
+
63
65
  type KenBurnsOptions = KenBurnsBase & ({
64
66
  motion: 'still';
65
67
  } | KenBurnsScale | KenBurnsRotation | KenBurnsPosition);
@@ -74,7 +76,7 @@ interface KenBurnsBase {
74
76
  duration: number;
75
77
  /** How the image fills the canvas. Default `'cover'`. */
76
78
  fit?: 'cover' | 'contain';
77
- /** GSAP easing name. Default `'sine.inOut'`. */
79
+ /** Ease name. Default `'sine.inOut'`. */
78
80
  ease?: string;
79
81
  }
80
82
  interface KenBurnsScale {
@@ -128,7 +130,7 @@ interface OrbitOptions {
128
130
  height?: number;
129
131
  /** Vertical field of view, degrees. Default 40. Written to the camera. */
130
132
  fov?: number;
131
- /** Easing of the sweep as a whole (any GSAP ease). Default `'sine.inOut'`. */
133
+ /** Easing of the sweep as a whole (any ease name). Default `'sine.inOut'`. */
132
134
  ease?: string;
133
135
  /**
134
136
  * A dolly zoom while orbiting: `fov` animates from `from` to `to` (degrees) and the radius follows it
@@ -241,7 +243,7 @@ interface FollowPathOptions {
241
243
  at?: number;
242
244
  /** How long the trip takes, in seconds. Required. */
243
245
  duration: number;
244
- /** GSAP ease for the progress along the path (default `'none'`: constant speed). */
246
+ /** Ease for the progress along the path (default `'none'`: constant speed). */
245
247
  ease?: string;
246
248
  /** Where on the path to start and stop, as fractions 0–1 of its length (default 0 → 1). `from: 1, to: 0` goes backwards. */
247
249
  from?: number;
@@ -275,7 +277,7 @@ interface CameraPathOptions {
275
277
  at?: number;
276
278
  /** How long the flight takes, in seconds. Required. */
277
279
  duration: number;
278
- /** GSAP ease for the progress along the route (default `'none'`: constant speed; `'power2.in'` is an accelerating rush). */
280
+ /** Ease for the progress along the route (default `'none'`: constant speed; `'power2.in'` is an accelerating rush). */
279
281
  ease?: string;
280
282
  /** Where the camera looks: a fixed `[x, y, z]`, or `'ahead'` (default): a point further along the route, so it faces where it flies. */
281
283
  look?: [number, number, number] | 'ahead';
@@ -312,13 +314,13 @@ interface StaggerOptions {
312
314
  from?: 'start' | 'end' | 'center' | 'edges' | 'random' | number;
313
315
  /** `[columns, rows]`: the items fill a grid row by row and the wave travels by straight-line distance across it. */
314
316
  grid?: [number, number];
315
- /** GSAP ease that reshapes the spread (default `'none'`: even steps). The first stays at 0, the last at the full spread. */
317
+ /** Ease that reshapes the spread (default `'none'`: even steps). The first stays at 0, the last at the full spread. */
316
318
  ease?: string;
317
319
  /** For `from: 'random'`: another seed is another order. Default 0. */
318
320
  seed?: number;
319
321
  }
320
322
  /**
321
- * Delays for a wave of items, in seconds, in the style of GSAP's `stagger`.
323
+ * Delays for a wave of items, in seconds, in the style of GSAP's `stagger` (its names, with thanks).
322
324
  *
323
325
  * stagger(6, { each: 0.08 }) // [0, 0.08, 0.16, …] use: `at: 1 + d[i]`
324
326
  * stagger(letters, { each: 0.05, from: 'center' }) // the same layers with their `at` pushed back
@@ -400,7 +402,7 @@ interface AnimateTextTween {
400
402
  to?: Record<string, number>;
401
403
  /** Seconds each piece takes. */
402
404
  duration?: number;
403
- /** GSAP ease. */
405
+ /** Ease name. */
404
406
  ease?: string;
405
407
  }
406
408
  interface AnimateTextOptions {
@@ -654,7 +656,7 @@ interface WiggleOptions {
654
656
  freq?: number;
655
657
  /** Another seed is another take of the same shake. Default 0. */
656
658
  seed?: number;
657
- /** GSAP ease between targets. Default `'sine.inOut'`; `'none'` gives straight, jittery lines. */
659
+ /** Ease between targets. Default `'sine.inOut'`; `'none'` gives straight, jittery lines. */
658
660
  ease?: string;
659
661
  /** The properties to move, each independently: `{ x: { around: 960, amp: 6 }, rotation: { around: 0, amp: 1.5 } }`. */
660
662
  props: Record<string, WiggleProp>;
@@ -716,4 +718,4 @@ interface WithFadeOptions {
716
718
  */
717
719
  declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
718
720
 
719
- export { type AnimateTextOptions, type AnimateTextTween, type AudioEnvelope, type AudioEnvelopeSource, type CameraPathOptions, CameraSequenceSpec, CompositionSpec, type DeckOptions, type DeckPage, type DeckResult, type DeckTransition, type EnvelopeOptions, type FollowPathOptions, ImageSequenceSpec, type KenBurnsOptions, Keyframe, type MeasureStyle, MusicOptions, type OrbitOptions, type ParticlesOptions, Props, type ReactOptions, type ReactProp, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type StaggerOptions, type TextPiece, type TextPreset, TextSequenceSpec, type TextSize, TransitionSpec, type WiggleOptions, type WiggleProp, type WithFadeOptions, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, deck, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, noise, orbit, particles, rand, random, react, registerSequenceType, splitText, stagger, wiggle, withFade };
721
+ export { type AnimateTextOptions, type AnimateTextTween, type AudioEnvelope, type AudioEnvelopeSource, type CameraPathOptions, CameraSequenceSpec, CompositionSpec, type DeckOptions, type DeckPage, type DeckResult, type DeckTransition, type EnvelopeOptions, type FollowPathOptions, ImageSequenceSpec, type KenBurnsOptions, Keyframe, type MeasureStyle, MusicOptions, type OrbitOptions, type ParticlesOptions, Props, type ReactOptions, type ReactProp, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type StaggerOptions, type TextPiece, type TextPreset, TextSequenceSpec, type TextSize, TransitionSpec, type WiggleOptions, type WiggleProp, type WithFadeOptions, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, deck, parseEase as ease, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, noise, orbit, particles, rand, random, react, registerSequenceType, splitText, stagger, wiggle, withFade };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- 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, M as MotionBlurOptions, i as MotionBlurSpec, j as Movie, k as MovieErrorEvent, l as MovieOptions, O as OnionSkinOptions, P as ProgressEvent, R as RenderOptions, m as ReviewOptions, n as ReviewReport, S as SnapshotOptions, o as SoundMeasure, p as StopEvent, q as StopImage, r as StopImagesOptions, T as TimelineData, s as TimelineHtmlOptions, t as TimelineRow, u as TimelineSvgOptions, v as TimelineTransition, V as VolumeEvent, w as dismissLoader, x as failLoader, y as resolveLoader } from './Movie-BkP82KXS.js';
2
- import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, P as Props, b as TransitionSpec, c as CompositionSpec, d as SequenceCommon } from './types-DSGwN5w1.js';
3
- export { A as ArcShapeSpec, e as AssetSpec, f as AudioAssetSpec, g as AudioMusicSpec, h as AudioSequenceSpec, i as AudioSfxSpec, B as BlendModeName, j as ChromaKeyFilterSpec, k as CircleShapeSpec, l as CompositionSequenceSpec, m as CrossfadeTransition, n as CustomFilterSpec, D as DipTransition, o as DissolveTransition, E as EllipseShapeSpec, p as Expr, F as FilterSpec, G as GradientSpec, q as IrisTransition, L as LightSequenceSpec, r as LineShapeSpec, s as LumaTransition, t as MaskRefSpec, u as MatteRefSpec, v as MusicDrum, w as MusicDrums, x as MusicInstrument, y as MusicLevel, z as MusicTrack, N as NullSequenceSpec, H as PathShapeSpec, J as PolygonShapeSpec, O as PropValue, R as RectShapeSpec, Q as SfxKnobs, U as SfxOptions, V as SfxPreset, W as SfxVoice, X as ShaderSequenceSpec, Y as ShapeSequenceSpec, Z as SlideTransition, _ as Stop, $ as StopSpec, a0 as TransitionCommon, a1 as VideoSequenceSpec, a2 as WipeTransition, a3 as ZoomTransition, a4 as normalizeStops, a5 as pictureStops } from './types-DSGwN5w1.js';
4
- import { S as Sequence } from './Base-CpdDs4HT.js';
1
+ 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, M as MotionBlurOptions, i as MotionBlurSpec, j as Movie, k as MovieErrorEvent, l as MovieOptions, O as OnionSkinOptions, P as ProgressEvent, R as RenderOptions, m as ReviewOptions, n as ReviewReport, S as SnapshotOptions, o as SoundMeasure, p as StopEvent, q as StopImage, r as StopImagesOptions, T as TimelineData, s as TimelineHtmlOptions, t as TimelineRow, u as TimelineSvgOptions, v as TimelineTransition, V as VolumeEvent, w as dismissLoader, x as failLoader, y as resolveLoader } from './Movie-ILKq2fw_.js';
2
+ import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, K as Keyframe, T as TextSequenceSpec, M as MusicOptions, P as Props, b as TransitionSpec, c as CompositionSpec, d as SequenceCommon } from './types-BNVsBBZf.js';
3
+ export { A as ArcShapeSpec, e as AssetSpec, f as AudioAssetSpec, g as AudioMusicSpec, h as AudioSequenceSpec, i as AudioSfxSpec, B as BlendModeName, j as ChromaKeyFilterSpec, k as CircleShapeSpec, l as CompositionSequenceSpec, m as CrossfadeTransition, n as CustomFilterSpec, D as DipTransition, o as DissolveTransition, E as EllipseShapeSpec, p as Expr, F as FilterSpec, G as GradientSpec, q as IrisTransition, L as LightSequenceSpec, r as LineShapeSpec, s as LumaTransition, t as MaskRefSpec, u as MatteRefSpec, v as MusicDrum, w as MusicDrums, x as MusicInstrument, y as MusicLevel, z as MusicTrack, N as NullSequenceSpec, H as PathShapeSpec, J as PolygonShapeSpec, O as PropValue, R as RectShapeSpec, Q as SfxKnobs, U as SfxOptions, V as SfxPreset, W as SfxVoice, X as ShaderSequenceSpec, Y as ShapeSequenceSpec, Z as SlideTransition, _ as Stop, $ as StopSpec, a0 as TransitionCommon, a1 as VideoSequenceSpec, a2 as WipeTransition, a3 as ZoomTransition, a4 as normalizeStops, a5 as pictureStops } from './types-BNVsBBZf.js';
4
+ import { S as Sequence } from './Base-CKGl6jCo.js';
5
5
  import 'pixi.js';
6
- import 'gsap';
7
6
 
8
7
  /** A text style as written in a `text` layer's `style` (numbers, not expressions, for the fields that size the text). */
9
8
  type MeasureStyle = Record<string, unknown>;
@@ -60,6 +59,9 @@ type SequenceCtor = {
60
59
  /** Register an external sequence type. Later registrations overwrite earlier ones. */
61
60
  declare function registerSequenceType(type: string, ctor: SequenceCtor): void;
62
61
 
62
+ /** Resolve an ease name to a function (0–1 → 0–1). An unknown name warns once and runs as the default ease, `power1.out`. */
63
+ declare function parseEase(name: string): (p: number) => number;
64
+
63
65
  type KenBurnsOptions = KenBurnsBase & ({
64
66
  motion: 'still';
65
67
  } | KenBurnsScale | KenBurnsRotation | KenBurnsPosition);
@@ -74,7 +76,7 @@ interface KenBurnsBase {
74
76
  duration: number;
75
77
  /** How the image fills the canvas. Default `'cover'`. */
76
78
  fit?: 'cover' | 'contain';
77
- /** GSAP easing name. Default `'sine.inOut'`. */
79
+ /** Ease name. Default `'sine.inOut'`. */
78
80
  ease?: string;
79
81
  }
80
82
  interface KenBurnsScale {
@@ -128,7 +130,7 @@ interface OrbitOptions {
128
130
  height?: number;
129
131
  /** Vertical field of view, degrees. Default 40. Written to the camera. */
130
132
  fov?: number;
131
- /** Easing of the sweep as a whole (any GSAP ease). Default `'sine.inOut'`. */
133
+ /** Easing of the sweep as a whole (any ease name). Default `'sine.inOut'`. */
132
134
  ease?: string;
133
135
  /**
134
136
  * A dolly zoom while orbiting: `fov` animates from `from` to `to` (degrees) and the radius follows it
@@ -241,7 +243,7 @@ interface FollowPathOptions {
241
243
  at?: number;
242
244
  /** How long the trip takes, in seconds. Required. */
243
245
  duration: number;
244
- /** GSAP ease for the progress along the path (default `'none'`: constant speed). */
246
+ /** Ease for the progress along the path (default `'none'`: constant speed). */
245
247
  ease?: string;
246
248
  /** Where on the path to start and stop, as fractions 0–1 of its length (default 0 → 1). `from: 1, to: 0` goes backwards. */
247
249
  from?: number;
@@ -275,7 +277,7 @@ interface CameraPathOptions {
275
277
  at?: number;
276
278
  /** How long the flight takes, in seconds. Required. */
277
279
  duration: number;
278
- /** GSAP ease for the progress along the route (default `'none'`: constant speed; `'power2.in'` is an accelerating rush). */
280
+ /** Ease for the progress along the route (default `'none'`: constant speed; `'power2.in'` is an accelerating rush). */
279
281
  ease?: string;
280
282
  /** Where the camera looks: a fixed `[x, y, z]`, or `'ahead'` (default): a point further along the route, so it faces where it flies. */
281
283
  look?: [number, number, number] | 'ahead';
@@ -312,13 +314,13 @@ interface StaggerOptions {
312
314
  from?: 'start' | 'end' | 'center' | 'edges' | 'random' | number;
313
315
  /** `[columns, rows]`: the items fill a grid row by row and the wave travels by straight-line distance across it. */
314
316
  grid?: [number, number];
315
- /** GSAP ease that reshapes the spread (default `'none'`: even steps). The first stays at 0, the last at the full spread. */
317
+ /** Ease that reshapes the spread (default `'none'`: even steps). The first stays at 0, the last at the full spread. */
316
318
  ease?: string;
317
319
  /** For `from: 'random'`: another seed is another order. Default 0. */
318
320
  seed?: number;
319
321
  }
320
322
  /**
321
- * Delays for a wave of items, in seconds, in the style of GSAP's `stagger`.
323
+ * Delays for a wave of items, in seconds, in the style of GSAP's `stagger` (its names, with thanks).
322
324
  *
323
325
  * stagger(6, { each: 0.08 }) // [0, 0.08, 0.16, …] use: `at: 1 + d[i]`
324
326
  * stagger(letters, { each: 0.05, from: 'center' }) // the same layers with their `at` pushed back
@@ -400,7 +402,7 @@ interface AnimateTextTween {
400
402
  to?: Record<string, number>;
401
403
  /** Seconds each piece takes. */
402
404
  duration?: number;
403
- /** GSAP ease. */
405
+ /** Ease name. */
404
406
  ease?: string;
405
407
  }
406
408
  interface AnimateTextOptions {
@@ -654,7 +656,7 @@ interface WiggleOptions {
654
656
  freq?: number;
655
657
  /** Another seed is another take of the same shake. Default 0. */
656
658
  seed?: number;
657
- /** GSAP ease between targets. Default `'sine.inOut'`; `'none'` gives straight, jittery lines. */
659
+ /** Ease between targets. Default `'sine.inOut'`; `'none'` gives straight, jittery lines. */
658
660
  ease?: string;
659
661
  /** The properties to move, each independently: `{ x: { around: 960, amp: 6 }, rotation: { around: 0, amp: 1.5 } }`. */
660
662
  props: Record<string, WiggleProp>;
@@ -716,4 +718,4 @@ interface WithFadeOptions {
716
718
  */
717
719
  declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
718
720
 
719
- export { type AnimateTextOptions, type AnimateTextTween, type AudioEnvelope, type AudioEnvelopeSource, type CameraPathOptions, CameraSequenceSpec, CompositionSpec, type DeckOptions, type DeckPage, type DeckResult, type DeckTransition, type EnvelopeOptions, type FollowPathOptions, ImageSequenceSpec, type KenBurnsOptions, Keyframe, type MeasureStyle, MusicOptions, type OrbitOptions, type ParticlesOptions, Props, type ReactOptions, type ReactProp, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type StaggerOptions, type TextPiece, type TextPreset, TextSequenceSpec, type TextSize, TransitionSpec, type WiggleOptions, type WiggleProp, type WithFadeOptions, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, deck, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, noise, orbit, particles, rand, random, react, registerSequenceType, splitText, stagger, wiggle, withFade };
721
+ export { type AnimateTextOptions, type AnimateTextTween, type AudioEnvelope, type AudioEnvelopeSource, type CameraPathOptions, CameraSequenceSpec, CompositionSpec, type DeckOptions, type DeckPage, type DeckResult, type DeckTransition, type EnvelopeOptions, type FollowPathOptions, ImageSequenceSpec, type KenBurnsOptions, Keyframe, type MeasureStyle, MusicOptions, type OrbitOptions, type ParticlesOptions, Props, type ReactOptions, type ReactProp, SequenceCommon, type SequenceCtor, SequenceSpec, type SplitOptions, type StaggerOptions, type TextPiece, type TextPreset, TextSequenceSpec, type TextSize, TransitionSpec, type WiggleOptions, type WiggleProp, type WithFadeOptions, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, deck, parseEase as ease, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, noise, orbit, particles, rand, random, react, registerSequenceType, splitText, stagger, wiggle, withFade };
package/dist/index.js CHANGED
@@ -1,13 +1,10 @@
1
- import { CompositionSequence, maskSourceOf } from './chunk-WMMZDPWK.js';
2
- import { ensureFilterLibrary, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, rand, DEG, timeRemapOf, contentLength, resolveAt, checkEase } from './chunk-FXAHNPBP.js';
3
- export { noise, rand, random, registerSequenceType } from './chunk-FXAHNPBP.js';
4
- import { usesAdvancedBlend, enableAdvancedBlend } from './chunk-AXZUKNXF.js';
5
- import { collectPropKeys } from './chunk-TLYTYBWX.js';
1
+ import { CompositionSequence, maskSourceOf } from './chunk-AR3HVHKF.js';
2
+ import { createTimeline, lengthen, ensureFilterLibrary, checkEase, parseEase, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, rand, DEG, timeRemapOf, contentLength, resolveAt } from './chunk-X42BGR6P.js';
3
+ export { noise, rand, random, registerSequenceType } from './chunk-X42BGR6P.js';
4
+ import { usesAdvancedBlend, enableAdvancedBlend } from './chunk-TYWFKCPY.js';
5
+ import { collectPropKeys } from './chunk-45QKLD6M.js';
6
6
  import { warnUnknownOptions, suggestName } from './chunk-BXOCEZ4U.js';
7
- import * as PIXI from 'pixi.js';
8
7
  import { extensions, CullerPlugin, Application, Container, Rectangle, Culler, CanvasTextMetrics, TextStyle, Assets, ExtensionType, Filter, Texture, UniformGroup, GpuProgram, GlProgram, defaultFilterVert } from 'pixi.js';
9
- import { gsap } from 'gsap';
10
- import { PixiPlugin } from 'gsap/PixiPlugin';
11
8
  import { Output, BufferTarget, CanvasSource, AudioBufferSource, Input, ALL_FORMATS, BlobSource, WavOutputFormat, Conversion, VideoSampleSink, OggOutputFormat, QUALITY_VERY_HIGH, QUALITY_HIGH, QUALITY_MEDIUM, QUALITY_LOW, QUALITY_VERY_LOW, MkvOutputFormat, WebMOutputFormat, MovOutputFormat, Mp4OutputFormat, canEncodeVideo, getFirstEncodableAudioCodec } from 'mediabunny';
12
9
 
13
10
  var registered = false;
@@ -147,16 +144,19 @@ function clockReach(a, total) {
147
144
  }
148
145
 
149
146
  // src/core/AudioMixer.ts
150
- async function mixdown(audios, totalDuration, sampleRate = 44100) {
147
+ async function mixdown(audios, totalDuration, sampleRate = 44100, pace) {
151
148
  if (audios.length === 0) return null;
149
+ const weight = (a) => a.synth ? Math.max(1, a.end - a.start) : 0.2;
150
+ const all = audios.reduce((s, a) => s + weight(a), 0) + 0.5;
151
+ let made = 0;
152
152
  const ctx = new OfflineAudioContext(2, Math.ceil(sampleRate * totalDuration), sampleRate);
153
153
  const synthesised = /* @__PURE__ */ new Map();
154
- const bufferOf = (a) => {
154
+ const bufferOf = async (a, inner) => {
155
155
  if (a.buffer) return a.buffer;
156
156
  if (!a.synth) return null;
157
157
  let buf = synthesised.get(a.synth.key);
158
158
  if (!buf) {
159
- const [left, right] = a.synth.render(sampleRate);
159
+ const [left, right] = a.synth.renderAsync ? await a.synth.renderAsync(sampleRate, inner) : a.synth.render(sampleRate);
160
160
  buf = ctx.createBuffer(2, left.length, sampleRate);
161
161
  buf.getChannelData(0).set(left);
162
162
  buf.getChannelData(1).set(right);
@@ -165,7 +165,10 @@ async function mixdown(audios, totalDuration, sampleRate = 44100) {
165
165
  return buf;
166
166
  };
167
167
  for (const a of audios) {
168
- const buffer = bufferOf(a);
168
+ const w = weight(a), base = made;
169
+ const buffer = await bufferOf(a, pace ? (f) => pace((base + w * f) / all) : void 0);
170
+ made += w;
171
+ if (pace) await pace(made / all);
169
172
  if (!buffer) continue;
170
173
  if (a.warp || a.sourceMap) {
171
174
  const r = resampleThrough(a, buffer.getChannelData(0), buffer.numberOfChannels > 1 ? buffer.getChannelData(1) : buffer.getChannelData(0), buffer.sampleRate, sampleRate, totalDuration);
@@ -2409,6 +2412,7 @@ var LoadProgress = class {
2409
2412
  _onChange;
2410
2413
  _stage = null;
2411
2414
  _loaded = 0;
2415
+ _part = 0;
2412
2416
  _total = 0;
2413
2417
  _high = 0;
2414
2418
  _started = 0;
@@ -2426,6 +2430,7 @@ var LoadProgress = class {
2426
2430
  this._closeTiming();
2427
2431
  this._stage = stage;
2428
2432
  this._loaded = 0;
2433
+ this._part = 0;
2429
2434
  this._total = Math.max(0, total);
2430
2435
  this._started = this._now();
2431
2436
  this._emit();
@@ -2433,6 +2438,13 @@ var LoadProgress = class {
2433
2438
  tick(n = 1) {
2434
2439
  if (!this._stage) return;
2435
2440
  this._loaded = Math.min(this._total, this._loaded + n);
2441
+ this._part = 0;
2442
+ this._emit();
2443
+ }
2444
+ /** How much of the item being worked on is done (0..1), for an item that takes long: the number moves between two `tick`s. */
2445
+ part(done) {
2446
+ if (!this._stage) return;
2447
+ this._part = Math.min(1, Math.max(0, done));
2436
2448
  this._emit();
2437
2449
  }
2438
2450
  /** Everything is done: 1, whatever stage it was in. */
@@ -2464,7 +2476,7 @@ var LoadProgress = class {
2464
2476
  if (s === stage) break;
2465
2477
  done += WEIGHT[s];
2466
2478
  }
2467
- const within = this._total > 0 ? this._loaded / this._total : 1;
2479
+ const within = this._total > 0 ? Math.min(1, (this._loaded + this._part) / this._total) : 1;
2468
2480
  this._high = Math.min(1, Math.max(this._high, done + WEIGHT[stage] * within));
2469
2481
  this._onChange({ stage, loaded: this._loaded, total: this._total, progress: this._high });
2470
2482
  }
@@ -2523,8 +2535,6 @@ function setLoaderProgress(loader, state) {
2523
2535
 
2524
2536
  // src/core/Movie.ts
2525
2537
  extensions.add(CullerPlugin);
2526
- gsap.registerPlugin(PixiPlugin);
2527
- PixiPlugin.registerPIXI(PIXI);
2528
2538
  var Movie = class {
2529
2539
  _events = {};
2530
2540
  _initState = "idle";
@@ -2660,8 +2670,8 @@ var Movie = class {
2660
2670
  this.stops = normalizeStops(options.composition?.stops, this.duration, this.frameRate);
2661
2671
  this._posterFrame = poster.frame;
2662
2672
  this.background = options.background ?? "#000000";
2663
- this.timeline = gsap.timeline({ paused: true, defaults: { ease: "none" } });
2664
- this.timeline.add(gsap.to({}, { duration: this.duration }));
2673
+ this.timeline = createTimeline({ paused: true, defaults: { ease: "none" } });
2674
+ lengthen(this.timeline, this.duration);
2665
2675
  const baseAppOptions = {
2666
2676
  width: this.width,
2667
2677
  height: this.height,
@@ -2739,15 +2749,18 @@ var Movie = class {
2739
2749
  this._timeFilters = collectTimeFilters(composition);
2740
2750
  const audios = [];
2741
2751
  composition.collectAudio(audios, 0);
2742
- lp.begin("sound", audios.length);
2752
+ lp.begin("sound", 1);
2743
2753
  if (audios.length > 0) {
2744
- this.audioBuffer = await mixdown(audios, this.duration, audioContext.sampleRate);
2745
- lp.tick(audios.length);
2754
+ this.audioBuffer = await mixdown(audios, this.duration, audioContext.sampleRate, async (done) => {
2755
+ lp.part(done);
2756
+ await lp.yieldIfDue();
2757
+ });
2758
+ lp.tick();
2746
2759
  if (this.audioBuffer) this._mixStats = limitMix(this.audioBuffer, audios);
2747
2760
  }
2748
2761
  this._audioSources = audios;
2749
- this.timeline.progress(1).progress(0);
2750
2762
  lp.begin("frames", 0);
2763
+ this.timeline.time(this._timeOf(0));
2751
2764
  await this._awaitVideoFrames();
2752
2765
  this._updateSpace();
2753
2766
  this._renderNow();
@@ -3452,6 +3465,12 @@ function splitText(text, style = {}, opts = {}) {
3452
3465
  return out;
3453
3466
  }
3454
3467
 
3468
+ // src/presets/_ease.ts
3469
+ function parseEase2(name) {
3470
+ checkEase(name, "a preset");
3471
+ return parseEase(name);
3472
+ }
3473
+
3455
3474
  // src/presets/kenBurns.ts
3456
3475
  var KEN_BURNS_KEYS = ["asset", "name", "at", "duration", "fit", "ease", "motion", "origin", "zoom", "direction", "angle", "from", "to"];
3457
3476
  function kenBurns(opts) {
@@ -3564,10 +3583,6 @@ function kenBurns(opts) {
3564
3583
  function clamp(v, lo, hi) {
3565
3584
  return Math.max(lo, Math.min(hi, v));
3566
3585
  }
3567
- function parseEase(name) {
3568
- checkEase(name, "a preset");
3569
- return gsap.parseEase(name);
3570
- }
3571
3586
 
3572
3587
  // src/presets/orbit.ts
3573
3588
  var ORBIT_KEYS = ["duration", "degrees", "start", "radius", "center", "width", "height", "fov", "ease", "dollyZoom", "at", "name", "stepsPerSecond"];
@@ -3591,8 +3606,8 @@ function orbit(opts) {
3591
3606
  const fixedR = opts.radius ?? homeDistance(height, fov ?? DEFAULT_FOV);
3592
3607
  const start = opts.start ?? -degrees / 2;
3593
3608
  const steps = Math.max(1, Math.round(duration * stepsPerSecond));
3594
- const easeFn = parseEase(ease);
3595
- const dollyEase = dolly ? parseEase(dolly.ease ?? ease) : null;
3609
+ const easeFn = parseEase2(ease);
3610
+ const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
3596
3611
  const pos = (i) => {
3597
3612
  const p = i / steps;
3598
3613
  const a = (start + degrees * easeFn(p)) * DEG;
@@ -3762,7 +3777,7 @@ function followPath(opts) {
3762
3777
  const t = Math.min(Math.max((s - g.start) / g.len, 0), 1);
3763
3778
  return { x: g.x0 + (g.x1 - g.x0) * t, y: g.y0 + (g.y1 - g.y0) * t, heading: Math.atan2(g.y1 - g.y0, g.x1 - g.x0) * 180 / Math.PI };
3764
3779
  };
3765
- const shape = parseEase(ease);
3780
+ const shape = parseEase2(ease);
3766
3781
  const round3 = (v) => Math.round(v * 1e6) / 1e6;
3767
3782
  let turn = 0;
3768
3783
  const sample = (k) => {
@@ -3839,7 +3854,7 @@ function cameraPath(opts) {
3839
3854
  const a = curve[i], b = curve[i + 1];
3840
3855
  return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
3841
3856
  };
3842
- const shape = parseEase(ease);
3857
+ const shape = parseEase2(ease);
3843
3858
  const round3 = (v) => Math.round(v * 1e6) / 1e6;
3844
3859
  const sample = (k) => {
3845
3860
  const p = from + (to - from) * shape(k / steps);
@@ -3881,7 +3896,7 @@ function stagger(items, options = {}) {
3881
3896
  const dist2 = distances(n, from, grid, seed);
3882
3897
  const max = dist2.reduce((m, d) => Math.max(m, d), 0);
3883
3898
  const total = amount !== void 0 ? amount : (each ?? 0.1) * max;
3884
- const shape = parseEase(ease);
3899
+ const shape = parseEase2(ease);
3885
3900
  const clamp01 = (v) => Math.min(1, Math.max(0, v));
3886
3901
  const delays = dist2.map((d) => max === 0 ? 0 : Math.round(total * clamp01(shape(d / max)) * 1e6) / 1e6);
3887
3902
  if (isCount) return delays;
@@ -4317,7 +4332,7 @@ async function audioEnvelope(source, options = {}) {
4317
4332
 
4318
4333
  // src/audio/musicEnvelope.ts
4319
4334
  async function musicEnvelope(music, options = {}) {
4320
- const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-3O5MDQXY.js');
4335
+ const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-JVRNXHQ5.js');
4321
4336
  const messages = [];
4322
4337
  const m = resolveMusic(music, "musicEnvelope()", (msg) => messages.push(msg));
4323
4338
  if (!m) throw new Error(`pixi-effects: musicEnvelope(): ${messages.join(" ") || "the music has nothing to play"}`);
@@ -4330,7 +4345,7 @@ async function musicEnvelope(music, options = {}) {
4330
4345
 
4331
4346
  // src/audio/musicBuffer.ts
4332
4347
  async function musicBuffer(music, options = {}) {
4333
- const { resolveMusic, renderMusic, musicLength } = await import('./music-3O5MDQXY.js');
4348
+ const { resolveMusic, renderMusic, musicLength } = await import('./music-JVRNXHQ5.js');
4334
4349
  const messages = [];
4335
4350
  const m = resolveMusic(music, "musicBuffer()", (msg) => messages.push(msg));
4336
4351
  if (!m) throw new Error(`pixi-effects: musicBuffer(): ${messages.join(" ") || "the music has nothing to play"}`);
@@ -4426,6 +4441,6 @@ function withFade(spec, opts) {
4426
4441
  return spec;
4427
4442
  }
4428
4443
 
4429
- export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, deck, dismissLoader, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, normalizeStops, orbit, particles, pictureStops, react, resolveLoader, splitText, stagger, wiggle, withFade };
4444
+ export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, deck, dismissLoader, parseEase2 as ease, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, normalizeStops, orbit, particles, pictureStops, react, resolveLoader, splitText, stagger, wiggle, withFade };
4430
4445
  //# sourceMappingURL=index.js.map
4431
4446
  //# sourceMappingURL=index.js.map