comp-hub 0.42.7 → 0.42.8
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.js +81 -81
- package/dist/master.js +19 -19
- package/dist/website/container/assets/{index-BIcqvqGy.js → index-E15UfKFM.js} +8 -8
- package/dist/website/container/index.html +1 -1
- package/dist/website/item/assets/{index-DDuyXuC_.js → index-CwtVkGPL.js} +29 -29
- package/dist/website/item/index.html +1 -1
- package/dist/website/main/assets/{BaseBadge-Dwav8-_V.js → BaseBadge-BReHrAqs.js} +1 -1
- package/dist/website/main/assets/{CanvasAnimation.vue_vue_type_script_setup_true_lang-Br1ZlT-C.js → CanvasAnimation.vue_vue_type_script_setup_true_lang-T5vn0JFD.js} +1 -1
- package/dist/website/main/assets/{CodeMirrorEditor-Cqow8ROO-D5a3bJrn.js → CodeMirrorEditor-Cqow8ROO-DYjlZgX9.js} +3 -3
- package/dist/website/main/assets/{GithubCallback-DRfvlj0J.js → GithubCallback-UUNSnoh7.js} +1 -1
- package/dist/website/main/assets/{ReplyForm.vue_vue_type_script_setup_true_lang-DztoCP65.js → ReplyForm.vue_vue_type_script_setup_true_lang-CEqkWYsv.js} +1 -1
- package/dist/website/main/assets/{SiteLogo-BK2LmBdP.js → SiteLogo-Bpm2Ah9F.js} +1 -1
- package/dist/website/main/assets/{index-BIIfOsTM.js → index-4S2NYemE.js} +1 -1
- package/dist/website/main/assets/{index--Gl7kxRA.js → index-6zg8j_nT.js} +1 -1
- package/dist/website/main/assets/{index-72rReQ2I-DT4t3yv7.js → index-72rReQ2I-C_aIAupr.js} +1 -1
- package/dist/website/main/assets/{index-DShvoWo5.js → index-B1K6cAvN.js} +1 -1
- package/dist/website/main/assets/{index-CwoRYDBS.js → index-B2qulmRp.js} +1 -1
- package/dist/website/main/assets/{index-BGAAZcsT.js → index-B5rd6Qgm.js} +1 -1
- package/dist/website/main/assets/index-B6JeEo9g.js +1 -0
- package/dist/website/main/assets/{index-GF-tJPqO.js → index-B6Oo99Ej.js} +1 -1
- package/dist/website/main/assets/{index-CRerG_jj.js → index-BA02DjBI.js} +1 -1
- package/dist/website/main/assets/{index-CmDlT9OG.js → index-BD8DwKlG.js} +1 -1
- package/dist/website/main/assets/{index-DOR-FWWa.js → index-BF2ETnQh.js} +1 -1
- package/dist/website/main/assets/{index-BYr_uRik.js → index-BNwWVTCF.js} +1 -1
- package/dist/website/main/assets/{index-D2YpsmLA.js → index-BPdEkCOx.js} +1 -1
- package/dist/website/main/assets/{index-DKrCvuOe.js → index-BTmh_pkn.js} +1 -1
- package/dist/website/main/assets/{index-3thCh3qq.js → index-BWh3R1jI.js} +3 -3
- package/dist/website/main/assets/{index-CAhGpcw0.js → index-BX3Tl9jb.js} +1 -1
- package/dist/website/main/assets/index-By_sRNiP.js +1 -0
- package/dist/website/main/assets/{index-B4Denke_.js → index-C1zFaUVE.js} +1 -1
- package/dist/website/main/assets/index-CCJiyDal.js +1 -0
- package/dist/website/main/assets/{index-DCw86ogq.js → index-CMiBqyhH.js} +1 -1
- package/dist/website/main/assets/{index-ruR13HOB.js → index-CaoAcCMA.js} +2 -2
- package/dist/website/main/assets/index-CbOKlsZn.js +2 -0
- package/dist/website/main/assets/{index-BDXFoym_.js → index-CeiBBtdW.js} +1 -1
- package/dist/website/main/assets/{index-bwN_igRO.js → index-CtNrOkJr.js} +1 -1
- package/dist/website/main/assets/{index-B_R6um8d.js → index-CuCbuNEj.js} +1 -1
- package/dist/website/main/assets/{index-CGL710hV.js → index-D-25wqLa.js} +1 -1
- package/dist/website/main/assets/{index-4DalWgib.js → index-D-HOLV6Z.js} +1 -1
- package/dist/website/main/assets/{index-D76eWsZ1-_nyu7eQb.js → index-D76eWsZ1-a1NwqrGS.js} +1 -1
- package/dist/website/main/assets/{index-C1XabFrJ.js → index-DR4j8Ql1.js} +1 -1
- package/dist/website/main/assets/{index-C0QhLzHP.js → index-DRsSRfwD.js} +1 -1
- package/dist/website/main/assets/{index-CkHWSI2b.js → index-DS44gjNL.js} +1 -1
- package/dist/website/main/assets/index-D_NvG8ob.js +1 -0
- package/dist/website/main/assets/{index-B0gjb0CJ.js → index-Dblv7zZt.js} +1 -1
- package/dist/website/main/assets/index-Dcp6qLr1.js +1 -0
- package/dist/website/main/assets/{index-B_rFxdlu.js → index-DdIWt0oE.js} +1 -1
- package/dist/website/main/assets/{index-CKtWjh5B.js → index-DdqWCLvd.js} +1 -1
- package/dist/website/main/assets/{index-BZrH5MtZ.js → index-DgQa2ZqK.js} +3 -3
- package/dist/website/main/assets/index-DgrizPPB.js +50 -0
- package/dist/website/main/assets/{index-Dms7ZQ2h-CXFhQfmI.js → index-Dms7ZQ2h-DZe32-4Q.js} +1 -1
- package/dist/website/main/assets/{index-DqiFCfGx-BdEBAtzU.js → index-DqiFCfGx-Be_VzFT8.js} +1 -1
- package/dist/website/main/assets/{index-K6SUsq-d.js → index-DvFQxOj2.js} +1 -1
- package/dist/website/main/assets/{index-DxypSQ0K-wm4wOntm.js → index-DxypSQ0K-DZ74HfZS.js} +1 -1
- package/dist/website/main/assets/{index-DvXl2xci.js → index-Dy0c-ddP.js} +1 -1
- package/dist/website/main/assets/{index-C7kbImye.js → index-DyFpWAJM.js} +1 -1
- package/dist/website/main/assets/{index-DRLluzuR.js → index-RrkKKQjp.js} +1 -1
- package/dist/website/main/assets/{index-DFFxrR-b.js → index-S0EB9acK.js} +1 -1
- package/dist/website/main/assets/{index-T76vWLBU-C0PuuEJA.js → index-T76vWLBU-iHnxnk3E.js} +1 -1
- package/dist/website/main/assets/index-VpAGAhRh.js +1 -0
- package/dist/website/main/assets/{index-CQTH6cXs.js → index-VyPJ3PyN.js} +1 -1
- package/dist/website/main/assets/{index-DXwxbpG5.js → index-Zt46lwNk.js} +1 -1
- package/dist/website/main/assets/{index-F2VTlbBR.js → index-ex5YI_gC.js} +1 -1
- package/dist/website/main/assets/{index-fZBcgzqR-CRYn0SF1.js → index-fZBcgzqR-CqMOhDrG.js} +1 -1
- package/dist/website/main/assets/{index-mqeGrL6B-BF63ossB.js → index-mqeGrL6B-C5oP0065.js} +1 -1
- package/dist/website/main/assets/index-wd7ZswFD.js +1 -0
- package/dist/website/main/assets/index-z8BnmFXm.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-Ap8wTvsB.js +2 -0
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-CJ6uny7o.js → index.vue_vue_type_script_setup_true_lang-B05SHLQS.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-D1Yenn0_.js → index.vue_vue_type_script_setup_true_lang-BOkD4Vs3.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-DVDnFtUl.js → index.vue_vue_type_script_setup_true_lang-Bs4fbZK8.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-CsPwDCDo.js → index.vue_vue_type_script_setup_true_lang-ByHasmxS.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-Do3aUu26.js → index.vue_vue_type_script_setup_true_lang-Dsu1eY0B.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-CMD4VvG4.js → index.vue_vue_type_style_index_0_lang-66fUtqSq.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-C7Y8qEDg.js → index.vue_vue_type_style_index_0_lang-CUQ5yd-1.js} +1 -1
- package/dist/website/main/assets/{useCacheOssStore-BovkXuwo.js → useCacheOssStore-C6-kY3lP.js} +1 -1
- package/dist/website/main/assets/{useCompEditStore-C47KFq3s.js → useCompEditStore-B7__tBPJ.js} +3 -3
- package/dist/website/main/assets/{useKeyword-C0diQZGk.js → useKeyword-O-wdQuD_.js} +1 -1
- package/dist/website/main/assets/{useMessage-Dxhw28ry.js → useMessage-yR4W8KDP.js} +1 -1
- package/dist/website/main/assets/{useTeamHeaders-BuIG232Y.js → useTeamHeaders-BbJQSrjN.js} +1 -1
- package/dist/website/main/assets/{useUnreadStore-CmdbW-yt.js → useUnreadStore-COt1XJEP.js} +1 -1
- package/dist/website/main/assets/{useVscodeOpen-0AeELCuF.js → useVscodeOpen-CCvngYEV.js} +1 -1
- package/dist/website/main/index.html +1 -1
- package/package.json +1 -1
- package/dist/website/main/assets/index-APbKgJd9.js +0 -1
- package/dist/website/main/assets/index-BLCWm3Fn.js +0 -1
- package/dist/website/main/assets/index-BU8KZHUA.js +0 -1
- package/dist/website/main/assets/index-BiXGgf9p.js +0 -1
- package/dist/website/main/assets/index-BkWR9AZK.js +0 -50
- package/dist/website/main/assets/index-Cey7IuDj.js +0 -1
- package/dist/website/main/assets/index-Cp8ViCIR.js +0 -1
- package/dist/website/main/assets/index-DGc9WQeN.js +0 -2
- package/dist/website/main/assets/index-_FSb4t-p.js +0 -1
- package/dist/website/main/assets/index-sFKst8yj.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-C9gk_QQc.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as K,F as U,N as _,v as F,a8 as N}from"./vendor-ui-Cvgmewma.js";import{c as B,G as u,k as M,K as v,U as m,B as $,l as h}from"./index-BkWR9AZK.js";import{c as H,b as Q}from"./index.vue_vue_type_script_setup_true_lang-C9gk_QQc.js";import{z,ao as V,h as J,ax as W,au as Y,x as y,aq as j,a as d,m as o,e as f,n as X,$ as Z,Q as q,u as c,G as ee,H as te,W as g,P as T}from"./vendor-core-CNXB6kVe.js";import{u as ae}from"./useKeyword-C0diQZGk.js";import"./index-C7kbImye.js";import"./useCompMetaLocalStore-DUMtt_yz.js";import"./useCacheOssStore-BovkXuwo.js";import"./useVscodeOpen-0AeELCuF.js";import"./useTeamHeaders-BuIG232Y.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-BK7dbjCA.js";/* empty css *//* empty css */import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CNOUTt3S.js";import"./useMessage-Dxhw28ry.js";const oe={class:"size-full p-[10px] pr-0"},ye=z({__name:"index",setup(se){const{t:s}=V(),C=J()?.uid,S=W(),E=Y(),b=B(),r=H(S.path)();y(u.PROVIDE_KEY_COMP_LIST_STORE,r);const k=new Map;y(u.PROVIDE_KEY_CALLBACKS,k);const l=K(`${M}`,"XTTJ"),L=j("compIframeContainer"),w=d([]),p=d(!1);async function R(e){p.value=!0;const a=(await m.v1Comp.compcontrollerTags({keyword:e})).data?.rows??[];w.value=a.map(t=>({value:t,label:t})),p.value=!1}const A=o(()=>h.DEFAULT_TAG_GROUP.map(e=>({label:s(e.label),value:e.value}))),i=d({data:[],search:{column:[{prop:"keyword",component:f(U),label:o(()=>s("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:o(()=>s("comp.keywordPlaceholder")),fetchSuggestions:x,triggerOnFocus:!1,style:"width: 350px",fitInputWidth:!0}},{prop:"tag",component:f(_),label:o(()=>s("common.filter")),value:l.value,attributes:{options:A,style:"width: 200px",onChange:e=>{l.value=e,window?.umami?.track(v.FILTER_TAG,{tag:e,page:"share"})}}},{prop:"tags",component:f(_),label:o(()=>s("comp.tags")),value:[],autoQuery:!1,attributes:{multiple:!0,filterable:!0,remote:!0,clearable:!0,reserveKeyword:!1,defaultFirstOption:!0,placeholder:o(()=>s("comp.pleaseInputTags")),remoteMethod:R,loading:p,options:w,style:"width: 240px"}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:G}),O=o(()=>i.value?.search?.column[0]?.value??"");ae(O,L);function I(e){return e===h.DEFAULT_TAG_GROUP[0].value?JSON.stringify(b?.deps||[]):"[]"}function x(e,n){if(e.length<=1)return n([]);m.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compShare"}).then(a=>{const{keywords:t=[]}=a.data||{};n(t)})}async function G(e){r.renderList([]),await X(),r.setLoading(!0),e.keyword&&window?.umami?.track(v.SEARCH_COMPONENT,{keyword:e.keyword,tag:l.value,page:"share"});const n={...e,deps:I(l.value),tags:Array.isArray(e.tags)?e.tags.join(","):e.tags||""},a=await m.v1Comp.compcontrollerComps({...n}),{rows:t,total:D}=a.data??{};r.renderList(t??[]),i.value.pagination.total=D??0,i.value.data=t??[]}function P(e){E.push({path:`/preview/${e}`})}return Z(()=>{r.$reset()}),(e,n)=>{const a=N,t=F;return q((ee(),te("div",oe,[g(c($),{tableConfig:i.value},{table:T(()=>[g(a,{always:"",wrapClass:"pr-[10px]"},{default:T(()=>[g(Q,{ref:"compIframeContainer",iuid:c(C),compType:c(u).IFRAME_ROUTES.CONTAINER.SHARE,onPreview:P},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"])])),[[t,c(r).loading]])}}});export{ye as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as J,N as Re,ac as ke,a7 as Ee,ad as Me,a5 as H,g as $e,c as le,n as Pe,aa as se,S as Ae,a as Ve,ae as De,a8 as Oe}from"./vendor-ui-Cvgmewma.js";import{h as Ne,G as V,p as K,_ as Le,U as N,o as ve,g as Z,B as fe,i as X,a as Be,c as _e,C as He,j as Ye,K as me,T as Ue}from"./index-BkWR9AZK.js";import{_ as ze}from"./el-table-column-C2GQUl4R.js";/* empty css */import{z as B,ao as z,G as r,I as k,u as s,P as f,W as p,M as W,H as g,S as M,U as L,V as _,F as U,a7 as j,m as I,ar as Fe,f as re,as as je,a as b,d as Ge,J as h,aq as de,K as Ke,ax as ge,ac as ue,ad as pe,aa as ye,w as q,x as We,au as Je,k as qe,at as Xe,R as Qe,N as Ze}from"./vendor-core-CNXB6kVe.js";import{_ as et}from"./index.vue_vue_type_style_index_0_lang-CMD4VvG4.js";/* empty css */import{_ as tt}from"./index.vue_vue_type_script_setup_true_lang-D1Yenn0_.js";import{_ as at,a as ot}from"./index.vue_vue_type_script_setup_true_lang-C9gk_QQc.js";import{u as nt}from"./useTeamHeaders-BuIG232Y.js";import{C as lt,a as st,_ as rt}from"./index.vue_vue_type_script_setup_true_lang-CsPwDCDo.js";import{_ as he}from"./index.vue_vue_type_script_setup_true_lang-CJ6uny7o.js";import{_ as ct,c as it,a as mt}from"./ReplyForm.vue_vue_type_script_setup_true_lang-DztoCP65.js";import{_ as Ce}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BK7dbjCA.js";import{c as dt,p as ut}from"./index-C7kbImye.js";import{_ as pt}from"./index.vue_vue_type_script_setup_true_lang-Do3aUu26.js";import{_ as vt}from"./index3-BiHnTK1Z.js";import{_ as ft}from"./BaseSegmented.vue_vue_type_script_setup_true_lang-CcSntY2B.js";import"./vendor-xterm-mNFjEaKn.js";import"./useCompMetaLocalStore-DUMtt_yz.js";import"./useCacheOssStore-BovkXuwo.js";import"./useVscodeOpen-0AeELCuF.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CNOUTt3S.js";import"./useMessage-Dxhw28ry.js";/* empty css */import"./index-B_R6um8d.js";import"./index-KhSB9wFh.js";const _t=B({__name:"CompDepsTags",props:{compDeps:{},depsSetting:{}},setup(e){const{t:m}=z(),a=e,d=I(()=>{const c=new Map;return a.depsSetting?.forEach(o=>{c.set(o.name,o)}),c});function u(c,o){const l=o.match;try{switch(l){case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_AUTO:case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_ONLY_INSTALL:return!0;case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MAJOR_VERSION:{const i=K.parseVersion(c),n=K.parseVersion(o.version);return i.major===n.major}case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MINOR_VERSION:{const i=K.parseVersion(c),n=K.parseVersion(o.version);return i.major===n.major&&i.minor===n.minor}case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_EXACT_VERSION:{const i=K.parseVersion(c),n=K.parseVersion(o.version);return i.major===n.major&&i.minor===n.minor&&i.patch===n.patch}default:return!1}}catch(i){return console.warn(`Version parse failed: ${c} or ${o.version}`,i),!1}}function t(c){const o=d.value.get(c.name);return o?u(c.version,o):!1}function v(c){const o=d.value.get(c.name);if(!o||!u(c.version,o))return"";switch(o.match){case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_AUTO:return"bg-slate-400";case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_ONLY_INSTALL:return"bg-emerald-500";case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MAJOR_VERSION:return"bg-sky-500";case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MINOR_VERSION:return"bg-amber-500";case V.COMP_MATCH_TYPES.COMP_MATCH_TYPE_EXACT_VERSION:return"bg-red-500";default:return""}}return(c,o)=>(r(),k(s(Ne),{list:e.compDeps,getKey:l=>l.name,class:"flex items-center gap-1"},{display:f(({visibleList:l,overflow:i})=>[(r(!0),g(U,null,j(l,n=>(r(),k(s(J),{key:n.name,type:"info","disable-transitions":"",size:"small",class:W({"not-matched":!t(n)})},{default:f(()=>[v(n)?(r(),g("span",{key:0,class:W(["inline-block w-2 h-2 rounded-full mr-1",v(n)])},null,2)):M("",!0),L(" "+_(n.name)+" "+_(n.version),1)]),_:2},1032,["class"]))),128)),i>0?(r(),k(s(J),{key:0,type:"info",size:"small","disable-transitions":""},{default:f(()=>[L("+"+_(i)+" "+_(s(m)("common.more")),1)]),_:2},1024)):M("",!0)]),measure:f(({item:l})=>[p(s(J),{type:"info",size:"small","disable-transitions":"",class:W({"not-matched":!t(l)})},{default:f(()=>[v(l)?(r(),g("span",{key:0,class:W(["inline-block w-2 h-2 rounded-full mr-1",v(l)])},null,2)):M("",!0),L(" "+_(l.name)+" "+_(l.version),1)]),_:2},1032,["class"])]),_:1},8,["list","getKey"]))}}),gt=Le(_t,[["__scopeId","data-v-5e624223"]]),yt={class:"w-[100px]"},ht=B({__name:"index",props:je({id:{type:String,default:""},version:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const m=e,a=Fe(e,"modelValue"),d=b([]),u=b(!1);function t(o){a.value=o}async function v(){if(u.value)return;const o=await N.v1Comp.compcontrollerVersions({compId:m.id});u.value=!0,d.value=o.data.rows.map(l=>({value:l.version,label:l.version}))}function c(){d.value=[{value:m.version,label:m.version}],a.value=m.version}return re(()=>{c()}),(o,l)=>{const i=ke,n=Re;return r(),g("div",yt,[p(n,{"model-value":a.value,onChange:t,onVisibleChange:v},{default:f(()=>[(r(!0),g(U,null,j(d.value,y=>(r(),k(i,{key:y.value,label:y.label,value:y.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])}}}),Ct={class:"size-full flex flex-col gap-5"},xt={class:"p-2"},Tt={class:"flex flex-wrap gap-2"},It={class:"flex-1 border border-(--el-border-color-light) rounded-md overflow-hidden"},bt=B({__name:"index",props:{compId:{},getCompDetail:{type:Function}},setup(e){const m=e,a=b(),d=I(()=>ve.handleDepData(a.value?.dep??[])),u=(t,v)=>`npm install ${t}@${v}`;return Ge(async()=>{const t=await m.getCompDetail(m.compId);t&&(a.value=t)}),(t,v)=>{const c=J;return r(),g("div",Ct,[h("div",xt,[h("div",Tt,[(r(!0),g(U,null,j(d.value,o=>(r(),k(c,{key:o.name,type:"info","disable-transitions":!0},{default:f(()=>[p(s(ze),{class:"text-sm",text:u(o.name,o.version)},null,8,["text"])]),_:2},1024))),128))])]),h("div",It,[p(et)])])}}}),xe=B({__name:"index",props:{id:{type:String,default:""},name:{type:String,default:""},version:{type:String,default:""}},emits:["downloadSuccess"],setup(e,{emit:m}){const{t:a}=z(),d=e,u=m,t=de("dialogVueFinder"),v=de("dialogDownloadCoverRef");async function c(l){l()&&t.value?.open(o)}async function o(l){const i=Me.service({lock:!0,text:a("comp.downloading")});try{const n=await Z.comp.compcontrollerDownload({compId:d.id,savePath:l.path,compName:d.name,version:d.version}),{isRepeat:y=!1}=n.data;if(y){if(!await v.value.open({compId:d.id,savePath:l.path,compName:d.name}).catch(()=>!1)){i.close();return}await Z.comp.compcontrollerDownload({compId:d.id,savePath:l.path,compName:d.name,isCover:!0,version:d.version})}H.success(a("message.success.download")),u("downloadSuccess"),t.value?.close()}finally{i.close()}}return(l,i)=>{const n=Ee;return r(),g(U,null,[p(tt,null,{default:f(({isLogin:y})=>[Ke(l.$slots,"default",{downloadHandler:c,isLogin:y},()=>[p(n,{type:"primary",link:"",onClick:w=>c(y)},{default:f(()=>[L(_(s(a)("common.download")),1)]),_:1},8,["onClick"])])]),_:3}),p(at,{ref:"dialogVueFinder",onDownload:o},null,512),p(ot,{ref_key:"dialogDownloadCoverRef",ref:v},null,512)],64)}}}),wt={class:"h-[calc(100vh-160px)]"},St=B({__name:"index",props:{compName:{type:String,default:""}},setup(e){const{t:m}=z(),a=e,d=ge(),{compId:u}=d.params,t=b({data:[],column:[{prop:"prevVersion",label:I(()=>m("team.prevVersion")),align:"center"},{prop:"newVersion",label:I(()=>m("team.newVersion")),align:"center"},{prop:"upgradeDesc",label:I(()=>m("team.upgradeDesc")),align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{slot:"operation",prop:"operation",label:I(()=>m("common.operation")),align:"center"}],pagination:{total:0},fixedHeight:!1,fetchData:c}),v=I(()=>({id:u,name:a.compName}));async function c(o){if(!u)return;const l=await N.v1Comp.compcontrollerUpgraderecords({compId:u,...o}),{rows:i,total:n}=l.data||{};t.value.data=i||[],t.value.pagination.total=n||0}return(o,l)=>{const i=$e;return r(),g("div",wt,[p(s(fe),{tableConfig:t.value,border:"",stripe:""},{operation:f(({col:n})=>[p(i,ue(pe(n)),{default:f(({row:y})=>[p(xe,ue(pe({version:y.newVersion,...v.value})),null,16)]),_:1},16)]),_:1},8,["tableConfig"])])}}}),Rt={class:"border-b border-[var(--el-border-color-lighter)] pb-3"},kt={class:"flex items-center mb-2"},Et={class:"flex items-center gap-2"},Mt={class:"text-sm font-medium text-[var(--el-text-color-primary)]"},$t={class:"text-xs text-[var(--el-text-color-placeholder)]"},Pt={key:0,class:"ml-10 mb-2 text-xs text-[var(--el-color-primary)]"},At={class:"ml-10 text-sm break-words whitespace-pre-wrap",style:{color:"var(--el-text-color-primary)"}},Vt={key:2,class:"mt-3 ml-10 p-3 bg-[var(--el-fill-color-light)] rounded-md"},Dt=B({__name:"CommentItem",props:{comment:{},isReply:{type:Boolean,default:!1},parentAuthorName:{default:""},currentUserId:{default:""},isLoggedIn:{type:Boolean,default:!1},replies:{default:()=>[]},replyCount:{default:0},compId:{default:""},targetType:{default:X.TargetType.GLOBAL},teamId:{default:""}},emits:["deleted","replyDeleted","replyAdded","loadMoreReplies"],setup(e,{emit:m}){const{t:a}=z(),d=it(a),u=m,t=e,v=t.currentUserId&&String(t.comment.userId?._id)===String(t.currentUserId),c=b(!1),o=b(""),l=b(!1),i=b(!1),n=b([]),y=I(()=>i.value&&n.value.length?n.value:t.replies||[]);async function w(){try{const D=await N.v1Comment.commentcontrollerReplies({commentId:t.comment._id});n.value=D.data.rows||[],i.value=!0}catch{H.error(a("comment.loadError"))}}function x(D){i.value&&(n.value=n.value.filter(A=>A._id!==D)),u("replyDeleted",D)}async function S(){try{await Pe.confirm(a("comment.deleteConfirm"),a("comment.deleteTitle"),{confirmButtonText:a("common.delete"),cancelButtonText:a("common.cancel"),type:"warning"})}catch{return}try{await N.v1Comment.commentcontrollerDelete({commentId:t.comment._id}),H.success(a("comment.deleteSuccess")),u("deleted",t.comment._id)}catch{H.error(a("comment.deleteError"))}}async function G(){if(!(!o.value.trim()||l.value||!t.compId)){l.value=!0;try{const D=t.comment.rootId||t.comment._id,A=o.value.trim(),T=await N.v1Comment.commentcontrollerCreate({compId:t.compId,targetType:t.targetType,teamId:t.teamId||void 0,content:A,parentId:t.comment._id,rootId:D});H.success(a("comment.replySuccess")),o.value="",c.value=!1,u("replyAdded",{rootId:D,parentId:t.comment._id,reply:T.data})}catch{H.error(a("comment.replyError"))}finally{l.value=!1}}}return(D,A)=>{const T=J,$=le,C=ye("CommentItem",!0);return r(),g("div",Rt,[h("div",kt,[h("div",Et,[p(he,{size:32,src:e.comment.userId?.avatar,text:e.comment.userId?.nickname?.[0]||""},null,8,["src","text"]),h("span",Mt,_(e.comment.userId?.nickname||s(a)("comment.anonymous")),1),h("span",$t,_(s(d)(e.comment.createdAt)),1),s(v)?(r(),k(T,{key:0,size:"small",type:"primary",effect:"plain"},{default:f(()=>[L(_(s(a)("comment.self")),1)]),_:1})):M("",!0),!e.isReply&&!s(v)&&e.isLoggedIn?(r(),k($,{key:1,link:"",size:"small",type:"primary",onClick:A[0]||(A[0]=R=>c.value=!c.value)},{default:f(()=>[L(_(c.value?s(a)("comment.cancelReply"):s(a)("comment.reply")),1)]),_:1})):M("",!0),s(v)?(r(),k($,{key:2,link:"",size:"small",type:"danger",onClick:S},{default:f(()=>[L(_(s(a)("common.delete")),1)]),_:1})):M("",!0)])]),e.comment.parentId&&e.parentAuthorName?(r(),g("div",Pt,_(s(a)("comment.replyTo",{name:e.parentAuthorName})),1)):M("",!0),h("div",At,_(e.comment.content),1),c.value?(r(),k(ct,{key:1,modelValue:o.value,"onUpdate:modelValue":A[1]||(A[1]=R=>o.value=R),loading:l.value,placeholder:s(a)("comment.replyTo",{name:e.parentAuthorName||e.comment.userId?.nickname}),onSubmit:G,onCancel:A[2]||(A[2]=R=>c.value=!1)},null,8,["modelValue","loading","placeholder"])):M("",!0),!e.isReply&&(e.replies?.length||e.replyCount)?(r(),g("div",Vt,[(r(!0),g(U,null,j(y.value,R=>(r(),k(C,{key:R._id,comment:R,"is-reply":!0,"parent-author-name":e.comment.userId?.nickname,"current-user-id":e.currentUserId,onDeleted:x},null,8,["comment","parent-author-name","current-user-id"]))),128)),!i.value&&e.replyCount>y.value.length?(r(),g("div",{key:0,class:"mt-2 text-xs text-[var(--el-color-primary)] cursor-pointer hover:underline",onClick:w},_(s(a)("comment.viewAllReplies",{count:e.replyCount})),1)):M("",!0)])):M("",!0)])}}}),Ot={class:"inline-flex items-center gap-2"},Nt=["onClick","onMouseenter"],Lt={class:"flex items-center gap-1"},Bt={key:0,class:"text-sm font-semibold text-[var(--el-color-warning)] ml-1"},Ht={key:1,class:"text-xs text-[var(--el-text-color-secondary)]"},Yt=B({__name:"index",props:{avgRating:{default:0},ratingCount:{default:0},interactive:{type:Boolean,default:!1},myScore:{default:0},compId:{default:""},targetType:{default:X.TargetType.GLOBAL},teamId:{default:""}},emits:["rated"],setup(e,{emit:m}){const{t:a}=z(),d=m,u=e,t=b(u.myScore),v=b(0),c=b(!1),o=I(()=>Math.round(u.avgRating)),l=I(()=>u.avgRating>0),i=I(()=>!0);q(()=>u.myScore,y=>{t.value=y});async function n(y){if(!(c.value||!u.compId)){c.value=!0;try{y===t.value?(await N.v1Rating.ratingcontrollerRemove({compId:u.compId,targetType:u.targetType,teamId:u.teamId||void 0}),t.value=0,H.success(a("comment.ratingCancelSuccess")),d("rated",0)):(await N.v1Rating.ratingcontrollerSet({compId:u.compId,targetType:u.targetType,score:y,teamId:u.teamId||void 0}),t.value=y,H.success(a("comment.ratingSuccess")),d("rated",y))}catch{H.error(a("comment.ratingError"))}finally{c.value=!1}}}return(y,w)=>(r(),g("div",Ot,[e.interactive?(r(),g(U,{key:0},j(5,x=>h("span",{key:x,class:W(["star-interactive cursor-pointer text-2xl transition-all duration-150 select-none",x<=v.value||x<=t.value?"text-[var(--el-color-warning)]":"text-[var(--el-text-color-disabled)]"]),onClick:S=>n(x),onMouseenter:S=>v.value=x,onMouseleave:w[0]||(w[0]=S=>v.value=0)}," ★ ",42,Nt)),64)):(r(),g(U,{key:1},[h("div",Lt,[(r(),g(U,null,j(5,x=>h("span",{key:x,class:W(["star-display text-lg transition-colors duration-150",x<=o.value?"text-[var(--el-color-warning)]":"text-[var(--el-text-color-disabled)]"])}," ★ ",2)),64))]),l.value?(r(),g("span",Bt,_(e.avgRating>0?e.avgRating.toFixed(1):"-"),1)):M("",!0),i.value&&e.ratingCount>0?(r(),g("span",Ht," ("+_(e.ratingCount)+") ",1)):M("",!0)],64))]))}}),Ut={key:0,class:"text-center"},zt={class:"text-sm text-[var(--el-text-color-secondary)] mb-4"},Ft={key:1,class:"text-center py-4"},jt={class:"text-sm text-[var(--el-text-color-secondary)]"},Gt=B({__name:"index",props:{modelValue:{type:Boolean},compId:{},targetType:{default:X.TargetType.GLOBAL},teamId:{default:""}},emits:["update:modelValue"],setup(e,{emit:m}){const{t:a}=z(),d=e,u=m,t=b(d.modelValue),v=b(0),c=b(!1);q(()=>d.modelValue,async l=>{if(t.value=l,l){c.value=!1;try{const i=await N.v1Rating.ratingcontrollerMy({compId:d.compId,targetType:d.targetType,teamId:d.teamId||void 0});v.value=i.data?.score??0}catch{v.value=0}}}),q(t,l=>{l||u("update:modelValue",!1)});function o(l){c.value=!0}return(l,i)=>(r(),k(s(Ce),{modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=n=>t.value=n),title:s(a)("comment.rating"),width:"360px","align-center":""},{default:f(()=>[c.value?(r(),g("div",Ft,[h("p",jt,_(s(a)("comment.ratingThanks")),1)])):(r(),g("div",Ut,[h("p",zt,_(s(a)("comment.ratingDialogDesc")),1),p(Yt,{interactive:"","comp-id":e.compId,"target-type":e.targetType,"team-id":e.teamId||"","my-score":v.value,onRated:o},null,8,["comp-id","target-type","team-id","my-score"])]))]),_:1},8,["modelValue","title"]))}}),Kt={class:"comment-section"},Wt={class:"mb-6"},Jt={class:"flex gap-3"},qt={class:"flex-1"},Xt={class:"flex justify-between items-center mt-2"},Qt={key:0,class:"space-y-4"},Zt={class:"text-sm font-medium text-[var(--el-text-color-regular)]"},ea={key:1,class:"text-center py-10 text-sm text-[var(--el-text-color-placeholder)]"},ta=B({__name:"index",props:{compId:{},targetType:{default:X.TargetType.GLOBAL},teamId:{default:""}},setup(e){const{t:m}=z(),a=e,d=Be(),u=I(()=>d.userInfo?._id?.toString()||""),t=I(()=>d.userInfo?.avatar||""),v=I(()=>d.avatarStr||""),c=I(()=>!!d.userInfo?._id),o=b(""),l=b(!1),i=b(!1),n=b(!1);function y(){n.value=!0}const w=b({data:[],pagination:{total:0},fixedHeight:!1,fetchData:x});async function x($){const C=$.page??1,R=$.pageSize??10;try{const O=await N.v1Comment.commentcontrollerList({compId:a.compId,targetType:a.targetType,teamId:a.teamId||void 0,page:C,pageSize:R});w.value.data=O.data.rows||[],w.value.pagination.total=O.data.total||0,i.value=!0}catch{H.error(m("comment.loadError"))}}async function S(){if(!(!o.value.trim()||l.value)){l.value=!0;try{await N.v1Comment.commentcontrollerCreate({compId:a.compId,targetType:a.targetType,teamId:a.teamId||void 0,content:o.value.trim()}),H.success(m("comment.postSuccess")),o.value="",await x({page:1})}finally{l.value=!1}}}function G($){const C=w.value.data;w.value.data=C.filter(R=>R._id!==$),w.value.pagination.total=Math.max(0,(w.value.pagination.total??0)-1)}function D($){w.value.data.forEach(C=>{C.replies&&(C.replies=C.replies.filter(R=>R._id!==$),C.replyCount=Math.max(0,(C.replyCount||0)-1))})}function A($){const C=w.value.data.find(R=>R._id===$.rootId);C&&(C.replies||(C.replies=[]),C.replies=[$.reply,...C.replies].slice(0,3),C.replyCount=(C.replyCount||0)+1)}function T($){x({page:1})}return re(()=>{a.compId&&x({})}),($,C)=>{const R=le;return r(),g("div",Kt,[h("div",Wt,[h("div",Jt,[p(he,{size:36,src:t.value,text:v.value},null,8,["src","text"]),h("div",qt,[p(s(mt),{modelValue:o.value,"onUpdate:modelValue":C[0]||(C[0]=O=>o.value=O),rows:3,"show-word-limit":"",placeholder:c.value?s(m)("comment.writePlaceholder"):s(m)("comment.loginPlaceholder"),disabled:!c.value,onSubmit:S},null,8,["modelValue","placeholder","disabled"]),h("div",Xt,[p(R,{type:"primary",loading:l.value,disabled:!o.value.trim()||!c.value,onClick:S},{default:f(()=>[L(_(s(m)("comment.post")),1)]),_:1},8,["loading","disabled"]),p(R,{disabled:!c.value,onClick:y},{default:f(()=>[L(_(s(m)("comment.rating")),1)]),_:1},8,["disabled"])])])])]),p(Gt,{modelValue:n.value,"onUpdate:modelValue":C[1]||(C[1]=O=>n.value=O),"comp-id":e.compId,"target-type":e.targetType,"team-id":e.teamId||""},null,8,["modelValue","comp-id","target-type","team-id"]),p(s(fe),{"table-config":w.value,class:"flex-1 min-h-0","fixed-height":!1},{table:f(()=>[w.value.data.length?(r(),g("div",Qt,[h("div",Zt,_(s(m)("comment.allComments"))+" ("+_(w.value.pagination?.total||0)+")",1),(r(!0),g(U,null,j(w.value.data,O=>(r(),k(Dt,{key:O._id,comment:O,replies:O.replies,"reply-count":O.replyCount,"current-user-id":u.value,"is-logged-in":c.value,"comp-id":e.compId,"target-type":e.targetType,"team-id":e.teamId,onDeleted:G,onReplyDeleted:D,onReplyAdded:A,onLoadMoreReplies:T},null,8,["comment","replies","reply-count","current-user-id","is-logged-in","comp-id","target-type","team-id"]))),128))])):i.value?(r(),g("div",ea,_(s(m)("comment.empty")),1)):M("",!0)]),_:1},8,["table-config"])])}}}),aa={class:"h-[calc(100vh-160px)]"},oa=B({__name:"index",props:{compId:{},avgRating:{},ratingCount:{},myRatingScore:{}},emits:["rated"],setup(e){return(m,a)=>{const d=se;return r(),g("div",aa,[p(d,null,{default:f(()=>[e.compId?(r(),k(ta,{key:0,"comp-id":e.compId,"target-type":s(X).TargetType.GLOBAL},null,8,["comp-id","target-type"])):M("",!0)]),_:1})])}}}),na={class:"size-full"},la={key:0,class:"flex items-center"},sa={class:"text-xs text-gray-500 shrink-0"},ra={class:"flex gap-1"},ca={class:"flex items-center"},ia={class:"text-xs text-gray-500 shrink-0"},ma={class:"flex-1"},da={class:"text-xs ml-auto"},ua=B({__name:"index",props:{version:{type:String,default:""},compAttrs:{type:Object,default:()=>({})}},setup(e){const m=e,{t:a}=z(),d=_e(),u=I(()=>ve.handleDepData(m.compAttrs.dep??[]));return(t,v)=>{const c=se,o=J,l=Ae;return r(),k(s(vt),{class:"size-full flex-1 shrink-0 flex flex-col gap-1",bg:e.compAttrs?.bgColor},{default:f(({bg:i,updateColor:n})=>[p(c,{"body-class":"!p-0 !overflow-visible",class:"flex-1 relative z-10"},{default:f(()=>[h("div",na,[p(pt,{compAttrs:e.compAttrs,version:e.version,bgColor:i,compType:s(V).IFRAME_ROUTES.ITEM.PREVIEW_REMOTE},null,8,["compAttrs","version","bgColor","compType"])])]),_:2},1024),e.compAttrs?.tags?.length?(r(),g("div",la,[h("span",sa,_(s(a)("comp.tags"))+":",1),h("div",ra,[(r(!0),g(U,null,j(e.compAttrs.tags,y=>(r(),k(o,{key:y,size:"small","disable-transitions":!0},{default:f(()=>[L(_(y),1)]),_:2},1024))),128))])])):M("",!0),h("div",ca,[h("span",ia,_(s(a)("comp.dep"))+":",1),h("div",ma,[p(s(gt),{compDeps:u.value,depsSetting:s(d).deps},null,8,["compDeps","depsSetting"])]),h("span",da,[h("span",null,_(s(a)("comp.bgPanel"))+":",1),p(l,{teleported:!0,modelValue:i,clearable:"",onChange:n,onActiveChange:n},null,8,["modelValue","onChange","onActiveChange"])])])]),_:1},8,["bg"])}}}),pa={class:"size-full p-[10px] pr-0"},va={class:"h-[50vh]"},fa={class:"flex-1"},_a={class:"mt-2"},Fa=B({__name:"index",props:{isTeamPreview:{type:Boolean,default:!1}},setup(e){const{t:m}=z(),a=e,d=ge(),u=d.query[V.ROUTE_STATE_KEY_VERSION]!==void 0,{compId:t}=d.params,v=I(()=>[{label:m("common.doc"),value:"doc",component:rt,visible:()=>!0},{label:m("common.upgradeRecord"),value:"upgradeRecord",component:St,visible:()=>!0},{label:m("common.ratingReview"),value:"ratingReview",component:oa,visible:()=>!0}]),c=new Map;We(V.PROVIDE_KEY_CALLBACKS,c);const o=Je(),{teamId:l}=nt(),i=b(!1),n=Ve(He,v.value[0]?.value),y=_e(),w=Ye(),x=dt(t)(),S=b(x.latestVersion),G=b(!1),D=b(0);function A(P){D.value=P,t&&N.v1Comp.compcontrollerCompdetail({compId:t,version:S.value}).then(E=>{x.setDetail(S.value,{...E.data,_id:t})})}const T=I(()=>x.detail[S.value]),$=I(()=>T.value?.desc??""),C=I(()=>Object.keys(T.value??{}).length>0),R=I(()=>x.versionToFileAccessPath[S.value]??[]),O=I(()=>R.value.length?v.value.find(E=>E.value===n.value)?.component:void 0),Te=I(()=>n.value==="doc"?{mdSrc:Ie.value,compDesc:$.value,scrollContainer:".preview-container"}:n.value==="upgradeRecord"?{compName:T.value?.name||""}:n.value==="ratingReview"?{compId:t,avgRating:T.value?.avgRating,ratingCount:T.value?.ratingCount,myRatingScore:D.value}:{}),Ie=I(()=>R.value.find(P=>P.path.endsWith(`/${V.COMP_README_FILENAME}`))?.signedUrl??"");async function ce(){if(await y.initSetting(),!t)throw new Error("compId is required");const P=await N.v1Comp.compcontrollerCompdetail({compId:t,version:S.value}),{objectId:E,version:F,files:Q,dep:ee}=P.data,te={objectId:E,version:F,files:Q.map(ne=>ne.path)},ae=await Z.comp.compcontrollerCompfilesosssignedurl(te),Y=ut(ee,y.deps).map(ne=>ne.name),oe=await Z.module.modulecontrollerPrebuild({deps:Y}),{entryNameToFile:ie={}}=oe.data;x.setDepEntryNameToFile(F,ie),x.setVersionToFileAccessPath(F,ae.data.signedUrls),x.setDetail(F,{...P.data,_id:t}),S.value||(x.setLatestVersion(F),S.value=F)}function be(){return Promise.resolve(T.value)}function we(){a.isTeamPreview?w.addPayLoad(`/previewTeam/${l}/${t}`,{name:T.value?.name??""}):w.addPayLoad(`/preview/${t}`,{name:T.value?.name??""})}function Se(){window?.umami?.track(me.PREVIEW_OPEN_NEWTAB,{compId:t,version:S.value});const{href:P}=o.resolve({name:"previewBlank",params:{compId:t,version:S.value}});window.open(P,"_blank")}return q(S,async P=>{P!==T.value?.version&&await ce()}),q(n,(P,E)=>{E&&P!==E&&window?.umami?.track(me.PREVIEW_TAB_CHANGE,{compId:t,from:E,to:P})}),re(async()=>{(!C.value||u)&&await ce(),we(),G.value=!0}),(P,E)=>{const F=ye("Icon"),Q=le,ee=se,te=De,ae=Oe;return r(),g("div",pa,[p(ae,{"wrap-class":"preview-container relative",class:"size-full pr-[10px]"},{default:f(()=>[h("div",va,[G.value?(r(),k(s(lt),{key:0,title:T.value?.name,actions:["maximize"]},{beforeActions:f(()=>[p(s(st),{type:"primary",circle:"",title:s(m)("common.openInNewPage"),onClick:Se},{default:f(()=>[p(F,{icon:"material-symbols:screen-share-rounded"})]),_:1},8,["title"])]),default:f(()=>[p(ua,{compAttrs:T.value,version:S.value},null,8,["compAttrs","version"])]),_:1},8,["title"])):M("",!0)]),p(ee,{"body-class":"!p-0 flex items-center gap-1",class:"sticky top-0 mt-1 w-full z-10"},{default:f(()=>[h("div",fa,[p(s(ft),{modelValue:s(n),"onUpdate:modelValue":E[0]||(E[0]=Y=>qe(n)?n.value=Y:null),options:v.value},null,8,["modelValue","options"])]),p(Q,{color:"#414141",onClick:E[1]||(E[1]=Y=>i.value=!0)},{default:f(()=>[L(_(s(m)("common.terminal")),1)]),_:1}),p(ht,{id:T.value?._id,modelValue:S.value,"onUpdate:modelValue":E[2]||(E[2]=Y=>S.value=Y),version:T.value?.version},null,8,["id","modelValue","version"]),p(xe,{id:T.value?._id,name:T.value?.name,version:T.value?.version},{default:f(({downloadHandler:Y,isLogin:oe})=>[p(Q,{type:"primary",onClick:ie=>Y(oe)},{default:f(()=>[L(_(s(m)("common.download")),1)]),_:1},8,["onClick"])]),_:1},8,["id","name","version"])]),_:1}),h("div",_a,[p(s(Ue),null,{default:f(()=>[(r(),k(Xe,null,[(r(),k(Qe(O.value),Ze(Te.value,{onRated:A}),null,16))],1024))]),_:1})]),p(te,{right:100,bottom:100,target:".preview-container"})]),_:1}),p(s(Ce),{modelValue:i.value,"onUpdate:modelValue":E[3]||(E[3]=Y=>i.value=Y),title:s(m)("common.depInstall"),width:"70%",top:"5vh","destroy-on-close":""},{default:f(()=>[T.value?._id?(r(),k(bt,{key:0,class:"h-[70vh]",compId:T.value?._id,getCompDetail:be},null,8,["compId"])):M("",!0)]),_:1},8,["modelValue","title"])])}}});export{Fa as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C0QhLzHP.js","./vendor-ui-Cvgmewma.js","./vendor-core-CNXB6kVe.js","./index-BkWR9AZK.js","./index-CLT68CCM.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{m as ae,G as _,n as te,q as re,g as T,K,U as se}from"./index-BkWR9AZK.js";import{u as le,a8 as ne,af as ie,ag as ce,c as me,a as G,t as de,a9 as ue,w as pe,ad as _e,n as fe,a5 as z}from"./vendor-ui-Cvgmewma.js";/* empty css */import{u as he,a as ge,c as ve,C as ye,_ as xe}from"./useCompEditStore-C47KFq3s.js";import{z as q,ao as J,aa as B,G as g,I as P,P as n,W as i,J as e,V as f,u as r,M as k,S as H,H as F,F as be,a7 as Ce,U as j,a as A,l as Ee,m as Q,au as Se,ax as we,x as Te,aq as X,$ as ke,k as Pe,az as Re,n as Y}from"./vendor-core-CNXB6kVe.js";import{_ as Oe}from"./index.vue_vue_type_script_setup_true_lang-D1Yenn0_.js";import{l as Ie}from"./index-KhSB9wFh.js";import{_ as De}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BK7dbjCA.js";import{u as Ne}from"./useTeamHeaders-BuIG232Y.js";/* empty css *//* empty css */import"./index-C7kbImye.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CNOUTt3S.js";import"./v4-EwEgHOG0.js";import"./useMessage-Dxhw28ry.js";import"./index3-BiHnTK1Z.js";import"./useVscodeOpen-0AeELCuF.js";import"./BaseSegmented.vue_vue_type_script_setup_true_lang-CcSntY2B.js";import"./BaseBadge-Dwav8-_V.js";import"./LoadingWrapper.vue_vue_type_script_setup_true_lang-BYA4gUOI.js";/* empty css */const Ue={class:"flex items-center gap-2"},Ae={class:"text-sm font-semibold"},Fe={class:"px-1 pb-3"},Le={class:"text-sm leading-relaxed mb-1"},Me={class:"text-xs leading-relaxed mb-4 opacity-60"},$e={class:"flex flex-col gap-2"},Ve={class:"text-sm font-medium"},Ke={class:"text-sm font-medium"},ze={class:"flex items-center gap-2"},He={class:"text-sm font-semibold"},je={class:"px-1 pb-3"},Be={class:"text-[13px] leading-relaxed mb-3"},Ge={key:1,class:"text-red-500"},Xe={class:"flex items-center flex-wrap gap-1.5 pt-2 border-t border-gray-200 dark:border-gray-700"},Ye={class:"text-xs font-medium opacity-50"},qe={class:"flex justify-end items-center gap-2.5"},Je="dialog-upload-confirm",Qe=q({__name:"index",setup(W,{expose:L}){const{t}=J(),O=le(),y=A(!1),c=Ee({similarList:[],needRename:!1,editedName:"",folderName:""}),d=A(!0),a=A(["rename"]);let I=null,C=null;const{src:x}=he("COMP_REPEAT.md"),{text:D,errorMessage:v}=ge(x),M=Q(()=>O.value?"dark":"light");function $(E){return Object.assign(c,E),d.value=!0,a.value=E.needRename?["rename"]:E.similarList.length?["duplicate"]:[],y.value=!0,new Promise((u,b)=>{I=u,C=b})}function R(){C?.()}function N(){y.value=!1,C?.()}function U(){y.value=!1,I?.({shouldRename:d.value})}return L({open:$,close:N}),(E,u)=>{const b=B("Icon"),o=ce,s=B("router-link"),m=ie,h=ne,p=me;return g(),P(r(De),{modelValue:y.value,"onUpdate:modelValue":u[3]||(u[3]=l=>y.value=l),title:r(t)("comp.uploadConfirmTitle"),width:"1000px",top:"10vh",onClosed:R},{footer:n(()=>[e("div",qe,[i(p,{onClick:N},{default:n(()=>[j(f(r(t)("common.cancel")),1)]),_:1}),i(p,{type:"primary",onClick:U},{default:n(()=>[j(f(r(t)("common.confirm")),1)]),_:1})])]),default:n(()=>[i(h,{class:"!h-[70vh] pr-5"},{default:n(()=>[i(m,{modelValue:a.value,"onUpdate:modelValue":u[2]||(u[2]=l=>a.value=l),class:"!border-none"},{default:n(()=>[c.needRename?(g(),P(o,{key:0,name:"rename"},{title:n(()=>[e("div",Ue,[i(b,{icon:"material-symbols:drive-file-rename-outline-rounded",width:"18",height:"18"}),e("span",Ae,f(r(t)("comp.renameFolderTitle")),1)])]),default:n(()=>[e("div",Fe,[e("p",Le,f(r(t)("comp.renameFolderTip",{editedName:c.editedName,folderName:c.folderName})),1),e("p",Me,f(r(t)("comp.renameFolderQuestion")),1),e("div",$e,[e("label",{class:k(["flex items-center gap-3 px-3.5 py-3 rounded-lg border cursor-pointer transition-all duration-200",d.value?"border-[var(--el-color-primary)] bg-[var(--el-color-primary-light-9)] dark:bg-[var(--el-color-primary-light-3)]/15":"border-gray-200 dark:border-gray-700 hover:border-[var(--el-color-primary-light-5)]"]),onClick:u[0]||(u[0]=l=>d.value=!0)},[e("span",{class:k(["flex items-center justify-center w-5 h-5 rounded-full border-1.5 flex-shrink-0 transition-all duration-200",d.value?"border-[var(--el-color-primary)] bg-[var(--el-color-primary)]":"border-gray-300 dark:border-gray-600"])},[e("span",{class:k(["w-2 h-2 rounded-full bg-white transition-transform duration-200",d.value?"scale-100":"scale-0"])},null,2)],2),e("span",Ve,f(r(t)("comp.renameSyncYes")),1)],2),e("label",{class:k(["flex items-center gap-3 px-3.5 py-3 rounded-lg border cursor-pointer transition-all duration-200",d.value?"border-gray-200 dark:border-gray-700 hover:border-[var(--el-color-primary-light-5)]":"border-[var(--el-color-primary)] bg-[var(--el-color-primary-light-9)] dark:bg-[var(--el-color-primary-light-3)]/15"]),onClick:u[1]||(u[1]=l=>d.value=!1)},[e("span",{class:k(["flex items-center justify-center w-5 h-5 rounded-full border-1.5 flex-shrink-0 transition-all duration-200",d.value?"border-gray-300 dark:border-gray-600":"border-[var(--el-color-primary)] bg-[var(--el-color-primary)]"])},[e("span",{class:k(["w-2 h-2 rounded-full bg-white transition-transform duration-200",d.value?"scale-0":"scale-100"])},null,2)],2),e("span",Ke,f(r(t)("comp.renameSyncNo")),1)],2)])])]),_:1})):H("",!0),c.similarList.length?(g(),P(o,{key:1,name:"duplicate"},{title:n(()=>[e("div",ze,[i(b,{icon:"material-symbols:warning-rounded",width:"18",height:"18"}),e("span",He,f(r(t)("comp.similarFound")),1)])]),default:n(()=>[e("div",je,[e("div",Be,[r(D)?(g(),P(r(Ie),{key:0,id:Je,"model-value":r(D),theme:M.value,"no-mermaid":!0,"no-katex":!0,"no-echarts":!0},null,8,["model-value","theme"])):r(v)?(g(),F("div",Ge,f(r(v)),1)):H("",!0)]),e("div",Xe,[e("span",Ye,f(r(t)("comp.similar"))+":",1),(g(!0),F(be,null,Ce(c.similarList,l=>(g(),P(s,{key:l._id,to:`/similarPreview/${l._id}`,target:"_blank",class:"inline-flex items-center gap-0.5 text-xs font-medium no-underline text-[var(--el-color-primary)] bg-[var(--el-color-primary-light-9)] dark:bg-[var(--el-color-primary-light-3)]/15 hover:bg-[var(--el-color-primary-light-7)] dark:hover:bg-[var(--el-color-primary-light-3)]/25 px-2.5 py-1 rounded-full transition-colors duration-150"},{default:n(()=>[j(f(l.name)+" ",1),i(b,{icon:"material-symbols:open-in-new-rounded",width:"12",height:"12",class:"opacity-50"})]),_:2},1032,["to"]))),128))])])]),_:1})):H("",!0)]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["modelValue","title"])}}}),We={class:"size-full p-[10px]"},Ze={class:"overflow-hidden size-full"},eo={key:0,class:"cursor-not-allowed bg-gray-100 dark:bg-gray-800 absolute inset-0 flex items-center justify-center"},oo={class:"text-gray-500"},wo=q({__name:"index",setup(W){const L=Re(()=>re(()=>import("./index-C0QhLzHP.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),{t}=J(),O=Se(),y=we(),{teamId:c}=Ne(),d=G(ae,!1),a=ve(y.path,_.DIALOG_TYPE_ADD)();Te(_.PROVIDE_KEY_COMP_EDIT_STORE,a);const I=X("dialogPutTreaty"),C=X("dialogUploadConfirmRef"),x=G(te,330);x.value<=0&&(x.value=330);const D=A(""),v=Q(()=>a.selectedFolder?.path);async function M(o){const s=await T.comp.compcontrollerDir({compPath:o}),{tree:m,files:h}=s.data;a.setOriginalDirectory(m),a.setOriginalDirectoryList(h);const p=m?.children||[];if(p?.length){const l=p.find(oe=>oe.name===_.COMP_CONFIG_FILENAME);if(!l)return _.COMP_CHECK_STATUS_NOT_EXIST;const S=await T.comp.compcontrollerFile({filePath:l.path}),{content:w}=S.data,V=JSON.parse(w)[_.COMP_FIELD_COMP_ID];if(!V)return _.COMP_CHECK_STATUS_NOT_EXIST;const Z=await se.v1Comp.compcontrollerCheckcompexistbyid({compId:V}),{exist:ee}=Z.data;if(ee)return D.value=V,_.COMP_CHECK_STATUS_EXIST}return _.COMP_CHECK_STATUS_NOT_EXIST}const $=async(o,s)=>{if(s()){if(a.$reset(),!d.value){I.value?.open(m=>{m&&(d.value=!0,R(o))});return}R(o)}};async function R(o){const s=_e.service({fullscreen:!0}),m=await M(o.path);if(m===_.COMP_CHECK_STATUS_NOT_EXIST){const h=await T.comp.compcontrollerDep({compPath:o.path}),{thirdParty:p}=h.data;a.setSelectedFolder(o),Y(()=>{a.initPreviewCompList(),a.setCompDep(p),s.close()}),window?.umami?.track(K.UPLOAD_SELECT_FOLDER,{path:o.path})}else m===_.COMP_CHECK_STATUS_EXIST&&fe.confirm(t("comp.compAlreadyUploaded"),t("common.warning"),{confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),type:"warning"}).catch(()=>{}).finally(()=>{s.close()})}async function N(){const o=a.extraInfo.name;try{await T.comp.compcontrollerRenamedir({compPath:v.value,newName:o}),z.success(t("message.success.renameFolder"))}catch{z.warning(t("message.error.renameFolder"))}}async function U({shouldRename:o}){const s=a.getCompSubmitParams();await T.comp.compcontrollerSubmit({...s,...c?{teamId:c}:{}}),z.success(t("message.success.upload")),window?.umami?.track(K.UPLOAD_SUCCESS,{compPath:v.value,teamId:c}),o&&await N(),await u(),a.$reset()}async function E({end:o}){try{const s=await T.comp.compcontrollerCheckcomprepeat({compPath:v.value,...c?{teamId:c}:{}}),{similarList:m=[]}=s.data,h=a.extraInfo.name,p=a.selectedFolder.basename,l=!!(h&&h!==p);if(!(m.length>0)&&!l){await U({shouldRename:!1}),o();return}const w=await C.value.open({similarList:m,needRename:l,editedName:h,folderName:p}).catch(()=>null);if(w===null)return;await U({shouldRename:w.shouldRename})}catch(s){console.error("上传失败:",s),window?.umami?.track(K.UPLOAD_FAILED,{compPath:v.value,teamId:c,error:String(s)})}finally{o()}}async function u(){c?await O.push({name:"team",params:{teamId:c},query:{[_.ROUTE_STATE_KEY_VERSION]:Date.now()}}):await O.push({name:"mine",query:{[_.ROUTE_STATE_KEY_VERSION]:Date.now()}})}async function b(){const o=a.selectedFolder;a.$reset(),await Y(),R(o)}return ke(()=>{a.$reset()}),(o,s)=>{const m=de,h=B("Icon"),p=ue,l=pe;return g(),F("div",We,[i(l,null,{default:n(()=>[i(m,{size:r(x),"onUpdate:size":s[0]||(s[0]=S=>Pe(x)?x.value=S:null),collapsible:"",max:"30%"},{default:n(()=>[e("div",Ze,[i(Oe,null,{default:n(({isLogin:S})=>[i(r(L),{onSelect:w=>$(w,S)},null,8,["onSelect"])]),_:1})])]),_:1},8,["size"]),i(m,{class:"size-full rounded-sm relative !overflow-hidden"},{default:n(()=>[v.value?(g(),P(ye,{key:1,onConfirmUpload:E,onReload:b})):(g(),F("div",eo,[i(p,null,{image:n(()=>[e("div",null,[i(h,{icon:"material-symbols:folder-info"})])]),description:n(()=>[e("span",oo,f(r(t)("comp.pleaseSelectFolderFirst")),1)]),_:1})]))]),_:1})]),_:1}),i(xe,{ref:"dialogPutTreaty"},null,512),i(Qe,{ref_key:"dialogUploadConfirmRef",ref:C},null,512)])}}});export{wo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as I,a8 as R,F as S,N as x}from"./vendor-ui-Cvgmewma.js";import{G as l,B as A,U as u,K as P}from"./index-BkWR9AZK.js";import{c as K,b as M}from"./index.vue_vue_type_script_setup_true_lang-C9gk_QQc.js";import{z as N,ao as B,h as D,ax as F,au as Q,x as _,aq as U,$,Q as z,u as i,G,H,W as m,P as g,a as d,m as s,e as C,n as V}from"./vendor-core-CNXB6kVe.js";import{u as Y}from"./useKeyword-C0diQZGk.js";import"./index-C7kbImye.js";import"./useCompMetaLocalStore-DUMtt_yz.js";import"./useCacheOssStore-BovkXuwo.js";import"./useVscodeOpen-0AeELCuF.js";import"./useTeamHeaders-BuIG232Y.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-BK7dbjCA.js";/* empty css *//* empty css */import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CNOUTt3S.js";import"./useMessage-Dxhw28ry.js";const W={class:"size-full p-[10px] pr-0"},ue=N({__name:"index",setup(j){const{t:n}=B(),h=D()?.uid,y=F(),v=Q(),o=K(y.path)();_(l.PROVIDE_KEY_COMP_LIST_STORE,o);const f=new Map;_(l.PROVIDE_KEY_CALLBACKS,f);const E=U("compIframeContainer"),w=d([]),c=d(!1);async function L(e){c.value=!0;const a=(await u.v1Comp.compcontrollerTags({keyword:e})).data?.rows??[];w.value=a.map(t=>({value:t,label:t})),c.value=!1}const p=d({data:[],search:{column:[{prop:"keyword",component:C(S),label:s(()=>n("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:s(()=>n("comp.keywordPlaceholder")),fetchSuggestions:b,triggerOnFocus:!1,style:"width: 350px",fitInputWidth:!0}},{prop:"tags",component:C(x),label:s(()=>n("comp.tags")),value:[],autoQuery:!1,attributes:{multiple:!0,filterable:!0,remote:!0,clearable:!0,reserveKeyword:!1,defaultFirstOption:!0,placeholder:s(()=>n("comp.pleaseInputTags")),remoteMethod:L,loading:c,options:w,style:"width: 240px"}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:k}),T=s(()=>p.value?.search?.column[0]?.value??"");Y(T,E);function b(e,r){if(e.length<=1)return r([]);u.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compMyCollect"}).then(a=>{const{keywords:t=[]}=a.data||{};r(t)})}async function k(e){o.renderList([]),await V(),o.setLoading(!0),e.keyword&&window?.umami?.track(P.SEARCH_COMPONENT,{keyword:e.keyword,page:"collect"});const r=await u.v1Comp.compcontrollerCollectedcomps({...e,tags:Array.isArray(e.tags)?e.tags.join(","):e.tags||""}),{rows:a,total:t}=r.data??{};o.renderList(a??[]),p.value.pagination.total=t??0}function O(e){v.push({path:`/preview/${e}`})}return f.set(l.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT,e=>{o.delCompListById(e)}),$(()=>{o.$reset()}),(e,r)=>{const a=R,t=I;return z((G(),H("div",W,[m(i(A),{tableConfig:p.value},{table:g(()=>[m(a,{always:"",wrapClass:"pr-[10px]"},{default:g(()=>[m(M,{ref:"compIframeContainer",iuid:i(h),compType:i(l).IFRAME_ROUTES.CONTAINER.COLLECT,onPreview:O},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"])])),[[t,i(o).loading]])}}});export{ue as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as u,G as d,H as _,W as r,u as f,ax as L,x as P,f as g,P as w,a as M,m as p}from"./vendor-core-CNXB6kVe.js";import{c as T}from"./useCompMetaLocalStore-DUMtt_yz.js";import{G as v,g as n}from"./index-BkWR9AZK.js";import{_ as I}from"./index.vue_vue_type_script_setup_true_lang-DVDnFtUl.js";import{_ as R}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CNOUTt3S.js";import"./vendor-ui-Cvgmewma.js";import"./useVscodeOpen-0AeELCuF.js";import"./useMessage-Dxhw28ry.js";const $={class:"size-full"},b=u({__name:"index",props:{version:{},compAttrs:{}},setup(a){return(l,t)=>(d(),_("div",$,[r(I,{compAttrs:a.compAttrs,version:a.version,compType:f(v).IFRAME_ROUTES.ITEM.PREVIEW_LOCAL},null,8,["compAttrs","version","compType"])]))}}),k={class:"size-full"},H=u({__name:"index",setup(a){const l=L(),{compId:t}=l.params,e=T(t)(),h=new Map;P(v.PROVIDE_KEY_CALLBACKS,h);const o=M(!1),s=p(()=>e.detail),A=p(()=>Object.keys(s.value??{}).length>0);async function y(){if(!t)return;o.value=!0;const c=await n.comp.compcontrollerLocalcompdetailbypathhash({fullPathHash:t}),i=await n.comp.compcontrollerDep({compPath:c.data.path}),{thirdParty:m=[]}=i.data,E=m.map(C=>C.name),D=await n.module.modulecontrollerPrebuild({deps:E}),{entryNameToFile:x={}}=D.data;e.setDetail(c.data),e.setDep(m),e.setDepToFile(x),o.value=!1}return g(async()=>{await y()}),(c,i)=>(d(),_("div",k,[r(f(R),{isEmpty:!A.value,loading:o.value,class:"size-full"},{default:w(()=>[r(b,{compAttrs:s.value,version:s.value.version},null,8,["compAttrs","version"])]),_:1},8,["isEmpty","loading"])]))}});export{H as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C0QhLzHP.js","./vendor-ui-Cvgmewma.js","./vendor-core-CNXB6kVe.js","./index-BkWR9AZK.js","./index-CLT68CCM.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{z as Ce,ao as J,G as ie,I as ue,P as W,J as V,W as b,u as g,V as Z,az as Ae,a as R,aq as ce,aa as Re,S as Fe,U as Ie,l as ke,m as G,n as Ge,ap as Le,j as z,w as Ve,H as be,L as xe}from"./vendor-core-CNXB6kVe.js";import{p as fe,c as U}from"./index-C7kbImye.js";import{q as $e,G as I,g as N,U as q,f as Be,z as _e,c as le,a as ge,K,E as We}from"./index-BkWR9AZK.js";import{c as ee}from"./useCompMetaLocalStore-DUMtt_yz.js";import{a7 as Ue,c as He,n as we,ad as Te,a5 as he,u as je}from"./vendor-ui-Cvgmewma.js";import{u as Ke}from"./useCacheOssStore-BovkXuwo.js";import{u as De}from"./useVscodeOpen-0AeELCuF.js";import{_ as Ye,D as ze,a as qe,u as Je}from"./useTeamHeaders-BuIG232Y.js";import{_ as Se}from"./BaseDialog.vue_vue_type_script_setup_true_lang-BK7dbjCA.js";/* empty css */import{_ as Xe}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CNOUTt3S.js";import{d as Qe,u as Ze,a as et,e as tt,b as j,c as ot}from"./useMessage-Dxhw28ry.js";const at={class:"flex items-center"},nt={class:"h-[65vh]"},st=Ce({__name:"index",setup(T,{expose:e}){const{t}=J(),s=Ae(()=>$e(()=>import("./index-C0QhLzHP.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),{openCompPathInVscode:d,openCompPathInExplorer:i}=De(),{cwd:u}=window.__GLOBAL_CONFIG__,o=R(!1),c=R(null),m=R(u);function r(v){v==="editor"?d(m.value,"./package.json"):i(m.value,"./package.json")}const p=v=>{o.value=!0,c.value=v},f=()=>{o.value=!1,c.value=null},h=v=>{c.value&&c.value(v)};return e({open:p,close:f}),(v,D)=>(ie(),ue(g(Se),{modelValue:o.value,"onUpdate:modelValue":D[0]||(D[0]=H=>o.value=H),width:"50%","show-close":""},{header:W(()=>[V("div",at,[V("span",null,Z(g(t)("file.projectPath"))+":",1),b(g(Ye),{path:m.value,"link-class":"truncate",onCommand:r},null,8,["path"])])]),default:W(()=>[V("div",nt,[b(g(s),{onSelect:h})])]),_:1},8,["modelValue"]))}}),ct={class:"flex flex-col gap-3"},it={class:"flex items-center gap-2 text-sm"},lt={class:"flex justify-end items-center gap-2.5"},rt=Ce({__name:"index",setup(T,{expose:e}){const{t}=J(),{buildDiffTree:s}=qe(),d=R(!1),i=ke({compId:"",savePath:"",compName:""}),u=R(!1),o=ce("diffDialogRef"),c=R([]),m=R(""),r=R("");let p=null,f=[],h=new Map,v="";const D=G(()=>({version:t("comp.localVersionPrefix")+m.value})),H=G(()=>({version:t("comp.remoteVersionPrefix")+r.value}));let C=null,X=null;function re(O){return Object.assign(i,O),c.value=[],m.value="",r.value="",d.value=!0,new Promise((w,M)=>{C=w,X=M})}function me(){X?.()}function te(){d.value=!1,X?.()}function de(){d.value=!1,C?.(!0)}async function oe(){if(!u.value){u.value=!0;try{await Y(),c.value=ae(),await Ge(),o.value?.open()}finally{u.value=!1}}}async function pe(){await Y(),c.value=ae()}async function Y(){const{savePath:O,compId:w,compName:M}=i;v=O.replace(I.FILE_MANAGER_DIRNAME,"")+"/"+M;const[F,B]=await Promise.all([N.comp.compcontrollerDir({compPath:O}),q.v1Comp.compcontrollerCompdetail({compId:w})]);p=F.data.tree;const{files:x=[],objectId:Q,version:S}=B.data;f=x,r.value=S;const k=(p.children||[]).filter(E=>E.name===M&&E.type==="directory")[0];if(k){const E=(k.children||[]).find($=>$.name===I.COMP_CONFIG_FILENAME);if(E)try{const $=await N.comp.compcontrollerFile({filePath:E.path}),P=JSON.parse($.data.content);m.value=P.version||""}catch{}}if(h=new Map,x.length&&Q&&S)try{const $=(await N.comp.compcontrollerCompfilesosssignedurl({objectId:Q,version:S,files:x.map(P=>P.path)})).data.signedUrls||[];for(const P of $)h.set(Be.replaceBackslashWithSlash(P.path),P.signedUrl)}catch{}}function ae(){const{savePath:O,compName:w}=i;if(!p)return[];const{srcPath:M,sep:F}=window.__GLOBAL_CONFIG__,x=(O.replace(I.FILE_MANAGER_DIRNAME,"")+"/"+w).replaceAll("/",F),ne=(_e.mapTree(p,E=>(E.path=E.path.replace(`${M}${F}${x}`,""),E)).children||[]).filter(E=>E.name===w&&E.type==="directory")[0],k=f.length?_e.convertFlatToTree(f,{pathSeparator:"\\",createNode:(E,$,P)=>({name:$,path:P.startsWith("\\")?P:"\\"+P,type:E,children:[]})}):{children:[]};return s(ne?.children||[],k.children||[],E=>`${I.COMP_PREVIEW_PREFIX_LOCAL}/${v}${E}`,E=>h.get(E)||"")}return e({open:re,close:te}),(O,w)=>{const M=Re("Icon"),F=Ue,B=He;return ie(),ue(g(Se),{modelValue:d.value,"onUpdate:modelValue":w[0]||(w[0]=x=>d.value=x),title:g(t)("comp.downloadCoverTitle"),width:"500px",top:"40vh",onClosed:me},{footer:W(()=>[V("div",lt,[b(F,{type:"primary",underline:"never",loading:u.value,onClick:oe},{default:W(()=>[b(M,{icon:"material-symbols:difference",height:18}),V("span",null,Z(g(t)("comp.viewFileChanges")),1)]),_:1},8,["loading"]),w[1]||(w[1]=V("div",{class:"flex-1"},null,-1)),b(B,{onClick:te},{default:W(()=>[Ie(Z(g(t)("common.cancel")),1)]),_:1}),b(B,{type:"primary",onClick:de},{default:W(()=>[Ie(Z(g(t)("comp.coverConfirm")),1)]),_:1})])]),default:W(()=>[V("div",ct,[V("div",it,[b(M,{icon:"material-symbols:warning-rounded",width:"20",height:"20",class:"text-[var(--el-color-warning)]"}),V("span",null,Z(g(t)("comp.downloadCoverConfirm",{name:i.compName})),1)]),c.value.length?(ie(),ue(g(ze),{key:0,ref_key:"diffDialogRef",ref:o,resultTree:c.value,oldMeta:D.value,newMeta:H.value,onRefresh:pe},null,8,["resultTree","oldMeta","newMeta"])):Fe("",!0)])]),_:1},8,["modelValue","title"])}}}),Pt=(T,e)=>Le(`compListStore_${T}`,{state:()=>({scopeId:T,list:[],localList:[],loading:!1,listType:e??I.COMP_LIST_TYPE_REMOTE}),getters:{isEmpty:t=>t.list.length===0,isRemote:t=>t.listType===I.COMP_LIST_TYPE_REMOTE,isLocal:t=>t.listType===I.COMP_LIST_TYPE_LOCAL},actions:{setLocalList(t){this.$patch(s=>{s.localList=t})},setLoading(t){this.$patch(s=>{s.loading=t})},setList(t){this.$patch(s=>{s.list=t})},delCompListById(t){this.$patch(s=>{s.list=s.list.filter(d=>d._id!==t)})},updateCompListItemById(t,s){this.$patch(d=>{d.list=d.list.map(i=>{if(i._id===t){const u={...i,...s};return U(t)().setDetail(u.version,u),u}return i})})},async getListDeps(t){const s=le(),u=t.map(m=>m.dep).map(m=>fe(m,s.deps)).reduce((m,r)=>[...m,...r],[]).map(m=>m.name),o=await N.module.modulecontrollerPrebuild({deps:[...new Set(u)]}),{entryNameToFile:c={}}=o.data;return c},async initCompMetas(t){const s=le(),d=await N.comp.compcontrollerLocalcompsbyids({compIds:t.map(o=>o._id)}),{compInfos:i=[]}=d.data,u=await this.getListDeps(t);t.forEach(o=>{const m=fe(o.dep,s.deps).reduce((f,h)=>(u[h.name]&&(f[h.name]=u[h.name]),f),{}),r=U(o._id)();r.setLatestVersion(o.version),r.setDetail(o.version,o);const p=i.filter(f=>f.id===o._id);r.setLocalCompInfo(p),r.setDepEntryNameToFile(o.version,m)})},async initCompMetasLocal(t){t.forEach(s=>{ee(s._id)().setDetail(s)})},async renderList(t){t.length&&(this.isRemote?await this.initCompMetas(t):await this.initCompMetasLocal(t)),this.setList(t)}}});async function ve(T){const e=le();async function t(m){const{objectId:r,version:p,files:f}=m,h={objectId:r,version:p,files:f.map(H=>H.path)},v=await N.comp.compcontrollerCompfilesosssignedurl(h),{signedUrls:D}=v.data;return D}async function s(m){const{dep:r}=m,p=fe(r,e.deps).map(v=>v.name),f=await N.module.modulecontrollerPrebuild({deps:p}),{entryNameToFile:h={}}=f.data;return h}const{version:d,_id:i}=T,u=U(i)();let o=null,c=null;u.versionToFileAccessPath[d]||(o=await t(T),u.setVersionToFileAccessPath(d,o)),u.depEntryNameToFile[d]||(c=await s(T),u.setDepEntryNameToFile(d,c))}const ye=()=>{const T=ge();function e(){const t=T.isRealUserLogin();return t||T.logoutDialog(),t}return{isLogin:e}};function mt(){const{isLogin:T}=ye(),e=z(I.PROVIDE_KEY_CALLBACKS),t=z(I.PROVIDE_KEY_COMP_LIST_STORE),{t:s}=J();async function d(i){if(!T()||!t.isRemote)return;const{id:u,isCollect:o}=i,c=t.list.find(r=>r._id===u);if(!c||!o&&await we.confirm(s("comp.uncollectConfirm",{name:c.name}),s("comp.uncollect"),{confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const m=Te.service({fullscreen:!0});q.v1Comp.compcontrollerCollect({compId:c._id,isCollect:o}).then(()=>{he.success(c.isCollect?s("message.success.uncollect"):s("message.success.collect")),window?.umami?.track(K.COMP_COLLECT_TOGGLE,{compId:c._id,name:c.name,action:o?"collect":"uncollect"});const r={...c,isCollect:o};o?t.updateCompListItemById(c._id,{...r,collectCount:c.collectCount+1}):(t.updateCompListItemById(c._id,{...r,collectCount:c.collectCount-1}),e.get(I.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT)?.(c._id))}).finally(()=>{m.close()})}return{onCollect:d}}const dt=(T="")=>{if(!T)throw new Error("createTeamHomeStore scopeId is required");return Le(`teamHome_${T}`,{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 s={...t.selectedRowsToLeafNodeMap};e.forEach(d=>{delete s[d]}),t.selectedRowsToLeafNodeMap=s})},getSelectedGroupLeafNodes(e=""){return e?_e.getTreeAllChildren(this.menuGroup,e).filter(s=>s.children?.length===0).map(s=>s.id):[]}}})};function pt(){const{isLogin:T}=ye(),e=z(I.PROVIDE_KEY_CALLBACKS),t=z(I.PROVIDE_KEY_COMP_LIST_STORE),{t:s}=J(),{headers:d,teamId:i}=Je();async function u(o){const c=Te.service({fullscreen:!0});try{if(!T())return;const m=t.list.find(p=>p._id===o);if(!m){console.error("组件不存在");return}if(!m.name){console.error("组件名称不能为空");return}if(await we.confirm(s("comp.deleteConfirm",{name:m.name}),s("common.info"),{confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;if(i){const p=dt(i)();await q.v1Team.teamcontrollerRemovemyteamcomp({compIds:[o]},{headers:d}).then(()=>{t.delCompListById(o),p.setTeamDetail({...p.teamDetail,compCount:p.teamDetail.compCount-1}),e.get(I.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(o)})}else await q.v1Comp.compcontrollerDeletemycomp({compId:o}).then(()=>{t.delCompListById(o),e.get(I.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(o)});he.success(s("message.success.delete")),window?.umami?.track(K.COMP_DELETE,{compId:o,compName:m.name,teamId:i||void 0})}finally{c.close()}}return{onDelete:u}}function ut(T){const e=R(),t=z(I.PROVIDE_KEY_COMP_LIST_STORE),{t:s}=J();let d=null;function i(c){d=c}async function u(c){if(!t.isRemote)return;const m=Te.service({lock:!0,text:s("comp.downloading")});try{const r=t.list.find(v=>v._id===e.value?.id);if(!r)return;const p=await N.comp.compcontrollerDownload({compId:e.value?.id??"",savePath:c.path,compName:r.name??"",version:e.value?.version??""}),{isRepeat:f=!1}=p.data;let h=!1;if(f){if(!d){m.close();return}if(h=await d({compId:e.value?.id??"",savePath:c.path,compName:r.name??""}).catch(()=>!1),!h){m.close();return}await N.comp.compcontrollerDownload({compId:e.value?.id??"",savePath:c.path,compName:r.name??"",isCover:!0,version:e.value?.version??""})}he.success(s("message.success.download")),window?.umami?.track(K.COMP_DOWNLOAD_SUCCESS,{compId:r._id,compName:r.name,savePath:c.path,version:e.value?.version,isCover:h}),t.updateCompListItemById(r._id,{totalDownloadCount:r.totalDownloadCount+1}),await o(r._id),T?.()}catch(r){window?.umami?.track(K.COMP_DOWNLOAD_FAILED,{compId:e.value?.id,error:String(r)})}finally{m.close()}}async function o(c){const m=U(c)(),r=await N.comp.compcontrollerLocalcompsbyids({compIds:[c]}),{compInfos:p=[]}=r.data,f=p.filter(h=>h.id===c);m.setLocalCompInfo(f)}return{currDownloadCompItem:e,affirmDownload:u,registerCoverHandler:i}}const ft=["src"],Nt=Ce({__name:"index",props:{compType:{},iuid:{default:-1}},emits:["preview","previewLocal","update"],setup(T,{expose:e,emit:t}){const s=T,d=t,i=z(I.PROVIDE_KEY_COMP_LIST_STORE),{locale:u}=J(),{IFRAME_POST_MESSAGE_TYPE:o}=tt,c=le(),m=ge(),r=Ke(),p=Qe(!1,window.__GLOBAL_CONFIG__.subPort),f=Ze(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:h,messageListener:v,sendMessageToTargetIframe:D}=ot(),{createIframeParams:H}=et(),{addListener:C}=v(),{openCompPathInVscode:X,handlePath:re}=De(),{onCollect:me}=mt(),{onDelete:te}=pt(),{currDownloadCompItem:de,affirmDownload:oe,registerCoverHandler:pe}=ut(()=>w.value?.close()),Y=je(),ae=Y.value,O=ce("iframe"),w=ce("dialogVueFinder"),M=ce("dialogDownloadCoverRef");pe(a=>M.value.open(a));const F=R(0),B=R({}),x=G(()=>F.value?{height:`${F.value+10}px`}:{}),Q=(()=>{const a={topOrigin:window.location.origin,compType:s.compType,userId:m.userId??"",instanceUid:[h.value,s.iuid].filter(Boolean).join(",")??""},n=new URLSearchParams({params:H(a),isDark:ae.toString()}).toString();return`${p}/${I.WEBSITE_PATH_CONTAINER}/${s.compType}/?${n}`})();function S(a,n,l){const _=O.value?.contentWindow;return _?(D(_,a,n,l),!0):!1}function ne(a,n,l){const _=O.value?.contentWindow;if(!_)return;const L=_.length??0;for(let y=0;y<L;y++){const A=_[y];A&&D(A,a,n,l)}}function k(a){try{const n=O.value?.contentWindow;if(n)return n[a]}catch(n){console.log("findIframeByCompId error",n.message)}return null}function E(a,n){if(n){const l=k(n);l&&a(l)}else a(O.value?.contentWindow)}async function $(a){if(!i.isLocal)return;const n=i.list.find(se=>se._id===a);if(!n)return;const l=ee(a)(),{data:_}=await N.comp.compcontrollerDep({compPath:n.path}),{thirdParty:L}=_;l.setDep(L);const y=L.map(se=>se.name),A=await N.module.modulecontrollerPrebuild({deps:y}),{entryNameToFile:Ee={}}=A.data;l.setDepToFile(Ee)}async function P(a){const n=i.list.find(l=>l._id===a);if(n){const l=k(a);if(l&&i.isRemote){await ve(n);const _=U(n._id)(),L=_.depEntryNameToFile[n.version],y=_.versionToFileAccessPath[n.version],A={item:n,depEntryNameToFile:L,versionToFileAccessPath:y};D(l,o.ITEM_INIT_SET,A,f)}}}async function Oe(a){const n=i.list.find(l=>l._id===a);if(n){const l=k(a);if(l){await $(a);const _=ee(a)(),{dep:L,depToFile:y}=_,A={item:n,dep:L,depToFile:y};D(l,o.ITEM_INIT_SET_LOCAL,A,f)}}}function Me(a){a.forEach(n=>{const l=k(n._id);l&&i.isRemote&&ve(n).then(()=>{const _=U(n._id)(),L=_.depEntryNameToFile[n.version],y=_.versionToFileAccessPath[n.version],A={item:n,depEntryNameToFile:L,versionToFileAccessPath:y};D(l,o.ITEM_INIT_SET,A,f)})})}return C(o.LIST_INIT_GET,()=>{const{stopWatch:a,triggerCallback:n}=j(G(()=>i.list),()=>{S(o.LIST_INIT,i.list,p)||a()});n()}),C(o.SETTING_DATA_GET,()=>{const{stopWatch:a,triggerCallback:n}=j(G(()=>c.deps),()=>{S(o.SETTING_DATA_SET,c.deps,p)||a()});n()}),C(o.SETTING_DATA_LEAF_GET,a=>{const{stopWatch:n,triggerCallback:l}=j(G(()=>c.deps),()=>{const _=k(a);_?D(_,o.SETTING_DATA_LEAF_SET,c.deps,f):n()});l()}),C(o.ITEM_SITE_PATH_GET,()=>{const{stopWatch:a,triggerCallback:n}=j(G(()=>i.list),()=>{const l=i.list.map(_=>{const L=ee(_._id)();return{compId:_._id,fullPath:re(L.detail.fullPath,1)}});S(o.ITEM_SITE_PATH_SET,l,p)||a()});n()}),C(o.LOCALE_GET,()=>{const{stopWatch:a,triggerCallback:n}=j(G(()=>u.value),()=>{S(o.LOCALE_SET,u.value,f)||a()});n()}),C(o.THEME_CHANGE_GET,()=>{const{stopWatch:a,triggerCallback:n}=j(G(()=>Y.value),()=>{const l={isDark:Y.value};if(!S(o.THEME_CHANGE_SET,l,p)){a();return}ne(o.THEME_CHANGE_SET,l,f)});n()}),C(o.ACTION_COLLECT,me),C(o.ACTION_DELETE,te),C(o.ACTION_DOWNLOAD,async a=>{de.value=a,w.value?.open(oe)}),C(o.ACTION_PREVIEW,a=>{window?.umami?.track(K.COMP_PREVIEW,{compId:a}),d("preview",a)}),C(o.ACTION_PREVIEW_LOCAL,a=>{d("previewLocal",a)}),C(o.ACTION_UPDATE,a=>{window?.umami?.track(K.COMP_UPDATE,{compId:a}),d("update",a)}),C(o.UPDATE_IFRAME_HEIGHT,a=>{F.value=a}),C(o.ITEM_INIT_GET,a=>{P(a)}),C(o.ITEM_INIT_GET_LOCAL,a=>{Oe(a)}),C(o.ITEM_VERSION_CHANGE,async a=>{const{compId:n,version:l}=a;window?.umami?.track(K.COMP_VERSION_CHANGE,{compId:n,version:l});const L=U(n)().detail[l];if(L){const{totalDownloadCount:_t,collectCount:Ct,isCollect:Tt,...Ne}=L;i.updateCompListItemById(n,{...Ne,_id:n});return}const{data:y}=await q.v1Comp.compcontrollerCompdetail({compId:n,version:l}),{totalDownloadCount:A,collectCount:Ee,isCollect:se,...Pe}=y;i.updateCompListItemById(n,{...Pe,_id:n})}),C(o.ITEM_VERSION_LIST_GET,async a=>{let n=B.value[a];n||(n=(await q.v1Comp.compcontrollerVersions({compId:a})).data.rows??[],B.value[a]=n),S(o.ITEM_VERSION_LIST_SET,{compId:a,versionList:n},p)}),C(o.LOCAL_EXIST_GET,a=>{const n=U(a)(),{stopWatch:l,triggerCallback:_}=j(G(()=>n.isLocalExist),L=>{S(o.LOCAL_EXIST_SET,{compId:L,exist:n.isLocalExist},p)||l()});_(a)}),C(o.ACTION_OPEN_VSCODE_LOCAL,a=>{const l=ee(a)().detail.fullPath;X(l,`./${I.COMP_CONFIG_FILENAME}`)}),C(o.OSS_FILE_SIGN_URL_GET,async({objectId:a})=>{const n=await r.getOrFetchSignUrl(a);S(o.OSS_FILE_SIGN_URL_SET,{objectId:a,signUrl:n},p)}),C(o.LOADING_SET,a=>{i.setLoading(a)}),Ve(()=>i.list,(a,n)=>{if(a.length===0){i.setLoading(!1);return}const{modifiedItems:l}=We.findChangedArrayItems(a,n);Me(l)},{deep:!0}),e({sendMessageToTargetIframeByCompId:E}),(a,n)=>(ie(),be("div",{style:xe(x.value),class:"min-h-[390px]"},[b(g(Xe),{isEmpty:g(i).isEmpty,loading:g(i).loading,class:"size-full"},{default:W(()=>[V("iframe",{ref:"iframe",class:"size-full min-h-[390px]",src:g(Q),frameborder:"0"},null,8,ft)]),_:1},8,["isEmpty","loading"]),b(st,{ref:"dialogVueFinder",onDownload:g(oe)},null,8,["onDownload"]),b(rt,{ref_key:"dialogDownloadCoverRef",ref:M},null,512)],4))}});export{st as _,rt as a,Nt as b,Pt as c,dt as d};
|