@tsparticles/interaction-external-remove 4.0.0-alpha.5 → 4.0.0-beta.0
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/909.min.js +1 -0
- package/README.md +5 -0
- package/browser/Options/Classes/Remove.js +1 -0
- package/browser/Remover.js +6 -3
- package/browser/index.js +3 -3
- package/cjs/Options/Classes/Remove.js +1 -0
- package/cjs/Remover.js +6 -3
- package/cjs/index.js +3 -3
- package/dist_browser_Remover_js.js +2 -2
- package/esm/Options/Classes/Remove.js +1 -0
- package/esm/Remover.js +6 -3
- package/esm/index.js +3 -3
- package/package.json +3 -3
- package/report.html +3 -3
- package/tsparticles.interaction.external.remove.js +41 -29
- package/tsparticles.interaction.external.remove.min.js +2 -2
- package/types/Remover.d.ts +3 -2
- package/umd/Options/Classes/Remove.js +1 -0
- package/umd/Remover.js +5 -2
- package/umd/index.js +3 -3
- package/569.min.js +0 -2
- package/569.min.js.LICENSE.txt +0 -1
- package/tsparticles.interaction.external.remove.min.js.LICENSE.txt +0 -1
package/909.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_external_remove=this.webpackChunk_tsparticles_interaction_external_remove||[]).push([[909],{909(e,t,i){i.d(t,{Remover:()=>s});var n=i(702),r=i(303),a=i(237);let o="remove";class s extends n.ExternalInteractorBase{handleClickMode;maxDistance=0;constructor(e){super(e),this.handleClickMode=e=>{let t=this.container,i=t.actualOptions;if(!i.interactivity?.modes.remove||e!==o)return;let n=(0,r.getRangeValue)(i.interactivity.modes.remove.quantity);t.particles.removeQuantity(n)}}clear(){}init(){}interact(){}isEnabled(e,t){let i=this.container.actualOptions,n=e.mouse,a=(t?.interactivity??i.interactivity)?.events;return!!a&&n.clicking&&n.inside&&!!n.position&&(0,r.isInArray)(o,a.onClick.mode)}loadModeOptions(e,...t){for(let i of(e.remove??=new a.n,t))e.remove.load(i?.remove)}reset(){}}}}]);
|
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Once the scripts are loaded you can set up `tsParticles` and the interaction plu
|
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
30
|
(async () => {
|
|
31
|
+
await loadInteractivityPlugin(tsParticles);
|
|
31
32
|
await loadExternalRemoveInteraction(tsParticles);
|
|
32
33
|
|
|
33
34
|
await tsParticles.load({
|
|
@@ -57,9 +58,11 @@ Then you need to import it in the app, like this:
|
|
|
57
58
|
|
|
58
59
|
```javascript
|
|
59
60
|
const { tsParticles } = require("@tsparticles/engine");
|
|
61
|
+
const { loadInteractivityPlugin } = require("@tsparticles/plugin-interactivity");
|
|
60
62
|
const { loadExternalRemoveInteraction } = require("@tsparticles/interaction-external-remove");
|
|
61
63
|
|
|
62
64
|
(async () => {
|
|
65
|
+
await loadInteractivityPlugin(tsParticles);
|
|
63
66
|
await loadExternalRemoveInteraction(tsParticles);
|
|
64
67
|
})();
|
|
65
68
|
```
|
|
@@ -68,9 +71,11 @@ or
|
|
|
68
71
|
|
|
69
72
|
```javascript
|
|
70
73
|
import { tsParticles } from "@tsparticles/engine";
|
|
74
|
+
import { loadInteractivityPlugin } from "@tsparticles/plugin-interactivity";
|
|
71
75
|
import { loadExternalRemoveInteraction } from "@tsparticles/interaction-external-remove";
|
|
72
76
|
|
|
73
77
|
(async () => {
|
|
78
|
+
await loadInteractivityPlugin(tsParticles);
|
|
74
79
|
await loadExternalRemoveInteraction(tsParticles);
|
|
75
80
|
})();
|
|
76
81
|
```
|
package/browser/Remover.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { getRangeValue } from "@tsparticles/engine";
|
|
2
|
+
import { getRangeValue, isInArray } from "@tsparticles/engine";
|
|
3
3
|
import { Remove } from "./Options/Classes/Remove.js";
|
|
4
4
|
const removeMode = "remove";
|
|
5
5
|
export class Remover extends ExternalInteractorBase {
|
|
6
|
+
handleClickMode;
|
|
7
|
+
maxDistance = 0;
|
|
6
8
|
constructor(container) {
|
|
7
9
|
super(container);
|
|
8
10
|
this.handleClickMode = (mode) => {
|
|
@@ -20,8 +22,9 @@ export class Remover extends ExternalInteractorBase {
|
|
|
20
22
|
}
|
|
21
23
|
interact() {
|
|
22
24
|
}
|
|
23
|
-
isEnabled() {
|
|
24
|
-
|
|
25
|
+
isEnabled(interactivityData, particle) {
|
|
26
|
+
const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
|
|
27
|
+
return !!events && mouse.clicking && mouse.inside && !!mouse.position && isInArray(removeMode, events.onClick.mode);
|
|
25
28
|
}
|
|
26
29
|
loadModeOptions(options, ...sources) {
|
|
27
30
|
options.remove ??= new Remove();
|
package/browser/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalRemoveInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalRemove", async (container) => {
|
|
7
7
|
const { Remover } = await import("./Remover.js");
|
|
8
8
|
return new Remover(container);
|
package/cjs/Remover.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { getRangeValue } from "@tsparticles/engine";
|
|
2
|
+
import { getRangeValue, isInArray } from "@tsparticles/engine";
|
|
3
3
|
import { Remove } from "./Options/Classes/Remove.js";
|
|
4
4
|
const removeMode = "remove";
|
|
5
5
|
export class Remover extends ExternalInteractorBase {
|
|
6
|
+
handleClickMode;
|
|
7
|
+
maxDistance = 0;
|
|
6
8
|
constructor(container) {
|
|
7
9
|
super(container);
|
|
8
10
|
this.handleClickMode = (mode) => {
|
|
@@ -20,8 +22,9 @@ export class Remover extends ExternalInteractorBase {
|
|
|
20
22
|
}
|
|
21
23
|
interact() {
|
|
22
24
|
}
|
|
23
|
-
isEnabled() {
|
|
24
|
-
|
|
25
|
+
isEnabled(interactivityData, particle) {
|
|
26
|
+
const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
|
|
27
|
+
return !!events && mouse.clicking && mouse.inside && !!mouse.position && isInArray(removeMode, events.onClick.mode);
|
|
25
28
|
}
|
|
26
29
|
loadModeOptions(options, ...sources) {
|
|
27
30
|
options.remove ??= new Remove();
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalRemoveInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalRemove", async (container) => {
|
|
7
7
|
const { Remover } = await import("./Remover.js");
|
|
8
8
|
return new Remover(container);
|
|
@@ -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
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\*********************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Remover: () => (/* binding */ Remover)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Remove_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Remove.js */ \"./dist/browser/Options/Classes/Remove.js\");\n\n\n\nconst removeMode = \"remove\";\nclass Remover extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Remover: () => (/* binding */ Remover)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Remove_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Remove.js */ \"./dist/browser/Options/Classes/Remove.js\");\n\n\n\nconst removeMode = \"remove\";\nclass Remover extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n handleClickMode;\n maxDistance = 0;\n constructor(container){\n super(container);\n this.handleClickMode = (mode)=>{\n const container = this.container, options = container.actualOptions;\n if (!options.interactivity?.modes.remove || mode !== removeMode) {\n return;\n }\n const removeNb = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.getRangeValue)(options.interactivity.modes.remove.quantity);\n container.particles.removeQuantity(removeNb);\n };\n }\n clear() {}\n init() {}\n interact() {}\n isEnabled(interactivityData, particle) {\n const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;\n return !!events && mouse.clicking && mouse.inside && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isInArray)(removeMode, events.onClick.mode);\n }\n loadModeOptions(options, ...sources) {\n options.remove ??= new _Options_Classes_Remove_js__WEBPACK_IMPORTED_MODULE_2__.Remove();\n for (const source of sources){\n options.remove.load(source?.remove);\n }\n }\n reset() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-remove/./dist/browser/Remover.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/Remover.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
-
import { getRangeValue } from "@tsparticles/engine";
|
|
2
|
+
import { getRangeValue, isInArray } from "@tsparticles/engine";
|
|
3
3
|
import { Remove } from "./Options/Classes/Remove.js";
|
|
4
4
|
const removeMode = "remove";
|
|
5
5
|
export class Remover extends ExternalInteractorBase {
|
|
6
|
+
handleClickMode;
|
|
7
|
+
maxDistance = 0;
|
|
6
8
|
constructor(container) {
|
|
7
9
|
super(container);
|
|
8
10
|
this.handleClickMode = (mode) => {
|
|
@@ -20,8 +22,9 @@ export class Remover extends ExternalInteractorBase {
|
|
|
20
22
|
}
|
|
21
23
|
interact() {
|
|
22
24
|
}
|
|
23
|
-
isEnabled() {
|
|
24
|
-
|
|
25
|
+
isEnabled(interactivityData, particle) {
|
|
26
|
+
const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
|
|
27
|
+
return !!events && mouse.clicking && mouse.inside && !!mouse.position && isInArray(removeMode, events.onClick.mode);
|
|
25
28
|
}
|
|
26
29
|
loadModeOptions(options, ...sources) {
|
|
27
30
|
options.remove ??= new Remove();
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalRemoveInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalRemove", async (container) => {
|
|
7
7
|
const { Remover } = await import("./Remover.js");
|
|
8
8
|
return new Remover(container);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-remove",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles remove external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "4.0.0-
|
|
91
|
-
"@tsparticles/plugin-interactivity": "4.0.0-
|
|
90
|
+
"@tsparticles/engine": "4.0.0-beta.0",
|
|
91
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.0"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|