@tsparticles/plugin-poisson-disc 4.0.0-beta.15 → 4.0.0-beta.16
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/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +2 -2
- package/tsparticles.plugin.poisson.js +2 -2
- package/tsparticles.plugin.poisson.min.js +1 -1
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoissonDiscPlugin } from "./PoissonDiscPlugin.js";
|
|
2
2
|
export async function loadPoissonDiscPlugin(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
|
6
6
|
});
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadPoissonDiscPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
2
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { PoissonDiscPlugin } = await import("./PoissonDiscPlugin.js");
|
|
5
5
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoissonDiscPlugin } from "./PoissonDiscPlugin.js";
|
|
2
2
|
export async function loadPoissonDiscPlugin(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
|
6
6
|
});
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadPoissonDiscPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
2
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { PoissonDiscPlugin } = await import("./PoissonDiscPlugin.js");
|
|
5
5
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoissonDiscPlugin } from "./PoissonDiscPlugin.js";
|
|
2
2
|
export async function loadPoissonDiscPlugin(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
|
6
6
|
});
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadPoissonDiscPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
2
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { PoissonDiscPlugin } = await import("./PoissonDiscPlugin.js");
|
|
5
5
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-poisson-disc",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.16",
|
|
4
4
|
"description": "tsParticles poisson disc plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"./package.json": "./package.json"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
94
|
+
"@tsparticles/engine": "4.0.0-beta.16"
|
|
95
95
|
},
|
|
96
96
|
"publishConfig": {
|
|
97
97
|
"access": "public"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Plugin v4.0.0-beta.
|
|
2
|
+
/* Plugin v4.0.0-beta.16 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
async function loadPoissonDiscPlugin(engine) {
|
|
63
|
-
engine.checkVersion("4.0.0-beta.
|
|
63
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
64
64
|
await engine.pluginManager.register(e => {
|
|
65
65
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
|
66
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.poisson=s.__tsParticlesInternals.plugins.poisson||{}),s.__tsParticlesInternals.engine)}(this,function(s,t){"use strict";class i{dimensions;enable;radius;retries;steps;constructor(){this.enable=!1,this.dimensions=2,this.radius=0,this.retries=30,this.steps=0}load(s){t.isNull(s)||(void 0!==s.enable&&(this.enable=s.enable),void 0!==s.dimensions&&(this.dimensions=s.dimensions),void 0!==s.radius&&(this.radius=s.radius),void 0!==s.retries&&(this.retries=s.retries))}}class e{id="poisson";async getPlugin(s){const{PoissonDiscPluginInstance:t}=await Promise.resolve().then(function(){return r});return new t(s)}loadOptions(s,t,e){if(!this.needsPlugin(t)&&!this.needsPlugin(e))return;let n=t.poisson;void 0===n?.load&&(t.poisson=n=new i),n.load(e?.poisson)}needsPlugin(s){return s?.poisson?.enable??!1}}async function n(s){s.checkVersion("4.0.0-beta.
|
|
1
|
+
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.poisson=s.__tsParticlesInternals.plugins.poisson||{}),s.__tsParticlesInternals.engine)}(this,function(s,t){"use strict";class i{dimensions;enable;radius;retries;steps;constructor(){this.enable=!1,this.dimensions=2,this.radius=0,this.retries=30,this.steps=0}load(s){t.isNull(s)||(void 0!==s.enable&&(this.enable=s.enable),void 0!==s.dimensions&&(this.dimensions=s.dimensions),void 0!==s.radius&&(this.radius=s.radius),void 0!==s.retries&&(this.retries=s.retries))}}class e{id="poisson";async getPlugin(s){const{PoissonDiscPluginInstance:t}=await Promise.resolve().then(function(){return r});return new t(s)}loadOptions(s,t,e){if(!this.needsPlugin(t)&&!this.needsPlugin(e))return;let n=t.poisson;void 0===n?.load&&(t.poisson=n=new i),n.load(e?.poisson)}needsPlugin(s){return s?.poisson?.enable??!1}}async function n(s){s.checkVersion("4.0.0-beta.16"),await s.pluginManager.register(s=>{s.pluginManager.addPlugin(new e)})}const a=globalThis;a.__tsParticlesInternals=a.__tsParticlesInternals??{},a.loadPoissonDiscPlugin=n;var r=Object.freeze({__proto__:null,PoissonDiscPluginInstance:class{poissonDisc;redrawTimeout;_container;_currentIndex;constructor(s){this._container=s,this._currentIndex=0}async init(){await this._initData()}particlePosition(s){const t=this._container.actualOptions.poisson;if(this.poissonDisc&&t?.enable&&!(this._currentIndex>=this.poissonDisc.points.length))return s??this.poissonDisc.points[this._currentIndex++]?.position}resize(){const s=this._container,t=s.actualOptions.poisson;if(!t?.enable)return;this.redrawTimeout&&clearTimeout(this.redrawTimeout);this.redrawTimeout=setTimeout(()=>{(async()=>{this._container.destroyed||(await this._initData(),await s.particles.redraw())})()},250)}stop(){delete this.poissonDisc}async _initData(){const s=this._container,i=s.actualOptions.poisson,e=s.actualOptions.particles,n=s.canvas.size,a=s.retina.pixelRatio;if(!i?.enable)return;this._currentIndex=0;const{PoissonDisc:r}=await Promise.resolve().then(function(){return l});this.poissonDisc=new r(n,i.radius?i.radius*a:Math.max(t.getRangeMax(e.size.value)*a,Math.sqrt(n.width*n.height/e.number.value)),i.retries,i.dimensions);i.steps>0?this.poissonDisc.steps(i.steps):await this.poissonDisc.run()}}});var l=Object.freeze({__proto__:null,PoissonDisc:class{active;cellSize;cols;dimensions;firstPoint;grid;points;radius;retries;rows;size;constructor(s,t,i,e,n){this.size={...s},this.radius=t,this.retries=i,this.dimensions=e,this.cellSize=Math.floor(this.radius/Math.sqrt(this.dimensions)),this.cols=Math.floor(this.size.width/this.cellSize),this.rows=Math.floor(this.size.height/this.cellSize),this.points=[],this.active=[],this.grid=[],this.firstPoint=n?{...n}:void 0,this.reset()}addPoint(s){const t={position:{...s},gridPosition:{x:Math.floor(s.x/this.cellSize),y:Math.floor(s.y/this.cellSize)}},i=this.points.length,e=this.grid[t.gridPosition.y];e&&(this.points.push(t),e[t.gridPosition.x]=i,this.active.push(i))}getRandom(s,i){return Math.floor(t.getRandom()*(i-s))+s}initialiseGrid(){for(let s=0;s<=this.rows;s++){this.grid[s]=[];const t=this.grid[s];if(t)for(let s=0;s<=this.cols;s++)t[s]=-1}}reset(){if(this.points=[],this.active=[],this.grid=[],this.initialiseGrid(),this.firstPoint)this.addPoint(this.firstPoint);else{const s=0;this.addPoint({x:this.getRandom(s,this.size.width),y:this.getRandom(s,this.size.height)})}}async run(){this.reset();let s=0;for(;this.active.length>0;)this.steps(1),++s%100==0&&await new Promise(s=>setTimeout(s))}steps(s){for(let t=0;t<s;t++)this.active.length<=0||this._step()}_getNewPoint(s,i){const e=i*(t.doublePI/this.retries),n=this.getRandom(this.radius,this.radius*t.double),a=Math.cos(e)*n,r=Math.sin(e)*n,l={x:Math.floor(s.position.x+a),y:Math.floor(s.position.y+r)},o=Math.floor(l.x/this.cellSize),c=Math.floor(l.y/this.cellSize);if(l.x<=0||l.x>=this.size.width||l.y<=0||l.y>=this.size.height)return;const _=this.grid[c];if(!_)return;const h=_[o];if(void 0!==h&&!(h>=0)){for(let s=-1;s<=1;s++)for(let i=-1;i<=1;i++){if(!s&&!i)continue;const e={x:o+i,y:c+s};if(e.x<0||e.y<0||e.x>=this.cols||e.y>=this.rows)continue;const n=this.grid[e.y]?.[e.x];if(void 0===n||n<0)continue;const a=this.points[n];if(a&&t.getDistance(l,a.position)<this.radius)return}return l}}_step(){const s=this.getRandom(0,this.active.length);let t=!1;for(let i=0;i<this.retries;i++){const e=this.active[s];if(void 0===e)continue;const n=this.points[e];if(!n)continue;const a=this._getNewPoint(n,i);if(a){t=!0,this.addPoint(a);break}}if(!t){const t=1;this.active.splice(s,t)}}}});s.loadPoissonDiscPlugin=n}),Object.assign(globalThis.window||globalThis,{loadPoissonDiscPlugin:(globalThis.__tsParticlesInternals.plugins.poisson||{}).loadPoissonDiscPlugin}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|