@nuxt/devtools 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/module-main.mjs +3 -2
- package/dist/client/200.html +23 -23
- package/dist/client/404.html +23 -23
- package/dist/client/_nuxt/__blank-j47419ao.js +1 -0
- package/dist/client/_nuxt/{analyze-build-dswniyeh.js → analyze-build-bugaz9us.js} +1 -1
- package/dist/client/_nuxt/{assets-d2wlrwj5.js → assets-osp8hkm5.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/5f994163-fc52-4e71-a78a-98b64f1fb08f.json +1 -0
- package/dist/client/_nuxt/{client-kpmlv67d.js → client-edufhzwa.js} +1 -1
- package/dist/client/_nuxt/{code-diff.vue-dnq2h1u9.js → code-diff.vue-gy1k04x9.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-j2rf4gq2.js → code-snippets.vue-ofmkxw4b.js} +1 -1
- package/dist/client/_nuxt/{components-cr6la0jc.js → components-hzbrj322.js} +1 -1
- package/dist/client/_nuxt/{composable-item.vue-nkul53a1.js → composable-item.vue-o29ru8an.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-dwpm6y1k.js → custom-_name_-m1v3gtb3.js} +1 -1
- package/dist/client/_nuxt/{data-schema-button.vue-hqqx4i1r.js → data-schema-button.vue-m1rfzflw.js} +1 -1
- package/dist/client/_nuxt/data-schema-drawer-jmqcuxpo.js +2 -0
- package/dist/client/_nuxt/{default-err1p5vu.js → default-jt337kpj.js} +1 -1
- package/dist/client/_nuxt/{duration-display.vue-dzttyi5n.js → duration-display.vue-gu7el5x3.js} +1 -1
- package/dist/client/_nuxt/{entry.css-mj1nvcy6.css → entry.css-jfo9gib8.css} +1 -1
- package/dist/client/_nuxt/{error-404-gd4k7ljf.js → error-404-f20h7euk.js} +1 -1
- package/dist/client/_nuxt/error-404.css-fsdpg4tp.css +1 -0
- package/dist/client/_nuxt/{error-500-acaymbms.js → error-500-kln77uik.js} +1 -1
- package/dist/client/_nuxt/error-500.css-bernuda7.css +1 -0
- package/dist/client/_nuxt/{error-c99pd47j.js → error-o3wydv8q.js} +1 -1
- package/dist/client/_nuxt/{filepath-item.vue-ci7z8yh9.js → filepath-item.vue-i51hnv27.js} +1 -1
- package/dist/client/_nuxt/full-hllxflb0.js +1 -0
- package/dist/client/_nuxt/g3h63aw5.js +17 -0
- package/dist/client/_nuxt/{help-fab.vue-jfmsun8j.js → help-fab.vue-lv824f8h.js} +1 -1
- package/dist/client/_nuxt/{hooks-ih7mpu9m.js → hooks-lylmzd7n.js} +1 -1
- package/dist/client/_nuxt/{imports-pa9o9gy7.js → imports-b9yuvomv.js} +1 -1
- package/dist/client/_nuxt/{index-b0inf0b1.js → index-pa2alw8p.js} +1 -1
- package/dist/client/_nuxt/launch-page.vue-c4udrikr.js +1 -0
- package/dist/client/_nuxt/modules-jbbzhk6s.js +1 -0
- package/dist/client/_nuxt/nbadge-inu2cbym.js +1 -0
- package/dist/client/_nuxt/{ncheckbox.vue-ny9mboxw.js → ncheckbox.vue-ebn9fsvc.js} +1 -1
- package/dist/client/_nuxt/{ncode-block.vue-dt6krs6h.js → ncode-block.vue-msaaoy71.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-dan2xl77.js → ndrawer.vue-nv73yu3i.js} +1 -1
- package/dist/client/_nuxt/ndropdown.vue-f8fjs48r.js +1 -0
- package/dist/client/_nuxt/{nicon-title.vue-hzhi6u0u.js → nicon-title.vue-j1ceohu1.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-ck043kl6.js → nlink.vue-ncsjb1ly.js} +1 -1
- package/dist/client/_nuxt/{nmarkdown.vue-jpbjhala.js → nmarkdown.vue-oxfi26vk.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-jas2jnez.js → nnavbar.vue-c3um92xe.js} +1 -1
- package/dist/client/_nuxt/none-hokh1e0y.js +1 -0
- package/dist/client/_nuxt/{nsection-block-h1gauc17.js → nsection-block-jrje44xx.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs.vue-osip56xu.js → nselect-tabs.vue-kmg7oqpq.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-o0k1l9g8.js → nselect.vue-otkv89hb.js} +1 -1
- package/dist/client/_nuxt/{nswitch.vue-iu20lc9i.js → nswitch.vue-l8xqfho0.js} +1 -1
- package/dist/client/_nuxt/{open-graph-gt5upzf3.js → open-graph-g14cvh6u.js} +1 -1
- package/dist/client/_nuxt/{overview-ie3okhgw.js → overview-h8wty1mg.js} +1 -1
- package/dist/client/_nuxt/{pages-eh09e5pf.js → pages-bkcg7jdi.js} +1 -1
- package/dist/client/_nuxt/{payload-mkny1tm5.js → payload-oxquqq8k.js} +1 -1
- package/dist/client/_nuxt/pinia-d8u1ilag.js +1 -0
- package/dist/client/_nuxt/{plugins-gtlc1x83.js → plugins-im2207tt.js} +1 -1
- package/dist/client/_nuxt/render-tree-e9fjta20.js +1 -0
- package/dist/client/_nuxt/{runtime-configs-3blc3z3w.js → runtime-configs-dy1sicee.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-bbthi13e.js → server-discovery-o8cr9llt.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-emwjkvdf.js → server-route-inputs.vue-bpkh6jhv.js} +1 -1
- package/dist/client/_nuxt/{server-routes-jt78ozjb.js → server-routes-ml9qzq4f.js} +2 -2
- package/dist/client/_nuxt/{server-tasks-e4n3a8e4.js → server-tasks-jtcxge81.js} +1 -1
- package/dist/client/_nuxt/{settings-nhpano1u.js → settings-k4hm6nna.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list.vue-cgyq8j5q.js → stacktrace-list.vue-b1n0lhud.js} +1 -1
- package/dist/client/_nuxt/{state-components-bl8ndmfx.js → state-components-hvnej0jk.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-o71oq72z.js +1 -0
- package/dist/client/_nuxt/{state-modules-gsjoppg4.js → state-modules-d3vu3o41.js} +1 -1
- package/dist/client/_nuxt/{storage-lumi6wjg.js → storage-d5jfpe6j.js} +1 -1
- package/dist/client/_nuxt/{terminals-lgt62s8g.js → terminals-jlz6zkmv.js} +1 -1
- package/dist/client/_nuxt/{timeline-eln3mo5n.js → timeline-cnxzcq07.js} +1 -1
- package/dist/client/_nuxt/{unocss-runtime-cb61k1ql.js → unocss-runtime-gc1hqonm.js} +1 -1
- package/dist/client/_nuxt/vendor/json-editor-vue-npezbdce.js +3818 -0
- package/dist/client/_nuxt/vendor/{quicktype-core-lnbp3n5r.js → quicktype-core-i8ym98gu.js} +1 -1
- package/dist/client/_nuxt/vendor/{shiki-bpva4tco.js → shiki-ian6uf3s.js} +26 -26
- package/dist/client/_nuxt/vendor/{unocss-mstcul8h.js → unocss-hjqyvvq7.js} +2 -2
- package/dist/client/_nuxt/{virtual-files-ecvlvl51.js → virtual-files-jh7t3cfd.js} +1 -1
- package/dist/client/_nuxt/vue-devtools-dzipubfc.js +2 -0
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-ryb7s73q.js → vue-virtual-scroller.esm-guzt9iin.js} +1 -1
- package/dist/client/index.html +23 -23
- package/dist/module.d.mts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/plugins/view/Main.vue +1 -1
- package/dist/runtime/plugins/view/client.js +8 -5
- package/dist/shared/{devtools.2a48a9e5.d.mts → devtools.2e078e30.d.mts} +4 -0
- package/dist/shared/{devtools.2a48a9e5.d.ts → devtools.2e078e30.d.ts} +4 -0
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +27 -27
- package/dist/client/_nuxt/__blank-lg13rweu.js +0 -1
- package/dist/client/_nuxt/builds/meta/d7fd3832-7caa-4509-b853-415d3c160ceb.json +0 -1
- package/dist/client/_nuxt/data-schema-drawer-h37seqpj.js +0 -2
- package/dist/client/_nuxt/ebt3cj6n.js +0 -17
- package/dist/client/_nuxt/error-404.css-fwe7gpvk.css +0 -1
- package/dist/client/_nuxt/error-500.css-djemplc9.css +0 -1
- package/dist/client/_nuxt/full-hh52dt43.js +0 -1
- package/dist/client/_nuxt/index-fcdkwnzi.js +0 -2
- package/dist/client/_nuxt/launch-page.vue-kt4750to.js +0 -1
- package/dist/client/_nuxt/modules-n2gurld7.js +0 -1
- package/dist/client/_nuxt/nbadge-hx8q1ml8.js +0 -1
- package/dist/client/_nuxt/ndropdown.vue-ky50hs20.js +0 -1
- package/dist/client/_nuxt/none-dli6w9ti.js +0 -1
- package/dist/client/_nuxt/pinia-bnsnnkci.js +0 -1
- package/dist/client/_nuxt/render-tree-t4au4qai.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-kg8q7nng.js +0 -1
- package/dist/client/_nuxt/vendor/json-editor-vue-kcahofzr.js +0 -3818
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as ne,
|
|
1
|
+
import{R as ne,bh as ae,p as oe,q as z,D as se,r as f,m as k,bi as R,_ as le,z as re,H as ue,V as ie,h as de,w as pe,a4 as me}from"./g3h63aw5.js";import{_ as ve}from"./nselect.vue-otkv89hb.js";import{_ as fe}from"./nlink.vue-ncsjb1ly.js";import{_ as ce}from"./filepath-item.vue-i51hnv27.js";import{p as W,f as U,az as T,I as ye,j as _e,w as ge,q as ke,u as c,U as s,P as m,a2 as r,X as l,a3 as d,A as xe,W as u,F as b,ae as A,a8 as x,a0 as E,a1 as M,a9 as i,Z as F,ax as be,a4 as we,aa as Ce,ai as Ke,an as Se}from"./vendor/json-editor-vue-npezbdce.js";import"./vendor/unocss-hjqyvvq7.js";import"./vendor/shiki-ian6uf3s.js";const Ve={class:"h-[48px] flex items-center justify-between gap1 px-3"},Ne={class:"w-full text-sm"},$e=["value"],Ie=["onClick"],he={key:0,"h-full":"","of-hidden":"",flex:"~ col"},je={border:"b base",class:"h-[49px] flex flex-none items-center justify-between px-4 text-sm"},De={class:"flex items-center gap-4"},Ue={key:1},Ae=["onKeyup"],Me={key:0,op50:""},qe={key:1},Be={"font-bold":""},Le={"text-sm":""},Pe=W({__name:"StorageDetails",async setup(G){let p,_;const w=ne(),C=ae(),K=oe(),S=U(""),g=U(""),o=z("storage:current",""),t=U(),y=z("storage:file:state",""),{data:V}=([p,_]=T(()=>R("storageMounts",()=>f.getStorageMounts())),p=await p,_(),p),{data:N,refresh:q}=([p,_]=T(async()=>R("storageKeys",async()=>o.value?await f.getStorageKeys(o.value):[])),p=await p,_(),p),H=C.hook("storage:key:update",async(n,e)=>{if(!(!o.value||n.split(":")[0]!==o.value)&&(await q(),y.value===n)){if(e==="remove")return K.replace({query:{storage:o.value}});await I(y.value)}});ye(H),_e(o,()=>{q(),y.value=""}),ge(async()=>{if(!y.value){t.value=null;return}I(y.value)}),se("keydown",n=>{n.key==="s"&&(n.ctrlKey||n.metaKey)&&(h(),n.preventDefault())});function $(n){return n.replace(`${o.value}:`,"")}const O=ke(()=>N.value?N.value.filter(n=>n.includes(S.value)):[]);async function I(n){const e=await f.getStorageItem(await k(),n);t.value={key:n,updatedKey:$(n),editingKey:!1,content:e,updatedContent:e}}async function X(){if(!g.value||!o.value)return;const n=`${o.value}:${g.value}`;N.value?.includes(n)||await f.setStorageItem(await k(),n,""),K.replace({query:{storage:o.value,key:n}}),g.value=""}async function h(){t.value&&(await f.setStorageItem(await k(),t.value.key,t.value.updatedContent),await I(t.value.key))}async function Z(){!t.value||!o.value||(await f.removeStorageItem(await k(),t.value.key),t.value=null)}async function J(){if(!t.value||!o.value)return;const n=`${o.value}:${t.value.updatedKey}`,e=await k();await f.setStorageItem(e,n,t.value.updatedContent),await f.removeStorageItem(e,t.value.key),K.replace({query:{storage:o.value,key:n}})}return(n,e)=>{const j=le,Q=ve,D=re,Y=ue,B=fe,L=ie,P=de,ee=pe,te=ce;return c(o)?(s(),m(ee,{key:0,"storage-key":"tab-storage"},{left:r(()=>[l("div",Ve,[d(j,{icon:"carbon-chevron-left","ml--1":"",border:!1,onClick:e[0]||(e[0]=a=>o.value="")}),l("div",Ne,[d(Q,{modelValue:c(o),"onUpdate:modelValue":e[1]||(e[1]=a=>xe(o)?o.value=a:null),n:"primary",icon:"carbon-data-base"},{default:r(()=>[(s(!0),u(b,null,A(c(V),(a,v)=>(s(),u("option",{key:v,value:v},x(v),9,$e))),128))]),_:1},8,["modelValue"])])]),d(D,{modelValue:S.value,"onUpdate:modelValue":e[2]||(e[2]=a=>S.value=a),icon:"carbon-search",placeholder:"Search...",n:"primary sm",border:"y x-none base! rounded-0",class:"w-full py2 ring-0!"},null,8,["modelValue"]),(s(!0),u(b,null,A(O.value,a=>(s(),u(b,{key:a},[l("button",{block:"","w-full":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:E(a===t.value?.key?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:v=>y.value=a},x($(a)),11,Ie),e[8]||(e[8]=l("div",{"x-divider":""},null,-1))],64))),128)),d(D,{modelValue:g.value,"onUpdate:modelValue":e[3]||(e[3]=a=>g.value=a),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"])]),right:r(()=>[t.value?.key?(s(),u("div",he,[l("div",je,[l("div",De,[t.value.editingKey?(s(),m(D,{key:0,modelValue:t.value.updatedKey,"onUpdate:modelValue":e[4]||(e[4]=a=>t.value.updatedKey=a),onKeyup:M(J,["enter"])},null,8,["modelValue"])):(s(),u("code",Ue,[i(x($(t.value.key))+" ",1),d(Y,{icon:"carbon-edit",class:"cursor-pointer op50 hover:op100",onClick:e[5]||(e[5]=a=>t.value.editingKey=!0)})])),t.value.editingKey?F("",!0):(s(),m(j,{key:2,n:"green xs",disabled:t.value.content===t.value.updatedContent,class:E({"border-green":t.value.content!==t.value.updatedContent}),onClick:h},{default:r(()=>e[9]||(e[9]=[i(" Save ")])),_:1},8,["disabled","class"]))]),l("div",null,[d(j,{n:"red xs",onClick:Z},{default:r(()=>e[10]||(e[10]=[i(" Delete ")])),_:1})])]),typeof t.value.content=="object"?(s(),m(c(be),we({key:0,modelValue:t.value.updatedContent,"onUpdate:modelValue":e[6]||(e[6]=a=>t.value.updatedContent=a),class:[[c(w)==="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"])):Ce((s(),u("textarea",{key:1,"onUpdate:modelValue":e[7]||(e[7]=a=>t.value.updatedContent=a),placeholder:"Item value...",class:"h-full of-auto p-4 text-sm font-mono outline-none",onKeyup:M(Ke(h,["ctrl"]),["enter"])},null,40,Ae)),[[Se,t.value.updatedContent]])])):(s(),m(P,{key:1},{default:r(()=>[d(L,{px6:"",py4:""},{default:r(()=>[e[12]||(e[12]=i(" Select one key to start.")),e[13]||(e[13]=l("br",null,null,-1)),e[14]||(e[14]=i("Learn more about ")),d(B,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:r(()=>e[11]||(e[11]=[i(" Nitro storage ")])),_:1})]),_:1})]),_:1}))]),_:1})):(s(),m(P,{key:1},{default:r(()=>[Object.keys(c(V)).length?(s(),u("p",Me," Select one storage to start: ")):(s(),u("p",qe,[e[16]||(e[16]=i(" No custom storage defined in ")),e[17]||(e[17]=l("code",null,"nitro.storage",-1)),e[18]||(e[18]=i(".")),e[19]||(e[19]=l("br",null,null,-1)),e[20]||(e[20]=i(" Learn more about ")),d(B,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:r(()=>e[15]||(e[15]=[i(" Nitro storage ")])),_:1})])),(s(!0),u(b,null,A(c(V),(a,v)=>(s(),m(L,{key:v,"min-w-80":"","cursor-pointer":"","p-4":"","text-left":"",hover:"border-green",onClick:ze=>o.value=v},{default:r(()=>[l("span",Be,x(v),1),e[21]||(e[21]=l("br",null,null,-1)),l("span",Le,x(a.driver)+" driver",1),e[22]||(e[22]=l("br",null,null,-1)),a.base?(s(),m(te,{key:0,"text-xs":"",filepath:a.base},null,8,["filepath"])):F("",!0)]),_:2},1032,["onClick"]))),128))]),_:1}))}}}),Oe=W({__name:"storage",setup(G){return(p,_)=>{const w=Pe,C=me;return s(),m(C,null,{default:r(()=>[d(w)]),_:1})}}});export{Oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bh as B,D as E,r as f,m as _,_ as $,bj as V,s as D,H as F,a4 as P}from"./g3h63aw5.js";import{x as z,a as I}from"./vendor/xterm-b1jefe3j.js";import{p as y,f as g,z as M,U as t,W as d,X as c,a3 as A,P as m,Z as v,a8 as p,F as N,q as R,w as j,u as w,ae as q,a0 as C,ai as L,a9 as h,a2 as H}from"./vendor/json-editor-vue-npezbdce.js";import"./vendor/unocss-hjqyvvq7.js";import"./vendor/shiki-ian6uf3s.js";const S={border:"t base",flex:"~ gap-2","items-center":"",p2:""},U={"text-sm":"",op50:""},W=y({__name:"TerminalView",props:{id:{}},setup(b){const n=b,i=g(),r=B(),o=g();let a;M(async()=>{a=new z.Terminal({convertEol:!0,cols:80,screenReaderMode:!0});const u=new I.FitAddon;a.loadAddon(u),a.open(i.value),u.fit(),E(window,"resize",()=>{u.fit()}),o.value=await f.getTerminalDetail(await _(),n.id),o.value?.buffer&&a.write(o.value.buffer),r.hook("devtools:terminal:data",({id:e,data:l})=>{e===n.id&&a.write(l)})});async function s(){f.runTerminalAction(await _(),n.id,"clear"),a?.clear()}async function k(){f.runTerminalAction(await _(),n.id,"restart")}async function x(){f.runTerminalAction(await _(),n.id,"terminate")}return(u,e)=>{const l=$;return t(),d(N,null,[c("div",{ref_key:"container",ref:i,"h-full":"","w-full":"","of-auto":"","bg-black":""},null,512),c("div",S,[A(l,{title:"Clear",icon:"i-carbon-clean",border:!1,onClick:e[0]||(e[0]=T=>s())}),o.value?.restartable?(t(),m(l,{key:0,title:"Restart",icon:"carbon-renew",border:!1,onClick:e[1]||(e[1]=T=>k())})):v("",!0),o.value?.terminatable?(t(),m(l,{key:1,title:"Terminate",icon:"carbon-delete",border:!1,onClick:e[2]||(e[2]=T=>x())})):v("",!0),c("span",U,p(o.value?.description),1)])],64)}}}),X={key:0,"h-full":"","w-full":"","of-hidden":"",grid:"~ rows-[max-content_1fr_max-content]"},Z={flex:"~",border:"b base","flex-1":"","items-center":"","n-navbar-glass":""},G=["onClick"],J={key:1,p10:""},K={key:1,"h-full":"",flex:"","items-center":"","justify-center":""},O=y({__name:"TerminalPage",setup(b){const n=V(),i=D(),r=R(()=>n.value?.find(a=>a.id===i.value));async function o(a){f.runTerminalAction(await _(),a,"remove")}return j(()=>{!i.value&&n.value?.length&&(i.value=n.value[0].id)}),(a,s)=>{const k=F,x=$,u=W;return w(n)?.length?(t(),d("div",X,[c("div",Z,[(t(!0),d(N,null,q(w(n),e=>(t(),d("button",{key:e.id,border:"r base",flex:"~ gap-2","items-center":"",px3:"",py2:"",class:C(e.id===r.value?.id?"bg-active":""),onClick:l=>i.value=e.id},[e.icon?(t(),m(k,{key:0,icon:e.icon},null,8,["icon"])):v("",!0),c("span",{class:C(e.id===r.value?.id?"":"op50")},p(e.name)+p(e.isTerminated?" (terminated)":""),3),e.isTerminated?(t(),m(x,{key:1,icon:"carbon-close","mx--2":"",border:!1,onClick:L(l=>o(e.id),["stop"])},null,8,["onClick"])):v("",!0)],10,G))),128))]),r.value?(t(),m(u,{id:r.value.id,key:r.value.id},null,8,["id"])):(t(),d("div",J,[s[0]||(s[0]=h(" Terminal ")),c("code",null,p(w(i)),1),s[1]||(s[1]=h(" not found "))]))])):(t(),d("div",K,s[2]||(s[2]=[c("em",{op50:""},"No terminal attached",-1)])))}}}),ae=y({__name:"terminals",setup(b){return(n,i)=>{const r=O,o=P;return t(),m(o,null,{default:H(()=>[A(r)]),_:1})}}});export{ae as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a5 as V,M as O,D as j,bh as Y,b as U,R as q,a as K,_ as z,a7 as X,f as Z,bi as Q,K as ee,n as se,L as ne,h as te,r as G,G as oe,B as ae}from"./ebt3cj6n.js";import{_ as W}from"./duration-display.vue-dzttyi5n.js";import{p as B,q as w,U as o,W as i,X as t,$ as T,a8 as m,u as g,F as y,ae as E,P as h,f as C,j as le,n as re,Z as x,a3 as u,a0 as R,V as P,a2 as v,ax as ie,a4 as pe,a9 as F,aj as ce}from"./vendor/json-editor-vue-kcahofzr.js";import{_ as H}from"./nbadge-hx8q1ml8.js";import{_ as de}from"./composable-item.vue-nkul53a1.js";import{_ as ue}from"./stacktrace-list.vue-cgyq8j5q.js";import{_ as me}from"./ndrawer.vue-dan2xl77.js";import{_ as ke}from"./launch-page.vue-kt4750to.js";import{_ as fe}from"./nlink.vue-ck043kl6.js";import{_ as ye}from"./code-diff.vue-dnq2h1u9.js";import{_ as he}from"./help-fab.vue-jfmsun8j.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-bpva4tco.js";import"./nmarkdown.vue-jpbjhala.js";import"./client-kpmlv67d.js";import"./filepath-item.vue-ci7z8yh9.js";import"./index-obsucz0g.js";import"./constants-b32h69zq.js";import"./ncode-block.vue-dt6krs6h.js";const ve=B({__name:"TimelineItemFunction",props:{item:{}},setup(f){const d=f,p=w(()=>V(d.item.name,50,60,"_op_")),n=w(()=>p.value.replace(/_op_/,"1")),e=w(()=>V(d.item.name,50,40)),l=w(()=>p.value.replace(/_op_/,"0.2"));return(a,r)=>(o(),i("button",{class:"group",style:T({color:n.value,borderLeft:`2px solid ${n.value}`}),relative:"","text-sm":"",transition:"","hover:z-1000":"","bg-base":""},[t("div",{style:T({backgroundColor:l.value}),absolute:"","bottom-0":"","left--1px":"","top-0":"","w-full":"","text-sm":"","transition-all":"","duration-300":""},null,4),t("div",{style:T({color:e.value,"--c":n.value}),border:"r-2 t-2 y-2 transparent","min-w-max":"",px1:"","text-left":"","group-hover":"border-$c"},m(a.item.name),5)],4))}}),_e={relative:"","h-full":""},be={absolute:"","left-2":"","top-2.3em":"","text-xs":"",op50:""},ge=B({__name:"TimelineSegment",props:{segment:{}},emits:["select"],setup(f,{emit:d}){const p=f,n=d,e=O(()=>p.segment.start,{updateInterval:1e3,showSecond:!0,controls:!1,messages:{justNow:"",past:l=>l,future:l=>l,invalid:"-",second:l=>l?`${l}s`:"",minute:l=>`${l}m`,hour:l=>`${l}h`,week:l=>`${l}w`,day:l=>`${l}d`,month:l=>`${l}mo`,year:l=>`${l}y`}});return(l,a)=>{const r=ve;return o(),i("div",_e,[t("button",{absolute:"","left-0":"","right-0":"","top-0":"","bg-green:5":"",px2:"",py1:"","text-left":"","text-xs":"","text-green6":"","font-mono":"",onClick:a[0]||(a[0]=s=>l.segment.route?n("select",l.segment.route):void 0)},m(l.segment.route?.event.to),1),t("div",be,m(g(e))+" ago ",1),t("div",null,[(o(!0),i(y,null,E(l.segment.functions,(s,c)=>(o(),h(r,{key:c,item:s.event,style:T({position:"absolute",minWidth:`${s.relativeWidth*100}%`,maxWidth:`${s.relativeWidth*100}%`,top:`${4+s.layer*1.6}em`,left:`${s.relativeStart*100}%`}),onClick:k=>n("select",s)},null,8,["item","style","onClick"]))),128))])])}}}),xe=3e3,De=50;function Ae(f){const d=[];let p={start:0,end:0,events:[],functions:[],duration:0};for(const n of f){const e=n.end||n.start;(n.start-p.end>xe||n.type==="route")&&(p={start:n.start,end:e,events:[],functions:[],duration:0},d.push(p)),p.events.push(n),p.end=e+De}return d.forEach((n,e)=>{const l=n.end-n.start,a=[];n.duration=l,n.previousGap=e>0?n.start-d[e-1].end:0,n.events.forEach(r=>{const s=r.end||r.start;let c=0;r.type!=="route"&&(c=a.findIndex(D=>D<=r.start),c===-1?(c=a.length,a.push(s+1e3)):a[c]=s+1e3);const k={event:r,segment:n,relativeStart:(r.start-n.start)/l,relativeWidth:(s-r.start)/l,layer:c};r.type==="function"?n.functions.push(k):n.route=k})}),d}const $e={relative:""},Ce={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":""},Be=B({__name:"TimelineTable",props:{data:{}},emits:["select"],setup(f,{emit:d}){const p=f,n=d,e=C(),l=C(),a=C(),r=C(),s=C(!0),c=C(1.5),k=w(()=>Ae(p.data.events)),D=w(()=>(p.data.events.length,e.value?.scrollWidth||window.innerWidth));function A(){r.value&&(r.value.style.width=`${D.value}px`)}function S(){s.value&&e.value&&(e.value.scrollTo({left:e.value.scrollWidth-e.value.clientWidth,behavior:"smooth"}),a.value.scrollTo({left:e.value.scrollWidth-e.value.clientWidth,behavior:"smooth"}))}return le(()=>p.data.events.length,async()=>{await re(),A(),S()},{flush:"post"}),j(e,"scroll",()=>{a.value.scrollLeft!==e.value.scrollLeft&&(A(),a.value.scrollLeft=e.value.scrollLeft,s.value=e.value.scrollLeft>=e.value.scrollWidth-e.value.clientWidth)}),j(a,"scroll",()=>{a.value.scrollLeft!==e.value.scrollLeft&&(A(),e.value.scrollLeft=a.value.scrollLeft)}),j(e,"wheel",_=>{_.altKey?(c.value=Y(c.value+_.deltaY/200,.5,3),A()):e.value.scrollLeft+=_.deltaY}),(_,L)=>{const $=W,M=ge;return o(),i(y,null,[t("div",$e,[t("div",{ref_key:"minimap",ref:l,border:"t b base",relative:"","h-50px":"","ws-nowrap":"","border-base":""},[(o(!0),i(y,null,E(k.value,(b,N)=>(o(),i("div",{key:N,relative:"","h-full":"","flex-inline":"",style:T({width:`${Math.max(100,b.duration/10)/D.value*100}%`})},[(o(!0),i(y,null,E(b.functions,(I,J)=>(o(),i("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 _?_.getHashColorFromString:g(V))(I.event.name,50,60)})},null,4))),128)),b.route?(o(),i("div",{key:0,absolute:"","top-0":"","h-full":"","w-px":"","border-l":"","border-green6":"",op10:"",style:T({left:`${b.route.relativeStart*100}%`})},null,4)):x("",!0)],4))),128))],512),t("div",{ref_key:"minimapScroller",ref:a,class:"timeline-scroller",absolute:"","inset-0":"","h-full":"","w-full":"","of-x-scroll":""},[t("div",{ref_key:"minimapScrollerInner",ref:r,"h-1px":""},null,512)],512)]),t("div",{ref_key:"scroller",ref:e,relative:"","h-full":"","w-full":"","of-x-scroll":"","of-y-hidden":"","ws-nowrap":"","n-panel-grids":""},[(o(!0),i(y,null,E(k.value,(b,N)=>(o(),i(y,{key:N},[b.previousGap&&b.previousGap>=200?(o(),i("div",Ce,[u($,{op50:"",duration:b.previousGap,color:!1},null,8,["duration"])])):x("",!0),u(M,{"flex-inline":"","of-x-hidden":"","hover:of-x-visible":"","bg-base":"",class:R(N===k.value.length-1?"border-r border-base":""),segment:b,style:T({width:`${Math.max(50,b.duration/10)*c.value}px`}),onSelect:L[0]||(L[0]=I=>n("select",I))},null,8,["class","segment","style"])],64))),128))],512)],64)}}}),we=U(Be,[["__scopeId","data-v-18afc15e"]]),Te={border:"t base",flex:"~ col","h-full":"","of-y-auto":"","text-sm":""},Se=["onClick"],Ne={flex:"~","ml--1":"","font-mono":""},Fe={key:0,mr2:"",op30:""},Ee={op75:""},Le={flex:"~ col items-start"},Ie={"text-xs":"","font-mono":"",op30:""},Me={"text-green":"","font-bold":"","font-mono":""},Ve=B({__name:"TimelineList",props:{data:{}},emits:["select"],setup(f,{emit:d}){const p=d;return(n,e)=>{const l=W;return o(),i("div",Te,[(o(!0),i(y,null,E(n.data.events,(a,r)=>(o(),i("button",{key:r,border:"b base",px3:"",py2:"",flex:"~ items-center gap-2",hover:"bg-active",onClick:s=>p("select",a)},[a.type==="function"?(o(),i(y,{key:0},[e[2]||(e[2]=t("div",{"i-carbon-function":"",op50:""},null,-1)),t("div",{"font-mono":"",style:T({color:a.type==="function"?("getHashColorFromString"in n?n.getHashColorFromString:g(V))(a.name,50,60):""})},m(a.name),5),t("div",Ne,[e[0]||(e[0]=t("div",{op30:""}," ( ",-1)),(o(!0),i(y,null,E(a.args,(s,c)=>(o(),i(y,{key:c},[c?(o(),i("div",Fe," , ")):x("",!0),t("div",Ee,m(s===null?"null":s===void 0?"undefined":typeof s=="function"?"[function]":Array.isArray(s)?"[Array]":typeof s=="object"?"[object]":JSON.stringify(s)),1)],64))),128)),e[1]||(e[1]=t("div",{op30:""}," ) ",-1))])],64)):(o(),i(y,{key:1},[e[3]||(e[3]=t("div",{"mr-1":"","h-7":"","w-7":"",flex:"","rounded-lg":"","bg-primary:5":"",p1:"","text-green6":""},[t("div",{"i-carbon-direction-rotary-right":"",ma:"","text-lg":""})],-1)),t("div",Le,[t("div",Ie,m(a.from),1),t("div",Me,m(a.to),1)])],64)),e[4]||(e[4]=t("div",{"flex-auto":""},null,-1)),a.end?(o(),h(l,{key:2,duration:a.end-a.start,color:a.type==="function"},null,8,["duration","color"])):x("",!0)],8,Se))),128)),e[5]||(e[5]=t("div",{"min-h-100":""},null,-1))])}}}),We={key:0,"text-blue":""},je={key:1,"text-purple":""},Oe={key:2,"text-green":""},ze={key:3,"text-gray":""},Re={key:4,"text-gray":""},Ge={key:5,"text-gray":""},Pe={key:0,"bg-red:10":"",px2:"",py1:"","text-red":""},He={key:1},Je={p2:"","text-sm":"",border:"t base"},Ye=B({__name:"TimelineArgumentView",props:{value:{}},setup(f){const d=f,p=C(),n=C();function e(){try{p.value=JSON.parse(JSON.stringify(d.value))}catch(s){console.error(s),n.value=s}}const l=B({emits:["setup"],setup(s,{emit:c}){return c("setup"),()=>null}}),a=q(),r=K();return(s,c)=>{const k=z,D=P("VMenu");return typeof s.value=="string"?(o(),i("div",We,m(JSON.stringify(s.value)),1)):typeof s.value=="number"?(o(),i("div",je,m(s.value),1)):typeof s.value=="boolean"?(o(),i("div",Oe,m(s.value),1)):typeof s.value>"u"?(o(),i("div",ze," undefined ")):typeof s.value=="function"?(o(),i("div",Re," [Function"+m(s.value.name?`: ${s.value.name}`:"")+"] ",1)):s.value===null?(o(),i("div",Ge," null ")):(o(),h(D,{key:6,placement:"top"},{popper:v(()=>[u(g(l),{onSetup:e}),n.value?(o(),i("div",Pe," Failed to display object: "+m(n.value),1)):p.value?(o(),i("div",He,[u(g(ie),pe({"model-value":p.value},s.$attrs,{class:["json-editor-vue",[g(a)==="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"]),t("div",Je,[u(k,{title:"Copy to clipboard",icon:"carbon-copy",onClick:c[0]||(c[0]=A=>g(r)(JSON.stringify(p.value,null,2),"timeline-argument"))},{default:v(()=>c[1]||(c[1]=[F(" Copy ")])),_:1})])])):x("",!0)]),default:v(()=>[t("span",{"rounded-sm":"",px1:"","py0.5":"","text-sm":"",class:R([Array.isArray(s.value)?"text-amber bg-amber:10":"text-orange bg-orange:10"])},m(Array.isArray(s.value)?`[Array(${s.value.length})]`:"[Object]"),3)]),_:1}))}}}),Ue={key:0,"p-4":"",flex:"~ col gap-2","text-base":""},qe={"mx--1":""},Ke={flex:"~ gap-1","font-mono":""},Xe={key:1},Ze={key:0,op30:""},Qe={flex:"~ gap-1","text-sm":""},es={class:"text-sm text-gray-400"},ss=B({__name:"TimelineDetailsFunction",props:{record:{}},setup(f){const d=f,p=O(()=>d.record.start,{showSecond:!0}),n=X(),e=w(()=>n.value?.metadata),l=w(()=>n.value?.imports.find(a=>a.as===d.record.name));return(a,r)=>{const s=H,c=de,k=Ye,D=W,A=ue;return a.record?(o(),i("div",Ue,[t("div",qe,[u(s,{n:"yellow",textContent:"Function call"})]),t("div",Ke,[l.value?(o(),h(c,{key:0,item:l.value,metadata:e.value,counter:!1,classes:"px2 py1","mx--2":""},null,8,["item","metadata"])):(o(),i("span",Xe,m(a.record.name),1)),r[0]||(r[0]=t("span",{ml1:"",op30:""},"(",-1)),(o(!0),i(y,null,E(a.record.args,(S,_)=>(o(),i(y,{key:_},[_?(o(),i("span",Ze,", ")):x("",!0),u(k,{value:S},null,8,["value"])],64))),128)),r[1]||(r[1]=t("span",{op30:""},")",-1))]),t("div",Qe,[a.record.end?(o(),h(D,{key:0,duration:a.record.end-a.record.start},null,8,["duration"])):x("",!0),r[2]||(r[2]=t("span",{mx1:"",op50:""},"·",-1)),t("div",es,m(g(p)),1)]),a.record.stacktrace?(o(),h(A,{key:0,stacktrace:a.record.stacktrace,class:"text-xs text-gray-400"},null,8,["stacktrace"])):x("",!0)])):x("",!0)}}}),ns={key:0,"p-4":"",flex:"~ col gap-2"},ts={"mx--1":""},os={flex:"~ gap-1 items-center","font-mono":""},as={op50:""},ls={flex:"~ gap-1","text-sm":""},rs={class:"text-sm text-gray-400"},is=B({__name:"TimelineDetailsRoute",props:{record:{}},setup(f){const d=f,p=O(()=>d.record.start,{showSecond:!0});return(n,e)=>{const l=H,a=W;return n.record?(o(),i("div",ns,[t("div",ts,[u(l,{n:"green",textContent:"Route Change"})]),t("div",os,[t("span",as,m(n.record.from),1),e[0]||(e[0]=t("span",{"i-carbon-arrow-right":"",op50:""},null,-1)),t("span",null,m(n.record.to),1)]),t("div",ls,[n.record.end?(o(),h(a,{key:0,duration:n.record.end-n.record.start},null,8,["duration"])):x("",!0),e[1]||(e[1]=t("span",{mx1:"",op50:""},"·",-1)),t("div",rs,m(g(p)),1)])])):x("",!0)}}}),ps={key:0,"h-screen":"","of-hidden":""},cs={"h-screen":"","w-full":"",flex:"","flex-col":""},ds={"h-10":"",flex:"~ gap-2 items-center justify-end",p2:"",px3:""},us={"text-sm":""},ms={"min-h-50":"",px3:"",py2:""},ks=B({__name:"TimelineView",setup(f){const d=Z(),p=C("table"),n=C(),e=w(()=>d.value?.metrics.clientTimeline());function l(){e.value&&(e.value.events=[])}function a(){p.value=p.value==="table"?"list":"table"}return(r,s)=>{const c=P("VTooltip"),k=z,D=we,A=Ve,S=ss,_=is,L=me;return e.value?(o(),i("div",ps,[t("div",cs,[t("div",ds,[u(c,{flex:""},{popper:v(()=>[t("div",us,m(e.value.options.enabled?"Recording...":"Paused"),1)]),default:v(()=>[t("div",{"text-lg":"",class:R(e.value.options.enabled?"i-carbon-radio-button-checked text-primary animate-pulse":"i-carbon-pause-outline op30")},null,2)]),_:1}),e.value.options.enabled?(o(),h(k,{key:1,size:"small",ml1:"","text-sm":"",n:"orange",icon:"i-carbon-stop",onClick:s[1]||(s[1]=$=>e.value.options.enabled=!1)},{default:v(()=>s[6]||(s[6]=[F(" Stop Tracking ")])),_:1})):(o(),h(k,{key:0,size:"small",ml1:"","text-sm":"",n:"primary",icon:"i-carbon-play",onClick:s[0]||(s[0]=$=>e.value.options.enabled=!0)},{default:v(()=>s[5]||(s[5]=[F(" Start Tracking ")])),_:1})),s[7]||(s[7]=t("div",{"flex-auto":""},null,-1)),u(k,{icon:p.value==="table"?"i-carbon-roadmap":"i-carbon-list",class:"ml-2",title:"Toggle View",border:!1,onClick:a},null,8,["icon"]),u(k,{icon:"i-carbon-trash-can","hover-text-red":"",class:"ml-2",border:!1,onClick:l})]),p.value==="table"?(o(),h(D,{key:0,data:{...e.value},onSelect:s[2]||(s[2]=$=>n.value=$.event)},null,8,["data"])):(o(),h(A,{key:1,data:{...e.value},onSelect:s[3]||(s[3]=$=>n.value=$)},null,8,["data"]))]),u(L,{"model-value":!!n.value,"auto-close":"",transition:"bottom",left:"#nuxt-devtools-side-nav",onClose:s[4]||(s[4]=$=>n.value=void 0)},{default:v(()=>[t("div",ms,[n.value?.type==="function"?(o(),h(S,{key:0,record:n.value},null,8,["record"])):n.value?.type==="route"?(o(),h(_,{key:1,record:n.value},null,8,["record"])):x("",!0)])]),_:1},8,["model-value"])])):x("",!0)}}}),fs={class:"markdown-body"},ys={__name:"timeline",setup(f,{expose:d}){return d({frontmatter:{}}),(n,e)=>(o(),i("div",fs,e[0]||(e[0]=[t("h1",null,"Timeline",-1),t("blockquote",{"text-orange":"","bg-orange:10":"",py1:""}," This is an experimental feature ",-1),ce(`<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{a5 as V,M as O,D as j,bk as Y,b as U,R as q,a as K,_ as z,a7 as X,f as Z,bl as Q,K as ee,n as se,L as ne,h as te,r as G,G as oe,B as ae}from"./g3h63aw5.js";import{_ as W}from"./duration-display.vue-gu7el5x3.js";import{p as B,q as w,U as o,W as i,X as t,$ as T,a8 as m,u as g,F as y,ae as E,P as h,f as C,j as le,n as re,Z as x,a3 as u,a0 as R,V as P,a2 as v,ax as ie,a4 as pe,a9 as F,aj as ce}from"./vendor/json-editor-vue-npezbdce.js";import{_ as H}from"./nbadge-inu2cbym.js";import{_ as de}from"./composable-item.vue-o29ru8an.js";import{_ as ue}from"./stacktrace-list.vue-b1n0lhud.js";import{_ as me}from"./ndrawer.vue-nv73yu3i.js";import{_ as ke}from"./launch-page.vue-c4udrikr.js";import{_ as fe}from"./nlink.vue-ncsjb1ly.js";import{_ as ye}from"./code-diff.vue-gy1k04x9.js";import{_ as he}from"./help-fab.vue-lv824f8h.js";import"./vendor/unocss-hjqyvvq7.js";import"./vendor/shiki-ian6uf3s.js";import"./nmarkdown.vue-oxfi26vk.js";import"./client-edufhzwa.js";import"./filepath-item.vue-i51hnv27.js";import"./index-obsucz0g.js";import"./constants-b32h69zq.js";import"./ncode-block.vue-msaaoy71.js";const ve=B({__name:"TimelineItemFunction",props:{item:{}},setup(f){const d=f,p=w(()=>V(d.item.name,50,60,"_op_")),n=w(()=>p.value.replace(/_op_/,"1")),e=w(()=>V(d.item.name,50,40)),l=w(()=>p.value.replace(/_op_/,"0.2"));return(a,r)=>(o(),i("button",{class:"group",style:T({color:n.value,borderLeft:`2px solid ${n.value}`}),relative:"","text-sm":"",transition:"","hover:z-1000":"","bg-base":""},[t("div",{style:T({backgroundColor:l.value}),absolute:"","bottom-0":"","left--1px":"","top-0":"","w-full":"","text-sm":"","transition-all":"","duration-300":""},null,4),t("div",{style:T({color:e.value,"--c":n.value}),border:"r-2 t-2 y-2 transparent","min-w-max":"",px1:"","text-left":"","group-hover":"border-$c"},m(a.item.name),5)],4))}}),_e={relative:"","h-full":""},be={absolute:"","left-2":"","top-2.3em":"","text-xs":"",op50:""},ge=B({__name:"TimelineSegment",props:{segment:{}},emits:["select"],setup(f,{emit:d}){const p=f,n=d,e=O(()=>p.segment.start,{updateInterval:1e3,showSecond:!0,controls:!1,messages:{justNow:"",past:l=>l,future:l=>l,invalid:"-",second:l=>l?`${l}s`:"",minute:l=>`${l}m`,hour:l=>`${l}h`,week:l=>`${l}w`,day:l=>`${l}d`,month:l=>`${l}mo`,year:l=>`${l}y`}});return(l,a)=>{const r=ve;return o(),i("div",_e,[t("button",{absolute:"","left-0":"","right-0":"","top-0":"","bg-green:5":"",px2:"",py1:"","text-left":"","text-xs":"","text-green6":"","font-mono":"",onClick:a[0]||(a[0]=s=>l.segment.route?n("select",l.segment.route):void 0)},m(l.segment.route?.event.to),1),t("div",be,m(g(e))+" ago ",1),t("div",null,[(o(!0),i(y,null,E(l.segment.functions,(s,c)=>(o(),h(r,{key:c,item:s.event,style:T({position:"absolute",minWidth:`${s.relativeWidth*100}%`,maxWidth:`${s.relativeWidth*100}%`,top:`${4+s.layer*1.6}em`,left:`${s.relativeStart*100}%`}),onClick:k=>n("select",s)},null,8,["item","style","onClick"]))),128))])])}}}),xe=3e3,De=50;function Ae(f){const d=[];let p={start:0,end:0,events:[],functions:[],duration:0};for(const n of f){const e=n.end||n.start;(n.start-p.end>xe||n.type==="route")&&(p={start:n.start,end:e,events:[],functions:[],duration:0},d.push(p)),p.events.push(n),p.end=e+De}return d.forEach((n,e)=>{const l=n.end-n.start,a=[];n.duration=l,n.previousGap=e>0?n.start-d[e-1].end:0,n.events.forEach(r=>{const s=r.end||r.start;let c=0;r.type!=="route"&&(c=a.findIndex(D=>D<=r.start),c===-1?(c=a.length,a.push(s+1e3)):a[c]=s+1e3);const k={event:r,segment:n,relativeStart:(r.start-n.start)/l,relativeWidth:(s-r.start)/l,layer:c};r.type==="function"?n.functions.push(k):n.route=k})}),d}const $e={relative:""},Ce={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":""},Be=B({__name:"TimelineTable",props:{data:{}},emits:["select"],setup(f,{emit:d}){const p=f,n=d,e=C(),l=C(),a=C(),r=C(),s=C(!0),c=C(1.5),k=w(()=>Ae(p.data.events)),D=w(()=>(p.data.events.length,e.value?.scrollWidth||window.innerWidth));function A(){r.value&&(r.value.style.width=`${D.value}px`)}function S(){s.value&&e.value&&(e.value.scrollTo({left:e.value.scrollWidth-e.value.clientWidth,behavior:"smooth"}),a.value.scrollTo({left:e.value.scrollWidth-e.value.clientWidth,behavior:"smooth"}))}return le(()=>p.data.events.length,async()=>{await re(),A(),S()},{flush:"post"}),j(e,"scroll",()=>{a.value.scrollLeft!==e.value.scrollLeft&&(A(),a.value.scrollLeft=e.value.scrollLeft,s.value=e.value.scrollLeft>=e.value.scrollWidth-e.value.clientWidth)}),j(a,"scroll",()=>{a.value.scrollLeft!==e.value.scrollLeft&&(A(),e.value.scrollLeft=a.value.scrollLeft)}),j(e,"wheel",_=>{_.altKey?(c.value=Y(c.value+_.deltaY/200,.5,3),A()):e.value.scrollLeft+=_.deltaY}),(_,L)=>{const $=W,M=ge;return o(),i(y,null,[t("div",$e,[t("div",{ref_key:"minimap",ref:l,border:"t b base",relative:"","h-50px":"","ws-nowrap":"","border-base":""},[(o(!0),i(y,null,E(k.value,(b,N)=>(o(),i("div",{key:N,relative:"","h-full":"","flex-inline":"",style:T({width:`${Math.max(100,b.duration/10)/D.value*100}%`})},[(o(!0),i(y,null,E(b.functions,(I,J)=>(o(),i("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 _?_.getHashColorFromString:g(V))(I.event.name,50,60)})},null,4))),128)),b.route?(o(),i("div",{key:0,absolute:"","top-0":"","h-full":"","w-px":"","border-l":"","border-green6":"",op10:"",style:T({left:`${b.route.relativeStart*100}%`})},null,4)):x("",!0)],4))),128))],512),t("div",{ref_key:"minimapScroller",ref:a,class:"timeline-scroller",absolute:"","inset-0":"","h-full":"","w-full":"","of-x-scroll":""},[t("div",{ref_key:"minimapScrollerInner",ref:r,"h-1px":""},null,512)],512)]),t("div",{ref_key:"scroller",ref:e,relative:"","h-full":"","w-full":"","of-x-scroll":"","of-y-hidden":"","ws-nowrap":"","n-panel-grids":""},[(o(!0),i(y,null,E(k.value,(b,N)=>(o(),i(y,{key:N},[b.previousGap&&b.previousGap>=200?(o(),i("div",Ce,[u($,{op50:"",duration:b.previousGap,color:!1},null,8,["duration"])])):x("",!0),u(M,{"flex-inline":"","of-x-hidden":"","hover:of-x-visible":"","bg-base":"",class:R(N===k.value.length-1?"border-r border-base":""),segment:b,style:T({width:`${Math.max(50,b.duration/10)*c.value}px`}),onSelect:L[0]||(L[0]=I=>n("select",I))},null,8,["class","segment","style"])],64))),128))],512)],64)}}}),we=U(Be,[["__scopeId","data-v-18afc15e"]]),Te={border:"t base",flex:"~ col","h-full":"","of-y-auto":"","text-sm":""},Se=["onClick"],Ne={flex:"~","ml--1":"","font-mono":""},Fe={key:0,mr2:"",op30:""},Ee={op75:""},Le={flex:"~ col items-start"},Ie={"text-xs":"","font-mono":"",op30:""},Me={"text-green":"","font-bold":"","font-mono":""},Ve=B({__name:"TimelineList",props:{data:{}},emits:["select"],setup(f,{emit:d}){const p=d;return(n,e)=>{const l=W;return o(),i("div",Te,[(o(!0),i(y,null,E(n.data.events,(a,r)=>(o(),i("button",{key:r,border:"b base",px3:"",py2:"",flex:"~ items-center gap-2",hover:"bg-active",onClick:s=>p("select",a)},[a.type==="function"?(o(),i(y,{key:0},[e[2]||(e[2]=t("div",{"i-carbon-function":"",op50:""},null,-1)),t("div",{"font-mono":"",style:T({color:a.type==="function"?("getHashColorFromString"in n?n.getHashColorFromString:g(V))(a.name,50,60):""})},m(a.name),5),t("div",Ne,[e[0]||(e[0]=t("div",{op30:""}," ( ",-1)),(o(!0),i(y,null,E(a.args,(s,c)=>(o(),i(y,{key:c},[c?(o(),i("div",Fe," , ")):x("",!0),t("div",Ee,m(s===null?"null":s===void 0?"undefined":typeof s=="function"?"[function]":Array.isArray(s)?"[Array]":typeof s=="object"?"[object]":JSON.stringify(s)),1)],64))),128)),e[1]||(e[1]=t("div",{op30:""}," ) ",-1))])],64)):(o(),i(y,{key:1},[e[3]||(e[3]=t("div",{"mr-1":"","h-7":"","w-7":"",flex:"","rounded-lg":"","bg-primary:5":"",p1:"","text-green6":""},[t("div",{"i-carbon-direction-rotary-right":"",ma:"","text-lg":""})],-1)),t("div",Le,[t("div",Ie,m(a.from),1),t("div",Me,m(a.to),1)])],64)),e[4]||(e[4]=t("div",{"flex-auto":""},null,-1)),a.end?(o(),h(l,{key:2,duration:a.end-a.start,color:a.type==="function"},null,8,["duration","color"])):x("",!0)],8,Se))),128)),e[5]||(e[5]=t("div",{"min-h-100":""},null,-1))])}}}),We={key:0,"text-blue":""},je={key:1,"text-purple":""},Oe={key:2,"text-green":""},ze={key:3,"text-gray":""},Re={key:4,"text-gray":""},Ge={key:5,"text-gray":""},Pe={key:0,"bg-red:10":"",px2:"",py1:"","text-red":""},He={key:1},Je={p2:"","text-sm":"",border:"t base"},Ye=B({__name:"TimelineArgumentView",props:{value:{}},setup(f){const d=f,p=C(),n=C();function e(){try{p.value=JSON.parse(JSON.stringify(d.value))}catch(s){console.error(s),n.value=s}}const l=B({emits:["setup"],setup(s,{emit:c}){return c("setup"),()=>null}}),a=q(),r=K();return(s,c)=>{const k=z,D=P("VMenu");return typeof s.value=="string"?(o(),i("div",We,m(JSON.stringify(s.value)),1)):typeof s.value=="number"?(o(),i("div",je,m(s.value),1)):typeof s.value=="boolean"?(o(),i("div",Oe,m(s.value),1)):typeof s.value>"u"?(o(),i("div",ze," undefined ")):typeof s.value=="function"?(o(),i("div",Re," [Function"+m(s.value.name?`: ${s.value.name}`:"")+"] ",1)):s.value===null?(o(),i("div",Ge," null ")):(o(),h(D,{key:6,placement:"top"},{popper:v(()=>[u(g(l),{onSetup:e}),n.value?(o(),i("div",Pe," Failed to display object: "+m(n.value),1)):p.value?(o(),i("div",He,[u(g(ie),pe({"model-value":p.value},s.$attrs,{class:["json-editor-vue",[g(a)==="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"]),t("div",Je,[u(k,{title:"Copy to clipboard",icon:"carbon-copy",onClick:c[0]||(c[0]=A=>g(r)(JSON.stringify(p.value,null,2),"timeline-argument"))},{default:v(()=>c[1]||(c[1]=[F(" Copy ")])),_:1})])])):x("",!0)]),default:v(()=>[t("span",{"rounded-sm":"",px1:"","py0.5":"","text-sm":"",class:R([Array.isArray(s.value)?"text-amber bg-amber:10":"text-orange bg-orange:10"])},m(Array.isArray(s.value)?`[Array(${s.value.length})]`:"[Object]"),3)]),_:1}))}}}),Ue={key:0,"p-4":"",flex:"~ col gap-2","text-base":""},qe={"mx--1":""},Ke={flex:"~ gap-1","font-mono":""},Xe={key:1},Ze={key:0,op30:""},Qe={flex:"~ gap-1","text-sm":""},es={class:"text-sm text-gray-400"},ss=B({__name:"TimelineDetailsFunction",props:{record:{}},setup(f){const d=f,p=O(()=>d.record.start,{showSecond:!0}),n=X(),e=w(()=>n.value?.metadata),l=w(()=>n.value?.imports.find(a=>a.as===d.record.name));return(a,r)=>{const s=H,c=de,k=Ye,D=W,A=ue;return a.record?(o(),i("div",Ue,[t("div",qe,[u(s,{n:"yellow",textContent:"Function call"})]),t("div",Ke,[l.value?(o(),h(c,{key:0,item:l.value,metadata:e.value,counter:!1,classes:"px2 py1","mx--2":""},null,8,["item","metadata"])):(o(),i("span",Xe,m(a.record.name),1)),r[0]||(r[0]=t("span",{ml1:"",op30:""},"(",-1)),(o(!0),i(y,null,E(a.record.args,(S,_)=>(o(),i(y,{key:_},[_?(o(),i("span",Ze,", ")):x("",!0),u(k,{value:S},null,8,["value"])],64))),128)),r[1]||(r[1]=t("span",{op30:""},")",-1))]),t("div",Qe,[a.record.end?(o(),h(D,{key:0,duration:a.record.end-a.record.start},null,8,["duration"])):x("",!0),r[2]||(r[2]=t("span",{mx1:"",op50:""},"·",-1)),t("div",es,m(g(p)),1)]),a.record.stacktrace?(o(),h(A,{key:0,stacktrace:a.record.stacktrace,class:"text-xs text-gray-400"},null,8,["stacktrace"])):x("",!0)])):x("",!0)}}}),ns={key:0,"p-4":"",flex:"~ col gap-2"},ts={"mx--1":""},os={flex:"~ gap-1 items-center","font-mono":""},as={op50:""},ls={flex:"~ gap-1","text-sm":""},rs={class:"text-sm text-gray-400"},is=B({__name:"TimelineDetailsRoute",props:{record:{}},setup(f){const d=f,p=O(()=>d.record.start,{showSecond:!0});return(n,e)=>{const l=H,a=W;return n.record?(o(),i("div",ns,[t("div",ts,[u(l,{n:"green",textContent:"Route Change"})]),t("div",os,[t("span",as,m(n.record.from),1),e[0]||(e[0]=t("span",{"i-carbon-arrow-right":"",op50:""},null,-1)),t("span",null,m(n.record.to),1)]),t("div",ls,[n.record.end?(o(),h(a,{key:0,duration:n.record.end-n.record.start},null,8,["duration"])):x("",!0),e[1]||(e[1]=t("span",{mx1:"",op50:""},"·",-1)),t("div",rs,m(g(p)),1)])])):x("",!0)}}}),ps={key:0,"h-screen":"","of-hidden":""},cs={"h-screen":"","w-full":"",flex:"","flex-col":""},ds={"h-10":"",flex:"~ gap-2 items-center justify-end",p2:"",px3:""},us={"text-sm":""},ms={"min-h-50":"",px3:"",py2:""},ks=B({__name:"TimelineView",setup(f){const d=Z(),p=C("table"),n=C(),e=w(()=>d.value?.metrics.clientTimeline());function l(){e.value&&(e.value.events=[])}function a(){p.value=p.value==="table"?"list":"table"}return(r,s)=>{const c=P("VTooltip"),k=z,D=we,A=Ve,S=ss,_=is,L=me;return e.value?(o(),i("div",ps,[t("div",cs,[t("div",ds,[u(c,{flex:""},{popper:v(()=>[t("div",us,m(e.value.options.enabled?"Recording...":"Paused"),1)]),default:v(()=>[t("div",{"text-lg":"",class:R(e.value.options.enabled?"i-carbon-radio-button-checked text-primary animate-pulse":"i-carbon-pause-outline op30")},null,2)]),_:1}),e.value.options.enabled?(o(),h(k,{key:1,size:"small",ml1:"","text-sm":"",n:"orange",icon:"i-carbon-stop",onClick:s[1]||(s[1]=$=>e.value.options.enabled=!1)},{default:v(()=>s[6]||(s[6]=[F(" Stop Tracking ")])),_:1})):(o(),h(k,{key:0,size:"small",ml1:"","text-sm":"",n:"primary",icon:"i-carbon-play",onClick:s[0]||(s[0]=$=>e.value.options.enabled=!0)},{default:v(()=>s[5]||(s[5]=[F(" Start Tracking ")])),_:1})),s[7]||(s[7]=t("div",{"flex-auto":""},null,-1)),u(k,{icon:p.value==="table"?"i-carbon-roadmap":"i-carbon-list",class:"ml-2",title:"Toggle View",border:!1,onClick:a},null,8,["icon"]),u(k,{icon:"i-carbon-trash-can","hover-text-red":"",class:"ml-2",border:!1,onClick:l})]),p.value==="table"?(o(),h(D,{key:0,data:{...e.value},onSelect:s[2]||(s[2]=$=>n.value=$.event)},null,8,["data"])):(o(),h(A,{key:1,data:{...e.value},onSelect:s[3]||(s[3]=$=>n.value=$)},null,8,["data"]))]),u(L,{"model-value":!!n.value,"auto-close":"",transition:"bottom",left:"#nuxt-devtools-side-nav",onClose:s[4]||(s[4]=$=>n.value=void 0)},{default:v(()=>[t("div",ms,[n.value?.type==="function"?(o(),h(S,{key:0,record:n.value},null,8,["record"])):n.value?.type==="route"?(o(),h(_,{key:1,record:n.value},null,8,["record"])):x("",!0)])]),_:1},8,["model-value"])])):x("",!0)}}}),fs={class:"markdown-body"},ys={__name:"timeline",setup(f,{expose:d}){return d({frontmatter:{}}),(n,e)=>(o(),i("div",fs,e[0]||(e[0]=[t("h1",null,"Timeline",-1),t("blockquote",{"text-orange":"","bg-orange:10":"",py1:""}," This is an experimental feature ",-1),ce(`<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;"> useRoute</span><span style="color:#999999;--shiki-dark:#666666;"> }</span><span style="color:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="color:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">#app/composables/router</span><span style="color:#B5695977;--shiki-dark:#C98A7D77;">'</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:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">#imports</span><span style="color:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
4
4
|
<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:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">@vueuse/core</span><span style="color:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,k as s}from"./vendor/unocss-
|
|
1
|
+
import{g as e,k as s}from"./vendor/unocss-hjqyvvq7.js";import"./vendor/json-editor-vue-npezbdce.js";e({defaults:{presets:[s({prefix:["i-",""],collections:{},cdn:"https://esm.sh/",scale:1.2,extraProperties:{display:"inline-block","vertical-align":"middle"}})]},bypassDefined:!0});
|