@tsparticles/vue2 4.3.1 → 4.4.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/package.json +2 -2
- package/vue-particles.vue.d.ts +16 -11
- package/vue-particles.vue.d.ts.map +1 -1
- package/vue2-particles.es.js +98 -289
- package/vue2-particles.umd.js +1 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/vue2",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Official tsParticles Vue.js 2.x Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for Web Components, React, Vue.js 3.x, Angular, Svelte, jQuery, Preact, Riot.js, Solid.js, Inferno.",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"vue": "^2.7.0",
|
|
97
|
-
"@tsparticles/engine": "4.
|
|
97
|
+
"@tsparticles/engine": "4.4.0"
|
|
98
98
|
},
|
|
99
99
|
"publishConfig": {
|
|
100
100
|
"access": "public"
|
package/vue-particles.vue.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { Container, ISourceOptions } from '@tsparticles/engine';
|
|
2
2
|
import { default as Vue } from 'vue';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
interface ParticlesInstance extends Vue {
|
|
4
|
+
id: string;
|
|
5
|
+
options?: ISourceOptions;
|
|
6
|
+
url?: string;
|
|
7
|
+
theme?: string;
|
|
8
|
+
particlesLoaded?: (container?: Container) => void;
|
|
9
9
|
container?: Container;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
beforeDestroy(): void;
|
|
10
|
+
loadGeneration: number;
|
|
11
|
+
onPropChange: () => void;
|
|
12
|
+
onThemeChange: (newTheme?: string) => void;
|
|
14
13
|
}
|
|
15
|
-
declare const __VLS_export: import('vue').DefineComponent<{}, unknown, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{}>>, {}>;
|
|
16
14
|
declare const _default: typeof __VLS_export;
|
|
17
15
|
export default _default;
|
|
16
|
+
declare const __VLS_export: import('vue/types/vue').ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue>, {
|
|
17
|
+
container: Container | undefined;
|
|
18
|
+
loadGeneration: number;
|
|
19
|
+
}, {
|
|
20
|
+
onPropChange(this: ParticlesInstance): void;
|
|
21
|
+
onThemeChange(this: ParticlesInstance, newTheme?: string): void;
|
|
22
|
+
}, unknown, Record<never, any>, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin>;
|
|
18
23
|
//# sourceMappingURL=vue-particles.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-particles.vue.d.ts","sourceRoot":"","sources":["../src/Particles/vue-particles.vue"],"names":[],"mappings":"AAGA;
|
|
1
|
+
{"version":3,"file":"vue-particles.vue.d.ts","sourceRoot":"","sources":["../src/Particles/vue-particles.vue"],"names":[],"mappings":"AAGA;AAAA,OAgJO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAe,MAAM,qBAAqB,CAAC;AACvF,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB,UAAU,iBAAkB,SAAQ,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;wBAgDoB,OAAO,YAAY;AAAxC,wBAAyC;AAezC,QAAA,MAAM,YAAY;eAyBY,SAAS,GAAG,SAAS;;;uBA4B5B,iBAAiB,GAAG,IAAI;wBAMvB,iBAAiB,aAAa,MAAM,GAAG,IAAI;6GAQjE,CAAC"}
|
package/vue2-particles.es.js
CHANGED
|
@@ -1,323 +1,132 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* vue-class-component v7.2.6
|
|
5
|
-
* (c) 2015-present Evan You
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/
|
|
1
|
+
import { tsParticles as u } from "@tsparticles/engine";
|
|
2
|
+
import f from "vue";
|
|
3
|
+
let s = !1, a, d;
|
|
8
4
|
function p(e) {
|
|
9
|
-
|
|
10
|
-
return typeof t;
|
|
11
|
-
} : p = function(t) {
|
|
12
|
-
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
13
|
-
}, p(e);
|
|
14
|
-
}
|
|
15
|
-
function D(e, t, r) {
|
|
16
|
-
return t in e ? Object.defineProperty(e, t, {
|
|
17
|
-
value: r,
|
|
18
|
-
enumerable: !0,
|
|
19
|
-
configurable: !0,
|
|
20
|
-
writable: !0
|
|
21
|
-
}) : e[t] = r, e;
|
|
22
|
-
}
|
|
23
|
-
function E(e) {
|
|
24
|
-
return I(e) || x(e) || N();
|
|
25
|
-
}
|
|
26
|
-
function I(e) {
|
|
27
|
-
if (Array.isArray(e)) {
|
|
28
|
-
for (var t = 0, r = new Array(e.length); t < e.length; t++) r[t] = e[t];
|
|
29
|
-
return r;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function x(e) {
|
|
33
|
-
if (Symbol.iterator in Object(e) || Object.prototype.toString.call(e) === "[object Arguments]") return Array.from(e);
|
|
34
|
-
}
|
|
35
|
-
function N() {
|
|
36
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
37
|
-
}
|
|
38
|
-
function T() {
|
|
39
|
-
return typeof Reflect < "u" && Reflect.defineMetadata && Reflect.getOwnMetadataKeys;
|
|
40
|
-
}
|
|
41
|
-
function V(e, t) {
|
|
42
|
-
_(e, t), Object.getOwnPropertyNames(t.prototype).forEach(function(r) {
|
|
43
|
-
_(e.prototype, t.prototype, r);
|
|
44
|
-
}), Object.getOwnPropertyNames(t).forEach(function(r) {
|
|
45
|
-
_(e, t, r);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function _(e, t, r) {
|
|
49
|
-
var n = r ? Reflect.getOwnMetadataKeys(t, r) : Reflect.getOwnMetadataKeys(t);
|
|
50
|
-
n.forEach(function(o) {
|
|
51
|
-
var i = r ? Reflect.getOwnMetadata(o, t, r) : Reflect.getOwnMetadata(o, t);
|
|
52
|
-
r ? Reflect.defineMetadata(o, i, e, r) : Reflect.defineMetadata(o, i, e);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
var z = {
|
|
56
|
-
__proto__: []
|
|
57
|
-
}, F = z instanceof Array;
|
|
58
|
-
function M(e) {
|
|
59
|
-
return function(t, r, n) {
|
|
60
|
-
var o = typeof t == "function" ? t : t.constructor;
|
|
61
|
-
o.__decorators__ || (o.__decorators__ = []), typeof n != "number" && (n = void 0), o.__decorators__.push(function(i) {
|
|
62
|
-
return e(i, r, n);
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function H(e) {
|
|
67
|
-
var t = p(e);
|
|
68
|
-
return e == null || t !== "object" && t !== "function";
|
|
69
|
-
}
|
|
70
|
-
function A(e) {
|
|
71
|
-
typeof console < "u" && console.warn("[vue-class-component] " + e);
|
|
72
|
-
}
|
|
73
|
-
function $(e, t) {
|
|
74
|
-
var r = t.prototype._init;
|
|
75
|
-
t.prototype._init = function() {
|
|
76
|
-
var i = this, c = Object.getOwnPropertyNames(e);
|
|
77
|
-
if (e.$options.props)
|
|
78
|
-
for (var f in e.$options.props)
|
|
79
|
-
e.hasOwnProperty(f) || c.push(f);
|
|
80
|
-
c.forEach(function(a) {
|
|
81
|
-
Object.defineProperty(i, a, {
|
|
82
|
-
get: function() {
|
|
83
|
-
return e[a];
|
|
84
|
-
},
|
|
85
|
-
set: function(S) {
|
|
86
|
-
e[a] = S;
|
|
87
|
-
},
|
|
88
|
-
configurable: !0
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
var n = new t();
|
|
93
|
-
t.prototype._init = r;
|
|
94
|
-
var o = {};
|
|
95
|
-
return Object.keys(n).forEach(function(i) {
|
|
96
|
-
n[i] !== void 0 && (o[i] = n[i]);
|
|
97
|
-
}), process.env.NODE_ENV !== "production" && !(t.prototype instanceof h) && Object.keys(o).length > 0 && A("Component class must inherit Vue or its descendant class when class property is used."), o;
|
|
98
|
-
}
|
|
99
|
-
var g = [
|
|
100
|
-
"data",
|
|
101
|
-
"beforeCreate",
|
|
102
|
-
"created",
|
|
103
|
-
"beforeMount",
|
|
104
|
-
"mounted",
|
|
105
|
-
"beforeDestroy",
|
|
106
|
-
"destroyed",
|
|
107
|
-
"beforeUpdate",
|
|
108
|
-
"updated",
|
|
109
|
-
"activated",
|
|
110
|
-
"deactivated",
|
|
111
|
-
"render",
|
|
112
|
-
"errorCaptured",
|
|
113
|
-
"serverPrefetch"
|
|
114
|
-
// 2.6
|
|
115
|
-
];
|
|
116
|
-
function P(e) {
|
|
117
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
118
|
-
t.name = t.name || e._componentTag || e.name;
|
|
119
|
-
var r = e.prototype;
|
|
120
|
-
Object.getOwnPropertyNames(r).forEach(function(f) {
|
|
121
|
-
if (f !== "constructor") {
|
|
122
|
-
if (g.indexOf(f) > -1) {
|
|
123
|
-
t[f] = r[f];
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
var a = Object.getOwnPropertyDescriptor(r, f);
|
|
127
|
-
a.value !== void 0 ? typeof a.value == "function" ? (t.methods || (t.methods = {}))[f] = a.value : (t.mixins || (t.mixins = [])).push({
|
|
128
|
-
data: function() {
|
|
129
|
-
return D({}, f, a.value);
|
|
130
|
-
}
|
|
131
|
-
}) : (a.get || a.set) && ((t.computed || (t.computed = {}))[f] = {
|
|
132
|
-
get: a.get,
|
|
133
|
-
set: a.set
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}), (t.mixins || (t.mixins = [])).push({
|
|
137
|
-
data: function() {
|
|
138
|
-
return $(this, e);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
var n = e.__decorators__;
|
|
142
|
-
n && (n.forEach(function(f) {
|
|
143
|
-
return f(t);
|
|
144
|
-
}), delete e.__decorators__);
|
|
145
|
-
var o = Object.getPrototypeOf(e.prototype), i = o instanceof h ? o.constructor : h, c = i.extend(t);
|
|
146
|
-
return q(c, e, i), T() && V(c, e), c;
|
|
147
|
-
}
|
|
148
|
-
var C = [
|
|
149
|
-
// Unique id
|
|
150
|
-
"cid",
|
|
151
|
-
// Super Vue constructor
|
|
152
|
-
"super",
|
|
153
|
-
// Component options that will be used by the component
|
|
154
|
-
"options",
|
|
155
|
-
"superOptions",
|
|
156
|
-
"extendOptions",
|
|
157
|
-
"sealedOptions",
|
|
158
|
-
// Private assets
|
|
159
|
-
"component",
|
|
160
|
-
"directive",
|
|
161
|
-
"filter"
|
|
162
|
-
], L = {
|
|
163
|
-
prototype: !0,
|
|
164
|
-
arguments: !0,
|
|
165
|
-
callee: !0,
|
|
166
|
-
caller: !0
|
|
167
|
-
};
|
|
168
|
-
function q(e, t, r) {
|
|
169
|
-
Object.getOwnPropertyNames(t).forEach(function(n) {
|
|
170
|
-
if (!L[n]) {
|
|
171
|
-
var o = Object.getOwnPropertyDescriptor(e, n);
|
|
172
|
-
if (!(o && !o.configurable)) {
|
|
173
|
-
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
174
|
-
if (!F) {
|
|
175
|
-
if (n === "cid")
|
|
176
|
-
return;
|
|
177
|
-
var c = Object.getOwnPropertyDescriptor(r, n);
|
|
178
|
-
if (!H(i.value) && c && c.value === i.value)
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
process.env.NODE_ENV !== "production" && C.indexOf(n) >= 0 && A("Static property name '".concat(n, "' declared on class '").concat(t.name, "' ") + "conflicts with reserved property name of Vue internal. It may cause unexpected behavior of the component. Consider renaming the property."), Object.defineProperty(e, n, i);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
function R(e) {
|
|
187
|
-
return typeof e == "function" ? P(e) : function(t) {
|
|
188
|
-
return P(t, e);
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
R.registerHooks = function(t) {
|
|
192
|
-
g.push.apply(g, E(t));
|
|
193
|
-
};
|
|
194
|
-
var W = typeof Reflect < "u" && typeof Reflect.getMetadata < "u";
|
|
195
|
-
function U(e, t, r) {
|
|
196
|
-
if (W && !Array.isArray(e) && typeof e != "function" && !e.hasOwnProperty("type") && typeof e.type > "u") {
|
|
197
|
-
var n = Reflect.getMetadata("design:type", t, r);
|
|
198
|
-
n !== Object && (e.type = n);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
function l(e) {
|
|
202
|
-
return e === void 0 && (e = {}), function(t, r) {
|
|
203
|
-
U(e, t, r), M(function(n, o) {
|
|
204
|
-
(n.props || (n.props = {}))[o] = e;
|
|
205
|
-
})(t, r);
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function v(e, t) {
|
|
209
|
-
t === void 0 && (t = {});
|
|
210
|
-
var r = t.deep, n = r === void 0 ? !1 : r, o = t.immediate, i = o === void 0 ? !1 : o;
|
|
211
|
-
return M(function(c, f) {
|
|
212
|
-
typeof c.watch != "object" && (c.watch = /* @__PURE__ */ Object.create(null));
|
|
213
|
-
var a = c.watch;
|
|
214
|
-
typeof a[e] == "object" && !Array.isArray(a[e]) ? a[e] = [a[e]] : typeof a[e] > "u" && (a[e] = []), a[e].push({ handler: f, deep: n, immediate: i });
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
let y = !1, d, m;
|
|
218
|
-
function B(e) {
|
|
219
|
-
if (y)
|
|
5
|
+
if (s)
|
|
220
6
|
return Promise.resolve();
|
|
221
|
-
if (
|
|
7
|
+
if (a && d !== e)
|
|
222
8
|
throw new Error("@tsparticles/vue2 init callback must be stable across the app lifecycle.");
|
|
223
|
-
return
|
|
224
|
-
|
|
9
|
+
return a || (d = e, a = Promise.resolve(e == null ? void 0 : e(u)).then(() => u.init()).then(() => {
|
|
10
|
+
s = !0;
|
|
225
11
|
}).catch((t) => {
|
|
226
|
-
throw
|
|
227
|
-
}),
|
|
12
|
+
throw a = void 0, d = void 0, s = !1, t;
|
|
13
|
+
}), a);
|
|
228
14
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
15
|
+
function m() {
|
|
16
|
+
return a ?? Promise.resolve();
|
|
231
17
|
}
|
|
232
|
-
function
|
|
233
|
-
return
|
|
18
|
+
function v() {
|
|
19
|
+
return s;
|
|
234
20
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
(c = e[i]) && (o = (n ? c(t, r, o) : c(o)) || o);
|
|
238
|
-
return n && o && Q(t, r, o), o;
|
|
239
|
-
};
|
|
240
|
-
async function O(e) {
|
|
241
|
-
var n;
|
|
21
|
+
async function c(e) {
|
|
22
|
+
var l;
|
|
242
23
|
if (!e.id)
|
|
243
24
|
throw new Error("Prop 'id' is required!");
|
|
244
|
-
|
|
25
|
+
const t = e.loadGeneration;
|
|
26
|
+
if (await m(), !v())
|
|
245
27
|
throw new Error(
|
|
246
28
|
"@tsparticles/vue2 plugin initialization must be completed before rendering <VueParticles /> components."
|
|
247
29
|
);
|
|
248
|
-
const
|
|
30
|
+
const r = (o) => {
|
|
31
|
+
if (t !== e.loadGeneration) {
|
|
32
|
+
o == null || o.destroy();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
249
35
|
e.container = o, o && e.particlesLoaded && e.particlesLoaded(o);
|
|
250
|
-
},
|
|
36
|
+
}, i = await u.load({
|
|
251
37
|
id: e.id,
|
|
252
38
|
options: e.options ?? {},
|
|
253
39
|
url: e.url
|
|
254
40
|
});
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
onPropChange() {
|
|
259
|
-
this.container && O(this);
|
|
260
|
-
}
|
|
261
|
-
onThemeChange(e) {
|
|
262
|
-
var t, r;
|
|
263
|
-
this.container && ((r = (t = this.container).loadTheme) == null || r.call(t, e));
|
|
41
|
+
if (t !== e.loadGeneration) {
|
|
42
|
+
i == null || i.destroy();
|
|
43
|
+
return;
|
|
264
44
|
}
|
|
45
|
+
i && e.theme && ((l = i.loadTheme) == null || l.call(i, e.theme)), r(i);
|
|
46
|
+
}
|
|
47
|
+
const P = f.extend({
|
|
48
|
+
props: {
|
|
49
|
+
id: {
|
|
50
|
+
required: !0,
|
|
51
|
+
type: String
|
|
52
|
+
},
|
|
53
|
+
options: {
|
|
54
|
+
default: void 0,
|
|
55
|
+
type: Object
|
|
56
|
+
},
|
|
57
|
+
url: {
|
|
58
|
+
default: void 0,
|
|
59
|
+
type: String
|
|
60
|
+
},
|
|
61
|
+
theme: {
|
|
62
|
+
default: void 0,
|
|
63
|
+
type: String
|
|
64
|
+
},
|
|
65
|
+
particlesLoaded: {
|
|
66
|
+
default: void 0,
|
|
67
|
+
type: Function
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
container: void 0,
|
|
73
|
+
loadGeneration: 0
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
watch: {
|
|
77
|
+
options() {
|
|
78
|
+
this.onPropChange();
|
|
79
|
+
},
|
|
80
|
+
url() {
|
|
81
|
+
this.onPropChange();
|
|
82
|
+
},
|
|
83
|
+
id() {
|
|
84
|
+
this.onPropChange();
|
|
85
|
+
},
|
|
86
|
+
theme(e) {
|
|
87
|
+
this.onThemeChange(e);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
265
90
|
mounted() {
|
|
266
91
|
this.$nextTick(() => {
|
|
267
|
-
|
|
92
|
+
c(this);
|
|
268
93
|
});
|
|
269
|
-
}
|
|
270
|
-
|
|
94
|
+
},
|
|
95
|
+
beforeUnmount() {
|
|
271
96
|
var e;
|
|
272
|
-
(e = this.container) == null || e.destroy();
|
|
97
|
+
this.loadGeneration++, (e = this.container) == null || e.destroy();
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
onPropChange() {
|
|
101
|
+
var e;
|
|
102
|
+
(e = this.container) == null || e.destroy(), this.container = void 0, this.loadGeneration++, c(this);
|
|
103
|
+
},
|
|
104
|
+
onThemeChange(e) {
|
|
105
|
+
var t, r;
|
|
106
|
+
this.container && ((r = (t = this.container).loadTheme) == null || r.call(t, e));
|
|
107
|
+
}
|
|
273
108
|
}
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
u([
|
|
279
|
-
l()
|
|
280
|
-
], s.prototype, "options", 2);
|
|
281
|
-
u([
|
|
282
|
-
l()
|
|
283
|
-
], s.prototype, "url", 2);
|
|
284
|
-
u([
|
|
285
|
-
l()
|
|
286
|
-
], s.prototype, "theme", 2);
|
|
287
|
-
u([
|
|
288
|
-
l()
|
|
289
|
-
], s.prototype, "particlesLoaded", 2);
|
|
290
|
-
u([
|
|
291
|
-
v("options"),
|
|
292
|
-
v("url"),
|
|
293
|
-
v("id")
|
|
294
|
-
], s.prototype, "onPropChange", 1);
|
|
295
|
-
u([
|
|
296
|
-
v("theme")
|
|
297
|
-
], s.prototype, "onThemeChange", 1);
|
|
298
|
-
s = u([
|
|
299
|
-
R
|
|
300
|
-
], s);
|
|
301
|
-
function Y(e, t, r, n, o, i, c, f) {
|
|
302
|
-
var a = typeof e == "function" ? e.options : e;
|
|
303
|
-
return t && (a.render = t, a.staticRenderFns = r, a._compiled = !0), {
|
|
109
|
+
});
|
|
110
|
+
function _(e, t, r, i, l, o, b, C) {
|
|
111
|
+
var n = typeof e == "function" ? e.options : e;
|
|
112
|
+
return t && (n.render = t, n.staticRenderFns = r, n._compiled = !0), {
|
|
304
113
|
exports: e,
|
|
305
|
-
options:
|
|
114
|
+
options: n
|
|
306
115
|
};
|
|
307
116
|
}
|
|
308
|
-
var
|
|
117
|
+
var y = function() {
|
|
309
118
|
var t = this, r = t._self._c;
|
|
310
119
|
return t._self._setupProxy, r("div", { attrs: { id: t.id } });
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
120
|
+
}, g = [], w = /* @__PURE__ */ _(
|
|
121
|
+
P,
|
|
122
|
+
y,
|
|
123
|
+
g
|
|
315
124
|
);
|
|
316
|
-
const
|
|
125
|
+
const h = w.exports, I = {
|
|
317
126
|
install: (e, t) => {
|
|
318
|
-
e.component("VueParticles",
|
|
127
|
+
e.component("VueParticles", h), e.component("VueParticles", h), p(t == null ? void 0 : t.init);
|
|
319
128
|
}
|
|
320
129
|
};
|
|
321
130
|
export {
|
|
322
|
-
|
|
131
|
+
I as default
|
|
323
132
|
};
|
package/vue2-particles.umd.js
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* vue-class-component v7.2.6
|
|
3
|
-
* (c) 2015-present Evan You
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/function y(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(t){return typeof t}:y=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(e)}function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e){return E(e)||I(e)||x()}function E(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function I(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function x(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function T(){return typeof Reflect<"u"&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function N(e,t){m(e,t),Object.getOwnPropertyNames(t.prototype).forEach(function(r){m(e.prototype,t.prototype,r)}),Object.getOwnPropertyNames(t).forEach(function(r){m(e,t,r)})}function m(e,t,r){var n=r?Reflect.getOwnMetadataKeys(t,r):Reflect.getOwnMetadataKeys(t);n.forEach(function(i){var o=r?Reflect.getOwnMetadata(i,t,r):Reflect.getOwnMetadata(i,t);r?Reflect.defineMetadata(i,o,e,r):Reflect.defineMetadata(i,o,e)})}var V={__proto__:[]},z=V instanceof Array;function P(e){return function(t,r,n){var i=typeof t=="function"?t:t.constructor;i.__decorators__||(i.__decorators__=[]),typeof n!="number"&&(n=void 0),i.__decorators__.push(function(o){return e(o,r,n)})}}function F(e){var t=y(e);return e==null||t!=="object"&&t!=="function"}function w(e){typeof console<"u"&&console.warn("[vue-class-component] "+e)}function q(e,t){var r=t.prototype._init;t.prototype._init=function(){var o=this,c=Object.getOwnPropertyNames(e);if(e.$options.props)for(var s in e.$options.props)e.hasOwnProperty(s)||c.push(s);c.forEach(function(a){Object.defineProperty(o,a,{get:function(){return e[a]},set:function(k){e[a]=k},configurable:!0})})};var n=new t;t.prototype._init=r;var i={};return Object.keys(n).forEach(function(o){n[o]!==void 0&&(i[o]=n[o])}),process.env.NODE_ENV!=="production"&&!(t.prototype instanceof f)&&Object.keys(i).length>0&&w("Component class must inherit Vue or its descendant class when class property is used."),i}var b=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function O(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};t.name=t.name||e._componentTag||e.name;var r=e.prototype;Object.getOwnPropertyNames(r).forEach(function(s){if(s!=="constructor"){if(b.indexOf(s)>-1){t[s]=r[s];return}var a=Object.getOwnPropertyDescriptor(r,s);a.value!==void 0?typeof a.value=="function"?(t.methods||(t.methods={}))[s]=a.value:(t.mixins||(t.mixins=[])).push({data:function(){return S({},s,a.value)}}):(a.get||a.set)&&((t.computed||(t.computed={}))[s]={get:a.get,set:a.set})}}),(t.mixins||(t.mixins=[])).push({data:function(){return q(this,e)}});var n=e.__decorators__;n&&(n.forEach(function(s){return s(t)}),delete e.__decorators__);var i=Object.getPrototypeOf(e.prototype),o=i instanceof f?i.constructor:f,c=o.extend(t);return C(c,e,o),T()&&N(c,e),c}var H=["cid","super","options","superOptions","extendOptions","sealedOptions","component","directive","filter"],$={prototype:!0,arguments:!0,callee:!0,caller:!0};function C(e,t,r){Object.getOwnPropertyNames(t).forEach(function(n){if(!$[n]){var i=Object.getOwnPropertyDescriptor(e,n);if(!(i&&!i.configurable)){var o=Object.getOwnPropertyDescriptor(t,n);if(!z){if(n==="cid")return;var c=Object.getOwnPropertyDescriptor(r,n);if(!F(o.value)&&c&&c.value===o.value)return}process.env.NODE_ENV!=="production"&&H.indexOf(n)>=0&&w("Static property name '".concat(n,"' declared on class '").concat(t.name,"' ")+"conflicts with reserved property name of Vue internal. It may cause unexpected behavior of the component. Consider renaming the property."),Object.defineProperty(e,n,o)}}})}function j(e){return typeof e=="function"?O(e):function(t){return O(t,e)}}j.registerHooks=function(t){b.push.apply(b,D(t))};var L=typeof Reflect<"u"&&typeof Reflect.getMetadata<"u";function W(e,t,r){if(L&&!Array.isArray(e)&&typeof e!="function"&&!e.hasOwnProperty("type")&&typeof e.type>"u"){var n=Reflect.getMetadata("design:type",t,r);n!==Object&&(e.type=n)}}function v(e){return e===void 0&&(e={}),function(t,r){W(e,t,r),P(function(n,i){(n.props||(n.props={}))[i]=e})(t,r)}}function h(e,t){t===void 0&&(t={});var r=t.deep,n=r===void 0?!1:r,i=t.immediate,o=i===void 0?!1:i;return P(function(c,s){typeof c.watch!="object"&&(c.watch=Object.create(null));var a=c.watch;typeof a[e]=="object"&&!Array.isArray(a[e])?a[e]=[a[e]]:typeof a[e]>"u"&&(a[e]=[]),a[e].push({handler:s,deep:n,immediate:o})})}let _=!1,p,g;function U(e){if(_)return Promise.resolve();if(p&&g!==e)throw new Error("@tsparticles/vue2 init callback must be stable across the app lifecycle.");return p||(g=e,p=Promise.resolve(e==null?void 0:e(l.tsParticles)).then(()=>l.tsParticles.init()).then(()=>{_=!0}).catch(t=>{throw p=void 0,g=void 0,_=!1,t}),p)}function B(){return p??Promise.resolve()}function G(){return _}var J=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,d=(e,t,r,n)=>{for(var i=n>1?void 0:n?Q(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&J(t,r,i),i};async function M(e){var n;if(!e.id)throw new Error("Prop 'id' is required!");if(await B(),!G())throw new Error("@tsparticles/vue2 plugin initialization must be completed before rendering <VueParticles /> components.");const t=i=>{e.container=i,i&&e.particlesLoaded&&e.particlesLoaded(i)},r=await l.tsParticles.load({id:e.id,options:e.options??{},url:e.url});r&&e.theme&&((n=r.loadTheme)==null||n.call(r,e.theme)),t(r)}let u=class extends f{onPropChange(){this.container&&M(this)}onThemeChange(e){var t,r;this.container&&((r=(t=this.container).loadTheme)==null||r.call(t,e))}mounted(){this.$nextTick(()=>{M(this)})}beforeDestroy(){var e;(e=this.container)==null||e.destroy()}};d([v({required:!0})],u.prototype,"id",2),d([v()],u.prototype,"options",2),d([v()],u.prototype,"url",2),d([v()],u.prototype,"theme",2),d([v()],u.prototype,"particlesLoaded",2),d([h("options"),h("url"),h("id")],u.prototype,"onPropChange",1),d([h("theme")],u.prototype,"onThemeChange",1),u=d([j],u);function X(e,t,r,n,i,o,c,s){var a=typeof e=="function"?e.options:e;return t&&(a.render=t,a.staticRenderFns=r,a._compiled=!0),{exports:e,options:a}}var Y=function(){var t=this,r=t._self._c;return t._self._setupProxy,r("div",{attrs:{id:t.id}})},Z=[],K=X(u,Y,Z);const A=K.exports;return{install:(e,t)=>{e.component("VueParticles",A),e.component("VueParticles",A),U(t==null?void 0:t.init)}}}));
|
|
1
|
+
(function(i,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("@tsparticles/engine"),require("vue")):typeof define=="function"&&define.amd?define(["@tsparticles/engine","vue"],a):(i=typeof globalThis<"u"?globalThis:i||self,i["@tsparticles/vue2"]=a(i.tsParticles,i.Vue))})(this,(function(i,a){"use strict";let d=!1,n,u;function p(e){if(d)return Promise.resolve();if(n&&u!==e)throw new Error("@tsparticles/vue2 init callback must be stable across the app lifecycle.");return n||(u=e,n=Promise.resolve(e==null?void 0:e(i.tsParticles)).then(()=>i.tsParticles.init()).then(()=>{d=!0}).catch(t=>{throw n=void 0,u=void 0,d=!1,t}),n)}function v(){return n??Promise.resolve()}function P(){return d}async function f(e){var c;if(!e.id)throw new Error("Prop 'id' is required!");const t=e.loadGeneration;if(await v(),!P())throw new Error("@tsparticles/vue2 plugin initialization must be completed before rendering <VueParticles /> components.");const s=o=>{if(t!==e.loadGeneration){o==null||o.destroy();return}e.container=o,o&&e.particlesLoaded&&e.particlesLoaded(o)},r=await i.tsParticles.load({id:e.id,options:e.options??{},url:e.url});if(t!==e.loadGeneration){r==null||r.destroy();return}r&&e.theme&&((c=r.loadTheme)==null||c.call(r,e.theme)),s(r)}const m=a.extend({props:{id:{required:!0,type:String},options:{default:void 0,type:Object},url:{default:void 0,type:String},theme:{default:void 0,type:String},particlesLoaded:{default:void 0,type:Function}},data(){return{container:void 0,loadGeneration:0}},watch:{options(){this.onPropChange()},url(){this.onPropChange()},id(){this.onPropChange()},theme(e){this.onThemeChange(e)}},mounted(){this.$nextTick(()=>{f(this)})},beforeUnmount(){var e;this.loadGeneration++,(e=this.container)==null||e.destroy()},methods:{onPropChange(){var e;(e=this.container)==null||e.destroy(),this.container=void 0,this.loadGeneration++,f(this)},onThemeChange(e){var t,s;this.container&&((s=(t=this.container).loadTheme)==null||s.call(t,e))}}});function _(e,t,s,r,c,o,C,T){var l=typeof e=="function"?e.options:e;return t&&(l.render=t,l.staticRenderFns=s,l._compiled=!0),{exports:e,options:l}}var y=function(){var t=this,s=t._self._c;return t._self._setupProxy,s("div",{attrs:{id:t.id}})},w=[],g=_(m,y,w);const h=g.exports;return{install:(e,t)=>{e.component("VueParticles",h),e.component("VueParticles",h),p(t==null?void 0:t.init)}}}));
|