@tsparticles/preset-confetti-falling 4.5.0 → 4.5.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.
@@ -1,6 +1,6 @@
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);})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
2
  (function (g) {
3
- /* Preset v4.5.0 */
3
+ /* Preset v4.5.1 */
4
4
  g.__tsParticlesInternals = g.__tsParticlesInternals || {};
5
5
  g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
6
6
  (function (exports) {
@@ -654,12 +654,8 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
654
654
  }
655
655
  addEventListener(type, listener) {
656
656
  this.removeEventListener(type, listener);
657
- let arr = this.#listeners.get(type);
658
- if (!arr) {
659
- arr = [];
660
- this.#listeners.set(type, arr);
661
- }
662
- arr.push(listener);
657
+ const arr = this.#listeners.get(type);
658
+ this.#listeners.set(type, arr ? [...arr, listener] : [listener]);
663
659
  }
664
660
  dispatchEvent(type, args) {
665
661
  const listeners = this.#listeners.get(type);
@@ -691,7 +687,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
691
687
  this.#listeners.delete(type);
692
688
  }
693
689
  else {
694
- arr.splice(idx, deleteCount);
690
+ this.#listeners.set(type, [...arr.slice(minIndex, idx), ...arr.slice(idx + deleteCount)]);
695
691
  }
696
692
  }
697
693
  }
@@ -872,7 +868,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
872
868
  return this.#domArray;
873
869
  }
874
870
  get version() {
875
- return "4.5.0";
871
+ return "4.5.1";
876
872
  }
877
873
  addEventListener(type, listener) {
878
874
  this.#eventDispatcher.addEventListener(type, listener);
@@ -2273,7 +2269,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2273
2269
  }
2274
2270
 
2275
2271
  async function loadBlendPlugin(engine) {
2276
- engine.checkVersion("4.5.0");
2272
+ engine.checkVersion("4.5.1");
2277
2273
  await engine.pluginManager.register(e => {
2278
2274
  e.pluginManager.addPlugin(new BlendPlugin());
2279
2275
  });
@@ -2310,7 +2306,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2310
2306
  }
2311
2307
 
2312
2308
  async function loadCircleShape(engine) {
2313
- engine.checkVersion("4.5.0");
2309
+ engine.checkVersion("4.5.1");
2314
2310
  await engine.pluginManager.register(e => {
2315
2311
  e.pluginManager.addShape(["circle"], () => {
2316
2312
  return Promise.resolve(new CircleDrawer());
@@ -2358,7 +2354,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2358
2354
  }
2359
2355
 
2360
2356
  async function loadHexColorPlugin(engine) {
2361
- engine.checkVersion("4.5.0");
2357
+ engine.checkVersion("4.5.1");
2362
2358
  await engine.pluginManager.register(e => {
2363
2359
  e.pluginManager.addColorManager("hex", new HexColorManager());
2364
2360
  });
@@ -2411,7 +2407,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2411
2407
  }
2412
2408
 
2413
2409
  async function loadHslColorPlugin(engine) {
2414
- engine.checkVersion("4.5.0");
2410
+ engine.checkVersion("4.5.1");
2415
2411
  await engine.pluginManager.register(e => {
2416
2412
  e.pluginManager.addColorManager("hsl", new HslColorManager());
2417
2413
  });
@@ -2443,7 +2439,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2443
2439
  }
2444
2440
 
2445
2441
  async function loadMovePlugin(engine) {
2446
- engine.checkVersion("4.5.0");
2442
+ engine.checkVersion("4.5.1");
2447
2443
  if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
2448
2444
  addErrorMessages(ErrorMessages);
2449
2445
  }
@@ -2659,7 +2655,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2659
2655
  }
2660
2656
 
2661
2657
  async function loadOpacityUpdater(engine) {
2662
- engine.checkVersion("4.5.0");
2658
+ engine.checkVersion("4.5.1");
2663
2659
  await engine.pluginManager.register(e => {
2664
2660
  e.pluginManager.addParticleUpdater("opacity", container => {
2665
2661
  return Promise.resolve(new OpacityUpdater(container));
@@ -2988,7 +2984,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2988
2984
  }
2989
2985
 
2990
2986
  async function loadOutModesUpdater(engine) {
2991
- engine.checkVersion("4.5.0");
2987
+ engine.checkVersion("4.5.1");
2992
2988
  await engine.pluginManager.register(e => {
2993
2989
  e.pluginManager.addParticleUpdater("outModes", container => {
2994
2990
  return Promise.resolve(new OutOfCanvasUpdater(container));
@@ -3067,7 +3063,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3067
3063
  }
3068
3064
 
3069
3065
  async function loadPaintUpdater(engine) {
3070
- engine.checkVersion("4.5.0");
3066
+ engine.checkVersion("4.5.1");
3071
3067
  await engine.pluginManager.register(e => {
3072
3068
  e.pluginManager.addParticleUpdater("paint", container => {
3073
3069
  return Promise.resolve(new PaintUpdater(e.pluginManager, container));
@@ -3122,7 +3118,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3122
3118
  }
3123
3119
 
3124
3120
  async function loadRgbColorPlugin(engine) {
3125
- engine.checkVersion("4.5.0");
3121
+ engine.checkVersion("4.5.1");
3126
3122
  await engine.pluginManager.register(e => {
3127
3123
  e.pluginManager.addColorManager("rgb", new RgbColorManager());
3128
3124
  });
@@ -3207,7 +3203,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3207
3203
  }
3208
3204
 
3209
3205
  async function loadSizeUpdater(engine) {
3210
- engine.checkVersion("4.5.0");
3206
+ engine.checkVersion("4.5.1");
3211
3207
  await engine.pluginManager.register(e => {
3212
3208
  e.pluginManager.addParticleUpdater("size", container => {
3213
3209
  return Promise.resolve(new SizeUpdater(container));
@@ -3216,7 +3212,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3216
3212
  }
3217
3213
 
3218
3214
  async function loadBasic(engine) {
3219
- engine.checkVersion("4.5.0");
3215
+ engine.checkVersion("4.5.1");
3220
3216
  await engine.pluginManager.register(async (e) => {
3221
3217
  await Promise.all([
3222
3218
  loadBlendPlugin(e),
@@ -3309,7 +3305,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3309
3305
  }
3310
3306
 
3311
3307
  async function loadMotionPlugin(engine) {
3312
- engine.checkVersion("4.5.0");
3308
+ engine.checkVersion("4.5.1");
3313
3309
  await engine.pluginManager.register(e => {
3314
3310
  e.pluginManager.addPlugin(new MotionPlugin());
3315
3311
  });
@@ -3442,7 +3438,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3442
3438
  }
3443
3439
 
3444
3440
  async function loadRollUpdater(engine) {
3445
- engine.checkVersion("4.5.0");
3441
+ engine.checkVersion("4.5.1");
3446
3442
  await engine.pluginManager.register(e => {
3447
3443
  e.pluginManager.addParticleUpdater("roll", () => {
3448
3444
  return Promise.resolve(new RollUpdater(e.pluginManager));
@@ -3548,7 +3544,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3548
3544
  }
3549
3545
 
3550
3546
  async function loadRotateUpdater(engine) {
3551
- engine.checkVersion("4.5.0");
3547
+ engine.checkVersion("4.5.1");
3552
3548
  await engine.pluginManager.register(e => {
3553
3549
  e.pluginManager.addParticleUpdater("rotate", container => {
3554
3550
  return Promise.resolve(new RotateUpdater(container));
@@ -3572,7 +3568,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3572
3568
  }
3573
3569
 
3574
3570
  async function loadSquareShape(engine) {
3575
- engine.checkVersion("4.5.0");
3571
+ engine.checkVersion("4.5.1");
3576
3572
  await engine.pluginManager.register(e => {
3577
3573
  e.pluginManager.addShape(["edge", "square"], () => Promise.resolve(new SquareDrawer()));
3578
3574
  });
@@ -3681,7 +3677,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3681
3677
  }
3682
3678
 
3683
3679
  async function loadTiltUpdater(engine) {
3684
- engine.checkVersion("4.5.0");
3680
+ engine.checkVersion("4.5.1");
3685
3681
  await engine.pluginManager.register(e => {
3686
3682
  e.pluginManager.addParticleUpdater("tilt", container => {
3687
3683
  return Promise.resolve(new TiltUpdater(container));
@@ -3783,7 +3779,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3783
3779
  }
3784
3780
 
3785
3781
  async function loadWobbleUpdater(engine) {
3786
- engine.checkVersion("4.5.0");
3782
+ engine.checkVersion("4.5.1");
3787
3783
  await engine.pluginManager.register(e => {
3788
3784
  e.pluginManager.addParticleUpdater("wobble", container => {
3789
3785
  return Promise.resolve(new WobbleUpdater(container));
@@ -4822,6 +4818,10 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
4822
4818
  this.#manageListeners(true);
4823
4819
  }
4824
4820
  removeListeners() {
4821
+ if (this.#resizeTimeout !== undefined) {
4822
+ clearTimeout(this.#resizeTimeout);
4823
+ this.#resizeTimeout = undefined;
4824
+ }
4825
4825
  this.#manageListeners(false);
4826
4826
  }
4827
4827
  #handleVisibilityChange() {
@@ -5476,14 +5476,22 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
5476
5476
  return out;
5477
5477
  }
5478
5478
  queryCircle(position, radius, check, out = []) {
5479
- const circle = this.#acquireCircle(position.x, position.y, radius), result = this.query(circle, check, out);
5480
- this.#releaseShapes();
5481
- return result;
5479
+ const circle = this.#acquireCircle(position.x, position.y, radius);
5480
+ try {
5481
+ return this.query(circle, check, out);
5482
+ }
5483
+ finally {
5484
+ this.#circlePoolIdx--;
5485
+ }
5482
5486
  }
5483
5487
  queryRectangle(position, size, check, out = []) {
5484
- const rect = this.#acquireRectangle(position.x, position.y, size.width, size.height), result = this.query(rect, check, out);
5485
- this.#releaseShapes();
5486
- return result;
5488
+ const rect = this.#acquireRectangle(position.x, position.y, size.width, size.height);
5489
+ try {
5490
+ return this.query(rect, check, out);
5491
+ }
5492
+ finally {
5493
+ this.#rectanglePoolIdx--;
5494
+ }
5487
5495
  }
5488
5496
  #acquireCircle(x, y, r) {
5489
5497
  const idx = this.#circlePoolIdx++;
@@ -5542,10 +5550,6 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
5542
5550
  }
5543
5551
  }
5544
5552
  }
5545
- #releaseShapes() {
5546
- this.#circlePoolIdx = 0;
5547
- this.#rectanglePoolIdx = 0;
5548
- }
5549
5553
  }
5550
5554
 
5551
5555
  class ParticlesManager {
@@ -6093,6 +6097,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
6093
6097
  started;
6094
6098
  zLayers;
6095
6099
  #delay;
6100
+ #delayResolve;
6096
6101
  #delayTimeout;
6097
6102
  #delta = { value: 0, factor: 0 };
6098
6103
  #dispatchCallback;
@@ -6331,7 +6336,10 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
6331
6336
  await this.init();
6332
6337
  this.started = true;
6333
6338
  await new Promise(resolve => {
6339
+ this.#delayResolve = resolve;
6334
6340
  const start = async () => {
6341
+ this.#delayTimeout = undefined;
6342
+ this.#delayResolve = undefined;
6335
6343
  this.#eventListeners.addListeners();
6336
6344
  for (const plugin of this.plugins) {
6337
6345
  await plugin.start?.();
@@ -6347,9 +6355,11 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
6347
6355
  if (!guardCheck(this) || !this.started) {
6348
6356
  return;
6349
6357
  }
6350
- if (this.#delayTimeout) {
6358
+ if (this.#delayTimeout !== undefined) {
6351
6359
  clearTimeout(this.#delayTimeout);
6352
6360
  this.#delayTimeout = undefined;
6361
+ this.#delayResolve?.();
6362
+ this.#delayResolve = undefined;
6353
6363
  }
6354
6364
  this.#firstStart = true;
6355
6365
  this.started = false;