@unocss/inspector 0.37.3 → 0.38.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/README.md +1 -1
- package/dist/client/assets/_id_.ae0f85c3.js +1 -0
- package/dist/client/assets/index.00f1fc60.css +1 -0
- package/dist/client/assets/index.37306e5c.js +220 -0
- package/dist/client/assets/{repl.746c9f79.js → repl.5fed5469.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_id_.d2c3ba35.js +0 -1
- package/dist/client/assets/index.17b5e9f2.js +0 -30
- package/dist/client/assets/index.6ec50f91.css +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 R,h as V,j as b,k as w}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 R,h as V,j as b,k as w}from"./index.37306e5c.js";const C={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},P=n("div",null," REPL Playground ",-1),E=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({name:"ReplPlayground",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=R,c=V;return i(),S("div",C,[l(p,{ref_key:"status",ref:o},{default:k(()=>[P,E]),_: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(),w(s)}var L=b($,[["render",j]]);export{L as default};
|
package/dist/client/index.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
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.
|
|
12
|
-
<link rel="stylesheet" href="/__unocss/assets/index.
|
|
11
|
+
<script type="module" crossorigin src="/__unocss/assets/index.37306e5c.js"></script>
|
|
12
|
+
<link rel="stylesheet" href="/__unocss/assets/index.00f1fc60.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as S,m as z,d as F,p as P,t as B,r as T,u as I,q as O,g as h,o as V,c as E,b,w as W,e as p,s as R,v as $,x as k,n as w,y as U,_ as Z,h as j,k as q,z as D}from"./index.17b5e9f2.js";const K=t=>t.split(/[\s'"`;>=]+/g).filter(S),G={name:"split",order:0,extract({code:t}){return new Set(K(t))}},M=/^(?!\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/,H=(t={})=>{var o,d,i;const n=(o=t.prefix)!=null?o:"un-",c=(d=t.prefixedOnly)!=null?d:!1,_=(i=t.trueToNonValued)!=null?i:!1;return{name:"attributify",match(l){const a=z(l);if(!a)return;let e=a[1];if(e.startsWith(n))e=e.slice(n.length);else if(c)return;const u=a[2],[,s="",r=u]=u.match(M)||[];return r==="~"||_&&r==="true"||!r?`${s}${e}`:`${s}${e}-${r}`}}},J=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,L=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,N=/[\s'"`;>]+/,Q={name:"attributify",extract:({content:t,cursor:n})=>{const c=t.matchAll(J);let _,o=0;for(const m of c){const[,x,v]=m,g=m.index+x.length;if(n>g&&n<=g+v.length){o=g,_=v;break}}if(!_)return null;const d=_.matchAll(L);let i=0,l,a;for(const m of d){const[x,v,g]=m,A=o+m.index;if(n>A&&n<=A+x.length){i=A,l=v,a=g==null?void 0:g.slice(1);break}}if(!l||l==="class"||l==="className")return null;if(a===void 0)return{extracted:l,resolveReplacement(m){return{start:i,end:i+l.length,replacement:m}}};const e=i+l.length+2;let u=N.exec(a),s=0,r;for(;u;){const[m]=u;if(n>e+s&&n<=e+s+u.index){r=a.slice(s,s+u.index);break}s+=u.index+m.length,u=N.exec(a.slice(s))}r===void 0&&(r=a.slice(s));const[,f="",y]=r.match(M)||[];return{extracted:`${f}${l}-${y}`,transformSuggestions(m){return m.filter(x=>x.startsWith(`${f}${l}-`)).map(x=>f+x.slice(f.length+l.length+1))},resolveReplacement(m){return{start:s+e,end:s+e+r.length,replacement:f+m.slice(f.length+l.length+1)}}}}},X=["v-bind:",":"],C=/[\s'"`;]+/g,Y=/<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)>/gs,tt=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:=(["'])([^\2]*?)\2)?/g,et=t=>{var o,d,i;const n=(o=t==null?void 0:t.ignoreAttributes)!=null?o:[],c=(d=t==null?void 0:t.nonValuedAttribute)!=null?d:!0,_=(i=t==null?void 0:t.trueToNonValued)!=null?i:!1;return{name:"attributify",extract({code:l}){const a=Array.from(l.matchAll(Y)).flatMap(e=>Array.from((e[1]||"").matchAll(tt))).flatMap(([,e,u,s])=>{if(n.includes(e))return[];for(const r of X)if(e.startsWith(r)){e=e.slice(r.length);break}if(!s){if(S(e)&&c!==!1){const r=[`[${e}=""]`];return _&&r.push(`[${e}="true"]`),r}return[]}return["class","className"].includes(e)?s.split(C).filter(S):s.split(C).filter(Boolean).map(r=>`[${e}~="${r}"]`)});return new Set(a)}}},rt=(t={})=>{var o,d,i,l,a;t.strict=(o=t.strict)!=null?o:!1,t.prefix=(d=t.prefix)!=null?d:"un-",t.prefixedOnly=(i=t.prefixedOnly)!=null?i:!1,t.nonValuedAttribute=(l=t.nonValuedAttribute)!=null?l:!0,t.ignoreAttributes=(a=t.ignoreAttributes)!=null?a:[];const n=[H(t)],c=[et(t)],_=[Q];return t.strict||c.unshift(G),{name:"@unocss/preset-attributify",variants:n,extractors:c,options:t,autocomplete:{extractors:_}}},st={key:0,"h-full":"","of-hidden":""},lt=p("div",{op50:""}," Module ",-1),nt=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":""},ut=p("div",{op50:""}," Potentially Unmatched ",-1),dt={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},ft=F({name:"ModuleInfo",props:{id:null},setup(t){const n=t,{data:c}=P(B(n,"id")),_=n.id.split(/\./g).pop(),o=T(null),d=I(o,"module-scrolls");function i(){fetch(`/__open-in-editor?file=${encodeURIComponent(n.id)}`)}const{extractors:l}=rt({strict:!0}),a=O(async()=>{var u;const e=new Set;if(l){const s={code:((u=c.value)==null?void 0:u.code)||""};for(const r of l){const f=await r.extract(s);f==null||f.forEach(y=>e.add(y))}}return Array.from(e).filter(s=>!s.startsWith("[")).filter(s=>{var r;return!((r=c.value)!=null&&r.matched.includes(s))})});return(e,u)=>{const s=U,r=Z,f=j;return h(c)?(V(),E("div",st,[b(r,{ref_key:"status",ref:o,grid:"~ cols-3 gap-4"},{default:W(()=>{var y;return[p("div",null,[lt,p("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:i},[b(s,{id:h(c).id,"mr-1":""},null,8,["id"]),nt])]),p("div",null,[ct,R(" "+$(h(c).matched.length),1)]),p("div",null,[at,R(" "+$(((((y=h(c))==null?void 0:y.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),ot]),h(a).length?(V(),E("div",it,[ut,p("code",null,$(h(a).join(", ")),1)])):k("",!0)]}),_:1},512),p("div",dt,[b(f,{"h-full":"","model-value":h(c).code,"read-only":!0,mode:h(_),matched:h(c).matched,class:"scrolls module-scrolls",style:w(h(d))},null,8,["model-value","mode","matched","style"]),b(f,{"h-full":"",b:"l main","model-value":h(c).css,"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:w(h(d))},null,8,["model-value","style"])])])):k("",!0)}}}),ht=F({name:"[id]",setup(t){const n=D();return(c,_)=>{const o=ft;return V(),q(o,{id:h(n).params.id},null,8,["id"])}}});export{ht as default};
|