@unocss/inspector 0.32.1 → 0.32.7
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_.12c692e0.js +1 -0
- package/dist/client/assets/{index.22bec824.js → index.2fe34db0.js} +16 -16
- package/dist/client/assets/{repl.970e70ef.js → repl.3e585e1b.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/_id_.d75c7481.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as h,r as y,u as g,a as v,f as x,o as i,c as S,b as l,w as k,e as n,g as e,i as B,n as _,_ as V,h as b,j as w,k as C}from"./index.
|
|
1
|
+
import{d as h,r as y,u as g,a as v,f as x,o as i,c as S,b as l,w as k,e as n,g as e,i as B,n as _,_ as V,h as b,j as w,k as C}from"./index.2fe34db0.js";const R={"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=g(o,"rpel-scrolls"),t=v("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
2
|
Hello World
|
|
3
3
|
</div>`),{data:a}=x(t);return(z,r)=>{var d,u;const p=V,c=b;return i(),S("div",R,[l(p,{ref_key:"status",ref:o},{default:k(()=>[E,P]),_:1},512),n("div",N,[l(c,{modelValue:e(t),"onUpdate:modelValue":r[0]||(r[0]=f=>B(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 j(m,o){const s=U;return i(),C(s)}var L=w($,[["render",j]]);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.2fe34db0.js"></script>
|
|
12
12
|
<link rel="stylesheet" href="/__unocss/assets/index.0f4ed7ea.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as S,m as P,d as z,p as B,t as N,r as O,u as W,q as I,g as m,o as E,c as R,b,w as U,e as p,s as k,v as $,x as w,n as V,y as Z,_ as j,h as q,k as D,z as K}from"./index.22bec824.js";const T=e=>e.split(/[\s'"`;>=]+/g).filter(S),G={name:"split",order:0,extract({code:e}){return new Set(T(e))}},M=/^(?!\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/,H=(e={})=>{var d,c;const s=(d=e.prefix)!=null?d:"un-",r=(c=e.prefixedOnly)!=null?c:!1;return _=>{const o=P(_);if(!o)return;let t=o[1];if(t.startsWith(s))t=t.slice(s.length);else if(r)return;const a=o[2],[,i="",n=a]=a.match(M)||[];return n==="~"||!n?`${i}${t}`:`${i}${t}-${n}`}},J=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,L=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,C=/[\s'"`;>]+/,Q={name:"attributify",extract:({content:e,cursor:s})=>{const r=e.matchAll(J);let d,c=0;for(const f of r){const[,x,v]=f,g=f.index+x.length;if(s>g&&s<=g+v.length){c=g,d=v;break}}if(!d)return null;const _=d.matchAll(L);let o=0,t,a;for(const f of _){const[x,v,g]=f,A=c+f.index;if(s>A&&s<=A+x.length){o=A,t=v,a=g==null?void 0:g.slice(1);break}}if(!t||t==="class"||t==="className")return null;if(a===void 0)return{extracted:t,resolveReplacement(f){return{start:o,end:o+t.length,replacement:f}}};const i=o+t.length+2;let n=C.exec(a),l=0,h;for(;n;){const[f]=n;if(s>i+l&&s<=i+l+n.index){h=a.slice(l,l+n.index);break}l+=n.index+f.length,n=C.exec(a.slice(l))}h===void 0&&(h=a.slice(l));const[,u="",y]=h.match(M)||[];return{extracted:`${u}${t}-${y}`,transformSuggestions(f){return f.filter(x=>x.startsWith(`${u}${t}-`)).map(x=>u+x.slice(u.length+t.length+1))},resolveReplacement(f){return{start:l+i,end:l+i+h.length,replacement:u+f.slice(u.length+t.length+1)}}}}},X=["v-bind:",":"],F=/[\s'"`;]+/g,Y=/<\w[\w:\.$-]*\s((?:'[\s\S]*?'|"[\s\S]*?"|`[\s\S]*?`|\{[\s\S]*?\}|[\s\S]*?)*?)>/g,tt=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:=(["'])([^\2]*?)\2)?/g,et=e=>{var d,c;const s=(d=e==null?void 0:e.ignoreAttributes)!=null?d:[],r=(c=e==null?void 0:e.nonValuedAttribute)!=null?c:!0;return{name:"attributify",extract({code:_}){const o=Array.from(_.matchAll(Y)).flatMap(t=>Array.from((t[1]||"").matchAll(tt))).flatMap(([,t,a,i])=>{if(s.includes(t))return[];for(const n of X)if(t.startsWith(n)){t=t.slice(n.length);break}return i?["class","className"].includes(t)?i.split(F).filter(S):i.split(F).filter(Boolean).map(n=>`[${t}~="${n}"]`):S(t)&&r!==!1?[`[${t}=""]`]:[]});return new Set(o)}}},st=(e={})=>{var c,_,o,t,a;e.strict=(c=e.strict)!=null?c:!1,e.prefix=(_=e.prefix)!=null?_:"un-",e.prefixedOnly=(o=e.prefixedOnly)!=null?o:!1,e.nonValuedAttribute=(t=e.nonValuedAttribute)!=null?t:!0,e.ignoreAttributes=(a=e.ignoreAttributes)!=null?a:[];const s=[H(e)],r=[et(e)],d=[Q];return e.strict||r.unshift(G),{name:"@unocss/preset-attributify",variants:s,extractors:r,options:e,autocomplete:{extractors:d}}},rt={key:0,"h-full":"","of-hidden":""},nt=p("div",{op50:""}," Module ",-1),lt=p("div",{"i-carbon-launch":""},null,-1),ct=p("div",{op50:""}," Matched Rules ",-1),at=p("div",{op50:""}," CSS Size ",-1),ot=p("span",{op50:""},"gzipped",-1),it={key:0,"row-span-3":""},dt=p("div",{op50:""}," Potentially Unmatched ",-1),ut={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},ft=z({props:{id:null},setup(e){const s=e,{data:r}=B(N(s,"id")),d=s.id.split(/\./g).pop(),c=O(null),_=W(c,"module-scrolls");function o(){fetch(`/__open-in-editor?file=${encodeURIComponent(s.id)}`)}const{extractors:t}=st({strict:!0}),a=I(async()=>{var n;const i=new Set;if(t){const l={code:((n=r.value)==null?void 0:n.code)||""};for(const h of t){const u=await h.extract(l);u==null||u.forEach(y=>i.add(y))}}return Array.from(i).filter(l=>!l.startsWith("[")).filter(l=>{var h;return!((h=r.value)!=null&&h.matched.includes(l))})});return(i,n)=>{const l=Z,h=j,u=q;return m(r)?(E(),R("div",rt,[b(h,{ref_key:"status",ref:c,grid:"~ cols-3 gap-4"},{default:U(()=>{var y;return[p("div",null,[nt,p("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:o},[b(l,{id:m(r).id,"mr-1":""},null,8,["id"]),lt])]),p("div",null,[ct,k(" "+$(m(r).matched.length),1)]),p("div",null,[at,k(" "+$(((((y=m(r))==null?void 0:y.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),ot]),m(a).length?(E(),R("div",it,[dt,p("code",null,$(m(a).join(", ")),1)])):w("",!0)]}),_:1},512),p("div",ut,[b(u,{"h-full":"","model-value":m(r).code,"read-only":!0,mode:m(d),matched:m(r).matched,class:"scrolls module-scrolls",style:V(m(_))},null,8,["model-value","mode","matched","style"]),b(u,{"h-full":"",b:"l main","model-value":m(r).css,"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:V(m(_))},null,8,["model-value","style"])])])):w("",!0)}}}),ht=z({setup(e){const s=K();return(r,d)=>{const c=ft;return E(),D(c,{id:m(s).params.id},null,8,["id"])}}});export{ht as default};
|