@tsparticles/updater-out-modes 4.0.0-beta.9 → 4.0.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.
@@ -28,6 +28,7 @@ export class OutOfCanvasUpdater {
28
28
  }
29
29
  update(particle, delta) {
30
30
  const outModes = particle.options.move.outModes;
31
+ particle.justWarped = false;
31
32
  this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, OutModeDirection.bottom);
32
33
  this._updateOutMode(particle, delta, outModes.left ?? outModes.default, OutModeDirection.left);
33
34
  this._updateOutMode(particle, delta, outModes.right ?? outModes.default, OutModeDirection.right);
@@ -37,6 +37,7 @@ export class OutOutMode {
37
37
  const { dx: newDx, dy: newDy } = getDistances(particle.position, particle.moveCenter);
38
38
  particle.direction = Math.atan2(-newDy, -newDx);
39
39
  particle.velocity.angle = particle.direction;
40
+ particle.justWarped = true;
40
41
  break;
41
42
  }
42
43
  default: {
@@ -60,6 +61,7 @@ export class OutOutMode {
60
61
  particle.direction = Math.atan2(dy, dx);
61
62
  particle.velocity.angle = particle.direction;
62
63
  }
64
+ particle.justWarped = true;
63
65
  break;
64
66
  }
65
67
  case ParticleOutType.normal: {
@@ -76,6 +78,7 @@ export class OutOutMode {
76
78
  particle.position.y = getRandom() * canvasSize.height;
77
79
  particle.initialPosition.y = particle.position.y;
78
80
  }
81
+ particle.justWarped = true;
79
82
  }
80
83
  else if (direction === OutModeDirection.left && nextBounds.right < -particle.offset.x) {
81
84
  particle.position.x = newPos.right;
@@ -84,6 +87,7 @@ export class OutOutMode {
84
87
  particle.position.y = getRandom() * canvasSize.height;
85
88
  particle.initialPosition.y = particle.position.y;
86
89
  }
90
+ particle.justWarped = true;
87
91
  }
88
92
  if (direction === OutModeDirection.bottom && nextBounds.top > canvasSize.height + particle.offset.y) {
89
93
  if (!warp) {
@@ -92,6 +96,7 @@ export class OutOutMode {
92
96
  }
93
97
  particle.position.y = newPos.top;
94
98
  particle.initialPosition.y = particle.position.y;
99
+ particle.justWarped = true;
95
100
  }
96
101
  else if (direction === OutModeDirection.top && nextBounds.bottom < -particle.offset.y) {
97
102
  if (!warp) {
@@ -100,6 +105,7 @@ export class OutOutMode {
100
105
  }
101
106
  particle.position.y = newPos.bottom;
102
107
  particle.initialPosition.y = particle.position.y;
108
+ particle.justWarped = true;
103
109
  }
104
110
  break;
105
111
  }
@@ -0,0 +1,5 @@
1
+ import { loadOutModesUpdater } from "./index.js";
2
+ const globalObject = globalThis;
3
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
4
+ globalObject.loadOutModesUpdater = loadOutModesUpdater;
5
+ export * from "./index.js";
package/browser/index.js CHANGED
@@ -1,9 +1,9 @@
1
+ import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater.js";
1
2
  export async function loadOutModesUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.9");
3
+ engine.checkVersion("4.0.1");
3
4
  await engine.pluginManager.register(e => {
4
- e.pluginManager.addParticleUpdater("outModes", async (container) => {
5
- const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
6
- return new OutOfCanvasUpdater(container);
5
+ e.pluginManager.addParticleUpdater("outModes", container => {
6
+ return Promise.resolve(new OutOfCanvasUpdater(container));
7
7
  });
8
8
  });
9
9
  }
@@ -0,0 +1,9 @@
1
+ export async function loadOutModesUpdater(engine) {
2
+ engine.checkVersion("4.0.1");
3
+ await engine.pluginManager.register(e => {
4
+ e.pluginManager.addParticleUpdater("outModes", async (container) => {
5
+ const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
6
+ return new OutOfCanvasUpdater(container);
7
+ });
8
+ });
9
+ }
@@ -28,6 +28,7 @@ export class OutOfCanvasUpdater {
28
28
  }
29
29
  update(particle, delta) {
30
30
  const outModes = particle.options.move.outModes;
31
+ particle.justWarped = false;
31
32
  this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, OutModeDirection.bottom);
32
33
  this._updateOutMode(particle, delta, outModes.left ?? outModes.default, OutModeDirection.left);
33
34
  this._updateOutMode(particle, delta, outModes.right ?? outModes.default, OutModeDirection.right);
package/cjs/OutOutMode.js CHANGED
@@ -37,6 +37,7 @@ export class OutOutMode {
37
37
  const { dx: newDx, dy: newDy } = getDistances(particle.position, particle.moveCenter);
38
38
  particle.direction = Math.atan2(-newDy, -newDx);
39
39
  particle.velocity.angle = particle.direction;
40
+ particle.justWarped = true;
40
41
  break;
41
42
  }
42
43
  default: {
@@ -60,6 +61,7 @@ export class OutOutMode {
60
61
  particle.direction = Math.atan2(dy, dx);
61
62
  particle.velocity.angle = particle.direction;
62
63
  }
64
+ particle.justWarped = true;
63
65
  break;
64
66
  }
65
67
  case ParticleOutType.normal: {
@@ -76,6 +78,7 @@ export class OutOutMode {
76
78
  particle.position.y = getRandom() * canvasSize.height;
77
79
  particle.initialPosition.y = particle.position.y;
78
80
  }
81
+ particle.justWarped = true;
79
82
  }
80
83
  else if (direction === OutModeDirection.left && nextBounds.right < -particle.offset.x) {
81
84
  particle.position.x = newPos.right;
@@ -84,6 +87,7 @@ export class OutOutMode {
84
87
  particle.position.y = getRandom() * canvasSize.height;
85
88
  particle.initialPosition.y = particle.position.y;
86
89
  }
90
+ particle.justWarped = true;
87
91
  }
88
92
  if (direction === OutModeDirection.bottom && nextBounds.top > canvasSize.height + particle.offset.y) {
89
93
  if (!warp) {
@@ -92,6 +96,7 @@ export class OutOutMode {
92
96
  }
93
97
  particle.position.y = newPos.top;
94
98
  particle.initialPosition.y = particle.position.y;
99
+ particle.justWarped = true;
95
100
  }
96
101
  else if (direction === OutModeDirection.top && nextBounds.bottom < -particle.offset.y) {
97
102
  if (!warp) {
@@ -100,6 +105,7 @@ export class OutOutMode {
100
105
  }
101
106
  particle.position.y = newPos.bottom;
102
107
  particle.initialPosition.y = particle.position.y;
108
+ particle.justWarped = true;
103
109
  }
104
110
  break;
105
111
  }
package/cjs/browser.js ADDED
@@ -0,0 +1,5 @@
1
+ import { loadOutModesUpdater } from "./index.js";
2
+ const globalObject = globalThis;
3
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
4
+ globalObject.loadOutModesUpdater = loadOutModesUpdater;
5
+ export * from "./index.js";
package/cjs/index.js CHANGED
@@ -1,9 +1,9 @@
1
+ import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater.js";
1
2
  export async function loadOutModesUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.9");
3
+ engine.checkVersion("4.0.1");
3
4
  await engine.pluginManager.register(e => {
4
- e.pluginManager.addParticleUpdater("outModes", async (container) => {
5
- const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
6
- return new OutOfCanvasUpdater(container);
5
+ e.pluginManager.addParticleUpdater("outModes", container => {
6
+ return Promise.resolve(new OutOfCanvasUpdater(container));
7
7
  });
8
8
  });
9
9
  }
@@ -0,0 +1,9 @@
1
+ export async function loadOutModesUpdater(engine) {
2
+ engine.checkVersion("4.0.1");
3
+ await engine.pluginManager.register(e => {
4
+ e.pluginManager.addParticleUpdater("outModes", async (container) => {
5
+ const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
6
+ return new OutOfCanvasUpdater(container);
7
+ });
8
+ });
9
+ }
@@ -28,6 +28,7 @@ export class OutOfCanvasUpdater {
28
28
  }
29
29
  update(particle, delta) {
30
30
  const outModes = particle.options.move.outModes;
31
+ particle.justWarped = false;
31
32
  this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, OutModeDirection.bottom);
32
33
  this._updateOutMode(particle, delta, outModes.left ?? outModes.default, OutModeDirection.left);
33
34
  this._updateOutMode(particle, delta, outModes.right ?? outModes.default, OutModeDirection.right);
package/esm/OutOutMode.js CHANGED
@@ -37,6 +37,7 @@ export class OutOutMode {
37
37
  const { dx: newDx, dy: newDy } = getDistances(particle.position, particle.moveCenter);
38
38
  particle.direction = Math.atan2(-newDy, -newDx);
39
39
  particle.velocity.angle = particle.direction;
40
+ particle.justWarped = true;
40
41
  break;
41
42
  }
42
43
  default: {
@@ -60,6 +61,7 @@ export class OutOutMode {
60
61
  particle.direction = Math.atan2(dy, dx);
61
62
  particle.velocity.angle = particle.direction;
62
63
  }
64
+ particle.justWarped = true;
63
65
  break;
64
66
  }
65
67
  case ParticleOutType.normal: {
@@ -76,6 +78,7 @@ export class OutOutMode {
76
78
  particle.position.y = getRandom() * canvasSize.height;
77
79
  particle.initialPosition.y = particle.position.y;
78
80
  }
81
+ particle.justWarped = true;
79
82
  }
80
83
  else if (direction === OutModeDirection.left && nextBounds.right < -particle.offset.x) {
81
84
  particle.position.x = newPos.right;
@@ -84,6 +87,7 @@ export class OutOutMode {
84
87
  particle.position.y = getRandom() * canvasSize.height;
85
88
  particle.initialPosition.y = particle.position.y;
86
89
  }
90
+ particle.justWarped = true;
87
91
  }
88
92
  if (direction === OutModeDirection.bottom && nextBounds.top > canvasSize.height + particle.offset.y) {
89
93
  if (!warp) {
@@ -92,6 +96,7 @@ export class OutOutMode {
92
96
  }
93
97
  particle.position.y = newPos.top;
94
98
  particle.initialPosition.y = particle.position.y;
99
+ particle.justWarped = true;
95
100
  }
96
101
  else if (direction === OutModeDirection.top && nextBounds.bottom < -particle.offset.y) {
97
102
  if (!warp) {
@@ -100,6 +105,7 @@ export class OutOutMode {
100
105
  }
101
106
  particle.position.y = newPos.bottom;
102
107
  particle.initialPosition.y = particle.position.y;
108
+ particle.justWarped = true;
103
109
  }
104
110
  break;
105
111
  }
package/esm/browser.js ADDED
@@ -0,0 +1,5 @@
1
+ import { loadOutModesUpdater } from "./index.js";
2
+ const globalObject = globalThis;
3
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
4
+ globalObject.loadOutModesUpdater = loadOutModesUpdater;
5
+ export * from "./index.js";
package/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
+ import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater.js";
1
2
  export async function loadOutModesUpdater(engine) {
2
- engine.checkVersion("4.0.0-beta.9");
3
+ engine.checkVersion("4.0.1");
3
4
  await engine.pluginManager.register(e => {
4
- e.pluginManager.addParticleUpdater("outModes", async (container) => {
5
- const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
6
- return new OutOfCanvasUpdater(container);
5
+ e.pluginManager.addParticleUpdater("outModes", container => {
6
+ return Promise.resolve(new OutOfCanvasUpdater(container));
7
7
  });
8
8
  });
9
9
  }
@@ -0,0 +1,9 @@
1
+ export async function loadOutModesUpdater(engine) {
2
+ engine.checkVersion("4.0.1");
3
+ await engine.pluginManager.register(e => {
4
+ e.pluginManager.addParticleUpdater("outModes", async (container) => {
5
+ const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
6
+ return new OutOfCanvasUpdater(container);
7
+ });
8
+ });
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-out-modes",
3
- "version": "4.0.0-beta.9",
3
+ "version": "4.0.1",
4
4
  "description": "tsParticles particles out modes updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -83,10 +83,17 @@
83
83
  "require": "./cjs/index.js",
84
84
  "default": "./esm/index.js"
85
85
  },
86
+ "./lazy": {
87
+ "types": "./types/index.lazy.d.ts",
88
+ "browser": "./browser/index.lazy.js",
89
+ "import": "./esm/index.lazy.js",
90
+ "require": "./cjs/index.lazy.js",
91
+ "default": "./esm/index.lazy.js"
92
+ },
86
93
  "./package.json": "./package.json"
87
94
  },
88
95
  "peerDependencies": {
89
- "@tsparticles/engine": "4.0.0-beta.9"
96
+ "@tsparticles/engine": "4.0.1"
90
97
  },
91
98
  "publishConfig": {
92
99
  "access": "public"