@tsparticles/updater-life 4.2.0 → 4.2.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/browser/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LifeUpdater } from "./LifeUpdater.js";
2
2
  export async function loadLifeUpdater(engine) {
3
- engine.checkVersion("4.2.0");
3
+ engine.checkVersion("4.2.1");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("life", container => {
6
6
  return Promise.resolve(new LifeUpdater(container));
@@ -1,5 +1,5 @@
1
1
  export async function loadLifeUpdater(engine) {
2
- engine.checkVersion("4.2.0");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("life", async (container) => {
5
5
  const { LifeUpdater } = await import("./LifeUpdater.js");
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LifeUpdater } from "./LifeUpdater.js";
2
2
  export async function loadLifeUpdater(engine) {
3
- engine.checkVersion("4.2.0");
3
+ engine.checkVersion("4.2.1");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("life", container => {
6
6
  return Promise.resolve(new LifeUpdater(container));
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadLifeUpdater(engine) {
2
- engine.checkVersion("4.2.0");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("life", async (container) => {
5
5
  const { LifeUpdater } = await import("./LifeUpdater.js");
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LifeUpdater } from "./LifeUpdater.js";
2
2
  export async function loadLifeUpdater(engine) {
3
- engine.checkVersion("4.2.0");
3
+ engine.checkVersion("4.2.1");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("life", container => {
6
6
  return Promise.resolve(new LifeUpdater(container));
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadLifeUpdater(engine) {
2
- engine.checkVersion("4.2.0");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("life", async (container) => {
5
5
  const { LifeUpdater } = await import("./LifeUpdater.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-life",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "tsParticles particles life updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -93,7 +93,7 @@
93
93
  "./package.json": "./package.json"
94
94
  },
95
95
  "peerDependencies": {
96
- "@tsparticles/engine": "4.2.0"
96
+ "@tsparticles/engine": "4.2.1"
97
97
  },
98
98
  "publishConfig": {
99
99
  "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
- /* Updater v4.2.0 */
2
+ /* Updater v4.2.1 */
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) :
@@ -143,7 +143,7 @@
143
143
  }
144
144
 
145
145
  async function loadLifeUpdater(engine) {
146
- engine.checkVersion("4.2.0");
146
+ engine.checkVersion("4.2.1");
147
147
  await engine.pluginManager.register(e => {
148
148
  e.pluginManager.addParticleUpdater("life", container => {
149
149
  return Promise.resolve(new LifeUpdater(container));
@@ -1 +1 @@
1
- !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.life=t.__tsParticlesInternals.updaters.life||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s extends e.ValueWithRandom{sync=!1;load(t){e.isNull(t)||(super.load(t),e.loadProperty(this,"sync",t.sync))}}class n extends e.ValueWithRandom{sync=!1;load(t){e.isNull(t)||(super.load(t),e.loadProperty(this,"sync",t.sync))}}class a{count=0;delay=new s;duration=new n;load(t){e.isNull(t)||(e.loadProperty(this,"count",t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class l{#t;constructor(t){this.#t=t}init(t){const s=this.#t,n=t.options.life;if(!n)return;const a=n.delay.sync?1:e.getRandom(),l=n.duration.sync?1:e.getRandom();t.life={delay:s.retina.reduceFactor?e.getRangeValue(n.delay.value)*a/s.retina.reduceFactor*e.millisecondsToSeconds:0,delayTime:0,duration:s.retina.reduceFactor?e.getRangeValue(n.duration.value)*l/s.retina.reduceFactor*e.millisecondsToSeconds:0,time:0,count:n.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...s){e.loadOptionProperty(t,"life",a,...s)}update(t,s){this.isEnabled(t)&&t.life&&function(t,s,n){if(!t.life)return;const a=t.life;let l=!1;if(t.spawning){if(a.delayTime+=s.value,!(a.delayTime>=t.life.delay))return;l=!0,t.spawning=!1,a.delayTime=0,a.time=0}if(-1===a.duration)return;if(l?a.time=0:a.time+=s.value,a.time<a.duration)return;if(a.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const r=e.setRangeValue(0,n.width),i=e.setRangeValue(0,n.width);t.position.x=e.randomInRangeValue(r),t.position.y=e.randomInRangeValue(i),t.spawning=!0,a.delayTime=0,a.time=0,t.reset();const c=t.options.life;c&&(a.delay=e.getRangeValue(c.delay.value)*e.millisecondsToSeconds,a.duration=e.getRangeValue(c.duration.value)*e.millisecondsToSeconds)}(t,s,this.#t.canvas.size)}}async function r(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new l(t)))})}const i=globalThis;i.__tsParticlesInternals=i.__tsParticlesInternals??{},i.loadLifeUpdater=r,t.loadLifeUpdater=r}),Object.assign(globalThis.window||globalThis,{loadLifeUpdater:(globalThis.__tsParticlesInternals.updaters.life||{}).loadLifeUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.life=t.__tsParticlesInternals.updaters.life||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s extends e.ValueWithRandom{sync=!1;load(t){e.isNull(t)||(super.load(t),e.loadProperty(this,"sync",t.sync))}}class n extends e.ValueWithRandom{sync=!1;load(t){e.isNull(t)||(super.load(t),e.loadProperty(this,"sync",t.sync))}}class a{count=0;delay=new s;duration=new n;load(t){e.isNull(t)||(e.loadProperty(this,"count",t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class l{#t;constructor(t){this.#t=t}init(t){const s=this.#t,n=t.options.life;if(!n)return;const a=n.delay.sync?1:e.getRandom(),l=n.duration.sync?1:e.getRandom();t.life={delay:s.retina.reduceFactor?e.getRangeValue(n.delay.value)*a/s.retina.reduceFactor*e.millisecondsToSeconds:0,delayTime:0,duration:s.retina.reduceFactor?e.getRangeValue(n.duration.value)*l/s.retina.reduceFactor*e.millisecondsToSeconds:0,time:0,count:n.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...s){e.loadOptionProperty(t,"life",a,...s)}update(t,s){this.isEnabled(t)&&t.life&&function(t,s,n){if(!t.life)return;const a=t.life;let l=!1;if(t.spawning){if(a.delayTime+=s.value,!(a.delayTime>=t.life.delay))return;l=!0,t.spawning=!1,a.delayTime=0,a.time=0}if(-1===a.duration)return;if(l?a.time=0:a.time+=s.value,a.time<a.duration)return;if(a.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const r=e.setRangeValue(0,n.width),i=e.setRangeValue(0,n.width);t.position.x=e.randomInRangeValue(r),t.position.y=e.randomInRangeValue(i),t.spawning=!0,a.delayTime=0,a.time=0,t.reset();const c=t.options.life;c&&(a.delay=e.getRangeValue(c.delay.value)*e.millisecondsToSeconds,a.duration=e.getRangeValue(c.duration.value)*e.millisecondsToSeconds)}(t,s,this.#t.canvas.size)}}async function r(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new l(t)))})}const i=globalThis;i.__tsParticlesInternals=i.__tsParticlesInternals??{},i.loadLifeUpdater=r,t.loadLifeUpdater=r}),Object.assign(globalThis.window||globalThis,{loadLifeUpdater:(globalThis.__tsParticlesInternals.updaters.life||{}).loadLifeUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;