@vtj/renderer 0.7.9 → 0.7.11

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.9
13
+ * @version 0.7.11
14
14
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
15
15
  */
16
- const F = "0.7.9";
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.11";
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,30 @@ 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
+ let r = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "@vtj/pro/#/";
629
+ location.href = r;
687
630
  };
688
- return (s, n) => (_e(), ye("div", vt, [
689
- E("div", gt, [
690
- E("div", _t, [
691
- E("span", yt, k(e.name), 1)
631
+ return (r, n) => (ve(), _e("div", ct, [
632
+ E("div", lt, [
633
+ E("div", ut, [
634
+ E("span", pt, B(e.name), 1)
692
635
  ]),
693
- E("div", wt, k(e.tagline), 1),
694
- E("div", St, [
695
- we(K(Fe), {
636
+ E("div", ft, B(e.tagline), 1),
637
+ E("div", mt, [
638
+ ye(U(Ee), {
696
639
  type: "primary",
697
640
  size: "large",
698
641
  round: "",
699
- icon: K(He),
642
+ icon: U(Fe),
700
643
  onClick: t
701
644
  }, {
702
- default: Se(() => [
703
- $e(k(e.actionText), 1)
645
+ default: ge(() => [
646
+ we(B(e.actionText), 1)
704
647
  ]),
705
648
  _: 1
706
649
  }, 8, ["icon"])
@@ -708,17 +651,17 @@ const X = L({
708
651
  ])
709
652
  ]));
710
653
  }
711
- }), jt = L({
654
+ }), ht = A({
712
655
  name: "VtjStartupContainer",
713
656
  render() {
714
- return D($t);
657
+ return D(dt);
715
658
  }
716
- }), ie = Symbol("Provider");
717
- class Pt extends le {
659
+ }), ne = Symbol("Provider");
660
+ class vt extends ae {
718
661
  mode;
719
662
  globals = {};
720
663
  modules = {};
721
- adapter = { request: Je, jsonp: he };
664
+ adapter = { request: Te, jsonp: me };
722
665
  apis = {};
723
666
  dependencies = {};
724
667
  materials = {};
@@ -732,7 +675,7 @@ class Pt extends le {
732
675
  super();
733
676
  const {
734
677
  service: t,
735
- mode: s = y.Raw,
678
+ mode: r = g.Raw,
736
679
  dependencies: n,
737
680
  materials: o,
738
681
  project: i = {},
@@ -742,19 +685,19 @@ class Pt extends le {
742
685
  router: m = null,
743
686
  materialPath: f = "./"
744
687
  } = 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);
688
+ 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
689
  }
747
690
  async load(e) {
748
691
  const t = this.modules[`.vtj/projects/${e.id}.json`];
749
692
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
750
693
  throw new Error("project is null");
751
- const { dependencies: s = [], apis: n } = this.project, { dependencies: o, library: i, components: a, materialPath: l } = this, {
694
+ const { dependencies: r = [], apis: n } = this.project, { dependencies: o, library: i, components: a, materialPath: l } = this, {
752
695
  libraryExports: c,
753
696
  libraryMap: m,
754
697
  materials: f,
755
698
  materialExports: u,
756
699
  materialMapLibrary: h
757
- } = Ce(s, l);
700
+ } = Re(r, l);
758
701
  for (const p of c) {
759
702
  const w = o[p], S = window[p];
760
703
  if (S)
@@ -762,57 +705,57 @@ class Pt extends le {
762
705
  else if (w)
763
706
  window[p] = i[p] = await w();
764
707
  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];
708
+ const _ = m[p] || [];
709
+ for (const H of _)
710
+ G(H) && await Ce(p, b.append(H, { v: F })), Q(H) && await q(b.append(H, { v: F })), i[p] = window[p];
768
711
  }
769
712
  }
770
713
  for (const p of f)
771
- await z(b.append(p, { v: F }));
714
+ await q(b.append(p, { v: F }));
772
715
  const v = this.materials || {};
773
716
  for (const p of u) {
774
717
  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);
718
+ w && S && w.components.forEach((_) => {
719
+ a[_.name] = Ie(_, S);
777
720
  });
778
721
  }
779
- n && (this.apis = Ue(n, this.adapter)), this.initRouter(), this.triggerReady();
722
+ n && (this.apis = Be(n, this.adapter)), this.initRouter(), this.triggerReady();
780
723
  }
781
724
  initRouter() {
782
725
  const { router: e, project: t } = this;
783
726
  e && (e.addRoute({
784
727
  path: "/page/:id",
785
728
  name: "VtjPage",
786
- component: X
729
+ component: W
787
730
  }), e.addRoute({
788
731
  path: "/",
789
732
  name: "VtjHomepage",
790
- component: t?.homepage ? X : jt
733
+ component: t?.homepage ? W : ht
791
734
  }));
792
735
  }
793
736
  install(e) {
794
737
  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;
738
+ for (const [r, n] of Object.entries(this.library))
739
+ !t[r] && Oe(n) && (e.use(n), t[r] = !0);
740
+ e.provide(ne, this), e.config.globalProperties.installed = t;
798
741
  }
799
742
  getFile(e) {
800
743
  const { blocks: t = [] } = this.project || {};
801
- return this.getPage(e) || t.find((s) => s.id === e) || null;
744
+ return this.getPage(e) || t.find((r) => r.id === e) || null;
802
745
  }
803
746
  getPage(e) {
804
- const { pages: t = [] } = this.project || {}, s = (n, o = []) => {
747
+ const { pages: t = [] } = this.project || {}, r = (n, o = []) => {
805
748
  for (const i of o) {
806
749
  if (i.id === n)
807
750
  return i;
808
751
  if (i.children && i.children.length) {
809
- const a = s(n, i.children);
752
+ const a = r(n, i.children);
810
753
  if (a)
811
754
  return a;
812
755
  }
813
756
  }
814
757
  };
815
- return s(e, t) || null;
758
+ return r(e, t) || null;
816
759
  }
817
760
  getHomepage() {
818
761
  const { homepage: e } = this.project || {};
@@ -825,13 +768,13 @@ class Pt extends le {
825
768
  async getRenderComponent(e) {
826
769
  const t = this.getFile(e);
827
770
  if (!t)
828
- return O.warn(`Can not find file: ${e}`), null;
829
- const s = `.vtj/vue/${e}.vue`, n = this.modules[s];
771
+ return C.warn(`Can not find file: ${e}`), null;
772
+ const r = `.vtj/vue/${e}.vue`, n = this.modules[r];
830
773
  if (n)
831
774
  return (await n())?.default;
832
775
  const o = await this.getDsl(t.id);
833
776
  if (!o)
834
- return O.warn(`Can not find dsl: ${e}`), null;
777
+ return C.warn(`Can not find dsl: ${e}`), null;
835
778
  const { library: i, components: a, mode: l, apis: c } = this, m = {
836
779
  mode: l,
837
780
  Vue: i.Vue,
@@ -839,10 +782,10 @@ class Pt extends le {
839
782
  libs: i,
840
783
  apis: c,
841
784
  window
842
- }, f = ne({
785
+ }, f = re({
843
786
  getDsl: async (h) => await this.getDsl(h) || null,
844
787
  options: m
845
- }), { renderer: u } = se({
788
+ }), { renderer: u } = te({
846
789
  ...m,
847
790
  dsl: o,
848
791
  loader: f
@@ -850,22 +793,22 @@ class Pt extends le {
850
793
  return u;
851
794
  }
852
795
  }
853
- function Dt(r) {
854
- const e = new Pt(r);
796
+ function It(s) {
797
+ const e = new vt(s);
855
798
  return {
856
799
  provider: e,
857
- onReady: (s) => e.ready(s)
800
+ onReady: (r) => e.ready(r)
858
801
  };
859
802
  }
860
- function ae(r = {}) {
861
- const e = je(ie);
803
+ function oe(s = {}) {
804
+ const e = Se(ne);
862
805
  if (!e)
863
806
  throw new Error("Can not find provider");
864
- if (e.mode === y.Raw) {
865
- const { id: t, version: s } = r;
866
- t && s && (async () => {
807
+ if (e.mode === g.Raw) {
808
+ const { id: t, version: r } = s;
809
+ t && r && (async () => {
867
810
  const n = await e.getDsl(t);
868
- n?.__VERSION__ !== s && J.warning({
811
+ n?.__VERSION__ !== r && V.warning({
869
812
  title: n?.name,
870
813
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
871
814
  });
@@ -873,21 +816,21 @@ function ae(r = {}) {
873
816
  }
874
817
  return e;
875
818
  }
876
- const Et = new ve({
819
+ const _t = new de({
877
820
  settings: {
878
821
  type: "json",
879
822
  validSuccess: !0,
880
823
  originResponse: !1,
881
824
  failMessage: !0,
882
- validate: (r) => r.data?.code === 0,
883
- showError: (r) => {
884
- J.error({
885
- message: r || "未知错误"
825
+ validate: (s) => s.data?.code === 0,
826
+ showError: (s) => {
827
+ V.error({
828
+ message: s || "未知错误"
886
829
  });
887
830
  }
888
831
  }
889
- }), bt = (r = "/vtj/local/repository/${type}.json") => (e, t) => Et.send({
890
- url: r,
832
+ }), yt = (s = "/vtj/local/repository/${type}.json") => (e, t) => _t.send({
833
+ url: s,
891
834
  method: "post",
892
835
  query: { type: e },
893
836
  data: {
@@ -895,10 +838,10 @@ const Et = new ve({
895
838
  data: t
896
839
  }
897
840
  });
898
- class q {
841
+ class J {
899
842
  api;
900
843
  constructor() {
901
- this.api = bt();
844
+ this.api = yt();
902
845
  }
903
846
  async init(e) {
904
847
  return console.log("BaseService.init", e), {};
@@ -954,14 +897,14 @@ class q {
954
897
  return await this.api("removeRawPage", e).catch(() => "");
955
898
  }
956
899
  }
957
- const d = new ge({
900
+ const d = new he({
958
901
  type: "local",
959
902
  expired: 0,
960
903
  prefix: "__VTJ_"
961
904
  });
962
- class At extends q {
905
+ class Ct extends J {
963
906
  init(e) {
964
- const t = new I(e), s = d.get(`project_${t.id}`), n = Object.assign(t.toDsl(), s || {});
907
+ const t = new I(e), r = d.get(`project_${t.id}`), n = Object.assign(t.toDsl(), r || {});
965
908
  return d.save(`project_${t.id}`, n), Promise.resolve(n);
966
909
  }
967
910
  saveProject(e) {
@@ -969,7 +912,7 @@ class At extends q {
969
912
  return d.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
970
913
  }
971
914
  saveMaterials(e, t) {
972
- return d.save(`materials_${e.id}`, V(t)), Promise.resolve(!0);
915
+ return d.save(`materials_${e.id}`, N(t)), Promise.resolve(!0);
973
916
  }
974
917
  saveFile(e) {
975
918
  return d.save(`file_${e.id}`, e), Promise.resolve(!0);
@@ -993,30 +936,30 @@ class At extends q {
993
936
  return Promise.resolve(!0);
994
937
  }
995
938
  getHistory(e) {
996
- const t = d.get(`history_${e}`), s = new G(t || { id: e });
997
- return Promise.resolve(s.toDsl());
939
+ const t = d.get(`history_${e}`), r = new Y(t || { id: e });
940
+ return Promise.resolve(r.toDsl());
998
941
  }
999
942
  getHistoryItem(e, t) {
1000
- const s = d.get(`history_${e}_${t}`);
1001
- return Promise.resolve(s);
943
+ const r = d.get(`history_${e}_${t}`);
944
+ return Promise.resolve(r);
1002
945
  }
1003
946
  saveHistoryItem(e, t) {
1004
947
  return d.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1005
948
  }
1006
949
  removeHistoryItem(e, t) {
1007
- return t.forEach((s) => {
1008
- d.remove(`history_${e}_${s}`);
950
+ return t.forEach((r) => {
951
+ d.remove(`history_${e}_${r}`);
1009
952
  }), Promise.resolve(!0);
1010
953
  }
1011
954
  }
1012
- class Ft extends q {
955
+ class gt extends J {
1013
956
  projects = {};
1014
957
  materials = {};
1015
958
  files = {};
1016
959
  histories = {};
1017
960
  historyItems = {};
1018
961
  init(e) {
1019
- const t = new I(e), s = this.projects[t.id] || {}, n = Object.assign(t.toDsl(), s);
962
+ const t = new I(e), r = this.projects[t.id] || {}, n = Object.assign(t.toDsl(), r);
1020
963
  return this.projects[n.id] = n, Promise.resolve(n);
1021
964
  }
1022
965
  saveProject(e) {
@@ -1024,7 +967,7 @@ class Ft extends q {
1024
967
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1025
968
  }
1026
969
  saveMaterials(e, t) {
1027
- return e.id && (this.materials[e.id] = V(t)), Promise.resolve(!0);
970
+ return e.id && (this.materials[e.id] = N(t)), Promise.resolve(!0);
1028
971
  }
1029
972
  saveFile(e) {
1030
973
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1048,29 +991,29 @@ class Ft extends q {
1048
991
  return Promise.resolve(!0);
1049
992
  }
1050
993
  getHistory(e) {
1051
- const t = this.histories[e], s = new G(t || { id: e });
1052
- return Promise.resolve(s);
994
+ const t = this.histories[e], r = new Y(t || { id: e });
995
+ return Promise.resolve(r);
1053
996
  }
1054
997
  getHistoryItem(e, t) {
1055
- const s = `${e}_${t}`, n = this.historyItems[s] || {};
998
+ const r = `${e}_${t}`, n = this.historyItems[r] || {};
1056
999
  return Promise.resolve(n);
1057
1000
  }
1058
1001
  saveHistoryItem(e, t) {
1059
- const s = `${e}_${t.id}`;
1060
- return this.historyItems[s] = t, Promise.resolve(!0);
1002
+ const r = `${e}_${t.id}`;
1003
+ return this.historyItems[r] = t, Promise.resolve(!0);
1061
1004
  }
1062
1005
  removeHistoryItem(e, t) {
1063
- return t.forEach((s) => {
1064
- const n = `${e}_${s}`;
1006
+ return t.forEach((r) => {
1007
+ const n = `${e}_${r}`;
1065
1008
  delete this.historyItems[n];
1066
1009
  }), Promise.resolve(!0);
1067
1010
  }
1068
1011
  }
1069
1012
  let R = null;
1070
- function Vt() {
1071
- return R || (R = new Ft(), R);
1013
+ function Ot() {
1014
+ return R || (R = new gt(), R);
1072
1015
  }
1073
- class Lt extends q {
1016
+ class Mt extends J {
1074
1017
  async init(e) {
1075
1018
  return await this.api("init", e).catch(() => null) || {};
1076
1019
  }
@@ -1080,7 +1023,7 @@ class Lt extends q {
1080
1023
  async saveMaterials(e, t) {
1081
1024
  return !!await this.api("saveMaterials", {
1082
1025
  project: e,
1083
- materials: V(t)
1026
+ materials: N(t)
1084
1027
  }).catch(() => !1);
1085
1028
  }
1086
1029
  async saveFile(e) {
@@ -1115,83 +1058,80 @@ class Lt extends q {
1115
1058
  );
1116
1059
  }
1117
1060
  }
1118
- function ce(r = []) {
1119
- return r.map((e) => {
1120
- const { id: t, title: s, icon: n, children: o, hidden: i } = e;
1061
+ function ie(s = []) {
1062
+ return s.map((e) => {
1063
+ const { id: t, title: r, icon: n, children: o, hidden: i } = e;
1121
1064
  return {
1122
1065
  id: t,
1123
- title: s,
1066
+ title: r,
1124
1067
  icon: n,
1125
1068
  hidden: i,
1126
1069
  url: `/page/${t}`,
1127
- children: o && o.length ? ce(o) : void 0
1070
+ children: o && o.length ? ie(o) : void 0
1128
1071
  };
1129
1072
  });
1130
1073
  }
1131
- function Jt() {
1132
- const r = ae(), e = Q(), t = Pe(!1), s = r.project;
1133
- Ee(() => {
1074
+ function Tt() {
1075
+ const s = oe(), e = X(), t = $e(!1), r = s.project;
1076
+ je(() => {
1134
1077
  const { name: o, params: i, meta: a } = e;
1135
1078
  if (o === "VtjPage") {
1136
- const l = r.getPage(i.id);
1079
+ const l = s.getPage(i.id);
1137
1080
  t.value = !l?.mask;
1138
1081
  } else if (o === "VtjHomepage") {
1139
- const l = r.getHomepage();
1082
+ const l = s.getHomepage();
1140
1083
  t.value = !l?.mask;
1141
1084
  } else
1142
1085
  t.value = !a.mask;
1143
1086
  });
1144
- const n = ce(s?.pages);
1087
+ const n = ie(r?.pages);
1145
1088
  return {
1146
1089
  disabled: t,
1147
- title: s?.description || s?.name || "VTJ App",
1090
+ title: r?.description || r?.name || "VTJ App",
1148
1091
  menus: n
1149
1092
  };
1150
1093
  }
1151
1094
  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,
1095
+ He as BUILDIN_DIRECTIVES,
1096
+ J as BaseService,
1097
+ K as CONTEXT_HOST,
1098
+ De as Context,
1099
+ g as ContextMode,
1100
+ xe as DATA_TYPES,
1101
+ Rt as JSCodeToString,
1102
+ Ft as LIFE_CYCLES_LIST,
1103
+ Mt as LocalService,
1104
+ gt as MemoryService,
1105
+ vt as Provider,
1106
+ Ct as StorageService,
1165
1107
  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
1108
+ ee as adoptedStyleSheets,
1109
+ Ht as createAssetScripts,
1110
+ xt as createAssetsCss,
1111
+ qe as createDataSources,
1112
+ re as createLoader,
1113
+ Ot as createMemoryService,
1114
+ It as createProvider,
1115
+ te as createRenderer,
1116
+ ke as createSchemaApi,
1117
+ Be as createSchemaApis,
1118
+ ze as defaultLoader,
1119
+ x as fillBasePath,
1120
+ se as getModifiers,
1121
+ Ie as getRawComponent,
1122
+ G as isCSSUrl,
1123
+ Me as isJSCode,
1124
+ y as isJSExpression,
1125
+ k as isJSFunction,
1126
+ Q as isJSUrl,
1127
+ Oe as isVuePlugin,
1128
+ Ce as loadCss,
1129
+ M as nodeRender,
1130
+ Re as parseDeps,
1131
+ O as parseExpression,
1132
+ z as parseFunction,
1133
+ ne as providerKey,
1134
+ Z as toString,
1135
+ Tt as useMask,
1136
+ oe as useProvider
1197
1137
  };