@vtj/renderer 0.7.10 → 0.7.12

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