@tsparticles/plugin-emitters-shape-polygon 4.0.0-beta.15 → 4.0.0-beta.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ensureEmittersPluginLoaded } from "@tsparticles/plugin-emitters";
2
2
  import { EmittersPolygonShapeGenerator } from "./EmittersPolygonShapeGenerator.js";
3
3
  export async function loadEmittersShapePolygon(engine) {
4
- engine.checkVersion("4.0.0-beta.15");
4
+ engine.checkVersion("4.0.0-beta.17");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureEmittersPluginLoaded(e);
7
7
  e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
@@ -1,5 +1,5 @@
1
1
  export async function loadEmittersShapePolygon(engine) {
2
- engine.checkVersion("4.0.0-beta.15");
2
+ engine.checkVersion("4.0.0-beta.17");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { ensureEmittersPluginLoaded } = await import("@tsparticles/plugin-emitters/lazy");
5
5
  ensureEmittersPluginLoaded(e);
package/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ensureEmittersPluginLoaded } from "@tsparticles/plugin-emitters";
2
2
  import { EmittersPolygonShapeGenerator } from "./EmittersPolygonShapeGenerator.js";
3
3
  export async function loadEmittersShapePolygon(engine) {
4
- engine.checkVersion("4.0.0-beta.15");
4
+ engine.checkVersion("4.0.0-beta.17");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureEmittersPluginLoaded(e);
7
7
  e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadEmittersShapePolygon(engine) {
2
- engine.checkVersion("4.0.0-beta.15");
2
+ engine.checkVersion("4.0.0-beta.17");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { ensureEmittersPluginLoaded } = await import("@tsparticles/plugin-emitters/lazy");
5
5
  ensureEmittersPluginLoaded(e);
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ensureEmittersPluginLoaded } from "@tsparticles/plugin-emitters";
2
2
  import { EmittersPolygonShapeGenerator } from "./EmittersPolygonShapeGenerator.js";
3
3
  export async function loadEmittersShapePolygon(engine) {
4
- engine.checkVersion("4.0.0-beta.15");
4
+ engine.checkVersion("4.0.0-beta.17");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureEmittersPluginLoaded(e);
7
7
  e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadEmittersShapePolygon(engine) {
2
- engine.checkVersion("4.0.0-beta.15");
2
+ engine.checkVersion("4.0.0-beta.17");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { ensureEmittersPluginLoaded } = await import("@tsparticles/plugin-emitters/lazy");
5
5
  ensureEmittersPluginLoaded(e);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@tsparticles/plugin-emitters-shape-polygon",
3
- "version": "4.0.0-beta.15",
3
+ "version": "4.0.0-beta.17",
4
4
  "description": "tsParticles emitters shape polygon plugin",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/tsparticles/tsparticles.git",
9
- "directory": "plugins/emitterShapes/polygon"
9
+ "directory": "plugins/emittersShapes/polygon"
10
10
  },
11
11
  "keywords": [
12
12
  "front-end",
@@ -106,8 +106,8 @@
106
106
  "./package.json": "./package.json"
107
107
  },
108
108
  "peerDependencies": {
109
- "@tsparticles/engine": "4.0.0-beta.15",
110
- "@tsparticles/plugin-emitters": "4.0.0-beta.15"
109
+ "@tsparticles/engine": "4.0.0-beta.17",
110
+ "@tsparticles/plugin-emitters": "4.0.0-beta.17"
111
111
  },
112
112
  "publishConfig": {
113
113
  "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
- /* Emitters Shape v4.0.0-beta.15 */
2
+ /* Emitters Shape v4.0.0-beta.17 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-emitters'), require('@tsparticles/engine')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-emitters', '@tsparticles/engine'], factory) :
@@ -130,7 +130,7 @@
130
130
  }
131
131
 
132
132
  async function loadEmittersShapePolygon(engine) {
133
- engine.checkVersion("4.0.0-beta.15");
133
+ engine.checkVersion("4.0.0-beta.17");
134
134
  await engine.pluginManager.register((e) => {
135
135
  pluginEmitters.ensureEmittersPluginLoaded(e);
136
136
  e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
@@ -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/plugin-emitters"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-emitters","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.plugins.emittersShapes.polygon=s.__tsParticlesInternals.plugins.emittersShapes.polygon||{}),s.__tsParticlesInternals.plugins.emitters,s.__tsParticlesInternals.engine)}(this,function(s,t,e){"use strict";function n(s,t,n,a=0){const l=[],r=e.doublePI/t;for(let e=0;e<t;e++){const t=r*e+a;l.push({x:s.x+n*Math.cos(t),y:s.y+n*Math.sin(t)})}return l}function a(s,t){let e=!1;for(let n=0,a=t.length-1;n<t.length;a=n++){const l=t[n],r=t[a];if(!l||!r)continue;l.y>s.y!=r.y>s.y&&s.x<(r.x-l.x)*(s.y-l.y)/(r.y-l.y)+l.x&&(e=!e)}return e}class l extends t.EmitterShapeBase{angle;polygon;sides;constructor(s,t,a,l){super(s,t,a,l),this.sides=l.sides,this.angle=e.degToRad(l.angle),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}async init(){}randomPosition(){const s=this.fill,t=this.polygon,n=s?function(s){const t=s[0];if(!t)return null;const n={...t},l={...t};for(const t of s)t.x<n.x&&(n.x=t.x),t.x>l.x&&(l.x=t.x),t.y<n.y&&(n.y=t.y),t.y>l.y&&(l.y=t.y);let r=null;for(let t=0;t<100;t++){const t={x:n.x+e.getRandom()*(l.x-n.x),y:n.y+e.getRandom()*(l.y-n.y)};if(a(t,s)){r=t;break}}return r}(t):function(s){const t=Math.floor(e.getRandom()*s.length),n=s[t];if(!n)return;const a=s[(t+1)%s.length];if(!a)return;const l=e.getRandom();return{x:n.x+(a.x-n.x)*l,y:n.y+(a.y-n.y)*l}}(t);return n?{position:n}:null}resize(s,t){super.resize(s,t),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}}class r{angle;sides;constructor(){this.angle=0,this.sides=5}load(s){e.isNull(s)||(void 0!==s.angle&&(this.angle=s.angle),void 0!==s.sides&&(this.sides=s.sides))}}class i{generate(s,t,e,n,a){const i=new r;return i.load(a),new l(t,e,n,i)}}async function _(s){s.checkVersion("4.0.0-beta.15"),await s.pluginManager.register(s=>{t.ensureEmittersPluginLoaded(s),s.pluginManager.addEmitterShapeGenerator?.("polygon",new i)})}const c=globalThis;c.__tsParticlesInternals=c.__tsParticlesInternals??{},c.loadEmittersShapePolygon=_,s.loadEmittersShapePolygon=_}),Object.assign(globalThis.window||globalThis,{loadEmittersShapePolygon:(globalThis.__tsParticlesInternals.plugins.emittersShapes.polygon||{}).loadEmittersShapePolygon}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
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/plugin-emitters"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-emitters","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.plugins.emittersShapes.polygon=s.__tsParticlesInternals.plugins.emittersShapes.polygon||{}),s.__tsParticlesInternals.plugins.emitters,s.__tsParticlesInternals.engine)}(this,function(s,t,e){"use strict";function n(s,t,n,a=0){const l=[],r=e.doublePI/t;for(let e=0;e<t;e++){const t=r*e+a;l.push({x:s.x+n*Math.cos(t),y:s.y+n*Math.sin(t)})}return l}function a(s,t){let e=!1;for(let n=0,a=t.length-1;n<t.length;a=n++){const l=t[n],r=t[a];if(!l||!r)continue;l.y>s.y!=r.y>s.y&&s.x<(r.x-l.x)*(s.y-l.y)/(r.y-l.y)+l.x&&(e=!e)}return e}class l extends t.EmitterShapeBase{angle;polygon;sides;constructor(s,t,a,l){super(s,t,a,l),this.sides=l.sides,this.angle=e.degToRad(l.angle),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}async init(){}randomPosition(){const s=this.fill,t=this.polygon,n=s?function(s){const t=s[0];if(!t)return null;const n={...t},l={...t};for(const t of s)t.x<n.x&&(n.x=t.x),t.x>l.x&&(l.x=t.x),t.y<n.y&&(n.y=t.y),t.y>l.y&&(l.y=t.y);let r=null;for(let t=0;t<100;t++){const t={x:n.x+e.getRandom()*(l.x-n.x),y:n.y+e.getRandom()*(l.y-n.y)};if(a(t,s)){r=t;break}}return r}(t):function(s){const t=Math.floor(e.getRandom()*s.length),n=s[t];if(!n)return;const a=s[(t+1)%s.length];if(!a)return;const l=e.getRandom();return{x:n.x+(a.x-n.x)*l,y:n.y+(a.y-n.y)*l}}(t);return n?{position:n}:null}resize(s,t){super.resize(s,t),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}}class r{angle;sides;constructor(){this.angle=0,this.sides=5}load(s){e.isNull(s)||(void 0!==s.angle&&(this.angle=s.angle),void 0!==s.sides&&(this.sides=s.sides))}}class i{generate(s,t,e,n,a){const i=new r;return i.load(a),new l(t,e,n,i)}}async function _(s){s.checkVersion("4.0.0-beta.17"),await s.pluginManager.register(s=>{t.ensureEmittersPluginLoaded(s),s.pluginManager.addEmitterShapeGenerator?.("polygon",new i)})}const c=globalThis;c.__tsParticlesInternals=c.__tsParticlesInternals??{},c.loadEmittersShapePolygon=_,s.loadEmittersShapePolygon=_}),Object.assign(globalThis.window||globalThis,{loadEmittersShapePolygon:(globalThis.__tsParticlesInternals.plugins.emittersShapes.polygon||{}).loadEmittersShapePolygon}),delete(globalThis.window||globalThis).tsparticlesInternalExports;