tsparticles 1.37.0 → 1.37.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/Core/InteractionManager.d.ts +1 -0
- package/Core/InteractionManager.js +4 -1
- package/Core/Particles.d.ts +1 -1
- package/Core/Particles.js +3 -1
- package/Utils/Plugins.d.ts +2 -2
- package/Utils/Plugins.js +4 -4
- package/browser/Core/InteractionManager.d.ts +1 -0
- package/browser/Core/InteractionManager.js +4 -1
- package/browser/Core/Particles.d.ts +1 -1
- package/browser/Core/Particles.js +3 -1
- package/browser/Plugins/PolygonMask/plugin.js +1 -1
- package/browser/Utils/Plugins.d.ts +2 -2
- package/browser/Utils/Plugins.js +4 -4
- package/esm/Core/InteractionManager.d.ts +1 -0
- package/esm/Core/InteractionManager.js +4 -1
- package/esm/Core/Particles.d.ts +1 -1
- package/esm/Core/Particles.js +3 -1
- package/esm/Utils/Plugins.d.ts +2 -2
- package/esm/Utils/Plugins.js +4 -4
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.js +433 -371
- package/tsparticles.min.js +2 -2
- package/tsparticles.slim.js +405 -180
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.pathseg.js +0 -1472
|
@@ -6,6 +6,7 @@ export declare class InteractionManager {
|
|
|
6
6
|
private readonly externalInteractors;
|
|
7
7
|
private readonly particleInteractors;
|
|
8
8
|
constructor(container: Container);
|
|
9
|
+
init(): void;
|
|
9
10
|
externalInteract(delta: IDelta): void;
|
|
10
11
|
particlesInteract(particle: Particle, delta: IDelta): void;
|
|
11
12
|
}
|
|
@@ -6,9 +6,12 @@ const Enums_1 = require("../Enums");
|
|
|
6
6
|
class InteractionManager {
|
|
7
7
|
constructor(container) {
|
|
8
8
|
this.container = container;
|
|
9
|
-
const interactors = Utils_1.Plugins.getInteractors(container);
|
|
10
9
|
this.externalInteractors = [];
|
|
11
10
|
this.particleInteractors = [];
|
|
11
|
+
this.init();
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
const interactors = Utils_1.Plugins.getInteractors(this.container, true);
|
|
12
15
|
for (const interactor of interactors) {
|
|
13
16
|
switch (interactor.type) {
|
|
14
17
|
case Enums_1.InteractorType.External:
|
package/Core/Particles.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class Particles {
|
|
|
17
17
|
pushing?: boolean;
|
|
18
18
|
linksColor?: IRgb | string;
|
|
19
19
|
grabLineColor?: IRgb | string;
|
|
20
|
-
|
|
20
|
+
updaters: import("./Interfaces").IParticleUpdater[];
|
|
21
21
|
private interactionManager;
|
|
22
22
|
private nextId;
|
|
23
23
|
private readonly freqs;
|
package/Core/Particles.js
CHANGED
|
@@ -24,7 +24,7 @@ class Particles {
|
|
|
24
24
|
const canvasSize = this.container.canvas.size;
|
|
25
25
|
this.linksColors = new Map();
|
|
26
26
|
this.quadTree = new Utils_1.QuadTree(new Utils_1.Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
27
|
-
this.updaters = Utils_1.Plugins.getUpdaters(container);
|
|
27
|
+
this.updaters = Utils_1.Plugins.getUpdaters(container, true);
|
|
28
28
|
}
|
|
29
29
|
get count() {
|
|
30
30
|
return this.array.length;
|
|
@@ -38,6 +38,8 @@ class Particles {
|
|
|
38
38
|
this.freqs.links = new Map();
|
|
39
39
|
this.freqs.triangles = new Map();
|
|
40
40
|
let handled = false;
|
|
41
|
+
this.updaters = Utils_1.Plugins.getUpdaters(container, true);
|
|
42
|
+
this.interactionManager.init();
|
|
41
43
|
for (const [, plugin] of container.plugins) {
|
|
42
44
|
if (plugin.particlesInitialization !== undefined) {
|
|
43
45
|
handled = plugin.particlesInitialization();
|
package/Utils/Plugins.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export declare class Plugins {
|
|
|
15
15
|
static getSupportedShapes(): IterableIterator<string>;
|
|
16
16
|
static getPathGenerator(type: string): IMovePathGenerator | undefined;
|
|
17
17
|
static addPathGenerator(type: string, pathGenerator: IMovePathGenerator): void;
|
|
18
|
-
static getInteractors(container: Container): IInteractor[];
|
|
18
|
+
static getInteractors(container: Container, force?: boolean): IInteractor[];
|
|
19
19
|
static addInteractor(name: string, initInteractor: (container: Container) => IInteractor): void;
|
|
20
|
-
static getUpdaters(container: Container): IParticleUpdater[];
|
|
20
|
+
static getUpdaters(container: Container, force?: boolean): IParticleUpdater[];
|
|
21
21
|
static addParticleUpdater(name: string, initUpdater: (container: Container) => IParticleUpdater): void;
|
|
22
22
|
}
|
package/Utils/Plugins.js
CHANGED
|
@@ -60,9 +60,9 @@ class Plugins {
|
|
|
60
60
|
pathGenerators.set(type, pathGenerator);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
static getInteractors(container) {
|
|
63
|
+
static getInteractors(container, force = false) {
|
|
64
64
|
let res = interactors.get(container);
|
|
65
|
-
if (!res) {
|
|
65
|
+
if (!res || force) {
|
|
66
66
|
res = [...interactorsInitializers.values()].map((t) => t(container));
|
|
67
67
|
interactors.set(container, res);
|
|
68
68
|
}
|
|
@@ -71,9 +71,9 @@ class Plugins {
|
|
|
71
71
|
static addInteractor(name, initInteractor) {
|
|
72
72
|
interactorsInitializers.set(name, initInteractor);
|
|
73
73
|
}
|
|
74
|
-
static getUpdaters(container) {
|
|
74
|
+
static getUpdaters(container, force = false) {
|
|
75
75
|
let res = updaters.get(container);
|
|
76
|
-
if (!res) {
|
|
76
|
+
if (!res || force) {
|
|
77
77
|
res = [...updatersInitializers.values()].map((t) => t(container));
|
|
78
78
|
updaters.set(container, res);
|
|
79
79
|
}
|
|
@@ -9,6 +9,7 @@ export declare class InteractionManager {
|
|
|
9
9
|
private readonly externalInteractors;
|
|
10
10
|
private readonly particleInteractors;
|
|
11
11
|
constructor(container: Container);
|
|
12
|
+
init(): void;
|
|
12
13
|
externalInteract(delta: IDelta): void;
|
|
13
14
|
particlesInteract(particle: Particle, delta: IDelta): void;
|
|
14
15
|
}
|
|
@@ -6,9 +6,12 @@ import { InteractorType } from "../Enums";
|
|
|
6
6
|
export class InteractionManager {
|
|
7
7
|
constructor(container) {
|
|
8
8
|
this.container = container;
|
|
9
|
-
const interactors = Plugins.getInteractors(container);
|
|
10
9
|
this.externalInteractors = [];
|
|
11
10
|
this.particleInteractors = [];
|
|
11
|
+
this.init();
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
const interactors = Plugins.getInteractors(this.container, true);
|
|
12
15
|
for (const interactor of interactors) {
|
|
13
16
|
switch (interactor.type) {
|
|
14
17
|
case InteractorType.External:
|
|
@@ -27,7 +27,7 @@ export declare class Particles {
|
|
|
27
27
|
pushing?: boolean;
|
|
28
28
|
linksColor?: IRgb | string;
|
|
29
29
|
grabLineColor?: IRgb | string;
|
|
30
|
-
|
|
30
|
+
updaters: import("./Interfaces").IParticleUpdater[];
|
|
31
31
|
private interactionManager;
|
|
32
32
|
private nextId;
|
|
33
33
|
private readonly freqs;
|
|
@@ -25,7 +25,7 @@ export class Particles {
|
|
|
25
25
|
const canvasSize = this.container.canvas.size;
|
|
26
26
|
this.linksColors = new Map();
|
|
27
27
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
28
|
-
this.updaters = Plugins.getUpdaters(container);
|
|
28
|
+
this.updaters = Plugins.getUpdaters(container, true);
|
|
29
29
|
}
|
|
30
30
|
get count() {
|
|
31
31
|
return this.array.length;
|
|
@@ -40,6 +40,8 @@ export class Particles {
|
|
|
40
40
|
this.freqs.links = new Map();
|
|
41
41
|
this.freqs.triangles = new Map();
|
|
42
42
|
let handled = false;
|
|
43
|
+
this.updaters = Plugins.getUpdaters(container, true);
|
|
44
|
+
this.interactionManager.init();
|
|
43
45
|
for (const [, plugin] of container.plugins) {
|
|
44
46
|
if (plugin.particlesInitialization !== undefined) {
|
|
45
47
|
handled = plugin.particlesInitialization();
|
|
@@ -32,7 +32,7 @@ export async function loadPolygonMaskPlugin(tsParticles) {
|
|
|
32
32
|
if (!isSsr() && !window.SVGPathSeg) {
|
|
33
33
|
await import(
|
|
34
34
|
/* webpackChunkName: "tsparticles.pathseg" */
|
|
35
|
-
/* webpackMode: "
|
|
35
|
+
/* webpackMode: "weak" */
|
|
36
36
|
"./pathseg");
|
|
37
37
|
}
|
|
38
38
|
const plugin = new Plugin();
|
|
@@ -18,8 +18,8 @@ export declare class Plugins {
|
|
|
18
18
|
static getSupportedShapes(): IterableIterator<string>;
|
|
19
19
|
static getPathGenerator(type: string): IMovePathGenerator | undefined;
|
|
20
20
|
static addPathGenerator(type: string, pathGenerator: IMovePathGenerator): void;
|
|
21
|
-
static getInteractors(container: Container): IInteractor[];
|
|
21
|
+
static getInteractors(container: Container, force?: boolean): IInteractor[];
|
|
22
22
|
static addInteractor(name: string, initInteractor: (container: Container) => IInteractor): void;
|
|
23
|
-
static getUpdaters(container: Container): IParticleUpdater[];
|
|
23
|
+
static getUpdaters(container: Container, force?: boolean): IParticleUpdater[];
|
|
24
24
|
static addParticleUpdater(name: string, initUpdater: (container: Container) => IParticleUpdater): void;
|
|
25
25
|
}
|
package/browser/Utils/Plugins.js
CHANGED
|
@@ -60,9 +60,9 @@ export class Plugins {
|
|
|
60
60
|
pathGenerators.set(type, pathGenerator);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
static getInteractors(container) {
|
|
63
|
+
static getInteractors(container, force = false) {
|
|
64
64
|
let res = interactors.get(container);
|
|
65
|
-
if (!res) {
|
|
65
|
+
if (!res || force) {
|
|
66
66
|
res = [...interactorsInitializers.values()].map((t) => t(container));
|
|
67
67
|
interactors.set(container, res);
|
|
68
68
|
}
|
|
@@ -71,9 +71,9 @@ export class Plugins {
|
|
|
71
71
|
static addInteractor(name, initInteractor) {
|
|
72
72
|
interactorsInitializers.set(name, initInteractor);
|
|
73
73
|
}
|
|
74
|
-
static getUpdaters(container) {
|
|
74
|
+
static getUpdaters(container, force = false) {
|
|
75
75
|
let res = updaters.get(container);
|
|
76
|
-
if (!res) {
|
|
76
|
+
if (!res || force) {
|
|
77
77
|
res = [...updatersInitializers.values()].map((t) => t(container));
|
|
78
78
|
updaters.set(container, res);
|
|
79
79
|
}
|
|
@@ -6,6 +6,7 @@ export declare class InteractionManager {
|
|
|
6
6
|
private readonly externalInteractors;
|
|
7
7
|
private readonly particleInteractors;
|
|
8
8
|
constructor(container: Container);
|
|
9
|
+
init(): void;
|
|
9
10
|
externalInteract(delta: IDelta): void;
|
|
10
11
|
particlesInteract(particle: Particle, delta: IDelta): void;
|
|
11
12
|
}
|
|
@@ -3,9 +3,12 @@ import { InteractorType } from "../Enums";
|
|
|
3
3
|
export class InteractionManager {
|
|
4
4
|
constructor(container) {
|
|
5
5
|
this.container = container;
|
|
6
|
-
const interactors = Plugins.getInteractors(container);
|
|
7
6
|
this.externalInteractors = [];
|
|
8
7
|
this.particleInteractors = [];
|
|
8
|
+
this.init();
|
|
9
|
+
}
|
|
10
|
+
init() {
|
|
11
|
+
const interactors = Plugins.getInteractors(this.container, true);
|
|
9
12
|
for (const interactor of interactors) {
|
|
10
13
|
switch (interactor.type) {
|
|
11
14
|
case InteractorType.External:
|
package/esm/Core/Particles.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class Particles {
|
|
|
17
17
|
pushing?: boolean;
|
|
18
18
|
linksColor?: IRgb | string;
|
|
19
19
|
grabLineColor?: IRgb | string;
|
|
20
|
-
|
|
20
|
+
updaters: import("./Interfaces").IParticleUpdater[];
|
|
21
21
|
private interactionManager;
|
|
22
22
|
private nextId;
|
|
23
23
|
private readonly freqs;
|
package/esm/Core/Particles.js
CHANGED
|
@@ -21,7 +21,7 @@ export class Particles {
|
|
|
21
21
|
const canvasSize = this.container.canvas.size;
|
|
22
22
|
this.linksColors = new Map();
|
|
23
23
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
24
|
-
this.updaters = Plugins.getUpdaters(container);
|
|
24
|
+
this.updaters = Plugins.getUpdaters(container, true);
|
|
25
25
|
}
|
|
26
26
|
get count() {
|
|
27
27
|
return this.array.length;
|
|
@@ -35,6 +35,8 @@ export class Particles {
|
|
|
35
35
|
this.freqs.links = new Map();
|
|
36
36
|
this.freqs.triangles = new Map();
|
|
37
37
|
let handled = false;
|
|
38
|
+
this.updaters = Plugins.getUpdaters(container, true);
|
|
39
|
+
this.interactionManager.init();
|
|
38
40
|
for (const [, plugin] of container.plugins) {
|
|
39
41
|
if (plugin.particlesInitialization !== undefined) {
|
|
40
42
|
handled = plugin.particlesInitialization();
|
package/esm/Utils/Plugins.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export declare class Plugins {
|
|
|
15
15
|
static getSupportedShapes(): IterableIterator<string>;
|
|
16
16
|
static getPathGenerator(type: string): IMovePathGenerator | undefined;
|
|
17
17
|
static addPathGenerator(type: string, pathGenerator: IMovePathGenerator): void;
|
|
18
|
-
static getInteractors(container: Container): IInteractor[];
|
|
18
|
+
static getInteractors(container: Container, force?: boolean): IInteractor[];
|
|
19
19
|
static addInteractor(name: string, initInteractor: (container: Container) => IInteractor): void;
|
|
20
|
-
static getUpdaters(container: Container): IParticleUpdater[];
|
|
20
|
+
static getUpdaters(container: Container, force?: boolean): IParticleUpdater[];
|
|
21
21
|
static addParticleUpdater(name: string, initUpdater: (container: Container) => IParticleUpdater): void;
|
|
22
22
|
}
|
package/esm/Utils/Plugins.js
CHANGED
|
@@ -57,9 +57,9 @@ export class Plugins {
|
|
|
57
57
|
pathGenerators.set(type, pathGenerator);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
static getInteractors(container) {
|
|
60
|
+
static getInteractors(container, force = false) {
|
|
61
61
|
let res = interactors.get(container);
|
|
62
|
-
if (!res) {
|
|
62
|
+
if (!res || force) {
|
|
63
63
|
res = [...interactorsInitializers.values()].map((t) => t(container));
|
|
64
64
|
interactors.set(container, res);
|
|
65
65
|
}
|
|
@@ -68,9 +68,9 @@ export class Plugins {
|
|
|
68
68
|
static addInteractor(name, initInteractor) {
|
|
69
69
|
interactorsInitializers.set(name, initInteractor);
|
|
70
70
|
}
|
|
71
|
-
static getUpdaters(container) {
|
|
71
|
+
static getUpdaters(container, force = false) {
|
|
72
72
|
let res = updaters.get(container);
|
|
73
|
-
if (!res) {
|
|
73
|
+
if (!res || force) {
|
|
74
74
|
res = [...updatersInitializers.values()].map((t) => t(container));
|
|
75
75
|
updaters.set(container, res);
|
|
76
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsparticles",
|
|
3
|
-
"version": "1.37.
|
|
3
|
+
"version": "1.37.1",
|
|
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
|
"scripts": {
|