@tsparticles/confetti 4.1.3 → 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.
@@ -1,4 +1,4 @@
1
- import { deepExtend, isArray, isNull, percentDenominator, } from "@tsparticles/engine";
1
+ import { deepExtend, isArray, isNull, loadProperty, percentDenominator, } from "@tsparticles/engine";
2
2
  export class ConfettiOptions {
3
3
  angle;
4
4
  colors;
@@ -57,34 +57,18 @@ export class ConfettiOptions {
57
57
  if (isNull(data)) {
58
58
  return;
59
59
  }
60
- if (data.angle !== undefined) {
61
- this.angle = data.angle;
62
- }
60
+ loadProperty(this, "angle", data.angle);
63
61
  const count = data.count ?? data.particleCount;
64
62
  if (count !== undefined) {
65
63
  this.count = count;
66
64
  }
67
- if (data.spread !== undefined) {
68
- this.spread = data.spread;
69
- }
70
- if (data.startVelocity !== undefined) {
71
- this.startVelocity = data.startVelocity;
72
- }
73
- if (data.decay !== undefined) {
74
- this.decay = data.decay;
75
- }
76
- if (data.flat !== undefined) {
77
- this.flat = data.flat;
78
- }
79
- if (data.gravity !== undefined) {
80
- this.gravity = data.gravity;
81
- }
82
- if (data.drift !== undefined) {
83
- this.drift = data.drift;
84
- }
85
- if (data.ticks !== undefined) {
86
- this.ticks = data.ticks;
87
- }
65
+ loadProperty(this, "spread", data.spread);
66
+ loadProperty(this, "startVelocity", data.startVelocity);
67
+ loadProperty(this, "decay", data.decay);
68
+ loadProperty(this, "flat", data.flat);
69
+ loadProperty(this, "gravity", data.gravity);
70
+ loadProperty(this, "drift", data.drift);
71
+ loadProperty(this, "ticks", data.ticks);
88
72
  const origin = data.origin;
89
73
  if (origin && !data.position) {
90
74
  data.position = {
@@ -126,14 +110,8 @@ export class ConfettiOptions {
126
110
  this.shapes = data.shapes;
127
111
  }
128
112
  }
129
- if (data.scalar !== undefined) {
130
- this.scalar = data.scalar;
131
- }
132
- if (data.zIndex !== undefined) {
133
- this.zIndex = data.zIndex;
134
- }
135
- if (data.disableForReducedMotion !== undefined) {
136
- this.disableForReducedMotion = data.disableForReducedMotion;
137
- }
113
+ loadProperty(this, "scalar", data.scalar);
114
+ loadProperty(this, "zIndex", data.zIndex);
115
+ loadProperty(this, "disableForReducedMotion", data.disableForReducedMotion);
138
116
  }
139
117
  }
@@ -17,7 +17,7 @@ import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
17
17
  import { setConfetti } from "./utils.js";
18
18
  let initPromise = null;
19
19
  async function doInitPlugins(engine) {
20
- engine.checkVersion("4.1.3");
20
+ engine.checkVersion("4.2.1");
21
21
  await engine.pluginManager.register(async (e) => {
22
22
  await Promise.all([
23
23
  loadBasic(e),
@@ -90,5 +90,5 @@ confetti.create = async (canvas, options = {}) => {
90
90
  confetti.init = async () => {
91
91
  await initPlugins(tsParticles);
92
92
  };
93
- confetti.version = "4.1.3";
93
+ confetti.version = "4.2.1";
94
94
  globalThis.confetti = confetti;
@@ -2,7 +2,7 @@ import { isString, tsParticles } from "@tsparticles/engine/lazy";
2
2
  import { setConfetti } from "./utils.js";
3
3
  let initPromise = null;
4
4
  async function doInitPlugins(engine) {
5
- engine.checkVersion("4.1.3");
5
+ engine.checkVersion("4.2.1");
6
6
  await engine.pluginManager.register(async (e) => {
7
7
  const [{ loadBasic }, { loadEmittersPluginSimple }, { loadMotionPlugin }, { loadCardSuitsShape }, { loadEmojiShape }, { loadHeartShape }, { loadImageShape }, { loadPolygonShape }, { loadSquareShape }, { loadStarShape }, { loadRotateUpdater }, { loadLifeUpdater }, { loadRollUpdater }, { loadTiltUpdater }, { loadWobbleUpdater },] = await Promise.all([
8
8
  import("@tsparticles/basic/lazy"),
@@ -92,5 +92,5 @@ confetti.create = async (canvas, options = {}) => {
92
92
  confetti.init = async () => {
93
93
  await initPlugins(tsParticles);
94
94
  };
95
- confetti.version = "4.1.3";
95
+ confetti.version = "4.2.1";
96
96
  globalThis.confetti = confetti;
@@ -1,4 +1,4 @@
1
- import { deepExtend, isArray, isNull, percentDenominator, } from "@tsparticles/engine";
1
+ import { deepExtend, isArray, isNull, loadProperty, percentDenominator, } from "@tsparticles/engine";
2
2
  export class ConfettiOptions {
3
3
  angle;
4
4
  colors;
@@ -57,34 +57,18 @@ export class ConfettiOptions {
57
57
  if (isNull(data)) {
58
58
  return;
59
59
  }
60
- if (data.angle !== undefined) {
61
- this.angle = data.angle;
62
- }
60
+ loadProperty(this, "angle", data.angle);
63
61
  const count = data.count ?? data.particleCount;
64
62
  if (count !== undefined) {
65
63
  this.count = count;
66
64
  }
67
- if (data.spread !== undefined) {
68
- this.spread = data.spread;
69
- }
70
- if (data.startVelocity !== undefined) {
71
- this.startVelocity = data.startVelocity;
72
- }
73
- if (data.decay !== undefined) {
74
- this.decay = data.decay;
75
- }
76
- if (data.flat !== undefined) {
77
- this.flat = data.flat;
78
- }
79
- if (data.gravity !== undefined) {
80
- this.gravity = data.gravity;
81
- }
82
- if (data.drift !== undefined) {
83
- this.drift = data.drift;
84
- }
85
- if (data.ticks !== undefined) {
86
- this.ticks = data.ticks;
87
- }
65
+ loadProperty(this, "spread", data.spread);
66
+ loadProperty(this, "startVelocity", data.startVelocity);
67
+ loadProperty(this, "decay", data.decay);
68
+ loadProperty(this, "flat", data.flat);
69
+ loadProperty(this, "gravity", data.gravity);
70
+ loadProperty(this, "drift", data.drift);
71
+ loadProperty(this, "ticks", data.ticks);
88
72
  const origin = data.origin;
89
73
  if (origin && !data.position) {
90
74
  data.position = {
@@ -126,14 +110,8 @@ export class ConfettiOptions {
126
110
  this.shapes = data.shapes;
127
111
  }
128
112
  }
129
- if (data.scalar !== undefined) {
130
- this.scalar = data.scalar;
131
- }
132
- if (data.zIndex !== undefined) {
133
- this.zIndex = data.zIndex;
134
- }
135
- if (data.disableForReducedMotion !== undefined) {
136
- this.disableForReducedMotion = data.disableForReducedMotion;
137
- }
113
+ loadProperty(this, "scalar", data.scalar);
114
+ loadProperty(this, "zIndex", data.zIndex);
115
+ loadProperty(this, "disableForReducedMotion", data.disableForReducedMotion);
138
116
  }
139
117
  }
package/cjs/confetti.js CHANGED
@@ -17,7 +17,7 @@ import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
17
17
  import { setConfetti } from "./utils.js";
18
18
  let initPromise = null;
19
19
  async function doInitPlugins(engine) {
20
- engine.checkVersion("4.1.3");
20
+ engine.checkVersion("4.2.1");
21
21
  await engine.pluginManager.register(async (e) => {
22
22
  await Promise.all([
23
23
  loadBasic(e),
@@ -90,5 +90,5 @@ confetti.create = async (canvas, options = {}) => {
90
90
  confetti.init = async () => {
91
91
  await initPlugins(tsParticles);
92
92
  };
93
- confetti.version = "4.1.3";
93
+ confetti.version = "4.2.1";
94
94
  globalThis.confetti = confetti;
@@ -2,7 +2,7 @@ import { isString, tsParticles } from "@tsparticles/engine/lazy";
2
2
  import { setConfetti } from "./utils.js";
3
3
  let initPromise = null;
4
4
  async function doInitPlugins(engine) {
5
- engine.checkVersion("4.1.3");
5
+ engine.checkVersion("4.2.1");
6
6
  await engine.pluginManager.register(async (e) => {
7
7
  const [{ loadBasic }, { loadEmittersPluginSimple }, { loadMotionPlugin }, { loadCardSuitsShape }, { loadEmojiShape }, { loadHeartShape }, { loadImageShape }, { loadPolygonShape }, { loadSquareShape }, { loadStarShape }, { loadRotateUpdater }, { loadLifeUpdater }, { loadRollUpdater }, { loadTiltUpdater }, { loadWobbleUpdater },] = await Promise.all([
8
8
  import("@tsparticles/basic/lazy"),
@@ -92,5 +92,5 @@ confetti.create = async (canvas, options = {}) => {
92
92
  confetti.init = async () => {
93
93
  await initPlugins(tsParticles);
94
94
  };
95
- confetti.version = "4.1.3";
95
+ confetti.version = "4.2.1";
96
96
  globalThis.confetti = confetti;
@@ -1,4 +1,4 @@
1
- import { deepExtend, isArray, isNull, percentDenominator, } from "@tsparticles/engine";
1
+ import { deepExtend, isArray, isNull, loadProperty, percentDenominator, } from "@tsparticles/engine";
2
2
  export class ConfettiOptions {
3
3
  angle;
4
4
  colors;
@@ -57,34 +57,18 @@ export class ConfettiOptions {
57
57
  if (isNull(data)) {
58
58
  return;
59
59
  }
60
- if (data.angle !== undefined) {
61
- this.angle = data.angle;
62
- }
60
+ loadProperty(this, "angle", data.angle);
63
61
  const count = data.count ?? data.particleCount;
64
62
  if (count !== undefined) {
65
63
  this.count = count;
66
64
  }
67
- if (data.spread !== undefined) {
68
- this.spread = data.spread;
69
- }
70
- if (data.startVelocity !== undefined) {
71
- this.startVelocity = data.startVelocity;
72
- }
73
- if (data.decay !== undefined) {
74
- this.decay = data.decay;
75
- }
76
- if (data.flat !== undefined) {
77
- this.flat = data.flat;
78
- }
79
- if (data.gravity !== undefined) {
80
- this.gravity = data.gravity;
81
- }
82
- if (data.drift !== undefined) {
83
- this.drift = data.drift;
84
- }
85
- if (data.ticks !== undefined) {
86
- this.ticks = data.ticks;
87
- }
65
+ loadProperty(this, "spread", data.spread);
66
+ loadProperty(this, "startVelocity", data.startVelocity);
67
+ loadProperty(this, "decay", data.decay);
68
+ loadProperty(this, "flat", data.flat);
69
+ loadProperty(this, "gravity", data.gravity);
70
+ loadProperty(this, "drift", data.drift);
71
+ loadProperty(this, "ticks", data.ticks);
88
72
  const origin = data.origin;
89
73
  if (origin && !data.position) {
90
74
  data.position = {
@@ -126,14 +110,8 @@ export class ConfettiOptions {
126
110
  this.shapes = data.shapes;
127
111
  }
128
112
  }
129
- if (data.scalar !== undefined) {
130
- this.scalar = data.scalar;
131
- }
132
- if (data.zIndex !== undefined) {
133
- this.zIndex = data.zIndex;
134
- }
135
- if (data.disableForReducedMotion !== undefined) {
136
- this.disableForReducedMotion = data.disableForReducedMotion;
137
- }
113
+ loadProperty(this, "scalar", data.scalar);
114
+ loadProperty(this, "zIndex", data.zIndex);
115
+ loadProperty(this, "disableForReducedMotion", data.disableForReducedMotion);
138
116
  }
139
117
  }
package/esm/confetti.js CHANGED
@@ -17,7 +17,7 @@ import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
17
17
  import { setConfetti } from "./utils.js";
18
18
  let initPromise = null;
19
19
  async function doInitPlugins(engine) {
20
- engine.checkVersion("4.1.3");
20
+ engine.checkVersion("4.2.1");
21
21
  await engine.pluginManager.register(async (e) => {
22
22
  await Promise.all([
23
23
  loadBasic(e),
@@ -90,5 +90,5 @@ confetti.create = async (canvas, options = {}) => {
90
90
  confetti.init = async () => {
91
91
  await initPlugins(tsParticles);
92
92
  };
93
- confetti.version = "4.1.3";
93
+ confetti.version = "4.2.1";
94
94
  globalThis.confetti = confetti;
@@ -2,7 +2,7 @@ import { isString, tsParticles } from "@tsparticles/engine/lazy";
2
2
  import { setConfetti } from "./utils.js";
3
3
  let initPromise = null;
4
4
  async function doInitPlugins(engine) {
5
- engine.checkVersion("4.1.3");
5
+ engine.checkVersion("4.2.1");
6
6
  await engine.pluginManager.register(async (e) => {
7
7
  const [{ loadBasic }, { loadEmittersPluginSimple }, { loadMotionPlugin }, { loadCardSuitsShape }, { loadEmojiShape }, { loadHeartShape }, { loadImageShape }, { loadPolygonShape }, { loadSquareShape }, { loadStarShape }, { loadRotateUpdater }, { loadLifeUpdater }, { loadRollUpdater }, { loadTiltUpdater }, { loadWobbleUpdater },] = await Promise.all([
8
8
  import("@tsparticles/basic/lazy"),
@@ -92,5 +92,5 @@ confetti.create = async (canvas, options = {}) => {
92
92
  confetti.init = async () => {
93
93
  await initPlugins(tsParticles);
94
94
  };
95
- confetti.version = "4.1.3";
95
+ confetti.version = "4.2.1";
96
96
  globalThis.confetti = confetti;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsparticles/confetti",
3
- "version": "4.1.3",
4
- "description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
3
+ "version": "4.2.1",
4
+ "description": "tsParticles confetti bundle — easily create confetti, confetti cannon, confetti explosions, confetti falling, and confetti parade animations with presets. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
7
7
  "type": "git",
@@ -105,22 +105,22 @@
105
105
  "./package.json": "./package.json"
106
106
  },
107
107
  "dependencies": {
108
- "@tsparticles/basic": "4.1.3",
109
- "@tsparticles/engine": "4.1.3",
110
- "@tsparticles/plugin-emitters": "4.1.3",
111
- "@tsparticles/plugin-motion": "4.1.3",
112
- "@tsparticles/shape-cards": "4.1.3",
113
- "@tsparticles/shape-emoji": "4.1.3",
114
- "@tsparticles/shape-heart": "4.1.3",
115
- "@tsparticles/shape-image": "4.1.3",
116
- "@tsparticles/shape-polygon": "4.1.3",
117
- "@tsparticles/shape-square": "4.1.3",
118
- "@tsparticles/shape-star": "4.1.3",
119
- "@tsparticles/updater-life": "4.1.3",
120
- "@tsparticles/updater-roll": "4.1.3",
121
- "@tsparticles/updater-rotate": "4.1.3",
122
- "@tsparticles/updater-tilt": "4.1.3",
123
- "@tsparticles/updater-wobble": "4.1.3"
108
+ "@tsparticles/basic": "4.2.1",
109
+ "@tsparticles/engine": "4.2.1",
110
+ "@tsparticles/plugin-emitters": "4.2.1",
111
+ "@tsparticles/plugin-motion": "4.2.1",
112
+ "@tsparticles/shape-cards": "4.2.1",
113
+ "@tsparticles/shape-emoji": "4.2.1",
114
+ "@tsparticles/shape-heart": "4.2.1",
115
+ "@tsparticles/shape-image": "4.2.1",
116
+ "@tsparticles/shape-polygon": "4.2.1",
117
+ "@tsparticles/shape-square": "4.2.1",
118
+ "@tsparticles/shape-star": "4.2.1",
119
+ "@tsparticles/updater-life": "4.2.1",
120
+ "@tsparticles/updater-roll": "4.2.1",
121
+ "@tsparticles/updater-rotate": "4.2.1",
122
+ "@tsparticles/updater-tilt": "4.2.1",
123
+ "@tsparticles/updater-wobble": "4.2.1"
124
124
  },
125
125
  "publishConfig": {
126
126
  "access": "public"