@tsparticles/interaction-external-attract 3.0.0-beta.3 → 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, Vector, clamp, getDistances, getEasing, isInArray, mouseMoveEvent, } from "@tsparticles/engine";
2
2
  import { Attract } from "./Options/Classes/Attract.js";
3
+ const attractMode = "attract";
3
4
  export class Attractor extends ExternalInteractorBase {
4
5
  constructor(engine, container) {
5
6
  super(container);
@@ -57,7 +58,7 @@ export class Attractor extends ExternalInteractorBase {
57
58
  }
58
59
  this.handleClickMode = (mode) => {
59
60
  const options = this.container.actualOptions, attract = options.interactivity.modes.attract;
60
- if (!attract || mode !== "attract") {
61
+ if (!attract || mode !== attractMode) {
61
62
  return;
62
63
  }
63
64
  if (!container.attract) {
@@ -95,10 +96,10 @@ export class Attractor extends ExternalInteractorBase {
95
96
  }
96
97
  async interact() {
97
98
  const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode;
98
- if (mouseMoveStatus && hoverEnabled && isInArray("attract", hoverMode)) {
99
+ if (mouseMoveStatus && hoverEnabled && isInArray(attractMode, hoverMode)) {
99
100
  this._hoverAttract();
100
101
  }
101
- else if (clickEnabled && isInArray("attract", clickMode)) {
102
+ else if (clickEnabled && isInArray(attractMode, clickMode)) {
102
103
  this._clickAttract();
103
104
  }
104
105
  }
@@ -108,7 +109,7 @@ export class Attractor extends ExternalInteractorBase {
108
109
  return false;
109
110
  }
110
111
  const hoverMode = events.onHover.mode, clickMode = events.onClick.mode;
111
- return isInArray("attract", hoverMode) || isInArray("attract", clickMode);
112
+ return isInArray(attractMode, hoverMode) || isInArray(attractMode, clickMode);
112
113
  }
113
114
  loadModeOptions(options, ...sources) {
114
115
  if (!options.attract) {
package/cjs/Attractor.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Attractor = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
5
  const Attract_js_1 = require("./Options/Classes/Attract.js");
6
+ const attractMode = "attract";
6
7
  class Attractor extends engine_1.ExternalInteractorBase {
7
8
  constructor(engine, container) {
8
9
  super(container);
@@ -60,7 +61,7 @@ class Attractor extends engine_1.ExternalInteractorBase {
60
61
  }
61
62
  this.handleClickMode = (mode) => {
62
63
  const options = this.container.actualOptions, attract = options.interactivity.modes.attract;
63
- if (!attract || mode !== "attract") {
64
+ if (!attract || mode !== attractMode) {
64
65
  return;
65
66
  }
66
67
  if (!container.attract) {
@@ -98,10 +99,10 @@ class Attractor extends engine_1.ExternalInteractorBase {
98
99
  }
99
100
  async interact() {
100
101
  const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === engine_1.mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode;
101
- if (mouseMoveStatus && hoverEnabled && (0, engine_1.isInArray)("attract", hoverMode)) {
102
+ if (mouseMoveStatus && hoverEnabled && (0, engine_1.isInArray)(attractMode, hoverMode)) {
102
103
  this._hoverAttract();
103
104
  }
104
- else if (clickEnabled && (0, engine_1.isInArray)("attract", clickMode)) {
105
+ else if (clickEnabled && (0, engine_1.isInArray)(attractMode, clickMode)) {
105
106
  this._clickAttract();
106
107
  }
107
108
  }
@@ -111,7 +112,7 @@ class Attractor extends engine_1.ExternalInteractorBase {
111
112
  return false;
112
113
  }
113
114
  const hoverMode = events.onHover.mode, clickMode = events.onClick.mode;
114
- return (0, engine_1.isInArray)("attract", hoverMode) || (0, engine_1.isInArray)("attract", clickMode);
115
+ return (0, engine_1.isInArray)(attractMode, hoverMode) || (0, engine_1.isInArray)(attractMode, clickMode);
115
116
  }
116
117
  loadModeOptions(options, ...sources) {
117
118
  if (!options.attract) {
package/esm/Attractor.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Circle, ExternalInteractorBase, Vector, clamp, getDistances, getEasing, isInArray, mouseMoveEvent, } from "@tsparticles/engine";
2
2
  import { Attract } from "./Options/Classes/Attract.js";
3
+ const attractMode = "attract";
3
4
  export class Attractor extends ExternalInteractorBase {
4
5
  constructor(engine, container) {
5
6
  super(container);
@@ -57,7 +58,7 @@ export class Attractor extends ExternalInteractorBase {
57
58
  }
58
59
  this.handleClickMode = (mode) => {
59
60
  const options = this.container.actualOptions, attract = options.interactivity.modes.attract;
60
- if (!attract || mode !== "attract") {
61
+ if (!attract || mode !== attractMode) {
61
62
  return;
62
63
  }
63
64
  if (!container.attract) {
@@ -95,10 +96,10 @@ export class Attractor extends ExternalInteractorBase {
95
96
  }
96
97
  async interact() {
97
98
  const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode;
98
- if (mouseMoveStatus && hoverEnabled && isInArray("attract", hoverMode)) {
99
+ if (mouseMoveStatus && hoverEnabled && isInArray(attractMode, hoverMode)) {
99
100
  this._hoverAttract();
100
101
  }
101
- else if (clickEnabled && isInArray("attract", clickMode)) {
102
+ else if (clickEnabled && isInArray(attractMode, clickMode)) {
102
103
  this._clickAttract();
103
104
  }
104
105
  }
@@ -108,7 +109,7 @@ export class Attractor extends ExternalInteractorBase {
108
109
  return false;
109
110
  }
110
111
  const hoverMode = events.onHover.mode, clickMode = events.onClick.mode;
111
- return isInArray("attract", hoverMode) || isInArray("attract", clickMode);
112
+ return isInArray(attractMode, hoverMode) || isInArray(attractMode, clickMode);
112
113
  }
113
114
  loadModeOptions(options, ...sources) {
114
115
  if (!options.attract) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-external-attract",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "tsParticles attract 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.3"
90
+ "@tsparticles/engine": "^3.0.0-beta.4"
91
91
  },
92
92
  "publishConfig": {
93
93
  "access": "public"