pixi-effects 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRN5FWGGM_cjs = require('./chunk-RN5FWGGM.cjs');
3
+ var chunkWVZLAIKK_cjs = require('./chunk-WVZLAIKK.cjs');
4
4
  require('./chunk-3HZV3UHU.cjs');
5
5
  var chunkX62H3RBG_cjs = require('./chunk-X62H3RBG.cjs');
6
6
  var chunkLQDDDIC4_cjs = require('./chunk-LQDDDIC4.cjs');
@@ -12,99 +12,99 @@ var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
12
12
 
13
13
  Object.defineProperty(exports, "Movie", {
14
14
  enumerable: true,
15
- get: function () { return chunkRN5FWGGM_cjs.Movie; }
15
+ get: function () { return chunkWVZLAIKK_cjs.Movie; }
16
16
  });
17
17
  Object.defineProperty(exports, "animateText", {
18
18
  enumerable: true,
19
- get: function () { return chunkRN5FWGGM_cjs.animateText; }
19
+ get: function () { return chunkWVZLAIKK_cjs.animateText; }
20
20
  });
21
21
  Object.defineProperty(exports, "audioEnvelope", {
22
22
  enumerable: true,
23
- get: function () { return chunkRN5FWGGM_cjs.audioEnvelope; }
23
+ get: function () { return chunkWVZLAIKK_cjs.audioEnvelope; }
24
24
  });
25
25
  Object.defineProperty(exports, "bpmEnvelope", {
26
26
  enumerable: true,
27
- get: function () { return chunkRN5FWGGM_cjs.bpmEnvelope; }
27
+ get: function () { return chunkWVZLAIKK_cjs.bpmEnvelope; }
28
28
  });
29
29
  Object.defineProperty(exports, "cameraPath", {
30
30
  enumerable: true,
31
- get: function () { return chunkRN5FWGGM_cjs.cameraPath; }
31
+ get: function () { return chunkWVZLAIKK_cjs.cameraPath; }
32
32
  });
33
33
  Object.defineProperty(exports, "computeEnvelope", {
34
34
  enumerable: true,
35
- get: function () { return chunkRN5FWGGM_cjs.computeEnvelope; }
35
+ get: function () { return chunkWVZLAIKK_cjs.computeEnvelope; }
36
36
  });
37
37
  Object.defineProperty(exports, "dismissLoader", {
38
38
  enumerable: true,
39
- get: function () { return chunkRN5FWGGM_cjs.dismissLoader; }
39
+ get: function () { return chunkWVZLAIKK_cjs.dismissLoader; }
40
40
  });
41
41
  Object.defineProperty(exports, "ease", {
42
42
  enumerable: true,
43
- get: function () { return chunkRN5FWGGM_cjs.parseEase; }
43
+ get: function () { return chunkWVZLAIKK_cjs.parseEase; }
44
44
  });
45
45
  Object.defineProperty(exports, "failLoader", {
46
46
  enumerable: true,
47
- get: function () { return chunkRN5FWGGM_cjs.failLoader; }
47
+ get: function () { return chunkWVZLAIKK_cjs.failLoader; }
48
48
  });
49
49
  Object.defineProperty(exports, "followPath", {
50
50
  enumerable: true,
51
- get: function () { return chunkRN5FWGGM_cjs.followPath; }
51
+ get: function () { return chunkWVZLAIKK_cjs.followPath; }
52
52
  });
53
53
  Object.defineProperty(exports, "kenBurns", {
54
54
  enumerable: true,
55
- get: function () { return chunkRN5FWGGM_cjs.kenBurns; }
55
+ get: function () { return chunkWVZLAIKK_cjs.kenBurns; }
56
56
  });
57
57
  Object.defineProperty(exports, "measureText", {
58
58
  enumerable: true,
59
- get: function () { return chunkRN5FWGGM_cjs.measureText; }
59
+ get: function () { return chunkWVZLAIKK_cjs.measureText; }
60
60
  });
61
61
  Object.defineProperty(exports, "musicBuffer", {
62
62
  enumerable: true,
63
- get: function () { return chunkRN5FWGGM_cjs.musicBuffer; }
63
+ get: function () { return chunkWVZLAIKK_cjs.musicBuffer; }
64
64
  });
65
65
  Object.defineProperty(exports, "musicEnvelope", {
66
66
  enumerable: true,
67
- get: function () { return chunkRN5FWGGM_cjs.musicEnvelope; }
67
+ get: function () { return chunkWVZLAIKK_cjs.musicEnvelope; }
68
68
  });
69
69
  Object.defineProperty(exports, "musicEvents", {
70
70
  enumerable: true,
71
- get: function () { return chunkRN5FWGGM_cjs.musicEvents; }
71
+ get: function () { return chunkWVZLAIKK_cjs.musicEvents; }
72
72
  });
73
73
  Object.defineProperty(exports, "orbit", {
74
74
  enumerable: true,
75
- get: function () { return chunkRN5FWGGM_cjs.orbit; }
75
+ get: function () { return chunkWVZLAIKK_cjs.orbit; }
76
76
  });
77
77
  Object.defineProperty(exports, "particles", {
78
78
  enumerable: true,
79
- get: function () { return chunkRN5FWGGM_cjs.particles; }
79
+ get: function () { return chunkWVZLAIKK_cjs.particles; }
80
80
  });
81
81
  Object.defineProperty(exports, "react", {
82
82
  enumerable: true,
83
- get: function () { return chunkRN5FWGGM_cjs.react; }
83
+ get: function () { return chunkWVZLAIKK_cjs.react; }
84
84
  });
85
85
  Object.defineProperty(exports, "resolveLoader", {
86
86
  enumerable: true,
87
- get: function () { return chunkRN5FWGGM_cjs.resolveLoader; }
87
+ get: function () { return chunkWVZLAIKK_cjs.resolveLoader; }
88
88
  });
89
89
  Object.defineProperty(exports, "samplePath", {
90
90
  enumerable: true,
91
- get: function () { return chunkRN5FWGGM_cjs.samplePath; }
91
+ get: function () { return chunkWVZLAIKK_cjs.samplePath; }
92
92
  });
93
93
  Object.defineProperty(exports, "splitText", {
94
94
  enumerable: true,
95
- get: function () { return chunkRN5FWGGM_cjs.splitText; }
95
+ get: function () { return chunkWVZLAIKK_cjs.splitText; }
96
96
  });
97
97
  Object.defineProperty(exports, "stagger", {
98
98
  enumerable: true,
99
- get: function () { return chunkRN5FWGGM_cjs.stagger; }
99
+ get: function () { return chunkWVZLAIKK_cjs.stagger; }
100
100
  });
101
101
  Object.defineProperty(exports, "wiggle", {
102
102
  enumerable: true,
103
- get: function () { return chunkRN5FWGGM_cjs.wiggle; }
103
+ get: function () { return chunkWVZLAIKK_cjs.wiggle; }
104
104
  });
105
105
  Object.defineProperty(exports, "withFade", {
106
106
  enumerable: true,
107
- get: function () { return chunkRN5FWGGM_cjs.withFade; }
107
+ get: function () { return chunkWVZLAIKK_cjs.withFade; }
108
108
  });
109
109
  Object.defineProperty(exports, "Sequence", {
110
110
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-DWtxRiJ2.cjs';
1
+ export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, H as HoverOptions, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-BHGhg-fJ.cjs';
2
2
  import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, f as CameraSequenceSpec, K as Keyframe, g as TextSequenceSpec, M as MusicOptions, d as SequenceCommon } from './types-DIh93lFb.cjs';
3
3
  export { h as ArcShapeSpec, A as AssetSpec, i as AudioAssetSpec, j as AudioMusicSpec, k as AudioSequenceSpec, l as AudioSfxSpec, B as BlendModeName, m as CanvasInfo, n as CanvasSequenceSpec, o as ChromaKeyFilterSpec, p as CircleShapeSpec, q as CompositionSequenceSpec, a as CompositionSpec, r as CrossfadeTransition, s as CustomFilterSpec, D as DipTransition, t as DissolveTransition, E as EllipseShapeSpec, u as Expr, F as FilterSpec, G as GradientSpec, v as IrisTransition, L as LightSequenceSpec, w as LineShapeSpec, x as LumaTransition, y as MaskRefSpec, z as MatteRefSpec, H as MusicDrum, J as MusicDrums, N as MusicInstrument, O as MusicLevel, Q as MusicTrack, R as NullSequenceSpec, U as PathShapeSpec, V as PolygonShapeSpec, e as PropValue, P as Props, W as RectShapeSpec, X as SfxKnobs, Y as SfxOptions, Z as SfxPreset, _ as SfxVoice, $ as ShaderSequenceSpec, a0 as ShapeSequenceSpec, a1 as SlideTransition, c as SpaceNow, b as Stop, a2 as StopSpec, a3 as TextSpan, a4 as TransitionCommon, T as TransitionSpec, a5 as VideoSequenceSpec, a6 as WipeTransition, a7 as ZoomTransition } from './types-DIh93lFb.cjs';
4
4
  import { M as MusicEvents } from './soundEntry-DT13DNt8.cjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-CwqRLOzE.js';
1
+ export { C as ContactSheetOptions, F as FontReport, b as FrameEvent, H as HoverOptions, I as InspectOptions, c as InspectReport, d as IssueGroup, L as LayerInfo, e as LoadProgressState, f as LoadStage, g as LoaderOption, h as LoopEvent, i as MotionBlurOptions, a as MotionBlurSpec, M as Movie, j as MovieErrorEvent, k as MovieOptions, O as OnionSkinOptions, P as PickHit, l as PickOptions, m as ProgressEvent, R as RebuildOptions, n as RebuildReason, o as RebuildReport, p as RenderOptions, q as ReviewOptions, r as ReviewReport, S as SnapshotOptions, T as ThumbnailOptions, s as TimelineData, t as TimelineHtmlOptions, u as TimelineRow, v as TimelineSvgOptions, w as TimelineTransition, V as VolumeEvent, x as dismissLoader, y as failLoader, z as resolveLoader } from './Movie-CBVFZ1kg.js';
2
2
  import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, f as CameraSequenceSpec, K as Keyframe, g as TextSequenceSpec, M as MusicOptions, d as SequenceCommon } from './types-DIh93lFb.js';
3
3
  export { h as ArcShapeSpec, A as AssetSpec, i as AudioAssetSpec, j as AudioMusicSpec, k as AudioSequenceSpec, l as AudioSfxSpec, B as BlendModeName, m as CanvasInfo, n as CanvasSequenceSpec, o as ChromaKeyFilterSpec, p as CircleShapeSpec, q as CompositionSequenceSpec, a as CompositionSpec, r as CrossfadeTransition, s as CustomFilterSpec, D as DipTransition, t as DissolveTransition, E as EllipseShapeSpec, u as Expr, F as FilterSpec, G as GradientSpec, v as IrisTransition, L as LightSequenceSpec, w as LineShapeSpec, x as LumaTransition, y as MaskRefSpec, z as MatteRefSpec, H as MusicDrum, J as MusicDrums, N as MusicInstrument, O as MusicLevel, Q as MusicTrack, R as NullSequenceSpec, U as PathShapeSpec, V as PolygonShapeSpec, e as PropValue, P as Props, W as RectShapeSpec, X as SfxKnobs, Y as SfxOptions, Z as SfxPreset, _ as SfxVoice, $ as ShaderSequenceSpec, a0 as ShapeSequenceSpec, a1 as SlideTransition, c as SpaceNow, b as Stop, a2 as StopSpec, a3 as TextSpan, a4 as TransitionCommon, T as TransitionSpec, a5 as VideoSequenceSpec, a6 as WipeTransition, a7 as ZoomTransition } from './types-DIh93lFb.js';
4
4
  import { M as MusicEvents } from './soundEntry-DT13DNt8.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, parseEase as ease, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, particles, react, resolveLoader, samplePath, splitText, stagger, wiggle, withFade } from './chunk-Y2N6U3X5.js';
1
+ export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, parseEase as ease, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, particles, react, resolveLoader, samplePath, splitText, stagger, wiggle, withFade } from './chunk-NFJKBWYO.js';
2
2
  import './chunk-ICI6ACHY.js';
3
3
  export { Sequence, noise, noise2, rand, random, registerSequenceType } from './chunk-4QVQ5UJJ.js';
4
4
  export { inspectSound } from './chunk-UHNSL2KJ.js';
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.41.0/dist/loader.css">
4
+ * <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixi-effects@0.42.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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./chunk-RN5FWGGM.cjs');
3
+ require('./chunk-WVZLAIKK.cjs');
4
4
  require('./chunk-3HZV3UHU.cjs');
5
5
  require('./chunk-X62H3RBG.cjs');
6
6
  require('./chunk-LQDDDIC4.cjs');
@@ -1,4 +1,4 @@
1
- import { M as Movie, a as MotionBlurSpec } from './Movie-DWtxRiJ2.cjs';
1
+ import { M as Movie, a as MotionBlurSpec } from './Movie-BHGhg-fJ.cjs';
2
2
  import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DIh93lFb.cjs';
3
3
  import 'pixi.js';
4
4
  import './soundEntry-DT13DNt8.cjs';
package/dist/present.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as Movie, a as MotionBlurSpec } from './Movie-CwqRLOzE.js';
1
+ import { M as Movie, a as MotionBlurSpec } from './Movie-CBVFZ1kg.js';
2
2
  import { S as SequenceSpec, P as Props, K as Keyframe, T as TransitionSpec, a as CompositionSpec, b as Stop } from './types-DIh93lFb.js';
3
3
  import 'pixi.js';
4
4
  import './soundEntry-DT13DNt8.js';
package/dist/present.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-Y2N6U3X5.js';
1
+ import './chunk-NFJKBWYO.js';
2
2
  import './chunk-ICI6ACHY.js';
3
3
  import './chunk-4QVQ5UJJ.js';
4
4
  import './chunk-UHNSL2KJ.js';
package/dist/three.cjs CHANGED
@@ -189,6 +189,8 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
189
189
  _fogMirror = null;
190
190
  _warnedSpace = /* @__PURE__ */ new Set();
191
191
  _tracked = false;
192
+ /** Set when this layer lets its renderer go on purpose: the context loss that follows is its own doing, not the browser's. */
193
+ _closing = false;
192
194
  get _threeSpec() {
193
195
  return this.spec;
194
196
  }
@@ -245,7 +247,7 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
245
247
  this._track();
246
248
  let said = false;
247
249
  canvas.addEventListener("webglcontextlost", () => {
248
- if (said) return;
250
+ if (said || this._closing) return;
249
251
  said = true;
250
252
  console.warn(`pixi-effects: three layer${spec.name ? ` "${spec.name}"` : ""}: the browser took this layer's WebGL context away (a page keeps about 16 for all its layers, PixiJS and shader layers: too many were alive), so the layer draws nothing. Put several objects in one three layer, or destroy layers that are over`);
251
253
  });
@@ -336,6 +338,36 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
336
338
  }
337
339
  return null;
338
340
  }
341
+ /**
342
+ * `hit.three.grab(plane)`: drag a grabbed point of the scene. Returns a function of a point (u, v) of the layer's picture (0..1, v down) that gives where the pointer's ray through the layer's
343
+ * camera meets a plane through the grabbed point, and how far that is from the grabbed point (`delta`): move the object by it and it follows the pointer exactly. `plane`: `'screen'` (facing the
344
+ * camera: the default), `'floor'` (horizontal, the three y up), `'wall'` (z constant), or a normal `[x, y, z]`. null where the ray never meets it (a floor seen edge-on, behind the camera).
345
+ */
346
+ dragPlane(point, plane = "screen") {
347
+ const grabbed = new three$1.Vector3(...point);
348
+ let normal;
349
+ if (plane === "floor") normal = new three$1.Vector3(0, 1, 0);
350
+ else if (plane === "wall") normal = new three$1.Vector3(0, 0, 1);
351
+ else if (Array.isArray(plane)) normal = new three$1.Vector3(...plane).normalize();
352
+ else {
353
+ const turn = new three$1.Quaternion();
354
+ this._camera?.updateMatrixWorld();
355
+ this._camera?.getWorldQuaternion(turn);
356
+ normal = new three$1.Vector3(0, 0, 1).applyQuaternion(turn);
357
+ }
358
+ const surface = new three$1.Plane().setFromNormalAndCoplanarPoint(normal, grabbed);
359
+ return (u, v) => {
360
+ const scene = this._scene, camera = this._camera;
361
+ if (!scene || !camera) return null;
362
+ scene.updateMatrixWorld();
363
+ camera.updateMatrixWorld();
364
+ const ray = new three$1.Raycaster();
365
+ ray.setFromCamera(new three$1.Vector2(u * 2 - 1, -(v * 2 - 1)), camera);
366
+ const at = ray.ray.intersectPlane(surface, new three$1.Vector3());
367
+ if (!at) return null;
368
+ return { point: at.toArray(), delta: at.clone().sub(grabbed).toArray() };
369
+ };
370
+ }
339
371
  /**
340
372
  * The determinism check (`check`, `movie.review()`): the scene drawn at a few moments in two orders, with one draw thrown away first, and the pictures compared, as the canvas layer
341
373
  * does. A layer whose same frame is not the same picture (a clock, `Math.random`, a mixer advanced with `update(dt)`, any state that builds up from call to call) is reported.
@@ -557,6 +589,7 @@ var ThreeSequence = class extends chunkX62H3RBG_cjs.Sequence {
557
589
  }
558
590
  _disposeRenderer() {
559
591
  if (!this._renderer) return;
592
+ this._closing = true;
560
593
  if (this._tracked) {
561
594
  this._tracked = false;
562
595
  releaseThree(this._gpu ? "webgpu" : "webgl");