@nuxt/devtools 0.5.3 → 0.5.4

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.
Files changed (105) hide show
  1. package/dist/chunks/module-main.mjs +90 -32
  2. package/dist/chunks/vscode.mjs +4 -5
  3. package/dist/client/200.html +2 -2
  4. package/dist/client/404.html +2 -2
  5. package/dist/client/__inspecting/index.html +2 -2
  6. package/dist/client/_nuxt/{Badge.0ce662e4.js → Badge.ade65c69.js} +1 -1
  7. package/dist/client/_nuxt/CodeSnippets.vue.0933ada7.js +1 -0
  8. package/dist/client/_nuxt/{DrawerRight.vue.eb026405.js → DrawerRight.vue.7bc0ac9b.js} +1 -1
  9. package/dist/client/_nuxt/{DurationDisplay.vue.9fa7b27d.js → DurationDisplay.vue.d2a5c09b.js} +1 -1
  10. package/dist/client/_nuxt/{FilepathItem.vue.7eb51d4e.js → FilepathItem.vue.a3a55bfd.js} +1 -1
  11. package/dist/client/_nuxt/{HelpFab.vue.ebcc1356.js → HelpFab.vue.1ab4e4f1.js} +1 -1
  12. package/dist/client/_nuxt/{LaunchPage.vue.63709998.js → LaunchPage.vue.dff3dd39.js} +1 -1
  13. package/dist/client/_nuxt/{NCheckbox.vue.a470be6e.js → NCheckbox.vue.cd1637b2.js} +1 -1
  14. package/dist/client/_nuxt/{NCodeBlock.vue.3fea7f9d.js → NCodeBlock.vue.d5b2e85d.js} +1 -1
  15. package/dist/client/_nuxt/{NIconButton.vue.13275ce3.js → NIconButton.vue.3defcade.js} +1 -1
  16. package/dist/client/_nuxt/{NIconTitle.vue.811968a5.js → NIconTitle.vue.62b2ff0a.js} +1 -1
  17. package/dist/client/_nuxt/NLink.vue.be635eca.js +1 -0
  18. package/dist/client/_nuxt/{NMarkdown.vue.f8a61172.js → NMarkdown.vue.00fc3014.js} +1 -1
  19. package/dist/client/_nuxt/{NPanelGrids.afa6e237.js → NPanelGrids.24e40025.js} +1 -1
  20. package/dist/client/_nuxt/{NSectionBlock.4824dc31.js → NSectionBlock.eb96beb4.js} +1 -1
  21. package/dist/client/_nuxt/{NSelect.vue.2f75a7b4.js → NSelect.vue.7652516b.js} +1 -1
  22. package/dist/client/_nuxt/{NSwitch.vue.ae05571e.js → NSwitch.vue.c07ff0b7.js} +1 -1
  23. package/dist/client/_nuxt/{NTip.vue.6c00393e.js → NTip.vue.3fd9b115.js} +1 -1
  24. package/dist/client/_nuxt/Navbar.vue.12ff05d9.js +1 -0
  25. package/dist/client/_nuxt/NpmVersionCheck.vue.7bc4775a.js +1 -0
  26. package/dist/client/_nuxt/{PanelLeftRight.vue.9e8aa6b8.js → PanelLeftRight.vue.0d3c5a22.js} +1 -1
  27. package/dist/client/_nuxt/StateEditor.vue.6e8c107a.js +1 -0
  28. package/dist/client/_nuxt/{__inspecting.689fc045.js → __inspecting.137e909d.js} +1 -1
  29. package/dist/client/_nuxt/analyze-build.790e4c36.js +1 -0
  30. package/dist/client/_nuxt/assets.1c0d54b4.js +16 -0
  31. package/dist/client/_nuxt/{client.ce74bb6b.js → client.d93a636c.js} +1 -1
  32. package/dist/client/_nuxt/{components.212338f5.js → components.060d9fd5.js} +3 -3
  33. package/dist/client/_nuxt/custom-_name_.e88f914e.js +1 -0
  34. package/dist/client/_nuxt/{default.b5c163f2.js → default.6eda7699.js} +1 -1
  35. package/dist/client/_nuxt/{editor.6dcc09c7.js → editor.4380b623.js} +1 -1
  36. package/dist/client/_nuxt/entry.34446c1f.js +19 -0
  37. package/dist/client/_nuxt/{entry.5cc961cc.css → entry.bf8a0e33.css} +1 -1
  38. package/dist/client/_nuxt/{error-404.67a51e0c.js → error-404.7bcf1a44.js} +1 -1
  39. package/dist/client/_nuxt/{error-500.811aab1a.js → error-500.b67f8091.js} +1 -1
  40. package/dist/client/_nuxt/{error-component.74964985.js → error-component.5479d89e.js} +2 -2
  41. package/dist/client/_nuxt/{full.1ccd4009.js → full.89a525fd.js} +1 -1
  42. package/dist/client/_nuxt/{hooks.310738c8.js → hooks.99ea2107.js} +1 -1
  43. package/dist/client/_nuxt/imports.29e62250.js +1 -0
  44. package/dist/client/_nuxt/{index.5d80161c.js → index.a348e979.js} +1 -1
  45. package/dist/client/_nuxt/{index.a86d9a7f.js → index.b8d7fad0.js} +1 -1
  46. package/dist/client/_nuxt/{json-editor-vue.cb8f6785.js → json-editor-vue.62f947e8.js} +1 -1
  47. package/dist/client/_nuxt/{middleware.c10051f6.js → middleware.61ccc755.js} +1 -1
  48. package/dist/client/_nuxt/modules.f8953fab.js +4 -0
  49. package/dist/client/_nuxt/{none.1d054cdf.js → none.566b9a55.js} +1 -1
  50. package/dist/client/_nuxt/open-graph.26d327ec.js +3 -0
  51. package/dist/client/_nuxt/overview.4326006b.js +1 -0
  52. package/dist/client/_nuxt/pages.b234eacb.js +1 -0
  53. package/dist/client/_nuxt/{payload.4878fb79.js → payload.fbf9b90d.js} +1 -1
  54. package/dist/client/_nuxt/{plugins.92e36c4c.js → plugins.9c9f9450.js} +1 -1
  55. package/dist/client/_nuxt/{runtime-configs.c13ac314.js → runtime-configs.cf5a4a0c.js} +1 -1
  56. package/dist/client/_nuxt/server-routes.7185e439.js +9 -0
  57. package/dist/client/_nuxt/{settings.fcb97906.js → settings.8603972f.js} +1 -1
  58. package/dist/client/_nuxt/state-components.f564bfa7.js +1 -0
  59. package/dist/client/_nuxt/storage.4b5872ff.js +1 -0
  60. package/dist/client/_nuxt/{terminals.dcdca739.js → terminals.d263a781.js} +1 -1
  61. package/dist/client/_nuxt/{unocss-runtime.cfd98600.js → unocss-runtime.a821baa9.js} +1 -1
  62. package/dist/client/_nuxt/virtual-files.2fc42163.js +1 -0
  63. package/dist/client/index.html +2 -2
  64. package/dist/client/modules/analyze-build/index.html +2 -2
  65. package/dist/client/modules/assets/index.html +2 -2
  66. package/dist/client/modules/components/index.html +2 -2
  67. package/dist/client/modules/hooks/index.html +2 -2
  68. package/dist/client/modules/imports/index.html +2 -2
  69. package/dist/client/modules/middleware/index.html +2 -2
  70. package/dist/client/modules/modules/index.html +2 -2
  71. package/dist/client/modules/open-graph/index.html +2 -2
  72. package/dist/client/modules/overview/index.html +2 -2
  73. package/dist/client/modules/pages/index.html +2 -2
  74. package/dist/client/modules/payload/index.html +2 -2
  75. package/dist/client/modules/plugins/index.html +2 -2
  76. package/dist/client/modules/runtime-configs/index.html +2 -2
  77. package/dist/client/modules/server-routes/index.html +2 -2
  78. package/dist/client/modules/storage/index.html +2 -2
  79. package/dist/client/modules/terminals/index.html +2 -2
  80. package/dist/client/modules/virtual-files/index.html +2 -2
  81. package/dist/client/settings/index.html +2 -2
  82. package/dist/module.json +1 -1
  83. package/dist/module.mjs +1 -1
  84. package/dist/shared/{devtools.a2798b81.mjs → devtools.345c630c.mjs} +2 -2
  85. package/dist/types.d.ts +12 -1
  86. package/package.json +8 -9
  87. package/dist/client/_nuxt/CodeSnippets.vue.63e1babe.js +0 -1
  88. package/dist/client/_nuxt/NLink.vue.8becbaf2.js +0 -1
  89. package/dist/client/_nuxt/NTextInput.vue.efd43a47.js +0 -1
  90. package/dist/client/_nuxt/Navbar.vue.76f856f0.js +0 -1
  91. package/dist/client/_nuxt/NpmVersionCheck.vue.9ff03721.js +0 -1
  92. package/dist/client/_nuxt/StateEditor.vue.b9b04885.js +0 -1
  93. package/dist/client/_nuxt/analyze-build.8d6d1198.js +0 -1
  94. package/dist/client/_nuxt/assets.b6f9866b.js +0 -16
  95. package/dist/client/_nuxt/custom-_name_.87eb6297.js +0 -1
  96. package/dist/client/_nuxt/entry.3c854225.js +0 -19
  97. package/dist/client/_nuxt/fuse.esm.88e2763d.js +0 -1
  98. package/dist/client/_nuxt/imports.ccc44d22.js +0 -1
  99. package/dist/client/_nuxt/modules.9cc1fa1d.js +0 -4
  100. package/dist/client/_nuxt/open-graph.4ea7bb24.js +0 -3
  101. package/dist/client/_nuxt/overview.9f34e07f.js +0 -1
  102. package/dist/client/_nuxt/pages.a55d4866.js +0 -1
  103. package/dist/client/_nuxt/server-routes.dae9cba0.js +0 -9
  104. package/dist/client/_nuxt/storage.d543849f.js +0 -1
  105. package/dist/client/_nuxt/virtual-files.3a24df07.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as E,p as I,r as V,o,h as u,f as e,F as _,q as L,s as F,u as n,t as f,v as y,x as P,i as r,w as a,l as p,y as R,z as T,A,k as U,B as Q,C as X,D as ee,E as te,G as ne,H as k,c as w,I as S,J as oe,K as le,L as ie}from"./entry.34446c1f.js";import{_ as se}from"./FilepathItem.vue.a3a55bfd.js";import{_ as ae}from"./NPanelGrids.24e40025.js";import{_ as re}from"./PanelLeftRight.vue.0d3c5a22.js";import{_ as ue}from"./NTip.vue.3fd9b115.js";import{_ as de}from"./NCodeBlock.vue.d5b2e85d.js";import{_ as ce}from"./NCheckbox.vue.cd1637b2.js";import{_ as me}from"./HelpFab.vue.1ab4e4f1.js";import"./editor.4380b623.js";import"./client.d93a636c.js";import"./NIconButton.vue.3defcade.js";const _e={"h-full":"",grid:"~ rows-[max-content_1fr]"},fe={flex:"~ wrap","w-full":""},pe=["onClick"],ve=e("div",{border:"b base","flex-auto":""},null,-1),he={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},xe=e("div",{"flex-auto":""},null,-1),ye={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},$e=e("div",{"i-carbon-commit":"","text-xl":""},null,-1),be=e("div",{"text-sm":"",op50:""}," Name ",-1),ge=e("div",{"i-carbon-time":"","text-xl":""},null,-1),we=e("div",{"text-sm":"",op50:""}," Build duration ",-1),ze=e("div",{"i-carbon-cics-program":"","text-xl":""},null,-1),Be=e("div",{"text-sm":"",op50:""}," Client bundle size ",-1),ke=e("div",{"i-carbon-bare-metal-server":"","text-xl":""},null,-1),Ce=e("div",{"text-sm":"",op50:""}," Nitro bundle size ",-1),Ne=e("div",{"i-carbon-edge-node":"","text-xl":""},null,-1),Te=e("div",{"text-sm":"",op50:""}," Built ",-1),Ae=e("div",{"i-carbon:folder-parent":"","text-xl":""},null,-1),De=e("div",{"text-sm":"",op50:""}," Report Path ",-1),Ie=e("div",{"flex-auto":""},null,-1),D="/__nuxt_devtools__/analyze/",Ve=E({__name:"BuildAnalyzeDetails",props:{current:null,prev:null},setup(i){const v=i,h=I(()=>{const t=[{name:"Overview",id:"overview"}];return v.current.features.bundleClient&&t.push({name:"Client Bundle",id:"bundle-client"}),v.current.features.bundleNitro&&t.push({name:"Nitro Bundle",id:"bundle-nitro"}),v.current.features.viteInspect&&t.push({name:"Vite Inspect",id:"vite-inspect"}),t}),s=V(h.value[0]);function b(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:t<1024*1024*1024?`${(t/1024/1024).toFixed(1)}MB`:`${(t/1024/1024/1024).toFixed(1)}GB`}function g(t){return`${((t.endTime-t.startTime)/1e3).toFixed(1)}s`}return(t,l)=>{const C=se,z=U;return o(),u("div",_e,[e("div",fe,[(o(!0),u(_,null,L(n(h),(x,N)=>(o(),u("button",{key:N,px4:"",py2:"",border:"r base",hover:"bg-active",class:F(x.id===n(s).id?"":"border-b"),onClick:c=>s.value=x},[e("div",{class:F(x.id===n(s).id?"":"op30")},f(x.name),3)],10,pe))),128)),ve]),n(s).id==="overview"?(o(),u("div",he,[xe,e("div",ye,[$e,e("div",null,[be,e("div",null,f(i.current.name),1)]),ge,e("div",null,[we,e("div",null,f(g(i.current)),1)]),i.current.size?.clientBundle?(o(),u(_,{key:0},[ze,e("div",null,[Be,e("div",null,f(b(i.current.size.clientBundle)),1)])],64)):y("",!0),i.current.size.nitroBundle?(o(),u(_,{key:1},[ke,e("div",null,[Ce,e("div",null,f(b(i.current.size.nitroBundle)),1)])],64)):y("",!0),Ne,e("div",null,[Te,e("div",null,f(n(P)(new Date(i.current.endTime))),1)]),Ae,e("div",null,[De,r(C,{filepath:i.current.analyzeDir},null,8,["filepath"])])]),Ie,r(z,{n:"rose",icon:"carbon-delete",onClick:l[0]||(l[0]=x=>("rpc"in t?t.rpc:n(R)).clearAnalyzeBuilds([i.current.name]))},{default:a(()=>[p(" Delete this report ")]),_:1})])):y("",!0),l._lazyshow1||n(s).id==="bundle-client"?(l._lazyshow1=!0,o(),u(_,null,[T(e("iframe",{src:`${D}${i.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[A,n(s).id==="bundle-client"]])],64)):y("v-show-if",!0),l._lazyshow2||n(s).id==="bundle-nitro"?(l._lazyshow2=!0,o(),u(_,null,[T(e("iframe",{src:`${D}${i.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[A,n(s).id==="bundle-nitro"]])],64)):y("v-show-if",!0),l._lazyshow3||n(s).id==="vite-inspect"?(l._lazyshow3=!0,o(),u(_,null,[T(e("iframe",{src:`${D}${i.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[A,n(s).id==="vite-inspect"]])],64)):y("v-show-if",!0)])}}}),Fe={class:"markdown-body"},Re=e("h1",null,"Build Analyze",-1),Se=e("p",null,[p("DevTools provides a build analyze tool to help you understand the size of your app in production. Whenever you start a new build, it runs the command "),e("code",null,"nuxt build --analyze"),p(" and present the output data directly in DevTools for easy browsing and comparing.")],-1),Ee=[Re,Se],Le={__name:"analyze-build",setup(i,{expose:v}){return v({frontmatter:{}}),(s,b)=>(o(),u("div",Fe,Ee))}},Pe={flex:"~ col"},Ue={flex:"~ gap-1 items-center","text-sm":"",op60:""},je=e("div",{"i-carbon-time":""},null,-1),Ge=e("div",{"flex-auto":""},null,-1),qe=e("div",{"x-divider":""},null,-1),He={flex:"~ items-center justify-center",p4:""},Ke={flex:"~ col gap-1","w-250":"",p4:""},Oe=e("h3",{class:"text-lg font-medium leading-6",mb2:""}," Start analyze build? ",-1),Je=e("p",{op50:""}," Enter the name of the build: ",-1),Me=e("div",{my3:"","x-divider":""},null,-1),We=e("p",{op50:""}," The following command will be executed in your terminal: ",-1),Ye={flex:"~ gap-3",mt2:"","justify-end":""},rt=E({__name:"analyze-build",setup(i){const v=Q(),h=X(),s=ee(),b=te(),g=I(()=>{const c=b.query.slug;return h.value?.builds.find(m=>m.slug===c)??h.value?.builds[0]}),t=V(!1),l=V(""),C=I(()=>h.value?.builds.some(c=>c.name===l.value.trim()));async function z(){l.value=await R.generateAnalyzeBuildName(),await v.start()&&(k.value={name:l.value,processId:await R.startAnalyzeBuild(l.value)},t.value&&x())}function x(){k.value?.processId&&s.push(`/modules/terminals?id=${encodeURIComponent(k.value.processId)}`)}function N(c){return`${((c.endTime-c.startTime)/1e3).toFixed(1)}s`}return ne(()=>[{id:"analyze-build: start",title:"Start a new analyze build",icon:"i-carbon-edge-node",action:z}]),(c,m)=>{const j=oe,B=U,G=Ve,q=ae,H=re,K=le,O=ue,J=de,M=ce,W=ie,Y=Le,Z=me;return o(),u(_,null,[r(H,{"left-size":20},{left:a(()=>[e("div",Pe,[(o(!0),u(_,null,L(n(h)?.builds,d=>(o(),u(_,{key:d.slug},[r(j,{flex:"~ col gap1","hover:bg-active":"",p3:"",class:F(d.slug===n(g)?.slug?"text-primary bg-active":""),to:`?slug=${encodeURIComponent(d.slug)}`},{default:a(()=>[e("code",null,f(d.name),1),e("div",Ue,[je,e("span",null,f(N(d)),1),Ge,e("span",null,f(n(P)(new Date(d.endTime))),1)])]),_:2},1032,["class","to"]),qe],64))),128)),e("div",He,[("processAnalyzeBuildInfo"in c?c.processAnalyzeBuildInfo:n(k))?(o(),w(B,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:m[1]||(m[1]=d=>x())},{default:a(()=>[p(" Building... ")]),_:1})):(o(),w(B,{key:0,n:"primary",icon:"carbon-edge-node",onClick:m[0]||(m[0]=d=>z())},{default:a(()=>[p(" Start a new build ")]),_:1}))])])]),right:a(()=>[n(g)?(o(),w(G,{key:0,current:n(g)},null,8,["current"])):(o(),w(q,{key:1}))]),_:1}),r(n(v),null,{default:a(({resolve:d})=>[r(W,{"model-value":!0,onClose:$=>d(!1)},{default:a(()=>[e("div",Ke,[Oe,Je,r(K,{modelValue:n(l),"onUpdate:modelValue":m[2]||(m[2]=$=>S(l)?l.value=$:null),placeholder:"Build name"},null,8,["modelValue"]),n(C)?(o(),w(O,{key:0,"n-orange":""},{default:a(()=>[p(" A build with the same name already exists, continue would overrides the previous build result. ")]),_:1})):y("",!0),Me,We,r(J,{code:`npx nuxi analyze --no-serve --name=${n(l)}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),r(M,{modelValue:n(t),"onUpdate:modelValue":m[3]||(m[3]=$=>S(t)?t.value=$:null),mt2:"",n:"primary"},{default:a(()=>[p(" Navigate to terminal ")]),_:1},8,["modelValue"]),e("div",Ye,[r(B,{onClick:$=>d(!1)},{default:a(()=>[p(" Cancel ")]),_:2},1032,["onClick"]),r(B,{n:"solid primary",onClick:$=>d(!0)},{default:a(()=>[p(" Start ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),r(Z,null,{default:a(()=>[r(Y)]),_:1})],64)}}});export{rt as default};
@@ -0,0 +1,16 @@
1
+ import{_ as K}from"./NIconButton.vue.3defcade.js";import{_ as H}from"./Navbar.vue.12ff05d9.js";import{a as j,M as J,r as T,e as V,o as s,h as c,i as f,u as n,f as e,l as E,F as N,q as O,c as F,w as z,v as S,s as G,N as ee,O as te,y as X,P as ne,K as se,k as W,p as y,Q as oe,R as ae,S as ie,t as w,T as q,U as le,V as re,W as ce,X as ue,Y as de,I as pe}from"./entry.34446c1f.js";import{_ as me}from"./NSectionBlock.eb96beb4.js";import{_ as fe}from"./FilepathItem.vue.a3a55bfd.js";import{_ as he}from"./CodeSnippets.vue.0933ada7.js";import{u as _e,a as ve}from"./editor.4380b623.js";import{_ as ge}from"./DrawerRight.vue.7bc0ac9b.js";import{D as xe}from"./constants.d7bcda3c.js";import"./NIconTitle.vue.62b2ff0a.js";import"./NCodeBlock.vue.d5b2e85d.js";import"./client.d93a636c.js";const be={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},we={for:"drop-zone-input","text-3xl":""},ye={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},$e=e("div",{px6:"",py6:""},[e("h1",{"text-2xl":""}," Upload "),e("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1),ke={grid:"~ cols-minmax-8rem","overflow-auto":"",p6:""},Ce={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Pe=["src"],Fe={flex:"~ gap1","items-center":""},Ae={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},De=j({__name:"DropZone",props:{folder:{type:String,required:!0}},emits:["uploaded"],setup(o,{emit:t}){const m=o,l=J(),g=T(!1),k=T(),u=T([]),C=["image","video"];function L(a){k.value=a.target,g.value=!0}function B(a){a.target===k.value&&(g.value=!1)}function M(a){a.preventDefault()}function x(a){a.preventDefault(),h(a.dataTransfer.files)}function h(a){const _=Array.from(a||[]);if(_.length){const i=[],v=u.value.map(d=>d.name);for(const d of _)if(v.includes(d.name)){let b=1;const[P,R]=d.name.split(".");for(;v.includes(`${P} (${b}).${R}`);)b++;const U=`${P}-${b}.${R}`,Q=new Blob([d],{type:d.type}),Y=new File([Q],U,{lastModified:Date.now()});i.push(Y),v.push(U)}else d.type===""?l("Folders are not supported yet","carbon:face-dissatisfied"):C.some(b=>d.type.includes(b))?i.push(d):l(`"${d.type}" file type is not allowed`,"carbon:face-dizzy");u.value=[...u.value,...i]}}async function r(){if(ee.value||te.value)return;const a=[];for(const _ of u.value){const i=new FileReader;i.readAsDataURL(_);const d=(await new Promise(b=>{i.onload=()=>b(i.result)})).split(";base64,").pop();a.push({name:_.name,data:d})}await X.writeStaticAssets([...a],m.folder).then(()=>{t("uploaded"),I(),l("Files uploaded successfully!","carbon:face-cool")}).catch(_=>{console.error(_),I(),l("Upload failed!","carbon:face-dizzy")}),g.value=!1}function p(a){u.value?.splice(a,1)}function A(a){return URL.createObjectURL(a)}function $(a,_){const[i,v]=a.name.split("."),d=_.replace(/\.\w+$/,""),b=`${d}.${v}`;return d.length===0?(alert("File name must be at least 1 characters long"),i):(Object.defineProperty(a,"name",{value:b,writable:!1}),u.value.splice(u.value.indexOf(a),1,a),a)}function D(){u.value=[]}function I(){g.value=!1,D()}return V("dragenter",L),V("dragleave",B),V("dragover",M),V("drop",x),(a,_)=>{const i=K,v=ne,d=se,b=W;return s(),c("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:G(n(g)?"opacity-100 visible":"opacity-0 invisible")},[f(i,{icon:"carbon-close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",onClick:I}),n(u)?.length?(s(),c("div",ye,[$e,e("div",ke,[(s(!0),c(N,null,O(n(u),(P,R)=>(s(),c("div",{key:P.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[e("div",Ce,[e("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:A(P)},null,8,Pe)]),e("div",Fe,[f(d,{n:"xs","flex-auto":"","model-value":P.name,"onUpdate:modelValue":U=>$(P,U.target.value)},null,8,["model-value","onUpdate:modelValue"]),f(i,{icon:"carbon-delete","flex-none":"",title:"Remove file",onClick:U=>p(R)},null,8,["onClick"])])]))),128))]),e("div",Ae,[n(u).length?(s(),F(b,{key:0,n:"red",onClick:D},{default:z(()=>[f(v,{icon:"carbon-clean"}),E(" Clear ")]),_:1})):S("",!0),f(b,{disabled:!n(u).length,n:"primary solid",onClick:r},{default:z(()=>[f(v,{icon:"carbon-cloud-upload"}),E(" Upload ")]),_:1},8,["disabled"])])])):(s(),c("div",be,[e("label",we,[f(v,{icon:"carbon-cloud-upload","mr-2":""}),E(" Drop files here or click to select ")]),e("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:_[0]||(_[0]=P=>h(P.target.files))},null,32)]))],2)}}}),Ie=j({__name:"AssetFontPreview",props:{asset:null},setup(o){const t=o,m=y(()=>`devtools-assets-${oe(t.asset)}`);return ae(y(()=>`
2
+ @font-face {
3
+ font-family: '${m.value}';
4
+ src: url('${t.asset.publicPath}');
5
+ }
6
+ `)),(l,g)=>(s(),c("div",{"of-hidden":"",style:ie({fontFamily:`'${n(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))}}),Ne={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},Se=["src"],ze={key:2,"i-carbon-document":"","text-3xl":"",op20:""},Te={key:3,"w-full":"","self-start":"",p4:""},je=["textContent"],Be={key:4,"i-carbon-help":"","text-3xl":"",op20:""},Z=j({__name:"AssetPreview",props:{asset:null,textContent:null},setup(o){return(t,m)=>{const l=Ie;return s(),c("div",Ne,[o.asset.type==="image"?(s(),c("img",{key:0,src:o.asset.publicPath},null,8,Se)):o.asset.type==="font"?(s(),F(l,{key:o.asset.publicPath,asset:o.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):o.asset.type==="text"&&!o.textContent?(s(),c("div",ze)):o.asset.type==="text"&&o.textContent?(s(),c("div",Te,[e("pre",{"max-h-10rem":"","of-hidden":"","font-mono":"","text-xs":"",textContent:w(o.textContent)},null,8,je)])):(s(),c("div",Be))])}}}),Ee={flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},Le={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},Me=j({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(o){const t=o,m=y(()=>t.folder&&t.asset.path.startsWith(t.folder)?t.asset.path.slice(t.folder.length):t.asset.path);return(l,g)=>{const k=Z;return s(),c("button",Ee,[f(k,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:l.asset},null,8,["asset"]),e("div",Le,w(n(m)),1)])}}}),Ue={flex:"~ gap-1","w-full":"","items-center":"",hover:"bg-active",rounded:"",px4:"",py2:""},Oe={"of-hidden":"",truncate:"","ws-nowrap":"","text-center":""},Re=j({__name:"AssetListItem",props:{asset:{}},setup(o){const t=o,m=y(()=>t.asset.type==="image"?"i-carbon-image":t.asset.type==="video"?"i-carbon-video":t.asset.type==="audio"?"i-carbon-volume-up":t.asset.type==="font"?"i-carbon-text-small-caps":t.asset.type==="text"?"i-carbon-document":t.asset.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(l,g)=>(s(),c("button",Ue,[e("div",{class:G(n(m))},null,2),e("div",Oe,w(l.asset.path),1)]))}}),Ve={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},Xe=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Preview "),e("div",{"x-divider":""})],-1),Ke={flex:"~","items-center":"","justify-center":""},qe=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Details "),e("div",{"x-divider":""})],-1),Ge={"max-w-full":"","w-full":"","table-fixed":""},We=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1),Ze={flex:"~ gap-1","w-full":"","items-center":""},Qe=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1),Ye={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},He={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},Je=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1),et={capitalize:""},tt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1),nt={key:0},st=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1),ot=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1),at=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1),it={op70:""},lt=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Actions "),e("div",{"x-divider":""})],-1),rt={flex:"~ gap2 wrap"},ct=e("div",{"flex-auto":""},null,-1),ut=j({__name:"AssetDetails",props:{asset:null},setup(o){const t=o,m=_e(),l=q(()=>{if(t.asset.type==="image")return X.getImageMeta(t.asset.filePath)}),g=q(()=>{if(t.asset.type==="text")return X.getTextAssetContent(t.asset.filePath)}),k=le(),u=y(()=>(k.value?._installedModules||[]).some(p=>p.meta?.name==="@nuxt/image"||p.meta?.name==="@nuxt/image-edge")),C=y(()=>{const r=[];if(t.asset.type==="image"){const p=l.value?.width?`
7
+ width="${l.value.width}"
8
+ height="${l.value.height}" `:" ";return r.push({lang:"vue-html",code:`<img${p}
9
+ src="${t.asset.publicPath}"
10
+ />`,name:"Plain Image"}),u.value&&r.push({lang:"vue-html",code:`<NuxtImage${p}
11
+ src="${t.asset.publicPath}"
12
+ />`,name:"Nuxt Image",docs:"https://image.nuxtjs.org/components/nuxt-img"},{lang:"vue-html",code:`<NuxtPicture${p}
13
+ src="${t.asset.publicPath}"
14
+ />`,name:"Nuxt Picture",docs:"https://image.nuxtjs.org/components/nuxt-picture"}),r}return r.push({lang:"html",code:`<a download href="${t.asset.publicPath}">
15
+ Download ${t.asset.path.split("/").slice(-1)[0]}
16
+ </a>`,name:"Download link"}),r}),L=ve(),B=re(()=>t.asset.mtime),M=y(()=>{const r=t.asset.size;return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(2)} KB`:`${(r/1024/1024).toFixed(2)} MB`}),x=y(()=>{if(!l.value?.width||!l.value?.height)return"";const r=(A,$)=>$?r($,A%$):A,p=r(l.value.width,l.value.height);return p>3?`${l.value.width/p}:${l.value.height/p}`:""}),h=y(()=>["image","text","video","font"].includes(t.asset.type));return(r,p)=>{const A=Z,$=fe,D=K,I=W,a=he;return s(),c("div",Ve,[n(h)?(s(),c(N,{key:0},[Xe,e("div",Ke,[f(A,{"max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:o.asset,"text-content":n(g)},null,8,["asset","text-content"])])],64)):S("",!0),qe,e("table",Ge,[e("tbody",null,[e("tr",null,[We,e("td",null,[e("div",Ze,[f($,{filepath:o.asset.filePath,"text-left":""},null,8,["filepath"]),f(D,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",onClick:p[0]||(p[0]=_=>n(m)(o.asset.filePath))})])])]),e("tr",null,[Qe,e("td",null,[e("div",Ye,[e("div",He,w(o.asset.publicPath),1),f(D,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",onClick:p[1]||(p[1]=_=>n(L)(o.asset.publicPath))}),f(D,{"flex-none":"",to:o.asset.publicPath,icon:"carbon-launch",target:"_blank",title:"Open in browser"},null,8,["to"])])])]),e("tr",null,[Je,e("td",et,w(o.asset.type),1)]),n(l)?.width?(s(),c(N,{key:0},[e("tr",null,[tt,e("td",null,w(n(l).width)+" x "+w(n(l).height),1)]),n(x)?(s(),c("tr",nt,[st,e("td",null,w(n(x)),1)])):S("",!0)],64)):S("",!0),e("tr",null,[ot,e("td",null,w(n(M)),1)]),e("tr",null,[at,e("td",null,[E(w(new Date(o.asset.mtime).toLocaleString())+" ",1),e("span",it,"("+w(n(B))+")",1)])])])]),lt,e("div",rt,[f(I,{to:o.asset.publicPath,download:"",target:"_blank",icon:"carbon-download"},{default:z(()=>[E(" Download ")]),_:1},8,["to"]),o.asset.type==="image"?(s(),F(I,{key:0,disabled:"",icon:"carbon-image-service"},{default:z(()=>[E(" Optimize image (Coming soon) ")]),_:1})):S("",!0)]),ct,n(C).length?(s(),F(a,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":n(C)},null,8,["code-snippets"])):S("",!0)])}}}),dt={"h-full":"","of-auto":""},pt={"flex-none":"",flex:"~ gap2 items-center"},mt={op50:""},ft={key:0},ht={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},_t={key:1,p2:"",grid:"~ cols-minmax-8rem"},vt={key:1},It=j({__name:"assets",setup(o){const t=ce(),m=T(""),l=y(()=>new ue(t.value||[],{keys:["path"]})),g=y(()=>m.value?l.value.search(m.value).map(h=>h.item):t.value||[]),k=y(()=>{const x={};for(const h of g.value){const r=`${h.path.split("/").slice(0,-1).join("/")}/`;x[r]||(x[r]=[]),x[r].push(h)}return Object.entries(x).sort(([h],[r])=>h.localeCompare(r))}),u=T(),C=T("grid");function L(){C.value=C.value==="list"?"grid":"list"}de("Escape",()=>{u.value=void 0});const B=T();function M(){}return(x,h)=>{const r=K,p=H,A=De,$=Me,D=me,I=Re,a=ut,_=ge;return s(),c("div",dt,[f(p,{ref_key:"navbar",ref:B,search:n(m),"onUpdate:search":h[0]||(h[0]=i=>pe(m)?m.value=i:null),pb2:""},{actions:z(()=>[e("div",pt,[f(r,{"text-lg":"",icon:n(C)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:L},null,8,["icon"])])]),default:z(()=>[e("div",mt,[n(m)?(s(),c("span",ft,w(n(g).length)+" matched · ",1)):S("",!0),e("span",null,w(n(t)?.length)+" assets in total",1)])]),_:1},8,["search"]),f(A,{folder:"/",onUploaded:M}),n(C)==="grid"?(s(),c(N,{key:0},[n(k).length>1?(s(!0),c(N,{key:0},O(n(k),([i,v])=>(s(),F(D,{key:i,text:i,description:`${v.length} items`,open:v.length<=("DETAILS_MAX_ITEMS"in x?x.DETAILS_MAX_ITEMS:n(xe)),padding:!1},{default:z(()=>[e("div",ht,[(s(!0),c(N,null,O(v,d=>(s(),F($,{key:d.path,asset:d,folder:i,onClick:b=>u.value=d},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(s(),c("div",_t,[(s(!0),c(N,null,O(n(g),i=>(s(),F($,{key:i.path,asset:i,onClick:v=>u.value=i},null,8,["asset","onClick"]))),128))]))],64)):(s(),c("div",vt,[(s(!0),c(N,null,O(n(g),i=>(s(),F(I,{key:i.path,asset:i,onClick:v=>u.value=i},null,8,["asset","onClick"]))),128))])),f(_,{"model-value":!!n(u),"auto-close":"","w-120":"",navbar:n(B),onClose:h[1]||(h[1]=i=>u.value=void 0)},{default:z(()=>[n(u)?(s(),F(a,{key:0,asset:n(u)},null,8,["asset"])):S("",!0)]),_:1},8,["model-value","navbar"])])}}});export{It as default};
@@ -1 +1 @@
1
- import{a_ as r,b8 as f}from"./entry.3c854225.js";let o;const t=[];function s(n){if(t.push(n),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&t.forEach(e=>e(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set(e){e&&t.forEach(i=>i(e))},get(){return o.value},configurable:!0}),()=>{t.splice(t.indexOf(n),1)}}function _(){o||(o=r(),s(n));function n(e){o.value=e,e.host&&e.host.hooks.hook("host:update:reactivity",()=>{f(o)})}return o}const d=_();export{d};
1
+ import{b0 as r,ba as f}from"./entry.34446c1f.js";let o;const t=[];function s(n){if(t.push(n),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&t.forEach(e=>e(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set(e){e&&t.forEach(i=>i(e))},get(){return o.value},configurable:!0}),()=>{t.splice(t.indexOf(n),1)}}function u(){o||(o=r(),s(n));function n(e){o.value=e,e.host&&e.host.hooks.hook("host:update:reactivity",()=>{f(o)})}return o}const d=u();export{d};