@vtj/renderer 0.7.34 → 0.8.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/index.cjs +5 -5
- package/dist/index.mjs +634 -503
- package/package.json +7 -7
- package/types/provider/provider.d.ts +10 -1
- package/types/render/loader.d.ts +3 -1
- package/types/services/base.d.ts +8 -1
- package/types/services/local.d.ts +1 -0
- package/types/utils/deps.d.ts +2 -0
- package/types/utils/util.d.ts +2 -0
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { isUrl as
|
|
1
|
+
import { Base as pe, BUILT_IN_COMPONENTS as fe, ProjectModel as x, HistoryModel as Z } from "@vtj/core";
|
|
2
|
+
import { isUrl as de, url as F, dedupArray as me, isString as C, isFunction as W, logger as O, createRequest as he, merge as ve, pathToRegexp as ye, pathToRegexpMatch as ge, formDataToJson as _e, camelCase as E, upperFirst as we, pick as Se, jsonp as $e, loadScript as X, Request as je, Storage as Ee, mapToObject as U } from "@vtj/utils";
|
|
3
3
|
import * as k from "vue";
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { useRoute as
|
|
6
|
-
import { ElNotification as
|
|
7
|
-
import
|
|
8
|
-
import { useTitle as
|
|
9
|
-
import { XStartup as
|
|
4
|
+
import { defineComponent as ee, h as A, inject as Pe, defineAsyncComponent as Y, ref as Fe, watchEffect as Ce } from "vue";
|
|
5
|
+
import { useRoute as te } from "vue-router";
|
|
6
|
+
import { ElNotification as q, ElLoading as be } from "element-plus";
|
|
7
|
+
import D from "mockjs";
|
|
8
|
+
import { useTitle as Re } from "@vueuse/core";
|
|
9
|
+
import { XStartup as Ie } from "@vtj/ui";
|
|
10
10
|
/**!
|
|
11
11
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
12
12
|
* @name @vtj/renderer
|
|
13
13
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
14
|
-
* @version 0.
|
|
14
|
+
* @version 0.8.0
|
|
15
15
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
18
|
-
var
|
|
19
|
-
const
|
|
17
|
+
const b = "0.8.0";
|
|
18
|
+
var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
|
|
19
|
+
const z = [
|
|
20
20
|
"$el",
|
|
21
21
|
"$emit",
|
|
22
22
|
"$nextTick",
|
|
@@ -28,7 +28,7 @@ const L = [
|
|
|
28
28
|
"$props",
|
|
29
29
|
"$options",
|
|
30
30
|
"$forceUpdate"
|
|
31
|
-
],
|
|
31
|
+
], Ct = [
|
|
32
32
|
"beforeCreate",
|
|
33
33
|
"created",
|
|
34
34
|
"beforeMount",
|
|
@@ -42,7 +42,7 @@ const L = [
|
|
|
42
42
|
"renderTriggered",
|
|
43
43
|
"activated",
|
|
44
44
|
"deactivated"
|
|
45
|
-
],
|
|
45
|
+
], He = ["vIf", "vShow", "vModel", "vFor", "vBind"], xe = {
|
|
46
46
|
String,
|
|
47
47
|
Number,
|
|
48
48
|
Boolean,
|
|
@@ -51,179 +51,207 @@ const L = [
|
|
|
51
51
|
Function,
|
|
52
52
|
Date
|
|
53
53
|
};
|
|
54
|
-
function
|
|
55
|
-
return
|
|
54
|
+
function I(n, e) {
|
|
55
|
+
return n.map((t) => de(t) ? t : `${e}${t}`);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return /\.css$/.test(
|
|
57
|
+
function J(n) {
|
|
58
|
+
return /\.css$/.test(n);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return /\.js$/.test(
|
|
60
|
+
function V(n) {
|
|
61
|
+
return /\.js$/.test(n);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
65
|
-
|
|
63
|
+
function Oe(n) {
|
|
64
|
+
return /\.json$/.test(n);
|
|
65
|
+
}
|
|
66
|
+
function bt(n) {
|
|
67
|
+
return n.map(
|
|
68
|
+
(e) => `<script src="${F.append(e, { v: b })}"><\/script>`
|
|
66
69
|
).join("");
|
|
67
70
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
70
|
-
(e) => `<link rel="stylesheet" href="${
|
|
71
|
+
function Rt(n = []) {
|
|
72
|
+
return n.map(
|
|
73
|
+
(e) => `<link rel="stylesheet" href="${F.append(e, { v: b })}" />`
|
|
71
74
|
).join("");
|
|
72
75
|
}
|
|
73
|
-
function
|
|
74
|
-
const t =
|
|
75
|
-
return t.forEach(
|
|
76
|
-
f
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
function De(n, e) {
|
|
77
|
+
const t = n.filter((f) => !!f.enabled), r = [], s = [], o = [], i = [], a = {}, l = {}, c = [], d = {};
|
|
78
|
+
return t.forEach(
|
|
79
|
+
({ urls: f, assetsUrl: p, library: y, assetsLibrary: m, localeLibrary: h }) => {
|
|
80
|
+
f?.forEach((u) => {
|
|
81
|
+
V(u) && r.push(u), J(u) && s.push(u);
|
|
82
|
+
}), y && (i.push(y), a[y] = I(f || [], e), h && (l[y] = h)), p && o.push(p), m && c.push(m), y && m && (d[m] = y);
|
|
83
|
+
}
|
|
84
|
+
), {
|
|
85
|
+
scripts: I(r, e),
|
|
86
|
+
css: I(s, e),
|
|
87
|
+
materials: I(o, e),
|
|
83
88
|
libraryExports: i,
|
|
84
|
-
materialExports:
|
|
85
|
-
materialMapLibrary:
|
|
86
|
-
libraryMap: a
|
|
89
|
+
materialExports: me(c),
|
|
90
|
+
materialMapLibrary: d,
|
|
91
|
+
libraryMap: a,
|
|
92
|
+
libraryLocaleMap: l
|
|
87
93
|
};
|
|
88
94
|
}
|
|
89
|
-
function
|
|
90
|
-
const { name: t, parent:
|
|
91
|
-
return
|
|
95
|
+
function Me(n, e) {
|
|
96
|
+
const { name: t, parent: r, alias: s } = n;
|
|
97
|
+
return r ? e[r]?.[s || t] : e[s || t];
|
|
92
98
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
99
|
+
function re(n) {
|
|
100
|
+
return C(n) ? n : JSON.stringify(n);
|
|
95
101
|
}
|
|
96
|
-
function
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const o =
|
|
102
|
-
(
|
|
102
|
+
function ne(n, e, t) {
|
|
103
|
+
const r = n.CSSStyleSheet;
|
|
104
|
+
if (r.prototype.replaceSync) {
|
|
105
|
+
const s = new r();
|
|
106
|
+
s.id = e, s.replaceSync(t);
|
|
107
|
+
const o = n.document, i = o.adoptedStyleSheets, a = Array.from(i).filter(
|
|
108
|
+
(l) => l.id !== e
|
|
103
109
|
);
|
|
104
|
-
o.adoptedStyleSheets = [...a,
|
|
110
|
+
o.adoptedStyleSheets = [...a, s];
|
|
105
111
|
} else {
|
|
106
|
-
const
|
|
107
|
-
let o =
|
|
108
|
-
o ? o.innerHTML = t : (o =
|
|
112
|
+
const s = n.document;
|
|
113
|
+
let o = s.getElementById(e);
|
|
114
|
+
o ? o.innerHTML = t : (o = s.createElement("style"), o.id = e, o.innerHTML = t, s.head.appendChild(o));
|
|
109
115
|
}
|
|
110
116
|
}
|
|
111
|
-
async function
|
|
112
|
-
const t = await window.fetch(e).then((
|
|
113
|
-
t &&
|
|
117
|
+
async function ke(n, e) {
|
|
118
|
+
const t = await window.fetch(e).then((r) => r.text()).catch(() => "");
|
|
119
|
+
t && ne(window, n, t);
|
|
120
|
+
}
|
|
121
|
+
function se(n, e = window) {
|
|
122
|
+
const t = e.document, r = e.document.head;
|
|
123
|
+
for (const s of n)
|
|
124
|
+
if (!t.getElementById(s)) {
|
|
125
|
+
const i = t.createElement("link");
|
|
126
|
+
i.rel = "stylesheet", i.id = s, i.href = s, r.appendChild(i);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function Te(n, e, t = window) {
|
|
130
|
+
const r = t.document, s = t.document.head;
|
|
131
|
+
let o = t[e];
|
|
132
|
+
return o ? o.default || o : new Promise((i, a) => {
|
|
133
|
+
for (const l of n) {
|
|
134
|
+
const c = r.createElement("script");
|
|
135
|
+
c.src = l, c.onload = () => {
|
|
136
|
+
o = t[e], o && i(o.default || o);
|
|
137
|
+
}, c.onerror = (d) => {
|
|
138
|
+
a(d);
|
|
139
|
+
}, s.appendChild(c);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
114
142
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
143
|
+
function Ae(n) {
|
|
144
|
+
return W(n) || W(n?.install);
|
|
117
145
|
}
|
|
118
|
-
function R(
|
|
146
|
+
function R(n, e, t = !1, r = !1) {
|
|
119
147
|
try {
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
let o = (
|
|
123
|
-
o = o.replace(/this(\W|$)/g, (a,
|
|
148
|
+
const s = ['"use strict";', "var __self = arguments[0];"];
|
|
149
|
+
s.push("return ");
|
|
150
|
+
let o = (n.value || "").trim();
|
|
151
|
+
o = o.replace(/this(\W|$)/g, (a, l) => `__self${l}`), o = s.join(`
|
|
124
152
|
`) + o;
|
|
125
153
|
const i = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
|
|
126
154
|
return new Function("$scope", i)(e);
|
|
127
|
-
} catch (
|
|
128
|
-
if (O.error("parseExpression.error",
|
|
129
|
-
throw
|
|
155
|
+
} catch (s) {
|
|
156
|
+
if (O.error("parseExpression.error", s, n, e?.__self ?? e), r)
|
|
157
|
+
throw s;
|
|
130
158
|
}
|
|
131
159
|
}
|
|
132
|
-
function
|
|
133
|
-
const
|
|
134
|
-
if (typeof
|
|
160
|
+
function G(n, e, t = !1, r = !1) {
|
|
161
|
+
const s = R(n, e, t, r);
|
|
162
|
+
if (typeof s != "function" && (O.error(
|
|
135
163
|
"parseFunction.error",
|
|
136
164
|
"not a function",
|
|
137
|
-
|
|
165
|
+
n,
|
|
138
166
|
e?.__self ?? e
|
|
139
|
-
),
|
|
140
|
-
throw new Error(`"${
|
|
141
|
-
return
|
|
167
|
+
), r))
|
|
168
|
+
throw new Error(`"${n.value}" not a function`);
|
|
169
|
+
return s;
|
|
142
170
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
171
|
+
function w(n) {
|
|
172
|
+
return n && n.type === "JSExpression";
|
|
145
173
|
}
|
|
146
|
-
function
|
|
147
|
-
return typeof
|
|
174
|
+
function T(n) {
|
|
175
|
+
return typeof n == "object" && n && n.type === "JSFunction";
|
|
148
176
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
177
|
+
function Be(n) {
|
|
178
|
+
return w(n) || T(n);
|
|
151
179
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
180
|
+
function It(n) {
|
|
181
|
+
return Be(n) ? n.value : JSON.stringify(n);
|
|
154
182
|
}
|
|
155
|
-
let
|
|
156
|
-
const
|
|
183
|
+
let P = null;
|
|
184
|
+
const Ne = he({
|
|
157
185
|
settings: {
|
|
158
186
|
type: "form",
|
|
159
187
|
validSuccess: !0,
|
|
160
188
|
originResponse: !1,
|
|
161
189
|
loading: !0,
|
|
162
|
-
validate: (
|
|
190
|
+
validate: (n) => n.data?.code === 0 || !!n.data?.success,
|
|
163
191
|
failMessage: !0,
|
|
164
|
-
showError: (
|
|
165
|
-
|
|
166
|
-
message:
|
|
192
|
+
showError: (n) => {
|
|
193
|
+
q.error({
|
|
194
|
+
message: n || "未知错误"
|
|
167
195
|
});
|
|
168
196
|
},
|
|
169
197
|
showLoading: () => {
|
|
170
|
-
|
|
198
|
+
P && P.close(), P = be.service({
|
|
171
199
|
lock: !0,
|
|
172
200
|
text: "Loading",
|
|
173
201
|
background: "rgba(0, 0, 0, 0.05)"
|
|
174
202
|
});
|
|
175
203
|
},
|
|
176
204
|
hideLoading: () => {
|
|
177
|
-
|
|
205
|
+
P && (P.close(), P = null);
|
|
178
206
|
}
|
|
179
207
|
}
|
|
180
208
|
});
|
|
181
|
-
function
|
|
182
|
-
const { jsonp: t, request:
|
|
183
|
-
if (
|
|
184
|
-
return (
|
|
185
|
-
...
|
|
186
|
-
query:
|
|
209
|
+
function Ue(n, e) {
|
|
210
|
+
const { jsonp: t, request: r } = e;
|
|
211
|
+
if (n.method === "jsonp")
|
|
212
|
+
return (s = {}) => t(n.url, {
|
|
213
|
+
...n.jsonpOptions,
|
|
214
|
+
query: s
|
|
187
215
|
});
|
|
188
216
|
{
|
|
189
|
-
const
|
|
190
|
-
url:
|
|
191
|
-
method:
|
|
217
|
+
const s = n.headers ? R(n.headers, {}, !0) : void 0, o = {
|
|
218
|
+
url: n.url,
|
|
219
|
+
method: n.method,
|
|
192
220
|
settings: {
|
|
193
|
-
...
|
|
194
|
-
headers:
|
|
221
|
+
...n.settings,
|
|
222
|
+
headers: s
|
|
195
223
|
}
|
|
196
224
|
};
|
|
197
|
-
return (i, a) =>
|
|
225
|
+
return (i, a) => r.send(ve(o, a || {}, { data: i }));
|
|
198
226
|
}
|
|
199
227
|
}
|
|
200
|
-
function
|
|
201
|
-
return
|
|
202
|
-
(t,
|
|
228
|
+
function qe(n = [], e) {
|
|
229
|
+
return n.reduce(
|
|
230
|
+
(t, r) => (t[r.id] = Ue(r, e), t),
|
|
203
231
|
{}
|
|
204
232
|
);
|
|
205
233
|
}
|
|
206
|
-
function
|
|
207
|
-
|
|
234
|
+
function Je(n = []) {
|
|
235
|
+
D.setup({
|
|
208
236
|
timeout: "50-500"
|
|
209
|
-
}),
|
|
237
|
+
}), oe(), n.forEach((e) => Ve(e));
|
|
210
238
|
}
|
|
211
|
-
function
|
|
212
|
-
if (!
|
|
239
|
+
function Ve(n) {
|
|
240
|
+
if (!n.mock)
|
|
213
241
|
return;
|
|
214
|
-
const { url: e, mockTemplate: t } =
|
|
242
|
+
const { url: e, mockTemplate: t } = n;
|
|
215
243
|
if (e && t) {
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
const a =
|
|
219
|
-
return Object.assign(i, { data:
|
|
244
|
+
const r = ye(`${e}(.*)`), s = ge(e, { decode: decodeURIComponent }), o = R(t, {}, !0);
|
|
245
|
+
D.mock(r, (i) => {
|
|
246
|
+
const a = F.parse(i.url) || {}, l = i.body instanceof FormData ? _e(i.body) : i.body, c = s(i.url)?.params;
|
|
247
|
+
return Object.assign(i, { data: l, params: a, query: c }), D.mock(o(i));
|
|
220
248
|
});
|
|
221
249
|
}
|
|
222
250
|
}
|
|
223
|
-
function
|
|
224
|
-
|
|
251
|
+
function oe() {
|
|
252
|
+
D._mocked = {};
|
|
225
253
|
}
|
|
226
|
-
class
|
|
254
|
+
class Le {
|
|
227
255
|
__id = null;
|
|
228
256
|
__mode;
|
|
229
257
|
__instance = null;
|
|
@@ -248,113 +276,113 @@ class Ne {
|
|
|
248
276
|
$apis = {};
|
|
249
277
|
__transform = {};
|
|
250
278
|
constructor(e) {
|
|
251
|
-
const { mode: t, dsl:
|
|
252
|
-
this.__mode = t,
|
|
279
|
+
const { mode: t, dsl: r, attrs: s } = e;
|
|
280
|
+
this.__mode = t, r && (this.__id = r.id || null, this.__transform = r.transform || {}), s && Object.assign(this, s);
|
|
253
281
|
}
|
|
254
282
|
setup(e, t = k) {
|
|
255
|
-
const
|
|
256
|
-
if (!
|
|
283
|
+
const r = t.getCurrentInstance();
|
|
284
|
+
if (!r)
|
|
257
285
|
return;
|
|
258
|
-
this.__instance =
|
|
259
|
-
const
|
|
260
|
-
Object.assign(this,
|
|
286
|
+
this.__instance = r.proxy;
|
|
287
|
+
const s = r.appContext.config.globalProperties;
|
|
288
|
+
Object.assign(this, s), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
|
|
261
289
|
this.__proxy();
|
|
262
290
|
}), t.onUnmounted(() => {
|
|
263
291
|
this.__cleanup();
|
|
264
292
|
});
|
|
265
293
|
}
|
|
266
294
|
__proxy() {
|
|
267
|
-
this.__instance &&
|
|
295
|
+
this.__instance && z.forEach((e) => {
|
|
268
296
|
this[e] = this.__instance?.[e];
|
|
269
297
|
});
|
|
270
298
|
}
|
|
271
299
|
__cleanup() {
|
|
272
|
-
|
|
300
|
+
z.forEach((e) => {
|
|
273
301
|
this[e] = null;
|
|
274
302
|
});
|
|
275
303
|
}
|
|
276
304
|
__parseFunction(e) {
|
|
277
305
|
if (e)
|
|
278
|
-
if (this.__mode ===
|
|
279
|
-
const { id: t, type:
|
|
280
|
-
return
|
|
306
|
+
if (this.__mode === _.Runtime) {
|
|
307
|
+
const { id: t, type: r } = e, s = t ? this.__transform[t] ?? e.value : e.value;
|
|
308
|
+
return G({ type: r, value: s }, this);
|
|
281
309
|
} else
|
|
282
|
-
return
|
|
310
|
+
return G(e, this);
|
|
283
311
|
}
|
|
284
312
|
__parseExpression(e) {
|
|
285
313
|
if (e)
|
|
286
|
-
if (this.__mode ===
|
|
287
|
-
const { id: t, type:
|
|
288
|
-
return R({ type:
|
|
314
|
+
if (this.__mode === _.Runtime) {
|
|
315
|
+
const { id: t, type: r } = e, s = t ? this.__transform[t] ?? e.value : e.value;
|
|
316
|
+
return R({ type: r, value: s }, this);
|
|
289
317
|
} else
|
|
290
318
|
return R(e, this);
|
|
291
319
|
}
|
|
292
320
|
__ref(e = null, t) {
|
|
293
|
-
if (this.__mode !==
|
|
294
|
-
return e && e !== this.__id && (this.__contextRefs[e] = this), (
|
|
295
|
-
let
|
|
296
|
-
if (!
|
|
321
|
+
if (this.__mode !== _.VNode)
|
|
322
|
+
return e && e !== this.__id && (this.__contextRefs[e] = this), (r) => {
|
|
323
|
+
let s = r?.$vtjEl || r?.$el || r;
|
|
324
|
+
if (!s) {
|
|
297
325
|
typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
|
|
298
326
|
return;
|
|
299
327
|
}
|
|
300
|
-
if (
|
|
301
|
-
t(
|
|
328
|
+
if (s.nodeType === 3 && s.nextSibling && (s = s.nextSibling), s.__vtj__ = e, _.Design === this.__mode && (s.__context__ = this), e && (this.__refs[e] = r), typeof t == "function")
|
|
329
|
+
t(r);
|
|
302
330
|
else if (t) {
|
|
303
331
|
const o = this.$refs[t];
|
|
304
332
|
if (o) {
|
|
305
|
-
const i = new Set([].concat(o,
|
|
333
|
+
const i = new Set([].concat(o, r));
|
|
306
334
|
this.$refs[t] = Array.from(i);
|
|
307
335
|
} else
|
|
308
|
-
this.$refs[t] =
|
|
336
|
+
this.$refs[t] = r;
|
|
309
337
|
}
|
|
310
|
-
return
|
|
338
|
+
return r;
|
|
311
339
|
};
|
|
312
340
|
}
|
|
313
341
|
__clone(e = {}) {
|
|
314
|
-
const t = { ...this.context, ...e },
|
|
342
|
+
const t = { ...this.context, ...e }, r = {
|
|
315
343
|
...t,
|
|
316
344
|
context: t
|
|
317
345
|
};
|
|
318
|
-
return
|
|
346
|
+
return r.context.__proto__ = this.context, r.__proto__ = this, r;
|
|
319
347
|
}
|
|
320
348
|
}
|
|
321
|
-
function
|
|
349
|
+
function B(n) {
|
|
322
350
|
const {
|
|
323
351
|
Vue: e = k,
|
|
324
|
-
mode: t =
|
|
325
|
-
components:
|
|
326
|
-
libs:
|
|
352
|
+
mode: t = _.Runtime,
|
|
353
|
+
components: r = {},
|
|
354
|
+
libs: s = {},
|
|
327
355
|
apis: o = {},
|
|
328
356
|
loader: i
|
|
329
|
-
} =
|
|
330
|
-
$components:
|
|
331
|
-
$libs:
|
|
357
|
+
} = n, a = e.computed(() => n.dsl), l = {
|
|
358
|
+
$components: r,
|
|
359
|
+
$libs: s,
|
|
332
360
|
$apis: o
|
|
333
|
-
}, c = new
|
|
361
|
+
}, c = new Le({
|
|
334
362
|
mode: t,
|
|
335
363
|
dsl: a.value,
|
|
336
|
-
attrs:
|
|
337
|
-
}),
|
|
364
|
+
attrs: l
|
|
365
|
+
}), d = e.defineComponent({
|
|
338
366
|
name: a.value.name,
|
|
339
367
|
props: {
|
|
340
|
-
...
|
|
368
|
+
...Ke(a.value.props ?? [], c)
|
|
341
369
|
},
|
|
342
|
-
setup(
|
|
343
|
-
c.$props =
|
|
344
|
-
|
|
370
|
+
setup(f) {
|
|
371
|
+
c.$props = f, a.value.id && ne(
|
|
372
|
+
n.window || window,
|
|
345
373
|
a.value.id,
|
|
346
374
|
a.value.css || ""
|
|
347
|
-
), c.state =
|
|
348
|
-
const
|
|
375
|
+
), c.state = We(e, a.value.state ?? {}, c);
|
|
376
|
+
const p = Xe(e, a.value.computed ?? {}, c), y = Ye(a.value.methods ?? {}, c), m = ze(e, a.value.inject, c), h = Ge(
|
|
349
377
|
a.value.dataSources || {},
|
|
350
378
|
c
|
|
351
|
-
),
|
|
352
|
-
...
|
|
353
|
-
...
|
|
354
|
-
...
|
|
355
|
-
...
|
|
379
|
+
), u = {
|
|
380
|
+
...m,
|
|
381
|
+
...p,
|
|
382
|
+
...y,
|
|
383
|
+
...h
|
|
356
384
|
};
|
|
357
|
-
return c.setup(
|
|
385
|
+
return c.setup(u, e), Qe(e, a.value.watch ?? [], c), {
|
|
358
386
|
vtj: c
|
|
359
387
|
};
|
|
360
388
|
},
|
|
@@ -363,288 +391,314 @@ function te(r) {
|
|
|
363
391
|
render() {
|
|
364
392
|
if (!a.value.nodes)
|
|
365
393
|
return null;
|
|
366
|
-
const
|
|
367
|
-
return
|
|
394
|
+
const f = a.value.nodes || [];
|
|
395
|
+
return f.length === 1 ? M(f[0], c, e, i) : f.map((p) => M(p, c, e, i));
|
|
368
396
|
},
|
|
369
|
-
...
|
|
397
|
+
...Ze(a.value.lifeCycles ?? {}, c)
|
|
370
398
|
});
|
|
371
399
|
return {
|
|
372
|
-
renderer: e.markRaw(
|
|
400
|
+
renderer: e.markRaw(d),
|
|
373
401
|
context: c
|
|
374
402
|
};
|
|
375
403
|
}
|
|
376
|
-
function
|
|
377
|
-
const t = (
|
|
378
|
-
return
|
|
379
|
-
name:
|
|
404
|
+
function Ke(n = [], e) {
|
|
405
|
+
const t = (r) => r ? (Array.isArray(r) ? r : [r]).map((o) => xe[o]) : void 0;
|
|
406
|
+
return n.map((r) => C(r) ? {
|
|
407
|
+
name: r
|
|
380
408
|
} : {
|
|
381
|
-
name:
|
|
382
|
-
type:
|
|
383
|
-
required:
|
|
384
|
-
default:
|
|
409
|
+
name: r.name,
|
|
410
|
+
type: r.type,
|
|
411
|
+
required: r.required,
|
|
412
|
+
default: w(r.default) ? e.__parseExpression(r.default) : r.default
|
|
385
413
|
}).reduce(
|
|
386
|
-
(
|
|
387
|
-
type: t(
|
|
388
|
-
required:
|
|
389
|
-
default:
|
|
390
|
-
},
|
|
414
|
+
(r, s) => (r[s.name] = {
|
|
415
|
+
type: t(s.type),
|
|
416
|
+
required: s.required,
|
|
417
|
+
default: s.default
|
|
418
|
+
}, r),
|
|
391
419
|
{}
|
|
392
420
|
);
|
|
393
421
|
}
|
|
394
|
-
function
|
|
395
|
-
return
|
|
422
|
+
function We(n, e, t) {
|
|
423
|
+
return n.reactive(
|
|
396
424
|
Object.keys(e || {}).reduce(
|
|
397
|
-
(
|
|
398
|
-
let o = e[
|
|
399
|
-
return
|
|
425
|
+
(r, s) => {
|
|
426
|
+
let o = e[s];
|
|
427
|
+
return w(o) ? o = t.__parseExpression(o) : T(o) && (o = t.__parseFunction(o)), r[s] = o, r;
|
|
400
428
|
},
|
|
401
429
|
{}
|
|
402
430
|
)
|
|
403
431
|
);
|
|
404
432
|
}
|
|
405
|
-
function
|
|
433
|
+
function Xe(n, e, t) {
|
|
406
434
|
return Object.entries(e ?? {}).reduce(
|
|
407
|
-
(
|
|
435
|
+
(r, [s, o]) => (r[s] = n.computed(t.__parseFunction(o)), r),
|
|
408
436
|
{}
|
|
409
437
|
);
|
|
410
438
|
}
|
|
411
|
-
function
|
|
412
|
-
return Object.entries(
|
|
413
|
-
(t, [
|
|
439
|
+
function Ye(n, e) {
|
|
440
|
+
return Object.entries(n ?? {}).reduce(
|
|
441
|
+
(t, [r, s]) => (t[r] = e.__parseFunction(s), t),
|
|
414
442
|
{}
|
|
415
443
|
);
|
|
416
444
|
}
|
|
417
|
-
function
|
|
445
|
+
function ze(n, e = [], t) {
|
|
418
446
|
return e.reduce(
|
|
419
|
-
(
|
|
420
|
-
const { name: o, from: i } =
|
|
421
|
-
|
|
422
|
-
const a =
|
|
423
|
-
return
|
|
447
|
+
(r, s) => {
|
|
448
|
+
const { name: o, from: i } = s || {};
|
|
449
|
+
s.default;
|
|
450
|
+
const a = w(i) ? t.__parseExpression(i) || o : i ?? o, l = w(s.default) ? t.__parseExpression(s.default) : s.default ?? null;
|
|
451
|
+
return r[o] = n.inject(a, l), r;
|
|
424
452
|
},
|
|
425
453
|
{}
|
|
426
454
|
);
|
|
427
455
|
}
|
|
428
|
-
function
|
|
429
|
-
return Object.keys(
|
|
430
|
-
(t,
|
|
431
|
-
const
|
|
432
|
-
return t[
|
|
433
|
-
const
|
|
434
|
-
return i ? i(
|
|
456
|
+
function Ge(n, e) {
|
|
457
|
+
return Object.keys(n).reduce(
|
|
458
|
+
(t, r) => {
|
|
459
|
+
const s = n[r], o = e.$apis[s.ref], i = T(s.transform) ? s.transform.value ? e.__parseFunction(s.transform) : void 0 : s.transform;
|
|
460
|
+
return t[r] = async (...a) => {
|
|
461
|
+
const l = await o.apply(e, a);
|
|
462
|
+
return i ? i(l) : l;
|
|
435
463
|
}, t;
|
|
436
464
|
},
|
|
437
465
|
{}
|
|
438
466
|
);
|
|
439
467
|
}
|
|
440
|
-
function
|
|
441
|
-
e.forEach((
|
|
442
|
-
|
|
443
|
-
t.__parseExpression(
|
|
444
|
-
t.__parseFunction(
|
|
468
|
+
function Qe(n, e = [], t) {
|
|
469
|
+
e.forEach((r) => {
|
|
470
|
+
n.watch(
|
|
471
|
+
t.__parseExpression(r.source),
|
|
472
|
+
t.__parseFunction(r.handler),
|
|
445
473
|
{
|
|
446
|
-
deep:
|
|
447
|
-
immediate:
|
|
474
|
+
deep: r.deep,
|
|
475
|
+
immediate: r.immediate
|
|
448
476
|
}
|
|
449
477
|
);
|
|
450
478
|
});
|
|
451
479
|
}
|
|
452
|
-
function
|
|
453
|
-
return Object.entries(
|
|
454
|
-
(t, [
|
|
480
|
+
function Ze(n, e) {
|
|
481
|
+
return Object.entries(n ?? {}).reduce(
|
|
482
|
+
(t, [r, s]) => (t[r] = e.__parseFunction(s), t),
|
|
455
483
|
{}
|
|
456
484
|
);
|
|
457
485
|
}
|
|
458
|
-
const
|
|
459
|
-
function
|
|
460
|
-
const {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
486
|
+
const et = (n) => n;
|
|
487
|
+
async function ie(n, e = window) {
|
|
488
|
+
const { urls: t = [], library: r } = n, s = t.filter((l) => V(l));
|
|
489
|
+
if (s.length === 0 || !r)
|
|
490
|
+
return null;
|
|
491
|
+
const o = t.filter((l) => J(l));
|
|
492
|
+
let i;
|
|
493
|
+
const a = await Te(s, r, e).catch(
|
|
494
|
+
() => null
|
|
495
|
+
);
|
|
496
|
+
return a?.plugin && (i = a.plugin), i ? {
|
|
497
|
+
component: i,
|
|
498
|
+
css: o
|
|
499
|
+
} : null;
|
|
500
|
+
}
|
|
501
|
+
function N(n) {
|
|
502
|
+
const { getDsl: e, getDslByUrl: t, options: r } = n;
|
|
503
|
+
return (s, o, i = k) => !o || typeof o == "string" ? s : o.type === "Schema" && o.id ? i.defineAsyncComponent(async () => {
|
|
504
|
+
const a = await e(o.id);
|
|
505
|
+
return a && (a.name = s), a ? B({
|
|
506
|
+
...r,
|
|
507
|
+
Vue: i,
|
|
508
|
+
dsl: a,
|
|
509
|
+
mode: _.Runtime,
|
|
510
|
+
loader: N(n)
|
|
511
|
+
}).renderer : null;
|
|
512
|
+
}) : o.type === "UrlSchema" && o.url ? i.defineAsyncComponent(async () => {
|
|
513
|
+
const a = await t(o.url);
|
|
514
|
+
return a && (a.name = s), a ? B({
|
|
515
|
+
...r,
|
|
516
|
+
Vue: i,
|
|
517
|
+
dsl: a,
|
|
518
|
+
mode: _.Runtime,
|
|
519
|
+
loader: N(n)
|
|
469
520
|
}).renderer : null;
|
|
521
|
+
}) : o.type === "Plugin" ? i.defineAsyncComponent(async () => {
|
|
522
|
+
const a = await ie(o, r.window);
|
|
523
|
+
return a ? (se(a.css), a.component) : null;
|
|
470
524
|
}) : s;
|
|
471
525
|
}
|
|
472
|
-
function
|
|
473
|
-
if (!
|
|
526
|
+
function M(n, e, t = k, r = et) {
|
|
527
|
+
if (!n || !n.name || n.invisible)
|
|
474
528
|
return null;
|
|
475
|
-
const { id:
|
|
476
|
-
if (i && !
|
|
529
|
+
const { id: s = null, directives: o = [] } = n, { vIf: i, vFor: a, vShow: l, vModels: c, vBind: d } = tt(o);
|
|
530
|
+
if (i && !rt(i, e))
|
|
477
531
|
return null;
|
|
478
|
-
const
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
481
|
-
return
|
|
482
|
-
if (
|
|
483
|
-
return
|
|
484
|
-
const
|
|
485
|
-
return
|
|
486
|
-
})(),
|
|
487
|
-
if (
|
|
488
|
-
return
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
)), c.forEach((
|
|
493
|
-
Object.assign(
|
|
532
|
+
const f = (p) => {
|
|
533
|
+
const y = p.$components, m = (() => {
|
|
534
|
+
if (n.name === "component")
|
|
535
|
+
return nt(p, n.props?.is);
|
|
536
|
+
if (n.name === "slot")
|
|
537
|
+
return n.name;
|
|
538
|
+
const g = r(n.name, n.from, t);
|
|
539
|
+
return C(g) ? y[g] ?? g : g;
|
|
540
|
+
})(), h = st(s, n.props ?? {}, p), u = ot(t, n.events ?? {}, p);
|
|
541
|
+
if (n.name === "slot")
|
|
542
|
+
return it(t, n, h, p);
|
|
543
|
+
d && Object.assign(h, p.__parseExpression(d.value)), l && (h.style = Object.assign(
|
|
544
|
+
h.style ?? {},
|
|
545
|
+
ct(l, p)
|
|
546
|
+
)), c.forEach((g) => {
|
|
547
|
+
Object.assign(h, lt(t, g, p));
|
|
494
548
|
});
|
|
495
|
-
const S =
|
|
496
|
-
return t.createVNode(
|
|
549
|
+
const S = ut(t, n.children ?? [], p, n);
|
|
550
|
+
return t.createVNode(m, { ...h, ...u }, S);
|
|
497
551
|
};
|
|
498
|
-
return a ?
|
|
552
|
+
return a ? dt(a, f, e) : f(e);
|
|
499
553
|
}
|
|
500
|
-
function
|
|
501
|
-
const e =
|
|
502
|
-
(a) => !
|
|
554
|
+
function tt(n = []) {
|
|
555
|
+
const e = n.find((a) => E(a.name) === "vIf"), t = n.find((a) => E(a.name) === "vFor"), r = n.find((a) => E(a.name) === "vShow"), s = n.find((a) => E(a.name) === "vBind"), o = n.filter((a) => E(a.name) === "vModel"), i = n.filter(
|
|
556
|
+
(a) => !He.includes(E(a.name))
|
|
503
557
|
);
|
|
504
558
|
return {
|
|
505
559
|
vIf: e,
|
|
506
560
|
vFor: t,
|
|
507
|
-
vShow:
|
|
561
|
+
vShow: r,
|
|
508
562
|
vModels: o,
|
|
509
|
-
vBind:
|
|
563
|
+
vBind: s,
|
|
510
564
|
others: i
|
|
511
565
|
};
|
|
512
566
|
}
|
|
513
|
-
function
|
|
514
|
-
return !!e.__parseExpression(
|
|
567
|
+
function rt(n, e) {
|
|
568
|
+
return !!e.__parseExpression(n.value);
|
|
515
569
|
}
|
|
516
|
-
function
|
|
517
|
-
return e ?
|
|
570
|
+
function nt(n, e) {
|
|
571
|
+
return e ? w(e) ? n.__parseExpression(e) : e : "div";
|
|
518
572
|
}
|
|
519
|
-
function
|
|
520
|
-
const
|
|
521
|
-
(
|
|
573
|
+
function st(n, e, t) {
|
|
574
|
+
const r = Object.keys(e || {}).reduce(
|
|
575
|
+
(s, o) => {
|
|
522
576
|
let i = e[o];
|
|
523
|
-
return
|
|
577
|
+
return w(i) ? i = t.__parseExpression(i) : T(i) && (i = t.__parseFunction(i)), s[o] = i, s;
|
|
524
578
|
},
|
|
525
579
|
{}
|
|
526
580
|
);
|
|
527
|
-
return
|
|
581
|
+
return r.ref = t.__ref(n, r.ref), r;
|
|
528
582
|
}
|
|
529
|
-
function
|
|
530
|
-
const
|
|
583
|
+
function ot(n, e, t) {
|
|
584
|
+
const r = ["passive", "capture", "once"], s = {
|
|
531
585
|
capture: "Capture",
|
|
532
586
|
once: "Once",
|
|
533
587
|
passive: "OnceCapture"
|
|
534
588
|
};
|
|
535
589
|
return Object.keys(e || {}).reduce(
|
|
536
590
|
(o, i) => {
|
|
537
|
-
const a = e[i],
|
|
538
|
-
return
|
|
591
|
+
const a = e[i], l = ae(a.modifiers), c = l.find((p) => r.includes(p)), d = "on" + we(i) + (c && s[c] || ""), f = t.__parseFunction(a.handler);
|
|
592
|
+
return f && (o[d] = n.withModifiers(f, l)), o;
|
|
539
593
|
},
|
|
540
594
|
{}
|
|
541
595
|
);
|
|
542
596
|
}
|
|
543
|
-
function
|
|
544
|
-
const t = Object.keys(
|
|
545
|
-
return e ? t.map((
|
|
597
|
+
function ae(n = {}, e = !1) {
|
|
598
|
+
const t = Object.keys(n);
|
|
599
|
+
return e ? t.map((r) => "." + r) : t;
|
|
546
600
|
}
|
|
547
|
-
function
|
|
548
|
-
const { children:
|
|
549
|
-
return i ? i(t) :
|
|
550
|
-
|
|
551
|
-
) : Array.isArray(
|
|
601
|
+
function it(n, e, t, r) {
|
|
602
|
+
const { children: s } = e, o = at(e, r), i = r.$slots?.[o.name];
|
|
603
|
+
return i ? i(t) : s ? C(s) ? n.createTextVNode(s) : w(s) ? n.createTextVNode(
|
|
604
|
+
re(r.__parseExpression(s))
|
|
605
|
+
) : Array.isArray(s) ? s.map((a) => M(a, r, n)) : null : null;
|
|
552
606
|
}
|
|
553
|
-
function
|
|
554
|
-
const { props: t } =
|
|
607
|
+
function at(n, e) {
|
|
608
|
+
const { props: t } = n, r = t?.name || "default";
|
|
555
609
|
return {
|
|
556
|
-
name:
|
|
610
|
+
name: w(r) ? e.__parseExpression(r) : r,
|
|
557
611
|
params: []
|
|
558
612
|
};
|
|
559
613
|
}
|
|
560
|
-
function
|
|
561
|
-
return e.__parseExpression(
|
|
614
|
+
function ct(n, e) {
|
|
615
|
+
return e.__parseExpression(n.value) ? {} : {
|
|
562
616
|
display: "none"
|
|
563
617
|
};
|
|
564
618
|
}
|
|
565
|
-
function
|
|
566
|
-
const
|
|
619
|
+
function lt(n, e, t) {
|
|
620
|
+
const r = {
|
|
567
621
|
type: "JSFunction",
|
|
568
622
|
value: e.value?.value ? `(v) => {
|
|
569
623
|
${e.value.value} = v;
|
|
570
624
|
}` : "(v) => {}"
|
|
571
|
-
},
|
|
625
|
+
}, s = t.__parseFunction(r), o = ae(e.modifiers), i = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
572
626
|
return {
|
|
573
627
|
[i]: t.__parseExpression(e.value),
|
|
574
|
-
[`onUpdate:${i}`]: o.length &&
|
|
628
|
+
[`onUpdate:${i}`]: o.length && s ? n.withModifiers(s, o) : s
|
|
575
629
|
};
|
|
576
630
|
}
|
|
577
|
-
function
|
|
631
|
+
function ut(n, e, t, r) {
|
|
578
632
|
if (!e)
|
|
579
633
|
return null;
|
|
580
|
-
if (
|
|
634
|
+
if (C(e))
|
|
581
635
|
return { default: () => e };
|
|
582
|
-
if (
|
|
636
|
+
if (w(e))
|
|
583
637
|
return {
|
|
584
|
-
default: () =>
|
|
638
|
+
default: () => re(t.__parseExpression(e))
|
|
585
639
|
};
|
|
586
640
|
if (Array.isArray(e) && e.length > 0) {
|
|
587
|
-
const
|
|
588
|
-
[`scope_${
|
|
641
|
+
const s = pt(e), o = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
|
|
642
|
+
[`scope_${r.id}`]: i
|
|
589
643
|
} : {};
|
|
590
|
-
return Object.entries(
|
|
591
|
-
const
|
|
592
|
-
return
|
|
593
|
-
(
|
|
644
|
+
return Object.entries(s).reduce((i, [a, { nodes: l, params: c }]) => (i[a] = (d) => {
|
|
645
|
+
const f = c.length ? Se(d ?? {}, c) : o(d);
|
|
646
|
+
return l.map(
|
|
647
|
+
(p) => M(p, t.__clone(f), n)
|
|
594
648
|
);
|
|
595
649
|
}, i), {});
|
|
596
650
|
}
|
|
597
651
|
return null;
|
|
598
652
|
}
|
|
599
|
-
function
|
|
653
|
+
function pt(n) {
|
|
600
654
|
const e = {
|
|
601
655
|
default: {
|
|
602
656
|
params: [],
|
|
603
657
|
nodes: []
|
|
604
658
|
}
|
|
605
659
|
};
|
|
606
|
-
for (const t of
|
|
607
|
-
const
|
|
608
|
-
e[
|
|
660
|
+
for (const t of n) {
|
|
661
|
+
const r = ft(t.slot), s = r.name;
|
|
662
|
+
e[s] ? (e[s].nodes.push(t), e[s].params = e[s].params.concat(r.params)) : e[s] = {
|
|
609
663
|
nodes: [t],
|
|
610
|
-
params:
|
|
664
|
+
params: r.params
|
|
611
665
|
};
|
|
612
666
|
}
|
|
613
667
|
return e;
|
|
614
668
|
}
|
|
615
|
-
function
|
|
616
|
-
return
|
|
669
|
+
function ft(n = "default") {
|
|
670
|
+
return C(n) ? { name: n, params: [] } : { params: [], ...n };
|
|
617
671
|
}
|
|
618
|
-
function
|
|
619
|
-
const { value:
|
|
620
|
-
let a = t.__parseExpression(
|
|
621
|
-
return Number.isInteger(a) && (a = new Array(a).fill(!0).map((
|
|
672
|
+
function dt(n, e, t) {
|
|
673
|
+
const { value: r, iterator: s } = n, { item: o = "item", index: i = "index" } = s || {};
|
|
674
|
+
let a = t.__parseExpression(r) || [];
|
|
675
|
+
return Number.isInteger(a) && (a = new Array(a).fill(!0).map((l, c) => c + 1)), Array.isArray(a) ? a.map((l, c) => e(t.__clone({ [o]: l, [i]: c }))) : (console.warn("[vForRender]:", `${r?.value} is not a Arrary`), []);
|
|
622
676
|
}
|
|
623
|
-
const
|
|
677
|
+
const Q = ee({
|
|
624
678
|
name: "VtjPageContainer",
|
|
625
679
|
async setup() {
|
|
626
|
-
const
|
|
627
|
-
return
|
|
628
|
-
provider:
|
|
629
|
-
component:
|
|
630
|
-
file:
|
|
680
|
+
const n = le(), e = te(), t = e.params.id, r = t ? n.getPage(t) : n.getHomepage(), s = r ? await n.getRenderComponent(r.id) : null;
|
|
681
|
+
return r && Re(r.title || "VTJ"), {
|
|
682
|
+
provider: n,
|
|
683
|
+
component: s,
|
|
684
|
+
file: r,
|
|
631
685
|
query: e.query
|
|
632
686
|
};
|
|
633
687
|
},
|
|
634
688
|
render() {
|
|
635
|
-
return this.component ?
|
|
689
|
+
return this.component ? A(this.component, this.query) : A("div", "页面不存在");
|
|
636
690
|
}
|
|
637
|
-
}),
|
|
691
|
+
}), mt = ee({
|
|
638
692
|
name: "VtjStartupContainer",
|
|
639
693
|
render() {
|
|
640
|
-
return
|
|
694
|
+
return A(Ie);
|
|
641
695
|
}
|
|
642
|
-
}),
|
|
643
|
-
class
|
|
696
|
+
}), ce = Symbol("Provider");
|
|
697
|
+
class ht extends pe {
|
|
644
698
|
mode;
|
|
645
699
|
globals = {};
|
|
646
700
|
modules = {};
|
|
647
|
-
adapter = { request:
|
|
701
|
+
adapter = { request: Ne, jsonp: $e };
|
|
648
702
|
apis = {};
|
|
649
703
|
dependencies = {};
|
|
650
704
|
materials = {};
|
|
@@ -655,100 +709,101 @@ class ut extends ae {
|
|
|
655
709
|
nodeEnv = "development";
|
|
656
710
|
router = null;
|
|
657
711
|
materialPath = "./";
|
|
712
|
+
urlDslCaches = {};
|
|
658
713
|
constructor(e) {
|
|
659
714
|
super();
|
|
660
715
|
const {
|
|
661
716
|
service: t,
|
|
662
|
-
mode:
|
|
663
|
-
dependencies:
|
|
717
|
+
mode: r = _.Raw,
|
|
718
|
+
dependencies: s,
|
|
664
719
|
materials: o,
|
|
665
720
|
project: i = {},
|
|
666
721
|
adapter: a = {},
|
|
667
|
-
globals:
|
|
722
|
+
globals: l = {},
|
|
668
723
|
modules: c = {},
|
|
669
|
-
router:
|
|
670
|
-
materialPath:
|
|
671
|
-
nodeEnv:
|
|
724
|
+
router: d = null,
|
|
725
|
+
materialPath: f = "./",
|
|
726
|
+
nodeEnv: p = "development"
|
|
672
727
|
} = e;
|
|
673
|
-
this.mode =
|
|
728
|
+
this.mode = r, this.modules = c, this.service = t, this.router = d, this.materialPath = f, this.nodeEnv = p, s && (this.dependencies = s), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, a), r !== _.Design && this.load(i);
|
|
674
729
|
}
|
|
675
730
|
async load(e) {
|
|
676
731
|
const t = this.modules[`.vtj/projects/${e.id}.json`];
|
|
677
732
|
if (this.project = t ? await t() : await this.service.init(e), !this.project)
|
|
678
733
|
throw new Error("project is null");
|
|
679
|
-
const { dependencies:
|
|
734
|
+
const { dependencies: r = [], apis: s } = this.project, { dependencies: o, library: i, components: a, materialPath: l } = this, {
|
|
680
735
|
libraryExports: c,
|
|
681
|
-
libraryMap:
|
|
682
|
-
materials:
|
|
683
|
-
materialExports:
|
|
684
|
-
materialMapLibrary:
|
|
685
|
-
} =
|
|
686
|
-
|
|
687
|
-
for (const
|
|
688
|
-
const S = o[
|
|
689
|
-
if (
|
|
690
|
-
i[
|
|
736
|
+
libraryMap: d,
|
|
737
|
+
materials: f,
|
|
738
|
+
materialExports: p,
|
|
739
|
+
materialMapLibrary: y
|
|
740
|
+
} = De(r, l), m = window;
|
|
741
|
+
m.CKEDITOR_VERSION = void 0;
|
|
742
|
+
for (const u of c) {
|
|
743
|
+
const S = o[u], g = m[u];
|
|
744
|
+
if (g)
|
|
745
|
+
i[u] = g;
|
|
691
746
|
else if (S)
|
|
692
|
-
|
|
747
|
+
m[u] = i[u] = await S();
|
|
693
748
|
else {
|
|
694
|
-
const $ =
|
|
749
|
+
const $ = d[u] || [];
|
|
695
750
|
for (const j of $)
|
|
696
|
-
|
|
751
|
+
J(j) && await ke(u, F.append(j, { v: b })), V(j) && await X(F.append(j, { v: b })), i[u] = m[u];
|
|
697
752
|
}
|
|
698
753
|
}
|
|
699
|
-
for (const
|
|
700
|
-
await
|
|
701
|
-
const
|
|
702
|
-
for (const
|
|
703
|
-
const S =
|
|
704
|
-
if (
|
|
705
|
-
S &&
|
|
754
|
+
for (const u of f)
|
|
755
|
+
await X(F.append(u, { v: b }));
|
|
756
|
+
const h = this.materials || {};
|
|
757
|
+
for (const u of p) {
|
|
758
|
+
const S = m[y[u]], g = fe[u];
|
|
759
|
+
if (g)
|
|
760
|
+
S && g.forEach(($) => {
|
|
706
761
|
a[$] = S[$];
|
|
707
762
|
});
|
|
708
763
|
else {
|
|
709
|
-
const $ =
|
|
764
|
+
const $ = h[u] ? (await h[u]()).default : m[u];
|
|
710
765
|
$ && S && ($.components || []).forEach((j) => {
|
|
711
|
-
a[j.name] =
|
|
766
|
+
a[j.name] = Me(j, S);
|
|
712
767
|
});
|
|
713
768
|
}
|
|
714
769
|
}
|
|
715
|
-
|
|
770
|
+
s && (this.apis = qe(s, this.adapter), oe(), this.project.config?.mock && Je(s)), this.initRouter(), this.triggerReady();
|
|
716
771
|
}
|
|
717
772
|
initRouter() {
|
|
718
773
|
const { router: e, project: t } = this;
|
|
719
774
|
e && (e.addRoute({
|
|
720
775
|
path: "/page/:id",
|
|
721
776
|
name: "VtjPage",
|
|
722
|
-
component:
|
|
777
|
+
component: Q
|
|
723
778
|
}), e.addRoute({
|
|
724
779
|
path: "/",
|
|
725
780
|
name: "VtjHomepage",
|
|
726
|
-
component: t?.homepage ?
|
|
781
|
+
component: t?.homepage ? Q : mt
|
|
727
782
|
}));
|
|
728
783
|
}
|
|
729
784
|
install(e) {
|
|
730
785
|
const t = e.config.globalProperties.installed || {};
|
|
731
|
-
for (const [
|
|
732
|
-
!t[
|
|
733
|
-
e.provide(
|
|
786
|
+
for (const [r, s] of Object.entries(this.library))
|
|
787
|
+
!t[r] && Ae(s) && (e.use(s), t[r] = !0);
|
|
788
|
+
e.provide(ce, this), e.config.globalProperties.installed = t;
|
|
734
789
|
}
|
|
735
790
|
getFile(e) {
|
|
736
791
|
const { blocks: t = [] } = this.project || {};
|
|
737
|
-
return this.getPage(e) || t.find((
|
|
792
|
+
return this.getPage(e) || t.find((r) => r.id === e) || null;
|
|
738
793
|
}
|
|
739
794
|
getPage(e) {
|
|
740
|
-
const { pages: t = [] } = this.project || {},
|
|
795
|
+
const { pages: t = [] } = this.project || {}, r = (s, o = []) => {
|
|
741
796
|
for (const i of o) {
|
|
742
|
-
if (i.id ===
|
|
797
|
+
if (i.id === s)
|
|
743
798
|
return i;
|
|
744
799
|
if (i.children && i.children.length) {
|
|
745
|
-
const a = s
|
|
800
|
+
const a = r(s, i.children);
|
|
746
801
|
if (a)
|
|
747
802
|
return a;
|
|
748
803
|
}
|
|
749
804
|
}
|
|
750
805
|
};
|
|
751
|
-
return
|
|
806
|
+
return r(e, t) || null;
|
|
752
807
|
}
|
|
753
808
|
getHomepage() {
|
|
754
809
|
const { homepage: e } = this.project || {};
|
|
@@ -758,83 +813,121 @@ class ut extends ae {
|
|
|
758
813
|
const t = this.modules[`.vtj/files/${e}.json`];
|
|
759
814
|
return t ? await t() : this.service.getFile(e).catch(() => null);
|
|
760
815
|
}
|
|
816
|
+
async getDslByUrl(e) {
|
|
817
|
+
const t = this.urlDslCaches[e];
|
|
818
|
+
return t || (this.urlDslCaches[e] = this.adapter.request.send({
|
|
819
|
+
url: e,
|
|
820
|
+
method: "get",
|
|
821
|
+
settings: {
|
|
822
|
+
validSuccess: !1,
|
|
823
|
+
originResponse: !0
|
|
824
|
+
}
|
|
825
|
+
}).then((r) => r.data).catch(() => null));
|
|
826
|
+
}
|
|
827
|
+
createDslRenderer(e, t = {}) {
|
|
828
|
+
const { library: r, components: s, mode: o, apis: i } = this, a = {
|
|
829
|
+
mode: o,
|
|
830
|
+
Vue: r.Vue,
|
|
831
|
+
components: s,
|
|
832
|
+
libs: r,
|
|
833
|
+
apis: i,
|
|
834
|
+
window,
|
|
835
|
+
...t
|
|
836
|
+
}, l = N({
|
|
837
|
+
getDsl: async (c) => await this.getDsl(c) || null,
|
|
838
|
+
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
|
839
|
+
options: a
|
|
840
|
+
});
|
|
841
|
+
return B({
|
|
842
|
+
...a,
|
|
843
|
+
dsl: e,
|
|
844
|
+
loader: l
|
|
845
|
+
});
|
|
846
|
+
}
|
|
761
847
|
async getRenderComponent(e) {
|
|
762
848
|
const t = this.getFile(e);
|
|
763
849
|
if (!t)
|
|
764
850
|
return O.warn(`Can not find file: ${e}`), null;
|
|
765
|
-
const
|
|
766
|
-
if (
|
|
767
|
-
return (await
|
|
851
|
+
const r = `.vtj/vue/${e}.vue`, s = this.modules[r];
|
|
852
|
+
if (s)
|
|
853
|
+
return (await s())?.default;
|
|
768
854
|
const o = await this.getDsl(t.id);
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}), { renderer: l } = te({
|
|
782
|
-
...f,
|
|
783
|
-
dsl: o,
|
|
784
|
-
loader: p
|
|
855
|
+
return o ? this.createDslRenderer(o).renderer : (O.warn(`Can not find dsl: ${e}`), null);
|
|
856
|
+
}
|
|
857
|
+
defineUrlSchemaComponent(e, t) {
|
|
858
|
+
return Y(async () => {
|
|
859
|
+
const r = await this.getDslByUrl(e);
|
|
860
|
+
return r ? (r.name = t || r.name, this.createDslRenderer(r).renderer) : null;
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
definePluginComponent(e) {
|
|
864
|
+
return Y(async () => {
|
|
865
|
+
const t = await ie(e, window);
|
|
866
|
+
return t ? (se(t.css), t.component) : null;
|
|
785
867
|
});
|
|
786
|
-
return l;
|
|
787
868
|
}
|
|
788
869
|
}
|
|
789
|
-
function
|
|
790
|
-
const e = new
|
|
870
|
+
function Ht(n) {
|
|
871
|
+
const e = new ht(n);
|
|
791
872
|
return {
|
|
792
873
|
provider: e,
|
|
793
|
-
onReady: (
|
|
874
|
+
onReady: (r) => e.ready(r)
|
|
794
875
|
};
|
|
795
876
|
}
|
|
796
|
-
function
|
|
797
|
-
const e =
|
|
877
|
+
function le(n = {}) {
|
|
878
|
+
const e = Pe(ce);
|
|
798
879
|
if (!e)
|
|
799
880
|
throw new Error("Can not find provider");
|
|
800
|
-
if (e.mode ===
|
|
801
|
-
const { id: t, version:
|
|
802
|
-
t &&
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
title:
|
|
881
|
+
if (e.mode === _.Raw && e.nodeEnv === "development") {
|
|
882
|
+
const { id: t, version: r } = n;
|
|
883
|
+
t && r && (async () => {
|
|
884
|
+
const s = await e.getDsl(t);
|
|
885
|
+
s?.__VERSION__ !== r && q.warning({
|
|
886
|
+
title: s?.name,
|
|
806
887
|
message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
|
|
807
888
|
});
|
|
808
889
|
})();
|
|
809
890
|
}
|
|
810
891
|
return e;
|
|
811
892
|
}
|
|
812
|
-
const
|
|
893
|
+
const L = new je({
|
|
813
894
|
settings: {
|
|
814
895
|
type: "json",
|
|
815
896
|
validSuccess: !0,
|
|
816
897
|
originResponse: !1,
|
|
817
898
|
failMessage: !0,
|
|
818
|
-
validate: (
|
|
819
|
-
showError: (
|
|
820
|
-
|
|
821
|
-
message:
|
|
899
|
+
validate: (n) => n.data?.code === 0,
|
|
900
|
+
showError: (n) => {
|
|
901
|
+
q.error({
|
|
902
|
+
message: n || "未知错误"
|
|
822
903
|
});
|
|
823
904
|
}
|
|
824
905
|
}
|
|
825
|
-
}),
|
|
826
|
-
url:
|
|
906
|
+
}), vt = (n = "/vtj/local/repository/${type}.json") => (e, t) => L.send({
|
|
907
|
+
url: n,
|
|
827
908
|
method: "post",
|
|
828
909
|
query: { type: e },
|
|
829
910
|
data: {
|
|
830
911
|
type: e,
|
|
831
912
|
data: t
|
|
832
913
|
}
|
|
833
|
-
})
|
|
834
|
-
|
|
914
|
+
}), yt = (n = "/vtj/local/repository/uploader.json") => async (e, t) => await L.send({
|
|
915
|
+
url: n,
|
|
916
|
+
method: "post",
|
|
917
|
+
data: {
|
|
918
|
+
files: e,
|
|
919
|
+
projectId: t
|
|
920
|
+
},
|
|
921
|
+
settings: {
|
|
922
|
+
type: "data"
|
|
923
|
+
}
|
|
924
|
+
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
|
925
|
+
class K {
|
|
835
926
|
api;
|
|
927
|
+
pluginCaches = {};
|
|
928
|
+
uploader;
|
|
836
929
|
constructor() {
|
|
837
|
-
this.api =
|
|
930
|
+
this.api = vt(), this.uploader = yt();
|
|
838
931
|
}
|
|
839
932
|
async init(e) {
|
|
840
933
|
return console.log("BaseService.init", e), {};
|
|
@@ -889,78 +982,106 @@ class V {
|
|
|
889
982
|
async removeRawPage(e) {
|
|
890
983
|
return await this.api("removeRawPage", e).catch(() => "");
|
|
891
984
|
}
|
|
985
|
+
async uploadStaticFile(e, t) {
|
|
986
|
+
return await this.uploader(e, t).catch(() => null);
|
|
987
|
+
}
|
|
988
|
+
async getStaticFiles(e) {
|
|
989
|
+
return await this.api("getStaticFiles", e).catch(() => []);
|
|
990
|
+
}
|
|
991
|
+
async removeStaticFile(e, t) {
|
|
992
|
+
return await this.api("removeStaticFile", { name: e, projectId: t }).catch(
|
|
993
|
+
() => ""
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
async clearStaticFiles(e) {
|
|
997
|
+
return await this.api("clearStaticFiles", e).catch(() => "");
|
|
998
|
+
}
|
|
999
|
+
async getPluginMaterial(e) {
|
|
1000
|
+
const { urls: t = [] } = e, r = t.filter((o) => Oe(o))[0];
|
|
1001
|
+
if (!r)
|
|
1002
|
+
return null;
|
|
1003
|
+
const s = this.pluginCaches[r];
|
|
1004
|
+
return s || (this.pluginCaches[r] = L.send({
|
|
1005
|
+
url: r,
|
|
1006
|
+
method: "get",
|
|
1007
|
+
settings: {
|
|
1008
|
+
validSuccess: !1,
|
|
1009
|
+
originResponse: !0
|
|
1010
|
+
}
|
|
1011
|
+
}).then((o) => o.data).catch(() => null));
|
|
1012
|
+
}
|
|
892
1013
|
}
|
|
893
|
-
const
|
|
1014
|
+
const v = new Ee({
|
|
894
1015
|
type: "local",
|
|
895
1016
|
expired: 0,
|
|
896
1017
|
prefix: "__VTJ_"
|
|
897
1018
|
});
|
|
898
|
-
class
|
|
1019
|
+
class xt extends K {
|
|
899
1020
|
init(e) {
|
|
900
|
-
const t = new x(e),
|
|
901
|
-
return
|
|
1021
|
+
const t = new x(e), r = v.get(`project_${t.id}`), s = Object.assign(t.toDsl(), r || {});
|
|
1022
|
+
return v.save(`project_${t.id}`, s), Promise.resolve(s);
|
|
902
1023
|
}
|
|
903
1024
|
saveProject(e) {
|
|
904
1025
|
const t = new x(e);
|
|
905
|
-
return
|
|
1026
|
+
return v.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
|
906
1027
|
}
|
|
907
1028
|
saveMaterials(e, t) {
|
|
908
|
-
return
|
|
1029
|
+
return v.save(`materials_${e.id}`, U(t)), Promise.resolve(!0);
|
|
909
1030
|
}
|
|
910
1031
|
saveFile(e) {
|
|
911
|
-
return
|
|
1032
|
+
return v.save(`file_${e.id}`, e), Promise.resolve(!0);
|
|
912
1033
|
}
|
|
913
1034
|
getFile(e) {
|
|
914
|
-
const t =
|
|
1035
|
+
const t = v.get(`file_${e}`);
|
|
915
1036
|
return t ? Promise.resolve(t) : Promise.reject(null);
|
|
916
1037
|
}
|
|
917
1038
|
removeFile(e) {
|
|
918
|
-
return
|
|
1039
|
+
return v.remove(`file_${e}`), Promise.resolve(!0);
|
|
919
1040
|
}
|
|
920
1041
|
saveHistory(e) {
|
|
921
|
-
return
|
|
1042
|
+
return v.save(`history_${e.id}`, e), Promise.resolve(!0);
|
|
922
1043
|
}
|
|
923
1044
|
removeHistory(e) {
|
|
924
|
-
const t =
|
|
1045
|
+
const t = v.get(`history_${e}`);
|
|
925
1046
|
if (t) {
|
|
926
|
-
const
|
|
927
|
-
this.removeHistoryItem(e,
|
|
1047
|
+
const s = (t.items || []).map((o) => o.id);
|
|
1048
|
+
this.removeHistoryItem(e, s), v.remove(`history_${e}`);
|
|
928
1049
|
}
|
|
929
1050
|
return Promise.resolve(!0);
|
|
930
1051
|
}
|
|
931
1052
|
getHistory(e) {
|
|
932
|
-
const t =
|
|
933
|
-
return Promise.resolve(
|
|
1053
|
+
const t = v.get(`history_${e}`), r = new Z(t || { id: e });
|
|
1054
|
+
return Promise.resolve(r.toDsl());
|
|
934
1055
|
}
|
|
935
1056
|
getHistoryItem(e, t) {
|
|
936
|
-
const
|
|
937
|
-
return Promise.resolve(
|
|
1057
|
+
const r = v.get(`history_${e}_${t}`);
|
|
1058
|
+
return Promise.resolve(r);
|
|
938
1059
|
}
|
|
939
1060
|
saveHistoryItem(e, t) {
|
|
940
|
-
return
|
|
1061
|
+
return v.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
|
|
941
1062
|
}
|
|
942
1063
|
removeHistoryItem(e, t) {
|
|
943
|
-
return t.forEach((
|
|
944
|
-
|
|
1064
|
+
return t.forEach((r) => {
|
|
1065
|
+
v.remove(`history_${e}_${r}`);
|
|
945
1066
|
}), Promise.resolve(!0);
|
|
946
1067
|
}
|
|
947
1068
|
}
|
|
948
|
-
class
|
|
1069
|
+
class gt extends K {
|
|
949
1070
|
projects = {};
|
|
950
1071
|
materials = {};
|
|
951
1072
|
files = {};
|
|
952
1073
|
histories = {};
|
|
953
1074
|
historyItems = {};
|
|
954
1075
|
init(e) {
|
|
955
|
-
const t = new x(e),
|
|
956
|
-
return this.projects[
|
|
1076
|
+
const t = new x(e), r = this.projects[t.id] || {}, s = Object.assign(t.toDsl(), r);
|
|
1077
|
+
return this.projects[s.id] = s, Promise.resolve(s);
|
|
957
1078
|
}
|
|
958
1079
|
saveProject(e) {
|
|
959
1080
|
const t = new x(e);
|
|
960
1081
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
|
961
1082
|
}
|
|
962
1083
|
saveMaterials(e, t) {
|
|
963
|
-
return e.id && (this.materials[e.id] =
|
|
1084
|
+
return e.id && (this.materials[e.id] = U(t)), Promise.resolve(!0);
|
|
964
1085
|
}
|
|
965
1086
|
saveFile(e) {
|
|
966
1087
|
return this.files[e.id] = e, Promise.resolve(!0);
|
|
@@ -978,35 +1099,36 @@ class ft extends V {
|
|
|
978
1099
|
removeHistory(e) {
|
|
979
1100
|
const t = this.histories[e];
|
|
980
1101
|
if (t) {
|
|
981
|
-
const
|
|
982
|
-
this.removeHistoryItem(e,
|
|
1102
|
+
const s = (t.items || []).map((o) => o.id);
|
|
1103
|
+
this.removeHistoryItem(e, s), delete this.historyItems[e];
|
|
983
1104
|
}
|
|
984
1105
|
return Promise.resolve(!0);
|
|
985
1106
|
}
|
|
986
1107
|
getHistory(e) {
|
|
987
|
-
const t = this.histories[e],
|
|
988
|
-
return Promise.resolve(
|
|
1108
|
+
const t = this.histories[e], r = new Z(t || { id: e });
|
|
1109
|
+
return Promise.resolve(r);
|
|
989
1110
|
}
|
|
990
1111
|
getHistoryItem(e, t) {
|
|
991
|
-
const
|
|
992
|
-
return Promise.resolve(
|
|
1112
|
+
const r = `${e}_${t}`, s = this.historyItems[r] || {};
|
|
1113
|
+
return Promise.resolve(s);
|
|
993
1114
|
}
|
|
994
1115
|
saveHistoryItem(e, t) {
|
|
995
|
-
const
|
|
996
|
-
return this.historyItems[
|
|
1116
|
+
const r = `${e}_${t.id}`;
|
|
1117
|
+
return this.historyItems[r] = t, Promise.resolve(!0);
|
|
997
1118
|
}
|
|
998
1119
|
removeHistoryItem(e, t) {
|
|
999
|
-
return t.forEach((
|
|
1000
|
-
const
|
|
1001
|
-
delete this.historyItems[
|
|
1120
|
+
return t.forEach((r) => {
|
|
1121
|
+
const s = `${e}_${r}`;
|
|
1122
|
+
delete this.historyItems[s];
|
|
1002
1123
|
}), Promise.resolve(!0);
|
|
1003
1124
|
}
|
|
1004
1125
|
}
|
|
1005
|
-
let
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1126
|
+
let H = null;
|
|
1127
|
+
function Ot() {
|
|
1128
|
+
return H || (H = new gt(), H);
|
|
1008
1129
|
}
|
|
1009
|
-
class
|
|
1130
|
+
class Dt extends K {
|
|
1131
|
+
getFileCaches = {};
|
|
1010
1132
|
async init(e) {
|
|
1011
1133
|
return await this.api("init", e).catch(() => null) || {};
|
|
1012
1134
|
}
|
|
@@ -1016,14 +1138,19 @@ class It extends V {
|
|
|
1016
1138
|
async saveMaterials(e, t) {
|
|
1017
1139
|
return !!await this.api("saveMaterials", {
|
|
1018
1140
|
project: e,
|
|
1019
|
-
materials:
|
|
1141
|
+
materials: U(t)
|
|
1020
1142
|
}).catch(() => !1);
|
|
1021
1143
|
}
|
|
1022
1144
|
async saveFile(e) {
|
|
1023
1145
|
return !!await this.api("saveFile", e).catch(() => !1);
|
|
1024
1146
|
}
|
|
1025
1147
|
async getFile(e) {
|
|
1026
|
-
|
|
1148
|
+
const t = this.getFileCaches[e];
|
|
1149
|
+
return t || (this.getFileCaches[e] = this.api("getFile", e).catch(
|
|
1150
|
+
() => null
|
|
1151
|
+
)).finally(() => {
|
|
1152
|
+
delete this.getFileCaches[e];
|
|
1153
|
+
});
|
|
1027
1154
|
}
|
|
1028
1155
|
async removeFile(e) {
|
|
1029
1156
|
return !!await this.api("removeFile", e).catch(() => !1);
|
|
@@ -1051,85 +1178,89 @@ class It extends V {
|
|
|
1051
1178
|
);
|
|
1052
1179
|
}
|
|
1053
1180
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return
|
|
1056
|
-
const { id: t, title:
|
|
1181
|
+
function ue(n = []) {
|
|
1182
|
+
return n.map((e) => {
|
|
1183
|
+
const { id: t, title: r, icon: s, children: o, hidden: i } = e;
|
|
1057
1184
|
return {
|
|
1058
1185
|
id: t,
|
|
1059
|
-
title:
|
|
1060
|
-
icon:
|
|
1186
|
+
title: r,
|
|
1187
|
+
icon: s,
|
|
1061
1188
|
hidden: i,
|
|
1062
1189
|
url: `/page/${t}`,
|
|
1063
|
-
children: o && o.length ?
|
|
1190
|
+
children: o && o.length ? ue(o) : void 0
|
|
1064
1191
|
};
|
|
1065
1192
|
});
|
|
1066
1193
|
}
|
|
1067
|
-
function
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1070
|
-
const { name: i, params: a, meta:
|
|
1194
|
+
function Mt() {
|
|
1195
|
+
const n = le(), e = te(), t = Fe(!1), r = n.project;
|
|
1196
|
+
Ce(() => {
|
|
1197
|
+
const { name: i, params: a, meta: l } = e;
|
|
1071
1198
|
if (i === "VtjPage") {
|
|
1072
|
-
const c =
|
|
1199
|
+
const c = n.getPage(a.id);
|
|
1073
1200
|
t.value = !c?.mask;
|
|
1074
1201
|
} else if (i === "VtjHomepage") {
|
|
1075
|
-
const c =
|
|
1202
|
+
const c = n.getHomepage();
|
|
1076
1203
|
t.value = !c?.mask;
|
|
1077
1204
|
} else
|
|
1078
|
-
t.value = !
|
|
1205
|
+
t.value = !l.mask;
|
|
1079
1206
|
});
|
|
1080
|
-
const
|
|
1207
|
+
const s = ue(r?.pages), o = r?.config;
|
|
1081
1208
|
return {
|
|
1082
1209
|
disabled: t,
|
|
1083
1210
|
logo: o?.logo,
|
|
1084
1211
|
themeSwitchable: o?.themeSwitchable,
|
|
1085
|
-
title: o?.title ||
|
|
1086
|
-
menus:
|
|
1212
|
+
title: o?.title || r?.description || r?.name || "VTJ App",
|
|
1213
|
+
menus: s
|
|
1087
1214
|
};
|
|
1088
1215
|
}
|
|
1089
1216
|
export {
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1217
|
+
He as BUILT_IN_DIRECTIVES,
|
|
1218
|
+
K as BaseService,
|
|
1219
|
+
z as CONTEXT_HOST,
|
|
1220
|
+
Le as Context,
|
|
1221
|
+
_ as ContextMode,
|
|
1222
|
+
xe as DATA_TYPES,
|
|
1223
|
+
It as JSCodeToString,
|
|
1224
|
+
Ct as LIFE_CYCLES_LIST,
|
|
1225
|
+
Dt as LocalService,
|
|
1226
|
+
gt as MemoryService,
|
|
1227
|
+
ht as Provider,
|
|
1228
|
+
xt as StorageService,
|
|
1229
|
+
b as VTJ_RENDERER_VERSION,
|
|
1230
|
+
ne as adoptedStyleSheets,
|
|
1231
|
+
bt as createAssetScripts,
|
|
1232
|
+
Rt as createAssetsCss,
|
|
1233
|
+
Ge as createDataSources,
|
|
1234
|
+
N as createLoader,
|
|
1235
|
+
Ot as createMemoryService,
|
|
1236
|
+
Ht as createProvider,
|
|
1237
|
+
B as createRenderer,
|
|
1238
|
+
Ue as createSchemaApi,
|
|
1239
|
+
qe as createSchemaApis,
|
|
1240
|
+
et as defaultLoader,
|
|
1241
|
+
I as fillBasePath,
|
|
1242
|
+
ae as getModifiers,
|
|
1243
|
+
ie as getPlugin,
|
|
1244
|
+
Me as getRawComponent,
|
|
1245
|
+
J as isCSSUrl,
|
|
1246
|
+
Be as isJSCode,
|
|
1247
|
+
w as isJSExpression,
|
|
1248
|
+
T as isJSFunction,
|
|
1249
|
+
Oe as isJSON,
|
|
1250
|
+
V as isJSUrl,
|
|
1251
|
+
Ae as isVuePlugin,
|
|
1252
|
+
ke as loadCss,
|
|
1253
|
+
se as loadCssUrl,
|
|
1254
|
+
Te as loadScriptUrl,
|
|
1255
|
+
Ve as mockApi,
|
|
1256
|
+
Je as mockApis,
|
|
1257
|
+
oe as mockCleanup,
|
|
1258
|
+
M as nodeRender,
|
|
1259
|
+
De as parseDeps,
|
|
1129
1260
|
R as parseExpression,
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1261
|
+
G as parseFunction,
|
|
1262
|
+
ce as providerKey,
|
|
1263
|
+
re as toString,
|
|
1264
|
+
Mt as useMask,
|
|
1265
|
+
le as useProvider
|
|
1135
1266
|
};
|