plugin-tls 4.6.0 → 4.7.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/dist/{createTierModeOptionsPluginHost-3jPWAW92.js → createTierModeOptionsPluginHost-D-fKYlcA.js} +202 -188
- package/dist/createTierModeOptionsPluginHost-DyDtXKNW.cjs +1 -0
- package/dist/index-node.cjs +1 -1
- package/dist/index-node.js +3 -3
- package/dist/index-web.cjs +1 -1
- package/dist/index-web.js +10 -10
- package/dist/index.cjs +1 -1
- package/dist/index.js +146 -120
- package/dist/plugin-manager/ExtendManager.d.ts +15 -5
- package/dist/plugin-manager/ExtendManager.d.ts.map +1 -1
- package/dist/plugin-manager/PluginExtendManager.d.ts +20 -5
- package/dist/plugin-manager/PluginExtendManager.d.ts.map +1 -1
- package/dist/plugin-manager/PluginManager.d.ts +20 -6
- package/dist/plugin-manager/PluginManager.d.ts.map +1 -1
- package/dist/plugin-manager/index.d.ts +1 -0
- package/dist/plugin-manager/index.d.ts.map +1 -1
- package/dist/plugin-manager/type.d.ts +2 -0
- package/dist/plugin-manager/type.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/createTierModeOptionsPluginHost-GosxwlJk.cjs +0 -1
|
@@ -1,87 +1,95 @@
|
|
|
1
|
-
import { Destroyable as
|
|
2
|
-
import { deepmergeInto as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { Destroyable as x, createDestroyableSubClass as T } from "@gby/destroyable";
|
|
2
|
+
import { deepmergeInto as f, deepmerge as y } from "deepmerge-ts";
|
|
3
|
+
import { waitAsyncable as g } from "type-tls";
|
|
4
|
+
import { omitMembers as D, removeUndefined as E, pickMembers as v, serialCallFuns as O } from "com-tools";
|
|
5
|
+
function a(s, ...t) {
|
|
5
6
|
for (const e of t) {
|
|
6
7
|
const n = Object.getOwnPropertyDescriptors(e);
|
|
7
|
-
Object.defineProperties(
|
|
8
|
+
Object.defineProperties(s, n);
|
|
8
9
|
}
|
|
9
|
-
return
|
|
10
|
+
return s;
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
+
function S(s, t, e) {
|
|
12
13
|
let n = Object.getOwnPropertyDescriptors(t);
|
|
13
|
-
return e &&
|
|
14
|
+
return e && D(n, e), Object.defineProperties(s, n), s;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function R(s, t, e) {
|
|
16
17
|
let n = Object.getOwnPropertyDescriptors(t);
|
|
17
|
-
return e ? Object.defineProperties(
|
|
18
|
+
return e ? Object.defineProperties(s, E(v(n, e))) : Object.defineProperties(s, n), s;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function A(s, t) {
|
|
20
21
|
return t;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function B(s) {
|
|
23
24
|
return function(e) {
|
|
24
25
|
return e;
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
28
|
+
function z(s, t) {
|
|
29
|
+
return a(s, t), t;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function K(s) {
|
|
31
32
|
return function(e) {
|
|
32
|
-
return
|
|
33
|
+
return a(s, e), e;
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
36
|
+
function $(s, t) {
|
|
37
|
+
return a(s, t), s;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function q(s) {
|
|
39
40
|
return function(e) {
|
|
40
|
-
return
|
|
41
|
+
return a(s, e), s;
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
const
|
|
44
|
-
function
|
|
45
|
-
const t = { ...
|
|
46
|
-
for (const e of
|
|
44
|
+
const P = ["onCreate", "onInit", "onDestroy"];
|
|
45
|
+
function G(s) {
|
|
46
|
+
const t = { ...s };
|
|
47
|
+
for (const e of P)
|
|
47
48
|
typeof t[e] == "function" && delete t[e];
|
|
48
49
|
return t;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function N(s, t) {
|
|
51
52
|
let e = Object.getOwnPropertyDescriptors(t);
|
|
52
|
-
for (const n of
|
|
53
|
+
for (const n of P)
|
|
53
54
|
typeof t[n] == "function" && delete e[n];
|
|
54
|
-
return Object.defineProperties(
|
|
55
|
+
return Object.defineProperties(s, e), s;
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function L(s, t) {
|
|
57
58
|
return t;
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function J(s) {
|
|
60
61
|
return function(e) {
|
|
61
62
|
return e;
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
65
|
+
function Q(s, t) {
|
|
66
|
+
return a(s.prototype, t), t;
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
+
function W(s) {
|
|
68
69
|
return function(e) {
|
|
69
|
-
return
|
|
70
|
+
return a(s.prototype, e), e;
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
73
|
+
function X(s, t) {
|
|
74
|
+
return a(s.prototype, t), s;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function Y(s) {
|
|
76
77
|
return function(e) {
|
|
77
|
-
return
|
|
78
|
+
return a(s.prototype, e), s;
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
81
|
+
function V(s) {
|
|
82
|
+
return s && typeof s.onUse == "function";
|
|
82
83
|
}
|
|
83
|
-
const
|
|
84
|
-
class
|
|
84
|
+
const d = /* @__PURE__ */ Symbol("extend");
|
|
85
|
+
class c extends x {
|
|
86
|
+
/**
|
|
87
|
+
* 父级插件管理者
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* 当子类创建了子类插件管理者时,为了能让父类插件管理者的插件生效,需要将父类插件管理者设置为其 parent
|
|
91
|
+
*/
|
|
92
|
+
parent;
|
|
85
93
|
/**
|
|
86
94
|
* 插件的宿主
|
|
87
95
|
*/
|
|
@@ -93,8 +101,8 @@ class p extends M {
|
|
|
93
101
|
/**
|
|
94
102
|
* @param host - 插件的宿主
|
|
95
103
|
*/
|
|
96
|
-
constructor(t) {
|
|
97
|
-
super(), t && (this.host = t);
|
|
104
|
+
constructor(t, e) {
|
|
105
|
+
super(), this.parent = e, t && (this.host = t);
|
|
98
106
|
}
|
|
99
107
|
destroyThis() {
|
|
100
108
|
return this.plugins.clear(), this.host = null, super.destroyThis();
|
|
@@ -105,7 +113,16 @@ class p extends M {
|
|
|
105
113
|
* @returns 是否注册了插件 或 扩展
|
|
106
114
|
*/
|
|
107
115
|
hasUsed(t) {
|
|
108
|
-
return this.plugins.has(t);
|
|
116
|
+
return this.parent?.hasUsed(t) || this.plugins.has(t);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 获取插件 或 扩展 的 use 的返回值
|
|
120
|
+
* @param plugin
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
getUseReturn(t) {
|
|
124
|
+
const { parent: e } = this;
|
|
125
|
+
return e?.hasUsed(t) ? e.getUseReturn(t) : this.plugins.get(t);
|
|
109
126
|
}
|
|
110
127
|
/**
|
|
111
128
|
* 判断一个对象是否是插件
|
|
@@ -113,8 +130,7 @@ class p extends M {
|
|
|
113
130
|
* @returns
|
|
114
131
|
*/
|
|
115
132
|
isPlugin(t) {
|
|
116
|
-
|
|
117
|
-
return e.has(t) ? e.get(t) !== l : N(t);
|
|
133
|
+
return this.hasUsed(t) ? this.getUseReturn(t) !== d : V(t);
|
|
118
134
|
}
|
|
119
135
|
/**
|
|
120
136
|
* 使用插件、注册插件
|
|
@@ -122,8 +138,7 @@ class p extends M {
|
|
|
122
138
|
* @param args - 传递给插件的选项
|
|
123
139
|
*/
|
|
124
140
|
useExtend(t) {
|
|
125
|
-
|
|
126
|
-
return e.has(t) ? e.get(t) : (v(this.host.prototype, t), e.set(t, l), t);
|
|
141
|
+
return this.hasUsed(t) || (N(this.host.prototype, t), this.plugins.set(t, d)), t;
|
|
127
142
|
}
|
|
128
143
|
/**
|
|
129
144
|
* 插件宿主实例的注册插件的方法
|
|
@@ -133,8 +148,7 @@ class p extends M {
|
|
|
133
148
|
* @param hostInst - 插件宿主的新实例
|
|
134
149
|
*/
|
|
135
150
|
instUseExtend(t, e, ...n) {
|
|
136
|
-
|
|
137
|
-
return s.has(e) ? s.get(e) : (this.useExtend(e), e.onCreate?.call(t, t, ...n), e);
|
|
151
|
+
return this.hasUsed(e) || (this.useExtend(e), e.onCreate?.call(t, t, ...n)), e;
|
|
138
152
|
}
|
|
139
153
|
/**
|
|
140
154
|
* 使用插件、注册插件
|
|
@@ -142,10 +156,9 @@ class p extends M {
|
|
|
142
156
|
* @param args - 传递给插件的选项
|
|
143
157
|
*/
|
|
144
158
|
usePlugin(t, ...e) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return n.set(t, s), s;
|
|
159
|
+
if (this.hasUsed(t)) return this.getUseReturn(t);
|
|
160
|
+
const n = t.onUse(this.host, ...e);
|
|
161
|
+
return this.plugins.set(t, n), n;
|
|
149
162
|
}
|
|
150
163
|
/**
|
|
151
164
|
* 插件宿主实例的注册插件的方法
|
|
@@ -155,10 +168,9 @@ class p extends M {
|
|
|
155
168
|
* @param hostInst - 插件宿主的新实例
|
|
156
169
|
*/
|
|
157
170
|
instUsePlugin(t, e, ...n) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return e.onCreate?.(t), r;
|
|
171
|
+
if (this.hasUsed(e)) return this.getUseReturn(e);
|
|
172
|
+
const i = this.usePlugin(e, ...n);
|
|
173
|
+
return e.onCreate?.(t), i;
|
|
162
174
|
}
|
|
163
175
|
/**
|
|
164
176
|
* 插件宿主创建实例时调用
|
|
@@ -169,13 +181,13 @@ class p extends M {
|
|
|
169
181
|
* @param hostInst - 插件宿主的新实例
|
|
170
182
|
*/
|
|
171
183
|
onCreate(t, ...e) {
|
|
172
|
-
const n = [];
|
|
173
|
-
for (const [
|
|
174
|
-
if (
|
|
175
|
-
const
|
|
176
|
-
|
|
184
|
+
const n = this.parent?.onCreate(t, ...e), i = [];
|
|
185
|
+
for (const [r, o] of this.plugins)
|
|
186
|
+
if (r.onCreate) {
|
|
187
|
+
const u = o === d ? r.onCreate : r.onCreate.bind(r);
|
|
188
|
+
i.push(u);
|
|
177
189
|
}
|
|
178
|
-
return
|
|
190
|
+
return g(n, () => O(i, t, [t, ...e]));
|
|
179
191
|
}
|
|
180
192
|
/**
|
|
181
193
|
* 插件宿主创建实例时调用
|
|
@@ -186,13 +198,13 @@ class p extends M {
|
|
|
186
198
|
* @param args - 初始化宿主实例时的参数
|
|
187
199
|
*/
|
|
188
200
|
onInit(t, ...e) {
|
|
189
|
-
const n = [];
|
|
190
|
-
for (const [
|
|
191
|
-
if (
|
|
192
|
-
const
|
|
193
|
-
|
|
201
|
+
const n = this.parent?.onInit(t, ...e), i = [];
|
|
202
|
+
for (const [r, o] of this.plugins)
|
|
203
|
+
if (r.onInit) {
|
|
204
|
+
const u = o === d ? r.onInit : r.onInit.bind(r);
|
|
205
|
+
i.push(u);
|
|
194
206
|
}
|
|
195
|
-
return
|
|
207
|
+
return g(n, () => O(i, t, [t, ...e]));
|
|
196
208
|
}
|
|
197
209
|
/**
|
|
198
210
|
* 插件宿主被销毁时调用
|
|
@@ -203,43 +215,45 @@ class p extends M {
|
|
|
203
215
|
*/
|
|
204
216
|
onDestroy(t) {
|
|
205
217
|
const e = [];
|
|
206
|
-
for (const [
|
|
207
|
-
if (
|
|
208
|
-
const
|
|
209
|
-
e.push(
|
|
218
|
+
for (const [r, o] of this.plugins)
|
|
219
|
+
if (r.onDestroy) {
|
|
220
|
+
const u = o === d ? r.onDestroy : r.onDestroy.bind(r);
|
|
221
|
+
e.push(u);
|
|
210
222
|
}
|
|
211
|
-
|
|
223
|
+
e.reverse();
|
|
224
|
+
const n = O(e, t, [t]), { parent: i } = this;
|
|
225
|
+
return i ? g(n, () => i.onDestroy(t)) : n;
|
|
212
226
|
}
|
|
213
227
|
}
|
|
214
|
-
function
|
|
215
|
-
const t =
|
|
228
|
+
function _(s) {
|
|
229
|
+
const t = s.split(".");
|
|
216
230
|
return t[0] === "" && t.shift(), t;
|
|
217
231
|
}
|
|
218
|
-
function
|
|
232
|
+
function M(s, t) {
|
|
219
233
|
for (const e of t)
|
|
220
|
-
if (
|
|
221
|
-
return
|
|
234
|
+
if (s = s[e], s == null) return;
|
|
235
|
+
return s;
|
|
222
236
|
}
|
|
223
|
-
function
|
|
224
|
-
return
|
|
237
|
+
function Z(s, t) {
|
|
238
|
+
return M(s, _(t));
|
|
225
239
|
}
|
|
226
|
-
function
|
|
227
|
-
const n = t.pop(),
|
|
240
|
+
function b(s, t, e) {
|
|
241
|
+
const n = t.pop(), i = t.length;
|
|
228
242
|
let r = 0;
|
|
229
|
-
for (; r <
|
|
230
|
-
const o =
|
|
243
|
+
for (; r < i; ) {
|
|
244
|
+
const o = s[t[r]];
|
|
231
245
|
if (o == null) break;
|
|
232
|
-
|
|
246
|
+
s = o, r++;
|
|
233
247
|
}
|
|
234
248
|
t = t.slice(r);
|
|
235
249
|
for (const o of t)
|
|
236
|
-
|
|
237
|
-
return
|
|
250
|
+
s = s[o] = {};
|
|
251
|
+
return s[n] = e, s;
|
|
238
252
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
253
|
+
function tt(s, t, e) {
|
|
254
|
+
return b(s, _(t), e);
|
|
241
255
|
}
|
|
242
|
-
const
|
|
256
|
+
const m = {
|
|
243
257
|
UndefinedAndNull: function(t) {
|
|
244
258
|
return t == null;
|
|
245
259
|
},
|
|
@@ -250,7 +264,7 @@ const g = {
|
|
|
250
264
|
return t === null;
|
|
251
265
|
}
|
|
252
266
|
};
|
|
253
|
-
class
|
|
267
|
+
class U {
|
|
254
268
|
/**
|
|
255
269
|
* 是否要冻结 fullOption 的成员
|
|
256
270
|
* @remarks
|
|
@@ -266,11 +280,11 @@ class b {
|
|
|
266
280
|
fullOption = new Proxy(this, {
|
|
267
281
|
// @ts-ignore
|
|
268
282
|
get: function(t, e, n) {
|
|
269
|
-
const
|
|
270
|
-
return t.freezeMember ? Object.freeze(
|
|
283
|
+
const i = t.plainFullOption[e];
|
|
284
|
+
return t.freezeMember ? Object.freeze(i) : i;
|
|
271
285
|
},
|
|
272
286
|
// @ts-ignore
|
|
273
|
-
set: function(t, e, n,
|
|
287
|
+
set: function(t, e, n, i) {
|
|
274
288
|
return t.setMember(e, n, !1), !0;
|
|
275
289
|
},
|
|
276
290
|
// @ts-ignore
|
|
@@ -302,7 +316,7 @@ class b {
|
|
|
302
316
|
* @param deep - 是否要进行深度合并
|
|
303
317
|
*/
|
|
304
318
|
setOption(t, e) {
|
|
305
|
-
const n = e ?
|
|
319
|
+
const n = e ? f(this.option, t) : Object.assign(this.option, t);
|
|
306
320
|
return this.updateFullOption(), n;
|
|
307
321
|
}
|
|
308
322
|
/**
|
|
@@ -312,13 +326,13 @@ class b {
|
|
|
312
326
|
return this._undefinedValue;
|
|
313
327
|
}
|
|
314
328
|
set undefinedValue(t) {
|
|
315
|
-
this._undefinedValue = t, this.isUndefined =
|
|
329
|
+
this._undefinedValue = t, this.isUndefined = m[t] || m.UndefinedAndNull;
|
|
316
330
|
}
|
|
317
331
|
_undefinedValue = "UndefinedAndNull";
|
|
318
332
|
/**
|
|
319
333
|
* 未定义值的判断函数
|
|
320
334
|
*/
|
|
321
|
-
isUndefined =
|
|
335
|
+
isUndefined = m.UndefinedAndNull;
|
|
322
336
|
/**
|
|
323
337
|
* 获取选项成员
|
|
324
338
|
* @param key
|
|
@@ -334,12 +348,12 @@ class b {
|
|
|
334
348
|
* @param deep - 是否要进行深度合并
|
|
335
349
|
*/
|
|
336
350
|
setMember(t, e, n) {
|
|
337
|
-
const
|
|
351
|
+
const i = this.option;
|
|
338
352
|
if (e === void 0)
|
|
339
|
-
delete
|
|
353
|
+
delete i[t];
|
|
340
354
|
else {
|
|
341
|
-
const r =
|
|
342
|
-
n && r && typeof r == "object" ?
|
|
355
|
+
const r = i[t];
|
|
356
|
+
n && r && typeof r == "object" ? f(r, e) : i[t] = e;
|
|
343
357
|
}
|
|
344
358
|
this.updateFullOption();
|
|
345
359
|
}
|
|
@@ -349,7 +363,7 @@ class b {
|
|
|
349
363
|
* @returns
|
|
350
364
|
*/
|
|
351
365
|
getValue(t) {
|
|
352
|
-
return
|
|
366
|
+
return M(this.option, t);
|
|
353
367
|
}
|
|
354
368
|
/**
|
|
355
369
|
* 设置属性路径对应的值
|
|
@@ -359,12 +373,12 @@ class b {
|
|
|
359
373
|
* @returns
|
|
360
374
|
*/
|
|
361
375
|
setValue(t, e, n) {
|
|
362
|
-
const
|
|
376
|
+
const i = this.option;
|
|
363
377
|
let r;
|
|
364
|
-
n && (r =
|
|
378
|
+
n && (r = M(i, t)) && typeof r == "object" ? f(r, e) : b(this.option, t, e), this.updateFullOption();
|
|
365
379
|
}
|
|
366
380
|
}
|
|
367
|
-
class
|
|
381
|
+
class l extends U {
|
|
368
382
|
constructor(t, e) {
|
|
369
383
|
super(), t && (this.option = t), e && (this.extends = e);
|
|
370
384
|
}
|
|
@@ -392,8 +406,8 @@ class a extends b {
|
|
|
392
406
|
if (t) return t;
|
|
393
407
|
const { extends: e, option: n } = this;
|
|
394
408
|
if (t = n, e) {
|
|
395
|
-
const
|
|
396
|
-
t =
|
|
409
|
+
const i = e.plainFullOption;
|
|
410
|
+
t = y(i, n);
|
|
397
411
|
}
|
|
398
412
|
return this._plainFullOption = t;
|
|
399
413
|
}
|
|
@@ -429,15 +443,15 @@ class a extends b {
|
|
|
429
443
|
return n.getValue(t);
|
|
430
444
|
}
|
|
431
445
|
}
|
|
432
|
-
function
|
|
446
|
+
function et(s, t) {
|
|
433
447
|
const { name: e } = t, n = `_${e}`;
|
|
434
448
|
return {
|
|
435
449
|
get: function() {
|
|
436
|
-
return this[n] || (this[n] = new
|
|
450
|
+
return this[n] || (this[n] = new l(void 0, this.constructor[e]));
|
|
437
451
|
}
|
|
438
452
|
};
|
|
439
453
|
}
|
|
440
|
-
class
|
|
454
|
+
class k extends U {
|
|
441
455
|
constructor(t, e) {
|
|
442
456
|
super(), e && this.setModeOption(t, e), this.mode = t;
|
|
443
457
|
}
|
|
@@ -526,16 +540,16 @@ class V extends b {
|
|
|
526
540
|
* @param deep - 是否要进行深度合并
|
|
527
541
|
* @param extend - 继承哪个模式
|
|
528
542
|
*/
|
|
529
|
-
setModeOption(t, e, n,
|
|
530
|
-
const { modes: r } = this, o = r[t] || (r[t] = new
|
|
531
|
-
if (o.setOption(e, n),
|
|
532
|
-
const
|
|
533
|
-
|
|
543
|
+
setModeOption(t, e, n, i) {
|
|
544
|
+
const { modes: r } = this, o = r[t] || (r[t] = new l());
|
|
545
|
+
if (o.setOption(e, n), i) {
|
|
546
|
+
const u = r[i];
|
|
547
|
+
u && (o.extends = u);
|
|
534
548
|
}
|
|
535
549
|
return this.updateFullOption(), o;
|
|
536
550
|
}
|
|
537
551
|
}
|
|
538
|
-
class
|
|
552
|
+
class p extends k {
|
|
539
553
|
constructor(t, e, n) {
|
|
540
554
|
super(t, e), n && (this.extends = n);
|
|
541
555
|
}
|
|
@@ -557,12 +571,12 @@ class d extends V {
|
|
|
557
571
|
* @returns
|
|
558
572
|
*/
|
|
559
573
|
getFullModeOption(t) {
|
|
560
|
-
const { modes: e, extends: n } = this,
|
|
574
|
+
const { modes: e, extends: n } = this, i = e[t]?.plainFullOption;
|
|
561
575
|
if (n) {
|
|
562
576
|
const r = n.getFullModeOption(t);
|
|
563
|
-
return
|
|
577
|
+
return i ? y(r, i) : r;
|
|
564
578
|
}
|
|
565
|
-
return
|
|
579
|
+
return i;
|
|
566
580
|
}
|
|
567
581
|
/**
|
|
568
582
|
* 获取所有的模式名字
|
|
@@ -571,8 +585,8 @@ class d extends V {
|
|
|
571
585
|
getModeNames() {
|
|
572
586
|
const { modes: t, extends: e } = this, n = Object.keys(t);
|
|
573
587
|
if (!e) return n;
|
|
574
|
-
const
|
|
575
|
-
return [.../* @__PURE__ */ new Set([...n, ...
|
|
588
|
+
const i = e.getModeNames();
|
|
589
|
+
return [.../* @__PURE__ */ new Set([...n, ...i])];
|
|
576
590
|
}
|
|
577
591
|
/**
|
|
578
592
|
* 在整个层级上判断是否有某个模式
|
|
@@ -624,15 +638,15 @@ class d extends V {
|
|
|
624
638
|
return n.getValue(t);
|
|
625
639
|
}
|
|
626
640
|
}
|
|
627
|
-
function
|
|
641
|
+
function nt(s, t) {
|
|
628
642
|
const { name: e } = t, n = `_${e}`;
|
|
629
643
|
return {
|
|
630
644
|
get: function() {
|
|
631
|
-
return this[n] || (this[n] = new
|
|
645
|
+
return this[n] || (this[n] = new p(this.constructor[e].mode, void 0, this.constructor[e]));
|
|
632
646
|
}
|
|
633
647
|
};
|
|
634
648
|
}
|
|
635
|
-
class F extends
|
|
649
|
+
class F extends x {
|
|
636
650
|
/**
|
|
637
651
|
* 是否使用独立的插件管理器
|
|
638
652
|
* @defaultValue false
|
|
@@ -642,9 +656,9 @@ class F extends M {
|
|
|
642
656
|
* 插件管理器
|
|
643
657
|
*/
|
|
644
658
|
static get pluginManager() {
|
|
645
|
-
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new
|
|
659
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new c(this, this._pluginManager)), this._pluginManager;
|
|
646
660
|
}
|
|
647
|
-
static _pluginManager = new
|
|
661
|
+
static _pluginManager = new c(this);
|
|
648
662
|
/**
|
|
649
663
|
* 插件管理器 {@link PluginHost.pluginManager}
|
|
650
664
|
*/
|
|
@@ -715,24 +729,24 @@ class F extends M {
|
|
|
715
729
|
return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
|
|
716
730
|
}
|
|
717
731
|
}
|
|
718
|
-
class
|
|
732
|
+
class st extends F {
|
|
719
733
|
/**
|
|
720
734
|
* 全局级别的默认选项
|
|
721
735
|
*/
|
|
722
|
-
static defaultOptions = new
|
|
736
|
+
static defaultOptions = new l();
|
|
723
737
|
/**
|
|
724
738
|
* 实例级的默认选项
|
|
725
739
|
*/
|
|
726
740
|
get defaultOptions() {
|
|
727
|
-
return this._defaultOptions || (this._defaultOptions = new
|
|
741
|
+
return this._defaultOptions || (this._defaultOptions = new l(void 0, this.constructor.defaultOptions));
|
|
728
742
|
}
|
|
729
743
|
_defaultOptions;
|
|
730
744
|
constructor(t) {
|
|
731
745
|
super(), this.defaultOptions.option = t;
|
|
732
746
|
}
|
|
733
747
|
}
|
|
734
|
-
function w(
|
|
735
|
-
const t =
|
|
748
|
+
function w(s) {
|
|
749
|
+
const t = T(s);
|
|
736
750
|
return class extends t {
|
|
737
751
|
/**
|
|
738
752
|
* 是否使用独立的插件管理器
|
|
@@ -743,9 +757,9 @@ function w(i) {
|
|
|
743
757
|
* 插件管理器
|
|
744
758
|
*/
|
|
745
759
|
static get pluginManager() {
|
|
746
|
-
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new
|
|
760
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new c(this, this._pluginManager)), this._pluginManager;
|
|
747
761
|
}
|
|
748
|
-
static _pluginManager = new
|
|
762
|
+
static _pluginManager = new c(this);
|
|
749
763
|
/**
|
|
750
764
|
* 插件管理器 {@link PluginHostSub.pluginManager}
|
|
751
765
|
*/
|
|
@@ -755,8 +769,8 @@ function w(i) {
|
|
|
755
769
|
/**
|
|
756
770
|
* {@inheritDoc PluginExtendManager.usePlugin}
|
|
757
771
|
*/
|
|
758
|
-
static usePlugin(n, ...
|
|
759
|
-
return this.pluginManager.usePlugin(n, ...
|
|
772
|
+
static usePlugin(n, ...i) {
|
|
773
|
+
return this.pluginManager.usePlugin(n, ...i);
|
|
760
774
|
}
|
|
761
775
|
/**
|
|
762
776
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
@@ -788,14 +802,14 @@ function w(i) {
|
|
|
788
802
|
* @param args
|
|
789
803
|
* @returns
|
|
790
804
|
*/
|
|
791
|
-
usePlugin(n, ...
|
|
792
|
-
return this.pluginManager.instUsePlugin(this, n, ...
|
|
805
|
+
usePlugin(n, ...i) {
|
|
806
|
+
return this.pluginManager.instUsePlugin(this, n, ...i);
|
|
793
807
|
}
|
|
794
808
|
/**
|
|
795
809
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
796
810
|
*/
|
|
797
|
-
useExtend(n, ...
|
|
798
|
-
return this.pluginManager.instUseExtend(this, n, ...
|
|
811
|
+
useExtend(n, ...i) {
|
|
812
|
+
return this.pluginManager.instUseExtend(this, n, ...i);
|
|
799
813
|
}
|
|
800
814
|
/**
|
|
801
815
|
* 初始化实例
|
|
@@ -816,18 +830,18 @@ function w(i) {
|
|
|
816
830
|
}
|
|
817
831
|
};
|
|
818
832
|
}
|
|
819
|
-
function
|
|
820
|
-
const t = w(
|
|
833
|
+
function ot(s) {
|
|
834
|
+
const t = w(s);
|
|
821
835
|
return class extends t {
|
|
822
836
|
/**
|
|
823
837
|
* 全局级别的默认选项
|
|
824
838
|
*/
|
|
825
|
-
static defaultOptions = new
|
|
839
|
+
static defaultOptions = new l();
|
|
826
840
|
/**
|
|
827
841
|
* 实例级的默认选项
|
|
828
842
|
*/
|
|
829
843
|
get defaultOptions() {
|
|
830
|
-
return this._defaultOptions || (this._defaultOptions = new
|
|
844
|
+
return this._defaultOptions || (this._defaultOptions = new l(void 0, this.constructor.defaultOptions));
|
|
831
845
|
}
|
|
832
846
|
_defaultOptions;
|
|
833
847
|
constructor(n) {
|
|
@@ -835,17 +849,17 @@ function st(i) {
|
|
|
835
849
|
}
|
|
836
850
|
};
|
|
837
851
|
}
|
|
838
|
-
const
|
|
839
|
-
class
|
|
852
|
+
const h = "common";
|
|
853
|
+
class ut extends F {
|
|
840
854
|
/**
|
|
841
855
|
* 全局级别的默认选项
|
|
842
856
|
*/
|
|
843
|
-
static modeOptions = new
|
|
857
|
+
static modeOptions = new p(h);
|
|
844
858
|
/**
|
|
845
859
|
* 实例级的默认选项
|
|
846
860
|
*/
|
|
847
861
|
get modeOptions() {
|
|
848
|
-
return this._modeOptions || (this._modeOptions = new
|
|
862
|
+
return this._modeOptions || (this._modeOptions = new p(h, void 0, this.constructor.modeOptions));
|
|
849
863
|
}
|
|
850
864
|
_modeOptions;
|
|
851
865
|
get mode() {
|
|
@@ -861,18 +875,18 @@ class rt extends F {
|
|
|
861
875
|
super(), this.modeOptions.setOption(t);
|
|
862
876
|
}
|
|
863
877
|
}
|
|
864
|
-
function
|
|
865
|
-
const t = w(
|
|
878
|
+
function lt(s) {
|
|
879
|
+
const t = w(s);
|
|
866
880
|
return class extends t {
|
|
867
881
|
/**
|
|
868
882
|
* 全局级别的默认选项
|
|
869
883
|
*/
|
|
870
|
-
static modeOptions = new
|
|
884
|
+
static modeOptions = new p(h);
|
|
871
885
|
/**
|
|
872
886
|
* 实例级的默认选项
|
|
873
887
|
*/
|
|
874
888
|
get modeOptions() {
|
|
875
|
-
return this._modeOptions || (this._modeOptions = new
|
|
889
|
+
return this._modeOptions || (this._modeOptions = new p(h, void 0, this.constructor.modeOptions));
|
|
876
890
|
}
|
|
877
891
|
_modeOptions;
|
|
878
892
|
get mode() {
|
|
@@ -890,41 +904,41 @@ function ut(i) {
|
|
|
890
904
|
};
|
|
891
905
|
}
|
|
892
906
|
export {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
c,
|
|
907
|
-
|
|
907
|
+
_ as A,
|
|
908
|
+
G as B,
|
|
909
|
+
b as C,
|
|
910
|
+
tt as D,
|
|
911
|
+
Q as E,
|
|
912
|
+
z as F,
|
|
913
|
+
nt as G,
|
|
914
|
+
et as H,
|
|
915
|
+
k as M,
|
|
916
|
+
c as P,
|
|
917
|
+
p as T,
|
|
918
|
+
N as a,
|
|
919
|
+
$ as b,
|
|
920
|
+
h as c,
|
|
921
|
+
l as d,
|
|
908
922
|
F as e,
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
923
|
+
ut as f,
|
|
924
|
+
st as g,
|
|
925
|
+
J as h,
|
|
926
|
+
B as i,
|
|
927
|
+
Y as j,
|
|
928
|
+
q as k,
|
|
915
929
|
w as l,
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
+
a as m,
|
|
931
|
+
W as n,
|
|
932
|
+
K as o,
|
|
933
|
+
lt as p,
|
|
934
|
+
ot as q,
|
|
935
|
+
L as r,
|
|
936
|
+
A as s,
|
|
937
|
+
d as t,
|
|
938
|
+
M as u,
|
|
939
|
+
Z as v,
|
|
940
|
+
X as w,
|
|
941
|
+
V as x,
|
|
942
|
+
S as y,
|
|
943
|
+
R as z
|
|
930
944
|
};
|