tsparticles 3.0.0-alpha.1 → 3.0.0-beta.0

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
@@ -5,18 +5,19 @@
5
5
  [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles/badge)](https://www.jsdelivr.com/package/npm/tsparticles) [![npmjs](https://badge.fury.io/js/tsparticles.svg)](https://www.npmjs.com/package/tsparticles) [![npmjs](https://img.shields.io/npm/dt/tsparticles)](https://www.npmjs.com/package/tsparticles) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
6
6
 
7
7
  [tsParticles](https://github.com/matteobruni/tsparticles) full bundle loads all the v1 features to
8
- a `tsparticles-engine` instance.
8
+ a `@tsparticles/engine` instance.
9
9
 
10
10
  **Included Packages**
11
11
 
12
- - [tsparticles-engine](https://github.com/matteobruni/tsparticles/tree/main/engine)
13
- - [tsparticles-slim (and all its dependencies)](https://github.com/matteobruni/tsparticles/tree/main/bundles/slim)
14
- - [tsparticles-interaction-external-trail](https://github.com/matteobruni/tsparticles/tree/main/interactions/external/trail)
15
- - [tsparticles-plugin-absorbers](https://github.com/matteobruni/tsparticles/tree/main/plugins/absorbers)
16
- - [tsparticles-plugin-emitters](https://github.com/matteobruni/tsparticles/tree/main/plugins/emitters)
17
- - [tsparticles-updater-roll](https://github.com/matteobruni/tsparticles/tree/main/updaters/roll)
18
- - [tsparticles-updater-tilt](https://github.com/matteobruni/tsparticles/tree/main/updaters/tilt)
19
- - [tsparticles-updater-wobble](https://github.com/matteobruni/tsparticles/tree/main/updaters/wobble)
12
+ - [@tsparticles/slim (and all its dependencies)](https://github.com/matteobruni/tsparticles/tree/main/bundles/slim)
13
+ - [@tsparticles/interaction-external-trail](https://github.com/matteobruni/tsparticles/tree/main/interactions/external/trail)
14
+ - [@tsparticles/plugin-absorbers](https://github.com/matteobruni/tsparticles/tree/main/plugins/absorbers)
15
+ - [@tsparticles/plugin-emitters](https://github.com/matteobruni/tsparticles/tree/main/plugins/emitters)
16
+ - [@tsparticles/updater-destroy](https://github.com/matteobruni/tsparticles/tree/main/updaters/destroy)
17
+ - [@tsparticles/updater-roll](https://github.com/matteobruni/tsparticles/tree/main/updaters/roll)
18
+ - [@tsparticles/updater-tilt](https://github.com/matteobruni/tsparticles/tree/main/updaters/tilt)
19
+ - [@tsparticles/updater-twinkle](https://github.com/matteobruni/tsparticles/tree/main/updaters/twinkle)
20
+ - [@tsparticles/updater-wobble](https://github.com/matteobruni/tsparticles/tree/main/updaters/wobble)
20
21
 
21
22
  ## How to use it
22
23
 
@@ -42,8 +43,8 @@ All new features will be added as external packages, this bundle is recommended
42
43
  This installation requires more work since all dependencies must be included in the page. Some lines above are all
43
44
  specified in the **Included Packages** section.
44
45
 
45
- A note about `tsparticles-slim` can be made: it's not mandatory to include all of its dependencies, the slim bundle file
46
- is enough, and if this is done the `tsparticles-engine` is not needed, since it's already bundled in the slim bundle.
46
+ A note about `@tsparticles/slim` can be made: it's not mandatory to include all of its dependencies, the slim bundle file
47
+ is enough, and if this is done the `@tsparticles/engine` is not needed, since it's already bundled in the slim bundle.
47
48
 
48
49
  ### Usage
49
50
 
@@ -73,7 +74,7 @@ _Class Components_
73
74
  ```typescript jsx
74
75
  import React from "react";
75
76
  import Particles from "react-particles";
76
- import type { Engine } from "tsparticles-engine";
77
+ import type { Engine } from "@tsparticles/engine";
77
78
  import { loadFull } from "tsparticles";
78
79
 
79
80
  export class ParticlesContainer extends PureComponent<unknown> {
@@ -98,7 +99,7 @@ _Hooks / Functional Components_
98
99
  ```typescript jsx
99
100
  import React, { useCallback } from "react";
100
101
  import Particles from "react-particles";
101
- import type { Engine } from "tsparticles-engine";
102
+ import type { Engine } from "@tsparticles/engine";
102
103
  import { loadFull } from "tsparticles";
103
104
 
104
105
  export function ParticlesContainer(props: unknown) {
@@ -137,7 +138,7 @@ async function particlesInit(engine: Engine): Promise<void> {
137
138
  ### Angular
138
139
 
139
140
  ```html
140
- <angular-particles [id]="id" [options]="options" [particlesInit]="particlesInit"></angular-particles>
141
+ <ng-particles [id]="id" [options]="options" [particlesInit]="particlesInit"></ng-particles>
141
142
  ```
142
143
 
143
144
  ```ts
@@ -155,9 +156,9 @@ async function particlesInit(engine: Engine): Promise<void> {
155
156
  ```sveltehtml
156
157
 
157
158
  <Particles
158
- id="tsparticles"
159
- options={options}
160
- particlesInit={particlesInit}
159
+ id="tsparticles"
160
+ options={options}
161
+ particlesInit={particlesInit}
161
162
  />
162
163
  ```
163
164
 
package/browser/index.js CHANGED
@@ -7,14 +7,14 @@ import { loadSlim } from "@tsparticles/slim";
7
7
  import { loadTiltUpdater } from "@tsparticles/updater-tilt";
8
8
  import { loadTwinkleUpdater } from "@tsparticles/updater-twinkle";
9
9
  import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
10
- export async function loadFull(engine) {
11
- await loadSlim(engine);
12
- await loadDestroyUpdater(engine);
13
- await loadRollUpdater(engine);
14
- await loadTiltUpdater(engine);
15
- await loadTwinkleUpdater(engine);
16
- await loadWobbleUpdater(engine);
17
- await loadExternalTrailInteraction(engine);
18
- await loadAbsorbersPlugin(engine);
19
- await loadEmittersPlugin(engine);
10
+ export async function loadFull(engine, refresh = true) {
11
+ await loadDestroyUpdater(engine, false);
12
+ await loadRollUpdater(engine, false);
13
+ await loadTiltUpdater(engine, false);
14
+ await loadTwinkleUpdater(engine, false);
15
+ await loadWobbleUpdater(engine, false);
16
+ await loadExternalTrailInteraction(engine, false);
17
+ await loadAbsorbersPlugin(engine, false);
18
+ await loadEmittersPlugin(engine, false);
19
+ await loadSlim(engine, refresh);
20
20
  }
package/cjs/index.js CHANGED
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.loadFull = void 0;
13
4
  const plugin_absorbers_1 = require("@tsparticles/plugin-absorbers");
@@ -19,17 +10,15 @@ const slim_1 = require("@tsparticles/slim");
19
10
  const updater_tilt_1 = require("@tsparticles/updater-tilt");
20
11
  const updater_twinkle_1 = require("@tsparticles/updater-twinkle");
21
12
  const updater_wobble_1 = require("@tsparticles/updater-wobble");
22
- function loadFull(engine) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- yield (0, slim_1.loadSlim)(engine);
25
- yield (0, updater_destroy_1.loadDestroyUpdater)(engine);
26
- yield (0, updater_roll_1.loadRollUpdater)(engine);
27
- yield (0, updater_tilt_1.loadTiltUpdater)(engine);
28
- yield (0, updater_twinkle_1.loadTwinkleUpdater)(engine);
29
- yield (0, updater_wobble_1.loadWobbleUpdater)(engine);
30
- yield (0, interaction_external_trail_1.loadExternalTrailInteraction)(engine);
31
- yield (0, plugin_absorbers_1.loadAbsorbersPlugin)(engine);
32
- yield (0, plugin_emitters_1.loadEmittersPlugin)(engine);
33
- });
13
+ async function loadFull(engine, refresh = true) {
14
+ await (0, updater_destroy_1.loadDestroyUpdater)(engine, false);
15
+ await (0, updater_roll_1.loadRollUpdater)(engine, false);
16
+ await (0, updater_tilt_1.loadTiltUpdater)(engine, false);
17
+ await (0, updater_twinkle_1.loadTwinkleUpdater)(engine, false);
18
+ await (0, updater_wobble_1.loadWobbleUpdater)(engine, false);
19
+ await (0, interaction_external_trail_1.loadExternalTrailInteraction)(engine, false);
20
+ await (0, plugin_absorbers_1.loadAbsorbersPlugin)(engine, false);
21
+ await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
22
+ await (0, slim_1.loadSlim)(engine, refresh);
34
23
  }
35
24
  exports.loadFull = loadFull;
package/esm/index.js CHANGED
@@ -7,14 +7,14 @@ import { loadSlim } from "@tsparticles/slim";
7
7
  import { loadTiltUpdater } from "@tsparticles/updater-tilt";
8
8
  import { loadTwinkleUpdater } from "@tsparticles/updater-twinkle";
9
9
  import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
10
- export async function loadFull(engine) {
11
- await loadSlim(engine);
12
- await loadDestroyUpdater(engine);
13
- await loadRollUpdater(engine);
14
- await loadTiltUpdater(engine);
15
- await loadTwinkleUpdater(engine);
16
- await loadWobbleUpdater(engine);
17
- await loadExternalTrailInteraction(engine);
18
- await loadAbsorbersPlugin(engine);
19
- await loadEmittersPlugin(engine);
10
+ export async function loadFull(engine, refresh = true) {
11
+ await loadDestroyUpdater(engine, false);
12
+ await loadRollUpdater(engine, false);
13
+ await loadTiltUpdater(engine, false);
14
+ await loadTwinkleUpdater(engine, false);
15
+ await loadWobbleUpdater(engine, false);
16
+ await loadExternalTrailInteraction(engine, false);
17
+ await loadAbsorbersPlugin(engine, false);
18
+ await loadEmittersPlugin(engine, false);
19
+ await loadSlim(engine, refresh);
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsparticles",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-beta.0",
4
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.",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -66,28 +66,39 @@
66
66
  "bugs": {
67
67
  "url": "https://github.com/matteobruni/tsparticles/issues"
68
68
  },
69
- "funding": {
70
- "type": "github",
71
- "url": "https://github.com/sponsors/matteobruni"
72
- },
69
+ "funding": [
70
+ {
71
+ "type": "github",
72
+ "url": "https://github.com/sponsors/matteobruni"
73
+ },
74
+ {
75
+ "type": "github",
76
+ "url": "https://github.com/sponsors/tsparticles"
77
+ },
78
+ {
79
+ "type": "buymeacoffee",
80
+ "url": "https://www.buymeacoffee.com/matteobruni"
81
+ }
82
+ ],
73
83
  "main": "cjs/index.js",
74
84
  "module": "esm/index.js",
75
85
  "jsdelivr": "tsparticles.bundle.min.js",
76
86
  "unpkg": "tsparticles.bundle.min.js",
77
87
  "types": "types/index.d.ts",
88
+ "sideEffects": false,
89
+ "dependencies": {
90
+ "@tsparticles/engine": "^3.0.0-beta.0",
91
+ "@tsparticles/interaction-external-trail": "^3.0.0-beta.0",
92
+ "@tsparticles/plugin-absorbers": "^3.0.0-beta.0",
93
+ "@tsparticles/plugin-emitters": "^3.0.0-beta.0",
94
+ "@tsparticles/slim": "^3.0.0-beta.0",
95
+ "@tsparticles/updater-destroy": "^3.0.0-beta.0",
96
+ "@tsparticles/updater-roll": "^3.0.0-beta.0",
97
+ "@tsparticles/updater-tilt": "^3.0.0-beta.0",
98
+ "@tsparticles/updater-twinkle": "^3.0.0-beta.0",
99
+ "@tsparticles/updater-wobble": "^3.0.0-beta.0"
100
+ },
78
101
  "publishConfig": {
79
102
  "access": "public"
80
- },
81
- "dependencies": {
82
- "@tsparticles/engine": "^3.0.0-alpha.1",
83
- "@tsparticles/interaction-external-trail": "^3.0.0-alpha.1",
84
- "@tsparticles/plugin-absorbers": "^3.0.0-alpha.1",
85
- "@tsparticles/plugin-emitters": "^3.0.0-alpha.1",
86
- "@tsparticles/slim": "^3.0.0-alpha.1",
87
- "@tsparticles/updater-destroy": "^3.0.0-alpha.1",
88
- "@tsparticles/updater-roll": "^3.0.0-alpha.1",
89
- "@tsparticles/updater-tilt": "^3.0.0-alpha.1",
90
- "@tsparticles/updater-twinkle": "^3.0.0-alpha.1",
91
- "@tsparticles/updater-wobble": "^3.0.0-alpha.1"
92
103
  }
93
- }
104
+ }