@nuxt/devtools 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/module-main.mjs +8 -6
- package/dist/chunks/plugin-metrics.mjs +1 -1
- package/dist/chunks/timeline.mjs +1 -1
- package/dist/chunks/vite-inspect.mjs +1 -1
- package/dist/chunks/vue-inspector.mjs +1 -1
- package/dist/client/200.html +19 -19
- package/dist/client/404.html +19 -19
- package/dist/client/_nuxt/{CodeDiff.vue.470b870b.js → CodeDiff.vue.786903cd.js} +1 -1
- package/dist/client/_nuxt/{ComposableItem.vue.4be0b467.js → ComposableItem.vue.93291047.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaButton.vue.7acec8bd.js → DataSchemaButton.vue.e78a09d4.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaDrawer.6f0305ae.js → DataSchemaDrawer.f39b3d44.js} +1 -1
- package/dist/client/_nuxt/{DurationDisplay.vue.d5eecd01.js → DurationDisplay.vue.ce619fea.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.0f604f99.js → FilepathItem.vue.e3761da9.js} +1 -1
- package/dist/client/_nuxt/{HelpFab.vue.308adf61.js → HelpFab.vue.452fd066.js} +1 -1
- package/dist/client/_nuxt/{LaunchPage.vue.ffcbcacd.js → LaunchPage.vue.5db0c060.js} +1 -1
- package/dist/client/_nuxt/{NBadge.1af19adc.js → NBadge.787d75d1.js} +1 -1
- package/dist/client/_nuxt/{NCheckbox.vue.c0c515c4.js → NCheckbox.vue.7e495ed2.js} +1 -1
- package/dist/client/_nuxt/{NCodeBlock.vue.55894991.js → NCodeBlock.vue.7e25538f.js} +1 -1
- package/dist/client/_nuxt/{NDrawer.vue.99f5580b.js → NDrawer.vue.fa4b06a6.js} +1 -1
- package/dist/client/_nuxt/{NDropdown.vue.82a0f7a6.js → NDropdown.vue.7a6942fe.js} +1 -1
- package/dist/client/_nuxt/{NIconTitle.vue.a9777fd3.js → NIconTitle.vue.8e6741d5.js} +1 -1
- package/dist/client/_nuxt/{NLink.vue.090d2b6e.js → NLink.vue.0a35d66d.js} +1 -1
- package/dist/client/_nuxt/{NMarkdown.vue.4a9638b7.js → NMarkdown.vue.099cce55.js} +1 -1
- package/dist/client/_nuxt/{NNavbar.vue.329d273e.js → NNavbar.vue.9cb56412.js} +1 -1
- package/dist/client/_nuxt/{NSectionBlock.bc36f09f.js → NSectionBlock.f3242abf.js} +1 -1
- package/dist/client/_nuxt/{NSelect.vue.73b358c9.js → NSelect.vue.cdaf42b9.js} +1 -1
- package/dist/client/_nuxt/{NSelectTabs.vue.c879b497.js → NSelectTabs.vue.cf18ccbe.js} +1 -1
- package/dist/client/_nuxt/{NSwitch.vue.8e26c951.js → NSwitch.vue.6e493b89.js} +1 -1
- package/dist/client/_nuxt/{StacktraceList.vue.8012c829.js → StacktraceList.vue.a54c08af.js} +1 -1
- package/dist/client/_nuxt/{StateEditor.vue.de9e5fb0.js → StateEditor.vue.2b7dac11.js} +1 -1
- package/dist/client/_nuxt/{__blank.b424e04d.js → __blank.38ec0588.js} +1 -1
- package/dist/client/_nuxt/{analyze-build.0a92832b.js → analyze-build.3c8ffa82.js} +1 -1
- package/dist/client/_nuxt/{assets.b1bb5a8b.js → assets.c6f98235.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/de4ce1fd-092b-47eb-98b3-1a9b7af1000f.json +1 -0
- package/dist/client/_nuxt/{client.5139b740.js → client.7628b7e9.js} +1 -1
- package/dist/client/_nuxt/{components.ec2bc2e0.js → components.0df44336.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_.22b5de51.js → custom-_name_.97248110.js} +1 -1
- package/dist/client/_nuxt/{default.a830102b.js → default.80c1f1c2.js} +1 -1
- package/dist/client/_nuxt/entry.52bc93cd.js +27 -0
- package/dist/client/_nuxt/entry.8bdf7dd8.css +1 -0
- package/dist/client/_nuxt/{error-404.08d4b3ab.js → error-404.c1c64157.js} +1 -1
- package/dist/client/_nuxt/{error-500.2884d8fb.js → error-500.14a76226.js} +1 -1
- package/dist/client/_nuxt/{error.480298a9.js → error.81ad2d42.js} +1 -1
- package/dist/client/_nuxt/{full.7cf1e42e.js → full.6e527000.js} +1 -1
- package/dist/client/_nuxt/{hooks.09b6efe0.js → hooks.e54b1704.js} +1 -1
- package/dist/client/_nuxt/{imports.9dbeba31.js → imports.996d62b8.js} +1 -1
- package/dist/client/_nuxt/{index.3ee0584e.js → index.64fbc2ea.js} +1 -1
- package/dist/client/_nuxt/index.f5673bec.js +16 -0
- package/dist/client/_nuxt/{json-editor-vue.e51c968b.js → json-editor-vue.d503734c.js} +1 -1
- package/dist/client/_nuxt/{modules.451e38d7.js → modules.56c28a7c.js} +1 -1
- package/dist/client/_nuxt/{none.67be85f3.js → none.194e11c7.js} +1 -1
- package/dist/client/_nuxt/{open-graph.9eed2b01.js → open-graph.da61329c.js} +1 -1
- package/dist/client/_nuxt/{overview.d4940d4b.js → overview.17cbcb18.js} +1 -1
- package/dist/client/_nuxt/{pages.e7892d8a.js → pages.7378ad18.js} +1 -1
- package/dist/client/_nuxt/{payload.734d0b5c.js → payload.d51e3588.js} +1 -1
- package/dist/client/_nuxt/{plugins.4ae6abad.js → plugins.0aa922de.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs.be989942.js → runtime-configs.ea309d52.js} +1 -1
- package/dist/client/_nuxt/server-routes.8a6576d0.js +9 -0
- package/dist/client/_nuxt/{settings.a91f8ddb.js → settings.d6b62c31.js} +1 -1
- package/dist/client/_nuxt/{state-components.558caa8f.js → state-components.bc8116fe.js} +1 -1
- package/dist/client/_nuxt/{state-modules.59c565a3.js → state-modules.a9841149.js} +1 -1
- package/dist/client/_nuxt/{storage-options.1c93b6a2.js → storage-options.e85e583e.js} +1 -1
- package/dist/client/_nuxt/{storage.d115f7c4.js → storage.9ae52fa2.js} +1 -1
- package/dist/client/_nuxt/{terminals.8201c148.js → terminals.ae8551c9.js} +1 -1
- package/dist/client/_nuxt/{timeline.ca0d67c3.js → timeline.595f30d2.js} +1 -1
- package/dist/client/_nuxt/{unocss-runtime.43e5d503.js → unocss-runtime.2336828a.js} +1 -1
- package/dist/client/_nuxt/{virtual-files.19e5fb95.js → virtual-files.acddf2b7.js} +1 -1
- package/dist/client/_nuxt/{vue-html.ded4875c.js → vue-html.1cd5a6cc.js} +1 -1
- package/dist/client/_nuxt/{vue.421a3560.js → vue.e4f172c2.js} +727 -439
- package/dist/client/index.html +19 -19
- package/dist/module.json +1 -1
- package/package.json +15 -15
- package/dist/client/_nuxt/builds/meta/136dbdb0-d4da-4a06-b141-83ca2e534bfd.json +0 -1
- package/dist/client/_nuxt/entry.56a3d1dd.css +0 -1
- package/dist/client/_nuxt/entry.7025a867.js +0 -27
- package/dist/client/_nuxt/index.cc851671.js +0 -17
- package/dist/client/_nuxt/server-routes.e1a8e445.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as V,au as L,ab as M,aJ as R,b5 as T,b6 as E,P,a as w,h as m,j as n,A as O,o as s,f as e,m as c,k as t,i,t as r,p as l,F as h,b7 as f,b8 as x,b9 as $,v as a,aE as F,D as W,M as G,E as H,x as K,Y as J,_ as U}from"./entry.
|
|
1
|
+
import{d as V,au as L,ab as M,aJ as R,b5 as T,b6 as E,P,a as w,h as m,j as n,A as O,o as s,f as e,m as c,k as t,i,t as r,p as l,F as h,b7 as f,b8 as x,b9 as $,v as a,aE as F,D as W,M as G,E as H,x as K,Y as J,_ as U}from"./entry.52bc93cd.js";import{u as Y,_ as q}from"./state-modules.a9841149.js";import{u as Q}from"./state-components.bc8116fe.js";import"./NBadge.787d75d1.js";import"./NCodeBlock.vue.7e25538f.js";import"./client.7628b7e9.js";import"./NCheckbox.vue.7e495ed2.js";const X="1.0.6",Z={key:0},tt={key:1,flex:"~ col gap2",ma:"","h-full":"","max-w-300":"","w-full":"",p5:"",px5:"","md:px20":""},et=t("div",{"flex-auto":""},null,-1),ot={flex:"~ col","mt-5":"","items-center":"","md:mt-20":""},nt=t("span",{op40:""}," Nuxt DevTools ",-1),st={op40:""},at={flex:"~ gap2 wrap"},it=t("div",{"logos-nuxt-icon":"","text-3xl":""},null,-1),lt=t("div",{"logos-vue":"","text-3xl":""},null,-1),ut=t("div",{"carbon-tree-view-alt":"","text-3xl":""},null,-1),rt=t("div",{"i-carbon-assembly-cluster":"","text-3xl":""},null,-1),dt=t("div",{"carbon-function":"","text-3xl":""},null,-1),ct=t("div",{"carbon-3d-mpr-toggle":"","text-3xl":""},null,-1),pt=t("div",{"carbon-plug":"","text-3xl":""},null,-1),_t={key:5,"pointer-events-none":"","min-w-40":"",p4:"","theme-card-lime":"",flex:"~ auto gap-6"},mt=t("div",{"i-carbon-time-plot":"","flex-none":"","text-3xl":""},null,-1),ht={grid:"~ cols-[auto_auto] gap-x-5 items-center"},ft=t("div",{"text-sm":""}," SSR to full load ",-1),xt={"text-right":""},vt=t("div",{"text-sm":""}," Page load ",-1),gt={"text-right":""},bt=t("div",{"text-sm":""}," Navigation ",-1),kt={"text-right":""},yt=t("div",{"text-sm":""}," HMR ",-1),Ct={"text-right":""},wt={flex:"~ col gap2"},Dt={flex:"~ gap-6 wrap","mt-5":"","items-center":"","justify-center":""},Bt=t("a",{href:"https://github.com/nuxt/devtools",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-blue",transition:""},[t("div",{"i-carbon-star":""}),a(" Star on GitHub ")],-1),St=t("a",{href:"https://github.com/nuxt/devtools/discussions/29",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-yellow",transition:""},[t("div",{"i-carbon-data-enrichment":""}),a(" Ideas & Suggestions ")],-1),zt=t("a",{href:"https://github.com/nuxt/devtools/discussions/31",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-lime",transition:""},[t("div",{"i-carbon-plan":""}),a(" Project Roadmap ")],-1),Nt=t("a",{href:"https://github.com/nuxt/devtools/issues",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-rose",transition:""},[t("div",{"i-carbon-debug":""}),a(" Bug Reports ")],-1),At=t("div",{"i-carbon-settings-adjust":""},null,-1),jt=t("div",{"flex-auto":""},null,-1),It={flex:"col gap-2",mxa:"",hidden:"","w-100":"","text-sm":"",op50:"","md:flex":""},Vt={flex:"~ gap-1","items-center":""},Lt=t("span",null,"+",-1),Mt=t("span",null,"+",-1),Rt=t("div",{"flex-auto":""},null,-1),Tt={flex:"~ gap-1","items-center":""},Et=t("span",null,"+",-1),Pt=t("span",null,"+",-1),Ot=t("span",null,"+",-1),$t=t("span",null,"+",-1),Ft=t("div",{"flex-auto":""},null,-1),Wt=t("div",null,"Toggle DevTools",-1),Zt=V({__name:"overview",setup(Gt){const v=L(),p=M(),D=Q(),g=R(),B=Y(),S=T(),b=E(),z=P();function N(){W.value=!0,z.push("/")}const k=w(()=>v.value?.nuxt.vueApp.version),u=w(()=>v.value?.metrics.loading());function A(){G()}return(o,Ht)=>{const j=H,_=K,y=q,C=J,d=U,I=O;return s(),m(I,{"h-screen":"","w-full":"",flex:""},{default:n(()=>[e(p)?(s(),c("div",tt,[et,t("div",ot,[i(_,{flex:"~","mt--10":"","items-center":"","justify-center":"",to:"https://devtools.nuxt.com/",target:"_blank"},{default:n(()=>[i(j,{"h-10":""})]),_:1}),t("button",{mb6:"",mt3:"","text-center":"","text-sm":"",flex:"~ gap-1 wrap",onClick:N},[nt,t("code",st,"v"+r(e(X)),1),i(y,{"package-name":"@nuxt/devtools",options:{dev:!0},"show-version":!1})])]),t("div",at,[i(_,{to:"https://nuxt.com",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[it,i(y,{"package-name":"nuxt",options:{dev:!0}})]),_:1}),e(k)?(s(),m(_,{key:0,to:"https://vuejs.org",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[lt,t("code",null,"v"+r(e(k)),1)]),_:1})):l("",!0),e(p)?(s(),c(h,{key:1},[e(p)&&e(p).pages&&e(v)?(s(),m(_,{key:0,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/pages"},{default:n(()=>[ut,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(S).length,"page")),1)]),_:1})):l("",!0),e(p)?(s(),m(_,{key:1,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/components"},{default:n(()=>[rt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(D).length,"component")),1)]),_:1})):l("",!0),e(p)&&e(g)?(s(),m(_,{key:2,"min-w-40":"",p4:"","theme-card-yellow":"",flex:"~ col auto",to:"/modules/imports"},{default:n(()=>[dt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(g).imports.length,"import")),1)]),_:1})):l("",!0),e(p)?(s(),m(_,{key:3,"min-w-40":"",p4:"","theme-card-purple":"",flex:"~ col auto",to:"/modules/modules"},{default:n(()=>[ct,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(B).length,"module")),1)]),_:1})):l("",!0),e(p)?(s(),m(_,{key:4,"min-w-40":"",p4:"","theme-card-teal":"",flex:"~ col auto",to:"/modules/plugins"},{default:n(()=>[pt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(p).plugins.length,"plugin")),1)]),_:1})):l("",!0),e(u)?(s(),c("div",_t,[mt,t("div",ht,[e(u).ssrStart?(s(),c(h,{key:0},[ft,t("div",xt,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).appLoad-e(u).ssrStart)),1)],64)):l("",!0),vt,t("div",gt,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).appLoad-e(u).appInit)),1),bt,t("div",kt,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).pageEnd-e(u).pageStart)),1),e(u).hmrStart?(s(),c(h,{key:1},[yt,t("div",Ct,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).hmrEnd-e(u).hmrStart)),1)],64)):l("",!0)])])):l("",!0)],64)):l("",!0)]),t("div",wt,[("showConnectionWarning"in o?o.showConnectionWarning:e($))?(s(),m(C,{key:0,n:"yellow5",icon:"carbon-unlink","justify-center":""},{default:n(()=>[a(" Not connected to the client app, showing server-side data only. Use the embedded mode for full features. ")]),_:1})):l("",!0),t("button",{title:"Authorize",onClick:A},[("isDevAuthed"in o?o.isDevAuthed:e(F))?l("",!0):(s(),m(C,{key:0,n:"orange5",icon:"i-carbon-locked","justify-center":""},{default:n(()=>[a(" Access from an untrusted browser, some features are limited. Click to authorize now. ")]),_:1}))])]),t("div",Dt,[Bt,St,zt,Nt,i(_,{to:"/settings",flex:"~ gap1","inline-block":"","items-center":"",op50:"","hover:op80":""},{default:n(()=>[At,a(" Settings ")]),_:1})]),jt,t("div",It,[t("div",Vt,[e(b)?(s(),c(h,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" ⌘ Cmd ")]),_:1}),Lt,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" K ")]),_:1})],64)):(s(),c(h,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" Ctrl ")]),_:1}),Mt,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" K ")]),_:1})],64)),Rt,a(" Open Command Palette ")]),t("div",Tt,[e(b)?(s(),c(h,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" ⇧ Shift ")]),_:1}),Et,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" ⌥ Option ")]),_:1}),Pt,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" D ")]),_:1})],64)):(s(),c(h,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" Shift ")]),_:1}),Ot,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" Alt ")]),_:1}),$t,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" D ")]),_:1})],64)),Ft,Wt])])])):(s(),c("div",Z," Loading... "))]),_:1})}}});export{Zt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as B,r as T,a as k,ap as W,f as t,o,m as s,k as e,t as $,h as y,j as x,bf as G,F as v,n as M,p as P,i as h,v as L,G as E,X as A,_ as H,ac as X,bg as D,b1 as q,b2 as J,ab as Q,am as Y,b3 as Z,an as ee,l as te,ae as oe,L as ne,M as ae}from"./entry.
|
|
1
|
+
import{d as B,r as T,a as k,ap as W,f as t,o,m as s,k as e,t as $,h as y,j as x,bf as G,F as v,n as M,p as P,i as h,v as L,G as E,X as A,_ as H,ac as X,bg as D,b1 as q,b2 as J,ab as Q,am as Y,b3 as Z,an as ee,l as te,ae as oe,L as ne,M as ae}from"./entry.52bc93cd.js";import{_ as j}from"./NBadge.787d75d1.js";import{_ as F}from"./FilepathItem.vue.e3761da9.js";import{_ as se}from"./NSectionBlock.f3242abf.js";import{_ as re}from"./LaunchPage.vue.5db0c060.js";import{_ as le}from"./HelpFab.vue.452fd066.js";import"./NIconTitle.vue.8e6741d5.js";import"./NMarkdown.vue.099cce55.js";import"./client.7628b7e9.js";const ie={block:"","cursor-pointer":""},ue={p2:""},ce=["onSubmit"],de=e("div",{px2:"","text-sm":"",op50:""}," Fill params and navigate: ",-1),pe={flex:"~","items-center":"",p2:"","text-sm":"","font-mono":""},_e={key:1},he=B({__name:"RoutePathItem",props:{route:{}},emits:["navigate"],setup(V,{emit:i}){const d=V,w=i,m=T([]),p=k(()=>{const u=N(d.route.path);return m.value=Array.from({length:u.length},()=>""),u});function N(u){return u.split(/(:\w+[\?\*]?(?:\(\))?)/).filter(Boolean).map(_=>_[0]===":"?_.replace(/\(\)$/,"?"):_)}const r=k(()=>p.value.map((u,_)=>u[0]===":"?m.value[_]:u).join("").replace(/\/+/g,"/")),n=k(()=>d.route.path.includes(":"));function f(){w("navigate",r.value)}return(u,_)=>{const a=A,l=H,c=W("VDropdown");return t(n)?(o(),y(c,{key:1},{popper:x(({hide:g})=>[e("div",ue,[e("form",{flex:"~ col",onSubmit:G(()=>{f(),g()},["prevent"])},[t(n)?(o(),s(v,{key:0},[de,e("div",pe,[(o(!0),s(v,null,M(t(p),(b,R)=>(o(),s(v,{key:R},[b[0]===":"?(o(),y(a,{key:0,modelValue:t(m)[R],"onUpdate:modelValue":I=>t(m)[R]=I,"w-20":"","n-sm":"",placeholder:b.slice(1)},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(o(),s("span",_e,$(b),1))],64))),128))])],64)):P("",!0),h(l,{block:"",n:"primary"},{default:x(()=>[L(" Navigate ")]),_:1})],40,ce)])]),default:x(()=>[e("code",ie,[(o(!0),s(v,null,M(t(p),(g,b)=>(o(),s("span",{key:b,class:E(g[0]===":"?"text-gray border border-dashed rounded border-gray:50 px1":"")},$(g[0]===":"?g.slice(1):g),3))),128))])]),_:1})):(o(),s("button",{key:0,onClick:f},[e("code",null,$(u.route.path),1)]))}}}),me={"w-full":""},fe=e("thead",{border:"b base"},[e("tr",null,[e("th",{"text-left":""}),e("th",{"text-left":""}," Route Path "),e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Middleware "),e("th",null," Layout ")])],-1),ge={"w-20":"","pr-1":""},ve={flex:"","items-center":"","justify-end":""},ye={"text-sm":""},be={flex:"inline gap3","items-center":""},xe={op0:"","group-hover:op100":"",flex:"~ gap1"},ke=["onClick"],$e=e("div",{"i-carbon-script-reference":""},null,-1),we=[$e],Ne={"w-0":"","ws-nowrap":"","pr-1":"","text-left":"","text-sm":"","font-mono":"",op50:""},Re={"w-0":"","ws-nowrap":"","pr-1":"","text-center":"","text-sm":"","font-mono":"",op50:""},Ce={"w-0":"","ws-nowrap":"","text-center":"","text-sm":"","font-mono":""},Pe={key:0},Ve=["onClick"],Ie=B({__name:"RoutesTable",props:{pages:{},layouts:{},matched:{},matchedPending:{}},emits:["navigate"],setup(V){const i=V,d=X(),w=D(),m=k(()=>[...i.pages].sort((r,n)=>r.path.localeCompare(n.path)));function p(r){const n=i.layouts.find(f=>f.name===r);n&&d(n.file)}function N(r){if(typeof r=="string")return w.value?.middleware.find(n=>n.name===r)?.path}return(r,n)=>{const f=j,u=he,_=F;return o(),s("div",null,[e("table",me,[fe,e("tbody",null,[(o(!0),s(v,null,M(t(m),a=>(o(),s("tr",{key:a.name,class:"group","h-7":"",border:"b dashed transparent hover:base"},[e("td",ge,[e("div",ve,[r.matched.find(l=>l.name===a.name)?(o(),y(f,{key:0,n:"green",title:"active",textContent:"active"})):r.matchedPending.find(l=>l.name===a.name)?(o(),y(f,{key:1,n:"teal",title:"next",textContent:"next"})):P("",!0)])]),e("td",ye,[e("div",be,[h(u,{route:a,class:E(r.matched.find(l=>l.name===a.name)?"text-primary":r.matchedPending.find(l=>l.name===a.name)?"text-teal":""),onNavigate:n[0]||(n[0]=l=>r.$emit("navigate",l))},null,8,["route","class"]),e("div",xe,[a.file||a.meta?.file?(o(),s("button",{key:0,"text-sm":"",op40:"",hover:"op100 text-primary",title:"Open in editor",onClick:l=>t(d)(a.file||a.meta?.file)},we,8,ke)):P("",!0)])])]),e("td",Ne,$(a.name),1),e("td",Re,[h(_,{filepath:N(a.meta.middleware),override:`${a.meta.middleware||"-"}`},null,8,["filepath","override"])]),e("td",Ce,[a.meta.layout===!1?(o(),s("span",Pe,"-")):a.meta.layout?(o(),s("button",{key:1,onClick:l=>p(a.meta.layout)},$(a.meta.layout),9,Ve)):(o(),s("button",{key:2,"text-sm":"",op15:"",onClick:n[1]||(n[1]=l=>p("default"))}," (default) "))])]))),128))])])])}}}),Le={class:"markdown-body"},Me=e("h1",null,"Pages",-1),Te=e("p",null,[L("Nuxt provides a file-based routing to create routes within your web application using Vue Router under the hood. Pages are Vue components and can have any valid extension that Nuxt supports (by default .vue, .js, .jsx, .mjs, .ts or .tsx). Nuxt will automatically create a route for every page in your "),e("code",null,"~/pages/"),L(" directory.")],-1),Be=e("p",null,[e("a",{href:"https://nuxt.com/docs/getting-started/routing",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Ee=e("hr",null,null,-1),Ae=e("h1",null,"Middlewares",-1),De=e("p",null,"Nuxt provides a customizable route middleware framework that can be used throughout the application. This is ideal for extracting code that needs to run before navigating to a particular route.",-1),je=e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/directory-structure/middleware",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Fe=[Me,Te,Be,Ee,Ae,De,je],Se={__name:"pages",setup(V,{expose:i}){return i({frontmatter:{}}),(w,m)=>(o(),s("div",Le,Fe))}},ze={key:0,"h-full":"","of-auto":""},Ke={border:"b base",flex:"~ col gap1",px4:"",py3:"","n-navbar-glass":""},Ue=e("span",{op50:""},"Navigate from ",-1),Oe={"font-mono":""},We=e("span",{op50:""}," to ",-1),Ge={key:1,op50:""},He=e("span",null,[L("Press "),e("b",{"font-bold":""},"Enter"),L(" to navigate")],-1),Xe={key:0,"text-orange":"",op75:""},qe={key:1,op50:""},Je={"min-h-14":""},Qe={key:1,class:"py-4 text-center"},Ye=e("span",{op50:""},"No routes matched",-1),Ze=[Ye],et={"w-full":""},tt=e("thead",{border:"b base","h-7":""},[e("tr",null,[e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Path ")])],-1),ot={mr1:""},pt=B({__name:"pages",setup(V){const i=q(),d=J(),w=Q(),m=D(),p=Y(),N=Z(),r=k(()=>m.value?.middleware||[]),n=T(""),f=T(0),u=k(()=>(r.value,n.value,p.value,f.value,i.value?.currentRoute?.value?.path));ee(()=>{d.value&&(n.value=i.value?.currentRoute?.value?.path),i.value?.beforeEach(c=>{n.value=c.fullPath}),i.value?.afterEach(c=>{n.value=c.fullPath})});async function _(){n.value!==i.value?.currentRoute?.value?.path&&i.value.push(n.value||"/")}const a=k(()=>i.value.resolve(n.value||"/").matched);function l(c){i.value.push(c),n.value=c}return(c,g)=>{const b=A,R=Ie,I=se,S=j,z=F,K=re,U=Se,O=le;return o(),s(v,null,[t(w)?.pages&&t(i)?(o(),s("div",ze,[e("div",Ke,[e("div",null,[t(u)!==t(n)?(o(),s(v,{key:0},[Ue,e("span",Oe,$(t(u)),1),We],64)):(o(),s("span",Ge,"Current route"))]),h(b,{modelValue:t(n),"onUpdate:modelValue":g[0]||(g[0]=C=>te(n)?n.value=C:null),"font-mono":"",icon:"carbon-direction-right-01 scale-y--100",class:E(t(u)===t(n)?"":t(a).length?"text-green":"text-orange"),onKeydown:oe(_,["enter"])},null,8,["modelValue","class","onKeydown"]),e("div",null,[t(u)!==t(n)?(o(),s(v,{key:0},[He,t(a).length?P("",!0):(o(),s("span",Xe," (no match)"))],64)):(o(),s("span",qe,"Edit path above to navigate"))])]),h(I,{icon:"carbon-tree-view",text:"Matched Routes",padding:!1},{default:x(()=>[e("div",Je,[t(a).length?(o(),y(R,{key:0,pages:t(a),layouts:t(p)||[],matched:t(d).matched,"matched-pending":t(a),onNavigate:l},null,8,["pages","layouts","matched","matched-pending"])):(o(),s("div",Qe,Ze))])]),_:1}),h(I,{icon:"carbon-tree-view-alt",text:"All Routes",description:`${t(N).length} routes registered in your application`,padding:"pr5"},{default:x(()=>[h(R,{pages:t(N),layouts:t(p)||[],matched:t(d).matched,"matched-pending":t(a),onNavigate:l},null,8,["pages","layouts","matched","matched-pending"])]),_:1},8,["description"]),t(r).length?(o(),y(I,{key:0,icon:"carbon:ibm-watson-studio",text:"Middleware",description:`${t(r).length} middleware registered in your application`,padding:"px13"},{default:x(()=>[e("table",et,[tt,(o(!0),s(v,null,M(t(r),C=>(o(),s("tr",{key:C.path,"h-7":""},[e("td",null,[e("span",ot,$(C.name),1),C.global?(o(),y(S,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"global"})):P("",!0)]),e("td",null,[h(z,{filepath:C.path},null,8,["filepath"])])]))),128))])]),_:1},8,["description"])):P("",!0)])):(o(),y(K,{key:1,icon:"carbon-tree-view-alt",name:"wizard-pages",title:"Nuxt Routing",description:"Create `./pages/index.vue` to enable routing",actions:[{label:"Learn more",src:"https://nuxt.com/docs/getting-started/routing",attrs:{n:"primary"}},{label:"Enable Routing",async handle(){return("rpc"in c?c.rpc:t(ne)).runWizard(await("ensureDevAuthToken"in c?c.ensureDevAuthToken:t(ae))(),"enablePages")}}]},null,8,["actions"])),h(O,null,{default:x(()=>[h(U)]),_:1})],64)}}});export{pt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as v}from"./StateEditor.vue.
|
|
1
|
+
import{_ as v}from"./StateEditor.vue.2b7dac11.js";import{d as b,o as e,m as c,F as k,n as C,h as f,j as o,aa as N,bh as B,bi as w,k as x,au as F,a as O,a2 as P,f as r,i as a,p as u,v as R,I as V,_ as j}from"./entry.52bc93cd.js";import{_ as E}from"./NSectionBlock.f3242abf.js";import{_ as A}from"./HelpFab.vue.452fd066.js";import"./DataSchemaButton.vue.e78a09d4.js";import"./json-editor-vue.d503734c.js";import"./NIconTitle.vue.8e6741d5.js";const G={key:0,flex:"~ col gap-1"},H={key:1,mt2:"",px4:"",italic:"",op35:""},K=b({__name:"StateGroup",props:{state:{},prefix:{default:""}},setup(m){return(t,n)=>{const i=v;return e(),c("div",null,[t.state&&Object.keys(t.state).length>0?(e(),c("div",G,[(e(!0),c(k,null,C(t.state,(l,s)=>(e(),f(i,{key:s,state:l,name:s.startsWith(t.prefix)?s.slice(t.prefix.length):s},{actions:o(_=>[N(t.$slots,"actions",B(w(_)))]),_:2},1032,["state","name"]))),128))])):(e(),c("div",H," No data "))])}}}),T={class:"markdown-body"},z=x("h1",null,"State & Async Data",-1),I=x("p",null,"// TODO",-1),L=[z,I],W={__name:"payload",setup(m,{expose:t}){return t({frontmatter:{}}),(i,l)=>(e(),c("div",T,L))}},q={key:0},et=b({__name:"payload",setup(m){const t=F(),n=O(()=>t.value?.nuxt.payload);async function i(l){await t.value?.nuxt.hooks.callHookParallel("app:data:refresh",l)}return(l,s)=>{const _=K,d=E,h=j,$=v,S=W,g=A,D=P("tooltip");return e(),c(k,null,[r(t)?(e(),c("div",q,[a(d,{icon:"carbon-data-set",text:"State",description:"Keyed state from `useState`",padding:!1},{default:o(()=>[a(_,{state:r(n).state,prefix:"$s"},null,8,["state"])]),_:1}),a(d,{icon:"carbon-data-blob",text:"Data",description:"Keyed state from `useAsyncData`",padding:!1},{actions:o(()=>[a(h,{n:"xs primary","self-start":"",icon:"i-carbon-recycle",onClick:s[0]||(s[0]=y=>i())},{default:o(()=>[R(" Re-fetch all data ")]),_:1})]),default:o(()=>[a(_,{state:r(n).data},{actions:o(({isOpen:y,name:p})=>[y&&p?V((e(),f(h,{key:0,title:`Re-fetch '${p}'`,icon:"carbon-recycle",border:!1,onClick:J=>i([p])},null,8,["title","onClick"])),[[D,`Re-fetch '${p}'`,void 0,{bottom:!0}]]):u("",!0)]),_:1},8,["state"])]),_:1}),r(n).functions&&Object.keys(r(n).functions).length?(e(),f(d,{key:0,icon:"carbon-function",text:"Functions",description:"State for functions"},{default:o(()=>[a($,{"ml--6":"",state:r(n).functions},null,8,["state"])]),_:1})):u("",!0)])):u("",!0),a(g,null,{default:o(()=>[a(S)]),_:1})],64)}}});export{et as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as S}from"./FilepathItem.vue.
|
|
1
|
+
import{_ as S}from"./FilepathItem.vue.e3761da9.js";import{_ as D}from"./NBadge.787d75d1.js";import{_ as C}from"./DurationDisplay.vue.ce619fea.js";import{d as v,ab as B,a as x,be as V,o as n,m,k as t,t as P,i as l,f,h as u,p as d,ap as F,aa as N,a6 as H,q as I,j as g,v as y,bg as E,au as W,F as k,n as j,G as L}from"./entry.52bc93cd.js";import{_ as M}from"./NSectionBlock.f3242abf.js";import{_ as q}from"./HelpFab.vue.452fd066.js";import"./NIconTitle.vue.8e6741d5.js";const z={flex:"~ gap2","items-center":""},A={w8:"","text-right":"","text-sm":"",op25:""},G={key:0,"flex-auto":"","text-right":""},R=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(p){const e=p,a=B(),r=x(()=>V(e.plugin.src,a.value?.rootDir||"").path);return(i,c)=>{const _=S,o=D,s=C;return n(),m("div",z,[t("div",A,P(i.index),1),l(_,{filepath:e.plugin.src,subpath:!0},null,8,["filepath"]),t("div",null,[f(r).startsWith("#")?(n(),u(o,{key:0,n:"rose",textContent:"virtual"})):f(r).startsWith(".")?d("",!0):(n(),u(o,{key:1,n:"gray",textContent:"module"})),i.plugin.mode==="server"?(n(),u(o,{key:2,n:"teal",textContent:"server"})):d("",!0),i.plugin.mode==="client"?(n(),u(o,{key:3,n:"orange",textContent:"client"})):d("",!0)]),i.plugin.metric?.duration!=null?(n(),m("div",G,[l(s,{duration:i.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),Y={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},J={flex:"~ items-center gap-1","font-bold":""},K=v({__name:"HelpTip",props:{title:{},icon:{}},setup(p){return(e,a)=>{const r=H,i=F("ContentSlot");return n(),m("div",Y,[t("div",J,[e.icon?(n(),u(r,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),t("div",null,P(e.title),1)]),t("div",null,[N(e.$slots,"default",{},()=>[l(i,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),O={};function Q(p,e){const a=K;return n(),u(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:g(()=>[N(p.$slots,"default")]),_:3})}const U=I(O,[["render",Q]]),X={class:"markdown-body"},Z=t("h1",null,"Plugins",-1),tt=t("p",null,[y("Nuxt plugins allow you to extend the functionality of the Nuxt runtime and the Vue instance. You can add plugins to the "),t("code",null,"plugins/"),y(" directory and they will be automatically imported and registered.")],-1),et=t("p",null,[t("a",{href:"https://nuxt.com/docs/guide/directory-structure/plugins",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),nt={__name:"plugins",setup(p,{expose:e}){return e({frontmatter:{}}),(r,i)=>{const c=U;return n(),m("div",X,[Z,tt,l(c,null,{default:g(()=>[y(" Plugins always run before your application's runtime. The loading time of each plugin will directly impact your application's initial loading time. ")]),_:1}),et])}}},ot={pt4:""},st={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},it=t("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1),at=t("span",{op50:""},"Total execution time:",-1),dt=v({__name:"plugins",setup(p){const e=E(),a=W(),r=x(()=>{const c=e.value?.plugins||[],_=a.value?.metrics.clientPlugins()||[];return c.map(o=>{const s=typeof o=="string"?{src:o}:o;return{...s,metric:_.find(h=>h.src===s.src||h.src.startsWith(s.src))}})}),i=x(()=>{const c=a.value?.metrics.clientPlugins()||[],_=Math.min(...c.map(s=>s.start));return Math.max(...c.map(s=>s.end))-_});return(c,_)=>{const o=R,s=C,h=M,T=nt,w=q;return n(),m(k,null,[l(h,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${f(r).length}`},{default:g(()=>[t("div",ot,[(n(!0),m(k,null,j(f(r),($,b)=>(n(),u(o,{key:$.src,plugin:$,index:b+1,"ml--4":"","border-base":"",py2:"",class:L(b?"border-t":"")},null,8,["plugin","index","class"]))),128)),t("div",st,[it,at,l(s,{duration:f(i),factor:10},null,8,["duration"])])])]),_:1},8,["description"]),l(w,null,{default:g(()=>[l(T)]),_:1})],64)}}});export{dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as v}from"./StateEditor.vue.
|
|
1
|
+
import{_ as v}from"./StateEditor.vue.2b7dac11.js";import{_ as x}from"./NSectionBlock.f3242abf.js";import{o as r,m as u,k as e,v as m,d as y,au as b,bj as C,a as d,f as i,i as t,j as a,p as k,F as w}from"./entry.52bc93cd.js";import{_ as N}from"./HelpFab.vue.452fd066.js";import"./DataSchemaButton.vue.e78a09d4.js";import"./json-editor-vue.d503734c.js";import"./NIconTitle.vue.8e6741d5.js";const R={class:"markdown-body"},T=e("h1",null,"Runtime Configs",-1),B=e("p",null,"Nuxt provides a runtime config API to expose configuration within your application and server routes, with the ability to update it at runtime by setting environment variables.",-1),V=e("p",null,[m("In Nuxt DevTools, the editor allows you to edit the runtime config temporarily to see how the changes affect your application. To update them, you might want to update your "),e("code",null,"nuxt.config.js"),m(" file, or check more details in the documentation.")],-1),$=e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/going-further/runtime-config",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),j=[T,B,V,$],D={__name:"runtime-configs",setup(f,{expose:o}){return o({frontmatter:{}}),(p,_)=>(r(),u("div",R,j))}},F={key:0},z=y({__name:"runtime-configs",setup(f){const o=b(),l=C(),p=d(()=>o.value?.nuxt.payload),_=d(()=>{const n={...l.value};return delete n.public,delete n.app,n});return(n,P)=>{const s=v,c=x,g=D,h=N;return r(),u(w,null,[i(o)?(r(),u("div",F,[t(c,{icon:"carbon-settings-services",text:"App Config",padding:!1},{default:a(()=>[t(s,{state:i(o).app.appConfig},null,8,["state"])]),_:1}),t(c,{icon:"carbon-settings",text:"Public Runtime Config",padding:!1},{default:a(()=>[t(s,{state:i(p).config?.public},null,8,["state"])]),_:1}),t(c,{icon:"i-carbon-code-signing-service",text:"Private Runtime Config",open:!1,padding:!1,description:"These values are not exposed to the client. Readonly in the DevTools."},{default:a(()=>[t(s,{state:i(_),readonly:""},null,8,["state"])]),_:1})])):k("",!0),t(h,null,{default:a(()=>[t(g)]),_:1})],64)}}});export{z as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{d as ae,r as B,bm as $e,o as t,m as y,k as i,G as q,h as C,f as e,bn as se,t as L,p as N,v as W,a9 as We,aa as Z,F as I,n as M,a6 as fe,a0 as Je,a as T,w as Se,i as h,j as $,X as Te,_ as me,bo as Ve,bp as Re,ay as Ke,bq as Qe,br as Xe,bs as Ye,ab as Ze,au as et,aw as pe,ac as tt,az as ot,e as nt,a2 as Ue,l as Y,I as le,at as st,V as lt,A as De,bt as at,bu as rt,ah as it,U as ut,bv as dt,ao as ct}from"./entry.52bc93cd.js";import{_ as pt}from"./NNavbar.vue.9cb56412.js";import{_ as Ne}from"./NBadge.787d75d1.js";import{_ as Ie}from"./NSelect.vue.cdaf42b9.js";import{_ as ft}from"./NCheckbox.vue.7e495ed2.js";import{u as Ee,_ as mt}from"./storage-options.e85e583e.js";import{_ as vt}from"./DataSchemaButton.vue.e78a09d4.js";import{_ as ht}from"./NCodeBlock.vue.7e25538f.js";import{C as xe,S as je}from"./constants.2cc6e981.js";import{q as yt}from"./json-editor-vue.d503734c.js";import{_ as gt}from"./NSectionBlock.f3242abf.js";import{_ as _t}from"./NDrawer.vue.fa4b06a6.js";import"./client.7628b7e9.js";import"./NIconTitle.vue.8e6741d5.js";const ne=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function bt(l,g){if(typeof l!="string")throw new TypeError("argument str must be a string");const u={},k=(g||{}).decode||Ct;let x=0;for(;x<l.length;){const p=l.indexOf("=",x);if(p===-1)break;let f=l.indexOf(";",x);if(f===-1)f=l.length;else if(f<p){x=l.lastIndexOf(";",p-1)+1;continue}const s=l.slice(x,p).trim();if(u[s]===void 0){let d=l.slice(p+1,f).trim();d.codePointAt(0)===34&&(d=d.slice(1,-1)),u[s]=xt(d,k)}x=f+1}return u}function Ce(l,g,u){const o=u||{},k=o.encode||wt;if(typeof k!="function")throw new TypeError("option encode is invalid");if(!ne.test(l))throw new TypeError("argument name is invalid");const x=k(g);if(x&&!ne.test(x))throw new TypeError("argument val is invalid");let p=l+"="+x;if(o.maxAge!==void 0&&o.maxAge!==null){const f=o.maxAge-0;if(Number.isNaN(f)||!Number.isFinite(f))throw new TypeError("option maxAge is invalid");p+="; Max-Age="+Math.floor(f)}if(o.domain){if(!ne.test(o.domain))throw new TypeError("option domain is invalid");p+="; Domain="+o.domain}if(o.path){if(!ne.test(o.path))throw new TypeError("option path is invalid");p+="; Path="+o.path}if(o.expires){if(!kt(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");p+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(p+="; HttpOnly"),o.secure&&(p+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":p+="; Priority=Low";break;case"medium":p+="; Priority=Medium";break;case"high":p+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:p+="; SameSite=Strict";break;case"lax":p+="; SameSite=Lax";break;case"strict":p+="; SameSite=Strict";break;case"none":p+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return p}function kt(l){return Object.prototype.toString.call(l)==="[object Date]"||l instanceof Date}function xt(l,g){try{return g(l)}catch{return l}}function Ct(l){return l.includes("%")?decodeURIComponent(l):l}function wt(l){return encodeURIComponent(l)}const $t=i("div",{"x-divider":""},null,-1),Oe=ae({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(l){const g=B(!0),u=$e();return(o,k)=>{const x=fe,p=Ne,f=Oe;return t(),y("div",null,[i("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:q([{"bg-active":e(u)===o.item.filepath}]),style:We({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:k[0]||(k[0]=s=>{g.value=!e(g),u.value=o.item.filepath})},[i("div",{class:q({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(t(),C(x,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":e(g)?90:0,transition:""},null,8,["transform-rotate"])):(t(),C(p,{key:1,class:q(("getRequestMethodClass"in o?o.getRequestMethodClass:e(se))(o.item.method||"*")),textContent:L((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),i("span",{class:q({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(t(),C(x,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):N("",!0),W(" "+L(o.item.route),1)],2)],6),$t,e(g)?Z(o.$slots,"default",{key:0},()=>[(t(!0),y(I,null,M(o.item.routes,s=>(t(),C(f,{key:s.filepath,item:s,index:o.index+1},null,8,["item","index"]))),128))]):N("",!0)])}}}),St={p4:"",flex:"~ col gap-4"},Tt={key:1,ml2:"",flex:""},Vt=["value"],Rt={key:0,flex:"","gap-4":""},Ut=i("div",{"flex-auto":""},null,-1),Le=ae({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(l,{emit:g}){const u=l,k=Je(u,"modelValue",g,{passive:!0}),x=T(()=>[...u.keys,"active","key","value","type"]),p=T(()=>{const d={};for(const a of x.value)d[a]=u.default[a]||"";return d}),f=["string","number","boolean","file","date","time","datetime-local"];function s(d,a){const E=a.target;if(E.files&&E.files[0]){const F=E.files[0],H=new FileReader;H.readAsDataURL(F),H.onload=()=>{k.value[d].value=H.result}}}return Se(()=>k,d=>{d.value.forEach(a=>{if(a.type==="number"&&typeof a.value!="number"){const E=Number.parseFloat(a.value);a.value=Number.isNaN(E)?0:E}else a.type==="boolean"&&typeof a.value!="boolean"?a.value=!0:a.type==="file"&&typeof a.value!="object"?a.value="":a.type==="date"&&typeof a.value=="string"&&!a.value.match(/^\d{4}-\d{2}-\d{2}$/)?a.value=new Date().toISOString().slice(0,10):a.type==="time"&&typeof a.value=="string"&&!a.value.match(/^\d{2}:\d{2}$/)?a.value=new Date().toISOString().slice(11,16):a.type==="datetime-local"&&typeof a.value=="string"&&!a.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)?a.value=new Date().toISOString().slice(0,16):a.type==="string"&&(a.value=a.value.toString())})},{deep:!0,immediate:!0,flush:"sync"}),(d,a)=>{const E=ft,F=Te,H=Ie,V=fe,w=me;return t(),y("div",St,[(t(!0),y(I,null,M(e(k),(m,S)=>(t(),y("div",{key:S,flex:"~ gap-2","justify-around":""},[Z(d.$slots,"input",{item:m}),(t(!0),y(I,null,M(e(x),_=>(t(),y(I,{key:_},[m.type!==null&&_==="active"?(t(),C(E,{key:0,modelValue:m[_],"onUpdate:modelValue":b=>m[_]=b,n:"sm primary",disabled:d.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):N("",!0),m.type!==null&&_==="key"?(t(),C(F,{key:1,modelValue:m[_],"onUpdate:modelValue":b=>m[_]=b,placeholder:_,"flex-1":"","font-mono":"",n:"sm primary",disabled:d.disabled,class:q(d.disabled?"op50":"")},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])):_==="value"?(t(),y(I,{key:2},[m.type==="file"?(t(),C(F,{key:0,type:"file",disabled:d.disabled,class:q(d.disabled?"op75":""),onChange:b=>s(S,b)},null,8,["disabled","class","onChange"])):m.type==="boolean"?(t(),y("div",Tt,[h(E,{modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,placeholder:"Value",n:"green lg",disabled:d.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(t(),C(F,{key:2,modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,type:m.type,placeholder:"Value","flex-1":"","font-mono":"",n:"sm primary",disabled:d.disabled,class:q(d.disabled?"op75":"")},null,8,["modelValue","onUpdate:modelValue","type","disabled","class"]))],64)):_==="type"?(t(),C(H,{key:3,modelValue:m.type,"onUpdate:modelValue":b=>m.type=b,n:"sm green",class:q(d.disabled?"op75":""),disabled:d.disabled},{default:$(()=>[(t(),y(I,null,M(f,b=>i("option",{key:b,value:b},L(b),9,Vt)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):N("",!0)],64))),128)),Z(d.$slots,"input-actions",{},()=>[h(w,{n:"red",disabled:d.disabled,class:q(d.disabled?"op0!":""),onClick:_=>e(k).splice(S,1)},{default:$(()=>[h(V,{icon:"carbon:trash-can"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),d.disabled?N("",!0):(t(),y("div",Rt,[Z(d.$slots,"actions",{params:e(k)},()=>[h(w,{icon:"carbon-add",n:"sm primary",my1:"","px-3":"",onClick:a[0]||(a[0]=m=>e(k).push({...e(p)}))},{default:$(()=>[W(" Add ")]),_:1}),Ut,e(k).length?(t(),C(w,{key:0,icon:"carbon-trash-can",n:"sm red",my1:"","px-3":"",onClick:a[1]||(a[1]=m=>k.value=[])},{default:$(()=>[W(" Remove All ")]),_:1})):N("",!0)])])),Z(d.$slots,"default")])}}}),Dt={path:"/",watch:!0,decode:l=>Xe(decodeURIComponent(l)),encode:l=>encodeURIComponent(typeof l=="string"?l:JSON.stringify(l))};function Nt(l,g){const u={...Dt,...g},o=It(u)||{};let k;u.maxAge!==void 0?k=u.maxAge*1e3:u.expires&&(k=u.expires.getTime()-Date.now());const x=k!==void 0&&k<=0,p=x?void 0:o[l]??u.default?.(),f=k&&!x?Ot(p,k):B(p);{const s=typeof BroadcastChannel>"u"?null:new BroadcastChannel(`nuxt:cookies:${l}`),d=()=>{jt(l,f.value,u),s?.postMessage(u.encode(f.value))};let a=!1;Ve()&&Re(()=>{a=!0,d(),s?.close()}),s&&(s.onmessage=E=>{a=!0,f.value=u.decode(E.data),Ke(()=>{a=!1})}),u.watch?Se(f,()=>{a||d()},{deep:u.watch!=="shallow"}):d()}return f}function It(l={}){return bt(document.cookie,l)}function Et(l,g,u={}){return g==null?Ce(l,g,{...u,maxAge:-1}):Ce(l,g,u)}function jt(l,g,u={}){document.cookie=Et(l,g,u)}const we=2147483647;function Ot(l,g){let u,o=0;return Ve()&&Re(()=>{clearTimeout(u)}),Qe((k,x)=>{function p(){clearTimeout(u);const f=g-o,s=f<we?f:we;u=setTimeout(()=>{if(o+=s,o<g)return p();l=void 0,x()},s)}return{get(){return k(),l},set(f){p(),l=f,x()}}})}const Lt={"h-full":"","w-full":"",flex:"~ col"},qt={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},At={flex:"~ gap2 items-center"},Pt={relative:"","w-full":""},Bt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},Mt={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Ft=i("div",{"flex-auto":""},null,-1),zt=i("div",{"text-xs":"",op50:""}," Send from ",-1),Ht=i("option",{value:"app"}," App ",-1),Gt=i("option",{value:"devtools"}," DevTools ",-1),Wt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Jt={"text-right":"","font-mono":""},Kt={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Qt={flex:"~ gap-4"},Xt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Yt=i("div",{"w-5":"","x-divider":""},null,-1),Zt=i("div",{"flex-none":""}," Default Inputs ",-1),eo=i("div",{"x-divider":""},null,-1),to={key:2},oo={key:3,border:"b base",relative:"","n-code-block":""},no={flex:"~ wrap","w-full":""},so=["onClick"],lo=i("div",{border:"b base","flex-auto":""},null,-1),ao={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},ro=i("div",null,"Response",-1),io={key:1,"text-xs":"",op50:""},uo=i("div",{"flex-auto":""},null,-1),co=i("div",{op50:""}," Request finished in ",-1),po={key:0,"flex-auto":"","overflow-auto":""},fo={border:"~ base","h-full":"","w-full":"",rounded:""},mo=["data"],vo={key:2,"flex-auto":"","overflow-auto":"",p4:""},ho={border:"~ base",rounded:""},yo=["src"],go={key:1,controls:"",rounded:""},_o=["src"],bo=ae({__name:"ServerRouteDetails",props:{route:{}},emits:["open-default-input"],setup(l,{emit:g}){const u=l,o=g,[k,x]=Ye(),p=Ze(),f=et(),s=pe({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),d=T(()=>s.contentType.includes("application/json")?"json":s.contentType.includes("text/html")?"html":s.contentType.includes("text/css")?"css":s.contentType.includes("text/javascript")?"javascript":s.contentType.includes("image")||s.contentType.includes("video")?"media":s.contentType.includes("text/xml")||s.contentType.includes("application/xml")?"xml":s.contentType.includes("application/pdf")?"pdf":"text"),a=T(()=>{if(d.value==="json")return JSON.stringify(s.data,null,2);if(d.value==="media"||d.value==="pdf"){const n=new Blob([s.data],{type:s.contentType});return URL.createObjectURL(n)}return s.data}),E=B(!1),F=B(!1),H=tt(),V=T(()=>u.route.route?.split(/((?:\*\*)?:[\w_]+)/g)),w=T(()=>V.value?.filter(n=>n.startsWith(":")||n.startsWith("**:"))||[]),m=B(u.route.method||"GET"),S=B({}),_=pe({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[{active:!0,key:"Content-Type",value:"application/json",type:"string"}]}),b=B({}),{inputDefaults:R,sendFrom:O}=Ee("serverRoutes"),P=T(()=>f?.value?.app?.$fetch?O.value:"devtools"),re=["GET","POST","PUT","PATCH","DELETE","HEAD"],ie=["PATCH","POST","PUT","DELETE"],ee=T(()=>ie.includes(m.value.toUpperCase())),A=B(w.value.length?"params":"query"),U=["input","json"],G=B(U[0]),te=T({get:()=>_[A.value],set:n=>{_[A.value]=n}}),ve=T(()=>({...K(R.value.query),...K(_.query)})),he=T(()=>({...K(R.value.headers),...K(_.headers)})),ue=T(()=>ee.value?G.value==="json"?{...K(R.value.body),...b.value}:{...K(R.value.body),...K(_.body)}:void 0),qe=T(()=>{let n=window?.location.origin;return n.charAt(n.length-1)==="/"&&(n=n.slice(0,-1)),n}),oe=T(()=>{let n=new URLSearchParams(ve.value).toString();n&&(n=`?${n}`);const c=(V.value?.map(j=>(j.startsWith(":")||j.startsWith("**:"))&&S.value[j]||j).join("")||"")+n;let v=p.value?.app.baseURL||"";return(v==="./"||v===".")&&(v=""),v.endsWith("/")&&(v=v.slice(0,-1)),v+c}),ye=T(()=>qe.value+oe.value);function K(n){const c=Object.fromEntries(n.filter(({active:v,key:j,value:D})=>v&&j&&D!==void 0).map(({key:v,value:j})=>[v,j]));return Object.entries(c).length?c:void 0}async function ge(){F.value=!0,E.value=!0;const n=Date.now(),c=P.value==="app"?f.value.app.$fetch:$fetch;lt("server-routes:fetch",{method:m.value,sendFrom:P.value});try{s.data=await c(ye.value,{method:m.value.toUpperCase(),headers:he.value,query:ve.value,body:ue.value,onResponse({response:v}){s.contentType=(v.headers.get("content-type")||"").toString().toLowerCase().trim(),s.statusCode=v.status,s.error=void 0},onResponseError(v){s.error=v.response._data,s.data=v.response._data}})}catch{}E.value=!1,s.fetchTime=Date.now()-n}const _e=T(()=>{const n=[],c=[],v=Object.entries(he.value).filter(([D,z])=>D&&z&&!(D==="Content-Type"&&z==="application/json")).map(([D,z])=>` '${D}': '${z}'`).join(`,
|
|
2
|
+
`);m.value.toUpperCase()!=="GET"&&c.push(`method: '${m.value.toUpperCase()}'`),v&&c.push(`headers: {
|
|
3
|
+
${v}
|
|
4
|
+
}`),ue.value&&c.push(`body: ${JSON.stringify(ue.value,null,2)}`);const j=c.length?`, {
|
|
5
|
+
${c.join(`,
|
|
6
|
+
`).split(`
|
|
7
|
+
`).map(D=>` ${D}`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
}`:"";return n.push({name:"useFetch",lang:"javascript",docs:xe.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${j})`}),n.push({name:"$fetch",lang:"javascript",docs:xe.nuxt.$fetch,code:`await $fetch('${oe.value}'${j})`}),n}),Q=B(Pe()),J=pe({key:"",value:""}),Ae=T(()=>{const n=[];return w.value.length&&n.push({name:"Params",slug:"params",length:w.value.length}),n.push({name:"Query",slug:"query",length:_.query.length}),ee.value&&n.push({name:"Body",slug:"body",length:_.body.length}),n.push({name:"Headers",slug:"headers",length:_.headers.length}),n.push({name:"Cookies",slug:"cookies",length:Q.value.length}),n.push({name:"Snippets",slug:"snippet"}),n});function Pe(){return document.cookie.split("; ").map(n=>{const[c,v]=n.split("=");return{key:c,value:v}}).filter(n=>n.key)}function de(n,c){if(!n)return;const v=Q.value.find(D=>D.key===n),j=Nt(n);v!==void 0?c===void 0&&(Q.value=Q.value.filter(D=>D.key!==n)):(Q.value.push({key:n,value:c}),J.key="",J.value=""),j.value=c}ot(()=>{G.value==="json"&&typeof b.value=="string"&&(b.value=JSON.parse(b.value))});const Be=nt();return(n,c)=>{const v=me,j=Ie,D=Te,z=fe,be=Le,Me=mt,Fe=De,ze=at,ce=Ne,He=vt,Ge=ht,ke=Ue("tooltip");return t(),y("div",Lt,[i("div",qt,[i("div",At,[n.route.method?(t(),C(v,{key:0,class:q(["n-badge-base n-sm",("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(e(m))]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:$(()=>[W(L(e(m).toUpperCase()),1)]),_:1},8,["class"])):(t(),C(j,{key:1,modelValue:e(m),"onUpdate:modelValue":c[0]||(c[0]=r=>Y(m)?m.value=r:null),class:q(["n-badge-base n-sm",("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(e(m))])},{default:$(()=>[(t(),y(I,null,M(re,r=>i("option",{key:r,class:q(("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(r))},L(r.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),i("div",Pt,[h(D,{"model-value":e(oe),readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),i("div",Bt,[le(h(v,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:c[1]||(c[1]=r=>e(Be)(e(ye),"server-route-url"))},null,512),[[ke,"Copy URL"]]),le(h(v,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:c[2]||(c[2]=r=>e(H)(n.route.filepath))},null,512),[[ke,"Open in Editor"]])])]),h(v,{"h-full":"",n:"primary solid",onClick:ge},{default:$(()=>[h(z,{icon:"carbon:send"})]),_:1})])]),i("div",Mt,[(t(!0),y(I,null,M(e(Ae),r=>(t(),C(v,{key:r.slug,class:q(e(A)===r.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:X=>A.value=r.slug},{default:$(()=>[h(z,{icon:("ServerRouteTabIcons"in n?n.ServerRouteTabIcons:e(je))[r.slug]},null,8,["icon"]),W(" "+L(r.name)+" "+L(r?.length?`(${r.length})`:"")+" ",1),i("span",null,L(e(R)[r.slug]?.length?`(${e(R)[r.slug].length})`:""),1)]),_:2},1032,["class","onClick"]))),128)),Ft,zt,h(j,{modelValue:e(P),"onUpdate:modelValue":c[3]||(c[3]=r=>Y(P)?P.value=r:null),class:"n-xs",disabled:!e(f)?.app?.$fetch},{default:$(()=>[Ht,Gt]),_:1},8,["modelValue","disabled"])]),e(A)==="params"?(t(),y("div",Wt,[(t(!0),y(I,null,M(e(w),r=>(t(),y(I,{key:r},[i("div",Jt,L(r),1),h(D,{modelValue:e(S)[r],"onUpdate:modelValue":X=>e(S)[r]=X,placeholder:r,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):N("",!0),e(A)==="cookies"?(t(),y("div",Kt,[(t(!0),y(I,null,M(e(Q),r=>(t(),y("div",{key:r.key,flex:"~ gap-4 items-center"},[h(D,{placeholder:"Key...","model-value":r.key,disabled:"","op-70":""},null,8,["model-value"]),h(D,{placeholder:"Value...","model-value":r.value,"flex-1":"",n:"primary",onInput:X=>de(r.key,X.target?.value)},null,8,["model-value","onInput"]),h(v,{title:"Delete",n:"red",onClick:X=>de(r.key,void 0)},{default:$(()=>[h(z,{icon:"i-carbon-trash-can"})]),_:2},1032,["onClick"])]))),128)),i("div",Qt,[h(D,{modelValue:e(J).key,"onUpdate:modelValue":c[4]||(c[4]=r=>e(J).key=r),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),h(D,{modelValue:e(J).value,"onUpdate:modelValue":c[5]||(c[5]=r=>e(J).value=r),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),h(v,{title:"Add",n:"primary",onClick:c[6]||(c[6]=r=>de(e(J).key,e(J).value))},{default:$(()=>[h(z,{icon:"i-carbon-save"})]),_:1})])])):N("",!0),h(e(k),null,{default:$(()=>[h(be,{modelValue:e(te),"onUpdate:modelValue":c[9]||(c[9]=r=>Y(te)?te.value=r:null),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:$(()=>[e(R)[e(A)]?.length?(t(),y(I,{key:0},[i("div",Xt,[Yt,Zt,h(v,{icon:"i-carbon-edit",border:!1,onClick:c[7]||(c[7]=r=>o("open-default-input"))}),eo]),h(be,{modelValue:e(R)[e(A)],"onUpdate:modelValue":c[8]||(c[8]=r=>e(R)[e(A)]=r),disabled:"",p0:""},null,8,["modelValue"])],64)):N("",!0)]),_:1},8,["modelValue"])]),_:1}),e(A)==="snippet"?(t(),y("div",to,[e(_e).length?(t(),C(Me,{key:0,"code-snippets":e(_e)},null,8,["code-snippets"])):N("",!0)])):e(te)?(t(),y("div",oo,[e(A)==="body"?(t(),y(I,{key:0},[i("div",no,[(t(),y(I,null,M(U,r=>i("button",{key:r,px4:"",py2:"",border:"r base",hover:"bg-active",class:q({"border-b":r!==e(G)}),onClick:X=>G.value=r},[i("div",{class:q({op30:r!==e(G)}),"font-mono":""},L(r),3)],10,so)),64)),lo]),e(G)==="input"?(t(),C(e(x),{key:0})):e(G)==="json"?(t(),C(e(yt),st({key:1,modelValue:e(b),"onUpdate:modelValue":c[10]||(c[10]=r=>Y(b)?b.value=r:null),class:[[n.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue of-auto text-sm outline-none"]},n.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):N("",!0)],64)):(t(),C(e(x),{key:1}))])):N("",!0),e(F)?e(E)?(t(),C(ze,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:$(()=>[W(" Fetching... ")]),_:1})):(t(),y(I,{key:6},[i("div",ao,[ro,e(s).error?(t(),C(ce,{key:0,n:"red"},{default:$(()=>[W(" Error ")]),_:1})):N("",!0),h(ce,{n:e(s).error?"orange":"green",textContent:L(e(s).statusCode)},null,8,["n","textContent"]),e(s).contentType?(t(),y("code",io,L(e(s).contentType),1)):N("",!0),e(s).contentType==="application/json"?(t(),C(He,{key:2,getter:()=>({input:e(a)})},null,8,["getter"])):N("",!0),uo,co,h(ce,{n:"green"},{default:$(()=>[W(L(e(s).fetchTime)+" ms ",1)]),_:1})]),e(d)==="pdf"?(t(),y("div",po,[i("div",fo,[i("object",{data:e(a),type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,mo)])])):e(d)!=="media"?(t(),C(Ge,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:e(a),lang:e(d)},null,8,["code","lang"])):(t(),y("div",vo,[i("div",ho,[e(s).contentType.includes("image")?(t(),y("img",{key:0,rounded:"",src:e(a)},null,8,yo)):(t(),y("video",go,[i("source",{src:e(a),type:"video/mp4"},null,8,_o)]))])]))],64)):(t(),C(Fe,{key:4},{default:$(()=>[h(v,{n:"primary",onClick:ge},{default:$(()=>[h(z,{icon:"carbon:send"}),W(" Send request ")]),_:1})]),_:1}))])}}}),ko={flex:"~ gap1","text-sm":""},xo={key:0,op50:""},Co={op50:""},wo=i("span",{op75:""},"Select a route to start",-1),$o=i("div",{p4:"",border:"b base"},[i("span",{"text-lg":""},"Default Inputs"),i("br"),i("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1),Po=ae({__name:"server-routes",setup(l){const g=B(!1),u=rt(),o=$e(),{selectedRoute:k,view:x,inputDefaults:p}=Ee("serverRoutes"),f=T(()=>{!o.value&&k.value&&(o.value=k.value.filepath);const V=u.value?.find(w=>w.filepath===o.value);return o.value!==k.value?.filepath&&V&&(k.value=V),V}),s=B(""),d=T(()=>new it(u.value||[],{keys:["method","route"],shouldSort:!0})),a=T(()=>u.value?s.value?d.value.search(s.value).map(w=>w.item):u.value:[]),E=T(()=>{const V=[],w=(S,_)=>{S.routes=S.routes||[],S.routes.push(_)},m=(S,_)=>{const b=_?_.routes?.find(O=>O.route===S):V.find(O=>O.route===S);if(b)return b;const R={route:S,filepath:S.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};return _?w(_,R):V.push(R),R};return a.value.forEach(S=>{let _,b;const R=S.filepath.split("/"),O=R.slice(R.indexOf("server")+1);if(S.type==="runtime"){O[0]="runtime";const P=R.indexOf("dist");P!==-1&&(_=R[P-1],_&&O.splice(1,0,_))}O.length>0&&O[O.length-1].includes(".")&&O.pop(),O.forEach(P=>{b=m(P,b)}),b?w(b,S):V.push(S)}),V});function F(){x.value=x.value==="tree"?"list":"tree"}function H(V){return V.charAt(0).toUpperCase()+V.slice(1)}return(V,w)=>{const m=me,S=pt,_=Oe,b=bo,R=ct,O=De,P=ut,re=Le,ie=gt,ee=_t,A=Ue("tooltip");return t(),y(I,null,[h(P,{"storage-key":"tab-server-routes"},{left:$(()=>[h(S,{search:e(s),"onUpdate:search":w[1]||(w[1]=U=>Y(s)?s.value=U:null),pb2:""},{actions:$(()=>[le(h(m,{"text-lg":"",icon:e(x)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:F},null,8,["icon"]),[[A,"Toggle View"]]),le(h(m,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:w[0]||(w[0]=U=>g.value=!e(g))},null,512),[[A,"Default Inputs"]])]),default:$(()=>[i("div",ko,[e(s)?(t(),y("span",xo,L(e(a).length)+" matched · ",1)):N("",!0),i("span",Co,L(e(u)?.length)+" routes in total",1)])]),_:1},8,["search"]),(t(!0),y(I,null,M(e(x)==="tree"?e(E):e(a),U=>(t(),C(_,{key:U.filepath,item:U},null,8,["item"]))),128))]),right:$(()=>[(t(),C(dt,{max:10},[e(f)?(t(),C(b,{key:e(f).filepath,route:e(f),onOpenDefaultInput:w[2]||(w[2]=U=>g.value=!0)},null,8,["route"])):N("",!0)],1024)),e(f)?N("",!0):(t(),C(O,{key:0},{default:$(()=>[h(R,{px6:"",py2:""},{default:$(()=>[wo]),_:1})]),_:1}))]),_:1}),h(ee,{modelValue:e(g),"onUpdate:modelValue":w[3]||(w[3]=U=>Y(g)?g.value=U:null),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:w[4]||(w[4]=U=>g.value=!1)},{default:$(()=>[i("div",null,[$o,(t(!0),y(I,null,M(Object.keys(e(p)),U=>(t(),C(ie,{key:U,text:`${H(U)} ${e(p)[U].length?`(${e(p)[U].length})`:""}`,padding:!1,icon:("ServerRouteTabIcons"in V?V.ServerRouteTabIcons:e(je))[U]},{default:$(()=>[h(re,{modelValue:e(p)[U],"onUpdate:modelValue":G=>e(p)[U]=G,py0:"",default:{active:!0,type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{Po as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as Q}from"./NIconTitle.vue.
|
|
1
|
+
import{_ as Q}from"./NIconTitle.vue.8e6741d5.js";import{_ as X}from"./NSwitch.vue.6e493b89.js";import{d as Y,au as Z,bO as ee,aD as le,az as E,m,i as n,k as e,F as v,n as N,f as t,j as a,L as oe,_ as ne,ao as te,o as r,h as P,t as y,G as j,p as A,v as O,l as c,C as z,B as ae,bG as se,bP as ie}from"./entry.52bc93cd.js";import{_ as ue}from"./NSelect.vue.cdaf42b9.js";import{_ as de}from"./NCheckbox.vue.7e495ed2.js";import{_ as re}from"./NLink.vue.0a35d66d.js";const ce={px8:"",py6:""},pe={grid:"~ md:cols-2 gap-x-10 gap-y-3","max-w-300":""},me={flex:"~ col gap-2"},_e=e("h3",{"text-lg":""}," Tabs ",-1),fe={flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":""},ve={capitalize:"",op75:""},ge=e("div",{"mx--1":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),he=e("div",{"flex-auto":""},null,-1),be={flex:"~ col gap-2"},xe=e("h3",{"text-lg":""}," Appearance ",-1),ye=e("div",{"i-carbon-sun":"","dark:i-carbon-moon":"","translate-y--1px":""},null,-1),ke=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),Ve=e("p",null,"UI Scale",-1),Ce=["value"],we=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),Te=e("span",null," Expand Sidebar ",-1),Se=e("span",null," Scrollable Sidebar ",-1),Ne=e("h3",{mt2:"","text-lg":""}," Features ",-1),Oe=e("span",null,"Close DevTools when clicking outside",-1),Ue=e("span",null,"Show help buttons",-1),$e=e("span",null,"Always show the floating panel",-1),Ie=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),De=e("p",null,"Minimize floating panel on inactive",-1),ze=["value"],Be=e("h3",{mt2:"","text-lg":""}," Feedback ",-1),Le=e("span",null,"Send anonymous statistics, help us improving DevTools",-1),Ee=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),Pe={flex:"~ gap-2"},je=e("div",{"i-carbon-data-enrichment":""},null,-1),Ae=e("div",{"i-carbon-debug":""},null,-1),Fe=e("h3",{mt2:"","text-lg":""}," Debug ",-1),Me={flex:"~ gap-2"},Re=e("div",{"i-carbon-breaking-change":""},null,-1),Xe=Y({__name:"settings",setup(Ge){const{interactionCloseOnOutsideClick:k,showPanel:U,showHelpButtons:$,scale:I,hiddenTabs:g,pinnedTabs:u,hiddenTabCategories:h,minimizePanelInactive:V,sidebarExpanded:C,sidebarScrollable:D}=ae(),b=Z(),F=[["Tiny",12/15],["Small",14/15],["Normal",1],["Large",16/15],["Huge",18/15]],M=[["Always",0],["1s",1e3],["2s",2e3],["5s",5e3],["10s",1e4],["Never",-1]],R=ee(le());function G(s,o){o?g.value=g.value.filter(d=>d!==s):g.value.push(s)}function H(s,o){o?h.value=h.value.filter(d=>d!==s):h.value.push(s)}function W(s){u.value.includes(s)?u.value=u.value.filter(o=>o!==s):u.value.push(s)}function B(s,o){const d=u.value.indexOf(s);if(d===-1)return;const _=d+o;if(_<0||_>=u.value.length)return;const x=[...u.value];x.splice(d,1),x.splice(_,0,s),u.value=x}async function q(){confirm("Are you sure you to reset all local settings & state? The app will reload.")&&(Object.keys(localStorage).forEach(s=>{s.startsWith("nuxt-devtools-")&&localStorage.removeItem(s)}),await oe.clearOptions(),b.value?.app?.reload?.(),window.location.reload())}return E(()=>{b.value&&(b.value.app.frameState.value.closeOnOutsideClick=k.value)}),E(()=>{b.value&&(b.value.app.frameState.value.minimizePanelInactive=V.value)}),(s,o)=>{const d=Q,_=X,x=se,p=ne,w=te,J=ie,L=ue,f=de,K=re;return r(),m("div",ce,[n(d,{class:"mb-5 text-xl op75",icon:"i-carbon-settings-adjust",text:"DevTools Settings"}),e("div",pe,[e("div",me,[_e,(r(!0),m(v,null,N(t(R),([l,T])=>(r(),m(v,{key:l},[T.length?(r(),P(w,{key:0,p3:"",flex:"~ col gap-1",class:j(t(h).includes(l)?"op50 grayscale":"")},{default:a(()=>[n(_,{flex:"~ row-reverse",py1:"",pl2:"",pr1:"","n-lime":"","model-value":!t(h).includes(l),"onUpdate:modelValue":i=>H(l,i)},{default:a(()=>[e("div",fe,[e("span",ve,y(l),1)])]),_:2},1032,["model-value","onUpdate:modelValue"]),ge,(r(!0),m(v,null,N(T,i=>(r(),P(_,{key:i.name,flex:"~ row-reverse",py1:"",pl2:"",pr1:"","n-primary":"","model-value":!t(g).includes(i.name),"onUpdate:modelValue":S=>G(i.name,S)},{default:a(()=>[e("div",{flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":"","pr-4":"",class:j(t(g).includes(i.name)?"op25":"")},[n(x,{"text-xl":"",icon:i.icon,title:i.title},null,8,["icon","title"]),e("span",null,y(i.title),1),he,t(u).includes(i.name)?(r(),m(v,{key:0},[n(p,{icon:"i-carbon-caret-up",disabled:t(u).indexOf(i.name)===0,border:!1,onClick:S=>B(i.name,-1)},null,8,["disabled","onClick"]),n(p,{icon:"i-carbon-caret-down",disabled:t(u).indexOf(i.name)===t(u).length-1,border:!1,onClick:S=>B(i.name,1)},null,8,["disabled","onClick"])],64)):A("",!0),n(p,{icon:t(u).includes(i.name)?" i-carbon-pin-filled rotate--45":" i-carbon-pin op50",border:!1,onClick:S=>W(i.name)},null,8,["icon","onClick"])],2)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))]),_:2},1032,["class"])):A("",!0)],64))),128))]),e("div",be,[xe,n(w,{p4:"",flex:"~ col gap-2"},{default:a(()=>[e("div",null,[n(J,null,{default:a(({toggle:l,isDark:T})=>[n(p,{n:"primary",onClick:l},{default:a(()=>[ye,O(" "+y(T.value?"Dark":"Light"),1)]),_:2},1032,["onClick"])]),_:1})]),ke,Ve,n(L,{modelValue:t(I),"onUpdate:modelValue":o[0]||(o[0]=l=>c(I)?I.value=l:null),n:"primary"},{default:a(()=>[(r(),m(v,null,N(F,l=>e("option",{key:l[0],value:l[1]},y(l[0]),9,Ce)),64))]),_:1},8,["modelValue"]),we,n(f,{modelValue:t(C),"onUpdate:modelValue":o[1]||(o[1]=l=>c(C)?C.value=l:null),"n-primary":""},{default:a(()=>[Te]),_:1},8,["modelValue"]),n(f,{modelValue:t(D),"onUpdate:modelValue":o[2]||(o[2]=l=>c(D)?D.value=l:null),disabled:t(C),"n-primary":""},{default:a(()=>[Se]),_:1},8,["modelValue","disabled"])]),_:1}),Ne,n(w,{p4:"",flex:"~ col gap-2"},{default:a(()=>[n(f,{modelValue:t(k),"onUpdate:modelValue":o[3]||(o[3]=l=>c(k)?k.value=l:null),"n-primary":""},{default:a(()=>[Oe]),_:1},8,["modelValue"]),n(f,{modelValue:t($),"onUpdate:modelValue":o[4]||(o[4]=l=>c($)?$.value=l:null),"n-primary":""},{default:a(()=>[Ue]),_:1},8,["modelValue"]),n(f,{modelValue:t(U),"onUpdate:modelValue":o[5]||(o[5]=l=>c(U)?U.value=l:null),"n-primary":""},{default:a(()=>[$e]),_:1},8,["modelValue"]),Ie,De,n(L,{modelValue:t(V),"onUpdate:modelValue":o[6]||(o[6]=l=>c(V)?V.value=l:null),modelModifiers:{number:!0},"n-primary":""},{default:a(()=>[(r(),m(v,null,N(M,l=>e("option",{key:l[0],value:l[1]},y(l[0]),9,ze)),64))]),_:1},8,["modelValue"])]),_:1}),Be,n(w,{p4:"",flex:"~ col gap-2"},{default:a(()=>[n(f,{modelValue:t(z),"onUpdate:modelValue":o[7]||(o[7]=l=>c(z)?z.value=l:null),"n-primary":""},{default:a(()=>[Le,n(K,{href:"https://github.com/nuxt/devtools#anonymous-usage-analytics",target:"_blank",ml1:"",op50:"",textContent:"Learn more"})]),_:1},8,["modelValue"]),Ee,e("div",Pe,[n(p,{n:"blue",to:"https://github.com/nuxt/devtools/discussions/29",target:"_blank"},{default:a(()=>[je,O(" Ideas & Suggestions ")]),_:1}),n(p,{n:"orange",to:"https://github.com/nuxt/devtools/issues",target:"_blank"},{default:a(()=>[Ae,O(" Bug Reports ")]),_:1})])]),_:1}),Fe,e("div",Me,[n(p,{n:"orange",onClick:q},{default:a(()=>[Re,O(" Reset Local Settings & State ")]),_:1})])])])])}}});export{Xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{au as m,ba as n,a as s,L as o}from"./entry.
|
|
1
|
+
import{au as m,ba as n,a as s,L as o}from"./entry.52bc93cd.js";function u(){const p=m(),t=n("getComponents",()=>o.getComponents()),l=s(()=>Object.entries(p.value?.nuxt?.vueApp._context.components||{}).map(([e])=>({pascalName:e,global:!0})).filter(e=>!/^Lazy[A-Z]/.test(e.pascalName)).filter(e=>!(t.value||[]).find(a=>a.pascalName===e.pascalName)));return s(()=>[...l.value,...t.value||[]].sort((e,a)=>e.pascalName.localeCompare(a.pascalName)))}function r(){return n("getComponentsRelationships",()=>o.getComponentsRelationships())}export{r as a,u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as F}from"./NBadge.
|
|
1
|
+
import{_ as F}from"./NBadge.787d75d1.js";import{_ as L}from"./NCodeBlock.vue.7e25538f.js";import{_ as A}from"./NCheckbox.vue.7e495ed2.js";import{d as E,P as G,bb as W,r as V,bc as Y,N as Z,R as q,o as m,m as g,aa as z,f as a,t as $,p as w,F as B,i as n,h as H,j as u,k as h,l as M,v as p,V as J,Y as K,_ as O,Z as Q,bd as X,ab as ee,a as te,ar as ae,as as se,be as ne,ba as oe}from"./entry.52bc93cd.js";const le={key:0},re={p4:"",flex:"~ col gap-1"},ue={class:"text-lg font-medium leading-6"},ie=h("p",{op50:""}," The following command will be executed in your terminal: ",-1),ce={flex:"~ gap-3",mt2:"","justify-end":""},ve=E({__name:"NpmVersionCheck",props:{packageName:{},options:{},showVersion:{type:Boolean,default:!0}},setup(l){const t=l,e=G(),{info:s,update:i,state:y,processId:k,restart:d}=W(t.packageName,t.options),f=V(!0),_=V(!0),R=Y(),b=Z(),U=q();async function N(){const r=await i(async o=>b.start(o));J("npm:update",{packageName:t.packageName,oldVersion:s.value?.current}),r&&_.value&&R.value.push({id:r,message:`${t.packageName} has been updated. Do you want to restart the Nuxt server now?`}),r&&f.value&&(U.value=r,e.push("/modules/terminals"))}return(r,o)=>{const C=F,S=L,x=A,T=K,P=O,I=Q;return m(),g(B,null,[z(r.$slots,"default",{id:a(k),info:a(s),update:N,state:a(y),restart:a(d)},()=>[a(s)&&r.showVersion?(m(),g("code",le,$(`v${a(s).current}`),1)):w("",!0),a(s)?.latest?(m(),g(B,{key:1},[a(s).needsUpdate?(m(),g("button",{key:0,onClick:o[0]||(o[0]=v=>N())},[n(C,{n:"green",title:"updates available",textContent:"updates available"})])):(m(),H(C,{key:1,n:"gray",title:"latest",textContent:"latest"}))],64)):w("",!0)]),n(a(b),null,{default:u(({resolve:v,args:j})=>[n(I,{"model-value":!0,onClose:c=>v(!1)},{default:u(()=>[h("div",re,[h("h3",ue," Update "+$(t.packageName)+"? ",1),ie,n(S,{code:j[0],lang:"bash",my3:"",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),n(x,{modelValue:a(f),"onUpdate:modelValue":o[1]||(o[1]=c=>M(f)?f.value=c:null),n:"primary"},{default:u(()=>[p(" Navigate to terminal ")]),_:1},8,["modelValue"]),n(x,{modelValue:a(_),"onUpdate:modelValue":o[2]||(o[2]=c=>M(_)?_.value=c:null),n:"primary"},{default:u(()=>[p(" Restart Nuxt server after update ")]),_:1},8,["modelValue"]),h("div",ce,[n(T,{n:"sm amber","flex-auto":"",icon:"i-carbon-data-backup"},{default:u(()=>[p(" Please make sure to backup your project first. ")]),_:1}),n(P,{onClick:c=>v(!1)},{default:u(()=>[p(" Cancel ")]),_:2},1032,["onClick"]),n(P,{n:"solid primary",onClick:c=>v(!0)},{default:u(()=>[p(" Update ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1})],64)}}}),D=["pages","meta","components","imports","nuxt-config-schema","@nuxt/devtools","@nuxt/telemetry"];function de(){return oe("getModulesList",async()=>(await $fetch("https://api.nuxt.com/modules?version=3")).modules.filter(t=>!D.includes(t.npm)&&t.compatibility.nuxt.includes("^3")))}function ge(){return X("installed-modules",()=>{const l=ee(),t=de();return te(()=>(l.value?._installedModules||[]).map(e=>{if(!e.entryPath)return;const s=e.entryPath&&ae(e.entryPath),i=e.meta?.name?e.meta?.name:e.entryPath?s?se(e.entryPath):l.value?.rootDir?ne(e.entryPath,l.value?.rootDir).path:void 0:void 0,y=l.value?.modules?.includes(i),k=t.value?.find(d=>d.npm===i)||t.value?.find(d=>d.name===i);return{name:i,isPackageModule:s,isUninstallable:y,info:k,...e}}).filter(e=>e&&(!e.name||!D.includes(e.name))))})}export{ve as _,de as a,ge as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as B}from"./NCodeBlock.vue.
|
|
1
|
+
import{_ as B}from"./NCodeBlock.vue.7e25538f.js";import{d as N,bw as R,e as $,a as D,az as T,o as n,m as a,k as c,F as f,n as V,G as m,f as t,t as L,i as _,j as v,v as b,h as z,p as l,_ as E,r as y,L as p,bx as k,by as g}from"./entry.52bc93cd.js";const F={key:0,relative:"","n-code-block":""},W={flex:"~ wrap","w-full":""},j=["onClick"],G=c("div",{border:"b base","flex-auto":""},null,-1),q={flex:"~ gap-2",px3:"",pb3:"",n:"sm primary"},P=N({__name:"CodeSnippets",props:{codeSnippets:{},eventType:{}},setup(s){const r=s,e=R(r.codeSnippets[0]),w=$(),x=D(()=>e.value?.lang||"text");return T(()=>{r.codeSnippets.includes(e.value)||(e.value=r.codeSnippets[0])}),(i,d)=>{const S=B,u=E;return i.codeSnippets.length?(n(),a("div",F,[c("div",W,[(n(!0),a(f,null,V(i.codeSnippets,(o,O)=>(n(),a("button",{key:O,px4:"",py2:"",border:"r base",hover:"bg-active",class:m(o===t(e)?"":"border-b"),onClick:J=>e.value=o},[c("div",{class:m(o===t(e)?"":"op30"),"font-mono":""},L(o.name),3)],10,j))),128)),G]),t(e)?(n(),a(f,{key:0},[_(S,{code:t(e).code,lang:t(x),lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"]),c("div",q,[_(u,{icon:"carbon-copy",onClick:d[0]||(d[0]=o=>t(w)(t(e).code,i.eventType||`code-snippet-${t(e).name}`))},{default:v(()=>[b(" Copy ")]),_:1}),t(e)?.docs?(n(),z(u,{key:0,to:t(e).docs,target:"_blank",icon:"carbon-catalog"},{default:v(()=>[b(" Docs ")]),_:1},8,["to"])):l("",!0)])],64)):l("",!0)])):l("",!0)}}}),h=y(await p.getOptions("assets")),A=k(h);g(h,async s=>{p.updateOptions("assets",s)},{deep:!0,flush:"post",debounce:500,maxWait:1e3});const C=y(await p.getOptions("serverRoutes")),H=k(C);g(C,async s=>{p.updateOptions("serverRoutes",s)},{deep:!0,flush:"post",debounce:500,maxWait:1e3});const I={serverRoutes:H,assets:A};function Q(s){return I[s]}export{P as _,Q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as R,P as ne,r as A,Q as z,bz as T,aA as ae,w as oe,az as se,a1 as le,a as re,L as f,M as k,f as t,o as l,h as m,j as u,k as r,i as c,l as D,m as i,F as w,n as U,t as b,G as E,ae as M,v as d,p as F,at as ue,I as ie,bf as de,af as ce,bA as pe,bB as G,_ as me,X as _e,a6 as fe,ao as ve,A as ye,U as ge,aG as he}from"./entry.
|
|
1
|
+
import{d as R,P as ne,r as A,Q as z,bz as T,aA as ae,w as oe,az as se,a1 as le,a as re,L as f,M as k,f as t,o as l,h as m,j as u,k as r,i as c,l as D,m as i,F as w,n as U,t as b,G as E,ae as M,v as d,p as F,at as ue,I as ie,bf as de,af as ce,bA as pe,bB as G,_ as me,X as _e,a6 as fe,ao as ve,A as ye,U as ge,aG as he}from"./entry.52bc93cd.js";import{_ as ke}from"./NSelect.vue.cdaf42b9.js";import{_ as be}from"./NLink.vue.0a35d66d.js";import{_ as xe}from"./FilepathItem.vue.e3761da9.js";import{q as we}from"./json-editor-vue.d503734c.js";const Ce={class:"h-[48px] flex items-center justify-between gap1 px-3"},Ke={class:"w-full text-sm"},Se=["value"],Ve=["onClick"],$e=r("div",{"x-divider":""},null,-1),Ne={key:0,"h-full":"","of-hidden":"",flex:"~ col"},Ie={border:"b base",class:"h-[49px] flex flex-none items-center justify-between px-4 text-sm"},je={class:"flex items-center gap-4"},Ae={key:1},De=["onKeyup"],Ue=r("br",null,null,-1),Me={key:0,op50:""},qe={key:1},Be=r("code",null,"nitro.storage",-1),Le=r("br",null,null,-1),Pe={"font-bold":""},ze=r("br",null,null,-1),Te={"text-sm":""},Ee=r("br",null,null,-1),Fe=R({__name:"StorageDetails",async setup(O){let p,g;const C=pe(),h=ne(),x=A(""),v=A(""),s=z("storage:current",""),e=A(),y=z("storage:file:state",""),{data:K}=([p,g]=T(()=>G("storageMounts",()=>f.getStorageMounts())),p=await p,g(),p),{data:S,refresh:q}=([p,g]=T(async()=>G("storageKeys",async()=>s.value?await f.getStorageKeys(s.value):[])),p=await p,g(),p),Q=C.hook("storage:key:update",async(n,a)=>{if(!(!s.value||n.split(":")[0]!==s.value)&&(await q(),y.value===n)){if(a==="remove")return h.replace({query:{storage:s.value}});await $(y.value)}});ae(Q),oe(s,()=>{q(),y.value=""}),se(async()=>{if(!y.value){e.value=null;return}$(y.value)}),le("keydown",n=>{n.key==="s"&&(n.ctrlKey||n.metaKey)&&(N(),n.preventDefault())});function V(n){return n.replace(`${s.value}:`,"")}const W=re(()=>S.value?S.value.filter(n=>n.includes(x.value)):[]);async function $(n){const a=await f.getStorageItem(await k(),n);e.value={key:n,updatedKey:V(n),editingKey:!1,content:a,updatedContent:a}}async function X(){if(!v.value||!s.value)return;const n=`${s.value}:${v.value}`;S.value?.includes(n)||await f.setStorageItem(await k(),n,""),h.replace({query:{storage:s.value,key:n}}),v.value=""}async function N(){e.value&&(await f.setStorageItem(await k(),e.value.key,e.value.updatedContent),await $(e.value.key))}async function H(){!e.value||!s.value||(await f.removeStorageItem(await k(),e.value.key),e.value=null)}async function J(){if(!e.value||!s.value)return;const n=`${s.value}:${e.value.updatedKey}`,a=await k();await f.setStorageItem(a,n,e.value.updatedContent),await f.removeStorageItem(a,e.value.key),h.replace({query:{storage:s.value,key:n}})}return(n,a)=>{const I=me,Y=ke,j=_e,Z=fe,B=be,L=ve,P=ye,ee=ge,te=xe;return t(s)?(l(),m(ee,{key:0,"storage-key":"tab-storage"},{left:u(()=>[r("div",Ce,[c(I,{icon:"carbon-chevron-left","ml--1":"",border:!1,onClick:a[0]||(a[0]=o=>s.value="")}),r("div",Ke,[c(Y,{modelValue:t(s),"onUpdate:modelValue":a[1]||(a[1]=o=>D(s)?s.value=o:null),n:"primary",icon:"carbon-data-base"},{default:u(()=>[(l(!0),i(w,null,U(t(K),(o,_)=>(l(),i("option",{key:_,value:_},b(_),9,Se))),128))]),_:1},8,["modelValue"])])]),c(j,{modelValue:t(x),"onUpdate:modelValue":a[2]||(a[2]=o=>D(x)?x.value=o:null),icon:"carbon-search",placeholder:"Search...",n:"primary sm",border:"y x-none base! rounded-0",class:"w-full py2 ring-0!"},null,8,["modelValue"]),(l(!0),i(w,null,U(t(W),o=>(l(),i(w,{key:o},[r("button",{block:"","w-full":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:E(o===t(e)?.key?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:_=>y.value=o},b(V(o)),11,Ve),$e],64))),128)),c(j,{modelValue:t(v),"onUpdate:modelValue":a[3]||(a[3]=o=>D(v)?v.value=o:null),icon:"carbon-add",placeholder:"key",n:"sm",border:"t-none x-none base! rounded-0",class:"w-full py2 font-mono ring-0!",onKeyup:M(X,["enter"])},null,8,["modelValue","onKeyup"])]),right:u(()=>[t(e)?.key?(l(),i("div",Ne,[r("div",Ie,[r("div",je,[t(e).editingKey?(l(),m(j,{key:0,modelValue:t(e).updatedKey,"onUpdate:modelValue":a[4]||(a[4]=o=>t(e).updatedKey=o),onKeyup:M(J,["enter"])},null,8,["modelValue","onKeyup"])):(l(),i("code",Ae,[d(b(V(t(e).key))+" ",1),c(Z,{icon:"carbon-edit",class:"cursor-pointer op50 hover:op100",onClick:a[5]||(a[5]=o=>t(e).editingKey=!0)})])),t(e).editingKey?F("",!0):(l(),m(I,{key:2,n:"green xs",disabled:t(e).content===t(e).updatedContent,class:E({"border-green":t(e).content!==t(e).updatedContent}),onClick:N},{default:u(()=>[d(" Save ")]),_:1},8,["disabled","class"]))]),r("div",null,[c(I,{n:"red xs",onClick:H},{default:u(()=>[d(" Delete ")]),_:1})])]),typeof t(e).content=="object"?(l(),m(t(we),ue({key:0,modelValue:t(e).updatedContent,"onUpdate:modelValue":a[6]||(a[6]=o=>t(e).updatedContent=o),class:[[n.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue h-full of-auto text-sm outline-none"]},n.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):ie((l(),i("textarea",{key:1,"onUpdate:modelValue":a[7]||(a[7]=o=>t(e).updatedContent=o),placeholder:"Item value...",class:"h-full of-auto p-4 text-sm font-mono outline-none",onKeyup:M(de(N,["ctrl"]),["enter"])},null,40,De)),[[ce,t(e).updatedContent]])])):(l(),m(P,{key:1},{default:u(()=>[c(L,{px6:"",py4:""},{default:u(()=>[d(" Select one key to start."),Ue,d("Learn more about "),c(B,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:u(()=>[d(" Nitro storage ")]),_:1})]),_:1})]),_:1}))]),_:1})):(l(),m(P,{key:1},{default:u(()=>[Object.keys(t(K)).length?(l(),i("p",Me," Select one storage to start: ")):(l(),i("p",qe,[d(" No custom storage defined in "),Be,d("."),Le,d(" Learn more about "),c(B,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:u(()=>[d(" Nitro storage ")]),_:1})])),(l(!0),i(w,null,U(t(K),(o,_)=>(l(),m(L,{key:_,"min-w-80":"","cursor-pointer":"","p-4":"","text-left":"",hover:"border-green",onClick:Ge=>s.value=_},{default:u(()=>[r("span",Pe,b(_),1),ze,r("span",Te,b(o.driver)+" driver",1),Ee,o.base?(l(),m(te,{key:0,"text-xs":"",filepath:o.base},null,8,["filepath"])):F("",!0)]),_:2},1032,["onClick"]))),128))]),_:1}))}}}),He=R({__name:"storage",setup(O){return(p,g)=>{const C=Fe,h=he;return l(),m(h,null,{default:u(()=>[c(C)]),_:1})}}});export{He as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as Ee,r as ke,an as Pe,a1 as Ie,L as fe,M as ve,o as ee,m as he,k as oe,i as Re,f as te,h as ce,p as me,t as ge,F as xe,bA as He,_ as Ae,bC as Fe,R as We,a as Ue,az as Ne,n as $e,G as Le,bf as je,v as De,a6 as ze,j as Ke,aG as qe}from"./entry.
|
|
1
|
+
import{d as Ee,r as ke,an as Pe,a1 as Ie,L as fe,M as ve,o as ee,m as he,k as oe,i as Re,f as te,h as ce,p as me,t as ge,F as xe,bA as He,_ as Ae,bC as Fe,R as We,a as Ue,az as Ne,n as $e,G as Le,bf as je,v as De,a6 as ze,j as Ke,aG as qe}from"./entry.52bc93cd.js";var Be={exports:{}};(function(ne,Y){(function(J,G){ne.exports=G()})(self,()=>(()=>{var J={4567:function(P,r,o){var c=this&&this.__decorate||function(i,a,l,v){var m,h=arguments.length,p=h<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,a,l,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(p=(h<3?m(p):h>3?m(a,l,p):m(a,l))||p);return h>3&&p&&Object.defineProperty(a,l,p),p},u=this&&this.__param||function(i,a){return function(l,v){a(l,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=o(9042),d=o(6114),f=o(9924),g=o(844),_=o(5596),e=o(4725),s=o(3656);let t=r.AccessibilityManager=class extends g.Disposable{constructor(i,a){super(),this._terminal=i,this._renderService=a,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(l=>this._handleResize(l.rows))),this.register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(l=>this._handleChar(l))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
2
|
`))),this.register(this._terminal.onA11yTab(l=>this._handleTab(l))),this.register(this._terminal.onKey(l=>this._handleKey(l.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new _.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,s.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(i){for(let a=0;a<i;a++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),d.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,d.isMac&&this._liveRegion.remove()}_handleKey(i){this._clearLiveRegion(),/\p{Control}/u.test(i)||this._charsToConsume.push(i)}_refreshRows(i,a){this._liveRegionDebouncer.refresh(i,a,this._terminal.rows)}_renderRows(i,a){const l=this._terminal.buffer,v=l.lines.length.toString();for(let m=i;m<=a;m++){const h=l.translateBufferLineToString(l.ydisp+m,!0),p=(l.ydisp+m+1).toString(),b=this._rowElements[m];b&&(h.length===0?b.innerText=" ":b.textContent=h,b.setAttribute("aria-posinset",p),b.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,a){const l=i.target,v=this._rowElements[a===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(a===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==v)return;let m,h;if(a===0?(m=l,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=l,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),a===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(a===0?-1:1),this._rowElements[a===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let a=this._rowContainer.children.length;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=c([u(1,e.IRenderService)],t)},3614:(P,r)=>{function o(d){return d.replace(/\r?\n/g,"\r")}function c(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function u(d,f,g,_){d=c(d=o(d),g.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),f.value=""}function n(d,f,g){const _=g.getBoundingClientRect(),e=d.clientX-_.left-10,s=d.clientY-_.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=c,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,g,_){d.stopPropagation(),d.clipboardData&&u(d.clipboardData.getData("text/plain"),f,g,_)},r.paste=u,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,g,_,e){n(d,f,g),e&&_.rightClickSelect(d),f.value=_.selectionText,f.select()}},7239:(P,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=o(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(u,n,d){this._css.set(u,n,d)}getCss(u,n){return this._css.get(u,n)}setColor(u,n,d){this._color.set(u,n,d)}getColor(u,n){return this._color.get(u,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,u,n){o.addEventListener(c,u,n);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(c,u,n))}}}},6465:function(P,r,o){var c=this&&this.__decorate||function(e,s,t,i){var a,l=arguments.length,v=l<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(a=e[m])&&(v=(l<3?a(v):l>3?a(s,t,v):a(s,t))||v);return l>3&&v&&Object.defineProperty(s,t,v),v},u=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=o(3656),d=o(8460),f=o(844),g=o(2585);let _=r.Linkifier2=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,t){this._element=e,this._mouseService=s,this._renderService=t,this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const t=e.composedPath();for(let i=0;i<t.length;i++){const a=t[i];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,s){var t,i;this._activeProviderReplies&&s||((t=this._activeProviderReplies)===null||t===void 0||t.forEach(l=>{l?.forEach(v=>{v.link.dispose&&v.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let a=!1;for(const[l,v]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(l)&&(a=this._checkLinkProviderResult(l,e,a)):v.provideLinks(e.y,m=>{var h,p;if(this._isMouseOut)return;const b=m?.map(L=>({link:L}));(h=this._activeProviderReplies)===null||h===void 0||h.set(l,b),a=this._checkLinkProviderResult(l,e,a),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,s){const t=new Set;for(let i=0;i<s.size;i++){const a=s.get(i);if(a)for(let l=0;l<a.length;l++){const v=a[l],m=v.link.range.start.y<e?0:v.link.range.start.x,h=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let p=m;p<=h;p++){if(t.has(p)){a.splice(l--,1);break}t.add(p)}}}}_checkLinkProviderResult(e,s,t){var i;if(!this._activeProviderReplies)return t;const a=this._activeProviderReplies.get(e);let l=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(l=!0);if(!l&&a){const v=a.find(m=>this._linkAtPosition(m.link,s));v&&(t=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let v=0;v<this._activeProviderReplies.size;v++){const m=(i=this._activeProviderReplies.get(v))===null||i===void 0?void 0:i.find(h=>this._linkAtPosition(h.link,s));if(m){t=!0,this._handleNewLink(m);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!s||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:t=>{var i,a;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((a=this._element)===null||a===void 0||a.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.underline},set:t=>{var i,a,l;!((i=this._currentLink)===null||i===void 0)&&i.state&&((l=(a=this._currentLink)===null||a===void 0?void 0:a.state)===null||l===void 0?void 0:l.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const i=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(i,a),this._lastMouseEvent&&this._element)){const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(t,s.text)}_fireUnderlineEvent(e,s){const t=e.range,i=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-i-1,t.end.x,t.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(t,s.text)}_linkAtPosition(e,s){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,a=s.y*this._bufferService.cols+s.x;return t<=a&&a<=i}_positionFromMouseEvent(e,s,t){const i=t.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,t,i,a){return{x1:e,y1:s,x2:t,y2:i,cols:this._bufferService.cols,fg:a}}};r.Linkifier2=_=c([u(0,g.IBufferService)],_)},9042:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(P,r,o){var c=this&&this.__decorate||function(_,e,s,t){var i,a=arguments.length,l=a<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(_,e,s,t);else for(var v=_.length-1;v>=0;v--)(i=_[v])&&(l=(a<3?i(l):a>3?i(e,s,l):i(e,s))||l);return a>3&&l&&Object.defineProperty(e,s,l),l},u=this&&this.__param||function(_,e){return function(s,t){e(s,t,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=o(511),d=o(2585);let f=r.OscLinkProvider=class{constructor(_,e,s){this._bufferService=_,this._optionsService=e,this._oscLinkService=s}provideLinks(_,e){var s;const t=this._bufferService.buffer.lines.get(_-1);if(!t)return void e(void 0);const i=[],a=this._optionsService.rawOptions.linkHandler,l=new n.CellData,v=t.getTrimmedLength();let m=-1,h=-1,p=!1;for(let b=0;b<v;b++)if(h!==-1||t.hasContent(b)){if(t.loadCell(b,l),l.hasExtendedAttrs()&&l.extended.urlId){if(h===-1){h=b,m=l.extended.urlId;continue}p=l.extended.urlId!==m}else h!==-1&&(p=!0);if(p||h!==-1&&b===v-1){const L=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(L){const y={start:{x:h+1,y:_},end:{x:b+(p||b!==v-1?0:1),y:_}};let k=!1;if(!a?.allowNonHttpProtocols)try{const x=new URL(L);["http:","https:"].includes(x.protocol)||(k=!0)}catch{k=!0}k||i.push({text:L,range:y,activate:(x,T)=>a?a.activate(x,T,y):g(0,T),hover:(x,T)=>{var O;return(O=a?.hover)===null||O===void 0?void 0:O.call(a,x,T,y)},leave:(x,T)=>{var O;return(O=a?.leave)===null||O===void 0?void 0:O.call(a,x,T,y)}})}p=!1,l.hasExtendedAttrs()&&l.extended.urlId?(h=b,m=l.extended.urlId):(h=-1,m=-1)}}e(i)}};function g(_,e){if(confirm(`Do you want to navigate to ${e}?
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as B,a as w,aH as W,o as t,m as c,k as s,a9 as T,f as l,t as k,ad as O,F as f,n as E,h as y,r as C,w as q,ay as Y,a1 as j,bD as U,p as x,i as m,G as z,q as Z,e as K,ap as H,j as v,at as X,v as F,_ as G,aJ as Q,au as ee,a$ as se,bE as te,ab as ne,N as oe,ac as ae,A as le,L as R,a5 as ie,Z as re}from"./entry.7025a867.js";import{_ as M}from"./DurationDisplay.vue.d5eecd01.js";import{_ as P}from"./NBadge.1af19adc.js";import{_ as ce}from"./ComposableItem.vue.4be0b467.js";import{q as pe}from"./json-editor-vue.e51c968b.js";import{_ as de}from"./StacktraceList.vue.8012c829.js";import{_ as ue}from"./NDrawer.vue.99f5580b.js";import{_ as me}from"./LaunchPage.vue.ffcbcacd.js";import{_ as ke}from"./NLink.vue.090d2b6e.js";import{_ as _e}from"./CodeDiff.vue.470b870b.js";import{_ as he}from"./HelpFab.vue.308adf61.js";import"./NMarkdown.vue.4a9638b7.js";import"./client.5139b740.js";import"./FilepathItem.vue.0f604f99.js";import"./constants.2cc6e981.js";import"./NCodeBlock.vue.55894991.js";const fe=B({__name:"TimelineItemFunction",props:{item:{}},setup(h){const d=h,p=w(()=>W(d.item.name,50,60,"_op_")),e=w(()=>p.value.replace(/_op_/,"1")),o=w(()=>W(d.item.name,50,40)),i=w(()=>p.value.replace(/_op_/,"0.2"));return(n,a)=>(t(),c("button",{class:"group",style:T({color:l(e),borderLeft:`2px solid ${l(e)}`}),relative:"","text-sm":"",transition:"","hover:z-1000":"","bg-base":""},[s("div",{style:T({backgroundColor:l(i)}),absolute:"","bottom-0":"","left--1px":"","top-0":"","w-full":"","text-sm":"","transition-all":"","duration-300":""},null,4),s("div",{style:T({color:l(o),"--c":l(e)}),border:"r-2 t-2 y-2 transparent","min-w-max":"",px1:"","text-left":"","group-hover":"border-$c"},k(n.item.name),5)],4))}}),ye={relative:"","h-full":""},ve={absolute:"","left-2":"","top-2.3em":"","text-xs":"",op50:""},be=B({__name:"TimelineSegment",props:{segment:{}},emits:["select"],setup(h,{emit:d}){const p=h,e=d,o=O(()=>p.segment.start,{updateInterval:1e3,showSecond:!0,messages:{justNow:"",past:i=>i,future:i=>i,invalid:"-",second:i=>i?`${i}s`:"",minute:i=>`${i}m`,hour:i=>`${i}h`,week:i=>`${i}w`,day:i=>`${i}d`,month:i=>`${i}mo`,year:i=>`${i}y`}});return(i,n)=>{const a=fe;return t(),c("div",ye,[s("button",{absolute:"","left-0":"","right-0":"","top-0":"","bg-green:5":"",px2:"",py1:"","text-left":"","text-xs":"","text-green6":"","font-mono":"",onClick:n[0]||(n[0]=r=>i.segment.route?e("select",i.segment.route):void 0)},k(i.segment.route?.event.to),1),s("div",ve,k(l(o))+" ago ",1),s("div",null,[(t(!0),c(f,null,E(i.segment.functions,(r,u)=>(t(),y(a,{key:u,item:r.event,style:T({position:"absolute",minWidth:`${r.relativeWidth*100}%`,maxWidth:`${r.relativeWidth*100}%`,top:`${4+r.layer*1.6}em`,left:`${r.relativeStart*100}%`}),onClick:_=>e("select",r)},null,8,["item","style","onClick"]))),128))])])}}}),ge=3e3,xe=50;function $e(h){const d=[];let p={start:0,end:0,events:[],functions:[],duration:0};for(const e of h){const o=e.end||e.start;(e.start-p.end>ge||e.type==="route")&&(p={start:e.start,end:o,events:[],functions:[],duration:0},d.push(p)),p.events.push(e),p.end=o+xe}return d.forEach((e,o)=>{const i=e.end-e.start,n=[];e.duration=i,e.previousGap=o>0?e.start-d[o-1].end:0,e.events.forEach(a=>{const r=a.end||a.start;let u=0;a.type!=="route"&&(u=n.findIndex($=>$<=a.start),u===-1?(u=n.length,n.push(r+1e3)):n[u]=r+1e3);const _={event:a,segment:e,relativeStart:(a.start-e.start)/i,relativeWidth:(r-a.start)/i,layer:u};a.type==="function"?e.functions.push(_):e.route=_})}),d}const Ae={relative:""},De={key:0,border:"x base","h-full":"","flex-inline":"","bg-true-gray-1":"",py15:"","text-xs":"","write-vertical-left":"",op50:"","dark:bg-true-gray-9":""},Ce=B({__name:"TimelineTable",props:{data:{}},emits:["select"],setup(h,{emit:d}){const p=h,e=d,o=C(),i=C(),n=C(),a=C(),r=C(!0),u=C(1.5),_=w(()=>$e(p.data.events)),$=w(()=>(p.data.events.length,o.value?.scrollWidth||window.innerWidth));function A(){a.value&&(a.value.style.width=`${$.value}px`)}function S(){r.value&&o.value&&(o.value.scrollTo({left:o.value.scrollWidth-o.value.clientWidth,behavior:"smooth"}),n.value.scrollTo({left:o.value.scrollWidth-o.value.clientWidth,behavior:"smooth"}))}return q(()=>p.data.events.length,async()=>{await Y(),A(),S()},{flush:"post"}),j(o,"scroll",()=>{n.value.scrollLeft!==o.value.scrollLeft&&(A(),n.value.scrollLeft=o.value.scrollLeft,r.value=o.value.scrollLeft>=o.value.scrollWidth-o.value.clientWidth)}),j(n,"scroll",()=>{n.value.scrollLeft!==o.value.scrollLeft&&(A(),o.value.scrollLeft=n.value.scrollLeft)}),j(o,"wheel",b=>{b.altKey?(u.value=U(u.value+b.deltaY/200,.5,3),A()):o.value.scrollLeft+=b.deltaY}),(b,L)=>{const D=M,V=be;return t(),c(f,null,[s("div",Ae,[s("div",{ref_key:"minimap",ref:i,border:"t b base",relative:"","h-50px":"","ws-nowrap":"","border-base":""},[(t(!0),c(f,null,E(l(_),(g,N)=>(t(),c("div",{key:N,relative:"","h-full":"","flex-inline":"",style:T({width:`${Math.max(100,g.duration/10)/l($)*100}%`})},[(t(!0),c(f,null,E(g.functions,(I,J)=>(t(),c("div",{key:J,"h-3px":"",rounded:"",style:T({width:`max(${I.relativeWidth*100}%, 10px)`,position:"absolute",top:`${I.layer*4}px`,left:`${I.relativeStart*100}%`,backgroundColor:("getHashColorFromString"in b?b.getHashColorFromString:l(W))(I.event.name,50,60)})},null,4))),128)),g.route?(t(),c("div",{key:0,absolute:"","top-0":"","h-full":"","w-px":"","border-l":"","border-green6":"",op10:"",style:T({left:`${g.route.relativeStart*100}%`})},null,4)):x("",!0)],4))),128))],512),s("div",{ref_key:"minimapScroller",ref:n,class:"timeline-scroller",absolute:"","inset-0":"","h-full":"","w-full":"","of-x-scroll":""},[s("div",{ref_key:"minimapScrollerInner",ref:a,"h-1px":""},null,512)],512)]),s("div",{ref_key:"scroller",ref:o,relative:"","h-full":"","w-full":"","of-x-scroll":"","of-y-hidden":"","ws-nowrap":"","n-panel-grids":""},[(t(!0),c(f,null,E(l(_),(g,N)=>(t(),c(f,{key:N},[g.previousGap&&g.previousGap>=200?(t(),c("div",De,[m(D,{op50:"",duration:g.previousGap,color:!1},null,8,["duration"])])):x("",!0),m(V,{"flex-inline":"","of-x-hidden":"","hover:of-x-visible":"","bg-base":"",class:z(N===l(_).length-1?"border-r border-base":""),segment:g,style:T({width:`${Math.max(50,g.duration/10)*l(u)}px`}),onSelect:L[0]||(L[0]=I=>e("select",I))},null,8,["class","segment","style"])],64))),128))],512)],64)}}});const Be=Z(Ce,[["__scopeId","data-v-27e8fb2d"]]),we={border:"t base",flex:"~ col","h-full":"","of-y-auto":"","text-sm":""},Te=["onClick"],Se=s("div",{"i-carbon-function":"",op50:""},null,-1),Ne={flex:"~","ml--1":"","font-mono":""},Fe=s("div",{op30:""}," ( ",-1),Ee={key:0,mr2:"",op30:""},Le={op75:""},Ie=s("div",{op30:""}," ) ",-1),Ve=s("div",{"mr-1":"","h-7":"","w-7":"",flex:"","rounded-lg":"","bg-primary:5":"",p1:"","text-green6":""},[s("div",{"i-carbon-direction-rotary-right":"",ma:"","text-lg":""})],-1),We={flex:"~ col items-start"},Me={"text-xs":"","font-mono":"",op30:""},je={"text-green":"","font-bold":"","font-mono":""},Oe=s("div",{"flex-auto":""},null,-1),ze=s("div",{"min-h-100":""},null,-1),Ge=B({__name:"TimelineList",props:{data:{}},emits:["select"],setup(h,{emit:d}){const p=d;return(e,o)=>{const i=M;return t(),c("div",we,[(t(!0),c(f,null,E(e.data.events,(n,a)=>(t(),c("button",{key:a,border:"b base",px3:"",py2:"",flex:"~ items-center gap-2",hover:"bg-active",onClick:r=>p("select",n)},[n.type==="function"?(t(),c(f,{key:0},[Se,s("div",{"font-mono":"",style:T({color:n.type==="function"?("getHashColorFromString"in e?e.getHashColorFromString:l(W))(n.name,50,60):""})},k(n.name),5),s("div",Ne,[Fe,(t(!0),c(f,null,E(n.args,(r,u)=>(t(),c(f,{key:u},[u?(t(),c("div",Ee," , ")):x("",!0),s("div",Le,k(r===null?"null":r===void 0?"undefined":typeof r=="function"?"[function]":Array.isArray(r)?"[Array]":typeof r=="object"?"[object]":JSON.stringify(r)),1)],64))),128)),Ie])],64)):(t(),c(f,{key:1},[Ve,s("div",We,[s("div",Me,k(n.from),1),s("div",je,k(n.to),1)])],64)),Oe,n.end?(t(),y(i,{key:2,duration:n.end-n.start,color:n.type==="function"},null,8,["duration","color"])):x("",!0)],8,Te))),128)),ze])}}}),Re={key:0,"text-blue":""},He={key:1,"text-purple":""},Pe={key:2,"text-green":""},Je={key:3,"text-gray":""},qe={key:4,"text-gray":""},Ye={key:5,"text-gray":""},Ue={key:0,"bg-red:10":"",px2:"",py1:"","text-red":""},Ze={key:1},Ke={p2:"","text-sm":"",border:"t base"},Xe=B({__name:"TimelineArgumentView",props:{value:{}},setup(h){const d=h,p=C(),e=C();function o(){try{p.value=JSON.parse(JSON.stringify(d.value))}catch(a){console.error(a),e.value=a}}const i=B({emits:["setup"],setup(a,{emit:r}){return r("setup"),()=>null}}),n=K();return(a,r)=>{const u=G,_=H("VMenu");return typeof a.value=="string"?(t(),c("div",Re,k(JSON.stringify(a.value)),1)):typeof a.value=="number"?(t(),c("div",He,k(a.value),1)):typeof a.value=="boolean"?(t(),c("div",Pe,k(a.value),1)):typeof a.value>"u"?(t(),c("div",Je," undefined ")):typeof a.value=="function"?(t(),c("div",qe," [Function"+k(a.value.name?`: ${a.value.name}`:"")+"] ",1)):a.value===null?(t(),c("div",Ye," null ")):(t(),y(_,{key:6,placement:"top"},{popper:v(()=>[m(l(i),{onSetup:o}),l(e)?(t(),c("div",Ue," Failed to display object: "+k(l(e)),1)):l(p)?(t(),c("div",Ze,[m(l(pe),X({"model-value":l(p)},a.$attrs,{class:["json-editor-vue",[a.$colorMode.value==="dark"?"jse-theme-dark":""]],"main-menu-bar":!1,"navigation-bar":!1,"status-bar":!1,"read-only":!0,indentation:2,"tab-size":2}),null,16,["model-value","class"]),s("div",Ke,[m(u,{title:"Copy to clipboard",icon:"carbon-copy",onClick:r[0]||(r[0]=$=>l(n)(JSON.stringify(l(p),null,2),"timeline-argument"))},{default:v(()=>[F(" Copy ")]),_:1})])])):x("",!0)]),default:v(()=>[s("span",{"rounded-sm":"",px1:"","py0.5":"","text-sm":"",class:z([Array.isArray(a.value)?"text-amber bg-amber:10":"text-orange bg-orange:10"])},k(Array.isArray(a.value)?`[Array(${a.value.length})]`:"[Object]"),3)]),_:1}))}}}),Qe={key:0,"p-4":"",flex:"~ col gap-2","text-base":""},es={"mx--1":""},ss={flex:"~ gap-1","font-mono":""},ts={key:1},ns=s("span",{ml1:"",op30:""},"(",-1),os={key:0,op30:""},as=s("span",{op30:""},")",-1),ls={flex:"~ gap-1","text-sm":""},is=s("span",{mx1:"",op50:""},"·",-1),rs={class:"text-sm text-gray-400"},cs=B({__name:"TimelineDetailsFunction",props:{record:{}},setup(h){const d=h,p=O(()=>d.record.start,{showSecond:!0}),e=Q(),o=w(()=>e.value?.metadata),i=w(()=>e.value?.imports.find(n=>n.as===d.record.name));return(n,a)=>{const r=P,u=ce,_=Xe,$=M,A=de;return n.record?(t(),c("div",Qe,[s("div",es,[m(r,{n:"yellow",textContent:"Function call"})]),s("div",ss,[l(i)?(t(),y(u,{key:0,item:l(i),metadata:l(o),counter:!1,classes:"px2 py1","mx--2":""},null,8,["item","metadata"])):(t(),c("span",ts,k(n.record.name),1)),ns,(t(!0),c(f,null,E(n.record.args,(S,b)=>(t(),c(f,{key:b},[b?(t(),c("span",os,", ")):x("",!0),m(_,{value:S},null,8,["value"])],64))),128)),as]),s("div",ls,[n.record.end?(t(),y($,{key:0,duration:n.record.end-n.record.start},null,8,["duration"])):x("",!0),is,s("div",rs,k(l(p)),1)]),n.record.stacktrace?(t(),y(A,{key:0,stacktrace:n.record.stacktrace,class:"text-xs text-gray-400"},null,8,["stacktrace"])):x("",!0)])):x("",!0)}}}),ps={key:0,"p-4":"",flex:"~ col gap-2"},ds={"mx--1":""},us={flex:"~ gap-1 items-center","font-mono":""},ms={op50:""},ks=s("span",{"i-carbon-arrow-right":"",op50:""},null,-1),_s={flex:"~ gap-1","text-sm":""},hs=s("span",{mx1:"",op50:""},"·",-1),fs={class:"text-sm text-gray-400"},ys=B({__name:"TimelineDetailsRoute",props:{record:{}},setup(h){const d=h,p=O(()=>d.record.start,{showSecond:!0});return(e,o)=>{const i=P,n=M;return e.record?(t(),c("div",ps,[s("div",ds,[m(i,{n:"green",textContent:"Route Change"})]),s("div",us,[s("span",ms,k(e.record.from),1),ks,s("span",null,k(e.record.to),1)]),s("div",_s,[e.record.end?(t(),y(n,{key:0,duration:e.record.end-e.record.start},null,8,["duration"])):x("",!0),hs,s("div",fs,k(l(p)),1)])])):x("",!0)}}}),vs={key:0,"h-screen":"","of-hidden":""},bs={"h-screen":"","w-full":"",flex:"","flex-col":""},gs={"h-10":"",flex:"~ gap-2 items-center justify-end",p2:"",px3:""},xs={"text-sm":""},$s=s("div",{"flex-auto":""},null,-1),As={"min-h-50":"",px3:"",py2:""},Ds=B({__name:"TimelineView",setup(h){const d=ee(),p=C("table"),e=C(),o=w(()=>d.value?.metrics.clientTimeline());function i(){o.value&&(o.value.events=[])}function n(){p.value=p.value==="table"?"list":"table"}return(a,r)=>{const u=H("VTooltip"),_=G,$=Be,A=Ge,S=cs,b=ys,L=ue;return l(o)?(t(),c("div",vs,[s("div",bs,[s("div",gs,[m(u,{flex:""},{popper:v(()=>[s("div",xs,k(l(o).options.enabled?"Recording...":"Paused"),1)]),default:v(()=>[s("div",{"text-lg":"",class:z(l(o).options.enabled?"i-carbon-radio-button-checked text-primary animate-pulse":"i-carbon-pause-outline op30")},null,2)]),_:1}),l(o).options.enabled?(t(),y(_,{key:1,size:"small",ml1:"","text-sm":"",n:"orange",icon:"i-carbon-stop",onClick:r[1]||(r[1]=D=>l(o).options.enabled=!1)},{default:v(()=>[F(" Stop Tracking ")]),_:1})):(t(),y(_,{key:0,size:"small",ml1:"","text-sm":"",n:"primary",icon:"i-carbon-play",onClick:r[0]||(r[0]=D=>l(o).options.enabled=!0)},{default:v(()=>[F(" Start Tracking ")]),_:1})),$s,m(_,{icon:l(p)==="table"?"i-carbon-roadmap":"i-carbon-list",class:"ml-2",title:"Toggle View",border:!1,onClick:n},null,8,["icon"]),m(_,{icon:"i-carbon-trash-can","hover-text-red":"",class:"ml-2",border:!1,onClick:i})]),l(p)==="table"?(t(),y($,{key:0,data:{...l(o)},onSelect:r[2]||(r[2]=D=>e.value=D.event)},null,8,["data"])):(t(),y(A,{key:1,data:{...l(o)},onSelect:r[3]||(r[3]=D=>e.value=D)},null,8,["data"]))]),m(L,{"model-value":!!l(e),"auto-close":"",transition:"bottom",left:"#nuxt-devtools-side-nav",onClose:r[4]||(r[4]=D=>e.value=void 0)},{default:v(()=>[s("div",As,[l(e)?.type==="function"?(t(),y(S,{key:0,record:l(e)},null,8,["record"])):l(e)?.type==="route"?(t(),y(b,{key:1,record:l(e)},null,8,["record"])):x("",!0)])]),_:1},8,["model-value"])])):x("",!0)}}}),Cs={class:"markdown-body"},Bs=s("h1",null,"Timeline",-1),ws=s("p",null,[s("blockquote",{"text-orange":"","bg-orange:10":"",py1:""}," This is an experimental feature ")],-1),Ts=se(`<p>Timeline tracks your route navigations and functions calls in your Nuxt application. It can be used to debug performance issues and to understand how your application works.</p><h2>Function calls</h2><p>Nuxt DevTools tracks function calls by wrapping them in the build time. It works for functions referenced by auto-imports, or explicit imports through <code>import {} from '#imports'</code>.</p><pre class="shiki shiki-themes vitesse-light vitesse-dark" style="background-color:#ffffff;--shiki-dark-bg:#121212;color:#393a34;--shiki-dark:#dbd7caee;" tabindex="0"><code><span class="line"><span style="color:#999999;--shiki-dark:#666666;"><</span><span style="color:#1E754F;--shiki-dark:#4D9375;">script</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> setup</span><span style="color:#999999;--shiki-dark:#666666;">></span></span>
|
|
1
|
+
import{d as B,a as w,aH as W,o as t,m as c,k as s,a9 as T,f as l,t as k,ad as O,F as f,n as E,h as y,r as C,w as q,ay as Y,a1 as j,bD as U,p as x,i as m,G as z,q as Z,e as K,ap as H,j as v,at as X,v as F,_ as G,aJ as Q,au as ee,a$ as se,bE as te,ab as ne,N as oe,ac as ae,A as le,L as R,a5 as ie,Z as re}from"./entry.52bc93cd.js";import{_ as M}from"./DurationDisplay.vue.ce619fea.js";import{_ as P}from"./NBadge.787d75d1.js";import{_ as ce}from"./ComposableItem.vue.93291047.js";import{q as pe}from"./json-editor-vue.d503734c.js";import{_ as de}from"./StacktraceList.vue.a54c08af.js";import{_ as ue}from"./NDrawer.vue.fa4b06a6.js";import{_ as me}from"./LaunchPage.vue.5db0c060.js";import{_ as ke}from"./NLink.vue.0a35d66d.js";import{_ as _e}from"./CodeDiff.vue.786903cd.js";import{_ as he}from"./HelpFab.vue.452fd066.js";import"./NMarkdown.vue.099cce55.js";import"./client.7628b7e9.js";import"./FilepathItem.vue.e3761da9.js";import"./constants.2cc6e981.js";import"./NCodeBlock.vue.7e25538f.js";const fe=B({__name:"TimelineItemFunction",props:{item:{}},setup(h){const d=h,p=w(()=>W(d.item.name,50,60,"_op_")),e=w(()=>p.value.replace(/_op_/,"1")),o=w(()=>W(d.item.name,50,40)),i=w(()=>p.value.replace(/_op_/,"0.2"));return(n,a)=>(t(),c("button",{class:"group",style:T({color:l(e),borderLeft:`2px solid ${l(e)}`}),relative:"","text-sm":"",transition:"","hover:z-1000":"","bg-base":""},[s("div",{style:T({backgroundColor:l(i)}),absolute:"","bottom-0":"","left--1px":"","top-0":"","w-full":"","text-sm":"","transition-all":"","duration-300":""},null,4),s("div",{style:T({color:l(o),"--c":l(e)}),border:"r-2 t-2 y-2 transparent","min-w-max":"",px1:"","text-left":"","group-hover":"border-$c"},k(n.item.name),5)],4))}}),ye={relative:"","h-full":""},ve={absolute:"","left-2":"","top-2.3em":"","text-xs":"",op50:""},be=B({__name:"TimelineSegment",props:{segment:{}},emits:["select"],setup(h,{emit:d}){const p=h,e=d,o=O(()=>p.segment.start,{updateInterval:1e3,showSecond:!0,messages:{justNow:"",past:i=>i,future:i=>i,invalid:"-",second:i=>i?`${i}s`:"",minute:i=>`${i}m`,hour:i=>`${i}h`,week:i=>`${i}w`,day:i=>`${i}d`,month:i=>`${i}mo`,year:i=>`${i}y`}});return(i,n)=>{const a=fe;return t(),c("div",ye,[s("button",{absolute:"","left-0":"","right-0":"","top-0":"","bg-green:5":"",px2:"",py1:"","text-left":"","text-xs":"","text-green6":"","font-mono":"",onClick:n[0]||(n[0]=r=>i.segment.route?e("select",i.segment.route):void 0)},k(i.segment.route?.event.to),1),s("div",ve,k(l(o))+" ago ",1),s("div",null,[(t(!0),c(f,null,E(i.segment.functions,(r,u)=>(t(),y(a,{key:u,item:r.event,style:T({position:"absolute",minWidth:`${r.relativeWidth*100}%`,maxWidth:`${r.relativeWidth*100}%`,top:`${4+r.layer*1.6}em`,left:`${r.relativeStart*100}%`}),onClick:_=>e("select",r)},null,8,["item","style","onClick"]))),128))])])}}}),ge=3e3,xe=50;function $e(h){const d=[];let p={start:0,end:0,events:[],functions:[],duration:0};for(const e of h){const o=e.end||e.start;(e.start-p.end>ge||e.type==="route")&&(p={start:e.start,end:o,events:[],functions:[],duration:0},d.push(p)),p.events.push(e),p.end=o+xe}return d.forEach((e,o)=>{const i=e.end-e.start,n=[];e.duration=i,e.previousGap=o>0?e.start-d[o-1].end:0,e.events.forEach(a=>{const r=a.end||a.start;let u=0;a.type!=="route"&&(u=n.findIndex($=>$<=a.start),u===-1?(u=n.length,n.push(r+1e3)):n[u]=r+1e3);const _={event:a,segment:e,relativeStart:(a.start-e.start)/i,relativeWidth:(r-a.start)/i,layer:u};a.type==="function"?e.functions.push(_):e.route=_})}),d}const Ae={relative:""},De={key:0,border:"x base","h-full":"","flex-inline":"","bg-true-gray-1":"",py15:"","text-xs":"","write-vertical-left":"",op50:"","dark:bg-true-gray-9":""},Ce=B({__name:"TimelineTable",props:{data:{}},emits:["select"],setup(h,{emit:d}){const p=h,e=d,o=C(),i=C(),n=C(),a=C(),r=C(!0),u=C(1.5),_=w(()=>$e(p.data.events)),$=w(()=>(p.data.events.length,o.value?.scrollWidth||window.innerWidth));function A(){a.value&&(a.value.style.width=`${$.value}px`)}function S(){r.value&&o.value&&(o.value.scrollTo({left:o.value.scrollWidth-o.value.clientWidth,behavior:"smooth"}),n.value.scrollTo({left:o.value.scrollWidth-o.value.clientWidth,behavior:"smooth"}))}return q(()=>p.data.events.length,async()=>{await Y(),A(),S()},{flush:"post"}),j(o,"scroll",()=>{n.value.scrollLeft!==o.value.scrollLeft&&(A(),n.value.scrollLeft=o.value.scrollLeft,r.value=o.value.scrollLeft>=o.value.scrollWidth-o.value.clientWidth)}),j(n,"scroll",()=>{n.value.scrollLeft!==o.value.scrollLeft&&(A(),o.value.scrollLeft=n.value.scrollLeft)}),j(o,"wheel",b=>{b.altKey?(u.value=U(u.value+b.deltaY/200,.5,3),A()):o.value.scrollLeft+=b.deltaY}),(b,L)=>{const D=M,V=be;return t(),c(f,null,[s("div",Ae,[s("div",{ref_key:"minimap",ref:i,border:"t b base",relative:"","h-50px":"","ws-nowrap":"","border-base":""},[(t(!0),c(f,null,E(l(_),(g,N)=>(t(),c("div",{key:N,relative:"","h-full":"","flex-inline":"",style:T({width:`${Math.max(100,g.duration/10)/l($)*100}%`})},[(t(!0),c(f,null,E(g.functions,(I,J)=>(t(),c("div",{key:J,"h-3px":"",rounded:"",style:T({width:`max(${I.relativeWidth*100}%, 10px)`,position:"absolute",top:`${I.layer*4}px`,left:`${I.relativeStart*100}%`,backgroundColor:("getHashColorFromString"in b?b.getHashColorFromString:l(W))(I.event.name,50,60)})},null,4))),128)),g.route?(t(),c("div",{key:0,absolute:"","top-0":"","h-full":"","w-px":"","border-l":"","border-green6":"",op10:"",style:T({left:`${g.route.relativeStart*100}%`})},null,4)):x("",!0)],4))),128))],512),s("div",{ref_key:"minimapScroller",ref:n,class:"timeline-scroller",absolute:"","inset-0":"","h-full":"","w-full":"","of-x-scroll":""},[s("div",{ref_key:"minimapScrollerInner",ref:a,"h-1px":""},null,512)],512)]),s("div",{ref_key:"scroller",ref:o,relative:"","h-full":"","w-full":"","of-x-scroll":"","of-y-hidden":"","ws-nowrap":"","n-panel-grids":""},[(t(!0),c(f,null,E(l(_),(g,N)=>(t(),c(f,{key:N},[g.previousGap&&g.previousGap>=200?(t(),c("div",De,[m(D,{op50:"",duration:g.previousGap,color:!1},null,8,["duration"])])):x("",!0),m(V,{"flex-inline":"","of-x-hidden":"","hover:of-x-visible":"","bg-base":"",class:z(N===l(_).length-1?"border-r border-base":""),segment:g,style:T({width:`${Math.max(50,g.duration/10)*l(u)}px`}),onSelect:L[0]||(L[0]=I=>e("select",I))},null,8,["class","segment","style"])],64))),128))],512)],64)}}});const Be=Z(Ce,[["__scopeId","data-v-27e8fb2d"]]),we={border:"t base",flex:"~ col","h-full":"","of-y-auto":"","text-sm":""},Te=["onClick"],Se=s("div",{"i-carbon-function":"",op50:""},null,-1),Ne={flex:"~","ml--1":"","font-mono":""},Fe=s("div",{op30:""}," ( ",-1),Ee={key:0,mr2:"",op30:""},Le={op75:""},Ie=s("div",{op30:""}," ) ",-1),Ve=s("div",{"mr-1":"","h-7":"","w-7":"",flex:"","rounded-lg":"","bg-primary:5":"",p1:"","text-green6":""},[s("div",{"i-carbon-direction-rotary-right":"",ma:"","text-lg":""})],-1),We={flex:"~ col items-start"},Me={"text-xs":"","font-mono":"",op30:""},je={"text-green":"","font-bold":"","font-mono":""},Oe=s("div",{"flex-auto":""},null,-1),ze=s("div",{"min-h-100":""},null,-1),Ge=B({__name:"TimelineList",props:{data:{}},emits:["select"],setup(h,{emit:d}){const p=d;return(e,o)=>{const i=M;return t(),c("div",we,[(t(!0),c(f,null,E(e.data.events,(n,a)=>(t(),c("button",{key:a,border:"b base",px3:"",py2:"",flex:"~ items-center gap-2",hover:"bg-active",onClick:r=>p("select",n)},[n.type==="function"?(t(),c(f,{key:0},[Se,s("div",{"font-mono":"",style:T({color:n.type==="function"?("getHashColorFromString"in e?e.getHashColorFromString:l(W))(n.name,50,60):""})},k(n.name),5),s("div",Ne,[Fe,(t(!0),c(f,null,E(n.args,(r,u)=>(t(),c(f,{key:u},[u?(t(),c("div",Ee," , ")):x("",!0),s("div",Le,k(r===null?"null":r===void 0?"undefined":typeof r=="function"?"[function]":Array.isArray(r)?"[Array]":typeof r=="object"?"[object]":JSON.stringify(r)),1)],64))),128)),Ie])],64)):(t(),c(f,{key:1},[Ve,s("div",We,[s("div",Me,k(n.from),1),s("div",je,k(n.to),1)])],64)),Oe,n.end?(t(),y(i,{key:2,duration:n.end-n.start,color:n.type==="function"},null,8,["duration","color"])):x("",!0)],8,Te))),128)),ze])}}}),Re={key:0,"text-blue":""},He={key:1,"text-purple":""},Pe={key:2,"text-green":""},Je={key:3,"text-gray":""},qe={key:4,"text-gray":""},Ye={key:5,"text-gray":""},Ue={key:0,"bg-red:10":"",px2:"",py1:"","text-red":""},Ze={key:1},Ke={p2:"","text-sm":"",border:"t base"},Xe=B({__name:"TimelineArgumentView",props:{value:{}},setup(h){const d=h,p=C(),e=C();function o(){try{p.value=JSON.parse(JSON.stringify(d.value))}catch(a){console.error(a),e.value=a}}const i=B({emits:["setup"],setup(a,{emit:r}){return r("setup"),()=>null}}),n=K();return(a,r)=>{const u=G,_=H("VMenu");return typeof a.value=="string"?(t(),c("div",Re,k(JSON.stringify(a.value)),1)):typeof a.value=="number"?(t(),c("div",He,k(a.value),1)):typeof a.value=="boolean"?(t(),c("div",Pe,k(a.value),1)):typeof a.value>"u"?(t(),c("div",Je," undefined ")):typeof a.value=="function"?(t(),c("div",qe," [Function"+k(a.value.name?`: ${a.value.name}`:"")+"] ",1)):a.value===null?(t(),c("div",Ye," null ")):(t(),y(_,{key:6,placement:"top"},{popper:v(()=>[m(l(i),{onSetup:o}),l(e)?(t(),c("div",Ue," Failed to display object: "+k(l(e)),1)):l(p)?(t(),c("div",Ze,[m(l(pe),X({"model-value":l(p)},a.$attrs,{class:["json-editor-vue",[a.$colorMode.value==="dark"?"jse-theme-dark":""]],"main-menu-bar":!1,"navigation-bar":!1,"status-bar":!1,"read-only":!0,indentation:2,"tab-size":2}),null,16,["model-value","class"]),s("div",Ke,[m(u,{title:"Copy to clipboard",icon:"carbon-copy",onClick:r[0]||(r[0]=$=>l(n)(JSON.stringify(l(p),null,2),"timeline-argument"))},{default:v(()=>[F(" Copy ")]),_:1})])])):x("",!0)]),default:v(()=>[s("span",{"rounded-sm":"",px1:"","py0.5":"","text-sm":"",class:z([Array.isArray(a.value)?"text-amber bg-amber:10":"text-orange bg-orange:10"])},k(Array.isArray(a.value)?`[Array(${a.value.length})]`:"[Object]"),3)]),_:1}))}}}),Qe={key:0,"p-4":"",flex:"~ col gap-2","text-base":""},es={"mx--1":""},ss={flex:"~ gap-1","font-mono":""},ts={key:1},ns=s("span",{ml1:"",op30:""},"(",-1),os={key:0,op30:""},as=s("span",{op30:""},")",-1),ls={flex:"~ gap-1","text-sm":""},is=s("span",{mx1:"",op50:""},"·",-1),rs={class:"text-sm text-gray-400"},cs=B({__name:"TimelineDetailsFunction",props:{record:{}},setup(h){const d=h,p=O(()=>d.record.start,{showSecond:!0}),e=Q(),o=w(()=>e.value?.metadata),i=w(()=>e.value?.imports.find(n=>n.as===d.record.name));return(n,a)=>{const r=P,u=ce,_=Xe,$=M,A=de;return n.record?(t(),c("div",Qe,[s("div",es,[m(r,{n:"yellow",textContent:"Function call"})]),s("div",ss,[l(i)?(t(),y(u,{key:0,item:l(i),metadata:l(o),counter:!1,classes:"px2 py1","mx--2":""},null,8,["item","metadata"])):(t(),c("span",ts,k(n.record.name),1)),ns,(t(!0),c(f,null,E(n.record.args,(S,b)=>(t(),c(f,{key:b},[b?(t(),c("span",os,", ")):x("",!0),m(_,{value:S},null,8,["value"])],64))),128)),as]),s("div",ls,[n.record.end?(t(),y($,{key:0,duration:n.record.end-n.record.start},null,8,["duration"])):x("",!0),is,s("div",rs,k(l(p)),1)]),n.record.stacktrace?(t(),y(A,{key:0,stacktrace:n.record.stacktrace,class:"text-xs text-gray-400"},null,8,["stacktrace"])):x("",!0)])):x("",!0)}}}),ps={key:0,"p-4":"",flex:"~ col gap-2"},ds={"mx--1":""},us={flex:"~ gap-1 items-center","font-mono":""},ms={op50:""},ks=s("span",{"i-carbon-arrow-right":"",op50:""},null,-1),_s={flex:"~ gap-1","text-sm":""},hs=s("span",{mx1:"",op50:""},"·",-1),fs={class:"text-sm text-gray-400"},ys=B({__name:"TimelineDetailsRoute",props:{record:{}},setup(h){const d=h,p=O(()=>d.record.start,{showSecond:!0});return(e,o)=>{const i=P,n=M;return e.record?(t(),c("div",ps,[s("div",ds,[m(i,{n:"green",textContent:"Route Change"})]),s("div",us,[s("span",ms,k(e.record.from),1),ks,s("span",null,k(e.record.to),1)]),s("div",_s,[e.record.end?(t(),y(n,{key:0,duration:e.record.end-e.record.start},null,8,["duration"])):x("",!0),hs,s("div",fs,k(l(p)),1)])])):x("",!0)}}}),vs={key:0,"h-screen":"","of-hidden":""},bs={"h-screen":"","w-full":"",flex:"","flex-col":""},gs={"h-10":"",flex:"~ gap-2 items-center justify-end",p2:"",px3:""},xs={"text-sm":""},$s=s("div",{"flex-auto":""},null,-1),As={"min-h-50":"",px3:"",py2:""},Ds=B({__name:"TimelineView",setup(h){const d=ee(),p=C("table"),e=C(),o=w(()=>d.value?.metrics.clientTimeline());function i(){o.value&&(o.value.events=[])}function n(){p.value=p.value==="table"?"list":"table"}return(a,r)=>{const u=H("VTooltip"),_=G,$=Be,A=Ge,S=cs,b=ys,L=ue;return l(o)?(t(),c("div",vs,[s("div",bs,[s("div",gs,[m(u,{flex:""},{popper:v(()=>[s("div",xs,k(l(o).options.enabled?"Recording...":"Paused"),1)]),default:v(()=>[s("div",{"text-lg":"",class:z(l(o).options.enabled?"i-carbon-radio-button-checked text-primary animate-pulse":"i-carbon-pause-outline op30")},null,2)]),_:1}),l(o).options.enabled?(t(),y(_,{key:1,size:"small",ml1:"","text-sm":"",n:"orange",icon:"i-carbon-stop",onClick:r[1]||(r[1]=D=>l(o).options.enabled=!1)},{default:v(()=>[F(" Stop Tracking ")]),_:1})):(t(),y(_,{key:0,size:"small",ml1:"","text-sm":"",n:"primary",icon:"i-carbon-play",onClick:r[0]||(r[0]=D=>l(o).options.enabled=!0)},{default:v(()=>[F(" Start Tracking ")]),_:1})),$s,m(_,{icon:l(p)==="table"?"i-carbon-roadmap":"i-carbon-list",class:"ml-2",title:"Toggle View",border:!1,onClick:n},null,8,["icon"]),m(_,{icon:"i-carbon-trash-can","hover-text-red":"",class:"ml-2",border:!1,onClick:i})]),l(p)==="table"?(t(),y($,{key:0,data:{...l(o)},onSelect:r[2]||(r[2]=D=>e.value=D.event)},null,8,["data"])):(t(),y(A,{key:1,data:{...l(o)},onSelect:r[3]||(r[3]=D=>e.value=D)},null,8,["data"]))]),m(L,{"model-value":!!l(e),"auto-close":"",transition:"bottom",left:"#nuxt-devtools-side-nav",onClose:r[4]||(r[4]=D=>e.value=void 0)},{default:v(()=>[s("div",As,[l(e)?.type==="function"?(t(),y(S,{key:0,record:l(e)},null,8,["record"])):l(e)?.type==="route"?(t(),y(b,{key:1,record:l(e)},null,8,["record"])):x("",!0)])]),_:1},8,["model-value"])])):x("",!0)}}}),Cs={class:"markdown-body"},Bs=s("h1",null,"Timeline",-1),ws=s("p",null,[s("blockquote",{"text-orange":"","bg-orange:10":"",py1:""}," This is an experimental feature ")],-1),Ts=se(`<p>Timeline tracks your route navigations and functions calls in your Nuxt application. It can be used to debug performance issues and to understand how your application works.</p><h2>Function calls</h2><p>Nuxt DevTools tracks function calls by wrapping them in the build time. It works for functions referenced by auto-imports, or explicit imports through <code>import {} from '#imports'</code>.</p><pre class="shiki shiki-themes vitesse-light vitesse-dark" style="background-color:#ffffff;--shiki-dark-bg:#121212;color:#393a34;--shiki-dark:#dbd7caee;" tabindex="0"><code><span class="line"><span style="color:#999999;--shiki-dark:#666666;"><</span><span style="color:#1E754F;--shiki-dark:#4D9375;">script</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> setup</span><span style="color:#999999;--shiki-dark:#666666;">></span></span>
|
|
2
2
|
<span class="line"><span style="color:#1E754F;--shiki-dark:#4D9375;">import</span><span style="color:#999999;--shiki-dark:#666666;"> {</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> useMouse</span><span style="color:#999999;--shiki-dark:#666666;"> }</span><span style="color:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">@vueuse/core</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">'</span></span>
|
|
3
3
|
<span class="line"><span style="color:#1E754F;--shiki-dark:#4D9375;">import</span><span style="color:#999999;--shiki-dark:#666666;"> {</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> useNuxtApp</span><span style="color:#999999;--shiki-dark:#666666;"> }</span><span style="color:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">#imports</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">'</span></span>
|
|
4
4
|
<span class="line"></span>
|