vite-plugin-vue-devtools 9.0.0-beta.0 → 9.0.0-rc.1
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/client/assets/{Checkbox-B5ipNSnY.js → Checkbox-DdjbU4Ab.js} +1 -1
- package/client/assets/InspectorState-DZv9Og7g.js +1 -0
- package/client/assets/{InspectorTree-rRXQ8s8J.js → InspectorTree-B3RSWmY6.js} +1 -1
- package/client/assets/RecycleScroller.vue_vue_type_script_setup_true_lang-C7mZBLYi-Cs8N2BLS.js +1 -0
- package/client/assets/{_plugin-vue_export-helper-B6clznOd.js → _plugin-vue_export-helper-Ch5OTWxJ.js} +3 -3
- package/client/assets/components-BpgaYFt2.js +3 -0
- package/client/assets/custom-inspector-uckTmF0A.js +1 -0
- package/client/assets/{graph-Co9SWzH6.js → graph-BjDyhmRt.js} +1 -1
- package/client/assets/index-Bv8QmTQo.js +3 -0
- package/client/assets/index-DeVPR5Sm.css +1 -0
- package/client/assets/overview-C_sVDbL-.js +1 -0
- package/client/assets/{pages-D4pnggpw.js → pages-CYqUm_3i.js} +1 -1
- package/client/assets/{plugins-BTGsMjgr.js → plugins-KZYZQ92t.js} +1 -1
- package/client/assets/settings-pKlwh08i.js +1 -0
- package/client/assets/{splitpanes.esm-5A9-eU15.js → splitpanes.esm-pCUnIIVu.js} +1 -1
- package/client/assets/timeline-BS4_rAnE.js +1 -0
- package/client/assets/timeline-JU58z8qA.css +1 -0
- package/client/index.html +3 -3
- package/dist/client.d.mts +6 -8
- package/dist/client.mjs +1 -105
- package/dist/constants-CGjdG_4e.mjs +1 -0
- package/dist/dirs.d.mts +2 -4
- package/dist/dirs.mjs +1 -7
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +4 -100
- package/package.json +18 -25
- package/client/assets/InspectorState-C8KGEiMm.js +0 -1
- package/client/assets/RecycleScroller.vue_vue_type_script_setup_true_lang-C7mZBLYi-s2RvbuDy.js +0 -1
- package/client/assets/components-DKmeLgtF.js +0 -3
- package/client/assets/custom-inspector-CstMcuV5.js +0 -1
- package/client/assets/index-Bkh_izWx.css +0 -1
- package/client/assets/index-CpB7HNf-.js +0 -3
- package/client/assets/overview-CsjiAgcT.js +0 -1
- package/client/assets/settings-Pw4Wn4w6.js +0 -1
- package/client/assets/timeline-B8YJRZK8.css +0 -1
- package/client/assets/timeline-DvpvgZDi.js +0 -1
- package/dist/client.cjs +0 -109
- package/dist/client.cjs.map +0 -1
- package/dist/client.d.cts +0 -13
- package/dist/client.mjs.map +0 -1
- package/dist/constants-DF-V2vvy.cjs +0 -63
- package/dist/constants-DF-V2vvy.cjs.map +0 -1
- package/dist/constants-DyETSsjK.mjs +0 -22
- package/dist/constants-DyETSsjK.mjs.map +0 -1
- package/dist/dirs.cjs +0 -7
- package/dist/dirs.cjs.map +0 -1
- package/dist/dirs.d.cts +0 -5
- package/dist/dirs.mjs.map +0 -1
- package/dist/index.cjs +0 -111
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -24
- package/dist/index.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dt as e,I as t,J as n,K as r,M as i,Y as a,b as o,d as s,et as c,f as l,h as u,i as ee,l as d,m as f,ot as p,p as m,t as h,v as g,wt as _,y as v,z as te}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{Dt as e,I as t,J as n,K as r,M as i,Y as a,b as o,d as s,et as c,f as l,h as u,i as ee,l as d,m as f,ot as p,p as m,t as h,v as g,wt as _,y as v,z as te}from"./_plugin-vue_export-helper-Ch5OTWxJ.js";import{c as ne,d as re,f as ie,p as ae}from"./index-Bv8QmTQo.js";import{n as oe,t as y}from"./splitpanes.esm-pCUnIIVu.js";var se={class:`block h-full overflow-auto`},ce={class:`h-full grid grid-rows-[auto_1fr]`},le={class:`border-b border-base px-4 py-3 flex flex-col gap-1`},ue={key:0,class:`text-orange op75`},de={key:1,class:`op50`},fe={open:``},pe={class:`cursor-pointer select-none p-4 hover:bg-active`},me={class:`flex items-start gap-2 text-xl transition op100`},he={class:`text-sm op50`},ge={class:`mt-1 flex flex-col gap-2 pb-6 pt-2`},_e={key:0,class:`w-full`},ve={class:`border-b border-base px-3`},ye={key:0,class:`text-left`},be={class:`w-20 pr-1`},b={class:`flex items-center justify-end`},x={key:0,class:`rounded-1 bg-green-400/10 px-1.5 py-0.25 text-11px text-green-400`,title:`active`},S={key:1,class:`rounded-1 bg-teal-400/10 px-1.5 py-0.25 text-11px text-teal-400`,title:`next`},C={class:`text-sm`},w={class:`inline-flex items-center gap-3`},T=[`onClick`],E={class:`p-2`},D=[`onSubmit`],O={class:`flex items-center p-2 font-mono text-sm`},k=[`placeholder`,`value`,`onInput`],A={key:1},j={class:`w-0 whitespace-nowrap pr-1 text-left font-mono text-sm op50`},M={key:0,class:`w-50 whitespace-nowrap pr-1 text-left font-mono text-sm op50 hover:text-primary hover:op100`},N=[`title`,`onClick`],xe={key:1,class:`px-4 py-8 text-center color-muted`},P={class:`p-2`},Se={class:`flex items-center justify-between`},Ce={class:`m-0 mt-2 overflow-auto rounded-1 border border-base bg-active p-3 font-state-field text-12px leading-5`},F=h(o({__name:`pages`,setup(o){let{error:h,getMatchedRoutes:F,navigateRoute:we,routerSnapshot:I,selectedAppId:Te}=ee(),L=c(``),R=c([]),z=c(),B=c(!1),V=c({}),H,U=s(()=>I.value.currentRoute),Ee=s(()=>U.value?.path??U.value?.fullPath??``),W=s(()=>J(I.value.routes).sort((e,t)=>e.path.localeCompare(t.path))),G=s(()=>L.value===U.value?.path?[]:R.value),K=s(()=>W.value.some(e=>Oe(e)));r([Ee,Te],([e])=>{L.value=e||`/`,R.value=[],z.value=void 0},{immediate:!0}),r(L,e=>{if(H&&clearTimeout(H),e===U.value?.path){R.value=[],B.value=!1;return}B.value=!0,H=setTimeout(async()=>{R.value=await F(e),B.value=!1},180)});async function De(){G.value.length&&await q(L.value)}async function q(e){try{await we(e)}catch(e){h.value=e instanceof Error?e.message:String(e)}}function J(e,t=`route`){return e.flatMap((e,n)=>{let r=`${t}:${n}:${e.path}`;return[{...e,id:r},...J(e.children??[],r)]})}function Y(e,t){return e.some(e=>e.name&&t.name?e.name===t.name:e.path===t.path)}function Oe(e){return!!e.meta&&Object.keys(e.meta).length>0}function X(e,t=0){if(!e)return`-`;let n=JSON.stringify(e,null,t);return n===`{}`?`-`:n}function ke(e){e&&(z.value=e)}function Ae(e){return e.split(/(:\w+[?*+]?(?:\([^)]*\))?[?*+]?)/).filter(Boolean)}function je(e){return e.path.includes(`:`)}function Z(e){return Ae(e.path)}function Q(e,t){return V.value[e.id]?.[t]??``}function Me(e,t,n){let r=[...V.value[e.id]??[]];r[t]=n,V.value={...V.value,[e.id]:r}}function Ne(e){return Z(e).map((t,n)=>$(t)?Q(e,n):t).join(``).replace(/\/+/g,`/`)}function Pe(e){return e.target instanceof HTMLInputElement?e.target.value:``}function $(e){return e[0]===`:`}return(r,o)=>{let s=te(`tooltip`);return i(),u(`div`,se,[l(`div`,ce,[l(`div`,le,[o[4]||=l(`div`,null,[l(`span`,{class:`op50`},`Current route`)],-1),l(`div`,{class:_([`group relative min-w-0 flex items-center justify-between gap-0.5 overflow-hidden rounded-1 border border-primary-100 px-3 py-0.75 color-base dark:border-gray-700`,L.value===U.value?.path?``:G.value.length?`text-green!`:`text-orange!`])},[o[2]||=l(`span`,{class:`i-carbon-direction-right-01 shrink-0 scale-y--100 color-gray-500 dark:color-gray-300`,"aria-hidden":`true`},null,-1),a(l(`input`,{"onUpdate:modelValue":o[0]||=e=>L.value=e,class:`w-full border-0 bg-transparent color-inherit outline-none placeholder-color-gray-500 dark:placeholder-gray-300`,type:`text`,placeholder:`/`,onKeydown:ie(De,[`enter`])},null,544),[[re,L.value]])],2),l(`div`,null,[U.value?.path===L.value?(i(),u(`span`,de,`Edit path above to navigate`)):(i(),u(d,{key:0},[o[3]||=l(`span`,null,[g(`Press `),l(`b`,{class:`font-bold`},`Enter`),g(` to navigate`)],-1),!B.value&&!G.value.length?(i(),u(`span`,ue,` (no match) `)):f(``,!0)],64))])]),v(p(oe),{class:`overflow-hidden`},{default:n(()=>[v(p(y),{size:`70`,class:`overflow-auto!`},{default:n(()=>[l(`details`,fe,[l(`summary`,pe,[l(`div`,me,[o[6]||=l(`span`,{class:`i-carbon-tree-view-alt shrink-0 text-xl`,"aria-hidden":`true`},null,-1),l(`div`,null,[o[5]||=l(`div`,{class:`text-base`},`All Routes`,-1),l(`div`,he,e(W.value.length)+` routes registered in your application `,1)]),o[7]||=l(`div`,{class:`flex-auto`},null,-1),o[8]||=l(`span`,{class:`chevron i-carbon-chevron-down place-self-start cursor-pointer text-base op75 transition duration-500`,"aria-hidden":`true`},null,-1)])]),l(`div`,ge,[W.value.length?(i(),u(`table`,_e,[l(`thead`,ve,[l(`tr`,null,[o[9]||=l(`th`,{class:`text-left`},null,-1),o[10]||=l(`th`,{class:`text-left`},`Route Path`,-1),o[11]||=l(`th`,{class:`text-left`},`Name`,-1),K.value?(i(),u(`th`,ye,`Route Meta`)):f(``,!0)])]),l(`tbody`,null,[(i(!0),u(d,null,t(W.value,r=>(i(),u(`tr`,{key:r.id,class:`group h-7 border-b border-dashed border-transparent hover:border-base`},[l(`td`,be,[l(`div`,b,[Y(U.value?.matched??[],r)?(i(),u(`span`,x,` active `)):Y(G.value,r)?(i(),u(`span`,S,` next `)):f(``,!0)])]),l(`td`,C,[l(`div`,w,[je(r)?(i(),m(p(ne),{key:1},{popper:n(({hide:n})=>[l(`div`,E,[l(`form`,{class:`flex flex-col`,onSubmit:ae(()=>{q(Ne(r)),n()},[`prevent`])},[o[12]||=l(`div`,{class:`px-2 text-sm op50`},`Fill params and navigate:`,-1),l(`div`,O,[(i(!0),u(d,null,t(Z(r),(t,n)=>(i(),u(d,{key:`${r.id}-input-${n}-${t}`},[$(t)?(i(),u(`input`,{key:0,class:`w-20 rounded-1 border border-primary-100 bg-transparent px-2 py-0.75 color-inherit outline-none dark:border-gray-700`,placeholder:t.slice(1),value:Q(r,n),onInput:e=>Me(r,n,Pe(e))},null,40,k)):(i(),u(`span`,A,e(t),1))],64))),128))]),o[13]||=l(`button`,{class:`block rounded-1 border border-primary-500/40 bg-primary-500/12 px-3 py-1 text-primary-500 hover:bg-primary-500/18`,type:`submit`},` Navigate `,-1)],40,D)])]),default:n(()=>[l(`code`,{class:_([`block cursor-pointer font-mono`,Y(U.value?.matched??[],r)?`text-primary-400`:Y(G.value,r)?`text-teal`:``])},[(i(!0),u(d,null,t(Z(r),(t,n)=>(i(),u(`span`,{key:`${r.id}-${n}-${t}`,class:_($(t)?`rounded-1 border border-dashed border-gray/50 px-1 text-gray`:``)},e($(t)?t.slice(1):t),3))),128))],2)]),_:2},1024)):(i(),u(`button`,{key:0,class:_([`border-0 bg-transparent p-0 color-inherit font-mono`,Y(U.value?.matched??[],r)?`text-primary-400`:Y(G.value,r)?`text-teal`:``]),type:`button`,onClick:e=>q(r.path)},[l(`code`,null,e(r.path),1)],10,T))])]),l(`td`,j,e(r.name??`-`),1),K.value?(i(),u(`td`,M,[l(`span`,{class:`inline-block w-50 cursor-pointer overflow-hidden text-ellipsis`,title:X(r.meta,2),onClick:e=>ke(r.meta)},e(X(r.meta)),9,N)])):f(``,!0)]))),128))])])):(i(),u(`div`,xe,`No routes`))])]),o[14]||=l(`div`,{class:`border-b border-base`},null,-1)]),_:1}),z.value?(i(),m(p(y),{key:0,size:`30`,class:`overflow-auto!`},{default:n(()=>[l(`div`,P,[l(`div`,Se,[o[15]||=l(`span`,{class:`font-500`},`Route meta detail`,-1),a(l(`button`,{class:`i-carbon-close cursor-pointer border-0 bg-transparent p-1 color-muted hover:color-base`,type:`button`,"aria-label":`Close route meta detail`,onClick:o[1]||=e=>z.value=void 0},null,512),[[s,`Close route meta detail`,void 0,{bottom:!0}]])]),l(`pre`,Ce,[l(`code`,null,e(JSON.stringify(z.value,null,2)),1)])])]),_:1})):f(``,!0)]),_:1})])])}}}),[[`__scopeId`,`data-v-bcb7c7b1`]]);export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,Dt as t,I as n,J as r,K as i,M as a,Y as o,b as s,d as c,et as l,f as u,h as d,i as f,j as p,l as m,m as h,ot as g,p as _,t as v,v as y,wt as b,y as x}from"./_plugin-vue_export-helper-B6clznOd.js";import{d as S,n as C}from"./index-CpB7HNf-.js";import{t as w}from"./Checkbox-B5ipNSnY.js";import{n as T,t as E}from"./splitpanes.esm-5A9-eU15.js";var D={class:`plugin-settings-pane h-full min-h-0 flex flex-col bg-transparent`},O={class:`min-h-15 shrink-0 flex items-center gap-2 border-b border-base px-4 font-state-field text-3.5`},k={class:`color-muted font-400`},A={class:`no-scrollbar min-h-0 flex-1 overflow-auto`},j={class:`min-w-0`},M={class:`font-state-field text-3.5`},N={key:0,class:`mt-0.5 color-muted text-13px leading-5`},P={class:`mt-1 block truncate color-muted text-3.5`},F={class:`plugin-setting-control min-w-0 flex justify-end`},I={key:1,class:`min-w-0 inline-flex overflow-hidden rounded-1 border border-base`},L=[`onClick`],R=[`value`,`onChange`],z=[`value`],B=[`value`,`onChange`],V=[`value`,`onInput`],H={key:1,class:`mx-4 border-b border-base py-3 color-muted font-state-field text-3.5`},U=v(s({__name:`PluginSettings`,props:{plugin:{}},emits:[`update`],setup(e,{emit:r}){let i=e,o=r,s=c(()=>Object.entries(i.plugin.settings??{}).sort(([e],[t])=>e.localeCompare(t)));function l(e){return e.type?e.type:e.options?.length?`choice`:typeof e.defaultValue==`boolean`?`boolean`:typeof e.defaultValue==`number`?`number`:`text`}function f(e,t){return t.label||E(e)}function p(e){return typeof e.description==`string`?e.description:void 0}function g(e,t){let n=i.plugin.settingValues??{};return e in n?n[e]:t.defaultValue}function v(e,t){let n=g(e,t);return n==null?``:String(n)}function y(e){return e.options??[]}function x(e,t,n){return Object.is(g(e,t),n.value)}function S(e,t){t.currentTarget instanceof HTMLInputElement&&U(e,t.currentTarget.value)}function C(e,t){if(!(t.currentTarget instanceof HTMLInputElement))return;let n=Number(t.currentTarget.value);U(e,Number.isNaN(n)?t.currentTarget.value:n)}function T(e,t,n){if(!(n.currentTarget instanceof HTMLSelectElement))return;let r=n.currentTarget.value;U(e,y(t).find(e=>String(e.value)===r)?.value??r)}function E(e){return e.replace(/[-_:.]+/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/\b\w/g,e=>e.toUpperCase())}function U(e,t){o(`update`,e,t)}return(e,r)=>(a(),d(`section`,D,[u(`div`,O,[r[0]||=u(`span`,null,`Settings`,-1),u(`span`,k,t(s.value.length),1)]),u(`div`,A,[s.value.length?(a(!0),d(m,{key:0},n(s.value,([e,r])=>(a(),d(`div`,{key:e,class:`plugin-setting-row mx-4 grid grid-cols-[minmax(0,1fr)_max-content] items-center gap-4 border-b border-base py-3`},[u(`div`,j,[u(`div`,M,t(f(e,r)),1),p(r)?(a(),d(`div`,N,t(p(r)),1)):h(``,!0),u(`code`,P,t(e),1)]),u(`div`,F,[l(r)===`boolean`?(a(),_(w,{key:0,"aria-label":f(e,r),"model-value":g(e,r)===!0,"onUpdate:modelValue":t=>U(e,t)},null,8,[`aria-label`,`model-value`,`onUpdate:modelValue`])):l(r)===`choice`&&r.component===`button-group`?(a(),d(`div`,I,[(a(!0),d(m,null,n(y(r),n=>(a(),d(`button`,{key:String(n.value),class:b([`min-w-10 border-0 border-r border-base bg-transparent px-2 py-1 color-inherit text-3.5 last:border-r-0 hover:bg-active`,{"bg-primary-500/15 text-primary-700 dark:text-primary-300":x(e,r,n)}]),type:`button`,onClick:t=>U(e,n.value)},t(n.label),11,L))),128))])):l(r)===`choice`?(a(),d(`select`,{key:2,class:`plugin-field h-7 w-40 max-w-[42cqw] min-w-0 rounded-1 border border-base bg-transparent px-2 font-state-field text-3.5 color-inherit outline-none focus:border-primary-500/60`,value:String(g(e,r)??``),onChange:t=>T(e,r,t)},[(a(!0),d(m,null,n(y(r),e=>(a(),d(`option`,{key:String(e.value),value:String(e.value)},t(e.label),9,z))),128))],40,R)):l(r)===`number`?(a(),d(`input`,{key:3,class:`plugin-field h-7 w-40 max-w-[42cqw] min-w-0 rounded-1 border border-base bg-transparent px-2 font-state-field text-3.5 color-inherit outline-none focus:border-primary-500/60`,type:`number`,value:v(e,r),onChange:t=>C(e,t)},null,40,B)):(a(),d(`input`,{key:4,class:`plugin-field h-7 w-40 max-w-[42cqw] min-w-0 rounded-1 border border-base bg-transparent px-2 font-state-field text-3.5 color-inherit outline-none focus:border-primary-500/60`,type:`text`,value:v(e,r),onInput:t=>S(e,t)},null,40,V))])]))),128)):(a(),d(`div`,H,` No plugin settings `))])]))}}),[[`__scopeId`,`data-v-c2b3954c`]]),ee={key:0,class:`h-full flex items-center justify-center p-6`},te={class:`h-full min-h-0 flex flex-col bg-#88808005`},ne={class:`h-9.5 shrink-0 flex items-center gap-1.5 px-3.5`},W={class:`no-scrollbar min-h-0 flex-1 overflow-auto p-1.5`},G=[`onClick`],K={class:`h-6 w-6 shrink-0 color-active op90 inline-flex items-center justify-center`},q=[`src`],J={key:1,class:`i-carbon-plug text-4`,"aria-hidden":`true`},Y={class:`min-w-0 flex-1 text-left`},X={class:`block truncate font-state-field text-3.5`},Z={class:`block truncate color-muted text-3.5 leading-4`},re={key:0,class:`px-3 py-8 text-center color-muted text-13px`},ie={key:0,class:`h-full min-h-0`},ae={class:`h-full min-h-0 flex flex-col bg-transparent`},oe={class:`min-h-15 shrink-0 flex items-center gap-2.5 border-b border-base px-4 py-3`},se={class:`h-8 w-8 shrink-0 inline-flex items-center justify-center`},ce=[`src`],le={key:1,class:`i-carbon-plug color-muted text-5`,"aria-hidden":`true`},ue={class:`min-w-0 flex-1`},de={class:`m-0 truncate font-state-field text-3.5`},fe={class:`block truncate color-muted text-3.5 leading-5`},pe={class:`no-scrollbar min-h-0 flex-1 overflow-auto`},me={class:`px-4 py-4`},he={class:`plugin-info-list m-0 mt-2.5 grid grid-cols-[minmax(7rem,max-content)_minmax(0,1fr)] gap-x-4 gap-y-2.5 font-state-field text-3.5`},ge={class:`contents`},_e={class:`m-0 min-w-0`},ve={key:0,class:`contents`},ye={class:`m-0 min-w-0`},be={key:1,class:`contents`},xe={class:`m-0 min-w-0`},Se=[`href`],Ce={class:`border-t border-base px-4 py-4`},we={class:`plugin-info-list m-0 mt-2.5 grid grid-cols-[minmax(7rem,max-content)_minmax(0,1fr)] gap-x-4 gap-y-2.5 font-state-field text-3.5`},Te={class:`contents`},Ee={class:`m-0 min-w-0`},De={key:0,class:`flex flex-wrap gap-x-2 gap-y-1.5`},Oe={key:1,class:`color-muted`},Q={class:`contents`},ke={class:`m-0 min-w-0`},Ae={key:0,class:`flex flex-wrap gap-x-2 gap-y-1.5`},je={key:1,class:`color-muted`},Me={class:`contents`},Ne={class:`m-0 min-w-0`},Pe={key:0,class:`mx-4 mb-4 border-l-2 border-red-500 px-2.5 py-1.5 text-red-600 text-12px`},Fe={key:1,class:`h-full flex items-center justify-center color-muted text-13px`},$=v(s({__name:`plugins`,setup(s){let{error:v,inspectors:w,plugins:D,timelineLayers:O,updatePluginSetting:k}=f(),A=l(),j=l(!1),M=l(``),N=l(``),P,F=c(()=>D.value.filter(e=>!C(e,w.value))),I=c(()=>[...F.value].sort((e,t)=>$(e).localeCompare($(t)))),L=c(()=>{let e=M.value.trim().toLowerCase();return e?I.value.filter(t=>[t.label,t.packageName,t.homepage,t.id].some(t=>t?.toLowerCase().includes(e))):I.value}),R=c(()=>F.value.find(e=>e.id===N.value)),z=c(()=>{let e=R.value?.id;return e?w.value.filter(t=>t.pluginId===e):[]}),B=c(()=>{let e=R.value?.id;return e?O.value.filter(t=>t.pluginId===e):[]}),V=c(()=>Object.entries(R.value?.settings??{}).sort(([e],[t])=>e.localeCompare(t)));i(L,e=>{e.some(e=>e.id===N.value)||(N.value=e[0]?.id??``)},{immediate:!0});function H(e){N.value=e}function $(e){return e.label||e.packageName||e.id}function Ie(e){return e.packageName||e.id}function Le(e,t,n){k(e.id,t,n).catch(()=>{})}return e(()=>{P=new ResizeObserver(([e])=>{j.value=e.contentRect.width<780}),A.value&&P.observe(A.value)}),p(()=>{P?.disconnect()}),(e,i)=>(a(),d(`section`,{ref_key:`container`,ref:A,class:`h-full min-h-0 overflow-hidden`},[F.value.length?(a(),_(g(T),{key:1,class:`h-full min-h-0 overflow-hidden`,horizontal:j.value},{default:r(()=>[x(g(E),{class:`h-full min-h-0`,"min-size":`18`,size:j.value?34:28},{default:r(()=>[u(`aside`,te,[u(`label`,ne,[i[3]||=u(`span`,{class:`i-carbon-search shrink-0 color-muted text-4`,"aria-hidden":`true`},null,-1),o(u(`input`,{"onUpdate:modelValue":i[0]||=e=>M.value=e,class:`min-w-0 w-full border-0 bg-transparent p-0 outline-none font-state-field text-3.5 color-inherit placeholder-color-gray-500 dark:placeholder-gray-300`,placeholder:`Filter plugins...`,type:`search`},null,512),[[S,M.value]])]),u(`div`,W,[(a(!0),d(m,null,n(L.value,e=>(a(),d(`button`,{key:e.id,class:b([`w-full min-h-8 flex items-center gap-2 border-0 rounded-0 bg-transparent px-2 py-1 color-inherit hover:bg-active`,e.id===N.value?`bg-active!`:``]),type:`button`,onClick:t=>H(e.id)},[u(`span`,K,[e.logo?(a(),d(`img`,{key:0,class:`max-h-full max-w-full`,src:e.logo,alt:``},null,8,q)):(a(),d(`span`,J))]),u(`span`,Y,[u(`span`,X,t($(e)),1),u(`code`,Z,t(Ie(e)),1)])],10,G))),128)),L.value.length?h(``,!0):(a(),d(`div`,re,` No matching plugins `))])])]),_:1},8,[`size`]),x(g(E),{class:`h-full min-h-0`,"min-size":`44`},{default:r(()=>[R.value?(a(),d(`div`,ie,[x(g(T),{class:`h-full min-h-0 overflow-hidden`,horizontal:j.value},{default:r(()=>[x(g(E),{class:`h-full min-h-0`,"min-size":`28`,size:j.value?42:38},{default:r(()=>[u(`aside`,ae,[u(`header`,oe,[u(`span`,se,[R.value.logo?(a(),d(`img`,{key:0,class:`max-h-full max-w-full`,src:R.value.logo,alt:``},null,8,ce)):(a(),d(`span`,le))]),u(`div`,ue,[u(`h1`,de,t($(R.value)),1),u(`code`,fe,t(R.value.id),1)])]),u(`div`,pe,[u(`section`,me,[i[8]||=u(`div`,{class:`min-h-6 flex items-center color-muted font-state-field font-500 text-3.5`},` Details `,-1),u(`dl`,he,[u(`div`,ge,[i[4]||=u(`dt`,{class:`text-#a3a3a3`},`ID`,-1),u(`dd`,_e,[u(`code`,null,t(R.value.id),1)])]),R.value.packageName?(a(),d(`div`,ve,[i[5]||=u(`dt`,{class:`text-#a3a3a3`},`Package`,-1),u(`dd`,ye,[u(`code`,null,t(R.value.packageName),1)])])):h(``,!0),R.value.homepage?(a(),d(`div`,be,[i[7]||=u(`dt`,{class:`text-#a3a3a3`},`Homepage`,-1),u(`dd`,xe,[u(`a`,{class:`color-inherit inline-flex items-center gap-0.75 no-underline hover:color-active`,href:R.value.homepage,rel:`noreferrer`,target:`_blank`},[...i[6]||=[y(` Open `,-1),u(`span`,{class:`i-carbon-launch text-3`,"aria-hidden":`true`},null,-1)]],8,Se)])])):h(``,!0)])]),u(`section`,Ce,[i[12]||=u(`div`,{class:`min-h-6 flex items-center color-muted font-state-field font-500 text-3.5`},` Capabilities `,-1),u(`dl`,we,[u(`div`,Te,[i[9]||=u(`dt`,{class:`text-#a3a3a3`},`Custom inspectors`,-1),u(`dd`,Ee,[z.value.length?(a(),d(`span`,De,[(a(!0),d(m,null,n(z.value,e=>(a(),d(`span`,{key:e.id},t(e.label),1))),128))])):(a(),d(`span`,Oe,`None`))])]),u(`div`,Q,[i[10]||=u(`dt`,{class:`text-#a3a3a3`},`Timeline layers`,-1),u(`dd`,ke,[B.value.length?(a(),d(`span`,Ae,[(a(!0),d(m,null,n(B.value,e=>(a(),d(`span`,{key:e.id},t(e.label),1))),128))])):(a(),d(`span`,je,`None`))])]),u(`div`,Me,[i[11]||=u(`dt`,{class:`text-#a3a3a3`},`Settings`,-1),u(`dd`,Ne,t(V.value.length),1)])])]),g(v)?(a(),d(`div`,Pe,t(g(v)),1)):h(``,!0)])])]),_:1},8,[`size`]),x(g(E),{class:`h-full min-h-0`,"min-size":`40`},{default:r(()=>[x(U,{plugin:R.value,onUpdate:i[1]||=(e,t)=>Le(R.value,e,t)},null,8,[`plugin`])]),_:1})]),_:1},8,[`horizontal`])])):(a(),d(`div`,Fe,` Select a plugin `))]),_:1})]),_:1},8,[`horizontal`])):(a(),d(`div`,ee,[...i[2]||=[u(`div`,{class:`max-w-90 text-center`},[u(`div`,{class:`mx-auto mb-2 h-8 w-8 flex items-center justify-center`},[u(`span`,{class:`i-carbon-plug color-muted text-7`,"aria-hidden":`true`})]),u(`div`,{class:`font-650`},`No data`)],-1)]]))],512))}}),[[`__scopeId`,`data-v-eb8c90a8`]]);export{$ as default};
|
|
1
|
+
import{A as e,Dt as t,I as n,J as r,K as i,M as a,Y as o,b as s,d as c,et as l,f as u,h as d,i as f,j as p,l as m,m as h,ot as g,p as _,t as v,v as y,wt as b,y as x}from"./_plugin-vue_export-helper-Ch5OTWxJ.js";import{d as S,n as C}from"./index-Bv8QmTQo.js";import{t as w}from"./Checkbox-DdjbU4Ab.js";import{n as T,t as E}from"./splitpanes.esm-pCUnIIVu.js";var D={class:`plugin-settings-pane h-full min-h-0 flex flex-col bg-transparent`},O={class:`min-h-15 shrink-0 flex items-center gap-2 border-b border-base px-4 font-state-field text-3.5`},k={class:`color-muted font-400`},A={class:`no-scrollbar min-h-0 flex-1 overflow-auto`},j={class:`min-w-0`},M={class:`font-state-field text-3.5`},N={key:0,class:`mt-0.5 color-muted text-13px leading-5`},P={class:`mt-1 block truncate color-muted text-3.5`},F={class:`plugin-setting-control min-w-0 flex justify-end`},I={key:1,class:`min-w-0 inline-flex overflow-hidden rounded-1 border border-base`},L=[`onClick`],R=[`value`,`onChange`],z=[`value`],B=[`value`,`onChange`],V=[`value`,`onInput`],H={key:1,class:`mx-4 border-b border-base py-3 color-muted font-state-field text-3.5`},U=v(s({__name:`PluginSettings`,props:{plugin:{}},emits:[`update`],setup(e,{emit:r}){let i=e,o=r,s=c(()=>Object.entries(i.plugin.settings??{}).sort(([e],[t])=>e.localeCompare(t)));function l(e){return e.type?e.type:e.options?.length?`choice`:typeof e.defaultValue==`boolean`?`boolean`:typeof e.defaultValue==`number`?`number`:`text`}function f(e,t){return t.label||E(e)}function p(e){return typeof e.description==`string`?e.description:void 0}function g(e,t){let n=i.plugin.settingValues??{};return e in n?n[e]:t.defaultValue}function v(e,t){let n=g(e,t);return n==null?``:String(n)}function y(e){return e.options??[]}function x(e,t,n){return Object.is(g(e,t),n.value)}function S(e,t){t.currentTarget instanceof HTMLInputElement&&U(e,t.currentTarget.value)}function C(e,t){if(!(t.currentTarget instanceof HTMLInputElement))return;let n=Number(t.currentTarget.value);U(e,Number.isNaN(n)?t.currentTarget.value:n)}function T(e,t,n){if(!(n.currentTarget instanceof HTMLSelectElement))return;let r=n.currentTarget.value;U(e,y(t).find(e=>String(e.value)===r)?.value??r)}function E(e){return e.replace(/[-_:.]+/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/\b\w/g,e=>e.toUpperCase())}function U(e,t){o(`update`,e,t)}return(e,r)=>(a(),d(`section`,D,[u(`div`,O,[r[0]||=u(`span`,null,`Settings`,-1),u(`span`,k,t(s.value.length),1)]),u(`div`,A,[s.value.length?(a(!0),d(m,{key:0},n(s.value,([e,r])=>(a(),d(`div`,{key:e,class:`plugin-setting-row mx-4 grid grid-cols-[minmax(0,1fr)_max-content] items-center gap-4 border-b border-base py-3`},[u(`div`,j,[u(`div`,M,t(f(e,r)),1),p(r)?(a(),d(`div`,N,t(p(r)),1)):h(``,!0),u(`code`,P,t(e),1)]),u(`div`,F,[l(r)===`boolean`?(a(),_(w,{key:0,"aria-label":f(e,r),"model-value":g(e,r)===!0,"onUpdate:modelValue":t=>U(e,t)},null,8,[`aria-label`,`model-value`,`onUpdate:modelValue`])):l(r)===`choice`&&r.component===`button-group`?(a(),d(`div`,I,[(a(!0),d(m,null,n(y(r),n=>(a(),d(`button`,{key:String(n.value),class:b([`min-w-10 border-0 border-r border-base bg-transparent px-2 py-1 color-inherit text-3.5 last:border-r-0 hover:bg-active`,{"bg-primary-500/15 text-primary-700 dark:text-primary-300":x(e,r,n)}]),type:`button`,onClick:t=>U(e,n.value)},t(n.label),11,L))),128))])):l(r)===`choice`?(a(),d(`select`,{key:2,class:`plugin-field h-7 w-40 max-w-[42cqw] min-w-0 rounded-1 border border-base bg-transparent px-2 font-state-field text-3.5 color-inherit outline-none focus:border-primary-500/60`,value:String(g(e,r)??``),onChange:t=>T(e,r,t)},[(a(!0),d(m,null,n(y(r),e=>(a(),d(`option`,{key:String(e.value),value:String(e.value)},t(e.label),9,z))),128))],40,R)):l(r)===`number`?(a(),d(`input`,{key:3,class:`plugin-field h-7 w-40 max-w-[42cqw] min-w-0 rounded-1 border border-base bg-transparent px-2 font-state-field text-3.5 color-inherit outline-none focus:border-primary-500/60`,type:`number`,value:v(e,r),onChange:t=>C(e,t)},null,40,B)):(a(),d(`input`,{key:4,class:`plugin-field h-7 w-40 max-w-[42cqw] min-w-0 rounded-1 border border-base bg-transparent px-2 font-state-field text-3.5 color-inherit outline-none focus:border-primary-500/60`,type:`text`,value:v(e,r),onInput:t=>S(e,t)},null,40,V))])]))),128)):(a(),d(`div`,H,` No plugin settings `))])]))}}),[[`__scopeId`,`data-v-c2b3954c`]]),ee={key:0,class:`h-full flex items-center justify-center p-6`},te={class:`h-full min-h-0 flex flex-col bg-#88808005`},ne={class:`h-9.5 shrink-0 flex items-center gap-1.5 px-3.5`},W={class:`no-scrollbar min-h-0 flex-1 overflow-auto p-1.5`},G=[`onClick`],K={class:`h-6 w-6 shrink-0 color-active op90 inline-flex items-center justify-center`},q=[`src`],J={key:1,class:`i-carbon-plug text-4`,"aria-hidden":`true`},Y={class:`min-w-0 flex-1 text-left`},X={class:`block truncate font-state-field text-3.5`},Z={class:`block truncate color-muted text-3.5 leading-4`},re={key:0,class:`px-3 py-8 text-center color-muted text-13px`},ie={key:0,class:`h-full min-h-0`},ae={class:`h-full min-h-0 flex flex-col bg-transparent`},oe={class:`min-h-15 shrink-0 flex items-center gap-2.5 border-b border-base px-4 py-3`},se={class:`h-8 w-8 shrink-0 inline-flex items-center justify-center`},ce=[`src`],le={key:1,class:`i-carbon-plug color-muted text-5`,"aria-hidden":`true`},ue={class:`min-w-0 flex-1`},de={class:`m-0 truncate font-state-field text-3.5`},fe={class:`block truncate color-muted text-3.5 leading-5`},pe={class:`no-scrollbar min-h-0 flex-1 overflow-auto`},me={class:`px-4 py-4`},he={class:`plugin-info-list m-0 mt-2.5 grid grid-cols-[minmax(7rem,max-content)_minmax(0,1fr)] gap-x-4 gap-y-2.5 font-state-field text-3.5`},ge={class:`contents`},_e={class:`m-0 min-w-0`},ve={key:0,class:`contents`},ye={class:`m-0 min-w-0`},be={key:1,class:`contents`},xe={class:`m-0 min-w-0`},Se=[`href`],Ce={class:`border-t border-base px-4 py-4`},we={class:`plugin-info-list m-0 mt-2.5 grid grid-cols-[minmax(7rem,max-content)_minmax(0,1fr)] gap-x-4 gap-y-2.5 font-state-field text-3.5`},Te={class:`contents`},Ee={class:`m-0 min-w-0`},De={key:0,class:`flex flex-wrap gap-x-2 gap-y-1.5`},Oe={key:1,class:`color-muted`},Q={class:`contents`},ke={class:`m-0 min-w-0`},Ae={key:0,class:`flex flex-wrap gap-x-2 gap-y-1.5`},je={key:1,class:`color-muted`},Me={class:`contents`},Ne={class:`m-0 min-w-0`},Pe={key:0,class:`mx-4 mb-4 border-l-2 border-red-500 px-2.5 py-1.5 text-red-600 text-12px`},Fe={key:1,class:`h-full flex items-center justify-center color-muted text-13px`},$=v(s({__name:`plugins`,setup(s){let{error:v,inspectors:w,plugins:D,timelineLayers:O,updatePluginSetting:k}=f(),A=l(),j=l(!1),M=l(``),N=l(``),P,F=c(()=>D.value.filter(e=>!C(e,w.value))),I=c(()=>[...F.value].sort((e,t)=>$(e).localeCompare($(t)))),L=c(()=>{let e=M.value.trim().toLowerCase();return e?I.value.filter(t=>[t.label,t.packageName,t.homepage,t.id].some(t=>t?.toLowerCase().includes(e))):I.value}),R=c(()=>F.value.find(e=>e.id===N.value)),z=c(()=>{let e=R.value?.id;return e?w.value.filter(t=>t.pluginId===e):[]}),B=c(()=>{let e=R.value?.id;return e?O.value.filter(t=>t.pluginId===e):[]}),V=c(()=>Object.entries(R.value?.settings??{}).sort(([e],[t])=>e.localeCompare(t)));i(L,e=>{e.some(e=>e.id===N.value)||(N.value=e[0]?.id??``)},{immediate:!0});function H(e){N.value=e}function $(e){return e.label||e.packageName||e.id}function Ie(e){return e.packageName||e.id}function Le(e,t,n){k(e.id,t,n).catch(()=>{})}return e(()=>{P=new ResizeObserver(([e])=>{j.value=e.contentRect.width<780}),A.value&&P.observe(A.value)}),p(()=>{P?.disconnect()}),(e,i)=>(a(),d(`section`,{ref_key:`container`,ref:A,class:`h-full min-h-0 overflow-hidden`},[F.value.length?(a(),_(g(T),{key:1,class:`h-full min-h-0 overflow-hidden`,horizontal:j.value},{default:r(()=>[x(g(E),{class:`h-full min-h-0`,"min-size":`18`,size:j.value?34:28},{default:r(()=>[u(`aside`,te,[u(`label`,ne,[i[3]||=u(`span`,{class:`i-carbon-search shrink-0 color-muted text-4`,"aria-hidden":`true`},null,-1),o(u(`input`,{"onUpdate:modelValue":i[0]||=e=>M.value=e,class:`min-w-0 w-full border-0 bg-transparent p-0 outline-none font-state-field text-3.5 color-inherit placeholder-color-gray-500 dark:placeholder-gray-300`,placeholder:`Filter plugins...`,type:`search`},null,512),[[S,M.value]])]),u(`div`,W,[(a(!0),d(m,null,n(L.value,e=>(a(),d(`button`,{key:e.id,class:b([`w-full min-h-8 flex items-center gap-2 border-0 rounded-0 bg-transparent px-2 py-1 color-inherit hover:bg-active`,e.id===N.value?`bg-active!`:``]),type:`button`,onClick:t=>H(e.id)},[u(`span`,K,[e.logo?(a(),d(`img`,{key:0,class:`max-h-full max-w-full`,src:e.logo,alt:``},null,8,q)):(a(),d(`span`,J))]),u(`span`,Y,[u(`span`,X,t($(e)),1),u(`code`,Z,t(Ie(e)),1)])],10,G))),128)),L.value.length?h(``,!0):(a(),d(`div`,re,` No matching plugins `))])])]),_:1},8,[`size`]),x(g(E),{class:`h-full min-h-0`,"min-size":`44`},{default:r(()=>[R.value?(a(),d(`div`,ie,[x(g(T),{class:`h-full min-h-0 overflow-hidden`,horizontal:j.value},{default:r(()=>[x(g(E),{class:`h-full min-h-0`,"min-size":`28`,size:j.value?42:38},{default:r(()=>[u(`aside`,ae,[u(`header`,oe,[u(`span`,se,[R.value.logo?(a(),d(`img`,{key:0,class:`max-h-full max-w-full`,src:R.value.logo,alt:``},null,8,ce)):(a(),d(`span`,le))]),u(`div`,ue,[u(`h1`,de,t($(R.value)),1),u(`code`,fe,t(R.value.id),1)])]),u(`div`,pe,[u(`section`,me,[i[8]||=u(`div`,{class:`min-h-6 flex items-center color-muted font-state-field font-500 text-3.5`},` Details `,-1),u(`dl`,he,[u(`div`,ge,[i[4]||=u(`dt`,{class:`text-#a3a3a3`},`ID`,-1),u(`dd`,_e,[u(`code`,null,t(R.value.id),1)])]),R.value.packageName?(a(),d(`div`,ve,[i[5]||=u(`dt`,{class:`text-#a3a3a3`},`Package`,-1),u(`dd`,ye,[u(`code`,null,t(R.value.packageName),1)])])):h(``,!0),R.value.homepage?(a(),d(`div`,be,[i[7]||=u(`dt`,{class:`text-#a3a3a3`},`Homepage`,-1),u(`dd`,xe,[u(`a`,{class:`color-inherit inline-flex items-center gap-0.75 no-underline hover:color-active`,href:R.value.homepage,rel:`noreferrer`,target:`_blank`},[...i[6]||=[y(` Open `,-1),u(`span`,{class:`i-carbon-launch text-3`,"aria-hidden":`true`},null,-1)]],8,Se)])])):h(``,!0)])]),u(`section`,Ce,[i[12]||=u(`div`,{class:`min-h-6 flex items-center color-muted font-state-field font-500 text-3.5`},` Capabilities `,-1),u(`dl`,we,[u(`div`,Te,[i[9]||=u(`dt`,{class:`text-#a3a3a3`},`Custom inspectors`,-1),u(`dd`,Ee,[z.value.length?(a(),d(`span`,De,[(a(!0),d(m,null,n(z.value,e=>(a(),d(`span`,{key:e.id},t(e.label),1))),128))])):(a(),d(`span`,Oe,`None`))])]),u(`div`,Q,[i[10]||=u(`dt`,{class:`text-#a3a3a3`},`Timeline layers`,-1),u(`dd`,ke,[B.value.length?(a(),d(`span`,Ae,[(a(!0),d(m,null,n(B.value,e=>(a(),d(`span`,{key:e.id},t(e.label),1))),128))])):(a(),d(`span`,je,`None`))])]),u(`div`,Me,[i[11]||=u(`dt`,{class:`text-#a3a3a3`},`Settings`,-1),u(`dd`,Ne,t(V.value.length),1)])])]),g(v)?(a(),d(`div`,Pe,t(g(v)),1)):h(``,!0)])])]),_:1},8,[`size`]),x(g(E),{class:`h-full min-h-0`,"min-size":`40`},{default:r(()=>[x(U,{plugin:R.value,onUpdate:i[1]||=(e,t)=>Le(R.value,e,t)},null,8,[`plugin`])]),_:1})]),_:1},8,[`horizontal`])])):(a(),d(`div`,Fe,` Select a plugin `))]),_:1})]),_:1},8,[`horizontal`])):(a(),d(`div`,ee,[...i[2]||=[u(`div`,{class:`max-w-90 text-center`},[u(`div`,{class:`mx-auto mb-2 h-8 w-8 flex items-center justify-center`},[u(`span`,{class:`i-carbon-plug color-muted text-7`,"aria-hidden":`true`})]),u(`div`,{class:`font-650`},`No data`)],-1)]]))],512))}}),[[`__scopeId`,`data-v-eb8c90a8`]]);export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,Dt as t,I as n,J as r,K as i,L as a,M as o,T as s,U as c,W as l,Y as u,Z as d,a as f,b as p,et as m,f as h,h as g,it as _,k as v,l as y,m as b,ot as x,p as S,t as C,v as w,wt as T,y as E,z as D}from"./_plugin-vue_export-helper-Ch5OTWxJ.js";import{a as O,l as k,p as A,r as j,t as ee,u as te}from"./index-Bv8QmTQo.js";import{t as M}from"./Checkbox-DdjbU4Ab.js";var N={class:`h-full flex flex-col`},P={class:`flex justify-end gap-2 border-t border-base px-4 py-3`},F=C(p({__name:`ConfirmationDialog`,props:{cancelLabel:{default:`Cancel`},confirmLabel:{default:`Confirm`},description:{},open:{type:Boolean},title:{}},emits:[`confirm`,`update:open`],setup(n,{emit:r}){let a=n,s=r,l=m(),u=m(),d=c(),f=`confirmation-dialog-title-${d}`,p=`confirmation-dialog-description-${d}`,_;i(()=>a.open,async t=>{if(t){_=document.activeElement instanceof HTMLElement?document.activeElement:void 0,await e(),l.value?.open||l.value?.showModal(),await e(),u.value?.focus();return}l.value?.open&&l.value.close()},{flush:`post`,immediate:!0}),v(()=>{l.value?.open&&l.value.close()});function y(){s(`update:open`,!1)}function b(e){e.preventDefault(),y()}function x(){a.open&&s(`update:open`,!1),e(()=>{_?.focus(),_=void 0})}function S(e){e.target===l.value&&y()}return(e,r)=>(o(),g(`dialog`,{ref_key:`dialog`,ref:l,class:`settings-confirm-dialog panel-card h-50 max-w-[calc(100vw-2rem)] w-[40%] min-w-80 overscroll-contain p-0 color-base shadow-2xl`,role:`dialog`,"aria-modal":`true`,"aria-describedby":p,"aria-labelledby":f,onCancel:b,onClick:S,onClose:x},[h(`div`,N,[h(`h2`,{id:f,class:`m-0 border-b border-base px-4 py-3 text-base font-650`},t(n.title),1),h(`div`,{id:p,class:`flex flex-auto items-center px-4 py-3 color-muted`},t(n.description),1),h(`div`,P,[h(`button`,{ref_key:`cancelButton`,ref:u,class:`settings-button`,type:`button`,onClick:y},t(n.cancelLabel),513),h(`button`,{class:`settings-button settings-button-warning`,type:`button`,onClick:r[0]||=e=>s(`confirm`)},t(n.confirmLabel),1)])])],544))}}),[[`__scopeId`,`data-v-0cce1ba9`]]),I=[`aria-label`,`disabled`,`id`,`name`],L=p({__name:`Switch`,props:s({ariaLabel:{default:void 0},disabled:{type:Boolean,default:!1},id:{default:void 0},name:{default:void 0}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=l(e,`modelValue`);return(n,r)=>(o(),g(`label`,{class:T([`inline-flex cursor-pointer items-center gap-2 rounded-1`,e.disabled?`cursor-not-allowed op50`:``])},[u(h(`input`,{"onUpdate:modelValue":r[0]||=e=>t.value=e,class:`peer sr-only`,type:`checkbox`,"aria-label":e.ariaLabel,disabled:e.disabled,id:e.id,name:e.name},null,8,I),[[k,t.value]]),h(`span`,{class:T([`relative h-4 w-7 shrink-0 border border-base rounded-full bg-#8882 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500/35`,t.value?`border-primary-500/40 bg-primary-500/20`:``]),"aria-hidden":`true`},[h(`span`,{class:T([`absolute left-3px top-1/2 h-2.5 w-2.5 rounded-full bg-#8889 transition-[transform,background-color] -translate-y-1/2`,t.value?`translate-x-3 bg-primary-500`:``])},null,2)],2),a(n.$slots,`default`)],2))}}),R={class:`h-full w-full overflow-y-auto`},z={class:`min-h-full px-8 py-6`},B={class:`grid max-w-300 grid-cols-1 gap-x-10 gap-y-3 md:grid-cols-[repeat(auto-fit,minmax(16rem,1fr))]`},V={class:`flex flex-col gap-2`},H={class:`flex flex-auto items-center justify-start gap-2 capitalize op75`},U={class:`min-w-0 flex flex-auto items-center justify-start gap-2 pr-4 text-sm`},W={class:`truncate`},G=[`disabled`,`onClick`],K=[`disabled`,`onClick`],q=[`aria-label`,`title`,`onClick`],J={class:`flex flex-col gap-2`},Y={class:`panel-card flex flex-col gap-2 p-4`},ne={class:`flex gap-2`},re=[`aria-label`],ie=[`value`],ae={class:`flex gap-2`},X=p({__name:`settings`,setup(e){let{categorizedTabs:i}=ee(),{dark:a,setDarkMode:s}=O(),{settings:c,resetDevtoolsSettings:l}=f(),{scale:p,expandSidebar:v,scrollableSidebar:C,highlightUpdates:k}=_(c),{hiddenTabCategories:N,hiddenTabs:P,pinnedTabs:I}=_(c.tabSettings),X=[[`Tiny`,12/15],[`Small`,14/15],[`Normal`,1],[`Large`,16/15],[`Huge`,18/15]],Z=m(!1);function oe(){s(!a.value)}function se(e,t){$(P,e,!t)}function ce(e,t){$(N,e,!t)}function le(e){$(I,e,!I.value.includes(e))}function Q(e,t){let n=I.value.indexOf(e);if(n===-1)return;let r=n+t;if(r<0||r>=I.value.length)return;let i=[...I.value];i.splice(n,1),i.splice(r,0,e),I.value=i}function ue(){l(),window.location.reload()}function $(e,t,n){let r=e.value.includes(t);if(n&&!r){e.value=[...e.value,t];return}!n&&r&&(e.value=e.value.filter(e=>e!==t))}return(e,s)=>{let c=D(`tooltip`);return o(),g(`div`,R,[h(`div`,z,[s[20]||=h(`div`,{class:`mb-5 flex items-center gap-2 text-xl op75`},[h(`div`,{class:`i-carbon-settings-adjust`}),h(`span`,null,`DevTools Settings`)],-1),h(`div`,B,[h(`div`,V,[s[10]||=h(`h3`,{class:`text-lg`},`Tabs`,-1),(o(!0),g(y,null,n(x(i),([{name:e,hidden:i},a])=>(o(),g(y,{key:e},[a.length?(o(),g(`div`,{key:0,class:T([`panel-card flex flex-col gap-1 p-3`,i?`op50 grayscale`:``])},[E(L,{"model-value":!x(N).includes(e),class:`flex-row-reverse py-1 pl-2 pr-1 hover:bg-active`,"aria-label":`Toggle ${e} tabs`,"onUpdate:modelValue":t=>ce(e,t)},{default:r(()=>[h(`span`,H,t(e),1)]),_:2},1032,[`model-value`,`aria-label`,`onUpdate:modelValue`]),s[9]||=h(`div`,{class:`-mx-1 my-1 h-1px border-b border-base op75`},null,-1),(o(!0),g(y,null,n(a,e=>(o(),S(L,{key:e.id,"model-value":!x(P).includes(e.id),class:T([`flex-row-reverse py-1 pl-2 pr-1 hover:bg-active`,e.hidden?`op35`:``]),"aria-label":`Toggle ${e.title}`,"onUpdate:modelValue":t=>se(e.id,t)},{default:r(()=>[h(`span`,U,[E(j,{class:`text-xl`,icon:e.icon},null,8,[`icon`]),h(`span`,W,t(e.title),1),s[8]||=h(`span`,{class:`flex-auto`},null,-1),x(I).includes(e.id)?(o(),g(y,{key:0},[u((o(),g(`button`,{class:`settings-icon-button`,type:`button`,"aria-label":`Move pinned tab up`,disabled:x(I).indexOf(e.id)===0,title:`Move up`,onClick:A(t=>Q(e.id,-1),[`stop`,`prevent`])},[...s[6]||=[h(`div`,{class:`i-carbon-caret-up`,"aria-hidden":`true`},null,-1)]],8,G)),[[c,`Move up`,void 0,{bottom:!0}]]),u((o(),g(`button`,{class:`settings-icon-button`,type:`button`,"aria-label":`Move pinned tab down`,disabled:x(I).indexOf(e.id)===x(I).length-1,title:`Move down`,onClick:A(t=>Q(e.id,1),[`stop`,`prevent`])},[...s[7]||=[h(`div`,{class:`i-carbon-caret-down`,"aria-hidden":`true`},null,-1)]],8,K)),[[c,`Move down`,void 0,{bottom:!0}]])],64)):b(``,!0),u((o(),g(`button`,{class:`settings-icon-button`,type:`button`,"aria-label":x(I).includes(e.id)?`Unpin tab`:`Pin tab`,title:x(I).includes(e.id)?`Unpin tab`:`Pin tab`,onClick:A(t=>le(e.id),[`stop`,`prevent`])},[h(`div`,{class:T(x(I).includes(e.id)?`i-carbon-pin-filled -rotate-45`:`i-carbon-pin op45`),"aria-hidden":`true`},null,2)],8,q)),[[c,x(I).includes(e.id)?`Unpin tab`:`Pin tab`,void 0,{bottom:!0}]])])]),_:2},1032,[`model-value`,`class`,`aria-label`,`onUpdate:modelValue`]))),128))],2)):b(``,!0)],64))),128))]),h(`div`,J,[s[18]||=h(`h3`,{class:`text-lg`},`Appearance`,-1),h(`div`,Y,[h(`div`,ne,[h(`button`,{class:`settings-button text-primary-700 dark:text-primary-300`,type:`button`,onClick:oe},[h(`div`,{class:T(x(a)?`i-carbon-moon`:`i-carbon-sun`)},null,2),w(` `+t(x(a)?`Dark`:`Light`),1)])]),s[14]||=h(`div`,{class:`-mx-2 my-1 h-1px border-b border-base op75`},null,-1),s[15]||=h(`p`,null,`UI Scale`,-1),h(`div`,null,[u(h(`select`,{"onUpdate:modelValue":s[0]||=e=>d(p)?p.value=e:null,class:`settings-select`,"aria-label":`UI Scale: ${x(p)}`},[(o(),g(y,null,n(X,([e,n])=>h(`option`,{key:e,value:n},t(e),9,ie)),64))],8,re),[[te,x(p),void 0,{number:!0}]])]),s[16]||=h(`div`,{class:`-mx-2 my-1 h-1px border-b border-base op75`},null,-1),E(M,{modelValue:x(v),"onUpdate:modelValue":s[1]||=e=>d(v)?v.value=e:null,class:`text-sm`},{default:r(()=>[...s[11]||=[h(`span`,{class:`op75`},`Expand Sidebar`,-1)]]),_:1},8,[`modelValue`]),E(M,{modelValue:x(C),"onUpdate:modelValue":s[2]||=e=>d(C)?C.value=e:null,class:`text-sm`},{default:r(()=>[...s[12]||=[h(`span`,{class:`op75`},`Scrollable Sidebar`,-1)]]),_:1},8,[`modelValue`]),E(M,{modelValue:x(k),"onUpdate:modelValue":s[3]||=e=>d(k)?k.value=e:null,class:`text-sm`},{default:r(()=>[...s[13]||=[h(`span`,{class:`op75`},`Highlight component updates`,-1)]]),_:1},8,[`modelValue`])]),s[19]||=h(`h3`,{class:`mt-2 text-lg`},`Debug`,-1),h(`div`,ae,[h(`button`,{class:`settings-button text-primary-700 dark:text-primary-300`,type:`button`,onClick:s[4]||=e=>Z.value=!0},[...s[17]||=[h(`div`,{class:`i-carbon-breaking-change`},null,-1),w(` Reset Local Settings & State `,-1)]])])])]),E(F,{open:Z.value,"onUpdate:open":s[5]||=e=>Z.value=e,description:`Are you sure you want to reset all local settings and state? DevTools will reload.`,title:`Clear Local Settings & State`,onConfirm:ue},null,8,[`open`])])])}}});export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,B as t,C as n,D as r,Et as i,G as a,H as o,K as s,L as c,M as l,P as u,d,et as f,h as p,k as m,ot as h,p as g,w as _,x as v}from"./_plugin-vue_export-helper-B6clznOd.js";var y=Object.assign({inheritAttrs:!1},{__name:`splitpanes`,props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1},keyboardStep:{type:Number,default:5}},emits:[`ready`,`resize`,`resized`,`pane-click`,`pane-maximize`,`pane-add`,`pane-remove`,`splitter-click`,`splitter-dblclick`,`direction-changed`],setup(i,{emit:c}){let p=c,h=i,_=o(),v=a(),y=f([]),b=d(()=>y.value.reduce((e,t)=>(e[~~t.id]=t)&&e,{})),x=d(()=>y.value.length),S=f(null),C=f(!1),w=f({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),T=f({splitter:null,timeoutId:null}),E=d(()=>({[`splitpanes splitpanes--${h.horizontal?`horizontal`:`vertical`}`]:!0,"splitpanes--dragging":w.value.dragging,"splitpanes--ready":C.value})),ee=()=>{document.addEventListener(`mousemove`,k,{passive:!1}),document.addEventListener(`mouseup`,A),`ontouchstart`in window&&(document.addEventListener(`touchmove`,k,{passive:!1}),document.addEventListener(`touchend`,A))},D=()=>{document.removeEventListener(`mousemove`,k,{passive:!1}),document.removeEventListener(`mouseup`,A),`ontouchstart`in window&&(document.removeEventListener(`touchmove`,k,{passive:!1}),document.removeEventListener(`touchend`,A))},O=(e,t)=>{let n=e.target.closest(`.splitpanes__splitter`);if(n){let{left:t,top:r}=n.getBoundingClientRect(),{clientX:i,clientY:a}=`ontouchstart`in window&&e.touches?e.touches[0]:e;w.value.cursorOffset=h.horizontal?a-r:i-t}ee(),w.value.mouseDown=!0,w.value.activeSplitter=t,document.documentElement.style.cursor=h.horizontal?`row-resize`:`col-resize`},k=e=>{w.value.mouseDown&&(e.preventDefault(),w.value.dragging||(window.getSelection()?.removeAllRanges(),w.value.dragging=!0),requestAnimationFrame(()=>{L(F(e)),$(`resize`,{event:e},!0)}))},A=e=>{w.value.dragging&&(window.getSelection()?.removeAllRanges(),$(`resized`,{event:e},!0)),w.value.mouseDown=!1,w.value.activeSplitter=null,setTimeout(()=>{w.value.dragging=!1,D(),document.documentElement.style.cursor=``},100)},j=(e,t)=>{`ontouchstart`in window&&(e.preventDefault(),T.value.splitter===t?(clearTimeout(T.value.timeoutId),T.value.timeoutId=null,M(e,t),T.value.splitter=null):(T.value.splitter=t,T.value.timeoutId=setTimeout(()=>T.value.splitter=null,500))),w.value.dragging||$(`splitter-click`,{event:e,index:t},!0)},M=(e,t)=>{if($(`splitter-dblclick`,{event:e,index:t},!0),h.maximizePanes){let n=0;y.value=y.value.map((e,r)=>(e.size=r===t?e.max:e.min,r!==t&&(n+=e.min),e)),y.value[t].size-=n,$(`pane-maximize`,{event:e,index:t,pane:y.value[t]}),$(`resized`,{event:e,index:t},!0)}},N=(e,t)=>{if(!h.keyboardStep)return;let n=h.horizontal?e.key===`ArrowDown`:e.key===`ArrowRight`,r=h.horizontal?e.key===`ArrowUp`:e.key===`ArrowLeft`;if(!n&&!r)return;e.preventDefault(),w.value.activeSplitter=t;let i=(n?1:-1)*(h.rtl&&!h.horizontal?-1:1),a=z(t)+y.value[t].size;R(Math.min(Math.max(a+i*h.keyboardStep,0),100)),$(`resize`,{event:e},!0),$(`resized`,{event:e},!0),w.value.activeSplitter=null},P=(e,t)=>{let n=b.value[t];n&&$(`pane-click`,{event:e,index:n.index,pane:n})},F=e=>{let t=S.value.getBoundingClientRect(),{clientX:n,clientY:r}=`ontouchstart`in window&&e.touches?e.touches[0]:e;return{x:n-(h.horizontal?0:w.value.cursorOffset)-t.left,y:r-(h.horizontal?w.value.cursorOffset:0)-t.top}},I=e=>{e=e[h.horizontal?`y`:`x`];let t=S.value[h.horizontal?`clientHeight`:`clientWidth`];return h.rtl&&!h.horizontal&&(e=t-e),e*100/t},L=e=>{R(I(e))},R=e=>{let t=w.value.activeSplitter;if(t===null||t>=y.value.length-1)return;let n={prevPanesSize:z(t),nextPanesSize:B(t),prevReachedMinPanes:0,nextReachedMinPanes:0},r=0+(h.pushOtherPanes?0:n.prevPanesSize),i=100-(h.pushOtherPanes?0:n.nextPanesSize);e=Math.max(Math.min(e,i),r);let a=[t,t+1],o=y.value[a[0]]||null,s=y.value[a[1]]||null,c=o!==null&&o.max<100&&e>=o.max+n.prevPanesSize,l=s!==null&&s.max<100&&e<=100-(s.max+B(t+1));if(c||l){c?(o.size=o.max,s.size=Math.min(Math.max(100-o.max-n.prevPanesSize-n.nextPanesSize,s.min),s.max)):(o.size=Math.min(Math.max(100-s.max-n.prevPanesSize-B(t+1),o.min),o.max),s.size=s.max);return}if(h.pushOtherPanes){let t=te(n,e);if(!t)return;({sums:n,panesToResize:a}=t),o=y.value[a[0]]||null,s=y.value[a[1]]||null}o!==null&&(o.size=Math.min(Math.max(e-n.prevPanesSize-n.prevReachedMinPanes,o.min),o.max)),s!==null&&(s.size=Math.min(Math.max(100-e-n.nextPanesSize-n.nextReachedMinPanes,s.min),s.max))},te=(e,t)=>{let n=w.value.activeSplitter,r=[n,n+1];if(t<e.prevPanesSize+y.value[r[0]].min){if(r[0]=V(n).index,e.prevReachedMinPanes=0,r[0]<n&&y.value.forEach((t,i)=>{i>r[0]&&i<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),r[0]===void 0)return e.prevReachedMinPanes=0,y.value[0].size=y.value[0].min,y.value.forEach((t,r)=>{r>0&&r<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),y.value[r[1]].size=100-e.prevReachedMinPanes-y.value[0].min-e.prevPanesSize-e.nextPanesSize,null;e.prevPanesSize=z(r[0])}return t>100-e.nextPanesSize-y.value[r[1]].min&&(r[1]=H(n).index,e.nextReachedMinPanes=0,r[1]>n+1&&y.value.forEach((t,i)=>{i>n&&i<r[1]&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),e.nextPanesSize=r[1]===void 0?0:B(r[1]-1),r[1]===void 0)?(e.nextReachedMinPanes=0,y.value.forEach((t,r)=>{r>=n+1&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),r[0]!==void 0&&(y.value[r[0]].size=100-e.prevPanesSize-B(r[0]-1)),null):{sums:e,panesToResize:r}},z=e=>y.value.reduce((t,n,r)=>t+(r<e?n.size:0),0),B=e=>y.value.reduce((t,n,r)=>t+(r>e+1?n.size:0),0),V=e=>[...y.value].reverse().find(t=>t.index<e&&t.size>t.min)||{},H=e=>y.value.find(t=>t.index>e+1&&t.size>t.min)||{},U=()=>{let e=Array.from(S.value?.children||[]);for(let t of e){let e=t.classList.contains(`splitpanes__pane`),n=t.classList.contains(`splitpanes__splitter`);!e&&!n&&(t.remove(),console.warn(`Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.`))}},W=(e,t,n=!1)=>{let r=e-1,i=document.createElement(`div`);i.classList.add(`splitpanes__splitter`),n||(i.onmousedown=e=>O(e,r),typeof window<`u`&&`ontouchstart`in window&&(i.ontouchstart=e=>O(e,r)),i.onclick=e=>j(e,r+1),h.keyboardStep&&(i.setAttribute(`tabindex`,`0`),i.setAttribute(`role`,`separator`),i.setAttribute(`aria-orientation`,h.horizontal?`horizontal`:`vertical`),i.onkeydown=e=>N(e,r))),i.ondblclick=e=>M(e,r+1),t.parentNode.insertBefore(i,t)},G=e=>{e.onmousedown=null,e.onclick=null,e.ondblclick=null,e.onkeydown=null,e.remove()},K=()=>{let e=Array.from(S.value?.children||[]);for(let t of e)t.className.includes(`splitpanes__splitter`)&&G(t);let t=0;for(let n of e)n.className.includes(`splitpanes__pane`)&&(!t&&h.firstSplitter?W(t,n,!0):t&&W(t,n),t++)},q=({uid:e,...t})=>{let n=b.value[e];for(let[e,r]of Object.entries(t))n[e]=r},J=!1,Y=e=>{let t=-1;Array.from(S.value?.children||[]).some(n=>(n.className.includes(`splitpanes__pane`)&&t++,n.isSameNode(e.el))),y.value.splice(t,0,{...e,index:t}),y.value.forEach((e,t)=>e.index=t),C.value&&!J&&(J=!0,r(()=>{K(),Z({addedPane:y.value[t]}),$(`pane-add`,{pane:y.value[t]}),J=!1}))},X=e=>{let t=y.value.findIndex(t=>t.id===e);y.value[t].el=null;let n=y.value.splice(t,1)[0];y.value.forEach((e,t)=>e.index=t),r(()=>{K(),$(`pane-remove`,{pane:n}),Z({removedPane:{...n,index:t}})})},Z=(e={})=>{!e.addedPane&&!e.removedPane?re():y.value.some(e=>e.givenSize!==null||e.min||e.max<100)?ie(e):ne(),C.value&&$(`resized`)},ne=()=>{let e=100/x.value,t=100,n=[],r=[];for(let i of y.value)i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&n.push(i.id),i.size<=i.min&&r.push(i.id);Math.abs(t)>.1&&Q(t,n,r)},re=()=>{let e=100,t=[],n=[],r=0;for(let i of y.value)e-=i.size,i.givenSize!==null&&r++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id);let i=100;if(e>.1){for(let t of y.value)t.givenSize===null&&(t.size=Math.max(Math.min(e/(x.value-r),t.max),t.min)),i-=t.size;i>.1&&Q(i,t,n)}},ie=({addedPane:e,removedPane:t}={})=>{let n=y.value.reduce((e,t)=>e+(t.givenSize===null?0:t.givenSize),0),r=y.value.filter(e=>e.givenSize===null).length,i=r>0?(100-n)/r:0,a=0,o=[],s=[];for(let e of y.value)a-=e.size,e.size>=e.max&&o.push(e.id),e.size<=e.min&&s.push(e.id);if(!(Math.abs(a)<.1)){a=100;for(let e of y.value)e.givenSize===null&&(e.size=Math.max(Math.min(i,e.max),e.min)),a-=e.size,e.size>=e.max&&o.push(e.id),e.size<=e.min&&s.push(e.id);Math.abs(a)>.1&&Q(a,o,s)}},Q=(e,t,n)=>{let r;r=e>0?e/(x.value-t.length):e/(x.value-n.length),y.value.forEach((i,a)=>{if(e>0&&!t.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}else if(!n.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}}),Math.abs(e)>.1&&C.value&&console.warn(`Splitpanes: Could not resize panes correctly due to their constraints.`)},$=(e,t=void 0,n=!1)=>{let r=t?.index??w.value.activeSplitter??null;p(e,{...t,...r!==null&&{index:r},...n&&r!==null&&{prevPane:y.value[r-+!!h.firstSplitter],nextPane:y.value[r+ +!h.firstSplitter]},panes:y.value.map(e=>({min:e.min,max:e.max,size:e.size}))})};s(()=>h.firstSplitter,()=>K()),s(()=>h.horizontal,e=>r(()=>{p(`direction-changed`,{horizontal:e,panes:y.value.map(e=>({min:e.min,max:e.max,size:e.size}))})})),e(()=>{U(),K(),Z(),$(`ready`),C.value=!0}),m(()=>C.value=!1);let ae=()=>{let{class:e,...t}=_;return n(`div`,{ref:S,class:[E.value,e],...t},v.default?.())};return u(`panes`,y),u(`indexedPanes`,b),u(`horizontal`,d(()=>h.horizontal)),u(`requestUpdate`,q),u(`onPaneAdd`,Y),u(`onPaneRemove`,X),u(`onPaneClick`,P),(e,n)=>(l(),g(t(ae)))}}),b={__name:`pane`,props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(t){let n=t,r=_(`requestUpdate`),a=_(`onPaneAdd`),o=_(`horizontal`),u=_(`onPaneRemove`),g=_(`onPaneClick`),y=v()?.uid,b=_(`indexedPanes`),x=d(()=>b.value[y]),S=f(null),C=d(()=>{let e=isNaN(n.size)||n.size===void 0?0:parseFloat(n.size);return Math.max(Math.min(e,T.value),w.value)}),w=d(()=>{let e=parseFloat(n.minSize);return isNaN(e)?0:e}),T=d(()=>{let e=parseFloat(n.maxSize);return isNaN(e)?100:e}),E=d(()=>{let e=x.value?.size??(n.size===void 0?void 0:C.value);return e===void 0?``:`${o.value?`height`:`width`}: ${e}%`});return s(()=>C.value,e=>r({uid:y,size:e})),s(()=>w.value,e=>r({uid:y,min:e})),s(()=>T.value,e=>r({uid:y,max:e})),e(()=>{a({id:y,el:S.value,min:w.value,max:T.value,givenSize:n.size===void 0?null:C.value,size:C.value})}),m(()=>u(y)),(e,t)=>(l(),p(`div`,{ref_key:`paneEl`,ref:S,class:`splitpanes__pane`,onClick:t[0]||=t=>h(g)(t,e._.uid),style:i(E.value)},[c(e.$slots,`default`)],4))}};export{y as n,b as t};
|
|
1
|
+
import{A as e,B as t,C as n,D as r,Et as i,G as a,H as o,K as s,L as c,M as l,P as u,d,et as f,h as p,k as m,ot as h,p as g,w as _,x as v}from"./_plugin-vue_export-helper-Ch5OTWxJ.js";var y=Object.assign({inheritAttrs:!1},{__name:`splitpanes`,props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1},keyboardStep:{type:Number,default:5}},emits:[`ready`,`resize`,`resized`,`pane-click`,`pane-maximize`,`pane-add`,`pane-remove`,`splitter-click`,`splitter-dblclick`,`direction-changed`],setup(i,{emit:c}){let p=c,h=i,_=o(),v=a(),y=f([]),b=d(()=>y.value.reduce((e,t)=>(e[~~t.id]=t)&&e,{})),x=d(()=>y.value.length),S=f(null),C=f(!1),w=f({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),T=f({splitter:null,timeoutId:null}),E=d(()=>({[`splitpanes splitpanes--${h.horizontal?`horizontal`:`vertical`}`]:!0,"splitpanes--dragging":w.value.dragging,"splitpanes--ready":C.value})),ee=()=>{document.addEventListener(`mousemove`,k,{passive:!1}),document.addEventListener(`mouseup`,A),`ontouchstart`in window&&(document.addEventListener(`touchmove`,k,{passive:!1}),document.addEventListener(`touchend`,A))},D=()=>{document.removeEventListener(`mousemove`,k,{passive:!1}),document.removeEventListener(`mouseup`,A),`ontouchstart`in window&&(document.removeEventListener(`touchmove`,k,{passive:!1}),document.removeEventListener(`touchend`,A))},O=(e,t)=>{let n=e.target.closest(`.splitpanes__splitter`);if(n){let{left:t,top:r}=n.getBoundingClientRect(),{clientX:i,clientY:a}=`ontouchstart`in window&&e.touches?e.touches[0]:e;w.value.cursorOffset=h.horizontal?a-r:i-t}ee(),w.value.mouseDown=!0,w.value.activeSplitter=t,document.documentElement.style.cursor=h.horizontal?`row-resize`:`col-resize`},k=e=>{w.value.mouseDown&&(e.preventDefault(),w.value.dragging||(window.getSelection()?.removeAllRanges(),w.value.dragging=!0),requestAnimationFrame(()=>{L(F(e)),$(`resize`,{event:e},!0)}))},A=e=>{w.value.dragging&&(window.getSelection()?.removeAllRanges(),$(`resized`,{event:e},!0)),w.value.mouseDown=!1,w.value.activeSplitter=null,setTimeout(()=>{w.value.dragging=!1,D(),document.documentElement.style.cursor=``},100)},j=(e,t)=>{`ontouchstart`in window&&(e.preventDefault(),T.value.splitter===t?(clearTimeout(T.value.timeoutId),T.value.timeoutId=null,M(e,t),T.value.splitter=null):(T.value.splitter=t,T.value.timeoutId=setTimeout(()=>T.value.splitter=null,500))),w.value.dragging||$(`splitter-click`,{event:e,index:t},!0)},M=(e,t)=>{if($(`splitter-dblclick`,{event:e,index:t},!0),h.maximizePanes){let n=0;y.value=y.value.map((e,r)=>(e.size=r===t?e.max:e.min,r!==t&&(n+=e.min),e)),y.value[t].size-=n,$(`pane-maximize`,{event:e,index:t,pane:y.value[t]}),$(`resized`,{event:e,index:t},!0)}},N=(e,t)=>{if(!h.keyboardStep)return;let n=h.horizontal?e.key===`ArrowDown`:e.key===`ArrowRight`,r=h.horizontal?e.key===`ArrowUp`:e.key===`ArrowLeft`;if(!n&&!r)return;e.preventDefault(),w.value.activeSplitter=t;let i=(n?1:-1)*(h.rtl&&!h.horizontal?-1:1),a=z(t)+y.value[t].size;R(Math.min(Math.max(a+i*h.keyboardStep,0),100)),$(`resize`,{event:e},!0),$(`resized`,{event:e},!0),w.value.activeSplitter=null},P=(e,t)=>{let n=b.value[t];n&&$(`pane-click`,{event:e,index:n.index,pane:n})},F=e=>{let t=S.value.getBoundingClientRect(),{clientX:n,clientY:r}=`ontouchstart`in window&&e.touches?e.touches[0]:e;return{x:n-(h.horizontal?0:w.value.cursorOffset)-t.left,y:r-(h.horizontal?w.value.cursorOffset:0)-t.top}},I=e=>{e=e[h.horizontal?`y`:`x`];let t=S.value[h.horizontal?`clientHeight`:`clientWidth`];return h.rtl&&!h.horizontal&&(e=t-e),e*100/t},L=e=>{R(I(e))},R=e=>{let t=w.value.activeSplitter;if(t===null||t>=y.value.length-1)return;let n={prevPanesSize:z(t),nextPanesSize:B(t),prevReachedMinPanes:0,nextReachedMinPanes:0},r=0+(h.pushOtherPanes?0:n.prevPanesSize),i=100-(h.pushOtherPanes?0:n.nextPanesSize);e=Math.max(Math.min(e,i),r);let a=[t,t+1],o=y.value[a[0]]||null,s=y.value[a[1]]||null,c=o!==null&&o.max<100&&e>=o.max+n.prevPanesSize,l=s!==null&&s.max<100&&e<=100-(s.max+B(t+1));if(c||l){c?(o.size=o.max,s.size=Math.min(Math.max(100-o.max-n.prevPanesSize-n.nextPanesSize,s.min),s.max)):(o.size=Math.min(Math.max(100-s.max-n.prevPanesSize-B(t+1),o.min),o.max),s.size=s.max);return}if(h.pushOtherPanes){let t=te(n,e);if(!t)return;({sums:n,panesToResize:a}=t),o=y.value[a[0]]||null,s=y.value[a[1]]||null}o!==null&&(o.size=Math.min(Math.max(e-n.prevPanesSize-n.prevReachedMinPanes,o.min),o.max)),s!==null&&(s.size=Math.min(Math.max(100-e-n.nextPanesSize-n.nextReachedMinPanes,s.min),s.max))},te=(e,t)=>{let n=w.value.activeSplitter,r=[n,n+1];if(t<e.prevPanesSize+y.value[r[0]].min){if(r[0]=V(n).index,e.prevReachedMinPanes=0,r[0]<n&&y.value.forEach((t,i)=>{i>r[0]&&i<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),r[0]===void 0)return e.prevReachedMinPanes=0,y.value[0].size=y.value[0].min,y.value.forEach((t,r)=>{r>0&&r<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),y.value[r[1]].size=100-e.prevReachedMinPanes-y.value[0].min-e.prevPanesSize-e.nextPanesSize,null;e.prevPanesSize=z(r[0])}return t>100-e.nextPanesSize-y.value[r[1]].min&&(r[1]=H(n).index,e.nextReachedMinPanes=0,r[1]>n+1&&y.value.forEach((t,i)=>{i>n&&i<r[1]&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),e.nextPanesSize=r[1]===void 0?0:B(r[1]-1),r[1]===void 0)?(e.nextReachedMinPanes=0,y.value.forEach((t,r)=>{r>=n+1&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),r[0]!==void 0&&(y.value[r[0]].size=100-e.prevPanesSize-B(r[0]-1)),null):{sums:e,panesToResize:r}},z=e=>y.value.reduce((t,n,r)=>t+(r<e?n.size:0),0),B=e=>y.value.reduce((t,n,r)=>t+(r>e+1?n.size:0),0),V=e=>[...y.value].reverse().find(t=>t.index<e&&t.size>t.min)||{},H=e=>y.value.find(t=>t.index>e+1&&t.size>t.min)||{},U=()=>{let e=Array.from(S.value?.children||[]);for(let t of e){let e=t.classList.contains(`splitpanes__pane`),n=t.classList.contains(`splitpanes__splitter`);!e&&!n&&(t.remove(),console.warn(`Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.`))}},W=(e,t,n=!1)=>{let r=e-1,i=document.createElement(`div`);i.classList.add(`splitpanes__splitter`),n||(i.onmousedown=e=>O(e,r),typeof window<`u`&&`ontouchstart`in window&&(i.ontouchstart=e=>O(e,r)),i.onclick=e=>j(e,r+1),h.keyboardStep&&(i.setAttribute(`tabindex`,`0`),i.setAttribute(`role`,`separator`),i.setAttribute(`aria-orientation`,h.horizontal?`horizontal`:`vertical`),i.onkeydown=e=>N(e,r))),i.ondblclick=e=>M(e,r+1),t.parentNode.insertBefore(i,t)},G=e=>{e.onmousedown=null,e.onclick=null,e.ondblclick=null,e.onkeydown=null,e.remove()},K=()=>{let e=Array.from(S.value?.children||[]);for(let t of e)t.className.includes(`splitpanes__splitter`)&&G(t);let t=0;for(let n of e)n.className.includes(`splitpanes__pane`)&&(!t&&h.firstSplitter?W(t,n,!0):t&&W(t,n),t++)},q=({uid:e,...t})=>{let n=b.value[e];for(let[e,r]of Object.entries(t))n[e]=r},J=!1,Y=e=>{let t=-1;Array.from(S.value?.children||[]).some(n=>(n.className.includes(`splitpanes__pane`)&&t++,n.isSameNode(e.el))),y.value.splice(t,0,{...e,index:t}),y.value.forEach((e,t)=>e.index=t),C.value&&!J&&(J=!0,r(()=>{K(),Z({addedPane:y.value[t]}),$(`pane-add`,{pane:y.value[t]}),J=!1}))},X=e=>{let t=y.value.findIndex(t=>t.id===e);y.value[t].el=null;let n=y.value.splice(t,1)[0];y.value.forEach((e,t)=>e.index=t),r(()=>{K(),$(`pane-remove`,{pane:n}),Z({removedPane:{...n,index:t}})})},Z=(e={})=>{!e.addedPane&&!e.removedPane?re():y.value.some(e=>e.givenSize!==null||e.min||e.max<100)?ie(e):ne(),C.value&&$(`resized`)},ne=()=>{let e=100/x.value,t=100,n=[],r=[];for(let i of y.value)i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&n.push(i.id),i.size<=i.min&&r.push(i.id);Math.abs(t)>.1&&Q(t,n,r)},re=()=>{let e=100,t=[],n=[],r=0;for(let i of y.value)e-=i.size,i.givenSize!==null&&r++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id);let i=100;if(e>.1){for(let t of y.value)t.givenSize===null&&(t.size=Math.max(Math.min(e/(x.value-r),t.max),t.min)),i-=t.size;i>.1&&Q(i,t,n)}},ie=({addedPane:e,removedPane:t}={})=>{let n=y.value.reduce((e,t)=>e+(t.givenSize===null?0:t.givenSize),0),r=y.value.filter(e=>e.givenSize===null).length,i=r>0?(100-n)/r:0,a=0,o=[],s=[];for(let e of y.value)a-=e.size,e.size>=e.max&&o.push(e.id),e.size<=e.min&&s.push(e.id);if(!(Math.abs(a)<.1)){a=100;for(let e of y.value)e.givenSize===null&&(e.size=Math.max(Math.min(i,e.max),e.min)),a-=e.size,e.size>=e.max&&o.push(e.id),e.size<=e.min&&s.push(e.id);Math.abs(a)>.1&&Q(a,o,s)}},Q=(e,t,n)=>{let r;r=e>0?e/(x.value-t.length):e/(x.value-n.length),y.value.forEach((i,a)=>{if(e>0&&!t.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}else if(!n.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}}),Math.abs(e)>.1&&C.value&&console.warn(`Splitpanes: Could not resize panes correctly due to their constraints.`)},$=(e,t=void 0,n=!1)=>{let r=t?.index??w.value.activeSplitter??null;p(e,{...t,...r!==null&&{index:r},...n&&r!==null&&{prevPane:y.value[r-+!!h.firstSplitter],nextPane:y.value[r+ +!h.firstSplitter]},panes:y.value.map(e=>({min:e.min,max:e.max,size:e.size}))})};s(()=>h.firstSplitter,()=>K()),s(()=>h.horizontal,e=>r(()=>{p(`direction-changed`,{horizontal:e,panes:y.value.map(e=>({min:e.min,max:e.max,size:e.size}))})})),e(()=>{U(),K(),Z(),$(`ready`),C.value=!0}),m(()=>C.value=!1);let ae=()=>{let{class:e,...t}=_;return n(`div`,{ref:S,class:[E.value,e],...t},v.default?.())};return u(`panes`,y),u(`indexedPanes`,b),u(`horizontal`,d(()=>h.horizontal)),u(`requestUpdate`,q),u(`onPaneAdd`,Y),u(`onPaneRemove`,X),u(`onPaneClick`,P),(e,n)=>(l(),g(t(ae)))}}),b={__name:`pane`,props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(t){let n=t,r=_(`requestUpdate`),a=_(`onPaneAdd`),o=_(`horizontal`),u=_(`onPaneRemove`),g=_(`onPaneClick`),y=v()?.uid,b=_(`indexedPanes`),x=d(()=>b.value[y]),S=f(null),C=d(()=>{let e=isNaN(n.size)||n.size===void 0?0:parseFloat(n.size);return Math.max(Math.min(e,T.value),w.value)}),w=d(()=>{let e=parseFloat(n.minSize);return isNaN(e)?0:e}),T=d(()=>{let e=parseFloat(n.maxSize);return isNaN(e)?100:e}),E=d(()=>{let e=x.value?.size??(n.size===void 0?void 0:C.value);return e===void 0?``:`${o.value?`height`:`width`}: ${e}%`});return s(()=>C.value,e=>r({uid:y,size:e})),s(()=>w.value,e=>r({uid:y,min:e})),s(()=>T.value,e=>r({uid:y,max:e})),e(()=>{a({id:y,el:S.value,min:w.value,max:T.value,givenSize:n.size===void 0?null:C.value,size:C.value})}),m(()=>u(y)),(e,t)=>(l(),p(`div`,{ref_key:`paneEl`,ref:S,class:`splitpanes__pane`,onClick:t[0]||=t=>h(g)(t,e._.uid),style:i(E.value)},[c(e.$slots,`default`)],4))}};export{y as n,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,D as t,Dt as n,Et as r,I as i,J as a,K as o,M as s,Y as c,b as ee,d as l,et as u,f as d,h as f,i as te,j as ne,l as p,m,ot as h,p as g,t as _,v as re,wt as v,y,z as ie}from"./_plugin-vue_export-helper-Ch5OTWxJ.js";import{p as ae}from"./index-Bv8QmTQo.js";import{n as oe,t as se}from"./RecycleScroller.vue_vue_type_script_setup_true_lang-C7mZBLYi-Cs8N2BLS.js";import{n as b,t as x}from"./splitpanes.esm-pCUnIIVu.js";var ce={class:`h-full min-h-0 flex flex-col p-2`},S={class:`relative mb-1 min-h-7 w-full shrink-0 flex items-center justify-end border-b border-b-dashed border-base pb-1`},le={key:0,class:`absolute left-2 top-1/2 -translate-y-1/2 text-xs text-gray-300 dark:text-gray-500`},ue={class:`flex items-center gap-2 px-1`},de=[`aria-label`],fe={class:`no-scrollbar m-0 min-h-0 flex-1 list-none overflow-auto p-2`},pe=[`onClick`],me={class:`min-w-0 flex-1 truncate`},he=[`aria-label`,`onClick`],ge={class:`relative h-full min-h-0 flex flex-col`},_e={class:`h-full min-h-0 box-border py-2`},ve=[`onClick`],ye={class:`relative h-full w-3 shrink-0 flex items-center justify-center`,"aria-hidden":`true`},be={key:1,class:`absolute left-1/2 top-1/2 w-1.5 border-t border-t-solid border-gray-300 dark:border-gray-600`},xe={key:1,class:`max-w-2/5 shrink-0 truncate color-muted op70`},Se={class:`ml-auto w-23 shrink-0 text-right font-mono text-3 color-muted tabular-nums`},Ce={class:`op50`},we={class:`no-scrollbar h-full min-h-0 overflow-auto p-5`},Te=[`aria-expanded`,`onClick`],Ee={class:`font-state-field text-3.5 text-#a3a3a3`},C={key:0,class:`font-state-field grid grid-cols-[max-content_auto_minmax(0,1fr)] pl-5 text-3.5`},w={class:`state-key py-0.5 op70`},T={class:`state-value min-w-0 break-all py-0.5`},E={key:0,class:`col-span-3 grid grid-cols-[max-content_auto_minmax(0,1fr)] pl-4`},D={class:`state-key py-0.5 op70`},De={class:`state-value min-w-0 break-all py-0.5`},Oe={key:1,class:`min-h-0 flex-1 flex items-center justify-center color-muted`},ke={class:`text-center`},Ae={key:0,class:`mt-1 text-12px op70`},je=`#a17646`,Me=28,O=_(ee({__name:`timeline`,setup(ee){let _=[{id:`mouse`,label:`Mouse`},{id:`keyboard`,label:`Keyboard`},{id:`component-event`,label:`Component events`},{id:`performance`,label:`Performance`}],{apps:O,clearTimelineEvents:Ne,formatValue:k,isTimelineLayerEnabled:A,inspectTimelineEvent:Pe,selectedTimelineLayerId:Fe,selectedAppId:j,selectTimelineLayer:M,timeline:Ie,timelineLayers:Le,timelineRecording:N,toggleTimelineLayerEnabled:Re,toggleTimelineRecording:P}=te(),F=u(),I=u(!1),L=Fe,R=u(),z=u(new Set),B=u(),V,H=l(()=>Ie.value.filter(e=>!e.appId||!j.value||e.appId===j.value)),U=l(()=>{let e=new Map;for(let t of _)e.set(t.id,t);for(let t of Le.value)t.appId&&j.value&&t.appId!==j.value||e.set(t.id,t);for(let t of H.value)t.layerId&&!e.has(t.layerId)&&e.set(t.layerId,{id:t.layerId,label:Je(t.layerId)});return[...e.values()]}),W=l(()=>H.value.filter(e=>e.layerId===L.value&&e.layerId&&A(e.layerId))),G=l(()=>{let e=W.value,t=q.value?$(q.value):`#42b983`;return e.map((n,r)=>{let i=e[r-1],a=e[r+1],o=e=>n.groupId!=null&&e?.groupId===n.groupId;return{...n,color:n.type===`timeline:eventsLimited`?je:t,delta:i&&n.time>=i.time?n.time-i.time:void 0,grouped:o(i),groupStart:!o(i)&&o(a),repeatsTitle:o(i)&&(i.title??i.label)===(n.title??n.label),groupEnd:o(i)&&!o(a)}})}),K=l(()=>G.value.find(e=>e.id===R.value)??G.value[G.value.length-1]),q=l(()=>U.value.find(e=>e.id===L.value)),ze=l(()=>{let e=K.value;if(!e)return[];let t=[];t.push({id:`event`,label:`Event`,rows:Ge(e)}),e.data&&t.push({id:`data`,label:`Data`,rows:Y(e.data)}),e.meta&&t.push({id:`meta`,label:`Meta`,rows:Y(e.meta)});let n=Ke(e);return n.length&&t.push({id:`group`,label:`Group`,rows:n}),t});o(U,e=>{e.some(e=>e.id===L.value)||M(e[0]?.id??``)},{immediate:!0}),o(G,async e=>{e.some(e=>e.id===R.value)||(R.value=e[e.length-1]?.id,await t(),B.value?.scrollToItem(e.length-1))},{immediate:!0});function Be(e){let t=new Set(z.value);t.delete(e)||t.add(e),z.value=t}function Ve(e){M(e)}function He(e){Re(e)}function J(e){return A(e)}function Ue(e){R.value=e;let t=G.value.find(t=>t.id===e);t&&Pe(t)}function We(){Ne(),R.value=void 0}function Ge(e){let t=[{key:`title`,value:e.title??e.label},{key:`timestamp`,value:Q(e.time)}];return e.delta!=null&&t.push({key:`delta`,value:qe(e.delta)}),e.subtitle&&t.push({key:`subtitle`,value:e.subtitle}),e.layerId&&t.push({key:`layer`,value:e.layerId}),e.logType&&t.push({key:`logType`,value:e.logType}),t}function Ke(e){if(e.groupId==null)return[];let t=W.value.filter(t=>t.groupId===e.groupId);if(!t.length)return[];let n=t[0].time,r=t[t.length-1].time;return[{key:`events`,value:String(t.length)},{key:`duration`,value:`${Math.max(0,r-n)}ms`}]}function Y(e){let t=X(e);return t.length?t:[{key:`value`,value:k(e)}]}function X(e){return Z(e).map(e=>({key:e.key,value:k(e.value),children:X(e.value).slice(0,5)}))}function Z(e){return!e||typeof e!=`object`?[]:e.kind===`custom`?e.value&&typeof e.value==`object`?Z(e.value):[]:`preview`in e&&Array.isArray(e.preview)?e.preview.slice(0,12):[]}function Q(e){let t=new Date(e),n=(e,t=2)=>String(e).padStart(t,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}.${n(t.getMilliseconds(),3)}`}function qe(e){return e==null?``:e<1e3?`+${Math.max(0,Math.round(e))}ms`:e<6e4?`+${(e/1e3).toFixed(1)}s`:`+${Math.round(e/6e4)}m`}function $(e){return e.color==null?`#42b983`:`#${e.color.toString(16).padStart(6,`0`)}`}function Je(e){return e.split(/[-:]/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(` `)}function Ye(e){switch(e){case`error`:return`text-red-500 dark:text-red-300`;case`warning`:return`text-amber-500 dark:text-amber-300`;default:return``}}return e(()=>{V=new ResizeObserver(([e])=>{I.value=e.contentRect.width<700}),F.value&&V.observe(F.value)}),ne(()=>{V?.disconnect()}),(e,t)=>{let o=ie(`tooltip`);return s(),f(`div`,{ref_key:`container`,ref:F,class:`h-full w-full`},[y(h(b),{class:`h-full min-h-0 overflow-hidden`,horizontal:I.value},{default:a(()=>[h(O).length>1?(s(),g(h(x),{key:0,class:`h-full min-h-0`,"min-size":`12`,size:`18`},{default:a(()=>[y(oe)]),_:1})):m(``,!0),y(h(x),{class:`h-full min-h-0`,"min-size":`20`,size:h(O).length>1?22:25},{default:a(()=>[d(`div`,ce,[d(`div`,S,[h(N)?m(``,!0):(s(),f(`span`,le,` Not recording `)),d(`div`,ue,[c((s(),f(`button`,{class:`h-6 w-6 border-0 bg-transparent p-0 flex items-center justify-center`,type:`button`,"aria-label":h(N)?`Stop recording`:`Start recording`,onClick:t[0]||=(...e)=>h(P)&&h(P)(...e)},[d(`span`,{class:v([`h-3.5 w-3.5 cursor-pointer rounded-full inline-flex`,h(N)?`recording bg-#ef4444`:`bg-black op70 hover:op100 dark:bg-white`]),"aria-hidden":`true`},null,2)],8,de)),[[o,h(N)?`Stop recording`:`Start recording — Timeline recording may add overhead in large applications.`,void 0,{"bottom-end":!0}]]),c((s(),f(`button`,{class:`h-6 w-6 border-0 bg-transparent p-0 color-muted flex items-center justify-center hover:color-base`,type:`button`,"aria-label":`Clear all timelines`,onClick:We},[...t[1]||=[d(`span`,{class:`i-ic-baseline-delete text-xl`,"aria-hidden":`true`},null,-1)]])),[[o,`Clear all timelines`,void 0,{"bottom-end":!0}]])])]),d(`ul`,fe,[(s(!0),f(p,null,i(U.value,e=>(s(),f(`li`,{key:e.id,class:v([`group relative min-h-7 cursor-pointer rounded-1 px-2 py-1 color-base flex items-center gap-2 text-3.5 hover:bg-active`,{"active bg-primary-600! text-white hover:bg-primary-600!":e.id===h(L),op60:!J(e.id)}]),onClick:t=>Ve(e.id)},[d(`span`,{class:`h-2.5 w-2.5 shrink-0 rounded-full`,style:r({backgroundColor:$(e)}),"aria-hidden":`true`},null,4),d(`span`,me,n(e.label),1),d(`button`,{class:`absolute right-2 rounded-1 border-0 bg-primary-500 px-1 color-white text-3 op0 group-hover:op80 hover:op100 [.active_&]:(bg-primary-400 dark:bg-gray-600)`,type:`button`,"aria-label":J(e.id)?`Disable layer`:`Enable layer`,onClick:ae(t=>He(e.id),[`stop`])},n(J(e.id)?`Disable`:`Enable`),9,he)],10,pe))),128))])])]),_:1},8,[`size`]),y(h(x),{class:`h-full min-h-0`,size:h(O).length>1?60:75,"min-size":`40`},{default:a(()=>[d(`div`,ge,[G.value.length?(s(),g(h(b),{key:0,class:`h-full min-h-0`},{default:a(()=>[y(h(x),{class:`h-full min-h-0`,"min-size":`30`,size:`40`},{default:a(()=>[d(`div`,_e,[y(h(se),{ref_key:`eventListScroller`,ref:B,class:`no-scrollbar h-full min-h-0 select-none overflow-auto`,items:G.value,"item-size":Me,"key-field":`id`,"list-tag":`ul`,"item-tag":`li`,"list-class":`m-0 list-none p-0`,"item-class":`block w-full`,buffer:520,prerender:20},{default:a(({item:e})=>[d(`div`,{class:v([`relative h-7 cursor-pointer pl-3 pr-3 flex items-center gap-3 text-3.25 hover:bg-#8881`,{"bg-#8882! hover:bg-#8882":K.value?.id===e.id}]),onClick:t=>Ue(e.id)},[d(`span`,ye,[e.grouped||e.groupStart?(s(),f(`span`,{key:0,class:v([`absolute left-1/2 w-0 border-l border-l-solid border-gray-300 dark:border-gray-600`,e.groupStart?`top-1/2 h-1/2`:e.groupEnd?`top-0 h-1/2`:`top-0 h-full`])},null,2)):m(``,!0),e.grouped?(s(),f(`span`,be)):(s(),f(`span`,{key:2,class:`h-2 w-2 rounded-full`,style:r({backgroundColor:e.color})},null,4))]),!e.repeatsTitle||!e.subtitle?(s(),f(`span`,{key:0,class:v([`min-w-0 truncate`,e.type===`timeline:eventsLimited`?void 0:Ye(e.logType)||`color-base`]),style:r(e.type===`timeline:eventsLimited`?{color:e.color}:void 0)},n(e.title??e.label),7)):m(``,!0),e.subtitle&&!e.groupStart?(s(),f(`span`,xe,n(e.subtitle),1)):m(``,!0),d(`span`,Se,[d(`span`,Ce,n(Q(e.time).slice(0,6)),1),re(n(Q(e.time).slice(6)),1)])],10,ve)]),_:1},8,[`items`])])]),_:1}),y(h(x),{class:`h-full min-h-0`,"min-size":`36`,size:`60`},{default:a(()=>[d(`div`,we,[(s(!0),f(p,null,i(ze.value,e=>(s(),f(`section`,{key:e.id,class:`mb-3`},[d(`button`,{class:`w-full cursor-pointer border-0 bg-transparent p-0 color-inherit flex items-center`,type:`button`,"aria-expanded":!z.value.has(e.id),onClick:t=>Be(e.id)},[d(`span`,{class:v([`i-carbon-chevron-right flex-none text-4 op50 transition-transform`,{"rotate-90":!z.value.has(e.id)}]),"aria-hidden":`true`},null,2),d(`span`,Ee,n(e.label),1)],8,Te),z.value.has(e.id)?m(``,!0):(s(),f(`div`,C,[(s(!0),f(p,null,i(e.rows,r=>(s(),f(p,{key:`${e.id}-${r.key}`},[d(`span`,w,n(r.key),1),t[3]||=d(`span`,{class:`colon mx-1 py-0.5`},`:`,-1),d(`span`,T,n(r.value),1),r.children?.length?(s(),f(`div`,E,[(s(!0),f(p,null,i(r.children,i=>(s(),f(p,{key:`${e.id}-${r.key}-${i.key}`},[d(`span`,D,n(i.key),1),t[2]||=d(`span`,{class:`colon mx-1 py-0.5`},`:`,-1),d(`span`,De,n(i.value),1)],64))),128))])):m(``,!0)],64))),128))]))]))),128))])]),_:1})]),_:1})):(s(),f(`div`,Oe,[d(`div`,ke,[t[4]||=d(`div`,{class:`mx-auto mb-3 h-10 w-10 flex items-center justify-center`},[d(`span`,{class:`i-carbon-time text-9 op70`,"aria-hidden":`true`})],-1),t[5]||=d(`div`,null,`No events`,-1),q.value?(s(),f(`div`,Ae,n(q.value.label),1)):m(``,!0)])]))])]),_:1},8,[`size`])]),_:1},8,[`horizontal`])],512)}}}),[[`__scopeId`,`data-v-2baf7eb6`]]);export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@keyframes pulse-2baf7eb6{50%{opacity:.5}}.recording[data-v-2baf7eb6]{transition-duration:1s;animation:2s cubic-bezier(.4,0,.6,1) infinite pulse-2baf7eb6;box-shadow:0 0 8px #ef4444}
|
package/client/index.html
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Vue DevTools</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-Bv8QmTQo.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="./assets/browser-agent-Pu-FLk6I-Dsjmnbas.js">
|
|
9
|
-
<link rel="modulepreload" crossorigin href="./assets/_plugin-vue_export-helper-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<link rel="modulepreload" crossorigin href="./assets/_plugin-vue_export-helper-Ch5OTWxJ.js">
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DeVPR5Sm.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="app"></div>
|
package/dist/client.d.mts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { DevtoolsKit } from "@vue/devtools-kit";
|
|
2
2
|
import { DevToolsClientContext, DockClientScriptContext } from "@vitejs/devtools-kit/client";
|
|
3
3
|
//#region src/client.d.ts
|
|
4
|
-
interface InstallVueDevToolsOptions {
|
|
4
|
+
export interface InstallVueDevToolsOptions {
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare function installVueDevTools(options: InstallVueDevToolsOptions): DevtoolsKit;
|
|
8
|
-
declare const injectVueDevTools: typeof installVueDevTools;
|
|
9
|
-
declare function setupVueDevToolsDockController(context?: DevToolsClientContext | DockClientScriptContext): void;
|
|
10
|
-
declare function disposeVueDevTools(): void;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { InstallVueDevToolsOptions, disposeVueDevTools, injectVueDevTools, installVueDevTools, setupVueDevToolsDockController };
|
|
13
|
-
//# sourceMappingURL=client.d.mts.map
|
|
7
|
+
export declare function installVueDevTools(options: InstallVueDevToolsOptions): DevtoolsKit;
|
|
8
|
+
export declare const injectVueDevTools: typeof installVueDevTools;
|
|
9
|
+
export declare function setupVueDevToolsDockController(context?: DevToolsClientContext | DockClientScriptContext): void;
|
|
10
|
+
export declare function disposeVueDevTools(): void;
|
|
11
|
+
//#endregion
|
package/dist/client.mjs
CHANGED
|
@@ -1,105 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createDevtoolsKit, startIframeDevtoolsRpcHost } from "@vue/devtools-kit";
|
|
3
|
-
//#region src/component-inspector.ts
|
|
4
|
-
async function closeDockPanelForComponentInspection(context) {
|
|
5
|
-
const session = context?.panel.session;
|
|
6
|
-
const selectedId = context?.docks.selectedId;
|
|
7
|
-
const wasOpen = session?.open === true;
|
|
8
|
-
if (!context || !selectedId && !wasOpen) return;
|
|
9
|
-
if (selectedId) await context.docks.switchEntry(null);
|
|
10
|
-
else if (session) session.open = false;
|
|
11
|
-
return async () => {
|
|
12
|
-
if (selectedId) {
|
|
13
|
-
await context.docks.switchEntry(selectedId);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (session && wasOpen) session.open = true;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/utils/dock/binding.ts
|
|
21
|
-
function createVueDevToolsDockBinding(context, runtime) {
|
|
22
|
-
let componentInspectionOwnsDock = false;
|
|
23
|
-
const disposeDockDeactivation = isDockClientScriptContext(context) ? context.current.events.on("entry:deactivated", () => {
|
|
24
|
-
if (componentInspectionOwnsDock) return;
|
|
25
|
-
runtime?.command({ type: "components:cancelInspect" });
|
|
26
|
-
}) : void 0;
|
|
27
|
-
return {
|
|
28
|
-
async closeForComponentInspection() {
|
|
29
|
-
componentInspectionOwnsDock = true;
|
|
30
|
-
try {
|
|
31
|
-
const restore = await closeDockPanelForComponentInspection(context);
|
|
32
|
-
if (!restore) {
|
|
33
|
-
componentInspectionOwnsDock = false;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
return async () => {
|
|
37
|
-
try {
|
|
38
|
-
await restore();
|
|
39
|
-
} finally {
|
|
40
|
-
componentInspectionOwnsDock = false;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
} catch (error) {
|
|
44
|
-
componentInspectionOwnsDock = false;
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
dispose() {
|
|
49
|
-
disposeDockDeactivation?.();
|
|
50
|
-
componentInspectionOwnsDock = false;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function isDockClientScriptContext(context) {
|
|
55
|
-
return "current" in context;
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/client.ts
|
|
59
|
-
function installVueDevTools(options) {
|
|
60
|
-
const target = getTarget();
|
|
61
|
-
const state = getClientState();
|
|
62
|
-
if (!state.kit) {
|
|
63
|
-
state.kit = createDevtoolsKit({
|
|
64
|
-
target: { name: "vue devtools" },
|
|
65
|
-
enabled: options.enabled,
|
|
66
|
-
capabilities: { openInEditor: true },
|
|
67
|
-
hook: { target },
|
|
68
|
-
componentInspectorDockController: { closeForComponentInspection: () => state.dockBinding?.closeForComponentInspection() }
|
|
69
|
-
});
|
|
70
|
-
state.kit.install();
|
|
71
|
-
state.disposeRpcHost = startIframeDevtoolsRpcHost(state.kit.rpc, { window: typeof window !== "undefined" ? window : void 0 });
|
|
72
|
-
state.bindDock = setupVueDevToolsDockController;
|
|
73
|
-
}
|
|
74
|
-
target.__VUE_DEVTOOLS_VITE_PLUGIN_DETECTED__ = true;
|
|
75
|
-
setupVueDevToolsDockController();
|
|
76
|
-
return state.kit;
|
|
77
|
-
}
|
|
78
|
-
const injectVueDevTools = installVueDevTools;
|
|
79
|
-
function setupVueDevToolsDockController(context) {
|
|
80
|
-
const state = getClientState();
|
|
81
|
-
if (context) state.context = context;
|
|
82
|
-
if (!state.context || !state.kit) return;
|
|
83
|
-
state.dockBinding?.dispose();
|
|
84
|
-
state.dockBinding = createVueDevToolsDockBinding(state.context, state.kit.runtime);
|
|
85
|
-
}
|
|
86
|
-
function disposeVueDevTools() {
|
|
87
|
-
const state = getClientState();
|
|
88
|
-
state.dockBinding?.dispose();
|
|
89
|
-
state.disposeRpcHost?.();
|
|
90
|
-
state.kit?.dispose();
|
|
91
|
-
delete state.dockBinding;
|
|
92
|
-
delete state.disposeRpcHost;
|
|
93
|
-
delete state.kit;
|
|
94
|
-
delete state.bindDock;
|
|
95
|
-
}
|
|
96
|
-
function getClientState() {
|
|
97
|
-
return getTarget()[CLIENT_RUNTIME_KEY] ??= {};
|
|
98
|
-
}
|
|
99
|
-
function getTarget() {
|
|
100
|
-
return typeof window !== "undefined" ? window : globalThis;
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
export { disposeVueDevTools, injectVueDevTools, installVueDevTools, setupVueDevToolsDockController };
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=client.mjs.map
|
|
1
|
+
import{r as e}from"./constants-CGjdG_4e.mjs";import{connectDevtoolsIframeClient as t,createDevtoolsKit as n,startIframeDevtoolsRpcHost as r}from"@vue/devtools-kit";async function i(e){let t=e?.panel.session,n=e?.docks.selectedId,r=t?.open===!0;if(e&&(n||r))return n?await e.docks.switchEntry(null):t&&(t.open=!1),async()=>{if(n){await e.docks.switchEntry(n);return}t&&r&&(t.open=!0)}}function a(e,t){let n=!1,r=o(e)?e.current.events.on(`entry:deactivated`,()=>{n||t?.command({type:`components:cancelInspect`})}):void 0;return{async closeForComponentInspection(){n=!0;try{let t=await i(e);if(!t){n=!1;return}return async()=>{try{await t()}finally{n=!1}}}catch(e){throw n=!1,e}},dispose(){r?.(),n=!1}}}function o(e){return`current`in e}function s(e){let t=f(),i=d();return i.kit||(i.kit=n({target:{name:`vue devtools`},enabled:e.enabled,capabilities:{openInEditor:!0},hook:{target:t},componentInspectorDockController:{closeForComponentInspection:()=>i.dockBinding?.closeForComponentInspection()}}),i.kit.install(),i.disposeRpcHost=r(i.kit.rpc,{window:typeof window<`u`?window:void 0}),i.bindDock=l),t.__VUE_DEVTOOLS_VITE_PLUGIN_DETECTED__=!0,l(),i.kit}const c=s;function l(e){let t=d();if(e&&(t.context=e),!t.context||!t.kit)return;t.dockBinding?.dispose(),t.dockBinding=a(t.context,t.kit.runtime);let n=t.context.rpc;if(!n?.connectionMeta.mcp){p(t);return}if(t.agentSetup?.kit===t.kit&&t.agentSetup.rpc===n)return;p(t);let r={kit:t.kit,rpc:n};t.agentSetup=r,m(t,r).catch(e=>{t.agentSetup===r&&(p(t),console.error(`[vue-devtools] Failed to register agent tools`,e))})}function u(){let e=d();p(e),e.dockBinding?.dispose(),e.disposeRpcHost?.(),e.kit?.dispose(),delete e.dockBinding,delete e.disposeRpcHost,delete e.kit,delete e.bindDock}function d(){return f()[e]??={}}function f(){return typeof window<`u`?window:globalThis}function p(e){e.disposeAgent?.(),delete e.disposeAgent,delete e.agentSetup}async function m(e,n){let{createVueDevtoolsAgentSession:r,registerVueDevtoolsAgentPage:i}=await import(`@vue/devtools-agent/devframe`);if(e.kit!==n.kit||e.agentSetup!==n||!n.rpc.connectionMeta.mcp||typeof window>`u`)return;let a=r(()=>t({targetWindow:window})),o={id:Array.from(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),get url(){return location.href},get title(){return document.title}},s=()=>{};e.disposeAgent=()=>{s(),a.dispose()};try{s=i(a,o)}catch(t){throw e.disposeAgent(),delete e.disposeAgent,t}}export{u as disposeVueDevTools,c as injectVueDevTools,s as installVueDevTools,l as setupVueDevToolsDockController};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`__VUE_DEVTOOLS_VITE_RUNTIME__`,t=`virtual:vue-devtools-client`,n=`\0${t}`,r=`vite-plugin-vue-devtools/client`,i=`vue-devtools`;function a(e){return!e||e===`./`?`/`:e.endsWith(`/`)?e:`${e}/`}function o(e){return`${a(e)}__devtools__/`}function s(e){return`${o(e)}dock-client.js`}export{n as a,i,t as n,o,e as r,s,r as t};
|
package/dist/dirs.d.mts
CHANGED
package/dist/dirs.mjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/dirs.ts
|
|
3
|
-
const clientDist = fileURLToPath(new URL("../client", import.meta.url));
|
|
4
|
-
//#endregion
|
|
5
|
-
export { clientDist };
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=dirs.mjs.map
|
|
1
|
+
import{fileURLToPath as e}from"node:url";const t=e(new URL(`../client`,import.meta.url));export{t as clientDist};
|
package/dist/index.d.mts
CHANGED
|
@@ -18,7 +18,6 @@ interface VitePluginVueDevToolsOptions {
|
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/index.d.ts
|
|
21
|
-
declare function vueDevtools(options?: VitePluginVueDevToolsOptions): PluginOption[];
|
|
21
|
+
export declare function vueDevtools(options?: VitePluginVueDevToolsOptions): PluginOption[];
|
|
22
22
|
//#endregion
|
|
23
|
-
export { type VitePluginVueDevToolsOptions, vueDevtools as default
|
|
24
|
-
//# sourceMappingURL=index.d.mts.map
|
|
23
|
+
export { type VitePluginVueDevToolsOptions, vueDevtools as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1,106 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { normalizePath } from "vite";
|
|
5
|
-
//#region src/client-injection.ts
|
|
6
|
-
const CLIENT_INJECTION_MARKER = "/* vue-devtools:client-injection */";
|
|
7
|
-
function createVueDevToolsClientInjectionPlugin(options, clientOptions) {
|
|
8
|
-
const pluginImporter = normalizePath(fileURLToPath(import.meta.url));
|
|
9
|
-
const injectionMatchers = resolveInjectionMatchers(options.appendTo);
|
|
10
|
-
return {
|
|
11
|
-
name: "vue-devtools:client-injection",
|
|
12
|
-
enforce: "pre",
|
|
13
|
-
apply: "serve",
|
|
14
|
-
async resolveId(importee, importer) {
|
|
15
|
-
if (importee === "virtual:vue-devtools-client") return RESOLVED_CLIENT_MODULE_ID;
|
|
16
|
-
if (importee === "vite-plugin-vue-devtools/client" && importer === RESOLVED_CLIENT_MODULE_ID) return await this.resolve(importee, pluginImporter, { skipSelf: true });
|
|
17
|
-
},
|
|
18
|
-
load(id) {
|
|
19
|
-
if (id === RESOLVED_CLIENT_MODULE_ID) return createClientModule(clientOptions);
|
|
20
|
-
},
|
|
21
|
-
transform(code, id, transformOptions) {
|
|
22
|
-
if (transformOptions?.ssr) return;
|
|
23
|
-
if (!injectionMatchers.length) return;
|
|
24
|
-
const [filename] = id.split("?", 2);
|
|
25
|
-
if (!matchesModule(filename, injectionMatchers) || code.includes(CLIENT_INJECTION_MARKER)) return;
|
|
26
|
-
return `${CLIENT_INJECTION_MARKER}\nimport '${CLIENT_MODULE_ID}';\n${code}`;
|
|
27
|
-
},
|
|
28
|
-
transformIndexHtml: {
|
|
29
|
-
order: "pre",
|
|
30
|
-
handler() {
|
|
31
|
-
if (injectionMatchers.length) return;
|
|
32
|
-
return [{
|
|
33
|
-
tag: "script",
|
|
34
|
-
injectTo: "head-prepend",
|
|
35
|
-
attrs: { type: "module" },
|
|
36
|
-
children: `import ${JSON.stringify(CLIENT_MODULE_ID)}`
|
|
37
|
-
}];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function resolveInjectionMatchers(appendTo) {
|
|
43
|
-
if (!appendTo) return [];
|
|
44
|
-
return Array.isArray(appendTo) ? appendTo : [appendTo];
|
|
45
|
-
}
|
|
46
|
-
function matchesModule(filename, matchers) {
|
|
47
|
-
return matchers.some((matcher) => {
|
|
48
|
-
if (typeof matcher === "string") return filename.endsWith(matcher);
|
|
49
|
-
matcher.lastIndex = 0;
|
|
50
|
-
return matcher.test(filename);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function createClientModule(options) {
|
|
54
|
-
return `
|
|
55
|
-
import { disposeVueDevTools, installVueDevTools } from '${CLIENT_IMPORT_ID}'
|
|
1
|
+
import{a as e,i as t,n,o as r,s as i,t as a}from"./constants-CGjdG_4e.mjs";import{clientDist as o}from"./dirs.mjs";import{fileURLToPath as s}from"node:url";import{normalizePath as c}from"vite";const l=`/* vue-devtools:client-injection */`;function u(t,r){let i=c(s(import.meta.url)),a=d(t.appendTo);return{name:`vue-devtools:client-injection`,enforce:`pre`,apply:`serve`,async resolveId(t,n){if(t===`virtual:vue-devtools-client`)return e;if(t===`vite-plugin-vue-devtools/client`&&n===e)return await this.resolve(t,i,{skipSelf:!0})},load(t){if(t===e)return p(r)},transform(e,t,r){if(r?.ssr||!a.length)return;let[i]=t.split(`?`,2);if(f(i,a)&&!e.includes(l))return`${l}\nimport '${n}';\n${e}`},transformIndexHtml:{order:`pre`,handler(){if(!a.length)return[{tag:`script`,injectTo:`head-prepend`,attrs:{type:`module`},children:`import ${JSON.stringify(n)}`}]}}}}function d(e){return e?Array.isArray(e)?e:[e]:[]}function f(e,t){return t.some(t=>typeof t==`string`?e.endsWith(t):(t.lastIndex=0,t.test(e)))}function p(e){return`
|
|
2
|
+
import { disposeVueDevTools, installVueDevTools } from '${a}'
|
|
56
3
|
|
|
57
|
-
installVueDevTools(${JSON.stringify(
|
|
4
|
+
installVueDevTools(${JSON.stringify(e)})
|
|
58
5
|
|
|
59
6
|
if (import.meta.hot) {
|
|
60
7
|
import.meta.hot.accept()
|
|
61
8
|
import.meta.hot.dispose(disposeVueDevTools)
|
|
62
9
|
}
|
|
63
|
-
`.trimStart();
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/utils/dock/registration.ts
|
|
67
|
-
function createVueDevToolsDockRegistrationPlugin() {
|
|
68
|
-
let base = "/";
|
|
69
|
-
return {
|
|
70
|
-
name: "vue-devtools:dock-registration",
|
|
71
|
-
apply: "serve",
|
|
72
|
-
configResolved(config) {
|
|
73
|
-
base = config.base;
|
|
74
|
-
if (!config.devtools) config.logger.warn("[vite-plugin-vue-devtools] Vue DevTools requires Vite DevTools. Install @vitejs/devtools and set devtools: { apply: 'serve' } in your Vite config.");
|
|
75
|
-
},
|
|
76
|
-
devtools: { setup(ctx) {
|
|
77
|
-
const clientUrl = getClientBasePath(base);
|
|
78
|
-
ctx.views.hostStatic(clientUrl, clientDist);
|
|
79
|
-
ctx.docks.register({
|
|
80
|
-
id: DOCK_ENTRY_ID,
|
|
81
|
-
title: "Vue DevTools",
|
|
82
|
-
category: "framework",
|
|
83
|
-
icon: "logos:vue",
|
|
84
|
-
type: "iframe",
|
|
85
|
-
url: clientUrl,
|
|
86
|
-
frameId: DOCK_ENTRY_ID,
|
|
87
|
-
clientScript: { importFrom: getClientDockModulePath(base) }
|
|
88
|
-
});
|
|
89
|
-
} }
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/options.ts
|
|
94
|
-
function resolveClientOptions(options) {
|
|
95
|
-
return { enabled: options.enabled ?? true };
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/index.ts
|
|
99
|
-
function vueDevtools(options = {}) {
|
|
100
|
-
if (!(options.enabled ?? true)) return [];
|
|
101
|
-
return [createVueDevToolsClientInjectionPlugin(options, resolveClientOptions(options)), createVueDevToolsDockRegistrationPlugin()];
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
|
-
export { vueDevtools as default, vueDevtools };
|
|
105
|
-
|
|
106
|
-
//# sourceMappingURL=index.mjs.map
|
|
10
|
+
`.trimStart()}function m(){let e=`/`,n=!0,a;return{name:`vue-devtools:dock-registration`,apply:`serve`,configResolved(t){e=t.base,n=!!t.devtools&&t.devtools.config.mcp!==!1,t.devtools||t.logger.warn(`[vite-plugin-vue-devtools] Vue DevTools requires Vite DevTools. Install @vitejs/devtools and set devtools: { apply: 'serve' } in your Vite config.`)},closeBundle(){a?.(),a=void 0},devtools:{async setup(s){if(n){let{registerVueDevtoolsAgentHost:e}=await import(`@vue/devtools-agent/node`);a?.(),a=e(s)}let c=r(e);s.views.hostStatic(c,o),s.docks.register({id:t,title:`Vue DevTools`,category:`framework`,icon:`logos:vue`,type:`iframe`,url:c,frameId:t,clientScript:{importFrom:i(e),...n?{eager:!0}:{}}})}}}}function h(e){return{enabled:e.enabled??!0}}function g(e={}){return e.enabled??!0?[u(e,h(e)),m()]:[]}export{g as default,g as vueDevtools};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-vue-devtools",
|
|
3
|
-
"version": "9.0.0-
|
|
3
|
+
"version": "9.0.0-rc.1",
|
|
4
4
|
"description": "A Vite plugin for Vue DevTools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dx",
|
|
@@ -27,46 +27,39 @@
|
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
29
|
"sideEffects": false,
|
|
30
|
-
"main": "./dist/index.
|
|
30
|
+
"main": "./dist/index.mjs",
|
|
31
31
|
"module": "./dist/index.mjs",
|
|
32
32
|
"types": "./dist/index.d.mts",
|
|
33
33
|
"exports": {
|
|
34
34
|
".": {
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"default": "./dist/index.mjs"
|
|
38
|
-
},
|
|
39
|
-
"require": {
|
|
40
|
-
"types": "./dist/index.d.cts",
|
|
41
|
-
"default": "./dist/index.cjs"
|
|
42
|
-
}
|
|
35
|
+
"types": "./dist/index.d.mts",
|
|
36
|
+
"default": "./dist/index.mjs"
|
|
43
37
|
},
|
|
44
38
|
"./client": {
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
"default": "./dist/client.mjs"
|
|
48
|
-
},
|
|
49
|
-
"require": {
|
|
50
|
-
"types": "./dist/client.d.cts",
|
|
51
|
-
"default": "./dist/client.cjs"
|
|
52
|
-
}
|
|
39
|
+
"types": "./dist/client.d.mts",
|
|
40
|
+
"default": "./dist/client.mjs"
|
|
53
41
|
},
|
|
54
42
|
"./package.json": "./package.json"
|
|
55
43
|
},
|
|
56
44
|
"dependencies": {
|
|
57
|
-
"@vitejs/devtools-kit": "^0.7.
|
|
58
|
-
"@vue/devtools-
|
|
45
|
+
"@vitejs/devtools-kit": "^0.7.6",
|
|
46
|
+
"@vue/devtools-agent": "9.0.0-rc.1",
|
|
47
|
+
"@vue/devtools-kit": "9.0.0-rc.1"
|
|
59
48
|
},
|
|
60
49
|
"devDependencies": {
|
|
61
|
-
"@vue/devtools-client": "9.0.0-
|
|
62
|
-
"
|
|
50
|
+
"@vue/devtools-client": "9.0.0-rc.1",
|
|
51
|
+
"tsdown": "^0.23.0",
|
|
52
|
+
"vite": "^8.3.1"
|
|
63
53
|
},
|
|
64
54
|
"peerDependencies": {
|
|
65
|
-
"@vitejs/devtools": "^0.7.
|
|
55
|
+
"@vitejs/devtools": "^0.7.6",
|
|
66
56
|
"vite": "^8.3.0"
|
|
67
57
|
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=22.12.0"
|
|
60
|
+
},
|
|
68
61
|
"scripts": {
|
|
69
|
-
"build": "
|
|
70
|
-
"dev": "
|
|
62
|
+
"build": "tsdown && node --input-type=commonjs -e \"const fs=require('node:fs');fs.rmSync('client',{recursive:true,force:true});fs.cpSync('../client/dist','client',{recursive:true})\"",
|
|
63
|
+
"dev": "tsdown --watch"
|
|
71
64
|
}
|
|
72
65
|
}
|