plugin-tls 4.5.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-CeND_z6P.js → createTierModeOptionsPluginHost-D-fKYlcA.js} +248 -156
- package/dist/createTierModeOptionsPluginHost-DyDtXKNW.cjs +1 -0
- package/dist/index-node.cjs +1 -1
- package/dist/index-node.js +9 -9
- package/dist/index-web.cjs +1 -1
- package/dist/index-web.js +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +220 -227
- package/dist/plugin-manager/ExtendManager.d.ts +15 -5
- package/dist/plugin-manager/ExtendManager.d.ts.map +1 -1
- package/dist/plugin-manager/IExtend.d.ts +64 -0
- package/dist/plugin-manager/IExtend.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/extend.d.ts +1 -1
- package/dist/plugin-manager/extend.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-C3kmxB00.cjs +0 -1
|
@@ -1,24 +1,95 @@
|
|
|
1
|
-
import { Destroyable as
|
|
2
|
-
import { deepmergeInto as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
const t
|
|
7
|
-
|
|
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) {
|
|
6
|
+
for (const e of t) {
|
|
7
|
+
const n = Object.getOwnPropertyDescriptors(e);
|
|
8
|
+
Object.defineProperties(s, n);
|
|
9
|
+
}
|
|
10
|
+
return s;
|
|
11
|
+
}
|
|
12
|
+
function S(s, t, e) {
|
|
13
|
+
let n = Object.getOwnPropertyDescriptors(t);
|
|
14
|
+
return e && D(n, e), Object.defineProperties(s, n), s;
|
|
15
|
+
}
|
|
16
|
+
function R(s, t, e) {
|
|
17
|
+
let n = Object.getOwnPropertyDescriptors(t);
|
|
18
|
+
return e ? Object.defineProperties(s, E(v(n, e))) : Object.defineProperties(s, n), s;
|
|
19
|
+
}
|
|
20
|
+
function A(s, t) {
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
function B(s) {
|
|
24
|
+
return function(e) {
|
|
25
|
+
return e;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function z(s, t) {
|
|
29
|
+
return a(s, t), t;
|
|
30
|
+
}
|
|
31
|
+
function K(s) {
|
|
32
|
+
return function(e) {
|
|
33
|
+
return a(s, e), e;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function $(s, t) {
|
|
37
|
+
return a(s, t), s;
|
|
38
|
+
}
|
|
39
|
+
function q(s) {
|
|
40
|
+
return function(e) {
|
|
41
|
+
return a(s, e), s;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const P = ["onCreate", "onInit", "onDestroy"];
|
|
45
|
+
function G(s) {
|
|
46
|
+
const t = { ...s };
|
|
47
|
+
for (const e of P)
|
|
8
48
|
typeof t[e] == "function" && delete t[e];
|
|
9
49
|
return t;
|
|
10
50
|
}
|
|
11
|
-
function
|
|
51
|
+
function N(s, t) {
|
|
12
52
|
let e = Object.getOwnPropertyDescriptors(t);
|
|
13
|
-
for (const n of
|
|
53
|
+
for (const n of P)
|
|
14
54
|
typeof t[n] == "function" && delete e[n];
|
|
15
|
-
return Object.defineProperties(
|
|
55
|
+
return Object.defineProperties(s, e), s;
|
|
56
|
+
}
|
|
57
|
+
function L(s, t) {
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
function J(s) {
|
|
61
|
+
return function(e) {
|
|
62
|
+
return e;
|
|
63
|
+
};
|
|
16
64
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
65
|
+
function Q(s, t) {
|
|
66
|
+
return a(s.prototype, t), t;
|
|
19
67
|
}
|
|
20
|
-
|
|
21
|
-
|
|
68
|
+
function W(s) {
|
|
69
|
+
return function(e) {
|
|
70
|
+
return a(s.prototype, e), e;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function X(s, t) {
|
|
74
|
+
return a(s.prototype, t), s;
|
|
75
|
+
}
|
|
76
|
+
function Y(s) {
|
|
77
|
+
return function(e) {
|
|
78
|
+
return a(s.prototype, e), s;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function V(s) {
|
|
82
|
+
return s && typeof s.onUse == "function";
|
|
83
|
+
}
|
|
84
|
+
const d = /* @__PURE__ */ Symbol("extend");
|
|
85
|
+
class c extends x {
|
|
86
|
+
/**
|
|
87
|
+
* 父级插件管理者
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* 当子类创建了子类插件管理者时,为了能让父类插件管理者的插件生效,需要将父类插件管理者设置为其 parent
|
|
91
|
+
*/
|
|
92
|
+
parent;
|
|
22
93
|
/**
|
|
23
94
|
* 插件的宿主
|
|
24
95
|
*/
|
|
@@ -30,8 +101,8 @@ class d extends m {
|
|
|
30
101
|
/**
|
|
31
102
|
* @param host - 插件的宿主
|
|
32
103
|
*/
|
|
33
|
-
constructor(t) {
|
|
34
|
-
super(), t && (this.host = t);
|
|
104
|
+
constructor(t, e) {
|
|
105
|
+
super(), this.parent = e, t && (this.host = t);
|
|
35
106
|
}
|
|
36
107
|
destroyThis() {
|
|
37
108
|
return this.plugins.clear(), this.host = null, super.destroyThis();
|
|
@@ -42,7 +113,16 @@ class d extends m {
|
|
|
42
113
|
* @returns 是否注册了插件 或 扩展
|
|
43
114
|
*/
|
|
44
115
|
hasUsed(t) {
|
|
45
|
-
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);
|
|
46
126
|
}
|
|
47
127
|
/**
|
|
48
128
|
* 判断一个对象是否是插件
|
|
@@ -50,8 +130,7 @@ class d extends m {
|
|
|
50
130
|
* @returns
|
|
51
131
|
*/
|
|
52
132
|
isPlugin(t) {
|
|
53
|
-
|
|
54
|
-
return e.has(t) ? e.get(t) !== a : N(t);
|
|
133
|
+
return this.hasUsed(t) ? this.getUseReturn(t) !== d : V(t);
|
|
55
134
|
}
|
|
56
135
|
/**
|
|
57
136
|
* 使用插件、注册插件
|
|
@@ -59,8 +138,7 @@ class d extends m {
|
|
|
59
138
|
* @param args - 传递给插件的选项
|
|
60
139
|
*/
|
|
61
140
|
useExtend(t) {
|
|
62
|
-
|
|
63
|
-
return e.has(t) ? e.get(t) : (w(this.host.prototype, t), e.set(t, a), t);
|
|
141
|
+
return this.hasUsed(t) || (N(this.host.prototype, t), this.plugins.set(t, d)), t;
|
|
64
142
|
}
|
|
65
143
|
/**
|
|
66
144
|
* 插件宿主实例的注册插件的方法
|
|
@@ -70,8 +148,7 @@ class d extends m {
|
|
|
70
148
|
* @param hostInst - 插件宿主的新实例
|
|
71
149
|
*/
|
|
72
150
|
instUseExtend(t, e, ...n) {
|
|
73
|
-
|
|
74
|
-
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;
|
|
75
152
|
}
|
|
76
153
|
/**
|
|
77
154
|
* 使用插件、注册插件
|
|
@@ -79,10 +156,9 @@ class d extends m {
|
|
|
79
156
|
* @param args - 传递给插件的选项
|
|
80
157
|
*/
|
|
81
158
|
usePlugin(t, ...e) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
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;
|
|
86
162
|
}
|
|
87
163
|
/**
|
|
88
164
|
* 插件宿主实例的注册插件的方法
|
|
@@ -92,10 +168,9 @@ class d extends m {
|
|
|
92
168
|
* @param hostInst - 插件宿主的新实例
|
|
93
169
|
*/
|
|
94
170
|
instUsePlugin(t, e, ...n) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return e.onCreate?.(t), o;
|
|
171
|
+
if (this.hasUsed(e)) return this.getUseReturn(e);
|
|
172
|
+
const i = this.usePlugin(e, ...n);
|
|
173
|
+
return e.onCreate?.(t), i;
|
|
99
174
|
}
|
|
100
175
|
/**
|
|
101
176
|
* 插件宿主创建实例时调用
|
|
@@ -106,13 +181,13 @@ class d extends m {
|
|
|
106
181
|
* @param hostInst - 插件宿主的新实例
|
|
107
182
|
*/
|
|
108
183
|
onCreate(t, ...e) {
|
|
109
|
-
const n = [];
|
|
110
|
-
for (const [
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
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);
|
|
114
189
|
}
|
|
115
|
-
return
|
|
190
|
+
return g(n, () => O(i, t, [t, ...e]));
|
|
116
191
|
}
|
|
117
192
|
/**
|
|
118
193
|
* 插件宿主创建实例时调用
|
|
@@ -123,13 +198,13 @@ class d extends m {
|
|
|
123
198
|
* @param args - 初始化宿主实例时的参数
|
|
124
199
|
*/
|
|
125
200
|
onInit(t, ...e) {
|
|
126
|
-
const n = [];
|
|
127
|
-
for (const [
|
|
128
|
-
if (
|
|
129
|
-
const
|
|
130
|
-
|
|
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);
|
|
131
206
|
}
|
|
132
|
-
return
|
|
207
|
+
return g(n, () => O(i, t, [t, ...e]));
|
|
133
208
|
}
|
|
134
209
|
/**
|
|
135
210
|
* 插件宿主被销毁时调用
|
|
@@ -140,43 +215,45 @@ class d extends m {
|
|
|
140
215
|
*/
|
|
141
216
|
onDestroy(t) {
|
|
142
217
|
const e = [];
|
|
143
|
-
for (const [
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
146
|
-
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);
|
|
147
222
|
}
|
|
148
|
-
|
|
223
|
+
e.reverse();
|
|
224
|
+
const n = O(e, t, [t]), { parent: i } = this;
|
|
225
|
+
return i ? g(n, () => i.onDestroy(t)) : n;
|
|
149
226
|
}
|
|
150
227
|
}
|
|
151
|
-
function
|
|
152
|
-
const t =
|
|
228
|
+
function _(s) {
|
|
229
|
+
const t = s.split(".");
|
|
153
230
|
return t[0] === "" && t.shift(), t;
|
|
154
231
|
}
|
|
155
|
-
function
|
|
232
|
+
function M(s, t) {
|
|
156
233
|
for (const e of t)
|
|
157
|
-
if (
|
|
158
|
-
return
|
|
234
|
+
if (s = s[e], s == null) return;
|
|
235
|
+
return s;
|
|
159
236
|
}
|
|
160
|
-
function
|
|
161
|
-
return
|
|
237
|
+
function Z(s, t) {
|
|
238
|
+
return M(s, _(t));
|
|
162
239
|
}
|
|
163
|
-
function
|
|
164
|
-
const n = t.pop(),
|
|
165
|
-
let
|
|
166
|
-
for (;
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
t = t.slice(
|
|
172
|
-
for (const
|
|
173
|
-
|
|
174
|
-
return
|
|
240
|
+
function b(s, t, e) {
|
|
241
|
+
const n = t.pop(), i = t.length;
|
|
242
|
+
let r = 0;
|
|
243
|
+
for (; r < i; ) {
|
|
244
|
+
const o = s[t[r]];
|
|
245
|
+
if (o == null) break;
|
|
246
|
+
s = o, r++;
|
|
247
|
+
}
|
|
248
|
+
t = t.slice(r);
|
|
249
|
+
for (const o of t)
|
|
250
|
+
s = s[o] = {};
|
|
251
|
+
return s[n] = e, s;
|
|
175
252
|
}
|
|
176
|
-
function
|
|
177
|
-
return
|
|
253
|
+
function tt(s, t, e) {
|
|
254
|
+
return b(s, _(t), e);
|
|
178
255
|
}
|
|
179
|
-
const
|
|
256
|
+
const m = {
|
|
180
257
|
UndefinedAndNull: function(t) {
|
|
181
258
|
return t == null;
|
|
182
259
|
},
|
|
@@ -187,7 +264,7 @@ const g = {
|
|
|
187
264
|
return t === null;
|
|
188
265
|
}
|
|
189
266
|
};
|
|
190
|
-
class
|
|
267
|
+
class U {
|
|
191
268
|
/**
|
|
192
269
|
* 是否要冻结 fullOption 的成员
|
|
193
270
|
* @remarks
|
|
@@ -203,11 +280,11 @@ class _ {
|
|
|
203
280
|
fullOption = new Proxy(this, {
|
|
204
281
|
// @ts-ignore
|
|
205
282
|
get: function(t, e, n) {
|
|
206
|
-
const
|
|
207
|
-
return t.freezeMember ? Object.freeze(
|
|
283
|
+
const i = t.plainFullOption[e];
|
|
284
|
+
return t.freezeMember ? Object.freeze(i) : i;
|
|
208
285
|
},
|
|
209
286
|
// @ts-ignore
|
|
210
|
-
set: function(t, e, n,
|
|
287
|
+
set: function(t, e, n, i) {
|
|
211
288
|
return t.setMember(e, n, !1), !0;
|
|
212
289
|
},
|
|
213
290
|
// @ts-ignore
|
|
@@ -239,7 +316,7 @@ class _ {
|
|
|
239
316
|
* @param deep - 是否要进行深度合并
|
|
240
317
|
*/
|
|
241
318
|
setOption(t, e) {
|
|
242
|
-
const n = e ?
|
|
319
|
+
const n = e ? f(this.option, t) : Object.assign(this.option, t);
|
|
243
320
|
return this.updateFullOption(), n;
|
|
244
321
|
}
|
|
245
322
|
/**
|
|
@@ -249,13 +326,13 @@ class _ {
|
|
|
249
326
|
return this._undefinedValue;
|
|
250
327
|
}
|
|
251
328
|
set undefinedValue(t) {
|
|
252
|
-
this._undefinedValue = t, this.isUndefined =
|
|
329
|
+
this._undefinedValue = t, this.isUndefined = m[t] || m.UndefinedAndNull;
|
|
253
330
|
}
|
|
254
331
|
_undefinedValue = "UndefinedAndNull";
|
|
255
332
|
/**
|
|
256
333
|
* 未定义值的判断函数
|
|
257
334
|
*/
|
|
258
|
-
isUndefined =
|
|
335
|
+
isUndefined = m.UndefinedAndNull;
|
|
259
336
|
/**
|
|
260
337
|
* 获取选项成员
|
|
261
338
|
* @param key
|
|
@@ -271,12 +348,12 @@ class _ {
|
|
|
271
348
|
* @param deep - 是否要进行深度合并
|
|
272
349
|
*/
|
|
273
350
|
setMember(t, e, n) {
|
|
274
|
-
const
|
|
351
|
+
const i = this.option;
|
|
275
352
|
if (e === void 0)
|
|
276
|
-
delete
|
|
353
|
+
delete i[t];
|
|
277
354
|
else {
|
|
278
|
-
const
|
|
279
|
-
n &&
|
|
355
|
+
const r = i[t];
|
|
356
|
+
n && r && typeof r == "object" ? f(r, e) : i[t] = e;
|
|
280
357
|
}
|
|
281
358
|
this.updateFullOption();
|
|
282
359
|
}
|
|
@@ -286,7 +363,7 @@ class _ {
|
|
|
286
363
|
* @returns
|
|
287
364
|
*/
|
|
288
365
|
getValue(t) {
|
|
289
|
-
return
|
|
366
|
+
return M(this.option, t);
|
|
290
367
|
}
|
|
291
368
|
/**
|
|
292
369
|
* 设置属性路径对应的值
|
|
@@ -296,12 +373,12 @@ class _ {
|
|
|
296
373
|
* @returns
|
|
297
374
|
*/
|
|
298
375
|
setValue(t, e, n) {
|
|
299
|
-
const
|
|
300
|
-
let
|
|
301
|
-
n && (
|
|
376
|
+
const i = this.option;
|
|
377
|
+
let r;
|
|
378
|
+
n && (r = M(i, t)) && typeof r == "object" ? f(r, e) : b(this.option, t, e), this.updateFullOption();
|
|
302
379
|
}
|
|
303
380
|
}
|
|
304
|
-
class
|
|
381
|
+
class l extends U {
|
|
305
382
|
constructor(t, e) {
|
|
306
383
|
super(), t && (this.option = t), e && (this.extends = e);
|
|
307
384
|
}
|
|
@@ -329,8 +406,8 @@ class u extends _ {
|
|
|
329
406
|
if (t) return t;
|
|
330
407
|
const { extends: e, option: n } = this;
|
|
331
408
|
if (t = n, e) {
|
|
332
|
-
const
|
|
333
|
-
t =
|
|
409
|
+
const i = e.plainFullOption;
|
|
410
|
+
t = y(i, n);
|
|
334
411
|
}
|
|
335
412
|
return this._plainFullOption = t;
|
|
336
413
|
}
|
|
@@ -366,15 +443,15 @@ class u extends _ {
|
|
|
366
443
|
return n.getValue(t);
|
|
367
444
|
}
|
|
368
445
|
}
|
|
369
|
-
function
|
|
446
|
+
function et(s, t) {
|
|
370
447
|
const { name: e } = t, n = `_${e}`;
|
|
371
448
|
return {
|
|
372
449
|
get: function() {
|
|
373
|
-
return this[n] || (this[n] = new
|
|
450
|
+
return this[n] || (this[n] = new l(void 0, this.constructor[e]));
|
|
374
451
|
}
|
|
375
452
|
};
|
|
376
453
|
}
|
|
377
|
-
class
|
|
454
|
+
class k extends U {
|
|
378
455
|
constructor(t, e) {
|
|
379
456
|
super(), e && this.setModeOption(t, e), this.mode = t;
|
|
380
457
|
}
|
|
@@ -463,16 +540,16 @@ class T extends _ {
|
|
|
463
540
|
* @param deep - 是否要进行深度合并
|
|
464
541
|
* @param extend - 继承哪个模式
|
|
465
542
|
*/
|
|
466
|
-
setModeOption(t, e, n,
|
|
467
|
-
const { modes:
|
|
468
|
-
if (
|
|
469
|
-
const
|
|
470
|
-
|
|
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);
|
|
471
548
|
}
|
|
472
|
-
return this.updateFullOption(),
|
|
549
|
+
return this.updateFullOption(), o;
|
|
473
550
|
}
|
|
474
551
|
}
|
|
475
|
-
class
|
|
552
|
+
class p extends k {
|
|
476
553
|
constructor(t, e, n) {
|
|
477
554
|
super(t, e), n && (this.extends = n);
|
|
478
555
|
}
|
|
@@ -494,12 +571,12 @@ class l extends T {
|
|
|
494
571
|
* @returns
|
|
495
572
|
*/
|
|
496
573
|
getFullModeOption(t) {
|
|
497
|
-
const { modes: e, extends: n } = this,
|
|
574
|
+
const { modes: e, extends: n } = this, i = e[t]?.plainFullOption;
|
|
498
575
|
if (n) {
|
|
499
|
-
const
|
|
500
|
-
return
|
|
576
|
+
const r = n.getFullModeOption(t);
|
|
577
|
+
return i ? y(r, i) : r;
|
|
501
578
|
}
|
|
502
|
-
return
|
|
579
|
+
return i;
|
|
503
580
|
}
|
|
504
581
|
/**
|
|
505
582
|
* 获取所有的模式名字
|
|
@@ -508,8 +585,8 @@ class l extends T {
|
|
|
508
585
|
getModeNames() {
|
|
509
586
|
const { modes: t, extends: e } = this, n = Object.keys(t);
|
|
510
587
|
if (!e) return n;
|
|
511
|
-
const
|
|
512
|
-
return [.../* @__PURE__ */ new Set([...n, ...
|
|
588
|
+
const i = e.getModeNames();
|
|
589
|
+
return [.../* @__PURE__ */ new Set([...n, ...i])];
|
|
513
590
|
}
|
|
514
591
|
/**
|
|
515
592
|
* 在整个层级上判断是否有某个模式
|
|
@@ -561,15 +638,15 @@ class l extends T {
|
|
|
561
638
|
return n.getValue(t);
|
|
562
639
|
}
|
|
563
640
|
}
|
|
564
|
-
function
|
|
641
|
+
function nt(s, t) {
|
|
565
642
|
const { name: e } = t, n = `_${e}`;
|
|
566
643
|
return {
|
|
567
644
|
get: function() {
|
|
568
|
-
return this[n] || (this[n] = new
|
|
645
|
+
return this[n] || (this[n] = new p(this.constructor[e].mode, void 0, this.constructor[e]));
|
|
569
646
|
}
|
|
570
647
|
};
|
|
571
648
|
}
|
|
572
|
-
class F extends
|
|
649
|
+
class F extends x {
|
|
573
650
|
/**
|
|
574
651
|
* 是否使用独立的插件管理器
|
|
575
652
|
* @defaultValue false
|
|
@@ -579,9 +656,9 @@ class F extends m {
|
|
|
579
656
|
* 插件管理器
|
|
580
657
|
*/
|
|
581
658
|
static get pluginManager() {
|
|
582
|
-
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;
|
|
583
660
|
}
|
|
584
|
-
static _pluginManager = new
|
|
661
|
+
static _pluginManager = new c(this);
|
|
585
662
|
/**
|
|
586
663
|
* 插件管理器 {@link PluginHost.pluginManager}
|
|
587
664
|
*/
|
|
@@ -652,24 +729,24 @@ class F extends m {
|
|
|
652
729
|
return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
|
|
653
730
|
}
|
|
654
731
|
}
|
|
655
|
-
class
|
|
732
|
+
class st extends F {
|
|
656
733
|
/**
|
|
657
734
|
* 全局级别的默认选项
|
|
658
735
|
*/
|
|
659
|
-
static defaultOptions = new
|
|
736
|
+
static defaultOptions = new l();
|
|
660
737
|
/**
|
|
661
738
|
* 实例级的默认选项
|
|
662
739
|
*/
|
|
663
740
|
get defaultOptions() {
|
|
664
|
-
return this._defaultOptions || (this._defaultOptions = new
|
|
741
|
+
return this._defaultOptions || (this._defaultOptions = new l(void 0, this.constructor.defaultOptions));
|
|
665
742
|
}
|
|
666
743
|
_defaultOptions;
|
|
667
744
|
constructor(t) {
|
|
668
745
|
super(), this.defaultOptions.option = t;
|
|
669
746
|
}
|
|
670
747
|
}
|
|
671
|
-
function
|
|
672
|
-
const t =
|
|
748
|
+
function w(s) {
|
|
749
|
+
const t = T(s);
|
|
673
750
|
return class extends t {
|
|
674
751
|
/**
|
|
675
752
|
* 是否使用独立的插件管理器
|
|
@@ -680,9 +757,9 @@ function b(i) {
|
|
|
680
757
|
* 插件管理器
|
|
681
758
|
*/
|
|
682
759
|
static get pluginManager() {
|
|
683
|
-
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;
|
|
684
761
|
}
|
|
685
|
-
static _pluginManager = new
|
|
762
|
+
static _pluginManager = new c(this);
|
|
686
763
|
/**
|
|
687
764
|
* 插件管理器 {@link PluginHostSub.pluginManager}
|
|
688
765
|
*/
|
|
@@ -692,8 +769,8 @@ function b(i) {
|
|
|
692
769
|
/**
|
|
693
770
|
* {@inheritDoc PluginExtendManager.usePlugin}
|
|
694
771
|
*/
|
|
695
|
-
static usePlugin(n, ...
|
|
696
|
-
return this.pluginManager.usePlugin(n, ...
|
|
772
|
+
static usePlugin(n, ...i) {
|
|
773
|
+
return this.pluginManager.usePlugin(n, ...i);
|
|
697
774
|
}
|
|
698
775
|
/**
|
|
699
776
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
@@ -725,14 +802,14 @@ function b(i) {
|
|
|
725
802
|
* @param args
|
|
726
803
|
* @returns
|
|
727
804
|
*/
|
|
728
|
-
usePlugin(n, ...
|
|
729
|
-
return this.pluginManager.instUsePlugin(this, n, ...
|
|
805
|
+
usePlugin(n, ...i) {
|
|
806
|
+
return this.pluginManager.instUsePlugin(this, n, ...i);
|
|
730
807
|
}
|
|
731
808
|
/**
|
|
732
809
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
733
810
|
*/
|
|
734
|
-
useExtend(n, ...
|
|
735
|
-
return this.pluginManager.instUseExtend(this, n, ...
|
|
811
|
+
useExtend(n, ...i) {
|
|
812
|
+
return this.pluginManager.instUseExtend(this, n, ...i);
|
|
736
813
|
}
|
|
737
814
|
/**
|
|
738
815
|
* 初始化实例
|
|
@@ -753,18 +830,18 @@ function b(i) {
|
|
|
753
830
|
}
|
|
754
831
|
};
|
|
755
832
|
}
|
|
756
|
-
function
|
|
757
|
-
const t =
|
|
833
|
+
function ot(s) {
|
|
834
|
+
const t = w(s);
|
|
758
835
|
return class extends t {
|
|
759
836
|
/**
|
|
760
837
|
* 全局级别的默认选项
|
|
761
838
|
*/
|
|
762
|
-
static defaultOptions = new
|
|
839
|
+
static defaultOptions = new l();
|
|
763
840
|
/**
|
|
764
841
|
* 实例级的默认选项
|
|
765
842
|
*/
|
|
766
843
|
get defaultOptions() {
|
|
767
|
-
return this._defaultOptions || (this._defaultOptions = new
|
|
844
|
+
return this._defaultOptions || (this._defaultOptions = new l(void 0, this.constructor.defaultOptions));
|
|
768
845
|
}
|
|
769
846
|
_defaultOptions;
|
|
770
847
|
constructor(n) {
|
|
@@ -772,17 +849,17 @@ function z(i) {
|
|
|
772
849
|
}
|
|
773
850
|
};
|
|
774
851
|
}
|
|
775
|
-
const
|
|
776
|
-
class
|
|
852
|
+
const h = "common";
|
|
853
|
+
class ut extends F {
|
|
777
854
|
/**
|
|
778
855
|
* 全局级别的默认选项
|
|
779
856
|
*/
|
|
780
|
-
static modeOptions = new
|
|
857
|
+
static modeOptions = new p(h);
|
|
781
858
|
/**
|
|
782
859
|
* 实例级的默认选项
|
|
783
860
|
*/
|
|
784
861
|
get modeOptions() {
|
|
785
|
-
return this._modeOptions || (this._modeOptions = new
|
|
862
|
+
return this._modeOptions || (this._modeOptions = new p(h, void 0, this.constructor.modeOptions));
|
|
786
863
|
}
|
|
787
864
|
_modeOptions;
|
|
788
865
|
get mode() {
|
|
@@ -798,18 +875,18 @@ class K extends F {
|
|
|
798
875
|
super(), this.modeOptions.setOption(t);
|
|
799
876
|
}
|
|
800
877
|
}
|
|
801
|
-
function
|
|
802
|
-
const t =
|
|
878
|
+
function lt(s) {
|
|
879
|
+
const t = w(s);
|
|
803
880
|
return class extends t {
|
|
804
881
|
/**
|
|
805
882
|
* 全局级别的默认选项
|
|
806
883
|
*/
|
|
807
|
-
static modeOptions = new
|
|
884
|
+
static modeOptions = new p(h);
|
|
808
885
|
/**
|
|
809
886
|
* 实例级的默认选项
|
|
810
887
|
*/
|
|
811
888
|
get modeOptions() {
|
|
812
|
-
return this._modeOptions || (this._modeOptions = new
|
|
889
|
+
return this._modeOptions || (this._modeOptions = new p(h, void 0, this.constructor.modeOptions));
|
|
813
890
|
}
|
|
814
891
|
_modeOptions;
|
|
815
892
|
get mode() {
|
|
@@ -827,26 +904,41 @@ function $(i) {
|
|
|
827
904
|
};
|
|
828
905
|
}
|
|
829
906
|
export {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
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,
|
|
922
|
+
F as e,
|
|
923
|
+
ut as f,
|
|
924
|
+
st as g,
|
|
925
|
+
J as h,
|
|
926
|
+
B as i,
|
|
927
|
+
Y as j,
|
|
928
|
+
q as k,
|
|
929
|
+
w as l,
|
|
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
|
|
852
944
|
};
|