@vtj/renderer 0.8.3 → 0.8.4

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.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@vtj/core"),l=require("@vtj/utils"),j=require("vue"),ee=require("vue-router"),T=require("element-plus"),D=require("mockjs"),Se=require("@vueuse/core"),we=require("@vtj/ui");function je(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const A=je(j);/**!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@vtj/core"),u=require("@vtj/utils"),j=require("vue"),ee=require("vue-router"),T=require("element-plus"),D=require("mockjs"),Se=require("@vueuse/core"),we=require("@vtj/ui");function je(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const A=je(j);/**!
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/renderer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.3
5
+ * @version 0.8.4
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const F="0.8.3";var S=(n=>(n.Runtime="Runtime",n.Design="Design",n.Raw="Raw",n.VNode="VNode",n))(S||{});const q=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],$e=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],te=["vIf","vShow","vModel","vFor","vBind"],re={String,Number,Boolean,Array,Object,Function,Date};function I(n,e){return n.map(t=>l.isUrl(t)?t:`${e}${t}`)}function B(n){return/\.css$/.test(n)}function N(n){return/\.js$/.test(n)}function ne(n){return/\.json$/.test(n)}function Ce(n){return n.map(e=>`<script src="${l.url.append(e,{v:F})}"><\/script>`).join("")}function Pe(n=[]){return n.map(e=>`<link rel="stylesheet" href="${l.url.append(e,{v:F})}" />`).join("")}function se(n,e){const t=n.filter(f=>!!f.enabled),r=[],s=[],o=[],i=[],a={},u={},c=[],m={};return t.forEach(({urls:f,assetsUrl:d,library:y,assetsLibrary:h,localeLibrary:v})=>{f?.forEach(p=>{N(p)&&r.push(p),B(p)&&s.push(p)}),y&&(i.push(y),a[y]=I(f||[],e),v&&(u[y]=v)),d&&o.push(d),h&&c.push(h),y&&h&&(m[h]=y)}),{scripts:I(r,e),css:I(s,e),materials:I(o,e),libraryExports:i,materialExports:l.dedupArray(c),materialMapLibrary:m,libraryMap:a,libraryLocaleMap:u}}function oe(n,e){const{name:t,parent:r,alias:s}=n;return r?e[r]?.[s||t]:e[s||t]}function L(n){return l.isString(n)?n:JSON.stringify(n)}function V(n,e,t){const r=n.CSSStyleSheet;if(r.prototype.replaceSync){const s=new r;s.id=e,s.replaceSync(t);const o=n.document,i=o.adoptedStyleSheets,a=Array.from(i).filter(u=>u.id!==e);o.adoptedStyleSheets=[...a,s]}else{const s=n.document;let o=s.getElementById(e);o?o.innerHTML=t:(o=s.createElement("style"),o.id=e,o.innerHTML=t,s.head.appendChild(o))}}async function ie(n,e){const t=await window.fetch(e).then(r=>r.text()).catch(()=>"");t&&V(window,n,t)}function Y(n,e=window){const t=e.document,r=e.document.head;for(const s of n)if(!t.getElementById(s)){const i=t.createElement("link");i.rel="stylesheet",i.id=s,i.href=s,r.appendChild(i)}}async function ae(n,e,t=window){const r=t.document,s=t.document.head;let o=t[e];return o?o.default||o:new Promise((i,a)=>{for(const u of n){const c=r.createElement("script");c.src=u,c.onload=()=>{o=t[e],o&&i(o.default||o)},c.onerror=m=>{a(m)},s.appendChild(c)}})}function ce(n){return l.isFunction(n)||l.isFunction(n?.install)}function R(n,e,t=!1,r=!1){try{const s=['"use strict";',"var __self = arguments[0];"];s.push("return ");let o=(n.value||"").trim();o=o.replace(/this(\W|$)/g,(a,u)=>`__self${u}`),o=s.join(`
8
- `)+o;const i=`with(${t?"{}":"$scope || {}"}) { ${o} }`;return new Function("$scope",i)(e)}catch(s){if(l.logger.error("parseExpression.error",s,n,e?.__self??e),r)throw s}}function J(n,e,t=!1,r=!1){const s=R(n,e,t,r);if(typeof s!="function"&&(l.logger.error("parseFunction.error","not a function",n,e?.__self??e),r))throw new Error(`"${n.value}" not a function`);return s}function w(n){return n&&n.type==="JSExpression"}function O(n){return typeof n=="object"&&n&&n.type==="JSFunction"}function le(n){return w(n)||O(n)}function Ee(n){return le(n)?n.value:JSON.stringify(n)}let b=null;const be=l.createRequest({settings:{type:"form",validSuccess:!0,originResponse:!1,loading:!0,validate:n=>n.data?.code===0||!!n.data?.success,failMessage:!0,showError:n=>{T.ElNotification.error({message:n||"未知错误"})},showLoading:()=>{b&&b.close(),b=T.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.05)"})},hideLoading:()=>{b&&(b.close(),b=null)}}});function ue(n,e){const{jsonp:t,request:r}=e;if(n.method==="jsonp")return(s={})=>t(n.url,{...n.jsonpOptions,query:s});{const s=n.headers?R(n.headers,{},!0):void 0,o={url:n.url,method:n.method,settings:{...n.settings,headers:s}};return(i,a)=>r.send(l.merge(o,a||{},{data:i}))}}function pe(n=[],e){return n.reduce((t,r)=>(t[r.id]=ue(r,e),t),{})}function de(n=[]){D.setup({timeout:"50-500"}),K(),n.forEach(e=>fe(e))}function fe(n){if(!n.mock)return;const{url:e,mockTemplate:t}=n;if(e&&t){const r=l.pathToRegexp(`${e}(.*)`),s=l.pathToRegexpMatch(e,{decode:decodeURIComponent}),o=R(t,{},!0);D.mock(r,i=>{const a=l.url.parse(i.url)||{},u=i.body instanceof FormData?l.formDataToJson(i.body):i.body,c=s(i.url)?.params;return Object.assign(i,{data:u,params:a,query:c}),D.mock(o(i))})}}function K(){D._mocked={}}class me{__id=null;__mode;__instance=null;__contextRefs={};__refs={};context={};state={};props={};$props={};$refs={};$el=null;$emit=null;$nextTick=null;$parent=null;$root=null;$attrs=null;$slots=null;$watch=null;$options=null;$forceUpdate=null;$components={};$libs={};$apis={};__transform={};constructor(e){const{mode:t,dsl:r,attrs:s}=e;this.__mode=t,r&&(this.__id=r.id||null,this.__transform=r.transform||{}),s&&Object.assign(this,s)}setup(e,t=A){const r=t.getCurrentInstance();if(!r)return;this.__instance=r.proxy;const s=r.appContext.config.globalProperties;Object.assign(this,s),Object.assign(this,e||{}),this.__proxy(),t.onMounted(()=>{this.__proxy()}),t.onUnmounted(()=>{this.__cleanup()})}__proxy(){this.__instance&&q.forEach(e=>{this[e]=this.__instance?.[e]})}__cleanup(){q.forEach(e=>{this[e]=null})}__parseFunction(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:r}=e,s=t?this.__transform[t]??e.value:e.value;return J({type:r,value:s},this)}else return J(e,this)}__parseExpression(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:r}=e,s=t?this.__transform[t]??e.value:e.value;return R({type:r,value:s},this)}else return R(e,this)}__ref(e=null,t){if(this.__mode!==S.VNode)return e&&e!==this.__id&&(this.__contextRefs[e]=this),r=>{let s=r?.$vtjEl||r?.$el||r;if(!s){typeof t=="string"&&(delete this.$refs[t],e&&delete this.__refs[e]);return}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")t(r);else if(t){const o=this.$refs[t];if(o){const i=new Set([].concat(o,r));this.$refs[t]=Array.from(i)}else this.$refs[t]=r}return r}}__clone(e={}){const t={...this.context,...e},r={...t,context:t};return r.context.__proto__=this.context,r.__proto__=this,r}}function x(n){const{Vue:e=A,mode:t=S.Runtime,components:r={},libs:s={},apis:o={},loader:i}=n,a=e.computed(()=>n.dsl),u={$components:r,$libs:s,$apis:o},c=new me({mode:t,dsl:a.value,attrs:u}),m=e.defineComponent({name:a.value.name,props:{...Fe(a.value.props??[],c)},setup(f){c.$props=f,c.props=f,a.value.id&&V(n.window||window,a.value.id,a.value.css||""),c.state=Re(e,a.value.state??{},c);const d=Ie(e,a.value.computed??{},c),y=He(a.value.methods??{},c),h=Oe(e,a.value.inject,c),v=he(a.value.dataSources||{},c),p={...h,...d,...y,...v};return c.setup(p,e),Me(e,a.value.watch??[],c),{vtj:c}},emits:[...a.value.emits??[]],expose:["vtj"],render(){if(!a.value.nodes)return null;const f=a.value.nodes||[];return f.length===1?H(f[0],c,e,i):f.map(d=>H(d,c,e,i))},...Te(a.value.lifeCycles??{},c)});return{renderer:e.markRaw(m),context:c}}function Fe(n=[],e){const t=r=>r?(Array.isArray(r)?r:[r]).map(o=>re[o]):void 0;return n.map(r=>l.isString(r)?{name:r}:{name:r.name,type:r.type,required:r.required,default:w(r.default)?e.__parseExpression(r.default):r.default}).reduce((r,s)=>(r[s.name]={type:t(s.type),required:s.required,default:s.default},r),{})}function Re(n,e,t){return n.reactive(Object.keys(e||{}).reduce((r,s)=>{let o=e[s];return w(o)?o=t.__parseExpression(o):O(o)&&(o=t.__parseFunction(o)),r[s]=o,r},{}))}function Ie(n,e,t){return Object.entries(e??{}).reduce((r,[s,o])=>(r[s]=n.computed(t.__parseFunction(o)),r),{})}function He(n,e){return Object.entries(n??{}).reduce((t,[r,s])=>(t[r]=e.__parseFunction(s),t),{})}function Oe(n,e=[],t){return e.reduce((r,s)=>{const{name:o,from:i}=s||{};s.default;const a=w(i)?t.__parseExpression(i)||o:i??o,u=w(s.default)?t.__parseExpression(s.default):s.default??null;return r[o]=n.inject(a,u),r},{})}function he(n,e){return Object.keys(n).reduce((t,r)=>{const s=n[r],o=e.$apis[s.ref],i=O(s.transform)?s.transform.value?e.__parseFunction(s.transform):void 0:s.transform;return t[r]=async(...a)=>{const u=await o.apply(e,a);return i?i(u):u},t},{})}function Me(n,e=[],t){e.forEach(r=>{n.watch(t.__parseExpression(r.source),t.__parseFunction(r.handler),{deep:r.deep,immediate:r.immediate})})}function Te(n,e){return Object.entries(n??{}).reduce((t,[r,s])=>(t[r]=e.__parseFunction(s),t),{})}const ve=n=>n;async function X(n,e=window){const{urls:t=[],library:r}=n,s=t.filter(u=>N(u));if(s.length===0||!r)return null;const o=t.filter(u=>B(u));let i;const a=await ae(s,r,e).catch(()=>null);return a?.plugin&&(i=a.plugin),i?{component:i,css:o}:null}function k(n){const{getDsl:e,getDslByUrl:t,options:r}=n;return(s,o,i=A)=>!o||typeof o=="string"?s:o.type==="Schema"&&o.id?i.defineAsyncComponent(async()=>{const a=await e(o.id);return a&&(a.name=s),a?x({...r,Vue:i,dsl:a,mode:S.Runtime,loader:k(n)}).renderer:null}):o.type==="UrlSchema"&&o.url?i.defineAsyncComponent(async()=>{const a=await t(o.url);return a&&(a.name=s),a?x({...r,Vue:i,dsl:a,mode:S.Runtime,loader:k(n)}).renderer:null}):o.type==="Plugin"?i.defineAsyncComponent(async()=>{const a=await X(o,r.window);return a?(Y(a.css),a.component):null}):s}function H(n,e,t=A,r=ve){if(!n||!n.name||n.invisible)return null;const{id:s=null,directives:o=[]}=n,{vIf:i,vFor:a,vShow:u,vModels:c,vBind:m}=De(o);if(i&&!xe(i,e))return null;const f=d=>{const y=d.$components,h=(()=>{if(n.name==="component")return ke(d,n.props?.is);if(n.name==="slot")return n.name;const _=r(n.name,n.from,t);return l.isString(_)?y[_]??_:_})(),v=Ae(s,n.props??{},d),p=Be(t,n.events??{},d);if(n.name==="slot")return Ne(t,n,v,d);m&&Object.assign(v,d.__parseExpression(m.value)),u&&(v.style=Object.assign(v.style??{},qe(u,d))),c.forEach(_=>{Object.assign(v,Je(t,_,d))});const $=Le(t,n.children??[],d,n);return t.createVNode(h,{...v,...p},$)};return a?Ke(a,f,e):f(e)}function De(n=[]){const e=n.find(a=>l.camelCase(a.name)==="vIf"),t=n.find(a=>l.camelCase(a.name)==="vFor"),r=n.find(a=>l.camelCase(a.name)==="vShow"),s=n.find(a=>l.camelCase(a.name)==="vBind"),o=n.filter(a=>l.camelCase(a.name)==="vModel"),i=n.filter(a=>!te.includes(l.camelCase(a.name)));return{vIf:e,vFor:t,vShow:r,vModels:o,vBind:s,others:i}}function xe(n,e){return!!e.__parseExpression(n.value)}function ke(n,e){return e?w(e)?n.__parseExpression(e):e:"div"}function Ae(n,e,t){const r=Object.keys(e||{}).reduce((s,o)=>{let i=e[o];return w(i)?i=t.__parseExpression(i):O(i)&&(i=t.__parseFunction(i)),s[o]=i,s},{});return r.ref=t.__ref(n,r.ref),r}function Be(n,e,t){const r=["passive","capture","once"],s={capture:"Capture",once:"Once",passive:"OnceCapture"};return Object.keys(e||{}).reduce((o,i)=>{const a=e[i],u=W(a.modifiers),c=u.find(d=>r.includes(d)),m="on"+l.upperFirst(i)+(c&&s[c]||""),f=t.__parseFunction(a.handler);return f&&(o[m]=n.withModifiers(f,u)),o},{})}function W(n={},e=!1){const t=Object.keys(n);return e?t.map(r=>"."+r):t}function Ne(n,e,t,r){const{children:s}=e,o=Ue(e,r),i=r.$slots?.[o.name];return i?i(t):s?l.isString(s)?n.createTextVNode(s):w(s)?n.createTextVNode(L(r.__parseExpression(s))):Array.isArray(s)?s.map(a=>H(a,r,n)):null:null}function Ue(n,e){const{props:t}=n,r=t?.name||"default";return{name:w(r)?e.__parseExpression(r):r,params:[]}}function qe(n,e){return e.__parseExpression(n.value)?{}:{display:"none"}}function Je(n,e,t){const r={type:"JSFunction",value:e.value?.value?`(v) => {
7
+ */const F="0.8.4";var S=(n=>(n.Runtime="Runtime",n.Design="Design",n.Raw="Raw",n.VNode="VNode",n))(S||{});const q=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],$e=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],te=["vIf","vShow","vModel","vFor","vBind"],re={String,Number,Boolean,Array,Object,Function,Date};function I(n,e){return n.map(t=>u.isUrl(t)?t:`${e}${t}`)}function B(n){return/\.css$/.test(n)}function N(n){return/\.js$/.test(n)}function ne(n){return/\.json$/.test(n)}function Ce(n){return n.map(e=>`<script src="${u.url.append(e,{v:F})}"><\/script>`).join("")}function Pe(n=[]){return n.map(e=>`<link rel="stylesheet" href="${u.url.append(e,{v:F})}" />`).join("")}function se(n,e){const t=n.filter(d=>!!d.enabled),r=[],s=[],o=[],a=[],i={},l={},c=[],m={};return t.forEach(({urls:d,assetsUrl:f,library:v,assetsLibrary:h,localeLibrary:g})=>{d?.forEach(p=>{N(p)&&r.push(p),B(p)&&s.push(p)}),v&&(a.push(v),i[v]=I(d||[],e),g&&(l[v]=g)),f&&o.push(f),h&&c.push(h),v&&h&&(m[h]=v)}),{scripts:I(r,e),css:I(s,e),materials:I(o,e),libraryExports:a,materialExports:u.dedupArray(c),materialMapLibrary:m,libraryMap:i,libraryLocaleMap:l}}function oe(n,e){const{name:t,parent:r,alias:s}=n;return r?e[r]?.[s||t]:e[s||t]}function L(n){return u.isString(n)?n:JSON.stringify(n)}function V(n,e,t){const r=n.CSSStyleSheet;if(r.prototype.replaceSync){const s=new r;s.id=e,s.replaceSync(t);const o=n.document,a=o.adoptedStyleSheets,i=Array.from(a).filter(l=>l.id!==e);o.adoptedStyleSheets=[...i,s]}else{const s=n.document;let o=s.getElementById(e);o?o.innerHTML=t:(o=s.createElement("style"),o.id=e,o.innerHTML=t,s.head.appendChild(o))}}async function ie(n,e){const t=await window.fetch(e).then(r=>r.text()).catch(()=>"");t&&V(window,n,t)}function Y(n,e=window){const t=e.document,r=e.document.head;for(const s of n)if(!t.getElementById(s)){const a=t.createElement("link");a.rel="stylesheet",a.id=s,a.href=s,r.appendChild(a)}}async function ae(n,e,t=window){const r=t.document,s=t.document.head;let o=t[e];return o?o.default||o:new Promise((a,i)=>{for(const l of n){const c=r.createElement("script");c.src=l,c.onload=()=>{o=t[e],o&&a(o.default||o)},c.onerror=m=>{i(m)},s.appendChild(c)}})}function ce(n){return u.isFunction(n)||u.isFunction(n?.install)}function R(n,e,t=!1,r=!1){try{const s=['"use strict";',"var __self = arguments[0];"];s.push("return ");let o=(n.value||"").trim();o=o.replace(/this(\W|$)/g,(i,l)=>`__self${l}`),o=s.join(`
8
+ `)+o;const a=`with(${t?"{}":"$scope || {}"}) { ${o} }`;return new Function("$scope",a)(e)}catch(s){if(u.logger.error("parseExpression.error",s,n,e?.__self??e),r)throw s}}function J(n,e,t=!1,r=!1){const s=R(n,e,t,r);if(typeof s!="function"&&(u.logger.error("parseFunction.error","not a function",n,e?.__self??e),r))throw new Error(`"${n.value}" not a function`);return s}function w(n){return n&&n.type==="JSExpression"}function O(n){return typeof n=="object"&&n&&n.type==="JSFunction"}function le(n){return w(n)||O(n)}function Ee(n){return le(n)?n.value:JSON.stringify(n)}let b=null;const be=u.createRequest({settings:{type:"form",validSuccess:!0,originResponse:!1,loading:!0,validate:n=>n.data?.code===0||!!n.data?.success,failMessage:!0,showError:n=>{T.ElNotification.error({message:n||"未知错误"})},showLoading:()=>{b&&b.close(),b=T.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.05)"})},hideLoading:()=>{b&&(b.close(),b=null)}}});function ue(n,e){const{jsonp:t,request:r}=e;if(n.method==="jsonp")return(s={})=>t(n.url,{...n.jsonpOptions,query:s});{const s=n.headers?R(n.headers,{},!0):void 0,o={url:n.url,method:n.method,settings:{...n.settings,headers:s}};return(a,i)=>r.send(u.merge(o,i||{},{data:a}))}}function pe(n=[],e){return n.reduce((t,r)=>(t[r.id]=ue(r,e),t),{})}function de(n=[]){D.setup({timeout:"50-500"}),K(),n.forEach(e=>fe(e))}function fe(n){if(!n.mock)return;const{url:e,mockTemplate:t}=n;if(e&&t){const r=u.pathToRegexp(`${e}(.*)`),s=u.pathToRegexpMatch(e,{decode:decodeURIComponent}),o=R(t,{},!0);D.mock(r,a=>{const i=u.url.parse(a.url)||{},l=a.body instanceof FormData?u.formDataToJson(a.body):a.body,c=s(a.url)?.params;return Object.assign(a,{data:l,params:i,query:c}),D.mock(o(a))})}}function K(){D._mocked={}}class me{__id=null;__mode;__instance=null;__contextRefs={};__refs={};context={};state={};props={};$props={};$refs={};$el=null;$emit=null;$nextTick=null;$parent=null;$root=null;$attrs=null;$slots=null;$watch=null;$options=null;$forceUpdate=null;$components={};$libs={};$apis={};__transform={};constructor(e){const{mode:t,dsl:r,attrs:s}=e;this.__mode=t,r&&(this.__id=r.id||null,this.__transform=r.transform||{}),s&&Object.assign(this,s)}setup(e,t=A){const r=t.getCurrentInstance();if(!r)return;this.__instance=r.proxy;const s=r.appContext.config.globalProperties;Object.assign(this,s),Object.assign(this,e||{}),this.__proxy(),t.onMounted(()=>{this.__proxy()}),t.onUnmounted(()=>{this.__cleanup()})}__proxy(){this.__instance&&q.forEach(e=>{this[e]=this.__instance?.[e]})}__cleanup(){q.forEach(e=>{this[e]=null})}__parseFunction(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:r}=e,s=t?this.__transform[t]??e.value:e.value;return J({type:r,value:s},this)}else return J(e,this)}__parseExpression(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:r}=e,s=t?this.__transform[t]??e.value:e.value;return R({type:r,value:s},this)}else return R(e,this)}__ref(e=null,t){if(this.__mode!==S.VNode)return e&&e!==this.__id&&(this.__contextRefs[e]=this),r=>{let s=r?.$vtjEl||r?.$el||r;if(!s){typeof t=="string"&&(delete this.$refs[t],e&&delete this.__refs[e]);return}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")t(r);else if(t){const o=this.$refs[t];if(o){const a=new Set([].concat(o,r));this.$refs[t]=Array.from(a)}else this.$refs[t]=r}return r}}__clone(e={}){const t={...this.context,...e},r={...t,context:t};return r.context.__proto__=this.context,r.__proto__=this,r}}function x(n){const{Vue:e=A,mode:t=S.Runtime,components:r={},libs:s={},apis:o={},loader:a}=n,i=e.computed(()=>n.dsl),l={$components:r,$libs:s,$apis:o},c=new me({mode:t,dsl:i.value,attrs:l}),m=e.defineComponent({name:i.value.name,props:{...Fe(i.value.props??[],c)},setup(d){c.$props=d,c.props=d,i.value.id&&V(n.window||window,i.value.id,i.value.css||""),c.state=Re(e,i.value.state??{},c);const f=Ie(e,i.value.computed??{},c),v=He(i.value.methods??{},c),h=Oe(e,i.value.inject,c),g=he(i.value.dataSources||{},c),p={...h,...f,...v,...g};return c.setup(p,e),Me(e,i.value.watch??[],c),{vtj:c}},emits:[...i.value.emits??[]],expose:["vtj"],render(){if(!i.value.nodes)return null;const d=i.value.nodes||[];return d.length===1?H(d[0],c,e,a):d.map(f=>H(f,c,e,a))},...Te(i.value.lifeCycles??{},c)});return{renderer:e.markRaw(m),context:c}}function Fe(n=[],e){const t=r=>r?(Array.isArray(r)?r:[r]).map(o=>re[o]):void 0;return n.map(r=>u.isString(r)?{name:r}:{name:r.name,type:r.type,required:r.required,default:w(r.default)?e.__parseExpression(r.default):r.default}).reduce((r,s)=>(r[s.name]={type:t(s.type),required:s.required,default:s.default},r),{})}function Re(n,e,t){return n.reactive(Object.keys(e||{}).reduce((r,s)=>{let o=e[s];return w(o)?o=t.__parseExpression(o):O(o)&&(o=t.__parseFunction(o)),r[s]=o,r},{}))}function Ie(n,e,t){return Object.entries(e??{}).reduce((r,[s,o])=>(r[s]=n.computed(t.__parseFunction(o)),r),{})}function He(n,e){return Object.entries(n??{}).reduce((t,[r,s])=>(t[r]=e.__parseFunction(s),t),{})}function Oe(n,e=[],t){return e.reduce((r,s)=>{const{name:o,from:a}=s||{};s.default;const i=w(a)?t.__parseExpression(a)||o:a??o,l=w(s.default)?t.__parseExpression(s.default):s.default??null;return r[o]=n.inject(i,l),r},{})}function he(n,e){return Object.keys(n).reduce((t,r)=>{const s=n[r],o=e.$apis[s.ref],a=O(s.transform)?s.transform.value?e.__parseFunction(s.transform):void 0:s.transform;return t[r]=async(...i)=>{const l=await o.apply(e,i);return a?a(l):l},t},{})}function Me(n,e=[],t){e.forEach(r=>{n.watch(t.__parseExpression(r.source),t.__parseFunction(r.handler),{deep:r.deep,immediate:r.immediate})})}function Te(n,e){return Object.entries(n??{}).reduce((t,[r,s])=>(t[r]=e.__parseFunction(s),t),{})}const ve=n=>n;async function X(n,e=window){const{urls:t=[],library:r}=n,s=t.filter(l=>N(l));if(s.length===0||!r)return null;const o=t.filter(l=>B(l));let a;const i=await ae(s,r,e).catch(()=>null);return i?.plugin&&(a=i.plugin),a?{component:a,css:o}:null}function k(n){const{getDsl:e,getDslByUrl:t,options:r}=n;return(s,o,a=A)=>!o||typeof o=="string"?s:o.type==="Schema"&&o.id?a.defineAsyncComponent(async()=>{const i=await e(o.id);return i&&(i.name=s),i?x({...r,Vue:a,dsl:i,mode:S.Runtime,loader:k(n)}).renderer:null}):o.type==="UrlSchema"&&o.url?a.defineAsyncComponent(async()=>{const i=await t(o.url);return i&&(i.name=s),i?x({...r,Vue:a,dsl:i,mode:S.Runtime,loader:k(n)}).renderer:null}):o.type==="Plugin"?a.defineAsyncComponent(async()=>{const i=await X(o,r.window);return i?(Y(i.css),i.component):null}):s}function H(n,e,t=A,r=ve){if(!n||!n.name||n.invisible)return null;const{id:s=null,directives:o=[]}=n,{vIf:a,vFor:i,vShow:l,vModels:c,vBind:m}=De(o);if(a&&!xe(a,e))return null;const d=f=>{const v=f.$components,h=(()=>{if(n.name==="component")return ke(f,n.props?.is);if(n.name==="slot")return n.name;const _=r(n.name,n.from,t);return u.isString(_)?v[_]??_:_})(),g=Ae(s,n.props??{},f),p=Be(t,n.events??{},f);if(n.name==="slot")return Ne(t,n,g,f,r);m&&Object.assign(g,f.__parseExpression(m.value)),l&&(g.style=Object.assign(g.style??{},qe(l,f))),c.forEach(_=>{Object.assign(g,Je(t,_,f))});const $=Le(t,n.children??[],f,r,n);return t.createVNode(h,{...g,...p},$)};return i?Ke(i,d,e):d(e)}function De(n=[]){const e=n.find(i=>u.camelCase(i.name)==="vIf"),t=n.find(i=>u.camelCase(i.name)==="vFor"),r=n.find(i=>u.camelCase(i.name)==="vShow"),s=n.find(i=>u.camelCase(i.name)==="vBind"),o=n.filter(i=>u.camelCase(i.name)==="vModel"),a=n.filter(i=>!te.includes(u.camelCase(i.name)));return{vIf:e,vFor:t,vShow:r,vModels:o,vBind:s,others:a}}function xe(n,e){return!!e.__parseExpression(n.value)}function ke(n,e){return e?w(e)?n.__parseExpression(e):e:"div"}function Ae(n,e,t){const r=Object.keys(e||{}).reduce((s,o)=>{let a=e[o];return w(a)?a=t.__parseExpression(a):O(a)&&(a=t.__parseFunction(a)),s[o]=a,s},{});return r.ref=t.__ref(n,r.ref),r}function Be(n,e,t){const r=["passive","capture","once"],s={capture:"Capture",once:"Once",passive:"OnceCapture"};return Object.keys(e||{}).reduce((o,a)=>{const i=e[a],l=W(i.modifiers),c=l.find(f=>r.includes(f)),m="on"+u.upperFirst(a)+(c&&s[c]||""),d=t.__parseFunction(i.handler);return d&&(o[m]=n.withModifiers(d,l)),o},{})}function W(n={},e=!1){const t=Object.keys(n);return e?t.map(r=>"."+r):t}function Ne(n,e,t,r,s){const{children:o}=e,a=Ue(e,r),i=r.$slots?.[a.name];return i?i(t):o?u.isString(o)?n.createTextVNode(o):w(o)?n.createTextVNode(L(r.__parseExpression(o))):Array.isArray(o)?o.map(l=>H(l,r,n,s)):null:null}function Ue(n,e){const{props:t}=n,r=t?.name||"default";return{name:w(r)?e.__parseExpression(r):r,params:[]}}function qe(n,e){return e.__parseExpression(n.value)?{}:{display:"none"}}function Je(n,e,t){const r={type:"JSFunction",value:e.value?.value?`(v) => {
9
9
  ${e.value.value} = v;
10
- }`:"(v) => {}"},s=t.__parseFunction(r),o=W(e.modifiers),i=w(e.arg)?t.__parseExpression(e.arg):e.arg||"modelValue";return{[i]:t.__parseExpression(e.value),[`onUpdate:${i}`]:o.length&&s?n.withModifiers(s,o):s}}function Le(n,e,t,r){if(!e)return null;if(l.isString(e))return{default:()=>e};if(w(e))return{default:()=>L(t.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const s=Ve(e),o=i=>!i||!r?{}:r?.id&&Object.keys(i).length?{[`scope_${r.id}`]:i}:{};return Object.entries(s).reduce((i,[a,{nodes:u,params:c}])=>(i[a]=m=>{const f=c.length?l.pick(m??{},c):o(m);return u.map(d=>H(d,t.__clone(f),n))},i),{})}return null}function Ve(n){const e={default:{params:[],nodes:[]}};for(const t of n){const r=Ye(t.slot),s=r.name;e[s]?(e[s].nodes.push(t),e[s].params=e[s].params.concat(r.params)):e[s]={nodes:[t],params:r.params}}return e}function Ye(n="default"){return l.isString(n)?{name:n,params:[]}:{params:[],...n}}function Ke(n,e,t){const{value:r,iterator:s}=n,{item:o="item",index:i="index"}=s||{};let a=t.__parseExpression(r)||[];return Number.isInteger(a)&&(a=new Array(a).fill(!0).map((u,c)=>c+1)),Array.isArray(a)?a.map((u,c)=>e(t.__clone({[o]:u,[i]:c}))):(console.warn("[vForRender]:",`${r?.value} is not a Arrary`),[])}const Z=j.defineComponent({name:"VtjPageContainer",async setup(){const n=G(),e=ee.useRoute(),t=e.params.id,r=t?n.getPage(t):n.getHomepage(),s=r?await n.getRenderComponent(r.id):null;return r&&Se.useTitle(r.title||"VTJ"),{provider:n,component:s,file:r,query:e.query}},render(){return this.component?j.h(this.component,this.query):j.h("div","页面不存在")}}),Xe=j.defineComponent({name:"VtjStartupContainer",render(){return j.h(we.XStartup)}}),z=Symbol("Provider");class ge extends C.Base{mode;globals={};modules={};adapter={request:be,jsonp:l.jsonp};apis={};dependencies={};materials={};library={};service;project=null;components={};nodeEnv="development";router=null;materialPath="./";urlDslCaches={};constructor(e){super();const{service:t,mode:r=S.Raw,dependencies:s,materials:o,project:i={},adapter:a={},globals:u={},modules:c={},router:m=null,materialPath:f="./",nodeEnv:d="development"}=e;this.mode=r,this.modules=c,this.service=t,this.router=m,this.materialPath=f,this.nodeEnv=d,s&&(this.dependencies=s),o&&(this.materials=o),Object.assign(this.globals,u),Object.assign(this.adapter,a),r!==S.Design&&this.load(i)}async load(e){const t=this.modules[`.vtj/projects/${e.id}.json`];if(this.project=t?await t():await this.service.init(e),!this.project)throw new Error("project is null");const{dependencies:r=[],apis:s}=this.project,{dependencies:o,library:i,components:a,materialPath:u}=this,{libraryExports:c,libraryMap:m,materials:f,materialExports:d,materialMapLibrary:y}=se(r,u),h=window;h.CKEDITOR_VERSION=void 0;for(const p of c){const $=o[p],_=h[p];if(_)i[p]=_;else if($)h[p]=i[p]=await $();else{const P=m[p]||[];for(const E of P)B(E)&&await ie(p,l.url.append(E,{v:F})),N(E)&&await l.loadScript(l.url.append(E,{v:F})),i[p]=h[p]}}for(const p of f)await l.loadScript(l.url.append(p,{v:F}));const v=this.materials||{};for(const p of d){const $=h[y[p]],_=C.BUILT_IN_COMPONENTS[p];if(_)$&&_.forEach(P=>{a[P]=$[P]});else{const P=v[p]?(await v[p]()).default:h[p];P&&$&&(P.components||[]).forEach(E=>{a[E.name]=oe(E,$)})}}s&&(this.apis=pe(s,this.adapter),K(),this.project.config?.mock&&de(s)),this.initRouter(),this.triggerReady()}initRouter(){const{router:e,project:t}=this;e&&(e.addRoute({path:"/page/:id",name:"VtjPage",component:Z}),e.addRoute({path:"/",name:"VtjHomepage",component:t?.homepage?Z:Xe}))}install(e){const t=e.config.globalProperties.installed||{};for(const[r,s]of Object.entries(this.library))!t[r]&&ce(s)&&(e.use(s),t[r]=!0);e.provide(z,this),e.config.globalProperties.installed=t}getFile(e){const{blocks:t=[]}=this.project||{};return this.getPage(e)||t.find(r=>r.id===e)||null}getPage(e){const{pages:t=[]}=this.project||{},r=(s,o=[])=>{for(const i of o){if(i.id===s)return i;if(i.children&&i.children.length){const a=r(s,i.children);if(a)return a}}};return r(e,t)||null}getHomepage(){const{homepage:e}=this.project||{};return e?this.getPage(e):null}async getDsl(e){const t=this.modules[`.vtj/files/${e}.json`];return t?await t():this.service.getFile(e).catch(()=>null)}async getDslByUrl(e){const t=this.urlDslCaches[e];return t||(this.urlDslCaches[e]=this.adapter.request.send({url:e,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(r=>r.data).catch(()=>null))}createDslRenderer(e,t={}){const{library:r,components:s,mode:o,apis:i}=this,a={mode:o,Vue:r.Vue,components:s,libs:r,apis:i,window,...t},u=k({getDsl:async c=>await this.getDsl(c)||null,getDslByUrl:async c=>await this.getDslByUrl(c)||null,options:a});return x({...a,dsl:e,loader:u})}async getRenderComponent(e){const t=this.getFile(e);if(!t)return l.logger.warn(`Can not find file: ${e}`),null;const r=`.vtj/vue/${e}.vue`,s=this.modules[r];if(s)return(await s())?.default;const o=await this.getDsl(t.id);return o?this.createDslRenderer(o).renderer:(l.logger.warn(`Can not find dsl: ${e}`),null)}defineUrlSchemaComponent(e,t){return j.defineAsyncComponent(async()=>{const r=await this.getDslByUrl(e);return r?(r.name=t||r.name,this.createDslRenderer(r).renderer):null})}definePluginComponent(e){return j.defineAsyncComponent(async()=>{const t=await X(e,window);return t?(Y(t.css),t.component):null})}}function We(n){const e=new ge(n);return{provider:e,onReady:r=>e.ready(r)}}function G(n={}){const e=j.inject(z);if(!e)throw new Error("Can not find provider");if(e.mode===S.Raw&&e.nodeEnv==="development"){const{id:t,version:r}=n;t&&r&&(async()=>{const s=await e.getDsl(t);s?.__VERSION__!==r&&T.ElNotification.warning({title:s?.name,message:"当前组件源码版本与运行时版本不一致,请重新发布组件"})})()}return e}const Q=new l.Request({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:n=>n.data?.code===0,showError:n=>{T.ElNotification.error({message:n||"未知错误"})}}}),ze=(n="/vtj/local/repository/${type}.json")=>(e,t)=>Q.send({url:n,method:"post",query:{type:e},data:{type:e,data:t}}),Ge=(n="/vtj/local/repository/uploader.json")=>async(e,t)=>await Q.send({url:n,method:"post",data:{files:e,projectId:t},settings:{type:"data"}}).then(r=>r&&r[0]?r[0]:null).catch(()=>null);class U{api;pluginCaches={};uploader;constructor(){this.api=ze(),this.uploader=Ge()}async init(e){return console.log("BaseService.init",e),{}}async saveProject(e){return!!await this.api("saveProject",e).catch(()=>!1)}async saveMaterials(e,t){return console.log("BaseService.saveMaterials",e,t),!1}async saveFile(e){return console.log("BaseService.saveFile",e),!1}async getFile(e){return console.log("BaseService.getFile",e),{}}async removeFile(e){return console.log("BaseService.removeFile",e),!1}async saveHistory(e){return console.log("BaseService.saveHistory",e),!1}async removeHistory(e){return console.log("BaseService.removeHistory",e),!1}async getHistory(e){return console.log("BaseService.getHistory",e),{}}async getHistoryItem(e,t){return console.log("BaseService.getHistoryItem",e,t),{}}async saveHistoryItem(e,t){return console.log("BaseService.saveHistoryItem",e,t),!1}async removeHistoryItem(e,t){return console.log("BaseService.removeHistoryItem",e,t),!1}async publish(e){return!!await this.api("publish",e).catch(()=>!1)}async publishFile(e,t){return!!await this.api("publishFile",{project:e,file:t}).catch(()=>!1)}async genVueContent(e,t){return await this.api("genVueContent",{project:e,dsl:t}).catch(()=>"")}async createRawPage(e){return await this.api("createRawPage",e).catch(()=>"")}async removeRawPage(e){return await this.api("removeRawPage",e).catch(()=>"")}async uploadStaticFile(e,t){return await this.uploader(e,t).catch(()=>null)}async getStaticFiles(e){return await this.api("getStaticFiles",e).catch(()=>[])}async removeStaticFile(e,t){return await this.api("removeStaticFile",{name:e,projectId:t}).catch(()=>"")}async clearStaticFiles(e){return await this.api("clearStaticFiles",e).catch(()=>"")}async getPluginMaterial(e){const{urls:t=[]}=e,r=t.filter(o=>ne(o))[0];if(!r)return null;const s=this.pluginCaches[r];return s||(this.pluginCaches[r]=Q.send({url:r,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(o=>o.data).catch(()=>null))}}const g=new l.Storage({type:"local",expired:0,prefix:"__VTJ_"});class Qe extends U{init(e){const t=new C.ProjectModel(e),r=g.get(`project_${t.id}`),s=Object.assign(t.toDsl(),r||{});return g.save(`project_${t.id}`,s),Promise.resolve(s)}saveProject(e){const t=new C.ProjectModel(e);return g.save(`project_${t.id}`,t.toDsl()),Promise.resolve(!0)}saveMaterials(e,t){return g.save(`materials_${e.id}`,l.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return g.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const t=g.get(`file_${e}`);return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return g.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return g.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const t=g.get(`history_${e}`);if(t){const s=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,s),g.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const t=g.get(`history_${e}`),r=new C.HistoryModel(t||{id:e});return Promise.resolve(r.toDsl())}getHistoryItem(e,t){const r=g.get(`history_${e}_${t}`);return Promise.resolve(r)}saveHistoryItem(e,t){return g.save(`history_${e}_${t.id}`,t),Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(r=>{g.remove(`history_${e}_${r}`)}),Promise.resolve(!0)}}class ye extends U{projects={};materials={};files={};histories={};historyItems={};init(e){const t=new C.ProjectModel(e),r=this.projects[t.id]||{},s=Object.assign(t.toDsl(),r);return this.projects[s.id]=s,Promise.resolve(s)}saveProject(e){const t=new C.ProjectModel(e);return this.projects[t.id]=t.toDsl(),Promise.resolve(!0)}saveMaterials(e,t){return e.id&&(this.materials[e.id]=l.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return this.files[e.id]=e,Promise.resolve(!0)}getFile(e){const t=this.files[e];return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return delete this.files[e],Promise.resolve(!0)}saveHistory(e){return this.histories[e.id]=e,Promise.resolve(!0)}removeHistory(e){const t=this.histories[e];if(t){const s=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,s),delete this.historyItems[e]}return Promise.resolve(!0)}getHistory(e){const t=this.histories[e],r=new C.HistoryModel(t||{id:e});return Promise.resolve(r)}getHistoryItem(e,t){const r=`${e}_${t}`,s=this.historyItems[r]||{};return Promise.resolve(s)}saveHistoryItem(e,t){const r=`${e}_${t.id}`;return this.historyItems[r]=t,Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(r=>{const s=`${e}_${r}`;delete this.historyItems[s]}),Promise.resolve(!0)}}let M=null;function Ze(){return M||(M=new ye,M)}class et extends U{getFileCaches={};async init(e){return await this.api("init",e).catch(()=>null)||{}}async saveProject(e){return!!await this.api("saveProject",e).catch(()=>!1)}async saveMaterials(e,t){return!!await this.api("saveMaterials",{project:e,materials:l.mapToObject(t)}).catch(()=>!1)}async saveFile(e){return!!await this.api("saveFile",e).catch(()=>!1)}async getFile(e){const t=this.getFileCaches[e];return t||(this.getFileCaches[e]=this.api("getFile",e).catch(()=>null)).finally(()=>{delete this.getFileCaches[e]})}async removeFile(e){return!!await this.api("removeFile",e).catch(()=>!1)}async saveHistory(e){return!!await this.api("saveHistory",e).catch(()=>!1)}async removeHistory(e){return!!await this.api("removeHistory",e).catch(()=>!1)}async getHistory(e){return await this.api("getHistory",e).catch(()=>null)||{}}async getHistoryItem(e,t){return await this.api("getHistoryItem",{fId:e,id:t}).catch(()=>null)||{}}async saveHistoryItem(e,t){return!!await this.api("saveHistoryItem",{fId:e,item:t}).catch(()=>!1)}async removeHistoryItem(e,t){return!!await this.api("removeHistoryItem",{fId:e,ids:t}).catch(()=>!1)}}function _e(n=[]){return n.map(e=>{const{id:t,title:r,icon:s,children:o,hidden:i}=e;return{id:t,title:r,icon:s,hidden:i,url:`/page/${t}`,children:o&&o.length?_e(o):void 0}})}function tt(){const n=G(),e=ee.useRoute(),t=j.ref(!1),r=n.project;j.watchEffect(()=>{const{name:i,params:a,meta:u}=e;if(i==="VtjPage"){const c=n.getPage(a.id);t.value=!c?.mask}else if(i==="VtjHomepage"){const c=n.getHomepage();t.value=!c?.mask}else t.value=!u.mask});const s=_e(r?.pages),o=r?.config;return{disabled:t,logo:o?.logo,themeSwitchable:o?.themeSwitchable,title:o?.title||r?.description||r?.name||"VTJ App",menus:s}}exports.BUILT_IN_DIRECTIVES=te;exports.BaseService=U;exports.CONTEXT_HOST=q;exports.Context=me;exports.ContextMode=S;exports.DATA_TYPES=re;exports.JSCodeToString=Ee;exports.LIFE_CYCLES_LIST=$e;exports.LocalService=et;exports.MemoryService=ye;exports.Provider=ge;exports.StorageService=Qe;exports.VTJ_RENDERER_VERSION=F;exports.adoptedStyleSheets=V;exports.createAssetScripts=Ce;exports.createAssetsCss=Pe;exports.createDataSources=he;exports.createLoader=k;exports.createMemoryService=Ze;exports.createProvider=We;exports.createRenderer=x;exports.createSchemaApi=ue;exports.createSchemaApis=pe;exports.defaultLoader=ve;exports.fillBasePath=I;exports.getModifiers=W;exports.getPlugin=X;exports.getRawComponent=oe;exports.isCSSUrl=B;exports.isJSCode=le;exports.isJSExpression=w;exports.isJSFunction=O;exports.isJSON=ne;exports.isJSUrl=N;exports.isVuePlugin=ce;exports.loadCss=ie;exports.loadCssUrl=Y;exports.loadScriptUrl=ae;exports.mockApi=fe;exports.mockApis=de;exports.mockCleanup=K;exports.nodeRender=H;exports.parseDeps=se;exports.parseExpression=R;exports.parseFunction=J;exports.providerKey=z;exports.toString=L;exports.useMask=tt;exports.useProvider=G;
10
+ }`:"(v) => {}"},s=t.__parseFunction(r),o=W(e.modifiers),a=w(e.arg)?t.__parseExpression(e.arg):e.arg||"modelValue";return{[a]:t.__parseExpression(e.value),[`onUpdate:${a}`]:o.length&&s?n.withModifiers(s,o):s}}function Le(n,e,t,r,s){if(!e)return null;if(u.isString(e))return{default:()=>e};if(w(e))return{default:()=>L(t.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const o=Ve(e),a=i=>!i||!s?{}:s?.id&&Object.keys(i).length?{[`scope_${s.id}`]:i}:{};return Object.entries(o).reduce((i,[l,{nodes:c,params:m}])=>(i[l]=d=>{const f=m.length?u.pick(d??{},m):a(d);return c.map(v=>H(v,t.__clone(f),n,r))},i),{})}return null}function Ve(n){const e={default:{params:[],nodes:[]}};for(const t of n){const r=Ye(t.slot),s=r.name;e[s]?(e[s].nodes.push(t),e[s].params=e[s].params.concat(r.params)):e[s]={nodes:[t],params:r.params}}return e}function Ye(n="default"){return u.isString(n)?{name:n,params:[]}:{params:[],...n}}function Ke(n,e,t){const{value:r,iterator:s}=n,{item:o="item",index:a="index"}=s||{};let i=t.__parseExpression(r)||[];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`),[])}const Z=j.defineComponent({name:"VtjPageContainer",async setup(){const n=G(),e=ee.useRoute(),t=e.params.id,r=t?n.getPage(t):n.getHomepage(),s=r?await n.getRenderComponent(r.id):null;return r&&Se.useTitle(r.title||"VTJ"),{provider:n,component:s,file:r,query:e.query}},render(){return this.component?j.h(this.component,this.query):j.h("div","页面不存在")}}),Xe=j.defineComponent({name:"VtjStartupContainer",render(){return j.h(we.XStartup)}}),z=Symbol("Provider");class ge extends C.Base{mode;globals={};modules={};adapter={request:be,jsonp:u.jsonp};apis={};dependencies={};materials={};library={};service;project=null;components={};nodeEnv="development";router=null;materialPath="./";urlDslCaches={};constructor(e){super();const{service:t,mode:r=S.Raw,dependencies:s,materials:o,project:a={},adapter:i={},globals:l={},modules:c={},router:m=null,materialPath:d="./",nodeEnv:f="development"}=e;this.mode=r,this.modules=c,this.service=t,this.router=m,this.materialPath=d,this.nodeEnv=f,s&&(this.dependencies=s),o&&(this.materials=o),Object.assign(this.globals,l),Object.assign(this.adapter,i),r!==S.Design&&this.load(a)}async load(e){const t=this.modules[`.vtj/projects/${e.id}.json`];if(this.project=t?await t():await this.service.init(e),!this.project)throw new Error("project is null");const{dependencies:r=[],apis:s}=this.project,{dependencies:o,library:a,components:i,materialPath:l}=this,{libraryExports:c,libraryMap:m,materials:d,materialExports:f,materialMapLibrary:v}=se(r,l),h=window;h.CKEDITOR_VERSION=void 0;for(const p of c){const $=o[p],_=h[p];if(_)a[p]=_;else if($)h[p]=a[p]=await $();else{const P=m[p]||[];for(const E of P)B(E)&&await ie(p,u.url.append(E,{v:F})),N(E)&&await u.loadScript(u.url.append(E,{v:F})),a[p]=h[p]}}for(const p of d)await u.loadScript(u.url.append(p,{v:F}));const g=this.materials||{};for(const p of f){const $=h[v[p]],_=C.BUILT_IN_COMPONENTS[p];if(_)$&&_.forEach(P=>{i[P]=$[P]});else{const P=g[p]?(await g[p]()).default:h[p];P&&$&&(P.components||[]).forEach(E=>{i[E.name]=oe(E,$)})}}s&&(this.apis=pe(s,this.adapter),K(),this.project.config?.mock&&de(s)),this.initRouter(),this.triggerReady()}initRouter(){const{router:e,project:t}=this;e&&(e.addRoute({path:"/page/:id",name:"VtjPage",component:Z}),e.addRoute({path:"/",name:"VtjHomepage",component:t?.homepage?Z:Xe}))}install(e){const t=e.config.globalProperties.installed||{};for(const[r,s]of Object.entries(this.library))!t[r]&&ce(s)&&(e.use(s),t[r]=!0);e.provide(z,this),e.config.globalProperties.installed=t}getFile(e){const{blocks:t=[]}=this.project||{};return this.getPage(e)||t.find(r=>r.id===e)||null}getPage(e){const{pages:t=[]}=this.project||{},r=(s,o=[])=>{for(const a of o){if(a.id===s)return a;if(a.children&&a.children.length){const i=r(s,a.children);if(i)return i}}};return r(e,t)||null}getHomepage(){const{homepage:e}=this.project||{};return e?this.getPage(e):null}async getDsl(e){const t=this.modules[`.vtj/files/${e}.json`];return t?await t():this.service.getFile(e).catch(()=>null)}async getDslByUrl(e){const t=this.urlDslCaches[e];return t||(this.urlDslCaches[e]=this.adapter.request.send({url:e,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(r=>r.data).catch(()=>null))}createDslRenderer(e,t={}){const{library:r,components:s,mode:o,apis:a}=this,i={mode:o,Vue:r.Vue,components:s,libs:r,apis:a,window,...t},l=k({getDsl:async c=>await this.getDsl(c)||null,getDslByUrl:async c=>await this.getDslByUrl(c)||null,options:i});return x({...i,dsl:e,loader:l})}async getRenderComponent(e){const t=this.getFile(e);if(!t)return u.logger.warn(`Can not find file: ${e}`),null;const r=`.vtj/vue/${e}.vue`,s=this.modules[r];if(s)return(await s())?.default;const o=await this.getDsl(t.id);return o?this.createDslRenderer(o).renderer:(u.logger.warn(`Can not find dsl: ${e}`),null)}defineUrlSchemaComponent(e,t){return j.defineAsyncComponent(async()=>{const r=await this.getDslByUrl(e);return r?(r.name=t||r.name,this.createDslRenderer(r).renderer):null})}definePluginComponent(e){return j.defineAsyncComponent(async()=>{const t=await X(e,window);return t?(Y(t.css),t.component):null})}}function We(n){const e=new ge(n);return{provider:e,onReady:r=>e.ready(r)}}function G(n={}){const e=j.inject(z);if(!e)throw new Error("Can not find provider");if(e.mode===S.Raw&&e.nodeEnv==="development"){const{id:t,version:r}=n;t&&r&&(async()=>{const s=await e.getDsl(t);s?.__VERSION__!==r&&T.ElNotification.warning({title:s?.name,message:"当前组件源码版本与运行时版本不一致,请重新发布组件"})})()}return e}const Q=new u.Request({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:n=>n.data?.code===0,showError:n=>{T.ElNotification.error({message:n||"未知错误"})}}}),ze=(n="/vtj/local/repository/${type}.json")=>(e,t)=>Q.send({url:n,method:"post",query:{type:e},data:{type:e,data:t}}),Ge=(n="/vtj/local/repository/uploader.json")=>async(e,t)=>await Q.send({url:n,method:"post",data:{files:e,projectId:t},settings:{type:"data"}}).then(r=>r&&r[0]?r[0]:null).catch(()=>null);class U{api;pluginCaches={};uploader;constructor(){this.api=ze(),this.uploader=Ge()}async init(e){return console.log("BaseService.init",e),{}}async saveProject(e){return!!await this.api("saveProject",e).catch(()=>!1)}async saveMaterials(e,t){return console.log("BaseService.saveMaterials",e,t),!1}async saveFile(e){return console.log("BaseService.saveFile",e),!1}async getFile(e){return console.log("BaseService.getFile",e),{}}async removeFile(e){return console.log("BaseService.removeFile",e),!1}async saveHistory(e){return console.log("BaseService.saveHistory",e),!1}async removeHistory(e){return console.log("BaseService.removeHistory",e),!1}async getHistory(e){return console.log("BaseService.getHistory",e),{}}async getHistoryItem(e,t){return console.log("BaseService.getHistoryItem",e,t),{}}async saveHistoryItem(e,t){return console.log("BaseService.saveHistoryItem",e,t),!1}async removeHistoryItem(e,t){return console.log("BaseService.removeHistoryItem",e,t),!1}async publish(e){return!!await this.api("publish",e).catch(()=>!1)}async publishFile(e,t){return!!await this.api("publishFile",{project:e,file:t}).catch(()=>!1)}async genVueContent(e,t){return await this.api("genVueContent",{project:e,dsl:t}).catch(()=>"")}async createRawPage(e){return await this.api("createRawPage",e).catch(()=>"")}async removeRawPage(e){return await this.api("removeRawPage",e).catch(()=>"")}async uploadStaticFile(e,t){return await this.uploader(e,t).catch(()=>null)}async getStaticFiles(e){return await this.api("getStaticFiles",e).catch(()=>[])}async removeStaticFile(e,t){return await this.api("removeStaticFile",{name:e,projectId:t}).catch(()=>"")}async clearStaticFiles(e){return await this.api("clearStaticFiles",e).catch(()=>"")}async getPluginMaterial(e){const{urls:t=[]}=e,r=t.filter(o=>ne(o))[0];if(!r)return null;const s=this.pluginCaches[r];return s||(this.pluginCaches[r]=Q.send({url:r,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(o=>o.data).catch(()=>null))}}const y=new u.Storage({type:"local",expired:0,prefix:"__VTJ_"});class Qe extends U{init(e){const t=new C.ProjectModel(e),r=y.get(`project_${t.id}`),s=Object.assign(t.toDsl(),r||{});return y.save(`project_${t.id}`,s),Promise.resolve(s)}saveProject(e){const t=new C.ProjectModel(e);return y.save(`project_${t.id}`,t.toDsl()),Promise.resolve(!0)}saveMaterials(e,t){return y.save(`materials_${e.id}`,u.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return y.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const t=y.get(`file_${e}`);return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return y.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return y.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const t=y.get(`history_${e}`);if(t){const s=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,s),y.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const t=y.get(`history_${e}`),r=new C.HistoryModel(t||{id:e});return Promise.resolve(r.toDsl())}getHistoryItem(e,t){const r=y.get(`history_${e}_${t}`);return Promise.resolve(r)}saveHistoryItem(e,t){return y.save(`history_${e}_${t.id}`,t),Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(r=>{y.remove(`history_${e}_${r}`)}),Promise.resolve(!0)}}class ye extends U{projects={};materials={};files={};histories={};historyItems={};init(e){const t=new C.ProjectModel(e),r=this.projects[t.id]||{},s=Object.assign(t.toDsl(),r);return this.projects[s.id]=s,Promise.resolve(s)}saveProject(e){const t=new C.ProjectModel(e);return this.projects[t.id]=t.toDsl(),Promise.resolve(!0)}saveMaterials(e,t){return e.id&&(this.materials[e.id]=u.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return this.files[e.id]=e,Promise.resolve(!0)}getFile(e){const t=this.files[e];return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return delete this.files[e],Promise.resolve(!0)}saveHistory(e){return this.histories[e.id]=e,Promise.resolve(!0)}removeHistory(e){const t=this.histories[e];if(t){const s=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,s),delete this.historyItems[e]}return Promise.resolve(!0)}getHistory(e){const t=this.histories[e],r=new C.HistoryModel(t||{id:e});return Promise.resolve(r)}getHistoryItem(e,t){const r=`${e}_${t}`,s=this.historyItems[r]||{};return Promise.resolve(s)}saveHistoryItem(e,t){const r=`${e}_${t.id}`;return this.historyItems[r]=t,Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(r=>{const s=`${e}_${r}`;delete this.historyItems[s]}),Promise.resolve(!0)}}let M=null;function Ze(){return M||(M=new ye,M)}class et extends U{getFileCaches={};async init(e){return await this.api("init",e).catch(()=>null)||{}}async saveProject(e){return!!await this.api("saveProject",e).catch(()=>!1)}async saveMaterials(e,t){return!!await this.api("saveMaterials",{project:e,materials:u.mapToObject(t)}).catch(()=>!1)}async saveFile(e){return!!await this.api("saveFile",e).catch(()=>!1)}async getFile(e){const t=this.getFileCaches[e];return t||(this.getFileCaches[e]=this.api("getFile",e).catch(()=>null)).finally(()=>{delete this.getFileCaches[e]})}async removeFile(e){return!!await this.api("removeFile",e).catch(()=>!1)}async saveHistory(e){return!!await this.api("saveHistory",e).catch(()=>!1)}async removeHistory(e){return!!await this.api("removeHistory",e).catch(()=>!1)}async getHistory(e){return await this.api("getHistory",e).catch(()=>null)||{}}async getHistoryItem(e,t){return await this.api("getHistoryItem",{fId:e,id:t}).catch(()=>null)||{}}async saveHistoryItem(e,t){return!!await this.api("saveHistoryItem",{fId:e,item:t}).catch(()=>!1)}async removeHistoryItem(e,t){return!!await this.api("removeHistoryItem",{fId:e,ids:t}).catch(()=>!1)}}function _e(n=[]){return n.map(e=>{const{id:t,title:r,icon:s,children:o,hidden:a}=e;return{id:t,title:r,icon:s,hidden:a,url:`/page/${t}`,children:o&&o.length?_e(o):void 0}})}function tt(){const n=G(),e=ee.useRoute(),t=j.ref(!1),r=n.project;j.watchEffect(()=>{const{name:a,params:i,meta:l}=e;if(a==="VtjPage"){const c=n.getPage(i.id);t.value=!c?.mask}else if(a==="VtjHomepage"){const c=n.getHomepage();t.value=!c?.mask}else t.value=!l.mask});const s=_e(r?.pages),o=r?.config;return{disabled:t,logo:o?.logo,themeSwitchable:o?.themeSwitchable,title:o?.title||r?.description||r?.name||"VTJ App",menus:s}}exports.BUILT_IN_DIRECTIVES=te;exports.BaseService=U;exports.CONTEXT_HOST=q;exports.Context=me;exports.ContextMode=S;exports.DATA_TYPES=re;exports.JSCodeToString=Ee;exports.LIFE_CYCLES_LIST=$e;exports.LocalService=et;exports.MemoryService=ye;exports.Provider=ge;exports.StorageService=Qe;exports.VTJ_RENDERER_VERSION=F;exports.adoptedStyleSheets=V;exports.createAssetScripts=Ce;exports.createAssetsCss=Pe;exports.createDataSources=he;exports.createLoader=k;exports.createMemoryService=Ze;exports.createProvider=We;exports.createRenderer=x;exports.createSchemaApi=ue;exports.createSchemaApis=pe;exports.defaultLoader=ve;exports.fillBasePath=I;exports.getModifiers=W;exports.getPlugin=X;exports.getRawComponent=oe;exports.isCSSUrl=B;exports.isJSCode=le;exports.isJSExpression=w;exports.isJSFunction=O;exports.isJSON=ne;exports.isJSUrl=N;exports.isVuePlugin=ce;exports.loadCss=ie;exports.loadCssUrl=Y;exports.loadScriptUrl=ae;exports.mockApi=fe;exports.mockApis=de;exports.mockCleanup=K;exports.nodeRender=H;exports.parseDeps=se;exports.parseExpression=R;exports.parseFunction=J;exports.providerKey=z;exports.toString=L;exports.useMask=tt;exports.useProvider=G;
package/dist/index.mjs CHANGED
@@ -11,10 +11,10 @@ import { XStartup as Ie } from "@vtj/ui";
11
11
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
12
12
  * @name @vtj/renderer
13
13
  * @author CHC chenhuachun1549@dingtalk.com
14
- * @version 0.8.3
14
+ * @version 0.8.4
15
15
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
16
16
  */
17
- const b = "0.8.3";
17
+ const b = "0.8.4";
18
18
  var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
19
19
  const z = [
20
20
  "$el",
@@ -74,21 +74,21 @@ function Rt(n = []) {
74
74
  ).join("");
75
75
  }
76
76
  function De(n, e) {
77
- const t = n.filter((f) => !!f.enabled), r = [], s = [], o = [], i = [], a = {}, l = {}, c = [], d = {};
77
+ const t = n.filter((p) => !!p.enabled), r = [], s = [], o = [], a = [], i = {}, l = {}, c = [], d = {};
78
78
  return t.forEach(
79
- ({ urls: f, assetsUrl: p, library: y, assetsLibrary: m, localeLibrary: h }) => {
80
- f?.forEach((u) => {
79
+ ({ urls: p, assetsUrl: f, library: h, assetsLibrary: m, localeLibrary: v }) => {
80
+ p?.forEach((u) => {
81
81
  V(u) && r.push(u), J(u) && s.push(u);
82
- }), y && (i.push(y), a[y] = I(f || [], e), h && (l[y] = h)), p && o.push(p), m && c.push(m), y && m && (d[m] = y);
82
+ }), h && (a.push(h), i[h] = I(p || [], e), v && (l[h] = v)), f && o.push(f), m && c.push(m), h && m && (d[m] = h);
83
83
  }
84
84
  ), {
85
85
  scripts: I(r, e),
86
86
  css: I(s, e),
87
87
  materials: I(o, e),
88
- libraryExports: i,
88
+ libraryExports: a,
89
89
  materialExports: me(c),
90
90
  materialMapLibrary: d,
91
- libraryMap: a,
91
+ libraryMap: i,
92
92
  libraryLocaleMap: l
93
93
  };
94
94
  }
@@ -104,10 +104,10 @@ function ne(n, e, t) {
104
104
  if (r.prototype.replaceSync) {
105
105
  const s = new r();
106
106
  s.id = e, s.replaceSync(t);
107
- const o = n.document, i = o.adoptedStyleSheets, a = Array.from(i).filter(
107
+ const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
108
108
  (l) => l.id !== e
109
109
  );
110
- o.adoptedStyleSheets = [...a, s];
110
+ o.adoptedStyleSheets = [...i, s];
111
111
  } else {
112
112
  const s = n.document;
113
113
  let o = s.getElementById(e);
@@ -122,20 +122,20 @@ function se(n, e = window) {
122
122
  const t = e.document, r = e.document.head;
123
123
  for (const s of n)
124
124
  if (!t.getElementById(s)) {
125
- const i = t.createElement("link");
126
- i.rel = "stylesheet", i.id = s, i.href = s, r.appendChild(i);
125
+ const a = t.createElement("link");
126
+ a.rel = "stylesheet", a.id = s, a.href = s, r.appendChild(a);
127
127
  }
128
128
  }
129
129
  async function Te(n, e, t = window) {
130
130
  const r = t.document, s = t.document.head;
131
131
  let o = t[e];
132
- return o ? o.default || o : new Promise((i, a) => {
132
+ return o ? o.default || o : new Promise((a, i) => {
133
133
  for (const l of n) {
134
134
  const c = r.createElement("script");
135
135
  c.src = l, c.onload = () => {
136
- o = t[e], o && i(o.default || o);
136
+ o = t[e], o && a(o.default || o);
137
137
  }, c.onerror = (d) => {
138
- a(d);
138
+ i(d);
139
139
  }, s.appendChild(c);
140
140
  }
141
141
  });
@@ -148,10 +148,10 @@ function R(n, e, t = !1, r = !1) {
148
148
  const s = ['"use strict";', "var __self = arguments[0];"];
149
149
  s.push("return ");
150
150
  let o = (n.value || "").trim();
151
- o = o.replace(/this(\W|$)/g, (a, l) => `__self${l}`), o = s.join(`
151
+ o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = s.join(`
152
152
  `) + o;
153
- const i = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
154
- return new Function("$scope", i)(e);
153
+ const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
154
+ return new Function("$scope", a)(e);
155
155
  } catch (s) {
156
156
  if (O.error("parseExpression.error", s, n, e?.__self ?? e), r)
157
157
  throw s;
@@ -222,7 +222,7 @@ function Ue(n, e) {
222
222
  headers: s
223
223
  }
224
224
  };
225
- return (i, a) => r.send(ve(o, a || {}, { data: i }));
225
+ return (a, i) => r.send(ve(o, i || {}, { data: a }));
226
226
  }
227
227
  }
228
228
  function qe(n = [], e) {
@@ -242,9 +242,9 @@ function Ve(n) {
242
242
  const { url: e, mockTemplate: t } = n;
243
243
  if (e && t) {
244
244
  const r = ye(`${e}(.*)`), s = ge(e, { decode: decodeURIComponent }), o = R(t, {}, !0);
245
- D.mock(r, (i) => {
246
- const a = F.parse(i.url) || {}, l = i.body instanceof FormData ? _e(i.body) : i.body, c = s(i.url)?.params;
247
- return Object.assign(i, { data: l, params: a, query: c }), D.mock(o(i));
245
+ D.mock(r, (a) => {
246
+ const i = F.parse(a.url) || {}, l = a.body instanceof FormData ? _e(a.body) : a.body, c = s(a.url)?.params;
247
+ return Object.assign(a, { data: l, params: i, query: c }), D.mock(o(a));
248
248
  });
249
249
  }
250
250
  }
@@ -331,8 +331,8 @@ class Le {
331
331
  else if (t) {
332
332
  const o = this.$refs[t];
333
333
  if (o) {
334
- const i = new Set([].concat(o, r));
335
- this.$refs[t] = Array.from(i);
334
+ const a = new Set([].concat(o, r));
335
+ this.$refs[t] = Array.from(a);
336
336
  } else
337
337
  this.$refs[t] = r;
338
338
  }
@@ -354,48 +354,48 @@ function B(n) {
354
354
  components: r = {},
355
355
  libs: s = {},
356
356
  apis: o = {},
357
- loader: i
358
- } = n, a = e.computed(() => n.dsl), l = {
357
+ loader: a
358
+ } = n, i = e.computed(() => n.dsl), l = {
359
359
  $components: r,
360
360
  $libs: s,
361
361
  $apis: o
362
362
  }, c = new Le({
363
363
  mode: t,
364
- dsl: a.value,
364
+ dsl: i.value,
365
365
  attrs: l
366
366
  }), d = e.defineComponent({
367
- name: a.value.name,
367
+ name: i.value.name,
368
368
  props: {
369
- ...Ke(a.value.props ?? [], c)
369
+ ...Ke(i.value.props ?? [], c)
370
370
  },
371
- setup(f) {
372
- c.$props = f, c.props = f, a.value.id && ne(
371
+ setup(p) {
372
+ c.$props = p, c.props = p, i.value.id && ne(
373
373
  n.window || window,
374
- a.value.id,
375
- a.value.css || ""
376
- ), c.state = We(e, a.value.state ?? {}, c);
377
- const p = Xe(e, a.value.computed ?? {}, c), y = Ye(a.value.methods ?? {}, c), m = ze(e, a.value.inject, c), h = Ge(
378
- a.value.dataSources || {},
374
+ i.value.id,
375
+ i.value.css || ""
376
+ ), c.state = We(e, i.value.state ?? {}, c);
377
+ const f = Xe(e, i.value.computed ?? {}, c), h = Ye(i.value.methods ?? {}, c), m = ze(e, i.value.inject, c), v = Ge(
378
+ i.value.dataSources || {},
379
379
  c
380
380
  ), u = {
381
381
  ...m,
382
- ...p,
383
- ...y,
384
- ...h
382
+ ...f,
383
+ ...h,
384
+ ...v
385
385
  };
386
- return c.setup(u, e), Qe(e, a.value.watch ?? [], c), {
386
+ return c.setup(u, e), Qe(e, i.value.watch ?? [], c), {
387
387
  vtj: c
388
388
  };
389
389
  },
390
- emits: [...a.value.emits ?? []],
390
+ emits: [...i.value.emits ?? []],
391
391
  expose: ["vtj"],
392
392
  render() {
393
- if (!a.value.nodes)
393
+ if (!i.value.nodes)
394
394
  return null;
395
- const f = a.value.nodes || [];
396
- return f.length === 1 ? M(f[0], c, e, i) : f.map((p) => M(p, c, e, i));
395
+ const p = i.value.nodes || [];
396
+ return p.length === 1 ? M(p[0], c, e, a) : p.map((f) => M(f, c, e, a));
397
397
  },
398
- ...Ze(a.value.lifeCycles ?? {}, c)
398
+ ...Ze(i.value.lifeCycles ?? {}, c)
399
399
  });
400
400
  return {
401
401
  renderer: e.markRaw(d),
@@ -446,10 +446,10 @@ function Ye(n, e) {
446
446
  function ze(n, e = [], t) {
447
447
  return e.reduce(
448
448
  (r, s) => {
449
- const { name: o, from: i } = s || {};
449
+ const { name: o, from: a } = s || {};
450
450
  s.default;
451
- const a = w(i) ? t.__parseExpression(i) || o : i ?? o, l = w(s.default) ? t.__parseExpression(s.default) : s.default ?? null;
452
- return r[o] = n.inject(a, l), r;
451
+ const i = w(a) ? t.__parseExpression(a) || o : a ?? o, l = w(s.default) ? t.__parseExpression(s.default) : s.default ?? null;
452
+ return r[o] = n.inject(i, l), r;
453
453
  },
454
454
  {}
455
455
  );
@@ -457,10 +457,10 @@ function ze(n, e = [], t) {
457
457
  function Ge(n, e) {
458
458
  return Object.keys(n).reduce(
459
459
  (t, r) => {
460
- const s = n[r], o = e.$apis[s.ref], i = T(s.transform) ? s.transform.value ? e.__parseFunction(s.transform) : void 0 : s.transform;
461
- return t[r] = async (...a) => {
462
- const l = await o.apply(e, a);
463
- return i ? i(l) : l;
460
+ const s = n[r], o = e.$apis[s.ref], a = T(s.transform) ? s.transform.value ? e.__parseFunction(s.transform) : void 0 : s.transform;
461
+ return t[r] = async (...i) => {
462
+ const l = await o.apply(e, i);
463
+ return a ? a(l) : l;
464
464
  }, t;
465
465
  },
466
466
  {}
@@ -490,71 +490,77 @@ async function ie(n, e = window) {
490
490
  if (s.length === 0 || !r)
491
491
  return null;
492
492
  const o = t.filter((l) => J(l));
493
- let i;
494
- const a = await Te(s, r, e).catch(
493
+ let a;
494
+ const i = await Te(s, r, e).catch(
495
495
  () => null
496
496
  );
497
- return a?.plugin && (i = a.plugin), i ? {
498
- component: i,
497
+ return i?.plugin && (a = i.plugin), a ? {
498
+ component: a,
499
499
  css: o
500
500
  } : null;
501
501
  }
502
502
  function N(n) {
503
503
  const { getDsl: e, getDslByUrl: t, options: r } = n;
504
- return (s, o, i = k) => !o || typeof o == "string" ? s : o.type === "Schema" && o.id ? i.defineAsyncComponent(async () => {
505
- const a = await e(o.id);
506
- return a && (a.name = s), a ? B({
504
+ return (s, o, a = k) => !o || typeof o == "string" ? s : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
505
+ const i = await e(o.id);
506
+ return i && (i.name = s), i ? B({
507
507
  ...r,
508
- Vue: i,
509
- dsl: a,
508
+ Vue: a,
509
+ dsl: i,
510
510
  mode: _.Runtime,
511
511
  loader: N(n)
512
512
  }).renderer : null;
513
- }) : o.type === "UrlSchema" && o.url ? i.defineAsyncComponent(async () => {
514
- const a = await t(o.url);
515
- return a && (a.name = s), a ? B({
513
+ }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
514
+ const i = await t(o.url);
515
+ return i && (i.name = s), i ? B({
516
516
  ...r,
517
- Vue: i,
518
- dsl: a,
517
+ Vue: a,
518
+ dsl: i,
519
519
  mode: _.Runtime,
520
520
  loader: N(n)
521
521
  }).renderer : null;
522
- }) : o.type === "Plugin" ? i.defineAsyncComponent(async () => {
523
- const a = await ie(o, r.window);
524
- return a ? (se(a.css), a.component) : null;
522
+ }) : o.type === "Plugin" ? a.defineAsyncComponent(async () => {
523
+ const i = await ie(o, r.window);
524
+ return i ? (se(i.css), i.component) : null;
525
525
  }) : s;
526
526
  }
527
527
  function M(n, e, t = k, r = et) {
528
528
  if (!n || !n.name || n.invisible)
529
529
  return null;
530
- const { id: s = null, directives: o = [] } = n, { vIf: i, vFor: a, vShow: l, vModels: c, vBind: d } = tt(o);
531
- if (i && !rt(i, e))
530
+ const { id: s = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: d } = tt(o);
531
+ if (a && !rt(a, e))
532
532
  return null;
533
- const f = (p) => {
534
- const y = p.$components, m = (() => {
533
+ const p = (f) => {
534
+ const h = f.$components, m = (() => {
535
535
  if (n.name === "component")
536
- return nt(p, n.props?.is);
536
+ return nt(f, n.props?.is);
537
537
  if (n.name === "slot")
538
538
  return n.name;
539
539
  const g = r(n.name, n.from, t);
540
- return C(g) ? y[g] ?? g : g;
541
- })(), h = st(s, n.props ?? {}, p), u = ot(t, n.events ?? {}, p);
540
+ return C(g) ? h[g] ?? g : g;
541
+ })(), v = st(s, n.props ?? {}, f), u = ot(t, n.events ?? {}, f);
542
542
  if (n.name === "slot")
543
- return it(t, n, h, p);
544
- d && Object.assign(h, p.__parseExpression(d.value)), l && (h.style = Object.assign(
545
- h.style ?? {},
546
- ct(l, p)
543
+ return it(t, n, v, f, r);
544
+ d && Object.assign(v, f.__parseExpression(d.value)), l && (v.style = Object.assign(
545
+ v.style ?? {},
546
+ ct(l, f)
547
547
  )), c.forEach((g) => {
548
- Object.assign(h, lt(t, g, p));
548
+ Object.assign(v, lt(t, g, f));
549
549
  });
550
- const S = ut(t, n.children ?? [], p, n);
551
- return t.createVNode(m, { ...h, ...u }, S);
550
+ const S = ut(
551
+ t,
552
+ n.children ?? [],
553
+ f,
554
+ r,
555
+ n
556
+ );
557
+ return t.createVNode(m, { ...v, ...u }, S);
552
558
  };
553
- return a ? dt(a, f, e) : f(e);
559
+ return i ? dt(i, p, e) : p(e);
554
560
  }
555
561
  function tt(n = []) {
556
- const e = n.find((a) => E(a.name) === "vIf"), t = n.find((a) => E(a.name) === "vFor"), r = n.find((a) => E(a.name) === "vShow"), s = n.find((a) => E(a.name) === "vBind"), o = n.filter((a) => E(a.name) === "vModel"), i = n.filter(
557
- (a) => !He.includes(E(a.name))
562
+ 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(
563
+ (i) => !He.includes(E(i.name))
558
564
  );
559
565
  return {
560
566
  vIf: e,
@@ -562,7 +568,7 @@ function tt(n = []) {
562
568
  vShow: r,
563
569
  vModels: o,
564
570
  vBind: s,
565
- others: i
571
+ others: a
566
572
  };
567
573
  }
568
574
  function rt(n, e) {
@@ -574,8 +580,8 @@ function nt(n, e) {
574
580
  function st(n, e, t) {
575
581
  const r = Object.keys(e || {}).reduce(
576
582
  (s, o) => {
577
- let i = e[o];
578
- return w(i) ? i = t.__parseExpression(i) : T(i) && (i = t.__parseFunction(i)), s[o] = i, s;
583
+ let a = e[o];
584
+ return w(a) ? a = t.__parseExpression(a) : T(a) && (a = t.__parseFunction(a)), s[o] = a, s;
579
585
  },
580
586
  {}
581
587
  );
@@ -588,9 +594,9 @@ function ot(n, e, t) {
588
594
  passive: "OnceCapture"
589
595
  };
590
596
  return Object.keys(e || {}).reduce(
591
- (o, i) => {
592
- const a = e[i], l = ae(a.modifiers), c = l.find((p) => r.includes(p)), d = "on" + we(i) + (c && s[c] || ""), f = t.__parseFunction(a.handler);
593
- return f && (o[d] = n.withModifiers(f, l)), o;
597
+ (o, a) => {
598
+ const i = e[a], l = ae(i.modifiers), c = l.find((f) => r.includes(f)), d = "on" + we(a) + (c && s[c] || ""), p = t.__parseFunction(i.handler);
599
+ return p && (o[d] = n.withModifiers(p, l)), o;
594
600
  },
595
601
  {}
596
602
  );
@@ -599,11 +605,13 @@ function ae(n = {}, e = !1) {
599
605
  const t = Object.keys(n);
600
606
  return e ? t.map((r) => "." + r) : t;
601
607
  }
602
- function it(n, e, t, r) {
603
- const { children: s } = e, o = at(e, r), i = r.$slots?.[o.name];
604
- return i ? i(t) : s ? C(s) ? n.createTextVNode(s) : w(s) ? n.createTextVNode(
605
- re(r.__parseExpression(s))
606
- ) : Array.isArray(s) ? s.map((a) => M(a, r, n)) : null : null;
608
+ function it(n, e, t, r, s) {
609
+ const { children: o } = e, a = at(e, r), i = r.$slots?.[a.name];
610
+ return i ? i(t) : o ? C(o) ? n.createTextVNode(o) : w(o) ? n.createTextVNode(
611
+ re(r.__parseExpression(o))
612
+ ) : Array.isArray(o) ? o.map(
613
+ (l) => M(l, r, n, s)
614
+ ) : null : null;
607
615
  }
608
616
  function at(n, e) {
609
617
  const { props: t } = n, r = t?.name || "default";
@@ -623,13 +631,13 @@ function lt(n, e, t) {
623
631
  value: e.value?.value ? `(v) => {
624
632
  ${e.value.value} = v;
625
633
  }` : "(v) => {}"
626
- }, s = t.__parseFunction(r), o = ae(e.modifiers), i = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
634
+ }, s = t.__parseFunction(r), o = ae(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
627
635
  return {
628
- [i]: t.__parseExpression(e.value),
629
- [`onUpdate:${i}`]: o.length && s ? n.withModifiers(s, o) : s
636
+ [a]: t.__parseExpression(e.value),
637
+ [`onUpdate:${a}`]: o.length && s ? n.withModifiers(s, o) : s
630
638
  };
631
639
  }
632
- function ut(n, e, t, r) {
640
+ function ut(n, e, t, r, s) {
633
641
  if (!e)
634
642
  return null;
635
643
  if (C(e))
@@ -639,13 +647,13 @@ function ut(n, e, t, r) {
639
647
  default: () => re(t.__parseExpression(e))
640
648
  };
641
649
  if (Array.isArray(e) && e.length > 0) {
642
- const s = pt(e), o = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
643
- [`scope_${r.id}`]: i
650
+ const o = pt(e), a = (i) => !i || !s ? {} : s?.id && Object.keys(i).length ? {
651
+ [`scope_${s.id}`]: i
644
652
  } : {};
645
- return Object.entries(s).reduce((i, [a, { nodes: l, params: c }]) => (i[a] = (d) => {
646
- const f = c.length ? Se(d ?? {}, c) : o(d);
647
- return l.map(
648
- (p) => M(p, t.__clone(f), n)
653
+ return Object.entries(o).reduce((i, [l, { nodes: c, params: d }]) => (i[l] = (p) => {
654
+ const f = d.length ? Se(p ?? {}, d) : a(p);
655
+ return c.map(
656
+ (h) => M(h, t.__clone(f), n, r)
649
657
  );
650
658
  }, i), {});
651
659
  }
@@ -671,9 +679,9 @@ function ft(n = "default") {
671
679
  return C(n) ? { name: n, params: [] } : { params: [], ...n };
672
680
  }
673
681
  function dt(n, e, t) {
674
- const { value: r, iterator: s } = n, { item: o = "item", index: i = "index" } = s || {};
675
- let a = t.__parseExpression(r) || [];
676
- return Number.isInteger(a) && (a = new Array(a).fill(!0).map((l, c) => c + 1)), Array.isArray(a) ? a.map((l, c) => e(t.__clone({ [o]: l, [i]: c }))) : (console.warn("[vForRender]:", `${r?.value} is not a Arrary`), []);
682
+ const { value: r, iterator: s } = n, { item: o = "item", index: a = "index" } = s || {};
683
+ let i = t.__parseExpression(r) || [];
684
+ return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }))) : (console.warn("[vForRender]:", `${r?.value} is not a Arrary`), []);
677
685
  }
678
686
  const Q = ee({
679
687
  name: "VtjPageContainer",
@@ -718,53 +726,53 @@ class ht extends pe {
718
726
  mode: r = _.Raw,
719
727
  dependencies: s,
720
728
  materials: o,
721
- project: i = {},
722
- adapter: a = {},
729
+ project: a = {},
730
+ adapter: i = {},
723
731
  globals: l = {},
724
732
  modules: c = {},
725
733
  router: d = null,
726
- materialPath: f = "./",
727
- nodeEnv: p = "development"
734
+ materialPath: p = "./",
735
+ nodeEnv: f = "development"
728
736
  } = e;
729
- this.mode = r, this.modules = c, this.service = t, this.router = d, this.materialPath = f, this.nodeEnv = p, s && (this.dependencies = s), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, a), r !== _.Design && this.load(i);
737
+ this.mode = r, this.modules = c, this.service = t, this.router = d, this.materialPath = p, this.nodeEnv = f, s && (this.dependencies = s), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i), r !== _.Design && this.load(a);
730
738
  }
731
739
  async load(e) {
732
740
  const t = this.modules[`.vtj/projects/${e.id}.json`];
733
741
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
734
742
  throw new Error("project is null");
735
- const { dependencies: r = [], apis: s } = this.project, { dependencies: o, library: i, components: a, materialPath: l } = this, {
743
+ const { dependencies: r = [], apis: s } = this.project, { dependencies: o, library: a, components: i, materialPath: l } = this, {
736
744
  libraryExports: c,
737
745
  libraryMap: d,
738
- materials: f,
739
- materialExports: p,
740
- materialMapLibrary: y
746
+ materials: p,
747
+ materialExports: f,
748
+ materialMapLibrary: h
741
749
  } = De(r, l), m = window;
742
750
  m.CKEDITOR_VERSION = void 0;
743
751
  for (const u of c) {
744
752
  const S = o[u], g = m[u];
745
753
  if (g)
746
- i[u] = g;
754
+ a[u] = g;
747
755
  else if (S)
748
- m[u] = i[u] = await S();
756
+ m[u] = a[u] = await S();
749
757
  else {
750
758
  const $ = d[u] || [];
751
759
  for (const j of $)
752
- J(j) && await ke(u, F.append(j, { v: b })), V(j) && await X(F.append(j, { v: b })), i[u] = m[u];
760
+ J(j) && await ke(u, F.append(j, { v: b })), V(j) && await X(F.append(j, { v: b })), a[u] = m[u];
753
761
  }
754
762
  }
755
- for (const u of f)
763
+ for (const u of p)
756
764
  await X(F.append(u, { v: b }));
757
- const h = this.materials || {};
758
- for (const u of p) {
759
- const S = m[y[u]], g = fe[u];
765
+ const v = this.materials || {};
766
+ for (const u of f) {
767
+ const S = m[h[u]], g = fe[u];
760
768
  if (g)
761
769
  S && g.forEach(($) => {
762
- a[$] = S[$];
770
+ i[$] = S[$];
763
771
  });
764
772
  else {
765
- const $ = h[u] ? (await h[u]()).default : m[u];
773
+ const $ = v[u] ? (await v[u]()).default : m[u];
766
774
  $ && S && ($.components || []).forEach((j) => {
767
- a[j.name] = Me(j, S);
775
+ i[j.name] = Me(j, S);
768
776
  });
769
777
  }
770
778
  }
@@ -794,13 +802,13 @@ class ht extends pe {
794
802
  }
795
803
  getPage(e) {
796
804
  const { pages: t = [] } = this.project || {}, r = (s, o = []) => {
797
- for (const i of o) {
798
- if (i.id === s)
799
- return i;
800
- if (i.children && i.children.length) {
801
- const a = r(s, i.children);
802
- if (a)
803
- return a;
805
+ for (const a of o) {
806
+ if (a.id === s)
807
+ return a;
808
+ if (a.children && a.children.length) {
809
+ const i = r(s, a.children);
810
+ if (i)
811
+ return i;
804
812
  }
805
813
  }
806
814
  };
@@ -826,21 +834,21 @@ class ht extends pe {
826
834
  }).then((r) => r.data).catch(() => null));
827
835
  }
828
836
  createDslRenderer(e, t = {}) {
829
- const { library: r, components: s, mode: o, apis: i } = this, a = {
837
+ const { library: r, components: s, mode: o, apis: a } = this, i = {
830
838
  mode: o,
831
839
  Vue: r.Vue,
832
840
  components: s,
833
841
  libs: r,
834
- apis: i,
842
+ apis: a,
835
843
  window,
836
844
  ...t
837
845
  }, l = N({
838
846
  getDsl: async (c) => await this.getDsl(c) || null,
839
847
  getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
840
- options: a
848
+ options: i
841
849
  });
842
850
  return B({
843
- ...a,
851
+ ...i,
844
852
  dsl: e,
845
853
  loader: l
846
854
  });
@@ -1012,58 +1020,58 @@ class K {
1012
1020
  }).then((o) => o.data).catch(() => null));
1013
1021
  }
1014
1022
  }
1015
- const v = new Ee({
1023
+ const y = new Ee({
1016
1024
  type: "local",
1017
1025
  expired: 0,
1018
1026
  prefix: "__VTJ_"
1019
1027
  });
1020
1028
  class xt extends K {
1021
1029
  init(e) {
1022
- const t = new x(e), r = v.get(`project_${t.id}`), s = Object.assign(t.toDsl(), r || {});
1023
- return v.save(`project_${t.id}`, s), Promise.resolve(s);
1030
+ const t = new x(e), r = y.get(`project_${t.id}`), s = Object.assign(t.toDsl(), r || {});
1031
+ return y.save(`project_${t.id}`, s), Promise.resolve(s);
1024
1032
  }
1025
1033
  saveProject(e) {
1026
1034
  const t = new x(e);
1027
- return v.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1035
+ return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1028
1036
  }
1029
1037
  saveMaterials(e, t) {
1030
- return v.save(`materials_${e.id}`, U(t)), Promise.resolve(!0);
1038
+ return y.save(`materials_${e.id}`, U(t)), Promise.resolve(!0);
1031
1039
  }
1032
1040
  saveFile(e) {
1033
- return v.save(`file_${e.id}`, e), Promise.resolve(!0);
1041
+ return y.save(`file_${e.id}`, e), Promise.resolve(!0);
1034
1042
  }
1035
1043
  getFile(e) {
1036
- const t = v.get(`file_${e}`);
1044
+ const t = y.get(`file_${e}`);
1037
1045
  return t ? Promise.resolve(t) : Promise.reject(null);
1038
1046
  }
1039
1047
  removeFile(e) {
1040
- return v.remove(`file_${e}`), Promise.resolve(!0);
1048
+ return y.remove(`file_${e}`), Promise.resolve(!0);
1041
1049
  }
1042
1050
  saveHistory(e) {
1043
- return v.save(`history_${e.id}`, e), Promise.resolve(!0);
1051
+ return y.save(`history_${e.id}`, e), Promise.resolve(!0);
1044
1052
  }
1045
1053
  removeHistory(e) {
1046
- const t = v.get(`history_${e}`);
1054
+ const t = y.get(`history_${e}`);
1047
1055
  if (t) {
1048
1056
  const s = (t.items || []).map((o) => o.id);
1049
- this.removeHistoryItem(e, s), v.remove(`history_${e}`);
1057
+ this.removeHistoryItem(e, s), y.remove(`history_${e}`);
1050
1058
  }
1051
1059
  return Promise.resolve(!0);
1052
1060
  }
1053
1061
  getHistory(e) {
1054
- const t = v.get(`history_${e}`), r = new Z(t || { id: e });
1062
+ const t = y.get(`history_${e}`), r = new Z(t || { id: e });
1055
1063
  return Promise.resolve(r.toDsl());
1056
1064
  }
1057
1065
  getHistoryItem(e, t) {
1058
- const r = v.get(`history_${e}_${t}`);
1066
+ const r = y.get(`history_${e}_${t}`);
1059
1067
  return Promise.resolve(r);
1060
1068
  }
1061
1069
  saveHistoryItem(e, t) {
1062
- return v.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1070
+ return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1063
1071
  }
1064
1072
  removeHistoryItem(e, t) {
1065
1073
  return t.forEach((r) => {
1066
- v.remove(`history_${e}_${r}`);
1074
+ y.remove(`history_${e}_${r}`);
1067
1075
  }), Promise.resolve(!0);
1068
1076
  }
1069
1077
  }
@@ -1181,12 +1189,12 @@ class Dt extends K {
1181
1189
  }
1182
1190
  function ue(n = []) {
1183
1191
  return n.map((e) => {
1184
- const { id: t, title: r, icon: s, children: o, hidden: i } = e;
1192
+ const { id: t, title: r, icon: s, children: o, hidden: a } = e;
1185
1193
  return {
1186
1194
  id: t,
1187
1195
  title: r,
1188
1196
  icon: s,
1189
- hidden: i,
1197
+ hidden: a,
1190
1198
  url: `/page/${t}`,
1191
1199
  children: o && o.length ? ue(o) : void 0
1192
1200
  };
@@ -1195,11 +1203,11 @@ function ue(n = []) {
1195
1203
  function Mt() {
1196
1204
  const n = le(), e = te(), t = Fe(!1), r = n.project;
1197
1205
  Ce(() => {
1198
- const { name: i, params: a, meta: l } = e;
1199
- if (i === "VtjPage") {
1200
- const c = n.getPage(a.id);
1206
+ const { name: a, params: i, meta: l } = e;
1207
+ if (a === "VtjPage") {
1208
+ const c = n.getPage(i.id);
1201
1209
  t.value = !c?.mask;
1202
- } else if (i === "VtjHomepage") {
1210
+ } else if (a === "VtjHomepage") {
1203
1211
  const c = n.getHomepage();
1204
1212
  t.value = !c?.mask;
1205
1213
  } else
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/renderer",
3
3
  "private": false,
4
- "version": "0.8.3",
4
+ "version": "0.8.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vue-tsc && vite build",
@@ -10,10 +10,10 @@
10
10
  "coverage": "vitest run --coverage"
11
11
  },
12
12
  "dependencies": {
13
- "@vtj/core": "^0.8.3",
14
- "@vtj/icons": "^0.8.3",
15
- "@vtj/ui": "^0.8.3",
16
- "@vtj/utils": "^0.8.3",
13
+ "@vtj/core": "^0.8.4",
14
+ "@vtj/icons": "^0.8.4",
15
+ "@vtj/ui": "^0.8.4",
16
+ "@vtj/utils": "^0.8.4",
17
17
  "mockjs": "~1.1.0"
18
18
  },
19
19
  "devDependencies": {
@@ -35,7 +35,7 @@
35
35
  "dist",
36
36
  "types"
37
37
  ],
38
- "gitHead": "5b5cc8b02b8f367591e4bee47a7d7ff54a01981b",
38
+ "gitHead": "a2174c3ec95f12c150d1451281dc9625c8dbb40f",
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  }
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/renderer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.2
5
+ * @version 0.8.3
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.8.2";
8
+ export declare const version = "0.8.3";