@vtj/renderer 0.10.12 → 0.10.13
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/index.cjs +5 -5
- package/dist/index.mjs +275 -251
- package/package.json +5 -5
- package/types/provider/defaults.d.ts +4 -1
- package/types/provider/provider.d.ts +1 -1
- package/types/utils/util.d.ts +4 -1
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
import { Base as
|
2
|
-
import { isUrl as
|
1
|
+
import { Base as Ae, BUILT_IN_COMPONENTS as Ce, ProjectModel as T, HistoryModel as ce } from "@vtj/core";
|
2
|
+
import { isUrl as Fe, url as b, dedupArray as ke, isString as $, isFunction as J, logger as R, storage as N, cookie as U, toArray as se, unRSA as re, delay as le, createRequest as ue, jsonp as pe, merge as Ie, pathToRegexp as Me, pathToRegexpMatch as Oe, formDataToJson as He, camelCase as E, upperFirst as Te, pick as De, request as q, loadScript as ne, Storage as xe, mapToObject as X } from "@vtj/utils";
|
3
3
|
import * as x from "vue";
|
4
|
-
import { inject as de, defineComponent as fe, h as
|
4
|
+
import { inject as de, defineComponent as fe, h as z, ref as K, defineAsyncComponent as ie, watchEffect as Be } from "vue";
|
5
5
|
import { useRoute as he } from "vue-router";
|
6
6
|
/**!
|
7
7
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
8
8
|
* @name @vtj/renderer
|
9
9
|
* @author CHC chenhuachun1549@dingtalk.com
|
10
|
-
* @version 0.10.
|
10
|
+
* @version 0.10.13
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
12
12
|
*/
|
13
|
-
const
|
13
|
+
const A = "0.10.13";
|
14
14
|
var y = /* @__PURE__ */ ((r) => (r.Runtime = "Runtime", r.Design = "Design", r.Raw = "Raw", r.VNode = "VNode", r))(y || {});
|
15
15
|
const oe = [
|
16
16
|
"$el",
|
@@ -24,7 +24,7 @@ const oe = [
|
|
24
24
|
"$props",
|
25
25
|
"$options",
|
26
26
|
"$forceUpdate"
|
27
|
-
],
|
27
|
+
], Gt = [
|
28
28
|
"beforeCreate",
|
29
29
|
"created",
|
30
30
|
"beforeMount",
|
@@ -38,14 +38,14 @@ const oe = [
|
|
38
38
|
"renderTriggered",
|
39
39
|
"activated",
|
40
40
|
"deactivated"
|
41
|
-
],
|
41
|
+
], Ne = [
|
42
42
|
"vIf",
|
43
43
|
"vShow",
|
44
44
|
"vModel",
|
45
45
|
"vFor",
|
46
46
|
"vBind",
|
47
47
|
"vHtml"
|
48
|
-
],
|
48
|
+
], Ue = {
|
49
49
|
String,
|
50
50
|
Number,
|
51
51
|
Boolean,
|
@@ -53,40 +53,40 @@ const oe = [
|
|
53
53
|
Object,
|
54
54
|
Function,
|
55
55
|
Date
|
56
|
-
}, C = "VtjPage", H = "VtjHomepage",
|
56
|
+
}, C = "VtjPage", H = "VtjHomepage", Le = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
|
57
57
|
","
|
58
58
|
), Je = "component,slot".split(",");
|
59
59
|
function M(r, e) {
|
60
|
-
return r.map((t) =>
|
60
|
+
return r.map((t) => Fe(t) || t.startsWith("/") ? t : `${e}${t}`);
|
61
61
|
}
|
62
|
-
function
|
62
|
+
function Y(r) {
|
63
63
|
return /\.css$/.test(r);
|
64
64
|
}
|
65
65
|
function Z(r) {
|
66
66
|
return /\.js$/.test(r);
|
67
67
|
}
|
68
|
-
function
|
68
|
+
function qe(r) {
|
69
69
|
return /\.json$/.test(r);
|
70
70
|
}
|
71
71
|
function Vt(r) {
|
72
72
|
return r.map(
|
73
|
-
(e) => `<script src="${
|
73
|
+
(e) => `<script src="${b.append(e, { v: A })}"><\/script>`
|
74
74
|
).join("");
|
75
75
|
}
|
76
76
|
function Wt(r = []) {
|
77
77
|
return r.map(
|
78
|
-
(e) => `<link rel="stylesheet" href="${
|
78
|
+
(e) => `<link rel="stylesheet" href="${b.append(e, { v: A })}" />`
|
79
79
|
).join("");
|
80
80
|
}
|
81
81
|
function ze(r, e = !1) {
|
82
82
|
return e && r.endsWith(".prod.js") ? r.replace(".prod.js", ".js") : r;
|
83
83
|
}
|
84
|
-
function
|
84
|
+
function Ke(r, e, t = !1) {
|
85
85
|
const s = r.filter((m) => !!m.enabled), n = [], i = [], a = [], o = [], c = {}, l = {}, f = [], p = {};
|
86
86
|
return s.forEach(
|
87
87
|
({ urls: m, assetsUrl: h, library: d, assetsLibrary: u, localeLibrary: w }) => {
|
88
88
|
m?.forEach((g) => {
|
89
|
-
Z(g) && n.push(ze(g, t)),
|
89
|
+
Z(g) && n.push(ze(g, t)), Y(g) && i.push(g);
|
90
90
|
}), d && (o.push(d), c[d] = M(m || [], e), w && (l[d] = w)), h && a.push(h), u && f.push(u), d && u && (p[u] = d);
|
91
91
|
}
|
92
92
|
), {
|
@@ -94,20 +94,20 @@ function Ve(r, e, t = !1) {
|
|
94
94
|
css: M(i, e),
|
95
95
|
materials: M(a, e),
|
96
96
|
libraryExports: o,
|
97
|
-
materialExports:
|
97
|
+
materialExports: ke(f),
|
98
98
|
materialMapLibrary: p,
|
99
99
|
libraryMap: c,
|
100
100
|
libraryLocaleMap: l
|
101
101
|
};
|
102
102
|
}
|
103
|
-
function
|
103
|
+
function Ge(r, e) {
|
104
104
|
const { name: t, parent: s, alias: n } = r;
|
105
105
|
return s ? e[s]?.[n || t] : e[n || t];
|
106
106
|
}
|
107
|
-
function
|
108
|
-
return
|
107
|
+
function me(r) {
|
108
|
+
return $(r) ? r : JSON.stringify(r);
|
109
109
|
}
|
110
|
-
function
|
110
|
+
function ge(r, e, t) {
|
111
111
|
const s = r.CSSStyleSheet;
|
112
112
|
if (s.prototype.replaceSync) {
|
113
113
|
const n = new s();
|
@@ -122,11 +122,11 @@ function ve(r, e, t) {
|
|
122
122
|
i ? i.innerHTML = t : (i = n.createElement("style"), i.id = e, i.innerHTML = t, n.head.appendChild(i));
|
123
123
|
}
|
124
124
|
}
|
125
|
-
async function
|
125
|
+
async function Ve(r, e) {
|
126
126
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
127
|
-
t &&
|
127
|
+
t && ge(window, r, t);
|
128
128
|
}
|
129
|
-
function
|
129
|
+
function We(r, e = window) {
|
130
130
|
const t = e.document, s = e.document.head;
|
131
131
|
for (const n of r)
|
132
132
|
if (!t.getElementById(n)) {
|
@@ -149,22 +149,27 @@ async function Qe(r, e, t = window) {
|
|
149
149
|
});
|
150
150
|
}
|
151
151
|
function Xe(r) {
|
152
|
-
return
|
152
|
+
return J(r) || J(r?.install);
|
153
153
|
}
|
154
|
-
function
|
154
|
+
function Ye(r) {
|
155
155
|
return Je.includes(r);
|
156
156
|
}
|
157
|
-
function
|
158
|
-
return
|
157
|
+
function Ze(r) {
|
158
|
+
return Le.includes(r);
|
159
159
|
}
|
160
|
-
function
|
160
|
+
function F(r = window) {
|
161
161
|
const e = window?.Mock;
|
162
162
|
if (e) return e;
|
163
163
|
const t = r?.Mock;
|
164
164
|
if (t && window)
|
165
165
|
return window.Mock = t, t;
|
166
166
|
}
|
167
|
-
function
|
167
|
+
function Qt(r, e, t) {
|
168
|
+
Object.assign(e.meta, t.meta);
|
169
|
+
const s = r?._container;
|
170
|
+
t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
|
171
|
+
}
|
172
|
+
function k(r, e, t = !1, s = !1) {
|
168
173
|
try {
|
169
174
|
const n = ['"use strict";', "var __self = arguments[0];"];
|
170
175
|
n.push("return ");
|
@@ -178,8 +183,8 @@ function F(r, e, t = !1, s = !1) {
|
|
178
183
|
throw n;
|
179
184
|
}
|
180
185
|
}
|
181
|
-
function
|
182
|
-
const n =
|
186
|
+
function G(r, e, t = !1, s = !1) {
|
187
|
+
const n = k(r, e, t, s);
|
183
188
|
if (typeof n != "function" && (R.error(
|
184
189
|
"parseFunction.error",
|
185
190
|
"not a function",
|
@@ -192,16 +197,16 @@ function V(r, e, t = !1, s = !1) {
|
|
192
197
|
function _(r) {
|
193
198
|
return r && r.type === "JSExpression";
|
194
199
|
}
|
195
|
-
function
|
200
|
+
function I(r) {
|
196
201
|
return typeof r == "object" && r && r.type === "JSFunction";
|
197
202
|
}
|
198
|
-
function
|
199
|
-
return _(r) ||
|
203
|
+
function et(r) {
|
204
|
+
return _(r) || I(r);
|
200
205
|
}
|
201
|
-
function
|
202
|
-
return
|
206
|
+
function Xt(r) {
|
207
|
+
return et(r) ? r.value : JSON.stringify(r);
|
203
208
|
}
|
204
|
-
const
|
209
|
+
const tt = {
|
205
210
|
session: !1,
|
206
211
|
authKey: "Authorization",
|
207
212
|
storageKey: "ACCESS_STORAGE",
|
@@ -213,13 +218,13 @@ const st = {
|
|
213
218
|
unauthorizedMessage: "登录已经失效,请重新登录!",
|
214
219
|
noPermissionMessage: "无权限访问该页面",
|
215
220
|
appName: ""
|
216
|
-
},
|
217
|
-
class
|
221
|
+
}, ve = Symbol("access");
|
222
|
+
class st {
|
218
223
|
options;
|
219
224
|
data = null;
|
220
225
|
mode = y.Raw;
|
221
226
|
constructor(e) {
|
222
|
-
this.options = Object.assign({},
|
227
|
+
this.options = Object.assign({}, tt, e), this.loadData();
|
223
228
|
}
|
224
229
|
connect(e) {
|
225
230
|
const { mode: t, router: s, request: n } = e;
|
@@ -230,14 +235,14 @@ class Yt {
|
|
230
235
|
this.setData(e), this.data && (N.save(t, e, {
|
231
236
|
type: "local",
|
232
237
|
prefix: s
|
233
|
-
}), n &&
|
238
|
+
}), n && U.set(i, this.data.token));
|
234
239
|
}
|
235
240
|
clear() {
|
236
241
|
const { storageKey: e, storagePrefix: t, session: s, authKey: n } = this.options;
|
237
242
|
this.data = null, N.remove(e, {
|
238
243
|
type: "local",
|
239
244
|
prefix: t
|
240
|
-
}), s &&
|
245
|
+
}), s && U.remove(n);
|
241
246
|
}
|
242
247
|
logout() {
|
243
248
|
this.clear(), this.toLogin();
|
@@ -257,7 +262,7 @@ class Yt {
|
|
257
262
|
return se(e).some((i) => s[i] || s[t + "." + i]);
|
258
263
|
}
|
259
264
|
install(e) {
|
260
|
-
e.config.globalProperties.$access || (e.config.globalProperties.$access = this, e.provide(
|
265
|
+
e.config.globalProperties.$access || (e.config.globalProperties.$access = this, e.provide(ve, this));
|
261
266
|
}
|
262
267
|
isAuthPath(e) {
|
263
268
|
const { auth: t, isAuth: s } = this.options;
|
@@ -301,7 +306,7 @@ class Yt {
|
|
301
306
|
}
|
302
307
|
isLogined() {
|
303
308
|
const { session: e, authKey: t } = this.options;
|
304
|
-
return e && t ? !!
|
309
|
+
return e && t ? !!U.get(t) : !!this.getToken();
|
305
310
|
}
|
306
311
|
hasRoutePermission(e) {
|
307
312
|
if (e.name === C) {
|
@@ -321,7 +326,7 @@ class Yt {
|
|
321
326
|
return t();
|
322
327
|
{
|
323
328
|
const { noPermissionMessage: s = "无权限访问", unauthorized: n = !1 } = this.options;
|
324
|
-
return await this.showTip(s),
|
329
|
+
return await this.showTip(s), J(n) ? (n(), t(!1)) : $(n) ? t(n) : t(!1);
|
325
330
|
}
|
326
331
|
}
|
327
332
|
t(!1), this.toLogin();
|
@@ -356,11 +361,18 @@ class Yt {
|
|
356
361
|
}
|
357
362
|
}
|
358
363
|
function rt() {
|
359
|
-
return de(
|
364
|
+
return de(ve, null);
|
360
365
|
}
|
361
|
-
function
|
362
|
-
const {
|
363
|
-
|
366
|
+
function Yt(r = {}) {
|
367
|
+
const {
|
368
|
+
notify: e,
|
369
|
+
loading: t,
|
370
|
+
settings: s = {},
|
371
|
+
Startup: n,
|
372
|
+
access: i,
|
373
|
+
remote: a = "https://lcdp.vtj.pro"
|
374
|
+
} = r;
|
375
|
+
let o = null;
|
364
376
|
return {
|
365
377
|
request: ue({
|
366
378
|
settings: {
|
@@ -368,16 +380,16 @@ function Qt(r = {}) {
|
|
368
380
|
validSuccess: !0,
|
369
381
|
originResponse: !1,
|
370
382
|
loading: !0,
|
371
|
-
validate: (
|
383
|
+
validate: (l) => l.data?.code === 0 || !!l.data?.success,
|
372
384
|
failMessage: !0,
|
373
|
-
showError: (
|
374
|
-
e && e(
|
385
|
+
showError: (l) => {
|
386
|
+
e && e(l || "未知错误");
|
375
387
|
},
|
376
388
|
showLoading: () => {
|
377
|
-
|
389
|
+
o && o.close(), t && (o = t());
|
378
390
|
},
|
379
391
|
hideLoading: () => {
|
380
|
-
|
392
|
+
o && (o.close(), o = null);
|
381
393
|
},
|
382
394
|
...s
|
383
395
|
}
|
@@ -385,10 +397,20 @@ function Qt(r = {}) {
|
|
385
397
|
jsonp: pe,
|
386
398
|
notify: e,
|
387
399
|
loading: t,
|
388
|
-
startupComponent: n
|
400
|
+
startupComponent: n,
|
401
|
+
remote: a,
|
402
|
+
access: i ? nt(i) : void 0
|
403
|
+
};
|
404
|
+
}
|
405
|
+
function nt(r = {}) {
|
406
|
+
const e = {
|
407
|
+
storageKey: "RRO_IDE_ACCESS_STORAGE__",
|
408
|
+
auth: "https://lcdp.vtj.pro/auth.html",
|
409
|
+
privateKey: "MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"
|
389
410
|
};
|
411
|
+
return new st(Object.assign(e, r));
|
390
412
|
}
|
391
|
-
function
|
413
|
+
function it(r, e) {
|
392
414
|
const { jsonp: t, request: s } = e;
|
393
415
|
if (r.method === "jsonp")
|
394
416
|
return (n = {}) => t(r.url, {
|
@@ -396,7 +418,7 @@ function nt(r, e) {
|
|
396
418
|
query: n
|
397
419
|
});
|
398
420
|
{
|
399
|
-
const n = r.headers ?
|
421
|
+
const n = r.headers ? k(r.headers, {}, !0) : void 0, i = {
|
400
422
|
url: r.url,
|
401
423
|
method: r.method,
|
402
424
|
settings: {
|
@@ -407,7 +429,7 @@ function nt(r, e) {
|
|
407
429
|
return (a, o) => (delete i.data, s.send(Ie(i, o || {}, { data: a })));
|
408
430
|
}
|
409
431
|
}
|
410
|
-
function
|
432
|
+
function ot(r, e) {
|
411
433
|
const { metaQuery: t } = e;
|
412
434
|
if (!t) return;
|
413
435
|
const { code: s, queryCode: n } = r;
|
@@ -419,20 +441,20 @@ function it(r, e) {
|
|
419
441
|
return t(s, n, i, a);
|
420
442
|
};
|
421
443
|
}
|
422
|
-
function
|
444
|
+
function at(r = [], e = [], t) {
|
423
445
|
const s = {};
|
424
446
|
for (const n of r)
|
425
|
-
s[n.id] = nt(n, t);
|
426
|
-
for (const n of e)
|
427
447
|
s[n.id] = it(n, t);
|
448
|
+
for (const n of e)
|
449
|
+
s[n.id] = ot(n, t);
|
428
450
|
return s;
|
429
451
|
}
|
430
|
-
async function
|
431
|
-
const t =
|
432
|
-
t && (
|
452
|
+
async function ct(r = [], e = window) {
|
453
|
+
const t = F(e);
|
454
|
+
t && (ye(e), r.forEach((s) => ut(t, s)));
|
433
455
|
}
|
434
|
-
function
|
435
|
-
const t =
|
456
|
+
function lt(r, e = window) {
|
457
|
+
const t = I(r.mockTemplate) && r.mockTemplate.value ? G(r.mockTemplate, {}, !0) : void 0, s = F(e);
|
436
458
|
return async (...n) => {
|
437
459
|
let i = {};
|
438
460
|
if (t)
|
@@ -444,22 +466,22 @@ function ct(r, e = window) {
|
|
444
466
|
return s?.mock(i);
|
445
467
|
};
|
446
468
|
}
|
447
|
-
function
|
469
|
+
function ut(r, e) {
|
448
470
|
if (!e.mock) return;
|
449
471
|
const { url: t, mockTemplate: s } = e;
|
450
472
|
if (t && s) {
|
451
|
-
const n =
|
473
|
+
const n = Me(`${t}(.*)`), i = Oe(t, { decode: decodeURIComponent }), a = k(s, {}, !0);
|
452
474
|
r.mock(n, (o) => {
|
453
|
-
const c =
|
475
|
+
const c = b.parse(o.url) || {}, l = o.body instanceof FormData ? He(o.body) : o.body, f = i(o.url)?.params;
|
454
476
|
return Object.assign(o, { data: l, params: c, query: f }), r.mock(a(o));
|
455
477
|
});
|
456
478
|
}
|
457
479
|
}
|
458
|
-
function
|
459
|
-
const e =
|
480
|
+
function ye(r = window) {
|
481
|
+
const e = F(r);
|
460
482
|
e && (e._mocked = {});
|
461
483
|
}
|
462
|
-
class
|
484
|
+
class pt {
|
463
485
|
__id = null;
|
464
486
|
__mode;
|
465
487
|
__instance = null;
|
@@ -518,17 +540,17 @@ class ut {
|
|
518
540
|
if (e)
|
519
541
|
if (this.__mode === y.Runtime) {
|
520
542
|
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
521
|
-
return
|
543
|
+
return G({ type: s, value: n }, this);
|
522
544
|
} else
|
523
|
-
return
|
545
|
+
return G(e, this);
|
524
546
|
}
|
525
547
|
__parseExpression(e) {
|
526
548
|
if (e)
|
527
549
|
if (this.__mode === y.Runtime) {
|
528
550
|
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
529
|
-
return
|
551
|
+
return k({ type: s, value: n }, this);
|
530
552
|
} else
|
531
|
-
return
|
553
|
+
return k(e, this);
|
532
554
|
}
|
533
555
|
__ref(e = null, t) {
|
534
556
|
if (this.__mode !== y.VNode)
|
@@ -558,7 +580,7 @@ class ut {
|
|
558
580
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
559
581
|
}
|
560
582
|
}
|
561
|
-
function
|
583
|
+
function V(r) {
|
562
584
|
const {
|
563
585
|
Vue: e = x,
|
564
586
|
mode: t = y.Runtime,
|
@@ -570,22 +592,22 @@ function W(r) {
|
|
570
592
|
$components: s,
|
571
593
|
$libs: n,
|
572
594
|
$apis: i
|
573
|
-
}, l = new
|
595
|
+
}, l = new pt({
|
574
596
|
mode: t,
|
575
597
|
dsl: o.value,
|
576
598
|
attrs: c
|
577
599
|
}), f = e.defineComponent({
|
578
600
|
name: o.value.name,
|
579
601
|
props: {
|
580
|
-
...
|
602
|
+
...ft(o.value.props ?? [], l)
|
581
603
|
},
|
582
604
|
setup(p) {
|
583
|
-
l.$props = p, l.props = p, o.value.id &&
|
605
|
+
l.$props = p, l.props = p, o.value.id && ge(
|
584
606
|
r.window || window,
|
585
607
|
o.value.id,
|
586
608
|
o.value.css || ""
|
587
|
-
), l.state =
|
588
|
-
const m =
|
609
|
+
), l.state = ht(e, o.value.state ?? {}, l);
|
610
|
+
const m = mt(e, o.value.computed ?? {}, l), h = gt(o.value.methods ?? {}, l), d = vt(e, o.value.inject, l), u = yt(
|
589
611
|
o.value.dataSources || {},
|
590
612
|
l
|
591
613
|
), w = {
|
@@ -594,30 +616,30 @@ function W(r) {
|
|
594
616
|
...h,
|
595
617
|
...u
|
596
618
|
};
|
597
|
-
return l.setup(w, e),
|
619
|
+
return l.setup(w, e), _t(e, o.value.watch ?? [], l), {
|
598
620
|
vtj: l
|
599
621
|
};
|
600
622
|
},
|
601
|
-
emits:
|
623
|
+
emits: dt(o.value.emits),
|
602
624
|
expose: ["vtj"],
|
603
625
|
render() {
|
604
626
|
if (!o.value.nodes) return null;
|
605
627
|
const p = o.value.nodes || [];
|
606
628
|
return p.length === 1 ? D(p[0], l, e, a) : p.map((m) => D(m, l, e, a));
|
607
629
|
},
|
608
|
-
...
|
630
|
+
...wt(o.value.lifeCycles ?? {}, l)
|
609
631
|
});
|
610
632
|
return {
|
611
633
|
renderer: e.markRaw(f),
|
612
634
|
context: l
|
613
635
|
};
|
614
636
|
}
|
615
|
-
function
|
616
|
-
return r.map((e) =>
|
637
|
+
function dt(r = []) {
|
638
|
+
return r.map((e) => $(e) ? e : e.name);
|
617
639
|
}
|
618
|
-
function
|
619
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((i) =>
|
620
|
-
return r.map((s) =>
|
640
|
+
function ft(r = [], e) {
|
641
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((i) => Ue[i]) : void 0;
|
642
|
+
return r.map((s) => $(s) ? {
|
621
643
|
name: s
|
622
644
|
} : {
|
623
645
|
name: s.name,
|
@@ -633,30 +655,30 @@ function dt(r = [], e) {
|
|
633
655
|
{}
|
634
656
|
);
|
635
657
|
}
|
636
|
-
function
|
658
|
+
function ht(r, e, t) {
|
637
659
|
return r.reactive(
|
638
660
|
Object.keys(e || {}).reduce(
|
639
661
|
(s, n) => {
|
640
662
|
let i = e[n];
|
641
|
-
return _(i) ? i = t.__parseExpression(i) :
|
663
|
+
return _(i) ? i = t.__parseExpression(i) : I(i) && (i = t.__parseFunction(i)), s[n] = i, s;
|
642
664
|
},
|
643
665
|
{}
|
644
666
|
)
|
645
667
|
);
|
646
668
|
}
|
647
|
-
function
|
669
|
+
function mt(r, e, t) {
|
648
670
|
return Object.entries(e ?? {}).reduce(
|
649
671
|
(s, [n, i]) => (s[n] = r.computed(t.__parseFunction(i)), s),
|
650
672
|
{}
|
651
673
|
);
|
652
674
|
}
|
653
|
-
function
|
675
|
+
function gt(r, e) {
|
654
676
|
return Object.entries(r ?? {}).reduce(
|
655
677
|
(t, [s, n]) => (t[s] = e.__parseFunction(n), t),
|
656
678
|
{}
|
657
679
|
);
|
658
680
|
}
|
659
|
-
function
|
681
|
+
function vt(r, e = [], t) {
|
660
682
|
return e.reduce(
|
661
683
|
(s, n) => {
|
662
684
|
const { name: i, from: a } = n || {};
|
@@ -667,14 +689,14 @@ function gt(r, e = [], t) {
|
|
667
689
|
{}
|
668
690
|
);
|
669
691
|
}
|
670
|
-
function
|
692
|
+
function yt(r, e) {
|
671
693
|
return Object.keys(r).reduce(
|
672
694
|
(t, s) => {
|
673
695
|
const n = r[s];
|
674
696
|
if (n.type === "mock")
|
675
|
-
t[s] =
|
697
|
+
t[s] = lt(n);
|
676
698
|
else if (n.ref) {
|
677
|
-
const i = e.$apis[n.ref], a =
|
699
|
+
const i = e.$apis[n.ref], a = I(n.transform) ? n.transform.value ? e.__parseFunction(n.transform) : void 0 : n.transform;
|
678
700
|
t[s] = async (...o) => {
|
679
701
|
const c = await i.apply(e, o);
|
680
702
|
return a ? a(c) : c;
|
@@ -685,7 +707,7 @@ function vt(r, e) {
|
|
685
707
|
{}
|
686
708
|
);
|
687
709
|
}
|
688
|
-
function
|
710
|
+
function _t(r, e = [], t) {
|
689
711
|
e.forEach((s) => {
|
690
712
|
r.watch(
|
691
713
|
t.__parseExpression(s.source),
|
@@ -697,59 +719,59 @@ function yt(r, e = [], t) {
|
|
697
719
|
);
|
698
720
|
});
|
699
721
|
}
|
700
|
-
function
|
722
|
+
function wt(r, e) {
|
701
723
|
return Object.entries(r ?? {}).reduce(
|
702
724
|
(t, [s, n]) => (t[s] = e.__parseFunction(n), t),
|
703
725
|
{}
|
704
726
|
);
|
705
727
|
}
|
706
|
-
let L = [],
|
707
|
-
const
|
708
|
-
async function
|
728
|
+
let L = [], P = {};
|
729
|
+
const St = (r) => r;
|
730
|
+
async function _e(r, e = window) {
|
709
731
|
const { urls: t = [], library: s } = r, n = t.filter((o) => Z(o));
|
710
732
|
if (n.length === 0 || !s) return null;
|
711
|
-
const i = t.filter((o) =>
|
712
|
-
return i.length &&
|
733
|
+
const i = t.filter((o) => Y(o));
|
734
|
+
return i.length && We(i, e), await Qe(n, s, e).catch(
|
713
735
|
(o) => (console.warn("loadScriptUrl error", n, s, o), null)
|
714
736
|
);
|
715
737
|
}
|
716
|
-
function
|
738
|
+
function W(r) {
|
717
739
|
const { getDsl: e, getDslByUrl: t, options: s } = r;
|
718
740
|
return s.window && (L.forEach((n) => {
|
719
741
|
delete s.window[n];
|
720
742
|
}), L = []), (n, i, a = x) => {
|
721
743
|
if (!i || typeof i == "string") return n;
|
722
744
|
if (i.type === "Schema" && i.id) {
|
723
|
-
let o =
|
724
|
-
return o || (o =
|
745
|
+
let o = P[i.id];
|
746
|
+
return o || (o = P[i.id] = a.defineAsyncComponent(async () => {
|
725
747
|
const c = await e(i.id);
|
726
|
-
return c && (c.name = n), c ?
|
748
|
+
return c && (c.name = n), c ? V({
|
727
749
|
...s,
|
728
750
|
Vue: a,
|
729
751
|
dsl: c,
|
730
752
|
mode: y.Runtime,
|
731
|
-
loader:
|
753
|
+
loader: W(r)
|
732
754
|
}).renderer : null;
|
733
755
|
}), o);
|
734
756
|
}
|
735
757
|
if (i.type === "UrlSchema" && i.url) {
|
736
|
-
let o =
|
737
|
-
return o || (o =
|
758
|
+
let o = P[i.url];
|
759
|
+
return o || (o = P[i.url] = a.defineAsyncComponent(async () => {
|
738
760
|
const c = await t(i.url);
|
739
|
-
return c && (c.name = n), c ?
|
761
|
+
return c && (c.name = n), c ? V({
|
740
762
|
...s,
|
741
763
|
Vue: a,
|
742
764
|
dsl: c,
|
743
765
|
mode: y.Runtime,
|
744
|
-
loader:
|
766
|
+
loader: W(r)
|
745
767
|
}).renderer : null;
|
746
768
|
}), o);
|
747
769
|
}
|
748
770
|
if (i.type === "Plugin") {
|
749
|
-
let o = i.library ?
|
750
|
-
return o || (i.library && L.push(i.library), o =
|
771
|
+
let o = i.library ? P[i.library] : null;
|
772
|
+
return o || (i.library && L.push(i.library), o = P[i.library || Symbol()] = a.defineAsyncComponent(
|
751
773
|
async () => {
|
752
|
-
const c = await
|
774
|
+
const c = await _e(i, s.window);
|
753
775
|
return c || (console.warn("getPlugin result is null", i), null);
|
754
776
|
}
|
755
777
|
), o);
|
@@ -757,44 +779,44 @@ function G(r) {
|
|
757
779
|
return n;
|
758
780
|
};
|
759
781
|
}
|
760
|
-
function
|
761
|
-
|
782
|
+
function Zt() {
|
783
|
+
P = {};
|
762
784
|
}
|
763
|
-
function D(r, e, t = x, s =
|
785
|
+
function D(r, e, t = x, s = St) {
|
764
786
|
if (!r || !r.name || r.invisible) return null;
|
765
787
|
const n = t.getCurrentInstance()?.appContext, { id: i = null, directives: a = [] } = r, { vIf: o, vFor: c, vShow: l, vModels: f, vBind: p, vHtml: m, others: h } = $t(a);
|
766
|
-
if (o && !
|
788
|
+
if (o && !Et(o, e))
|
767
789
|
return null;
|
768
790
|
const d = (u) => {
|
769
791
|
const w = u.$components, g = (() => {
|
770
792
|
if (r.name === "component")
|
771
|
-
return
|
793
|
+
return Pt(u, r.props?.is);
|
772
794
|
if (r.name === "slot") return r.name;
|
773
|
-
const
|
774
|
-
return j
|
775
|
-
})(), S =
|
795
|
+
const j = s(r.name, r.from, t);
|
796
|
+
return $(j) ? Ye(j) || Ze(j) ? j : w[j] ?? n?.app?.component(j) ?? j : j;
|
797
|
+
})(), S = bt(i, r.props ?? {}, u), be = Rt(t, r.events ?? {}, u);
|
776
798
|
if (r.name === "slot")
|
777
|
-
return
|
799
|
+
return At(t, r, S, u, s);
|
778
800
|
p && Object.assign(S, u.__parseExpression(p.value)), l && (S.style = Object.assign(
|
779
801
|
S.style ?? {},
|
780
|
-
|
781
|
-
)), m && Object.assign(S,
|
782
|
-
Object.assign(S,
|
802
|
+
Ft(l, u)
|
803
|
+
)), m && Object.assign(S, kt(m, u)), f.forEach((j) => {
|
804
|
+
Object.assign(S, It(t, j, u));
|
783
805
|
});
|
784
|
-
const
|
806
|
+
const Re = Mt(
|
785
807
|
t,
|
786
808
|
r.children ?? [],
|
787
809
|
u,
|
788
810
|
s,
|
789
811
|
r
|
790
812
|
);
|
791
|
-
let
|
792
|
-
const te = n ?
|
793
|
-
return te.length && (
|
813
|
+
let B = t.createVNode(g, { ...S, ...be }, Re);
|
814
|
+
const te = n ? jt(n, h, u) : [];
|
815
|
+
return te.length && (B = t.withDirectives(B, te)), B;
|
794
816
|
};
|
795
817
|
return c ? Tt(c, d, e) : d(e);
|
796
818
|
}
|
797
|
-
function
|
819
|
+
function jt(r, e, t) {
|
798
820
|
const s = r.app;
|
799
821
|
return e.map((n) => {
|
800
822
|
const i = typeof n.name == "string" ? s.directive(n.name) : t.__parseExpression(n.name);
|
@@ -804,10 +826,10 @@ function St(r, e, t) {
|
|
804
826
|
}).filter((n) => !!n);
|
805
827
|
}
|
806
828
|
function $t(r = []) {
|
807
|
-
const e = r.find((c) =>
|
808
|
-
(c) =>
|
829
|
+
const e = r.find((c) => E(c.name) === "vIf"), t = r.find((c) => E(c.name) === "vFor"), s = r.find((c) => E(c.name) === "vShow"), n = r.find((c) => E(c.name) === "vBind"), i = r.find((c) => E(c.name) === "vHtml"), a = r.filter(
|
830
|
+
(c) => E(c.name) === "vModel"
|
809
831
|
), o = r.filter(
|
810
|
-
(c) => !
|
832
|
+
(c) => !Ne.includes(E(c.name))
|
811
833
|
);
|
812
834
|
return {
|
813
835
|
vIf: e,
|
@@ -819,26 +841,26 @@ function $t(r = []) {
|
|
819
841
|
vHtml: i
|
820
842
|
};
|
821
843
|
}
|
822
|
-
function
|
844
|
+
function Et(r, e) {
|
823
845
|
return !!e.__parseExpression(r.value);
|
824
846
|
}
|
825
|
-
function
|
847
|
+
function Pt(r, e) {
|
826
848
|
return e ? _(e) ? r.__parseExpression(e) : e : "div";
|
827
849
|
}
|
828
|
-
function
|
829
|
-
const s =
|
850
|
+
function bt(r, e, t) {
|
851
|
+
const s = Q(e, t);
|
830
852
|
return s.ref = t.__ref(r, s.ref), s;
|
831
853
|
}
|
832
|
-
function
|
833
|
-
return _(r) ? e.__parseExpression(r) :
|
854
|
+
function Q(r, e) {
|
855
|
+
return _(r) ? e.__parseExpression(r) : I(r) ? e.__parseFunction(r) : Array.isArray(r) ? r.map((t) => Q(t, e)) : typeof r == "object" ? Object.keys(r || {}).reduce(
|
834
856
|
(t, s) => {
|
835
857
|
let n = r[s];
|
836
|
-
return t[s] =
|
858
|
+
return t[s] = Q(n, e), t;
|
837
859
|
},
|
838
860
|
{}
|
839
861
|
) : r;
|
840
862
|
}
|
841
|
-
function
|
863
|
+
function Rt(r, e, t) {
|
842
864
|
const s = ["passive", "capture", "once"], n = {
|
843
865
|
capture: "Capture",
|
844
866
|
once: "Once",
|
@@ -846,20 +868,20 @@ function Pt(r, e, t) {
|
|
846
868
|
};
|
847
869
|
return Object.keys(e || {}).reduce(
|
848
870
|
(i, a) => {
|
849
|
-
const o = e[a], c =
|
871
|
+
const o = e[a], c = we(o.modifiers), l = c.find((m) => s.includes(m)), f = "on" + Te(a) + (l && n[l] || ""), p = t.__parseFunction(o.handler);
|
850
872
|
return p && (i[f] = r.withModifiers(p, c)), i;
|
851
873
|
},
|
852
874
|
{}
|
853
875
|
);
|
854
876
|
}
|
855
|
-
function
|
877
|
+
function we(r = {}, e = !1) {
|
856
878
|
const t = Object.keys(r);
|
857
879
|
return e ? t.map((s) => "." + s) : t;
|
858
880
|
}
|
859
|
-
function
|
881
|
+
function At(r, e, t, s, n) {
|
860
882
|
const { children: i } = e, a = Ct(e, s), o = s.$slots?.[a.name];
|
861
|
-
return o ? o(t) : i ?
|
862
|
-
|
883
|
+
return o ? o(t) : i ? $(i) ? r.createTextVNode(i) : _(i) ? r.createTextVNode(
|
884
|
+
me(s.__parseExpression(i))
|
863
885
|
) : Array.isArray(i) ? i.map(
|
864
886
|
(c) => D(c, s, r, n)
|
865
887
|
) : null : null;
|
@@ -871,23 +893,23 @@ function Ct(r, e) {
|
|
871
893
|
params: []
|
872
894
|
};
|
873
895
|
}
|
874
|
-
function
|
896
|
+
function Ft(r, e) {
|
875
897
|
return e.__parseExpression(r.value) ? {} : {
|
876
898
|
display: "none"
|
877
899
|
};
|
878
900
|
}
|
879
|
-
function
|
901
|
+
function kt(r, e) {
|
880
902
|
return {
|
881
903
|
innerHTML: e.__parseExpression(r.value) || ""
|
882
904
|
};
|
883
905
|
}
|
884
|
-
function
|
906
|
+
function It(r, e, t) {
|
885
907
|
const s = {
|
886
908
|
type: "JSFunction",
|
887
909
|
value: e.value?.value ? `(v) => {
|
888
910
|
${e.value.value} = v;
|
889
911
|
}` : "(v) => {}"
|
890
|
-
}, n = t.__parseFunction(s), i =
|
912
|
+
}, n = t.__parseFunction(s), i = we(
|
891
913
|
_(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
892
914
|
), a = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
893
915
|
return {
|
@@ -897,18 +919,18 @@ function At(r, e, t) {
|
|
897
919
|
}
|
898
920
|
function Mt(r, e, t, s, n) {
|
899
921
|
if (!e) return null;
|
900
|
-
if (
|
922
|
+
if ($(e))
|
901
923
|
return { default: () => e };
|
902
924
|
if (_(e))
|
903
925
|
return {
|
904
|
-
default: () =>
|
926
|
+
default: () => me(t.__parseExpression(e))
|
905
927
|
};
|
906
928
|
if (Array.isArray(e) && e.length > 0) {
|
907
|
-
const i =
|
929
|
+
const i = Ot(e), a = (o) => !o || !n ? {} : n?.id && Object.keys(o).length ? {
|
908
930
|
[`scope_${n.id}`]: o
|
909
931
|
} : {};
|
910
932
|
return Object.entries(i).reduce((o, [c, { nodes: l, params: f }]) => (o[c] = (p) => {
|
911
|
-
const m = f.length ?
|
933
|
+
const m = f.length ? De(p ?? {}, f) : a(p);
|
912
934
|
return l.map(
|
913
935
|
(h) => D(h, t.__clone(m), r, s)
|
914
936
|
);
|
@@ -916,7 +938,7 @@ function Mt(r, e, t, s, n) {
|
|
916
938
|
}
|
917
939
|
return null;
|
918
940
|
}
|
919
|
-
function
|
941
|
+
function Ot(r) {
|
920
942
|
const e = {
|
921
943
|
default: {
|
922
944
|
params: [],
|
@@ -933,7 +955,7 @@ function It(r) {
|
|
933
955
|
return e;
|
934
956
|
}
|
935
957
|
function Ht(r = "default") {
|
936
|
-
return
|
958
|
+
return $(r) ? { name: r, params: [] } : { params: [], ...r };
|
937
959
|
}
|
938
960
|
function Tt(r, e, t) {
|
939
961
|
const { value: s, iterator: n } = r, { item: i = "item", index: a = "index" } = n || {};
|
@@ -943,7 +965,7 @@ function Tt(r, e, t) {
|
|
943
965
|
const ae = fe({
|
944
966
|
name: "VtjPageContainer",
|
945
967
|
async setup() {
|
946
|
-
const r = je(), e = he(), t = e.params.id, s = t ? r.getPage(t) : r.getHomepage(), n = s ? await r.getRenderComponent(s.id) : null, i =
|
968
|
+
const r = je(), e = he(), t = e.params.id, s = t ? r.getPage(t) : r.getHomepage(), n = s ? await r.getRenderComponent(s.id) : null, i = K(Symbol());
|
947
969
|
if (s) {
|
948
970
|
Object.assign(e.meta, s.meta || {}, { cache: s.cache });
|
949
971
|
const { useTitle: a } = r?.adapter;
|
@@ -961,7 +983,7 @@ const ae = fe({
|
|
961
983
|
},
|
962
984
|
render() {
|
963
985
|
const { component: r, query: e, sid: t } = this;
|
964
|
-
return r ?
|
986
|
+
return r ? z(r, { ...e, key: t }) : z("div", "页面不存在");
|
965
987
|
},
|
966
988
|
activated() {
|
967
989
|
this.meta.cache === !1 && (this.sid = Symbol());
|
@@ -969,11 +991,11 @@ const ae = fe({
|
|
969
991
|
}), Dt = fe({
|
970
992
|
name: "VtjStartupContainer",
|
971
993
|
render() {
|
972
|
-
return
|
994
|
+
return z("div", "page not found!");
|
973
995
|
}
|
974
|
-
}),
|
996
|
+
}), Se = Symbol("Provider");
|
975
997
|
var xt = /* @__PURE__ */ ((r) => (r.Production = "production", r.Development = "development", r))(xt || {});
|
976
|
-
class
|
998
|
+
class Bt extends Ae {
|
977
999
|
constructor(e) {
|
978
1000
|
super(), this.options = e;
|
979
1001
|
const {
|
@@ -997,7 +1019,7 @@ class Ot extends ke {
|
|
997
1019
|
mode;
|
998
1020
|
globals = {};
|
999
1021
|
modules = {};
|
1000
|
-
adapter = { request:
|
1022
|
+
adapter = { request: q, jsonp: pe };
|
1001
1023
|
apis = {};
|
1002
1024
|
dependencies = {};
|
1003
1025
|
materials = {};
|
@@ -1018,7 +1040,7 @@ class Ot extends ke {
|
|
1018
1040
|
} catch (i) {
|
1019
1041
|
R.warn("模拟数据模版异常", i);
|
1020
1042
|
}
|
1021
|
-
return
|
1043
|
+
return F()?.mock(s);
|
1022
1044
|
};
|
1023
1045
|
}
|
1024
1046
|
async load(e) {
|
@@ -1026,10 +1048,10 @@ class Ot extends ke {
|
|
1026
1048
|
if (this.project = t ? await t() : await this.service.init(e), !this.project)
|
1027
1049
|
throw new Error("project is null");
|
1028
1050
|
const { apis: s = [], meta: n = [] } = this.project, i = window;
|
1029
|
-
i && (i.CKEDITOR_VERSION = void 0), this.mode === y.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis =
|
1051
|
+
i && (i.CKEDITOR_VERSION = void 0), this.mode === y.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = at(s, n, this.adapter), ye(i), ct(s, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
|
1030
1052
|
}
|
1031
1053
|
initMock(e) {
|
1032
|
-
const t =
|
1054
|
+
const t = F(e);
|
1033
1055
|
t && t.setup({
|
1034
1056
|
timeout: "50-500"
|
1035
1057
|
});
|
@@ -1046,7 +1068,7 @@ class Ot extends ke {
|
|
1046
1068
|
materials: f,
|
1047
1069
|
materialExports: p,
|
1048
1070
|
materialMapLibrary: m
|
1049
|
-
} =
|
1071
|
+
} = Ke(
|
1050
1072
|
t,
|
1051
1073
|
a,
|
1052
1074
|
o === "development"
|
@@ -1061,16 +1083,16 @@ class Ot extends ke {
|
|
1061
1083
|
else {
|
1062
1084
|
const w = l[h] || [];
|
1063
1085
|
for (const g of w)
|
1064
|
-
|
1086
|
+
Y(g) && await Ve(h, b.append(g, { v: A })), Z(g) && await ne(b.append(g, { v: A }));
|
1065
1087
|
n[h] = e[h];
|
1066
1088
|
}
|
1067
1089
|
}
|
1068
1090
|
if (o === "development") {
|
1069
1091
|
for (const d of f)
|
1070
|
-
await ne(
|
1092
|
+
await ne(b.append(d, { v: A }));
|
1071
1093
|
const h = this.materials || {};
|
1072
1094
|
for (const d of p) {
|
1073
|
-
const u = e[m[d]], w =
|
1095
|
+
const u = e[m[d]], w = Ce[d];
|
1074
1096
|
if (w)
|
1075
1097
|
u && w.forEach((g) => {
|
1076
1098
|
i[g] = u[g];
|
@@ -1078,7 +1100,7 @@ class Ot extends ke {
|
|
1078
1100
|
else {
|
1079
1101
|
const g = h[d] ? (await h[d]()).default : e[d];
|
1080
1102
|
g && u && (g.components || []).forEach((S) => {
|
1081
|
-
i[S.name] =
|
1103
|
+
i[S.name] = Ge(S, u);
|
1082
1104
|
});
|
1083
1105
|
}
|
1084
1106
|
}
|
@@ -1107,7 +1129,7 @@ class Ot extends ke {
|
|
1107
1129
|
const t = e.config.globalProperties.installed || {};
|
1108
1130
|
for (const [s, n] of Object.entries(this.library))
|
1109
1131
|
!t[s] && Xe(n) && (e.use(n), t[s] = !0);
|
1110
|
-
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(
|
1132
|
+
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Se, this), e.config.globalProperties.$provider = this, e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (s, n, i) => {
|
1111
1133
|
const a = n?.$options.name, o = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${o} ${i}`;
|
1112
1134
|
console.error(
|
1113
1135
|
"[VTJ Error]:",
|
@@ -1166,12 +1188,12 @@ class Ot extends ke {
|
|
1166
1188
|
apis: a,
|
1167
1189
|
window,
|
1168
1190
|
...t
|
1169
|
-
}, c =
|
1191
|
+
}, c = W({
|
1170
1192
|
getDsl: async (l) => await this.getDsl(l) || null,
|
1171
1193
|
getDslByUrl: async (l) => await this.getDslByUrl(l) || null,
|
1172
1194
|
options: o
|
1173
1195
|
});
|
1174
|
-
return
|
1196
|
+
return V({
|
1175
1197
|
...o,
|
1176
1198
|
dsl: e,
|
1177
1199
|
loader: c
|
@@ -1195,18 +1217,18 @@ class Ot extends ke {
|
|
1195
1217
|
});
|
1196
1218
|
}
|
1197
1219
|
definePluginComponent(e) {
|
1198
|
-
return ie(async () => await
|
1220
|
+
return ie(async () => await _e(e, window));
|
1199
1221
|
}
|
1200
1222
|
}
|
1201
|
-
function
|
1202
|
-
const e = new
|
1223
|
+
function es(r) {
|
1224
|
+
const e = new Bt(r);
|
1203
1225
|
return {
|
1204
1226
|
provider: e,
|
1205
1227
|
onReady: (s) => e.ready(s)
|
1206
1228
|
};
|
1207
1229
|
}
|
1208
1230
|
function je(r = {}) {
|
1209
|
-
const e = de(
|
1231
|
+
const e = de(Se, null);
|
1210
1232
|
if (!e)
|
1211
1233
|
throw new Error("Can not find provider");
|
1212
1234
|
if (e.nodeEnv === "development") {
|
@@ -1222,7 +1244,7 @@ function je(r = {}) {
|
|
1222
1244
|
}
|
1223
1245
|
return e;
|
1224
1246
|
}
|
1225
|
-
const
|
1247
|
+
const $e = {
|
1226
1248
|
type: "json",
|
1227
1249
|
validSuccess: !0,
|
1228
1250
|
originResponse: !1,
|
@@ -1237,8 +1259,8 @@ const be = {
|
|
1237
1259
|
type: t,
|
1238
1260
|
data: s
|
1239
1261
|
},
|
1240
|
-
settings:
|
1241
|
-
}),
|
1262
|
+
settings: $e
|
1263
|
+
}), Ut = (r, e = "/__vtj__/api/uploader.json") => async (t, s) => await r.send({
|
1242
1264
|
url: e,
|
1243
1265
|
method: "post",
|
1244
1266
|
data: {
|
@@ -1246,11 +1268,11 @@ const be = {
|
|
1246
1268
|
projectId: s
|
1247
1269
|
},
|
1248
1270
|
settings: {
|
1249
|
-
|
1271
|
+
...$e,
|
1250
1272
|
type: "data"
|
1251
1273
|
}
|
1252
1274
|
}).then((n) => n && n[0] ? n[0] : null).catch(() => null);
|
1253
|
-
function
|
1275
|
+
function ts(r) {
|
1254
1276
|
return ue({
|
1255
1277
|
settings: {
|
1256
1278
|
type: "json",
|
@@ -1268,8 +1290,8 @@ class ee {
|
|
1268
1290
|
api;
|
1269
1291
|
pluginCaches = {};
|
1270
1292
|
uploader;
|
1271
|
-
constructor(e =
|
1272
|
-
this.api = Nt(e), this.uploader =
|
1293
|
+
constructor(e = q) {
|
1294
|
+
this.api = Nt(e), this.uploader = Ut(e);
|
1273
1295
|
}
|
1274
1296
|
async getExtension() {
|
1275
1297
|
console.log("BaseService.getExtension");
|
@@ -1344,10 +1366,10 @@ class ee {
|
|
1344
1366
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
1345
1367
|
}
|
1346
1368
|
async getPluginMaterial(e) {
|
1347
|
-
const { urls: t = [] } = e, s = t.filter((i) =>
|
1369
|
+
const { urls: t = [] } = e, s = t.filter((i) => qe(i))[0];
|
1348
1370
|
if (!s) return null;
|
1349
1371
|
const n = this.pluginCaches[s];
|
1350
|
-
return n || (this.pluginCaches[s] =
|
1372
|
+
return n || (this.pluginCaches[s] = q.send({
|
1351
1373
|
url: s,
|
1352
1374
|
method: "get",
|
1353
1375
|
settings: {
|
@@ -1360,12 +1382,12 @@ class ee {
|
|
1360
1382
|
return console.log("BaseService.genSource", e), "";
|
1361
1383
|
}
|
1362
1384
|
}
|
1363
|
-
const v = new
|
1385
|
+
const v = new xe({
|
1364
1386
|
type: "local",
|
1365
1387
|
expired: 0,
|
1366
1388
|
prefix: "__VTJ_"
|
1367
1389
|
});
|
1368
|
-
class
|
1390
|
+
class ss extends ee {
|
1369
1391
|
init(e) {
|
1370
1392
|
const t = new T(e), s = v.get(`project_${t.id}`), n = Object.assign(t.toDsl(), s || {});
|
1371
1393
|
return v.save(`project_${t.id}`, n), Promise.resolve(n);
|
@@ -1375,7 +1397,7 @@ class ts extends ee {
|
|
1375
1397
|
return v.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
1376
1398
|
}
|
1377
1399
|
saveMaterials(e, t) {
|
1378
|
-
return v.save(`materials_${e.id}`,
|
1400
|
+
return v.save(`materials_${e.id}`, X(t)), Promise.resolve(!0);
|
1379
1401
|
}
|
1380
1402
|
saveFile(e) {
|
1381
1403
|
return v.save(`file_${e.id}`, e), Promise.resolve(!0);
|
@@ -1415,7 +1437,7 @@ class ts extends ee {
|
|
1415
1437
|
}), Promise.resolve(!0);
|
1416
1438
|
}
|
1417
1439
|
}
|
1418
|
-
class
|
1440
|
+
class Lt extends ee {
|
1419
1441
|
projects = {};
|
1420
1442
|
materials = {};
|
1421
1443
|
files = {};
|
@@ -1430,7 +1452,7 @@ class Ut extends ee {
|
|
1430
1452
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
1431
1453
|
}
|
1432
1454
|
saveMaterials(e, t) {
|
1433
|
-
return e.id && (this.materials[e.id] =
|
1455
|
+
return e.id && (this.materials[e.id] = X(t)), Promise.resolve(!0);
|
1434
1456
|
}
|
1435
1457
|
saveFile(e) {
|
1436
1458
|
return this.files[e.id] = e, Promise.resolve(!0);
|
@@ -1472,11 +1494,11 @@ class Ut extends ee {
|
|
1472
1494
|
}), Promise.resolve(!0);
|
1473
1495
|
}
|
1474
1496
|
}
|
1475
|
-
let
|
1476
|
-
function
|
1477
|
-
return
|
1497
|
+
let O = null;
|
1498
|
+
function rs() {
|
1499
|
+
return O || (O = new Lt(), O);
|
1478
1500
|
}
|
1479
|
-
class
|
1501
|
+
class ns extends ee {
|
1480
1502
|
getFileCaches = {};
|
1481
1503
|
async getExtension() {
|
1482
1504
|
return await this.api("getExtension", {}).catch(() => {
|
@@ -1493,7 +1515,7 @@ class rs extends ee {
|
|
1493
1515
|
async saveMaterials(e, t) {
|
1494
1516
|
return !!await this.api("saveMaterials", {
|
1495
1517
|
project: e,
|
1496
|
-
materials:
|
1518
|
+
materials: X(t)
|
1497
1519
|
}).catch(() => !1);
|
1498
1520
|
}
|
1499
1521
|
async saveFile(e) {
|
@@ -1557,12 +1579,12 @@ function Pe(r, e) {
|
|
1557
1579
|
e.can(s.id.toString()) && t.push(s);
|
1558
1580
|
return t;
|
1559
1581
|
}
|
1560
|
-
function
|
1582
|
+
function is(r) {
|
1561
1583
|
const {
|
1562
1584
|
menuPathPrefix: e = "",
|
1563
1585
|
pageRouteName: t = "page",
|
1564
1586
|
disableMenusFilter: s = !1
|
1565
|
-
} = r || {}, n = je(), i = he(), a = rt(), o =
|
1587
|
+
} = r || {}, n = je(), i = he(), a = rt(), o = K(!1), c = K(!1), l = n.project;
|
1566
1588
|
Be(() => {
|
1567
1589
|
const { name: m, params: h, meta: d } = i;
|
1568
1590
|
if (m === C) {
|
@@ -1589,70 +1611,72 @@ function ns(r) {
|
|
1589
1611
|
};
|
1590
1612
|
}
|
1591
1613
|
export {
|
1592
|
-
|
1593
|
-
|
1614
|
+
ve as ACCESS_KEY,
|
1615
|
+
st as Access,
|
1594
1616
|
Je as BUILD_IN_TAGS,
|
1595
|
-
|
1617
|
+
Ne as BUILT_IN_DIRECTIVES,
|
1596
1618
|
ee as BaseService,
|
1597
1619
|
oe as CONTEXT_HOST,
|
1598
|
-
|
1620
|
+
pt as Context,
|
1599
1621
|
y as ContextMode,
|
1600
|
-
|
1622
|
+
Ue as DATA_TYPES,
|
1601
1623
|
H as HOMEPAGE_ROUTE_NAME,
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1624
|
+
Le as HTML_TAGS,
|
1625
|
+
Xt as JSCodeToString,
|
1626
|
+
Gt as LIFE_CYCLES_LIST,
|
1627
|
+
ns as LocalService,
|
1628
|
+
Lt as MemoryService,
|
1607
1629
|
xt as NodeEnv,
|
1608
1630
|
C as PAGE_ROUTE_NAME,
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1631
|
+
Bt as Provider,
|
1632
|
+
ss as StorageService,
|
1633
|
+
A as VTJ_RENDERER_VERSION,
|
1634
|
+
ge as adoptedStyleSheets,
|
1635
|
+
Zt as clearLoaderCache,
|
1636
|
+
nt as createAccess,
|
1637
|
+
Yt as createAdapter,
|
1615
1638
|
Vt as createAssetScripts,
|
1616
1639
|
Wt as createAssetsCss,
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1640
|
+
yt as createDataSources,
|
1641
|
+
W as createLoader,
|
1642
|
+
rs as createMemoryService,
|
1643
|
+
ot as createMetaApi,
|
1644
|
+
lt as createMock,
|
1645
|
+
es as createProvider,
|
1646
|
+
V as createRenderer,
|
1647
|
+
it as createSchemaApi,
|
1648
|
+
at as createSchemaApis,
|
1649
|
+
ts as createServiceRequest,
|
1650
|
+
St as defaultLoader,
|
1628
1651
|
M as fillBasePath,
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1652
|
+
F as getMock,
|
1653
|
+
we as getModifiers,
|
1654
|
+
_e as getPlugin,
|
1655
|
+
Ge as getRawComponent,
|
1656
|
+
Ye as isBuiltInTag,
|
1657
|
+
Y as isCSSUrl,
|
1658
|
+
et as isJSCode,
|
1636
1659
|
_ as isJSExpression,
|
1637
|
-
|
1638
|
-
|
1660
|
+
I as isJSFunction,
|
1661
|
+
qe as isJSON,
|
1639
1662
|
Z as isJSUrl,
|
1640
|
-
|
1663
|
+
Ze as isNativeTag,
|
1641
1664
|
Xe as isVuePlugin,
|
1642
|
-
|
1643
|
-
|
1665
|
+
Ve as loadCss,
|
1666
|
+
We as loadCssUrl,
|
1644
1667
|
Qe as loadScriptUrl,
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1668
|
+
ut as mockApi,
|
1669
|
+
ct as mockApis,
|
1670
|
+
ye as mockCleanup,
|
1648
1671
|
D as nodeRender,
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1672
|
+
Ke as parseDeps,
|
1673
|
+
k as parseExpression,
|
1674
|
+
G as parseFunction,
|
1675
|
+
Se as providerKey,
|
1653
1676
|
ze as removeProdFlag,
|
1654
|
-
|
1677
|
+
Qt as setupPageSetting,
|
1678
|
+
me as toString,
|
1655
1679
|
rt as useAccess,
|
1656
|
-
|
1680
|
+
is as useMask,
|
1657
1681
|
je as useProvider
|
1658
1682
|
};
|