@vitejs/devtools 0.1.10 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/{DockStandalone-CX4RwLuJ.js → DockStandalone-kfuGuU1K.js} +128 -21
  2. package/dist/{LogItem-Ca0SsU39.js → LogItem-DOamSzjc.js} +1 -1
  3. package/dist/{ViewBuiltinLogs-B_CLlali.js → ViewBuiltinLogs-BW-Z3LV1.js} +35 -25
  4. package/dist/{ViewBuiltinTerminals-ZrMObMte.js → ViewBuiltinTerminals-D_aHYGk9.js} +1 -1
  5. package/dist/{ViewJsonRender-Cc5BPfnv.js → ViewJsonRender-BlN5HDyU.js} +1 -1
  6. package/dist/{build-static-Cb3vKjJS.js → build-static-SRf6Mx0K.js} +4 -4
  7. package/dist/cli-commands.js +8 -5
  8. package/dist/client/inject.js +3 -3
  9. package/dist/client/standalone/assets/DockIcon-Bn9P0BA3.js +1 -0
  10. package/dist/client/standalone/assets/DockStandalone-BNVMXM6t.js +3 -0
  11. package/dist/client/standalone/assets/DockStandalone-GABFNqKk.js +1 -0
  12. package/dist/client/standalone/assets/{LogItem-BnVhub2j.js → LogItem-B2zhdfw_.js} +1 -1
  13. package/dist/client/standalone/assets/ViewBuiltinLogs-Bv93zOX9.js +1 -0
  14. package/dist/client/standalone/assets/{ViewBuiltinTerminals-DqaYBA6Q.js → ViewBuiltinTerminals-DPB8d-Q0.js} +4 -4
  15. package/dist/client/standalone/assets/{ViewJsonRender-De5eeIha.js → ViewJsonRender-CSnziLMr.js} +1 -1
  16. package/dist/client/standalone/assets/dist-DIiIv9-S.js +5 -0
  17. package/dist/client/standalone/assets/index-C05Px9az.css +1 -0
  18. package/dist/client/standalone/assets/index-C9nheAgG.js +1 -0
  19. package/dist/client/standalone/assets/runtime-core.esm-bundler-Dfaj58fA.js +1 -0
  20. package/dist/client/standalone/index.html +8 -6
  21. package/dist/client/webcomponents.js +3 -3
  22. package/dist/{context-BWju7fup.js → context-WJ5shSfy.js} +564 -506
  23. package/dist/{dist-CCdqIez-.js → dist-DD29zy1v.js} +390 -5
  24. package/dist/index.d.ts +90 -87
  25. package/dist/index.js +3 -3
  26. package/dist/{plugins-Dhpm6Ql_.js → plugins-D8NH18dj.js} +6 -4
  27. package/dist/{popup-DgYOsFy3.js → popup-D4DzCx7h.js} +1 -1
  28. package/dist/{server-DSh-GQIq.js → server-CE1QMUPY.js} +4 -4
  29. package/dist/server-Cz5aS6Hb.js +2 -0
  30. package/dist/{server-ZWEvQMOm.js → server-kLW_T-bo.js} +3 -3
  31. package/dist/{standalone-D_6Gsoqw.js → standalone-eqACht_F.js} +2 -2
  32. package/package.json +17 -14
  33. package/dist/client/standalone/assets/DockStandalone-BvXvOkmY.js +0 -1
  34. package/dist/client/standalone/assets/ViewBuiltinLogs-rU-E-8qT.js +0 -1
  35. package/dist/client/standalone/assets/dist-CAaP5Isp.js +0 -1
  36. package/dist/client/standalone/assets/index-2_yFTdkG.js +0 -3
  37. package/dist/client/standalone/assets/index-DtZFMvER.css +0 -1
  38. package/dist/client/standalone/assets/runtime-core.esm-bundler-Bvz2jy0O.js +0 -1
  39. package/dist/server-BQ4s1VXj.js +0 -2
  40. /package/dist/client/standalone/assets/{iconify-C-CPDXMf.js → iconify-DTCjcGxu.js} +0 -0
@@ -0,0 +1 @@
1
+ import{$ as e,C as t,E as n,K as r,L as i,O as a,P as ee,R as te,_t as o,a as s,c,f as l,h as u,l as d,n as f,o as p,p as m,s as h,vt as g,yt as _}from"./runtime-core.esm-bundler-Dfaj58fA.js";import{a as v,h as ne,i as y,n as b,o as re,p as ie,r as x,s as ae,t as oe}from"./LogItem-B2zhdfw_.js";import{n as se,o as ce}from"./dist-DIiIv9-S.js";var S={class:`text-xs op40`},C={class:`flex flex-wrap items-center gap-0.5`},w=[`onClick`],T=u({__name:`FilterToggles`,props:{label:{},items:{},active:{},styles:{},hashColor:{type:Function}},emits:[`toggle`],setup(e){return(t,r)=>(n(),d(f,null,[p(`span`,S,_(e.label),1),p(`div`,C,[(n(!0),d(f,null,a(e.items,r=>(n(),d(`button`,{key:r,class:o([`px-1.5 py-0.5 rounded text-xs flex items-center gap-0.5 hover:bg-active transition`,[e.active.size===0||e.active.has(r)?e.styles?.[r]?.color||``:`op30`]]),style:g(!e.styles?.[r]?.color&&e.hashColor?{color:e.active.size===0||e.active.has(r)?e.hashColor(r,1):void 0,backgroundColor:e.active.size===0||e.active.has(r)?e.hashColor(r,.1):void 0}:void 0),onClick:e=>t.$emit(`toggle`,r)},[e.styles?.[r]?.icon?(n(),d(`div`,{key:0,class:o([e.styles[r].icon,`w-3.5 h-3.5`])},null,2)):c(``,!0),p(`span`,null,_(e.styles?.[r]?.label||r),1)],14,w))),128))])],64))}}),le={class:`w-full h-full grid grid-rows-[max-content_1fr]`},ue={class:`border-base border-b p3 flex flex-col gap-2`},de={class:`flex items-center gap-1`},fe=[`title`],pe={key:0,class:`text-xs op40`},me={key:2,class:`border-l border-base h-4 mx-0.5`},he={class:`flex flex-wrap items-center gap-1`},ge={class:`h-full of-y-auto`},_e={key:0,class:`flex items-center justify-center h-full op50 text-sm`},E=[`onClick`],D=[`onClick`],O={key:0,class:`h-full of-y-auto border-l border-base p-4`},k={class:`flex items-start gap-2 mb-3`},A={class:`flex-1`},j={class:`font-medium text-lg`},M={class:`flex flex-wrap items-center gap-2 mb-3 text-xs`},N={class:`capitalize`},P={key:1,class:`flex items-center gap-1 text-amber`},F=[`title`],I={key:2,class:`flex items-center gap-0.5 op40`},ve={key:0,class:`text-sm op80 mb-3 whitespace-pre-wrap`},ye={key:1,class:`flex flex-wrap gap-1 mb-3`},be={key:3,class:`text-sm mb-3 bg-gray/5 rounded p-2`},xe={key:0,class:`font-mono text-xs`},Se={key:1,class:`text-xs op70 mt-1`},Ce={key:2,class:`text-xs op50 mt-1 font-mono`},we={key:4,class:`mb-3`},Te={class:`group relative`},Ee={class:`text-xs bg-gray/5 rounded p-2 of-x-auto whitespace-pre-wrap font-mono`},De={key:5,class:`flex flex-wrap gap-3 mb-3 text-xs op50`},Oe={key:0,class:`flex items-center gap-1`},ke={key:1,class:`flex items-center gap-1`},Ae={class:`flex flex-col gap-1 mb-3 text-xs op40 font-mono border-t border-base pt-3`},L=u({__name:`ViewBuiltinLogs`,props:{context:{}},setup(u){let g=u;function S(e){return new Date(e).toLocaleTimeString()}let C=ae(g.context),w=Object.keys(v),L=Object.keys(x),je={newest:`Newest first`,oldest:`Oldest first`,level:`By severity`},Me={newest:`i-ph:sort-descending-duotone`,oldest:`i-ph:sort-ascending-duotone`,level:`i-ph:warning-diamond-duotone`},R=r(``),z=r(null),B=r(new Set),V=r(new Set),H=r(new Set),U=r(new Set),W=r(`newest`),G=[`newest`,`oldest`,`level`];function Ne(){W.value=G[(G.indexOf(W.value)+1)%G.length]}let K={error:0,warn:1,info:2,success:3,debug:4};function Pe(e){let t=B.value;t.has(e)?t.delete(e):t.add(e)}function Fe(e){let t=V.value;t.has(e)?t.delete(e):t.add(e)}function Ie(e){let t=H.value;t.has(e)?t.delete(e):t.add(e)}function Le(e){let t=U.value;t.has(e)?t.delete(e):t.add(e)}let q=s(()=>B.value.size>0||V.value.size>0||H.value.size>0||U.value.size>0||R.value.length>0);function Re(){B.value.clear(),V.value.clear(),H.value.clear(),U.value.clear(),R.value=``}let J=s(()=>{let e=new Set;for(let t of C.entries)if(t.labels)for(let n of t.labels)e.add(n);return Array.from(e).sort()}),Y=s(()=>{let e=new Set;for(let t of C.entries)t.category&&e.add(t.category);return Array.from(e).sort()}),X=s(()=>{let e=C.entries;if(B.value.size>0&&(e=e.filter(e=>B.value.has(e.level))),V.value.size>0&&(e=e.filter(e=>e.labels?.some(e=>V.value.has(e)))),H.value.size>0&&(e=e.filter(e=>H.value.has(e.from))),U.value.size>0&&(e=e.filter(e=>e.category&&U.value.has(e.category))),R.value){let t=R.value.toLowerCase();e=e.filter(e=>e.message.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)||e.from?.toLowerCase().includes(t)||e.category?.toLowerCase().includes(t)||e.labels?.some(e=>e.toLowerCase().includes(t)))}return W.value===`oldest`?[...e]:W.value===`level`?e.toSorted((e,t)=>K[e.level]-K[t.level]):e.toReversed()}),Z=s(()=>z.value?C.entries.find(e=>e.id===z.value)??null:null);ee(Z,async e=>{e?.autoDelete&&await g.context.rpc.call(`devtoolskit:internal:logs:update`,e.id,{autoDelete:0})});let Q=ce(s(()=>Z.value?.timestamp??Date.now())),{copy:ze,copied:Be}=se();async function Ve(e){if(!e.filePosition)return;let{file:t,line:n,column:r}=e.filePosition,i=t;n&&(i+=`:${n}`),r&&(i+=`:${r}`),await g.context.rpc.call(`vite:core:open-in-editor`,i)}async function He(){await g.context.rpc.call(`devtoolskit:internal:logs:clear`),z.value=null}async function $(e){await g.context.rpc.call(`devtoolskit:internal:logs:remove`,e),z.value===e&&(z.value=null)}async function Ue(){let e=X.value.map(e=>e.id);for(let t of e)await g.context.rpc.call(`devtoolskit:internal:logs:remove`,t);z.value=null}return t(()=>{re()}),(t,r)=>(n(),d(`div`,le,[p(`div`,ue,[p(`div`,de,[te(p(`input`,{"onUpdate:modelValue":r[0]||=e=>R.value=e,type:`text`,placeholder:`Search logs...`,class:`bg-transparent border border-base rounded px-2 py-0.5 text-xs w-48 outline-none focus:border-purple`},null,512),[[ie,R.value]]),p(`button`,{class:`flex items-center gap-0.5 op50 hover:op100 p-1 rounded hover:bg-active transition`,title:je[W.value],onClick:Ne},[p(`div`,{class:o([Me[W.value],`w-4 h-4`])},null,2)],8,fe),r[8]||=p(`div`,{class:`flex-1`},null,-1),X.value.length===e(C).entries.length?c(``,!0):(n(),d(`span`,pe,_(X.value.length)+`/`+_(e(C).entries.length),1)),q.value?(n(),d(`button`,{key:1,class:`text-xs op50 hover:op100 px-1.5 py-0.5 hover:bg-active rounded transition flex items-center gap-0.5`,title:`Reset all filters`,onClick:Re},[...r[5]||=[p(`div`,{class:`i-ph:funnel-x-duotone w-3.5 h-3.5`},null,-1),l(` Reset Filters `,-1)]])):c(``,!0),q.value?(n(),d(`div`,me)):c(``,!0),q.value&&X.value.length>0?(n(),d(`button`,{key:3,class:`text-xs op50 hover:op100 px-1.5 py-0.5 hover:bg-active rounded transition flex items-center gap-0.5`,title:`Dismiss all matching the current filter`,onClick:Ue},[...r[6]||=[p(`div`,{class:`i-ph:trash-duotone w-3.5 h-3.5`},null,-1),l(` Dismiss filtered `,-1)]])):c(``,!0),!q.value&&e(C).entries.length>0?(n(),d(`button`,{key:4,class:`text-xs op50 hover:op100 px-1.5 py-0.5 hover:bg-active rounded transition flex items-center gap-0.5`,title:`Dismiss all logs`,onClick:He},[...r[7]||=[p(`div`,{class:`i-ph:trash-duotone w-3.5 h-3.5`},null,-1),l(` Dismiss all `,-1)]])):c(``,!0)]),p(`div`,he,[m(T,{label:`Level`,items:e(w),active:B.value,styles:e(v),onToggle:Pe},null,8,[`items`,`active`,`styles`]),r[11]||=p(`div`,{class:`border-l border-base h-4 mx-0.5`},null,-1),m(T,{label:`From`,items:e(L),active:H.value,styles:e(x),onToggle:Ie},null,8,[`items`,`active`,`styles`,`onToggle`]),Y.value.length>0?(n(),d(f,{key:0},[r[9]||=p(`div`,{class:`border-l border-base h-4 mx-1`},null,-1),m(T,{label:`Category`,items:Y.value,active:U.value,"hash-color":e(y),onToggle:Le},null,8,[`items`,`active`,`hash-color`])],64)):c(``,!0),J.value.length>0?(n(),d(f,{key:1},[r[10]||=p(`div`,{class:`border-l border-base h-4 mx-1`},null,-1),m(T,{label:`Labels`,items:J.value,active:V.value,"hash-color":e(y),onToggle:Fe},null,8,[`items`,`active`,`hash-color`])],64)):c(``,!0)])]),p(`div`,{class:o([`h-full of-hidden`,Z.value?`grid grid-cols-[1fr_1fr]`:``])},[p(`div`,ge,[X.value.length===0?(n(),d(`div`,_e,` No logs `)):c(``,!0),(n(!0),d(f,null,a(X.value,e=>(n(),d(`div`,{key:e.id,class:o([`w-full text-left border-b border-base hover:bg-active transition border-l-2 text-sm group cursor-pointer`,[z.value===e.id?`bg-active`:``]]),onClick:t=>z.value=z.value===e.id?null:e.id},[m(oe,{entry:e,class:`px-3 py-2.5`},{actions:i(()=>[p(`button`,{class:`op0 group-hover:op50 hover:op100! p-0.5 rounded hover:bg-active flex-none`,title:`Dismiss`,onClick:ne(t=>$(e.id),[`stop`])},[...r[12]||=[p(`div`,{class:`i-ph-trash-duotone w-3 h-3`},null,-1)]],8,D)]),_:2},1032,[`entry`])],10,E))),128))]),Z.value?(n(),d(`div`,O,[p(`div`,k,[p(`div`,A,[p(`div`,j,_(Z.value.message),1)]),p(`button`,{class:`op50 hover:op100 p-1`,title:`Dismiss`,onClick:r[1]||=e=>$(Z.value.id)},[...r[13]||=[p(`div`,{class:`i-ph-trash-duotone w-4 h-4`},null,-1)]]),p(`button`,{class:`op50 hover:op100 p-1`,title:`Close detail`,onClick:r[2]||=e=>z.value=null},[...r[14]||=[p(`div`,{class:`i-ph-x w-4 h-4`},null,-1)]])]),p(`div`,M,[p(`span`,{class:o([`flex items-center gap-1`,e(v)[Z.value.level].color])},[p(`div`,{class:o([e(v)[Z.value.level].icon,`w-3.5 h-3.5`])},null,2),p(`span`,N,_(Z.value.level),1)],2),e(x)[Z.value.from]?(n(),d(`span`,{key:0,class:o([`flex items-center gap-1`,e(x)[Z.value.from].color])},[p(`div`,{class:o([e(x)[Z.value.from].icon,`w-3.5 h-3.5`])},null,2),l(` `+_(e(x)[Z.value.from].label),1)],2)):c(``,!0),Z.value.status===`loading`?(n(),d(`span`,P,[...r[15]||=[p(`div`,{class:`w-3 h-3 border-1.5 border-current border-t-transparent rounded-full animate-spin`},null,-1),l(` Loading `,-1)]])):c(``,!0),p(`span`,{class:`op40`,title:S(Z.value.timestamp)},_(e(Q)),9,F),Z.value.notify?(n(),d(`span`,I,[...r[16]||=[p(`div`,{class:`i-ph:bell-duotone w-3.5 h-3.5`},null,-1),l(` notify `,-1)]])):c(``,!0)]),Z.value.description?(n(),d(`div`,ve,_(Z.value.description),1)):c(``,!0),Z.value.category||Z.value.labels&&Z.value.labels.length?(n(),d(`div`,ye,[Z.value.category?(n(),h(b,{key:0,label:Z.value.category},null,8,[`label`])):c(``,!0),(n(!0),d(f,null,a(Z.value.labels,e=>(n(),h(b,{key:e,label:e},null,8,[`label`]))),128))])):c(``,!0),Z.value.filePosition?(n(),d(`button`,{key:2,class:`flex items-center gap-1.5 text-sm text-blue hover:underline mb-3`,onClick:r[3]||=e=>Ve(Z.value)},[r[17]||=p(`div`,{class:`i-ph:file-code-duotone w-4 h-4`},null,-1),p(`span`,null,[l(_(Z.value.filePosition.file),1),Z.value.filePosition.line?(n(),d(f,{key:0},[l(`:`+_(Z.value.filePosition.line),1)],64)):c(``,!0),Z.value.filePosition.column?(n(),d(f,{key:1},[l(`:`+_(Z.value.filePosition.column),1)],64)):c(``,!0)])])):c(``,!0),Z.value.elementPosition?(n(),d(`div`,be,[r[18]||=p(`div`,{class:`op50 text-xs mb-1`},` Element `,-1),Z.value.elementPosition.selector?(n(),d(`div`,xe,_(Z.value.elementPosition.selector),1)):c(``,!0),Z.value.elementPosition.description?(n(),d(`div`,Se,_(Z.value.elementPosition.description),1)):c(``,!0),Z.value.elementPosition.boundingBox?(n(),d(`div`,Ce,_(Z.value.elementPosition.boundingBox.x)+`, `+_(Z.value.elementPosition.boundingBox.y)+` (`+_(Z.value.elementPosition.boundingBox.width)+` × `+_(Z.value.elementPosition.boundingBox.height)+`) `,1)):c(``,!0)])):c(``,!0),Z.value.stacktrace?(n(),d(`div`,we,[r[19]||=p(`div`,{class:`op50 text-xs mb-1`},` Stack Trace `,-1),p(`div`,Te,[p(`pre`,Ee,_(Z.value.stacktrace),1),p(`button`,{class:`group/bt absolute top-1.5 right-1.5 op0 group-hover:op100 p-1 rounded bg-base border border-base transition`,title:`Copy`,onClick:r[4]||=t=>e(ze)(Z.value.stacktrace)},[p(`div`,{class:o([e(Be)?`i-ph:check`:`i-ph:copy`,`op50 group-hover/bt:op100 size-3.5`])},null,2)])])])):c(``,!0),Z.value.autoDismiss||Z.value.autoDelete?(n(),d(`div`,De,[Z.value.autoDismiss?(n(),d(`span`,Oe,[r[20]||=p(`div`,{class:`i-ph:bell-slash-duotone w-3.5 h-3.5`},null,-1),l(` Auto-dismiss: `+_(Z.value.autoDismiss/1e3)+`s `,1)])):c(``,!0),Z.value.autoDelete?(n(),d(`span`,ke,[r[21]||=p(`div`,{class:`i-ph:timer-duotone w-3.5 h-3.5`},null,-1),l(` Auto-delete: `+_(Z.value.autoDelete/1e3)+`s `,1)])):c(``,!0)])):c(``,!0),p(`div`,Ae,[p(`span`,null,`ID: `+_(Z.value.id),1),p(`span`,null,_(S(Z.value.timestamp))+` (`+_(new Date(Z.value.timestamp).toLocaleDateString())+`)`,1)])])):c(``,!0)],2)]))}});export{L as default};