@nuxt/devtools 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -3
- package/dist/chunks/module-main.mjs +31 -15
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +24 -24
- package/dist/client/404.html +24 -24
- package/dist/client/{modules/middleware → __blank}/index.html +24 -24
- package/dist/client/_nuxt/{CodeDiff.vue.09a831fc.js → CodeDiff.vue.4fcef1e4.js} +1 -1
- package/dist/client/_nuxt/{ComposableItem.vue.770ce9d1.js → ComposableItem.vue.b4d03c6d.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaButton.vue.65a9244c.js → DataSchemaButton.vue.18fef0d4.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaDrawer.939e0d36.js → DataSchemaDrawer.714650a4.js} +1 -1
- package/dist/client/_nuxt/{DurationDisplay.vue.3abddd08.js → DurationDisplay.vue.dd0f91f1.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.66158bcd.js → FilepathItem.vue.a1b71b8d.js} +1 -1
- package/dist/client/_nuxt/{HelpFab.vue.074157ff.js → HelpFab.vue.f0924b60.js} +1 -1
- package/dist/client/_nuxt/LaunchPage.vue.c617b6d5.js +1 -0
- package/dist/client/_nuxt/{NBadge.532c6829.js → NBadge.ff27dca2.js} +1 -1
- package/dist/client/_nuxt/NCheckbox.vue.b56304c9.js +1 -0
- package/dist/client/_nuxt/{NCodeBlock.vue.d4a74ca4.js → NCodeBlock.vue.9ce69690.js} +2 -2
- package/dist/client/_nuxt/{NDrawer.vue.f03c3dec.js → NDrawer.vue.2b176b54.js} +1 -1
- package/dist/client/_nuxt/NDropdown.vue.e90fcd0b.js +1 -0
- package/dist/client/_nuxt/{NIconTitle.vue.5caf9fc5.js → NIconTitle.vue.7b846ffe.js} +1 -1
- package/dist/client/_nuxt/{NLink.vue.c05eef3c.js → NLink.vue.9859bf11.js} +1 -1
- package/dist/client/_nuxt/{NMarkdown.vue.52b3ce56.js → NMarkdown.vue.79860402.js} +1 -1
- package/dist/client/_nuxt/NNavbar.vue.737ef1b1.js +1 -0
- package/dist/client/_nuxt/NSectionBlock.acf7c6ed.js +1 -0
- package/dist/client/_nuxt/NSelect.vue.04805728.js +1 -0
- package/dist/client/_nuxt/NSelectTabs.vue.626ecbdd.js +1 -0
- package/dist/client/_nuxt/NSwitch.vue.ff927669.js +1 -0
- package/dist/client/_nuxt/{NTip.vue.7a94f00d.js → NTip.vue.c98a31a2.js} +1 -1
- package/dist/client/_nuxt/StateEditor.vue.1c34496c.js +1 -0
- package/dist/client/_nuxt/__blank.eaeade3a.js +1 -0
- package/dist/client/_nuxt/{analyze-build.2cdd206f.js → analyze-build.92ac65df.js} +1 -1
- package/dist/client/_nuxt/assets.c6f47fab.js +16 -0
- package/dist/client/_nuxt/client.17f79a3c.js +1 -0
- package/dist/client/_nuxt/components.80a04311.js +98 -0
- package/dist/client/_nuxt/{constants.4e5eba24.js → constants.2cc6e981.js} +1 -1
- package/dist/client/_nuxt/{css.a67813b3.js → css.f61fd02b.js} +3 -3
- package/dist/client/_nuxt/custom-_name_.b17c1362.js +1 -0
- package/dist/client/_nuxt/{default.de670135.js → default.201686e7.js} +1 -1
- package/dist/client/_nuxt/entry.909ad6c7.js +27 -0
- package/dist/client/_nuxt/entry.aac067b6.css +1 -0
- package/dist/client/_nuxt/{error-404.b43ed6fa.js → error-404.18967c67.js} +1 -1
- package/dist/client/_nuxt/{error-500.9a32d319.js → error-500.dcd91098.js} +1 -1
- package/dist/client/_nuxt/{full.44b6f3d9.js → full.a9db422e.js} +1 -1
- package/dist/client/_nuxt/{hooks.85310903.js → hooks.ad5f725f.js} +1 -1
- package/dist/client/_nuxt/{html.af01869e.js → html.14085b69.js} +1 -1
- package/dist/client/_nuxt/{imports.3e92b5b9.js → imports.468b0281.js} +1 -1
- package/dist/client/_nuxt/index.86b321d0.js +1 -0
- package/dist/client/_nuxt/{index.370f8c55.js → index.dacd63c3.js} +1 -1
- package/dist/client/_nuxt/{json-editor-vue.724e0801.js → json-editor-vue.8a771ed0.js} +2 -2
- package/dist/client/_nuxt/modules.dc1dbdef.js +2 -0
- package/dist/client/_nuxt/{none.06949a5f.js → none.37b64ac4.js} +1 -1
- package/dist/client/_nuxt/open-graph.03011848.js +3 -0
- package/dist/client/_nuxt/open-graph.484b1a77.css +1 -0
- package/dist/client/_nuxt/overview.acf4105d.js +1 -0
- package/dist/client/_nuxt/pages.061895e9.js +1 -0
- package/dist/client/_nuxt/payload.b7f38f74.js +1 -0
- package/dist/client/_nuxt/{plugins.f261769b.js → plugins.59bd86e7.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs.a5615107.js → runtime-configs.aaa20729.js} +1 -1
- package/dist/client/_nuxt/server-routes.c8d34f99.js +9 -0
- package/dist/client/_nuxt/settings.12ae4ad7.js +1 -0
- package/dist/client/_nuxt/shellscript.e25d1410.js +4 -0
- package/dist/client/_nuxt/{state-components.1d5849c5.js → state-components.a78445e5.js} +1 -1
- package/dist/client/_nuxt/state-modules.199ca5da.js +1 -0
- package/dist/client/_nuxt/storage-options.aeaf572e.js +1 -0
- package/dist/client/_nuxt/{storage.cb6d643c.js → storage.f2e2d671.js} +1 -1
- package/dist/client/_nuxt/{terminals.06dde221.js → terminals.091a556d.js} +1 -1
- package/dist/client/_nuxt/timeline.1210bb98.js +29 -0
- package/dist/client/_nuxt/{unocss-runtime.1dfe0ac4.js → unocss-runtime.c55f86fd.js} +1 -1
- package/dist/client/_nuxt/virtual-files.7767a81f.js +1 -0
- package/dist/client/_nuxt/{vitesse-dark.ab479e3d.js → vitesse-dark.ff0e7dcb.js} +1 -1
- package/dist/client/_nuxt/{vitesse-light.696edcfd.js → vitesse-light.c6996724.js} +1 -1
- package/dist/client/_nuxt/{vue-html.0806679f.js → vue-html.88dda4a8.js} +1 -1
- package/dist/client/_nuxt/{vue.24311fdc.js → vue.7ad3b25a.js} +3 -3
- package/dist/client/index.html +24 -24
- package/dist/client/modules/analyze-build/index.html +24 -24
- package/dist/client/modules/assets/index.html +24 -24
- package/dist/client/modules/components/index.html +24 -24
- package/dist/client/modules/hooks/index.html +24 -24
- package/dist/client/modules/imports/index.html +24 -24
- package/dist/client/modules/modules/index.html +24 -24
- package/dist/client/modules/open-graph/index.html +24 -24
- package/dist/client/modules/overview/index.html +24 -24
- package/dist/client/modules/pages/index.html +24 -24
- package/dist/client/modules/payload/index.html +24 -24
- package/dist/client/modules/plugins/index.html +24 -24
- package/dist/client/modules/runtime-configs/index.html +24 -24
- package/dist/client/modules/server-routes/index.html +24 -24
- package/dist/client/modules/storage/index.html +24 -24
- package/dist/client/modules/terminals/index.html +24 -24
- package/dist/client/modules/timeline/index.html +24 -24
- package/dist/client/modules/virtual-files/index.html +24 -24
- package/dist/client/settings/index.html +24 -24
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/view/client.mjs +1 -1
- package/dist/shared/{devtools.d18bab28.mjs → devtools.ca660ec5.mjs} +31 -1
- package/package.json +11 -11
- package/dist/client/_nuxt/LaunchPage.vue.20d8d836.js +0 -1
- package/dist/client/_nuxt/NCheckbox.vue.83a6e70e.js +0 -1
- package/dist/client/_nuxt/NDropdown.vue.885f70c3.js +0 -1
- package/dist/client/_nuxt/NNavbar.vue.0f176f87.js +0 -1
- package/dist/client/_nuxt/NSectionBlock.43816001.js +0 -1
- package/dist/client/_nuxt/NSelect.vue.dcac9c73.js +0 -1
- package/dist/client/_nuxt/NSelectTabs.vue.411a7347.js +0 -1
- package/dist/client/_nuxt/NSwitch.vue.aacb5de3.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.e862f0c1.js +0 -1
- package/dist/client/_nuxt/assets.41fcf77e.js +0 -16
- package/dist/client/_nuxt/client.ab169146.js +0 -1
- package/dist/client/_nuxt/components.81bb7f4d.js +0 -98
- package/dist/client/_nuxt/custom-_name_.3060f125.js +0 -1
- package/dist/client/_nuxt/entry.9effa704.js +0 -27
- package/dist/client/_nuxt/entry.ebd8706b.css +0 -1
- package/dist/client/_nuxt/index.780a9ee0.js +0 -1
- package/dist/client/_nuxt/middleware.44a34c7b.js +0 -1
- package/dist/client/_nuxt/modules.24081f84.js +0 -2
- package/dist/client/_nuxt/open-graph.6cf823d3.js +0 -3
- package/dist/client/_nuxt/overview.86a88207.js +0 -1
- package/dist/client/_nuxt/pages.23eb0566.js +0 -1
- package/dist/client/_nuxt/payload.1baa204b.js +0 -1
- package/dist/client/_nuxt/server-routes.2022f4ba.js +0 -9
- package/dist/client/_nuxt/settings.ab7b45b3.js +0 -1
- package/dist/client/_nuxt/shellscript.9d056341.js +0 -4
- package/dist/client/_nuxt/state-modules.78318316.js +0 -1
- package/dist/client/_nuxt/storage-options.8ca9ecbc.js +0 -1
- package/dist/client/_nuxt/timeline.5add59be.js +0 -29
- package/dist/client/_nuxt/virtual-files.804fdba7.js +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{d as Z,Y as ee,r as T,Z as W,a0 as te,m as u,I as X,i as d,f as t,k as e,v as N,F as B,n as G,h as S,j as x,p as U,G as Y,a1 as de,a2 as pe,U as me,K as q,L as H,a3 as z,_ as ne,o,a4 as le,W as ae,a as I,a5 as fe,a6 as ve,a7 as ie,t as F,a8 as he,l as M,a9 as _e,b as se,aa as ge,e as xe,ab as be,ac as we,ad as ye,X as $e,ae as ke,af as Ce,ag as Ve,ah as Pe}from"./entry.909ad6c7.js";import{_ as Ae}from"./NCheckbox.vue.b56304c9.js";import{_ as De}from"./NDropdown.vue.e90fcd0b.js";import{_ as Fe}from"./NNavbar.vue.737ef1b1.js";import{_ as Ne}from"./NSectionBlock.acf7c6ed.js";import{_ as Se}from"./FilepathItem.vue.a1b71b8d.js";import{_ as Ie,u as Te}from"./storage-options.aeaf572e.js";import{_ as Ue}from"./NDrawer.vue.2b176b54.js";import{D as je}from"./constants.2cc6e981.js";import"./NIconTitle.vue.7b846ffe.js";import"./NCodeBlock.vue.9ce69690.js";import"./client.17f79a3c.js";const Ee={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},Le={for:"drop-zone-input","text-3xl":"",hover:"text-green cursor-pointer","transition-all":""},Be={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},ze=e("div",{px6:"",py6:""},[e("h1",{"text-2xl":""}," Upload "),e("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1),Me={grid:"~ cols-minmax-8rem gap-8","overflow-auto":"",p6:""},Oe={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Re=["src"],Ke={flex:"~ gap1","items-center":""},Xe={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Ge=Z({__name:"AssetDropZone",props:{modelValue:{type:Boolean,required:!0},folder:{type:String,required:!0}},setup(j){const l=j,m=ee(l,"modelValue"),n=T(),_=T([]);function f(a){n.value=a.target,m.value=!0}function D(a){a.target===n.value&&(m.value=!1)}function k(a){a.preventDefault()}function E(a){a.preventDefault(),y(a.dataTransfer.files)}function y(a){const g=Array.from(a||[]);if(g.length){const b=[],h=_.value.map(v=>v.name);for(const v of g)if(h.includes(v.name)){let w=1;const[V,K]=v.name.split(".");for(;h.includes(`${V} (${w}).${K}`);)w++;const r=`${V}-${w}.${K}`,s=new Blob([v],{type:v.type}),i=new File([s],r,{lastModified:Date.now()});b.push(i),h.push(r)}else v.type===""&&z({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}),b.push(v);_.value=[..._.value,...b]}}async function L(){if(de.value||pe.value)return;me("assets:upload");const a=[];for(const g of _.value){const b=new FileReader;b.readAsDataURL(g);const v=(await new Promise(w=>{b.onload=()=>w(b.result)})).split(";base64,").pop();a.push({path:g.name,encoding:"base64",content:v})}await q.writeStaticAssets(await H(),[...a],l.folder).then(()=>{p(),z({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(g=>{p(),z({message:`Error uploading files: ${g?.message??"unknown"}`,icon:"i-carbon-warning",classes:"text-red"})}),m.value=!1}function O(a){_.value?.splice(a,1)}function R(a){return URL.createObjectURL(a)}function $(a,g){const[b,h]=a.name.split("."),v=g.replace(/\.\w+$/,""),w=`${v}.${h}`;return v.length===0?(alert("File name must be at least 1 characters long"),b):(Object.defineProperty(a,"name",{value:w,writable:!1}),_.value.splice(_.value.indexOf(a),1,a),a)}function c(){_.value=[]}function p(){m.value=!1,c()}return W("dragenter",f),W("dragleave",D),W("dragover",k),W("drop",E),(a,g)=>{const b=ne,h=le,v=ae,w=te("tooltip");return o(),u("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:Y(t(m)?"opacity-100 visible":"opacity-0 invisible")},[X(d(b,{icon:"carbon-close",title:"Close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",border:!1,onClick:p},null,512),[[w,"Close",void 0,{"bottom-end":!0}]]),t(_)?.length?(o(),u("div",Be,[ze,e("div",Me,[(o(!0),u(B,null,G(t(_),(V,K)=>(o(),u("div",{key:V.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[e("div",Oe,[e("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:R(V)},null,8,Re)]),e("div",Ke,[d(v,{n:"xs","h-full":"","flex-auto":"","model-value":V.name,"onUpdate:modelValue":r=>$(V,r.target.value)},null,8,["model-value","onUpdate:modelValue"]),d(b,{n:"red",icon:"carbon-trash-can","h-full":"","flex-none":"",title:"Remove file",onClick:r=>O(K)},null,8,["onClick"])])]))),128))]),e("div",Xe,[t(_).length?(o(),S(b,{key:0,n:"red",onClick:c},{default:x(()=>[d(h,{icon:"carbon-clean"}),N(" Clear ")]),_:1})):U("",!0),d(b,{disabled:!t(_).length,n:"primary solid",onClick:L},{default:x(()=>[d(h,{icon:"carbon-cloud-upload"}),N(" Upload ")]),_:1},8,["disabled"])])])):(o(),u("div",Ee,[e("label",Le,[d(h,{icon:"carbon-cloud-upload","mr-2":""}),N(" Drop files here or click to select ")]),e("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:g[0]||(g[0]=V=>y(V.target.files))},null,32)]))],2)}}}),Ze=Z({__name:"AssetFontPreview",props:{asset:{}},setup(j){const l=j,m=I(()=>`devtools-assets-${fe(l.asset)}`);return ve(I(()=>`
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: '${m.value}';
|
|
4
|
+
src: url('${l.asset.publicPath}');
|
|
5
|
+
}
|
|
6
|
+
`)),(n,_)=>(o(),u("div",{"of-hidden":"",style:ie({fontFamily:`'${t(m)}'`})}," Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz ",4))}}),qe={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},We=["src"],Ye={key:2,"i-carbon-document":"","text-3xl":"",op20:""},He={key:3,"w-full":"","self-start":"",p4:""},Je=["textContent"],Qe={key:4},et=["src","autoplay","controls"],tt={key:5},nt={key:0,"i-carbon-volume-up":"","text-3xl":"",op20:""},ot=["src"],st={key:6,"i-carbon-help":"","text-3xl":"",op20:""},re=Z({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(j){return(l,m)=>{const n=Ze;return o(),u("div",qe,[l.asset.type==="image"?(o(),u("img",{key:0,src:l.asset.publicPath},null,8,We)):l.asset.type==="font"?(o(),S(n,{key:l.asset.publicPath,asset:l.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):l.asset.type==="text"&&!l.textContent?(o(),u("div",Ye)):l.asset.type==="text"&&l.textContent?(o(),u("div",He,[e("pre",{"max-h-10rem":"","of-hidden":"","text-xs":"","font-mono":"",textContent:F(l.textContent)},null,8,Je)])):l.asset.type==="video"?(o(),u("div",Qe,[e("video",{src:l.asset.publicPath,autoplay:l.detail,controls:l.detail},null,8,et)])):l.asset.type==="audio"?(o(),u("div",tt,[l.detail?(o(),u("audio",{key:1,src:l.asset.publicPath,controls:""},null,8,ot)):(o(),u("div",nt))])):(o(),u("div",st))])}}}),lt={flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},at={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},it=Z({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(j){const l=j,m=I(()=>l.folder&&l.asset.path.startsWith(l.folder)?l.asset.path.slice(l.folder.length):l.asset.path);return(n,_)=>{const f=re;return o(),u("button",lt,[d(f,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:n.asset},null,8,["asset"]),e("div",at,F(t(m)),1)])}}}),ue=Z({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(j,{emit:l}){const m=j,n=ee(m,"modelValue",l,{passive:!0}),_=I(()=>m.item?.children?.length),f=T(!0),D=I(()=>_.value?"i-carbon-folder":m.item.type==="image"?"i-carbon-image":m.item.type==="video"?"i-carbon-video":m.item.type==="audio"?"i-carbon-volume-up":m.item.type==="font"?"i-carbon-text-small-caps":m.item.type==="text"?"i-carbon-document":m.item.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(k,E)=>{const y=le,L=ue;return o(),u("div",null,[e("button",{flex:"~ gap-2","w-full":"","items-center":"",hover:"bg-active",px4:"",py1:"",style:ie({paddingLeft:`calc(1rem + ${k.index*1.5}em)`}),class:Y({"bg-active":!t(_)&&t(n)?.filePath===k.item?.filePath}),border:"b base",onClick:E[0]||(E[0]=O=>t(_)?f.value=!t(f):n.value=k.item)},[e("div",{class:Y(t(D))},null,2),e("span",{class:Y({"flex items-center":t(_)}),"flex-auto":"","text-start":"","text-sm":"","font-mono":""},F(k.item.path),3),t(_)?(o(),S(y,{key:0,icon:"carbon:chevron-right","transform-rotate":t(f)?90:0,transition:""},null,8,["transform-rotate"])):U("",!0)],6),t(f)?he(k.$slots,"default",{key:0},()=>[(o(!0),u(B,null,G(k.item?.children,O=>(o(),S(L,{key:O.filepath,modelValue:t(n),"onUpdate:modelValue":E[1]||(E[1]=R=>M(n)?n.value=R:null),item:O,index:k.index+1},null,8,["modelValue","item","index"]))),128))]):U("",!0)])}}}),rt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},ut=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Preview "),e("div",{"x-divider":""})],-1),ct={flex:"~","items-center":"","justify-center":""},dt=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Details "),e("div",{"x-divider":""})],-1),pt={"max-w-full":"","w-full":"","table-fixed":""},mt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1),ft={flex:"~ gap-1","w-full":"","items-center":""},vt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1),ht={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},_t={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},gt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1),xt={capitalize:""},bt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1),wt={key:0},yt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1),$t=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1),kt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1),Ct={op70:""},Vt=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Actions "),e("div",{"x-divider":""})],-1),Pt={flex:"~ gap2 wrap"},At=e("div",{"flex-auto":""},null,-1),Dt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Ft=e("span",null," Are you sure you want to delete this asset? ",-1),Nt={flex:"~ gap2 wrap justify-center"},St={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},It={flex:"~ gap2 wrap justify-center"},Tt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},Ut=["onKeydown"],jt={flex:"","justify-end":"","gap-4":""},Et=Z({__name:"AssetDetails",props:{modelValue:{}},setup(j,{emit:l}){const n=ee(j,"modelValue",l,{passive:!0}),_=_e(),f=se(()=>{if(n.value.type==="image")return q.getImageMeta(n.value.filePath)}),D=T(!1),k=T(),E=T(0),y=se(async()=>{if(n.value.type!=="text")return;E.value;const r=await q.getTextAssetContent(n.value.filePath);return k.value=r,r});async function L(){if(y.value!==k.value)try{await q.writeStaticAssets(await H(),[{path:n.value.path,content:k.value,override:!0}],""),D.value=!1,E.value++,z({message:"Updated",icon:"i-carbon-checkmark",classes:"text-green"})}catch{z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const O=ge(),R=I(()=>(O.value?._installedModules||[]).some(s=>s.meta?.name==="@nuxt/image"||s.meta?.name==="@nuxt/image-edge")),$=I(()=>{const r=[];if(n.value.type==="image"){const s=f.value?.width?`
|
|
7
|
+
width="${f.value.width}"
|
|
8
|
+
height="${f.value.height}" `:" ";return r.push({lang:"vue-html",code:`<img${s}
|
|
9
|
+
src="${n.value.publicPath}"
|
|
10
|
+
/>`,name:"Plain Image"}),R.value&&r.push({lang:"vue-html",code:`<NuxtImg${s}
|
|
11
|
+
src="${n.value.publicPath}"
|
|
12
|
+
/>`,name:"Nuxt Img",docs:"https://image.nuxt.com/usage/nuxt-img"},{lang:"vue-html",code:`<NuxtPicture${s}
|
|
13
|
+
src="${n.value.publicPath}"
|
|
14
|
+
/>`,name:"Nuxt Picture",docs:"https://image.nuxt.com/usage/nuxt-picture"}),r}return r.push({lang:"html",code:`<a download href="${n.value.publicPath}">
|
|
15
|
+
Download ${n.value.path.split("/").slice(-1)[0]}
|
|
16
|
+
</a>`,name:"Download link"}),r}),c=xe(),p=be(()=>n.value.mtime),a=I(()=>{const r=n.value.size;return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(2)} KB`:`${(r/1024/1024).toFixed(2)} MB`}),g=I(()=>{if(!f.value?.width||!f.value?.height)return"";const r=(i,P)=>P?r(P,i%P):i,s=r(f.value.width,f.value.height);return s>3?`${f.value.width/s}:${f.value.height/s}`:""}),b=I(()=>["image","text","video","audio","font"].includes(n.value.type)),h=T(!1);async function v(){try{await q.deleteStaticAsset(await H(),n.value.filePath),n.value=void 0,h.value=!1,z({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch{z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const w=T(!1),V=T("");async function K(){const r=n.value.filePath.split("/"),s=r.slice(-1)[0].split(".").slice(0,-1).join(".");if(!V.value||V.value===s)return z({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const i=r.slice(-1)[0].split(".").slice(-1)[0],P=`${r.slice(0,-1).join("/")}/${V.value}.${i}`;await q.renameStaticAsset(await H(),n.value.filePath,P),n.value=void 0,w.value=!1,z({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch{z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(r,s)=>{const i=re,P=Se,C=ne,oe=Ie,J=$e,ce=ae,Q=te("tooltip");return o(),u(B,null,[e("div",rt,[t(b)?(o(),u(B,{key:0},[ut,e("div",ct,[d(i,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:t(n),"text-content":t(y)},null,8,["asset","text-content"])])],64)):U("",!0),dt,e("table",pt,[e("tbody",null,[e("tr",null,[mt,e("td",null,[e("div",ft,[d(P,{filepath:t(n).filePath,"text-left":""},null,8,["filepath"]),X(d(C,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",border:!1,onClick:s[0]||(s[0]=A=>t(_)(t(n).filePath))},null,512),[[Q,"Open in Editor"]])])])]),e("tr",null,[vt,e("td",null,[e("div",ht,[e("div",_t,F(t(n).publicPath),1),X(d(C,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",border:!1,onClick:s[1]||(s[1]=A=>t(c)(t(n).publicPath,"assets-public-path"))},null,512),[[Q,"Copy public path"]]),X(d(C,{"flex-none":"",to:t(n).publicPath,icon:"carbon-launch",target:"_blank",border:!1,title:"Open in browser"},null,8,["to"]),[[Q,"Open in browser"]])])])]),e("tr",null,[gt,e("td",xt,F(t(n).type),1)]),t(f)?.width?(o(),u(B,{key:0},[e("tr",null,[bt,e("td",null,F(t(f).width)+" x "+F(t(f).height),1)]),t(g)?(o(),u("tr",wt,[yt,e("td",null,F(t(g)),1)])):U("",!0)],64)):U("",!0),e("tr",null,[$t,e("td",null,F(t(a)),1)]),e("tr",null,[kt,e("td",null,[N(F(new Date(t(n).mtime).toLocaleString())+" ",1),e("span",Ct,"("+F(t(p))+")",1)])])])]),Vt,e("div",Pt,[d(C,{to:t(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:x(()=>[N(" Download ")]),_:1},8,["to"]),t(n).type==="text"?(o(),S(C,{key:0,icon:"carbon-edit",n:"cyan",onClick:s[2]||(s[2]=A=>D.value=!t(D))},{default:x(()=>[N(" Edit ")]),_:1})):U("",!0),d(C,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:s[3]||(s[3]=A=>w.value=!t(w))},{default:x(()=>[N(" Rename ")]),_:1}),d(C,{icon:"carbon-delete",n:"red",onClick:s[4]||(s[4]=A=>h.value=!t(h))},{default:x(()=>[N(" Delete ")]),_:1})]),At,t($).length?(o(),S(oe,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":t($)},null,8,["code-snippets"])):U("",!0)]),d(J,{modelValue:t(h),"onUpdate:modelValue":s[6]||(s[6]=A=>M(h)?h.value=A:null)},{default:x(()=>[e("div",Dt,[Ft,e("div",Nt,[d(C,{icon:"carbon-close",onClick:s[5]||(s[5]=A=>h.value=!1)},{default:x(()=>[N(" Cancel ")]),_:1}),d(C,{icon:"carbon-delete",n:"red",onClick:v},{default:x(()=>[N(" Delete ")]),_:1})])])]),_:1},8,["modelValue"]),d(J,{modelValue:t(w),"onUpdate:modelValue":s[9]||(s[9]=A=>M(w)?w.value=A:null)},{default:x(()=>[e("div",St,[d(ce,{modelValue:t(V),"onUpdate:modelValue":s[7]||(s[7]=A=>M(V)?V.value=A:null),placeholder:"New name",n:"blue"},null,8,["modelValue"]),e("div",It,[d(C,{icon:"carbon-close",onClick:s[8]||(s[8]=A=>w.value=!1)},{default:x(()=>[N(" Cancel ")]),_:1}),d(C,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:K},{default:x(()=>[N(" Rename ")]),_:1})])])]),_:1},8,["modelValue"]),t(n).type==="text"?(o(),S(J,{key:0,modelValue:t(D),"onUpdate:modelValue":s[12]||(s[12]=A=>M(D)?D.value=A:null)},{default:x(()=>[e("div",Tt,[X(e("textarea",{"onUpdate:modelValue":s[10]||(s[10]=A=>M(k)?k.value=A:null),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:we(L,["enter"])},null,40,Ut),[[ye,t(k)]]),e("div",jt,[d(C,{icon:"carbon-close",onClick:s[11]||(s[11]=A=>D.value=!1)},{default:x(()=>[N(" Cancel ")]),_:1}),d(C,{icon:"carbon:save",n:"primary",onClick:L},{default:x(()=>[N(" save ")]),_:1})])])]),_:1},8,["modelValue"])):U("",!0)],64)}}}),Lt={"h-full":"","of-auto":""},Bt={"flex-none":"",flex:"~ gap2 items-center","text-lg":""},zt={flex:"~ items-center justify-center",absolute:"","bottom--1":"","right--1":"","h-4":"","w-4":"","rounded-full":"","bg-primary:30":"","text-8px":""},Mt={flex:"~ col","w-30":"","of-auto":""},Ot={"text-xs":"",op75:""},Rt={op50:""},Kt={key:0},Xt={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},Gt={key:1,p2:"",grid:"~ cols-minmax-8rem"},Zt={key:1},an=Z({__name:"assets",setup(j){const l=ke(),m=T(!1),n=T(""),_=I(()=>new Ce(l.value||[],{keys:["path"]})),f=Ve(()=>{const $=[];for(const c of l.value||[]){const p=c.path.split(".").pop();p&&!$.find(a=>a.name===p)&&$.push({name:p,value:!0})}return $}),D=I(()=>(n.value?_.value.search(n.value).map(c=>c.item):l.value||[]).filter(c=>{const p=c.path.split(".").pop();return!p||f.some(a=>a.name===p&&a.value)})),k=I(()=>{const $={};for(const c of D.value){const p=`${c.path.split("/").slice(0,-1).join("/")}/`;$[p]||($[p]=[]),$[p].push(c)}return Object.entries($).sort(([c],[p])=>c.localeCompare(p))}),E=I(()=>{const $={path:"public",children:[]},c=(p,a,g)=>{const[b,...h]=a;let v=p.children.find(w=>w.path===b);v||(v={...g,path:b,children:[]},p.children.push(v)),h.length>1?c(v,h,g):h.length===1&&v.children.push({...g,path:h[0]})};return D.value.forEach(p=>{const a=p.path.split("/").filter(g=>g!=="");c($,a,p)}),$.children}),y=T(),{view:L}=Te("assets");function O(){L.value=L.value==="list"?"grid":"list"}Pe("Escape",()=>{y.value=void 0});const R=T();return($,c)=>{const p=ne,a=Ae,g=De,b=Fe,h=Ge,v=it,w=Ne,V=ue,K=Et,r=Ue,s=te("tooltip");return o(),u("div",Lt,[d(b,{ref_key:"navbar",ref:R,search:t(n),"onUpdate:search":c[1]||(c[1]=i=>M(n)?n.value=i:null),pb2:""},{actions:x(()=>[e("div",Bt,[X(d(p,{icon:"carbon:cloud-upload",title:"File Upload",border:!1,onClick:c[0]||(c[0]=i=>m.value=!t(m))},null,512),[[s,"File Upload",void 0,{"bottom-end":!0}]]),t(f).length?(o(),S(g,{key:0,direction:"end",n:"sm primary"},{trigger:x(({click:i})=>[X(d(p,{icon:"carbon-filter",border:!1,title:"Filter",p3:"","text-lg":"",onClick:P=>i()},null,8,["onClick"]),[[s,"Filter",void 0,{"bottom-end":!0}]]),e("span",zt,F(t(f).length),1)]),default:x(()=>[e("div",Mt,[(o(!0),u(B,null,G(t(f),i=>(o(),S(a,{key:i.name,modelValue:i.value,"onUpdate:modelValue":P=>i.value=P,flex:"~ gap-2",rounded:"",px2:"",py2:""},{default:x(()=>[e("span",Ot,F(i.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1})):U("",!0),X(d(p,{"text-lg":"",border:!1,icon:t(L)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:O},null,8,["icon"]),[[s,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:x(()=>[e("div",Rt,[t(n)?(o(),u("span",Kt,F(t(D).length)+" matched · ",1)):U("",!0),e("span",null,F(t(l)?.length)+" assets in total",1)])]),_:1},8,["search"]),d(h,{modelValue:t(m),"onUpdate:modelValue":c[2]||(c[2]=i=>M(m)?m.value=i:null),folder:"/"},null,8,["modelValue"]),t(L)==="grid"?(o(),u(B,{key:0},[t(k).length>1?(o(!0),u(B,{key:0},G(t(k),([i,P])=>(o(),S(w,{key:i,text:i,description:`${P.length} items`,open:P.length<=("DETAILS_MAX_ITEMS"in $?$.DETAILS_MAX_ITEMS:t(je)),padding:!1},{default:x(()=>[e("div",Xt,[(o(!0),u(B,null,G(P,C=>(o(),S(v,{key:C.path,asset:C,folder:i,onClick:oe=>y.value=C},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(o(),u("div",Gt,[(o(!0),u(B,null,G(t(D),i=>(o(),S(v,{key:i.path,asset:i,onClick:P=>y.value=i},null,8,["asset","onClick"]))),128))]))],64)):(o(),u("div",Zt,[(o(!0),u(B,null,G(t(E),(i,P)=>(o(),S(V,{key:P,modelValue:t(y),"onUpdate:modelValue":c[3]||(c[3]=C=>M(y)?y.value=C:null),item:i},null,8,["modelValue","item"]))),128))])),d(r,{"model-value":!!t(y),"auto-close":"","w-120":"",top:t(R),onClose:c[5]||(c[5]=i=>y.value=void 0)},{default:x(()=>[t(y)?(o(),S(K,{key:0,modelValue:t(y),"onUpdate:modelValue":c[4]||(c[4]=i=>M(y)?y.value=i:null)},null,8,["modelValue"])):U("",!0)]),_:1},8,["model-value","top"])])}}});export{an as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bt as f,bI as r}from"./entry.909ad6c7.js";let t;const n=[];function s(i){if(n.push(i),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&n.forEach(e=>e(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set(e){e&&n.forEach(o=>o(e))},get(){return t.value},configurable:!0}),()=>{n.splice(n.indexOf(i),1)}}function u(){t||(t=f(),s(e));function i(){r(t)}function e(o){t.value=o,o.host&&o.host.hooks.hook("host:update:reactivity",i)}return t}const c=u();export{c as d};
|