@tsparticles/interaction-external-pop 4.0.0-beta.0 → 4.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/217.min.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(this.webpackChunk_tsparticles_interaction_external_pop=this.webpackChunk_tsparticles_interaction_external_pop||[]).push([[217],{217(t,e,i){i.d(e,{Popper:()=>s});var n=i(702),r=i(303);class s extends n.ExternalInteractorBase{handleClickMode;maxDistance=0;constructor(t){super(t),this.handleClickMode=(t,e)=>{let i=this.container;if("pop"!==t)return;let n=e.mouse.clickPosition;if(!n)return;let r=i.particles.grid.queryCircle(n,i.retina.pixelRatio);if(r.length)for(let t of r)t.destroy()}}clear(){}init(){}interact(){}isEnabled(t,e){let i=this.container.actualOptions,n=t.mouse,s=(e?.interactivity??i.interactivity)?.events;return!!s&&n.clicking&&n.inside&&!!n.position&&(0,r.isInArray)("pop",s.onClick.mode)}reset(){}}}}]);
package/browser/Popper.js CHANGED
@@ -20,7 +20,7 @@ export class Popper extends ExternalInteractorBase {
20
20
  return;
21
21
  }
22
22
  for (const particle of poppedParticles) {
23
- container.particles.remove(particle);
23
+ particle.destroy();
24
24
  }
25
25
  };
26
26
  }
package/browser/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import {} from "@tsparticles/engine";
1
2
  export async function loadExternalPopInteraction(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
3
+ engine.checkVersion("4.0.0-beta.2");
4
+ await engine.pluginManager.register(async (e) => {
4
5
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
6
  ensureInteractivityPluginLoaded(e);
6
- e.addInteractor?.("externalPop", async (container) => {
7
+ e.pluginManager.addInteractor?.("externalPop", async (container) => {
7
8
  const { Popper } = await import("./Popper.js");
8
9
  return new Popper(container);
9
10
  });
package/cjs/Popper.js CHANGED
@@ -20,7 +20,7 @@ export class Popper extends ExternalInteractorBase {
20
20
  return;
21
21
  }
22
22
  for (const particle of poppedParticles) {
23
- container.particles.remove(particle);
23
+ particle.destroy();
24
24
  }
25
25
  };
26
26
  }
package/cjs/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import {} from "@tsparticles/engine";
1
2
  export async function loadExternalPopInteraction(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
3
+ engine.checkVersion("4.0.0-beta.2");
4
+ await engine.pluginManager.register(async (e) => {
4
5
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
6
  ensureInteractivityPluginLoaded(e);
6
- e.addInteractor?.("externalPop", async (container) => {
7
+ e.pluginManager.addInteractor?.("externalPop", async (container) => {
7
8
  const { Popper } = await import("./Popper.js");
8
9
  return new Popper(container);
9
10
  });
@@ -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-beta.0
7
+ * v4.0.0-beta.2
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 _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 maxDistance = 0;\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.grid.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}");
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 maxDistance = 0;\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.grid.queryCircle(clickPos, container.retina.pixelRatio);\n if (!poppedParticles.length) {\n return;\n }\n for (const particle of poppedParticles){\n particle.destroy();\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
@@ -20,7 +20,7 @@ export class Popper extends ExternalInteractorBase {
20
20
  return;
21
21
  }
22
22
  for (const particle of poppedParticles) {
23
- container.particles.remove(particle);
23
+ particle.destroy();
24
24
  }
25
25
  };
26
26
  }
package/esm/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import {} from "@tsparticles/engine";
1
2
  export async function loadExternalPopInteraction(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
3
+ engine.checkVersion("4.0.0-beta.2");
4
+ await engine.pluginManager.register(async (e) => {
4
5
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
6
  ensureInteractivityPluginLoaded(e);
6
- e.addInteractor?.("externalPop", async (container) => {
7
+ e.pluginManager.addInteractor?.("externalPop", async (container) => {
7
8
  const { Popper } = await import("./Popper.js");
8
9
  return new Popper(container);
9
10
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-external-pop",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.2",
4
4
  "description": "tsParticles pop external interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -81,17 +81,20 @@
81
81
  "browser": "./browser/index.js",
82
82
  "import": "./esm/index.js",
83
83
  "require": "./cjs/index.js",
84
- "umd": "./umd/index.js",
85
- "default": "./cjs/index.js"
84
+ "default": "./esm/index.js"
86
85
  },
87
86
  "./package.json": "./package.json"
88
87
  },
89
- "dependencies": {
90
- "@tsparticles/engine": "4.0.0-beta.0",
91
- "@tsparticles/plugin-interactivity": "4.0.0-beta.0"
88
+ "peerDepdendencies": {
89
+ "@tsparticles/engine": "4.0.0-beta.1",
90
+ "@tsparticles/plugin-interactivity": "4.0.0-beta.1"
92
91
  },
93
92
  "publishConfig": {
94
93
  "access": "public"
95
94
  },
96
- "type": "module"
95
+ "type": "module",
96
+ "peerDependencies": {
97
+ "@tsparticles/engine": "4.0.0-beta.1",
98
+ "@tsparticles/plugin-interactivity": "4.0.0-beta.1"
99
+ }
97
100
  }