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