@tsparticles/interaction-external-pop 4.0.0-alpha.1 → 4.0.0-alpha.14
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/534.min.js +1 -0
- package/browser/Popper.js +8 -5
- package/browser/index.js +6 -4
- package/cjs/Popper.js +8 -5
- package/cjs/index.js +6 -4
- package/dist_browser_Popper_js.js +2 -2
- package/esm/Popper.js +8 -5
- package/esm/index.js +6 -4
- package/package.json +3 -2
- package/report.html +3 -3
- package/tsparticles.interaction.external.pop.js +46 -6
- package/tsparticles.interaction.external.pop.min.js +2 -2
- package/types/Popper.d.ts +4 -4
- package/types/index.d.ts +1 -1
- package/umd/Popper.js +9 -6
- package/umd/index.js +7 -5
- package/494.min.js +0 -2
- package/494.min.js.LICENSE.txt +0 -1
- package/tsparticles.interaction.external.pop.min.js.LICENSE.txt +0 -1
package/534.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_external_pop=this.webpackChunk_tsparticles_interaction_external_pop||[]).push([[534],{534(e,t,i){i.d(t,{Popper:()=>a});var r=i(702),n=i(303);class a extends r.ExternalInteractorBase{handleClickMode;constructor(e){super(e),this.handleClickMode=(e,t)=>{let i=this.container;if("pop"!==e)return;let r=t.mouse.clickPosition;if(!r)return;let n=i.particles.quadTree.queryCircle(r,i.retina.pixelRatio);if(n.length)for(let e of n)i.particles.remove(e)}}clear(){}init(){}interact(){}isEnabled(e,t){let i=this.container.actualOptions,r=e.mouse,a=(t?.interactivity??i.interactivity)?.events;return!!a&&r.clicking&&r.inside&&!!r.position&&(0,n.isInArray)("pop",a.onClick.mode)}reset(){}}}}]);
|
package/browser/Popper.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { ExternalInteractorBase } from "@tsparticles/
|
|
1
|
+
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
+
import { isInArray } from "@tsparticles/engine";
|
|
2
3
|
const popMode = "pop";
|
|
3
4
|
export class Popper extends ExternalInteractorBase {
|
|
5
|
+
handleClickMode;
|
|
4
6
|
constructor(container) {
|
|
5
7
|
super(container);
|
|
6
|
-
this.handleClickMode = (mode) => {
|
|
8
|
+
this.handleClickMode = (mode, interactivityData) => {
|
|
7
9
|
const container = this.container;
|
|
8
10
|
if (mode !== popMode) {
|
|
9
11
|
return;
|
|
10
12
|
}
|
|
11
|
-
const clickPos =
|
|
13
|
+
const clickPos = interactivityData.mouse.clickPosition;
|
|
12
14
|
if (!clickPos) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
@@ -27,8 +29,9 @@ export class Popper extends ExternalInteractorBase {
|
|
|
27
29
|
}
|
|
28
30
|
interact() {
|
|
29
31
|
}
|
|
30
|
-
isEnabled() {
|
|
31
|
-
|
|
32
|
+
isEnabled(interactivityData, particle) {
|
|
33
|
+
const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
|
|
34
|
+
return !!events && mouse.clicking && mouse.inside && !!mouse.position && isInArray(popMode, events.onClick.mode);
|
|
32
35
|
}
|
|
33
36
|
reset() {
|
|
34
37
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export function loadExternalPopInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-alpha.
|
|
3
|
-
engine.register(e => {
|
|
4
|
-
|
|
1
|
+
export async function loadExternalPopInteraction(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.14");
|
|
3
|
+
await engine.register(async (e) => {
|
|
4
|
+
const { loadInteractivityPlugin } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
await loadInteractivityPlugin(e);
|
|
6
|
+
e.addInteractor?.("externalPop", async (container) => {
|
|
5
7
|
const { Popper } = await import("./Popper.js");
|
|
6
8
|
return new Popper(container);
|
|
7
9
|
});
|
package/cjs/Popper.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { ExternalInteractorBase } from "@tsparticles/
|
|
1
|
+
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
+
import { isInArray } from "@tsparticles/engine";
|
|
2
3
|
const popMode = "pop";
|
|
3
4
|
export class Popper extends ExternalInteractorBase {
|
|
5
|
+
handleClickMode;
|
|
4
6
|
constructor(container) {
|
|
5
7
|
super(container);
|
|
6
|
-
this.handleClickMode = (mode) => {
|
|
8
|
+
this.handleClickMode = (mode, interactivityData) => {
|
|
7
9
|
const container = this.container;
|
|
8
10
|
if (mode !== popMode) {
|
|
9
11
|
return;
|
|
10
12
|
}
|
|
11
|
-
const clickPos =
|
|
13
|
+
const clickPos = interactivityData.mouse.clickPosition;
|
|
12
14
|
if (!clickPos) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
@@ -27,8 +29,9 @@ export class Popper extends ExternalInteractorBase {
|
|
|
27
29
|
}
|
|
28
30
|
interact() {
|
|
29
31
|
}
|
|
30
|
-
isEnabled() {
|
|
31
|
-
|
|
32
|
+
isEnabled(interactivityData, particle) {
|
|
33
|
+
const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
|
|
34
|
+
return !!events && mouse.clicking && mouse.inside && !!mouse.position && isInArray(popMode, events.onClick.mode);
|
|
32
35
|
}
|
|
33
36
|
reset() {
|
|
34
37
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export function loadExternalPopInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-alpha.
|
|
3
|
-
engine.register(e => {
|
|
4
|
-
|
|
1
|
+
export async function loadExternalPopInteraction(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.14");
|
|
3
|
+
await engine.register(async (e) => {
|
|
4
|
+
const { loadInteractivityPlugin } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
await loadInteractivityPlugin(e);
|
|
6
|
+
e.addInteractor?.("externalPop", async (container) => {
|
|
5
7
|
const { Popper } = await import("./Popper.js");
|
|
6
8
|
return new Popper(container);
|
|
7
9
|
});
|
|
@@ -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-alpha.
|
|
7
|
+
* v4.0.0-alpha.14
|
|
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 */ Popper: () => (/* binding */ Popper)\n/* harmony export */ });\n/* harmony import */ var
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Popper: () => (/* binding */ Popper)\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\n\nconst popMode = \"pop\";\nclass Popper extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n handleClickMode;\n constructor(container){\n super(container);\n this.handleClickMode = (mode, interactivityData)=>{\n const container = this.container;\n if (mode !== popMode) {\n return;\n }\n const clickPos = interactivityData.mouse.clickPosition;\n if (!clickPos) {\n return;\n }\n const poppedParticles = container.particles.quadTree.queryCircle(clickPos, container.retina.pixelRatio);\n if (!poppedParticles.length) {\n return;\n }\n for (const particle of poppedParticles){\n container.particles.remove(particle);\n }\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)(popMode, events.onClick.mode);\n }\n reset() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-pop/./dist/browser/Popper.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/Popper.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { ExternalInteractorBase } from "@tsparticles/
|
|
1
|
+
import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
2
|
+
import { isInArray } from "@tsparticles/engine";
|
|
2
3
|
const popMode = "pop";
|
|
3
4
|
export class Popper extends ExternalInteractorBase {
|
|
5
|
+
handleClickMode;
|
|
4
6
|
constructor(container) {
|
|
5
7
|
super(container);
|
|
6
|
-
this.handleClickMode = (mode) => {
|
|
8
|
+
this.handleClickMode = (mode, interactivityData) => {
|
|
7
9
|
const container = this.container;
|
|
8
10
|
if (mode !== popMode) {
|
|
9
11
|
return;
|
|
10
12
|
}
|
|
11
|
-
const clickPos =
|
|
13
|
+
const clickPos = interactivityData.mouse.clickPosition;
|
|
12
14
|
if (!clickPos) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
@@ -27,8 +29,9 @@ export class Popper extends ExternalInteractorBase {
|
|
|
27
29
|
}
|
|
28
30
|
interact() {
|
|
29
31
|
}
|
|
30
|
-
isEnabled() {
|
|
31
|
-
|
|
32
|
+
isEnabled(interactivityData, particle) {
|
|
33
|
+
const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
|
|
34
|
+
return !!events && mouse.clicking && mouse.inside && !!mouse.position && isInArray(popMode, events.onClick.mode);
|
|
32
35
|
}
|
|
33
36
|
reset() {
|
|
34
37
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export function loadExternalPopInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-alpha.
|
|
3
|
-
engine.register(e => {
|
|
4
|
-
|
|
1
|
+
export async function loadExternalPopInteraction(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.14");
|
|
3
|
+
await engine.register(async (e) => {
|
|
4
|
+
const { loadInteractivityPlugin } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
await loadInteractivityPlugin(e);
|
|
6
|
+
e.addInteractor?.("externalPop", async (container) => {
|
|
5
7
|
const { Popper } = await import("./Popper.js");
|
|
6
8
|
return new Popper(container);
|
|
7
9
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-pop",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.14",
|
|
4
4
|
"description": "tsParticles pop external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,7 +87,8 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "4.0.0-alpha.
|
|
90
|
+
"@tsparticles/engine": "4.0.0-alpha.14",
|
|
91
|
+
"@tsparticles/plugin-interactivity": "4.0.0-alpha.14"
|
|
91
92
|
},
|
|
92
93
|
"publishConfig": {
|
|
93
94
|
"access": "public"
|