@vtj/renderer 0.8.25 → 0.8.27

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