comp-hub 0.1.22 → 0.1.33
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/bin/cli.cjs +10 -1
- package/dist/index.js +1 -1
- package/dist/website/dist/assets/{atom-one-dark-B2H-r86L.js → atom-one-dark-BwqwaUyO.js} +1 -1
- package/dist/website/dist/assets/index-2EaNUpcB.js +1 -0
- package/dist/website/dist/assets/index-B3Eo2cM5.css +1 -0
- package/dist/website/dist/assets/{index-XTZOLvZN.css → index-B61CIaPC.css} +1 -1
- package/dist/website/dist/assets/index-B7c-fEBH.js +1 -0
- package/dist/website/dist/assets/index-BNzVM320.js +1 -0
- package/dist/website/dist/assets/{index-BfqhDZ1z.js → index-BaIvuJ6m.js} +9 -9
- package/dist/website/dist/assets/index-CCeHDKXp.js +1 -0
- package/dist/website/dist/assets/index-COiFPcVH.js +1 -0
- package/dist/website/dist/assets/index-Cbk925c2.css +1 -0
- package/dist/website/dist/assets/index-CcI7tF3M.js +1 -0
- package/dist/website/dist/assets/index-ChPcVXrX.js +44 -0
- package/dist/website/dist/assets/index-CjOIQAwc.js +1 -0
- package/dist/website/dist/assets/index-CpShphGT.css +1 -0
- package/dist/website/dist/assets/{index-DNxTJC5Q.js → index-CylaEETe.js} +1 -1
- package/dist/website/dist/assets/index-D3Ir6GJ2.js +1 -0
- package/dist/website/dist/assets/index-DDgoj5iU.js +1 -0
- package/dist/website/dist/assets/index-DMFpYlel.js +1 -0
- package/dist/website/dist/assets/index-DTp0jdEu.js +1 -0
- package/dist/website/dist/assets/index-Dap8JQbU.js +2 -0
- package/dist/website/dist/assets/{index-B12IVxVV.css → index-DhLIGCDK.css} +1 -1
- package/dist/website/dist/assets/index-DnYe8-tu.js +1 -0
- package/dist/website/dist/assets/index-DsdcIYRt.js +1 -0
- package/dist/website/dist/assets/index-EkwR13Ku.css +1 -0
- package/dist/website/dist/assets/index-ElyUGQ1Q.js +1 -0
- package/dist/website/dist/assets/index-x7INBivR.js +1 -0
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-RtjuxFdx.js → index.vue_vue_type_script_setup_true_lang-BLnHXQn6.js} +1 -1
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-Bc1PXqOH.js +1 -0
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-CM4e2vlV.js +1 -0
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-CklfPaMl.js +1 -0
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-CtdhXfKs.js +1 -0
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-Deq2IwpY.js → index.vue_vue_type_script_setup_true_lang-hSvL-MZl.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-mjupg3Z_.js → index.vue_vue_type_script_setup_true_lang-nLMCZRFB.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-BMtIwDs3.js → index.vue_vue_type_script_setup_true_lang-uILIKD0X.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-CVT5yNeL.js → index.vue_vue_type_style_index_0_lang-CyH8SJ79.js} +12 -12
- package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-Dhu78hQ_.js → index.vue_vue_type_style_index_0_lang-D79LparT.js} +1 -1
- package/dist/website/dist/assets/index.vue_vue_type_style_index_0_lang-Do4LGQzJ.js +62 -0
- package/dist/website/dist/assets/{moment-DYVhN5eu.js → moment-DgND2ND5.js} +2 -2
- package/dist/website/dist/assets/useCompEditStore-CjQUgHl0.css +1 -0
- package/dist/website/dist/assets/useCompEditStore-DV_QyPzi.js +1 -0
- package/dist/website/dist/assets/{useTeamHeaders-22mJVwWy.js → useTeamHeaders-Ca3sFPFG.js} +1 -1
- package/dist/website/dist/assets/{v1Keyword-JxL-DecN.js → v1Keyword-MJXP7v9H.js} +1 -1
- package/dist/website/dist/assets/{v1Module-Clll6gmK.js → v1Module-Bqbebkss.js} +1 -1
- package/dist/website/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/website/dist/assets/index--3tjxLTJ.css +0 -1
- package/dist/website/dist/assets/index-4kzrJosw.js +0 -2
- package/dist/website/dist/assets/index-87m2Wftx.css +0 -1
- package/dist/website/dist/assets/index-B1R7DNzO.css +0 -1
- package/dist/website/dist/assets/index-BOnnhQqp.css +0 -1
- package/dist/website/dist/assets/index-Bg9J68nC.css +0 -1
- package/dist/website/dist/assets/index-BrnVzb3E.js +0 -1
- package/dist/website/dist/assets/index-BuFxFJw1.css +0 -1
- package/dist/website/dist/assets/index-CMr4JE7V.css +0 -1
- package/dist/website/dist/assets/index-CPx4gS-Z.js +0 -1
- package/dist/website/dist/assets/index-CUKBRQJT.js +0 -1
- package/dist/website/dist/assets/index-Cfid4FBF.js +0 -1
- package/dist/website/dist/assets/index-D8NW2qZW.js +0 -1
- package/dist/website/dist/assets/index-DDURCXIZ.js +0 -1
- package/dist/website/dist/assets/index-DS9olnsn.js +0 -1
- package/dist/website/dist/assets/index-DhTRF1Cu.js +0 -1
- package/dist/website/dist/assets/index-DuJUC7Nj.js +0 -1
- package/dist/website/dist/assets/index-J0Dg-l9h.js +0 -1
- package/dist/website/dist/assets/index-YOgOWiS9.js +0 -1
- package/dist/website/dist/assets/index-cHbH7T5D.js +0 -44
- package/dist/website/dist/assets/index-nDiFvJw_.js +0 -1
- package/dist/website/dist/assets/index-qsWrHMBc.js +0 -1
- package/dist/website/dist/assets/index-szn1X1M8.js +0 -1
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-C2jCrlom.js +0 -1
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-Cj1ig2OS.js +0 -1
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js +0 -1
- package/dist/website/dist/assets/index.vue_vue_type_script_setup_true_lang-s3TpsvnW.js +0 -1
- package/dist/website/dist/assets/index.vue_vue_type_style_index_0_lang-BVuL5ED4.js +0 -60
- package/dist/website/dist/assets/md5-CejJMKeR.js +0 -1
- package/dist/website/dist/assets/useCompEditStore-C3L6eIoz.js +0 -1
- package/dist/website/dist/assets/useCompEditStore-Dca_66Tn.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as E,aT as v,M as N,r as m,B as p,w as a,b as n,u as g,f as h,o as i,z as T,j as y,aU as R,k as S,x as A,aV as w,n as I,c as V,F as B,N as D,a as s,t as x,aW as $,a8 as O,E as k,aX as L,m as z,$ as U,a1 as P,a2 as F,a0 as Y}from"./index-ChPcVXrX.js";import{u as H,a as J,b as X}from"./v1Module-Bqbebkss.js";import{B as j}from"./index-D3Ir6GJ2.js";const M=E({__name:"RadioMatch",props:{modelValue:{type:String,default:v.MAJOR_VERSION},modelModifiers:{}},emits:["update:modelValue"],setup(b){const l=N(b,"modelValue");function c(d){l.value=String(d??"")}return(d,e)=>{const r=m("el-radio"),t=m("el-radio-group");return i(),p(t,{"model-value":l.value,onChange:c},{default:a(()=>[n(r,{value:g(v).ONLY_INSTALL},{default:a(()=>[...e[0]||(e[0]=[h("仅安装",-1)])]),_:1},8,["value"]),n(r,{value:g(v).MAJOR_VERSION},{default:a(()=>[...e[1]||(e[1]=[h("主版本",-1)])]),_:1},8,["value"]),n(r,{value:g(v).MINOR_VERSION},{default:a(()=>[...e[2]||(e[2]=[h("主次版本",-1)])]),_:1},8,["value"]),n(r,{value:g(v).EXACT_VERSION},{default:a(()=>[...e[3]||(e[3]=[h("完全一致",-1)])]),_:1},8,["value"])]),_:1},8,["model-value"])}}}),q={class:"size-full overflow-auto"},G={class:"border-b border-solid border-gray-300"},K={class:"flex"},W={class:"w-[100px]"},Q={class:"flex-1"},Z={class:"border-b border-solid border-gray-300"},ee={class:"flex"},ae={class:"w-[100px]"},te={class:"flex-1"},oe=E({__name:"index",setup(b){const l=T(),c=y(R,{dependencies:[],devDependencies:[]}),d=S([]),e=S([]);return A(async()=>{d.value=w(l.dependencies),e.value=w(l.devDependencies)}),I(()=>{d.value.length&&l.setDependencies(w(d.value)),e.value.length&&l.setDevDependencies(w(e.value)),c.value={dependencies:d.value.length?d.value:c.value.dependencies,devDependencies:e.value.length?e.value:c.value.devDependencies}}),(r,t)=>{const u=m("el-form-item"),_=m("el-card"),f=m("el-form");return i(),V("div",q,[n(f,{"label-position":"left","label-width":"auto"},{default:a(()=>[n(u,{label:"dependencies:"},{default:a(()=>[n(_,{class:"p-[10px] rounded-sm"},{default:a(()=>[(i(!0),V(B,null,D(d.value,o=>(i(),p(u,{key:o.name},{label:a(()=>[s("div",G,[s("span",null,x(o.name),1)])]),default:a(()=>[s("div",K,[s("span",W,x(o.version),1),s("div",Q,[n(M,{modelValue:o.match,"onUpdate:modelValue":C=>o.match=C},null,8,["modelValue","onUpdate:modelValue"])])])]),_:2},1024))),128))]),_:1})]),_:1}),n(u,{label:"devDependencies:"},{default:a(()=>[n(_,{class:"bg-[#f5f7fa] p-[10px] rounded-sm border border-[#ccc]"},{default:a(()=>[(i(!0),V(B,null,D(e.value,o=>(i(),p(u,{key:o.name},{label:a(()=>[s("div",Z,[s("span",null,x(o.name),1)])]),default:a(()=>[s("div",ee,[s("span",ae,x(o.version),1),s("div",te,[n(M,{modelValue:o.match,"onUpdate:modelValue":C=>o.match=C},null,8,["modelValue","onUpdate:modelValue"])])])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})])}}}),ne={class:"flex items-center"},le={class:"ml-2"},se=E({__name:"index",setup(b){const l=H(),c=S("");async function d(){try{if(!navigator.storage||!navigator.storage.estimate)throw new Error("浏览器不支持 storage.estimate API");const t=await navigator.storage.estimate();if(!t.usage||!t.quota)throw new Error("获取存储统计失败:返回数据不完整");return t}catch(t){return console.error("获取存储统计失败:",t.message),null}}function e(){O.confirm("将清空浏览器单文件编译结果以及模块预编译文件,确认清空缓存吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",beforeClose:async(t,u,_)=>{t==="confirm"&&(u.confirmButtonLoading=!0,await J(),await l.deleteDatabase(),u.confirmButtonLoading=!1,await r(),k.success("缓存已清空")),_()}}).catch(()=>{})}async function r(){const t=await d(),u=await X(),{size:_=0}=u.data??{},{usage:f=0}=t??{},o=(f+_)/(1024*1024);c.value=`${o.toFixed(2)} MB`}return $(async()=>{await r()}),(t,u)=>{const _=m("el-button"),f=m("el-form-item"),o=m("el-form");return i(),p(o,null,{default:a(()=>[n(f,{label:"缓存:"},{default:a(()=>[s("div",ne,[n(_,{onClick:e},{default:a(()=>[...u[0]||(u[0]=[h("清空缓存",-1)])]),_:1}),s("span",le,"已使用:"+x(c.value),1)])]),_:1})]),_:1})}}}),de={class:"size-full overflow-hidden flex flex-col rounded-sm"},re={class:"sticky top-0 w-full"},ue={class:"flex-1 overflow-auto overflow-x-hidden p-[10px]"},me=E({__name:"index",setup(b){const l=y(L,"previewRule"),c=[{label:"依赖设置",value:"previewRule",component:oe},{label:"其他设置",value:"otherSetting",component:se}],d=z(()=>c.find(r=>r.value===l.value)?.component||{render:()=>null});return(e,r)=>(i(),V("div",de,[s("div",re,[n(j,{modelValue:g(l),"onUpdate:modelValue":r[0]||(r[0]=t=>U(l)?l.value=t:null),options:c},null,8,["modelValue"])]),s("div",ue,[n(Y,null,{default:a(()=>[(i(),p(P,null,[(i(),p(F(d.value)))],1024))]),_:1})])]))}});export{me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-504f2312] .el-carousel__container{height:100%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as Q,K as ue,m as l,M as ie,ac as J,n as L,r as C,B as y,w as v,c as h,p as
|
|
1
|
+
import{d as Q,K as ue,m as l,M as ie,ac as J,n as L,r as C,B as y,w as v,c as h,p as K,o as s,F as P,N as x,a2 as G,Z as O,bz as B,b as N,f as H,u as Z,bA as re,b1 as fe,bt as ce,ao as de,i as q,aR as ge,k as z,bB as ve,y as W,bC as me,x as pe,W as be,X as ye,aH as b,a as he,ae as Ce,aM as Ne,v as Se}from"./index-ChPcVXrX.js";import{k as _e,l as ze}from"./index-BaIvuJ6m.js";const Oe=Q({__name:"index",props:ue({config:{}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const k=u,w=l(()=>{const o={};return k.config?.column?.forEach(e=>{o[e.prop]=e.value}),o}),n=ie(u,"modelValue"),S=J();async function T(){S?.onRefresh?.()}async function A(){k.config?.column?.forEach(o=>{o.value=""}),await de(),S?.onReset?.()}function m(o){return o??!0}function p(){S?.onSearch?.()}return L(()=>{n.value=w.value}),(o,e)=>{const i=C("el-form-item"),c=C("el-button"),M=C("el-form");return s(),y(M,{onSubmit:e[3]||(e[3]=ce(()=>{},["prevent"])),onKeyup:e[4]||(e[4]=fe(a=>p(),["enter"])),inline:!0},{default:v(()=>[(s(!0),h(P,null,x(u.config?.column||[],(a,U)=>(s(),y(i,{key:U,label:a.label},{default:v(()=>[m(a.useVModel)?(s(),y(G(a.type),O({key:1,modelValue:a.value,"onUpdate:modelValue":$=>a.value=$},{ref_for:!0},a?.attributes||{},B(a?.events||{})),null,16,["modelValue","onUpdate:modelValue"])):(s(),y(G(a.type),O({key:0,"model-value":a.value},{ref_for:!0},a?.attributes||{},B(a?.events||{})),null,16,["model-value"]))]),_:2},1032,["label"]))),128)),u.config?.column?.length?(s(),y(i,{key:0},{default:v(()=>[N(c,{type:"success",onClick:e[0]||(e[0]=a=>p())},{default:v(()=>[...e[5]||(e[5]=[H("查询",-1)])]),_:1}),N(c,{type:"primary",onClick:e[1]||(e[1]=a=>A())},{default:v(()=>[...e[6]||(e[6]=[H("重置",-1)])]),_:1}),N(c,{onClick:e[2]||(e[2]=a=>T()),icon:Z(re)},null,8,["icon"])]),_:1})):K("",!0)]),_:1})}}}),ke={key:0},Ve={ref:"tableContainer",class:"flex-1 overflow-hidden"},Ee={key:1,class:"mt-2"},Re=Q({__name:"index",props:{tableConfig:{}},setup(u,{expose:k}){const w=J(),n=u,S=q("tableContainer"),T=q("table"),{height:A}=ge(S),m=z(Number(ve()||10)),p=z(!1),o=z(1),e=z(ee()),i=z("UNKNOWN"),c=l(()=>n.tableConfig.size||""),M=l(()=>n.tableConfig?.fixedHeight??!0),a=l(()=>M.value?Math.max(A.value,100):"auto"),U=l(()=>n.tableConfig?.autoLoading??!0),$=l(()=>({"--pagination-location":n.tableConfig?.pagination?.location||"center"})),F=l(()=>n.tableConfig?.isPagination??!0),I=l(()=>n.tableConfig?.paginationMap?n.tableConfig.paginationMap:{page:"page",pageSize:"pageSize"}),j=l(()=>({[I.value.page]:o.value,[I.value.pageSize]:m.value})),Y=l(()=>({background:!0,pageSizes:[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",...n.tableConfig?.pagination?.attributes||{},total:n.tableConfig?.pagination?.total||0,pageSize:m.value,currentPage:o.value})),X=l(()=>({...j.value,...e.value})),D=l(()=>n.tableConfig?.search?.column.filter(t=>t.autoQuery??!0).map(t=>t.prop));function ee(){const t={};return n.tableConfig?.search?.column?.forEach(g=>{t[g.prop]=g.value}),t}async function d(){i.value!=="NOT_CHANGE"&&(U.value&&(p.value=!0),n.tableConfig?.fetchData?.(X.value)?.finally(()=>{i.value="NOT_CHANGE",p.value=!1}))}async function te(){await d()}async function ae(){i.value="UNKNOWN",await d()}async function ne(){o.value=1,i.value!=="AUTO_QUERY"&&await d()}async function oe(t){o.value=1,m.value=t}async function le(t){o.value=t}function se(){i.value="UNKNOWN",d()}return W(()=>JSON.stringify(e.value),(t,g)=>{i.value="UNKNOWN";const _=JSON.parse(t??"{}"),V=JSON.parse(g??"{}"),E=Object.keys(_),R=Object.keys(V);let r=[];E.length===R.length?r=Object.keys(_).filter(f=>_[f]!==V[f]):r=_e(E,R),D.value?.length&&ze(r,[...D.value])&&(i.value="AUTO_QUERY",d())}),W(()=>JSON.stringify(j.value),()=>{i.value="UNKNOWN",d()}),L(()=>{me(m.value.toString())}),pe(()=>{d()}),k({getTableRef:()=>T.value,forceRefreshData:se}),(t,g)=>{const _=C("el-table-column"),V=C("el-table"),E=C("el-pagination"),R=be("loading");return ye((s(),h("div",{class:"size-full flex flex-col overflow-hidden",style:Ce($.value)},[u.tableConfig.search?(s(),h("div",ke,[b(t.$slots,"search",{},()=>[N(Oe,{modelValue:e.value,"onUpdate:modelValue":g[0]||(g[0]=r=>e.value=r),config:u.tableConfig.search,size:c.value,onSearch:te,onRefresh:ae,onReset:ne},null,8,["modelValue","config","size"])],!0)])):K("",!0),b(t.$slots,"tableBefore",{},void 0,!0),he("div",Ve,[b(t.$slots,"table",{},()=>[N(V,O({ref:"table",data:u.tableConfig.data,height:a.value,size:c.value},Z(w)),Ne({default:v(()=>[(s(!0),h(P,null,x(u.tableConfig.column,(r,f)=>(s(),h(P,null,[r.slot?b(t.$slots,r.slot,{key:0,col:r,index:f},void 0,!0):(s(),y(_,O({key:`default-${f}`},{ref_for:!0},r),null,16))],64))),256))]),_:2},[x(t.$slots,(r,f)=>({name:f,fn:v(()=>[b(t.$slots,f,{},void 0,!0)])}))]),1040,["data","height","size"])],!0)],512),F.value?(s(),h("div",Ee,[b(t.$slots,"pagination",{},()=>[N(E,O({size:c.value},Y.value,{onSizeChange:oe,onCurrentChange:le},B(u.tableConfig?.pagination?.events||{})),null,16,["size"])],!0)])):K("",!0)],4)),[[R,p.value]])}}}),Ae=Se(Re,[["__scopeId","data-v-e6922157"]]);export{Ae as B};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as c,M as i,ac as p,av as _,r as f,c as v,b as V,Z as g,u as a,aM as x,N as B,w as M,aH as P,O as S,P as C,o as b,v as h}from"./index-ChPcVXrX.js";const k={class:"base-segmented"},w=c({inheritAttrs:!1,__name:"index",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=i(r,"modelValue"),l=p(),n=_();return(d,s)=>{const m=f("el-segmented");return b(),v("div",k,[V(m,g({modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=t=>e.value=t)},a(l)),x({_:2},[B(a(n),(t,o)=>({name:o,fn:M(u=>[P(d.$slots,o,S(C(u)),void 0,!0)])}))]),1040,["modelValue"])])}}}),N=h(w,[["__scopeId","data-v-d50f4856"]]);export{N as B};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as q,i as G,j as H}from"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";import{c as K,C as J}from"./useCompEditStore-DV_QyPzi.js";import{d as U,k as g,r as m,B as R,w as a,a as i,b as s,ah as A,o as E,c as I,F as Q,N as W,t as Z,f as O,ai as ee,g as te,G as oe,j as se,aj as ae,i as N,m as ne,D as le,u as re,ak as ie,a7 as ce,af as de,al as ue,a8 as pe,am as me,an as V,E as j,R as z,ao as fe,ap as _e,aq as ve,a4 as xe,a5 as ye}from"./index-ChPcVXrX.js";import{_ as B}from"./index.vue_vue_type_style_index_0_lang-Do4LGQzJ.js";import{u as ge}from"./useTeamHeaders-Ca3sFPFG.js";import"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";import"./index-BaIvuJ6m.js";import"./v1Module-Bqbebkss.js";import"./index-D3Ir6GJ2.js";import"./atom-one-dark-BwqwaUyO.js";const Ee={class:"h-[70vh] overflow-hidden flex flex-col"},Te={class:"flex justify-end"},he=U({__name:"index",setup(F,{expose:T}){const f="/dist/",n=g(!1),x=g(`${f}/md/PUT_TREATY.md`);let t;function b(v){n.value=!0,t=v}function y(){n.value=!1}function _(v){t?.(v),y()}return T({open:b,close:y}),(v,o)=>{const r=m("el-scrollbar"),h=m("el-button");return E(),R(A,{modelValue:n.value,"onUpdate:modelValue":o[2]||(o[2]=c=>n.value=c),title:"",width:"55%","show-close":"",top:"10vh"},{default:a(()=>[i("div",Ee,[s(r,{class:"flex-1 flex justify-center"},{default:a(()=>[s(B,{src:x.value},null,8,["src"])]),_:1}),i("div",Te,[s(h,{onClick:o[0]||(o[0]=c=>_(!1))},{default:a(()=>[...o[3]||(o[3]=[i("span",{class:"text-lg"},"拒绝",-1)])]),_:1}),s(h,{onClick:o[1]||(o[1]=c=>_(!0)),type:"primary"},{default:a(()=>[...o[4]||(o[4]=[i("span",{class:"text-[#fff] text-lg"},"同意",-1)])]),_:1})])])]),_:1},8,["modelValue"])}}}),Ce={class:"flex flex-col items-center"},be={class:"flex-1 overflow-hidden"},we={class:"text-center"},ke={class:"text-blue-600 hover:text-blue-800 hover:underline cursor-pointer transition-colors"},Re={class:"flex justify-end gap-[10px]"},Se=U({__name:"index",setup(F,{expose:T}){const f=g(!1),n=g([]);let x;const b=g("/dist//md/COMP_REPEAT.md");function y(o,r){n.value=o,f.value=!0,x=r}function _(){f.value=!1}function v(o){o.start(),x?.({end:o.end})}return T({open:y,close:_}),(o,r)=>{const h=m("router-link"),c=m("el-button");return E(),R(A,{title:"",modelValue:f.value,"onUpdate:modelValue":r[0]||(r[0]=u=>f.value=u),width:"660px"},{footer:a(()=>[i("div",Re,[s(c,{onClick:_},{default:a(()=>[...r[2]||(r[2]=[O("取消",-1)])]),_:1}),s(ee,null,{default:a(({instance:u,loading:S})=>[s(c,{loading:S,type:"primary",onClick:$=>v(u)},{default:a(()=>[...r[3]||(r[3]=[O("仍然上传",-1)])]),_:1},8,["loading","onClick"])]),_:1})])]),default:a(()=>[i("div",Ce,[i("div",be,[s(B,{src:b.value},null,8,["src"])]),i("div",we,[r[1]||(r[1]=i("span",null,"相似组件:",-1)),(E(!0),I(Q,null,W(n.value,u=>(E(),R(h,{class:"inline-block ml-[5px] mr-[5px]",key:u._id,to:`/similarPreview/${u._id}`,target:"_blank"},{default:a(()=>[i("span",ke,Z(u.name),1)]),_:2},1032,["to"]))),128))])])]),_:1},8,["modelValue"])}}}),$e={class:"size-full"},Pe={class:"overflow-hidden size-full"},De={key:0,class:"cursor-not-allowed bg-gray-100 dark:bg-gray-800 absolute inset-0 flex items-center justify-center"},Ie={class:"px-2 flex flex-1 items-center"},Me=U({__name:"index",setup(F){const T=te(),f=oe(),{teamId:n}=ge(),x=se(ae,!1),t=K(f.path)();xe(ye.COMP_EDIT_STORE,t);const b=N("dialogPutTreaty"),y=N("dialogCompRepeat"),_=g(330),v=g(""),o=ne(()=>t.selectedFolder?.path);async function r(l){const e=await _e({compPath:l});t.setOriginalDirectory(e.data);const p=e.data?.children||[];if(p?.length){const C=p.find(Y=>Y.name==="comp.json");if(!C)return"NOT_EXIST";const P=await ve({filePath:C.path}),{content:D}=P.data,w=JSON.parse(D).__id__;if(!w)return"NOT_EXIST";const M=await H({compId:w}),{exist:X}=M.data;if(X)return v.value=w,"EXIST"}return"NOT_EXIST"}const h=async(l,e)=>{if(e()){if(t.$reset(),!x.value){b.value?.open(d=>{d&&(x.value=!0,c(l))});return}c(l)}};async function c(l){const e=ce.service({fullscreen:!0}),d=await r(l.path);if(d==="NOT_EXIST"){const p=await de({compPath:l.path}),{thirdParty:C}=p.data;t.setSelectedFolder(l),t.setCompDialogType(ue.ADD),t.initPreviewCompList(),t.setCompDep(C),e.close()}else d==="EXIST"&&pe.confirm("组件已经上传,更新操作请前往我的组件或团队组件","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).finally(()=>{e.close()})}async function u({end:l}){try{const e=t.getCompSubmitParams(),d=await me({compPath:o.value,...n?{teamId:n}:{}}),{similarList:p=[]}=d.data;if(p.length){y.value?.open(p,S),l();return}await V({...e,...n?{teamId:n}:{}}),j.success("上传成功"),await $(),t.$reset()}catch(e){console.error("上传失败:",e)}finally{l()}}function S({end:l}){const e=t.getCompSubmitParams();V({...e,...n?{teamId:n}:{}}).then(async()=>{y.value?.close(),await $(),t.$reset(),j.success("上传成功")}).finally(()=>{l()})}async function $(){n?await T.push({name:"team",params:{teamId:n},query:{[z.VERSION]:Date.now()}}):await T.push({name:"mine",query:{[z.VERSION]:Date.now()}})}async function L(){const l=t.selectedFolder;t.$reset(),await fe(),c(l)}return le(()=>{t.$reset()}),(l,e)=>{const d=m("el-splitter-panel"),p=m("el-icon"),C=m("el-empty"),P=m("el-link"),D=m("el-splitter");return E(),I("div",$e,[s(D,null,{default:a(()=>[s(d,{collapsible:"",size:_.value,"onUpdate:size":e[0]||(e[0]=k=>_.value=k),max:330},{default:a(()=>[i("div",Pe,[s(q,null,{default:a(({isLogin:k})=>[s(G,{onSelect:w=>h(w,k)},null,8,["onSelect"])]),_:1})])]),_:1},8,["size"]),s(d,{class:"size-full rounded-sm relative"},{default:a(()=>[o.value?(E(),R(J,{key:1,onConfirmUpload:u},{toolbar:a(()=>[i("div",Ie,[s(P,{type:"primary",onClick:L},{default:a(()=>[...e[2]||(e[2]=[O("重新加载",-1)])]),_:1})])]),_:1})):(E(),I("div",De,[s(C,null,{image:a(()=>[i("div",null,[s(p,{style:{"font-size":"40px"}},{default:a(()=>[s(re(ie))]),_:1})])]),description:a(()=>[...e[1]||(e[1]=[i("span",{class:"text-[#ccc]"},"请先选择文件夹",-1)])]),_:1})]))]),_:1})]),_:1}),s(he,{ref:"dialogPutTreaty"},null,512),s(Se,{ref:"dialogCompRepeat"},null,512)])}}});export{Me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as me,a as Y,C as de}from"./index.vue_vue_type_script_setup_true_lang-CM4e2vlV.js";import{d as A,K as ve,M as fe,k as $,x as Q,r as h,c as T,b as e,w as o,F as X,N as J,o as c,B as y,m as f,n as _e,a as w,t as ge,G as ee,O as L,P as O,Q as he,R as we,j as q,T as be,U as ye,z as Ce,V as xe,y as Pe,D as Ve,W as De,X as Se,p as B,u as N,Y as Ee,Z as Te,f as G,$ as Z,a0 as $e,a1 as Ue,a2 as ke,a3 as Ie,a4 as Be,a5 as Me}from"./index-ChPcVXrX.js";import{c as ze,a as Ne,b as Ae}from"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";import{_ as Re}from"./index.vue_vue_type_script_setup_true_lang-nLMCZRFB.js";import{_ as te,a as ae}from"./index.vue_vue_type_script_setup_true_lang-CtdhXfKs.js";import{_ as Fe}from"./index.vue_vue_type_script_setup_true_lang-Bc1PXqOH.js";import{h as oe,r as Le,p as Oe}from"./index-BaIvuJ6m.js";import{u as Ke}from"./useTeamHeaders-Ca3sFPFG.js";import{B as je}from"./index-CylaEETe.js";import{c as He}from"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";import{m as We}from"./v1Module-Bqbebkss.js";import{B as Ye}from"./index-D3Ir6GJ2.js";import"./index.vue_vue_type_style_index_0_lang-Do4LGQzJ.js";import"./atom-one-dark-BwqwaUyO.js";import"./index-DTp0jdEu.js";const qe={class:"w-[100px]"},Ge=A({__name:"index",props:ve({id:{type:String,default:""},version:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(_){const m=_,i=fe(_,"modelValue"),u=$([]),g=$(!1);function n(l){i.value=l}async function C(){if(g.value)return;const l=await ze({compId:m.id});g.value=!0,u.value=l.data.map(t=>({value:t.version,label:t.version}))}function b(){u.value=[{value:m.version,label:m.version}],i.value=m.version}return Q(()=>{b()}),(l,t)=>{const x=h("el-option"),S=h("el-select");return c(),T("div",qe,[e(S,{"model-value":i.value,onChange:n,onVisibleChange:C},{default:o(()=>[(c(!0),T(X,null,J(u.value,d=>(c(),y(x,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])}}}),Ze={class:"size-full"},Qe={class:"size-full p-[10px] min-h-[80px] overflow-auto"},Xe={class:"mb-[10px]"},Je={class:"comp-name"},et={class:"mt-2"},tt=A({__name:"index",props:{compId:{},getCompDetail:{type:Function}},setup(_){const m=_,i=$(),u=f(()=>oe(i.value?.dep??[])),g=(n,C)=>`npm install ${n}@${C}`;return _e(async()=>{const n=await m.getCompDetail(m.compId);n&&(i.value=n)}),(n,C)=>{const b=h("el-splitter-panel"),l=h("el-splitter");return c(),T("div",Ze,[e(l,{layout:"vertical"},{default:o(()=>[e(b,{size:"30%",min:200},{default:o(()=>[w("div",Qe,[w("h4",Xe,[w("span",Je,ge(i.value?.name),1)]),w("div",null,[e(te,{compDeps:u.value},null,8,["compDeps"])]),w("div",et,[(c(!0),T(X,null,J(u.value,t=>(c(),T("div",{key:t.name,class:"flex items-center mb-[5px] gap-[10px]"},[e(Fe,{class:"text-sm text-[#666]",text:g(t.name,t.version)},null,8,["text"])]))),128))])])]),_:1}),e(b,{min:200,class:"size-full"},{default:o(()=>[e(Re)]),_:1})]),_:1})])}}}),at=A({__name:"index",props:{compName:{type:String,default:""}},setup(_){const m=_,i=ee(),{compId:u}=i.params,g=$({data:[],column:[{prop:"prevVersion",label:"升级前版本",align:"center"},{prop:"newVersion",label:"升级后版本",align:"center"},{prop:"upgradeDesc",label:"升级描述",align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{slot:"operation",prop:"operation",label:"操作",align:"center"}],pagination:{total:0},fixedHeight:!1,fetchData:C}),n=f(()=>({id:u,name:m.compName}));async function C(b){if(!u)return;const l=await Ne({compId:u},{...b}),{rows:t,total:x}=l.data||{};g.value.data=t||[],g.value.pagination.total=x||0}return(b,l)=>{const t=h("el-table-column");return c(),y(je,{tableConfig:g.value,border:"",stripe:""},{operation:o(({col:x})=>[e(t,L(O(x)),{default:o(({row:S})=>[e(ae,L(O({version:S.newVersion,...n.value})),null,16)]),_:1},16)]),_:1},8,["tableConfig"])}}}),ot=_=>he(`compPreview_${_}`,{state:()=>({isUnmounted:!1}),actions:{setIsUnmounted(m){this.$patch(i=>{i.isUnmounted=m})}}}),lt={class:"size-full"},nt={class:"h-[50vh]"},st={class:"w-full flex flex-col gap-1"},it={class:"flex-1 flex justify-start gap-[5px] items-center"},rt={class:"sticky top-0 mt-1 w-full"},ct={class:"mt-2"},Dt=A({__name:"index",props:{isTeamPreview:{type:Boolean,default:!1}},setup(_){const m=_,i=ee(),u=[{label:"文档",value:"doc",component:me,visible:()=>!0},{label:"升级记录",value:"upgradeRecord",component:at,visible:()=>!0}],g=i.query[we.VERSION]!==void 0,{compId:n}=i.params,C=new Map;Be(Me.CALLBACKS,C);const{teamId:b}=Ke(),l=q(be,0),t=q(ye,u[0]?.value),x=Ce(),S=xe(),d=He(n)(),R=ot(i.path)(),M=$(!1),P=$(d.latestVersion),a=f(()=>d.detail[P.value]),K=f(()=>Object.keys(a.value??{}).length>0),U=f(()=>d.versionToFileAccessPath[P.value]??[]),j=f(()=>oe(a.value?.dep??[])),H=f(()=>{const p=a.value?.previewConfigs||[];if(!p.length||!U.value?.length)return[];const s=new Map(U.value.map(({path:r,signedUrl:V})=>[r,V])),v=r=>{const V=Le(r.at(-1)??"");return s.get(V)??""},E=p.filter(r=>r.fullPath?.length);return E.length?E.map(r=>({finalEntryUrl:v(r.fullPath??[])})):p.filter(r=>r.miniPath?.length).map(r=>({finalEntryUrl:v(r.miniPath??[])}))}),le=f(()=>t.value==="doc"?{mdSrc:ne.value,scrollContainer:".preview-container"}:t.value==="upgradeRecord"?{compName:a.value?.name||""}:{}),ne=f(()=>U.value.find(p=>p.path.endsWith("/README.md"))?.signedUrl??""),se=f(()=>U.value.length?u.find(s=>s.value===t.value)?.component:void 0),ie=f(()=>{const p=H.value.length===1?"none":"";return{previews:H.value,dep:a.value?.dep??[],bgColor:a.value?.bgColor??"#fff",signedUrls:U.value,indicatorPosition:p,depToFile:d.depEntryNameToFile[P.value]??{}}});async function W(){M.value=!0;try{if(!n)throw new Error("compId is required");const p=await Ae({compId:n,version:P.value}),{objectId:s,version:v,files:E,dep:r}=p.data,V={objectId:s,version:v,files:E.map(I=>I.path)},z=await Ie(V),F=Oe(r,x.deps).map(I=>I.name),D=await We({deps:F}),{entryNameToFile:k={}}=D.data;P.value=v,d.setDetail(v,{...p.data,_id:n}),d.setDepEntryNameToFile(v,k),d.setVersionToFileAccessPath(v,z.data.signedUrls)}finally{M.value=!1}}function re(){l.value=Math.max(l.value,500)}function ce(){l.value=0}function ue(){return Promise.resolve(a.value)}function pe(){m.isTeamPreview?S.addPayLoad(`/previewTeam/${b}/${n}`,{name:a.value?.name??""}):S.addPayLoad(`/preview/${n}`,{name:a.value?.name??""})}return Pe(P,async p=>{p!==a.value?.version&&(await x.initSetting(),await W())}),Q(async()=>{(!K.value||g)&&(await W(),R.setIsUnmounted(!1)),pe()}),Ve(()=>{R.setIsUnmounted(!0)}),(p,s)=>{const v=h("el-button"),E=h("el-backtop"),r=h("el-scrollbar"),V=h("el-splitter-panel"),z=h("el-splitter"),F=De("loading");return Se((c(),T("div",lt,[e(z,null,{default:o(()=>[e(V,{min:510},{default:o(()=>[e(r,{"wrap-class":"preview-container",class:"size-full"},{default:o(()=>[w("div",nt,[e(Y,{title:a.value?.name,actions:["maximize"]},{default:o(({isMaximized:D})=>[N(R).isUnmounted?B("",!0):(c(),y(Ee,{key:0,isEmpty:!K.value,loading:M.value,class:"size-full"},{default:o(()=>[e(de,Te(ie.value,{arrow:"always"}),{compToolBar:o(()=>[w("div",st,[j.value.length>0?(c(),y(te,{key:0,compDeps:j.value},null,8,["compDeps"])):B("",!0),w("div",it,[D?B("",!0):(c(),y(v,{key:0,color:"#414141",onClick:re},{default:o(()=>[...s[3]||(s[3]=[G("终端",-1)])]),_:1})),e(Ge,{modelValue:P.value,"onUpdate:modelValue":s[0]||(s[0]=k=>P.value=k),id:a.value?._id,version:a.value?.version},null,8,["modelValue","id","version"]),e(ae,{id:a.value?._id,name:a.value?.name,version:a.value?.version},{default:o(({downloadHandler:k,isLogin:I})=>[e(v,{type:"primary",onClick:ut=>k(I)},{default:o(()=>[...s[4]||(s[4]=[G("下载",-1)])]),_:1},8,["onClick"])]),_:1},8,["id","name","version"])])])]),_:2},1040)]),_:2},1032,["isEmpty","loading"]))]),_:1},8,["title"])]),w("div",rt,[e(Ye,{modelValue:N(t),"onUpdate:modelValue":s[1]||(s[1]=D=>Z(t)?t.value=D:null),options:u},null,8,["modelValue"])]),w("div",ct,[e($e,null,{default:o(()=>[(c(),y(Ue,null,[(c(),y(ke(se.value),L(O(le.value)),null,16))],1024))]),_:1})]),e(E,{right:100,bottom:100,target:".preview-container"})]),_:1})]),_:1}),N(l)?(c(),y(V,{key:0,size:N(l),"onUpdate:size":s[2]||(s[2]=D=>Z(l)?l.value=D:null),collapsible:""},{default:o(()=>[e(Y,{title:"依赖安装",onClose:ce},{default:o(()=>[a.value?._id?(c(),y(tt,{key:0,compId:a.value?._id,getCompDetail:ue},null,8,["compId"])):B("",!0)]),_:1})]),_:1},8,["size"])):B("",!0)]),_:1})])),[[F,M.value]])}}});export{Dt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as w,z as x,bv as F,j as k,bP as v,bQ as B,d as A,ac as U,m as P,aG as R,r as I,B as E,w as T,c as N,F as G,N as z,a as q,p as V,Z as $,u as O,o as m,v as Q}from"./index-ChPcVXrX.js";import{m as j}from"./v1Module-Bqbebkss.js";import{p as S}from"./index-BaIvuJ6m.js";import{c as J,b as X}from"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";const Y=(l="")=>{if(!l)throw new Error("createCompMetaLocalStore scopeId is required");return w(`compMetaLocal_${l}`,{state:()=>({detail:{},dep:{},depToFile:{}}),getters:{},actions:{setDetail(e){this.$patch(t=>{t.detail=e})},setDep(e){this.$patch(t=>{t.dep=e})},setDepToFile(e){this.$patch(t=>{t.depToFile=e})}}})};let p=null;const g="IS_REPLACE",C="IS_ADD",D="IS_DELETE";function y(){p&&(cancelIdleCallback(p),p=null)}function M({list:l,oldList:e=[],render:t}){if(p&&(cancelIdleCallback(p),p=null),l.length===0)return console.warn("列表为空"),()=>{y()};const i=e.filter(c=>!l.some(d=>d._id===c._id));i.length>0&&t(D,i);let s=0;const o=l.length;let n=Date.now();const r=c=>{const d=Date.now()-n>100;if(s<o&&c.timeRemaining()>8||d){n=Date.now();const a=l[s];if(!a)throw new Error("组件列表项无效");e.findIndex(_=>_._id===a._id)>-1?t(g,[a]):t(C,[a]),s++}s<o&&(p=requestIdleCallback(r,{timeout:16.6*2}))};return o>0&&(p=requestIdleCallback(r,{timeout:16.6*2})),()=>{y()}}const se=l=>w(`compListStore_${l}`,{state:()=>({scopeId:l,list:[],localList:[],loading:!1,tagGroup:[...v],selectTag:k(`${B}_${l}`,"XTTJ"),isEmpty:!1}),actions:{setLocalList(e){this.$patch(t=>{t.localList=e})},setSelectTag(e){this.$patch(t=>{t.selectTag=e})},setLoading(e){this.$patch(t=>{t.loading=e})},setIsEmpty(e){this.$patch(t=>{t.isEmpty=e})},setList(e){this.$patch(t=>{t.list=e})},delCompListById(e){this.$patch(t=>{t.list=t.list.filter(i=>i._id!==e)})},updateCompListItemById(e,t){this.$patch(i=>{i.list=i.list.map(s=>s._id===e?{...s,...t}:s)})},idleList(e){return this.setIsEmpty(e.length===0),e.length===0?(this.setList([]),this.setLoading(!1),()=>{}):M({list:e,oldList:this.list,render:(t,i)=>{this.setLoading(!1),t===C?this.$patch(s=>{i[0]&&s.list.push(i[0])}):t===g?this.$patch(s=>{const o=i[0];if(o){const n=s.list.findIndex(r=>r._id===o._id);n>-1&&(s.list[n]=o)}}):t===D&&this.$patch(s=>{s.list=s.list.filter(o=>!i.find(n=>n._id===o._id))})}})},idleListLocal(e){return this.setIsEmpty(e.length===0),e.length===0?(this.setList([]),this.setLoading(!1),()=>{}):M({list:e,oldList:this.localList,render:(t,i)=>{this.setLoading(!1),t===C?this.$patch(s=>{i[0]&&s.localList.push(i[0])}):t===g?this.$patch(s=>{const o=i[0];if(o){const n=s.localList.findIndex(r=>r._id===o._id);n>-1&&(s.localList[n]=o)}}):t===D&&this.$patch(s=>{s.localList=s.localList.filter(o=>!i.find(n=>n._id===o._id))})}})},async initCompMetas(e){const t=x(),i=await F({compIds:e.map(a=>a._id)}),{compInfos:s=[]}=i.data||{},r=e.map(a=>a.dep).map(a=>S(a,t.deps)).reduce((a,u)=>[...a,...u],[]).map(a=>a.name),c=await j({deps:[...new Set(r)]}),{entryNameToFile:d={}}=c.data;e.forEach(a=>{const _=S(a.dep,t.deps).reduce((h,L)=>(d[L.name]&&(h[L.name]=d[L.name]),h),{}),f=J(a._id)();f.setLatestVersion(a.version),f.setDetail(a.version,a);const b=s.filter(h=>h.id===a._id);f.setLocalCompInfo(b),f.setDepEntryNameToFile(a.version,_)})},async initCompMetasLocal(e){e.forEach(t=>{Y(t._id)().setDetail(t)})},async renderList(e){return e.length&&await this.initCompMetas(e),this.idleList(e)},renderLocalList(e){return e.length&&this.initCompMetasLocal(e),this.idleListLocal(e)}}}),Z={class:"size-full"},H=A({__name:"index",props:{previews:{},dep:{},signedUrls:{},depToFile:{}},setup(l){const e=l,t=U(),i=P(()=>({dep:e.dep,signedUrls:e.signedUrls,depToFile:e.depToFile,panelType:R.MINI}));return(s,o)=>{const n=I("el-carousel-item"),r=I("el-carousel");return m(),E(r,$({class:"size-full"},O(t),{trigger:"click",loop:!1}),{default:T(()=>[(m(!0),N(G,null,z(l.previews,(c,d)=>(m(),E(n,{key:d,class:"size-full"},{default:T(()=>[q("div",Z,[c.finalEntryUrl?(m(),E(X,$({key:0,finalEntryUrl:c.finalEntryUrl},{ref_for:!0},i.value),null,16,["finalEntryUrl"])):V("",!0)])]),_:2},1024))),128))]),_:1},16)}}}),ie=Q(H,[["__scopeId","data-v-325964d0"]]);export{ie as C,Y as a,se as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as v,i as k,x as C,y as S,c as d,a as r,f as o,o as l,v as w,z as V,A as B,r as c,b as t,w as n,p as _,_ as $,t as f,u as a,F as h,B as z}from"./index-ChPcVXrX.js";import{H as D}from"./atom-one-dark-BwqwaUyO.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang-BLnHXQn6.js";import"./index-BaIvuJ6m.js";const N={class:"code-container"},U={ref:"code",class:"language-json"},F=v({__name:"index",props:{code:{}},setup(g){const p=g,e=k("code"),u=()=>{e.value&&(e.value.textContent=p.code,D.highlightElement(e.value))};return C(u),S(()=>p.code,()=>{u()}),(s,i)=>(l(),d("div",N,[r("pre",null,[i[0]||(i[0]=o(" ",-1)),r("code",U,null,512),i[1]||(i[1]=o(`
|
|
2
|
+
`,-1))])]))}}),j=w(F,[["__scopeId","data-v-71136191"]]),E={class:"relative"},R={class:"flex items-center gap-[5px]"},T={key:0,class:"flex items-center justify-center"},A={class:"flex items-center gap-[5px]"},I={class:"text-[14px] whitespace-pre-line leading-5"},K=v({__name:"index",setup(g){const p=V(),e=B();return(u,s)=>{const i=c("router-link"),m=c("el-tag"),y=c("el-empty"),x=c("el-divider"),b=c("el-card");return l(),d("div",E,[t(H),t(b,{class:"absolute inset-0 max-w-[1000px] mx-auto p-[10px] min-h-screen overflow-auto"},{default:n(()=>[r("div",R,[t(i,{to:"/"},{default:n(()=>[t($,{logoClass:"h-[30px] mt-[40px] mb-[40px]"})]),_:1}),t(m,{type:"info",round:"",size:"small"},{default:n(()=>[o(f(a(p).compHubVersion),1)]),_:1})]),a(e).hasUpgrade?_("",!0):(l(),d("div",T,[t(y,{description:"暂无更新"})])),a(e).upgradeDesc?(l(),d(h,{key:1},[t(x,{"content-position":"center"},{default:n(()=>[r("div",A,[s[0]||(s[0]=o(" 新版功能 ",-1)),t(m,{type:"info",round:"",size:"small"},{default:n(()=>[o(f(a(e).latestVersion),1)]),_:1})])]),_:1}),r("p",I,f(a(e).upgradeDesc),1)],64)):_("",!0),a(e).isUpgrade?(l(),d(h,{key:2},[t(x,{"content-position":"center"},{default:n(()=>[...s[1]||(s[1]=[o(" 更新方式 ",-1)])]),_:1}),s[3]||(s[3]=r("div",{class:"mb-[10px]"},[o(" 更新 "),r("span",{class:"font-bold"},"comp-hub"),o(" 请回到项目根目录,打开终端,执行以下命令: ")],-1)),a(e).isForceUpgrade?(l(),z(m,{key:0,type:"danger",round:"",size:"small"},{default:n(()=>[...s[2]||(s[2]=[o(" 不可忽略此次更新 ",-1)])]),_:1})):_("",!0),t(j,{code:"npm install comp-hub@latest -D",language:"bash"})],64)):_("",!0)]),_:1})])}}});export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.el-splitter-panel{overflow:hidden}.custom-tree-node[data-v-a4f31447]{flex:1;display:flex;align-items:center;justify-content:space-between;font-size:14px;padding-right:8px}
|
|
1
|
+
.el-splitter-panel{overflow:hidden}.custom-tree-node[data-v-a4f31447]{flex:1;display:flex;align-items:center;justify-content:space-between;font-size:14px;padding-right:8px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as B,G as F,V as M,m as n,ad as N,J as h,x as R,r as v,B as _,w as r,b as i,Y as I,a as p,O,P as A,p as j,o as P,f as z,t as U,aF as K,af as Y,a4 as G,a5 as H}from"./index-ChPcVXrX.js";import{a as J,C as W,_ as X}from"./index.vue_vue_type_script_setup_true_lang-CM4e2vlV.js";import{a as q}from"./index-DTp0jdEu.js";import{h as Q,c as w}from"./index-BaIvuJ6m.js";import{m as Z}from"./v1Module-Bqbebkss.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_lang-CtdhXfKs.js";import"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";import"./index.vue_vue_type_style_index_0_lang-Do4LGQzJ.js";import"./atom-one-dark-BwqwaUyO.js";import"./useTeamHeaders-Ca3sFPFG.js";import"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";const ae={class:"h-[50vh]"},te={class:"w-full flex flex-col gap-1"},oe={class:"text-xs flex items-center"},ve=B({__name:"index",setup(se){const C=new Map;G(H.CALLBACKS,C);const g=F(),y=M(),{openCompPathInVscode:D,handlePath:x}=N(),{compId:c}=g.params,o=q(c)(),u=n(()=>Q(o.dep??[])),V=n(()=>x(t.value.fullPath,1)),t=n(()=>o.detail),d=n(()=>Object.keys(t.value??{}).length>0),f=n(()=>{const a=t.value?.previewConfigs??[];if(!a.length)return[];const s=e=>{const m=w(t.value.path,e);return`${h}/${m}`},l=a.filter(e=>e.fullPath?.length);return l.length?l.map(e=>({finalEntryUrl:s(e.fullPath??[])})):a.filter(e=>e.miniPath?.length).map(e=>({finalEntryUrl:s(e.miniPath??[])}))}),E=n(()=>{const a=f.value.length===1?"none":"";return{previews:f.value,dep:o.dep,depToFile:o.depToFile,indicatorPosition:a,bgColor:t.value.bgColor??"#fff"}}),k=n(()=>{const a=w(t.value.path,["\\README.md"]);return`${h}/${a}`});function S(){D(t.value.fullPath,"./comp.json")}async function $(){if(!c)return;const a=await K({fullPathHash:c}),s=await Y({compPath:a.data.path}),{thirdParty:l=[]}=s.data,e=l.map(L=>L.name),m=await Z({deps:e}),{entryNameToFile:T={}}=m.data;o.setDetail(a.data),o.setDep(l),o.setDepToFile(T)}function b(){y.addPayLoad(`/previewLocal/${c}`,{name:`本地组件:${t.value?.name??""}`})}return R(async()=>{d.value||await $(),b()}),(a,s)=>{const l=v("el-link"),e=v("el-scrollbar");return P(),_(e,{"wrap-class":"preview-container",class:"size-full"},{default:r(()=>[i(I,{isEmpty:!d.value},{default:r(()=>[p("div",ae,[i(J,{title:t.value?.name,actions:["maximize"]},{default:r(()=>[i(W,O(A(E.value)),{compToolBar:r(()=>[p("div",te,[u.value.length>0?(P(),_(ee,{key:0,compDeps:u.value},null,8,["compDeps"])):j("",!0),p("div",oe,[s[0]||(s[0]=p("span",null,"组件位置:",-1)),i(l,{href:"javascript:void(0)",type:"primary",underline:"always",title:t.value.fullPath,onClick:S},{default:r(()=>[z(U(V.value),1)]),_:1},8,["title"])])])]),_:1},16)]),_:1},8,["title"])]),i(X,{mdSrc:k.value,scrollContainer:".preview-container",stickyTopDistance:0,showSimilarComp:!1},null,8,["mdSrc"])]),_:1},8,["isEmpty"])]),_:1})}}});export{ve as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as $,a as P,c as R}from"./index.vue_vue_type_script_setup_true_lang-CtdhXfKs.js";import{c as A}from"./index-DTp0jdEu.js";import{_ as U}from"./index.vue_vue_type_style_index_0_lang-D79LparT.js";import{_ as F,e as N,f as V,b as K}from"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";import{c as z}from"./useCompEditStore-DV_QyPzi.js";import{d as w,a6 as j,r as C,B as D,w as i,b as n,f as y,a7 as G,a8 as Q,a9 as h,aa as L,E as W,o as g,a5 as u,G as Y,g as q,i as H,k as X,D as Z,W as J,X as ee,u as oe,c as te,a as k,p as ae,O as ne,Z as se,a4 as f}from"./index-ChPcVXrX.js";import{B as ie}from"./index-CylaEETe.js";import{k as re}from"./v1Keyword-MJXP7v9H.js";import{c as le}from"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";import"./index-BaIvuJ6m.js";import"./v1Module-Bqbebkss.js";import"./useTeamHeaders-Ca3sFPFG.js";import"./index-D3Ir6GJ2.js";const ce=w({__name:"index",props:{id:{type:String,default:""},name:{type:String,default:""}},setup(E){const r=E,_=j(u.CALLBACKS);async function a(p){const l=G.service({fullscreen:!0});try{if(!p())return;if(!r.name){console.error("组件名称不能为空");return}if(await Q.confirm(h.CONFIRM.DELETE(r.name),"提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).catch(()=>{})!=="confirm")return;await N({compId:r.id}).then(()=>_.get(L.AFTER_COMP_DEL)?.(r.id)),W.success(h.SUCCESS.DELETE)}finally{l.close()}}return(p,l)=>{const d=C("el-link");return g(),D(F,null,{default:i(({isLogin:m})=>[n(d,{type:"danger",link:"",onClick:S=>a(m)},{default:i(()=>[...l[0]||(l[0]=[y(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})}}}),pe={class:"size-full"},de={class:"flex-1"},me={class:"flex-1 flex justify-end items-center gap-2"},Le=w({__name:"index",setup(E){const r=Y(),_=q(),a=A(r.path)();f(u.COMP_LIST_STORE,a);const p=z(r.path)();f(u.COMP_EDIT_STORE,p);const l=new Map;f(u.CALLBACKS,l);const d=H("compUpdateDialog"),m=X({data:[],search:{column:[{prop:"keyword",type:"el-autocomplete",label:"关键词",value:"",autoQuery:!1,attributes:{placeholder:"请输入组件名称/描述",fetchSuggestions:S,triggerOnFocus:!1,style:"width: 200px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:M});function S(e,o){if(e.length<=1)return o([]);re({keyword:e,type:"compMy"}).then(s=>{const{keywords:c=[]}=s.data||{};o(c)})}async function M(e){a.setLoading(!0);const o=await V(e),{rows:s,total:c}=o.data||{};await a.renderList(s||[]),m.value.pagination.total=c||0}function T(e){_.push({path:`/preview/${e._id}`})}async function B(e){d.value?.open(e._id)}function x(e){return le(e._id)().isLocalExist?"primary":"info"}function O(e){const{_id:o,totalDownloadCount:s=0}=e;a.updateCompListItemById(o,{totalDownloadCount:s+1})}function b(e){K({compId:e}).then(o=>{a.updateCompListItemById(e,o.data)})}return l.set(L.AFTER_COMP_DEL,e=>{console.log("删除的组件id",e),a.delCompListById(e)}),Z(()=>{a.$reset()}),(e,o)=>{const s=C("el-link"),c=C("el-scrollbar"),I=J("loading");return ee((g(),te("div",pe,[n(ie,{tableConfig:m.value},{table:i(()=>[n(c,{always:""},{default:i(()=>[n($,null,{compItemToolBar:i(({attrs:t})=>[k("div",de,[t._id?(g(),D(R,ne(se({key:0},{id:t._id,version:t.version})),null,16)):ae("",!0)])]),compItemFooterOperate:i(({attrs:t})=>[k("div",me,[n(P,{id:t._id,name:t.name,version:t.version,onDownloadSuccess:v=>O(t)},null,8,["id","name","version","onDownloadSuccess"]),n(s,{type:"primary",onClick:v=>T(t)},{default:i(()=>[...o[0]||(o[0]=[y("预览",-1)])]),_:1},8,["onClick"]),n(s,{type:x(t),onClick:v=>B(t)},{default:i(()=>[...o[1]||(o[1]=[y("更新",-1)])]),_:1},8,["type","onClick"]),n(ce,{id:t._id,name:t.name},null,8,["id","name"])])]),_:1})]),_:1})]),_:1},8,["tableConfig"]),n(U,{ref:"compUpdateDialog",onUpdateSuccess:b},null,512)])),[[I,oe(a).loading]])}}});export{Le as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.base-segmented[data-v-d50f4856]{background-color:var(--el-fill-color-light);box-shadow:0 2px 4px #0000001a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as B}from"./index-DTp0jdEu.js";import{b as D,a as S,c as O}from"./index.vue_vue_type_script_setup_true_lang-CtdhXfKs.js";import{d as x,G as E,g as P,k as I,aa as T,D as $,r as d,W as M,X as R,u as N,c as V,b as n,w as i,a as p,Z as m,f as A,O as u,P as z,B as F,p as K,o as _,a4 as f,a5 as C}from"./index-ChPcVXrX.js";import{g as Q}from"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";import{B as W}from"./index-CylaEETe.js";import{k as Y}from"./v1Keyword-MJXP7v9H.js";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang-hSvL-MZl.js";import"./v1Module-Bqbebkss.js";import"./index-BaIvuJ6m.js";import"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";const q={class:"size-full"},G={class:"flex-1"},H={class:"flex-1 flex justify-end items-center gap-2"},ie=x({__name:"index",setup(U){const g=E(),v=P(),a=B(g.path)();f(C.COMP_LIST_STORE,a);const r=new Map;f(C.CALLBACKS,r);const c=I({data:[],search:{column:[{prop:"keyword",type:"el-autocomplete",label:"关键词",value:"",autoQuery:!1,attributes:{placeholder:"请输入组件名称/描述",fetchSuggestions:w,triggerOnFocus:!1,style:"width: 200px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:h});function w(o,t){if(o.length<=1)return t([]);Y({keyword:o,type:"compMyCollect"}).then(s=>{const{keywords:l=[]}=s.data||{};t(l)})}async function h(o){a.setLoading(!0);const t=await Q(o),{rows:s,total:l}=t.data||{};await a.renderList(s||[]),c.value.pagination.total=l||0}function y(o){v.push({path:`/preview/${o._id}`})}function k(o){const{_id:t,totalDownloadCount:s=0}=o;a.updateCompListItemById(t,{totalDownloadCount:s+1})}return r.set(T.AFTER_COMP_CANCEL_COLLECT,o=>{a.delCompListById(o)}),$(()=>{a.$reset()}),(o,t)=>{const s=d("el-link"),l=d("el-scrollbar"),L=M("loading");return R((_(),V("div",q,[n(W,{tableConfig:c.value},{table:i(()=>[n(l,{always:""},{default:i(()=>[n(D,null,{compItemToolBar:i(({attrs:e})=>[p("div",G,[e._id?(_(),F(O,u(m({key:0},{id:e._id,version:e.version})),null,16)):K("",!0)])]),compItemFooterOperate:i(({attrs:e})=>[p("div",H,[n(S,m({id:e._id,name:e.name,version:e.version},{onDownloadSuccess:b=>k(e)}),null,16,["onDownloadSuccess"]),n(s,{type:"primary",onClick:b=>y(e)},{default:i(()=>[...t[0]||(t[0]=[A("预览",-1)])]),_:1},8,["onClick"]),n(j,u(z({id:e._id,name:e.name,isCollect:e.isCollect,collectCount:e.collectCount})),null,16)])]),_:1})]),_:1})]),_:1},8,["tableConfig"])])),[[L,N(a).loading]])}}});export{ie as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./index.vue_vue_type_script_setup_true_lang-nLMCZRFB.js";import{d as o,c as s,b as t,o as a}from"./index-ChPcVXrX.js";const c={class:"size-full"},p=o({__name:"index",setup(n){return(_,r)=>(a(),s("div",c,[t(e)]))}});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as a,b as u}from"./index-
|
|
1
|
+
import{g as a,b as u}from"./index-BaIvuJ6m.js";import{d as w,i as g,k as y,C as S,x as M,D as b,c as T,a as D,o as R}from"./index-ChPcVXrX.js";const _={class:"size-full"},P={ref:"canvas",class:"size-full bg-[#333436]"},k=w({__name:"index",setup(A){const d=g("canvas"),o=y(!1);let n=null;class x{rangeR;r;rSpeed;cvs;ctx;x;y;xSpeed;ySpeed;lastMoveTime;fillStyle;maxTimeDiff=100;constructor({cvs:t,ctx:e}){this.rangeR=[3,7],this.r=a(this.rangeR[0],this.rangeR[1]),this.rSpeed=a(-1,1),this.cvs=t,this.ctx=e,this.x=a(0+this.r,this.cvs.width-this.r),this.y=a(0+this.r,this.cvs.height-this.r),this.xSpeed=a(-10,10),this.ySpeed=a(-10,10),this.lastMoveTime=null,this.fillStyle=u()}setLastMoveTime(t){this.lastMoveTime=t}draw(){if(this.lastMoveTime){const i=Date.now()-this.lastMoveTime,s=Math.min(i,this.maxTimeDiff)/1e3;let h=this.x+s*this.xSpeed,c=this.y+s*this.ySpeed,l=this.r+s*this.rSpeed;l<=this.rangeR[0]?(l=this.rangeR[0],this.rSpeed=Math.abs(this.rSpeed)):l>=this.rangeR[1]&&(l=this.rangeR[1],this.rSpeed=-Math.abs(this.rSpeed)),h-this.r<0?(h=this.r,this.xSpeed=Math.abs(this.xSpeed)):h+this.r>this.cvs.width&&(h=this.cvs.width-this.r,this.xSpeed=-Math.abs(this.xSpeed)),c-this.r<0?(c=this.r,this.ySpeed=Math.abs(this.ySpeed)):c+this.r>this.cvs.height&&(c=this.cvs.height-this.r,this.ySpeed=-Math.abs(this.ySpeed)),this.x=h,this.y=c,this.r=l}const t=Math.max(0,this.r);this.ctx.beginPath(),this.ctx.arc(this.x,this.y,t,0,2*Math.PI),this.ctx.fillStyle=this.fillStyle,this.ctx.fill(),this.lastMoveTime=Date.now()}}class p{points;maxDis;cvs;ctx;constructor({pointNumber:t=30,maxDis:e=100,cvs:i,ctx:s}){this.points=new Array(t).fill(0).map(()=>new x({cvs:i,ctx:s})),this.maxDis=e,this.cvs=i,this.ctx=s}resetPointsTime(){const t=Date.now();this.points.forEach(e=>{e.setLastMoveTime(t)})}draw(){if(o.value){if(document.hidden){setTimeout(()=>this.draw(),100);return}requestAnimationFrame(()=>this.draw()),this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height);for(const[t,e]of this.points.entries()){e.draw();for(const i of this.points.slice(t+1)){const s=Math.sqrt((e.x-i.x)**2+(e.y-i.y)**2);isNaN(s)||s>this.maxDis||(this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(i.x,i.y),this.ctx.strokeStyle=`rgba(200,200,200,${Math.max(0,Math.min(1,1-s/this.maxDis))})`,this.ctx.stroke(),this.ctx.closePath())}}}}}function v(){if(!d.value)return;console.log("渲染动画"),o.value=!0;const r=1920,t=110*window.innerWidth/r,e=80*window.innerWidth/r,i=d.value,s=i.getContext("2d");if(!s)return;const h=window.devicePixelRatio||1;i.width=window.innerWidth*h,i.height=window.innerHeight*h,s.scale(h,h),n=new p({pointNumber:Math.floor(t),maxDis:Math.floor(e),cvs:i,ctx:s}),n.draw()}const m=S(v,200);function f(){document.hidden?o.value=!1:d.value&&n&&(o.value=!0,n.resetPointsTime(),n.draw())}return window.addEventListener("resize",m),document.addEventListener("visibilitychange",f),M(()=>{m()}),b(()=>{o.value=!1,window.removeEventListener("resize",m),document.removeEventListener("visibilitychange",f),n=null}),(r,t)=>(R(),T("div",_,[D("canvas",P,null,512)]))}});export{k as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-BaIvuJ6m.js";import{d as c,r as l,c as i,aH as p,b as d,w as m,f,E as u,a as x,t as _,o as y}from"./index-ChPcVXrX.js";const C={class:"flex items-center gap-[10px]"},k=c({__name:"index",props:{text:{type:String,default:""}},setup(t){const o=t;async function a(){const e=await r(o.text);e&&u.success(e)}return(e,s)=>{const n=l("el-button");return y(),i("div",C,[p(e.$slots,"default",{},()=>[x("span",null,_(t.text),1)]),d(n,{size:"small",onClick:a},{default:m(()=>[...s[0]||(s[0]=[f("复制",-1)])]),_:1})])}}});export{k as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as B,b as M}from"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";import{d as w,ac as U,m as b,aG as V,r as _,B as d,w as t,a as m,b as p,Z as g,u as v,c as $,F,N as O,aH as z,f as D,o as a,ae as P,p as x,v as A,k,t as E,aI as N,aJ as R,aK as j,ab as K,G as Y,x as G,D as H,O as J,Y as Z,a4 as S,a5 as T,i as q,aL as Q,aM as W}from"./index-ChPcVXrX.js";import{_ as X}from"./index.vue_vue_type_style_index_0_lang-Do4LGQzJ.js";import{u as I}from"./useTeamHeaders-Ca3sFPFG.js";import{c as ee}from"./index-DTp0jdEu.js";import{b as se,a as oe,c as te}from"./index.vue_vue_type_script_setup_true_lang-CtdhXfKs.js";import{k as ae}from"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";const ne={class:"flex-1"},le={class:"flex justify-end"},ie={class:"text-xs whitespace-nowrap"},ce=w({__name:"index",props:{previews:{},dep:{},signedUrls:{},bgColor:{},depToFile:{}},setup(o){const l=o,u=U(),i=b(()=>({dep:l.dep,signedUrls:l.signedUrls,depToFile:l.depToFile,panelType:V.FULL}));return(e,r)=>{const y=_("el-card"),f=_("el-carousel-item"),n=_("el-carousel"),c=_("el-color-picker");return a(),d(B,{class:"size-full flex flex-col gap-1",bg:o.bgColor},{default:t(({bg:s,updateColor:C})=>[m("div",ne,[p(n,g({class:"size-full"},v(u),{trigger:"click",loop:!1}),{default:t(()=>[(a(!0),$(F,null,O(o.previews,(h,L)=>(a(),d(f,{key:L,class:"size-full"},{default:t(()=>[p(y,{"body-class":"!p-0",class:"flex-1 overflow-hidden rounded-md size-full",style:P({backgroundColor:s})},{default:t(()=>[h.finalEntryUrl?(a(),d(M,g({key:0,finalEntryUrl:h.finalEntryUrl},{ref_for:!0},i.value),null,16,["finalEntryUrl"])):x("",!0)]),_:2},1032,["style"])]),_:2},1024))),128))]),_:2},1040)]),m("div",le,[z(e.$slots,"compToolBar",{},void 0,!0),m("span",ie,[r[0]||(r[0]=D("背景板:",-1)),p(c,{modelValue:s,onChange:C},null,8,["modelValue","onChange"])])])]),_:3},8,["bg"])}}}),Se=A(ce,[["__scopeId","data-v-504f2312"]]),re={class:"flex items-center justify-between px-3 py-2 select-none"},de={class:"text-sm font-medium"},me={class:"flex gap-1.5"},ue={key:0,class:"flex-1 p-2 overflow-auto"},Te=w({__name:"index",props:{title:{type:String,default:""},actions:{type:Array,default:()=>["close","maximize","minimize"]}},emits:["close","maximize","minimize"],setup(o,{emit:l}){const u=o,i=l,e=k(!1),r=k(!1);function y(){i("close")}function f(){e.value=!e.value,i("maximize",e.value)}function n(c){return u.actions.includes(c)}return(c,s)=>{const C=_("el-button"),h=_("el-card");return a(),d(h,{"body-class":"!p-0 flex flex-col overflow-hidden","header-class":"!p-0",class:K(["size-full",{"fixed inset-0 z-50":e.value}])},{header:t(()=>[m("div",re,[m("div",de,E(o.title),1),m("div",me,[n("close")?(a(),d(C,{key:0,type:"primary",icon:v(N),circle:"",onClick:y},null,8,["icon"])):x("",!0),n("maximize")?(a(),d(C,{key:1,type:"primary",icon:e.value?v(R):v(j),circle:"",onClick:f},null,8,["icon"])):x("",!0)])])]),default:t(()=>[r.value?x("",!0):(a(),$("div",ue,[z(c.$slots,"default",{isMaximized:e.value})]))]),_:3},8,["class"])}}}),_e={class:"min-h-[400px]"},pe={class:"flex-1"},fe={class:"flex-1 flex justify-end items-center gap-2"},ye=w({__name:"index",setup(o){const l=Y(),{compId:u}=l.params,{headers:i}=I(),e=ee(l.path)();S(T.COMP_LIST_STORE,e);const r=new Map;S(T.CALLBACKS,r);const y=async()=>{if(e.setLoading(!0),!u)return;const n=await ae({compId:u},{headers:i}),{rows:c}=n.data||{};await e.renderList(c),e.setLoading(!1)};function f(n){const{_id:c,totalDownloadCount:s=0}=n;e.updateCompListItemById(c,{totalDownloadCount:s+1})}return G(()=>{y()}),H(()=>{e.$reset()}),(n,c)=>(a(),$("div",_e,[p(Z,{isEmpty:v(e).isEmpty,loading:v(e).loading},{default:t(()=>[p(se,null,{compItemToolBar:t(({attrs:s})=>[m("div",pe,[s._id?(a(),d(te,J(g({key:0},{id:s._id,version:s.version})),null,16)):x("",!0)])]),compItemFooterOperate:t(({attrs:s})=>[m("div",fe,[p(oe,g({id:s._id,name:s.name,version:s.version},{onDownloadSuccess:C=>f(s)}),null,16,["onDownloadSuccess"])])]),_:1})]),_:1},8,["isEmpty","loading"])]))}}),ve={class:"mt-[10px] overflow-hidden",ref:"similarComp"},be=w({__name:"index",props:{mdSrc:{type:String,default:""},scrollContainer:{type:String,default:""},stickyTopDistance:{type:Number,default:45},showSimilarComp:{type:Boolean,default:!0}},setup(o){const{teamId:l}=I(),u=b(()=>l?"团队内相似组件":"相似组件"),i=k(!1),e=q("similarComp");return Q(e,([r])=>{i.value||(i.value=r?.isIntersecting||!1)}),(r,y)=>{const f=_("el-divider"),n=_("el-card");return a(),d(X,{showToc:!0,src:o.mdSrc,scrollContainer:o.scrollContainer,stickyTopDistance:o.stickyTopDistance},W({_:2},[o.showSimilarComp?{name:"footer",fn:t(()=>[m("div",ve,[p(f,{"content-position":"center"},{default:t(()=>[D(E(u.value),1)]),_:1}),p(n,{"body-class":"!p-0",class:"mt-[10px] p-[10px]"},{default:t(()=>[i.value?(a(),d(ye,{key:0})):x("",!0)]),_:1})],512)]),key:"0"}:void 0]),1032,["src","scrollContainer","stickyTopDistance"])}}});export{Se as C,be as _,Te as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aA as t,d as p,h as f,aH as h,aN as y,bR as v,m as C,H as T,bS as S,E as i,r as g,c as $,b as P,Z as j,o as O}from"./index-ChPcVXrX.js";async function x(e,o){return t("/__remote__/api/v1/comp/checkCompExistById",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function E(e,o){return t("/__remote__/api/v1/comp/collect",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function M(e,o){return t("/__remote__/api/v1/comp/collectedComps",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function w(e,o){return t("/__remote__/api/v1/comp/compDetail",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function D(e,o){return t("/__remote__/api/v1/comp/compHash",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function R(e,o){return t("/__remote__/api/v1/comp/comps",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function B(e,o){return t("/__remote__/api/v1/comp/deleteMyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function N(e,o){return t("/__remote__/api/v1/comp/myComps",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}async function U(e,o){return t("/__remote__/api/v1/comp/similarComps",{method:"POST",headers:{"Content-Type":"application/json"},data:e,...o||{}})}async function A(e,o){return t("/__remote__/api/v1/comp/updateBasicInfo",{method:"POST",headers:{"Content-Type":"application/json"},data:e,...o||{}})}async function F(e,o){return t("/__remote__/api/v1/comp/upgradeRecords",{method:"POST",headers:{"Content-Type":"application/json"},data:e,...o||{}})}async function H(e,o){return t("/__remote__/api/v1/comp/versions",{method:"POST",headers:{"Content-Type":"application/json"},data:e})}const L=p({__name:"index",setup(e){const o=f();function r(){const n=o.isRealUserLogin();return n||o.logoutDialog(),n}return(n,l)=>h(n.$slots,"default",{isLogin:r})}}),k={class:"size-full"},V=p({__name:"index",emits:["select"],setup(e,{emit:o}){const r=o,n=y(),m="/api/v1/vuefinder",d=new v({baseURL:m,url:{list:"/list"}}),_=C(()=>({selectionMode:"single",driver:d,features:{search:!1,upload:!1,delete:!1,rename:!1,preview:!1,edit:!1,archive:!1,unarchive:!1,newfile:!1,newfolder:!1,fullscreen:!1,download:!1,language:!0,move:!1,copy:!1,history:!1,theme:!1,pinned:!1},contextMenuItems:[...S,{id:"select-folder",title:()=>"选择",action:(c,a)=>{if(a.length>1){i.error("不支持多选");return}const{type:s="dir"}=a[0];if(s!=="dir"){i.error("只能选择文件夹");return}r("select",a[0])},show:(c,a)=>{const{target:s,items:u}=a;return u.length>1?!1:s?.type==="dir"}}],config:{initialPath:T.dirname,theme:n.value?"valorite":"silver"},locale:"zhCN"}));return(c,a)=>{const s=g("VueFinder");return O(),$("div",k,[P(s,j({id:"vuefinder"},_.value),null,16)])}}});export{L as _,F as a,w as b,H as c,R as d,B as e,N as f,M as g,E as h,V as i,x as j,U as k,D as l,A as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as G,_ as Z,c as q,b as J}from"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";import{d as S,r as b,B as $,w as _,b as c,f as E,t as C,c as w,p as z,F as V,N as F,bM as Q,o as m,k,ah as X,a as v,i as I,aH as T,a7 as ee,a8 as U,a9 as B,bN as P,E as te,K as se,bO as ne,aR as L,M as ae,m as D,n as oe,ao as le,v as A,aE as ie,ac as ce,z as re,y as O,x as H,u as x,ae as ue,Z as N,a3 as de,av as pe,a6 as j,Y as me,aM as fe,a5 as K}from"./index-ChPcVXrX.js";import{C as _e}from"./index-DTp0jdEu.js";import{c as W,_ as ve,a as he}from"./index.vue_vue_type_style_index_0_lang-CyH8SJ79.js";import{r as xe,h as ge,p as ye}from"./index-BaIvuJ6m.js";import{m as Ce}from"./v1Module-Bqbebkss.js";const we=S({__name:"index",props:{compDeps:{}},setup(l){return(e,t)=>{const i=b("el-tag");return m(),$(Q,{list:l.compDeps,getKey:a=>a.name,class:"flex gap-1 items-center"},{display:_(({visibleList:a,overflow:r})=>[(m(!0),w(V,null,F(a,u=>(m(),$(i,{key:u.name,type:"info","disable-transitions":!0,size:"small"},{default:_(()=>[E(C(u.name)+" "+C(u.version),1)]),_:2},1024))),128)),r>0?(m(),$(i,{key:0,type:"info",size:"small"},{default:_(()=>[E("+"+C(r)+" more",1)]),_:2},1024)):z("",!0)]),measure:_(({item:a})=>[c(i,{size:"small"},{default:_(()=>[E(C(a.name)+" "+C(a.version),1)]),_:2},1024)]),_:1},8,["list","getKey"])}}}),Se={class:"h-[65vh]"},be=S({__name:"index",setup(l,{expose:e}){const t=k(!1),i=k(null),a=d=>{t.value=!0,i.value=d},r=()=>{t.value=!1,i.value=null},u=d=>{i.value&&i.value(d)};return e({open:a,close:r}),(d,p)=>(m(),$(X,{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=f=>t.value=f),title:"项目文件夹",width:"50%","show-close":""},{default:_(()=>[v("div",Se,[c(G,{onSelect:u})])]),_:1},8,["modelValue"]))}}),tt=S({__name:"index",props:{id:{type:String,default:""},name:{type:String,default:""},version:{type:String,default:""}},emits:["downloadSuccess"],setup(l,{emit:e}){const t=l,i=e,a=I("dialogVueFinder");async function r(d){!d()||await U.confirm("当前选择的版本为:"+t.version+",确认下载吗?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).catch(()=>{})!=="confirm"||a.value?.open(u)}async function u(d){const p=ee.service({lock:!0,text:"组件下载中..."});try{if(await U.confirm(B.CONFIRM.DOWNLOAD(d.path),"提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).catch(()=>{})!=="confirm")return;const o=await P({compId:t.id,savePath:d.path,compName:t.name,version:t.version}),{isRepeat:n=!1}=o.data;if(n){if(await U.confirm(B.CONFIRM.COVER(t.name),"提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).catch(()=>{})!=="confirm"){p.close();return}await P({compId:t.id,savePath:d.path,compName:t.name,isCover:!0,version:t.version})}te.success(B.SUCCESS.DOWNLOAD),i("downloadSuccess"),a.value?.close()}finally{p.close()}}return(d,p)=>{const f=b("el-link");return m(),w(V,null,[c(Z,null,{default:_(({isLogin:o})=>[T(d.$slots,"default",{downloadHandler:r,isLogin:o},()=>[c(f,{type:"primary",link:"",onClick:n=>r(o)},{default:_(()=>[...p[0]||(p[0]=[E(" 下载 ",-1)])]),_:1},8,["onClick"])])]),_:3}),c(be,{ref:"dialogVueFinder",onDownload:u},null,512)],64)}}}),$e={class:"size-full",ref:"content"},ke=S({__name:"index",props:se({text:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){ne(f=>({v1153a1d3:p.value}));const e=I("textContainer"),t=I("content"),i=I("singleLine"),{height:a}=L(t),{height:r}=L(i),u=ae(l,"modelValue"),d=l,p=D(()=>!r.value||!a.value?1:Math.floor(a.value/r.value));return oe(async()=>{if(d.text){await le();const f=e.value;if(!f)return;u.value=f.scrollHeight>f.clientHeight}}),(f,o)=>(m(),w("div",$e,[v("div",{class:"text-container",ref:"textContainer"},C(l.text),513),v("div",{class:"text-single",ref:"singleLine"},C(l.text),513)],512))}}),Te=A(ke,[["__scopeId","data-v-8c47e69c"]]),Ee={class:"size-full"},Ve=S({__name:"index",props:{desc:{type:String,default:""}},setup(l){const e=k(!1);return(t,i)=>{const a=b("el-popover");return m(),w("div",Ee,[c(a,{disabled:!e.value,content:l.desc,placement:"bottom",width:"300","show-after":700},{reference:_(()=>[c(Te,{modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=r=>e.value=r),text:l.desc,class:"text-[#666] text-[12px]"},null,8,["modelValue","text"])]),_:1},8,["disabled","content"])])}}}),Me={class:"flex justify-center items-end gap-[5px]"},Ie={class:"text-[12px]"},De=S({__name:"index",props:{nickname:{type:String,default:""},avatar:{type:String,default:""},teamUserNickname:{type:String,default:""}},setup(l){return(e,t)=>(m(),w("div",Me,[v("span",Ie,C(l.teamUserNickname||l.nickname),1),c(ie,{size:15,src:l.avatar},null,8,["src"])]))}}),Fe=A(De,[["__scopeId","data-v-54ba0ed5"]]),Ne={class:"flex items-center gap-2 truncate"},Ue={class:"text-[12px]"},Be={class:"text-[12px]"},R=S({__name:"index",props:{label:{type:String,default:""},value:{type:[String,Number],default:""}},setup(l){return(e,t)=>(m(),w("div",Ne,[v("span",Ue,C(l.label),1),T(e.$slots,"value",{},()=>[v("span",Be,C(l.value),1)])]))}}),Oe={class:"flex justify-end items-center"},Pe={class:"text-xs"},Le={class:"text-left flex-1 flex flex-col w-full overflow-hidden my-1 gap-[5px]"},Re={class:"flex justify-between"},ze={class:"font-medium"},Ae={class:"desc-content flex-1 overflow-hidden relative"},He={class:"overflow-hidden w-full flex items-center justify-between"},je={class:"flex gap-[5px]"},Ke=S({__name:"Item",setup(l){const e=ce(),t=W(e._id)(),i=re(),a=D(()=>{const o=t.versionToFileAccessPath[e.version]??[],n=new Map(o.map(({path:s,signedUrl:h})=>[s,h]));return e.previewConfigs.filter(s=>s.miniPath?.length).slice(0,3).map(s=>{const h=xe(s.miniPath.at(-1)??"");return{finalEntryUrl:n.get(h)??""}})}),r=D(()=>ge(e.dep)),u=D(()=>{const o=a.value.length===1?"none":"";return{previews:a.value,dep:e.dep,signedUrls:t.versionToFileAccessPath[e.version]??[],depToFile:t.depEntryNameToFile[e.version]??{},indicatorPosition:o}});async function d(){const{version:o}=e;let n=null,s=null;t.versionToFileAccessPath[o]||(n=await f()),t.depEntryNameToFile[o]||(s=await p()),s&&t.setDepEntryNameToFile(o,s),n&&t.setVersionToFileAccessPath(o,n)}async function p(){const{dep:o}=e,n=ye(o,i.deps).map(g=>g.name),s=await Ce({deps:n}),{entryNameToFile:h={}}=s.data;return h}async function f(){const{objectId:o,version:n,files:s}=e,h={objectId:o,version:n,files:s.map(M=>M.path)},g=await de(h),{signedUrls:y}=g.data;return y}return O(()=>e.version,async()=>{await d()}),H(async()=>{const o=await f();t.setVersionToFileAccessPath(e.version,o)}),(o,n)=>{const s=b("el-card"),h=b("el-color-picker");return m(),w(V,null,[c(ve,{class:"flex flex-col gap-1 h-[280px] overflow-hidden",bg:x(e).bgColor},{default:_(({bg:g,updateColor:y})=>[c(s,{"body-class":"!p-0",class:"flex-1",style:ue({backgroundColor:g})},{default:_(()=>[c(_e,N(u.value,{autoplay:""}),null,16)]),_:1},8,["style"]),v("div",Oe,[T(o.$slots,"compItemToolBar",{attrs:x(e)}),v("span",Pe,[n[0]||(n[0]=E("背景板:",-1)),c(h,{modelValue:g,onChange:y,clearable:""},null,8,["modelValue","onChange"])])])]),_:3},8,["bg"]),v("div",Le,[v("div",Re,[v("h4",ze,C(x(e).name),1),v("div",null,[c(Fe,N(x(e).authorId,{teamUserNickname:x(e).teamUserNickname}),null,16,["teamUserNickname"])])]),v("div",Ae,[c(Ve,{desc:x(e).desc},null,8,["desc"])]),c(we,{compDeps:r.value},null,8,["compDeps"])]),T(o.$slots,"compItemFooter",{attrs:x(e)},()=>[v("div",He,[v("div",je,[c(R,{label:"下载",value:Math.max(x(e).totalDownloadCount,0)},null,8,["value"]),x(e).collectCount!==void 0?(m(),$(R,{key:0,label:"收藏",value:Math.max(x(e).collectCount,0)},null,8,["value"])):z("",!0)]),T(o.$slots,"compItemFooterOperate",{attrs:x(e)})])])],64)}}}),We={class:"size-full overflow-x-hidden"},st=S({__name:"index",setup(l){const e=pe(),t=j(K.COMP_LIST_STORE);return(i,a)=>{const r=b("el-card");return m(),w("div",We,[c(me,{isEmpty:x(t).isEmpty,class:"size-full"},{default:_(()=>[c(he,{itemMinWidth:310},{default:_(()=>[(m(!0),w(V,null,F(x(t).list,u=>(m(),$(r,{key:u._id,"body-style":"padding: 5px"},{default:_(()=>[c(Ke,N({ref_for:!0},u),fe({_:2},[F(x(e),(d,p)=>({name:p,fn:_(f=>[T(i.$slots,p,N({ref_for:!0},f))])}))]),1040)]),_:2},1024))),128))]),_:3})]),_:3},8,["isEmpty"])])}}}),Ye={class:"w-[100px]"},nt=S({__name:"index",props:{id:{type:String,default:""},version:{type:String,default:""}},setup(l){const e=l,t=W(e.id)(),i=j(K.COMP_LIST_STORE),a=k(""),r=k(!1),u=k([]);async function d(){if(r.value)return;const n=await q({compId:e.id});r.value=!0,u.value=n.data.map(s=>({value:s.version,label:s.version}))}function p(n){a.value=n}function f(){u.value=[{value:e.version,label:e.version}],a.value=e.version}async function o(n){const s=t.detail[n];if(s){const{totalDownloadCount:h,collectCount:g,isCollect:y,...M}=s;i.updateCompListItemById(e.id,{...M,_id:e.id});return}await J({compId:e.id,version:n}).then(h=>{const g=h.data,{totalDownloadCount:y,collectCount:M,isCollect:Ge,...Y}=g;i.updateCompListItemById(e.id,{...Y,_id:e.id}),t.setDetail(n,g)})}return O(()=>a.value,(n,s)=>{n===s||!s||o(n)}),O(()=>e.version,(n,s)=>{n===s||!s||(a.value=n)}),H(()=>{f()}),(n,s)=>{const h=b("el-option"),g=b("el-select");return m(),w("div",Ye,[c(g,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=y=>a.value=y),onChange:p,onVisibleChange:d},{default:_(()=>[(m(!0),w(V,null,F(u.value,y=>(m(),$(h,{key:y.value,label:y.label,value:y.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])}}});export{Te as T,Fe as U,we as _,tt as a,st as b,nt as c,R as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,r as _,c as E,b as C,ab as S,w as p,o as f,v as L,a6 as m,B as O,a9 as i,a8 as B,E as T,aa as x,a5 as d}from"./index-
|
|
1
|
+
import{d as u,r as _,c as E,b as C,ab as S,w as p,o as f,v as L,a6 as m,B as O,a9 as i,a8 as B,E as T,aa as x,a5 as d}from"./index-ChPcVXrX.js";import{_ as M,h as y}from"./index.vue_vue_type_script_setup_true_lang-CklfPaMl.js";const I={class:"collect"},g=u({__name:"index",props:{isCollect:{type:Boolean,default:!1}},emits:["collect"],setup(c,{emit:l}){const s=c,e=l;function n(){e("collect",!s.isCollect)}return(a,t)=>{const o=_("StarFilled"),r=_("el-icon");return f(),E("div",I,[C(r,{class:S(["collect-icon",{"is-collect":c.isCollect}]),onClick:n},{default:p(()=>[C(o)]),_:1},8,["class"])])}}}),h=L(g,[["__scopeId","data-v-25eb2692"]]),N=u({__name:"index",props:{id:{type:String,default:""},name:{type:String,default:""},isCollect:{type:Boolean,default:!1},collectCount:{type:Number,default:0}},setup(c){const l=m(d.COMP_LIST_STORE),s=m(d.CALLBACKS),e=c;async function n(a){if(a()&&e.isCollect!==void 0){if(e.isCollect){const t=i.CONFIRM.UNCOLLECT(e.name);if(await B.confirm(t,"取消收藏",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).catch(()=>{})!=="confirm")return}y({compId:e.id,isCollect:!e.isCollect}).then(()=>{T.success(e.isCollect?i.SUCCESS.UNCOLLECT:i.SUCCESS.COLLECT);const t={...e,isCollect:!e.isCollect};e.isCollect?(l.updateCompListItemById(e.id,{...t,collectCount:e.collectCount-1}),s.get(x.AFTER_COMP_CANCEL_COLLECT)?.(e.id)):l.updateCompListItemById(e.id,{...t,collectCount:e.collectCount+1})})}}return(a,t)=>(f(),O(M,null,{default:p(({isLogin:o})=>[C(h,{isCollect:c.isCollect,onCollect:r=>n(o)},null,8,["isCollect","onCollect"])]),_:1}))}});export{N as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as ye,m as Me,aP as ie,aQ as Oe,d as Pe,i as xe,aR as Ie,j as Fe,aS as He,y as We,x as Ue,D as Ne,c as $e,a as je,o as ze}from"./index-
|
|
1
|
+
import{k as ye,m as Me,aP as ie,aQ as Oe,d as Pe,i as xe,aR as Ie,j as Fe,aS as He,y as We,x as Ue,D as Ne,c as $e,a as je,o as ze}from"./index-ChPcVXrX.js";var me={exports:{}},Ee;function Ke(){return Ee||(Ee=1,(function(Q,J){(function(Z,K){Q.exports=K()})(globalThis,(()=>(()=>{var Z={4567:function(u,n,o){var l=this&&this.__decorate||function(e,i,a,v){var p,m=arguments.length,f=m<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,a,v);else for(var S=e.length-1;S>=0;S--)(p=e[S])&&(f=(m<3?p(f):m>3?p(i,a,f):p(i,a))||f);return m>3&&f&&Object.defineProperty(i,a,f),f},d=this&&this.__param||function(e,i){return function(a,v){i(a,v,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const s=o(9042),h=o(9924),_=o(844),g=o(4725),c=o(2585),t=o(3656);let r=n.AccessibilityManager=class extends _.Disposable{constructor(e,i,a,v){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=v,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new h.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((p=>this._handleResize(p.rows)))),this.register(this._terminal.onRender((p=>this._refreshRows(p.start,p.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((p=>this._handleChar(p)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
2
2
|
`)))),this.register(this._terminal.onA11yTab((p=>this._handleTab(p)))),this.register(this._terminal.onKey((p=>this._handleKey(p.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,t.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=s.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){const a=this._terminal.buffer,v=a.lines.length.toString();for(let p=e;p<=i;p++){const m=a.lines.get(a.ydisp+p),f=[],S=m?.translateToString(!0,void 0,void 0,f)||"",E=(a.ydisp+p+1).toString(),k=this._rowElements[p];k&&(S.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=S,this._rowColumns.set(k,f)),k.setAttribute("aria-posinset",E),k.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){const a=e.target,v=this._rowElements[i===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==v)return;let p,m;if(i===0?(p=a,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(p=this._rowElements.shift(),m=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){const f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{const f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===a.node&&i.offset>a.offset)&&([i,a]=[a,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;const v=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(v)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:v,offset:v.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:S,offset:E})=>{const k=S instanceof Text?S.parentNode:S;let A=parseInt(k?.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const w=this._rowColumns.get(k);if(!w)return console.warn("columns is null. Race condition?"),null;let R=E<w.length?w[E]:w.slice(-1)[0]+1;return R>=this._terminal.cols&&(++A,R=0),{row:A,column:R}},m=p(i),f=p(a);if(m&&f){if(m.row>f.row||m.row===f.row&&m.column>=f.column)throw new Error("invalid range");this._terminal.select(m.column,m.row,(f.row-m.row)*this._terminal.cols-m.column+f.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=r=l([d(1,c.IInstantiationService),d(2,g.ICoreBrowserService),d(3,g.IRenderService)],r)},3614:(u,n)=>{function o(h){return h.replace(/\r?\n/g,"\r")}function l(h,_){return _?"\x1B[200~"+h+"\x1B[201~":h}function d(h,_,g,c){h=l(h=o(h),g.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(h,!0),_.value=""}function s(h,_,g){const c=g.getBoundingClientRect(),t=h.clientX-c.left-10,r=h.clientY-c.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${t}px`,_.style.top=`${r}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=o,n.bracketTextForPaste=l,n.copyHandler=function(h,_){h.clipboardData&&h.clipboardData.setData("text/plain",_.selectionText),h.preventDefault()},n.handlePasteEvent=function(h,_,g,c){h.stopPropagation(),h.clipboardData&&d(h.clipboardData.getData("text/plain"),_,g,c)},n.paste=d,n.moveTextAreaUnderMouseCursor=s,n.rightClickHandler=function(h,_,g,c,t){s(h,_,g),t&&c.rightClickSelect(h),_.value=c.selectionText,_.select()}},7239:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const l=o(1505);n.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(d,s,h){this._css.set(d,s,h)}getCss(d,s){return this._css.get(d,s)}setColor(d,s,h){this._color.set(d,s,h)}getColor(d,s){return this._color.get(d,s)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(o,l,d,s){o.addEventListener(l,d,s);let h=!1;return{dispose:()=>{h||(h=!0,o.removeEventListener(l,d,s))}}}},3551:function(u,n,o){var l=this&&this.__decorate||function(r,e,i,a){var v,p=arguments.length,m=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,e,i,a);else for(var f=r.length-1;f>=0;f--)(v=r[f])&&(m=(p<3?v(m):p>3?v(e,i,m):v(e,i))||m);return p>3&&m&&Object.defineProperty(e,i,m),m},d=this&&this.__param||function(r,e){return function(i,a){e(i,a,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const s=o(3656),h=o(8460),_=o(844),g=o(2585),c=o(4725);let t=n.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(r,e,i,a,v){super(),this._element=r,this._mouseService=e,this._renderService=i,this._bufferService=a,this._linkProviderService=v,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new h.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new h.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,s.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,s.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,s.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,s.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(r){this._lastMouseEvent=r;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const i=r.composedPath();for(let a=0;a<i.length;a++){const v=i[a];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(r){if(this._activeLine!==r.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(r,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,r)||(this._clearCurrentLink(),this._askForLink(r,!0))}_askForLink(r,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach((a=>{a?.forEach((v=>{v.link.dispose&&v.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=r.y);let i=!1;for(const[a,v]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(i=this._checkLinkProviderResult(a,r,i)):v.provideLinks(r.y,(p=>{if(this._isMouseOut)return;const m=p?.map((f=>({link:f})));this._activeProviderReplies?.set(a,m),i=this._checkLinkProviderResult(a,r,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies)}))}_removeIntersectingLinks(r,e){const i=new Set;for(let a=0;a<e.size;a++){const v=e.get(a);if(v)for(let p=0;p<v.length;p++){const m=v[p],f=m.link.range.start.y<r?0:m.link.range.start.x,S=m.link.range.end.y>r?this._bufferService.cols:m.link.range.end.x;for(let E=f;E<=S;E++){if(i.has(E)){v.splice(p--,1);break}i.add(E)}}}}_checkLinkProviderResult(r,e,i){if(!this._activeProviderReplies)return i;const a=this._activeProviderReplies.get(r);let v=!1;for(let p=0;p<r;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(v=!0);if(!v&&a){const p=a.find((m=>this._linkAtPosition(m.link,e)));p&&(i=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let p=0;p<this._activeProviderReplies.size;p++){const m=this._activeProviderReplies.get(p)?.find((f=>this._linkAtPosition(f.link,e)));if(m){i=!0,this._handleNewLink(m);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(r){if(!this._currentLink)return;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(r,this._currentLink.link.text)}_clearCurrentLink(r,e){this._currentLink&&this._lastMouseEvent&&(!r||!e||this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(r){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(r.link,e)&&(this._currentLink=r,this._currentLink.state={decorations:{underline:r.link.decorations===void 0||r.link.decorations.underline,pointerCursor:r.link.decorations===void 0||r.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,r.link,this._lastMouseEvent),r.link.decorations={},Object.defineProperties(r.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(r.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((i=>{if(!this._currentLink)return;const a=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(a,v),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}}))))}_linkHover(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&r.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(r,e){const i=r.range,a=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-a-1,i.end.x,i.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&r.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(r,e){const i=r.range.start.y*this._bufferService.cols+r.range.start.x,a=r.range.end.y*this._bufferService.cols+r.range.end.x,v=e.y*this._bufferService.cols+e.x;return i<=v&&v<=a}_positionFromMouseEvent(r,e,i){const a=i.getCoords(r,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(r,e,i,a,v){return{x1:r,y1:e,x2:i,y2:a,cols:this._bufferService.cols,fg:v}}};n.Linkifier=t=l([d(1,c.IMouseService),d(2,c.IRenderService),d(3,g.IBufferService),d(4,c.ILinkProviderService)],t)},9042:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,n,o){var l=this&&this.__decorate||function(c,t,r,e){var i,a=arguments.length,v=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(c,t,r,e);else for(var p=c.length-1;p>=0;p--)(i=c[p])&&(v=(a<3?i(v):a>3?i(t,r,v):i(t,r))||v);return a>3&&v&&Object.defineProperty(t,r,v),v},d=this&&this.__param||function(c,t){return function(r,e){t(r,e,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const s=o(511),h=o(2585);let _=n.OscLinkProvider=class{constructor(c,t,r){this._bufferService=c,this._optionsService=t,this._oscLinkService=r}provideLinks(c,t){const r=this._bufferService.buffer.lines.get(c-1);if(!r)return void t(void 0);const e=[],i=this._optionsService.rawOptions.linkHandler,a=new s.CellData,v=r.getTrimmedLength();let p=-1,m=-1,f=!1;for(let S=0;S<v;S++)if(m!==-1||r.hasContent(S)){if(r.loadCell(S,a),a.hasExtendedAttrs()&&a.extended.urlId){if(m===-1){m=S,p=a.extended.urlId;continue}f=a.extended.urlId!==p}else m!==-1&&(f=!0);if(f||m!==-1&&S===v-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const k={start:{x:m+1,y:c},end:{x:S+(f||S!==v-1?0:1),y:c}};let A=!1;if(!i?.allowNonHttpProtocols)try{const w=new URL(E);["http:","https:"].includes(w.protocol)||(A=!0)}catch{A=!0}A||e.push({text:E,range:k,activate:(w,R)=>i?i.activate(w,R,k):g(0,R),hover:(w,R)=>i?.hover?.(w,R,k),leave:(w,R)=>i?.leave?.(w,R,k)})}f=!1,a.hasExtendedAttrs()&&a.extended.urlId?(m=S,p=a.extended.urlId):(m=-1,p=-1)}}t(e)}};function g(c,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aA as v,d as _,k as w,m as x,
|
|
1
|
+
import{aA as v,d as _,k as w,m as x,bL as b,r as y,B as C,w as i,b as h,f as T,t as k,ai as B,o as S}from"./index-ChPcVXrX.js";async function N(n,l){return v("/__remote__/api/v1/email/sendCode",{method:"POST",headers:{"Content-Type":"application/json"},data:n})}const V=_({__name:"index",props:{type:{default:"primary"},disabled:{type:Boolean,default:!1},text:{default:"获取验证码"},countdownText:{default:"{n}秒后重试"},duration:{default:60}},emits:["send","finish"],setup(n,{expose:l,emit:r}){const a=n,s=r,e=w(0);let t=null;const u=x(()=>e.value>0?a.countdownText.replace("{n}",e.value.toString()):a.text),d=()=>{e.value=a.duration,t=window.setInterval(()=>{e.value--,e.value<=0&&(clearInterval(t),t=null,s("finish"))},1e3)},c=async o=>{a.disabled||e.value>0||(o.start(),s("send",{end:o.end,startCountdown:d}))};return b(()=>{t&&(clearInterval(t),t=null)}),l({startCountdown:d,getCountdown:()=>e.value}),(o,g)=>{const p=y("el-button");return S(),C(B,null,{default:i(({instance:f,loading:m})=>[h(p,{type:n.type,loading:m,disabled:n.disabled||e.value>0,onClick:I=>c(f),class:"whitespace-nowrap"},{default:i(()=>[T(k(u.value),1)]),_:1},8,["type","loading","disabled","onClick"])]),_:1})}}});export{V as _,N as e};
|