comp-hub 0.28.5 → 0.28.6
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/README.md +132 -132
- package/bin/cli.js +53 -53
- package/bin/lib/commands.js +173 -173
- package/bin/lib/constants.js +22 -22
- package/bin/lib/http.js +62 -62
- package/bin/lib/startup.js +183 -183
- package/bin/lib/utils.js +112 -112
- package/dist/index.js +1 -1
- package/dist/website/container/assets/{index-DW_KDaXl.js → index-C4rP9NOf.js} +9 -9
- package/dist/website/container/assets/index-DyP-WX-l.css +1 -0
- package/dist/website/container/index.html +32 -32
- package/dist/website/container/js/vue2-sfc-loader.js +260 -260
- package/dist/website/container/js/vue3-sfc-loader.js +289 -289
- package/dist/website/item/assets/index-YY_elpPJ.js +39 -0
- package/dist/website/item/assets/index-xGYf6R_n.css +1 -0
- package/dist/website/item/index.html +30 -30
- package/dist/website/main/assets/{CanvasAnimation.vue_vue_type_script_setup_true_lang-Xr4R8ONt.js → CanvasAnimation.vue_vue_type_script_setup_true_lang-CllQrgJy.js} +1 -1
- package/dist/website/main/assets/index-30_1ggVR.js +1 -0
- package/dist/website/main/assets/{index-tKPA5N_x.js → index-5AGG9ot8.js} +1 -1
- package/dist/website/main/assets/index-5NbrFL1v.js +1 -0
- package/dist/website/main/assets/{index-DGaY7dL7.js → index-B5P6DgaP.js} +1 -1
- package/dist/website/main/assets/index-B94DbVvF.js +1 -0
- package/dist/website/main/assets/index-B9ln289Q.js +1 -0
- package/dist/website/main/assets/{index-DIKKFNiV.css → index-BboFkG3x.css} +1 -1
- package/dist/website/main/assets/{index-9E0N8vk2.js → index-Bix1nJzT.js} +1 -1
- package/dist/website/main/assets/index-Bt7T-LaE.js +1 -0
- package/dist/website/main/assets/index-C5FOjHtG.js +1 -0
- package/dist/website/main/assets/{index-RcR0UXkh.js → index-C9Y3CNRO.js} +1 -1
- package/dist/website/main/assets/{index-BGYcKO_k.js → index-CBkRhssK.js} +2 -2
- package/dist/website/main/assets/{index-BblV7ZcF.js → index-CJBbqPIC.js} +1 -1
- package/dist/website/main/assets/{index-CdLdwW7r.js → index-CRPDDq-V.js} +13 -13
- package/dist/website/main/assets/{index-CsUtZbBp.js → index-CS5py2lv.js} +1 -1
- package/dist/website/main/assets/{index-X1ZIWbVW.js → index-CYEfOQSg.js} +2 -2
- package/dist/website/main/assets/{index-BqUY_Pbs.js → index-CeYUbWQf.js} +1 -1
- package/dist/website/main/assets/{index-DxyEzkir.css → index-Cl0SK7oa.css} +1 -1
- package/dist/website/main/assets/index-ClGXZTwx.js +1 -0
- package/dist/website/main/assets/index-CyPExloz.css +1 -0
- package/dist/website/main/assets/{index-bdWvkmhc.js → index-D206deyl.js} +1 -1
- package/dist/website/main/assets/{index-BMSnGhSG.js → index-D8JLLNls.js} +1 -1
- package/dist/website/main/assets/index-DJ4AvgpT.css +1 -0
- package/dist/website/main/assets/{index-BVcp4iEn.js → index-DMKeTfl9.js} +1 -1
- package/dist/website/main/assets/index-DNzk9GC4.js +1 -0
- package/dist/website/main/assets/{index-Dfkpa19a.js → index-DdlcdFg6.js} +1 -1
- package/dist/website/main/assets/index-Dgyjv57X.js +1 -0
- package/dist/website/main/assets/index-DkvChnew.js +1 -0
- package/dist/website/main/assets/{index-DbmFA7Z2.js → index-DnoK5_sf.js} +1 -1
- package/dist/website/main/assets/index-Du5qihI4.js +1 -0
- package/dist/website/main/assets/{index-B8QVBEgQ.js → index-OKDkiqud.js} +1 -1
- package/dist/website/main/assets/index-OQIUhz5k.js +1 -0
- package/dist/website/main/assets/{index-Cc3zDN4S.js → index-pnMxQIk7.js} +1 -1
- package/dist/website/main/assets/index-qAIxUXsY.css +1 -0
- package/dist/website/main/assets/{index-qSRqezAW.js → index-zrOq4KJF.js} +1 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-BOye9Q0l.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-BcUGs_WV.js +2 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-C2f6_gwm.js +1 -0
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-DzvWwe2g.js → index.vue_vue_type_script_setup_true_lang-Cl-Fl4oU.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-BYKlY94g.js → index.vue_vue_type_script_setup_true_lang-CsP7DU8L.js} +1 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-piiSvWkd.js +1 -0
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-CwaGkvXy.js → index.vue_vue_type_style_index_0_lang-HhqETZCz.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-BNPcBMvg.js → index.vue_vue_type_style_index_0_lang-_EGM5AW2.js} +1 -1
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-lii4Mw4k.js +1 -0
- package/dist/website/main/assets/{useCompEditStore-EVZp94pg.css → useCompEditStore-CTeLLTZM.css} +1 -1
- package/dist/website/main/assets/{useCompEditStore-DI3vFtGm.js → useCompEditStore-De0RvlRq.js} +135 -135
- package/dist/website/main/assets/{useKeyword-bWHMALoZ.js → useKeyword-DPx3R5YX.js} +1 -1
- package/dist/website/main/assets/{useMessage-BVw3M4ej.js → useMessage-8Gi-vx-A.js} +1 -1
- package/dist/website/main/assets/useVscodeOpen--nBM6CZ-.js +1 -0
- package/dist/website/main/index.html +2 -2
- package/package.json +45 -45
- package/dist/website/container/assets/index-D6braxue.css +0 -1
- package/dist/website/item/assets/index-BWvMfSxu.css +0 -1
- package/dist/website/item/assets/index-Cqs5iLeY.js +0 -39
- package/dist/website/main/assets/index-BEVcnNvI.js +0 -1
- package/dist/website/main/assets/index-BHUDEWGt.js +0 -1
- package/dist/website/main/assets/index-BYC9CuLh.js +0 -1
- package/dist/website/main/assets/index-BwgqBNRu.js +0 -1
- package/dist/website/main/assets/index-CG7uKVdX.js +0 -1
- package/dist/website/main/assets/index-CzTcYkCn.css +0 -1
- package/dist/website/main/assets/index-D-uwf4yo.css +0 -1
- package/dist/website/main/assets/index-D6MA33Hi.js +0 -1
- package/dist/website/main/assets/index-Dd8ha0TC.js +0 -1
- package/dist/website/main/assets/index-Diq3BceD.js +0 -1
- package/dist/website/main/assets/index-DkakQhTy.js +0 -1
- package/dist/website/main/assets/index-Dz2nPzxk.js +0 -1
- package/dist/website/main/assets/index-FFTkVbVX.css +0 -1
- package/dist/website/main/assets/index-qsIY_6aA.js +0 -1
- package/dist/website/main/assets/index-rWF_BNTH.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CCaH-GEy.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DPbqR98S.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js +0 -2
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DtCu4Izc.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-1ZphBFBL.js +0 -1
- package/dist/website/main/assets/useVscodeOpen-SZpyzVHG.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as u,ab as d,l as _,r as n,ax as f,aC as L,ac as M,a7 as g,aO as w,af as P,g as m}from"./vendor-core-BKehvho7.js";import{c as T}from"./useCompMetaLocalStore-BKTMp_k8.js";import{u as v,q as r}from"./index-CdLdwW7r.js";import{_ as b}from"./index.vue_vue_type_script_setup_true_lang-DPbqR98S.js";import{_ as I}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./vendor-ui-CGT0cG1n.js";import"./useVscodeOpen-SZpyzVHG.js";import"./useMessage-BVw3M4ej.js";const O={class:"size-full"},R=u({__name:"index",props:{version:{},compAttrs:{}},setup(a){return(l,t)=>(d(),_("div",O,[n(b,{compAttrs:a.compAttrs,version:a.version,compType:f(v).IFRAME_ROUTES.ITEM.PREVIEW_LOCAL},null,8,["compAttrs","version","compType"])]))}}),k={class:"size-full"},j=u({__name:"index",setup(a){const l=L(),{compId:t}=l.params,e=T(t)(),h=new Map;M(v.PROVIDE_KEY_CALLBACKS,h);const o=P(!1),s=m(()=>e.detail),A=m(()=>Object.keys(s.value??{}).length>0);async function y(){if(!t)return;o.value=!0;const c=await r.v1Comp.compcontrollerLocalcompdetailbypathhash({fullPathHash:t}),i=await r.v1Comp.compcontrollerDep({compPath:c.data.path}),{thirdParty:p=[]}=i.data,C=p.map(x=>x.name),E=await r.v1Module.modulecontrollerPrebuild({deps:C}),{entryNameToFile:D={}}=E.data;e.setDetail(c.data),e.setDep(p),e.setDepToFile(D),o.value=!1}return g(async()=>{await y()}),(c,i)=>(d(),_("div",k,[n(f(I),{isEmpty:!A.value,loading:o.value,class:"size-full"},{default:w(()=>[n(R,{compAttrs:s.value,version:s.value.version},null,8,["compAttrs","version"])]),_:1},8,["isEmpty","loading"])]))}});export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a2 as R,e as $,W as H,L as F,b as q,K as z,J as C}from"./vendor-ui-CGT0cG1n.js";import{B as K,t as u,p as k}from"./index-CdLdwW7r.js";import"./el-table-column-CGzXlVpD.js";import{v as L,aA as Q,aD as W,a7 as j,ab as g,l as T,r as s,aO as r,_ as A,A as w,q as E,ap as v,ax as p,F as G,ah as J,j as X,i as Z,af as I,g as o,ao as ee}from"./vendor-core-BKehvho7.js";import{b as ae}from"./index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js";import{h as M}from"./moment-B-YVwB4U.js";import{u as te}from"./useTeamHeaders-DxHN7-t0.js";import{_ as oe}from"./LoadingWrapper.vue_vue_type_script_setup_true_lang-kJcgjuK5.js";import"./index-BYC9CuLh.js";import"./useCompMetaLocalStore-BKTMp_k8.js";/* empty css */import"./useVscodeOpen-SZpyzVHG.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./useCacheOssStore-OAoLDVbw.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./useMessage-BVw3M4ej.js";const ne={class:"size-full"},re={class:"text-gray-300"},Te=L({__name:"index",setup(le){const{t:a}=Q(),x=W(),{headers:i,teamId:f}=te(),_=ae(f)(),b=I([]),d=I({data:[],column:[{prop:"name",label:o(()=>a("comp.name")),align:"center"},{prop:"authorId.nickname",label:o(()=>a("common.author")),align:"center",formatter:e=>e.teamUserNickname||e.authorId?.nickname||"--"},{prop:"version",label:o(()=>a("comp.version")),align:"center"},{prop:"desc",label:o(()=>a("comp.desc")),align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{prop:"createdAt",label:o(()=>a("team.createTime")),align:"center",formatter:e=>e.createdAt?M(e.createdAt).format("YYYY-MM-DD"):"--"},{prop:"updatedAt",label:o(()=>a("team.updateTime")),align:"center",formatter:e=>e.updatedAt?M(e.updatedAt).format("YYYY-MM-DD"):"--"},{slot:"canUpdateUsers",prop:"canUpdateUsers",label:o(()=>a("team.updateAuth")),align:"center"},{slot:"operation",prop:"operation",label:o(()=>a("common.operation")),align:"center"}],search:{column:[{prop:"keyword",component:ee(q),label:o(()=>a("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:o(()=>a("comp.keywordPlaceholder")),fetchSuggestions:D,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}}]},pagination:{total:0},fixedHeight:!1,fetchData:O}),B=o(()=>b.value.map(e=>({value:e._id,label:e.teamUserNickname||e.nickname||e.account})));function D(e,t){if(e.length<=1)return t([]);u.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compTeam"},{headers:i}).then(c=>{const{keywords:l=[]}=c.data||{};t(l)})}async function O(e){const t=await u.v1Team.teamcontrollerTeamcomps({...e,scene:"management"},{headers:i}),{rows:c,total:l}=t.data||{};d.value.data=c||[],d.value.pagination.total=l||0}async function N(e,t){t.start();try{if(await z.confirm(a("team.deleteCompConfirm",{name:e.name}),a("common.info"),{confirmButtonText:a("common.confirm"),cancelButtonText:a("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;await u.v1Team.teamcontrollerRemovecompfromteam({compIds:[e._id]},{headers:i}).then(()=>{C.success(a("message.success.delete")),d.value.data=d.value.data.filter(l=>l._id!==e._id),_.setTeamDetail({..._.teamDetail,compCount:_.teamDetail.compCount-1}),window?.umami?.track(k.TEAM_COMP_REMOVE,{teamId:f,compId:e._id,compName:e.name})})}finally{t.end()}}function S(e){x.push({path:`/previewTeam/${f}/${e._id}`})}function V(){u.v1Team.teamcontrollerAllmember({headers:i}).then(e=>{b.value=e.data?.rows||[]})}function Y(e){const t={compId:e._id,canUpdateUserIds:e.canUpdateUsers||[]};u.v1Team.teamcontrollerUpdatecompcanupdateusers(t,{headers:i}).then(()=>{C.success(a("message.success.update")),window?.umami?.track(k.TEAM_COMP_PERMISSION_CHANGE,{teamId:f,compId:e._id,userIds:t.canUpdateUserIds})})}return j(()=>{V()}),(e,t)=>{const c=F,l=H,U=R,y=$;return g(),T("div",ne,[s(p(K),{tableConfig:d.value,border:""},{canUpdateUsers:r(({col:h})=>[s(U,A(w(h)),{default:r(({row:m})=>[s(l,{modelValue:m.canUpdateUsers,"onUpdate:modelValue":n=>m.canUpdateUsers=n,multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:p(a)("team.selectCanUpdateUser"),onChange:n=>Y(m)},{header:r(()=>[Z("span",re,v(p(a)("team.authorAutoAuth")),1)]),default:r(()=>[(g(!0),T(G,null,J(B.value,n=>(g(),X(c,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:1},16)]),operation:r(({col:h})=>[s(U,A(w(h)),{default:r(({row:m})=>[s(y,{type:"primary",onClick:n=>S(m)},{default:r(()=>[E(v(p(a)("common.preview")),1)]),_:1},8,["onClick"]),s(p(oe),null,{default:r(({instance:n,loading:P})=>[s(y,{type:"danger",loading:P,onClick:se=>N(m,n)},{default:r(()=>[E(v(p(a)("common.delete")),1)]),_:1},8,["loading","onClick"])]),_:2},1024)]),_:1},16)]),_:1},8,["tableConfig"])])}}});export{Te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as M}from"./vendor-core-BKehvho7.js";import{n as p,u as o}from"./index-CdLdwW7r.js";const P=(a="")=>{if(!a)throw new Error("createCompMetaStore scopeId is required");return M(`compMeta_${a}`,{state:()=>({detail:{},depEntryNameToFile:{},versionToFileAccessPath:{},localCompInfo:[],latestVersion:""}),getters:{isLocalExist:e=>e.localCompInfo.length!==0,latestVersionToFileAccessPath:e=>e.versionToFileAccessPath[e.latestVersion]??[]},actions:{setLatestVersion(e){this.$patch(t=>{t.latestVersion=e})},setLocalCompInfo(e){this.$patch(t=>{t.localCompInfo=e})},setDetail(e,t){this.$patch(r=>{r.detail[e]={...r.detail[e],...t}})},setDepEntryNameToFile(e,t){this.$patch(r=>{r.depEntryNameToFile[e]=t})},setVersionToFileAccessPath(e,t){this.$patch(r=>{r.versionToFileAccessPath[e]=t})}}})};function f(a,e){return a.filter(t=>{const r=e.find(l=>l.name===t.name||l.name===t.parent?.name);if(!r)return!1;const{match:h}=r,{major:s,minor:n,patch:m}=p.parseVersion(t.version),{major:i,minor:c,patch:T}=p.parseVersion(r.version);switch(h){case o.COMP_MATCH_TYPE_ONLY_INSTALL:return!0;case o.COMP_MATCH_TYPE_MAJOR_VERSION:return s===i;case o.COMP_MATCH_TYPE_MINOR_VERSION:return s===i&&n===c;case o.COMP_MATCH_TYPE_EXACT_VERSION:return s===i&&n===c&&m===T}})}export{P as c,f as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as $,l as O,D as R,e as T,U as B}from"./vendor-ui-CGT0cG1n.js";import{u as m,A as N,e as F,q as w}from"./index-CdLdwW7r.js";import{v as b,aA as k,ab as L,l as z,r as e,aO as a,i as t,ax as l,ap as f,q as x,ac as j,aC as U,aD as q,a7 as K,aj as W,j as G,af as H,g}from"./vendor-core-BKehvho7.js";import{c as X}from"./useCompMetaLocalStore-BKTMp_k8.js";import{B as Y,_ as J}from"./index.vue_vue_type_script_setup_true_lang-CCaH-GEy.js";/* empty css *//* empty css */import{_ as Q}from"./index.vue_vue_type_script_setup_true_lang-DPbqR98S.js";import{u as Z}from"./useVscodeOpen-SZpyzVHG.js";import{_ as ee}from"./PanelBackground.vue_vue_type_script_setup_true_lang-BELCrrRh.js";import{_ as oe}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./index.vue_vue_type_style_index_0_lang-BNPcBMvg.js";import"./core-CcVTMiBP.js";import"./useTeamHeaders-DxHN7-t0.js";import"./index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js";import"./index-BYC9CuLh.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./useCacheOssStore-OAoLDVbw.js";import"./useMessage-BVw3M4ej.js";const te={class:"size-full overflow-hidden flex flex-col"},ae={class:"size-full"},se={class:"flex items-center"},ne={class:"flex-1"},le={class:"text-xs ml-auto"},ce=b({__name:"index",props:{version:{},compAttrs:{}},setup(s){const{openCompPathInVscode:v}=Z(),h=s,{t:p}=k();function C(){v(h.compAttrs.fullPath,`./${m.COMP_CONFIG_FILENAME}`)}return(P,c)=>{const r=$,i=O,o=R;return L(),z("div",te,[e(l(ee),{class:"size-full flex-1 shrink-0 flex flex-col gap-1",bg:s.compAttrs?.bgColor},{default:a(({bg:u,updateColor:d})=>[e(r,{"body-class":"!p-0 !overflow-visible",class:"flex-1 relative z-10"},{default:a(()=>[t("div",ae,[e(Q,{compAttrs:s.compAttrs,version:s.version,compType:l(m).IFRAME_ROUTES.ITEM.PREVIEW_LOCAL},null,8,["compAttrs","version","compType"])])]),_:1}),t("div",se,[t("div",ne,[t("span",null,f(s.compAttrs?.version),1)]),t("span",le,[t("span",null,f(l(p)("comp.bgPanel"))+":",1),e(i,{teleported:!0,modelValue:u,clearable:"",onChange:d,onActiveChange:d},null,8,["modelValue","onChange","onActiveChange"])])])]),_:1},8,["bg"]),t("div",null,[x(f(l(p)("comp.compLocation"))+": ",1),e(o,{href:"javascript:void(0)",type:"primary",underline:"always",onClick:C},{default:a(()=>[x(f(s.compAttrs.fullPath),1)]),_:1})])])}}}),re={class:"h-[50vh]"},Le=b({__name:"index",setup(s){const{t:v}=k(),h=new Map;j(m.PROVIDE_KEY_CALLBACKS,h);const p=U(),C=q(),P=N(),{compId:c}=p.params,r=X(c)(),i=H(!1),o=g(()=>r.detail),u=g(()=>Object.keys(o.value??{}).length>0),d=g(()=>{const n=F.getPreviewUrl(o.value.path,[`\\${m.COMP_README_FILENAME}`]);return`${m.COMP_PREVIEW_PREFIX_LOCAL}/${n}`});async function D(){if(!c)return;i.value=!0;const n=await w.v1Comp.compcontrollerLocalcompdetailbypathhash({fullPathHash:c}),y=await w.v1Comp.compcontrollerDep({compPath:n.data.path}),{thirdParty:_=[]}=y.data,A=_.map(S=>S.name),E=await w.v1Module.modulecontrollerPrebuild({deps:A}),{entryNameToFile:V={}}=E.data;r.setDetail(n.data),r.setDep(_),r.setDepToFile(V),i.value=!1}function I(){P.addPayLoad(`/previewLocal/${c}`,{name:`${o.value?.name??""}`})}function M(){const{href:n}=C.resolve({name:"previewLocalBlank",params:{compId:c}});window.open(n,"_blank")}return K(async()=>{u.value||await D(),I()}),(n,y)=>{const _=W("Icon"),A=T,E=B;return L(),G(E,{"wrap-class":"preview-container",class:"size-full p-[10px]"},{default:a(()=>[e(l(oe),{isEmpty:!u.value,loading:i.value},{default:a(()=>[t("div",re,[e(l(Y),{title:o.value?.name,actions:["maximize"]},{beforeActions:a(()=>[e(A,{type:"primary",circle:"",title:l(v)("common.newPage"),onClick:M},{default:a(()=>[e(_,{icon:"material-symbols:screen-share-rounded"})]),_:1},8,["title"])]),default:a(()=>[e(ce,{compAttrs:o.value,version:o.value.version},null,8,["compAttrs","version"])]),_:1},8,["title"])]),e(J,{mdSrc:d.value,scrollContainer:".preview-container",stickyTopDistance:0,showSimilarComp:!1},null,8,["mdSrc"])]),_:1},8,["isEmpty","loading"])]),_:1})}}});export{Le as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./index.vue_vue_type_style_index_0_lang-CwaGkvXy.js";import{v as o,ab as t,l as r,r as s}from"./vendor-core-BKehvho7.js";import"./vendor-xterm-DbWxaMay.js";import"./index-CdLdwW7r.js";import"./vendor-ui-CGT0cG1n.js";const a={class:"size-full"},d=o({__name:"index",setup(n){return(_,c)=>(t(),r("div",a,[s(e)]))}});export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[data-v-911ad151] .el-radio__input.is-checked+.el-radio__label span:first-child{box-shadow:0 0 8px currentColor}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.match-dot-green[data-v-ca24e35d]{background-color:#67c23a}.match-dot-blue[data-v-ca24e35d]{background-color:#409eff}.match-dot-orange[data-v-ca24e35d]{background-color:#e6a23c}.match-dot-red[data-v-ca24e35d]{background-color:#f56c6c}[data-v-ca24e35d] .not-matched{text-decoration:line-through;opacity:.6}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a3 as B,W as Ce,L as he,D as we,K as W,F as Te,J as Ee,a2 as Pe,f as ne,l as ye,aH as Me,e as be,d as Ve,U as Ae}from"./vendor-ui-CGT0cG1n.js";import{k as Se,u as w,n as k,j as xe,t as X,e as se,q as H,B as Oe,z as le,C as ke,A as $e,p as ae,i as De}from"./index-CdLdwW7r.js";import{_ as Ie}from"./el-table-column-CGzXlVpD.js";/* empty css */import{v as O,aA as R,ab as p,j as V,ax as u,aO as m,r as l,Z as N,l as P,k as I,q as $,ap as M,F as Y,ah as G,g as C,aB as Re,a7 as re,W as Ne,af as x,aN as Be,i as b,aF as He,ai as Ye,aC as ce,_ as q,A as J,ac as Le,aD as Fe,aM as te,aj as ze,Q as je,K as Ue,al as Ke}from"./vendor-core-BKehvho7.js";import{_ as We}from"./index.vue_vue_type_style_index_0_lang-CwaGkvXy.js";/* empty css */import{_ as qe}from"./index.vue_vue_type_script_setup_true_lang-DzvWwe2g.js";import{_ as Je}from"./index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js";import{u as Xe}from"./useTeamHeaders-DxHN7-t0.js";import{B as Ge,_ as Qe}from"./index.vue_vue_type_script_setup_true_lang-CCaH-GEy.js";import{c as Ze,p as eo}from"./index-BYC9CuLh.js";import{_ as oo}from"./index.vue_vue_type_script_setup_true_lang-DtCu4Izc.js";import{_ as ao}from"./PanelBackground.vue_vue_type_script_setup_true_lang-BELCrrRh.js";import{_ as to}from"./BaseSegmented.vue_vue_type_script_setup_true_lang-DU79Plk1.js";import{_ as no}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./vendor-xterm-DbWxaMay.js";import"./useCompMetaLocalStore-BKTMp_k8.js";import"./useVscodeOpen-SZpyzVHG.js";import"./useCacheOssStore-OAoLDVbw.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./useMessage-BVw3M4ej.js";import"./index.vue_vue_type_style_index_0_lang-BNPcBMvg.js";import"./core-CcVTMiBP.js";const so=O({__name:"CompDepsTags",props:{compDeps:{},depsSetting:{}},setup(_){const{t:c}=R(),a=_,i=C(()=>{const r=new Map;return a.depsSetting?.forEach(e=>{r.set(e.name,e)}),r});function f(r,e){const t=e.match;try{switch(t){case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_ONLY_INSTALL:return!0;case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MAJOR_VERSION:{const n=k.parseVersion(r),o=k.parseVersion(e.version);return n.major===o.major}case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MINOR_VERSION:{const n=k.parseVersion(r),o=k.parseVersion(e.version);return n.major===o.major&&n.minor===o.minor}case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_EXACT_VERSION:{const n=k.parseVersion(r),o=k.parseVersion(e.version);return n.major===o.major&&n.minor===o.minor&&n.patch===o.patch}default:return!1}}catch(n){return console.warn(`Version parse failed: ${r} or ${e.version}`,n),!1}}function s(r){const e=i.value.get(r.name);return e?f(r.version,e):!1}function d(r){const e=i.value.get(r.name);if(!e||!f(r.version,e))return"";switch(e.match){case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_ONLY_INSTALL:return"match-dot-green";case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MAJOR_VERSION:return"match-dot-blue";case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MINOR_VERSION:return"match-dot-orange";case w.COMP_MATCH_TYPES.COMP_MATCH_TYPE_EXACT_VERSION:return"match-dot-red";default:return""}}return(r,e)=>(p(),V(u(Se),{list:_.compDeps,getKey:t=>t.name,class:"flex items-center gap-1"},{display:m(({visibleList:t,overflow:n})=>[(p(!0),P(Y,null,G(t,o=>(p(),V(u(B),{key:o.name,type:"info","disable-transitions":"",size:"small",class:N({"not-matched":!s(o)})},{default:m(()=>[d(o)?(p(),P("span",{key:0,class:N(["inline-block w-2 h-2 rounded-full mr-1",d(o)])},null,2)):I("",!0),$(" "+M(o.name)+" "+M(o.version),1)]),_:2},1032,["class"]))),128)),n>0?(p(),V(u(B),{key:0,type:"info",size:"small","disable-transitions":""},{default:m(()=>[$("+"+M(n)+" "+M(u(c)("common.more")),1)]),_:2},1024)):I("",!0)]),measure:m(({item:t})=>[l(u(B),{type:"info",size:"small","disable-transitions":"",class:N({"not-matched":!s(t)})},{default:m(()=>[d(t)?(p(),P("span",{key:0,class:N(["inline-block w-2 h-2 rounded-full mr-1",d(t)])},null,2)):I("",!0),$(" "+M(t.name)+" "+M(t.version),1)]),_:2},1032,["class"])]),_:1},8,["list","getKey"]))}}),lo=xe(so,[["__scopeId","data-v-ca24e35d"]]),ro={class:"w-[100px]"},co=O({__name:"index",props:Ne({id:{type:String,default:""},version:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(_){const c=_,a=Re(_,"modelValue"),i=x([]),f=x(!1);function s(e){a.value=e}async function d(){if(f.value)return;const e=await X.v1Comp.compcontrollerVersions({compId:c.id});f.value=!0,i.value=e.data.rows.map(t=>({value:t.version,label:t.version}))}function r(){i.value=[{value:c.version,label:c.version}],a.value=c.version}return re(()=>{r()}),(e,t)=>{const n=he,o=Ce;return p(),P("div",ro,[l(o,{"model-value":a.value,onChange:s,onVisibleChange:d},{default:m(()=>[(p(!0),P(Y,null,G(i.value,T=>(p(),V(n,{key:T.value,label:T.label,value:T.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])}}}),io={class:"size-full flex flex-col gap-5"},mo={class:"p-2"},uo={class:"flex flex-wrap gap-2"},po={class:"flex-1 border border-(--el-border-color-light) rounded-md overflow-hidden"},_o=O({__name:"index",props:{compId:{},getCompDetail:{type:Function}},setup(_){const c=_,a=x(),i=C(()=>se.handleDepData(a.value?.dep??[])),f=(s,d)=>`npm install ${s}@${d}`;return Be(async()=>{const s=await c.getCompDetail(c.compId);s&&(a.value=s)}),(s,d)=>{const r=B;return p(),P("div",io,[b("div",mo,[b("div",uo,[(p(!0),P(Y,null,G(i.value,e=>(p(),V(r,{key:e.name,type:"info","disable-transitions":!0},{default:m(()=>[l(u(Ie),{class:"text-sm",text:f(e.name,e.version)},null,8,["text"])]),_:2},1024))),128))])]),b("div",po,[l(We)])])}}}),ie=O({__name:"index",props:{id:{type:String,default:""},name:{type:String,default:""},version:{type:String,default:""}},emits:["downloadSuccess"],setup(_,{emit:c}){const{t:a}=R(),i=_,f=c,s=He("dialogVueFinder");async function d(e){!e()||await W.confirm(a("comp.downloadVersionConfirm",{version:i.version}),a("common.info"),{confirmButtonText:a("common.confirm"),cancelButtonText:a("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm"||s.value?.open(r)}async function r(e){const t=Te.service({lock:!0,text:a("comp.downloading")});try{if(await W.confirm(a("comp.downloadPathConfirm",{path:e.path}),a("common.info"),{confirmButtonText:a("common.confirm"),cancelButtonText:a("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const o=await H.v1Comp.compcontrollerDownload({compId:i.id,savePath:e.path,compName:i.name,version:i.version}),{isRepeat:T=!1}=o.data;if(T){if(await W.confirm(a("comp.downloadCoverConfirm",{name:i.name}),a("common.info"),{confirmButtonText:a("common.confirm"),cancelButtonText:a("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm"){t.close();return}await H.v1Comp.compcontrollerDownload({compId:i.id,savePath:e.path,compName:i.name,isCover:!0,version:i.version})}Ee.success(a("message.success.download")),f("downloadSuccess"),s.value?.close()}finally{t.close()}}return(e,t)=>{const n=we;return p(),P(Y,null,[l(qe,null,{default:m(({isLogin:o})=>[Ye(e.$slots,"default",{downloadHandler:d,isLogin:o},()=>[l(n,{type:"primary",link:"",onClick:T=>d(o)},{default:m(()=>[$(M(u(a)("common.download")),1)]),_:1},8,["onClick"])])]),_:3}),l(Je,{ref:"dialogVueFinder",onDownload:r},null,512)],64)}}}),fo={class:"h-[calc(100vh-160px)]"},vo=O({__name:"index",props:{compName:{type:String,default:""}},setup(_){const{t:c}=R(),a=_,i=ce(),{compId:f}=i.params,s=x({data:[],column:[{prop:"prevVersion",label:C(()=>c("team.prevVersion")),align:"center"},{prop:"newVersion",label:C(()=>c("team.newVersion")),align:"center"},{prop:"upgradeDesc",label:C(()=>c("team.upgradeDesc")),align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{slot:"operation",prop:"operation",label:C(()=>c("common.operation")),align:"center"}],pagination:{total:0},fixedHeight:!1,fetchData:r}),d=C(()=>({id:f,name:a.compName}));async function r(e){if(!f)return;const t=await X.v1Comp.compcontrollerUpgraderecords({compId:f,...e}),{rows:n,total:o}=t.data||{};s.value.data=n||[],s.value.pagination.total=o||0}return(e,t)=>{const n=Pe;return p(),P("div",fo,[l(u(Oe),{tableConfig:s.value,border:"",stripe:""},{operation:m(({col:o})=>[l(n,q(J(o)),{default:m(({row:T})=>[l(ie,q(J({version:T.newVersion,...d.value})),null,16)]),_:1},16)]),_:1},8,["tableConfig"])])}}}),go={class:"size-full"},Co={class:"flex items-center"},ho={class:"flex-1"},wo={class:"text-xs ml-auto"},To=O({__name:"index",props:{version:{type:String,default:""},compAttrs:{type:Object,default:()=>({})}},setup(_){const c=_,{t:a}=R(),i=le(),f=C(()=>se.handleDepData(c.compAttrs.dep??[]));return(s,d)=>{const r=ne,e=ye;return p(),V(u(ao),{class:"size-full flex-1 shrink-0 flex flex-col gap-1",bg:_.compAttrs?.bgColor},{default:m(({bg:t,updateColor:n})=>[l(r,{"body-class":"!p-0 !overflow-visible",class:"flex-1 relative z-10"},{default:m(()=>[b("div",go,[l(oo,{compAttrs:_.compAttrs,version:_.version,bgColor:t,compType:u(w).IFRAME_ROUTES.ITEM.PREVIEW_REMOTE},null,8,["compAttrs","version","bgColor","compType"])])]),_:2},1024),b("div",Co,[b("div",ho,[l(u(lo),{compDeps:f.value,depsSetting:u(i).deps},null,8,["compDeps","depsSetting"])]),b("span",wo,[b("span",null,M(u(a)("comp.bgPanel"))+":",1),l(e,{teleported:!0,modelValue:t,clearable:"",onChange:n,onActiveChange:n},null,8,["modelValue","onChange","onActiveChange"])])])]),_:1},8,["bg"])}}}),Eo={class:"size-full p-[10px] pr-0"},Po={key:0,class:"h-[50vh]"},yo={class:"flex-1"},Mo={class:"mt-2"},Xo=O({__name:"index",props:{isTeamPreview:{type:Boolean,default:!1}},setup(_){const{t:c}=R(),a=_,i=ce(),f=i.query[w.ROUTE_STATE_KEY_VERSION]!==void 0,{compId:s}=i.params,d=C(()=>[{label:c("common.doc"),value:"doc",component:Qe,visible:()=>!0},{label:c("common.upgradeRecord"),value:"upgradeRecord",component:vo,visible:()=>!0}]),r=new Map;Le(w.PROVIDE_KEY_CALLBACKS,r);const e=Fe(),{teamId:t}=Xe(),n=x(!1),o=Me(ke,d.value[0]?.value),T=le(),L=$e(),S=Ze(s)(),E=x(S.latestVersion),Q=x(!1),v=C(()=>S.detail[E.value]),me=C(()=>v.value?.desc??""),ue=C(()=>Object.keys(v.value??{}).length>0),Z=C(()=>S.versionToFileAccessPath[E.value]??[]),pe=C(()=>Z.value.length?d.value.find(g=>g.value===o.value)?.component:void 0),de=C(()=>o.value==="doc"?{mdSrc:_e.value,compDesc:me.value,scrollContainer:".preview-container"}:o.value==="upgradeRecord"?{compName:v.value?.name||""}:{}),_e=C(()=>Z.value.find(h=>h.path.endsWith(`/${w.COMP_README_FILENAME}`))?.signedUrl??"");async function ee(){if(await T.initSetting(),!s)throw new Error("compId is required");const h=await X.v1Comp.compcontrollerCompdetail({compId:s,version:E.value}),{objectId:g,version:A,files:D,dep:F}=h.data,z={objectId:g,version:A,files:D.map(K=>K.path)},j=await H.v1Comp.compcontrollerCompfilesosssignedurl(z),y=eo(F,T.deps).map(K=>K.name),U=await H.v1Module.modulecontrollerPrebuild({deps:y}),{entryNameToFile:oe={}}=U.data;S.setDepEntryNameToFile(A,oe),S.setVersionToFileAccessPath(A,j.data.signedUrls),S.setDetail(A,{...h.data,_id:s}),E.value||(S.setLatestVersion(A),E.value=A)}function fe(){return Promise.resolve(v.value)}function ve(){a.isTeamPreview?L.addPayLoad(`/previewTeam/${t}/${s}`,{name:v.value?.name??""}):L.addPayLoad(`/preview/${s}`,{name:v.value?.name??""})}function ge(){window?.umami?.track(ae.PREVIEW_OPEN_NEWTAB,{compId:s,version:E.value});const{href:h}=e.resolve({name:"previewBlank",params:{compId:s,version:E.value}});window.open(h,"_blank")}return te(E,async h=>{h!==v.value?.version&&await ee()}),te(o,(h,g)=>{g&&h!==g&&window?.umami?.track(ae.PREVIEW_TAB_CHANGE,{compId:s,from:g,to:h})}),re(async()=>{(!ue.value||f)&&await ee(),ve(),Q.value=!0}),(h,g)=>{const A=ze("Icon"),D=be,F=ne,z=Ve,j=Ae;return p(),P("div",Eo,[l(j,{"wrap-class":"preview-container",class:"size-full pr-[10px]"},{default:m(()=>[Q.value?(p(),P("div",Po,[l(u(Ge),{title:v.value?.name,actions:["maximize"]},{beforeActions:m(()=>[l(D,{type:"primary",circle:"",title:u(c)("common.openInNewPage"),onClick:ge},{default:m(()=>[l(A,{icon:"material-symbols:screen-share-rounded"})]),_:1},8,["title"])]),default:m(()=>[l(To,{compAttrs:v.value,version:E.value},null,8,["compAttrs","version"])]),_:1},8,["title"])])):I("",!0),l(F,{"body-class":"!p-0 flex items-center gap-1",class:"sticky top-0 mt-1 w-full z-10"},{default:m(()=>[b("div",yo,[l(u(to),{modelValue:u(o),"onUpdate:modelValue":g[0]||(g[0]=y=>je(o)?o.value=y:null),options:d.value},null,8,["modelValue","options"])]),l(D,{color:"#414141",onClick:g[1]||(g[1]=y=>n.value=!0)},{default:m(()=>[$(M(u(c)("common.terminal")),1)]),_:1}),l(co,{id:v.value?._id,modelValue:E.value,"onUpdate:modelValue":g[2]||(g[2]=y=>E.value=y),version:v.value?.version},null,8,["id","modelValue","version"]),l(ie,{id:v.value?._id,name:v.value?.name,version:v.value?.version},{default:m(({downloadHandler:y,isLogin:U})=>[l(D,{type:"primary",onClick:oe=>y(U)},{default:m(()=>[$(M(u(c)("common.download")),1)]),_:1},8,["onClick"])]),_:1},8,["id","name","version"])]),_:1}),b("div",Mo,[l(u(De),null,{default:m(()=>[(p(),V(Ue,null,[(p(),V(Ke(pe.value),q(J(de.value)),null,16))],1024))]),_:1})]),l(z,{right:100,bottom:100,target:".preview-container"})]),_:1}),l(u(no),{modelValue:n.value,"onUpdate:modelValue":g[3]||(g[3]=y=>n.value=y),title:u(c)("common.depInstall"),width:"70%",top:"5vh","destroy-on-close":""},{default:m(()=>[v.value?._id?(p(),V(_o,{key:0,class:"h-[70vh]",compId:v.value?._id,getCompDetail:fe},null,8,["compId"])):I("",!0)]),_:1},8,["modelValue","title"])])}}});export{Xo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as le,P as ce,aH as Z,ac as I,x as ee,f as te,e as ne,y as ae,U as ie,K as de,J as ue}from"./vendor-ui-CGT0cG1n.js";import{u as x,j as me,z as fe,D as pe,p as L,q as H,f as _e,i as he}from"./index-CdLdwW7r.js";/* empty css */import{v as C,aA as M,aB as ve,ab as h,j as y,aO as u,r as m,ax as c,i as l,q as w,ap as f,a7 as be,aN as ge,l as N,F as K,ah as W,af as E,w as xe,a0 as we,Q as ye,K as De,al as Ee,g as T}from"./vendor-core-BKehvho7.js";import{_ as Ie}from"./BaseSegmented.vue_vue_type_script_setup_true_lang-DU79Plk1.js";const Be=C({__name:"RadioMatch",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(t){const{t:e}=M(),n=ve(t,"modelValue");function s(r){n.value=String(r??"")}return(r,o)=>{const a=ce,d=le;return h(),y(d,{"model-value":n.value,class:"flex flex-wrap gap-2",onChange:s},{default:u(()=>[m(a,{value:c(x).COMP_MATCH_TYPE_ONLY_INSTALL,class:"!flex !items-center !gap-1 !m-0 !h-auto"},{default:u(()=>[o[0]||(o[0]=l("span",{class:"inline-block w-2 h-2 rounded-full mr-1 bg-green-500 shadow-[0_0_4px_rgba(103,194,58,0.5)]"},null,-1)),w(" "+f(c(e)("deps.match.onlyInstall")),1)]),_:1},8,["value"]),m(a,{value:c(x).COMP_MATCH_TYPE_MAJOR_VERSION,class:"!flex !items-center !gap-1 !m-0 !h-auto"},{default:u(()=>[o[1]||(o[1]=l("span",{class:"inline-block w-2 h-2 rounded-full mr-1 bg-blue-500 shadow-[0_0_4px_rgba(64,158,255,0.5)]"},null,-1)),w(" "+f(c(e)("deps.match.majorVersion")),1)]),_:1},8,["value"]),m(a,{value:c(x).COMP_MATCH_TYPE_MINOR_VERSION,class:"!flex !items-center !gap-1 !m-0 !h-auto"},{default:u(()=>[o[2]||(o[2]=l("span",{class:"inline-block w-2 h-2 rounded-full mr-1 bg-orange-500 shadow-[0_0_4px_rgba(230,162,60,0.5)]"},null,-1)),w(" "+f(c(e)("deps.match.minorVersion")),1)]),_:1},8,["value"]),m(a,{value:c(x).COMP_MATCH_TYPE_EXACT_VERSION,class:"!flex !items-center !gap-1 !m-0 !h-auto"},{default:u(()=>[o[3]||(o[3]=l("span",{class:"inline-block w-2 h-2 rounded-full mr-1 bg-red-500 shadow-[0_0_4px_rgba(245,108,108,0.5)]"},null,-1)),w(" "+f(c(e)("deps.match.exactVersion")),1)]),_:1},8,["value"])]),_:1},8,["model-value"])}}}),B=me(Be,[["__scopeId","data-v-911ad151"]]),Ce={class:"flex gap-2"},Me={class:"text-xl font-medium"},Ve={class:"flex items-center gap-[10px] mb-[15px] pb-[10px] border-b border-solid border-gray-200"},Se={class:"text-[14px] font-medium"},Te={class:"border-b border-solid border-gray-300"},Ae={class:"flex"},Pe={class:"w-[100px]"},Le={class:"text-xl font-medium"},Ne={class:"flex items-center gap-[10px] mb-[15px] pb-[10px] border-b border-solid border-gray-200"},ke={class:"text-[14px] font-medium"},Re={class:"border-b border-solid border-gray-300"},Oe={class:"flex"},je={class:"w-[100px]"},Ue=C({__name:"index",setup(t){const{t:e}=M(),n=fe(),s=Z(pe,{dependencies:[],devDependencies:[]}),r=E([]),o=E([]),a=E(""),d=E("");function i(){r.value.forEach(v=>{v.match=a.value}),window?.umami?.track(L.SETTING_APPLY_RULE,{type:"dependencies",match:a.value})}function p(){o.value.forEach(v=>{v.match=d.value}),window?.umami?.track(L.SETTING_APPLY_RULE,{type:"devDependencies",match:d.value})}return be(async()=>{r.value=I(n.dependencies),o.value=I(n.devDependencies)}),ge(()=>{r.value.length&&n.setDependencies(I(r.value)),o.value.length&&n.setDevDependencies(I(o.value)),s.value={dependencies:r.value.length?r.value:s.value.dependencies,devDependencies:o.value.length?o.value:s.value.devDependencies}}),(v,b)=>{const z=ne,F=ae,$=te,Y=ee,re=ie;return h(),y(re,{"wrap-class":"size-full"},{default:u(()=>[l("div",Ce,[m(Y,{"label-position":"left","label-width":"auto"},{default:u(()=>[m($,{class:"rounded-sm"},{default:u(()=>[l("h1",Me,f(c(e)("deps.dependencies")),1),l("div",Ve,[l("span",Se,f(c(e)("deps.batchSetting"))+":",1),m(c(B),{modelValue:a.value,"onUpdate:modelValue":b[0]||(b[0]=_=>a.value=_)},null,8,["modelValue"]),m(z,{type:"primary",size:"small",onClick:i},{default:u(()=>[w(f(c(e)("common.apply")),1)]),_:1})]),(h(!0),N(K,null,W(r.value,_=>(h(),y(F,{key:_.name,class:"!mb-10"},{label:u(()=>[l("div",Te,[l("span",null,f(_.name),1)])]),default:u(()=>[l("div",Ae,[l("span",Pe,f(_.version),1)]),l("div",null,[m(c(B),{modelValue:_.match,"onUpdate:modelValue":S=>_.match=S},null,8,["modelValue","onUpdate:modelValue"])])]),_:2},1024))),128))]),_:1})]),_:1}),m(Y,{"label-position":"left","label-width":"auto"},{default:u(()=>[m($,{class:"rounded-sm"},{default:u(()=>[l("h1",Le,f(c(e)("deps.devDependencies")),1),l("div",Ne,[l("span",ke,f(c(e)("deps.batchSetting"))+":",1),m(c(B),{modelValue:d.value,"onUpdate:modelValue":b[1]||(b[1]=_=>d.value=_)},null,8,["modelValue"]),m(z,{type:"primary",size:"small",onClick:p},{default:u(()=>[w(f(c(e)("common.apply")),1)]),_:1})]),(h(!0),N(K,null,W(o.value,_=>(h(),y(F,{key:_.name,class:"!mb-10"},{label:u(()=>[l("div",Re,[l("span",null,f(_.name),1)])]),default:u(()=>[l("div",Oe,[l("span",je,f(_.version),1)]),l("div",null,[m(c(B),{modelValue:_.match,"onUpdate:modelValue":S=>_.match=S},null,8,["modelValue","onUpdate:modelValue"])])]),_:2},1024))),128))]),_:1})]),_:1})])]),_:1})}}}),k=(t,e)=>e.some(n=>t instanceof n);let G,X;function ze(){return G||(G=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Fe(){return X||(X=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const R=new WeakMap,A=new WeakMap,V=new WeakMap;function $e(t){const e=new Promise((n,s)=>{const r=()=>{t.removeEventListener("success",o),t.removeEventListener("error",a)},o=()=>{n(D(t.result)),r()},a=()=>{s(t.error),r()};t.addEventListener("success",o),t.addEventListener("error",a)});return V.set(e,t),e}function Ye(t){if(R.has(t))return;const e=new Promise((n,s)=>{const r=()=>{t.removeEventListener("complete",o),t.removeEventListener("error",a),t.removeEventListener("abort",a)},o=()=>{n(),r()},a=()=>{s(t.error||new DOMException("AbortError","AbortError")),r()};t.addEventListener("complete",o),t.addEventListener("error",a),t.addEventListener("abort",a)});R.set(t,e)}let O={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return R.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return D(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function oe(t){O=t(O)}function He(t){return Fe().includes(t)?function(...e){return t.apply(j(this),e),D(this.request)}:function(...e){return D(t.apply(j(this),e))}}function Ke(t){return typeof t=="function"?He(t):(t instanceof IDBTransaction&&Ye(t),k(t,ze())?new Proxy(t,O):t)}function D(t){if(t instanceof IDBRequest)return $e(t);if(A.has(t))return A.get(t);const e=Ke(t);return e!==t&&(A.set(t,e),V.set(e,t)),e}const j=t=>V.get(t);function We(t,e,{blocked:n,upgrade:s,blocking:r,terminated:o}={}){const a=indexedDB.open(t,e),d=D(a);return s&&a.addEventListener("upgradeneeded",i=>{s(D(a.result),i.oldVersion,i.newVersion,D(a.transaction),i)}),n&&a.addEventListener("blocked",i=>n(i.oldVersion,i.newVersion,i)),d.then(i=>{o&&i.addEventListener("close",()=>o()),r&&i.addEventListener("versionchange",p=>r(p.oldVersion,p.newVersion,p))}).catch(()=>{}),d}const Ge=["get","getKey","getAll","getAllKeys","count"],Xe=["put","add","delete","clear"],P=new Map;function J(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(P.get(e))return P.get(e);const n=e.replace(/FromIndex$/,""),s=e!==n,r=Xe.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!(r||Ge.includes(n)))return;const o=async function(a,...d){const i=this.transaction(a,r?"readwrite":"readonly");let p=i.store;return s&&(p=p.index(d.shift())),(await Promise.all([p[n](...d),r&&i.done]))[0]};return P.set(e,o),o}oe(t=>({...t,get:(e,n,s)=>J(e,n)||t.get(e,n,s),has:(e,n)=>!!J(e,n)||t.has(e,n)}));const Je=["continue","continuePrimaryKey","advance"],Q={},U=new WeakMap,se=new WeakMap,Qe={get(t,e){if(!Je.includes(e))return t[e];let n=Q[e];return n||(n=Q[e]=function(...s){U.set(this,se.get(this)[e](...s))}),n}};async function*qe(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const n=new Proxy(e,Qe);for(se.set(n,e),V.set(n,j(e));e;)yield n,e=await(U.get(n)||e.continue()),U.delete(n)}function q(t,e){return e===Symbol.asyncIterator&&k(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&k(t,[IDBIndex,IDBObjectStore])}oe(t=>({...t,get(e,n,s){return q(e,n)?qe:t.get(e,n,s)},has(e,n){return q(e,n)||t.has(e,n)}}));let g=null;const Ze=xe("indexedDB",{actions:{async open(t=1){return g||(g=await We(x.INDEX_DB_NAME,t,{upgrade(e){e.objectStoreNames.contains(x.INDEX_DB_TABLE_NAME)||e.createObjectStore(x.INDEX_DB_TABLE_NAME,{keyPath:"hash",autoIncrement:!1}).createIndex("by-hash","hash")},blocked(){console.warn("IndexedDB 被其它标签页占用")}}),g)},async get(t,e){return(await this.open()).get(t,e)},async put(t,e){return(await this.open()).put(t,e)},async remove(t,e){return(await this.open()).delete(t,e)},close(){g?.close(),g=null},async deleteDatabase(){if(g){const t=g.name;this.close(),indexedDB.deleteDatabase(t)}}}}),et={class:"flex items-center"},tt={class:"ml-2"},nt=C({__name:"index",setup(t){const{t:e}=M(),n=Ze(),s=E("");async function r(){try{if(!navigator.storage||!navigator.storage.estimate)throw new Error(e("message.error.storageNotSupported"));return await navigator.storage.estimate()}catch(d){return console.error("获取存储统计失败:",d.message),null}}function o(){de.confirm(e("common.clearCacheConfirm"),e("common.info"),{confirmButtonText:e("common.confirm"),cancelButtonText:e("common.cancel"),type:"warning",beforeClose:async(d,i,p)=>{d==="confirm"&&(i.confirmButtonLoading=!0,await H.v1Module.modulecontrollerClearprebuild(),await n.deleteDatabase(),i.confirmButtonLoading=!1,await a(),ue.success(e("common.cacheCleared")),window?.umami?.track(L.CLEAR_CACHE)),p()}}).catch(()=>{})}async function a(){const d=await r(),i=await H.v1Module.modulecontrollerPrebuildsize(),{size:p=0}=i.data??{},{usage:v=0}=d??{},b=(v+p)/(1024*1024);s.value=`${b.toFixed(2)} MB`}return we(async()=>{await a()}),(d,i)=>{const p=ne,v=ae,b=ee;return h(),y(b,null,{default:u(()=>[m(v,{label:c(e)("common.cache")+":"},{default:u(()=>[l("div",et,[m(p,{onClick:o},{default:u(()=>[w(f(c(e)("common.clearCache")),1)]),_:1}),l("span",tt,f(c(e)("common.cacheSize"))+":"+f(s.value),1)])]),_:1},8,["label"])]),_:1})}}}),at={class:"size-full overflow-hidden flex flex-col rounded-sm"},ot={class:"flex-1 overflow-auto overflow-x-hidden p-1"},dt=C({__name:"index",setup(t){const{t:e}=M(),n=Z(_e,"previewRule"),s=[{label:T(()=>e("setting.previewRule")),value:"previewRule",component:Ue},{label:T(()=>e("setting.other")),value:"otherSetting",component:nt}],r=T(()=>s.find(a=>a.value===n.value)?.component||{render:()=>null});return(o,a)=>{const d=te;return h(),N("div",at,[m(d,{"body-class":"!p-0",class:"sticky top-0 w-full"},{default:u(()=>[m(c(Ie),{modelValue:c(n),"onUpdate:modelValue":a[0]||(a[0]=i=>ye(n)?n.value=i:null),options:s},null,8,["modelValue"])]),_:1}),l("div",ot,[m(c(he),null,{default:u(()=>[(h(),y(De,null,[(h(),y(Ee(r.value)))],1024))]),_:1})])])}}});export{dt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aJ as L,U as O,b as k}from"./vendor-ui-CGT0cG1n.js";import{u as s,B as R,t as u,p as T}from"./index-CdLdwW7r.js";import{c as b,a as I}from"./index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js";import{v as S,aA as P,y as A,aC as x,aD as M,ac as d,aF as B,a9 as D,aP as K,ax as n,ab as N,l as F,r as c,aO as f,af as $,g as l,ao as U}from"./vendor-core-BKehvho7.js";import{u as V}from"./useKeyword-bWHMALoZ.js";import"./index-BYC9CuLh.js";import"./useCompMetaLocalStore-BKTMp_k8.js";/* empty css */import"./useVscodeOpen-SZpyzVHG.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./useCacheOssStore-OAoLDVbw.js";import"./useTeamHeaders-DxHN7-t0.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./useMessage-BVw3M4ej.js";const Y={class:"size-full p-[10px] pr-0"},se=S({__name:"index",setup(z){const{t:p}=P(),_=A()?.uid,C=x(),w=M(),o=b(C.path)();d(s.PROVIDE_KEY_COMP_LIST_STORE,o);const m=new Map;d(s.PROVIDE_KEY_CALLBACKS,m);const y=B("compIframeContainer"),i=$({data:[],search:{column:[{prop:"keyword",component:U(k),label:l(()=>p("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:l(()=>p("comp.keywordPlaceholder")),fetchSuggestions:h,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:E}),g=l(()=>i.value?.search?.column[0]?.value??"");V(g,y);function h(e,t){if(e.length<=1)return t([]);u.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compMyCollect"}).then(a=>{const{keywords:r=[]}=a.data||{};t(r)})}async function E(e){o.setLoading(!0),e.keyword&&window?.umami?.track(T.SEARCH_COMPONENT,{keyword:e.keyword,page:"collect"});const t=await u.v1Comp.compcontrollerCollectedcomps(e),{rows:a,total:r}=t.data??{};o.renderList(a??[]),i.value.pagination.total=r??0,o.setLoading(!1)}function v(e){w.push({path:`/preview/${e}`})}return m.set(s.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT,e=>{o.delCompListById(e)}),D(()=>{o.$reset()}),(e,t)=>{const a=O,r=L;return K((N(),F("div",Y,[c(n(R),{tableConfig:i.value},{table:f(()=>[c(a,{always:"",wrapClass:"pr-[10px]"},{default:f(()=>[c(I,{ref:"compIframeContainer",iuid:n(_),compType:n(s).IFRAME_ROUTES.CONTAINER.COLLECT,onPreview:v},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"])])),[[r,n(o).loading]])}}});export{se as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a3 as i}from"./vendor-ui-CGT0cG1n.js";import{z as u,F as d,j as l}from"./index-CdLdwW7r.js";import{v as _,aA as g,aD as m,ab as f,j as S,aO as x,i as b,Z as h,ax as s,ap as t,g as C}from"./vendor-core-BKehvho7.js";const k=_({__name:"index",setup(U){const{t:a}=g(),o=u(),e=d(),r=m(),n=C(()=>e.isUpgrade?a("upgrade.hasUpdate"):a("upgrade.betaVersion"));function p(){r.push({name:"upgrade"})}return(V,v)=>{const c=i;return f(),S(c,{type:"primary",round:"",class:"cursor-pointer","disable-transitions":"",onClick:p},{default:x(()=>[b("span",{class:h({"is-upgrade":s(e).isUpgrade})},t(n.value)+" "+t(s(o).compHubVersion),3)]),_:1})}}}),z=l(k,[["__scopeId","data-v-cb2ac669"]]);export{z as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as _,ab as v,l as C,r as c,ax as p,aC as x,ac as D,a7 as I,aO as R,k,af as P,g as O}from"./vendor-core-BKehvho7.js";import{c as V,p as $}from"./index-BYC9CuLh.js";import{u as E,z,t as F,q as f}from"./index-CdLdwW7r.js";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-DtCu4Izc.js";import{_ as B}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./vendor-ui-CGT0cG1n.js";import"./useMessage-BVw3M4ej.js";const L={class:"size-full"},j=_({__name:"index",props:{version:{type:String,default:""},compAttrs:{type:Object,default:()=>({})}},setup(e){return(l,a)=>(v(),C("div",L,[c(N,{compAttrs:e.compAttrs,version:e.version,bgColor:e.compAttrs?.bgColor,compType:p(E).IFRAME_ROUTES.ITEM.PREVIEW_REMOTE},null,8,["compAttrs","version","bgColor","compType"])]))}}),q={key:0,class:"size-full"},Q=_({__name:"index",setup(e){const l=x(),a=z(),A=new Map;D(E.PROVIDE_KEY_CALLBACKS,A);const{compId:t,version:r=""}=l.params,m=P(!1),o=V(t)(),d=O(()=>o.detail[r]);async function g(){if(await a.initSetting(),!t)throw new Error("compId is required");const n=await F.v1Comp.compcontrollerCompdetail({compId:t,version:r}),{objectId:u,version:s,files:y,dep:b}=n.data,w={objectId:u,version:s,files:y.map(i=>i.path)},S=await f.v1Comp.compcontrollerCompfilesosssignedurl(w),h=$(b,a.deps).map(i=>i.name),M=await f.v1Module.modulecontrollerPrebuild({deps:h}),{entryNameToFile:T={}}=M.data;o.setDetail(s,{...n.data,_id:t}),o.setDepEntryNameToFile(s,T),o.setVersionToFileAccessPath(s,S.data.signedUrls)}return I(async()=>{await g(),m.value=!0}),(n,u)=>m.value?(v(),C("div",q,[c(p(B),{isEmpty:!d.value,class:"size-full"},{default:R(()=>[c(j,{compAttrs:d.value,version:p(r)},null,8,["compAttrs","version"])]),_:1},8,["isEmpty"])])):k("",!0)}});export{Q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.pane-card[data-v-96c02aae] .pane-body{padding:0!important;display:flex;flex-direction:column;overflow:hidden}.pane-card[data-v-96c02aae] .pane-header{padding:0!important}.pane-maximized[data-v-96c02aae]{position:fixed;inset:0;z-index:50}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aJ as M,b as x,g as B,F as N,K as $}from"./vendor-ui-CGT0cG1n.js";import{u as n,B as K,t as m,p as E}from"./index-CdLdwW7r.js";import{v as F,y as G,aA as H,aC as V,aD as Y,ac as _,aF as T,a9 as z,aP as Q,ax as p,ab as J,l as W,r as g,aO as j,af as X,g as i,ao as C}from"./vendor-core-BKehvho7.js";import{c as Z,b as q,a as ee}from"./index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js";import{c as oe}from"./useCompEditStore-DI3vFtGm.js";import{_ as te}from"./index.vue_vue_type_style_index_0_lang-1ZphBFBL.js";import{u as ae}from"./useTeamHeaders-DxHN7-t0.js";import{u as re}from"./useKeyword-bWHMALoZ.js";import"./index-BYC9CuLh.js";import"./useCompMetaLocalStore-BKTMp_k8.js";/* empty css */import"./useVscodeOpen-SZpyzVHG.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./useCacheOssStore-OAoLDVbw.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./useMessage-BVw3M4ej.js";/* empty css */import"./v4-EwEgHOG0.js";import"./index.vue_vue_type_style_index_0_lang-BNPcBMvg.js";import"./core-CcVTMiBP.js";import"./PanelBackground.vue_vue_type_script_setup_true_lang-BELCrrRh.js";import"./BaseSegmented.vue_vue_type_script_setup_true_lang-DU79Plk1.js";import"./LoadingWrapper.vue_vue_type_script_setup_true_lang-kJcgjuK5.js";const ne={class:"size-full overflow-hidden"},be=F({__name:"index",setup(se){const y=G()?.uid,{t:a}=H(),h=V(),v=Y(),{headers:l,teamId:d}=ae(),r=Z(`${h.path}_${n.SCOPE_ID_TEAM_COMP_LIST}`)();_(n.PROVIDE_KEY_COMP_LIST_STORE,r);const I=new Map;_(n.PROVIDE_KEY_CALLBACKS,I);const S=oe(h.path,n.DIALOG_TYPE_EDIT)();_(n.PROVIDE_KEY_COMP_EDIT_STORE,S);const w=q(d)(),L=T("compUpdateDialog"),k=T("compIframeContainer"),u=X({data:[],search:{column:[{prop:"keyword",component:C(x),label:i(()=>a("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:i(()=>a("comp.keywordPlaceholder")),fetchSuggestions:R,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}},{prop:"group",component:C(B),label:i(()=>a("team.group")),value:"",attributes:{options:i(()=>w.menuGroup),clearable:!0,props:{value:"id",checkStrictly:!0}}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:b}),O=i(()=>u.value?.search?.column[0]?.value??"");re(O,k);function R(e,o){if(e.length<=1)return o([]);m.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compTeam"},{headers:l}).then(t=>{const{keywords:s=[]}=t.data||{};o(s)})}async function b(e){r.setLoading(!0),e.keyword&&window?.umami?.track(E.SEARCH_COMPONENT,{keyword:e.keyword,page:"team"});const{group:o=[]}=e||{};delete e.group,o.length&&window?.umami?.track(E.TEAM_FILTER_GROUP,{teamId:d,group:o});const t=o?.[o.length-1];if(t){let c=w.getSelectedGroupLeafNodes(t);c=c.length===0?[t]:c,e.leafNodeIds=c}const s=await m.v1Team.teamcontrollerTeamcomps({...e,scene:"library"},{headers:l}),{rows:f,total:U}=s.data??{};r.renderList(f??[]),u.value.pagination.total=U??0,r.setLoading(!1)}function P(e){v.push({path:`/previewTeam/${d}/${e}`})}async function D(e){const o=N.service({fullscreen:!0});try{const t=e,s=await m.v1Team.teamcontrollerCheckcompupdatepermission({compId:t},{headers:l}),{result:f}=s.data||{};if(f==="cannot_update"){$.confirm(a("message.noUpdatePermission"),a("common.info"),{confirmButtonText:a("common.confirm"),cancelButtonText:a("common.cancel"),type:"warning"}).finally(()=>{});return}L.value?.open(t)}finally{o.close()}}function A(e){m.v1Comp.compcontrollerCompdetail({compId:e}).then(o=>{r.updateCompListItemById(e,o.data)})}return z(()=>{r.$reset()}),(e,o)=>{const t=M;return Q((J(),W("div",ne,[g(p(K),{tableConfig:u.value},{table:j(()=>[g(ee,{ref:"compIframeContainer",iuid:p(y),compType:p(n).IFRAME_ROUTES.CONTAINER.TEAM_ALL,onPreview:P,onUpdate:D},null,8,["iuid","compType"])]),_:1},8,["tableConfig"]),g(te,{ref:"compUpdateDialog",onUpdateSuccess:A},null,512)])),[[t,p(r).loading]])}}});export{be as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as $,aH as z,x as R,y as J,A as M,e as K,J as T}from"./vendor-ui-CGT0cG1n.js";import{w as Y,J as Q,L as W,p,t as X,j as A}from"./index-CdLdwW7r.js";/* empty css */import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang-CgaIiyg6.js";import{S as ee}from"./index-DkakQhTy.js";import{v as E,aA as D,ab as h,l as y,i as n,r as s,ap as _,ax as l,aO as c,q as C,aD as te,aF as se,ad as I,aN as ae,F as V,k as N,af as le,g as U}from"./vendor-core-BKehvho7.js";import{m as oe}from"./md5-ohq5q_Pj.js";import{_ as ne}from"./AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-CP9hjm3T.js";import{_ as re}from"./CanvasAnimation.vue_vue_type_script_setup_true_lang-Xr4R8ONt.js";import"./LoadingWrapper.vue_vue_type_script_setup_true_lang-kJcgjuK5.js";const ie={class:"flex bg-gray-600 items-center justify-center overflow-hidden"},ue={class:"w-full rounded-2xl p-8 md:p-12"},ce={class:"flex mb-[10px]"},de={class:"text-2sm text-gray-300 mb-[50px] ml-2"},me={class:"relative pl-6 border-l-4 border-indigo-400 mb-8"},pe={class:"leading-relaxed text-gray-300"},fe={class:"flex items-center gap-2 mb-6"},_e=E({__name:"index",setup(S){const{t:e}=D(),g=Y();return(b,m)=>{const v=$;return h(),y("div",ie,[n("section",ue,[n("header",ce,[s(Z)]),n("h2",de,_(l(e)("common.siteSubtitle")),1),n("blockquote",me,[n("p",pe,_(l(e)("common.siteSlogan")),1),m[0]||(m[0]=n("footer",{class:"mt-4 text-sm text-gray-500"},null,-1))]),n("div",fe,[s(ee),s(v,{href:l(g),type:"primary",underline:"always",target:"_blank"},{default:c(()=>[C(_(l(e)("common.docsTutorial")),1)]),_:1},8,["href"])])])])}}}),ge={class:"flex items-center justify-center bg-[#0d0d0d] size-full overflow-hidden"},ve={class:"h-full"},he={class:"flex items-center gap-1 w-full"},ye={class:"flex justify-between"},xe=E({__name:"index",setup(S){const{t:e}=D(),g=te(),b=Q(),m=se("form"),v=z(W,"account"),x=le(!1),f=I([{name:e("user.accountLogin"),type:"account",select:v.value==="account"},{name:e("user.emailLogin"),type:"email",select:v.value==="email"}]),o=I({account:"",password:"",email:"",authCode:""}),F=I({account:[{required:!0,message:e("user.pleaseInputAccount"),trigger:"blur"}],password:[{required:!0,message:e("user.pleaseInputPassword"),trigger:"blur"}],email:[{required:!0,message:e("common.pleaseInput")+e("user.email"),trigger:"blur"},{type:"email",message:e("user.pleaseInputCorrectEmail"),trigger:"blur"}],authCode:[{required:!0,message:e("user.pleaseInputAuthCode"),trigger:"blur"}]}),k=U(()=>f.find(a=>!a.select)??f[1]),w=U(()=>f.find(a=>a.select)??f[0]);function O(a){f.forEach(t=>{t.select=!1}),a.select=!0}function P(){g.replace("/")}async function B({end:a,startCountdown:t}){if(w.value?.type==="email"&&o.email){if(!await m.value?.validateField("email").catch(()=>!1)){a();return}X.v1Email.emailcontrollerSendcode({email:o.email}).then(()=>{T.success(e("message.success.sendAuthCode")),t(),window?.umami?.track(p.SEND_AUTH_CODE_SUCCESS,{email:o.email})}).catch(()=>{window?.umami?.track(p.SEND_AUTH_CODE_FAILED,{email:o.email})}).finally(()=>{a()})}}function j(){m.value&&m.value.validate(a=>{if(!a)return;const t={account:{fields:["account","password"],getParams:i=>({account:i.account,password:oe(i.password)})},email:{fields:["email","authCode"],getParams:i=>({email:i.email,authCode:i.authCode})}},r=w.value?.type,d=r&&t[r];if(!d)return;d.fields.every(i=>!!o[i])&&q(d.getParams(o))})}function q(a){m.value&&m.value.validate(t=>{t&&(x.value=!0,b.login(a).then(()=>{g.replace("/").finally(()=>{x.value=!1,T.success(e("user.loginSuccess")),window?.umami?.track(p.LOGIN_BUTTON_SUCCESS,{form:a}),window?.umami?.identify({id:b.userId})})}).catch(r=>{window?.umami?.track(p.LOGIN_BUTTON_FAILED,{form:a,error:r})}).finally(()=>{x.value=!1}))})}return ae(()=>{f.forEach(a=>{a.select&&(v.value=a.type)})}),(a,t)=>{const r=M,d=J,L=K,i=$,H=R;return h(),y("div",ge,[s(H,{ref:"form",class:"w-[70%]",model:o,rules:F,"status-icon":""},{default:c(()=>[n("div",ve,[w.value.type==="account"?(h(),y(V,{key:0},[s(d,{prop:"account"},{default:c(()=>[s(r,{modelValue:o.account,"onUpdate:modelValue":t[0]||(t[0]=u=>o.account=u),placeholder:l(e)("user.pleaseInputUsername")},null,8,["modelValue","placeholder"])]),_:1}),s(d,{prop:"password"},{default:c(()=>[s(r,{modelValue:o.password,"onUpdate:modelValue":t[1]||(t[1]=u=>o.password=u),placeholder:l(e)("user.pleaseInputPassword"),type:"password"},null,8,["modelValue","placeholder"])]),_:1}),t[6]||(t[6]=n("div",{class:"toolbar"},null,-1))],64)):N("",!0),w.value.type==="email"?(h(),y(V,{key:1},[s(d,{prop:"email"},{default:c(()=>[s(r,{modelValue:o.email,"onUpdate:modelValue":t[2]||(t[2]=u=>o.email=u),placeholder:l(e)("common.pleaseInput")+l(e)("user.email")},null,8,["modelValue","placeholder"])]),_:1}),s(d,{prop:"authCode"},{default:c(()=>[n("div",he,[s(r,{modelValue:o.authCode,"onUpdate:modelValue":t[3]||(t[3]=u=>o.authCode=u),placeholder:l(e)("user.pleaseInputAuthCode")},null,8,["modelValue","placeholder"]),s(l(ne),{id:l(p).SEND_AUTH_CODE,disabled:!o.email,text:l(e)("user.sendAuthCode"),"countdown-text":"user.resendAfterSeconds",duration:60,onSend:t[4]||(t[4]=({end:u,startCountdown:G})=>B({end:u,startCountdown:G}))},null,8,["id","disabled","text"])])]),_:1})],64)):N("",!0),s(d,null,{default:c(()=>[s(L,{id:l(p).LOGIN_BUTTON,class:"w-full",loading:x.value,type:"primary",onClick:j},{default:c(()=>[C(_(l(e)("user.login")),1)]),_:1},8,["id","loading"])]),_:1})]),n("div",ye,[s(i,{id:l(p).SKIP_LOGIN,href:"javascript:void(0)",onClick:P},{default:c(()=>[C(_(l(e)("user.skip")),1)]),_:1},8,["id"]),s(i,{type:"primary",onClick:t[5]||(t[5]=u=>O(k.value))},{default:c(()=>[C(_(k.value.name),1)]),_:1})])]),_:1},8,["model","rules"])])}}}),we=A(xe,[["__scopeId","data-v-e00e8e6e"]]),Ce={class:"size-full relative"},be={class:"absolute inset-0 flex items-center justify-center"},Ie={class:"login-content-container"},Ee={class:"flex size-full"},Se=E({__name:"index",setup(S){return(e,g)=>(h(),y("div",Ce,[s(l(re)),n("div",be,[n("div",Ie,[n("div",Ee,[s(_e,{class:"size-full flex-1"}),s(we,{class:"flex-1"})])])])]))}}),Oe=A(Se,[["__scopeId","data-v-69bff7ed"]]);export{Oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as x,j as D,u as C,t as $}from"./index-CdLdwW7r.js";import{e as I,f as g,aG as B,r as L}from"./vendor-ui-CGT0cG1n.js";import{v as k,aA as z,ab as o,j as l,aO as c,l as R,ai as w,k as _,i as y,ap as h,ax as s,r as v,Z as M,af as S,aC as A,aD as O,ac as T,a7 as N,a9 as V,aF as P,p as j,q as b,g as K}from"./vendor-core-BKehvho7.js";/* empty css */import{_ as F}from"./index.vue_vue_type_style_index_0_lang-BNPcBMvg.js";import{u as E}from"./useTeamHeaders-DxHN7-t0.js";import{c as H,a as U}from"./index.vue_vue_type_script_setup_true_lang-DTrkhAMQ.js";const Y={class:"flex items-center justify-between px-3 py-2 select-none"},q={class:"text-sm font-medium"},G={class:"flex gap-[6px]"},Z={key:0,class:"flex-1 p-2 overflow-auto"},J=k({__name:"BasePane",props:{title:{type:String,default:""},actions:{type:Array,default:()=>["close","maximize","minimize"]}},emits:["close","maximize","minimize"],setup(t,{emit:i}){const{t:p}=z(),m=t,n=i,e=S(!1),d=S(!1);function f(){n("close")}function u(){e.value=!e.value,n("maximize",e.value)}function a(r){return m.actions.includes(r)}return(r,ee)=>(o(),l(s(g),{"body-class":"pane-body","header-class":"pane-header",class:M(["pane-card w-full h-full",{"pane-maximized":e.value}])},{header:c(()=>[y("div",Y,[y("div",q,h(t.title),1),y("div",G,[w(r.$slots,"beforeActions",{},void 0,!0),a("close")?(o(),l(s(I),{key:0,type:"primary",circle:"",onClick:f},{default:c(()=>[v(s(x),{icon:"material-symbols:close"})]),_:1})):_("",!0),a("maximize")?(o(),l(s(I),{key:1,type:"primary",circle:"",title:s(p)("common.maximizeRestore"),onClick:u},{default:c(()=>[e.value?(o(),l(s(x),{key:1,icon:"material-symbols:fullscreen-exit"})):(o(),l(s(x),{key:0,icon:"material-symbols:fullscreen"}))]),_:1},8,["title"])):_("",!0)])])]),default:c(()=>[d.value?_("",!0):(o(),R("div",Z,[w(r.$slots,"default",{isMaximized:e.value},void 0,!0)]))]),_:3},8,["class"]))}}),re=D(J,[["__scopeId","data-v-96c02aae"]]),Q={class:"min-h-[400px]"},W=k({__name:"index",setup(t){const i=A(),p=O(),{compId:m}=i.params,{headers:n}=E(),e=H(i.path)();T(C.PROVIDE_KEY_COMP_LIST_STORE,e);const d=new Map;T(C.PROVIDE_KEY_CALLBACKS,d);const f=async()=>{if(e.setLoading(!0),!m)return;const a=await $.v1Comp.compcontrollerSimilarcomps({compId:m},{headers:n}),{rows:r}=a.data||{};await e.renderList(r),e.setLoading(!1)};function u(a){p.push({path:`/preview/${a}`})}return N(()=>{f()}),V(()=>{e.$reset()}),(a,r)=>(o(),R("div",Q,[v(U,{compType:s(C).IFRAME_ROUTES.CONTAINER.SIMILAR,onPreview:u},null,8,["compType"])]))}}),X={ref:"similarComp",class:"mt-[10px] overflow-hidden"},le=k({__name:"index",props:{mdSrc:{type:String,default:""},compDesc:{type:String,default:""},scrollContainer:{type:String,default:""},stickyTopDistance:{type:Number,default:45},showSimilarComp:{type:Boolean,default:!0}},setup(t){const{t:i}=z(),{teamId:p}=E(),m=K(()=>i(p?"team.similarCompInTeam":"team.similarComp")),n=S(!1),e=P("similarComp");return B(e,([d])=>{n.value||(n.value=d?.isIntersecting||!1)}),(d,f)=>{const u=L,a=g;return o(),l(F,{showToc:!0,src:t.mdSrc,scrollContainer:t.scrollContainer,stickyTopDistance:t.stickyTopDistance},j({empty:c(()=>[b(h(t.compDesc||s(i)("common.noReadme")),1)]),_:2},[t.showSimilarComp?{name:"footer",fn:c(()=>[y("div",X,[v(u,{"content-position":"center"},{default:c(()=>[b(h(m.value),1)]),_:1}),v(a,{"body-class":"!p-1",class:"mt-[10px]"},{default:c(()=>[n.value?(o(),l(W,{key:0})):_("",!0)]),_:1})],512)]),key:"0"}:void 0]),1032,["src","scrollContainer","stickyTopDistance"])}}});export{re as B,le as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as A,u}from"./index-CdLdwW7r.js";import{c as m}from"./useCompMetaLocalStore-BKTMp_k8.js";import{aD as g}from"./vendor-ui-CGT0cG1n.js";import{u as O}from"./useVscodeOpen-SZpyzVHG.js";import{v as h,aF as C,aM as w,ab as k,l as D,i as N,ax as v,g as B}from"./vendor-core-BKehvho7.js";import{c as F,b as G,I as o,a as W,e as b}from"./useMessage-BVw3M4ej.js";const $={class:"size-full"},x=["src"],J=h({__name:"index",props:{compType:{},version:{},compAttrs:{},iuid:{}},setup(d){const s=d,f=A(),n=F(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:I,messageListener:T,sendMessageToTargetIframe:l}=b(),{addListener:i}=T(),{createIframeParams:E}=G(),{openCompPathInVscode:S,handlePath:L}=O(),P=g().value,p=C("iframe"),M=(()=>{const e={topOrigin:window.location.origin,userId:f.userId??"",instanceUid:[I.value,s.iuid].join(",")??"",compId:s.compAttrs?._id??"",isSfc:!0},t={params:E(e),isDark:P.toString()},a=new URLSearchParams(t).toString();return`${n}/${u.WEBSITE_PATH_ITEM}/${s.compType}?${a}`})();async function _(){const e=p.value?.contentWindow;if(e){const t=m(s.compAttrs?._id)(),{dep:a,depToFile:r}=t,c={item:s.compAttrs,dep:a,depToFile:r};l(e,o.ITEM_INIT_SET_LOCAL,c,n)}}return i(o.ITEM_INIT_GET_LOCAL,()=>{_()}),i(o.ITEM_SITE_PATH_GET,e=>{const t=m(e)(),{stopWatch:a,triggerCallback:r}=W(B(()=>t.detail.fullPath),()=>{const c=p.value?.contentWindow;c?l(c,o.ITEM_SITE_PATH_SET,L(t.detail.fullPath,1),n):a()});r(e)}),i(o.ACTION_OPEN_VSCODE_LOCAL,e=>{const a=m(e)().detail.fullPath;S(a,`./${u.COMP_CONFIG_FILENAME}`)}),w(()=>s.compAttrs,e=>{e&&_()}),(e,t)=>(k(),D("div",$,[N("iframe",{ref:"iframe",class:"size-full",src:v(M),frameborder:"0"},null,8,x)]))}});export{J as _};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BqUY_Pbs.js","./vendor-ui-CGT0cG1n.js","./vendor-core-BKehvho7.js","./index-CdLdwW7r.js","./index-DIKKFNiV.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{v as ce,aA as b,ab as ie,j as ye,aO as Y,i as G,r as K,ax as O,ap as oe,q as Me,u as Ne,af as P,w as re,H as A,aF as ae,aM as Pe,l as Ae,$ as Re,g as M}from"./vendor-core-BKehvho7.js";import{p as q,c as y}from"./index-BYC9CuLh.js";import{_ as Fe,z as j,q as v,u as w,J as le,t as V,p as N,V as Be,N as Ge}from"./index-CdLdwW7r.js";import{c as k}from"./useCompMetaLocalStore-BKTMp_k8.js";import{D as ke,K as x,F as J,J as X,aD as Ve}from"./vendor-ui-CGT0cG1n.js";/* empty css */import{u as me}from"./useVscodeOpen-SZpyzVHG.js";import{_ as xe}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import{u as be}from"./useCacheOssStore-OAoLDVbw.js";import{u as $e}from"./useTeamHeaders-DxHN7-t0.js";import{_ as He}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import{u as Ue,c as We,b as Ye,I as m,a as ne,e as Ke}from"./useMessage-BVw3M4ej.js";const je={class:"flex justify-between items-center"},ze={class:"h-[65vh]"},qe=ce({__name:"index",setup(C,{expose:e}){const{t}=b(),n=Ne(()=>Fe(()=>import("./index-BqUY_Pbs.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),{openCompPathInVscode:d}=me(),{cwd:_}=window.__GLOBAL_CONFIG__,r=P(!1),s=P(null),l=P(_);function i(){d(l.value,"./package.json")}const p=h=>{r.value=!0,s.value=h},u=()=>{r.value=!1,s.value=null},E=h=>{s.value&&s.value(h)};return e({open:p,close:u}),(h,g)=>{const R=ke;return ie(),ye(O(xe),{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=D=>r.value=D),width:"50%","show-close":""},{header:Y(()=>[G("div",je,[G("span",null,[G("span",null,oe(O(t)("file.projectPath"))+":",1),K(R,{href:"javascript:void(0)",type:"primary",underline:"always",title:l.value,class:"truncate",onClick:i},{default:Y(()=>[Me(oe(l.value),1)]),_:1},8,["title"])])])]),default:Y(()=>[G("div",ze,[K(O(n),{onSelect:E})])]),_:1},8,["modelValue"])}}}),Ct=(C,e)=>re(`compListStore_${C}`,{state:()=>({scopeId:C,list:[],localList:[],loading:!1,listType:e??w.COMP_LIST_TYPE_REMOTE}),getters:{isEmpty:t=>t.list.length===0,isRemote:t=>t.listType===w.COMP_LIST_TYPE_REMOTE,isLocal:t=>t.listType===w.COMP_LIST_TYPE_LOCAL},actions:{setLocalList(t){this.$patch(n=>{n.localList=t})},setLoading(t){this.$patch(n=>{n.loading=t})},setList(t){this.$patch(n=>{n.list=t})},delCompListById(t){this.$patch(n=>{n.list=n.list.filter(d=>d._id!==t)})},updateCompListItemById(t,n){this.$patch(d=>{d.list=d.list.map(_=>{if(_._id===t){const r={..._,...n};return y(t)().setDetail(r.version,r),r}return _})})},async getListDeps(t){const n=j(),r=t.map(i=>i.dep).map(i=>q(i,n.deps)).reduce((i,p)=>[...i,...p],[]).map(i=>i.name),s=await v.v1Module.modulecontrollerPrebuild({deps:[...new Set(r)]}),{entryNameToFile:l={}}=s.data;return l},async initCompMetas(t){const n=j(),d=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:t.map(s=>s._id)}),{compInfos:_=[]}=d.data,r=await this.getListDeps(t);t.forEach(s=>{const i=q(s.dep,n.deps).reduce((E,h)=>(r[h.name]&&(E[h.name]=r[h.name]),E),{}),p=y(s._id)();p.setLatestVersion(s.version),p.setDetail(s.version,s);const u=_.filter(E=>E.id===s._id);p.setLocalCompInfo(u),p.setDepEntryNameToFile(s.version,i)})},async initCompMetasLocal(t){t.forEach(n=>{k(n._id)().setDetail(n)})},async renderList(t){t.length&&(this.isRemote?await this.initCompMetas(t):await this.initCompMetasLocal(t)),this.setList(t)}}});async function se(C){const e=j();async function t(i){const{objectId:p,version:u,files:E}=i,h={objectId:p,version:u,files:E.map(D=>D.path)},g=await v.v1Comp.compcontrollerCompfilesosssignedurl(h),{signedUrls:R}=g.data;return R}async function n(i){const{dep:p}=i,u=q(p,e.deps).map(g=>g.name),E=await v.v1Module.modulecontrollerPrebuild({deps:u}),{entryNameToFile:h={}}=E.data;return h}const{version:d,_id:_}=C,r=y(_)();let s=null,l=null;r.versionToFileAccessPath[d]||(s=await t(C),r.setVersionToFileAccessPath(d,s)),r.depEntryNameToFile[d]||(l=await n(C),r.setDepEntryNameToFile(d,l))}const pe=()=>{const C=le();function e(){const t=C.isRealUserLogin();return t||C.logoutDialog(),t}return{isLogin:e}};function Je(){const{isLogin:C}=pe(),e=A(w.PROVIDE_KEY_CALLBACKS),t=A(w.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b();async function d(_){if(!C()||!t.isRemote)return;const{id:r,isCollect:s}=_,l=t.list.find(p=>p._id===r);if(!l||!s&&await x.confirm(n("comp.uncollectConfirm",{name:l.name}),n("comp.uncollect"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const i=J.service({fullscreen:!0});V.v1Comp.compcontrollerCollect({compId:l._id,isCollect:s}).then(()=>{X.success(l.isCollect?n("message.success.uncollect"):n("message.success.collect")),window?.umami?.track(N.COMP_COLLECT_TOGGLE,{compId:l._id,name:l.name,action:s?"collect":"uncollect"});const p={...l,isCollect:s};s?t.updateCompListItemById(l._id,{...p,collectCount:l.collectCount+1}):(t.updateCompListItemById(l._id,{...p,collectCount:l.collectCount-1}),e.get(w.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT)?.(l._id))}).finally(()=>{i.close()})}return{onCollect:d}}const Xe=(C="")=>{if(!C)throw new Error("createTeamHomeStore scopeId is required");return re(`teamHome_${C}`,{state:()=>({teamDetail:{},loading:!1,selectedRows:[],selectedRowsToLeafNodeMap:{},dataSourceCopy:[],canSaveCopy:!1}),getters:{teamName:e=>e.teamDetail.name,creator:e=>({nickname:e.teamDetail?.creatorId?.nickname||e.teamDetail?.creatorId?.account||"",avatar:e.teamDetail?.creatorId?.avatar||""}),creatorNickname:e=>e.teamDetail?.creatorNickname||"",memberCount:e=>e.teamDetail?.memberCount||0,compCount:e=>e.teamDetail?.compCount||0,totalDownloadCount:e=>e.teamDetail?.totalDownloadCount||0,isCreator:e=>e.teamDetail.isCreator,isMember:e=>e.teamDetail.isMember,isOutMember:e=>!e.teamDetail.isCreator&&!e.teamDetail.isMember,description:e=>e.teamDetail.description||"",isPublic:e=>e.teamDetail.isPublic,isApplyNeedAudit:e=>e.teamDetail.isApplyNeedAudit,isAllowCompAuthorDelete:e=>e.teamDetail.isAllowCompAuthorDelete,isShowRepeatComp:e=>e.teamDetail.isShowRepeatComp,code:e=>e.teamDetail.code||"",menuGroup:e=>e.teamDetail.menuGroup||[]},actions:{setCanSaveCopy(e){this.$patch(t=>{t.canSaveCopy=e})},setLoading(e){this.$patch(t=>{t.loading=e})},setTeamDetail(e){this.$patch(t=>{t.teamDetail=e})},setSelectedRows(e){this.$patch(t=>{t.selectedRows=e})},setDataSourceCopy(e){this.$patch(t=>{t.dataSourceCopy=e})},setSelectedRowsToLeafNodeMap(e){this.$patch(t=>{t.selectedRowsToLeafNodeMap=e})},addSelectedRowsToLeafNodeMap(e){this.$patch(t=>{t.selectedRowsToLeafNodeMap={...t.selectedRowsToLeafNodeMap,...e}})},delSelectedRowsToLeafNodeMap(e){this.$patch(t=>{const n={...t.selectedRowsToLeafNodeMap};e.forEach(d=>{delete n[d]}),t.selectedRowsToLeafNodeMap=n})},getSelectedGroupLeafNodes(e=""){return e?Be.getTreeAllChildren(this.menuGroup,e).filter(n=>n.children?.length===0).map(n=>n.id):[]}}})};function Qe(){const{isLogin:C}=pe(),e=A(w.PROVIDE_KEY_CALLBACKS),t=A(w.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b(),{headers:d,teamId:_}=$e();async function r(s){const l=J.service({fullscreen:!0});try{if(!C())return;const i=t.list.find(u=>u._id===s);if(!i){console.error("组件不存在");return}if(!i.name){console.error("组件名称不能为空");return}if(await x.confirm(n("comp.deleteConfirm",{name:i.name}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;if(_){const u=Xe(_)();await V.v1Team.teamcontrollerRemovemyteamcomp({compIds:[s]},{headers:d}).then(()=>{t.delCompListById(s),u.setTeamDetail({...u.teamDetail,compCount:u.teamDetail.compCount-1}),e.get(w.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(s)})}else await V.v1Comp.compcontrollerDeletemycomp({compId:s}).then(()=>{t.delCompListById(s),e.get(w.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(s)});X.success(n("message.success.delete")),window?.umami?.track(N.COMP_DELETE,{compId:s,compName:i.name,teamId:_||void 0})}finally{l.close()}}return{onDelete:r}}function Ze(C){const e=P(),t=A(w.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b();async function d(r){if(!t.isRemote)return;const s=J.service({lock:!0,text:n("comp.downloading")});try{if(await x.confirm(n("comp.downloadPathConfirm",{path:r.path}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const i=t.list.find(E=>E._id===e.value?.id);if(!i)return;const p=await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:r.path,compName:i.name??"",version:e.value?.version??""}),{isRepeat:u=!1}=p.data;if(u){if(await x.confirm(n("comp.downloadCoverConfirm",{name:i.name??""}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm"){s.close();return}await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:r.path,compName:i.name??"",isCover:!0,version:e.value?.version??""})}X.success(n("message.success.download")),window?.umami?.track(N.COMP_DOWNLOAD_SUCCESS,{compId:i._id,compName:i.name,savePath:r.path,version:e.value?.version,isCover:u}),t.updateCompListItemById(i._id,{totalDownloadCount:i.totalDownloadCount+1}),await _(i._id),C?.()}catch(l){window?.umami?.track(N.COMP_DOWNLOAD_FAILED,{compId:e.value?.id,error:String(l)})}finally{s.close()}}async function _(r){const s=y(r)(),l=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:[r]}),{compInfos:i=[]}=l.data,p=i.filter(u=>u.id===r);s.setLocalCompInfo(p)}return{currDownloadCompItem:e,affirmDownload:d}}const et=["src"],Tt=ce({__name:"index",props:{compType:{},iuid:{default:-1}},emits:["preview","previewLocal","update"],setup(C,{expose:e,emit:t}){const n=C,d=t,{t:_,locale:r}=b(),s=A(w.PROVIDE_KEY_COMP_LIST_STORE),l=j(),i=le(),p=Ue(!1,window.__GLOBAL_CONFIG__.subPort),u=We(!1,window.__GLOBAL_CONFIG__.subPort),E=Ve(),h=E.value,{instanceUid:g,messageListener:R,sendMessageToTargetIframe:D}=Ke(),{createIframeParams:de}=Ye(),{addListener:I}=R(),{openCompPathInVscode:ue,handlePath:fe}=me(),Q=be(),$=ae("iframe"),Z=ae("dialogVueFinder"),{onCollect:_e}=Je(),{onDelete:Ce}=Qe(),{currDownloadCompItem:Te,affirmDownload:ee}=Ze(()=>Z.value?.close()),z=P(0),te=P({}),Ee=(()=>{const o={topOrigin:window.location.origin,compType:n.compType,userId:i.userId??"",instanceUid:[g.value,n.iuid].filter(Boolean).join(",")??""},a=new URLSearchParams({params:de(o),isDark:h.toString()}).toString();return`${p}/${w.WEBSITE_PATH_CONTAINER}/${n.compType}/?${a}`})(),Ie=M(()=>z.value?{height:`${z.value+10}px`}:{});function H(o){try{const a=$.value?.contentWindow;if(a)return a[o]}catch(a){console.log("findIframeByCompId error",a.message)}return null}async function Le(o){if(!s.isLocal)return;const a=s.list.find(W=>W._id===o);if(!a)return;const c=k(o)(),{data:f}=await v.v1Comp.compcontrollerDep({compPath:a.path}),{thirdParty:T}=f;c.setDep(T);const L=T.map(W=>W.name),S=await v.v1Module.modulecontrollerPrebuild({deps:L}),{entryNameToFile:B={}}=S.data;c.setDepToFile(B)}async function he(o){const a=s.list.find(c=>c._id===o);if(a){const c=H(o);if(c&&s.isRemote){await se(a);const f=y(a._id)(),T=f.depEntryNameToFile[a.version],L=f.versionToFileAccessPath[a.version],S={item:a,depEntryNameToFile:T,versionToFileAccessPath:L};D(c,m.ITEM_INIT_SET,S,u)}}}function we(o){o.forEach(a=>{const c=H(a._id);c&&s.isRemote&&se(a).then(()=>{const f=y(a._id)(),T=f.depEntryNameToFile[a.version],L=f.versionToFileAccessPath[a.version],S={item:a,depEntryNameToFile:T,versionToFileAccessPath:L};D(c,m.ITEM_INIT_SET,S,u)})})}async function Se(o){const a=s.list.find(c=>c._id===o);if(a){const c=H(o);if(c){await Le(o);const f=k(o)(),{dep:T,depToFile:L}=f,S={item:a,dep:T,depToFile:L};D(c,m.ITEM_INIT_SET_LOCAL,S,u)}}}function U(o,a,c){const f=$.value?.contentWindow;return f?(D(f,o,a,c),!0):!1}function ve(o,a,c){const f=$.value?.contentWindow;if(!f)return;const T=f.length??0;for(let L=0;L<T;L++){const S=f[L];S&&D(S,o,a,c)}}function F(o,a,c,f){const T=f?.origin??p;I(o,()=>{const{stopWatch:L,triggerCallback:S}=ne(c,()=>{const B=f?.transform?f.transform(c.value):c.value;if(U(a,B,T)){f?.onAfterSend?.(B);return}L()});S()})}function De(o,a){if(a){const c=H(a);c&&o(c)}else o($.value?.contentWindow)}return F(m.LIST_INIT_GET,m.LIST_INIT,M(()=>s.list)),F(m.SETTING_DATA_GET,m.SETTING_DATA_SET,M(()=>l.deps)),F(m.ITEM_SITE_PATH_GET,m.ITEM_SITE_PATH_SET,M(()=>s.list),{transform:o=>o.map(a=>{const c=k(a._id)();return{compId:a._id,fullPath:fe(c.detail.fullPath,1)}})}),F(m.LOCALE_GET,m.LOCALE_SET,M(()=>r.value),{origin:u}),F(m.THEME_CHANGE_GET,m.THEME_CHANGE_SET,M(()=>E.value),{transform:o=>({isDark:o}),origin:p,onAfterSend:o=>ve(m.THEME_CHANGE_SET,o,u)}),I(m.ACTION_COLLECT,_e),I(m.ACTION_DOWNLOAD,async o=>{const{version:a}=o;Te.value=o,await x.confirm(_("comp.downloadVersionConfirm",{version:a}),_("common.info"),{confirmButtonText:_("common.confirm"),cancelButtonText:_("common.cancel"),type:"warning"}).catch(()=>{})==="confirm"&&Z.value?.open(ee)}),I(m.ACTION_PREVIEW,o=>{window?.umami?.track(N.COMP_PREVIEW,{compId:o}),d("preview",o)}),I(m.ACTION_PREVIEW_LOCAL,o=>{d("previewLocal",o)}),I(m.ACTION_UPDATE,o=>{window?.umami?.track(N.COMP_UPDATE,{compId:o}),d("update",o)}),I(m.UPDATE_IFRAME_HEIGHT,o=>{z.value=o}),I(m.ITEM_INIT_GET,o=>{he(o)}),I(m.ITEM_INIT_GET_LOCAL,o=>{Se(o)}),I(m.ACTION_DELETE,Ce),I(m.ITEM_VERSION_CHANGE,async o=>{const{compId:a,version:c}=o;window?.umami?.track(N.COMP_VERSION_CHANGE,{compId:a,version:c});const T=y(a)().detail[c];if(T){const{totalDownloadCount:tt,collectCount:ot,isCollect:at,...Oe}=T;s.updateCompListItemById(a,{...Oe,_id:a});return}const{data:L}=await V.v1Comp.compcontrollerCompdetail({compId:a,version:c}),{totalDownloadCount:S,collectCount:B,isCollect:W,...ge}=L;s.updateCompListItemById(a,{...ge,_id:a})}),I(m.ITEM_VERSION_LIST_GET,async o=>{let a=te.value[o];a||(a=(await V.v1Comp.compcontrollerVersions({compId:o})).data.rows??[],te.value[o]=a),U(m.ITEM_VERSION_LIST_SET,{compId:o,versionList:a},p)}),I(m.LOCAL_EXIST_GET,o=>{const a=y(o)(),{stopWatch:c,triggerCallback:f}=ne(M(()=>a.isLocalExist),T=>{U(m.LOCAL_EXIST_SET,{compId:T,exist:a.isLocalExist},p)||c()});f(o)}),I(m.ACTION_OPEN_VSCODE_LOCAL,o=>{const c=k(o)().detail.fullPath;ue(c,`./${w.COMP_CONFIG_FILENAME}`)}),I(m.OSS_FILE_SIGN_URL_GET,async({objectId:o})=>{let a=Q.getCacheUrl(o);a||(a=(await v.v1Oss.osscontrollerFilesignurl({objectId:o})).data.signUrl,Q.setCacheUrl(o,a)),U(m.OSS_FILE_SIGN_URL_SET,{objectId:o,signUrl:a},p)}),Pe(()=>s.list,(o,a)=>{const{modifiedItems:c}=Ge.findChangedArrayItems(o,a);we(c)},{deep:!0}),e({sendMessageToTargetIframeByCompId:De}),(o,a)=>(ie(),Ae("div",{style:Re(Ie.value),class:"min-h-[390px]"},[K(O(He),{isEmpty:O(s).isEmpty,loading:O(s).loading,class:"size-full"},{default:Y(()=>[G("iframe",{ref:"iframe",class:"size-full min-h-[390px]",src:O(Ee),frameborder:"0"},null,8,et)]),_:1},8,["isEmpty","loading"]),K(qe,{ref:"dialogVueFinder",onDownload:O(ee)},null,8,["onDownload"])],4))}});export{qe as _,Tt as a,Xe as b,Ct as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as w,J as C,u as L}from"./index-CdLdwW7r.js";import{c as O}from"./index-BYC9CuLh.js";import{aD as G}from"./vendor-ui-CGT0cG1n.js";import{v as b,aA as k,aF as M,aM as P,ab as W,l as D,i as h,ax as B,g as m}from"./vendor-core-BKehvho7.js";import{c as N,b as F,I as a,a as l,e as y}from"./useMessage-BVw3M4ej.js";const R={class:"size-full"},x=["src"],V=b({__name:"index",props:{compType:{},version:{},compAttrs:{},iuid:{},bgColor:{}},setup(f){const s=f,{locale:d}=k(),u=w(),T=C(),r=N(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:g,messageListener:E,sendMessageToTargetIframe:n}=y(),{addListener:i}=E(),{createIframeParams:I}=F(),S=G().value,c=M("iframe"),A=(()=>{const e={topOrigin:window.location.origin,userId:T.userId??"",instanceUid:[g.value,s.iuid].join(",")??"",compId:s.compAttrs?._id??"",isSfc:!0},t={params:I(e),isDark:S.toString()},o=new URLSearchParams(t).toString();return`${r}/${L.WEBSITE_PATH_ITEM}/${s.compType}?${o}`})();async function _(){const e=c.value?.contentWindow;if(e){const t=O(s.compAttrs?._id)(),o=t.depEntryNameToFile[s.version],p=t.versionToFileAccessPath[s.version],v={item:s.compAttrs,depEntryNameToFile:o,versionToFileAccessPath:p};n(e,a.ITEM_INIT_SET,v,r)}}return i(a.ITEM_INIT_GET,()=>{_()}),i(a.SETTING_DATA_GET,l(m(()=>u.deps),()=>{const e=c.value?.contentWindow;e&&n(e,a.SETTING_DATA_SET,u.deps,r)}).triggerCallback),i(a.LOCALE_GET,()=>{const{stopWatch:e,triggerCallback:t}=l(m(()=>d.value),()=>{const o=c.value?.contentWindow;o?n(o,a.LOCALE_SET,d.value,r):e()});t()}),i(a.BG_COLOR_GET,l(m(()=>s.bgColor??""),()=>{const e=c.value?.contentWindow;e&&n(e,a.BG_COLOR_SET,s.bgColor??"",r)}).triggerCallback),P([()=>s.version,()=>s.compAttrs],async([e,t])=>{e&&t&&_()}),(e,t)=>(W(),D("div",R,[h("iframe",{ref:"iframe",class:"size-full",src:B(A),frameborder:"0"},null,8,x)]))}});export{V as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as ee,D as te,W as oe,aH as ae,aJ as se,e as le,K as B,J as y}from"./vendor-ui-CGT0cG1n.js";import{u as m,b as ne,q as I,t as D,M as $,e as ce}from"./index-CdLdwW7r.js";import{C as re}from"./useCompEditStore-DI3vFtGm.js";import{c as ie}from"./index-BYC9CuLh.js";import{u as pe}from"./useTeamHeaders-DxHN7-t0.js";/* empty css */import{v as H,aB as me,ab as v,j as L,aO as f,l as A,F as de,ah as ue,ax as d,i as N,ap as b,r as x,aR as fe,q as Y,W as he,aA as Ce,H as ve,aP as _e,Z as ge,X as Pe,af as F,g as k,B as Ee,Y as Ue}from"./vendor-core-BKehvho7.js";import{u as ye}from"./useVscodeOpen-SZpyzVHG.js";import{_ as Ie}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import{v as Te}from"./v4-EwEgHOG0.js";const we={class:"flex items-center justify-between"},Oe=["title"],Me=H({__name:"index",props:he({options:{type:Array,default:()=>[]},placeholderText:{type:String,default:""},openInVscodeText:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const{openCompPathInVscode:T,handlePath:_}=ye(),c=me(u,"modelValue"),g=u;function w(r){const e=g.options.find(i=>i.fullPath===r);e&&T(e.fullPath,`./${m.COMP_CONFIG_FILENAME}`)}function P(r){c.value=r}return(r,e)=>{const i=te,h=ee,O=oe;return v(),L(O,{"model-value":c.value,placeholder:u.placeholderText,onChange:P},{default:f(()=>[(v(!0),A(de,null,ue(u.options,p=>(v(),L(h,{key:p.value,label:d(_)(p.fullPath),value:p.value},{default:f(()=>[N("div",we,[N("span",{title:p.fullPath},b(d(_)(p.fullPath)),9,Oe),x(i,{type:"primary",href:"javascript:void(0)",onClick:[e[0]||(e[0]=fe(()=>{},["stop"])),V=>w(p.fullPath)]},{default:f(()=>[Y(b(u.openInVscodeText),1)]),_:1},8,["onClick"])])]),_:2},1032,["label","value"]))),128))]),_:1},8,["model-value","placeholder"])}}}),Ne=H({__name:"index",emits:["updateSuccess"],setup(u,{expose:T,emit:_}){const{t:c}=Ce(),g=_,{headers:w,teamId:P}=pe(),r=ae(ne,!1),e=ve(m.PROVIDE_KEY_COMP_EDIT_STORE),i=F(!1),h=F(!0),O=k(()=>{const o=e.selectedFolder?.basename,t=e.compDetail?.name??"";return o?`${c("comp.compOnlineUpdate")}:${t}`:`${c("comp.compOfflineUpdate")}:${t}`}),p=k(()=>({title:O.value,fullscreen:r.value,top:"5vh",width:"70%"}));async function V(o){h.value=!0;try{const t=await I.v1Comp.compcontrollerLocalcompsbyids({compIds:[o]}),{compInfos:a}=t.data;if(a?.length){let s=a[0];if(a.length>1&&(s=await W(a),!s))return;e.setCompUpdateType(m.COMP_UPDATE_TYPE_ONLINE),i.value=!0,e.setSelectedFolder(s),await S(o,s.path)}else{if(await B.confirm(c("comp.compNotInLocal"),c("common.info"),{type:"warning"}).catch(()=>{})!=="confirm")return;e.setCompUpdateType(m.COMP_UPDATE_TYPE_OFFLINE),i.value=!0,await S(o)}}catch(t){console.error(t),y.error(t.message)}finally{h.value=!1}}async function W(o){const t=o.map(n=>({value:n.fullPathHash,label:n.fullPath,fullPath:n.fullPath})),a=F("");return await B({title:c("comp.selectUpdateFolder"),customClass:"select-message",message:()=>Ee(Me,{modelValue:a.value,"onUpdate:modelValue":n=>a.value=n,options:t,placeholderText:c("comp.selectUpdateFolder"),openInVscodeText:c("comp.openInVscode")}),beforeClose:(n,C,E)=>{if(n==="confirm"){if(!a.value){y.error(c("comp.selectUpdateFolder"));return}E()}else E()}}).catch(()=>{})!=="confirm"?void 0:o.find(n=>n.fullPathHash===a.value)}function M(){i.value=!1}function j(){e.$reset()}function z(o,t){const a=l=>{if(!l?.length||!o)return"";const n=Te(),C=ce.getPreviewUrl(o,l);return`${m.COMP_PREVIEW_PREFIX_LOCAL}/${C}?v=${n}`};return t.map(l=>({...l,activeTab:m.COMP_EDIT_TAB_TYPE_MINI,miniEntryUrl:a(l.miniPath),fullEntryUrl:a(l.fullPath)}))}function q(o,t){const a=new Map(o.map(({path:s,signedUrl:l})=>[s,l]));return t.map(s=>{const l=$.replaceBackslashWithSlash(s.miniPath.at(-1)??""),n=$.replaceBackslashWithSlash(s.fullPath?.at(-1)??"");return{...s,activeTab:m.COMP_EDIT_TAB_TYPE_MINI,miniEntryUrl:a.get(l)??"",fullEntryUrl:a.get(n)??""}})}async function S(o,t){e.setLoading(!0);const a=await D.v1Comp.compcontrollerCompdetail({compId:o}),{desc:s,previewConfigs:l,bgColor:n,dep:C,name:E,version:G}=a.data||{};if(e.setCompDetail(a.data),e.setOnlineCompDep(C),e.setCompBgColor(n??"#fff"),e.setExtraInfo({description:s,name:E}),e.setEditCompId(o),e.isOnlineUpdate&&t){const R=await D.v1Comp.compcontrollerComphash({compId:o}),U=await I.v1Comp.compcontrollerCompfilehash({compPath:t}),Z=await I.v1Comp.compcontrollerDep({compPath:t}),{thirdParty:Q}=Z.data;e.setCompDep(Q),e.setLocalCompHash(U.data.compHash),e.setRemoteCompHash(R.data.compHash),e.setPreviewCompList(z(t,l))}else{const U=ie(o)().versionToFileAccessPath[G]??[];e.setSignedUrls(U),e.setPreviewCompList(q(U,l)),e.setCompDep(C)}e.setLoading(!1)}function J({end:o}){const t=e.getCompSubmitParams();if(e.isOnlineUpdate)I.v1Comp.compcontrollerUpdate({compId:e.editCompId,...t,...P?{teamId:P}:{}}).then(()=>{y.success(c("message.success.update")),g("updateSuccess",e.editCompId),M()}).finally(()=>{o()});else if(e.isOfflineUpdate){const{name:a,desc:s,bgColor:l,previewConfigs:n}=t;D.v1Comp.compcontrollerUpdatebasicinfo({compId:e.editCompId,name:a,desc:s,bgColor:l,previewConfigs:n},{headers:w}).then(()=>{y.success(c("message.success.update")),g("updateSuccess",e.editCompId),M()}).finally(()=>{o()})}}async function K(){r.value=!r.value}async function X(){const o=e.editCompId,t=e.selectedFolder,a=e.compUpdateType;e.$reset(),await Ue(),e.setCompUpdateType(a),e.setSelectedFolder(t),S(o,t.path)}return T({open:V,close:M}),(o,t)=>{const a=le,s=se;return v(),L(d(Ie),Pe({modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),class:"comp-update-dialog"},p.value,{"destroy-on-close":"","show-close":"",onClose:j}),{footer:f(()=>[x(a,{onClick:K},{default:f(()=>[Y(b(d(r)?d(c)("common.exitFullscreen"):d(c)("common.fullscreen")),1)]),_:1})]),default:f(()=>[_e((v(),A("div",{class:ge(d(r)?"size-full":"h-[70vh]")},[x(re,{class:"h-full",onConfirmUpload:J,onReload:X})],2)),[[s,h.value]])]),_:1},16,["modelValue"])}}});export{Ne as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as c}from"./vendor-ui-CGT0cG1n.js";import{m as p,q as l}from"./index-CdLdwW7r.js";const{i18n:r}=p;function d(){function s(n,e){const o=c.service({lock:!0,text:r.global.t("comp.openingInEditor")});l.v1Comp.compcontrollerOpencomppathinvscode({folderPath:n,relativeFilePath:e}).finally(()=>{o.close()})}function i(n,e=2){const o=window.__GLOBAL_CONFIG__.sep,t=n.split(o);return t.length>e?`...${o}${t.slice(-e).join(o)}`:n}return{handlePath:i,openCompPathInVscode:s}}export{d as u};
|