@tsparticles/interaction-external-grab 3.0.0-beta.0 → 3.0.0-beta.2
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 +1 -1
- package/browser/Grabber.js +2 -2
- package/browser/Options/Classes/Grab.js +1 -1
- package/browser/index.js +5 -5
- package/browser/package.json +1 -0
- package/cjs/Grabber.js +4 -4
- package/cjs/Options/Classes/Grab.js +2 -2
- package/cjs/index.js +6 -6
- package/cjs/package.json +1 -0
- package/esm/Grabber.js +2 -2
- package/esm/Options/Classes/Grab.js +1 -1
- package/esm/index.js +5 -5
- package/esm/package.json +1 -0
- package/package.json +18 -6
- package/report.html +23 -5
- package/tsparticles.interaction.external.grab.js +1 -1
- package/tsparticles.interaction.external.grab.min.js.LICENSE.txt +1 -1
- package/types/Grabber.d.ts +1 -1
- package/types/Options/Classes/Grab.d.ts +2 -2
- package/types/Options/Classes/GrabLinks.d.ts +1 -1
- package/types/Options/Classes/GrabOptions.d.ts +1 -1
- package/types/Options/Interfaces/IGrab.d.ts +1 -1
- package/types/Types.d.ts +3 -3
- package/types/Utils.d.ts +1 -1
- package/types/index.d.ts +4 -4
- package/umd/Grabber.js +5 -5
- package/umd/Options/Classes/Grab.js +3 -3
- package/umd/index.js +7 -7
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-beta.
|
|
7
|
+
* v3.0.0-beta.2
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Grab External Interaction v3.0.0-beta.
|
|
1
|
+
/*! tsParticles Grab External Interaction v3.0.0-beta.2 by Matteo Bruni */
|
package/types/Grabber.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExternalInteractorBase, type IModes, type Modes, type Particle, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
-
import type { GrabContainer, GrabMode, IGrabMode } from "./Types";
|
|
2
|
+
import type { GrabContainer, GrabMode, IGrabMode } from "./Types.js";
|
|
3
3
|
export declare class Grabber extends ExternalInteractorBase<GrabContainer> {
|
|
4
4
|
constructor(container: GrabContainer);
|
|
5
5
|
clear(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IOptionLoader, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
-
import { GrabLinks } from "./GrabLinks";
|
|
3
|
-
import type { IGrab } from "../Interfaces/IGrab";
|
|
2
|
+
import { GrabLinks } from "./GrabLinks.js";
|
|
3
|
+
import type { IGrab } from "../Interfaces/IGrab.js";
|
|
4
4
|
export declare class Grab implements IGrab, IOptionLoader<IGrab> {
|
|
5
5
|
distance: number;
|
|
6
6
|
links: GrabLinks;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IOptionLoader, OptionsColor, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
-
import type { IGrabLinks } from "../Interfaces/IGrabLinks";
|
|
2
|
+
import type { IGrabLinks } from "../Interfaces/IGrabLinks.js";
|
|
3
3
|
export declare class GrabLinks implements IGrabLinks, IOptionLoader<IGrabLinks> {
|
|
4
4
|
blink: boolean;
|
|
5
5
|
color?: OptionsColor;
|
package/types/Types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Container, IRgb, OptionsColor, Particle } from "@tsparticles/engine";
|
|
2
|
-
import type { Grab } from "./Options/Classes/Grab";
|
|
3
|
-
import type { GrabOptions } from "./Options/Classes/GrabOptions";
|
|
4
|
-
import type { IGrab } from "./Options/Interfaces/IGrab";
|
|
2
|
+
import type { Grab } from "./Options/Classes/Grab.js";
|
|
3
|
+
import type { GrabOptions } from "./Options/Classes/GrabOptions.js";
|
|
4
|
+
import type { IGrab } from "./Options/Interfaces/IGrab.js";
|
|
5
5
|
export type IGrabMode = {
|
|
6
6
|
grab: IGrab;
|
|
7
7
|
};
|
package/types/Utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GrabContainer, LinkParticle } from "./Types";
|
|
1
|
+
import type { GrabContainer, LinkParticle } from "./Types.js";
|
|
2
2
|
import { type ICoordinates, type IRgb } from "@tsparticles/engine";
|
|
3
3
|
export declare function drawGrabLine(context: CanvasRenderingContext2D, width: number, begin: ICoordinates, end: ICoordinates, colorLine: IRgb, opacity: number): void;
|
|
4
4
|
export declare function drawGrab(container: GrabContainer, particle: LinkParticle, lineColor: IRgb, opacity: number, mousePos: ICoordinates): void;
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Engine } from "@tsparticles/engine";
|
|
2
2
|
export declare function loadExternalGrabInteraction(engine: Engine, refresh?: boolean): Promise<void>;
|
|
3
|
-
export * from "./Options/Classes/Grab";
|
|
4
|
-
export * from "./Options/Classes/GrabLinks";
|
|
5
|
-
export * from "./Options/Interfaces/IGrab";
|
|
6
|
-
export * from "./Options/Interfaces/IGrabLinks";
|
|
3
|
+
export * from "./Options/Classes/Grab.js";
|
|
4
|
+
export * from "./Options/Classes/GrabLinks.js";
|
|
5
|
+
export * from "./Options/Interfaces/IGrab.js";
|
|
6
|
+
export * from "./Options/Interfaces/IGrabLinks.js";
|
package/umd/Grabber.js
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Grab", "./Utils"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Grab.js", "./Utils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Grabber = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const Grab_js_1 = require("./Options/Classes/Grab.js");
|
|
15
|
+
const Utils_js_1 = require("./Utils.js");
|
|
16
16
|
class Grabber extends engine_1.ExternalInteractorBase {
|
|
17
17
|
constructor(container) {
|
|
18
18
|
super(container);
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
if (!colorLine) {
|
|
61
61
|
continue;
|
|
62
62
|
}
|
|
63
|
-
(0,
|
|
63
|
+
(0, Utils_js_1.drawGrab)(container, particle, colorLine, opacityLine, mousePos);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
isEnabled(particle) {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
loadModeOptions(options, ...sources) {
|
|
71
71
|
if (!options.grab) {
|
|
72
|
-
options.grab = new
|
|
72
|
+
options.grab = new Grab_js_1.Grab();
|
|
73
73
|
}
|
|
74
74
|
for (const source of sources) {
|
|
75
75
|
options.grab.load(source?.grab);
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./GrabLinks"], factory);
|
|
7
|
+
define(["require", "exports", "./GrabLinks.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Grab = void 0;
|
|
13
|
-
const
|
|
13
|
+
const GrabLinks_js_1 = require("./GrabLinks.js");
|
|
14
14
|
class Grab {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.distance = 100;
|
|
17
|
-
this.links = new
|
|
17
|
+
this.links = new GrabLinks_js_1.GrabLinks();
|
|
18
18
|
}
|
|
19
19
|
get lineLinked() {
|
|
20
20
|
return this.links;
|
package/umd/index.js
CHANGED
|
@@ -18,19 +18,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
if (v !== undefined) module.exports = v;
|
|
19
19
|
}
|
|
20
20
|
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./Grabber", "./Options/Classes/Grab", "./Options/Classes/GrabLinks", "./Options/Interfaces/IGrab", "./Options/Interfaces/IGrabLinks"], factory);
|
|
21
|
+
define(["require", "exports", "./Grabber.js", "./Options/Classes/Grab.js", "./Options/Classes/GrabLinks.js", "./Options/Interfaces/IGrab.js", "./Options/Interfaces/IGrabLinks.js"], factory);
|
|
22
22
|
}
|
|
23
23
|
})(function (require, exports) {
|
|
24
24
|
"use strict";
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.loadExternalGrabInteraction = void 0;
|
|
27
|
-
const
|
|
27
|
+
const Grabber_js_1 = require("./Grabber.js");
|
|
28
28
|
async function loadExternalGrabInteraction(engine, refresh = true) {
|
|
29
|
-
await engine.addInteractor("externalGrab", (container) => new
|
|
29
|
+
await engine.addInteractor("externalGrab", (container) => new Grabber_js_1.Grabber(container), refresh);
|
|
30
30
|
}
|
|
31
31
|
exports.loadExternalGrabInteraction = loadExternalGrabInteraction;
|
|
32
|
-
__exportStar(require("./Options/Classes/Grab"), exports);
|
|
33
|
-
__exportStar(require("./Options/Classes/GrabLinks"), exports);
|
|
34
|
-
__exportStar(require("./Options/Interfaces/IGrab"), exports);
|
|
35
|
-
__exportStar(require("./Options/Interfaces/IGrabLinks"), exports);
|
|
32
|
+
__exportStar(require("./Options/Classes/Grab.js"), exports);
|
|
33
|
+
__exportStar(require("./Options/Classes/GrabLinks.js"), exports);
|
|
34
|
+
__exportStar(require("./Options/Interfaces/IGrab.js"), exports);
|
|
35
|
+
__exportStar(require("./Options/Interfaces/IGrabLinks.js"), exports);
|
|
36
36
|
});
|