@tsparticles/engine 3.0.0-beta.1 → 3.0.0-beta.2

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/README.md CHANGED
@@ -11,11 +11,11 @@ React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.j
11
11
  [![npm](https://img.shields.io/npm/v/@tsparticles/engine?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
12
12
  [![npm](https://img.shields.io/npm/dm/tsparticles?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
13
13
  [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff?style=for-the-badge)](https://lerna.js.org/)
14
- [![CodeFactor](https://www.codefactor.io/repository/github/matteobruni/tsparticles/badge)](https://www.codefactor.io/repository/github/matteobruni/tsparticles)
15
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b983aaf3461a4c48b1e2eecce1ff1d74)](https://www.codacy.com/manual/ar3s/tsparticles?utm_source=github.com&utm_medium=referral&utm_content=matteobruni/tsparticles&utm_campaign=Badge_Grade)
14
+ [![CodeFactor](https://www.codefactor.io/repository/github/tsparticles/tsparticles/badge)](https://www.codefactor.io/repository/github/tsparticles/tsparticles)
15
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b983aaf3461a4c48b1e2eecce1ff1d74)](https://www.codacy.com/manual/ar3s/tsparticles?utm_source=github.com&utm_medium=referral&utm_content=tsparticles/tsparticles&utm_campaign=Badge_Grade)
16
16
  [![Rate this package](https://badges.openbase.com/js/rating/tsparticles.svg?style=openbase&token=A9jHQ1nkb6fnCndKM7O2w4hx3OD8PVCuqHtSpw8mMOg=)](https://openbase.com/js/tsparticles?utm_source=embedded&utm_medium=badge&utm_campaign=rating-badge&utm_term=js/tsparticles)
17
- [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/matteobruni/tsparticles)
18
- [![Run on Repl.it](https://repl.it/badge/github/matteobruni/tsparticles)](https://repl.it/github/matteobruni/tsparticles)
17
+ [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/tsparticles/tsparticles)
18
+ [![Run on Repl.it](https://repl.it/badge/github/tsparticles/tsparticles)](https://repl.it/github/tsparticles/tsparticles)
19
19
 
20
20
  [![Discord](https://img.shields.io/discord/872061157379301416?label=discord&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/hACwv45Hme)
21
21
  [![Slack](https://particles.js.org/images/slack.png)](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI)
@@ -114,7 +114,7 @@ particles.js
114
114
  it's even easier**.
115
115
 
116
116
  You'll find the
117
- instructions [below](https://github.com/matteobruni/tsparticles/blob/main/README.md#library-installation), with all the
117
+ instructions [below](https://github.com/tsparticles/tsparticles/blob/main/README.md#library-installation), with all the
118
118
  links you need, and _don't be scared by **TypeScript**, it's just the source language_.
119
119
 
120
120
  **The output files are just JavaScript**. 🤩
@@ -124,7 +124,7 @@ all
124
124
  files splitted for `import` syntax.
125
125
 
126
126
  **If you are interested** there are some _simple instructions_
127
- just [below](https://github.com/matteobruni/tsparticles/blob/main/README.md#library-installation) to guide you to
127
+ just [below](https://github.com/tsparticles/tsparticles/blob/main/README.md#library-installation) to guide you to
128
128
  migrate from the old particles.js library.
129
129
 
130
130
  ## **_Library installation_**
@@ -839,10 +839,10 @@ e --> u
839
839
 
840
840
  <p>
841
841
  <a href="https://www.jetbrains.com/?from=tsParticles">
842
- <img src="https://raw.githubusercontent.com/matteobruni/tsparticles/gh-pages/images/jetbrains-logos/jetbrains-variant-4.png" height="150" alt="JetBrains" />
842
+ <img src="https://raw.githubusercontent.com/tsparticles/tsparticles/gh-pages/images/jetbrains-logos/jetbrains-variant-4.png" height="150" alt="JetBrains" />
843
843
  </a>
844
844
  <a href="https://www.jetbrains.com/webstorm/?from=tsParticles">
845
- <img src="https://raw.githubusercontent.com/matteobruni/tsparticles/gh-pages/images/jetbrains-logos/logo.png" height="150" alt="JetBrains" />
845
+ <img src="https://raw.githubusercontent.com/tsparticles/tsparticles/gh-pages/images/jetbrains-logos/logo.png" height="150" alt="JetBrains" />
846
846
  </a>
847
847
  </p>
848
848
 
@@ -50,7 +50,7 @@ export class Engine {
50
50
  return res;
51
51
  }
52
52
  get version() {
53
- return "3.0.0-beta.1";
53
+ return "3.0.0-beta.2";
54
54
  }
55
55
  addConfig(nameOrConfig, config) {
56
56
  if (isString(nameOrConfig)) {
@@ -70,8 +70,9 @@ export class Particles {
70
70
  return false;
71
71
  }
72
72
  particle.destroy(override);
73
+ const zIdx = this._zArray.indexOf(particle);
73
74
  this._array.splice(index, 1);
74
- this._zArray = this._zArray.splice(this._zArray.indexOf(particle), 1);
75
+ this._zArray.splice(zIdx, 1);
75
76
  this.pool.push(particle);
76
77
  this._engine.dispatchEvent("particleRemoved", {
77
78
  container: this._container,
@@ -172,7 +173,7 @@ export class Particles {
172
173
  }
173
174
  this.addManualParticles();
174
175
  if (!handled) {
175
- const particlesOptions = options.particles, groups = options.particles.groups;
176
+ const particlesOptions = options.particles, groups = particlesOptions.groups;
176
177
  for (const group in groups) {
177
178
  const groupOptions = groups[group];
178
179
  for (let i = this.count, j = 0; j < groupOptions.number?.value && i < particlesOptions.number.value; i++, j++) {
@@ -53,7 +53,7 @@ class Engine {
53
53
  return res;
54
54
  }
55
55
  get version() {
56
- return "3.0.0-beta.1";
56
+ return "3.0.0-beta.2";
57
57
  }
58
58
  addConfig(nameOrConfig, config) {
59
59
  if ((0, Utils_js_1.isString)(nameOrConfig)) {
@@ -73,8 +73,9 @@ class Particles {
73
73
  return false;
74
74
  }
75
75
  particle.destroy(override);
76
+ const zIdx = this._zArray.indexOf(particle);
76
77
  this._array.splice(index, 1);
77
- this._zArray = this._zArray.splice(this._zArray.indexOf(particle), 1);
78
+ this._zArray.splice(zIdx, 1);
78
79
  this.pool.push(particle);
79
80
  this._engine.dispatchEvent("particleRemoved", {
80
81
  container: this._container,
@@ -175,7 +176,7 @@ class Particles {
175
176
  }
176
177
  this.addManualParticles();
177
178
  if (!handled) {
178
- const particlesOptions = options.particles, groups = options.particles.groups;
179
+ const particlesOptions = options.particles, groups = particlesOptions.groups;
179
180
  for (const group in groups) {
180
181
  const groupOptions = groups[group];
181
182
  for (let i = this.count, j = 0; j < groupOptions.number?.value && i < particlesOptions.number.value; i++, j++) {
@@ -50,7 +50,7 @@ export class Engine {
50
50
  return res;
51
51
  }
52
52
  get version() {
53
- return "3.0.0-beta.1";
53
+ return "3.0.0-beta.2";
54
54
  }
55
55
  addConfig(nameOrConfig, config) {
56
56
  if (isString(nameOrConfig)) {
@@ -70,8 +70,9 @@ export class Particles {
70
70
  return false;
71
71
  }
72
72
  particle.destroy(override);
73
+ const zIdx = this._zArray.indexOf(particle);
73
74
  this._array.splice(index, 1);
74
- this._zArray = this._zArray.splice(this._zArray.indexOf(particle), 1);
75
+ this._zArray.splice(zIdx, 1);
75
76
  this.pool.push(particle);
76
77
  this._engine.dispatchEvent("particleRemoved", {
77
78
  container: this._container,
@@ -172,7 +173,7 @@ export class Particles {
172
173
  }
173
174
  this.addManualParticles();
174
175
  if (!handled) {
175
- const particlesOptions = options.particles, groups = options.particles.groups;
176
+ const particlesOptions = options.particles, groups = particlesOptions.groups;
176
177
  for (const group in groups) {
177
178
  const groupOptions = groups[group];
178
179
  for (let i = this.count, j = 0; j < groupOptions.number?.value && i < particlesOptions.number.value; i++, j++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/engine",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Easily create highly customizable particle, confetti and fireworks 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.",
5
5
  "homepage": "https://particles.js.org",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/matteobruni/tsparticles.git",
11
+ "url": "git+https://github.com/tsparticles/tsparticles.git",
12
12
  "directory": "engine"
13
13
  },
14
14
  "keywords": [
@@ -67,7 +67,7 @@
67
67
  "author": "Matteo Bruni <matteo.bruni@me.com>",
68
68
  "license": "MIT",
69
69
  "bugs": {
70
- "url": "https://github.com/matteobruni/tsparticles/issues"
70
+ "url": "https://github.com/tsparticles/tsparticles/issues"
71
71
  },
72
72
  "funding": [
73
73
  {