tsparticles 1.36.0 → 1.37.3
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/Container.d.ts +3 -1
- package/Core/Container.js +16 -11
- 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/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/Enums/Modes/ResponsiveMode.js +8 -0
- package/Enums/Modes/index.d.ts +1 -0
- package/Enums/Modes/index.js +1 -0
- package/Interactions/External/Attract/index.d.ts +1 -1
- package/Interactions/External/Attract/index.js +2 -2
- package/Interactions/External/Bounce/index.d.ts +1 -1
- package/Interactions/External/Bounce/index.js +2 -2
- package/Interactions/External/Bubble/index.d.ts +1 -1
- package/Interactions/External/Bubble/index.js +2 -2
- package/Interactions/External/Connect/index.d.ts +1 -1
- package/Interactions/External/Connect/index.js +2 -2
- package/Interactions/External/Grab/index.d.ts +1 -1
- package/Interactions/External/Grab/index.js +2 -2
- package/Interactions/External/Repulse/index.d.ts +1 -1
- package/Interactions/External/Repulse/index.js +2 -2
- package/Interactions/External/Trail/index.d.ts +1 -1
- package/Interactions/External/Trail/index.js +2 -2
- package/Interactions/Particles/Attract/index.d.ts +1 -1
- package/Interactions/Particles/Attract/index.js +2 -2
- package/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/Interactions/Particles/Collisions/index.js +2 -2
- package/Interactions/Particles/Links/index.d.ts +2 -2
- package/Interactions/Particles/Links/index.js +5 -5
- package/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/Interactions/Particles/Links/plugin.js +2 -2
- package/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/Options/Classes/Options.js +3 -1
- package/Options/Classes/Responsive.d.ts +2 -0
- package/Options/Classes/Responsive.js +10 -0
- package/Options/Interfaces/IResponsive.d.ts +2 -0
- package/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +21 -0
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +2 -0
- package/Plugins/Absorbers/plugin.d.ts +1 -1
- package/Plugins/Absorbers/plugin.js +2 -2
- package/Plugins/Emitters/plugin.d.ts +1 -1
- package/Plugins/Emitters/plugin.js +2 -2
- package/Plugins/PolygonMask/plugin.js +1 -1
- package/Shapes/Circle/index.d.ts +1 -1
- package/Shapes/Circle/index.js +2 -2
- package/Shapes/Image/index.d.ts +1 -1
- package/Shapes/Image/index.js +3 -3
- package/Shapes/Line/index.d.ts +1 -1
- package/Shapes/Line/index.js +2 -2
- package/Shapes/Polygon/index.d.ts +3 -3
- package/Shapes/Polygon/index.js +7 -7
- package/Shapes/Square/index.d.ts +1 -1
- package/Shapes/Square/index.js +3 -3
- package/Shapes/Star/index.d.ts +1 -1
- package/Shapes/Star/index.js +2 -2
- package/Shapes/Text/index.d.ts +1 -1
- package/Shapes/Text/index.js +2 -2
- package/Updaters/Angle/index.d.ts +1 -1
- package/Updaters/Angle/index.js +2 -2
- package/Updaters/Color/index.d.ts +1 -1
- package/Updaters/Color/index.js +2 -2
- package/Updaters/Life/index.d.ts +1 -1
- package/Updaters/Life/index.js +2 -2
- package/Updaters/Opacity/index.d.ts +1 -1
- package/Updaters/Opacity/index.js +2 -2
- package/Updaters/OutModes/index.d.ts +1 -1
- package/Updaters/OutModes/index.js +2 -2
- package/Updaters/Roll/index.d.ts +1 -1
- package/Updaters/Roll/index.js +2 -2
- package/Updaters/Size/index.d.ts +1 -1
- package/Updaters/Size/index.js +2 -2
- package/Updaters/StrokeColor/index.d.ts +1 -1
- package/Updaters/StrokeColor/index.js +2 -2
- package/Updaters/Tilt/index.d.ts +1 -1
- package/Updaters/Tilt/index.js +2 -2
- package/Updaters/Wobble/index.d.ts +1 -1
- package/Updaters/Wobble/index.js +2 -2
- package/Utils/Plugins.d.ts +2 -2
- package/Utils/Plugins.js +4 -4
- package/Utils/Utils.d.ts +1 -2
- package/browser/Core/Container.d.ts +3 -1
- package/browser/Core/Container.js +17 -12
- 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/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/browser/Enums/Modes/ResponsiveMode.js +5 -0
- package/browser/Enums/Modes/index.d.ts +1 -0
- package/browser/Enums/Modes/index.js +1 -0
- package/browser/Interactions/External/Attract/index.d.ts +1 -1
- package/browser/Interactions/External/Attract/index.js +2 -2
- package/browser/Interactions/External/Bounce/index.d.ts +1 -1
- package/browser/Interactions/External/Bounce/index.js +2 -2
- package/browser/Interactions/External/Bubble/index.d.ts +1 -1
- package/browser/Interactions/External/Bubble/index.js +2 -2
- package/browser/Interactions/External/Connect/index.d.ts +1 -1
- package/browser/Interactions/External/Connect/index.js +2 -2
- package/browser/Interactions/External/Grab/index.d.ts +1 -1
- package/browser/Interactions/External/Grab/index.js +2 -2
- package/browser/Interactions/External/Repulse/index.d.ts +1 -1
- package/browser/Interactions/External/Repulse/index.js +2 -2
- package/browser/Interactions/External/Trail/index.d.ts +1 -1
- package/browser/Interactions/External/Trail/index.js +2 -2
- package/browser/Interactions/Particles/Attract/index.d.ts +1 -1
- package/browser/Interactions/Particles/Attract/index.js +2 -2
- package/browser/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/browser/Interactions/Particles/Collisions/index.js +2 -2
- package/browser/Interactions/Particles/Links/index.d.ts +2 -2
- package/browser/Interactions/Particles/Links/index.js +5 -5
- package/browser/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/browser/Interactions/Particles/Links/plugin.js +2 -2
- package/browser/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/browser/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/browser/Options/Classes/Options.js +4 -2
- package/browser/Options/Classes/Responsive.d.ts +2 -0
- package/browser/Options/Classes/Responsive.js +11 -0
- package/browser/Options/Interfaces/IResponsive.d.ts +2 -0
- package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/browser/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
- package/browser/Plugins/Absorbers/plugin.d.ts +1 -1
- package/browser/Plugins/Absorbers/plugin.js +2 -2
- package/browser/Plugins/Emitters/plugin.d.ts +1 -1
- package/browser/Plugins/Emitters/plugin.js +2 -2
- package/browser/Plugins/PolygonMask/plugin.js +4 -2
- package/browser/Shapes/Circle/index.d.ts +1 -1
- package/browser/Shapes/Circle/index.js +2 -2
- package/browser/Shapes/Image/index.d.ts +1 -1
- package/browser/Shapes/Image/index.js +3 -3
- package/browser/Shapes/Line/index.d.ts +1 -1
- package/browser/Shapes/Line/index.js +2 -2
- package/browser/Shapes/Polygon/index.d.ts +3 -3
- package/browser/Shapes/Polygon/index.js +7 -7
- package/browser/Shapes/Square/index.d.ts +1 -1
- package/browser/Shapes/Square/index.js +3 -3
- package/browser/Shapes/Star/index.d.ts +1 -1
- package/browser/Shapes/Star/index.js +2 -2
- package/browser/Shapes/Text/index.d.ts +1 -1
- package/browser/Shapes/Text/index.js +2 -2
- package/browser/Updaters/Angle/index.d.ts +1 -1
- package/browser/Updaters/Angle/index.js +2 -2
- package/browser/Updaters/Color/index.d.ts +1 -1
- package/browser/Updaters/Color/index.js +2 -2
- package/browser/Updaters/Life/index.d.ts +1 -1
- package/browser/Updaters/Life/index.js +2 -2
- package/browser/Updaters/Opacity/index.d.ts +1 -1
- package/browser/Updaters/Opacity/index.js +2 -2
- package/browser/Updaters/OutModes/index.d.ts +1 -1
- package/browser/Updaters/OutModes/index.js +2 -2
- package/browser/Updaters/Roll/index.d.ts +1 -1
- package/browser/Updaters/Roll/index.js +2 -2
- package/browser/Updaters/Size/index.d.ts +1 -1
- package/browser/Updaters/Size/index.js +2 -2
- package/browser/Updaters/StrokeColor/index.d.ts +1 -1
- package/browser/Updaters/StrokeColor/index.js +2 -2
- package/browser/Updaters/Tilt/index.d.ts +1 -1
- package/browser/Updaters/Tilt/index.js +2 -2
- package/browser/Updaters/Wobble/index.d.ts +1 -1
- package/browser/Updaters/Wobble/index.js +2 -2
- package/browser/Utils/Plugins.d.ts +2 -2
- package/browser/Utils/Plugins.js +4 -4
- package/browser/Utils/Utils.d.ts +1 -2
- package/browser/full.d.ts +1 -1
- package/browser/full.js +9 -9
- package/browser/index.js +1 -1
- package/browser/index.slim.js +1 -1
- package/browser/main.d.ts +10 -6
- package/browser/main.js +20 -6
- package/browser/slim.d.ts +1 -1
- package/browser/slim.js +24 -24
- package/esm/Core/Container.d.ts +3 -1
- package/esm/Core/Container.js +16 -11
- 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/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/esm/Enums/Modes/ResponsiveMode.js +5 -0
- package/esm/Enums/Modes/index.d.ts +1 -0
- package/esm/Enums/Modes/index.js +1 -0
- package/esm/Interactions/External/Attract/index.d.ts +1 -1
- package/esm/Interactions/External/Attract/index.js +2 -2
- package/esm/Interactions/External/Bounce/index.d.ts +1 -1
- package/esm/Interactions/External/Bounce/index.js +2 -2
- package/esm/Interactions/External/Bubble/index.d.ts +1 -1
- package/esm/Interactions/External/Bubble/index.js +2 -2
- package/esm/Interactions/External/Connect/index.d.ts +1 -1
- package/esm/Interactions/External/Connect/index.js +2 -2
- package/esm/Interactions/External/Grab/index.d.ts +1 -1
- package/esm/Interactions/External/Grab/index.js +2 -2
- package/esm/Interactions/External/Repulse/index.d.ts +1 -1
- package/esm/Interactions/External/Repulse/index.js +2 -2
- package/esm/Interactions/External/Trail/index.d.ts +1 -1
- package/esm/Interactions/External/Trail/index.js +2 -2
- package/esm/Interactions/Particles/Attract/index.d.ts +1 -1
- package/esm/Interactions/Particles/Attract/index.js +2 -2
- package/esm/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/esm/Interactions/Particles/Collisions/index.js +2 -2
- package/esm/Interactions/Particles/Links/index.d.ts +2 -2
- package/esm/Interactions/Particles/Links/index.js +5 -5
- package/esm/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/esm/Interactions/Particles/Links/plugin.js +2 -2
- package/esm/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/esm/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/esm/Options/Classes/Options.js +4 -2
- package/esm/Options/Classes/Responsive.d.ts +2 -0
- package/esm/Options/Classes/Responsive.js +10 -0
- package/esm/Options/Interfaces/IResponsive.d.ts +2 -0
- package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
- package/esm/Plugins/Absorbers/AbsorberInstance.js +21 -9
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
- package/esm/Plugins/Absorbers/plugin.d.ts +1 -1
- package/esm/Plugins/Absorbers/plugin.js +2 -2
- package/esm/Plugins/Emitters/plugin.d.ts +1 -1
- package/esm/Plugins/Emitters/plugin.js +2 -2
- package/esm/Plugins/PolygonMask/plugin.js +1 -1
- package/esm/Shapes/Circle/index.d.ts +1 -1
- package/esm/Shapes/Circle/index.js +2 -2
- package/esm/Shapes/Image/index.d.ts +1 -1
- package/esm/Shapes/Image/index.js +3 -3
- package/esm/Shapes/Line/index.d.ts +1 -1
- package/esm/Shapes/Line/index.js +2 -2
- package/esm/Shapes/Polygon/index.d.ts +3 -3
- package/esm/Shapes/Polygon/index.js +7 -7
- package/esm/Shapes/Square/index.d.ts +1 -1
- package/esm/Shapes/Square/index.js +3 -3
- package/esm/Shapes/Star/index.d.ts +1 -1
- package/esm/Shapes/Star/index.js +2 -2
- package/esm/Shapes/Text/index.d.ts +1 -1
- package/esm/Shapes/Text/index.js +2 -2
- package/esm/Updaters/Angle/index.d.ts +1 -1
- package/esm/Updaters/Angle/index.js +2 -2
- package/esm/Updaters/Color/index.d.ts +1 -1
- package/esm/Updaters/Color/index.js +2 -2
- package/esm/Updaters/Life/index.d.ts +1 -1
- package/esm/Updaters/Life/index.js +2 -2
- package/esm/Updaters/Opacity/index.d.ts +1 -1
- package/esm/Updaters/Opacity/index.js +2 -2
- package/esm/Updaters/OutModes/index.d.ts +1 -1
- package/esm/Updaters/OutModes/index.js +2 -2
- package/esm/Updaters/Roll/index.d.ts +1 -1
- package/esm/Updaters/Roll/index.js +2 -2
- package/esm/Updaters/Size/index.d.ts +1 -1
- package/esm/Updaters/Size/index.js +2 -2
- package/esm/Updaters/StrokeColor/index.d.ts +1 -1
- package/esm/Updaters/StrokeColor/index.js +2 -2
- package/esm/Updaters/Tilt/index.d.ts +1 -1
- package/esm/Updaters/Tilt/index.js +2 -2
- package/esm/Updaters/Wobble/index.d.ts +1 -1
- package/esm/Updaters/Wobble/index.js +2 -2
- package/esm/Utils/Plugins.d.ts +2 -2
- package/esm/Utils/Plugins.js +4 -4
- package/esm/Utils/Utils.d.ts +1 -2
- package/esm/full.d.ts +1 -1
- package/esm/full.js +9 -9
- package/esm/index.js +1 -1
- package/esm/index.slim.js +1 -1
- package/esm/main.d.ts +7 -6
- package/esm/main.js +17 -6
- package/esm/slim.d.ts +1 -1
- package/esm/slim.js +24 -24
- package/full.d.ts +1 -1
- package/full.js +9 -9
- package/index.js +1 -1
- package/index.slim.js +1 -1
- package/main.d.ts +7 -6
- package/main.js +17 -6
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/slim.d.ts +1 -1
- package/slim.js +24 -24
- package/tsparticles.js +743 -363
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.js +2 -2
- package/tsparticles.slim.js +539 -284
- package/tsparticles.slim.min.js +2 -2
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/esm/Utils/Utils.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { IBounds, ICircleBouncer, ICoordinates, IDimension, IParticle } from "../Core/Interfaces";
|
|
2
|
-
import { DivMode } from "../Enums";
|
|
2
|
+
import { DivMode, OutModeDirection } from "../Enums";
|
|
3
3
|
import type { ICharacterShape } from "../Options/Interfaces/Particles/Shape/ICharacterShape";
|
|
4
4
|
import type { SingleOrMultiple } from "../Types";
|
|
5
5
|
import { DivEvent } from "../Options/Classes/Interactivity/Events/DivEvent";
|
|
6
6
|
import type { IModeDiv } from "../Options/Interfaces/Interactivity/Modes/IModeDiv";
|
|
7
|
-
import { OutModeDirection } from "../Enums";
|
|
8
7
|
declare global {
|
|
9
8
|
interface Window {
|
|
10
9
|
customRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
package/esm/full.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "./main";
|
|
2
|
-
export declare function loadFull(tsParticles: Main): void
|
|
2
|
+
export declare function loadFull(tsParticles: Main): Promise<void>;
|
package/esm/full.js
CHANGED
|
@@ -6,13 +6,13 @@ import { loadAbsorbersPlugin } from "./Plugins/Absorbers/plugin";
|
|
|
6
6
|
import { loadEmittersPlugin } from "./Plugins/Emitters/plugin";
|
|
7
7
|
import { loadPolygonMaskPlugin } from "./Plugins/PolygonMask/plugin";
|
|
8
8
|
import { loadRollUpdater } from "./Updaters/Roll";
|
|
9
|
-
export function loadFull(tsParticles) {
|
|
10
|
-
loadSlim(tsParticles);
|
|
11
|
-
loadExternalTrailInteraction(tsParticles);
|
|
12
|
-
loadRollUpdater(tsParticles);
|
|
13
|
-
loadTiltUpdater(tsParticles);
|
|
14
|
-
loadWobbleUpdater(tsParticles);
|
|
15
|
-
loadAbsorbersPlugin(tsParticles);
|
|
16
|
-
loadEmittersPlugin(tsParticles);
|
|
17
|
-
loadPolygonMaskPlugin(tsParticles);
|
|
9
|
+
export async function loadFull(tsParticles) {
|
|
10
|
+
await loadSlim(tsParticles);
|
|
11
|
+
await loadExternalTrailInteraction(tsParticles);
|
|
12
|
+
await loadRollUpdater(tsParticles);
|
|
13
|
+
await loadTiltUpdater(tsParticles);
|
|
14
|
+
await loadWobbleUpdater(tsParticles);
|
|
15
|
+
await loadAbsorbersPlugin(tsParticles);
|
|
16
|
+
await loadEmittersPlugin(tsParticles);
|
|
17
|
+
await loadPolygonMaskPlugin(tsParticles);
|
|
18
18
|
}
|
package/esm/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { Circle, CircleWarp, Constants, Point, Rectangle } from "./Utils";
|
|
|
4
4
|
import { loadFull } from "./full";
|
|
5
5
|
const tsParticles = new Main();
|
|
6
6
|
tsParticles.init();
|
|
7
|
-
loadFull(tsParticles);
|
|
8
7
|
const { particlesJS, pJSDom } = initPjs(tsParticles);
|
|
8
|
+
loadFull(tsParticles);
|
|
9
9
|
export * from "./Core/Particle/Vector";
|
|
10
10
|
export * from "./Core/Container";
|
|
11
11
|
export * from "./Enums";
|
package/esm/index.slim.js
CHANGED
|
@@ -4,8 +4,8 @@ import { Main } from "./main";
|
|
|
4
4
|
import { loadSlim } from "./slim";
|
|
5
5
|
const tsParticles = new Main();
|
|
6
6
|
tsParticles.init();
|
|
7
|
-
loadSlim(tsParticles);
|
|
8
7
|
const { particlesJS, pJSDom } = initPjs(tsParticles);
|
|
8
|
+
loadSlim(tsParticles);
|
|
9
9
|
export * from "./Core/Particle/Vector";
|
|
10
10
|
export * from "./Core/Container";
|
|
11
11
|
export * from "./Enums";
|
package/esm/main.d.ts
CHANGED
|
@@ -15,10 +15,11 @@ export declare class Main {
|
|
|
15
15
|
setOnClickHandler(callback: (e: Event, particles?: Particle[]) => void): void;
|
|
16
16
|
dom(): Container[];
|
|
17
17
|
domItem(index: number): Container | undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
refresh(): Promise<void>;
|
|
19
|
+
addShape(shape: string, drawer: IShapeDrawer | ShapeDrawerDrawFunction, init?: ShapeDrawerInitFunction, afterEffect?: ShapeDrawerAfterEffectFunction, destroy?: ShapeDrawerDestroyFunction): Promise<void>;
|
|
20
|
+
addPreset(preset: string, options: RecursivePartial<IOptions>, override?: boolean): Promise<void>;
|
|
21
|
+
addPlugin(plugin: IPlugin): Promise<void>;
|
|
22
|
+
addPathGenerator(name: string, generator: IMovePathGenerator): Promise<void>;
|
|
23
|
+
addInteractor(name: string, interactorInitializer: (container: Container) => IInteractor): Promise<void>;
|
|
24
|
+
addParticleUpdater(name: string, updaterInitializer: (container: Container) => IParticleUpdater): Promise<void>;
|
|
24
25
|
}
|
package/esm/main.js
CHANGED
|
@@ -46,7 +46,12 @@ export class Main {
|
|
|
46
46
|
domItem(index) {
|
|
47
47
|
return Loader.domItem(index);
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
async refresh() {
|
|
50
|
+
for (const instance of this.dom()) {
|
|
51
|
+
await instance.refresh();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async addShape(shape, drawer, init, afterEffect, destroy) {
|
|
50
55
|
let customDrawer;
|
|
51
56
|
if (typeof drawer === "function") {
|
|
52
57
|
customDrawer = {
|
|
@@ -60,21 +65,27 @@ export class Main {
|
|
|
60
65
|
customDrawer = drawer;
|
|
61
66
|
}
|
|
62
67
|
Plugins.addShapeDrawer(shape, customDrawer);
|
|
68
|
+
await this.refresh();
|
|
63
69
|
}
|
|
64
|
-
addPreset(preset, options, override = false) {
|
|
70
|
+
async addPreset(preset, options, override = false) {
|
|
65
71
|
Plugins.addPreset(preset, options, override);
|
|
72
|
+
await this.refresh();
|
|
66
73
|
}
|
|
67
|
-
addPlugin(plugin) {
|
|
74
|
+
async addPlugin(plugin) {
|
|
68
75
|
Plugins.addPlugin(plugin);
|
|
76
|
+
await this.refresh();
|
|
69
77
|
}
|
|
70
|
-
addPathGenerator(name, generator) {
|
|
78
|
+
async addPathGenerator(name, generator) {
|
|
71
79
|
Plugins.addPathGenerator(name, generator);
|
|
80
|
+
await this.refresh();
|
|
72
81
|
}
|
|
73
|
-
addInteractor(name, interactorInitializer) {
|
|
82
|
+
async addInteractor(name, interactorInitializer) {
|
|
74
83
|
Plugins.addInteractor(name, interactorInitializer);
|
|
84
|
+
await this.refresh();
|
|
75
85
|
}
|
|
76
|
-
addParticleUpdater(name, updaterInitializer) {
|
|
86
|
+
async addParticleUpdater(name, updaterInitializer) {
|
|
77
87
|
Plugins.addParticleUpdater(name, updaterInitializer);
|
|
88
|
+
await this.refresh();
|
|
78
89
|
}
|
|
79
90
|
}
|
|
80
91
|
_Main_initialized = new WeakMap();
|
package/esm/slim.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "./main";
|
|
2
|
-
export declare function loadSlim(tsParticles: Main): void
|
|
2
|
+
export declare function loadSlim(tsParticles: Main): Promise<void>;
|
package/esm/slim.js
CHANGED
|
@@ -21,28 +21,28 @@ import { loadExternalBounceInteraction } from "./Interactions/External/Bounce";
|
|
|
21
21
|
import { loadTextShape } from "./Shapes/Text";
|
|
22
22
|
import { loadParticlesLinksInteraction } from "./Interactions/Particles/Links";
|
|
23
23
|
import { loadSizeUpdater } from "./Updaters/Size";
|
|
24
|
-
export function loadSlim(tsParticles) {
|
|
25
|
-
loadExternalAttractInteraction(tsParticles);
|
|
26
|
-
loadExternalBounceInteraction(tsParticles);
|
|
27
|
-
loadExternalBubbleInteraction(tsParticles);
|
|
28
|
-
loadExternalConnectInteraction(tsParticles);
|
|
29
|
-
loadExternalGrabInteraction(tsParticles);
|
|
30
|
-
loadExternalRepulseInteraction(tsParticles);
|
|
31
|
-
loadParticlesAttractInteraction(tsParticles);
|
|
32
|
-
loadParticlesCollisionsInteraction(tsParticles);
|
|
33
|
-
loadParticlesLinksInteraction(tsParticles);
|
|
34
|
-
loadCircleShape(tsParticles);
|
|
35
|
-
loadImageShape(tsParticles);
|
|
36
|
-
loadLineShape(tsParticles);
|
|
37
|
-
loadPolygonShape(tsParticles);
|
|
38
|
-
loadSquareShape(tsParticles);
|
|
39
|
-
loadStarShape(tsParticles);
|
|
40
|
-
loadTextShape(tsParticles);
|
|
41
|
-
loadLifeUpdater(tsParticles);
|
|
42
|
-
loadOpacityUpdater(tsParticles);
|
|
43
|
-
loadSizeUpdater(tsParticles);
|
|
44
|
-
loadAngleUpdater(tsParticles);
|
|
45
|
-
loadColorUpdater(tsParticles);
|
|
46
|
-
loadStrokeColorUpdater(tsParticles);
|
|
47
|
-
loadOutModesUpdater(tsParticles);
|
|
24
|
+
export async function loadSlim(tsParticles) {
|
|
25
|
+
await loadExternalAttractInteraction(tsParticles);
|
|
26
|
+
await loadExternalBounceInteraction(tsParticles);
|
|
27
|
+
await loadExternalBubbleInteraction(tsParticles);
|
|
28
|
+
await loadExternalConnectInteraction(tsParticles);
|
|
29
|
+
await loadExternalGrabInteraction(tsParticles);
|
|
30
|
+
await loadExternalRepulseInteraction(tsParticles);
|
|
31
|
+
await loadParticlesAttractInteraction(tsParticles);
|
|
32
|
+
await loadParticlesCollisionsInteraction(tsParticles);
|
|
33
|
+
await loadParticlesLinksInteraction(tsParticles);
|
|
34
|
+
await loadCircleShape(tsParticles);
|
|
35
|
+
await loadImageShape(tsParticles);
|
|
36
|
+
await loadLineShape(tsParticles);
|
|
37
|
+
await loadPolygonShape(tsParticles);
|
|
38
|
+
await loadSquareShape(tsParticles);
|
|
39
|
+
await loadStarShape(tsParticles);
|
|
40
|
+
await loadTextShape(tsParticles);
|
|
41
|
+
await loadLifeUpdater(tsParticles);
|
|
42
|
+
await loadOpacityUpdater(tsParticles);
|
|
43
|
+
await loadSizeUpdater(tsParticles);
|
|
44
|
+
await loadAngleUpdater(tsParticles);
|
|
45
|
+
await loadColorUpdater(tsParticles);
|
|
46
|
+
await loadStrokeColorUpdater(tsParticles);
|
|
47
|
+
await loadOutModesUpdater(tsParticles);
|
|
48
48
|
}
|
package/full.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "./main";
|
|
2
|
-
export declare function loadFull(tsParticles: Main): void
|
|
2
|
+
export declare function loadFull(tsParticles: Main): Promise<void>;
|
package/full.js
CHANGED
|
@@ -9,14 +9,14 @@ const plugin_1 = require("./Plugins/Absorbers/plugin");
|
|
|
9
9
|
const plugin_2 = require("./Plugins/Emitters/plugin");
|
|
10
10
|
const plugin_3 = require("./Plugins/PolygonMask/plugin");
|
|
11
11
|
const Roll_1 = require("./Updaters/Roll");
|
|
12
|
-
function loadFull(tsParticles) {
|
|
13
|
-
(0, slim_1.loadSlim)(tsParticles);
|
|
14
|
-
(0, Trail_1.loadExternalTrailInteraction)(tsParticles);
|
|
15
|
-
(0, Roll_1.loadRollUpdater)(tsParticles);
|
|
16
|
-
(0, Tilt_1.loadTiltUpdater)(tsParticles);
|
|
17
|
-
(0, Wobble_1.loadWobbleUpdater)(tsParticles);
|
|
18
|
-
(0, plugin_1.loadAbsorbersPlugin)(tsParticles);
|
|
19
|
-
(0, plugin_2.loadEmittersPlugin)(tsParticles);
|
|
20
|
-
(0, plugin_3.loadPolygonMaskPlugin)(tsParticles);
|
|
12
|
+
async function loadFull(tsParticles) {
|
|
13
|
+
await (0, slim_1.loadSlim)(tsParticles);
|
|
14
|
+
await (0, Trail_1.loadExternalTrailInteraction)(tsParticles);
|
|
15
|
+
await (0, Roll_1.loadRollUpdater)(tsParticles);
|
|
16
|
+
await (0, Tilt_1.loadTiltUpdater)(tsParticles);
|
|
17
|
+
await (0, Wobble_1.loadWobbleUpdater)(tsParticles);
|
|
18
|
+
await (0, plugin_1.loadAbsorbersPlugin)(tsParticles);
|
|
19
|
+
await (0, plugin_2.loadEmittersPlugin)(tsParticles);
|
|
20
|
+
await (0, plugin_3.loadPolygonMaskPlugin)(tsParticles);
|
|
21
21
|
}
|
|
22
22
|
exports.loadFull = loadFull;
|
package/index.js
CHANGED
|
@@ -24,10 +24,10 @@ const full_1 = require("./full");
|
|
|
24
24
|
const tsParticles = new main_1.Main();
|
|
25
25
|
exports.tsParticles = tsParticles;
|
|
26
26
|
tsParticles.init();
|
|
27
|
-
(0, full_1.loadFull)(tsParticles);
|
|
28
27
|
const { particlesJS, pJSDom } = (0, pjs_1.initPjs)(tsParticles);
|
|
29
28
|
exports.particlesJS = particlesJS;
|
|
30
29
|
exports.pJSDom = pJSDom;
|
|
30
|
+
(0, full_1.loadFull)(tsParticles);
|
|
31
31
|
__exportStar(require("./Core/Particle/Vector"), exports);
|
|
32
32
|
__exportStar(require("./Core/Container"), exports);
|
|
33
33
|
__exportStar(require("./Enums"), exports);
|
package/index.slim.js
CHANGED
|
@@ -24,10 +24,10 @@ const slim_1 = require("./slim");
|
|
|
24
24
|
const tsParticles = new main_1.Main();
|
|
25
25
|
exports.tsParticles = tsParticles;
|
|
26
26
|
tsParticles.init();
|
|
27
|
-
(0, slim_1.loadSlim)(tsParticles);
|
|
28
27
|
const { particlesJS, pJSDom } = (0, pjs_1.initPjs)(tsParticles);
|
|
29
28
|
exports.particlesJS = particlesJS;
|
|
30
29
|
exports.pJSDom = pJSDom;
|
|
30
|
+
(0, slim_1.loadSlim)(tsParticles);
|
|
31
31
|
__exportStar(require("./Core/Particle/Vector"), exports);
|
|
32
32
|
__exportStar(require("./Core/Container"), exports);
|
|
33
33
|
__exportStar(require("./Enums"), exports);
|
package/main.d.ts
CHANGED
|
@@ -15,10 +15,11 @@ export declare class Main {
|
|
|
15
15
|
setOnClickHandler(callback: (e: Event, particles?: Particle[]) => void): void;
|
|
16
16
|
dom(): Container[];
|
|
17
17
|
domItem(index: number): Container | undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
refresh(): Promise<void>;
|
|
19
|
+
addShape(shape: string, drawer: IShapeDrawer | ShapeDrawerDrawFunction, init?: ShapeDrawerInitFunction, afterEffect?: ShapeDrawerAfterEffectFunction, destroy?: ShapeDrawerDestroyFunction): Promise<void>;
|
|
20
|
+
addPreset(preset: string, options: RecursivePartial<IOptions>, override?: boolean): Promise<void>;
|
|
21
|
+
addPlugin(plugin: IPlugin): Promise<void>;
|
|
22
|
+
addPathGenerator(name: string, generator: IMovePathGenerator): Promise<void>;
|
|
23
|
+
addInteractor(name: string, interactorInitializer: (container: Container) => IInteractor): Promise<void>;
|
|
24
|
+
addParticleUpdater(name: string, updaterInitializer: (container: Container) => IParticleUpdater): Promise<void>;
|
|
24
25
|
}
|
package/main.js
CHANGED
|
@@ -49,7 +49,12 @@ class Main {
|
|
|
49
49
|
domItem(index) {
|
|
50
50
|
return Loader_1.Loader.domItem(index);
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
async refresh() {
|
|
53
|
+
for (const instance of this.dom()) {
|
|
54
|
+
await instance.refresh();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async addShape(shape, drawer, init, afterEffect, destroy) {
|
|
53
58
|
let customDrawer;
|
|
54
59
|
if (typeof drawer === "function") {
|
|
55
60
|
customDrawer = {
|
|
@@ -63,21 +68,27 @@ class Main {
|
|
|
63
68
|
customDrawer = drawer;
|
|
64
69
|
}
|
|
65
70
|
Utils_1.Plugins.addShapeDrawer(shape, customDrawer);
|
|
71
|
+
await this.refresh();
|
|
66
72
|
}
|
|
67
|
-
addPreset(preset, options, override = false) {
|
|
73
|
+
async addPreset(preset, options, override = false) {
|
|
68
74
|
Utils_1.Plugins.addPreset(preset, options, override);
|
|
75
|
+
await this.refresh();
|
|
69
76
|
}
|
|
70
|
-
addPlugin(plugin) {
|
|
77
|
+
async addPlugin(plugin) {
|
|
71
78
|
Utils_1.Plugins.addPlugin(plugin);
|
|
79
|
+
await this.refresh();
|
|
72
80
|
}
|
|
73
|
-
addPathGenerator(name, generator) {
|
|
81
|
+
async addPathGenerator(name, generator) {
|
|
74
82
|
Utils_1.Plugins.addPathGenerator(name, generator);
|
|
83
|
+
await this.refresh();
|
|
75
84
|
}
|
|
76
|
-
addInteractor(name, interactorInitializer) {
|
|
85
|
+
async addInteractor(name, interactorInitializer) {
|
|
77
86
|
Utils_1.Plugins.addInteractor(name, interactorInitializer);
|
|
87
|
+
await this.refresh();
|
|
78
88
|
}
|
|
79
|
-
addParticleUpdater(name, updaterInitializer) {
|
|
89
|
+
async addParticleUpdater(name, updaterInitializer) {
|
|
80
90
|
Utils_1.Plugins.addParticleUpdater(name, updaterInitializer);
|
|
91
|
+
await this.refresh();
|
|
81
92
|
}
|
|
82
93
|
}
|
|
83
94
|
exports.Main = Main;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsparticles",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.3",
|
|
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": {
|