@tsparticles/interaction-external-grab 3.0.0-beta.3 → 3.0.0-beta.5

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,6 +1,7 @@
1
1
  import { ExternalInteractorBase, getDistance, getLinkColor, getLinkRandomColor, isInArray, mouseMoveEvent, } from "@tsparticles/engine";
2
2
  import { Grab } from "./Options/Classes/Grab.js";
3
3
  import { drawGrab } from "./Utils.js";
4
+ const grabMode = "grab";
4
5
  export class Grabber extends ExternalInteractorBase {
5
6
  constructor(container) {
6
7
  super(container);
@@ -53,7 +54,7 @@ export class Grabber extends ExternalInteractorBase {
53
54
  }
54
55
  isEnabled(particle) {
55
56
  const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
56
- return events.onHover.enable && !!mouse.position && isInArray("grab", events.onHover.mode);
57
+ return events.onHover.enable && !!mouse.position && isInArray(grabMode, events.onHover.mode);
57
58
  }
58
59
  loadModeOptions(options, ...sources) {
59
60
  if (!options.grab) {
@@ -4,18 +4,6 @@ export class Grab {
4
4
  this.distance = 100;
5
5
  this.links = new GrabLinks();
6
6
  }
7
- get lineLinked() {
8
- return this.links;
9
- }
10
- set lineLinked(value) {
11
- this.links = value;
12
- }
13
- get line_linked() {
14
- return this.links;
15
- }
16
- set line_linked(value) {
17
- this.links = value;
18
- }
19
7
  load(data) {
20
8
  if (!data) {
21
9
  return;
@@ -23,6 +11,6 @@ export class Grab {
23
11
  if (data.distance !== undefined) {
24
12
  this.distance = data.distance;
25
13
  }
26
- this.links.load(data.links ?? data.lineLinked ?? data.line_linked);
14
+ this.links.load(data.links);
27
15
  }
28
16
  }
package/cjs/Grabber.js CHANGED
@@ -4,6 +4,7 @@ exports.Grabber = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
5
  const Grab_js_1 = require("./Options/Classes/Grab.js");
6
6
  const Utils_js_1 = require("./Utils.js");
7
+ const grabMode = "grab";
7
8
  class Grabber extends engine_1.ExternalInteractorBase {
8
9
  constructor(container) {
9
10
  super(container);
@@ -56,7 +57,7 @@ class Grabber extends engine_1.ExternalInteractorBase {
56
57
  }
57
58
  isEnabled(particle) {
58
59
  const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
59
- return events.onHover.enable && !!mouse.position && (0, engine_1.isInArray)("grab", events.onHover.mode);
60
+ return events.onHover.enable && !!mouse.position && (0, engine_1.isInArray)(grabMode, events.onHover.mode);
60
61
  }
61
62
  loadModeOptions(options, ...sources) {
62
63
  if (!options.grab) {
@@ -7,18 +7,6 @@ class Grab {
7
7
  this.distance = 100;
8
8
  this.links = new GrabLinks_js_1.GrabLinks();
9
9
  }
10
- get lineLinked() {
11
- return this.links;
12
- }
13
- set lineLinked(value) {
14
- this.links = value;
15
- }
16
- get line_linked() {
17
- return this.links;
18
- }
19
- set line_linked(value) {
20
- this.links = value;
21
- }
22
10
  load(data) {
23
11
  if (!data) {
24
12
  return;
@@ -26,7 +14,7 @@ class Grab {
26
14
  if (data.distance !== undefined) {
27
15
  this.distance = data.distance;
28
16
  }
29
- this.links.load(data.links ?? data.lineLinked ?? data.line_linked);
17
+ this.links.load(data.links);
30
18
  }
31
19
  }
32
20
  exports.Grab = Grab;
package/esm/Grabber.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ExternalInteractorBase, getDistance, getLinkColor, getLinkRandomColor, isInArray, mouseMoveEvent, } from "@tsparticles/engine";
2
2
  import { Grab } from "./Options/Classes/Grab.js";
3
3
  import { drawGrab } from "./Utils.js";
4
+ const grabMode = "grab";
4
5
  export class Grabber extends ExternalInteractorBase {
5
6
  constructor(container) {
6
7
  super(container);
@@ -53,7 +54,7 @@ export class Grabber extends ExternalInteractorBase {
53
54
  }
54
55
  isEnabled(particle) {
55
56
  const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;
56
- return events.onHover.enable && !!mouse.position && isInArray("grab", events.onHover.mode);
57
+ return events.onHover.enable && !!mouse.position && isInArray(grabMode, events.onHover.mode);
57
58
  }
58
59
  loadModeOptions(options, ...sources) {
59
60
  if (!options.grab) {
@@ -4,18 +4,6 @@ export class Grab {
4
4
  this.distance = 100;
5
5
  this.links = new GrabLinks();
6
6
  }
7
- get lineLinked() {
8
- return this.links;
9
- }
10
- set lineLinked(value) {
11
- this.links = value;
12
- }
13
- get line_linked() {
14
- return this.links;
15
- }
16
- set line_linked(value) {
17
- this.links = value;
18
- }
19
7
  load(data) {
20
8
  if (!data) {
21
9
  return;
@@ -23,6 +11,6 @@ export class Grab {
23
11
  if (data.distance !== undefined) {
24
12
  this.distance = data.distance;
25
13
  }
26
- this.links.load(data.links ?? data.lineLinked ?? data.line_linked);
14
+ this.links.load(data.links);
27
15
  }
28
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-external-grab",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.5",
4
4
  "description": "tsParticles grab 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.5"
91
91
  },
92
92
  "publishConfig": {
93
93
  "access": "public"