@tsparticles/interaction-external-bounce 3.0.0-beta.2 → 3.0.0-beta.4

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.
@@ -1,5 +1,6 @@
1
1
  import { Circle, ExternalInteractorBase, Rectangle, Vector, calculateBounds, circleBounce, circleBounceDataFromParticle, divModeExecute, isDivModeEnabled, isInArray, mouseMoveEvent, rectBounce, } from "@tsparticles/engine";
2
2
  import { Bounce } from "./Options/Classes/Bounce.js";
3
+ const bounceMode = "bounce";
3
4
  export class Bouncer extends ExternalInteractorBase {
4
5
  constructor(container) {
5
6
  super(container);
@@ -54,17 +55,17 @@ export class Bouncer extends ExternalInteractorBase {
54
55
  }
55
56
  async interact() {
56
57
  const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
57
- if (mouseMoveStatus && hoverEnabled && isInArray("bounce", hoverMode)) {
58
+ if (mouseMoveStatus && hoverEnabled && isInArray(bounceMode, hoverMode)) {
58
59
  this._processMouseBounce();
59
60
  }
60
61
  else {
61
- divModeExecute("bounce", divs, (selector, div) => this._singleSelectorBounce(selector, div));
62
+ divModeExecute(bounceMode, divs, (selector, div) => this._singleSelectorBounce(selector, div));
62
63
  }
63
64
  }
64
65
  isEnabled(particle) {
65
66
  const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? options.interactivity).events, divs = events.onDiv;
66
- return ((mouse.position && events.onHover.enable && isInArray("bounce", events.onHover.mode)) ||
67
- isDivModeEnabled("bounce", divs));
67
+ return ((mouse.position && events.onHover.enable && isInArray(bounceMode, events.onHover.mode)) ||
68
+ isDivModeEnabled(bounceMode, divs));
68
69
  }
69
70
  loadModeOptions(options, ...sources) {
70
71
  if (!options.bounce) {
package/cjs/Bouncer.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Bouncer = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
5
  const Bounce_js_1 = require("./Options/Classes/Bounce.js");
6
+ const bounceMode = "bounce";
6
7
  class Bouncer extends engine_1.ExternalInteractorBase {
7
8
  constructor(container) {
8
9
  super(container);
@@ -57,17 +58,17 @@ class Bouncer extends engine_1.ExternalInteractorBase {
57
58
  }
58
59
  async interact() {
59
60
  const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === engine_1.mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
60
- if (mouseMoveStatus && hoverEnabled && (0, engine_1.isInArray)("bounce", hoverMode)) {
61
+ if (mouseMoveStatus && hoverEnabled && (0, engine_1.isInArray)(bounceMode, hoverMode)) {
61
62
  this._processMouseBounce();
62
63
  }
63
64
  else {
64
- (0, engine_1.divModeExecute)("bounce", divs, (selector, div) => this._singleSelectorBounce(selector, div));
65
+ (0, engine_1.divModeExecute)(bounceMode, divs, (selector, div) => this._singleSelectorBounce(selector, div));
65
66
  }
66
67
  }
67
68
  isEnabled(particle) {
68
69
  const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? options.interactivity).events, divs = events.onDiv;
69
- return ((mouse.position && events.onHover.enable && (0, engine_1.isInArray)("bounce", events.onHover.mode)) ||
70
- (0, engine_1.isDivModeEnabled)("bounce", divs));
70
+ return ((mouse.position && events.onHover.enable && (0, engine_1.isInArray)(bounceMode, events.onHover.mode)) ||
71
+ (0, engine_1.isDivModeEnabled)(bounceMode, divs));
71
72
  }
72
73
  loadModeOptions(options, ...sources) {
73
74
  if (!options.bounce) {
package/esm/Bouncer.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Circle, ExternalInteractorBase, Rectangle, Vector, calculateBounds, circleBounce, circleBounceDataFromParticle, divModeExecute, isDivModeEnabled, isInArray, mouseMoveEvent, rectBounce, } from "@tsparticles/engine";
2
2
  import { Bounce } from "./Options/Classes/Bounce.js";
3
+ const bounceMode = "bounce";
3
4
  export class Bouncer extends ExternalInteractorBase {
4
5
  constructor(container) {
5
6
  super(container);
@@ -54,17 +55,17 @@ export class Bouncer extends ExternalInteractorBase {
54
55
  }
55
56
  async interact() {
56
57
  const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
57
- if (mouseMoveStatus && hoverEnabled && isInArray("bounce", hoverMode)) {
58
+ if (mouseMoveStatus && hoverEnabled && isInArray(bounceMode, hoverMode)) {
58
59
  this._processMouseBounce();
59
60
  }
60
61
  else {
61
- divModeExecute("bounce", divs, (selector, div) => this._singleSelectorBounce(selector, div));
62
+ divModeExecute(bounceMode, divs, (selector, div) => this._singleSelectorBounce(selector, div));
62
63
  }
63
64
  }
64
65
  isEnabled(particle) {
65
66
  const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? options.interactivity).events, divs = events.onDiv;
66
- return ((mouse.position && events.onHover.enable && isInArray("bounce", events.onHover.mode)) ||
67
- isDivModeEnabled("bounce", divs));
67
+ return ((mouse.position && events.onHover.enable && isInArray(bounceMode, events.onHover.mode)) ||
68
+ isDivModeEnabled(bounceMode, divs));
68
69
  }
69
70
  loadModeOptions(options, ...sources) {
70
71
  if (!options.bounce) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-external-bounce",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "tsParticles bounce external interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "confettijs",
61
61
  "fireworksjs",
62
62
  "canvas-confetti",
63
- "@tsparticles/plugin",
63
+ "tsparticles-plugin",
64
64
  "@tsparticles/interaction"
65
65
  ],
66
66
  "author": "Matteo Bruni <matteo.bruni@me.com>",
@@ -87,7 +87,7 @@
87
87
  "./package.json": "./package.json"
88
88
  },
89
89
  "dependencies": {
90
- "@tsparticles/engine": "^3.0.0-beta.2"
90
+ "@tsparticles/engine": "^3.0.0-beta.4"
91
91
  },
92
92
  "publishConfig": {
93
93
  "access": "public"