tsparticles 1.39.1 → 1.40.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/Container.d.ts +3 -1
- package/Core/Container.js +30 -15
- package/Core/Loader.d.ts +12 -9
- package/Core/Loader.js +35 -19
- package/Core/Particle.d.ts +3 -1
- package/Core/Particle.js +17 -2
- package/Core/Particles.d.ts +3 -1
- package/Core/Particles.js +20 -5
- package/Core/Utils/InteractionManager.d.ts +5 -3
- package/Core/Utils/InteractionManager.js +19 -3
- package/Core/Utils/Plugins.d.ts +29 -15
- package/Core/Utils/Plugins.js +58 -46
- package/Options/Classes/Options.d.ts +2 -1
- package/Options/Classes/Options.js +14 -7
- package/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/Plugins/Emitters/EmitterInstance.js +46 -16
- package/Plugins/Emitters/Emitters.d.ts +3 -1
- package/Plugins/Emitters/Emitters.js +17 -2
- package/Plugins/Emitters/{EmittersMain.d.ts → EmittersEngine.d.ts} +3 -1
- package/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +1 -0
- package/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/Plugins/Emitters/ShapeManager.js +16 -4
- package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/Plugins/Emitters/index.d.ts +3 -3
- package/Plugins/Emitters/index.js +25 -6
- package/README.md +3 -3
- package/browser/Core/Container.d.ts +4 -1
- package/browser/Core/Container.js +32 -16
- package/browser/Core/Loader.d.ts +12 -9
- package/browser/Core/Loader.js +35 -19
- package/browser/Core/Particle.d.ts +3 -1
- package/browser/Core/Particle.js +18 -3
- package/browser/Core/Particles.d.ts +3 -1
- package/browser/Core/Particles.js +21 -6
- package/browser/Core/Utils/InteractionManager.d.ts +5 -3
- package/browser/Core/Utils/InteractionManager.js +19 -3
- package/browser/Core/Utils/Plugins.d.ts +29 -15
- package/browser/Core/Utils/Plugins.js +58 -46
- package/browser/Options/Classes/Options.d.ts +2 -1
- package/browser/Options/Classes/Options.js +14 -7
- package/browser/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/browser/Plugins/Emitters/EmitterInstance.js +46 -16
- package/browser/Plugins/Emitters/Emitters.d.ts +3 -1
- package/browser/Plugins/Emitters/Emitters.js +17 -2
- package/{esm/Plugins/Emitters/EmittersMain.d.ts → browser/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/browser/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/browser/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +4 -0
- package/browser/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/browser/Plugins/Emitters/ShapeManager.js +16 -4
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/browser/Plugins/Emitters/index.d.ts +3 -3
- package/browser/Plugins/Emitters/index.js +25 -6
- package/browser/engine.d.ts +5 -1
- package/browser/engine.js +22 -17
- package/engine.d.ts +3 -0
- package/engine.js +20 -16
- package/esm/Core/Container.d.ts +3 -1
- package/esm/Core/Container.js +31 -16
- package/esm/Core/Loader.d.ts +12 -9
- package/esm/Core/Loader.js +35 -19
- package/esm/Core/Particle.d.ts +3 -1
- package/esm/Core/Particle.js +18 -3
- package/esm/Core/Particles.d.ts +3 -1
- package/esm/Core/Particles.js +21 -6
- package/esm/Core/Utils/InteractionManager.d.ts +5 -3
- package/esm/Core/Utils/InteractionManager.js +19 -3
- package/esm/Core/Utils/Plugins.d.ts +29 -15
- package/esm/Core/Utils/Plugins.js +58 -46
- package/esm/Options/Classes/Options.d.ts +2 -1
- package/esm/Options/Classes/Options.js +14 -7
- package/esm/Plugins/Emitters/EmitterInstance.d.ts +6 -3
- package/esm/Plugins/Emitters/EmitterInstance.js +46 -16
- package/esm/Plugins/Emitters/Emitters.d.ts +3 -1
- package/esm/Plugins/Emitters/Emitters.js +17 -2
- package/{browser/Plugins/Emitters/EmittersMain.d.ts → esm/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/esm/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/esm/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +1 -0
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +1 -0
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +1 -0
- package/esm/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/esm/Plugins/Emitters/ShapeManager.js +16 -4
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/esm/Plugins/Emitters/index.d.ts +3 -3
- package/esm/Plugins/Emitters/index.js +25 -6
- package/esm/engine.d.ts +3 -0
- package/esm/engine.js +20 -16
- package/package.json +11 -5
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +227 -118
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +205 -100
- package/tsparticles.interaction.external.attract.min.js +2 -2
- package/tsparticles.interaction.external.bounce.js +205 -100
- package/tsparticles.interaction.external.bounce.min.js +2 -2
- package/tsparticles.interaction.external.bubble.js +205 -100
- package/tsparticles.interaction.external.bubble.min.js +2 -2
- package/tsparticles.interaction.external.connect.js +205 -100
- package/tsparticles.interaction.external.connect.min.js +2 -2
- package/tsparticles.interaction.external.grab.js +205 -100
- package/tsparticles.interaction.external.grab.min.js +2 -2
- package/tsparticles.interaction.external.repulse.js +205 -100
- package/tsparticles.interaction.external.repulse.min.js +2 -2
- package/tsparticles.interaction.external.trail.js +205 -100
- package/tsparticles.interaction.external.trail.min.js +2 -2
- package/tsparticles.interaction.particles.attract.js +205 -100
- package/tsparticles.interaction.particles.attract.min.js +2 -2
- package/tsparticles.interaction.particles.collisions.js +205 -100
- package/tsparticles.interaction.particles.collisions.min.js +2 -2
- package/tsparticles.interaction.particles.links.js +205 -100
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +347 -156
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +205 -100
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +330 -143
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +205 -100
- package/tsparticles.plugins.polygonMask.min.js +2 -2
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +208 -103
- package/tsparticles.shape.image.min.js +2 -2
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +205 -100
- package/tsparticles.shape.text.min.js +2 -2
- package/tsparticles.slim.js +227 -118
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +205 -100
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +205 -100
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +205 -100
- package/tsparticles.updater.life.min.js +2 -2
- package/tsparticles.updater.opacity.js +205 -100
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +205 -100
- package/tsparticles.updater.outModes.min.js +2 -2
- package/tsparticles.updater.roll.js +205 -100
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +205 -100
- package/tsparticles.updater.size.min.js +2 -2
- package/tsparticles.updater.strokeColor.js +205 -100
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +205 -100
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +205 -100
- package/tsparticles.updater.wobble.min.js +2 -2
package/esm/Core/Loader.js
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _Loader_engine;
|
|
1
13
|
import { Constants } from "./Utils";
|
|
2
14
|
import { Container } from "./Container";
|
|
3
15
|
import { itemFromArray } from "../Utils";
|
|
4
|
-
const tsParticlesDom = [];
|
|
5
16
|
function fetchError(statusCode) {
|
|
6
17
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
7
18
|
console.error("Error tsParticles - File config not found");
|
|
8
19
|
}
|
|
9
20
|
export class Loader {
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
constructor(engine) {
|
|
22
|
+
_Loader_engine.set(this, void 0);
|
|
23
|
+
__classPrivateFieldSet(this, _Loader_engine, engine, "f");
|
|
12
24
|
}
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
dom() {
|
|
26
|
+
return __classPrivateFieldGet(this, _Loader_engine, "f").domArray;
|
|
27
|
+
}
|
|
28
|
+
domItem(index) {
|
|
29
|
+
const dom = this.dom();
|
|
15
30
|
const item = dom[index];
|
|
16
31
|
if (item && !item.destroyed) {
|
|
17
32
|
return item;
|
|
18
33
|
}
|
|
19
34
|
dom.splice(index, 1);
|
|
20
35
|
}
|
|
21
|
-
|
|
36
|
+
async loadOptions(params) {
|
|
22
37
|
var _a, _b, _c;
|
|
23
38
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 10000)}`;
|
|
24
39
|
const { options, index } = params;
|
|
@@ -29,10 +44,10 @@ export class Loader {
|
|
|
29
44
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
30
45
|
}
|
|
31
46
|
const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
|
|
32
|
-
const dom =
|
|
47
|
+
const dom = this.dom();
|
|
33
48
|
const oldIndex = dom.findIndex((v) => v.id === tagId);
|
|
34
49
|
if (oldIndex >= 0) {
|
|
35
|
-
const old =
|
|
50
|
+
const old = this.domItem(oldIndex);
|
|
36
51
|
if (old && !old.destroyed) {
|
|
37
52
|
old.destroy();
|
|
38
53
|
dom.splice(oldIndex, 1);
|
|
@@ -57,7 +72,7 @@ export class Loader {
|
|
|
57
72
|
domContainer.appendChild(canvasEl);
|
|
58
73
|
}
|
|
59
74
|
}
|
|
60
|
-
const newItem = new Container(tagId, currentOptions);
|
|
75
|
+
const newItem = new Container(__classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
61
76
|
if (oldIndex >= 0) {
|
|
62
77
|
dom.splice(oldIndex, 0, newItem);
|
|
63
78
|
}
|
|
@@ -68,7 +83,7 @@ export class Loader {
|
|
|
68
83
|
await newItem.start();
|
|
69
84
|
return newItem;
|
|
70
85
|
}
|
|
71
|
-
|
|
86
|
+
async loadRemoteOptions(params) {
|
|
72
87
|
const { url: jsonUrl, index } = params;
|
|
73
88
|
const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
|
|
74
89
|
if (!url) {
|
|
@@ -80,14 +95,14 @@ export class Loader {
|
|
|
80
95
|
return;
|
|
81
96
|
}
|
|
82
97
|
const data = await response.json();
|
|
83
|
-
return
|
|
98
|
+
return this.loadOptions({
|
|
84
99
|
tagId: params.tagId,
|
|
85
100
|
element: params.element,
|
|
86
101
|
index,
|
|
87
102
|
options: data,
|
|
88
103
|
});
|
|
89
104
|
}
|
|
90
|
-
|
|
105
|
+
load(tagId, options, index) {
|
|
91
106
|
const params = { index };
|
|
92
107
|
if (typeof tagId === "string") {
|
|
93
108
|
params.tagId = tagId;
|
|
@@ -103,7 +118,7 @@ export class Loader {
|
|
|
103
118
|
}
|
|
104
119
|
return this.loadOptions(params);
|
|
105
120
|
}
|
|
106
|
-
|
|
121
|
+
async set(id, domContainer, options, index) {
|
|
107
122
|
const params = { index };
|
|
108
123
|
if (typeof id === "string") {
|
|
109
124
|
params.tagId = id;
|
|
@@ -125,7 +140,7 @@ export class Loader {
|
|
|
125
140
|
}
|
|
126
141
|
return this.loadOptions(params);
|
|
127
142
|
}
|
|
128
|
-
|
|
143
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
129
144
|
let url, id;
|
|
130
145
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
131
146
|
url = tagId;
|
|
@@ -134,9 +149,9 @@ export class Loader {
|
|
|
134
149
|
id = tagId;
|
|
135
150
|
url = jsonUrl;
|
|
136
151
|
}
|
|
137
|
-
return
|
|
152
|
+
return this.loadRemoteOptions({ tagId: id, url, index });
|
|
138
153
|
}
|
|
139
|
-
|
|
154
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
140
155
|
let url, newId, newIndex, element;
|
|
141
156
|
if (id instanceof HTMLElement) {
|
|
142
157
|
element = id;
|
|
@@ -149,10 +164,10 @@ export class Loader {
|
|
|
149
164
|
url = jsonUrl;
|
|
150
165
|
newIndex = index;
|
|
151
166
|
}
|
|
152
|
-
return
|
|
167
|
+
return this.loadRemoteOptions({ tagId: newId, url, index: newIndex, element });
|
|
153
168
|
}
|
|
154
|
-
|
|
155
|
-
const dom =
|
|
169
|
+
setOnClickHandler(callback) {
|
|
170
|
+
const dom = this.dom();
|
|
156
171
|
if (dom.length === 0) {
|
|
157
172
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
158
173
|
}
|
|
@@ -161,3 +176,4 @@ export class Loader {
|
|
|
161
176
|
}
|
|
162
177
|
}
|
|
163
178
|
}
|
|
179
|
+
_Loader_engine = new WeakMap();
|
package/esm/Core/Particle.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import { ShapeType } from "../Enums";
|
|
|
2
2
|
import type { IBubbleParticleData, ICoordinates, ICoordinates3d, IDelta, IHsl, IParticle, IParticleGradientAnimation, IParticleHslAnimation, IParticleLife, IParticleNumericValueAnimation, IParticleRetinaProps, IParticleRoll, IParticleSpin, IParticleTiltValueAnimation, IParticleValueAnimation, IParticleWobble, IRgb, IShapeValues } from "./Interfaces";
|
|
3
3
|
import { Vector, Vector3d } from "./Utils";
|
|
4
4
|
import type { Container } from "./Container";
|
|
5
|
+
import type { Engine } from "../engine";
|
|
5
6
|
import type { IParticles } from "../Options/Interfaces/Particles/IParticles";
|
|
6
7
|
import { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions";
|
|
7
8
|
import type { RecursivePartial } from "../Types";
|
|
8
9
|
import type { Stroke } from "../Options/Classes/Particles/Stroke";
|
|
9
10
|
export declare class Particle implements IParticle {
|
|
11
|
+
#private;
|
|
10
12
|
readonly id: number;
|
|
11
13
|
readonly container: Container;
|
|
12
14
|
readonly group?: string | undefined;
|
|
@@ -49,7 +51,7 @@ export declare class Particle implements IParticle {
|
|
|
49
51
|
readonly bubble: IBubbleParticleData;
|
|
50
52
|
readonly zIndexFactor: number;
|
|
51
53
|
readonly retina: IParticleRetinaProps;
|
|
52
|
-
constructor(id: number, container: Container, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>, group?: string | undefined);
|
|
54
|
+
constructor(engine: Engine, id: number, container: Container, position?: ICoordinates, overrideOptions?: RecursivePartial<IParticles>, group?: string | undefined);
|
|
53
55
|
isVisible(): boolean;
|
|
54
56
|
isInsideCanvas(): boolean;
|
|
55
57
|
draw(delta: IDelta): void;
|
package/esm/Core/Particle.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _Particle_engine;
|
|
13
|
+
import { Vector, Vector3d } from "./Utils";
|
|
2
14
|
import { alterHsl, clamp, colorToRgb, deepExtend, getDistance, getHslFromAnimation, getParticleBaseVelocity, getParticleDirectionAngle, getRangeMax, getRangeMin, getRangeValue, getValue, isInArray, itemFromArray, randomInRange, setRangeValue, } from "../Utils";
|
|
3
15
|
import { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions";
|
|
4
16
|
import { Shape } from "../Options/Classes/Particles/Shape/Shape";
|
|
@@ -13,11 +25,13 @@ const fixOutMode = (data) => {
|
|
|
13
25
|
}
|
|
14
26
|
};
|
|
15
27
|
export class Particle {
|
|
16
|
-
constructor(id, container, position, overrideOptions, group) {
|
|
28
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
17
29
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18
30
|
this.id = id;
|
|
19
31
|
this.container = container;
|
|
20
32
|
this.group = group;
|
|
33
|
+
_Particle_engine.set(this, void 0);
|
|
34
|
+
__classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
21
35
|
this.fill = true;
|
|
22
36
|
this.close = true;
|
|
23
37
|
this.lastPathTime = 0;
|
|
@@ -115,7 +129,7 @@ export class Particle {
|
|
|
115
129
|
this.sides = 24;
|
|
116
130
|
let drawer = container.drawers.get(this.shape);
|
|
117
131
|
if (!drawer) {
|
|
118
|
-
drawer =
|
|
132
|
+
drawer = __classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
119
133
|
if (drawer) {
|
|
120
134
|
container.drawers.set(this.shape, drawer);
|
|
121
135
|
}
|
|
@@ -363,3 +377,4 @@ export class Particle {
|
|
|
363
377
|
return life;
|
|
364
378
|
}
|
|
365
379
|
}
|
|
380
|
+
_Particle_engine = new WeakMap();
|
package/esm/Core/Particles.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ICoordinates, IDelta, IMouseData, IParticle, IRgb } from "./Interfaces";
|
|
2
2
|
import { QuadTree } from "./Utils";
|
|
3
3
|
import type { Container } from "./Container";
|
|
4
|
+
import type { Engine } from "../engine";
|
|
4
5
|
import type { IParticles } from "../Options/Interfaces/Particles/IParticles";
|
|
5
6
|
import { Particle } from "./Particle";
|
|
6
7
|
import type { RecursivePartial } from "../Types";
|
|
7
8
|
export declare class Particles {
|
|
9
|
+
#private;
|
|
8
10
|
private readonly container;
|
|
9
11
|
get count(): number;
|
|
10
12
|
quadTree: QuadTree;
|
|
@@ -22,7 +24,7 @@ export declare class Particles {
|
|
|
22
24
|
private nextId;
|
|
23
25
|
private readonly freqs;
|
|
24
26
|
private readonly mover;
|
|
25
|
-
constructor(container: Container);
|
|
27
|
+
constructor(engine: Engine, container: Container);
|
|
26
28
|
init(): void;
|
|
27
29
|
redraw(): void;
|
|
28
30
|
removeAt(index: number, quantity?: number, group?: string, override?: boolean): void;
|
package/esm/Core/Particles.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _Particles_engine;
|
|
13
|
+
import { InteractionManager, ParticlesMover, Point, QuadTree, Rectangle } from "./Utils";
|
|
2
14
|
import { getRangeMax, getRangeMin, getRangeValue, randomInRange, setRangeValue } from "../Utils";
|
|
3
15
|
import { Particle } from "./Particle";
|
|
4
16
|
import { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions";
|
|
5
17
|
export class Particles {
|
|
6
|
-
constructor(container) {
|
|
18
|
+
constructor(engine, container) {
|
|
7
19
|
this.container = container;
|
|
20
|
+
_Particles_engine.set(this, void 0);
|
|
21
|
+
__classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
8
22
|
this.nextId = 0;
|
|
9
23
|
this.array = [];
|
|
10
24
|
this.zArray = [];
|
|
@@ -16,11 +30,11 @@ export class Particles {
|
|
|
16
30
|
links: new Map(),
|
|
17
31
|
triangles: new Map(),
|
|
18
32
|
};
|
|
19
|
-
this.interactionManager = new InteractionManager(container);
|
|
33
|
+
this.interactionManager = new InteractionManager(__classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
20
34
|
const canvasSize = this.container.canvas.size;
|
|
21
35
|
this.linksColors = new Map();
|
|
22
36
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
|
|
23
|
-
this.updaters =
|
|
37
|
+
this.updaters = __classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
24
38
|
}
|
|
25
39
|
get count() {
|
|
26
40
|
return this.array.length;
|
|
@@ -34,7 +48,7 @@ export class Particles {
|
|
|
34
48
|
this.freqs.links = new Map();
|
|
35
49
|
this.freqs.triangles = new Map();
|
|
36
50
|
let handled = false;
|
|
37
|
-
this.updaters =
|
|
51
|
+
this.updaters = __classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
38
52
|
this.interactionManager.init();
|
|
39
53
|
for (const [, plugin] of container.plugins) {
|
|
40
54
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -281,7 +295,7 @@ export class Particles {
|
|
|
281
295
|
}
|
|
282
296
|
pushParticle(position, overrideOptions, group, initializer) {
|
|
283
297
|
try {
|
|
284
|
-
const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
|
|
298
|
+
const particle = new Particle(__classPrivateFieldGet(this, _Particles_engine, "f"), this.nextId, this.container, position, overrideOptions, group);
|
|
285
299
|
let canAdd = true;
|
|
286
300
|
if (initializer) {
|
|
287
301
|
canAdd = initializer(particle);
|
|
@@ -300,3 +314,4 @@ export class Particles {
|
|
|
300
314
|
}
|
|
301
315
|
}
|
|
302
316
|
}
|
|
317
|
+
_Particles_engine = new WeakMap();
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { IDelta } from "../Interfaces";
|
|
2
2
|
import type { Container } from "../Container";
|
|
3
|
+
import type { Engine } from "../../engine";
|
|
3
4
|
import type { Particle } from "../Particle";
|
|
4
5
|
export declare class InteractionManager {
|
|
6
|
+
#private;
|
|
5
7
|
private readonly container;
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
constructor(container: Container);
|
|
8
|
+
private externalInteractors;
|
|
9
|
+
private particleInteractors;
|
|
10
|
+
constructor(engine: Engine, container: Container);
|
|
9
11
|
init(): void;
|
|
10
12
|
externalInteract(delta: IDelta): void;
|
|
11
13
|
particlesInteract(particle: Particle, delta: IDelta): void;
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _InteractionManager_engine;
|
|
2
13
|
export class InteractionManager {
|
|
3
|
-
constructor(container) {
|
|
14
|
+
constructor(engine, container) {
|
|
4
15
|
this.container = container;
|
|
16
|
+
_InteractionManager_engine.set(this, void 0);
|
|
17
|
+
__classPrivateFieldSet(this, _InteractionManager_engine, engine, "f");
|
|
5
18
|
this.externalInteractors = [];
|
|
6
19
|
this.particleInteractors = [];
|
|
7
20
|
this.init();
|
|
8
21
|
}
|
|
9
22
|
init() {
|
|
10
|
-
const interactors =
|
|
23
|
+
const interactors = __classPrivateFieldGet(this, _InteractionManager_engine, "f").plugins.getInteractors(this.container, true);
|
|
24
|
+
this.externalInteractors = [];
|
|
25
|
+
this.particleInteractors = [];
|
|
11
26
|
for (const interactor of interactors) {
|
|
12
27
|
switch (interactor.type) {
|
|
13
28
|
case 0:
|
|
@@ -37,3 +52,4 @@ export class InteractionManager {
|
|
|
37
52
|
}
|
|
38
53
|
}
|
|
39
54
|
}
|
|
55
|
+
_InteractionManager_engine = new WeakMap();
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
import type { IContainerPlugin, IInteractor, IMovePathGenerator, IParticleUpdater, IPlugin, IShapeDrawer } from "../Interfaces";
|
|
2
2
|
import type { Container } from "../Container";
|
|
3
|
+
import type { Engine } from "../../engine";
|
|
3
4
|
import type { IOptions } from "../../Options/Interfaces/IOptions";
|
|
4
5
|
import type { Options } from "../../Options/Classes/Options";
|
|
5
6
|
import type { RecursivePartial } from "../../Types";
|
|
7
|
+
declare type InteractorInitializer = (container: Container) => IInteractor;
|
|
8
|
+
declare type UpdaterInitializer = (container: Container) => IParticleUpdater;
|
|
6
9
|
export declare class Plugins {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
#private;
|
|
11
|
+
readonly plugins: IPlugin[];
|
|
12
|
+
readonly interactorsInitializers: Map<string, InteractorInitializer>;
|
|
13
|
+
readonly updatersInitializers: Map<string, UpdaterInitializer>;
|
|
14
|
+
readonly interactors: Map<Container, IInteractor[]>;
|
|
15
|
+
readonly updaters: Map<Container, IParticleUpdater[]>;
|
|
16
|
+
readonly presets: Map<string, RecursivePartial<IOptions>>;
|
|
17
|
+
readonly drawers: Map<string, IShapeDrawer>;
|
|
18
|
+
readonly pathGenerators: Map<string, IMovePathGenerator>;
|
|
19
|
+
constructor(engine: Engine);
|
|
20
|
+
getPlugin(plugin: string): IPlugin | undefined;
|
|
21
|
+
addPlugin(plugin: IPlugin): void;
|
|
22
|
+
getAvailablePlugins(container: Container): Map<string, IContainerPlugin>;
|
|
23
|
+
loadOptions(options: Options, sourceOptions: RecursivePartial<IOptions>): void;
|
|
24
|
+
getPreset(preset: string): RecursivePartial<IOptions> | undefined;
|
|
25
|
+
addPreset(presetKey: string, options: RecursivePartial<IOptions>, override?: boolean): void;
|
|
26
|
+
addShapeDrawer(type: string, drawer: IShapeDrawer): void;
|
|
27
|
+
getShapeDrawer(type: string): IShapeDrawer | undefined;
|
|
28
|
+
getSupportedShapes(): IterableIterator<string>;
|
|
29
|
+
getPathGenerator(type: string): IMovePathGenerator | undefined;
|
|
30
|
+
addPathGenerator(type: string, pathGenerator: IMovePathGenerator): void;
|
|
31
|
+
getInteractors(container: Container, force?: boolean): IInteractor[];
|
|
32
|
+
addInteractor(name: string, initInteractor: (container: Container) => IInteractor): void;
|
|
33
|
+
getUpdaters(container: Container, force?: boolean): IParticleUpdater[];
|
|
34
|
+
addParticleUpdater(name: string, initUpdater: (container: Container) => IParticleUpdater): void;
|
|
22
35
|
}
|
|
36
|
+
export {};
|
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const pathGenerators = new Map();
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var _Plugins_engine;
|
|
9
8
|
export class Plugins {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
constructor(engine) {
|
|
10
|
+
_Plugins_engine.set(this, void 0);
|
|
11
|
+
__classPrivateFieldSet(this, _Plugins_engine, engine, "f");
|
|
12
|
+
this.plugins = [];
|
|
13
|
+
this.interactorsInitializers = new Map();
|
|
14
|
+
this.updatersInitializers = new Map();
|
|
15
|
+
this.interactors = new Map();
|
|
16
|
+
this.updaters = new Map();
|
|
17
|
+
this.presets = new Map();
|
|
18
|
+
this.drawers = new Map();
|
|
19
|
+
this.pathGenerators = new Map();
|
|
12
20
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
getPlugin(plugin) {
|
|
22
|
+
return this.plugins.find((t) => t.id === plugin);
|
|
23
|
+
}
|
|
24
|
+
addPlugin(plugin) {
|
|
25
|
+
if (!this.getPlugin(plugin.id)) {
|
|
26
|
+
this.plugins.push(plugin);
|
|
16
27
|
}
|
|
17
28
|
}
|
|
18
|
-
|
|
29
|
+
getAvailablePlugins(container) {
|
|
19
30
|
const res = new Map();
|
|
20
|
-
for (const plugin of plugins) {
|
|
31
|
+
for (const plugin of this.plugins) {
|
|
21
32
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
22
33
|
continue;
|
|
23
34
|
}
|
|
@@ -25,58 +36,59 @@ export class Plugins {
|
|
|
25
36
|
}
|
|
26
37
|
return res;
|
|
27
38
|
}
|
|
28
|
-
|
|
29
|
-
for (const plugin of plugins) {
|
|
39
|
+
loadOptions(options, sourceOptions) {
|
|
40
|
+
for (const plugin of this.plugins) {
|
|
30
41
|
plugin.loadOptions(options, sourceOptions);
|
|
31
42
|
}
|
|
32
43
|
}
|
|
33
|
-
|
|
34
|
-
return presets.get(preset);
|
|
44
|
+
getPreset(preset) {
|
|
45
|
+
return this.presets.get(preset);
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
if (override || !
|
|
38
|
-
presets.set(presetKey, options);
|
|
47
|
+
addPreset(presetKey, options, override = false) {
|
|
48
|
+
if (override || !this.getPreset(presetKey)) {
|
|
49
|
+
this.presets.set(presetKey, options);
|
|
39
50
|
}
|
|
40
51
|
}
|
|
41
|
-
|
|
42
|
-
if (!
|
|
43
|
-
drawers.set(type, drawer);
|
|
52
|
+
addShapeDrawer(type, drawer) {
|
|
53
|
+
if (!this.getShapeDrawer(type)) {
|
|
54
|
+
this.drawers.set(type, drawer);
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
|
|
47
|
-
return drawers.get(type);
|
|
57
|
+
getShapeDrawer(type) {
|
|
58
|
+
return this.drawers.get(type);
|
|
48
59
|
}
|
|
49
|
-
|
|
50
|
-
return drawers.keys();
|
|
60
|
+
getSupportedShapes() {
|
|
61
|
+
return this.drawers.keys();
|
|
51
62
|
}
|
|
52
|
-
|
|
53
|
-
return pathGenerators.get(type);
|
|
63
|
+
getPathGenerator(type) {
|
|
64
|
+
return this.pathGenerators.get(type);
|
|
54
65
|
}
|
|
55
|
-
|
|
56
|
-
if (!
|
|
57
|
-
pathGenerators.set(type, pathGenerator);
|
|
66
|
+
addPathGenerator(type, pathGenerator) {
|
|
67
|
+
if (!this.getPathGenerator(type)) {
|
|
68
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
58
69
|
}
|
|
59
70
|
}
|
|
60
|
-
|
|
61
|
-
let res = interactors.get(container);
|
|
71
|
+
getInteractors(container, force = false) {
|
|
72
|
+
let res = this.interactors.get(container);
|
|
62
73
|
if (!res || force) {
|
|
63
|
-
res = [...interactorsInitializers.values()].map((t) => t(container));
|
|
64
|
-
interactors.set(container, res);
|
|
74
|
+
res = [...this.interactorsInitializers.values()].map((t) => t(container));
|
|
75
|
+
this.interactors.set(container, res);
|
|
65
76
|
}
|
|
66
77
|
return res;
|
|
67
78
|
}
|
|
68
|
-
|
|
69
|
-
interactorsInitializers.set(name, initInteractor);
|
|
79
|
+
addInteractor(name, initInteractor) {
|
|
80
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
70
81
|
}
|
|
71
|
-
|
|
72
|
-
let res = updaters.get(container);
|
|
82
|
+
getUpdaters(container, force = false) {
|
|
83
|
+
let res = this.updaters.get(container);
|
|
73
84
|
if (!res || force) {
|
|
74
|
-
res = [...updatersInitializers.values()].map((t) => t(container));
|
|
75
|
-
updaters.set(container, res);
|
|
85
|
+
res = [...this.updatersInitializers.values()].map((t) => t(container));
|
|
86
|
+
this.updaters.set(container, res);
|
|
76
87
|
}
|
|
77
88
|
return res;
|
|
78
89
|
}
|
|
79
|
-
|
|
80
|
-
updatersInitializers.set(name, initUpdater);
|
|
90
|
+
addParticleUpdater(name, initUpdater) {
|
|
91
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
81
92
|
}
|
|
82
93
|
}
|
|
94
|
+
_Plugins_engine = new WeakMap();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RangeValue, RecursivePartial } from "../../Types";
|
|
2
2
|
import { Background } from "./Background/Background";
|
|
3
3
|
import { BackgroundMask } from "./BackgroundMask/BackgroundMask";
|
|
4
|
+
import type { Engine } from "../../engine";
|
|
4
5
|
import { FullScreen } from "./FullScreen/FullScreen";
|
|
5
6
|
import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
6
7
|
import type { IOptions } from "../Interfaces/IOptions";
|
|
@@ -39,7 +40,7 @@ export declare class Options implements IOptions, IOptionLoader<IOptions> {
|
|
|
39
40
|
defaultDarkTheme?: string;
|
|
40
41
|
defaultLightTheme?: string;
|
|
41
42
|
[name: string]: unknown;
|
|
42
|
-
constructor();
|
|
43
|
+
constructor(engine: Engine);
|
|
43
44
|
load(data?: RecursivePartial<IOptions>): void;
|
|
44
45
|
setTheme(name?: string): void;
|
|
45
46
|
setResponsive(width: number, pxRatio: number, defaultOptions: IOptions): number | undefined;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
1
7
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
8
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
11
|
};
|
|
6
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
12
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
7
13
|
import { Background } from "./Background/Background";
|
|
8
14
|
import { BackgroundMask } from "./BackgroundMask/BackgroundMask";
|
|
9
15
|
import { FullScreen } from "./FullScreen/FullScreen";
|
|
@@ -11,20 +17,21 @@ import { Interactivity } from "./Interactivity/Interactivity";
|
|
|
11
17
|
import { ManualParticle } from "./ManualParticle";
|
|
12
18
|
import { Motion } from "./Motion/Motion";
|
|
13
19
|
import { ParticlesOptions } from "./Particles/ParticlesOptions";
|
|
14
|
-
import { Plugins } from "../../Core";
|
|
15
20
|
import { Responsive } from "./Responsive";
|
|
16
21
|
import { Theme } from "./Theme/Theme";
|
|
17
22
|
import { deepExtend } from "../../Utils";
|
|
18
23
|
export class Options {
|
|
19
|
-
constructor() {
|
|
24
|
+
constructor(engine) {
|
|
20
25
|
_Options_instances.add(this);
|
|
26
|
+
_Options_engine.set(this, void 0);
|
|
27
|
+
__classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
21
28
|
this.autoPlay = true;
|
|
22
29
|
this.background = new Background();
|
|
23
30
|
this.backgroundMask = new BackgroundMask();
|
|
24
31
|
this.fullScreen = new FullScreen();
|
|
25
32
|
this.detectRetina = true;
|
|
26
33
|
this.duration = 0;
|
|
27
|
-
this.fpsLimit =
|
|
34
|
+
this.fpsLimit = 120;
|
|
28
35
|
this.interactivity = new Interactivity();
|
|
29
36
|
this.manualParticles = [];
|
|
30
37
|
this.motion = new Motion();
|
|
@@ -112,7 +119,7 @@ export class Options {
|
|
|
112
119
|
this.motion.load(data.motion);
|
|
113
120
|
this.particles.load(data.particles);
|
|
114
121
|
this.style = deepExtend(this.style, data.style);
|
|
115
|
-
|
|
122
|
+
__classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
116
123
|
if (data.responsive !== undefined) {
|
|
117
124
|
for (const responsive of data.responsive) {
|
|
118
125
|
const optResponsive = new Responsive();
|
|
@@ -154,10 +161,10 @@ export class Options {
|
|
|
154
161
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
155
162
|
}
|
|
156
163
|
importPreset(preset) {
|
|
157
|
-
this.load(
|
|
164
|
+
this.load(__classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
158
165
|
}
|
|
159
166
|
}
|
|
160
|
-
_Options_instances = new WeakSet(), _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
167
|
+
_Options_engine = new WeakMap(), _Options_instances = new WeakSet(), _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
161
168
|
var _a;
|
|
162
169
|
return ((_a = this.themes.find((theme) => theme.default.value && theme.default.mode === mode)) !== null && _a !== void 0 ? _a : this.themes.find((theme) => theme.default.value && theme.default.mode === "any"));
|
|
163
170
|
};
|