@unocss/inspector 0.29.5 → 0.29.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/_id_.48f15746.js +1 -0
- package/dist/client/assets/{index.fedf2005.js → index.78a58fdb.js} +1 -1
- package/dist/client/assets/{repl.534d7706.js → repl.d3fb4361.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/_id_.51547589.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as C,L as M,r as V,M as w,i as l,a as x,c as b,n as y,p as R,b as o,q as A,t as v,k as S,s as $,v as B,y as E}from"./vendor.e38106f4.js";import{i as g,c as z,d as F,u as N,e as O,_ as I,a as W}from"./index.78a58fdb.js";const P=t=>t.split(/[\s'"`;>=]+/g).filter(g),U={name:"split",order:0,extract({code:t}){return new Set(P(t))}},j=["v-bind:",":"],k=/[\s'"`;]+/g,q=/<\w[\w:\.$-]*\s((?:'[\s\S]*?'|"[\s\S]*?"|`[\s\S]*?`|\{[\s\S]*?\}|[\s\S]*?)*?)>/g,D=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:=(["'])([^\2]*?)\2)?/g,K=t=>{var a,r;const n=(a=t==null?void 0:t.ignoreAttributes)!=null?a:[],s=(r=t==null?void 0:t.nonValuedAttribute)!=null?r:!0;return{name:"attributify",extract({code:u}){const i=Array.from(u.matchAll(q)).flatMap(e=>Array.from((e[1]||"").matchAll(D))).flatMap(([,e,_,d])=>{if(n.includes(e))return[];for(const c of j)if(e.startsWith(c)){e=e.slice(c.length);break}return d?["class","className"].includes(e)?d.split(k).filter(g):d.split(k).filter(Boolean).map(c=>`[${e}~="${c}"]`):g(e)&&s!==!1?[`[${e}=""]`]:[]});return new Set(i)}}},L=/^(?!\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/,T=(t={})=>{var a,r;const n=(a=t.prefix)!=null?a:"un-",s=(r=t.prefixedOnly)!=null?r:!1;return u=>{const i=z(u);if(!i)return;let e=i[1];if(e.startsWith(n))e=e.slice(n.length);else if(s)return;const _=i[2],[,d="",c=_]=_.match(L)||[];return c==="~"||!c?`${d}${e}`:`${d}${e}-${c}`}},Z=(t={})=>{var a,r,u,i,e;t.strict=(a=t.strict)!=null?a:!1,t.prefix=(r=t.prefix)!=null?r:"un-",t.prefixedOnly=(u=t.prefixedOnly)!=null?u:!1,t.nonValuedAttribute=(i=t.nonValuedAttribute)!=null?i:!0,t.ignoreAttributes=(e=t.ignoreAttributes)!=null?e:[];const n=[T(t)],s=[K(t)];return t.strict||s.unshift(U),{name:"@unocss/preset-attributify",variants:n,extractors:s,options:t}},G={key:0,"h-full":"","of-hidden":""},H=o("div",{op50:""}," Module ",-1),J=o("div",{"i-carbon-launch":""},null,-1),Q=o("div",{op50:""}," Matched Rules ",-1),X=o("div",{op50:""}," CSS Size ",-1),Y=o("span",{op50:""},"gzipped",-1),tt={key:0,"row-span-3":""},et=o("div",{op50:""}," Potentially Unmatched ",-1),st={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},rt=C({props:{id:null},setup(t){const n=t,{data:s}=F(M(n,"id")),a=n.id.split(/\./g).pop(),r=V(null),u=N(r,"module-scrolls");function i(){fetch(`/__open-in-editor?file=${encodeURIComponent(n.id)}`)}const{extractors:e}=Z({strict:!0}),_=w(async()=>{var c;const d=new Set;if(e){const f={code:((c=s.value)==null?void 0:c.code)||""};for(const m of e){const h=await m.extract(f);h==null||h.forEach(p=>d.add(p))}}return Array.from(d).filter(f=>!f.startsWith("[")).filter(f=>{var m;return!((m=s.value)!=null&&m.matched.includes(f))})});return(d,c)=>{const f=O,m=I,h=W;return l(s)?(x(),b("div",G,[y(m,{ref_key:"status",ref:r,grid:"~ cols-3 gap-4"},{default:R(()=>{var p;return[o("div",null,[H,o("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:i},[y(f,{id:l(s).id,"mr-1":""},null,8,["id"]),J])]),o("div",null,[Q,A(" "+v(l(s).matched.length),1)]),o("div",null,[X,A(" "+v(((((p=l(s))==null?void 0:p.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),Y]),l(_).length?(x(),b("div",tt,[et,o("code",null,v(l(_).join(", ")),1)])):S("",!0)]}),_:1},512),o("div",st,[y(h,{"h-full":"","model-value":l(s).code,"read-only":!0,mode:l(a),matched:l(s).matched,class:"scrolls module-scrolls",style:$(l(u))},null,8,["model-value","mode","matched","style"]),y(h,{"h-full":"",b:"l main","model-value":l(s).css,"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:$(l(u))},null,8,["model-value","style"])])])):S("",!0)}}}),ct=C({setup(t){const n=E();return(s,a)=>{const r=rt;return x(),B(r,{id:l(n).params.id},null,8,["id"])}}});export{ct as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
var me=Object.defineProperty,he=Object.defineProperties;var fe=Object.getOwnPropertyDescriptors;var Q=Object.getOwnPropertySymbols;var ve=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var X=(e,o,t)=>o in e?me(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,w=(e,o)=>{for(var t in o||(o={}))ve.call(o,t)&&X(e,t,o[t]);if(Q)for(var t of Q(o))ge.call(o,t)&&X(e,t,o[t]);return e},Y=(e,o)=>he(e,fe(o));import{C as ye,w as re,d as y,r as L,u as xe,o as $e,a as d,c as p,b as r,e as ke,f as ce,g as O,h as b,i as l,j as be,F as T,t as _,k as R,l as we,m as Ee,n as h,p as $,q as f,s as Ce,v as S,x as V,y as Re,z as j,A as ee,B as Se,D as je,_ as Oe,E as te,G as Fe,H as Te,I as Ve}from"./vendor.e38106f4.js";const Ie=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerpolicy&&(i.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?i.credentials="include":s.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}};Ie();const Le="modulepreload",oe={},Me="/__unocss/",I=function(o,t){return!t||t.length===0?o():Promise.all(t.map(n=>{if(n=`${Me}${n}`,n in oe)return;oe[n]=!0;const s=n.endsWith(".css"),i=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${i}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Le,s||(c.as="script",c.crossOrigin=""),c.href=n,document.head.appendChild(c),s)return new Promise((a,v)=>{c.addEventListener("load",a),c.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>o())};function ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Ae=/^\[(.+?)~?="(.*)"\]$/,Pe=/(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-?]/;function He(e){return e.match(Ae)}function Xt(e=""){return Pe.test(e)}function ze(e,o){const t=[],n=[],s=new Set;Array.from(o).forEach(c=>{const a=He(c);a?a[2]?n.push(a):s.add(a[1]):s.add(c)});let i=0;return e.split(/[\s"';<>]/g).forEach(c=>{const a=i+c.length;s.has(c)&&t.push([i,a,c]),i=a+1}),n.forEach(([,c,a])=>{const v=new RegExp(`${ne(c)}=(['"])[^\\1]*?${ne(a)}[^\\1]*?\\1`,"g");Array.from(e.matchAll(v)).forEach(x=>{const g=x.index+x[0].indexOf(a),m=g+a.length;t.push([g,m,`[${c}="${a}"]`])})}),t}function De(e,o,t={}){const n=ye.fromTextArea(e.value,w({theme:"vars"},t));let s=!1;return n.on("change",()=>{if(s){s=!1;return}o.value=n.getValue()}),re(o,i=>{if(i!==n.getValue()){s=!0;const c=n.listSelections();n.replaceRange(i,n.posFromIndex(0),n.posFromIndex(1/0)),n.setSelections(c)}},{immediate:!0}),n}const Ne={relative:"","font-mono":"","text-sm":""},Be=y({props:{modelValue:null,mode:null,readOnly:{type:Boolean},matched:null,getHint:null},setup(e,{emit:o}){const t=e,n={html:"htmlmixed",vue:"htmlmixed",svelte:"htmlmixed",js:"javascript",mjs:"javascript",cjs:"javascript",ts:{name:"javascript",typescript:!0},mts:{name:"javascript",typescript:!0},cts:{name:"javascript",typescript:!0},jsx:{name:"javascript",jsx:!0},tsx:{name:"javascript",typescript:!0,jsx:!0}},s=L(),i=xe(t,"modelValue",o,{passive:!0});return $e(async()=>{const c=De(s,i,w(Y(w({},t),{mode:n[t.mode||""]||t.mode}),t.getHint?{extraKeys:{"Ctrl-Space":"autocomplete","Ctrl-.":"autocomplete","Cmd-Space":"autocomplete","Cmd-.":"autocomplete",Tab:"autocomplete"},hintOptions:{hint:t.getHint}}:{}));c.setSize("100%","100%"),t.getHint&&c.on("keyup",(m,k)=>{k.key.match(/^[\w:-]$/)&&m.execCommand("autocomplete")}),setTimeout(()=>c.refresh(),100);const a=[];function v(m,k){a.push(c.markText(c.posFromIndex(m),c.posFromIndex(k),{className:"highlighted"}))}function x(){a.forEach(m=>m.clear()),ze(t.modelValue,Array.from(t.matched||[])).forEach(m=>v(m[0],m[1]))}let g=0;re(()=>[t.modelValue,t.matched],async()=>{clearTimeout(g),t.matched&&(g=setTimeout(x,100))},{immediate:!0})}),(c,a)=>(d(),p("div",Ne,[r("textarea",{ref_key:"el",ref:s},null,512)]))}});var ie=(e,o)=>{const t=e.__vccOpts||e;for(const[n,s]of o)t[n]=s;return t};const Ue={},We={"bg-gray4:10":"","p-5":"",b:"b main",text:"sm gray5 dark:gray3"};function qe(e,o){return d(),p("div",We,[ke(e.$slots,"default")])}var Ke=ie(Ue,[["render",qe]]);const Ge="/@vite/client",ae=ce(),le=ce(),Ze=ae.on,de=le.on;I(()=>import(Ge),[]).then(e=>{const o=e.createHotContext("/");o.on("vite:beforeUpdate",t=>{t.updates.forEach(n=>{ae.trigger(n)})}),o.on("unocss:config-changed",()=>{le.trigger()})}).catch(e=>{console.error("failed to connect to client vite server, you might need to do manual refresh to see the updates"),console.error(e)});const F="/__unocss_api",ue=O(F).json(),M=O(`${F}/overview`,{immediate:!1}).json(),u=ue.data,E=M.data;de(()=>{ue.execute(),M.execute()});function Yt(e){const o=O(b(()=>`${F}/module?id=${encodeURIComponent(l(e))}`),{refetch:!0}).json();return de(()=>o.execute()),Ze(t=>{var n;(t.path===l(e)||t.path===l(e).slice(((n=u.value)==null?void 0:n.root.length)||0))&&setTimeout(()=>{o.execute()},50)}),o}function eo(e){const o=be(e,500);return O(b(()=>`${F}/repl?token=${encodeURIComponent(o.value)}`),{refetch:!0}).json()}const C=b(()=>{if(!u.value)return{workspace:{children:{},items:[]},root:{children:{},items:[]}};const e=u.value.modules.map(n=>({full:n,path:n})),o=e.filter(n=>n.full.startsWith(u.value.root)),t=e.filter(n=>!n.full.startsWith(u.value.root));return o.forEach(n=>n.path=n.path.slice(u.value.root.length+1)),{workspace:se(o,"Project Root"),root:se(t,"Disk Root")}});function se(e,o){const t={name:o,children:{},items:[]};function n(s,i,c=t){if(i.length<=1){c.items.push(s);return}const a=i.shift();c.children[a]||(c.children[a]={name:a,children:{},items:[]}),n(s,i,c.children[a])}return e.forEach(s=>{const i=s.path.split(/\//g).filter(Boolean);n(s,i)}),t}const Je={key:0,"ws-wrap":""},Qe=r("span",{op80:""},".",-1),Xe={key:1},Ye=y({props:{id:null},setup(e){return(o,t)=>e.id&&l(u)?(d(),p("span",Je,[e.id.startsWith(l(u).root)?(d(),p(T,{key:0},[Qe,r("span",null,_(e.id.slice(l(u).root.length)),1)],64)):(d(),p("span",Xe,_(e.id),1))])):R("",!0)}}),et=(e,o)=>{const t=L(null);return we(e,()=>{var s;const n=(s=Ee(e))==null?void 0:s.clientHeight;t.value=n?`--${o}: calc(100vh - ${n}px - 2px);`:null}),t},tt={"h-full":""},ot={p:"x4 y2",grid:"~ cols-4 gap-4"},nt=r("div",{op80:""}," Presets ",-1),st={op50:"","ws-pre":""},rt={overflow:"auto"},ct=r("div",{op80:""}," Rules ",-1),it=r("span",{op50:""},"dynamic",-1),at=r("br",null,null,-1),lt=r("span",{op50:""},"static",-1),dt=r("div",{op80:""}," Variants ",-1),ut=r("div",{op80:""}," Shortcuts ",-1),pt={key:0},_t=r("div",{op80:""}," Config File ",-1),mt=r("div",{op80:""}," Version ",-1),ht={op50:"","ws-pre":""},ft={b:"t main",p:"x4 y2",grid:"~ cols-4 gap-4"},vt=r("div",{op80:""}," Included Files ",-1),gt=r("div",{op80:""}," CSS Size ",-1),yt=r("span",{op50:""},"gzipped",-1),xt=r("div",{op80:""}," Matched Rules ",-1),$t=r("div",{op80:""}," Layers ",-1),kt={op50:"","ws-pre":""},bt=y({setup(e){const o=L(null),t=et(o,"overview-scrolls");return M.execute(),(n,s)=>{var v;const i=Ye,c=Ke,a=Be;return d(),p("div",tt,[h(c,{ref_key:"status",ref:o,p0:""},{default:$(()=>{var x,g,m,k,A,P,H,z,D,N,B,U,W,q,K,G,Z,J;return[r("div",ot,[r("div",null,[nt,r("div",st,_((m=(g=(x=l(u))==null?void 0:x.config)==null?void 0:g.presets)==null?void 0:m.map(_e=>_e.name).join(`
|
|
2
2
|
`)),1)]),r("div",rt,[ct,f(" "+_((P=(A=(k=l(u))==null?void 0:k.config)==null?void 0:A.rulesDynamic)==null?void 0:P.filter(Boolean).length)+" ",1),it,at,f(" "+_(Object.keys(((z=(H=l(u))==null?void 0:H.config)==null?void 0:z.rulesStaticMap)||{}).length)+" ",1),lt]),r("div",null,[dt,f(" "+_((B=(N=(D=l(u))==null?void 0:D.config)==null?void 0:N.variants)==null?void 0:B.length),1)]),r("div",null,[ut,f(" "+_((U=l(u))==null?void 0:U.config.shortcuts.length),1)]),(W=l(u))!=null&&W.configPath?(d(),p("div",pt,[_t,h(i,{id:l(u).configPath},null,8,["id"])])):R("",!0),r("div",null,[mt,r("div",ht,_((q=l(u))==null?void 0:q.version),1)])]),r("div",ft,[r("div",null,[vt,f(" "+_((K=l(u))==null?void 0:K.modules.length),1)]),r("div",null,[gt,f(" "+_(((((G=l(E))==null?void 0:G.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),yt]),r("div",null,[xt,f(" "+_((Z=l(E))==null?void 0:Z.matched.length),1)]),r("div",null,[$t,r("div",kt,_((J=l(E))==null?void 0:J.layers.join(`
|
|
3
|
-
`)),1)])])]}),_:1},512),h(a,{"model-value":((v=l(E))==null?void 0:v.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls overview-scrolls",style:Ce(l(t))},null,8,["model-value","style"])])}}}),wt={};function Et(e,o){const t=bt;return d(),S(t)}var Ct=ie(wt,[["render",Et]]);const Rt=[{name:"index",path:"/",component:Ct,props:!0},{name:"repl",path:"/repl",component:()=>I(()=>import("./repl.
|
|
3
|
+
`)),1)])])]}),_:1},512),h(a,{"model-value":((v=l(E))==null?void 0:v.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls overview-scrolls",style:Ce(l(t))},null,8,["model-value","style"])])}}}),wt={};function Et(e,o){const t=bt;return d(),S(t)}var Ct=ie(wt,[["render",Et]]);const Rt=[{name:"index",path:"/",component:Ct,props:!0},{name:"repl",path:"/repl",component:()=>I(()=>import("./repl.d3fb4361.js"),["assets/repl.d3fb4361.js","assets/repl.6afeb916.css","assets/vendor.e38106f4.js"]),props:!0},{name:"module-id",path:"/module/:id",component:()=>I(()=>import("./_id_.48f15746.js"),["assets/_id_.48f15746.js","assets/_id_.6d46d461.css","assets/vendor.e38106f4.js"]),props:!0}],St=y({props:{id:null},setup(e){const o=e,t=b(()=>o.id.split(/\./g).pop()),n=b(()=>{switch(t.value){case"vue":return"i-logos-vue";default:return"i-carbon-document-blank"}});return(s,i)=>(d(),p("div",{class:V(l(n))},null,2))}}),jt={open:""},Ot={"cursor-default":"","select-none":"","text-sm":"",truncate:"",p:"y1"},Ft={"ml-1":""},Tt=y({props:{node:null,icon:{default:"i-carbon-folder"}},setup(e){const o=Re();return(t,n)=>{const s=j("ModuleTreeNode",!0),i=St,c=j("RouterLink");return d(),p("details",jt,[r("summary",Ot,[r("div",{class:V(e.icon)},null,2),f(" "+_(e.node.name),1)]),(d(!0),p(T,null,ee(Object.entries(e.node.children),a=>(d(),S(s,{key:a[0],ml2:"",node:a[1]},null,8,["node"]))),128)),(d(!0),p(T,null,ee(e.node.items,a=>(d(),p("div",{key:a.full,ml4:"","ws-nowrap":""},[h(c,{block:"","text-sm":"",p:"x2 y1",rounded:"",to:`/module/${encodeURIComponent(a.full)}`,class:V({"bg-gray/10":a.full===l(o).params.id})},{default:$(()=>[h(i,{id:a.path},null,8,["id"]),r("span",Ft,_(a.path.split("/").pop()),1)]),_:2},1032,["to","class"])]))),128))])}}});var Vt="/__unocss/icon.svg";const It={p:"x4 y3",b:"b main",flex:"","children:my-auto":""},Lt=r("div",{flex:"","flex-auto":"","children:my-auto":"","ws-nowrap":""},[r("img",{src:Vt,filter:"","dark:invert":"","inline-block":"",h:"1.3em",m:"r-1.5"}),r("div",{"of-hidden":""},[f(" Inspector "),r("sup",{"text-teal5":"","bg-teal5:10":"",p:"x1.5 y0.5",rounded:"",italic:""},"beta")])],-1),Mt=y({setup(e){const o=Se(),t=je(o);return(n,s)=>(d(),p("nav",It,[Lt,r("button",{"text-lg":"","i-carbon-sun":"","dark:i-carbon-moon":"",onClick:s[0]||(s[0]=i=>l(t)())})]))}}),At={"h-full":""},Pt={b:"r main","of-hidden":""},Ht={pt:"4",flex:"~ col gap-3"},zt=r("div",{"i-carbon-dashboard":""},null,-1),Dt=r("span",null," Overview ",-1),Nt=r("div",{"i-carbon-terminal":""},null,-1),Bt=r("span",null," REPL ",-1),Ut=r("div",{b:"b main"},null,-1),Wt={b:"r main",class:"scrolls scrolls-sidebar"},qt=y({setup(e){return(o,t)=>{const n=Mt,s=j("RouterLink"),i=Tt;return d(),p("div",At,[r("div",Pt,[h(n),r("div",Ht,[h(s,{block:"",to:"/","text-sm":"",m:"l-3.7"},{default:$(()=>[zt,Dt]),_:1}),h(s,{block:"",to:"/repl","text-sm":"",m:"l-3.7"},{default:$(()=>[Nt,Bt]),_:1}),Ut])]),r("div",Wt,[Object.keys(l(C).workspace.children).length?(d(),S(i,{key:0,node:l(C).workspace,p:"l3 t4",icon:"i-carbon-portfolio"},null,8,["node"])):R("",!0),Object.keys(l(C).root.children).length?(d(),S(i,{key:1,node:l(C).root,p:"l3 t4",icon:"i-carbon-vmdk-disk"},null,8,["node"])):R("",!0)])])}}}),Kt={"h-screen":"","w-screen":"",overflow:"hidden"},Gt={"h-full":"","of-hidden":""},Zt=y({setup(e){return(o,t)=>{const n=qt,s=j("RouterView");return d(),p("div",Kt,[h(l(Oe),null,{default:$(()=>[h(l(te),{size:"20","push-other-panes":!1},{default:$(()=>[h(n)]),_:1}),h(l(te),{size:"80"},{default:$(()=>[r("div",Gt,[h(s)])]),_:1})]),_:1})])}}}),pe=Fe(Zt);pe.use(Te({history:Ve(),routes:Rt}));pe.mount("#app");export{Ke as _,Be as a,ie as b,He as c,Yt as d,Ye as e,eo as f,Xt as i,et as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as h,r as y,J as v,a as i,c as g,n as l,p as x,b as n,i as e,K as S,s as _,v as b}from"./vendor.e38106f4.js";import{u as B,f as V,_ as k,a as C,b as R}from"./index.
|
|
1
|
+
import{d as h,r as y,J as v,a as i,c as g,n as l,p as x,b as n,i as e,K as S,s as _,v as b}from"./vendor.e38106f4.js";import{u as B,f as V,_ as k,a as C,b as R}from"./index.78a58fdb.js";const w={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},E=n("div",null," REPL Playground ",-1),P=n("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1),N={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},U=h({setup(m){const o=y(null),s=B(o,"rpel-scrolls"),t=v("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
2
|
Hello World
|
|
3
3
|
</div>`),{data:a}=V(t);return(H,r)=>{var d,u;const p=k,c=C;return i(),g("div",w,[l(p,{ref_key:"status",ref:o},{default:x(()=>[E,P]),_:1},512),n("div",N,[l(c,{modelValue:e(t),"onUpdate:modelValue":r[0]||(r[0]=f=>S(t)?t.value=f:null),mode:"html",matched:((d=e(a))==null?void 0:d.matched)||[],class:"scrolls rpel-scrolls",style:_(e(s))},null,8,["modelValue","matched","style"]),l(c,{"b-l":"","b-main":"","model-value":((u=e(a))==null?void 0:u.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls rpel-scrolls",style:_(e(s))},null,8,["model-value","style"])])])}}}),$={};function z(m,o){const s=U;return i(),b(s)}var L=R($,[["render",z]]);export{L as default};
|
package/dist/client/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;400&family=Fira+Code&display=swap" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="/__unocss/assets/index.
|
|
11
|
+
<script type="module" crossorigin src="/__unocss/assets/index.78a58fdb.js"></script>
|
|
12
12
|
<link rel="modulepreload" href="/__unocss/assets/vendor.e38106f4.js">
|
|
13
13
|
<link rel="stylesheet" href="/__unocss/assets/index.dcb4ed18.css">
|
|
14
14
|
</head>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as C,L as M,r as V,M as w,i as l,a as x,c as b,n as y,p as R,b as o,q as A,t as v,k as S,s as $,v as B,y as E}from"./vendor.e38106f4.js";import{i as g,c as z,d as F,u as N,e as O,_ as I,a as W}from"./index.fedf2005.js";const P=t=>t.split(/[\s'"`;>=]+/g).filter(g),U={name:"split",order:0,extract({code:t}){return new Set(P(t))}},j=["v-bind:",":"],k=/[\s'"`;]+/g,q=/<\w[\w:\.$-]*\s((?:'[\s\S]*?'|"[\s\S]*?"|`[\s\S]*?`|\{[\s\S]*?\}|[\s\S]*?)*?)>/g,D=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=(["'])([^\2]*?)\2)?/g,K=t=>{var a,r;const n=(a=t==null?void 0:t.ignoreAttributes)!=null?a:[],s=(r=t==null?void 0:t.nonValuedAttribute)!=null?r:!0;return{name:"attributify",extract({code:u}){const i=Array.from(u.matchAll(q)).flatMap(e=>Array.from((e[1]||"").matchAll(D))).flatMap(([,e,_,d])=>{if(n.includes(e))return[];for(const c of j)if(e.startsWith(c)){e=e.slice(c.length);break}return d?["class","className"].includes(e)?d.split(k).filter(g):d.split(k).filter(Boolean).map(c=>`[${e}~="${c}"]`):g(e)&&s!==!1?[`[${e}=""]`]:[]});return new Set(i)}}},L=/^(?!\[(?:[^:]+):(?:.+)\]$)(.+:!?)?(.*)$/,T=(t={})=>{var a,r;const n=(a=t.prefix)!=null?a:"un-",s=(r=t.prefixedOnly)!=null?r:!1;return u=>{const i=z(u);if(!i)return;let e=i[1];if(e.startsWith(n))e=e.slice(n.length);else if(s)return;const _=i[2],[,d="",c=_]=_.match(L)||[];return c==="~"||!c?`${d}${e}`:`${d}${e}-${c}`}},Z=(t={})=>{var a,r,u,i,e;t.strict=(a=t.strict)!=null?a:!1,t.prefix=(r=t.prefix)!=null?r:"un-",t.prefixedOnly=(u=t.prefixedOnly)!=null?u:!1,t.nonValuedAttribute=(i=t.nonValuedAttribute)!=null?i:!0,t.ignoreAttributes=(e=t.ignoreAttributes)!=null?e:[];const n=[T(t)],s=[K(t)];return t.strict||s.unshift(U),{name:"@unocss/preset-attributify",variants:n,extractors:s,options:t}},G={key:0,"h-full":"","of-hidden":""},H=o("div",{op50:""}," Module ",-1),J=o("div",{"i-carbon-launch":""},null,-1),Q=o("div",{op50:""}," Matched Rules ",-1),X=o("div",{op50:""}," CSS Size ",-1),Y=o("span",{op50:""},"gzipped",-1),tt={key:0,"row-span-3":""},et=o("div",{op50:""}," Potentially Unmatched ",-1),st={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},rt=C({props:{id:null},setup(t){const n=t,{data:s}=F(M(n,"id")),a=n.id.split(/\./g).pop(),r=V(null),u=N(r,"module-scrolls");function i(){fetch(`/__open-in-editor?file=${encodeURIComponent(n.id)}`)}const{extractors:e}=Z({strict:!0}),_=w(async()=>{var c;const d=new Set;if(e){const f={code:((c=s.value)==null?void 0:c.code)||""};for(const m of e){const h=await m.extract(f);h==null||h.forEach(p=>d.add(p))}}return Array.from(d).filter(f=>!f.startsWith("[")).filter(f=>{var m;return!((m=s.value)!=null&&m.matched.includes(f))})});return(d,c)=>{const f=O,m=I,h=W;return l(s)?(x(),b("div",G,[y(m,{ref_key:"status",ref:r,grid:"~ cols-3 gap-4"},{default:R(()=>{var p;return[o("div",null,[H,o("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:i},[y(f,{id:l(s).id,"mr-1":""},null,8,["id"]),J])]),o("div",null,[Q,A(" "+v(l(s).matched.length),1)]),o("div",null,[X,A(" "+v(((((p=l(s))==null?void 0:p.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),Y]),l(_).length?(x(),b("div",tt,[et,o("code",null,v(l(_).join(", ")),1)])):S("",!0)]}),_:1},512),o("div",st,[y(h,{"h-full":"","model-value":l(s).code,"read-only":!0,mode:l(a),matched:l(s).matched,class:"scrolls module-scrolls",style:$(l(u))},null,8,["model-value","mode","matched","style"]),y(h,{"h-full":"",b:"l main","model-value":l(s).css,"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:$(l(u))},null,8,["model-value","style"])])])):S("",!0)}}}),ct=C({setup(t){const n=E();return(s,a)=>{const r=rt;return x(),B(r,{id:l(n).params.id},null,8,["id"])}}});export{ct as default};
|