@vtj/renderer 0.7.33 → 0.7.34
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 +5 -5
- package/dist/index.mjs +273 -272
- package/package.json +6 -6
- package/types/version.d.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@vtj/core"),l=require("@vtj/utils"),$=require("vue"),G=require("vue-router"),T=require("element-plus"),x=require("mockjs"),he=require("@vueuse/core"),ve=require("@vtj/ui");function ge(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const k=ge($);/**!
|
|
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.7.
|
|
5
|
+
* @version 0.7.34
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const
|
|
8
|
-
`)+o;const i=`with(${t?"{}":"$scope || {}"}) { ${o} }`;return new Function("$scope",i)(e)}catch(n){if(l.logger.error("parseExpression.error",n,r,e?.__self??e),s)throw n}}function
|
|
7
|
+
*/const I="0.7.34";var w=(r=>(r.Runtime="Runtime",r.Design="Design",r.Raw="Raw",r.VNode="VNode",r))(w||{});const D=["$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"],Q=["vIf","vShow","vModel","vFor","vBind"],Z={String,Number,Boolean,Array,Object,Function,Date};function F(r,e){return r.map(t=>l.isUrl(t)?t:`${e}${t}`)}function B(r){return/\.css$/.test(r)}function q(r){return/\.js$/.test(r)}function ye(r){return r.map(e=>`<script src="${l.url.append(e,{v:I})}"><\/script>`).join("")}function Se(r=[]){return r.map(e=>`<link rel="stylesheet" href="${l.url.append(e,{v:I})}" />`).join("")}function ee(r,e){const t=r.filter(d=>!!d.enabled),s=[],n=[],o=[],i=[],a={},u=[],c={};return t.forEach(({urls:d,assetsUrl:f,library:p,assetsLibrary:g})=>{d?.forEach(h=>{q(h)&&s.push(h),B(h)&&n.push(h)}),p&&(i.push(p),a[p]=F(d||[],e)),f&&o.push(f),g&&u.push(g),p&&g&&(c[g]=p)}),{scripts:F(s,e),css:F(n,e),materials:F(o,e),libraryExports:i,materialExports:l.dedupArray(u),materialMapLibrary:c,libraryMap:a}}function te(r,e){const{name:t,parent:s,alias:n}=r;return s?e[s]?.[n||t]:e[n||t]}function L(r){return l.isString(r)?r:JSON.stringify(r)}function V(r,e,t){const s=r.CSSStyleSheet;if(s.prototype.replaceSync){const n=new s;n.id=e,n.replaceSync(t);const o=r.document,i=o.adoptedStyleSheets,a=Array.from(i).filter(u=>u.id!==e);o.adoptedStyleSheets=[...a,n]}else{const n=r.document;let o=n.getElementById(e);o?o.innerHTML=t:(o=n.createElement("style"),o.id=e,o.innerHTML=t,n.head.appendChild(o))}}async function re(r,e){const t=await window.fetch(e).then(s=>s.text()).catch(()=>"");t&&V(window,r,t)}function se(r){return l.isFunction(r)||l.isFunction(r?.install)}function R(r,e,t=!1,s=!1){try{const n=['"use strict";',"var __self = arguments[0];"];n.push("return ");let o=(r.value||"").trim();o=o.replace(/this(\W|$)/g,(a,u)=>`__self${u}`),o=n.join(`
|
|
8
|
+
`)+o;const i=`with(${t?"{}":"$scope || {}"}) { ${o} }`;return new Function("$scope",i)(e)}catch(n){if(l.logger.error("parseExpression.error",n,r,e?.__self??e),s)throw n}}function N(r,e,t=!1,s=!1){const n=R(r,e,t,s);if(typeof n!="function"&&(l.logger.error("parseFunction.error","not a function",r,e?.__self??e),s))throw new Error(`"${r.value}" not a function`);return n}function y(r){return r&&r.type==="JSExpression"}function O(r){return typeof r=="object"&&r&&r.type==="JSFunction"}function ne(r){return y(r)||O(r)}function we(r){return ne(r)?r.value:JSON.stringify(r)}let C=null;const je=l.createRequest({settings:{type:"form",validSuccess:!0,originResponse:!1,loading:!0,validate:r=>r.data?.code===0||!!r.data?.success,failMessage:!0,showError:r=>{T.ElNotification.error({message:r||"未知错误"})},showLoading:()=>{C&&C.close(),C=T.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.05)"})},hideLoading:()=>{C&&(C.close(),C=null)}}});function oe(r,e){const{jsonp:t,request:s}=e;if(r.method==="jsonp")return(n={})=>t(r.url,{...r.jsonpOptions,query:n});{const n=r.headers?R(r.headers,{},!0):void 0,o={url:r.url,method:r.method,settings:{...r.settings,headers:n}};return(i,a)=>s.send(l.merge(o,a||{},{data:i}))}}function ie(r=[],e){return r.reduce((t,s)=>(t[s.id]=oe(s,e),t),{})}function ae(r=[]){x.setup({timeout:"50-500"}),J(),r.forEach(e=>ce(e))}function ce(r){if(!r.mock)return;const{url:e,mockTemplate:t}=r;if(e&&t){const s=l.pathToRegexp(`${e}(.*)`),n=l.pathToRegexpMatch(e,{decode:decodeURIComponent}),o=R(t,{},!0);x.mock(s,i=>{const a=l.url.parse(i.url)||{},u=i.body instanceof FormData?l.formDataToJson(i.body):i.body,c=n(i.url)?.params;return Object.assign(i,{data:u,params:a,query:c}),x.mock(o(i))})}}function J(){x._mocked={}}class le{__id=null;__mode;__instance=null;__contextRefs={};__refs={};context={};state={};$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:s,attrs:n}=e;this.__mode=t,s&&(this.__id=s.id||null,this.__transform=s.transform||{}),n&&Object.assign(this,n)}setup(e,t=k){const s=t.getCurrentInstance();if(!s)return;this.__instance=s.proxy;const n=s.appContext.config.globalProperties;Object.assign(this,n),Object.assign(this,e||{}),this.__proxy(),t.onMounted(()=>{this.__proxy()}),t.onUnmounted(()=>{this.__cleanup()})}__proxy(){this.__instance&&D.forEach(e=>{this[e]=this.__instance?.[e]})}__cleanup(){D.forEach(e=>{this[e]=null})}__parseFunction(e){if(e)if(this.__mode===w.Runtime){const{id:t,type:s}=e,n=t?this.__transform[t]??e.value:e.value;return N({type:s,value:n},this)}else return N(e,this)}__parseExpression(e){if(e)if(this.__mode===w.Runtime){const{id:t,type:s}=e,n=t?this.__transform[t]??e.value:e.value;return R({type:s,value:n},this)}else return R(e,this)}__ref(e=null,t){if(this.__mode!==w.VNode)return e&&e!==this.__id&&(this.__contextRefs[e]=this),s=>{let n=s?.$vtjEl||s?.$el||s;if(!n){typeof t=="string"&&(delete this.$refs[t],e&&delete this.__refs[e]);return}if(n.__vtj__=e,n.nodeType===3&&n.nextSibling&&(n=n.nextSibling),w.Design===this.__mode&&(n.__context__=this),e&&(this.__refs[e]=s),typeof t=="function")t(s);else if(t){const o=this.$refs[t];if(o){const i=new Set([].concat(o,s));this.$refs[t]=Array.from(i)}else this.$refs[t]=s}return s}}__clone(e={}){const t={...this.context,...e},s={...t,context:t};return s.context.__proto__=this.context,s.__proto__=this,s}}function U(r){const{Vue:e=k,mode:t=w.Runtime,components:s={},libs:n={},apis:o={},loader:i}=r,a=e.computed(()=>r.dsl),u={$components:s,$libs:n,$apis:o},c=new le({mode:t,dsl:a.value,attrs:u}),d=e.defineComponent({name:a.value.name,props:{...$e(a.value.props??[],c)},setup(f){c.$props=f,a.value.id&&V(r.window||window,a.value.id,a.value.css||""),c.state=Ee(e,a.value.state??{},c);const p=Pe(e,a.value.computed??{},c),g=be(a.value.methods??{},c),h=Ce(e,a.value.inject,c),S=ue(a.value.dataSources||{},c),m={...h,...p,...g,...S};return c.setup(m,e),Ie(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(p=>H(p,c,e,i))},...Re(a.value.lifeCycles??{},c)});return{renderer:e.markRaw(d),context:c}}function $e(r=[],e){const t=s=>s?(Array.isArray(s)?s:[s]).map(o=>Z[o]):void 0;return r.map(s=>l.isString(s)?{name:s}:{name:s.name,type:s.type,required:s.required,default:y(s.default)?e.__parseExpression(s.default):s.default}).reduce((s,n)=>(s[n.name]={type:t(n.type),required:n.required,default:n.default},s),{})}function Ee(r,e,t){return r.reactive(Object.keys(e||{}).reduce((s,n)=>{let o=e[n];return y(o)?o=t.__parseExpression(o):O(o)&&(o=t.__parseFunction(o)),s[n]=o,s},{}))}function Pe(r,e,t){return Object.entries(e??{}).reduce((s,[n,o])=>(s[n]=r.computed(t.__parseFunction(o)),s),{})}function be(r,e){return Object.entries(r??{}).reduce((t,[s,n])=>(t[s]=e.__parseFunction(n),t),{})}function Ce(r,e=[],t){return e.reduce((s,n)=>{const{name:o,from:i}=n||{};n.default;const a=y(i)?t.__parseExpression(i)||o:i??o,u=y(n.default)?t.__parseExpression(n.default):n.default??null;return s[o]=r.inject(a,u),s},{})}function ue(r,e){return Object.keys(r).reduce((t,s)=>{const n=r[s],o=e.$apis[n.ref],i=O(n.transform)?n.transform.value?e.__parseFunction(n.transform):void 0:n.transform;return t[s]=async(...a)=>{const u=await o.apply(e,a);return i?i(u):u},t},{})}function Ie(r,e=[],t){e.forEach(s=>{r.watch(t.__parseExpression(s.source),t.__parseFunction(s.handler),{deep:s.deep,immediate:s.immediate})})}function Re(r,e){return Object.entries(r??{}).reduce((t,[s,n])=>(t[s]=e.__parseFunction(n),t),{})}const pe=r=>r;function Y(r){const{getDsl:e,options:t}=r;return(s,n,o=k)=>!n||typeof n=="string"?s:n.type==="Schema"?o.defineAsyncComponent(async()=>{const i=await e(n.id);return i?U({...t,Vue:o,dsl:i,mode:w.Runtime,loader:Y(r)}).renderer:null}):s}function H(r,e,t=k,s=pe){if(!r||!r.name||r.invisible)return null;const{id:n=null,directives:o=[]}=r,{vIf:i,vFor:a,vShow:u,vModels:c,vBind:d}=Fe(o);if(i&&!He(i,e))return null;const f=p=>{const g=p.$components,h=(()=>{if(r.name==="component")return Oe(p,r.props?.is);if(r.name==="slot")return r.name;const _=s(r.name,r.from,t);return l.isString(_)?g[_]??_:_})(),S=Me(n,r.props??{},p),m=Te(t,r.events??{},p);if(r.name==="slot")return xe(t,r,S,p);d&&Object.assign(S,p.__parseExpression(d.value)),u&&(S.style=Object.assign(S.style??{},Ae(u,p))),c.forEach(_=>{Object.assign(S,De(t,_,p))});const j=Ne(t,r.children??[],p,r);return t.createVNode(h,{...S,...m},j)};return a?Le(a,f,e):f(e)}function Fe(r=[]){const e=r.find(a=>l.camelCase(a.name)==="vIf"),t=r.find(a=>l.camelCase(a.name)==="vFor"),s=r.find(a=>l.camelCase(a.name)==="vShow"),n=r.find(a=>l.camelCase(a.name)==="vBind"),o=r.filter(a=>l.camelCase(a.name)==="vModel"),i=r.filter(a=>!Q.includes(l.camelCase(a.name)));return{vIf:e,vFor:t,vShow:s,vModels:o,vBind:n,others:i}}function He(r,e){return!!e.__parseExpression(r.value)}function Oe(r,e){return e?y(e)?r.__parseExpression(e):e:"div"}function Me(r,e,t){const s=Object.keys(e||{}).reduce((n,o)=>{let i=e[o];return y(i)?i=t.__parseExpression(i):O(i)&&(i=t.__parseFunction(i)),n[o]=i,n},{});return s.ref=t.__ref(r,s.ref),s}function Te(r,e,t){const s=["passive","capture","once"],n={capture:"Capture",once:"Once",passive:"OnceCapture"};return Object.keys(e||{}).reduce((o,i)=>{const a=e[i],u=K(a.modifiers),c=u.find(p=>s.includes(p)),d="on"+l.upperFirst(i)+(c&&n[c]||""),f=t.__parseFunction(a.handler);return f&&(o[d]=r.withModifiers(f,u)),o},{})}function K(r={},e=!1){const t=Object.keys(r);return e?t.map(s=>"."+s):t}function xe(r,e,t,s){const{children:n}=e,o=ke(e,s),i=s.$slots?.[o.name];return i?i(t):n?l.isString(n)?r.createTextVNode(n):y(n)?r.createTextVNode(L(s.__parseExpression(n))):Array.isArray(n)?n.map(a=>H(a,s,r)):null:null}function ke(r,e){const{props:t}=r,s=t?.name||"default";return{name:y(s)?e.__parseExpression(s):s,params:[]}}function Ae(r,e){return e.__parseExpression(r.value)?{}:{display:"none"}}function De(r,e,t){const s={type:"JSFunction",value:e.value?.value?`(v) => {
|
|
9
9
|
${e.value.value} = v;
|
|
10
|
-
}`:"(v) => {}"},n=t.__parseFunction(s),o=Y(e.modifiers),i=_(e.arg)?t.__parseExpression(e.arg):e.arg||"modelValue";return{[i]:t.__parseExpression(e.value),[`onUpdate:${i}`]:o.length&&n?r.withModifiers(n,o):n}}function De(r,e,t,s){if(!e)return null;if(l.isString(e))return{default:()=>e};if(_(e))return{default:()=>q(t.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const n=Ne(e),o=i=>!i||!s?{}:s?.id&&Object.keys(i).length?{[`scope_${s.id}`]:i}:{};return Object.entries(n).reduce((i,[a,{nodes:u,params:c}])=>(i[a]=m=>{const d=c.length?l.pick(m??{},c):o(m);return u.map(p=>R(p,t.__clone(d),r))},i),{})}return null}function Ne(r){const e={default:{params:[],nodes:[]}};for(const t of r){const s=Be(t.slot),n=s.name;e[n]?(e[n].nodes.push(t),e[n].params=e[n].params.concat(s.params)):e[n]={nodes:[t],params:s.params}}return e}function Be(r="default"){return l.isString(r)?{name:r,params:[]}:{params:[],...r}}function qe(r,e,t){const{value:s,iterator:n}=r,{item:o="item",index:i="index"}=n||{};let a=t.__parseExpression(s)||[];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]:",`${s?.value} is not a Arrary`),[])}const W=j.defineComponent({name:"VtjPageContainer",async setup(){const r=K(),e=z.useRoute(),t=e.params.id,s=t?r.getPage(t):r.getHomepage(),n=s?await r.getRenderComponent(s.id):null;return s&&me.useTitle(s.title||"VTJ"),{provider:r,component:n,file:s,query:e.query}},render(){return this.component?j.h(this.component,this.query):j.h("div","页面不存在")}}),Le=j.defineComponent({name:"VtjStartupContainer",render(){return j.h(he.XStartup)}}),X=Symbol("Provider");class pe extends $.Base{mode;globals={};modules={};adapter={request:we,jsonp:l.jsonp};apis={};dependencies={};materials={};library={};service;project=null;components={};nodeEnv="development";router=null;materialPath="./";constructor(e){super();const{service:t,mode:s=w.Raw,dependencies:n,materials:o,project:i={},adapter:a={},globals:u={},modules:c={},router:m=null,materialPath:d="./",nodeEnv:p="development"}=e;this.mode=s,this.modules=c,this.service=t,this.router=m,this.materialPath=d,this.nodeEnv=p,n&&(this.dependencies=n),o&&(this.materials=o),Object.assign(this.globals,u),Object.assign(this.adapter,a),s!==w.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:s=[],apis:n}=this.project,{dependencies:o,library:i,components:a,materialPath:u}=this,{libraryExports:c,libraryMap:m,materials:d,materialExports:p,materialMapLibrary:g}=Z(s,u);for(const f of c){const S=o[f],E=window[f];if(E)i[f]=E;else if(S)window[f]=i[f]=await S();else{const h=m[f]||[];for(const P of h)N(P)&&await te(f,l.url.append(P,{v:C})),B(P)&&await l.loadScript(l.url.append(P,{v:C})),i[f]=window[f]}}for(const f of d)await l.loadScript(l.url.append(f,{v:C}));const y=this.materials||{};for(const f of p){const S=window[g[f]],E=$.BUILT_IN_COMPONENTS[f];if(E)S&&E.forEach(h=>{a[h]=S[h]});else{const h=y[f]?(await y[f]()).default:window[f];h&&S&&(h.components||[]).forEach(P=>{a[P.name]=ee(P,S)})}}n&&(this.apis=oe(n,this.adapter),J(),this.project.config?.mock&&ie(n)),this.initRouter(),this.triggerReady()}initRouter(){const{router:e,project:t}=this;e&&(e.addRoute({path:"/page/:id",name:"VtjPage",component:W}),e.addRoute({path:"/",name:"VtjHomepage",component:t?.homepage?W:Le}))}install(e){const t=e.config.globalProperties.installed||{};for(const[s,n]of Object.entries(this.library))!t[s]&&re(n)&&(e.use(n),t[s]=!0);e.provide(X,this),e.config.globalProperties.installed=t}getFile(e){const{blocks:t=[]}=this.project||{};return this.getPage(e)||t.find(s=>s.id===e)||null}getPage(e){const{pages:t=[]}=this.project||{},s=(n,o=[])=>{for(const i of o){if(i.id===n)return i;if(i.children&&i.children.length){const a=s(n,i.children);if(a)return a}}};return s(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 getRenderComponent(e){const t=this.getFile(e);if(!t)return l.logger.warn(`Can not find file: ${e}`),null;const s=`.vtj/vue/${e}.vue`,n=this.modules[s];if(n)return(await n())?.default;const o=await this.getDsl(t.id);if(!o)return l.logger.warn(`Can not find dsl: ${e}`),null;const{library:i,components:a,mode:u,apis:c}=this,m={mode:u,Vue:i.Vue,components:a,libs:i,apis:c,window},d=U({getDsl:async g=>await this.getDsl(g)||null,options:m}),{renderer:p}=V({...m,dsl:o,loader:d});return p}}function Je(r){const e=new pe(r);return{provider:e,onReady:s=>e.ready(s)}}function K(r={}){const e=j.inject(X);if(!e)throw new Error("Can not find provider");if(e.mode===w.Raw&&e.nodeEnv==="development"){const{id:t,version:s}=r;t&&s&&(async()=>{const n=await e.getDsl(t);n?.__VERSION__!==s&&O.ElNotification.warning({title:n?.name,message:"当前组件源码版本与运行时版本不一致,请重新发布组件"})})()}return e}const Ve=new l.Request({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:r=>r.data?.code===0,showError:r=>{O.ElNotification.error({message:r||"未知错误"})}}}),Ue=(r="/vtj/local/repository/${type}.json")=>(e,t)=>Ve.send({url:r,method:"post",query:{type:e},data:{type:e,data:t}});class k{api;constructor(){this.api=Ue()}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(()=>"")}}const v=new l.Storage({type:"local",expired:0,prefix:"__VTJ_"});class Ye extends k{init(e){const t=new $.ProjectModel(e),s=v.get(`project_${t.id}`),n=Object.assign(t.toDsl(),s||{});return v.save(`project_${t.id}`,n),Promise.resolve(n)}saveProject(e){const t=new $.ProjectModel(e);return v.save(`project_${t.id}`,t.toDsl()),Promise.resolve(!0)}saveMaterials(e,t){return v.save(`materials_${e.id}`,l.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return v.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const t=v.get(`file_${e}`);return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return v.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return v.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const t=v.get(`history_${e}`);if(t){const n=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,n),v.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const t=v.get(`history_${e}`),s=new $.HistoryModel(t||{id:e});return Promise.resolve(s.toDsl())}getHistoryItem(e,t){const s=v.get(`history_${e}_${t}`);return Promise.resolve(s)}saveHistoryItem(e,t){return v.save(`history_${e}_${t.id}`,t),Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{v.remove(`history_${e}_${s}`)}),Promise.resolve(!0)}}class fe extends k{projects={};materials={};files={};histories={};historyItems={};init(e){const t=new $.ProjectModel(e),s=this.projects[t.id]||{},n=Object.assign(t.toDsl(),s);return this.projects[n.id]=n,Promise.resolve(n)}saveProject(e){const t=new $.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 n=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,n),delete this.historyItems[e]}return Promise.resolve(!0)}getHistory(e){const t=this.histories[e],s=new $.HistoryModel(t||{id:e});return Promise.resolve(s)}getHistoryItem(e,t){const s=`${e}_${t}`,n=this.historyItems[s]||{};return Promise.resolve(n)}saveHistoryItem(e,t){const s=`${e}_${t.id}`;return this.historyItems[s]=t,Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{const n=`${e}_${s}`;delete this.historyItems[n]}),Promise.resolve(!0)}}let M=null;function Xe(){return M||(M=new fe,M)}class Ke extends k{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){return await this.api("getFile",e).catch(()=>null)||{}}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 de(r=[]){return r.map(e=>{const{id:t,title:s,icon:n,children:o,hidden:i}=e;return{id:t,title:s,icon:n,hidden:i,url:`/page/${t}`,children:o&&o.length?de(o):void 0}})}function We(){const r=K(),e=z.useRoute(),t=j.ref(!1),s=r.project;j.watchEffect(()=>{const{name:i,params:a,meta:u}=e;if(i==="VtjPage"){const c=r.getPage(a.id);t.value=!c?.mask}else if(i==="VtjHomepage"){const c=r.getHomepage();t.value=!c?.mask}else t.value=!u.mask});const n=de(s?.pages),o=s?.config;return{disabled:t,logo:o?.logo,themeSwitchable:o?.themeSwitchable,title:o?.title||s?.description||s?.name||"VTJ App",menus:n}}exports.BUILT_IN_DIRECTIVES=G;exports.BaseService=k;exports.CONTEXT_HOST=A;exports.Context=ce;exports.ContextMode=w;exports.DATA_TYPES=Q;exports.JSCodeToString=Se;exports.LIFE_CYCLES_LIST=ge;exports.LocalService=Ke;exports.MemoryService=fe;exports.Provider=pe;exports.StorageService=Ye;exports.VTJ_RENDERER_VERSION=C;exports.adoptedStyleSheets=L;exports.createAssetScripts=_e;exports.createAssetsCss=ye;exports.createDataSources=le;exports.createLoader=U;exports.createMemoryService=Xe;exports.createProvider=Je;exports.createRenderer=V;exports.createSchemaApi=ne;exports.createSchemaApis=oe;exports.defaultLoader=ue;exports.fillBasePath=I;exports.getModifiers=Y;exports.getRawComponent=ee;exports.isCSSUrl=N;exports.isJSCode=se;exports.isJSExpression=_;exports.isJSFunction=H;exports.isJSUrl=B;exports.isVuePlugin=re;exports.loadCss=te;exports.mockApi=ae;exports.mockApis=ie;exports.mockCleanup=J;exports.nodeRender=R;exports.parseDeps=Z;exports.parseExpression=F;exports.parseFunction=D;exports.providerKey=X;exports.toString=q;exports.useMask=We;exports.useProvider=K;
|
|
10
|
+
}`:"(v) => {}"},n=t.__parseFunction(s),o=K(e.modifiers),i=y(e.arg)?t.__parseExpression(e.arg):e.arg||"modelValue";return{[i]:t.__parseExpression(e.value),[`onUpdate:${i}`]:o.length&&n?r.withModifiers(n,o):n}}function Ne(r,e,t,s){if(!e)return null;if(l.isString(e))return{default:()=>e};if(y(e))return{default:()=>L(t.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const n=Be(e),o=i=>!i||!s?{}:s?.id&&Object.keys(i).length?{[`scope_${s.id}`]:i}:{};return Object.entries(n).reduce((i,[a,{nodes:u,params:c}])=>(i[a]=d=>{const f=c.length?l.pick(d??{},c):o(d);return u.map(p=>H(p,t.__clone(f),r))},i),{})}return null}function Be(r){const e={default:{params:[],nodes:[]}};for(const t of r){const s=qe(t.slot),n=s.name;e[n]?(e[n].nodes.push(t),e[n].params=e[n].params.concat(s.params)):e[n]={nodes:[t],params:s.params}}return e}function qe(r="default"){return l.isString(r)?{name:r,params:[]}:{params:[],...r}}function Le(r,e,t){const{value:s,iterator:n}=r,{item:o="item",index:i="index"}=n||{};let a=t.__parseExpression(s)||[];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]:",`${s?.value} is not a Arrary`),[])}const z=$.defineComponent({name:"VtjPageContainer",async setup(){const r=W(),e=G.useRoute(),t=e.params.id,s=t?r.getPage(t):r.getHomepage(),n=s?await r.getRenderComponent(s.id):null;return s&&he.useTitle(s.title||"VTJ"),{provider:r,component:n,file:s,query:e.query}},render(){return this.component?$.h(this.component,this.query):$.h("div","页面不存在")}}),Ve=$.defineComponent({name:"VtjStartupContainer",render(){return $.h(ve.XStartup)}}),X=Symbol("Provider");class fe extends E.Base{mode;globals={};modules={};adapter={request:je,jsonp:l.jsonp};apis={};dependencies={};materials={};library={};service;project=null;components={};nodeEnv="development";router=null;materialPath="./";constructor(e){super();const{service:t,mode:s=w.Raw,dependencies:n,materials:o,project:i={},adapter:a={},globals:u={},modules:c={},router:d=null,materialPath:f="./",nodeEnv:p="development"}=e;this.mode=s,this.modules=c,this.service=t,this.router=d,this.materialPath=f,this.nodeEnv=p,n&&(this.dependencies=n),o&&(this.materials=o),Object.assign(this.globals,u),Object.assign(this.adapter,a),s!==w.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:s=[],apis:n}=this.project,{dependencies:o,library:i,components:a,materialPath:u}=this,{libraryExports:c,libraryMap:d,materials:f,materialExports:p,materialMapLibrary:g}=ee(s,u),h=window;h.CKEDITOR_VERSION=void 0;for(const m of c){const j=o[m],_=h[m];if(_)i[m]=_;else if(j)h[m]=i[m]=await j();else{const P=d[m]||[];for(const b of P)B(b)&&await re(m,l.url.append(b,{v:I})),q(b)&&await l.loadScript(l.url.append(b,{v:I})),i[m]=h[m]}}for(const m of f)await l.loadScript(l.url.append(m,{v:I}));const S=this.materials||{};for(const m of p){const j=h[g[m]],_=E.BUILT_IN_COMPONENTS[m];if(_)j&&_.forEach(P=>{a[P]=j[P]});else{const P=S[m]?(await S[m]()).default:h[m];P&&j&&(P.components||[]).forEach(b=>{a[b.name]=te(b,j)})}}n&&(this.apis=ie(n,this.adapter),J(),this.project.config?.mock&&ae(n)),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:Ve}))}install(e){const t=e.config.globalProperties.installed||{};for(const[s,n]of Object.entries(this.library))!t[s]&&se(n)&&(e.use(n),t[s]=!0);e.provide(X,this),e.config.globalProperties.installed=t}getFile(e){const{blocks:t=[]}=this.project||{};return this.getPage(e)||t.find(s=>s.id===e)||null}getPage(e){const{pages:t=[]}=this.project||{},s=(n,o=[])=>{for(const i of o){if(i.id===n)return i;if(i.children&&i.children.length){const a=s(n,i.children);if(a)return a}}};return s(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 getRenderComponent(e){const t=this.getFile(e);if(!t)return l.logger.warn(`Can not find file: ${e}`),null;const s=`.vtj/vue/${e}.vue`,n=this.modules[s];if(n)return(await n())?.default;const o=await this.getDsl(t.id);if(!o)return l.logger.warn(`Can not find dsl: ${e}`),null;const{library:i,components:a,mode:u,apis:c}=this,d={mode:u,Vue:i.Vue,components:a,libs:i,apis:c,window},f=Y({getDsl:async g=>await this.getDsl(g)||null,options:d}),{renderer:p}=U({...d,dsl:o,loader:f});return p}}function Je(r){const e=new fe(r);return{provider:e,onReady:s=>e.ready(s)}}function W(r={}){const e=$.inject(X);if(!e)throw new Error("Can not find provider");if(e.mode===w.Raw&&e.nodeEnv==="development"){const{id:t,version:s}=r;t&&s&&(async()=>{const n=await e.getDsl(t);n?.__VERSION__!==s&&T.ElNotification.warning({title:n?.name,message:"当前组件源码版本与运行时版本不一致,请重新发布组件"})})()}return e}const Ue=new l.Request({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:r=>r.data?.code===0,showError:r=>{T.ElNotification.error({message:r||"未知错误"})}}}),Ye=(r="/vtj/local/repository/${type}.json")=>(e,t)=>Ue.send({url:r,method:"post",query:{type:e},data:{type:e,data:t}});class A{api;constructor(){this.api=Ye()}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(()=>"")}}const v=new l.Storage({type:"local",expired:0,prefix:"__VTJ_"});class Ke extends A{init(e){const t=new E.ProjectModel(e),s=v.get(`project_${t.id}`),n=Object.assign(t.toDsl(),s||{});return v.save(`project_${t.id}`,n),Promise.resolve(n)}saveProject(e){const t=new E.ProjectModel(e);return v.save(`project_${t.id}`,t.toDsl()),Promise.resolve(!0)}saveMaterials(e,t){return v.save(`materials_${e.id}`,l.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return v.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const t=v.get(`file_${e}`);return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return v.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return v.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const t=v.get(`history_${e}`);if(t){const n=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,n),v.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const t=v.get(`history_${e}`),s=new E.HistoryModel(t||{id:e});return Promise.resolve(s.toDsl())}getHistoryItem(e,t){const s=v.get(`history_${e}_${t}`);return Promise.resolve(s)}saveHistoryItem(e,t){return v.save(`history_${e}_${t.id}`,t),Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{v.remove(`history_${e}_${s}`)}),Promise.resolve(!0)}}class de extends A{projects={};materials={};files={};histories={};historyItems={};init(e){const t=new E.ProjectModel(e),s=this.projects[t.id]||{},n=Object.assign(t.toDsl(),s);return this.projects[n.id]=n,Promise.resolve(n)}saveProject(e){const t=new E.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 n=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,n),delete this.historyItems[e]}return Promise.resolve(!0)}getHistory(e){const t=this.histories[e],s=new E.HistoryModel(t||{id:e});return Promise.resolve(s)}getHistoryItem(e,t){const s=`${e}_${t}`,n=this.historyItems[s]||{};return Promise.resolve(n)}saveHistoryItem(e,t){const s=`${e}_${t.id}`;return this.historyItems[s]=t,Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{const n=`${e}_${s}`;delete this.historyItems[n]}),Promise.resolve(!0)}}let M=null;function Xe(){return M||(M=new de,M)}class We extends A{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){return await this.api("getFile",e).catch(()=>null)||{}}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 me(r=[]){return r.map(e=>{const{id:t,title:s,icon:n,children:o,hidden:i}=e;return{id:t,title:s,icon:n,hidden:i,url:`/page/${t}`,children:o&&o.length?me(o):void 0}})}function ze(){const r=W(),e=G.useRoute(),t=$.ref(!1),s=r.project;$.watchEffect(()=>{const{name:i,params:a,meta:u}=e;if(i==="VtjPage"){const c=r.getPage(a.id);t.value=!c?.mask}else if(i==="VtjHomepage"){const c=r.getHomepage();t.value=!c?.mask}else t.value=!u.mask});const n=me(s?.pages),o=s?.config;return{disabled:t,logo:o?.logo,themeSwitchable:o?.themeSwitchable,title:o?.title||s?.description||s?.name||"VTJ App",menus:n}}exports.BUILT_IN_DIRECTIVES=Q;exports.BaseService=A;exports.CONTEXT_HOST=D;exports.Context=le;exports.ContextMode=w;exports.DATA_TYPES=Z;exports.JSCodeToString=we;exports.LIFE_CYCLES_LIST=_e;exports.LocalService=We;exports.MemoryService=de;exports.Provider=fe;exports.StorageService=Ke;exports.VTJ_RENDERER_VERSION=I;exports.adoptedStyleSheets=V;exports.createAssetScripts=ye;exports.createAssetsCss=Se;exports.createDataSources=ue;exports.createLoader=Y;exports.createMemoryService=Xe;exports.createProvider=Je;exports.createRenderer=U;exports.createSchemaApi=oe;exports.createSchemaApis=ie;exports.defaultLoader=pe;exports.fillBasePath=F;exports.getModifiers=K;exports.getRawComponent=te;exports.isCSSUrl=B;exports.isJSCode=ne;exports.isJSExpression=y;exports.isJSFunction=O;exports.isJSUrl=q;exports.isVuePlugin=se;exports.loadCss=re;exports.mockApi=ce;exports.mockApis=ae;exports.mockCleanup=J;exports.nodeRender=H;exports.parseDeps=ee;exports.parseExpression=R;exports.parseFunction=N;exports.providerKey=X;exports.toString=L;exports.useMask=ze;exports.useProvider=W;
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { isUrl as
|
|
3
|
-
import * as
|
|
4
|
-
import { defineComponent as X, h as
|
|
1
|
+
import { Base as ae, BUILT_IN_COMPONENTS as ce, ProjectModel as x, HistoryModel as W } from "@vtj/core";
|
|
2
|
+
import { isUrl as ue, url as P, dedupArray as le, isString as F, isFunction as q, logger as O, createRequest as pe, merge as fe, pathToRegexp as me, pathToRegexpMatch as de, formDataToJson as he, camelCase as E, upperFirst as ve, pick as _e, jsonp as ye, loadScript as J, Request as ge, Storage as we, mapToObject as N } from "@vtj/utils";
|
|
3
|
+
import * as k from "vue";
|
|
4
|
+
import { defineComponent as X, h as D, inject as Se, ref as $e, watchEffect as je } from "vue";
|
|
5
5
|
import { useRoute as Y } from "vue-router";
|
|
6
|
-
import { ElNotification as
|
|
6
|
+
import { ElNotification as B, ElLoading as Ee } from "element-plus";
|
|
7
7
|
import M from "mockjs";
|
|
8
|
-
import { useTitle as
|
|
9
|
-
import { XStartup as
|
|
8
|
+
import { useTitle as be } from "@vueuse/core";
|
|
9
|
+
import { XStartup as Pe } from "@vtj/ui";
|
|
10
10
|
/**!
|
|
11
11
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
12
12
|
* @name @vtj/renderer
|
|
13
13
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
14
|
-
* @version 0.7.
|
|
14
|
+
* @version 0.7.34
|
|
15
15
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const I = "0.7.34";
|
|
18
18
|
var w = /* @__PURE__ */ ((r) => (r.Runtime = "Runtime", r.Design = "Design", r.Raw = "Raw", r.VNode = "VNode", r))(w || {});
|
|
19
|
-
const
|
|
19
|
+
const L = [
|
|
20
20
|
"$el",
|
|
21
21
|
"$emit",
|
|
22
22
|
"$nextTick",
|
|
@@ -28,7 +28,7 @@ const J = [
|
|
|
28
28
|
"$props",
|
|
29
29
|
"$options",
|
|
30
30
|
"$forceUpdate"
|
|
31
|
-
],
|
|
31
|
+
], St = [
|
|
32
32
|
"beforeCreate",
|
|
33
33
|
"created",
|
|
34
34
|
"beforeMount",
|
|
@@ -42,7 +42,7 @@ const J = [
|
|
|
42
42
|
"renderTriggered",
|
|
43
43
|
"activated",
|
|
44
44
|
"deactivated"
|
|
45
|
-
],
|
|
45
|
+
], Fe = ["vIf", "vShow", "vModel", "vFor", "vBind"], Ie = {
|
|
46
46
|
String,
|
|
47
47
|
Number,
|
|
48
48
|
Boolean,
|
|
@@ -51,49 +51,49 @@ const J = [
|
|
|
51
51
|
Function,
|
|
52
52
|
Date
|
|
53
53
|
};
|
|
54
|
-
function
|
|
55
|
-
return r.map((t) =>
|
|
54
|
+
function H(r, e) {
|
|
55
|
+
return r.map((t) => ue(t) ? t : `${e}${t}`);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function z(r) {
|
|
58
58
|
return /\.css$/.test(r);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function G(r) {
|
|
61
61
|
return /\.js$/.test(r);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function $t(r) {
|
|
64
64
|
return r.map(
|
|
65
|
-
(e) => `<script src="${
|
|
65
|
+
(e) => `<script src="${P.append(e, { v: I })}"><\/script>`
|
|
66
66
|
).join("");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function jt(r = []) {
|
|
69
69
|
return r.map(
|
|
70
|
-
(e) => `<link rel="stylesheet" href="${
|
|
70
|
+
(e) => `<link rel="stylesheet" href="${P.append(e, { v: I })}" />`
|
|
71
71
|
).join("");
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const t = r.filter((
|
|
75
|
-
return t.forEach(({ urls:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}), l && (i.push(l), a[l] =
|
|
73
|
+
function Re(r, e) {
|
|
74
|
+
const t = r.filter((f) => !!f.enabled), s = [], n = [], o = [], i = [], a = {}, u = [], c = {};
|
|
75
|
+
return t.forEach(({ urls: f, assetsUrl: p, library: l, assetsLibrary: v }) => {
|
|
76
|
+
f?.forEach((d) => {
|
|
77
|
+
G(d) && s.push(d), z(d) && n.push(d);
|
|
78
|
+
}), l && (i.push(l), a[l] = H(f || [], e)), p && o.push(p), v && u.push(v), l && v && (c[v] = l);
|
|
79
79
|
}), {
|
|
80
|
-
scripts:
|
|
81
|
-
css:
|
|
82
|
-
materials:
|
|
80
|
+
scripts: H(s, e),
|
|
81
|
+
css: H(n, e),
|
|
82
|
+
materials: H(o, e),
|
|
83
83
|
libraryExports: i,
|
|
84
|
-
materialExports:
|
|
84
|
+
materialExports: le(u),
|
|
85
85
|
materialMapLibrary: c,
|
|
86
86
|
libraryMap: a
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function He(r, e) {
|
|
90
90
|
const { name: t, parent: s, alias: n } = r;
|
|
91
91
|
return s ? e[s]?.[n || t] : e[n || t];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
93
|
+
function Q(r) {
|
|
94
|
+
return F(r) ? r : JSON.stringify(r);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Z(r, e, t) {
|
|
97
97
|
const s = r.CSSStyleSheet;
|
|
98
98
|
if (s.prototype.replaceSync) {
|
|
99
99
|
const n = new s();
|
|
@@ -108,14 +108,14 @@ function Q(r, e, t) {
|
|
|
108
108
|
o ? o.innerHTML = t : (o = n.createElement("style"), o.id = e, o.innerHTML = t, n.head.appendChild(o));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
async function
|
|
111
|
+
async function Ce(r, e) {
|
|
112
112
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
|
113
|
-
t &&
|
|
113
|
+
t && Z(window, r, t);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function xe(r) {
|
|
116
|
+
return q(r) || q(r?.install);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function R(r, e, t = !1, s = !1) {
|
|
119
119
|
try {
|
|
120
120
|
const n = ['"use strict";', "var __self = arguments[0];"];
|
|
121
121
|
n.push("return ");
|
|
@@ -125,13 +125,13 @@ function I(r, e, t = !1, s = !1) {
|
|
|
125
125
|
const i = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
|
|
126
126
|
return new Function("$scope", i)(e);
|
|
127
127
|
} catch (n) {
|
|
128
|
-
if (
|
|
128
|
+
if (O.error("parseExpression.error", n, r, e?.__self ?? e), s)
|
|
129
129
|
throw n;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
const n =
|
|
134
|
-
if (typeof n != "function" && (
|
|
132
|
+
function U(r, e, t = !1, s = !1) {
|
|
133
|
+
const n = R(r, e, t, s);
|
|
134
|
+
if (typeof n != "function" && (O.error(
|
|
135
135
|
"parseFunction.error",
|
|
136
136
|
"not a function",
|
|
137
137
|
r,
|
|
@@ -143,17 +143,17 @@ function L(r, e, t = !1, s = !1) {
|
|
|
143
143
|
function g(r) {
|
|
144
144
|
return r && r.type === "JSExpression";
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function A(r) {
|
|
147
147
|
return typeof r == "object" && r && r.type === "JSFunction";
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return g(r) ||
|
|
149
|
+
function Oe(r) {
|
|
150
|
+
return g(r) || A(r);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
152
|
+
function Et(r) {
|
|
153
|
+
return Oe(r) ? r.value : JSON.stringify(r);
|
|
154
154
|
}
|
|
155
|
-
let
|
|
156
|
-
const Me =
|
|
155
|
+
let b = null;
|
|
156
|
+
const Me = pe({
|
|
157
157
|
settings: {
|
|
158
158
|
type: "form",
|
|
159
159
|
validSuccess: !0,
|
|
@@ -162,23 +162,23 @@ const Me = le({
|
|
|
162
162
|
validate: (r) => r.data?.code === 0 || !!r.data?.success,
|
|
163
163
|
failMessage: !0,
|
|
164
164
|
showError: (r) => {
|
|
165
|
-
|
|
165
|
+
B.error({
|
|
166
166
|
message: r || "未知错误"
|
|
167
167
|
});
|
|
168
168
|
},
|
|
169
169
|
showLoading: () => {
|
|
170
|
-
|
|
170
|
+
b && b.close(), b = Ee.service({
|
|
171
171
|
lock: !0,
|
|
172
172
|
text: "Loading",
|
|
173
173
|
background: "rgba(0, 0, 0, 0.05)"
|
|
174
174
|
});
|
|
175
175
|
},
|
|
176
176
|
hideLoading: () => {
|
|
177
|
-
|
|
177
|
+
b && (b.close(), b = null);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
|
-
function
|
|
181
|
+
function Te(r, e) {
|
|
182
182
|
const { jsonp: t, request: s } = e;
|
|
183
183
|
if (r.method === "jsonp")
|
|
184
184
|
return (n = {}) => t(r.url, {
|
|
@@ -186,7 +186,7 @@ function Oe(r, e) {
|
|
|
186
186
|
query: n
|
|
187
187
|
});
|
|
188
188
|
{
|
|
189
|
-
const n = r.headers ?
|
|
189
|
+
const n = r.headers ? R(r.headers, {}, !0) : void 0, o = {
|
|
190
190
|
url: r.url,
|
|
191
191
|
method: r.method,
|
|
192
192
|
settings: {
|
|
@@ -194,36 +194,36 @@ function Oe(r, e) {
|
|
|
194
194
|
headers: n
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
|
-
return (i, a) => s.send(
|
|
197
|
+
return (i, a) => s.send(fe(o, a || {}, { data: i }));
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function ke(r = [], e) {
|
|
201
201
|
return r.reduce(
|
|
202
|
-
(t, s) => (t[s.id] =
|
|
202
|
+
(t, s) => (t[s.id] = Te(s, e), t),
|
|
203
203
|
{}
|
|
204
204
|
);
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Ae(r = []) {
|
|
207
207
|
M.setup({
|
|
208
208
|
timeout: "50-500"
|
|
209
|
-
}),
|
|
209
|
+
}), ee(), r.forEach((e) => De(e));
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function De(r) {
|
|
212
212
|
if (!r.mock)
|
|
213
213
|
return;
|
|
214
214
|
const { url: e, mockTemplate: t } = r;
|
|
215
215
|
if (e && t) {
|
|
216
|
-
const s =
|
|
216
|
+
const s = me(`${e}(.*)`), n = de(e, { decode: decodeURIComponent }), o = R(t, {}, !0);
|
|
217
217
|
M.mock(s, (i) => {
|
|
218
|
-
const a =
|
|
218
|
+
const a = P.parse(i.url) || {}, u = i.body instanceof FormData ? he(i.body) : i.body, c = n(i.url)?.params;
|
|
219
219
|
return Object.assign(i, { data: u, params: a, query: c }), M.mock(o(i));
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function ee() {
|
|
224
224
|
M._mocked = {};
|
|
225
225
|
}
|
|
226
|
-
class
|
|
226
|
+
class Ne {
|
|
227
227
|
__id = null;
|
|
228
228
|
__mode;
|
|
229
229
|
__instance = null;
|
|
@@ -251,7 +251,7 @@ class De {
|
|
|
251
251
|
const { mode: t, dsl: s, attrs: n } = e;
|
|
252
252
|
this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), n && Object.assign(this, n);
|
|
253
253
|
}
|
|
254
|
-
setup(e, t =
|
|
254
|
+
setup(e, t = k) {
|
|
255
255
|
const s = t.getCurrentInstance();
|
|
256
256
|
if (!s)
|
|
257
257
|
return;
|
|
@@ -264,12 +264,12 @@ class De {
|
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
__proxy() {
|
|
267
|
-
this.__instance &&
|
|
267
|
+
this.__instance && L.forEach((e) => {
|
|
268
268
|
this[e] = this.__instance?.[e];
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
271
|
__cleanup() {
|
|
272
|
-
|
|
272
|
+
L.forEach((e) => {
|
|
273
273
|
this[e] = null;
|
|
274
274
|
});
|
|
275
275
|
}
|
|
@@ -277,17 +277,17 @@ class De {
|
|
|
277
277
|
if (e)
|
|
278
278
|
if (this.__mode === w.Runtime) {
|
|
279
279
|
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
|
280
|
-
return
|
|
280
|
+
return U({ type: s, value: n }, this);
|
|
281
281
|
} else
|
|
282
|
-
return
|
|
282
|
+
return U(e, this);
|
|
283
283
|
}
|
|
284
284
|
__parseExpression(e) {
|
|
285
285
|
if (e)
|
|
286
286
|
if (this.__mode === w.Runtime) {
|
|
287
287
|
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
|
288
|
-
return
|
|
288
|
+
return R({ type: s, value: n }, this);
|
|
289
289
|
} else
|
|
290
|
-
return
|
|
290
|
+
return R(e, this);
|
|
291
291
|
}
|
|
292
292
|
__ref(e = null, t) {
|
|
293
293
|
if (this.__mode !== w.VNode)
|
|
@@ -318,9 +318,9 @@ class De {
|
|
|
318
318
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function te(r) {
|
|
322
322
|
const {
|
|
323
|
-
Vue: e =
|
|
323
|
+
Vue: e = k,
|
|
324
324
|
mode: t = w.Runtime,
|
|
325
325
|
components: s = {},
|
|
326
326
|
libs: n = {},
|
|
@@ -330,31 +330,31 @@ function ee(r) {
|
|
|
330
330
|
$components: s,
|
|
331
331
|
$libs: n,
|
|
332
332
|
$apis: o
|
|
333
|
-
}, c = new
|
|
333
|
+
}, c = new Ne({
|
|
334
334
|
mode: t,
|
|
335
335
|
dsl: a.value,
|
|
336
336
|
attrs: u
|
|
337
|
-
}),
|
|
337
|
+
}), f = e.defineComponent({
|
|
338
338
|
name: a.value.name,
|
|
339
339
|
props: {
|
|
340
|
-
...
|
|
340
|
+
...Be(a.value.props ?? [], c)
|
|
341
341
|
},
|
|
342
|
-
setup(
|
|
343
|
-
c.$props =
|
|
342
|
+
setup(p) {
|
|
343
|
+
c.$props = p, a.value.id && Z(
|
|
344
344
|
r.window || window,
|
|
345
345
|
a.value.id,
|
|
346
346
|
a.value.css || ""
|
|
347
|
-
), c.state =
|
|
348
|
-
const l =
|
|
347
|
+
), c.state = Ve(e, a.value.state ?? {}, c);
|
|
348
|
+
const l = qe(e, a.value.computed ?? {}, c), v = Je(a.value.methods ?? {}, c), d = Le(e, a.value.inject, c), y = Ue(
|
|
349
349
|
a.value.dataSources || {},
|
|
350
350
|
c
|
|
351
|
-
),
|
|
352
|
-
...
|
|
351
|
+
), m = {
|
|
352
|
+
...d,
|
|
353
353
|
...l,
|
|
354
354
|
...v,
|
|
355
|
-
...
|
|
355
|
+
...y
|
|
356
356
|
};
|
|
357
|
-
return c.setup(
|
|
357
|
+
return c.setup(m, e), Ke(e, a.value.watch ?? [], c), {
|
|
358
358
|
vtj: c
|
|
359
359
|
};
|
|
360
360
|
},
|
|
@@ -363,19 +363,19 @@ function ee(r) {
|
|
|
363
363
|
render() {
|
|
364
364
|
if (!a.value.nodes)
|
|
365
365
|
return null;
|
|
366
|
-
const
|
|
367
|
-
return
|
|
366
|
+
const p = a.value.nodes || [];
|
|
367
|
+
return p.length === 1 ? T(p[0], c, e, i) : p.map((l) => T(l, c, e, i));
|
|
368
368
|
},
|
|
369
369
|
...We(a.value.lifeCycles ?? {}, c)
|
|
370
370
|
});
|
|
371
371
|
return {
|
|
372
|
-
renderer: e.markRaw(
|
|
372
|
+
renderer: e.markRaw(f),
|
|
373
373
|
context: c
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) =>
|
|
378
|
-
return r.map((s) =>
|
|
376
|
+
function Be(r = [], e) {
|
|
377
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => Ie[o]) : void 0;
|
|
378
|
+
return r.map((s) => F(s) ? {
|
|
379
379
|
name: s
|
|
380
380
|
} : {
|
|
381
381
|
name: s.name,
|
|
@@ -391,30 +391,30 @@ function Ne(r = [], e) {
|
|
|
391
391
|
{}
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function Ve(r, e, t) {
|
|
395
395
|
return r.reactive(
|
|
396
396
|
Object.keys(e || {}).reduce(
|
|
397
397
|
(s, n) => {
|
|
398
398
|
let o = e[n];
|
|
399
|
-
return g(o) ? o = t.__parseExpression(o) :
|
|
399
|
+
return g(o) ? o = t.__parseExpression(o) : A(o) && (o = t.__parseFunction(o)), s[n] = o, s;
|
|
400
400
|
},
|
|
401
401
|
{}
|
|
402
402
|
)
|
|
403
403
|
);
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function qe(r, e, t) {
|
|
406
406
|
return Object.entries(e ?? {}).reduce(
|
|
407
407
|
(s, [n, o]) => (s[n] = r.computed(t.__parseFunction(o)), s),
|
|
408
408
|
{}
|
|
409
409
|
);
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function Je(r, e) {
|
|
412
412
|
return Object.entries(r ?? {}).reduce(
|
|
413
413
|
(t, [s, n]) => (t[s] = e.__parseFunction(n), t),
|
|
414
414
|
{}
|
|
415
415
|
);
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function Le(r, e = [], t) {
|
|
418
418
|
return e.reduce(
|
|
419
419
|
(s, n) => {
|
|
420
420
|
const { name: o, from: i } = n || {};
|
|
@@ -425,10 +425,10 @@ function Je(r, e = [], t) {
|
|
|
425
425
|
{}
|
|
426
426
|
);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Ue(r, e) {
|
|
429
429
|
return Object.keys(r).reduce(
|
|
430
430
|
(t, s) => {
|
|
431
|
-
const n = r[s], o = e.$apis[n.ref], i =
|
|
431
|
+
const n = r[s], o = e.$apis[n.ref], i = A(n.transform) ? n.transform.value ? e.__parseFunction(n.transform) : void 0 : n.transform;
|
|
432
432
|
return t[s] = async (...a) => {
|
|
433
433
|
const u = await o.apply(e, a);
|
|
434
434
|
return i ? i(u) : u;
|
|
@@ -437,7 +437,7 @@ function Le(r, e) {
|
|
|
437
437
|
{}
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Ke(r, e = [], t) {
|
|
441
441
|
e.forEach((s) => {
|
|
442
442
|
r.watch(
|
|
443
443
|
t.__parseExpression(s.source),
|
|
@@ -456,50 +456,50 @@ function We(r, e) {
|
|
|
456
456
|
);
|
|
457
457
|
}
|
|
458
458
|
const Xe = (r) => r;
|
|
459
|
-
function
|
|
459
|
+
function re(r) {
|
|
460
460
|
const { getDsl: e, options: t } = r;
|
|
461
|
-
return (s, n, o =
|
|
461
|
+
return (s, n, o = k) => !n || typeof n == "string" ? s : n.type === "Schema" ? o.defineAsyncComponent(async () => {
|
|
462
462
|
const i = await e(n.id);
|
|
463
|
-
return i ?
|
|
463
|
+
return i ? te({
|
|
464
464
|
...t,
|
|
465
465
|
Vue: o,
|
|
466
466
|
dsl: i,
|
|
467
467
|
mode: w.Runtime,
|
|
468
|
-
loader:
|
|
468
|
+
loader: re(r)
|
|
469
469
|
}).renderer : null;
|
|
470
470
|
}) : s;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function T(r, e, t = k, s = Xe) {
|
|
473
473
|
if (!r || !r.name || r.invisible)
|
|
474
474
|
return null;
|
|
475
|
-
const { id: n = null, directives: o = [] } = r, { vIf: i, vFor: a, vShow: u, vModels: c, vBind:
|
|
476
|
-
if (i && !
|
|
475
|
+
const { id: n = null, directives: o = [] } = r, { vIf: i, vFor: a, vShow: u, vModels: c, vBind: f } = Ye(o);
|
|
476
|
+
if (i && !ze(i, e))
|
|
477
477
|
return null;
|
|
478
|
-
const
|
|
479
|
-
const v = l.$components,
|
|
478
|
+
const p = (l) => {
|
|
479
|
+
const v = l.$components, d = (() => {
|
|
480
480
|
if (r.name === "component")
|
|
481
|
-
return
|
|
481
|
+
return Ge(l, r.props?.is);
|
|
482
482
|
if (r.name === "slot")
|
|
483
483
|
return r.name;
|
|
484
|
-
const
|
|
485
|
-
return
|
|
486
|
-
})(),
|
|
484
|
+
const _ = s(r.name, r.from, t);
|
|
485
|
+
return F(_) ? v[_] ?? _ : _;
|
|
486
|
+
})(), y = Qe(n, r.props ?? {}, l), m = Ze(t, r.events ?? {}, l);
|
|
487
487
|
if (r.name === "slot")
|
|
488
|
-
return
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
)), c.forEach((
|
|
493
|
-
Object.assign(
|
|
488
|
+
return et(t, r, y, l);
|
|
489
|
+
f && Object.assign(y, l.__parseExpression(f.value)), u && (y.style = Object.assign(
|
|
490
|
+
y.style ?? {},
|
|
491
|
+
rt(u, l)
|
|
492
|
+
)), c.forEach((_) => {
|
|
493
|
+
Object.assign(y, st(t, _, l));
|
|
494
494
|
});
|
|
495
|
-
const S =
|
|
496
|
-
return t.createVNode(
|
|
495
|
+
const S = nt(t, r.children ?? [], l, r);
|
|
496
|
+
return t.createVNode(d, { ...y, ...m }, S);
|
|
497
497
|
};
|
|
498
|
-
return a ?
|
|
498
|
+
return a ? at(a, p, e) : p(e);
|
|
499
499
|
}
|
|
500
500
|
function Ye(r = []) {
|
|
501
|
-
const e = r.find((a) =>
|
|
502
|
-
(a) => !
|
|
501
|
+
const e = r.find((a) => E(a.name) === "vIf"), t = r.find((a) => E(a.name) === "vFor"), s = r.find((a) => E(a.name) === "vShow"), n = r.find((a) => E(a.name) === "vBind"), o = r.filter((a) => E(a.name) === "vModel"), i = r.filter(
|
|
502
|
+
(a) => !Fe.includes(E(a.name))
|
|
503
503
|
);
|
|
504
504
|
return {
|
|
505
505
|
vIf: e,
|
|
@@ -510,23 +510,23 @@ function Ye(r = []) {
|
|
|
510
510
|
others: i
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ze(r, e) {
|
|
514
514
|
return !!e.__parseExpression(r.value);
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Ge(r, e) {
|
|
517
517
|
return e ? g(e) ? r.__parseExpression(e) : e : "div";
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Qe(r, e, t) {
|
|
520
520
|
const s = Object.keys(e || {}).reduce(
|
|
521
521
|
(n, o) => {
|
|
522
522
|
let i = e[o];
|
|
523
|
-
return g(i) ? i = t.__parseExpression(i) :
|
|
523
|
+
return g(i) ? i = t.__parseExpression(i) : A(i) && (i = t.__parseFunction(i)), n[o] = i, n;
|
|
524
524
|
},
|
|
525
525
|
{}
|
|
526
526
|
);
|
|
527
527
|
return s.ref = t.__ref(r, s.ref), s;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function Ze(r, e, t) {
|
|
530
530
|
const s = ["passive", "capture", "once"], n = {
|
|
531
531
|
capture: "Capture",
|
|
532
532
|
once: "Once",
|
|
@@ -534,69 +534,69 @@ function Qe(r, e, t) {
|
|
|
534
534
|
};
|
|
535
535
|
return Object.keys(e || {}).reduce(
|
|
536
536
|
(o, i) => {
|
|
537
|
-
const a = e[i], u =
|
|
538
|
-
return
|
|
537
|
+
const a = e[i], u = se(a.modifiers), c = u.find((l) => s.includes(l)), f = "on" + ve(i) + (c && n[c] || ""), p = t.__parseFunction(a.handler);
|
|
538
|
+
return p && (o[f] = r.withModifiers(p, u)), o;
|
|
539
539
|
},
|
|
540
540
|
{}
|
|
541
541
|
);
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function se(r = {}, e = !1) {
|
|
544
544
|
const t = Object.keys(r);
|
|
545
545
|
return e ? t.map((s) => "." + s) : t;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
const { children: n } = e, o =
|
|
549
|
-
return i ? i(t) : n ?
|
|
550
|
-
|
|
551
|
-
) : Array.isArray(n) ? n.map((a) =>
|
|
547
|
+
function et(r, e, t, s) {
|
|
548
|
+
const { children: n } = e, o = tt(e, s), i = s.$slots?.[o.name];
|
|
549
|
+
return i ? i(t) : n ? F(n) ? r.createTextVNode(n) : g(n) ? r.createTextVNode(
|
|
550
|
+
Q(s.__parseExpression(n))
|
|
551
|
+
) : Array.isArray(n) ? n.map((a) => T(a, s, r)) : null : null;
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function tt(r, e) {
|
|
554
554
|
const { props: t } = r, s = t?.name || "default";
|
|
555
555
|
return {
|
|
556
556
|
name: g(s) ? e.__parseExpression(s) : s,
|
|
557
557
|
params: []
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function rt(r, e) {
|
|
561
561
|
return e.__parseExpression(r.value) ? {} : {
|
|
562
562
|
display: "none"
|
|
563
563
|
};
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function st(r, e, t) {
|
|
566
566
|
const s = {
|
|
567
567
|
type: "JSFunction",
|
|
568
568
|
value: e.value?.value ? `(v) => {
|
|
569
569
|
${e.value.value} = v;
|
|
570
570
|
}` : "(v) => {}"
|
|
571
|
-
}, n = t.__parseFunction(s), o =
|
|
571
|
+
}, n = t.__parseFunction(s), o = se(e.modifiers), i = g(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
572
572
|
return {
|
|
573
573
|
[i]: t.__parseExpression(e.value),
|
|
574
574
|
[`onUpdate:${i}`]: o.length && n ? r.withModifiers(n, o) : n
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function nt(r, e, t, s) {
|
|
578
578
|
if (!e)
|
|
579
579
|
return null;
|
|
580
|
-
if (
|
|
580
|
+
if (F(e))
|
|
581
581
|
return { default: () => e };
|
|
582
582
|
if (g(e))
|
|
583
583
|
return {
|
|
584
|
-
default: () =>
|
|
584
|
+
default: () => Q(t.__parseExpression(e))
|
|
585
585
|
};
|
|
586
586
|
if (Array.isArray(e) && e.length > 0) {
|
|
587
|
-
const n =
|
|
587
|
+
const n = ot(e), o = (i) => !i || !s ? {} : s?.id && Object.keys(i).length ? {
|
|
588
588
|
[`scope_${s.id}`]: i
|
|
589
589
|
} : {};
|
|
590
|
-
return Object.entries(n).reduce((i, [a, { nodes: u, params: c }]) => (i[a] = (
|
|
591
|
-
const
|
|
590
|
+
return Object.entries(n).reduce((i, [a, { nodes: u, params: c }]) => (i[a] = (f) => {
|
|
591
|
+
const p = c.length ? _e(f ?? {}, c) : o(f);
|
|
592
592
|
return u.map(
|
|
593
|
-
(l) =>
|
|
593
|
+
(l) => T(l, t.__clone(p), r)
|
|
594
594
|
);
|
|
595
595
|
}, i), {});
|
|
596
596
|
}
|
|
597
597
|
return null;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function ot(r) {
|
|
600
600
|
const e = {
|
|
601
601
|
default: {
|
|
602
602
|
params: [],
|
|
@@ -604,7 +604,7 @@ function nt(r) {
|
|
|
604
604
|
}
|
|
605
605
|
};
|
|
606
606
|
for (const t of r) {
|
|
607
|
-
const s =
|
|
607
|
+
const s = it(t.slot), n = s.name;
|
|
608
608
|
e[n] ? (e[n].nodes.push(t), e[n].params = e[n].params.concat(s.params)) : e[n] = {
|
|
609
609
|
nodes: [t],
|
|
610
610
|
params: s.params
|
|
@@ -612,19 +612,19 @@ function nt(r) {
|
|
|
612
612
|
}
|
|
613
613
|
return e;
|
|
614
614
|
}
|
|
615
|
-
function
|
|
616
|
-
return
|
|
615
|
+
function it(r = "default") {
|
|
616
|
+
return F(r) ? { name: r, params: [] } : { params: [], ...r };
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function at(r, e, t) {
|
|
619
619
|
const { value: s, iterator: n } = r, { item: o = "item", index: i = "index" } = n || {};
|
|
620
620
|
let a = t.__parseExpression(s) || [];
|
|
621
621
|
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]:", `${s?.value} is not a Arrary`), []);
|
|
622
622
|
}
|
|
623
|
-
const
|
|
623
|
+
const K = X({
|
|
624
624
|
name: "VtjPageContainer",
|
|
625
625
|
async setup() {
|
|
626
|
-
const r =
|
|
627
|
-
return s &&
|
|
626
|
+
const r = oe(), e = Y(), t = e.params.id, s = t ? r.getPage(t) : r.getHomepage(), n = s ? await r.getRenderComponent(s.id) : null;
|
|
627
|
+
return s && be(s.title || "VTJ"), {
|
|
628
628
|
provider: r,
|
|
629
629
|
component: n,
|
|
630
630
|
file: s,
|
|
@@ -632,19 +632,19 @@ const U = X({
|
|
|
632
632
|
};
|
|
633
633
|
},
|
|
634
634
|
render() {
|
|
635
|
-
return this.component ?
|
|
635
|
+
return this.component ? D(this.component, this.query) : D("div", "页面不存在");
|
|
636
636
|
}
|
|
637
|
-
}),
|
|
637
|
+
}), ct = X({
|
|
638
638
|
name: "VtjStartupContainer",
|
|
639
639
|
render() {
|
|
640
|
-
return
|
|
640
|
+
return D(Pe);
|
|
641
641
|
}
|
|
642
|
-
}),
|
|
643
|
-
class
|
|
642
|
+
}), ne = Symbol("Provider");
|
|
643
|
+
class ut extends ae {
|
|
644
644
|
mode;
|
|
645
645
|
globals = {};
|
|
646
646
|
modules = {};
|
|
647
|
-
adapter = { request: Me, jsonp:
|
|
647
|
+
adapter = { request: Me, jsonp: ye };
|
|
648
648
|
apis = {};
|
|
649
649
|
dependencies = {};
|
|
650
650
|
materials = {};
|
|
@@ -666,11 +666,11 @@ class ct extends ie {
|
|
|
666
666
|
adapter: a = {},
|
|
667
667
|
globals: u = {},
|
|
668
668
|
modules: c = {},
|
|
669
|
-
router:
|
|
670
|
-
materialPath:
|
|
669
|
+
router: f = null,
|
|
670
|
+
materialPath: p = "./",
|
|
671
671
|
nodeEnv: l = "development"
|
|
672
672
|
} = e;
|
|
673
|
-
this.mode = s, this.modules = c, this.service = t, this.router =
|
|
673
|
+
this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = p, this.nodeEnv = l, n && (this.dependencies = n), o && (this.materials = o), Object.assign(this.globals, u), Object.assign(this.adapter, a), s !== w.Design && this.load(i);
|
|
674
674
|
}
|
|
675
675
|
async load(e) {
|
|
676
676
|
const t = this.modules[`.vtj/projects/${e.id}.json`];
|
|
@@ -678,58 +678,59 @@ class ct extends ie {
|
|
|
678
678
|
throw new Error("project is null");
|
|
679
679
|
const { dependencies: s = [], apis: n } = this.project, { dependencies: o, library: i, components: a, materialPath: u } = this, {
|
|
680
680
|
libraryExports: c,
|
|
681
|
-
libraryMap:
|
|
682
|
-
materials:
|
|
681
|
+
libraryMap: f,
|
|
682
|
+
materials: p,
|
|
683
683
|
materialExports: l,
|
|
684
684
|
materialMapLibrary: v
|
|
685
|
-
} =
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
685
|
+
} = Re(s, u), d = window;
|
|
686
|
+
d.CKEDITOR_VERSION = void 0;
|
|
687
|
+
for (const m of c) {
|
|
688
|
+
const S = o[m], _ = d[m];
|
|
689
|
+
if (_)
|
|
690
|
+
i[m] = _;
|
|
691
|
+
else if (S)
|
|
692
|
+
d[m] = i[m] = await S();
|
|
692
693
|
else {
|
|
693
|
-
const
|
|
694
|
-
for (const
|
|
695
|
-
|
|
694
|
+
const $ = f[m] || [];
|
|
695
|
+
for (const j of $)
|
|
696
|
+
z(j) && await Ce(m, P.append(j, { v: I })), G(j) && await J(P.append(j, { v: I })), i[m] = d[m];
|
|
696
697
|
}
|
|
697
698
|
}
|
|
698
|
-
for (const
|
|
699
|
-
await
|
|
700
|
-
const
|
|
701
|
-
for (const
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
704
|
-
|
|
705
|
-
a[
|
|
699
|
+
for (const m of p)
|
|
700
|
+
await J(P.append(m, { v: I }));
|
|
701
|
+
const y = this.materials || {};
|
|
702
|
+
for (const m of l) {
|
|
703
|
+
const S = d[v[m]], _ = ce[m];
|
|
704
|
+
if (_)
|
|
705
|
+
S && _.forEach(($) => {
|
|
706
|
+
a[$] = S[$];
|
|
706
707
|
});
|
|
707
708
|
else {
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
a[
|
|
709
|
+
const $ = y[m] ? (await y[m]()).default : d[m];
|
|
710
|
+
$ && S && ($.components || []).forEach((j) => {
|
|
711
|
+
a[j.name] = He(j, S);
|
|
711
712
|
});
|
|
712
713
|
}
|
|
713
714
|
}
|
|
714
|
-
n && (this.apis =
|
|
715
|
+
n && (this.apis = ke(n, this.adapter), ee(), this.project.config?.mock && Ae(n)), this.initRouter(), this.triggerReady();
|
|
715
716
|
}
|
|
716
717
|
initRouter() {
|
|
717
718
|
const { router: e, project: t } = this;
|
|
718
719
|
e && (e.addRoute({
|
|
719
720
|
path: "/page/:id",
|
|
720
721
|
name: "VtjPage",
|
|
721
|
-
component:
|
|
722
|
+
component: K
|
|
722
723
|
}), e.addRoute({
|
|
723
724
|
path: "/",
|
|
724
725
|
name: "VtjHomepage",
|
|
725
|
-
component: t?.homepage ?
|
|
726
|
+
component: t?.homepage ? K : ct
|
|
726
727
|
}));
|
|
727
728
|
}
|
|
728
729
|
install(e) {
|
|
729
730
|
const t = e.config.globalProperties.installed || {};
|
|
730
731
|
for (const [s, n] of Object.entries(this.library))
|
|
731
|
-
!t[s] &&
|
|
732
|
-
e.provide(
|
|
732
|
+
!t[s] && xe(n) && (e.use(n), t[s] = !0);
|
|
733
|
+
e.provide(ne, this), e.config.globalProperties.installed = t;
|
|
733
734
|
}
|
|
734
735
|
getFile(e) {
|
|
735
736
|
const { blocks: t = [] } = this.project || {};
|
|
@@ -760,47 +761,47 @@ class ct extends ie {
|
|
|
760
761
|
async getRenderComponent(e) {
|
|
761
762
|
const t = this.getFile(e);
|
|
762
763
|
if (!t)
|
|
763
|
-
return
|
|
764
|
+
return O.warn(`Can not find file: ${e}`), null;
|
|
764
765
|
const s = `.vtj/vue/${e}.vue`, n = this.modules[s];
|
|
765
766
|
if (n)
|
|
766
767
|
return (await n())?.default;
|
|
767
768
|
const o = await this.getDsl(t.id);
|
|
768
769
|
if (!o)
|
|
769
|
-
return
|
|
770
|
-
const { library: i, components: a, mode: u, apis: c } = this,
|
|
770
|
+
return O.warn(`Can not find dsl: ${e}`), null;
|
|
771
|
+
const { library: i, components: a, mode: u, apis: c } = this, f = {
|
|
771
772
|
mode: u,
|
|
772
773
|
Vue: i.Vue,
|
|
773
774
|
components: a,
|
|
774
775
|
libs: i,
|
|
775
776
|
apis: c,
|
|
776
777
|
window
|
|
777
|
-
},
|
|
778
|
+
}, p = re({
|
|
778
779
|
getDsl: async (v) => await this.getDsl(v) || null,
|
|
779
|
-
options:
|
|
780
|
-
}), { renderer: l } =
|
|
781
|
-
...
|
|
780
|
+
options: f
|
|
781
|
+
}), { renderer: l } = te({
|
|
782
|
+
...f,
|
|
782
783
|
dsl: o,
|
|
783
|
-
loader:
|
|
784
|
+
loader: p
|
|
784
785
|
});
|
|
785
786
|
return l;
|
|
786
787
|
}
|
|
787
788
|
}
|
|
788
|
-
function
|
|
789
|
-
const e = new
|
|
789
|
+
function bt(r) {
|
|
790
|
+
const e = new ut(r);
|
|
790
791
|
return {
|
|
791
792
|
provider: e,
|
|
792
793
|
onReady: (s) => e.ready(s)
|
|
793
794
|
};
|
|
794
795
|
}
|
|
795
|
-
function
|
|
796
|
-
const e =
|
|
796
|
+
function oe(r = {}) {
|
|
797
|
+
const e = Se(ne);
|
|
797
798
|
if (!e)
|
|
798
799
|
throw new Error("Can not find provider");
|
|
799
800
|
if (e.mode === w.Raw && e.nodeEnv === "development") {
|
|
800
801
|
const { id: t, version: s } = r;
|
|
801
802
|
t && s && (async () => {
|
|
802
803
|
const n = await e.getDsl(t);
|
|
803
|
-
n?.__VERSION__ !== s &&
|
|
804
|
+
n?.__VERSION__ !== s && B.warning({
|
|
804
805
|
title: n?.name,
|
|
805
806
|
message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
|
|
806
807
|
});
|
|
@@ -808,7 +809,7 @@ function ne(r = {}) {
|
|
|
808
809
|
}
|
|
809
810
|
return e;
|
|
810
811
|
}
|
|
811
|
-
const
|
|
812
|
+
const lt = new ge({
|
|
812
813
|
settings: {
|
|
813
814
|
type: "json",
|
|
814
815
|
validSuccess: !0,
|
|
@@ -816,12 +817,12 @@ const ut = new ye({
|
|
|
816
817
|
failMessage: !0,
|
|
817
818
|
validate: (r) => r.data?.code === 0,
|
|
818
819
|
showError: (r) => {
|
|
819
|
-
|
|
820
|
+
B.error({
|
|
820
821
|
message: r || "未知错误"
|
|
821
822
|
});
|
|
822
823
|
}
|
|
823
824
|
}
|
|
824
|
-
}),
|
|
825
|
+
}), pt = (r = "/vtj/local/repository/${type}.json") => (e, t) => lt.send({
|
|
825
826
|
url: r,
|
|
826
827
|
method: "post",
|
|
827
828
|
query: { type: e },
|
|
@@ -830,10 +831,10 @@ const ut = new ye({
|
|
|
830
831
|
data: t
|
|
831
832
|
}
|
|
832
833
|
});
|
|
833
|
-
class
|
|
834
|
+
class V {
|
|
834
835
|
api;
|
|
835
836
|
constructor() {
|
|
836
|
-
this.api =
|
|
837
|
+
this.api = pt();
|
|
837
838
|
}
|
|
838
839
|
async init(e) {
|
|
839
840
|
return console.log("BaseService.init", e), {};
|
|
@@ -889,22 +890,22 @@ class B {
|
|
|
889
890
|
return await this.api("removeRawPage", e).catch(() => "");
|
|
890
891
|
}
|
|
891
892
|
}
|
|
892
|
-
const h = new
|
|
893
|
+
const h = new we({
|
|
893
894
|
type: "local",
|
|
894
895
|
expired: 0,
|
|
895
896
|
prefix: "__VTJ_"
|
|
896
897
|
});
|
|
897
|
-
class
|
|
898
|
+
class Pt extends V {
|
|
898
899
|
init(e) {
|
|
899
|
-
const t = new
|
|
900
|
+
const t = new x(e), s = h.get(`project_${t.id}`), n = Object.assign(t.toDsl(), s || {});
|
|
900
901
|
return h.save(`project_${t.id}`, n), Promise.resolve(n);
|
|
901
902
|
}
|
|
902
903
|
saveProject(e) {
|
|
903
|
-
const t = new
|
|
904
|
+
const t = new x(e);
|
|
904
905
|
return h.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
|
905
906
|
}
|
|
906
907
|
saveMaterials(e, t) {
|
|
907
|
-
return h.save(`materials_${e.id}`,
|
|
908
|
+
return h.save(`materials_${e.id}`, N(t)), Promise.resolve(!0);
|
|
908
909
|
}
|
|
909
910
|
saveFile(e) {
|
|
910
911
|
return h.save(`file_${e.id}`, e), Promise.resolve(!0);
|
|
@@ -944,22 +945,22 @@ class bt extends B {
|
|
|
944
945
|
}), Promise.resolve(!0);
|
|
945
946
|
}
|
|
946
947
|
}
|
|
947
|
-
class
|
|
948
|
+
class ft extends V {
|
|
948
949
|
projects = {};
|
|
949
950
|
materials = {};
|
|
950
951
|
files = {};
|
|
951
952
|
histories = {};
|
|
952
953
|
historyItems = {};
|
|
953
954
|
init(e) {
|
|
954
|
-
const t = new
|
|
955
|
+
const t = new x(e), s = this.projects[t.id] || {}, n = Object.assign(t.toDsl(), s);
|
|
955
956
|
return this.projects[n.id] = n, Promise.resolve(n);
|
|
956
957
|
}
|
|
957
958
|
saveProject(e) {
|
|
958
|
-
const t = new
|
|
959
|
+
const t = new x(e);
|
|
959
960
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
|
960
961
|
}
|
|
961
962
|
saveMaterials(e, t) {
|
|
962
|
-
return e.id && (this.materials[e.id] =
|
|
963
|
+
return e.id && (this.materials[e.id] = N(t)), Promise.resolve(!0);
|
|
963
964
|
}
|
|
964
965
|
saveFile(e) {
|
|
965
966
|
return this.files[e.id] = e, Promise.resolve(!0);
|
|
@@ -1001,11 +1002,11 @@ class pt extends B {
|
|
|
1001
1002
|
}), Promise.resolve(!0);
|
|
1002
1003
|
}
|
|
1003
1004
|
}
|
|
1004
|
-
let
|
|
1005
|
-
function
|
|
1006
|
-
return
|
|
1005
|
+
let C = null;
|
|
1006
|
+
function Ft() {
|
|
1007
|
+
return C || (C = new ft(), C);
|
|
1007
1008
|
}
|
|
1008
|
-
class
|
|
1009
|
+
class It extends V {
|
|
1009
1010
|
async init(e) {
|
|
1010
1011
|
return await this.api("init", e).catch(() => null) || {};
|
|
1011
1012
|
}
|
|
@@ -1015,7 +1016,7 @@ class Ft extends B {
|
|
|
1015
1016
|
async saveMaterials(e, t) {
|
|
1016
1017
|
return !!await this.api("saveMaterials", {
|
|
1017
1018
|
project: e,
|
|
1018
|
-
materials:
|
|
1019
|
+
materials: N(t)
|
|
1019
1020
|
}).catch(() => !1);
|
|
1020
1021
|
}
|
|
1021
1022
|
async saveFile(e) {
|
|
@@ -1050,7 +1051,7 @@ class Ft extends B {
|
|
|
1050
1051
|
);
|
|
1051
1052
|
}
|
|
1052
1053
|
}
|
|
1053
|
-
function
|
|
1054
|
+
function ie(r = []) {
|
|
1054
1055
|
return r.map((e) => {
|
|
1055
1056
|
const { id: t, title: s, icon: n, children: o, hidden: i } = e;
|
|
1056
1057
|
return {
|
|
@@ -1059,13 +1060,13 @@ function oe(r = []) {
|
|
|
1059
1060
|
icon: n,
|
|
1060
1061
|
hidden: i,
|
|
1061
1062
|
url: `/page/${t}`,
|
|
1062
|
-
children: o && o.length ?
|
|
1063
|
+
children: o && o.length ? ie(o) : void 0
|
|
1063
1064
|
};
|
|
1064
1065
|
});
|
|
1065
1066
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const r =
|
|
1068
|
-
|
|
1067
|
+
function Rt() {
|
|
1068
|
+
const r = oe(), e = Y(), t = $e(!1), s = r.project;
|
|
1069
|
+
je(() => {
|
|
1069
1070
|
const { name: i, params: a, meta: u } = e;
|
|
1070
1071
|
if (i === "VtjPage") {
|
|
1071
1072
|
const c = r.getPage(a.id);
|
|
@@ -1076,7 +1077,7 @@ function It() {
|
|
|
1076
1077
|
} else
|
|
1077
1078
|
t.value = !u.mask;
|
|
1078
1079
|
});
|
|
1079
|
-
const n =
|
|
1080
|
+
const n = ie(s?.pages), o = s?.config;
|
|
1080
1081
|
return {
|
|
1081
1082
|
disabled: t,
|
|
1082
1083
|
logo: o?.logo,
|
|
@@ -1086,49 +1087,49 @@ function It() {
|
|
|
1086
1087
|
};
|
|
1087
1088
|
}
|
|
1088
1089
|
export {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1090
|
+
Fe as BUILT_IN_DIRECTIVES,
|
|
1091
|
+
V as BaseService,
|
|
1092
|
+
L as CONTEXT_HOST,
|
|
1093
|
+
Ne as Context,
|
|
1093
1094
|
w as ContextMode,
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1095
|
+
Ie as DATA_TYPES,
|
|
1096
|
+
Et as JSCodeToString,
|
|
1097
|
+
St as LIFE_CYCLES_LIST,
|
|
1098
|
+
It as LocalService,
|
|
1099
|
+
ft as MemoryService,
|
|
1100
|
+
ut as Provider,
|
|
1101
|
+
Pt as StorageService,
|
|
1102
|
+
I as VTJ_RENDERER_VERSION,
|
|
1103
|
+
Z as adoptedStyleSheets,
|
|
1104
|
+
$t as createAssetScripts,
|
|
1105
|
+
jt as createAssetsCss,
|
|
1106
|
+
Ue as createDataSources,
|
|
1107
|
+
re as createLoader,
|
|
1108
|
+
Ft as createMemoryService,
|
|
1109
|
+
bt as createProvider,
|
|
1110
|
+
te as createRenderer,
|
|
1111
|
+
Te as createSchemaApi,
|
|
1112
|
+
ke as createSchemaApis,
|
|
1112
1113
|
Xe as defaultLoader,
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1114
|
+
H as fillBasePath,
|
|
1115
|
+
se as getModifiers,
|
|
1116
|
+
He as getRawComponent,
|
|
1117
|
+
z as isCSSUrl,
|
|
1118
|
+
Oe as isJSCode,
|
|
1118
1119
|
g as isJSExpression,
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1120
|
+
A as isJSFunction,
|
|
1121
|
+
G as isJSUrl,
|
|
1122
|
+
xe as isVuePlugin,
|
|
1123
|
+
Ce as loadCss,
|
|
1124
|
+
De as mockApi,
|
|
1125
|
+
Ae as mockApis,
|
|
1126
|
+
ee as mockCleanup,
|
|
1127
|
+
T as nodeRender,
|
|
1128
|
+
Re as parseDeps,
|
|
1129
|
+
R as parseExpression,
|
|
1130
|
+
U as parseFunction,
|
|
1131
|
+
ne as providerKey,
|
|
1132
|
+
Q as toString,
|
|
1133
|
+
Rt as useMask,
|
|
1134
|
+
oe as useProvider
|
|
1134
1135
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtj/renderer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.34",
|
|
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.7.
|
|
14
|
-
"@vtj/icons": "^0.7.
|
|
15
|
-
"@vtj/ui": "^0.7.
|
|
16
|
-
"@vtj/utils": "^0.7.
|
|
13
|
+
"@vtj/core": "^0.7.34",
|
|
14
|
+
"@vtj/icons": "^0.7.34",
|
|
15
|
+
"@vtj/ui": "^0.7.34",
|
|
16
|
+
"@vtj/utils": "^0.7.34",
|
|
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": "
|
|
38
|
+
"gitHead": "307cf220b3b712bdc2264e44ae800f95017e0f0a",
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
}
|
package/types/version.d.ts
CHANGED
|
@@ -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.7.
|
|
5
|
+
* @version 0.7.33
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "0.7.
|
|
8
|
+
export declare const version = "0.7.33";
|