@tsparticles/interaction-external-grab 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.
package/browser/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(
|
|
57
|
+
return events.onHover.enable && !!mouse.position && isInArray(grabMode, events.onHover.mode);
|
|
57
58
|
}
|
|
58
59
|
loadModeOptions(options, ...sources) {
|
|
59
60
|
if (!options.grab) {
|
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)(
|
|
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) {
|
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(
|
|
57
|
+
return events.onHover.enable && !!mouse.position && isInArray(grabMode, events.onHover.mode);
|
|
57
58
|
}
|
|
58
59
|
loadModeOptions(options, ...sources) {
|
|
59
60
|
if (!options.grab) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-grab",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
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
|
-
"
|
|
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.
|
|
90
|
+
"@tsparticles/engine": "^3.0.0-beta.4"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|