xl-app-sdk 0.0.8 → 0.1.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/es/index.js +21 -26
- package/dist/es/request-DXNZ2mjR.js +268 -0
- package/dist/es/scene.js +70 -7
- package/dist/es/utils-CnDqFMmf.js +381 -0
- package/dist/es/utils.js +107 -7
- package/dist/es/vue.js +69 -5
- package/dist/types/lib/cdn.d.ts +11 -0
- package/dist/types/lib/index.d.ts +2 -3
- package/dist/types/modules/base.d.ts +1 -1
- package/dist/types/modules/event.d.ts +1 -0
- package/package.json +6 -6
- package/dist/es/scene-DeuRXFje.js +0 -84
- package/dist/es/utils-IPr2Rakl.js +0 -484
- package/dist/es/vue-CSCtfgHT.js +0 -343
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
function M(r) {
|
|
2
|
+
return Number.isSafeInteger(r) && r >= 0;
|
|
3
|
+
}
|
|
4
|
+
function U(r) {
|
|
5
|
+
return r != null && typeof r != "function" && M(r.length);
|
|
6
|
+
}
|
|
7
|
+
function m(r) {
|
|
8
|
+
return r === "__proto__";
|
|
9
|
+
}
|
|
10
|
+
function F(r) {
|
|
11
|
+
switch (typeof r) {
|
|
12
|
+
case "number":
|
|
13
|
+
case "symbol":
|
|
14
|
+
return !1;
|
|
15
|
+
case "string":
|
|
16
|
+
return r.includes(".") || r.includes("[") || r.includes("]");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function w(r) {
|
|
20
|
+
return typeof r == "string" || typeof r == "symbol" ? r : Object.is(r?.valueOf?.(), -0) ? "-0" : String(r);
|
|
21
|
+
}
|
|
22
|
+
function S(r) {
|
|
23
|
+
if (r == null)
|
|
24
|
+
return "";
|
|
25
|
+
if (typeof r == "string")
|
|
26
|
+
return r;
|
|
27
|
+
if (Array.isArray(r))
|
|
28
|
+
return r.map(S).join(",");
|
|
29
|
+
const n = String(r);
|
|
30
|
+
return n === "0" && Object.is(Number(r), -0) ? "-0" : n;
|
|
31
|
+
}
|
|
32
|
+
function j(r) {
|
|
33
|
+
if (Array.isArray(r))
|
|
34
|
+
return r.map(w);
|
|
35
|
+
if (typeof r == "symbol")
|
|
36
|
+
return [r];
|
|
37
|
+
r = S(r);
|
|
38
|
+
const n = [], e = r.length;
|
|
39
|
+
if (e === 0)
|
|
40
|
+
return n;
|
|
41
|
+
let i = 0, s = "", c = "", t = !1;
|
|
42
|
+
for (r.charCodeAt(0) === 46 && (n.push(""), i++); i < e; ) {
|
|
43
|
+
const f = r[i];
|
|
44
|
+
c ? f === "\\" && i + 1 < e ? (i++, s += r[i]) : f === c ? c = "" : s += f : t ? f === '"' || f === "'" ? c = f : f === "]" ? (t = !1, n.push(s), s = "") : s += f : f === "[" ? (t = !0, s && (n.push(s), s = "")) : f === "." ? s && (n.push(s), s = "") : s += f, i++;
|
|
45
|
+
}
|
|
46
|
+
return s && n.push(s), n;
|
|
47
|
+
}
|
|
48
|
+
function N(r, n, e) {
|
|
49
|
+
if (r == null)
|
|
50
|
+
return e;
|
|
51
|
+
switch (typeof n) {
|
|
52
|
+
case "string": {
|
|
53
|
+
if (m(n))
|
|
54
|
+
return e;
|
|
55
|
+
const i = r[n];
|
|
56
|
+
return i === void 0 ? F(n) ? N(r, j(n), e) : e : i;
|
|
57
|
+
}
|
|
58
|
+
case "number":
|
|
59
|
+
case "symbol": {
|
|
60
|
+
typeof n == "number" && (n = w(n));
|
|
61
|
+
const i = r[n];
|
|
62
|
+
return i === void 0 ? e : i;
|
|
63
|
+
}
|
|
64
|
+
default: {
|
|
65
|
+
if (Array.isArray(n))
|
|
66
|
+
return R(r, n, e);
|
|
67
|
+
if (Object.is(n?.valueOf(), -0) ? n = "-0" : n = String(n), m(n))
|
|
68
|
+
return e;
|
|
69
|
+
const i = r[n];
|
|
70
|
+
return i === void 0 ? e : i;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function R(r, n, e) {
|
|
75
|
+
if (n.length === 0)
|
|
76
|
+
return e;
|
|
77
|
+
let i = r;
|
|
78
|
+
for (let s = 0; s < n.length; s++) {
|
|
79
|
+
if (i == null || m(n[s]))
|
|
80
|
+
return e;
|
|
81
|
+
i = i[n[s]];
|
|
82
|
+
}
|
|
83
|
+
return i === void 0 ? e : i;
|
|
84
|
+
}
|
|
85
|
+
function g(r) {
|
|
86
|
+
return r !== null && (typeof r == "object" || typeof r == "function");
|
|
87
|
+
}
|
|
88
|
+
function W(r) {
|
|
89
|
+
return r == null || typeof r != "object" && typeof r != "function";
|
|
90
|
+
}
|
|
91
|
+
function $(r, n) {
|
|
92
|
+
return r === n || Number.isNaN(r) && Number.isNaN(n);
|
|
93
|
+
}
|
|
94
|
+
function z(r) {
|
|
95
|
+
return Object.getOwnPropertySymbols(r).filter((n) => Object.prototype.propertyIsEnumerable.call(r, n));
|
|
96
|
+
}
|
|
97
|
+
function d(r) {
|
|
98
|
+
return r == null ? r === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(r);
|
|
99
|
+
}
|
|
100
|
+
const G = "[object RegExp]", B = "[object String]", E = "[object Number]", I = "[object Boolean]", D = "[object Arguments]", L = "[object Symbol]", q = "[object Date]", J = "[object Map]", X = "[object Set]", Z = "[object Array]", H = "[object ArrayBuffer]", x = "[object Object]", Q = "[object DataView]", Y = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", K = "[object Uint16Array]", V = "[object Uint32Array]", a = "[object Int8Array]", k = "[object Int16Array]", T = "[object Int32Array]", l = "[object Float32Array]", C = "[object Float64Array]";
|
|
101
|
+
function P(r) {
|
|
102
|
+
return ArrayBuffer.isView(r) && !(r instanceof DataView);
|
|
103
|
+
}
|
|
104
|
+
function v(r, n) {
|
|
105
|
+
return p(r, void 0, r, /* @__PURE__ */ new Map(), n);
|
|
106
|
+
}
|
|
107
|
+
function p(r, n, e, i = /* @__PURE__ */ new Map(), s = void 0) {
|
|
108
|
+
const c = s?.(r, n, e, i);
|
|
109
|
+
if (c !== void 0)
|
|
110
|
+
return c;
|
|
111
|
+
if (W(r))
|
|
112
|
+
return r;
|
|
113
|
+
if (i.has(r))
|
|
114
|
+
return i.get(r);
|
|
115
|
+
if (Array.isArray(r)) {
|
|
116
|
+
const t = new Array(r.length);
|
|
117
|
+
i.set(r, t);
|
|
118
|
+
for (let f = 0; f < r.length; f++)
|
|
119
|
+
t[f] = p(r[f], f, e, i, s);
|
|
120
|
+
return Object.hasOwn(r, "index") && (t.index = r.index), Object.hasOwn(r, "input") && (t.input = r.input), t;
|
|
121
|
+
}
|
|
122
|
+
if (r instanceof Date)
|
|
123
|
+
return new Date(r.getTime());
|
|
124
|
+
if (r instanceof RegExp) {
|
|
125
|
+
const t = new RegExp(r.source, r.flags);
|
|
126
|
+
return t.lastIndex = r.lastIndex, t;
|
|
127
|
+
}
|
|
128
|
+
if (r instanceof Map) {
|
|
129
|
+
const t = /* @__PURE__ */ new Map();
|
|
130
|
+
i.set(r, t);
|
|
131
|
+
for (const [f, y] of r)
|
|
132
|
+
t.set(f, p(y, f, e, i, s));
|
|
133
|
+
return t;
|
|
134
|
+
}
|
|
135
|
+
if (r instanceof Set) {
|
|
136
|
+
const t = /* @__PURE__ */ new Set();
|
|
137
|
+
i.set(r, t);
|
|
138
|
+
for (const f of r)
|
|
139
|
+
t.add(p(f, void 0, e, i, s));
|
|
140
|
+
return t;
|
|
141
|
+
}
|
|
142
|
+
if (typeof Buffer < "u" && Buffer.isBuffer(r))
|
|
143
|
+
return r.subarray();
|
|
144
|
+
if (P(r)) {
|
|
145
|
+
const t = new (Object.getPrototypeOf(r)).constructor(r.length);
|
|
146
|
+
i.set(r, t);
|
|
147
|
+
for (let f = 0; f < r.length; f++)
|
|
148
|
+
t[f] = p(r[f], f, e, i, s);
|
|
149
|
+
return t;
|
|
150
|
+
}
|
|
151
|
+
if (r instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && r instanceof SharedArrayBuffer)
|
|
152
|
+
return r.slice(0);
|
|
153
|
+
if (r instanceof DataView) {
|
|
154
|
+
const t = new DataView(r.buffer.slice(0), r.byteOffset, r.byteLength);
|
|
155
|
+
return i.set(r, t), u(t, r, e, i, s), t;
|
|
156
|
+
}
|
|
157
|
+
if (typeof File < "u" && r instanceof File) {
|
|
158
|
+
const t = new File([r], r.name, {
|
|
159
|
+
type: r.type
|
|
160
|
+
});
|
|
161
|
+
return i.set(r, t), u(t, r, e, i, s), t;
|
|
162
|
+
}
|
|
163
|
+
if (typeof Blob < "u" && r instanceof Blob) {
|
|
164
|
+
const t = new Blob([r], { type: r.type });
|
|
165
|
+
return i.set(r, t), u(t, r, e, i, s), t;
|
|
166
|
+
}
|
|
167
|
+
if (r instanceof Error) {
|
|
168
|
+
const t = new r.constructor();
|
|
169
|
+
return i.set(r, t), t.message = r.message, t.name = r.name, t.stack = r.stack, t.cause = r.cause, u(t, r, e, i, s), t;
|
|
170
|
+
}
|
|
171
|
+
if (r instanceof Boolean) {
|
|
172
|
+
const t = new Boolean(r.valueOf());
|
|
173
|
+
return i.set(r, t), u(t, r, e, i, s), t;
|
|
174
|
+
}
|
|
175
|
+
if (r instanceof Number) {
|
|
176
|
+
const t = new Number(r.valueOf());
|
|
177
|
+
return i.set(r, t), u(t, r, e, i, s), t;
|
|
178
|
+
}
|
|
179
|
+
if (r instanceof String) {
|
|
180
|
+
const t = new String(r.valueOf());
|
|
181
|
+
return i.set(r, t), u(t, r, e, i, s), t;
|
|
182
|
+
}
|
|
183
|
+
if (typeof r == "object" && rr(r)) {
|
|
184
|
+
const t = Object.create(Object.getPrototypeOf(r));
|
|
185
|
+
return i.set(r, t), u(t, r, e, i, s), t;
|
|
186
|
+
}
|
|
187
|
+
return r;
|
|
188
|
+
}
|
|
189
|
+
function u(r, n, e = r, i, s) {
|
|
190
|
+
const c = [...Object.keys(n), ...z(n)];
|
|
191
|
+
for (let t = 0; t < c.length; t++) {
|
|
192
|
+
const f = c[t], y = Object.getOwnPropertyDescriptor(r, f);
|
|
193
|
+
(y == null || y.writable) && (r[f] = p(n[f], f, e, i, s));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function rr(r) {
|
|
197
|
+
switch (d(r)) {
|
|
198
|
+
case D:
|
|
199
|
+
case Z:
|
|
200
|
+
case H:
|
|
201
|
+
case Q:
|
|
202
|
+
case I:
|
|
203
|
+
case q:
|
|
204
|
+
case l:
|
|
205
|
+
case C:
|
|
206
|
+
case a:
|
|
207
|
+
case k:
|
|
208
|
+
case T:
|
|
209
|
+
case J:
|
|
210
|
+
case E:
|
|
211
|
+
case x:
|
|
212
|
+
case G:
|
|
213
|
+
case X:
|
|
214
|
+
case B:
|
|
215
|
+
case L:
|
|
216
|
+
case Y:
|
|
217
|
+
case _:
|
|
218
|
+
case K:
|
|
219
|
+
case V:
|
|
220
|
+
return !0;
|
|
221
|
+
default:
|
|
222
|
+
return !1;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function tr(r, n) {
|
|
226
|
+
return v(r, (e, i, s, c) => {
|
|
227
|
+
if (typeof r == "object") {
|
|
228
|
+
if (d(r) === x && typeof r.constructor != "function") {
|
|
229
|
+
const t = {};
|
|
230
|
+
return c.set(r, t), u(t, r, s, c), t;
|
|
231
|
+
}
|
|
232
|
+
switch (Object.prototype.toString.call(r)) {
|
|
233
|
+
case E:
|
|
234
|
+
case B:
|
|
235
|
+
case I: {
|
|
236
|
+
const t = new r.constructor(r?.valueOf());
|
|
237
|
+
return u(t, r), t;
|
|
238
|
+
}
|
|
239
|
+
case D: {
|
|
240
|
+
const t = {};
|
|
241
|
+
return u(t, r), t.length = r.length, t[Symbol.iterator] = r[Symbol.iterator], t;
|
|
242
|
+
}
|
|
243
|
+
default:
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function nr(r) {
|
|
250
|
+
return tr(r);
|
|
251
|
+
}
|
|
252
|
+
const er = /^(?:0|[1-9]\d*)$/;
|
|
253
|
+
function ir(r, n = Number.MAX_SAFE_INTEGER) {
|
|
254
|
+
switch (typeof r) {
|
|
255
|
+
case "number":
|
|
256
|
+
return Number.isInteger(r) && r >= 0 && r < n;
|
|
257
|
+
case "symbol":
|
|
258
|
+
return !1;
|
|
259
|
+
case "string":
|
|
260
|
+
return er.test(r);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function sr(r) {
|
|
264
|
+
return r !== null && typeof r == "object" && d(r) === "[object Arguments]";
|
|
265
|
+
}
|
|
266
|
+
function fr(r) {
|
|
267
|
+
return typeof r == "symbol" || r instanceof Symbol;
|
|
268
|
+
}
|
|
269
|
+
const cr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ur = /^\w*$/;
|
|
270
|
+
function yr(r, n) {
|
|
271
|
+
return Array.isArray(r) ? !1 : typeof r == "number" || typeof r == "boolean" || r == null || fr(r) ? !0 : typeof r == "string" && (ur.test(r) || !cr.test(r)) || n != null && Object.hasOwn(n, r);
|
|
272
|
+
}
|
|
273
|
+
function o(r) {
|
|
274
|
+
return Array.isArray(r);
|
|
275
|
+
}
|
|
276
|
+
const gr = (r, n, e) => {
|
|
277
|
+
const i = r[n];
|
|
278
|
+
(!(Object.hasOwn(r, n) && $(i, e)) || e === void 0 && !(n in r)) && (r[n] = e);
|
|
279
|
+
};
|
|
280
|
+
function pr(r, n, e, i) {
|
|
281
|
+
if (r == null && !g(r))
|
|
282
|
+
return r;
|
|
283
|
+
let s;
|
|
284
|
+
yr(n, r) ? s = [n] : Array.isArray(n) ? s = n : s = j(n);
|
|
285
|
+
const c = e(N(r, s));
|
|
286
|
+
let t = r;
|
|
287
|
+
for (let f = 0; f < s.length && t != null; f++) {
|
|
288
|
+
const y = w(s[f]);
|
|
289
|
+
if (m(y))
|
|
290
|
+
continue;
|
|
291
|
+
let A;
|
|
292
|
+
if (f === s.length - 1)
|
|
293
|
+
A = c;
|
|
294
|
+
else {
|
|
295
|
+
const O = t[y], h = i?.(O, y, r);
|
|
296
|
+
A = h !== void 0 ? h : g(O) ? O : ir(s[f + 1]) ? [] : {};
|
|
297
|
+
}
|
|
298
|
+
gr(t, y, A), t = t[y];
|
|
299
|
+
}
|
|
300
|
+
return r;
|
|
301
|
+
}
|
|
302
|
+
function mr(r, n, e) {
|
|
303
|
+
return pr(r, n, () => e, () => {
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function or(r) {
|
|
307
|
+
const n = r?.constructor, e = typeof n == "function" ? n.prototype : Object.prototype;
|
|
308
|
+
return r === e;
|
|
309
|
+
}
|
|
310
|
+
function br(r) {
|
|
311
|
+
return P(r);
|
|
312
|
+
}
|
|
313
|
+
function b(r) {
|
|
314
|
+
if (r == null)
|
|
315
|
+
return !0;
|
|
316
|
+
if (U(r))
|
|
317
|
+
return typeof r.splice != "function" && typeof r != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(r)) && !br(r) && !sr(r) ? !1 : r.length === 0;
|
|
318
|
+
if (typeof r == "object") {
|
|
319
|
+
if (r instanceof Map || r instanceof Set)
|
|
320
|
+
return r.size === 0;
|
|
321
|
+
const n = Object.keys(r);
|
|
322
|
+
return or(r) ? n.filter((e) => e !== "constructor").length === 0 : n.length === 0;
|
|
323
|
+
}
|
|
324
|
+
return !0;
|
|
325
|
+
}
|
|
326
|
+
function Ar(r) {
|
|
327
|
+
if (r = nr(r), g(r) && !o(r)) {
|
|
328
|
+
const n = (e) => (g(e) && !o(e) && Object.keys(e).forEach((i) => {
|
|
329
|
+
if (e[i] === null || e[i] === "" || e[i] === void 0) {
|
|
330
|
+
delete e[i];
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
if (g(e[i]) && !o(e[i]) && b(e[i])) {
|
|
334
|
+
delete e[i];
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
}), e);
|
|
338
|
+
if (Object.keys(r).forEach((e) => {
|
|
339
|
+
if (r[e] === null || r[e] === "" || r[e] === void 0) {
|
|
340
|
+
delete r[e];
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (g(r[e]) && !o(r[e]) && b(r[e])) {
|
|
344
|
+
delete r[e];
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
r[e] = n(r[e]);
|
|
348
|
+
}), Object.keys(r).forEach((e) => {
|
|
349
|
+
if (g(r[e]) && !o(r[e]) && b(r[e])) {
|
|
350
|
+
delete r[e];
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
}), b(r))
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
return r;
|
|
357
|
+
}
|
|
358
|
+
function Or(r) {
|
|
359
|
+
if (typeof r == "string")
|
|
360
|
+
try {
|
|
361
|
+
const n = JSON.parse(r);
|
|
362
|
+
return !!(typeof n == "object" && n);
|
|
363
|
+
} catch {
|
|
364
|
+
return !1;
|
|
365
|
+
}
|
|
366
|
+
return !1;
|
|
367
|
+
}
|
|
368
|
+
export {
|
|
369
|
+
W as a,
|
|
370
|
+
P as b,
|
|
371
|
+
m as c,
|
|
372
|
+
sr as d,
|
|
373
|
+
nr as e,
|
|
374
|
+
br as f,
|
|
375
|
+
z as g,
|
|
376
|
+
Ar as h,
|
|
377
|
+
U as i,
|
|
378
|
+
N as j,
|
|
379
|
+
mr as s,
|
|
380
|
+
Or as v
|
|
381
|
+
};
|
package/dist/es/utils.js
CHANGED
|
@@ -1,9 +1,109 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as S, a as h, b as P, g as x, c as B, d as A, e as m, f as p } from "./utils-CnDqFMmf.js";
|
|
2
|
+
import { h as V, j as I, s as W, v as $ } from "./utils-CnDqFMmf.js";
|
|
3
|
+
function g(e) {
|
|
4
|
+
return typeof e == "object" && e !== null;
|
|
5
|
+
}
|
|
6
|
+
function E(e) {
|
|
7
|
+
return g(e) && S(e);
|
|
8
|
+
}
|
|
9
|
+
function T() {
|
|
10
|
+
}
|
|
11
|
+
function d(e) {
|
|
12
|
+
if (typeof e != "object" || e == null)
|
|
13
|
+
return !1;
|
|
14
|
+
if (Object.getPrototypeOf(e) === null)
|
|
15
|
+
return !0;
|
|
16
|
+
if (Object.prototype.toString.call(e) !== "[object Object]") {
|
|
17
|
+
const f = e[Symbol.toStringTag];
|
|
18
|
+
return f == null || !Object.getOwnPropertyDescriptor(e, Symbol.toStringTag)?.writable ? !1 : e.toString() === `[object ${f}]`;
|
|
19
|
+
}
|
|
20
|
+
let n = e;
|
|
21
|
+
for (; Object.getPrototypeOf(n) !== null; )
|
|
22
|
+
n = Object.getPrototypeOf(n);
|
|
23
|
+
return Object.getPrototypeOf(e) === n;
|
|
24
|
+
}
|
|
25
|
+
function D(e) {
|
|
26
|
+
if (h(e))
|
|
27
|
+
return e;
|
|
28
|
+
if (Array.isArray(e) || P(e) || e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer)
|
|
29
|
+
return e.slice(0);
|
|
30
|
+
const n = Object.getPrototypeOf(e);
|
|
31
|
+
if (n == null)
|
|
32
|
+
return Object.assign(Object.create(n), e);
|
|
33
|
+
const f = n.constructor;
|
|
34
|
+
if (e instanceof Date || e instanceof Map || e instanceof Set)
|
|
35
|
+
return new f(e);
|
|
36
|
+
if (e instanceof RegExp) {
|
|
37
|
+
const t = new f(e);
|
|
38
|
+
return t.lastIndex = e.lastIndex, t;
|
|
39
|
+
}
|
|
40
|
+
if (e instanceof DataView)
|
|
41
|
+
return new f(e.buffer.slice(0));
|
|
42
|
+
if (e instanceof Error) {
|
|
43
|
+
let t;
|
|
44
|
+
return e instanceof AggregateError ? t = new f(e.errors, e.message, { cause: e.cause }) : t = new f(e.message, { cause: e.cause }), t.stack = e.stack, Object.assign(t, e), t;
|
|
45
|
+
}
|
|
46
|
+
if (typeof File < "u" && e instanceof File)
|
|
47
|
+
return new f([e], e.name, { type: e.type, lastModified: e.lastModified });
|
|
48
|
+
if (typeof e == "object") {
|
|
49
|
+
const t = Object.create(n);
|
|
50
|
+
return Object.assign(t, e);
|
|
51
|
+
}
|
|
52
|
+
return e;
|
|
53
|
+
}
|
|
54
|
+
function R(e, ...n) {
|
|
55
|
+
const f = n.slice(0, -1), t = n[n.length - 1];
|
|
56
|
+
let c = e;
|
|
57
|
+
for (let s = 0; s < f.length; s++) {
|
|
58
|
+
const l = f[s];
|
|
59
|
+
c = o(c, l, t, /* @__PURE__ */ new Map());
|
|
60
|
+
}
|
|
61
|
+
return c;
|
|
62
|
+
}
|
|
63
|
+
function o(e, n, f, t) {
|
|
64
|
+
if (h(e) && (e = Object(e)), n == null || typeof n != "object")
|
|
65
|
+
return e;
|
|
66
|
+
if (t.has(n))
|
|
67
|
+
return D(t.get(n));
|
|
68
|
+
if (t.set(n, e), Array.isArray(n)) {
|
|
69
|
+
n = n.slice();
|
|
70
|
+
for (let s = 0; s < n.length; s++)
|
|
71
|
+
n[s] = n[s] ?? void 0;
|
|
72
|
+
}
|
|
73
|
+
const c = [...Object.keys(n), ...x(n)];
|
|
74
|
+
for (let s = 0; s < c.length; s++) {
|
|
75
|
+
const l = c[s];
|
|
76
|
+
if (B(l))
|
|
77
|
+
continue;
|
|
78
|
+
let i = n[l], r = e[l];
|
|
79
|
+
if (A(i) && (i = { ...i }), A(r) && (r = { ...r }), typeof Buffer < "u" && Buffer.isBuffer(i) && (i = m(i)), Array.isArray(i))
|
|
80
|
+
if (Array.isArray(r)) {
|
|
81
|
+
const u = [], a = Reflect.ownKeys(r);
|
|
82
|
+
for (let y = 0; y < a.length; y++) {
|
|
83
|
+
const w = a[y];
|
|
84
|
+
u[w] = r[w];
|
|
85
|
+
}
|
|
86
|
+
r = u;
|
|
87
|
+
} else if (E(r)) {
|
|
88
|
+
const u = [];
|
|
89
|
+
for (let a = 0; a < r.length; a++)
|
|
90
|
+
u[a] = r[a];
|
|
91
|
+
r = u;
|
|
92
|
+
} else
|
|
93
|
+
r = [];
|
|
94
|
+
const O = f(r, i, l, e, n, t);
|
|
95
|
+
O !== void 0 ? e[l] = O : Array.isArray(i) || g(r) && g(i) && (d(r) || d(i) || p(r) || p(i)) ? e[l] = o(r, i, f, t) : r == null && d(i) ? e[l] = o({}, i, f, t) : r == null && p(i) ? e[l] = m(i) : (r === void 0 || i !== void 0) && (e[l] = i);
|
|
96
|
+
}
|
|
97
|
+
return e;
|
|
98
|
+
}
|
|
99
|
+
function K(e, ...n) {
|
|
100
|
+
return R(e, ...n, T);
|
|
101
|
+
}
|
|
2
102
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
103
|
+
m as cloneDeep,
|
|
104
|
+
V as filterEmpty,
|
|
105
|
+
I as get,
|
|
106
|
+
K as merge,
|
|
107
|
+
W as set,
|
|
108
|
+
$ as validateJSON
|
|
9
109
|
};
|
package/dist/es/vue.js
CHANGED
|
@@ -1,7 +1,71 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ref as o, onUnmounted as f, computed as a } from "vue";
|
|
2
|
+
import { v as r } from "./event-CGLPzfQO.js";
|
|
3
|
+
import { r as c } from "./request-DXNZ2mjR.js";
|
|
4
|
+
function p() {
|
|
5
|
+
return r;
|
|
6
|
+
}
|
|
7
|
+
function d(e = 100, u = 200) {
|
|
8
|
+
e < 0 && (e = 100);
|
|
9
|
+
let s = !0;
|
|
10
|
+
const t = o(!1);
|
|
11
|
+
r.getParent() && (t.value = !0);
|
|
12
|
+
const n = () => {
|
|
13
|
+
s && setTimeout(() => {
|
|
14
|
+
r.call("online", null, u, e).then((i) => {
|
|
15
|
+
t.value = !!i;
|
|
16
|
+
}).catch(() => {
|
|
17
|
+
t.value = !1;
|
|
18
|
+
}).finally(() => {
|
|
19
|
+
n();
|
|
20
|
+
});
|
|
21
|
+
}, e);
|
|
22
|
+
}, l = () => {
|
|
23
|
+
s = !1;
|
|
24
|
+
};
|
|
25
|
+
return n(), f(() => {
|
|
26
|
+
l();
|
|
27
|
+
}), {
|
|
28
|
+
status: a(() => t.value),
|
|
29
|
+
stop: l
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function g() {
|
|
33
|
+
const e = o("light"), u = o({}), s = r.on("onTheme", (n) => {
|
|
34
|
+
e.value = n?.name, u.value = n?.overrides;
|
|
35
|
+
}), t = () => {
|
|
36
|
+
r.off(s);
|
|
37
|
+
};
|
|
38
|
+
return f(() => {
|
|
39
|
+
t();
|
|
40
|
+
}), {
|
|
41
|
+
name: a(() => e.value),
|
|
42
|
+
overrides: a(() => u.value),
|
|
43
|
+
stop: t
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function q() {
|
|
47
|
+
const e = o(!1);
|
|
48
|
+
return {
|
|
49
|
+
request: (u) => new Promise((s, t) => {
|
|
50
|
+
e.value = !0, c(u).then((n) => {
|
|
51
|
+
s(n);
|
|
52
|
+
}).catch((n) => {
|
|
53
|
+
t(n);
|
|
54
|
+
}).finally(() => {
|
|
55
|
+
e.value = !1;
|
|
56
|
+
});
|
|
57
|
+
}),
|
|
58
|
+
requestLoading: a({
|
|
59
|
+
get: () => e.value,
|
|
60
|
+
set: (u) => {
|
|
61
|
+
e.value = u;
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
}
|
|
2
66
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
67
|
+
p as useEvent,
|
|
68
|
+
d as useOnline,
|
|
69
|
+
q as useRequest,
|
|
70
|
+
g as useTheme
|
|
7
71
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from '../modules/base';
|
|
2
|
+
export * from '../modules/theme';
|
|
3
|
+
export * from '../modules/request';
|
|
4
|
+
export * from '../modules/upload';
|
|
5
|
+
export * from '../modules/table';
|
|
6
|
+
export * from '../modules/richTextEdit';
|
|
7
|
+
export * as message from '../modules/message';
|
|
8
|
+
export * as notification from '../modules/notification';
|
|
9
|
+
export * as scene from '../modules/scene';
|
|
10
|
+
export * as utils from '../modules/utils';
|
|
11
|
+
export * as vueHooks from '../hooks/vue';
|
|
@@ -4,8 +4,7 @@ export * from '../modules/request';
|
|
|
4
4
|
export * from '../modules/upload';
|
|
5
5
|
export * from '../modules/table';
|
|
6
6
|
export * from '../modules/richTextEdit';
|
|
7
|
-
export
|
|
7
|
+
export type { MessageType, MessageOptions } from '../modules/message';
|
|
8
8
|
export * as message from '../modules/message';
|
|
9
|
+
export type { NotificationType, NotificationOptions } from '../modules/notification';
|
|
9
10
|
export * as notification from '../modules/notification';
|
|
10
|
-
export * as utils from '../modules/utils';
|
|
11
|
-
export * as vueHooks from '../hooks/vue';
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xl-app-sdk",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "玄灵前端应用SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/es/index.js",
|
|
7
7
|
"module": "dist/es/index.js",
|
|
8
|
-
"types": "dist/types/index.d.ts",
|
|
8
|
+
"types": "dist/types/lib/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"types": "./dist/types/lib/index.d.ts",
|
|
12
12
|
"import": "./dist/es/index.js"
|
|
13
13
|
},
|
|
14
14
|
"./scene": {
|
|
15
|
-
"types": "./dist/types/
|
|
15
|
+
"types": "./dist/types/lib/scene.d.ts",
|
|
16
16
|
"import": "./dist/es/scene.js"
|
|
17
17
|
},
|
|
18
18
|
"./utils": {
|
|
19
|
-
"types": "./dist/types/
|
|
19
|
+
"types": "./dist/types/lib/utils.d.ts",
|
|
20
20
|
"import": "./dist/es/utils.js"
|
|
21
21
|
},
|
|
22
22
|
"./vue": {
|
|
23
|
-
"types": "./dist/types/
|
|
23
|
+
"types": "./dist/types/lib/vue.d.ts",
|
|
24
24
|
"import": "./dist/es/vue.js"
|
|
25
25
|
}
|
|
26
26
|
},
|