@nuxt/devtools 0.7.5 → 0.8.0

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 (112) hide show
  1. package/dist/chunks/module-main.mjs +36 -20
  2. package/dist/chunks/plugin-metrics.mjs +8 -1
  3. package/dist/chunks/vscode.mjs +1 -1
  4. package/dist/client/200.html +2 -2
  5. package/dist/client/404.html +2 -2
  6. package/dist/client/__blank/index.html +2 -2
  7. package/dist/client/_nuxt/{Badge.809c442f.js → Badge.73590739.js} +1 -1
  8. package/dist/client/_nuxt/{CodeDiff.vue.1cd1f35a.js → CodeDiff.vue.5bc59452.js} +1 -1
  9. package/dist/client/_nuxt/{ComposableItem.vue.a490c449.js → ComposableItem.vue.b891778e.js} +1 -1
  10. package/dist/client/_nuxt/{DataSchemaButton.vue.31fe918d.js → DataSchemaButton.vue.58aa4fbb.js} +1 -1
  11. package/dist/client/_nuxt/{DataSchemaDrawer.7a8538ed.js → DataSchemaDrawer.b54a9c8c.js} +1 -1
  12. package/dist/client/_nuxt/{DrawerRight.vue.3bbd0e76.js → DrawerRight.vue.462f9048.js} +1 -1
  13. package/dist/client/_nuxt/{DurationDisplay.vue.1533a045.js → DurationDisplay.vue.281ea057.js} +1 -1
  14. package/dist/client/_nuxt/{FilepathItem.vue.a9853d6c.js → FilepathItem.vue.3d85c8b7.js} +1 -1
  15. package/dist/client/_nuxt/{HelpFab.vue.5d67494b.js → HelpFab.vue.7e36821f.js} +1 -1
  16. package/dist/client/_nuxt/LaunchPage.vue.fd74a96c.js +1 -0
  17. package/dist/client/_nuxt/{NCheckbox.vue.76b79ec0.js → NCheckbox.vue.1ddacd54.js} +1 -1
  18. package/dist/client/_nuxt/{NCodeBlock.vue.a8601f10.js → NCodeBlock.vue.31f18b3e.js} +1 -1
  19. package/dist/client/_nuxt/{NDropdown.vue.c183f72d.js → NDropdown.vue.ba86ab23.js} +1 -1
  20. package/dist/client/_nuxt/{NIconTitle.vue.e492e44a.js → NIconTitle.vue.9acdbad1.js} +1 -1
  21. package/dist/client/_nuxt/{NLink.vue.e00535a9.js → NLink.vue.a8242afb.js} +1 -1
  22. package/dist/client/_nuxt/{NMarkdown.vue.7d7a1e6e.js → NMarkdown.vue.12b1eecd.js} +1 -1
  23. package/dist/client/_nuxt/{NSectionBlock.6778ba18.js → NSectionBlock.00736ab5.js} +1 -1
  24. package/dist/client/_nuxt/NSelect.vue.d378258a.js +1 -0
  25. package/dist/client/_nuxt/NSelectTabs.vue.515b8214.js +1 -0
  26. package/dist/client/_nuxt/{NSwitch.vue.855c3f98.js → NSwitch.vue.8201d15e.js} +1 -1
  27. package/dist/client/_nuxt/{NTip.vue.6bf7cf97.js → NTip.vue.8812abb8.js} +1 -1
  28. package/dist/client/_nuxt/{Navbar.vue.c8f5ea35.js → Navbar.vue.c509e5d2.js} +1 -1
  29. package/dist/client/_nuxt/{StateEditor.vue.082de4fa.js → StateEditor.vue.2dfb9208.js} +1 -1
  30. package/dist/client/_nuxt/{__blank.8beed58c.js → __blank.6f88f9ac.js} +1 -1
  31. package/dist/client/_nuxt/{analyze-build.88782d48.js → analyze-build.ad9015ef.js} +1 -1
  32. package/dist/client/_nuxt/assets.d0e2ffb5.js +16 -0
  33. package/dist/client/_nuxt/{client.fbe3eaa6.js → client.237dd3ea.js} +1 -1
  34. package/dist/client/_nuxt/{components.99398ea7.js → components.5d298b86.js} +32 -32
  35. package/dist/client/_nuxt/custom-_name_.6bfb7c0f.js +1 -0
  36. package/dist/client/_nuxt/{default.2ae1a40e.js → default.f2c7ccc5.js} +1 -1
  37. package/dist/client/_nuxt/entry.582098fc.css +1 -0
  38. package/dist/client/_nuxt/{entry.704683a1.js → entry.d12f745d.js} +8 -8
  39. package/dist/client/_nuxt/{error-404.bde0cadd.js → error-404.ed94fa51.js} +1 -1
  40. package/dist/client/_nuxt/{error-500.524ae368.js → error-500.7606b55d.js} +1 -1
  41. package/dist/client/_nuxt/{full.6451054a.js → full.69c969de.js} +1 -1
  42. package/dist/client/_nuxt/{hooks.d1ff16ee.js → hooks.2100ca5d.js} +1 -1
  43. package/dist/client/_nuxt/imports.cb581504.js +1 -0
  44. package/dist/client/_nuxt/{index.2ab6466f.js → index.0d56c910.js} +1 -1
  45. package/dist/client/_nuxt/{index.ef0631d4.js → index.f204f87e.js} +1 -1
  46. package/dist/client/_nuxt/{json-editor-vue.d2d6ca22.js → json-editor-vue.ddceb6bb.js} +1 -1
  47. package/dist/client/_nuxt/{middleware.c86c494b.js → middleware.688539e5.js} +1 -1
  48. package/dist/client/_nuxt/{modules.e419f21a.js → modules.bd62827c.js} +2 -2
  49. package/dist/client/_nuxt/{none.bdacb36e.js → none.1af6e0ee.js} +1 -1
  50. package/dist/client/_nuxt/{open-graph.ae9112ee.js → open-graph.11338a0a.js} +2 -2
  51. package/dist/client/_nuxt/overview.94507b31.js +1 -0
  52. package/dist/client/_nuxt/{pages.f4173ed6.js → pages.e761585a.js} +1 -1
  53. package/dist/client/_nuxt/payload.6d63ca94.js +1 -0
  54. package/dist/client/_nuxt/{plugins.192ab129.js → plugins.37532eb5.js} +1 -1
  55. package/dist/client/_nuxt/runtime-configs.5354fdd6.js +1 -0
  56. package/dist/client/_nuxt/server-routes.6fd21992.js +9 -0
  57. package/dist/client/_nuxt/settings.5fe86309.js +1 -0
  58. package/dist/client/_nuxt/{state-components.eea2cf71.js → state-components.7bf3566d.js} +1 -1
  59. package/dist/client/_nuxt/{state-modules.8cc9b26b.js → state-modules.065d01b4.js} +1 -1
  60. package/dist/client/_nuxt/storage-options.f9b1696b.js +1 -0
  61. package/dist/client/_nuxt/{storage.7aca7890.js → storage.228d88e2.js} +1 -1
  62. package/dist/client/_nuxt/{terminals.b71c30e6.js → terminals.0377de90.js} +1 -1
  63. package/dist/client/_nuxt/{timeline.32019995.js → timeline.e89330f3.js} +3 -3
  64. package/dist/client/_nuxt/unocss-runtime.a5ba4c7b.js +2 -0
  65. package/dist/client/_nuxt/{virtual-files.2f2a88f3.js → virtual-files.1f7c68a1.js} +1 -1
  66. package/dist/client/index.html +2 -2
  67. package/dist/client/modules/analyze-build/index.html +2 -2
  68. package/dist/client/modules/assets/index.html +2 -2
  69. package/dist/client/modules/components/index.html +2 -2
  70. package/dist/client/modules/hooks/index.html +2 -2
  71. package/dist/client/modules/imports/index.html +2 -2
  72. package/dist/client/modules/middleware/index.html +2 -2
  73. package/dist/client/modules/modules/index.html +2 -2
  74. package/dist/client/modules/open-graph/index.html +2 -2
  75. package/dist/client/modules/overview/index.html +2 -2
  76. package/dist/client/modules/pages/index.html +2 -2
  77. package/dist/client/modules/payload/index.html +2 -2
  78. package/dist/client/modules/plugins/index.html +2 -2
  79. package/dist/client/modules/runtime-configs/index.html +2 -2
  80. package/dist/client/modules/server-routes/index.html +2 -2
  81. package/dist/client/modules/storage/index.html +2 -2
  82. package/dist/client/modules/terminals/index.html +2 -2
  83. package/dist/client/modules/timeline/index.html +2 -2
  84. package/dist/client/modules/virtual-files/index.html +2 -2
  85. package/dist/client/settings/index.html +2 -2
  86. package/dist/{global-ea55645c.d.ts → global-2a48a9e5.d.ts} +5 -1
  87. package/dist/module.d.ts +1 -1
  88. package/dist/module.json +1 -1
  89. package/dist/module.mjs +1 -1
  90. package/dist/runtime/function-metrics-helpers.mjs +17 -12
  91. package/dist/runtime/plugins/devtools.client.mjs +6 -1
  92. package/dist/runtime/plugins/view/FrameBox.vue +1 -1
  93. package/dist/runtime/plugins/view/Main.vue +4 -4
  94. package/dist/runtime/plugins/view/client.mjs +64 -44
  95. package/dist/runtime/use-nuxt-devtools.d.ts +8 -0
  96. package/dist/runtime/use-nuxt-devtools.mjs +23 -0
  97. package/dist/shared/{devtools.c34e61ba.mjs → devtools.6d7e3a3a.mjs} +3 -0
  98. package/dist/types.d.ts +1 -1
  99. package/package.json +11 -11
  100. package/dist/client/_nuxt/CodeSnippets.vue.e2cc365d.js +0 -1
  101. package/dist/client/_nuxt/LaunchPage.vue.304a6918.js +0 -1
  102. package/dist/client/_nuxt/NSelect.vue.6e592a84.js +0 -1
  103. package/dist/client/_nuxt/assets.dec2c564.js +0 -16
  104. package/dist/client/_nuxt/custom-_name_.53810490.js +0 -1
  105. package/dist/client/_nuxt/entry.6293ec9a.css +0 -1
  106. package/dist/client/_nuxt/imports.9142e1cd.js +0 -1
  107. package/dist/client/_nuxt/overview.b36ec18b.js +0 -1
  108. package/dist/client/_nuxt/payload.8138f0c2.js +0 -1
  109. package/dist/client/_nuxt/runtime-configs.399a5d6f.js +0 -1
  110. package/dist/client/_nuxt/server-routes.a3646010.js +0 -9
  111. package/dist/client/_nuxt/settings.2dfbccf3.js +0 -1
  112. package/dist/client/_nuxt/unocss-runtime.0935bd38.js +0 -2
@@ -1 +1 @@
1
- import{d as j,a as V,r as F,o,m as i,k as e,F as c,n as E,E as S,f as n,t as m,p as b,G,i as r,j as a,v as _,H as A,I as D,J as P,K as L,C as U,L as X,M as ee,N as te,O as ne,P as oe,Q as le,R as ie,S as k,h as w,l as R,U as se,V as ae,A as re}from"./entry.704683a1.js";import{_ as ue}from"./FilepathItem.vue.a9853d6c.js";import{_ as de}from"./NTip.vue.6bf7cf97.js";import{_ as ce}from"./NCodeBlock.vue.a8601f10.js";import{_ as me}from"./NCheckbox.vue.76b79ec0.js";import{_ as _e}from"./HelpFab.vue.5d67494b.js";import"./client.fbe3eaa6.js";const pe={"h-full":"",grid:"~ rows-[max-content_1fr]"},fe={flex:"~ wrap","w-full":""},ve=["onClick"],he=e("div",{border:"b base","flex-auto":""},null,-1),ye={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},be=e("div",{"flex-auto":""},null,-1),$e={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},xe=e("div",{"i-carbon-commit":"","text-xl":""},null,-1),ge=e("div",{"text-sm":"",op50:""}," Name ",-1),we=e("div",{"i-carbon-time":"","text-xl":""},null,-1),ze=e("div",{"text-sm":"",op50:""}," Build duration ",-1),Be=e("div",{"i-carbon-cics-program":"","text-xl":""},null,-1),ke=e("div",{"text-sm":"",op50:""}," Client bundle size ",-1),Ce=e("div",{"i-carbon-bare-metal-server":"","text-xl":""},null,-1),Ne=e("div",{"text-sm":"",op50:""}," Nitro bundle size ",-1),Te=e("div",{"i-carbon-edge-node":"","text-xl":""},null,-1),Ae=e("div",{"text-sm":"",op50:""}," Built ",-1),De=e("div",{"i-carbon:folder-parent":"","text-xl":""},null,-1),Ie=e("div",{"text-sm":"",op50:""}," Report Path ",-1),Ve=e("div",{"flex-auto":""},null,-1),I="/__nuxt_devtools__/analyze/",Fe=j({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(C){const p=C,f=V(()=>{const t=[{name:"Overview",id:"overview"}];return p.current.features.bundleClient&&t.push({name:"Client Bundle",id:"bundle-client"}),p.current.features.bundleNitro&&t.push({name:"Nitro Bundle",id:"bundle-nitro"}),p.current.features.viteInspect&&t.push({name:"Vite Inspect",id:"vite-inspect"}),t}),l=F(f.value[0]);function $(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`}async function x(t){return P.clearAnalyzeBuilds(await L(),[t])}return(t,u)=>{const z=ue,N=U;return o(),i("div",pe,[e("div",fe,[(o(!0),i(c,null,E(n(f),(v,T)=>(o(),i("button",{key:T,px4:"",py2:"",border:"r base",hover:"bg-active",class:S(v.id===n(l).id?"":"border-b"),onClick:d=>l.value=v},[e("div",{class:S(v.id===n(l).id?"":"op30")},m(v.name),3)],10,ve))),128)),he]),n(l).id==="overview"?(o(),i("div",ye,[be,e("div",$e,[xe,e("div",null,[ge,e("div",null,m(t.current.name),1)]),we,e("div",null,[ze,e("div",null,m(g(t.current)),1)]),t.current.size?.clientBundle?(o(),i(c,{key:0},[Be,e("div",null,[ke,e("div",null,m($(t.current.size.clientBundle)),1)])],64)):b("",!0),t.current.size.nitroBundle?(o(),i(c,{key:1},[Ce,e("div",null,[Ne,e("div",null,m($(t.current.size.nitroBundle)),1)])],64)):b("",!0),Te,e("div",null,[Ae,e("div",null,m(n(G)(new Date(t.current.endTime))),1)]),De,e("div",null,[Ie,r(z,{filepath:t.current.analyzeDir},null,8,["filepath"])])]),Ve,r(N,{n:"rose",icon:"carbon-delete",onClick:u[0]||(u[0]=v=>x(t.current.name))},{default:a(()=>[_(" Delete this report ")]),_:1})])):b("",!0),u._lazyshow1||n(l).id==="bundle-client"?(u._lazyshow1=!0,o(),i(c,null,[A(e("iframe",{src:`${I}${t.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[D,n(l).id==="bundle-client"]])],64)):b("v-show-if",!0),u._lazyshow2||n(l).id==="bundle-nitro"?(u._lazyshow2=!0,o(),i(c,null,[A(e("iframe",{src:`${I}${t.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[D,n(l).id==="bundle-nitro"]])],64)):b("v-show-if",!0),u._lazyshow3||n(l).id==="vite-inspect"?(u._lazyshow3=!0,o(),i(c,null,[A(e("iframe",{src:`${I}${t.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[D,n(l).id==="vite-inspect"]])],64)):b("v-show-if",!0)])}}}),Se={class:"markdown-body"},Pe=e("h1",null,"Build Analyze",-1),Re=e("p",null,[_("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"),_(" and present the output data directly in DevTools for easy browsing and comparing.")],-1),je=[Pe,Re],Ee={__name:"analyze-build",setup(C,{expose:p}){return p({frontmatter:{}}),(l,$)=>(o(),i("div",Se,je))}},Ge={flex:"~ col"},Le=["onClick"],Ue={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},Oe=e("div",{"i-carbon-time":""},null,-1),He=e("div",{"flex-auto":""},null,-1),Ke=e("div",{"x-divider":""},null,-1),Me={flex:"~ items-center justify-center wrap",p4:""},Je={flex:"~ col gap-1","w-250":"",p4:""},Qe=e("h3",{class:"text-lg font-medium leading-6",mb2:""}," Start analyze build? ",-1),We=e("p",{op50:""}," Enter the name of the build: ",-1),Ye=e("div",{my3:"","x-divider":""},null,-1),Ze=e("p",{op50:""}," The following command will be executed in your terminal: ",-1),qe={flex:"~ gap-3",mt2:"","justify-end":""},st=j({__name:"analyze-build",setup(C){const p=X(),f=ee(),l=te(),$=ne("analyze-build:slug",""),g=V(()=>f.value?.builds.find(d=>d.slug===$.value)??f.value?.builds[0]),x=F(!1),t=F(""),u=V(()=>f.value?.builds.some(d=>d.name===t.value.trim()));async function z(){t.value=await P.generateAnalyzeBuildName(),await p.start()&&(k.value={name:t.value,processId:await P.startAnalyzeBuild(await L(),t.value)},x.value&&v())}const N=oe();function v(){k.value?.processId&&(N.value=k.value.processId,l.push("/modules/terminals"))}function T(d){return`${((d.endTime-d.startTime)/1e3).toFixed(1)}s`}return le(()=>[{id:"action:analyze-build: start",title:"Start a new analyze build",icon:"i-carbon-edge-node",action:z}]),(d,h)=>{const B=U,O=Fe,H=re,K=ie,M=se,J=de,Q=ce,W=me,Y=ae,Z=Ee,q=_e;return o(),i(c,null,[r(K,{"left-size":30},{left:a(()=>[e("div",Ge,[(o(!0),i(c,null,E(n(f)?.builds,s=>(o(),i(c,{key:s.slug},[e("button",{flex:"~ col gap1","hover:bg-active":"",p3:"",class:S(s.slug===n(g)?.slug?"text-primary bg-active":""),onClick:y=>$.value=s.slug},[e("code",null,m(s.name),1),e("div",Ue,[Oe,e("span",null,m(T(s)),1),He,e("span",null,m(n(G)(new Date(s.endTime))),1)])],10,Le),Ke],64))),128)),e("div",Me,[("processAnalyzeBuildInfo"in d?d.processAnalyzeBuildInfo:n(k))?(o(),w(B,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:h[1]||(h[1]=s=>v())},{default:a(()=>[_(" Building... ")]),_:1})):(o(),w(B,{key:0,n:"primary",icon:"carbon-edge-node",onClick:h[0]||(h[0]=s=>z())},{default:a(()=>[_(" Start a new build ")]),_:1}))])])]),right:a(()=>[n(g)?(o(),w(O,{key:0,current:n(g)},null,8,["current"])):(o(),w(H,{key:1}))]),_:1}),r(n(p),null,{default:a(({resolve:s})=>[r(Y,{"model-value":!0,onClose:y=>s(!1)},{default:a(()=>[e("div",Je,[Qe,We,r(M,{modelValue:n(t),"onUpdate:modelValue":h[2]||(h[2]=y=>R(t)?t.value=y:null),placeholder:"Build name"},null,8,["modelValue"]),n(u)?(o(),w(J,{key:0,"n-orange":""},{default:a(()=>[_(" A build with the same name already exists, continue would overrides the previous build result. ")]),_:1})):b("",!0),Ye,Ze,r(Q,{code:`npx nuxi analyze --no-serve --name=${n(t)}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),r(W,{modelValue:n(x),"onUpdate:modelValue":h[3]||(h[3]=y=>R(x)?x.value=y:null),mt2:"",n:"primary"},{default:a(()=>[_(" Navigate to terminal ")]),_:1},8,["modelValue"]),e("div",qe,[r(B,{onClick:y=>s(!1)},{default:a(()=>[_(" Cancel ")]),_:2},1032,["onClick"]),r(B,{n:"solid primary",onClick:y=>s(!0)},{default:a(()=>[_(" Start ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),r(q,null,{default:a(()=>[r(Z)]),_:1})],64)}}});export{st as default};
1
+ import{d as j,a as V,r as F,o,m as i,k as e,F as c,n as E,E as S,f as n,t as m,p as b,G,i as r,j as a,v as _,H as A,I as D,J as P,K as L,C as U,L as X,M as ee,N as te,O as ne,P as oe,Q as le,R as ie,S as k,h as w,l as R,U as se,V as ae,A as re}from"./entry.d12f745d.js";import{_ as ue}from"./FilepathItem.vue.3d85c8b7.js";import{_ as de}from"./NTip.vue.8812abb8.js";import{_ as ce}from"./NCodeBlock.vue.31f18b3e.js";import{_ as me}from"./NCheckbox.vue.1ddacd54.js";import{_ as _e}from"./HelpFab.vue.7e36821f.js";import"./client.237dd3ea.js";const pe={"h-full":"",grid:"~ rows-[max-content_1fr]"},fe={flex:"~ wrap","w-full":""},ve=["onClick"],he=e("div",{border:"b base","flex-auto":""},null,-1),ye={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},be=e("div",{"flex-auto":""},null,-1),$e={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},xe=e("div",{"i-carbon-commit":"","text-xl":""},null,-1),ge=e("div",{"text-sm":"",op50:""}," Name ",-1),we=e("div",{"i-carbon-time":"","text-xl":""},null,-1),ze=e("div",{"text-sm":"",op50:""}," Build duration ",-1),Be=e("div",{"i-carbon-cics-program":"","text-xl":""},null,-1),ke=e("div",{"text-sm":"",op50:""}," Client bundle size ",-1),Ce=e("div",{"i-carbon-bare-metal-server":"","text-xl":""},null,-1),Ne=e("div",{"text-sm":"",op50:""}," Nitro bundle size ",-1),Te=e("div",{"i-carbon-edge-node":"","text-xl":""},null,-1),Ae=e("div",{"text-sm":"",op50:""}," Built ",-1),De=e("div",{"i-carbon:folder-parent":"","text-xl":""},null,-1),Ie=e("div",{"text-sm":"",op50:""}," Report Path ",-1),Ve=e("div",{"flex-auto":""},null,-1),I="/__nuxt_devtools__/analyze/",Fe=j({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(C){const p=C,f=V(()=>{const t=[{name:"Overview",id:"overview"}];return p.current.features.bundleClient&&t.push({name:"Client Bundle",id:"bundle-client"}),p.current.features.bundleNitro&&t.push({name:"Nitro Bundle",id:"bundle-nitro"}),p.current.features.viteInspect&&t.push({name:"Vite Inspect",id:"vite-inspect"}),t}),l=F(f.value[0]);function $(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`}async function x(t){return P.clearAnalyzeBuilds(await L(),[t])}return(t,u)=>{const z=ue,N=U;return o(),i("div",pe,[e("div",fe,[(o(!0),i(c,null,E(n(f),(v,T)=>(o(),i("button",{key:T,px4:"",py2:"",border:"r base",hover:"bg-active",class:S(v.id===n(l).id?"":"border-b"),onClick:d=>l.value=v},[e("div",{class:S(v.id===n(l).id?"":"op30")},m(v.name),3)],10,ve))),128)),he]),n(l).id==="overview"?(o(),i("div",ye,[be,e("div",$e,[xe,e("div",null,[ge,e("div",null,m(t.current.name),1)]),we,e("div",null,[ze,e("div",null,m(g(t.current)),1)]),t.current.size?.clientBundle?(o(),i(c,{key:0},[Be,e("div",null,[ke,e("div",null,m($(t.current.size.clientBundle)),1)])],64)):b("",!0),t.current.size.nitroBundle?(o(),i(c,{key:1},[Ce,e("div",null,[Ne,e("div",null,m($(t.current.size.nitroBundle)),1)])],64)):b("",!0),Te,e("div",null,[Ae,e("div",null,m(n(G)(new Date(t.current.endTime))),1)]),De,e("div",null,[Ie,r(z,{filepath:t.current.analyzeDir},null,8,["filepath"])])]),Ve,r(N,{n:"rose",icon:"carbon-delete",onClick:u[0]||(u[0]=v=>x(t.current.name))},{default:a(()=>[_(" Delete this report ")]),_:1})])):b("",!0),u._lazyshow1||n(l).id==="bundle-client"?(u._lazyshow1=!0,o(),i(c,null,[A(e("iframe",{src:`${I}${t.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[D,n(l).id==="bundle-client"]])],64)):b("v-show-if",!0),u._lazyshow2||n(l).id==="bundle-nitro"?(u._lazyshow2=!0,o(),i(c,null,[A(e("iframe",{src:`${I}${t.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[D,n(l).id==="bundle-nitro"]])],64)):b("v-show-if",!0),u._lazyshow3||n(l).id==="vite-inspect"?(u._lazyshow3=!0,o(),i(c,null,[A(e("iframe",{src:`${I}${t.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[D,n(l).id==="vite-inspect"]])],64)):b("v-show-if",!0)])}}}),Se={class:"markdown-body"},Pe=e("h1",null,"Build Analyze",-1),Re=e("p",null,[_("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"),_(" and present the output data directly in DevTools for easy browsing and comparing.")],-1),je=[Pe,Re],Ee={__name:"analyze-build",setup(C,{expose:p}){return p({frontmatter:{}}),(l,$)=>(o(),i("div",Se,je))}},Ge={flex:"~ col"},Le=["onClick"],Ue={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},Oe=e("div",{"i-carbon-time":""},null,-1),He=e("div",{"flex-auto":""},null,-1),Ke=e("div",{"x-divider":""},null,-1),Me={flex:"~ items-center justify-center wrap",p4:""},Je={flex:"~ col gap-1","w-250":"",p4:""},Qe=e("h3",{class:"text-lg font-medium leading-6",mb2:""}," Start analyze build? ",-1),We=e("p",{op50:""}," Enter the name of the build: ",-1),Ye=e("div",{my3:"","x-divider":""},null,-1),Ze=e("p",{op50:""}," The following command will be executed in your terminal: ",-1),qe={flex:"~ gap-3",mt2:"","justify-end":""},st=j({__name:"analyze-build",setup(C){const p=X(),f=ee(),l=te(),$=ne("analyze-build:slug",""),g=V(()=>f.value?.builds.find(d=>d.slug===$.value)??f.value?.builds[0]),x=F(!1),t=F(""),u=V(()=>f.value?.builds.some(d=>d.name===t.value.trim()));async function z(){t.value=await P.generateAnalyzeBuildName(),await p.start()&&(k.value={name:t.value,processId:await P.startAnalyzeBuild(await L(),t.value)},x.value&&v())}const N=oe();function v(){k.value?.processId&&(N.value=k.value.processId,l.push("/modules/terminals"))}function T(d){return`${((d.endTime-d.startTime)/1e3).toFixed(1)}s`}return le(()=>[{id:"action:analyze-build: start",title:"Start a new analyze build",icon:"i-carbon-edge-node",action:z}]),(d,h)=>{const B=U,O=Fe,H=re,K=ie,M=se,J=de,Q=ce,W=me,Y=ae,Z=Ee,q=_e;return o(),i(c,null,[r(K,{"left-size":30},{left:a(()=>[e("div",Ge,[(o(!0),i(c,null,E(n(f)?.builds,s=>(o(),i(c,{key:s.slug},[e("button",{flex:"~ col gap1","hover:bg-active":"",p3:"",class:S(s.slug===n(g)?.slug?"text-primary bg-active":""),onClick:y=>$.value=s.slug},[e("code",null,m(s.name),1),e("div",Ue,[Oe,e("span",null,m(T(s)),1),He,e("span",null,m(n(G)(new Date(s.endTime))),1)])],10,Le),Ke],64))),128)),e("div",Me,[("processAnalyzeBuildInfo"in d?d.processAnalyzeBuildInfo:n(k))?(o(),w(B,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:h[1]||(h[1]=s=>v())},{default:a(()=>[_(" Building... ")]),_:1})):(o(),w(B,{key:0,n:"primary",icon:"carbon-edge-node",onClick:h[0]||(h[0]=s=>z())},{default:a(()=>[_(" Start a new build ")]),_:1}))])])]),right:a(()=>[n(g)?(o(),w(O,{key:0,current:n(g)},null,8,["current"])):(o(),w(H,{key:1}))]),_:1}),r(n(p),null,{default:a(({resolve:s})=>[r(Y,{"model-value":!0,onClose:y=>s(!1)},{default:a(()=>[e("div",Je,[Qe,We,r(M,{modelValue:n(t),"onUpdate:modelValue":h[2]||(h[2]=y=>R(t)?t.value=y:null),placeholder:"Build name"},null,8,["modelValue"]),n(u)?(o(),w(J,{key:0,"n-orange":""},{default:a(()=>[_(" A build with the same name already exists, continue would overrides the previous build result. ")]),_:1})):b("",!0),Ye,Ze,r(Q,{code:`npx nuxi analyze --no-serve --name=${n(t)}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),r(W,{modelValue:n(x),"onUpdate:modelValue":h[3]||(h[3]=y=>R(x)?x.value=y:null),mt2:"",n:"primary"},{default:a(()=>[_(" Navigate to terminal ")]),_:1},8,["modelValue"]),e("div",qe,[r(B,{onClick:y=>s(!1)},{default:a(()=>[_(" Cancel ")]),_:2},1032,["onClick"]),r(B,{n:"solid primary",onClick:y=>s(!0)},{default:a(()=>[_(" Start ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),r(q,null,{default:a(()=>[r(Z)]),_:1})],64)}}});export{st as default};
@@ -0,0 +1,16 @@
1
+ import{d as X,r as N,W as q,o as s,m as p,i as u,f as t,k as e,v as k,F as L,n as G,h as F,j as x,p as S,E as H,X as U,Y as me,Z as fe,J as Z,K as J,_ as te,a0 as oe,U as se,C as ae,a as A,a1 as ve,a2 as he,a3 as le,t as V,a4 as ie,a5 as _e,l as R,a6 as ge,b as ne,a7 as xe,e as we,a8 as be,a9 as re,H as W,aa as ye,ab as $e,V as ke,ac as Ce,ad as Pe,ae as Ae}from"./entry.d12f745d.js";import{_ as De}from"./Navbar.vue.c509e5d2.js";import{_ as Ve}from"./NSectionBlock.00736ab5.js";import{_ as Ne}from"./FilepathItem.vue.3d85c8b7.js";import{_ as Fe,u as Ie}from"./storage-options.f9b1696b.js";import{_ as Se}from"./DrawerRight.vue.462f9048.js";import{D as Te}from"./constants.4e5eba24.js";import"./NIconTitle.vue.9acdbad1.js";import"./NCodeBlock.vue.31f18b3e.js";import"./client.237dd3ea.js";const je={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},Ee={for:"drop-zone-input","text-3xl":""},Ue={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},Be=e("div",{px6:"",py6:""},[e("h1",{"text-2xl":""}," Upload "),e("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1),Le={grid:"~ cols-minmax-8rem","overflow-auto":"",p6:""},ze={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Me=["src"],Oe={flex:"~ gap1","items-center":""},Re={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Ke=X({__name:"DropZone",props:{folder:{type:String,required:!0}},setup(T){const l=T,d=N(!1),n=N(),m=N([]),v=["image","video"];function D(i){n.value=i.target,d.value=!0}function c(i){i.target===n.value&&(d.value=!1)}function C(i){i.preventDefault()}function K(i){i.preventDefault(),B(i.dataTransfer.files)}function B(i){const g=Array.from(i||[]);if(g.length){const _=[],P=m.value.map(f=>f.name);for(const f of g)if(P.includes(f.name)){let r=1;const[y,a]=f.name.split(".");for(;P.includes(`${y} (${r}).${a}`);)r++;const o=`${y}-${r}.${a}`,M=new Blob([f],{type:f.type}),O=new File([M],o,{lastModified:Date.now()});_.push(O),P.push(o)}else f.type===""?U({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}):v.some(r=>f.type.includes(r))?_.push(f):U({message:`"${f.type}" file type is not allowed`,icon:"carbon:face-dissatisfied",classes:"text-orange"});m.value=[...m.value,..._]}}async function w(){if(me.value||fe.value)return;const i=[];for(const g of m.value){const _=new FileReader;_.readAsDataURL(g);const f=(await new Promise(r=>{_.onload=()=>r(_.result)})).split(";base64,").pop();i.push({path:g.name,encoding:"base64",content:f})}await Z.writeStaticAssets(await J(),[...i],l.folder).then(()=>{j(),U({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(g=>{console.error(g),j(),U({message:`Error uploading files: ${g}`,icon:"i-carbon-warning",classes:"text-red"})}),d.value=!1}function h(i){m.value?.splice(i,1)}function b(i){return URL.createObjectURL(i)}function z(i,g){const[_,P]=i.name.split("."),f=g.replace(/\.\w+$/,""),r=`${f}.${P}`;return f.length===0?(alert("File name must be at least 1 characters long"),_):(Object.defineProperty(i,"name",{value:r,writable:!1}),m.value.splice(m.value.indexOf(i),1,i),i)}function I(){m.value=[]}function j(){d.value=!1,I()}return q("dragenter",D),q("dragleave",c),q("dragover",C),q("drop",K),(i,g)=>{const _=te,P=oe,f=se,r=ae;return s(),p("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:H(t(d)?"opacity-100 visible":"opacity-0 invisible")},[u(_,{icon:"carbon-close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",onClick:j}),t(m)?.length?(s(),p("div",Ue,[Be,e("div",Le,[(s(!0),p(L,null,G(t(m),(y,a)=>(s(),p("div",{key:y.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[e("div",ze,[e("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:b(y)},null,8,Me)]),e("div",Oe,[u(f,{n:"xs","flex-auto":"","model-value":y.name,"onUpdate:modelValue":o=>z(y,o.target.value)},null,8,["model-value","onUpdate:modelValue"]),u(_,{icon:"carbon-delete","flex-none":"",title:"Remove file",onClick:o=>h(a)},null,8,["onClick"])])]))),128))]),e("div",Re,[t(m).length?(s(),F(r,{key:0,n:"red",onClick:I},{default:x(()=>[u(P,{icon:"carbon-clean"}),k(" Clear ")]),_:1})):S("",!0),u(r,{disabled:!t(m).length,n:"primary solid",onClick:w},{default:x(()=>[u(P,{icon:"carbon-cloud-upload"}),k(" Upload ")]),_:1},8,["disabled"])])])):(s(),p("div",je,[e("label",Ee,[u(P,{icon:"carbon-cloud-upload","mr-2":""}),k(" Drop files here or click to select ")]),e("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:g[0]||(g[0]=y=>B(y.target.files))},null,32)]))],2)}}}),Xe=X({__name:"AssetFontPreview",props:{asset:{}},setup(T){const l=T,d=A(()=>`devtools-assets-${ve(l.asset)}`);return he(A(()=>`
2
+ @font-face {
3
+ font-family: '${d.value}';
4
+ src: url('${l.asset.publicPath}');
5
+ }
6
+ `)),(n,m)=>(s(),p("div",{"of-hidden":"",style:le({fontFamily:`'${t(d)}'`})}," 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))}}),Ze={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},Ge=["src"],We={key:2,"i-carbon-document":"","text-3xl":"",op20:""},qe={key:3,"w-full":"","self-start":"",p4:""},He=["textContent"],Je={key:4},Ye=["src","autoplay","controls"],Qe={key:5,"i-carbon-help":"","text-3xl":"",op20:""},ce=X({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(T){return(l,d)=>{const n=Xe;return s(),p("div",Ze,[l.asset.type==="image"?(s(),p("img",{key:0,src:l.asset.publicPath},null,8,Ge)):l.asset.type==="font"?(s(),F(n,{key:l.asset.publicPath,asset:l.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):l.asset.type==="text"&&!l.textContent?(s(),p("div",We)):l.asset.type==="text"&&l.textContent?(s(),p("div",qe,[e("pre",{"max-h-10rem":"","of-hidden":"","text-xs":"","font-mono":"",textContent:V(l.textContent)},null,8,He)])):l.asset.type==="video"?(s(),p("div",Je,[e("video",{src:l.asset.publicPath,autoplay:l.detail,controls:l.detail},null,8,Ye)])):(s(),p("div",Qe))])}}}),et={flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},tt={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},nt=X({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(T){const l=T,d=A(()=>l.folder&&l.asset.path.startsWith(l.folder)?l.asset.path.slice(l.folder.length):l.asset.path);return(n,m)=>{const v=ce;return s(),p("button",et,[u(v,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:n.asset},null,8,["asset"]),e("div",tt,V(t(d)),1)])}}}),ue=X({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(T,{emit:l}){const d=T,n=ie(d,"modelValue",l,{passive:!0}),m=A(()=>d.item?.children?.length),v=N(!0),D=A(()=>m.value?"i-carbon-folder":d.item.type==="image"?"i-carbon-image":d.item.type==="video"?"i-carbon-video":d.item.type==="audio"?"i-carbon-volume-up":d.item.type==="font"?"i-carbon-text-small-caps":d.item.type==="text"?"i-carbon-document":d.item.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(c,C)=>{const K=oe,B=ue;return s(),p("div",null,[e("button",{flex:"~ gap-2","w-full":"","items-center":"",hover:"bg-active",px4:"",py1:"",style:le({paddingLeft:`calc(1rem + ${c.index*1.5}em)`}),class:H({"bg-active":!t(m)&&t(n)?.filePath===c.item?.filePath}),border:"b base",onClick:C[0]||(C[0]=w=>t(m)?v.value=!t(v):n.value=c.item)},[e("div",{class:H(t(D))},null,2),e("span",{class:H({"flex items-center":t(m)}),"flex-auto":"","text-start":"","text-sm":"","font-mono":""},V(c.item.path),3),t(m)?(s(),F(K,{key:0,icon:"carbon:chevron-right","transform-rotate":t(v)?90:0,transition:""},null,8,["transform-rotate"])):S("",!0)],6),t(v)?_e(c.$slots,"default",{key:0},()=>[(s(!0),p(L,null,G(c.item?.children,w=>(s(),F(B,{key:w.filepath,modelValue:t(n),"onUpdate:modelValue":C[1]||(C[1]=h=>R(n)?n.value=h:null),item:w,index:c.index+1},null,8,["modelValue","item","index"]))),128))]):S("",!0)])}}}),ot={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},st=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Preview "),e("div",{"x-divider":""})],-1),at={flex:"~","items-center":"","justify-center":""},lt=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Details "),e("div",{"x-divider":""})],-1),it={"max-w-full":"","w-full":"","table-fixed":""},rt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1),ct={flex:"~ gap-1","w-full":"","items-center":""},ut=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1),dt={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},pt={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},mt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1),ft={capitalize:""},vt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1),ht={key:0},_t=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1),gt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1),xt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1),wt={op70:""},bt=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Actions "),e("div",{"x-divider":""})],-1),yt={flex:"~ gap2 wrap"},$t=e("div",{"flex-auto":""},null,-1),kt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Ct=e("span",null," Are you sure you want to delete this asset? ",-1),Pt={flex:"~ gap2 wrap justify-center"},At={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Dt={flex:"~ gap2 wrap justify-center"},Vt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},Nt=["onKeydown"],Ft={flex:"","justify-end":"","gap-4":""},It=X({__name:"AssetDetails",props:{modelValue:{}},setup(T,{emit:l}){const n=ie(T,"modelValue",l,{passive:!0}),m=ge(),v=ne(()=>{if(n.value.type==="image")return Z.getImageMeta(n.value.filePath)}),D=N(!1),c=N(),C=N(0),K=ne(async()=>{if(n.value.type!=="text")return;C.value;const a=await Z.getTextAssetContent(n.value.filePath);return c.value=a,a});async function B(){if(K.value!==c.value)try{await Z.writeStaticAssets(await J(),[{path:n.value.path,content:c.value,override:!0}],""),D.value=!1,C.value++,U({message:"Updated",icon:"i-carbon-checkmark",classes:"text-green"})}catch{U({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const w=xe(),h=A(()=>(w.value?._installedModules||[]).some(o=>o.meta?.name==="@nuxt/image"||o.meta?.name==="@nuxt/image-edge")),b=A(()=>{const a=[];if(n.value.type==="image"){const o=v.value?.width?`
7
+ width="${v.value.width}"
8
+ height="${v.value.height}" `:" ";return a.push({lang:"vue-html",code:`<img${o}
9
+ src="${n.value.publicPath}"
10
+ />`,name:"Plain Image"}),h.value&&a.push({lang:"vue-html",code:`<NuxtImage${o}
11
+ src="${n.value.publicPath}"
12
+ />`,name:"Nuxt Image",docs:"https://image.nuxtjs.org/components/nuxt-img"},{lang:"vue-html",code:`<NuxtPicture${o}
13
+ src="${n.value.publicPath}"
14
+ />`,name:"Nuxt Picture",docs:"https://image.nuxtjs.org/components/nuxt-picture"}),a}return a.push({lang:"html",code:`<a download href="${n.value.publicPath}">
15
+ Download ${n.value.path.split("/").slice(-1)[0]}
16
+ </a>`,name:"Download link"}),a}),z=we(),I=be(()=>n.value.mtime),j=A(()=>{const a=n.value.size;return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/1024/1024).toFixed(2)} MB`}),i=A(()=>{if(!v.value?.width||!v.value?.height)return"";const a=(M,O)=>O?a(O,M%O):M,o=a(v.value.width,v.value.height);return o>3?`${v.value.width/o}:${v.value.height/o}`:""}),g=A(()=>["image","text","video","font"].includes(n.value.type)),_=N(!1);async function P(){try{await Z.deleteStaticAsset(await J(),n.value.filePath),n.value=void 0,_.value=!1,U({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch{U({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const f=N(!1),r=N("");async function y(){const a=n.value.filePath.split("/"),o=a.slice(-1)[0].split(".").slice(0,-1).join(".");if(!r.value||r.value===o)return U({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const M=a.slice(-1)[0].split(".").slice(-1)[0],O=`${a.slice(0,-1).join("/")}/${r.value}.${M}`;await Z.renameStaticAsset(await J(),n.value.filePath,O),n.value=void 0,f.value=!1,U({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch{U({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(a,o)=>{const M=ce,O=Ne,Y=te,E=ae,de=Fe,Q=ke,pe=se,ee=re("tooltip");return s(),p(L,null,[e("div",ot,[t(g)?(s(),p(L,{key:0},[st,e("div",at,[u(M,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:t(n),"text-content":t(K)},null,8,["asset","text-content"])])],64)):S("",!0),lt,e("table",it,[e("tbody",null,[e("tr",null,[rt,e("td",null,[e("div",ct,[u(O,{filepath:t(n).filePath,"text-left":""},null,8,["filepath"]),W(u(Y,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",onClick:o[0]||(o[0]=$=>t(m)(t(n).filePath))},null,512),[[ee,"Open in Editor"]])])])]),e("tr",null,[ut,e("td",null,[e("div",dt,[e("div",pt,V(t(n).publicPath),1),W(u(Y,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",onClick:o[1]||(o[1]=$=>t(z)(t(n).publicPath))},null,512),[[ee,"Copy public path"]]),W(u(Y,{"flex-none":"",to:t(n).publicPath,icon:"carbon-launch",target:"_blank",title:"Open in browser"},null,8,["to"]),[[ee,"Open in browser"]])])])]),e("tr",null,[mt,e("td",ft,V(t(n).type),1)]),t(v)?.width?(s(),p(L,{key:0},[e("tr",null,[vt,e("td",null,V(t(v).width)+" x "+V(t(v).height),1)]),t(i)?(s(),p("tr",ht,[_t,e("td",null,V(t(i)),1)])):S("",!0)],64)):S("",!0),e("tr",null,[gt,e("td",null,V(t(j)),1)]),e("tr",null,[xt,e("td",null,[k(V(new Date(t(n).mtime).toLocaleString())+" ",1),e("span",wt,"("+V(t(I))+")",1)])])])]),bt,e("div",yt,[u(E,{to:t(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:x(()=>[k(" Download ")]),_:1},8,["to"]),t(n).type==="text"?(s(),F(E,{key:0,icon:"carbon-edit",n:"cyan",onClick:o[2]||(o[2]=$=>D.value=!t(D))},{default:x(()=>[k(" Edit ")]),_:1})):S("",!0),u(E,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:o[3]||(o[3]=$=>f.value=!t(f))},{default:x(()=>[k(" Rename ")]),_:1}),u(E,{icon:"carbon-delete",n:"red",onClick:o[4]||(o[4]=$=>_.value=!t(_))},{default:x(()=>[k(" Delete ")]),_:1}),t(n).type==="image"?(s(),F(E,{key:1,disabled:"",icon:"carbon-image-service"},{default:x(()=>[k(" Optimize image (Coming soon) ")]),_:1})):S("",!0)]),$t,t(b).length?(s(),F(de,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":t(b)},null,8,["code-snippets"])):S("",!0)]),u(Q,{modelValue:t(_),"onUpdate:modelValue":o[6]||(o[6]=$=>R(_)?_.value=$:null)},{default:x(()=>[e("div",kt,[Ct,e("div",Pt,[u(E,{icon:"carbon-close",onClick:o[5]||(o[5]=$=>_.value=!1)},{default:x(()=>[k(" Cancel ")]),_:1}),u(E,{icon:"carbon-delete",n:"red",onClick:P},{default:x(()=>[k(" Delete ")]),_:1})])])]),_:1},8,["modelValue"]),u(Q,{modelValue:t(f),"onUpdate:modelValue":o[9]||(o[9]=$=>R(f)?f.value=$:null)},{default:x(()=>[e("div",At,[u(pe,{modelValue:t(r),"onUpdate:modelValue":o[7]||(o[7]=$=>R(r)?r.value=$:null),placeholder:"New name",n:"blue"},null,8,["modelValue"]),e("div",Dt,[u(E,{icon:"carbon-close",onClick:o[8]||(o[8]=$=>f.value=!1)},{default:x(()=>[k(" Cancel ")]),_:1}),u(E,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:y},{default:x(()=>[k(" Rename ")]),_:1})])])]),_:1},8,["modelValue"]),t(n).type==="text"?(s(),F(Q,{key:0,modelValue:t(D),"onUpdate:modelValue":o[12]||(o[12]=$=>R(D)?D.value=$:null)},{default:x(()=>[e("div",Vt,[W(e("textarea",{"onUpdate:modelValue":o[10]||(o[10]=$=>R(c)?c.value=$:null),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:ye(B,["enter"])},null,40,Nt),[[$e,t(c)]]),e("div",Ft,[u(E,{icon:"carbon-close",onClick:o[11]||(o[11]=$=>D.value=!1)},{default:x(()=>[k(" Cancel ")]),_:1}),u(E,{icon:"carbon:save",n:"primary",onClick:B},{default:x(()=>[k(" save ")]),_:1})])])]),_:1},8,["modelValue"])):S("",!0)],64)}}}),St={"h-full":"","of-auto":""},Tt={"flex-none":"",flex:"~ gap2 items-center"},jt={op50:""},Et={key:0},Ut={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},Bt={key:1,p2:"",grid:"~ cols-minmax-8rem"},Lt={key:1},Ht=X({__name:"assets",setup(T){const l=Ce(),d=N(""),n=A(()=>new Pe(l.value||[],{keys:["path"]})),m=A(()=>d.value?n.value.search(d.value).map(h=>h.item):l.value||[]),v=A(()=>{const w={};for(const h of m.value){const b=`${h.path.split("/").slice(0,-1).join("/")}/`;w[b]||(w[b]=[]),w[b].push(h)}return Object.entries(w).sort(([h],[b])=>h.localeCompare(b))}),D=A(()=>{const w={path:"public",children:[]},h=(b,z,I)=>{const[j,...i]=z;let g=b.children.find(_=>_.path===j);g||(g={...I,path:j,children:[]},b.children.push(g)),i.length>1?h(g,i,I):i.length===1&&g.children.push({...I,path:i[0]})};return m.value.forEach(b=>{const z=b.path.split("/").filter(I=>I!=="");h(w,z,b)}),w.children}),c=N(),{view:C}=Ie("assets");function K(){C.value=C.value==="list"?"grid":"list"}Ae("Escape",()=>{c.value=void 0});const B=N();return(w,h)=>{const b=te,z=De,I=Ke,j=nt,i=Ve,g=ue,_=It,P=Se,f=re("tooltip");return s(),p("div",St,[u(z,{ref_key:"navbar",ref:B,search:t(d),"onUpdate:search":h[0]||(h[0]=r=>R(d)?d.value=r:null),pb2:""},{actions:x(()=>[e("div",Tt,[W(u(b,{"text-lg":"",icon:t(C)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:K},null,8,["icon"]),[[f,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:x(()=>[e("div",jt,[t(d)?(s(),p("span",Et,V(t(m).length)+" matched · ",1)):S("",!0),e("span",null,V(t(l)?.length)+" assets in total",1)])]),_:1},8,["search"]),u(I,{folder:"/"}),t(C)==="grid"?(s(),p(L,{key:0},[t(v).length>1?(s(!0),p(L,{key:0},G(t(v),([r,y])=>(s(),F(i,{key:r,text:r,description:`${y.length} items`,open:y.length<=("DETAILS_MAX_ITEMS"in w?w.DETAILS_MAX_ITEMS:t(Te)),padding:!1},{default:x(()=>[e("div",Ut,[(s(!0),p(L,null,G(y,a=>(s(),F(j,{key:a.path,asset:a,folder:r,onClick:o=>c.value=a},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(s(),p("div",Bt,[(s(!0),p(L,null,G(t(m),r=>(s(),F(j,{key:r.path,asset:r,onClick:y=>c.value=r},null,8,["asset","onClick"]))),128))]))],64)):(s(),p("div",Lt,[(s(!0),p(L,null,G(t(D),(r,y)=>(s(),F(g,{key:y,modelValue:t(c),"onUpdate:modelValue":h[1]||(h[1]=a=>R(c)?c.value=a:null),item:r},null,8,["modelValue","item"]))),128))])),u(P,{"model-value":!!t(c),"auto-close":"","w-120":"",navbar:t(B),onClose:h[3]||(h[3]=r=>c.value=void 0)},{default:x(()=>[t(c)?(s(),F(_,{key:0,modelValue:t(c),"onUpdate:modelValue":h[2]||(h[2]=r=>R(c)?c.value=r:null)},null,8,["modelValue"])):S("",!0)]),_:1},8,["model-value","navbar"])])}}});export{Ht as default};
@@ -1 +1 @@
1
- import{bk as f,by as r}from"./entry.704683a1.js";let o;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(t=>t(e))},get(){return o.value},configurable:!0}),()=>{n.splice(n.indexOf(i),1)}}function u(){o||(o=f(),s(e));function i(){r(o)}function e(t){o.value=t,t.host&&t.host.hooks.hook("host:update:reactivity",i)}return o}const c=u();export{c as d};
1
+ import{bl as f,bA as r}from"./entry.d12f745d.js";let o;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(t=>t(e))},get(){return o.value},configurable:!0}),()=>{n.splice(n.indexOf(i),1)}}function u(){o||(o=f(),s(e));function i(){r(o)}function e(t){o.value=t,t.host&&t.host.hooks.hook("host:update:reactivity",i)}return o}const c=u();export{c as d};