@tsparticles/interaction-external-particle 4.0.0-alpha.8 → 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/828.min.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(this.webpackChunk_tsparticles_interaction_external_particle=this.webpackChunk_tsparticles_interaction_external_particle||[]).push([[828],{828(t,e,i){i.d(e,{InteractivityParticleMaker:()=>n});var s=i(702),o=i(303);class r{options;pauseOnStop;replaceCursor;stopDelay;constructor(){this.replaceCursor=!1,this.pauseOnStop=!1,this.stopDelay=0}load(t){(0,o.isNull)(t)||(void 0!==t.options&&(this.options=(0,o.deepExtend)({},t.options)),void 0!==t.replaceCursor&&(this.replaceCursor=t.replaceCursor),void 0!==t.pauseOnStop&&(this.pauseOnStop=t.pauseOnStop),void 0!==t.stopDelay&&(this.stopDelay=t.stopDelay))}}let a="particle";class n extends s.ExternalInteractorBase{maxDistance=0;_clearTimeout;_lastPosition;_particle;constructor(t){super(t)}clear(){}init(){}interact(t){let e=this.container,i=e.actualOptions;if(!e.retina.reduceFactor)return;let s=t.mouse.position,r=i.interactivity?.modes.particle;if(!r)return;let a=r.pauseOnStop&&(t.mouse.position===this._lastPosition||t.mouse.position?.x===this._lastPosition?.x&&t.mouse.position?.y===this._lastPosition?.y),n=r.stopDelay;if(s?this._lastPosition={...s}:delete this._lastPosition,this._lastPosition){if(a){if(this._clearTimeout)return;this._clearTimeout=setTimeout(()=>{if(this._particle){if(r.replaceCursor){let e=t.element;e&&(e instanceof Window?(0,o.safeDocument)().body.style.cursor="":e.style.cursor="")}this.container.particles.remove(this._particle,void 0,!0),delete this._particle}},n);return}if(this._clearTimeout&&(clearTimeout(this._clearTimeout),delete this._clearTimeout),!this._particle){let i=(0,o.deepExtend)(r.options,{move:{enable:!1}});if(this._particle=e.particles.addParticle(this._lastPosition,i),r.replaceCursor){let e=t.element;e&&(e instanceof Window?(0,o.safeDocument)().body.style.cursor="none":e.style.cursor="none")}}this._particle&&(this._particle.position.x=this._lastPosition.x,this._particle.position.y=this._lastPosition.y)}}isEnabled(t,e){let i=this.container.actualOptions,s=t.mouse,r=(e?.interactivity??i.interactivity)?.events;return!!r&&(s.clicking&&s.inside&&!!s.position&&(0,o.isInArray)(a,r.onClick.mode)||s.inside&&!!s.position&&(0,o.isInArray)(a,r.onHover.mode))}loadModeOptions(t,...e){for(let i of(t.particle??=new r,e))t.particle.load(i?.particle)}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 loadExternalParticleInteraction(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 { loadExternalParticleInteraction } = require("@tsparticles/interaction-external-particle");
61
63
 
62
64
  (async () => {
65
+ await loadInteractivityPlugin(tsParticles);
63
66
  await loadExternalParticleInteraction(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 { loadExternalParticleInteraction } from "@tsparticles/interaction-external-particle";
72
76
 
73
77
  (async () => {
78
+ await loadInteractivityPlugin(tsParticles);
74
79
  await loadExternalParticleInteraction(tsParticles);
75
80
  })();
76
81
  ```
@@ -3,6 +3,10 @@ import { deepExtend, isInArray, safeDocument, } from "@tsparticles/engine";
3
3
  import { InteractivityParticleOptions } from "./Options/Classes/InteractivityParticleOptions.js";
4
4
  const particleMode = "particle";
5
5
  export class InteractivityParticleMaker extends ExternalInteractorBase {
6
+ maxDistance = 0;
7
+ _clearTimeout;
8
+ _lastPosition;
9
+ _particle;
6
10
  constructor(container) {
7
11
  super(container);
8
12
  }
@@ -1,5 +1,9 @@
1
1
  import { deepExtend, isNull, } from "@tsparticles/engine";
2
2
  export class InteractivityParticleOptions {
3
+ options;
4
+ pauseOnStop;
5
+ replaceCursor;
6
+ stopDelay;
3
7
  constructor() {
4
8
  this.replaceCursor = false;
5
9
  this.pauseOnStop = false;
package/browser/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export async function loadExternalParticleInteraction(engine) {
2
- engine.checkVersion("4.0.0-alpha.8");
2
+ engine.checkVersion("4.0.0-beta.0");
3
3
  await engine.register(async (e) => {
4
- const { loadInteractivityPlugin } = await import("@tsparticles/plugin-interactivity");
5
- await loadInteractivityPlugin(e);
4
+ const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
+ ensureInteractivityPluginLoaded(e);
6
6
  e.addInteractor?.("externalParticle", async (container) => {
7
7
  const { InteractivityParticleMaker } = await import("./InteractivityParticleMaker.js");
8
8
  return new InteractivityParticleMaker(container);
@@ -3,6 +3,10 @@ import { deepExtend, isInArray, safeDocument, } from "@tsparticles/engine";
3
3
  import { InteractivityParticleOptions } from "./Options/Classes/InteractivityParticleOptions.js";
4
4
  const particleMode = "particle";
5
5
  export class InteractivityParticleMaker extends ExternalInteractorBase {
6
+ maxDistance = 0;
7
+ _clearTimeout;
8
+ _lastPosition;
9
+ _particle;
6
10
  constructor(container) {
7
11
  super(container);
8
12
  }
@@ -1,5 +1,9 @@
1
1
  import { deepExtend, isNull, } from "@tsparticles/engine";
2
2
  export class InteractivityParticleOptions {
3
+ options;
4
+ pauseOnStop;
5
+ replaceCursor;
6
+ stopDelay;
3
7
  constructor() {
4
8
  this.replaceCursor = false;
5
9
  this.pauseOnStop = false;
package/cjs/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export async function loadExternalParticleInteraction(engine) {
2
- engine.checkVersion("4.0.0-alpha.8");
2
+ engine.checkVersion("4.0.0-beta.0");
3
3
  await engine.register(async (e) => {
4
- const { loadInteractivityPlugin } = await import("@tsparticles/plugin-interactivity");
5
- await loadInteractivityPlugin(e);
4
+ const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
+ ensureInteractivityPluginLoaded(e);
6
6
  e.addInteractor?.("externalParticle", async (container) => {
7
7
  const { InteractivityParticleMaker } = await import("./InteractivityParticleMaker.js");
8
8
  return new InteractivityParticleMaker(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-alpha.8
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 */ InteractivityParticleMaker: () => (/* binding */ InteractivityParticleMaker)\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_InteractivityParticleOptions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/InteractivityParticleOptions.js */ \"./dist/browser/Options/Classes/InteractivityParticleOptions.js\");\n\n\n\nconst particleMode = \"particle\";\nclass InteractivityParticleMaker extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n constructor(container) {\n super(container);\n }\n clear() {}\n init() {}\n interact(interactivityData) {\n const container = this.container,\n options = container.actualOptions;\n if (!container.retina.reduceFactor) {\n return;\n }\n const mousePos = interactivityData.mouse.position,\n interactivityParticleOptions = options.interactivity?.modes.particle;\n if (!interactivityParticleOptions) {\n return;\n }\n const mouseStopped = interactivityParticleOptions.pauseOnStop && (interactivityData.mouse.position === this._lastPosition || interactivityData.mouse.position?.x === this._lastPosition?.x && interactivityData.mouse.position?.y === this._lastPosition?.y),\n clearDelay = interactivityParticleOptions.stopDelay;\n if (mousePos) {\n this._lastPosition = {\n ...mousePos\n };\n } else {\n delete this._lastPosition;\n }\n if (!this._lastPosition) {\n return;\n }\n if (mouseStopped) {\n if (this._clearTimeout) {\n return;\n }\n this._clearTimeout = setTimeout(() => {\n if (!this._particle) {\n return;\n }\n if (interactivityParticleOptions.replaceCursor) {\n const element = interactivityData.element;\n if (element) {\n if (element instanceof Window) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.safeDocument)().body.style.cursor = \"\";\n } else {\n element.style.cursor = \"\";\n }\n }\n }\n this.container.particles.remove(this._particle, undefined, true);\n delete this._particle;\n }, clearDelay);\n return;\n }\n if (this._clearTimeout) {\n clearTimeout(this._clearTimeout);\n delete this._clearTimeout;\n }\n if (!this._particle) {\n const particleOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.deepExtend)(interactivityParticleOptions.options, {\n move: {\n enable: false\n }\n });\n this._particle = container.particles.addParticle(this._lastPosition, particleOptions);\n if (interactivityParticleOptions.replaceCursor) {\n const element = interactivityData.element;\n if (element) {\n if (element instanceof Window) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.safeDocument)().body.style.cursor = \"none\";\n } else {\n element.style.cursor = \"none\";\n }\n }\n }\n }\n if (!this._particle) {\n return;\n }\n this._particle.position.x = this._lastPosition.x;\n this._particle.position.y = this._lastPosition.y;\n }\n isEnabled(interactivityData, particle) {\n const container = this.container,\n options = container.actualOptions,\n mouse = interactivityData.mouse,\n events = (particle?.interactivity ?? options.interactivity)?.events;\n return !!events && (mouse.clicking && mouse.inside && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isInArray)(particleMode, events.onClick.mode) || mouse.inside && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isInArray)(particleMode, events.onHover.mode));\n }\n loadModeOptions(options, ...sources) {\n options.particle ??= new _Options_Classes_InteractivityParticleOptions_js__WEBPACK_IMPORTED_MODULE_2__.InteractivityParticleOptions();\n for (const source of sources) {\n options.particle.load(source?.particle);\n }\n }\n reset() {}\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-particle/./dist/browser/InteractivityParticleMaker.js?\n}");
26
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ InteractivityParticleMaker: () => (/* binding */ InteractivityParticleMaker)\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_InteractivityParticleOptions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/InteractivityParticleOptions.js */ \"./dist/browser/Options/Classes/InteractivityParticleOptions.js\");\n\n\n\nconst particleMode = \"particle\";\nclass InteractivityParticleMaker extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n maxDistance = 0;\n _clearTimeout;\n _lastPosition;\n _particle;\n constructor(container){\n super(container);\n }\n clear() {}\n init() {}\n interact(interactivityData) {\n const container = this.container, options = container.actualOptions;\n if (!container.retina.reduceFactor) {\n return;\n }\n const mousePos = interactivityData.mouse.position, interactivityParticleOptions = options.interactivity?.modes.particle;\n if (!interactivityParticleOptions) {\n return;\n }\n const mouseStopped = interactivityParticleOptions.pauseOnStop && (interactivityData.mouse.position === this._lastPosition || interactivityData.mouse.position?.x === this._lastPosition?.x && interactivityData.mouse.position?.y === this._lastPosition?.y), clearDelay = interactivityParticleOptions.stopDelay;\n if (mousePos) {\n this._lastPosition = {\n ...mousePos\n };\n } else {\n delete this._lastPosition;\n }\n if (!this._lastPosition) {\n return;\n }\n if (mouseStopped) {\n if (this._clearTimeout) {\n return;\n }\n this._clearTimeout = setTimeout(()=>{\n if (!this._particle) {\n return;\n }\n if (interactivityParticleOptions.replaceCursor) {\n const element = interactivityData.element;\n if (element) {\n if (element instanceof Window) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.safeDocument)().body.style.cursor = \"\";\n } else {\n element.style.cursor = \"\";\n }\n }\n }\n this.container.particles.remove(this._particle, undefined, true);\n delete this._particle;\n }, clearDelay);\n return;\n }\n if (this._clearTimeout) {\n clearTimeout(this._clearTimeout);\n delete this._clearTimeout;\n }\n if (!this._particle) {\n const particleOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.deepExtend)(interactivityParticleOptions.options, {\n move: {\n enable: false\n }\n });\n this._particle = container.particles.addParticle(this._lastPosition, particleOptions);\n if (interactivityParticleOptions.replaceCursor) {\n const element = interactivityData.element;\n if (element) {\n if (element instanceof Window) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.safeDocument)().body.style.cursor = \"none\";\n } else {\n element.style.cursor = \"none\";\n }\n }\n }\n }\n if (!this._particle) {\n return;\n }\n this._particle.position.x = this._lastPosition.x;\n this._particle.position.y = this._lastPosition.y;\n }\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)(particleMode, events.onClick.mode) || mouse.inside && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isInArray)(particleMode, events.onHover.mode));\n }\n loadModeOptions(options, ...sources) {\n options.particle ??= new _Options_Classes_InteractivityParticleOptions_js__WEBPACK_IMPORTED_MODULE_2__.InteractivityParticleOptions();\n for (const source of sources){\n options.particle.load(source?.particle);\n }\n }\n reset() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-particle/./dist/browser/InteractivityParticleMaker.js?\n}");
27
27
 
28
28
  /***/ },
29
29
 
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
33
33
  \**********************************************************************/
34
34
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
35
35
 
36
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ InteractivityParticleOptions: () => (/* binding */ InteractivityParticleOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass InteractivityParticleOptions {\n constructor() {\n this.replaceCursor = false;\n this.pauseOnStop = false;\n this.stopDelay = 0;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.options !== undefined) {\n this.options = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, data.options);\n }\n if (data.replaceCursor !== undefined) {\n this.replaceCursor = data.replaceCursor;\n }\n if (data.pauseOnStop !== undefined) {\n this.pauseOnStop = data.pauseOnStop;\n }\n if (data.stopDelay !== undefined) {\n this.stopDelay = data.stopDelay;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-particle/./dist/browser/Options/Classes/InteractivityParticleOptions.js?\n}");
36
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ InteractivityParticleOptions: () => (/* binding */ InteractivityParticleOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass InteractivityParticleOptions {\n options;\n pauseOnStop;\n replaceCursor;\n stopDelay;\n constructor(){\n this.replaceCursor = false;\n this.pauseOnStop = false;\n this.stopDelay = 0;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.options !== undefined) {\n this.options = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, data.options);\n }\n if (data.replaceCursor !== undefined) {\n this.replaceCursor = data.replaceCursor;\n }\n if (data.pauseOnStop !== undefined) {\n this.pauseOnStop = data.pauseOnStop;\n }\n if (data.stopDelay !== undefined) {\n this.stopDelay = data.stopDelay;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-particle/./dist/browser/Options/Classes/InteractivityParticleOptions.js?\n}");
37
37
 
38
38
  /***/ }
39
39
 
@@ -3,6 +3,10 @@ import { deepExtend, isInArray, safeDocument, } from "@tsparticles/engine";
3
3
  import { InteractivityParticleOptions } from "./Options/Classes/InteractivityParticleOptions.js";
4
4
  const particleMode = "particle";
5
5
  export class InteractivityParticleMaker extends ExternalInteractorBase {
6
+ maxDistance = 0;
7
+ _clearTimeout;
8
+ _lastPosition;
9
+ _particle;
6
10
  constructor(container) {
7
11
  super(container);
8
12
  }
@@ -1,5 +1,9 @@
1
1
  import { deepExtend, isNull, } from "@tsparticles/engine";
2
2
  export class InteractivityParticleOptions {
3
+ options;
4
+ pauseOnStop;
5
+ replaceCursor;
6
+ stopDelay;
3
7
  constructor() {
4
8
  this.replaceCursor = false;
5
9
  this.pauseOnStop = false;
package/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export async function loadExternalParticleInteraction(engine) {
2
- engine.checkVersion("4.0.0-alpha.8");
2
+ engine.checkVersion("4.0.0-beta.0");
3
3
  await engine.register(async (e) => {
4
- const { loadInteractivityPlugin } = await import("@tsparticles/plugin-interactivity");
5
- await loadInteractivityPlugin(e);
4
+ const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
5
+ ensureInteractivityPluginLoaded(e);
6
6
  e.addInteractor?.("externalParticle", async (container) => {
7
7
  const { InteractivityParticleMaker } = await import("./InteractivityParticleMaker.js");
8
8
  return new InteractivityParticleMaker(container);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-external-particle",
3
- "version": "4.0.0-alpha.8",
3
+ "version": "4.0.0-beta.0",
4
4
  "description": "tsParticles particle 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-alpha.8",
91
- "@tsparticles/plugin-interactivity": "4.0.0-alpha.8"
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"
package/report.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8"/>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
6
- <title>@tsparticles/interaction-external-particle [23 Jan 2026 at 23:53]</title>
6
+ <title>@tsparticles/interaction-external-particle [19 Mar 2026 at 14:03]</title>
7
7
  <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
8
8
 
9
9
  <script>
@@ -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.8
7
+ * v4.0.0-beta.0
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -28,16 +28,6 @@ return /******/ (() => { // webpackBootstrap
28
28
  /******/ "use strict";
29
29
  /******/ var __webpack_modules__ = ({
30
30
 
31
- /***/ "./dist/browser/index.js"
32
- /*!*******************************!*\
33
- !*** ./dist/browser/index.js ***!
34
- \*******************************/
35
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
36
-
37
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadExternalParticleInteraction: () => (/* binding */ loadExternalParticleInteraction)\n/* harmony export */ });\nasync function loadExternalParticleInteraction(engine) {\n engine.checkVersion(\"4.0.0-alpha.8\");\n await engine.register(async e => {\n const {\n loadInteractivityPlugin\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n await loadInteractivityPlugin(e);\n e.addInteractor?.(\"externalParticle\", async container => {\n const {\n InteractivityParticleMaker\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_InteractivityParticleMaker_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./InteractivityParticleMaker.js */ \"./dist/browser/InteractivityParticleMaker.js\"));\n return new InteractivityParticleMaker(container);\n });\n });\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-particle/./dist/browser/index.js?\n}");
38
-
39
- /***/ },
40
-
41
31
  /***/ "@tsparticles/engine"
42
32
  /*!*********************************************************************************************************************************!*\
43
33
  !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
@@ -56,6 +46,16 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
56
46
 
57
47
  module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
58
48
 
49
+ /***/ },
50
+
51
+ /***/ "./dist/browser/index.js"
52
+ /*!*******************************!*\
53
+ !*** ./dist/browser/index.js ***!
54
+ \*******************************/
55
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
56
+
57
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadExternalParticleInteraction: () => (/* binding */ loadExternalParticleInteraction)\n/* harmony export */ });\nasync function loadExternalParticleInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.0\");\n await engine.register(async (e)=>{\n const { ensureInteractivityPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n ensureInteractivityPluginLoaded(e);\n e.addInteractor?.(\"externalParticle\", async (container)=>{\n const { InteractivityParticleMaker } = await __webpack_require__.e(/*! import() */ \"dist_browser_InteractivityParticleMaker_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./InteractivityParticleMaker.js */ \"./dist/browser/InteractivityParticleMaker.js\"));\n return new InteractivityParticleMaker(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-particle/./dist/browser/index.js?\n}");
58
+
59
59
  /***/ }
60
60
 
61
61
  /******/ });
@@ -70,12 +70,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
70
70
  /******/ if (cachedModule !== undefined) {
71
71
  /******/ return cachedModule.exports;
72
72
  /******/ }
73
- /******/ // Check if module exists (development only)
74
- /******/ if (__webpack_modules__[moduleId] === undefined) {
75
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
76
- /******/ e.code = 'MODULE_NOT_FOUND';
77
- /******/ throw e;
78
- /******/ }
79
73
  /******/ // Create a new module (and put it into the cache)
80
74
  /******/ var module = __webpack_module_cache__[moduleId] = {
81
75
  /******/ // no module.id needed
@@ -84,6 +78,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
84
78
  /******/ };
85
79
  /******/
86
80
  /******/ // Execute the module function
81
+ /******/ if (!(moduleId in __webpack_modules__)) {
82
+ /******/ delete __webpack_module_cache__[moduleId];
83
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
84
+ /******/ e.code = 'MODULE_NOT_FOUND';
85
+ /******/ throw e;
86
+ /******/ }
87
87
  /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
88
88
  /******/
89
89
  /******/ // Return the exports of the module
@@ -158,6 +158,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
158
158
  /******/ };
159
159
  /******/ })();
160
160
  /******/
161
+ /******/ /* webpack/runtime/global */
162
+ /******/ (() => {
163
+ /******/ __webpack_require__.g = (function() {
164
+ /******/ if (typeof globalThis === 'object') return globalThis;
165
+ /******/ try {
166
+ /******/ return this || new Function('return this')();
167
+ /******/ } catch (e) {
168
+ /******/ if (typeof window === 'object') return window;
169
+ /******/ }
170
+ /******/ })();
171
+ /******/ })();
172
+ /******/
161
173
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
162
174
  /******/ (() => {
163
175
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
@@ -222,8 +234,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
222
234
  /******/ /* webpack/runtime/publicPath */
223
235
  /******/ (() => {
224
236
  /******/ var scriptUrl;
225
- /******/ if (globalThis.importScripts) scriptUrl = globalThis.location + "";
226
- /******/ var document = globalThis.document;
237
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
238
+ /******/ var document = __webpack_require__.g.document;
227
239
  /******/ if (!scriptUrl && document) {
228
240
  /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
229
241
  /******/ scriptUrl = document.currentScript.src;
@@ -1,2 +1,2 @@
1
- /*! For license information please see tsparticles.interaction.external.particle.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-interactivity","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):t(e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,((e,t)=>(()=>{var r,i,n,o,a={303(e){e.exports=t},702(t){t.exports=e}},c={};function l(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return a[e](r,r.exports,l),r.exports}l.m=a,i=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);l.r(n);var o={};r=r||[null,i({}),i([]),i(i)];for(var a=2&t&&e;("object"==typeof a||"function"==typeof a)&&!~r.indexOf(a);a=i(a))Object.getOwnPropertyNames(a).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,l.d(n,o),n},l.d=(e,t)=>{for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,r)=>(l.f[r](e,t),t)),[])),l.u=e=>e+".min.js",l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},o="@tsparticles/interaction-external-particle:",l.l=(e,t,r,i)=>{if(n[e])n[e].push(t);else{var a,c;if(void 0!==r)for(var s=document.getElementsByTagName("script"),p=0;p<s.length;p++){var u=s[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+r){a=u;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",o+r),a.src=e),n[e]=[t];var f=(t,r)=>{a.onerror=a.onload=null,clearTimeout(d);var i=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(r))),t)return t(r)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),c&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),l.p=e})(),(()=>{var e={464:0};l.f.j=(t,r)=>{var i=l.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var n=new Promise(((r,n)=>i=e[t]=[r,n]));r.push(i[2]=n);var o=l.p+l.u(t),a=new Error;l.l(o,(r=>{if(l.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+n+": "+o+")",a.name="ChunkLoadError",a.type=n,a.request=o,i[1](a)}}),"chunk-"+t,t)}};var t=(t,r)=>{var i,n,[o,a,c]=r,s=0;if(o.some((t=>0!==e[t]))){for(i in a)l.o(a,i)&&(l.m[i]=a[i]);if(c)c(l)}for(t&&t(r);s<o.length;s++)n=o[s],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=this.webpackChunk_tsparticles_interaction_external_particle=this.webpackChunk_tsparticles_interaction_external_particle||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var s={};async function p(e){e.checkVersion("4.0.0-alpha.8"),await e.register((async e=>{const{loadInteractivityPlugin:t}=await Promise.resolve().then(l.t.bind(l,702,19));await t(e),e.addInteractor?.("externalParticle",(async e=>{const{InteractivityParticleMaker:t}=await l.e(623).then(l.bind(l,623));return new t(e)}))}))}return l.r(s),l.d(s,{loadExternalParticleInteraction:()=>p}),s})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-interactivity","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):t(e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,(e,t)=>(()=>{"use strict";var r,i,o,n={303(e){e.exports=t},702(t){t.exports=e}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,c),r.exports}c.m=n,s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);c.r(r);var i={};l=l||[null,s({}),s([]),s(s)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~l.indexOf(o);o=s(o))Object.getOwnPropertyNames(o).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,c.d(r,i),r},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,r)=>(c.f[r](e,t),t),[])),c.u=e=>""+e+".min.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},c.l=(e,t,r,i)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var o,n,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var s=a[l];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")=="@tsparticles/interaction-external-particle:"+r){o=s;break}}o||(n=!0,(o=document.createElement("script")).charset="utf-8",c.nc&&o.setAttribute("nonce",c.nc),o.setAttribute("data-webpack","@tsparticles/interaction-external-particle:"+r),o.src=e),p[e]=[t];var u=(t,r)=>{o.onerror=o.onload=null,clearTimeout(f);var i=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),n&&document.head.appendChild(o)},c.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(u=c.g.location+"");var l,s,p,u,f=c.g.document;if(!u&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(u=f.currentScript.src),!u)){var d=f.getElementsByTagName("script");if(d.length)for(var b=d.length-1;b>-1&&(!u||!/^http(s?):/.test(u));)u=d[b--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={464:0},c.f.j=(e,t)=>{var i=c.o(r,e)?r[e]:void 0;if(0!==i)if(i)t.push(i[2]);else{var o=new Promise((t,o)=>i=r[e]=[t,o]);t.push(i[2]=o);var n=c.p+c.u(e),a=Error();c.l(n,t=>{if(c.o(r,e)&&(0!==(i=r[e])&&(r[e]=void 0),i)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
2
+ (`+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,i[1](a)}},"chunk-"+e,e)}},i=(e,t)=>{var i,o,[n,a,l]=t,s=0;if(n.some(e=>0!==r[e])){for(i in a)c.o(a,i)&&(c.m[i]=a[i]);l&&l(c)}for(e&&e(t);s<n.length;s++)o=n[s],c.o(r,o)&&r[o]&&r[o][0](),r[o]=0},(o=this.webpackChunk_tsparticles_interaction_external_particle=this.webpackChunk_tsparticles_interaction_external_particle||[]).forEach(i.bind(null,0)),o.push=i.bind(null,o.push.bind(o));var h={};async function g(e){e.checkVersion("4.0.0-beta.0"),await e.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(c.t.bind(c,702,19));t(e),e.addInteractor?.("externalParticle",async e=>{let{InteractivityParticleMaker:t}=await c.e(828).then(c.bind(c,828));return new t(e)})})}return c.r(h),c.d(h,{loadExternalParticleInteraction:()=>g}),h})());
@@ -2,6 +2,7 @@ import { ExternalInteractorBase, type IInteractivityData, type IModes, type Inte
2
2
  import { type RecursivePartial } from "@tsparticles/engine";
3
3
  import type { IParticleMode, InteractivityParticleContainer, ParticleMode } from "./Types.js";
4
4
  export declare class InteractivityParticleMaker extends ExternalInteractorBase<InteractivityParticleContainer> {
5
+ readonly maxDistance = 0;
5
6
  private _clearTimeout?;
6
7
  private _lastPosition?;
7
8
  private _particle?;
@@ -15,6 +15,10 @@
15
15
  const InteractivityParticleOptions_js_1 = require("./Options/Classes/InteractivityParticleOptions.js");
16
16
  const particleMode = "particle";
17
17
  class InteractivityParticleMaker extends plugin_interactivity_1.ExternalInteractorBase {
18
+ maxDistance = 0;
19
+ _clearTimeout;
20
+ _lastPosition;
21
+ _particle;
18
22
  constructor(container) {
19
23
  super(container);
20
24
  }
@@ -12,6 +12,10 @@
12
12
  exports.InteractivityParticleOptions = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
14
  class InteractivityParticleOptions {
15
+ options;
16
+ pauseOnStop;
17
+ replaceCursor;
18
+ stopDelay;
15
19
  constructor() {
16
20
  this.replaceCursor = false;
17
21
  this.pauseOnStop = false;
package/umd/index.js CHANGED
@@ -45,10 +45,10 @@ var __importStar = (this && this.__importStar) || (function () {
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.loadExternalParticleInteraction = loadExternalParticleInteraction;
47
47
  async function loadExternalParticleInteraction(engine) {
48
- engine.checkVersion("4.0.0-alpha.8");
48
+ engine.checkVersion("4.0.0-beta.0");
49
49
  await engine.register(async (e) => {
50
- const { loadInteractivityPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-interactivity"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-interactivity"], resolve_1, reject_1); }).then(__importStar));
51
- await loadInteractivityPlugin(e);
50
+ const { ensureInteractivityPluginLoaded } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-interactivity"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-interactivity"], resolve_1, reject_1); }).then(__importStar));
51
+ ensureInteractivityPluginLoaded(e);
52
52
  e.addInteractor?.("externalParticle", async (container) => {
53
53
  const { InteractivityParticleMaker } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./InteractivityParticleMaker.js"))) : new Promise((resolve_2, reject_2) => { require(["./InteractivityParticleMaker.js"], resolve_2, reject_2); }).then(__importStar));
54
54
  return new InteractivityParticleMaker(container);
package/623.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 623.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_interaction_external_particle=this.webpackChunk_tsparticles_interaction_external_particle||[]).push([[623],{623(t,i,e){e.d(i,{InteractivityParticleMaker:()=>a});var s=e(702),o=e(303);class n{constructor(){this.replaceCursor=!1,this.pauseOnStop=!1,this.stopDelay=0}load(t){(0,o.isNull)(t)||(void 0!==t.options&&(this.options=(0,o.deepExtend)({},t.options)),void 0!==t.replaceCursor&&(this.replaceCursor=t.replaceCursor),void 0!==t.pauseOnStop&&(this.pauseOnStop=t.pauseOnStop),void 0!==t.stopDelay&&(this.stopDelay=t.stopDelay))}}const r="particle";class a extends s.ExternalInteractorBase{constructor(t){super(t)}clear(){}init(){}interact(t){const i=this.container,e=i.actualOptions;if(!i.retina.reduceFactor)return;const s=t.mouse.position,n=e.interactivity?.modes.particle;if(!n)return;const r=n.pauseOnStop&&(t.mouse.position===this._lastPosition||t.mouse.position?.x===this._lastPosition?.x&&t.mouse.position?.y===this._lastPosition?.y),a=n.stopDelay;if(s?this._lastPosition={...s}:delete this._lastPosition,this._lastPosition)if(r){if(this._clearTimeout)return;this._clearTimeout=setTimeout((()=>{if(this._particle){if(n.replaceCursor){const i=t.element;i&&(i instanceof Window?(0,o.safeDocument)().body.style.cursor="":i.style.cursor="")}this.container.particles.remove(this._particle,void 0,!0),delete this._particle}}),a)}else{if(this._clearTimeout&&(clearTimeout(this._clearTimeout),delete this._clearTimeout),!this._particle){const e=(0,o.deepExtend)(n.options,{move:{enable:!1}});if(this._particle=i.particles.addParticle(this._lastPosition,e),n.replaceCursor){const i=t.element;i&&(i instanceof Window?(0,o.safeDocument)().body.style.cursor="none":i.style.cursor="none")}}this._particle&&(this._particle.position.x=this._lastPosition.x,this._particle.position.y=this._lastPosition.y)}}isEnabled(t,i){const e=this.container.actualOptions,s=t.mouse,n=(i?.interactivity??e.interactivity)?.events;return!!n&&(s.clicking&&s.inside&&!!s.position&&(0,o.isInArray)(r,n.onClick.mode)||s.inside&&!!s.position&&(0,o.isInArray)(r,n.onHover.mode))}loadModeOptions(t,...i){t.particle??=new n;for(const e of i)t.particle.load(e?.particle)}reset(){}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Particle External Interaction v4.0.0-alpha.8 by Matteo Bruni */
@@ -1 +0,0 @@
1
- /*! tsParticles Particle External Interaction v4.0.0-alpha.8 by Matteo Bruni */