@vtj/renderer 0.8.31 → 0.8.32
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 +350 -259
- package/package.json +6 -6
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { isUrl as
|
|
1
|
+
import { Base as _e, BUILT_IN_COMPONENTS as we, ProjectModel as O, HistoryModel as re } from "@vtj/core";
|
|
2
|
+
import { isUrl as Se, url as P, dedupArray as $e, isString as C, isFunction as Y, logger as x, createRequest as je, merge as Ee, pathToRegexp as be, pathToRegexpMatch as Pe, formDataToJson as Ce, camelCase as E, upperFirst as Fe, pick as Re, jsonp as Ie, loadScript as z, Request as He, Storage as Me, mapToObject as J } from "@vtj/utils";
|
|
3
3
|
import * as T from "vue";
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { useRoute as
|
|
6
|
-
import { ElNotification as V, ElLoading as
|
|
4
|
+
import { toRef as Oe, readonly as xe, customRef as De, ref as L, onBeforeUnmount as ke, getCurrentScope as Te, onScopeDispose as Be, unref as Ae, getCurrentInstance as se, watch as oe, computed as ie, onMounted as Ne, defineComponent as ae, h as N, inject as Ue, defineAsyncComponent as Z, watchEffect as qe } from "vue";
|
|
5
|
+
import { useRoute as ce } from "vue-router";
|
|
6
|
+
import { ElNotification as V, ElLoading as Je } from "element-plus";
|
|
7
7
|
import D from "mockjs";
|
|
8
|
-
import {
|
|
9
|
-
import { XStartup as xe } from "@vtj/ui";
|
|
8
|
+
import { XStartup as Le } from "@vtj/ui";
|
|
10
9
|
/**!
|
|
11
10
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
12
11
|
* @name @vtj/renderer
|
|
13
12
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
14
|
-
* @version 0.8.
|
|
13
|
+
* @version 0.8.32
|
|
15
14
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
16
15
|
*/
|
|
17
|
-
const R = "0.8.
|
|
16
|
+
const R = "0.8.32";
|
|
18
17
|
var S = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(S || {});
|
|
19
|
-
const
|
|
18
|
+
const ee = [
|
|
20
19
|
"$el",
|
|
21
20
|
"$emit",
|
|
22
21
|
"$nextTick",
|
|
@@ -28,7 +27,7 @@ const G = [
|
|
|
28
27
|
"$props",
|
|
29
28
|
"$options",
|
|
30
29
|
"$forceUpdate"
|
|
31
|
-
],
|
|
30
|
+
], en = [
|
|
32
31
|
"beforeCreate",
|
|
33
32
|
"created",
|
|
34
33
|
"beforeMount",
|
|
@@ -42,7 +41,7 @@ const G = [
|
|
|
42
41
|
"renderTriggered",
|
|
43
42
|
"activated",
|
|
44
43
|
"deactivated"
|
|
45
|
-
],
|
|
44
|
+
], Ve = ["vIf", "vShow", "vModel", "vFor", "vBind"], We = {
|
|
46
45
|
String,
|
|
47
46
|
Number,
|
|
48
47
|
Boolean,
|
|
@@ -52,54 +51,54 @@ const G = [
|
|
|
52
51
|
Date
|
|
53
52
|
};
|
|
54
53
|
function H(n, e) {
|
|
55
|
-
return n.map((t) =>
|
|
54
|
+
return n.map((t) => Se(t) ? t : `${e}${t}`);
|
|
56
55
|
}
|
|
57
|
-
function
|
|
56
|
+
function W(n) {
|
|
58
57
|
return /\.css$/.test(n);
|
|
59
58
|
}
|
|
60
|
-
function
|
|
59
|
+
function G(n) {
|
|
61
60
|
return /\.js$/.test(n);
|
|
62
61
|
}
|
|
63
|
-
function
|
|
62
|
+
function Ge(n) {
|
|
64
63
|
return /\.json$/.test(n);
|
|
65
64
|
}
|
|
66
|
-
function
|
|
65
|
+
function tn(n) {
|
|
67
66
|
return n.map(
|
|
68
|
-
(e) => `<script src="${
|
|
67
|
+
(e) => `<script src="${P.append(e, { v: R })}"><\/script>`
|
|
69
68
|
).join("");
|
|
70
69
|
}
|
|
71
|
-
function
|
|
70
|
+
function nn(n = []) {
|
|
72
71
|
return n.map(
|
|
73
|
-
(e) => `<link rel="stylesheet" href="${
|
|
72
|
+
(e) => `<link rel="stylesheet" href="${P.append(e, { v: R })}" />`
|
|
74
73
|
).join("");
|
|
75
74
|
}
|
|
76
|
-
function
|
|
77
|
-
const t = n.filter((u) => !!u.enabled), r = [], s = [], o = [], a = [], i = {}, l = {}, c = [],
|
|
75
|
+
function Ke(n, e) {
|
|
76
|
+
const t = n.filter((u) => !!u.enabled), r = [], s = [], o = [], a = [], i = {}, l = {}, c = [], p = {};
|
|
78
77
|
return t.forEach(
|
|
79
|
-
({ urls: u, assetsUrl:
|
|
78
|
+
({ urls: u, assetsUrl: f, library: m, assetsLibrary: w, localeLibrary: h }) => {
|
|
80
79
|
u?.forEach((g) => {
|
|
81
|
-
|
|
82
|
-
}),
|
|
80
|
+
G(g) && r.push(g), W(g) && s.push(g);
|
|
81
|
+
}), m && (a.push(m), i[m] = H(u || [], e), h && (l[m] = h)), f && o.push(f), w && c.push(w), m && w && (p[w] = m);
|
|
83
82
|
}
|
|
84
83
|
), {
|
|
85
84
|
scripts: H(r, e),
|
|
86
85
|
css: H(s, e),
|
|
87
86
|
materials: H(o, e),
|
|
88
87
|
libraryExports: a,
|
|
89
|
-
materialExports:
|
|
90
|
-
materialMapLibrary:
|
|
88
|
+
materialExports: $e(c),
|
|
89
|
+
materialMapLibrary: p,
|
|
91
90
|
libraryMap: i,
|
|
92
91
|
libraryLocaleMap: l
|
|
93
92
|
};
|
|
94
93
|
}
|
|
95
|
-
function
|
|
94
|
+
function Qe(n, e) {
|
|
96
95
|
const { name: t, parent: r, alias: s } = n;
|
|
97
96
|
return r ? e[r]?.[s || t] : e[s || t];
|
|
98
97
|
}
|
|
99
|
-
function
|
|
98
|
+
function le(n) {
|
|
100
99
|
return C(n) ? n : JSON.stringify(n);
|
|
101
100
|
}
|
|
102
|
-
function
|
|
101
|
+
function ue(n, e, t) {
|
|
103
102
|
const r = n.CSSStyleSheet;
|
|
104
103
|
if (r.prototype.replaceSync) {
|
|
105
104
|
const s = new r();
|
|
@@ -114,11 +113,11 @@ function oe(n, e, t) {
|
|
|
114
113
|
o ? o.innerHTML = t : (o = s.createElement("style"), o.id = e, o.innerHTML = t, s.head.appendChild(o));
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
|
-
async function
|
|
116
|
+
async function Xe(n, e) {
|
|
118
117
|
const t = await window.fetch(e).then((r) => r.text()).catch(() => "");
|
|
119
|
-
t &&
|
|
118
|
+
t && ue(window, n, t);
|
|
120
119
|
}
|
|
121
|
-
function
|
|
120
|
+
function fe(n, e = window) {
|
|
122
121
|
const t = e.document, r = e.document.head;
|
|
123
122
|
for (const s of n)
|
|
124
123
|
if (!t.getElementById(s)) {
|
|
@@ -126,7 +125,7 @@ function ie(n, e = window) {
|
|
|
126
125
|
a.rel = "stylesheet", a.id = s, a.href = s, r.appendChild(a);
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
|
-
async function
|
|
128
|
+
async function Ye(n, e, t = window) {
|
|
130
129
|
const r = t.document, s = t.document.head;
|
|
131
130
|
let o = t[e];
|
|
132
131
|
return o ? o.default || o : new Promise((a, i) => {
|
|
@@ -134,14 +133,14 @@ async function Be(n, e, t = window) {
|
|
|
134
133
|
const c = r.createElement("script");
|
|
135
134
|
c.src = l, c.onload = () => {
|
|
136
135
|
o = t[e], o ? a(o.default || o) : i(null);
|
|
137
|
-
}, c.onerror = (
|
|
138
|
-
i(
|
|
136
|
+
}, c.onerror = (p) => {
|
|
137
|
+
i(p);
|
|
139
138
|
}, s.appendChild(c);
|
|
140
139
|
}
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
142
|
+
function ze(n) {
|
|
143
|
+
return Y(n) || Y(n?.install);
|
|
145
144
|
}
|
|
146
145
|
function I(n, e, t = !1, r = !1) {
|
|
147
146
|
try {
|
|
@@ -153,13 +152,13 @@ function I(n, e, t = !1, r = !1) {
|
|
|
153
152
|
const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
|
|
154
153
|
return new Function("$scope", a)(e);
|
|
155
154
|
} catch (s) {
|
|
156
|
-
if (
|
|
155
|
+
if (x.error("parseExpression.error", s, n, e?.__self ?? e), r)
|
|
157
156
|
throw s;
|
|
158
157
|
}
|
|
159
158
|
}
|
|
160
|
-
function
|
|
159
|
+
function te(n, e, t = !1, r = !1) {
|
|
161
160
|
const s = I(n, e, t, r);
|
|
162
|
-
if (typeof s != "function" && (
|
|
161
|
+
if (typeof s != "function" && (x.error(
|
|
163
162
|
"parseFunction.error",
|
|
164
163
|
"not a function",
|
|
165
164
|
n,
|
|
@@ -171,17 +170,17 @@ function Z(n, e, t = !1, r = !1) {
|
|
|
171
170
|
function _(n) {
|
|
172
171
|
return n && n.type === "JSExpression";
|
|
173
172
|
}
|
|
174
|
-
function
|
|
173
|
+
function B(n) {
|
|
175
174
|
return typeof n == "object" && n && n.type === "JSFunction";
|
|
176
175
|
}
|
|
177
|
-
function
|
|
178
|
-
return _(n) ||
|
|
176
|
+
function Ze(n) {
|
|
177
|
+
return _(n) || B(n);
|
|
179
178
|
}
|
|
180
|
-
function
|
|
181
|
-
return
|
|
179
|
+
function rn(n) {
|
|
180
|
+
return Ze(n) ? n.value : JSON.stringify(n);
|
|
182
181
|
}
|
|
183
|
-
let
|
|
184
|
-
const
|
|
182
|
+
let b = null;
|
|
183
|
+
const et = je({
|
|
185
184
|
settings: {
|
|
186
185
|
type: "form",
|
|
187
186
|
validSuccess: !0,
|
|
@@ -195,18 +194,18 @@ const qe = ye({
|
|
|
195
194
|
});
|
|
196
195
|
},
|
|
197
196
|
showLoading: () => {
|
|
198
|
-
|
|
197
|
+
b && b.close(), b = Je.service({
|
|
199
198
|
lock: !0,
|
|
200
199
|
text: "Loading",
|
|
201
200
|
background: "rgba(0, 0, 0, 0.05)"
|
|
202
201
|
});
|
|
203
202
|
},
|
|
204
203
|
hideLoading: () => {
|
|
205
|
-
|
|
204
|
+
b && (b.close(), b = null);
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
207
|
});
|
|
209
|
-
function
|
|
208
|
+
function tt(n, e) {
|
|
210
209
|
const { jsonp: t, request: r } = e;
|
|
211
210
|
if (n.method === "jsonp")
|
|
212
211
|
return (s = {}) => t(n.url, {
|
|
@@ -222,10 +221,10 @@ function Je(n, e) {
|
|
|
222
221
|
headers: s
|
|
223
222
|
}
|
|
224
223
|
};
|
|
225
|
-
return (a, i) => r.send(
|
|
224
|
+
return (a, i) => r.send(Ee(o, i || {}, { data: a }));
|
|
226
225
|
}
|
|
227
226
|
}
|
|
228
|
-
function
|
|
227
|
+
function nt(n, e) {
|
|
229
228
|
const { metaQuery: t } = e;
|
|
230
229
|
if (!t)
|
|
231
230
|
return;
|
|
@@ -238,35 +237,35 @@ function Ve(n, e) {
|
|
|
238
237
|
return t(r, s, o, a);
|
|
239
238
|
};
|
|
240
239
|
}
|
|
241
|
-
function
|
|
240
|
+
function rt(n = [], e = [], t) {
|
|
242
241
|
const r = {};
|
|
243
242
|
for (const s of n)
|
|
244
|
-
r[s.id] =
|
|
243
|
+
r[s.id] = tt(s, t);
|
|
245
244
|
for (const s of e)
|
|
246
|
-
r[s.id] =
|
|
245
|
+
r[s.id] = nt(s, t);
|
|
247
246
|
return r;
|
|
248
247
|
}
|
|
249
|
-
function
|
|
248
|
+
function st(n = []) {
|
|
250
249
|
D.setup({
|
|
251
250
|
timeout: "50-500"
|
|
252
|
-
}),
|
|
251
|
+
}), pe(), n.forEach((e) => ot(e));
|
|
253
252
|
}
|
|
254
|
-
function
|
|
253
|
+
function ot(n) {
|
|
255
254
|
if (!n.mock)
|
|
256
255
|
return;
|
|
257
256
|
const { url: e, mockTemplate: t } = n;
|
|
258
257
|
if (e && t) {
|
|
259
|
-
const r =
|
|
258
|
+
const r = be(`${e}(.*)`), s = Pe(e, { decode: decodeURIComponent }), o = I(t, {}, !0);
|
|
260
259
|
D.mock(r, (a) => {
|
|
261
|
-
const i =
|
|
260
|
+
const i = P.parse(a.url) || {}, l = a.body instanceof FormData ? Ce(a.body) : a.body, c = s(a.url)?.params;
|
|
262
261
|
return Object.assign(a, { data: l, params: i, query: c }), D.mock(o(a));
|
|
263
262
|
});
|
|
264
263
|
}
|
|
265
264
|
}
|
|
266
|
-
function
|
|
265
|
+
function pe() {
|
|
267
266
|
D._mocked = {};
|
|
268
267
|
}
|
|
269
|
-
class
|
|
268
|
+
class it {
|
|
270
269
|
__id = null;
|
|
271
270
|
__mode;
|
|
272
271
|
__instance = null;
|
|
@@ -308,12 +307,12 @@ class We {
|
|
|
308
307
|
});
|
|
309
308
|
}
|
|
310
309
|
__proxy() {
|
|
311
|
-
this.__instance &&
|
|
310
|
+
this.__instance && ee.forEach((e) => {
|
|
312
311
|
this[e] = this.__instance?.[e];
|
|
313
312
|
});
|
|
314
313
|
}
|
|
315
314
|
__cleanup() {
|
|
316
|
-
|
|
315
|
+
ee.forEach((e) => {
|
|
317
316
|
this[e] = null;
|
|
318
317
|
});
|
|
319
318
|
}
|
|
@@ -321,9 +320,9 @@ class We {
|
|
|
321
320
|
if (e)
|
|
322
321
|
if (this.__mode === S.Runtime) {
|
|
323
322
|
const { id: t, type: r } = e, s = t ? this.__transform[t] ?? e.value : e.value;
|
|
324
|
-
return
|
|
323
|
+
return te({ type: r, value: s }, this);
|
|
325
324
|
} else
|
|
326
|
-
return
|
|
325
|
+
return te(e, this);
|
|
327
326
|
}
|
|
328
327
|
__parseExpression(e) {
|
|
329
328
|
if (e)
|
|
@@ -374,31 +373,31 @@ function U(n) {
|
|
|
374
373
|
$components: r,
|
|
375
374
|
$libs: s,
|
|
376
375
|
$apis: o
|
|
377
|
-
}, c = new
|
|
376
|
+
}, c = new it({
|
|
378
377
|
mode: t,
|
|
379
378
|
dsl: i.value,
|
|
380
379
|
attrs: l
|
|
381
|
-
}),
|
|
380
|
+
}), p = e.defineComponent({
|
|
382
381
|
name: i.value.name,
|
|
383
382
|
props: {
|
|
384
|
-
...
|
|
383
|
+
...at(i.value.props ?? [], c)
|
|
385
384
|
},
|
|
386
385
|
setup(u) {
|
|
387
|
-
c.$props = u, c.props = u, i.value.id &&
|
|
386
|
+
c.$props = u, c.props = u, i.value.id && ue(
|
|
388
387
|
n.window || window,
|
|
389
388
|
i.value.id,
|
|
390
389
|
i.value.css || ""
|
|
391
|
-
), c.state =
|
|
392
|
-
const
|
|
390
|
+
), c.state = ct(e, i.value.state ?? {}, c);
|
|
391
|
+
const f = lt(e, i.value.computed ?? {}, c), m = ut(i.value.methods ?? {}, c), w = ft(e, i.value.inject, c), h = pt(
|
|
393
392
|
i.value.dataSources || {},
|
|
394
393
|
c
|
|
395
394
|
), g = {
|
|
396
395
|
...w,
|
|
397
|
-
...
|
|
398
|
-
...
|
|
399
|
-
...
|
|
396
|
+
...f,
|
|
397
|
+
...m,
|
|
398
|
+
...h
|
|
400
399
|
};
|
|
401
|
-
return c.setup(g, e),
|
|
400
|
+
return c.setup(g, e), dt(e, i.value.watch ?? [], c), {
|
|
402
401
|
vtj: c
|
|
403
402
|
};
|
|
404
403
|
},
|
|
@@ -408,17 +407,17 @@ function U(n) {
|
|
|
408
407
|
if (!i.value.nodes)
|
|
409
408
|
return null;
|
|
410
409
|
const u = i.value.nodes || [];
|
|
411
|
-
return u.length === 1 ? k(u[0], c, e, a) : u.map((
|
|
410
|
+
return u.length === 1 ? k(u[0], c, e, a) : u.map((f) => k(f, c, e, a));
|
|
412
411
|
},
|
|
413
|
-
...
|
|
412
|
+
...mt(i.value.lifeCycles ?? {}, c)
|
|
414
413
|
});
|
|
415
414
|
return {
|
|
416
|
-
renderer: e.markRaw(
|
|
415
|
+
renderer: e.markRaw(p),
|
|
417
416
|
context: c
|
|
418
417
|
};
|
|
419
418
|
}
|
|
420
|
-
function
|
|
421
|
-
const t = (r) => r ? (Array.isArray(r) ? r : [r]).map((o) =>
|
|
419
|
+
function at(n = [], e) {
|
|
420
|
+
const t = (r) => r ? (Array.isArray(r) ? r : [r]).map((o) => We[o]) : void 0;
|
|
422
421
|
return n.map((r) => C(r) ? {
|
|
423
422
|
name: r
|
|
424
423
|
} : {
|
|
@@ -435,30 +434,30 @@ function Xe(n = [], e) {
|
|
|
435
434
|
{}
|
|
436
435
|
);
|
|
437
436
|
}
|
|
438
|
-
function
|
|
437
|
+
function ct(n, e, t) {
|
|
439
438
|
return n.reactive(
|
|
440
439
|
Object.keys(e || {}).reduce(
|
|
441
440
|
(r, s) => {
|
|
442
441
|
let o = e[s];
|
|
443
|
-
return _(o) ? o = t.__parseExpression(o) :
|
|
442
|
+
return _(o) ? o = t.__parseExpression(o) : B(o) && (o = t.__parseFunction(o)), r[s] = o, r;
|
|
444
443
|
},
|
|
445
444
|
{}
|
|
446
445
|
)
|
|
447
446
|
);
|
|
448
447
|
}
|
|
449
|
-
function
|
|
448
|
+
function lt(n, e, t) {
|
|
450
449
|
return Object.entries(e ?? {}).reduce(
|
|
451
450
|
(r, [s, o]) => (r[s] = n.computed(t.__parseFunction(o)), r),
|
|
452
451
|
{}
|
|
453
452
|
);
|
|
454
453
|
}
|
|
455
|
-
function
|
|
454
|
+
function ut(n, e) {
|
|
456
455
|
return Object.entries(n ?? {}).reduce(
|
|
457
456
|
(t, [r, s]) => (t[r] = e.__parseFunction(s), t),
|
|
458
457
|
{}
|
|
459
458
|
);
|
|
460
459
|
}
|
|
461
|
-
function
|
|
460
|
+
function ft(n, e = [], t) {
|
|
462
461
|
return e.reduce(
|
|
463
462
|
(r, s) => {
|
|
464
463
|
const { name: o, from: a } = s || {};
|
|
@@ -469,10 +468,10 @@ function Ze(n, e = [], t) {
|
|
|
469
468
|
{}
|
|
470
469
|
);
|
|
471
470
|
}
|
|
472
|
-
function
|
|
471
|
+
function pt(n, e) {
|
|
473
472
|
return Object.keys(n).reduce(
|
|
474
473
|
(t, r) => {
|
|
475
|
-
const s = n[r], o = e.$apis[s.ref], a =
|
|
474
|
+
const s = n[r], o = e.$apis[s.ref], a = B(s.transform) ? s.transform.value ? e.__parseFunction(s.transform) : void 0 : s.transform;
|
|
476
475
|
return t[r] = async (...i) => {
|
|
477
476
|
const l = await o.apply(e, i);
|
|
478
477
|
return a ? a(l) : l;
|
|
@@ -481,7 +480,7 @@ function et(n, e) {
|
|
|
481
480
|
{}
|
|
482
481
|
);
|
|
483
482
|
}
|
|
484
|
-
function
|
|
483
|
+
function dt(n, e = [], t) {
|
|
485
484
|
e.forEach((r) => {
|
|
486
485
|
n.watch(
|
|
487
486
|
t.__parseExpression(r.source),
|
|
@@ -493,19 +492,19 @@ function tt(n, e = [], t) {
|
|
|
493
492
|
);
|
|
494
493
|
});
|
|
495
494
|
}
|
|
496
|
-
function
|
|
495
|
+
function mt(n, e) {
|
|
497
496
|
return Object.entries(n ?? {}).reduce(
|
|
498
497
|
(t, [r, s]) => (t[r] = e.__parseFunction(s), t),
|
|
499
498
|
{}
|
|
500
499
|
);
|
|
501
500
|
}
|
|
502
|
-
let
|
|
503
|
-
const
|
|
504
|
-
async function
|
|
505
|
-
const { urls: t = [], library: r } = n, s = t.filter((i) =>
|
|
501
|
+
let A = [];
|
|
502
|
+
const ht = (n) => n;
|
|
503
|
+
async function de(n, e = window) {
|
|
504
|
+
const { urls: t = [], library: r } = n, s = t.filter((i) => G(i));
|
|
506
505
|
if (s.length === 0 || !r)
|
|
507
506
|
return null;
|
|
508
|
-
const o = t.filter((i) =>
|
|
507
|
+
const o = t.filter((i) => W(i)), a = await Ye(s, r, e).catch(
|
|
509
508
|
() => null
|
|
510
509
|
);
|
|
511
510
|
return a ? {
|
|
@@ -515,9 +514,9 @@ async function ce(n, e = window) {
|
|
|
515
514
|
}
|
|
516
515
|
function q(n) {
|
|
517
516
|
const { getDsl: e, getDslByUrl: t, options: r } = n;
|
|
518
|
-
return r.window && (
|
|
517
|
+
return r.window && (A.forEach((s) => {
|
|
519
518
|
delete r.window[s];
|
|
520
|
-
}),
|
|
519
|
+
}), A = []), (s, o, a = T) => !o || typeof o == "string" ? s : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
|
|
521
520
|
const i = await e(o.id);
|
|
522
521
|
return i && (i.name = s), i ? U({
|
|
523
522
|
...r,
|
|
@@ -535,48 +534,48 @@ function q(n) {
|
|
|
535
534
|
mode: S.Runtime,
|
|
536
535
|
loader: q(n)
|
|
537
536
|
}).renderer : null;
|
|
538
|
-
}) : o.type === "Plugin" ? (o.library &&
|
|
539
|
-
const i = await
|
|
540
|
-
return i ? (
|
|
537
|
+
}) : o.type === "Plugin" ? (o.library && A.push(o.library), a.defineAsyncComponent(async () => {
|
|
538
|
+
const i = await de(o, r.window);
|
|
539
|
+
return i ? (fe(i.css, r.window), i.component) : null;
|
|
541
540
|
})) : s;
|
|
542
541
|
}
|
|
543
|
-
function k(n, e, t = T, r =
|
|
542
|
+
function k(n, e, t = T, r = ht) {
|
|
544
543
|
if (!n || !n.name || n.invisible)
|
|
545
544
|
return null;
|
|
546
|
-
const { id: s = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: l, vModels: c, vBind:
|
|
547
|
-
if (a && !
|
|
545
|
+
const { id: s = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: p } = vt(o);
|
|
546
|
+
if (a && !yt(a, e))
|
|
548
547
|
return null;
|
|
549
|
-
const u = (
|
|
550
|
-
const
|
|
548
|
+
const u = (f) => {
|
|
549
|
+
const m = f.$components, w = (() => {
|
|
551
550
|
if (n.name === "component")
|
|
552
|
-
return
|
|
551
|
+
return gt(f, n.props?.is);
|
|
553
552
|
if (n.name === "slot")
|
|
554
553
|
return n.name;
|
|
555
554
|
const v = r(n.name, n.from, t);
|
|
556
|
-
return C(v) ?
|
|
557
|
-
})(),
|
|
555
|
+
return C(v) ? m[v] ?? v : v;
|
|
556
|
+
})(), h = _t(s, n.props ?? {}, f), g = wt(t, n.events ?? {}, f);
|
|
558
557
|
if (n.name === "slot")
|
|
559
|
-
return
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
558
|
+
return St(t, n, h, f, r);
|
|
559
|
+
p && Object.assign(h, f.__parseExpression(p.value)), l && (h.style = Object.assign(
|
|
560
|
+
h.style ?? {},
|
|
561
|
+
jt(l, f)
|
|
563
562
|
)), c.forEach((v) => {
|
|
564
|
-
Object.assign(
|
|
563
|
+
Object.assign(h, Et(t, v, f));
|
|
565
564
|
});
|
|
566
|
-
const
|
|
565
|
+
const d = bt(
|
|
567
566
|
t,
|
|
568
567
|
n.children ?? [],
|
|
569
|
-
|
|
568
|
+
f,
|
|
570
569
|
r,
|
|
571
570
|
n
|
|
572
571
|
);
|
|
573
|
-
return t.createVNode(w, { ...
|
|
572
|
+
return t.createVNode(w, { ...h, ...g }, d);
|
|
574
573
|
};
|
|
575
|
-
return i ?
|
|
574
|
+
return i ? Ft(i, u, e) : u(e);
|
|
576
575
|
}
|
|
577
|
-
function
|
|
576
|
+
function vt(n = []) {
|
|
578
577
|
const e = n.find((i) => E(i.name) === "vIf"), t = n.find((i) => E(i.name) === "vFor"), r = n.find((i) => E(i.name) === "vShow"), s = n.find((i) => E(i.name) === "vBind"), o = n.filter((i) => E(i.name) === "vModel"), a = n.filter(
|
|
579
|
-
(i) => !
|
|
578
|
+
(i) => !Ve.includes(E(i.name))
|
|
580
579
|
);
|
|
581
580
|
return {
|
|
582
581
|
vIf: e,
|
|
@@ -587,23 +586,23 @@ function st(n = []) {
|
|
|
587
586
|
others: a
|
|
588
587
|
};
|
|
589
588
|
}
|
|
590
|
-
function
|
|
589
|
+
function yt(n, e) {
|
|
591
590
|
return !!e.__parseExpression(n.value);
|
|
592
591
|
}
|
|
593
|
-
function
|
|
592
|
+
function gt(n, e) {
|
|
594
593
|
return e ? _(e) ? n.__parseExpression(e) : e : "div";
|
|
595
594
|
}
|
|
596
|
-
function
|
|
595
|
+
function _t(n, e, t) {
|
|
597
596
|
const r = Object.keys(e || {}).reduce(
|
|
598
597
|
(s, o) => {
|
|
599
598
|
let a = e[o];
|
|
600
|
-
return _(a) ? a = t.__parseExpression(a) :
|
|
599
|
+
return _(a) ? a = t.__parseExpression(a) : B(a) && (a = t.__parseFunction(a)), s[o] = a, s;
|
|
601
600
|
},
|
|
602
601
|
{}
|
|
603
602
|
);
|
|
604
603
|
return r.ref = t.__ref(n, r.ref), r;
|
|
605
604
|
}
|
|
606
|
-
function
|
|
605
|
+
function wt(n, e, t) {
|
|
607
606
|
const r = ["passive", "capture", "once"], s = {
|
|
608
607
|
capture: "Capture",
|
|
609
608
|
once: "Once",
|
|
@@ -611,71 +610,71 @@ function ct(n, e, t) {
|
|
|
611
610
|
};
|
|
612
611
|
return Object.keys(e || {}).reduce(
|
|
613
612
|
(o, a) => {
|
|
614
|
-
const i = e[a], l =
|
|
615
|
-
return u && (o[
|
|
613
|
+
const i = e[a], l = me(i.modifiers), c = l.find((f) => r.includes(f)), p = "on" + Fe(a) + (c && s[c] || ""), u = t.__parseFunction(i.handler);
|
|
614
|
+
return u && (o[p] = n.withModifiers(u, l)), o;
|
|
616
615
|
},
|
|
617
616
|
{}
|
|
618
617
|
);
|
|
619
618
|
}
|
|
620
|
-
function
|
|
619
|
+
function me(n = {}, e = !1) {
|
|
621
620
|
const t = Object.keys(n);
|
|
622
621
|
return e ? t.map((r) => "." + r) : t;
|
|
623
622
|
}
|
|
624
|
-
function
|
|
625
|
-
const { children: o } = e, a =
|
|
623
|
+
function St(n, e, t, r, s) {
|
|
624
|
+
const { children: o } = e, a = $t(e, r), i = r.$slots?.[a.name];
|
|
626
625
|
return i ? i(t) : o ? C(o) ? n.createTextVNode(o) : _(o) ? n.createTextVNode(
|
|
627
|
-
|
|
626
|
+
le(r.__parseExpression(o))
|
|
628
627
|
) : Array.isArray(o) ? o.map(
|
|
629
628
|
(l) => k(l, r, n, s)
|
|
630
629
|
) : null : null;
|
|
631
630
|
}
|
|
632
|
-
function
|
|
631
|
+
function $t(n, e) {
|
|
633
632
|
const { props: t } = n, r = t?.name || "default";
|
|
634
633
|
return {
|
|
635
634
|
name: _(r) ? e.__parseExpression(r) : r,
|
|
636
635
|
params: []
|
|
637
636
|
};
|
|
638
637
|
}
|
|
639
|
-
function
|
|
638
|
+
function jt(n, e) {
|
|
640
639
|
return e.__parseExpression(n.value) ? {} : {
|
|
641
640
|
display: "none"
|
|
642
641
|
};
|
|
643
642
|
}
|
|
644
|
-
function
|
|
643
|
+
function Et(n, e, t) {
|
|
645
644
|
const r = {
|
|
646
645
|
type: "JSFunction",
|
|
647
646
|
value: e.value?.value ? `(v) => {
|
|
648
647
|
${e.value.value} = v;
|
|
649
648
|
}` : "(v) => {}"
|
|
650
|
-
}, s = t.__parseFunction(r), o =
|
|
649
|
+
}, s = t.__parseFunction(r), o = me(e.modifiers), a = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
651
650
|
return {
|
|
652
651
|
[a]: t.__parseExpression(e.value),
|
|
653
652
|
[`onUpdate:${a}`]: o.length && s ? n.withModifiers(s, o) : s
|
|
654
653
|
};
|
|
655
654
|
}
|
|
656
|
-
function
|
|
655
|
+
function bt(n, e, t, r, s) {
|
|
657
656
|
if (!e)
|
|
658
657
|
return null;
|
|
659
658
|
if (C(e))
|
|
660
659
|
return { default: () => e };
|
|
661
660
|
if (_(e))
|
|
662
661
|
return {
|
|
663
|
-
default: () =>
|
|
662
|
+
default: () => le(t.__parseExpression(e))
|
|
664
663
|
};
|
|
665
664
|
if (Array.isArray(e) && e.length > 0) {
|
|
666
|
-
const o =
|
|
665
|
+
const o = Pt(e), a = (i) => !i || !s ? {} : s?.id && Object.keys(i).length ? {
|
|
667
666
|
[`scope_${s.id}`]: i
|
|
668
667
|
} : {};
|
|
669
|
-
return Object.entries(o).reduce((i, [l, { nodes: c, params:
|
|
670
|
-
const
|
|
668
|
+
return Object.entries(o).reduce((i, [l, { nodes: c, params: p }]) => (i[l] = (u) => {
|
|
669
|
+
const f = p.length ? Re(u ?? {}, p) : a(u);
|
|
671
670
|
return c.map(
|
|
672
|
-
(
|
|
671
|
+
(m) => k(m, t.__clone(f), n, r)
|
|
673
672
|
);
|
|
674
673
|
}, i), {});
|
|
675
674
|
}
|
|
676
675
|
return null;
|
|
677
676
|
}
|
|
678
|
-
function
|
|
677
|
+
function Pt(n) {
|
|
679
678
|
const e = {
|
|
680
679
|
default: {
|
|
681
680
|
params: [],
|
|
@@ -683,7 +682,7 @@ function mt(n) {
|
|
|
683
682
|
}
|
|
684
683
|
};
|
|
685
684
|
for (const t of n) {
|
|
686
|
-
const r =
|
|
685
|
+
const r = Ct(t.slot), s = r.name;
|
|
687
686
|
e[s] ? (e[s].nodes.push(t), e[s].params = e[s].params.concat(r.params)) : e[s] = {
|
|
688
687
|
nodes: [t],
|
|
689
688
|
params: r.params
|
|
@@ -691,19 +690,111 @@ function mt(n) {
|
|
|
691
690
|
}
|
|
692
691
|
return e;
|
|
693
692
|
}
|
|
694
|
-
function
|
|
693
|
+
function Ct(n = "default") {
|
|
695
694
|
return C(n) ? { name: n, params: [] } : { params: [], ...n };
|
|
696
695
|
}
|
|
697
|
-
function
|
|
696
|
+
function Ft(n, e, t) {
|
|
698
697
|
const { value: r, iterator: s } = n, { item: o = "item", index: a = "index" } = s || {};
|
|
699
698
|
let i = t.__parseExpression(r) || [];
|
|
700
699
|
return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }))) : (console.warn("[vForRender]:", `${r?.value} is not a Arrary`), []);
|
|
701
700
|
}
|
|
702
|
-
|
|
701
|
+
function Rt(n) {
|
|
702
|
+
return Te() ? (Be(n), !0) : !1;
|
|
703
|
+
}
|
|
704
|
+
function K(n) {
|
|
705
|
+
return typeof n == "function" ? n() : Ae(n);
|
|
706
|
+
}
|
|
707
|
+
const he = typeof window < "u" && typeof document < "u";
|
|
708
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
709
|
+
const It = (n) => n != null, Ht = () => {
|
|
710
|
+
};
|
|
711
|
+
function Mt(n) {
|
|
712
|
+
return se();
|
|
713
|
+
}
|
|
714
|
+
function Ot(...n) {
|
|
715
|
+
if (n.length !== 1)
|
|
716
|
+
return Oe(...n);
|
|
717
|
+
const e = n[0];
|
|
718
|
+
return typeof e == "function" ? xe(De(() => ({ get: e, set: Ht }))) : L(e);
|
|
719
|
+
}
|
|
720
|
+
function xt(n, e) {
|
|
721
|
+
Mt() && ke(n, e);
|
|
722
|
+
}
|
|
723
|
+
function Dt(n) {
|
|
724
|
+
var e;
|
|
725
|
+
const t = K(n);
|
|
726
|
+
return (e = t?.$el) != null ? e : t;
|
|
727
|
+
}
|
|
728
|
+
const kt = he ? window : void 0, Tt = he ? window.document : void 0;
|
|
729
|
+
function Bt() {
|
|
730
|
+
const n = L(!1), e = se();
|
|
731
|
+
return e && Ne(() => {
|
|
732
|
+
n.value = !0;
|
|
733
|
+
}, e), n;
|
|
734
|
+
}
|
|
735
|
+
function At(n) {
|
|
736
|
+
const e = Bt();
|
|
737
|
+
return ie(() => (e.value, !!n()));
|
|
738
|
+
}
|
|
739
|
+
function Nt(n, e, t = {}) {
|
|
740
|
+
const { window: r = kt, ...s } = t;
|
|
741
|
+
let o;
|
|
742
|
+
const a = At(() => r && "MutationObserver" in r), i = () => {
|
|
743
|
+
o && (o.disconnect(), o = void 0);
|
|
744
|
+
}, l = ie(() => {
|
|
745
|
+
const f = K(n), m = (Array.isArray(f) ? f : [f]).map(Dt).filter(It);
|
|
746
|
+
return new Set(m);
|
|
747
|
+
}), c = oe(
|
|
748
|
+
() => l.value,
|
|
749
|
+
(f) => {
|
|
750
|
+
i(), a.value && r && f.size && (o = new MutationObserver(e), f.forEach((m) => o.observe(m, s)));
|
|
751
|
+
},
|
|
752
|
+
{ immediate: !0, flush: "post" }
|
|
753
|
+
), p = () => o?.takeRecords(), u = () => {
|
|
754
|
+
i(), c();
|
|
755
|
+
};
|
|
756
|
+
return Rt(u), {
|
|
757
|
+
isSupported: a,
|
|
758
|
+
stop: u,
|
|
759
|
+
takeRecords: p
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
function Ut(n = null, e = {}) {
|
|
763
|
+
var t, r, s;
|
|
764
|
+
const {
|
|
765
|
+
document: o = Tt,
|
|
766
|
+
restoreOnUnmount: a = (u) => u
|
|
767
|
+
} = e, i = (t = o?.title) != null ? t : "", l = Ot((r = n ?? o?.title) != null ? r : null), c = n && typeof n == "function";
|
|
768
|
+
function p(u) {
|
|
769
|
+
if (!("titleTemplate" in e))
|
|
770
|
+
return u;
|
|
771
|
+
const f = e.titleTemplate || "%s";
|
|
772
|
+
return typeof f == "function" ? f(u) : K(f).replace(/%s/g, u);
|
|
773
|
+
}
|
|
774
|
+
return oe(
|
|
775
|
+
l,
|
|
776
|
+
(u, f) => {
|
|
777
|
+
u !== f && o && (o.title = p(typeof u == "string" ? u : ""));
|
|
778
|
+
},
|
|
779
|
+
{ immediate: !0 }
|
|
780
|
+
), e.observe && !e.titleTemplate && o && !c && Nt(
|
|
781
|
+
(s = o.head) == null ? void 0 : s.querySelector("title"),
|
|
782
|
+
() => {
|
|
783
|
+
o && o.title !== l.value && (l.value = p(o.title));
|
|
784
|
+
},
|
|
785
|
+
{ childList: !0 }
|
|
786
|
+
), xt(() => {
|
|
787
|
+
if (a) {
|
|
788
|
+
const u = a(i, l.value || "");
|
|
789
|
+
u != null && o && (o.title = u);
|
|
790
|
+
}
|
|
791
|
+
}), l;
|
|
792
|
+
}
|
|
793
|
+
const ne = ae({
|
|
703
794
|
name: "VtjPageContainer",
|
|
704
795
|
async setup() {
|
|
705
|
-
const n =
|
|
706
|
-
return r &&
|
|
796
|
+
const n = ye(), e = ce(), t = e.params.id, r = t ? n.getPage(t) : n.getHomepage(), s = r ? await n.getRenderComponent(r.id) : null;
|
|
797
|
+
return r && Ut(r.title || "VTJ"), {
|
|
707
798
|
provider: n,
|
|
708
799
|
component: s,
|
|
709
800
|
file: r,
|
|
@@ -713,13 +804,13 @@ const ee = re({
|
|
|
713
804
|
render() {
|
|
714
805
|
return this.component ? N(this.component, this.query) : N("div", "页面不存在");
|
|
715
806
|
}
|
|
716
|
-
}),
|
|
807
|
+
}), qt = ae({
|
|
717
808
|
name: "VtjStartupContainer",
|
|
718
809
|
render() {
|
|
719
|
-
return N(
|
|
810
|
+
return N(Le);
|
|
720
811
|
}
|
|
721
|
-
}),
|
|
722
|
-
class
|
|
812
|
+
}), ve = Symbol("Provider");
|
|
813
|
+
class Jt extends _e {
|
|
723
814
|
constructor(e) {
|
|
724
815
|
super(), this.options = e;
|
|
725
816
|
const {
|
|
@@ -731,16 +822,16 @@ class gt extends de {
|
|
|
731
822
|
adapter: i = {},
|
|
732
823
|
globals: l = {},
|
|
733
824
|
modules: c = {},
|
|
734
|
-
router:
|
|
825
|
+
router: p = null,
|
|
735
826
|
materialPath: u = "./",
|
|
736
|
-
nodeEnv:
|
|
827
|
+
nodeEnv: f = "development"
|
|
737
828
|
} = e;
|
|
738
|
-
this.mode = r, this.modules = c, this.service = t, this.router =
|
|
829
|
+
this.mode = r, this.modules = c, this.service = t, this.router = p, this.materialPath = u, this.nodeEnv = f, s && (this.dependencies = s), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i), r !== S.Design && this.load(a);
|
|
739
830
|
}
|
|
740
831
|
mode;
|
|
741
832
|
globals = {};
|
|
742
833
|
modules = {};
|
|
743
|
-
adapter = { request:
|
|
834
|
+
adapter = { request: et, jsonp: Ie };
|
|
744
835
|
apis = {};
|
|
745
836
|
dependencies = {};
|
|
746
837
|
materials = {};
|
|
@@ -761,61 +852,61 @@ class gt extends de {
|
|
|
761
852
|
apis: s = [],
|
|
762
853
|
meta: o = []
|
|
763
854
|
} = this.project, { dependencies: a, library: i, components: l, materialPath: c } = this, {
|
|
764
|
-
libraryExports:
|
|
855
|
+
libraryExports: p,
|
|
765
856
|
libraryMap: u,
|
|
766
|
-
materials:
|
|
767
|
-
materialExports:
|
|
857
|
+
materials: f,
|
|
858
|
+
materialExports: m,
|
|
768
859
|
materialMapLibrary: w
|
|
769
|
-
} =
|
|
770
|
-
|
|
771
|
-
for (const
|
|
772
|
-
const v = a[
|
|
773
|
-
if (
|
|
774
|
-
i[
|
|
860
|
+
} = Ke(r, c), h = window;
|
|
861
|
+
h.CKEDITOR_VERSION = void 0;
|
|
862
|
+
for (const d of p) {
|
|
863
|
+
const v = a[d], F = h[d];
|
|
864
|
+
if (F)
|
|
865
|
+
i[d] = F;
|
|
775
866
|
else if (v)
|
|
776
|
-
|
|
867
|
+
h[d] = i[d] = await v();
|
|
777
868
|
else {
|
|
778
|
-
const $ = u[
|
|
869
|
+
const $ = u[d] || [];
|
|
779
870
|
for (const j of $)
|
|
780
|
-
|
|
781
|
-
i[
|
|
871
|
+
W(j) && await Xe(d, P.append(j, { v: R })), G(j) && await z(P.append(j, { v: R }));
|
|
872
|
+
i[d] = h[d];
|
|
782
873
|
}
|
|
783
874
|
}
|
|
784
|
-
for (const
|
|
785
|
-
await
|
|
875
|
+
for (const d of f)
|
|
876
|
+
await z(P.append(d, { v: R }));
|
|
786
877
|
const g = this.materials || {};
|
|
787
|
-
for (const
|
|
788
|
-
const v =
|
|
789
|
-
if (
|
|
790
|
-
v &&
|
|
878
|
+
for (const d of m) {
|
|
879
|
+
const v = h[w[d]], F = we[d];
|
|
880
|
+
if (F)
|
|
881
|
+
v && F.forEach(($) => {
|
|
791
882
|
l[$] = v[$];
|
|
792
883
|
});
|
|
793
884
|
else {
|
|
794
|
-
const $ = g[
|
|
885
|
+
const $ = g[d] ? (await g[d]()).default : h[d];
|
|
795
886
|
$ && v && ($.components || []).forEach((j) => {
|
|
796
|
-
l[j.name] =
|
|
887
|
+
l[j.name] = Qe(j, v);
|
|
797
888
|
});
|
|
798
889
|
}
|
|
799
890
|
}
|
|
800
|
-
this.apis =
|
|
891
|
+
this.apis = rt(s, o, this.adapter), pe(), this.project.config?.mock && st(s), this.initRouter(), this.triggerReady();
|
|
801
892
|
}
|
|
802
893
|
initRouter() {
|
|
803
894
|
const { router: e, project: t } = this;
|
|
804
895
|
e && (e.addRoute({
|
|
805
896
|
path: "/page/:id",
|
|
806
897
|
name: "VtjPage",
|
|
807
|
-
component:
|
|
898
|
+
component: ne
|
|
808
899
|
}), e.addRoute({
|
|
809
900
|
path: "/",
|
|
810
901
|
name: "VtjHomepage",
|
|
811
|
-
component: t?.homepage ?
|
|
902
|
+
component: t?.homepage ? ne : qt
|
|
812
903
|
}));
|
|
813
904
|
}
|
|
814
905
|
install(e) {
|
|
815
906
|
const t = e.config.globalProperties.installed || {};
|
|
816
907
|
for (const [r, s] of Object.entries(this.library))
|
|
817
|
-
!t[r] &&
|
|
818
|
-
e.provide(
|
|
908
|
+
!t[r] && ze(s) && (e.use(s), t[r] = !0);
|
|
909
|
+
this.options.install && e.use(this.options.install), e.provide(ve, this), e.config.globalProperties.installed = t;
|
|
819
910
|
}
|
|
820
911
|
getFile(e) {
|
|
821
912
|
const { blocks: t = [] } = this.project || {};
|
|
@@ -877,35 +968,35 @@ class gt extends de {
|
|
|
877
968
|
async getRenderComponent(e) {
|
|
878
969
|
const t = this.getFile(e);
|
|
879
970
|
if (!t)
|
|
880
|
-
return
|
|
971
|
+
return x.warn(`Can not find file: ${e}`), null;
|
|
881
972
|
const r = `.vtj/vue/${e}.vue`, s = this.modules[r];
|
|
882
973
|
if (s)
|
|
883
974
|
return (await s())?.default;
|
|
884
975
|
const o = await this.getDsl(t.id);
|
|
885
|
-
return o ? this.createDslRenderer(o).renderer : (
|
|
976
|
+
return o ? this.createDslRenderer(o).renderer : (x.warn(`Can not find dsl: ${e}`), null);
|
|
886
977
|
}
|
|
887
978
|
defineUrlSchemaComponent(e, t) {
|
|
888
|
-
return
|
|
979
|
+
return Z(async () => {
|
|
889
980
|
const r = await this.getDslByUrl(e);
|
|
890
981
|
return r ? (r.name = t || r.name, this.createDslRenderer(r).renderer) : null;
|
|
891
982
|
});
|
|
892
983
|
}
|
|
893
984
|
definePluginComponent(e) {
|
|
894
|
-
return
|
|
895
|
-
const t = await
|
|
896
|
-
return t ? (
|
|
985
|
+
return Z(async () => {
|
|
986
|
+
const t = await de(e, window);
|
|
987
|
+
return t ? (fe(t.css), t.component) : null;
|
|
897
988
|
});
|
|
898
989
|
}
|
|
899
990
|
}
|
|
900
|
-
function
|
|
901
|
-
const e = new
|
|
991
|
+
function sn(n) {
|
|
992
|
+
const e = new Jt(n);
|
|
902
993
|
return {
|
|
903
994
|
provider: e,
|
|
904
995
|
onReady: (r) => e.ready(r)
|
|
905
996
|
};
|
|
906
997
|
}
|
|
907
|
-
function
|
|
908
|
-
const e =
|
|
998
|
+
function ye(n = {}) {
|
|
999
|
+
const e = Ue(ve);
|
|
909
1000
|
if (!e)
|
|
910
1001
|
throw new Error("Can not find provider");
|
|
911
1002
|
if (e.nodeEnv === "development") {
|
|
@@ -920,7 +1011,7 @@ function pe(n = {}) {
|
|
|
920
1011
|
}
|
|
921
1012
|
return e;
|
|
922
1013
|
}
|
|
923
|
-
const Q = new
|
|
1014
|
+
const Q = new He({
|
|
924
1015
|
settings: {
|
|
925
1016
|
type: "json",
|
|
926
1017
|
validSuccess: !0,
|
|
@@ -933,7 +1024,7 @@ const Q = new Pe({
|
|
|
933
1024
|
});
|
|
934
1025
|
}
|
|
935
1026
|
}
|
|
936
|
-
}),
|
|
1027
|
+
}), Lt = (n = "/vtj/local/repository/${type}.json") => (e, t) => Q.send({
|
|
937
1028
|
url: n,
|
|
938
1029
|
method: "post",
|
|
939
1030
|
query: { type: e },
|
|
@@ -941,7 +1032,7 @@ const Q = new Pe({
|
|
|
941
1032
|
type: e,
|
|
942
1033
|
data: t
|
|
943
1034
|
}
|
|
944
|
-
}),
|
|
1035
|
+
}), Vt = (n = "/vtj/local/repository/uploader.json") => async (e, t) => await Q.send({
|
|
945
1036
|
url: n,
|
|
946
1037
|
method: "post",
|
|
947
1038
|
data: {
|
|
@@ -952,12 +1043,12 @@ const Q = new Pe({
|
|
|
952
1043
|
type: "data"
|
|
953
1044
|
}
|
|
954
1045
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
|
955
|
-
class
|
|
1046
|
+
class X {
|
|
956
1047
|
api;
|
|
957
1048
|
pluginCaches = {};
|
|
958
1049
|
uploader;
|
|
959
1050
|
constructor() {
|
|
960
|
-
this.api =
|
|
1051
|
+
this.api = Lt(), this.uploader = Vt();
|
|
961
1052
|
}
|
|
962
1053
|
async getExtension() {
|
|
963
1054
|
console.log("BaseService.getExtension");
|
|
@@ -1030,7 +1121,7 @@ class W {
|
|
|
1030
1121
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
|
1031
1122
|
}
|
|
1032
1123
|
async getPluginMaterial(e) {
|
|
1033
|
-
const { urls: t = [] } = e, r = t.filter((o) =>
|
|
1124
|
+
const { urls: t = [] } = e, r = t.filter((o) => Ge(o))[0];
|
|
1034
1125
|
if (!r)
|
|
1035
1126
|
return null;
|
|
1036
1127
|
const s = this.pluginCaches[r];
|
|
@@ -1044,18 +1135,18 @@ class W {
|
|
|
1044
1135
|
}).then((o) => o.data).catch(() => null));
|
|
1045
1136
|
}
|
|
1046
1137
|
}
|
|
1047
|
-
const y = new
|
|
1138
|
+
const y = new Me({
|
|
1048
1139
|
type: "local",
|
|
1049
1140
|
expired: 0,
|
|
1050
1141
|
prefix: "__VTJ_"
|
|
1051
1142
|
});
|
|
1052
|
-
class
|
|
1143
|
+
class on extends X {
|
|
1053
1144
|
init(e) {
|
|
1054
|
-
const t = new
|
|
1145
|
+
const t = new O(e), r = y.get(`project_${t.id}`), s = Object.assign(t.toDsl(), r || {});
|
|
1055
1146
|
return y.save(`project_${t.id}`, s), Promise.resolve(s);
|
|
1056
1147
|
}
|
|
1057
1148
|
saveProject(e) {
|
|
1058
|
-
const t = new
|
|
1149
|
+
const t = new O(e);
|
|
1059
1150
|
return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
|
1060
1151
|
}
|
|
1061
1152
|
saveMaterials(e, t) {
|
|
@@ -1083,7 +1174,7 @@ class Dt extends W {
|
|
|
1083
1174
|
return Promise.resolve(!0);
|
|
1084
1175
|
}
|
|
1085
1176
|
getHistory(e) {
|
|
1086
|
-
const t = y.get(`history_${e}`), r = new
|
|
1177
|
+
const t = y.get(`history_${e}`), r = new re(t || { id: e });
|
|
1087
1178
|
return Promise.resolve(r.toDsl());
|
|
1088
1179
|
}
|
|
1089
1180
|
getHistoryItem(e, t) {
|
|
@@ -1099,18 +1190,18 @@ class Dt extends W {
|
|
|
1099
1190
|
}), Promise.resolve(!0);
|
|
1100
1191
|
}
|
|
1101
1192
|
}
|
|
1102
|
-
class
|
|
1193
|
+
class Wt extends X {
|
|
1103
1194
|
projects = {};
|
|
1104
1195
|
materials = {};
|
|
1105
1196
|
files = {};
|
|
1106
1197
|
histories = {};
|
|
1107
1198
|
historyItems = {};
|
|
1108
1199
|
init(e) {
|
|
1109
|
-
const t = new
|
|
1200
|
+
const t = new O(e), r = this.projects[t.id] || {}, s = Object.assign(t.toDsl(), r);
|
|
1110
1201
|
return this.projects[s.id] = s, Promise.resolve(s);
|
|
1111
1202
|
}
|
|
1112
1203
|
saveProject(e) {
|
|
1113
|
-
const t = new
|
|
1204
|
+
const t = new O(e);
|
|
1114
1205
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
|
1115
1206
|
}
|
|
1116
1207
|
saveMaterials(e, t) {
|
|
@@ -1138,7 +1229,7 @@ class St extends W {
|
|
|
1138
1229
|
return Promise.resolve(!0);
|
|
1139
1230
|
}
|
|
1140
1231
|
getHistory(e) {
|
|
1141
|
-
const t = this.histories[e], r = new
|
|
1232
|
+
const t = this.histories[e], r = new re(t || { id: e });
|
|
1142
1233
|
return Promise.resolve(r);
|
|
1143
1234
|
}
|
|
1144
1235
|
getHistoryItem(e, t) {
|
|
@@ -1156,11 +1247,11 @@ class St extends W {
|
|
|
1156
1247
|
}), Promise.resolve(!0);
|
|
1157
1248
|
}
|
|
1158
1249
|
}
|
|
1159
|
-
let
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1250
|
+
let M = null;
|
|
1251
|
+
function an() {
|
|
1252
|
+
return M || (M = new Wt(), M);
|
|
1162
1253
|
}
|
|
1163
|
-
class
|
|
1254
|
+
class cn extends X {
|
|
1164
1255
|
getFileCaches = {};
|
|
1165
1256
|
async getExtension() {
|
|
1166
1257
|
return await this.api("getExtension", {}).catch(() => {
|
|
@@ -1215,7 +1306,7 @@ class Tt extends W {
|
|
|
1215
1306
|
);
|
|
1216
1307
|
}
|
|
1217
1308
|
}
|
|
1218
|
-
function
|
|
1309
|
+
function ge(n = []) {
|
|
1219
1310
|
return n.map((e) => {
|
|
1220
1311
|
const { id: t, title: r, icon: s, children: o, hidden: a } = e;
|
|
1221
1312
|
return {
|
|
@@ -1224,13 +1315,13 @@ function fe(n = []) {
|
|
|
1224
1315
|
icon: s,
|
|
1225
1316
|
hidden: a,
|
|
1226
1317
|
url: `/page/${t}`,
|
|
1227
|
-
children: o && o.length ?
|
|
1318
|
+
children: o && o.length ? ge(o) : void 0
|
|
1228
1319
|
};
|
|
1229
1320
|
});
|
|
1230
1321
|
}
|
|
1231
|
-
function
|
|
1232
|
-
const n =
|
|
1233
|
-
|
|
1322
|
+
function ln() {
|
|
1323
|
+
const n = ye(), e = ce(), t = L(!1), r = n.project;
|
|
1324
|
+
qe(() => {
|
|
1234
1325
|
const { name: a, params: i, meta: l } = e;
|
|
1235
1326
|
if (a === "VtjPage") {
|
|
1236
1327
|
const c = n.getPage(i.id);
|
|
@@ -1241,7 +1332,7 @@ function At() {
|
|
|
1241
1332
|
} else
|
|
1242
1333
|
t.value = !l.mask;
|
|
1243
1334
|
});
|
|
1244
|
-
const s =
|
|
1335
|
+
const s = ge(r?.pages), o = r?.config;
|
|
1245
1336
|
return {
|
|
1246
1337
|
disabled: t,
|
|
1247
1338
|
logo: o?.logo,
|
|
@@ -1251,54 +1342,54 @@ function At() {
|
|
|
1251
1342
|
};
|
|
1252
1343
|
}
|
|
1253
1344
|
export {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1345
|
+
Ve as BUILT_IN_DIRECTIVES,
|
|
1346
|
+
X as BaseService,
|
|
1347
|
+
ee as CONTEXT_HOST,
|
|
1348
|
+
it as Context,
|
|
1258
1349
|
S as ContextMode,
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1350
|
+
We as DATA_TYPES,
|
|
1351
|
+
rn as JSCodeToString,
|
|
1352
|
+
en as LIFE_CYCLES_LIST,
|
|
1353
|
+
cn as LocalService,
|
|
1354
|
+
Wt as MemoryService,
|
|
1355
|
+
Jt as Provider,
|
|
1356
|
+
on as StorageService,
|
|
1266
1357
|
R as VTJ_RENDERER_VERSION,
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1358
|
+
ue as adoptedStyleSheets,
|
|
1359
|
+
tn as createAssetScripts,
|
|
1360
|
+
nn as createAssetsCss,
|
|
1361
|
+
pt as createDataSources,
|
|
1271
1362
|
q as createLoader,
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1363
|
+
an as createMemoryService,
|
|
1364
|
+
nt as createMetaApi,
|
|
1365
|
+
sn as createProvider,
|
|
1275
1366
|
U as createRenderer,
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1367
|
+
tt as createSchemaApi,
|
|
1368
|
+
rt as createSchemaApis,
|
|
1369
|
+
ht as defaultLoader,
|
|
1279
1370
|
H as fillBasePath,
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1371
|
+
me as getModifiers,
|
|
1372
|
+
de as getPlugin,
|
|
1373
|
+
Qe as getRawComponent,
|
|
1374
|
+
W as isCSSUrl,
|
|
1375
|
+
Ze as isJSCode,
|
|
1285
1376
|
_ as isJSExpression,
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1377
|
+
B as isJSFunction,
|
|
1378
|
+
Ge as isJSON,
|
|
1379
|
+
G as isJSUrl,
|
|
1380
|
+
ze as isVuePlugin,
|
|
1381
|
+
Xe as loadCss,
|
|
1382
|
+
fe as loadCssUrl,
|
|
1383
|
+
Ye as loadScriptUrl,
|
|
1384
|
+
ot as mockApi,
|
|
1385
|
+
st as mockApis,
|
|
1386
|
+
pe as mockCleanup,
|
|
1296
1387
|
k as nodeRender,
|
|
1297
|
-
|
|
1388
|
+
Ke as parseDeps,
|
|
1298
1389
|
I as parseExpression,
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1390
|
+
te as parseFunction,
|
|
1391
|
+
ve as providerKey,
|
|
1392
|
+
le as toString,
|
|
1393
|
+
ln as useMask,
|
|
1394
|
+
ye as useProvider
|
|
1304
1395
|
};
|