@vtj/renderer 0.8.3 → 0.8.5

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