@vtj/renderer 0.9.0-alpha.8 → 0.9.0

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,19 +1,19 @@
1
- import { Base as xe, BUILT_IN_COMPONENTS as Re, ProjectModel as A, HistoryModel as ce } from "@vtj/core";
2
- import { isUrl as ke, url as x, dedupArray as Ce, isString as j, isFunction as ee, logger as I, createRequest as Fe, merge as Ae, pathToRegexp as Ie, pathToRegexpMatch as Oe, formDataToJson as De, storage as B, cookie as U, toArray as te, unRSA as se, delay as le, camelCase as $, upperFirst as Me, pick as Te, jsonp as He, loadScript as ne, Request as Be, Storage as Ue, mapToObject as z } from "@vtj/utils";
3
- import * as M from "vue";
4
- import { inject as ue, toRef as Ne, readonly as Le, customRef as qe, ref as O, onBeforeUnmount as Je, getCurrentScope as Ve, onScopeDispose as ze, unref as Ke, getCurrentInstance as de, watch as pe, computed as fe, onMounted as We, defineComponent as K, h as q, openBlock as Ge, createElementBlock as Ye, createElementVNode as b, toDisplayString as N, defineAsyncComponent as re, watchEffect as Qe } from "vue";
5
- import { ElNotification as T, ElLoading as Xe } from "element-plus";
6
- import { useRoute as he } from "vue-router";
1
+ import { Base as xe, BUILT_IN_COMPONENTS as ke, ProjectModel as T, HistoryModel as ue } from "@vtj/core";
2
+ import { isUrl as Ce, url as P, dedupArray as Fe, isString as S, isFunction as z, logger as D, createRequest as Ae, merge as Ie, pathToRegexp as Oe, pathToRegexpMatch as Me, formDataToJson as Te, storage as L, cookie as q, toArray as ne, unRSA as re, delay as de, camelCase as $, upperFirst as De, pick as He, jsonp as Be, loadScript as oe, Request as Ne, Storage as Ue, mapToObject as Y } from "@vtj/utils";
3
+ import * as B from "vue";
4
+ import { inject as pe, toRef as Le, readonly as qe, customRef as Je, ref as C, onBeforeUnmount as Ve, getCurrentScope as ze, onScopeDispose as Ke, unref as We, getCurrentInstance as fe, watch as he, computed as me, onMounted as Ge, defineComponent as Q, h as K, openBlock as Ye, createElementBlock as Qe, createElementVNode as b, toDisplayString as J, defineAsyncComponent as ie, watchEffect as Xe } from "vue";
5
+ import { ElNotification as N, ElLoading as Ze } from "element-plus";
6
+ import { useRoute as ge } from "vue-router";
7
7
  /**!
8
8
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
9
9
  * @name @vtj/renderer
10
10
  * @author CHC chenhuachun1549@dingtalk.com
11
- * @version 0.9.0-alpha.8
11
+ * @version 0.9.0
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const R = "0.9.0-alpha.8";
14
+ const x = "0.9.0";
15
15
  var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
16
- const oe = [
16
+ const ae = [
17
17
  "$el",
18
18
  "$emit",
19
19
  "$nextTick",
@@ -25,7 +25,7 @@ const oe = [
25
25
  "$props",
26
26
  "$options",
27
27
  "$forceUpdate"
28
- ], _s = [
28
+ ], ws = [
29
29
  "beforeCreate",
30
30
  "created",
31
31
  "beforeMount",
@@ -39,7 +39,7 @@ const oe = [
39
39
  "renderTriggered",
40
40
  "activated",
41
41
  "deactivated"
42
- ], Ze = ["vIf", "vShow", "vModel", "vFor", "vBind"], et = {
42
+ ], et = ["vIf", "vShow", "vModel", "vFor", "vBind"], tt = {
43
43
  String,
44
44
  Number,
45
45
  Boolean,
@@ -47,65 +47,65 @@ const oe = [
47
47
  Object,
48
48
  Function,
49
49
  Date
50
- }, W = "VtjPage", me = "VtjHomepage";
51
- function C(n, e) {
52
- return n.map((t) => ke(t) || t.startsWith("/") ? t : `${e}${t}`);
50
+ }, k = "VtjPage", M = "VtjHomepage";
51
+ function I(n, e) {
52
+ return n.map((t) => Ce(t) || t.startsWith("/") ? t : `${e}${t}`);
53
53
  }
54
- function G(n) {
54
+ function X(n) {
55
55
  return /\.css$/.test(n);
56
56
  }
57
- function Y(n) {
57
+ function Z(n) {
58
58
  return /\.js$/.test(n);
59
59
  }
60
- function tt(n) {
60
+ function st(n) {
61
61
  return /\.json$/.test(n);
62
62
  }
63
- function ws(n) {
63
+ function Ss(n) {
64
64
  return n.map(
65
- (e) => `<script src="${x.append(e, { v: R })}"><\/script>`
65
+ (e) => `<script src="${P.append(e, { v: x })}"><\/script>`
66
66
  ).join("");
67
67
  }
68
- function Ss(n = []) {
68
+ function js(n = []) {
69
69
  return n.map(
70
- (e) => `<link rel="stylesheet" href="${x.append(e, { v: R })}" />`
70
+ (e) => `<link rel="stylesheet" href="${P.append(e, { v: x })}" />`
71
71
  ).join("");
72
72
  }
73
- function st(n, e = !1) {
73
+ function nt(n, e = !1) {
74
74
  return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
75
75
  }
76
- function nt(n, e, t = !1) {
77
- const s = n.filter((u) => !!u.enabled), r = [], o = [], a = [], i = [], c = {}, l = {}, f = [], d = {};
76
+ function rt(n, e, t = !1) {
77
+ const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], u = {};
78
78
  return s.forEach(
79
- ({ urls: u, assetsUrl: m, library: p, assetsLibrary: h, localeLibrary: w }) => {
80
- u?.forEach((g) => {
81
- Y(g) && r.push(st(g, t)), G(g) && o.push(g);
82
- }), p && (i.push(p), c[p] = C(u || [], e), w && (l[p] = w)), m && a.push(m), h && f.push(h), p && h && (d[h] = p);
79
+ ({ urls: p, assetsUrl: d, library: h, assetsLibrary: m, localeLibrary: v }) => {
80
+ p?.forEach((g) => {
81
+ Z(g) && r.push(nt(g, t)), X(g) && o.push(g);
82
+ }), h && (i.push(h), l[h] = I(p || [], e), v && (c[h] = v)), d && a.push(d), m && f.push(m), h && m && (u[m] = h);
83
83
  }
84
84
  ), {
85
- scripts: C(r, e),
86
- css: C(o, e),
87
- materials: C(a, e),
85
+ scripts: I(r, e),
86
+ css: I(o, e),
87
+ materials: I(a, e),
88
88
  libraryExports: i,
89
- materialExports: Ce(f),
90
- materialMapLibrary: d,
91
- libraryMap: c,
92
- libraryLocaleMap: l
89
+ materialExports: Fe(f),
90
+ materialMapLibrary: u,
91
+ libraryMap: l,
92
+ libraryLocaleMap: c
93
93
  };
94
94
  }
95
- function rt(n, e) {
95
+ function ot(n, e) {
96
96
  const { name: t, parent: s, alias: r } = n;
97
97
  return s ? e[s]?.[r || t] : e[r || t];
98
98
  }
99
- function ge(n) {
100
- return j(n) ? n : JSON.stringify(n);
99
+ function ve(n) {
100
+ return S(n) ? n : JSON.stringify(n);
101
101
  }
102
- function ve(n, e, t) {
102
+ function ye(n, e, t) {
103
103
  const s = n.CSSStyleSheet;
104
104
  if (s.prototype.replaceSync) {
105
105
  const r = new s();
106
106
  r.id = e, r.replaceSync(t);
107
107
  const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
108
- (c) => c.id !== e
108
+ (l) => l.id !== e
109
109
  );
110
110
  o.adoptedStyleSheets = [...i, r];
111
111
  } else {
@@ -114,11 +114,11 @@ function ve(n, e, t) {
114
114
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
115
115
  }
116
116
  }
117
- async function ot(n, e) {
117
+ async function it(n, e) {
118
118
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
119
- t && ve(window, n, t);
119
+ t && ye(window, n, t);
120
120
  }
121
- function it(n, e = window) {
121
+ function at(n, e = window) {
122
122
  const t = e.document, s = e.document.head;
123
123
  for (const r of n)
124
124
  if (!t.getElementById(r)) {
@@ -126,40 +126,40 @@ function it(n, e = window) {
126
126
  a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
127
127
  }
128
128
  }
129
- async function at(n, e, t = window) {
129
+ async function ct(n, e, t = window) {
130
130
  const s = t.document, r = t.document.head;
131
131
  let o = t[e];
132
132
  return o ? o.default || o : new Promise((a, i) => {
133
- for (const c of n) {
134
- const l = s.createElement("script");
135
- l.src = c, l.onload = () => {
133
+ for (const l of n) {
134
+ const c = s.createElement("script");
135
+ c.src = l, c.onload = () => {
136
136
  o = t[e], o ? a(o.default || o) : i(null);
137
- }, l.onerror = (f) => {
137
+ }, c.onerror = (f) => {
138
138
  i(f);
139
- }, r.appendChild(l);
139
+ }, r.appendChild(c);
140
140
  }
141
141
  });
142
142
  }
143
- function ct(n) {
144
- return ee(n) || ee(n?.install);
143
+ function lt(n) {
144
+ return z(n) || z(n?.install);
145
145
  }
146
- function k(n, e, t = !1, s = !1) {
146
+ function F(n, e, t = !1, s = !1) {
147
147
  try {
148
148
  const r = ['"use strict";', "var __self = arguments[0];"];
149
149
  r.push("return ");
150
150
  let o = (n.value || "").trim();
151
- o = o.replace(/this(\W|$)/g, (i, c) => `__self${c}`), o = r.join(`
151
+ o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = r.join(`
152
152
  `) + o;
153
153
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
154
154
  return new Function("$scope", a)(e);
155
155
  } catch (r) {
156
- if (I.error("parseExpression.error", r, n, e?.__self ?? e), s)
156
+ if (D.error("parseExpression.error", r, n, e?.__self ?? e), s)
157
157
  throw r;
158
158
  }
159
159
  }
160
- function ie(n, e, t = !1, s = !1) {
161
- const r = k(n, e, t, s);
162
- if (typeof r != "function" && (I.error(
160
+ function ce(n, e, t = !1, s = !1) {
161
+ const r = F(n, e, t, s);
162
+ if (typeof r != "function" && (D.error(
163
163
  "parseFunction.error",
164
164
  "not a function",
165
165
  n,
@@ -168,20 +168,20 @@ function ie(n, e, t = !1, s = !1) {
168
168
  throw new Error(`"${n.value}" not a function`);
169
169
  return r;
170
170
  }
171
- function S(n) {
171
+ function w(n) {
172
172
  return n && n.type === "JSExpression";
173
173
  }
174
- function H(n) {
174
+ function U(n) {
175
175
  return typeof n == "object" && n && n.type === "JSFunction";
176
176
  }
177
- function lt(n) {
178
- return S(n) || H(n);
177
+ function ut(n) {
178
+ return w(n) || U(n);
179
179
  }
180
- function js(n) {
181
- return lt(n) ? n.value : JSON.stringify(n);
180
+ function $s(n) {
181
+ return ut(n) ? n.value : JSON.stringify(n);
182
182
  }
183
183
  let E = null;
184
- const ut = Fe({
184
+ const dt = Ae({
185
185
  settings: {
186
186
  type: "form",
187
187
  validSuccess: !0,
@@ -190,12 +190,12 @@ const ut = Fe({
190
190
  validate: (n) => n.data?.code === 0 || !!n.data?.success,
191
191
  failMessage: !0,
192
192
  showError: (n) => {
193
- T.error({
193
+ N.error({
194
194
  message: n || "未知错误"
195
195
  });
196
196
  },
197
197
  showLoading: () => {
198
- E && E.close(), E = Xe.service({
198
+ E && E.close(), E = Ze.service({
199
199
  lock: !0,
200
200
  text: "Loading",
201
201
  background: "rgba(0, 0, 0, 0.05)"
@@ -206,8 +206,8 @@ const ut = Fe({
206
206
  }
207
207
  }
208
208
  });
209
- let P;
210
- function dt(n, e) {
209
+ let R;
210
+ function pt(n, e) {
211
211
  const { jsonp: t, request: s } = e;
212
212
  if (n.method === "jsonp")
213
213
  return (r = {}) => t(n.url, {
@@ -215,7 +215,7 @@ function dt(n, e) {
215
215
  query: r
216
216
  });
217
217
  {
218
- const r = n.headers ? k(n.headers, {}, !0) : void 0, o = {
218
+ const r = n.headers ? F(n.headers, {}, !0) : void 0, o = {
219
219
  url: n.url,
220
220
  method: n.method,
221
221
  settings: {
@@ -223,10 +223,10 @@ function dt(n, e) {
223
223
  headers: r
224
224
  }
225
225
  };
226
- return (a, i) => (delete o.data, s.send(Ae(o, i || {}, { data: a })));
226
+ return (a, i) => (delete o.data, s.send(Ie(o, i || {}, { data: a })));
227
227
  }
228
228
  }
229
- function pt(n, e) {
229
+ function ft(n, e) {
230
230
  const { metaQuery: t } = e;
231
231
  if (!t) return;
232
232
  const { code: s, queryCode: r } = n;
@@ -238,89 +238,90 @@ function pt(n, e) {
238
238
  return t(s, r, o, a);
239
239
  };
240
240
  }
241
- function ft(n = [], e = [], t) {
241
+ function ht(n = [], e = [], t) {
242
242
  const s = {};
243
243
  for (const r of n)
244
- s[r.id] = dt(r, t);
245
- for (const r of e)
246
244
  s[r.id] = pt(r, t);
245
+ for (const r of e)
246
+ s[r.id] = ft(r, t);
247
247
  return s;
248
248
  }
249
- async function ht(n = []) {
250
- P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
249
+ async function mt(n = []) {
250
+ R = await import("mockjs").then((e) => e.default || e), R && (R.setup({
251
251
  timeout: "50-500"
252
- }), ye(), n.forEach((e) => mt(P, e)));
252
+ }), _e(), n.forEach((e) => gt(R, e)));
253
253
  }
254
- function mt(n, e) {
254
+ function gt(n, e) {
255
255
  if (!e.mock) return;
256
256
  const { url: t, mockTemplate: s } = e;
257
257
  if (t && s) {
258
- const r = Ie(`${t}(.*)`), o = Oe(t, { decode: decodeURIComponent }), a = k(s, {}, !0);
258
+ const r = Oe(`${t}(.*)`), o = Me(t, { decode: decodeURIComponent }), a = F(s, {}, !0);
259
259
  n.mock(r, (i) => {
260
- const c = x.parse(i.url) || {}, l = i.body instanceof FormData ? De(i.body) : i.body, f = o(i.url)?.params;
261
- return Object.assign(i, { data: l, params: c, query: f }), n.mock(a(i));
260
+ const l = P.parse(i.url) || {}, c = i.body instanceof FormData ? Te(i.body) : i.body, f = o(i.url)?.params;
261
+ return Object.assign(i, { data: c, params: l, query: f }), n.mock(a(i));
262
262
  });
263
263
  }
264
264
  }
265
- function ye() {
266
- P && (P._mocked = {});
265
+ function _e() {
266
+ R && (R._mocked = {});
267
267
  }
268
- const gt = {
268
+ const vt = {
269
269
  session: !1,
270
270
  authKey: "Authorization",
271
271
  storageKey: "ACCESS_STORAGE",
272
272
  storagePrefix: "__VTJ_",
273
- unauthorized: "/unauthorized",
273
+ unauthorized: void 0,
274
274
  auth: "/#/login",
275
275
  redirectParam: "r",
276
276
  unauthorizedCode: 401,
277
277
  unauthorizedMessage: "登录已经失效,请重新登录!",
278
- noPermissionMessage: "无权限访问该页面"
279
- }, _e = Symbol("access");
280
- class $s {
278
+ noPermissionMessage: "无权限访问该页面",
279
+ appName: ""
280
+ }, we = Symbol("access");
281
+ class bs {
281
282
  options;
282
283
  data = null;
283
284
  mode = _.Raw;
284
285
  constructor(e) {
285
- this.options = Object.assign({}, gt, e), this.loadData();
286
+ this.options = Object.assign({}, vt, e), this.loadData();
286
287
  }
287
288
  connect(e) {
288
289
  const { mode: t, router: s, request: r } = e;
289
- this.mode = t, s && t === _.Raw && this.setGuard(s), r && this.setRequest(r);
290
+ this.mode = t, s && this.mode === _.Raw && this.setGuard(s), r && this.setRequest(r);
290
291
  }
291
292
  login(e) {
292
293
  const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
293
- this.setData(e), this.data && (B.save(t, e, {
294
+ this.setData(e), this.data && (L.save(t, e, {
294
295
  type: "local",
295
296
  prefix: s
296
- }), r && U.set(o, this.data.token));
297
+ }), r && q.set(o, this.data.token));
297
298
  }
298
299
  clear() {
299
300
  const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
300
- this.data = null, B.remove(e, {
301
+ this.data = null, L.remove(e, {
301
302
  type: "local",
302
303
  prefix: t
303
- }), s && U.remove(r);
304
+ }), s && q.remove(r);
304
305
  }
305
306
  logout() {
306
307
  this.clear(), this.toLogin();
307
308
  }
308
309
  getData() {
309
- return this.data;
310
+ return this.data ? this.data : (this.loadData(), this.data);
310
311
  }
311
312
  getToken() {
312
- return this.data?.token;
313
+ return this.data || this.loadData(), this.data?.token;
313
314
  }
314
315
  can(e) {
315
- const { permissions: t = {} } = this.data || {};
316
- return typeof e == "function" ? e(t) : te(e).every((r) => t[r]);
316
+ const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
317
+ return typeof e == "function" ? e(s) : ne(e).every((o) => s[o] || s[t + "." + o]);
317
318
  }
318
319
  some(e) {
319
- const { permissions: t = {} } = this.data || {};
320
- return te(e).some((r) => t[r]);
320
+ const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
321
+ return ne(e).some((o) => s[o] || s[t + "." + o]);
321
322
  }
322
323
  install(e) {
323
- e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(_e, this);
324
+ e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(we, this);
324
325
  }
325
326
  isAuthPath(e) {
326
327
  const { auth: t, isAuth: s } = this.options;
@@ -334,20 +335,20 @@ class $s {
334
335
  }
335
336
  toLogin() {
336
337
  const { auth: e, redirectParam: t } = this.options;
337
- if (!e || this.mode !== _.Raw) return;
338
+ if (!e) return;
338
339
  const s = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
339
340
  typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
340
341
  }
341
342
  setData(e) {
342
343
  const { privateKey: t } = this.options;
343
344
  if (Array.isArray(e) && t) {
344
- const s = e.map((r) => se(r, t));
345
+ const s = e.map((r) => re(r, t));
345
346
  this.data = JSON.parse(s.join(""));
346
347
  return;
347
348
  }
348
349
  if (typeof e == "string")
349
350
  try {
350
- const s = t ? se(e, t) : e;
351
+ const s = t ? re(e, t) : e;
351
352
  s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
352
353
  } catch (s) {
353
354
  console.warn(s);
@@ -356,18 +357,18 @@ class $s {
356
357
  this.data = e;
357
358
  }
358
359
  loadData() {
359
- const { storageKey: e, storagePrefix: t } = this.options, s = B.get(e, {
360
+ const { storageKey: e, storagePrefix: t } = this.options, s = L.get(e, {
360
361
  type: "local",
361
362
  prefix: t
362
363
  });
363
- this.setData(s);
364
+ this.setData(s || null);
364
365
  }
365
366
  isLogined() {
366
367
  const { session: e, authKey: t } = this.options;
367
- return e && t ? !!U.get(t) : !!this.data;
368
+ return e && t ? !!q.get(t) : !!this.getToken();
368
369
  }
369
370
  hasRoutePermission(e) {
370
- if (e.name === W) {
371
+ if (e.name === k) {
371
372
  const t = e.params.id;
372
373
  return t && this.can(t);
373
374
  }
@@ -376,15 +377,15 @@ class $s {
376
377
  setGuard(e) {
377
378
  e.beforeEach((t, s, r) => this.guard(t, r));
378
379
  }
379
- guard(e, t) {
380
+ async guard(e, t) {
380
381
  if (this.isWhiteList(e) || this.isAuthPath(e))
381
382
  return t();
382
383
  if (this.isLogined()) {
383
384
  if (this.hasRoutePermission(e))
384
385
  return t();
385
386
  {
386
- const s = this.options.noPermissionMessage || "无权限访问";
387
- return this.showTip(s), t(!1);
387
+ const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
388
+ return await this.showTip(s), z(r) ? (r(), t(!1)) : S(r) ? t(r) : t(!1);
388
389
  }
389
390
  }
390
391
  t(!1), this.toLogin();
@@ -403,10 +404,10 @@ class $s {
403
404
  }
404
405
  async showTip(e) {
405
406
  const { alert: t } = this.options;
406
- t && (await le(150), await t(e, {
407
+ return t ? (await de(150), await t(e, {
407
408
  title: "提示",
408
409
  type: "warning"
409
- }).catch((s) => s));
410
+ }).catch(() => !1)) : !1;
410
411
  }
411
412
  setRequest(e) {
412
413
  e.useRequest((t) => (this.data?.token && (t.headers[this.options.authKey] = this.data?.token), t)), e.useResponse(
@@ -418,10 +419,10 @@ class $s {
418
419
  );
419
420
  }
420
421
  }
421
- function vt() {
422
- return ue(_e, null);
422
+ function yt() {
423
+ return pe(we, null);
423
424
  }
424
- class yt {
425
+ class _t {
425
426
  __id = null;
426
427
  __mode;
427
428
  __instance = null;
@@ -450,7 +451,7 @@ class yt {
450
451
  const { mode: t, dsl: s, attrs: r } = e;
451
452
  this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
452
453
  }
453
- setup(e, t = M) {
454
+ setup(e, t = B) {
454
455
  const s = t.getCurrentInstance();
455
456
  if (!s) return;
456
457
  this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
@@ -464,12 +465,12 @@ class yt {
464
465
  });
465
466
  }
466
467
  __proxy() {
467
- this.__instance && oe.forEach((e) => {
468
+ this.__instance && ae.forEach((e) => {
468
469
  this[e] = this.__instance?.[e];
469
470
  });
470
471
  }
471
472
  __cleanup() {
472
- oe.forEach((e) => {
473
+ ae.forEach((e) => {
473
474
  this[e] = null;
474
475
  });
475
476
  }
@@ -477,22 +478,22 @@ class yt {
477
478
  if (e)
478
479
  if (this.__mode === _.Runtime) {
479
480
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
480
- return ie({ type: s, value: r }, this);
481
+ return ce({ type: s, value: r }, this);
481
482
  } else
482
- return ie(e, this);
483
+ return ce(e, this);
483
484
  }
484
485
  __parseExpression(e) {
485
486
  if (e)
486
487
  if (this.__mode === _.Runtime) {
487
488
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
488
- return k({ type: s, value: r }, this);
489
+ return F({ type: s, value: r }, this);
489
490
  } else
490
- return k(e, this);
491
+ return F(e, this);
491
492
  }
492
493
  __ref(e = null, t) {
493
494
  if (this.__mode !== _.VNode)
494
495
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
495
- await le(0);
496
+ await de(0);
496
497
  let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
497
498
  if (!r) {
498
499
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
@@ -519,72 +520,72 @@ class yt {
519
520
  return s.context.__proto__ = this.context, s.__proto__ = this, s;
520
521
  }
521
522
  }
522
- function J(n) {
523
+ function W(n) {
523
524
  const {
524
- Vue: e = M,
525
+ Vue: e = B,
525
526
  mode: t = _.Runtime,
526
527
  components: s = {},
527
528
  libs: r = {},
528
529
  apis: o = {},
529
530
  loader: a
530
- } = n, i = e.computed(() => n.dsl), c = {
531
+ } = n, i = e.computed(() => n.dsl), l = {
531
532
  $components: s,
532
533
  $libs: r,
533
534
  $apis: o
534
- }, l = new yt({
535
+ }, c = new _t({
535
536
  mode: t,
536
537
  dsl: i.value,
537
- attrs: c
538
+ attrs: l
538
539
  }), f = e.defineComponent({
539
540
  name: i.value.name,
540
541
  props: {
541
- ...wt(i.value.props ?? [], l)
542
+ ...St(i.value.props ?? [], c)
542
543
  },
543
- setup(d) {
544
- l.$props = d, l.props = d, i.value.id && ve(
544
+ setup(u) {
545
+ c.$props = u, c.props = u, i.value.id && ye(
545
546
  n.window || window,
546
547
  i.value.id,
547
548
  i.value.css || ""
548
- ), l.state = St(e, i.value.state ?? {}, l);
549
- const u = jt(e, i.value.computed ?? {}, l), m = $t(i.value.methods ?? {}, l), p = bt(e, i.value.inject, l), h = Et(
549
+ ), c.state = jt(e, i.value.state ?? {}, c);
550
+ const p = $t(e, i.value.computed ?? {}, c), d = bt(i.value.methods ?? {}, c), h = Et(e, i.value.inject, c), m = Rt(
550
551
  i.value.dataSources || {},
551
- l
552
- ), w = {
552
+ c
553
+ ), v = {
554
+ ...h,
553
555
  ...p,
554
- ...u,
555
- ...m,
556
- ...h
556
+ ...d,
557
+ ...m
557
558
  };
558
- return l.setup(w, e), Pt(e, i.value.watch ?? [], l), {
559
- vtj: l
559
+ return c.setup(v, e), Pt(e, i.value.watch ?? [], c), {
560
+ vtj: c
560
561
  };
561
562
  },
562
- emits: _t(i.value.emits),
563
+ emits: wt(i.value.emits),
563
564
  expose: ["vtj"],
564
565
  render() {
565
566
  if (!i.value.nodes) return null;
566
- const d = i.value.nodes || [];
567
- return d.length === 1 ? D(d[0], l, e, a) : d.map((u) => D(u, l, e, a));
567
+ const u = i.value.nodes || [];
568
+ return u.length === 1 ? H(u[0], c, e, a) : u.map((p) => H(p, c, e, a));
568
569
  },
569
- ...xt(i.value.lifeCycles ?? {}, l)
570
+ ...xt(i.value.lifeCycles ?? {}, c)
570
571
  });
571
572
  return {
572
573
  renderer: e.markRaw(f),
573
- context: l
574
+ context: c
574
575
  };
575
576
  }
576
- function _t(n = []) {
577
- return n.map((e) => j(e) ? e : e.name);
577
+ function wt(n = []) {
578
+ return n.map((e) => S(e) ? e : e.name);
578
579
  }
579
- function wt(n = [], e) {
580
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => et[o]) : void 0;
581
- return n.map((s) => j(s) ? {
580
+ function St(n = [], e) {
581
+ const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => tt[o]) : void 0;
582
+ return n.map((s) => S(s) ? {
582
583
  name: s
583
584
  } : {
584
585
  name: s.name,
585
586
  type: s.type,
586
587
  required: s.required,
587
- default: S(s.default) ? e.__parseExpression(s.default) : s.default
588
+ default: w(s.default) ? e.__parseExpression(s.default) : s.default
588
589
  }).reduce(
589
590
  (s, r) => (s[r.name] = {
590
591
  type: t(r.type),
@@ -594,47 +595,47 @@ function wt(n = [], e) {
594
595
  {}
595
596
  );
596
597
  }
597
- function St(n, e, t) {
598
+ function jt(n, e, t) {
598
599
  return n.reactive(
599
600
  Object.keys(e || {}).reduce(
600
601
  (s, r) => {
601
602
  let o = e[r];
602
- return S(o) ? o = t.__parseExpression(o) : H(o) && (o = t.__parseFunction(o)), s[r] = o, s;
603
+ return w(o) ? o = t.__parseExpression(o) : U(o) && (o = t.__parseFunction(o)), s[r] = o, s;
603
604
  },
604
605
  {}
605
606
  )
606
607
  );
607
608
  }
608
- function jt(n, e, t) {
609
+ function $t(n, e, t) {
609
610
  return Object.entries(e ?? {}).reduce(
610
611
  (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
611
612
  {}
612
613
  );
613
614
  }
614
- function $t(n, e) {
615
+ function bt(n, e) {
615
616
  return Object.entries(n ?? {}).reduce(
616
617
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
617
618
  {}
618
619
  );
619
620
  }
620
- function bt(n, e = [], t) {
621
+ function Et(n, e = [], t) {
621
622
  return e.reduce(
622
623
  (s, r) => {
623
624
  const { name: o, from: a } = r || {};
624
625
  r.default;
625
- const i = S(a) ? t.__parseExpression(a) || o : a ?? o, c = S(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
626
- return s[o] = n.inject(i, c), s;
626
+ const i = w(a) ? t.__parseExpression(a) || o : a ?? o, l = w(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
627
+ return s[o] = n.inject(i, l), s;
627
628
  },
628
629
  {}
629
630
  );
630
631
  }
631
- function Et(n, e) {
632
+ function Rt(n, e) {
632
633
  return Object.keys(n).reduce(
633
634
  (t, s) => {
634
- const r = n[s], o = e.$apis[r.ref], a = H(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
635
+ const r = n[s], o = e.$apis[r.ref], a = U(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
635
636
  return t[s] = async (...i) => {
636
- const c = await o.apply(e, i);
637
- return a ? a(c) : c;
637
+ const l = await o.apply(e, i);
638
+ return a ? a(l) : l;
638
639
  }, t;
639
640
  },
640
641
  {}
@@ -658,78 +659,78 @@ function xt(n, e) {
658
659
  {}
659
660
  );
660
661
  }
661
- let L = [];
662
- const Rt = (n) => n;
663
- async function we(n, e = window) {
664
- const { urls: t = [], library: s } = n, r = t.filter((i) => Y(i));
662
+ let V = [];
663
+ const kt = (n) => n;
664
+ async function Se(n, e = window) {
665
+ const { urls: t = [], library: s } = n, r = t.filter((i) => Z(i));
665
666
  if (r.length === 0 || !s) return null;
666
- const o = t.filter((i) => G(i));
667
- return o.length && it(o, e), await at(r, s, e).catch(
667
+ const o = t.filter((i) => X(i));
668
+ return o.length && at(o, e), await ct(r, s, e).catch(
668
669
  (i) => (console.warn("loadScriptUrl error", r, s, i), null)
669
670
  );
670
671
  }
671
- function V(n) {
672
+ function G(n) {
672
673
  const { getDsl: e, getDslByUrl: t, options: s } = n;
673
- return s.window && (L.forEach((r) => {
674
+ return s.window && (V.forEach((r) => {
674
675
  delete s.window[r];
675
- }), L = []), (r, o, a = M) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
676
+ }), V = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
676
677
  const i = await e(o.id);
677
- return i && (i.name = r), i ? J({
678
+ return i && (i.name = r), i ? W({
678
679
  ...s,
679
680
  Vue: a,
680
681
  dsl: i,
681
682
  mode: _.Runtime,
682
- loader: V(n)
683
+ loader: G(n)
683
684
  }).renderer : null;
684
685
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
685
686
  const i = await t(o.url);
686
- return i && (i.name = r), i ? J({
687
+ return i && (i.name = r), i ? W({
687
688
  ...s,
688
689
  Vue: a,
689
690
  dsl: i,
690
691
  mode: _.Runtime,
691
- loader: V(n)
692
+ loader: G(n)
692
693
  }).renderer : null;
693
- }) : o.type === "Plugin" ? (o.library && L.push(o.library), a.defineAsyncComponent(async () => {
694
- const i = await we(o, s.window);
694
+ }) : o.type === "Plugin" ? (o.library && V.push(o.library), a.defineAsyncComponent(async () => {
695
+ const i = await Se(o, s.window);
695
696
  return i || (console.warn("getPlugin result is null", o), null);
696
697
  })) : r;
697
698
  }
698
- function D(n, e, t = M, s = Rt) {
699
+ function H(n, e, t = B, s = kt) {
699
700
  if (!n || !n.name || n.invisible) return null;
700
- const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: c, vModels: l, vBind: f } = kt(o);
701
- if (a && !Ct(a, e))
701
+ const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = n, { vIf: i, vFor: l, vShow: c, vModels: f, vBind: u } = Ct(a);
702
+ if (i && !Ft(i, e))
702
703
  return null;
703
- const d = (u) => {
704
- const m = u.$components, p = (() => {
704
+ const p = (d) => {
705
+ const h = d.$components, m = (() => {
705
706
  if (n.name === "component")
706
- return Ft(u, n.props?.is);
707
+ return At(d, n.props?.is);
707
708
  if (n.name === "slot") return n.name;
708
- const v = s(n.name, n.from, t);
709
- return j(v) ? m[v] ?? v : v;
710
- })(), h = At(r, n.props ?? {}, u), w = It(t, n.events ?? {}, u);
709
+ const j = s(n.name, n.from, t);
710
+ return S(j) ? h[j] ?? r?.app?.component(j) ?? j : j;
711
+ })(), v = It(o, n.props ?? {}, d), g = Ot(t, n.events ?? {}, d);
711
712
  if (n.name === "slot")
712
- return Ot(t, n, h, u, s);
713
- f && Object.assign(h, u.__parseExpression(f.value)), c && (h.style = Object.assign(
714
- h.style ?? {},
715
- Mt(c, u)
716
- )), l.forEach((v) => {
717
- Object.assign(h, Tt(t, v, u));
713
+ return Mt(t, n, v, d, s);
714
+ u && Object.assign(v, d.__parseExpression(u.value)), c && (v.style = Object.assign(
715
+ v.style ?? {},
716
+ Dt(c, d)
717
+ )), f.forEach((j) => {
718
+ Object.assign(v, Ht(t, j, d));
718
719
  });
719
- const g = Ht(
720
+ const A = Bt(
720
721
  t,
721
722
  n.children ?? [],
722
- u,
723
+ d,
723
724
  s,
724
725
  n
725
726
  );
726
- return t.createVNode(p, { ...h, ...w }, g);
727
+ return t.createVNode(m, { ...v, ...g }, A);
727
728
  };
728
- return i ? Nt(i, d, e) : d(e);
729
+ return l ? Lt(l, p, e) : p(e);
729
730
  }
730
- function kt(n = []) {
731
+ function Ct(n = []) {
731
732
  const e = n.find((i) => $(i.name) === "vIf"), t = n.find((i) => $(i.name) === "vFor"), s = n.find((i) => $(i.name) === "vShow"), r = n.find((i) => $(i.name) === "vBind"), o = n.filter((i) => $(i.name) === "vModel"), a = n.filter(
732
- (i) => !Ze.includes($(i.name))
733
+ (i) => !et.includes($(i.name))
733
734
  );
734
735
  return {
735
736
  vIf: e,
@@ -740,23 +741,23 @@ function kt(n = []) {
740
741
  others: a
741
742
  };
742
743
  }
743
- function Ct(n, e) {
744
+ function Ft(n, e) {
744
745
  return !!e.__parseExpression(n.value);
745
746
  }
746
- function Ft(n, e) {
747
- return e ? S(e) ? n.__parseExpression(e) : e : "div";
747
+ function At(n, e) {
748
+ return e ? w(e) ? n.__parseExpression(e) : e : "div";
748
749
  }
749
- function At(n, e, t) {
750
+ function It(n, e, t) {
750
751
  const s = Object.keys(e || {}).reduce(
751
752
  (r, o) => {
752
753
  let a = e[o];
753
- return S(a) ? a = t.__parseExpression(a) : H(a) && (a = t.__parseFunction(a)), r[o] = a, r;
754
+ return w(a) ? a = t.__parseExpression(a) : U(a) && (a = t.__parseFunction(a)), r[o] = a, r;
754
755
  },
755
756
  {}
756
757
  );
757
758
  return s.ref = t.__ref(n, s.ref), s;
758
759
  }
759
- function It(n, e, t) {
760
+ function Ot(n, e, t) {
760
761
  const s = ["passive", "capture", "once"], r = {
761
762
  capture: "Capture",
762
763
  once: "Once",
@@ -764,70 +765,70 @@ function It(n, e, t) {
764
765
  };
765
766
  return Object.keys(e || {}).reduce(
766
767
  (o, a) => {
767
- const i = e[a], c = Se(i.modifiers), l = c.find((u) => s.includes(u)), f = "on" + Me(a) + (l && r[l] || ""), d = t.__parseFunction(i.handler);
768
- return d && (o[f] = n.withModifiers(d, c)), o;
768
+ const i = e[a], l = je(i.modifiers), c = l.find((p) => s.includes(p)), f = "on" + De(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
769
+ return u && (o[f] = n.withModifiers(u, l)), o;
769
770
  },
770
771
  {}
771
772
  );
772
773
  }
773
- function Se(n = {}, e = !1) {
774
+ function je(n = {}, e = !1) {
774
775
  const t = Object.keys(n);
775
776
  return e ? t.map((s) => "." + s) : t;
776
777
  }
777
- function Ot(n, e, t, s, r) {
778
- const { children: o } = e, a = Dt(e, s), i = s.$slots?.[a.name];
779
- return i ? i(t) : o ? j(o) ? n.createTextVNode(o) : S(o) ? n.createTextVNode(
780
- ge(s.__parseExpression(o))
778
+ function Mt(n, e, t, s, r) {
779
+ const { children: o } = e, a = Tt(e, s), i = s.$slots?.[a.name];
780
+ return i ? i(t) : o ? S(o) ? n.createTextVNode(o) : w(o) ? n.createTextVNode(
781
+ ve(s.__parseExpression(o))
781
782
  ) : Array.isArray(o) ? o.map(
782
- (c) => D(c, s, n, r)
783
+ (l) => H(l, s, n, r)
783
784
  ) : null : null;
784
785
  }
785
- function Dt(n, e) {
786
+ function Tt(n, e) {
786
787
  const { props: t } = n, s = t?.name || "default";
787
788
  return {
788
- name: S(s) ? e.__parseExpression(s) : s,
789
+ name: w(s) ? e.__parseExpression(s) : s,
789
790
  params: []
790
791
  };
791
792
  }
792
- function Mt(n, e) {
793
+ function Dt(n, e) {
793
794
  return e.__parseExpression(n.value) ? {} : {
794
795
  display: "none"
795
796
  };
796
797
  }
797
- function Tt(n, e, t) {
798
+ function Ht(n, e, t) {
798
799
  const s = {
799
800
  type: "JSFunction",
800
801
  value: e.value?.value ? `(v) => {
801
802
  ${e.value.value} = v;
802
803
  }` : "(v) => {}"
803
- }, r = t.__parseFunction(s), o = Se(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
804
+ }, r = t.__parseFunction(s), o = je(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
804
805
  return {
805
806
  [a]: t.__parseExpression(e.value),
806
807
  [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
807
808
  };
808
809
  }
809
- function Ht(n, e, t, s, r) {
810
+ function Bt(n, e, t, s, r) {
810
811
  if (!e) return null;
811
- if (j(e))
812
- return { default: () => e };
813
812
  if (S(e))
813
+ return { default: () => e };
814
+ if (w(e))
814
815
  return {
815
- default: () => ge(t.__parseExpression(e))
816
+ default: () => ve(t.__parseExpression(e))
816
817
  };
817
818
  if (Array.isArray(e) && e.length > 0) {
818
- const o = Bt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
819
+ const o = Nt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
819
820
  [`scope_${r.id}`]: i
820
821
  } : {};
821
- return Object.entries(o).reduce((i, [c, { nodes: l, params: f }]) => (i[c] = (d) => {
822
- const u = f.length ? Te(d ?? {}, f) : a(d);
823
- return l.map(
824
- (m) => D(m, t.__clone(u), n, s)
822
+ return Object.entries(o).reduce((i, [l, { nodes: c, params: f }]) => (i[l] = (u) => {
823
+ const p = f.length ? He(u ?? {}, f) : a(u);
824
+ return c.map(
825
+ (d) => H(d, t.__clone(p), n, s)
825
826
  );
826
827
  }, i), {});
827
828
  }
828
829
  return null;
829
830
  }
830
- function Bt(n) {
831
+ function Nt(n) {
831
832
  const e = {
832
833
  default: {
833
834
  params: [],
@@ -844,142 +845,148 @@ function Bt(n) {
844
845
  return e;
845
846
  }
846
847
  function Ut(n = "default") {
847
- return j(n) ? { name: n, params: [] } : { params: [], ...n };
848
+ return S(n) ? { name: n, params: [] } : { params: [], ...n };
848
849
  }
849
- function Nt(n, e, t) {
850
+ function Lt(n, e, t) {
850
851
  const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
851
852
  let i = t.__parseExpression(s) || [];
852
- return Number.isInteger(i) && (i = new Array(i).fill(!0).map((c, l) => l + 1)), Array.isArray(i) ? i.map((c, l) => e(t.__clone({ [o]: c, [a]: l }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
853
+ 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]:", `${s?.value} is not a Arrary`), []);
853
854
  }
854
- function Lt(n) {
855
- return Ve() ? (ze(n), !0) : !1;
855
+ function qt(n) {
856
+ return ze() ? (Ke(n), !0) : !1;
856
857
  }
857
- function Q(n) {
858
- return typeof n == "function" ? n() : Ke(n);
858
+ function ee(n) {
859
+ return typeof n == "function" ? n() : We(n);
859
860
  }
860
- const je = typeof window < "u" && typeof document < "u";
861
+ const $e = typeof window < "u" && typeof document < "u";
861
862
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
862
- const qt = (n) => n != null, Jt = () => {
863
+ const Jt = (n) => n != null, Vt = () => {
863
864
  };
864
- function Vt(n) {
865
- return de();
865
+ function zt(n) {
866
+ return fe();
866
867
  }
867
- function zt(...n) {
868
+ function Kt(...n) {
868
869
  if (n.length !== 1)
869
- return Ne(...n);
870
+ return Le(...n);
870
871
  const e = n[0];
871
- return typeof e == "function" ? Le(qe(() => ({ get: e, set: Jt }))) : O(e);
872
+ return typeof e == "function" ? qe(Je(() => ({ get: e, set: Vt }))) : C(e);
872
873
  }
873
- function Kt(n, e) {
874
- Vt() && Je(n, e);
874
+ function Wt(n, e) {
875
+ zt() && Ve(n, e);
875
876
  }
876
- const Wt = je ? window : void 0, Gt = je ? window.document : void 0;
877
- function Yt(n) {
877
+ const Gt = $e ? window : void 0, Yt = $e ? window.document : void 0;
878
+ function Qt(n) {
878
879
  var e;
879
- const t = Q(n);
880
+ const t = ee(n);
880
881
  return (e = t?.$el) != null ? e : t;
881
882
  }
882
- function Qt() {
883
- const n = O(!1), e = de();
884
- return e && We(() => {
883
+ function Xt() {
884
+ const n = C(!1), e = fe();
885
+ return e && Ge(() => {
885
886
  n.value = !0;
886
887
  }, e), n;
887
888
  }
888
- function Xt(n) {
889
- const e = Qt();
890
- return fe(() => (e.value, !!n()));
889
+ function Zt(n) {
890
+ const e = Xt();
891
+ return me(() => (e.value, !!n()));
891
892
  }
892
- function Zt(n, e, t = {}) {
893
- const { window: s = Wt, ...r } = t;
893
+ function es(n, e, t = {}) {
894
+ const { window: s = Gt, ...r } = t;
894
895
  let o;
895
- const a = Xt(() => s && "MutationObserver" in s), i = () => {
896
+ const a = Zt(() => s && "MutationObserver" in s), i = () => {
896
897
  o && (o.disconnect(), o = void 0);
897
- }, c = fe(() => {
898
- const u = Q(n), m = (Array.isArray(u) ? u : [u]).map(Yt).filter(qt);
899
- return new Set(m);
900
- }), l = pe(
901
- () => c.value,
902
- (u) => {
903
- i(), a.value && u.size && (o = new MutationObserver(e), u.forEach((m) => o.observe(m, r)));
898
+ }, l = me(() => {
899
+ const p = ee(n), d = (Array.isArray(p) ? p : [p]).map(Qt).filter(Jt);
900
+ return new Set(d);
901
+ }), c = he(
902
+ () => l.value,
903
+ (p) => {
904
+ i(), a.value && p.size && (o = new MutationObserver(e), p.forEach((d) => o.observe(d, r)));
904
905
  },
905
906
  { immediate: !0, flush: "post" }
906
- ), f = () => o?.takeRecords(), d = () => {
907
- l(), i();
907
+ ), f = () => o?.takeRecords(), u = () => {
908
+ c(), i();
908
909
  };
909
- return Lt(d), {
910
+ return qt(u), {
910
911
  isSupported: a,
911
- stop: d,
912
+ stop: u,
912
913
  takeRecords: f
913
914
  };
914
915
  }
915
- function es(n = null, e = {}) {
916
+ function ts(n = null, e = {}) {
916
917
  var t, s, r;
917
918
  const {
918
- document: o = Gt,
919
- restoreOnUnmount: a = (d) => d
920
- } = e, i = (t = o?.title) != null ? t : "", c = zt((s = n ?? o?.title) != null ? s : null), l = n && typeof n == "function";
921
- function f(d) {
919
+ document: o = Yt,
920
+ restoreOnUnmount: a = (u) => u
921
+ } = e, i = (t = o?.title) != null ? t : "", l = Kt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
922
+ function f(u) {
922
923
  if (!("titleTemplate" in e))
923
- return d;
924
- const u = e.titleTemplate || "%s";
925
- return typeof u == "function" ? u(d) : Q(u).replace(/%s/g, d);
926
- }
927
- return pe(
928
- c,
929
- (d, u) => {
930
- d !== u && o && (o.title = f(typeof d == "string" ? d : ""));
924
+ return u;
925
+ const p = e.titleTemplate || "%s";
926
+ return typeof p == "function" ? p(u) : ee(p).replace(/%s/g, u);
927
+ }
928
+ return he(
929
+ l,
930
+ (u, p) => {
931
+ u !== p && o && (o.title = f(typeof u == "string" ? u : ""));
931
932
  },
932
933
  { immediate: !0 }
933
- ), e.observe && !e.titleTemplate && o && !l && Zt(
934
+ ), e.observe && !e.titleTemplate && o && !c && es(
934
935
  (r = o.head) == null ? void 0 : r.querySelector("title"),
935
936
  () => {
936
- o && o.title !== c.value && (c.value = f(o.title));
937
+ o && o.title !== l.value && (l.value = f(o.title));
937
938
  },
938
939
  { childList: !0 }
939
- ), Kt(() => {
940
+ ), Wt(() => {
940
941
  if (a) {
941
- const d = a(i, c.value || "");
942
- d != null && o && (o.title = d);
942
+ const u = a(i, l.value || "");
943
+ u != null && o && (o.title = u);
943
944
  }
944
- }), c;
945
+ }), l;
945
946
  }
946
- const ae = K({
947
+ const le = Q({
947
948
  name: "VtjPageContainer",
948
949
  async setup() {
949
- const n = be(), e = he(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null;
950
- return s && (Object.assign(e.meta, s.meta || {}), es(s.title || "VTJ")), {
950
+ const n = Ee(), e = ge(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = C(Symbol());
951
+ return s && (Object.assign(e.meta, s.meta || {}, { cache: s.cache }), ts(s.title || "VTJ")), {
951
952
  provider: n,
952
953
  component: r,
953
954
  file: s,
954
955
  query: e.query,
955
- meta: s?.meta
956
+ meta: e.meta,
957
+ sid: o,
958
+ route: e
956
959
  };
957
960
  },
958
961
  render() {
959
- const { component: n, query: e } = this;
960
- return n ? q(n, e) : q("div", "页面不存在");
962
+ const { component: n, query: e, sid: t } = this;
963
+ return n ? K(n, { ...e, key: t }) : K("div", "页面不存在");
964
+ },
965
+ activated() {
966
+ this.meta.cache === !1 && (this.sid = Symbol());
961
967
  }
962
- }), ts = {
968
+ }), ss = {
963
969
  "data-l-h6o7ki7": "",
964
970
  class: "vtj-startup__wrapper"
965
- }, ss = {
971
+ }, ns = {
966
972
  "data-l-h6o7ki7": "",
967
973
  class: "vtj-startup"
968
- }, ns = {
974
+ }, rs = {
969
975
  "data-l-h6o7ki7": "",
970
976
  class: "vtj-startup__name"
971
- }, rs = { "data-l-h6o7ki7": "" }, os = {
977
+ }, os = { "data-l-h6o7ki7": "" }, is = {
972
978
  "data-l-h6o7ki7": "",
973
979
  class: "vtj-startup__tagline"
974
- }, is = {
980
+ }, as = {
975
981
  "data-l-h6o7ki7": "",
976
982
  class: "vtj-startup__actions"
977
- }, as = /* @__PURE__ */ K({
983
+ }, cs = /* @__PURE__ */ Q({
978
984
  __name: "Startup",
979
985
  props: {
980
986
  name: { default: "VTJ.PRO" },
981
987
  tagline: { default: "基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台" },
982
- actionText: { default: "开始设计" }
988
+ actionText: { default: "开始设计" },
989
+ link: {}
983
990
  },
984
991
  setup(n) {
985
992
  ((r, o) => {
@@ -1053,33 +1060,37 @@ const ae = K({
1053
1060
  }`);
1054
1061
  const t = n, s = () => {
1055
1062
  if (typeof window < "u") {
1063
+ if (t.link) {
1064
+ typeof t.link == "function" ? t.link() : window.location.href = t.link;
1065
+ return;
1066
+ }
1056
1067
  let o = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "__vtj__/#/";
1057
1068
  window.location.href = o;
1058
1069
  }
1059
1070
  };
1060
- return (r, o) => (Ge(), Ye("div", ts, [
1061
- b("div", ss, [
1062
- b("h1", ns, [
1063
- b("span", rs, N(t.name), 1)
1071
+ return (r, o) => (Ye(), Qe("div", ss, [
1072
+ b("div", ns, [
1073
+ b("h1", rs, [
1074
+ b("span", os, J(t.name), 1)
1064
1075
  ]),
1065
- b("div", os, N(t.tagline), 1),
1066
- b("div", is, [
1076
+ b("div", is, J(t.tagline), 1),
1077
+ b("div", as, [
1067
1078
  b("button", {
1068
1079
  "data-l-h6o7ki7": "",
1069
1080
  onClick: s
1070
- }, N(t.actionText), 1)
1081
+ }, J(t.actionText), 1)
1071
1082
  ])
1072
1083
  ])
1073
1084
  ]));
1074
1085
  }
1075
- }), cs = K({
1086
+ }), ls = Q({
1076
1087
  name: "VtjStartupContainer",
1077
1088
  render() {
1078
- return q(as);
1089
+ return K(cs);
1079
1090
  }
1080
- }), $e = Symbol("Provider");
1081
- var ls = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(ls || {});
1082
- class us extends xe {
1091
+ }), be = Symbol("Provider");
1092
+ var us = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(us || {});
1093
+ class ds extends xe {
1083
1094
  constructor(e) {
1084
1095
  super(), this.options = e;
1085
1096
  const {
@@ -1089,21 +1100,21 @@ class us extends xe {
1089
1100
  materials: o,
1090
1101
  project: a = {},
1091
1102
  adapter: i = {},
1092
- globals: c = {},
1093
- modules: l = {},
1103
+ globals: l = {},
1104
+ modules: c = {},
1094
1105
  router: f = null,
1095
- materialPath: d = "./",
1096
- nodeEnv: u = "development"
1106
+ materialPath: u = "./",
1107
+ nodeEnv: p = "development"
1097
1108
  /* Development */
1098
1109
  } = e;
1099
- this.mode = s, this.modules = l, this.service = t, this.router = f, this.materialPath = d, this.nodeEnv = u, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, c), Object.assign(this.adapter, i);
1100
- const { access: m, request: p } = this.adapter;
1101
- m && m.connect({ mode: s, router: f, request: p }), s !== _.Design && this.load(a);
1110
+ this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
1111
+ const { access: d, request: h } = this.adapter;
1112
+ d && d.connect({ mode: s, router: f, request: h }), a && s !== _.Design ? this.load(a) : this.project = a;
1102
1113
  }
1103
1114
  mode;
1104
1115
  globals = {};
1105
1116
  modules = {};
1106
- adapter = { request: ut, jsonp: He };
1117
+ adapter = { request: dt, jsonp: Be };
1107
1118
  apis = {};
1108
1119
  dependencies = {};
1109
1120
  materials = {};
@@ -1120,77 +1131,79 @@ class us extends xe {
1120
1131
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1121
1132
  throw new Error("project is null");
1122
1133
  const { apis: s = [], meta: r = [] } = this.project, o = window;
1123
- o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ft(s, r, this.adapter), ye(), this.project.config?.mock && ht(s), this.initRouter(), this.triggerReady();
1134
+ o.CKEDITOR_VERSION = void 0, this.mode === _.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = ht(s, r, this.adapter), _e(), this.project.config?.mock && mt(s), this.initRouter(), this.triggerReady();
1124
1135
  }
1125
1136
  async loadDependencies(e) {
1126
1137
  const t = Object.entries(this.dependencies);
1127
1138
  for (const [s, r] of t)
1128
- e[s] || (e[s] = await r());
1139
+ e[s] || (e[s] = this.library[s] = await r());
1129
1140
  }
1130
1141
  async loadAssets(e) {
1131
1142
  const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1132
- libraryExports: c,
1133
- libraryMap: l,
1143
+ libraryExports: l,
1144
+ libraryMap: c,
1134
1145
  materials: f,
1135
- materialExports: d,
1136
- materialMapLibrary: u
1137
- } = nt(
1146
+ materialExports: u,
1147
+ materialMapLibrary: p
1148
+ } = rt(
1138
1149
  t,
1139
1150
  a,
1140
1151
  i === "development"
1141
1152
  /* Development */
1142
1153
  );
1143
- for (const p of c) {
1144
- const h = s[p], w = e[p];
1145
- if (w)
1146
- r[p] = w;
1154
+ for (const d of l) {
1155
+ const h = s[d], m = e[d];
1156
+ if (m)
1157
+ r[d] = m;
1147
1158
  else if (h)
1148
- e[p] = r[p] = await h();
1159
+ e[d] = r[d] = await h();
1149
1160
  else {
1150
- const g = l[p] || [];
1151
- for (const v of g)
1152
- G(v) && await ot(p, x.append(v, { v: R })), Y(v) && await ne(x.append(v, { v: R }));
1153
- r[p] = e[p];
1161
+ const v = c[d] || [];
1162
+ for (const g of v)
1163
+ X(g) && await it(d, P.append(g, { v: x })), Z(g) && await oe(P.append(g, { v: x }));
1164
+ r[d] = e[d];
1154
1165
  }
1155
1166
  }
1156
- for (const p of f)
1157
- await ne(x.append(p, { v: R }));
1158
- const m = this.materials || {};
1159
- for (const p of d) {
1160
- const h = e[u[p]], w = Re[p];
1161
- if (w)
1162
- h && w.forEach((g) => {
1163
- o[g] = h[g];
1164
- });
1165
- else {
1166
- const g = m[p] ? (await m[p]()).default : e[p];
1167
- g && h && (g.components || []).forEach((v) => {
1168
- o[v.name] = rt(v, h);
1169
- });
1167
+ if (i === "development") {
1168
+ for (const h of f)
1169
+ await oe(P.append(h, { v: x }));
1170
+ const d = this.materials || {};
1171
+ for (const h of u) {
1172
+ const m = e[p[h]], v = ke[h];
1173
+ if (v)
1174
+ m && v.forEach((g) => {
1175
+ o[g] = m[g];
1176
+ });
1177
+ else {
1178
+ const g = d[h] ? (await d[h]()).default : e[h];
1179
+ g && m && (g.components || []).forEach((A) => {
1180
+ o[A.name] = ot(A, m);
1181
+ });
1182
+ }
1170
1183
  }
1171
1184
  }
1172
1185
  }
1173
1186
  initRouter() {
1174
- const { router: e, project: t, options: s } = this;
1187
+ const { router: e, project: t, options: s, adapter: r } = this;
1175
1188
  if (!e) return;
1176
- const { routeParentName: r, pageRouteName: o = "page", routeMeta: a } = s, i = {
1177
- path: `/${o}/:id`,
1178
- name: W,
1179
- component: ae
1180
- }, c = {
1181
- path: "/",
1182
- name: me,
1183
- component: t?.homepage ? ae : cs,
1184
- meta: a
1189
+ const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = s, l = o ? "" : "/", c = {
1190
+ path: `${l}${a}/:id`,
1191
+ name: k,
1192
+ component: le
1193
+ }, f = {
1194
+ path: l,
1195
+ name: M,
1196
+ component: t?.homepage ? le : r.startupComponent || ls,
1197
+ meta: i
1185
1198
  };
1186
- r ? (e.addRoute(r, i), e.addRoute(r, c)) : (e.addRoute(i), e.addRoute(c));
1199
+ e.hasRoute(k) && e.removeRoute(k), e.hasRoute(M) && e.removeRoute(M), o ? (e.addRoute(o, c), e.addRoute(o, f)) : (e.addRoute(c), e.addRoute(f));
1187
1200
  }
1188
1201
  install(e) {
1189
1202
  const t = e.config.globalProperties.installed || {};
1190
1203
  for (const [s, r] of Object.entries(this.library))
1191
- !t[s] && ct(r) && (e.use(r), t[s] = !0);
1192
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide($e, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
1193
- const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${i} ${o}`;
1204
+ !t[s] && lt(r) && (e.use(r), t[s] = !0);
1205
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(be, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
1206
+ const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
1194
1207
  console.error(
1195
1208
  "[VTJ Error]:",
1196
1209
  {
@@ -1199,9 +1212,9 @@ class us extends xe {
1199
1212
  info: o
1200
1213
  },
1201
1214
  s?.stack
1202
- ), T.error({
1215
+ ), N.error({
1203
1216
  title: "未处理的异常:请在控制台查看详情",
1204
- message: c
1217
+ message: l
1205
1218
  });
1206
1219
  });
1207
1220
  }
@@ -1229,7 +1242,7 @@ class us extends xe {
1229
1242
  }
1230
1243
  async getDsl(e) {
1231
1244
  const t = this.modules[`.vtj/files/${e}.json`];
1232
- return t ? await t() : this.service.getFile(e).catch(() => null);
1245
+ return t ? await t() : this.service.getFile(e, this.project || void 0).catch(() => null);
1233
1246
  }
1234
1247
  async getDslByUrl(e) {
1235
1248
  const t = this.urlDslCaches[e];
@@ -1251,54 +1264,54 @@ class us extends xe {
1251
1264
  apis: a,
1252
1265
  window,
1253
1266
  ...t
1254
- }, c = V({
1255
- getDsl: async (l) => await this.getDsl(l) || null,
1256
- getDslByUrl: async (l) => await this.getDslByUrl(l) || null,
1267
+ }, l = G({
1268
+ getDsl: async (c) => await this.getDsl(c) || null,
1269
+ getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1257
1270
  options: i
1258
1271
  });
1259
- return J({
1272
+ return W({
1260
1273
  ...i,
1261
1274
  dsl: e,
1262
- loader: c
1275
+ loader: l
1263
1276
  });
1264
1277
  }
1265
1278
  async getRenderComponent(e, t) {
1266
1279
  const s = this.getFile(e);
1267
1280
  if (!s)
1268
- return I.warn(`Can not find file: ${e}`), null;
1281
+ return D.warn(`Can not find file: ${e}`), null;
1269
1282
  t && t(s);
1270
1283
  const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
1271
1284
  if (o)
1272
1285
  return (await o())?.default;
1273
1286
  const a = await this.getDsl(s.id);
1274
- return a ? this.createDslRenderer(a).renderer : (I.warn(`Can not find dsl: ${e}`), null);
1287
+ return a ? this.createDslRenderer(a).renderer : (D.warn(`Can not find dsl: ${e}`), null);
1275
1288
  }
1276
1289
  defineUrlSchemaComponent(e, t) {
1277
- return re(async () => {
1290
+ return ie(async () => {
1278
1291
  const s = await this.getDslByUrl(e);
1279
1292
  return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1280
1293
  });
1281
1294
  }
1282
1295
  definePluginComponent(e) {
1283
- return re(async () => await we(e, window));
1296
+ return ie(async () => await Se(e, window));
1284
1297
  }
1285
1298
  }
1286
- function bs(n) {
1287
- const e = new us(n);
1299
+ function Es(n) {
1300
+ const e = new ds(n);
1288
1301
  return {
1289
1302
  provider: e,
1290
1303
  onReady: (s) => e.ready(s)
1291
1304
  };
1292
1305
  }
1293
- function be(n = {}) {
1294
- const e = ue($e);
1306
+ function Ee(n = {}) {
1307
+ const e = pe(be);
1295
1308
  if (!e)
1296
1309
  throw new Error("Can not find provider");
1297
1310
  if (e.nodeEnv === "development") {
1298
1311
  const { id: t, version: s } = n;
1299
1312
  t && s && (async () => {
1300
1313
  const r = await e.getDsl(t);
1301
- r?.__VERSION__ !== s && T.warning({
1314
+ r?.__VERSION__ !== s && N.warning({
1302
1315
  title: r?.name,
1303
1316
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
1304
1317
  });
@@ -1306,7 +1319,7 @@ function be(n = {}) {
1306
1319
  }
1307
1320
  return e;
1308
1321
  }
1309
- const X = new Be({
1322
+ const te = new Ne({
1310
1323
  settings: {
1311
1324
  type: "json",
1312
1325
  validSuccess: !0,
@@ -1314,12 +1327,12 @@ const X = new Be({
1314
1327
  failMessage: !0,
1315
1328
  validate: (n) => n.data?.code === 0,
1316
1329
  showError: (n) => {
1317
- T.error({
1330
+ N.error({
1318
1331
  message: n || "未知错误"
1319
1332
  });
1320
1333
  }
1321
1334
  }
1322
- }), ds = (n = "/__vtj__/api/:type.json") => (e, t) => X.send({
1335
+ }), ps = (n = "/__vtj__/api/:type.json") => (e, t) => te.send({
1323
1336
  url: n,
1324
1337
  method: "post",
1325
1338
  params: { type: e },
@@ -1327,7 +1340,7 @@ const X = new Be({
1327
1340
  type: e,
1328
1341
  data: t
1329
1342
  }
1330
- }), ps = (n = "/__vtj__/api/uploader.json") => async (e, t) => await X.send({
1343
+ }), fs = (n = "/__vtj__/api/uploader.json") => async (e, t) => await te.send({
1331
1344
  url: n,
1332
1345
  method: "post",
1333
1346
  data: {
@@ -1338,12 +1351,12 @@ const X = new Be({
1338
1351
  type: "data"
1339
1352
  }
1340
1353
  }).then((s) => s && s[0] ? s[0] : null).catch(() => null);
1341
- class Z {
1354
+ class se {
1342
1355
  api;
1343
1356
  pluginCaches = {};
1344
1357
  uploader;
1345
1358
  constructor() {
1346
- this.api = ds(), this.uploader = ps();
1359
+ this.api = ps(), this.uploader = fs();
1347
1360
  }
1348
1361
  async getExtension() {
1349
1362
  console.log("BaseService.getExtension");
@@ -1416,10 +1429,10 @@ class Z {
1416
1429
  return await this.api("clearStaticFiles", e).catch(() => "");
1417
1430
  }
1418
1431
  async getPluginMaterial(e) {
1419
- const { urls: t = [] } = e, s = t.filter((o) => tt(o))[0];
1432
+ const { urls: t = [] } = e, s = t.filter((o) => st(o))[0];
1420
1433
  if (!s) return null;
1421
1434
  const r = this.pluginCaches[s];
1422
- return r || (this.pluginCaches[s] = X.send({
1435
+ return r || (this.pluginCaches[s] = te.send({
1423
1436
  url: s,
1424
1437
  method: "get",
1425
1438
  settings: {
@@ -1428,23 +1441,26 @@ class Z {
1428
1441
  }
1429
1442
  }).then((o) => o.data).catch(() => null));
1430
1443
  }
1444
+ async genSource(e) {
1445
+ return console.log("BaseService.genSource", e), "";
1446
+ }
1431
1447
  }
1432
1448
  const y = new Ue({
1433
1449
  type: "local",
1434
1450
  expired: 0,
1435
1451
  prefix: "__VTJ_"
1436
1452
  });
1437
- class Es extends Z {
1453
+ class Rs extends se {
1438
1454
  init(e) {
1439
- const t = new A(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1455
+ const t = new T(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1440
1456
  return y.save(`project_${t.id}`, r), Promise.resolve(r);
1441
1457
  }
1442
1458
  saveProject(e) {
1443
- const t = new A(e);
1459
+ const t = new T(e);
1444
1460
  return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1445
1461
  }
1446
1462
  saveMaterials(e, t) {
1447
- return y.save(`materials_${e.id}`, z(t)), Promise.resolve(!0);
1463
+ return y.save(`materials_${e.id}`, Y(t)), Promise.resolve(!0);
1448
1464
  }
1449
1465
  saveFile(e) {
1450
1466
  return y.save(`file_${e.id}`, e), Promise.resolve(!0);
@@ -1468,7 +1484,7 @@ class Es extends Z {
1468
1484
  return Promise.resolve(!0);
1469
1485
  }
1470
1486
  getHistory(e) {
1471
- const t = y.get(`history_${e}`), s = new ce(t || { id: e });
1487
+ const t = y.get(`history_${e}`), s = new ue(t || { id: e });
1472
1488
  return Promise.resolve(s.toDsl());
1473
1489
  }
1474
1490
  getHistoryItem(e, t) {
@@ -1484,22 +1500,22 @@ class Es extends Z {
1484
1500
  }), Promise.resolve(!0);
1485
1501
  }
1486
1502
  }
1487
- class fs extends Z {
1503
+ class hs extends se {
1488
1504
  projects = {};
1489
1505
  materials = {};
1490
1506
  files = {};
1491
1507
  histories = {};
1492
1508
  historyItems = {};
1493
1509
  init(e) {
1494
- const t = new A(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1510
+ const t = new T(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1495
1511
  return this.projects[r.id] = r, Promise.resolve(r);
1496
1512
  }
1497
1513
  saveProject(e) {
1498
- const t = new A(e);
1514
+ const t = new T(e);
1499
1515
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1500
1516
  }
1501
1517
  saveMaterials(e, t) {
1502
- return e.id && (this.materials[e.id] = z(t)), Promise.resolve(!0);
1518
+ return e.id && (this.materials[e.id] = Y(t)), Promise.resolve(!0);
1503
1519
  }
1504
1520
  saveFile(e) {
1505
1521
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1523,7 +1539,7 @@ class fs extends Z {
1523
1539
  return Promise.resolve(!0);
1524
1540
  }
1525
1541
  getHistory(e) {
1526
- const t = this.histories[e], s = new ce(t || { id: e });
1542
+ const t = this.histories[e], s = new ue(t || { id: e });
1527
1543
  return Promise.resolve(s);
1528
1544
  }
1529
1545
  getHistoryItem(e, t) {
@@ -1541,11 +1557,11 @@ class fs extends Z {
1541
1557
  }), Promise.resolve(!0);
1542
1558
  }
1543
1559
  }
1544
- let F = null;
1560
+ let O = null;
1545
1561
  function Ps() {
1546
- return F || (F = new fs(), F);
1562
+ return O || (O = new hs(), O);
1547
1563
  }
1548
- class xs extends Z {
1564
+ class xs extends se {
1549
1565
  getFileCaches = {};
1550
1566
  async getExtension() {
1551
1567
  return await this.api("getExtension", {}).catch(() => {
@@ -1560,7 +1576,7 @@ class xs extends Z {
1560
1576
  async saveMaterials(e, t) {
1561
1577
  return !!await this.api("saveMaterials", {
1562
1578
  project: e,
1563
- materials: z(t)
1579
+ materials: Y(t)
1564
1580
  }).catch(() => !1);
1565
1581
  }
1566
1582
  async saveFile(e) {
@@ -1600,16 +1616,16 @@ class xs extends Z {
1600
1616
  );
1601
1617
  }
1602
1618
  }
1603
- function Ee(n = []) {
1604
- return n.map((e) => {
1605
- const { id: t, title: s, icon: r, children: o, hidden: a } = e;
1619
+ function Re(n, e, t = []) {
1620
+ return t.map((s) => {
1621
+ const { id: r, title: o, icon: a, children: i, hidden: l } = s;
1606
1622
  return {
1607
- id: t,
1608
- title: s,
1609
- icon: r,
1610
- hidden: a,
1611
- url: `/page/${t}`,
1612
- children: o && o.length ? Ee(o) : void 0
1623
+ id: r,
1624
+ title: o,
1625
+ icon: a,
1626
+ hidden: l,
1627
+ url: `${n}/${e}/${r}`,
1628
+ children: i && i.length ? Re(n, e, i) : void 0
1613
1629
  };
1614
1630
  });
1615
1631
  }
@@ -1621,89 +1637,97 @@ function Pe(n, e) {
1621
1637
  const r = Pe(s.children, e);
1622
1638
  r.length && (s.children = r, t.push(s));
1623
1639
  } else
1624
- e[s.id] && t.push(s);
1640
+ e.can(s.id.toString()) && t.push(s);
1625
1641
  return t;
1626
1642
  }
1627
- function Rs() {
1628
- const n = be(), e = he(), t = vt(), s = O(!1), r = O(!1), o = t?.getData(), a = n.project;
1629
- Qe(() => {
1630
- const { name: l, params: f, meta: d } = e;
1631
- if (l === W) {
1632
- const u = n.getPage(f.id);
1633
- s.value = !u?.mask, r.value = !!u?.pure;
1634
- } else if (l === me) {
1635
- const u = n.getHomepage();
1636
- s.value = !u?.mask, r.value = !!u?.pure;
1643
+ function ks(n) {
1644
+ const {
1645
+ menuPathPrefix: e = "",
1646
+ pageRouteName: t = "page",
1647
+ disableMenusFilter: s = !1
1648
+ } = n || {}, r = Ee(), o = ge(), a = yt(), i = C(!1), l = C(!1), c = r.project;
1649
+ Xe(() => {
1650
+ const { name: p, params: d, meta: h } = o;
1651
+ if (p === k) {
1652
+ const m = r.getPage(d.id);
1653
+ i.value = !m?.mask, l.value = !!m?.pure;
1654
+ } else if (p === M) {
1655
+ const m = r.getHomepage();
1656
+ i.value = !m?.mask, l.value = !!m?.pure;
1637
1657
  } else
1638
- s.value = !d.mask, r.value = !!d.pure;
1658
+ i.value = !h.mask, l.value = !!h.pure;
1639
1659
  });
1640
- const i = Ee(a?.pages), c = a?.config;
1660
+ const f = Re(
1661
+ e,
1662
+ t,
1663
+ c?.pages
1664
+ ), u = c?.config;
1641
1665
  return {
1642
- disabled: s,
1643
- logo: c?.logo,
1644
- themeSwitchable: c?.themeSwitchable,
1645
- title: c?.title || a?.description || a?.name || "VTJ App",
1646
- menus: Pe(i, o?.permissions),
1647
- pure: r
1666
+ disabled: i,
1667
+ logo: u?.logo,
1668
+ themeSwitchable: u?.themeSwitchable,
1669
+ title: u?.title || c?.description || c?.name || "VTJ App",
1670
+ menus: s ? f : Pe(f, a),
1671
+ pure: l
1648
1672
  };
1649
1673
  }
1650
1674
  export {
1651
- _e as ACCESS_KEY,
1652
- $s as Access,
1653
- Ze as BUILT_IN_DIRECTIVES,
1654
- Z as BaseService,
1655
- oe as CONTEXT_HOST,
1656
- yt as Context,
1675
+ we as ACCESS_KEY,
1676
+ bs as Access,
1677
+ et as BUILT_IN_DIRECTIVES,
1678
+ se as BaseService,
1679
+ ae as CONTEXT_HOST,
1680
+ _t as Context,
1657
1681
  _ as ContextMode,
1658
- et as DATA_TYPES,
1659
- me as HOMEPAGE_ROUTE_NAME,
1660
- js as JSCodeToString,
1661
- _s as LIFE_CYCLES_LIST,
1682
+ tt as DATA_TYPES,
1683
+ M as HOMEPAGE_ROUTE_NAME,
1684
+ $s as JSCodeToString,
1685
+ ws as LIFE_CYCLES_LIST,
1662
1686
  xs as LocalService,
1663
- fs as MemoryService,
1664
- ls as NodeEnv,
1665
- W as PAGE_ROUTE_NAME,
1666
- us as Provider,
1667
- as as Startup,
1668
- Es as StorageService,
1669
- R as VTJ_RENDERER_VERSION,
1670
- ve as adoptedStyleSheets,
1671
- ws as createAssetScripts,
1672
- Ss as createAssetsCss,
1673
- Et as createDataSources,
1674
- V as createLoader,
1687
+ hs as MemoryService,
1688
+ us as NodeEnv,
1689
+ k as PAGE_ROUTE_NAME,
1690
+ ds as Provider,
1691
+ cs as Startup,
1692
+ Rs as StorageService,
1693
+ x as VTJ_RENDERER_VERSION,
1694
+ ye as adoptedStyleSheets,
1695
+ Ss as createAssetScripts,
1696
+ js as createAssetsCss,
1697
+ Rt as createDataSources,
1698
+ G as createLoader,
1675
1699
  Ps as createMemoryService,
1676
- pt as createMetaApi,
1677
- bs as createProvider,
1678
- J as createRenderer,
1679
- dt as createSchemaApi,
1680
- ft as createSchemaApis,
1681
- Rt as defaultLoader,
1682
- C as fillBasePath,
1683
- Se as getModifiers,
1684
- we as getPlugin,
1685
- rt as getRawComponent,
1686
- G as isCSSUrl,
1687
- lt as isJSCode,
1688
- S as isJSExpression,
1689
- H as isJSFunction,
1690
- tt as isJSON,
1691
- Y as isJSUrl,
1692
- ct as isVuePlugin,
1693
- ot as loadCss,
1694
- it as loadCssUrl,
1695
- at as loadScriptUrl,
1696
- mt as mockApi,
1697
- ht as mockApis,
1698
- ye as mockCleanup,
1699
- D as nodeRender,
1700
- nt as parseDeps,
1701
- k as parseExpression,
1702
- ie as parseFunction,
1703
- $e as providerKey,
1704
- st as removeProdFlag,
1705
- ge as toString,
1706
- vt as useAccess,
1707
- Rs as useMask,
1708
- be as useProvider
1700
+ ft as createMetaApi,
1701
+ Es as createProvider,
1702
+ W as createRenderer,
1703
+ pt as createSchemaApi,
1704
+ ht as createSchemaApis,
1705
+ kt as defaultLoader,
1706
+ I as fillBasePath,
1707
+ je as getModifiers,
1708
+ Se as getPlugin,
1709
+ ot as getRawComponent,
1710
+ X as isCSSUrl,
1711
+ ut as isJSCode,
1712
+ w as isJSExpression,
1713
+ U as isJSFunction,
1714
+ st as isJSON,
1715
+ Z as isJSUrl,
1716
+ lt as isVuePlugin,
1717
+ it as loadCss,
1718
+ at as loadCssUrl,
1719
+ ct as loadScriptUrl,
1720
+ gt as mockApi,
1721
+ mt as mockApis,
1722
+ _e as mockCleanup,
1723
+ H as nodeRender,
1724
+ rt as parseDeps,
1725
+ F as parseExpression,
1726
+ ce as parseFunction,
1727
+ be as providerKey,
1728
+ nt as removeProdFlag,
1729
+ ve as toString,
1730
+ yt as useAccess,
1731
+ ks as useMask,
1732
+ Ee as useProvider
1709
1733
  };