@tsparticles/updater-out-modes 3.0.0-alpha.1 → 3.0.0-beta.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/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # tsParticles Out Modes Updater
4
4
 
5
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-updater-out-modes/badge)](https://www.jsdelivr.com/package/npm/tsparticles-updater-out-modes)
6
- [![npmjs](https://badge.fury.io/js/tsparticles-updater-out-modes.svg)](https://www.npmjs.com/package/tsparticles-updater-out-modes)
7
- [![npmjs](https://img.shields.io/npm/dt/tsparticles-updater-out-modes)](https://www.npmjs.com/package/tsparticles-updater-out-modes) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
5
+ [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/updater-out-modes/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/updater-out-modes)
6
+ [![npmjs](https://badge.fury.io/js/@tsparticles/updater-out-modes.svg)](https://www.npmjs.com/package/@tsparticles/updater-out-modes)
7
+ [![npmjs](https://img.shields.io/npm/dt/@tsparticles/updater-out-modes)](https://www.npmjs.com/package/@tsparticles/updater-out-modes) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
8
8
 
9
9
  [tsParticles](https://github.com/matteobruni/tsparticles) updater plugin for out modes animations.
10
10
 
@@ -26,7 +26,7 @@ Once the scripts are loaded you can set up `tsParticles` and the updater plugin
26
26
 
27
27
  ```javascript
28
28
  (async () => {
29
- await loadOutModesUpdater();
29
+ await loadOutModesUpdater(tsParticles);
30
30
 
31
31
  await tsParticles.load({
32
32
  id: "tsparticles",
@@ -42,29 +42,33 @@ Once the scripts are loaded you can set up `tsParticles` and the updater plugin
42
42
  This package is compatible also with ES or CommonJS modules, firstly this needs to be installed, like this:
43
43
 
44
44
  ```shell
45
- $ npm install tsparticles-updater-out-modes
45
+ $ npm install @tsparticles/updater-out-modes
46
46
  ```
47
47
 
48
48
  or
49
49
 
50
50
  ```shell
51
- $ yarn add tsparticles-updater-out-modes
51
+ $ yarn add @tsparticles/updater-out-modes
52
52
  ```
53
53
 
54
54
  Then you need to import it in the app, like this:
55
55
 
56
56
  ```javascript
57
- const { tsParticles } = require("tsparticles-engine");
58
- const { loadOutModesUpdater } = require("tsparticles-updater-out-modes");
57
+ const { tsParticles } = require("@tsparticles/engine");
58
+ const { loadOutModesUpdater } = require("@tsparticles/updater-out-modes");
59
59
 
60
- loadOutModesUpdater(tsParticles);
60
+ (async () => {
61
+ await loadOutModesUpdater(tsParticles);
62
+ })();
61
63
  ```
62
64
 
63
65
  or
64
66
 
65
67
  ```javascript
66
- import { tsParticles } from "tsparticles-engine";
67
- import { loadOutModesUpdater } from "tsparticles-updater-out-modes";
68
+ import { tsParticles } from "@tsparticles/engine";
69
+ import { loadOutModesUpdater } from "@tsparticles/updater-out-modes";
68
70
 
69
- loadOutModesUpdater(tsParticles);
71
+ (async () => {
72
+ await loadOutModesUpdater(tsParticles);
73
+ })();
70
74
  ```
@@ -1,4 +1,4 @@
1
- import { calculateBounds } from "@tsparticles/engine";
1
+ import { calculateBounds, } from "@tsparticles/engine";
2
2
  import { bounceHorizontal, bounceVertical } from "./Utils";
3
3
  export class BounceOutMode {
4
4
  constructor(container) {
@@ -1,10 +1,10 @@
1
- import { Vector, getDistances, isPointInside } from "@tsparticles/engine";
1
+ import { Vector, getDistances, isPointInside, } from "@tsparticles/engine";
2
2
  export class DestroyOutMode {
3
3
  constructor(container) {
4
4
  this.container = container;
5
5
  this.modes = ["destroy"];
6
6
  }
7
- update(particle, direction, delta, outMode) {
7
+ update(particle, direction, _delta, outMode) {
8
8
  if (!this.modes.includes(outMode)) {
9
9
  return;
10
10
  }
@@ -1,4 +1,4 @@
1
- import { Vector, isPointInside } from "@tsparticles/engine";
1
+ import { Vector, isPointInside, } from "@tsparticles/engine";
2
2
  export class NoneOutMode {
3
3
  constructor(container) {
4
4
  this.container = container;
@@ -5,6 +5,11 @@ import { OutOutMode } from "./OutOutMode";
5
5
  export class OutOfCanvasUpdater {
6
6
  constructor(container) {
7
7
  this.container = container;
8
+ this._updateOutMode = (particle, delta, outMode, direction) => {
9
+ for (const updater of this.updaters) {
10
+ updater.update(particle, direction, delta, outMode);
11
+ }
12
+ };
8
13
  this.updaters = [
9
14
  new BounceOutMode(container),
10
15
  new DestroyOutMode(container),
@@ -18,16 +23,10 @@ export class OutOfCanvasUpdater {
18
23
  return !particle.destroyed && !particle.spawning;
19
24
  }
20
25
  update(particle, delta) {
21
- var _a, _b, _c, _d;
22
26
  const outModes = particle.options.move.outModes;
23
- this.updateOutMode(particle, delta, (_a = outModes.bottom) !== null && _a !== void 0 ? _a : outModes.default, "bottom");
24
- this.updateOutMode(particle, delta, (_b = outModes.left) !== null && _b !== void 0 ? _b : outModes.default, "left");
25
- this.updateOutMode(particle, delta, (_c = outModes.right) !== null && _c !== void 0 ? _c : outModes.default, "right");
26
- this.updateOutMode(particle, delta, (_d = outModes.top) !== null && _d !== void 0 ? _d : outModes.default, "top");
27
- }
28
- updateOutMode(particle, delta, outMode, direction) {
29
- for (const updater of this.updaters) {
30
- updater.update(particle, direction, delta, outMode);
31
- }
27
+ this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, "bottom");
28
+ this._updateOutMode(particle, delta, outModes.left ?? outModes.default, "left");
29
+ this._updateOutMode(particle, delta, outModes.right ?? outModes.default, "right");
30
+ this._updateOutMode(particle, delta, outModes.top ?? outModes.default, "top");
32
31
  }
33
32
  }
package/browser/Utils.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import { getValue } from "@tsparticles/engine";
2
2
  export function bounceHorizontal(data) {
3
- if (data.outMode !== "bounce" &&
3
+ if ((data.outMode !== "bounce" &&
4
4
  data.outMode !== "bounce-horizontal" &&
5
5
  data.outMode !== "bounceHorizontal" &&
6
- data.outMode !== "split") {
6
+ data.outMode !== "split") ||
7
+ (data.direction !== "left" && data.direction !== "right")) {
7
8
  return;
8
9
  }
9
- if (data.bounds.right < 0) {
10
+ if (data.bounds.right < 0 && data.direction === "left") {
10
11
  data.particle.position.x = data.size + data.offset.x;
11
12
  }
12
- else if (data.bounds.left > data.canvasSize.width) {
13
+ else if (data.bounds.left > data.canvasSize.width && data.direction === "right") {
13
14
  data.particle.position.x = data.canvasSize.width - data.size - data.offset.x;
14
15
  }
15
16
  const velocity = data.particle.velocity.x;
@@ -24,10 +25,10 @@ export function bounceHorizontal(data) {
24
25
  return;
25
26
  }
26
27
  const minPos = data.offset.x + data.size;
27
- if (data.bounds.right >= data.canvasSize.width) {
28
+ if (data.bounds.right >= data.canvasSize.width && data.direction === "right") {
28
29
  data.particle.position.x = data.canvasSize.width - minPos;
29
30
  }
30
- else if (data.bounds.left <= 0) {
31
+ else if (data.bounds.left <= 0 && data.direction === "left") {
31
32
  data.particle.position.x = minPos;
32
33
  }
33
34
  if (data.outMode === "split") {
@@ -35,16 +36,17 @@ export function bounceHorizontal(data) {
35
36
  }
36
37
  }
37
38
  export function bounceVertical(data) {
38
- if (data.outMode !== "bounce" &&
39
+ if ((data.outMode !== "bounce" &&
39
40
  data.outMode !== "bounce-vertical" &&
40
41
  data.outMode !== "bounceVertical" &&
41
- data.outMode !== "split") {
42
+ data.outMode !== "split") ||
43
+ (data.direction !== "bottom" && data.direction !== "top")) {
42
44
  return;
43
45
  }
44
- if (data.bounds.bottom < 0) {
46
+ if (data.bounds.bottom < 0 && data.direction === "top") {
45
47
  data.particle.position.y = data.size + data.offset.y;
46
48
  }
47
- else if (data.bounds.top > data.canvasSize.height) {
49
+ else if (data.bounds.top > data.canvasSize.height && data.direction === "bottom") {
48
50
  data.particle.position.y = data.canvasSize.height - data.size - data.offset.y;
49
51
  }
50
52
  const velocity = data.particle.velocity.y;
@@ -59,10 +61,10 @@ export function bounceVertical(data) {
59
61
  return;
60
62
  }
61
63
  const minPos = data.offset.y + data.size;
62
- if (data.bounds.bottom >= data.canvasSize.height) {
64
+ if (data.bounds.bottom >= data.canvasSize.height && data.direction === "bottom") {
63
65
  data.particle.position.y = data.canvasSize.height - minPos;
64
66
  }
65
- else if (data.bounds.top <= 0) {
67
+ else if (data.bounds.top <= 0 && data.direction === "top") {
66
68
  data.particle.position.y = minPos;
67
69
  }
68
70
  if (data.outMode === "split") {
package/browser/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater";
2
- export async function loadOutModesUpdater(engine) {
3
- await engine.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container));
2
+ export async function loadOutModesUpdater(engine, refresh = true) {
3
+ await engine.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container), refresh);
4
4
  }
@@ -7,7 +7,7 @@ class DestroyOutMode {
7
7
  this.container = container;
8
8
  this.modes = ["destroy"];
9
9
  }
10
- update(particle, direction, delta, outMode) {
10
+ update(particle, direction, _delta, outMode) {
11
11
  if (!this.modes.includes(outMode)) {
12
12
  return;
13
13
  }
@@ -8,6 +8,11 @@ const OutOutMode_1 = require("./OutOutMode");
8
8
  class OutOfCanvasUpdater {
9
9
  constructor(container) {
10
10
  this.container = container;
11
+ this._updateOutMode = (particle, delta, outMode, direction) => {
12
+ for (const updater of this.updaters) {
13
+ updater.update(particle, direction, delta, outMode);
14
+ }
15
+ };
11
16
  this.updaters = [
12
17
  new BounceOutMode_1.BounceOutMode(container),
13
18
  new DestroyOutMode_1.DestroyOutMode(container),
@@ -21,17 +26,11 @@ class OutOfCanvasUpdater {
21
26
  return !particle.destroyed && !particle.spawning;
22
27
  }
23
28
  update(particle, delta) {
24
- var _a, _b, _c, _d;
25
29
  const outModes = particle.options.move.outModes;
26
- this.updateOutMode(particle, delta, (_a = outModes.bottom) !== null && _a !== void 0 ? _a : outModes.default, "bottom");
27
- this.updateOutMode(particle, delta, (_b = outModes.left) !== null && _b !== void 0 ? _b : outModes.default, "left");
28
- this.updateOutMode(particle, delta, (_c = outModes.right) !== null && _c !== void 0 ? _c : outModes.default, "right");
29
- this.updateOutMode(particle, delta, (_d = outModes.top) !== null && _d !== void 0 ? _d : outModes.default, "top");
30
- }
31
- updateOutMode(particle, delta, outMode, direction) {
32
- for (const updater of this.updaters) {
33
- updater.update(particle, direction, delta, outMode);
34
- }
30
+ this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, "bottom");
31
+ this._updateOutMode(particle, delta, outModes.left ?? outModes.default, "left");
32
+ this._updateOutMode(particle, delta, outModes.right ?? outModes.default, "right");
33
+ this._updateOutMode(particle, delta, outModes.top ?? outModes.default, "top");
35
34
  }
36
35
  }
37
36
  exports.OutOfCanvasUpdater = OutOfCanvasUpdater;
package/cjs/Utils.js CHANGED
@@ -3,16 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bounceVertical = exports.bounceHorizontal = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
5
  function bounceHorizontal(data) {
6
- if (data.outMode !== "bounce" &&
6
+ if ((data.outMode !== "bounce" &&
7
7
  data.outMode !== "bounce-horizontal" &&
8
8
  data.outMode !== "bounceHorizontal" &&
9
- data.outMode !== "split") {
9
+ data.outMode !== "split") ||
10
+ (data.direction !== "left" && data.direction !== "right")) {
10
11
  return;
11
12
  }
12
- if (data.bounds.right < 0) {
13
+ if (data.bounds.right < 0 && data.direction === "left") {
13
14
  data.particle.position.x = data.size + data.offset.x;
14
15
  }
15
- else if (data.bounds.left > data.canvasSize.width) {
16
+ else if (data.bounds.left > data.canvasSize.width && data.direction === "right") {
16
17
  data.particle.position.x = data.canvasSize.width - data.size - data.offset.x;
17
18
  }
18
19
  const velocity = data.particle.velocity.x;
@@ -27,10 +28,10 @@ function bounceHorizontal(data) {
27
28
  return;
28
29
  }
29
30
  const minPos = data.offset.x + data.size;
30
- if (data.bounds.right >= data.canvasSize.width) {
31
+ if (data.bounds.right >= data.canvasSize.width && data.direction === "right") {
31
32
  data.particle.position.x = data.canvasSize.width - minPos;
32
33
  }
33
- else if (data.bounds.left <= 0) {
34
+ else if (data.bounds.left <= 0 && data.direction === "left") {
34
35
  data.particle.position.x = minPos;
35
36
  }
36
37
  if (data.outMode === "split") {
@@ -39,16 +40,17 @@ function bounceHorizontal(data) {
39
40
  }
40
41
  exports.bounceHorizontal = bounceHorizontal;
41
42
  function bounceVertical(data) {
42
- if (data.outMode !== "bounce" &&
43
+ if ((data.outMode !== "bounce" &&
43
44
  data.outMode !== "bounce-vertical" &&
44
45
  data.outMode !== "bounceVertical" &&
45
- data.outMode !== "split") {
46
+ data.outMode !== "split") ||
47
+ (data.direction !== "bottom" && data.direction !== "top")) {
46
48
  return;
47
49
  }
48
- if (data.bounds.bottom < 0) {
50
+ if (data.bounds.bottom < 0 && data.direction === "top") {
49
51
  data.particle.position.y = data.size + data.offset.y;
50
52
  }
51
- else if (data.bounds.top > data.canvasSize.height) {
53
+ else if (data.bounds.top > data.canvasSize.height && data.direction === "bottom") {
52
54
  data.particle.position.y = data.canvasSize.height - data.size - data.offset.y;
53
55
  }
54
56
  const velocity = data.particle.velocity.y;
@@ -63,10 +65,10 @@ function bounceVertical(data) {
63
65
  return;
64
66
  }
65
67
  const minPos = data.offset.y + data.size;
66
- if (data.bounds.bottom >= data.canvasSize.height) {
68
+ if (data.bounds.bottom >= data.canvasSize.height && data.direction === "bottom") {
67
69
  data.particle.position.y = data.canvasSize.height - minPos;
68
70
  }
69
- else if (data.bounds.top <= 0) {
71
+ else if (data.bounds.top <= 0 && data.direction === "top") {
70
72
  data.particle.position.y = minPos;
71
73
  }
72
74
  if (data.outMode === "split") {
package/cjs/index.js CHANGED
@@ -1,19 +1,8 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.loadOutModesUpdater = void 0;
13
4
  const OutOfCanvasUpdater_1 = require("./OutOfCanvasUpdater");
14
- function loadOutModesUpdater(engine) {
15
- return __awaiter(this, void 0, void 0, function* () {
16
- yield engine.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater_1.OutOfCanvasUpdater(container));
17
- });
5
+ async function loadOutModesUpdater(engine, refresh = true) {
6
+ await engine.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater_1.OutOfCanvasUpdater(container), refresh);
18
7
  }
19
8
  exports.loadOutModesUpdater = loadOutModesUpdater;
@@ -1,4 +1,4 @@
1
- import { calculateBounds } from "@tsparticles/engine";
1
+ import { calculateBounds, } from "@tsparticles/engine";
2
2
  import { bounceHorizontal, bounceVertical } from "./Utils";
3
3
  export class BounceOutMode {
4
4
  constructor(container) {
@@ -1,10 +1,10 @@
1
- import { Vector, getDistances, isPointInside } from "@tsparticles/engine";
1
+ import { Vector, getDistances, isPointInside, } from "@tsparticles/engine";
2
2
  export class DestroyOutMode {
3
3
  constructor(container) {
4
4
  this.container = container;
5
5
  this.modes = ["destroy"];
6
6
  }
7
- update(particle, direction, delta, outMode) {
7
+ update(particle, direction, _delta, outMode) {
8
8
  if (!this.modes.includes(outMode)) {
9
9
  return;
10
10
  }
@@ -1,4 +1,4 @@
1
- import { Vector, isPointInside } from "@tsparticles/engine";
1
+ import { Vector, isPointInside, } from "@tsparticles/engine";
2
2
  export class NoneOutMode {
3
3
  constructor(container) {
4
4
  this.container = container;
@@ -5,6 +5,11 @@ import { OutOutMode } from "./OutOutMode";
5
5
  export class OutOfCanvasUpdater {
6
6
  constructor(container) {
7
7
  this.container = container;
8
+ this._updateOutMode = (particle, delta, outMode, direction) => {
9
+ for (const updater of this.updaters) {
10
+ updater.update(particle, direction, delta, outMode);
11
+ }
12
+ };
8
13
  this.updaters = [
9
14
  new BounceOutMode(container),
10
15
  new DestroyOutMode(container),
@@ -18,16 +23,10 @@ export class OutOfCanvasUpdater {
18
23
  return !particle.destroyed && !particle.spawning;
19
24
  }
20
25
  update(particle, delta) {
21
- var _a, _b, _c, _d;
22
26
  const outModes = particle.options.move.outModes;
23
- this.updateOutMode(particle, delta, (_a = outModes.bottom) !== null && _a !== void 0 ? _a : outModes.default, "bottom");
24
- this.updateOutMode(particle, delta, (_b = outModes.left) !== null && _b !== void 0 ? _b : outModes.default, "left");
25
- this.updateOutMode(particle, delta, (_c = outModes.right) !== null && _c !== void 0 ? _c : outModes.default, "right");
26
- this.updateOutMode(particle, delta, (_d = outModes.top) !== null && _d !== void 0 ? _d : outModes.default, "top");
27
- }
28
- updateOutMode(particle, delta, outMode, direction) {
29
- for (const updater of this.updaters) {
30
- updater.update(particle, direction, delta, outMode);
31
- }
27
+ this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, "bottom");
28
+ this._updateOutMode(particle, delta, outModes.left ?? outModes.default, "left");
29
+ this._updateOutMode(particle, delta, outModes.right ?? outModes.default, "right");
30
+ this._updateOutMode(particle, delta, outModes.top ?? outModes.default, "top");
32
31
  }
33
32
  }
package/esm/Utils.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import { getValue } from "@tsparticles/engine";
2
2
  export function bounceHorizontal(data) {
3
- if (data.outMode !== "bounce" &&
3
+ if ((data.outMode !== "bounce" &&
4
4
  data.outMode !== "bounce-horizontal" &&
5
5
  data.outMode !== "bounceHorizontal" &&
6
- data.outMode !== "split") {
6
+ data.outMode !== "split") ||
7
+ (data.direction !== "left" && data.direction !== "right")) {
7
8
  return;
8
9
  }
9
- if (data.bounds.right < 0) {
10
+ if (data.bounds.right < 0 && data.direction === "left") {
10
11
  data.particle.position.x = data.size + data.offset.x;
11
12
  }
12
- else if (data.bounds.left > data.canvasSize.width) {
13
+ else if (data.bounds.left > data.canvasSize.width && data.direction === "right") {
13
14
  data.particle.position.x = data.canvasSize.width - data.size - data.offset.x;
14
15
  }
15
16
  const velocity = data.particle.velocity.x;
@@ -24,10 +25,10 @@ export function bounceHorizontal(data) {
24
25
  return;
25
26
  }
26
27
  const minPos = data.offset.x + data.size;
27
- if (data.bounds.right >= data.canvasSize.width) {
28
+ if (data.bounds.right >= data.canvasSize.width && data.direction === "right") {
28
29
  data.particle.position.x = data.canvasSize.width - minPos;
29
30
  }
30
- else if (data.bounds.left <= 0) {
31
+ else if (data.bounds.left <= 0 && data.direction === "left") {
31
32
  data.particle.position.x = minPos;
32
33
  }
33
34
  if (data.outMode === "split") {
@@ -35,16 +36,17 @@ export function bounceHorizontal(data) {
35
36
  }
36
37
  }
37
38
  export function bounceVertical(data) {
38
- if (data.outMode !== "bounce" &&
39
+ if ((data.outMode !== "bounce" &&
39
40
  data.outMode !== "bounce-vertical" &&
40
41
  data.outMode !== "bounceVertical" &&
41
- data.outMode !== "split") {
42
+ data.outMode !== "split") ||
43
+ (data.direction !== "bottom" && data.direction !== "top")) {
42
44
  return;
43
45
  }
44
- if (data.bounds.bottom < 0) {
46
+ if (data.bounds.bottom < 0 && data.direction === "top") {
45
47
  data.particle.position.y = data.size + data.offset.y;
46
48
  }
47
- else if (data.bounds.top > data.canvasSize.height) {
49
+ else if (data.bounds.top > data.canvasSize.height && data.direction === "bottom") {
48
50
  data.particle.position.y = data.canvasSize.height - data.size - data.offset.y;
49
51
  }
50
52
  const velocity = data.particle.velocity.y;
@@ -59,10 +61,10 @@ export function bounceVertical(data) {
59
61
  return;
60
62
  }
61
63
  const minPos = data.offset.y + data.size;
62
- if (data.bounds.bottom >= data.canvasSize.height) {
64
+ if (data.bounds.bottom >= data.canvasSize.height && data.direction === "bottom") {
63
65
  data.particle.position.y = data.canvasSize.height - minPos;
64
66
  }
65
- else if (data.bounds.top <= 0) {
67
+ else if (data.bounds.top <= 0 && data.direction === "top") {
66
68
  data.particle.position.y = minPos;
67
69
  }
68
70
  if (data.outMode === "split") {
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater";
2
- export async function loadOutModesUpdater(engine) {
3
- await engine.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container));
2
+ export async function loadOutModesUpdater(engine, refresh = true) {
3
+ await engine.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container), refresh);
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-out-modes",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-beta.0",
4
4
  "description": "tsParticles particles out modes updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -73,10 +73,11 @@
73
73
  "unpkg": "tsparticles.updater.out-modes.min.js",
74
74
  "module": "esm/index.js",
75
75
  "types": "types/index.d.ts",
76
+ "sideEffects": false,
77
+ "dependencies": {
78
+ "@tsparticles/engine": "^3.0.0-beta.0"
79
+ },
76
80
  "publishConfig": {
77
81
  "access": "public"
78
- },
79
- "dependencies": {
80
- "@tsparticles/engine": "^3.0.0-alpha.1"
81
82
  }
82
- }
83
+ }