@tsparticles/plugin-infection 4.0.0-beta.0 → 4.0.0-beta.1
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/{800.min.js → 321.min.js} +1 -1
- package/{392.min.js → 734.min.js} +1 -1
- package/951.min.js +1 -0
- package/browser/index.js +4 -4
- package/cjs/index.js +4 -4
- package/dist_browser_InfectionPluginInstance_js.js +1 -1
- package/dist_browser_InfectionPlugin_js.js +1 -1
- package/dist_browser_ParticlesInfecter_js.js +1 -1
- package/esm/index.js +4 -4
- package/package.json +3 -3
- package/report.html +84 -29
- package/tsparticles.plugin.infection.js +2 -2
- package/tsparticles.plugin.infection.min.js +2 -2
- package/umd/index.js +4 -4
- package/91.min.js +0 -1
|
@@ -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.
|
|
7
|
+
* v4.0.0-beta.1
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -54,7 +54,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
54
54
|
\*******************************/
|
|
55
55
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
56
|
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadInfectionPlugin: () => (/* binding */ loadInfectionPlugin)\n/* harmony export */ });\nasync function loadInfectionPlugin(engine) {\n engine.checkVersion(\"4.0.0-beta.
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadInfectionPlugin: () => (/* binding */ loadInfectionPlugin)\n/* harmony export */ });\nasync function loadInfectionPlugin(engine) {\n engine.checkVersion(\"4.0.0-beta.1\");\n await engine.pluginManager.register(async (e)=>{\n const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin }] = await Promise.all([\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19)),\n __webpack_require__.e(/*! import() */ \"dist_browser_InfectionPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./InfectionPlugin.js */ \"./dist/browser/InfectionPlugin.js\"))\n ]);\n ensureInteractivityPluginLoaded(e);\n e.pluginManager.addPlugin(new InfectionPlugin());\n e.pluginManager.addInteractor?.(\"particlesInfection\", async (container)=>{\n const { ParticlesInfecter } = await __webpack_require__.e(/*! import() */ \"dist_browser_ParticlesInfecter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ParticlesInfecter.js */ \"./dist/browser/ParticlesInfecter.js\"));\n return new ParticlesInfecter(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-infection/./dist/browser/index.js?\n}");
|
|
58
58
|
|
|
59
59
|
/***/ }
|
|
60
60
|
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
2
|
-
(`+
|
|
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 n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(e,t)=>(()=>{"use strict";var r,n,i,o={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 o[e](r,r.exports,c),r.exports}c.m=o,l=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 n={};s=s||[null,l({}),l([]),l(l)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~s.indexOf(i);i=l(i))Object.getOwnPropertyNames(i).forEach(t=>n[t]=()=>e[t]);return n.default=()=>e,c.d(r,n),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,n)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var i,o,a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var l=a[s];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/plugin-infection:"+r){i=l;break}}i||(o=!0,(i=document.createElement("script")).charset="utf-8",c.nc&&i.setAttribute("nonce",c.nc),i.setAttribute("data-webpack","@tsparticles/plugin-infection:"+r),i.src=e),p[e]=[t];var u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(f);var n=p[e];if(delete p[e],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),o&&document.head.appendChild(i)},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 s,l,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 g=d.length-1;g>-1&&(!u||!/^http(s?):/.test(u));)u=d[g--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={587:0},c.f.j=(e,t)=>{var n=c.o(r,e)?r[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise((t,i)=>n=r[e]=[t,i]);t.push(n[2]=i);var o=c.p+c.u(e),a=Error();c.l(o,t=>{if(c.o(r,e)&&(0!==(n=r[e])&&(r[e]=void 0),n)){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}},"chunk-"+e,e)}},n=(e,t)=>{var n,i,[o,a,s]=t,l=0;if(o.some(e=>0!==r[e])){for(n in a)c.o(a,n)&&(c.m[n]=a[n]);s&&s(c)}for(e&&e(t);l<o.length;l++)i=o[l],c.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_plugin_infection=this.webpackChunk_tsparticles_plugin_infection||[]).forEach(n.bind(null,0)),i.push=n.bind(null,i.push.bind(i));var b={};async function h(e){e.checkVersion("4.0.0-beta.1"),await e.pluginManager.register(async e=>{let[{ensureInteractivityPluginLoaded:t},{InfectionPlugin:r}]=await Promise.all([Promise.resolve().then(c.t.bind(c,702,19)),c.e(734).then(c.bind(c,734))]);t(e),e.pluginManager.addPlugin(new r),e.pluginManager.addInteractor?.("particlesInfection",async e=>{let{ParticlesInfecter:t}=await c.e(951).then(c.bind(c,951));return new t(e)})})}return c.r(b),c.d(b,{loadInfectionPlugin:()=>h}),b})());
|
package/umd/index.js
CHANGED
|
@@ -45,15 +45,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.loadInfectionPlugin = loadInfectionPlugin;
|
|
47
47
|
async function loadInfectionPlugin(engine) {
|
|
48
|
-
engine.checkVersion("4.0.0-beta.
|
|
49
|
-
await engine.register(async (e) => {
|
|
48
|
+
engine.checkVersion("4.0.0-beta.1");
|
|
49
|
+
await engine.pluginManager.register(async (e) => {
|
|
50
50
|
const [{ ensureInteractivityPluginLoaded }, { InfectionPlugin },] = await Promise.all([
|
|
51
51
|
__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),
|
|
52
52
|
__syncRequire ? Promise.resolve().then(() => __importStar(require("./InfectionPlugin.js"))) : new Promise((resolve_2, reject_2) => { require(["./InfectionPlugin.js"], resolve_2, reject_2); }).then(__importStar),
|
|
53
53
|
]);
|
|
54
54
|
ensureInteractivityPluginLoaded(e);
|
|
55
|
-
e.addPlugin(new InfectionPlugin());
|
|
56
|
-
e.addInteractor?.("particlesInfection", async (container) => {
|
|
55
|
+
e.pluginManager.addPlugin(new InfectionPlugin());
|
|
56
|
+
e.pluginManager.addInteractor?.("particlesInfection", async (container) => {
|
|
57
57
|
const { ParticlesInfecter } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ParticlesInfecter.js"))) : new Promise((resolve_3, reject_3) => { require(["./ParticlesInfecter.js"], resolve_3, reject_3); }).then(__importStar));
|
|
58
58
|
return new ParticlesInfecter(container);
|
|
59
59
|
});
|
package/91.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_plugin_infection=this.webpackChunk_tsparticles_plugin_infection||[]).push([[91],{91(e,t,i){i.d(t,{ParticlesInfecter:()=>s});var n=i(303),a=i(702);class s extends a.ParticlesInteractorBase{_maxDistance;constructor(e){super(e),this._maxDistance=0}get maxDistance(){return this._maxDistance}clear(){}init(){}interact(e,t,i){let a=this.container.infecter;if(!a||(a.updateInfection(e,i.value),e.infection?.stage===void 0))return;let s=this.container,c=s.actualOptions.infection;if(!c?.enable||c.stages.length<1)return;let o=c.stages[e.infection.stage];if(!o)return;this._maxDistance=Math.max(this._maxDistance,o.radius);let r=s.retina.pixelRatio,f=e.getRadius()*n.double+o.radius*r,g=e.getPosition(),l=o.infectedStage??e.infection.stage,u=s.particles.grid.queryCircle(g,f),d=o.rate,p=u.length;for(let t of u)if(!(t===e||t.destroyed||t.spawning||t.infection?.stage!==void 0&&t.infection.stage===e.infection.stage||(0,n.getRandom)()>=d/p)){if(t.infection?.stage===void 0)a.startInfection(t,l);else if(t.infection.stage<e.infection.stage)a.updateInfectionStage(t,l);else if(t.infection.stage>e.infection.stage){let i=c.stages[t.infection.stage];if(!i)continue;let n=i.infectedStage??t.infection.stage;a.updateInfectionStage(e,n)}}}isEnabled(){return this.container.actualOptions.infection?.enable??!1}reset(){}}}}]);
|