@unocss/inspector 0.47.6 → 0.48.0
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_-b353d660.js +1 -0
- package/dist/client/assets/{index-e3eb9aaf.css → index-485c44d9.css} +1 -1
- package/dist/client/assets/{index-9453f26c.js → index-90b5f220.js} +169 -169
- package/dist/client/assets/{repl-0ed4321d.js → repl-324f55f4.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_id_-04a1e846.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as x,r as b,u as S,a as k,b as V,f as B,o as h,c as w,e as a,w as m,g as s,h as C,v as R,i as e,j as p,k as P,n as f,_ as E,l as N,m as U,p as $,q as I}from"./index-
|
|
1
|
+
import{d as x,r as b,u as S,a as k,b as V,f as B,o as h,c as w,e as a,w as m,g as s,h as C,v as R,i as e,j as p,k as P,n as f,_ as E,l as N,m as U,p as $,q as I}from"./index-90b5f220.js";const L={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},M=s("div",null," REPL Playground ",-1),T=s("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1),j={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},q=x({__name:"ReplPlayground",setup(y){const r=b(null),l=S(r,"rpel-scrolls"),t=k("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
2
|
Hello World
|
|
3
3
|
</div>`),o=V("unocss-inspector-safelist",!1),{data:d}=B(t,o);return(H,n)=>{var i,_;const g=E,v=N,u=U;return h(),w("div",L,[a(g,{ref_key:"status",ref:r},{default:m(()=>[M,T]),_:1},512),a(v,{border:"b gray-400/20",title:""},{default:m(()=>[s("label",null,[C(s("input",{"onUpdate:modelValue":n[0]||(n[0]=c=>p(o)?o.value=c:null),type:"checkbox"},null,512),[[R,e(o)]]),P(" Include safelist ")])]),_:1}),s("div",j,[a(u,{modelValue:e(t),"onUpdate:modelValue":n[1]||(n[1]=c=>p(t)?t.value=c:null),mode:"html",matched:((i=e(d))==null?void 0:i.matched)||[],class:"scrolls rpel-scrolls",style:f(e(l))},null,8,["modelValue","matched","style"]),a(u,{"b-l":"","b-main":"","model-value":((_=e(d))==null?void 0:_.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls rpel-scrolls",style:f(e(l))},null,8,["model-value","style"])])])}}}),z={};function D(y,r){const l=q;return h(),I(l)}const A=$(z,[["render",D]]);export{A 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-90b5f220.js"></script>
|
|
12
|
+
<link rel="stylesheet" href="/__unocss/assets/index-485c44d9.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as I,t as R,x as O,d as B,y as W,z as D,r as C,u as U,A as j,B as Z,C as q,i,c as w,e as v,w as A,g as u,D as M,_ as G,o as E,k as S,E as V,F as N,n as P,h as H,v as K,M as J,G as L,m as Q,l as X,q as Y,H as tt}from"./index-9453f26c.js";const F=/^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/,et=(t={})=>{const n=t.prefix??"un-",a=t.prefixedOnly??!1,f=t.trueToNonValued??!1;return{name:"attributify",match(h){const x=I(h);if(!x)return;let e=x[1];if(e.startsWith(n))e=e.slice(n.length);else if(a)return;const s=x[2],[,c="",l=s]=s.match(F)||[];return l==="~"||f&&l==="true"||!l?`${c}${e}`:`${c}${e}-${l}`}}},lt=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,st=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,z=/[\s'"`;>]+/,rt={name:"attributify",extract:({content:t,cursor:n})=>{const a=t.matchAll(lt);let f,h=0;for(const r of a){const[,p,y]=r,b=r.index+p.length;if(n>b&&n<=b+y.length){h=b,f=y;break}}if(!f)return null;const x=f.matchAll(st);let e=0,s,c;for(const r of x){const[p,y,b]=r,$=h+r.index;if(n>$&&n<=$+p.length){e=$,s=y,c=b==null?void 0:b.slice(1);break}}if(!s||s==="class"||s==="className"||s===":class")return null;if(c===void 0)return{extracted:s,resolveReplacement(r){return{start:e,end:e+s.length,replacement:r}}};const l=e+s.length+2;let m=z.exec(c),o=0,_;for(;m;){const[r]=m;if(n>l+o&&n<=l+o+m.index){_=c.slice(o,o+m.index);break}o+=m.index+r.length,m=z.exec(c.slice(o))}_===void 0&&(_=c.slice(o));const[,d="",g]=_.match(F)||[];return{extracted:`${d}${s}-${g}`,transformSuggestions(r){return r.filter(p=>p.startsWith(`${d}${s}-`)).map(p=>d+p.slice(d.length+s.length+1))},resolveReplacement(r){return{start:o+l,end:o+l+_.length,replacement:d+r.slice(d.length+s.length+1)}}}}},nt=["v-bind:",":"],k=/[\s'"`;]+/g,at=/<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)>/gs,ct=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms,T=["placeholder"],ot=t=>{const n=(t==null?void 0:t.ignoreAttributes)??T,a=(t==null?void 0:t.nonValuedAttribute)??!0,f=(t==null?void 0:t.trueToNonValued)??!1;return{name:"attributify",extract({code:h}){const x=Array.from(h.matchAll(at)).flatMap(e=>Array.from((e[1]||"").matchAll(ct))).flatMap(([,e,...s])=>{const c=s.filter(Boolean).join("");if(n.includes(e))return[];for(const l of nt)if(e.startsWith(l)){e=e.slice(l.length);break}if(!c){if(R(e)&&a!==!1){const l=[`[${e}=""]`];return f&&l.push(`[${e}="true"]`),l}return[]}if(["class","className"].includes(e))return c.split(k).filter(R);{const l=Array.from(c.matchAll(/(?:[\?:].*?)(["'])([^\1]*?)\1/gms)).map(([,,m])=>m.split(k)).flat();return(l.length?l:c.split(k)).filter(Boolean).map(m=>`[${e}~="${m}"]`)}});return new Set(x)}}},it=(t={})=>{t.strict=t.strict??!1,t.prefix=t.prefix??"un-",t.prefixedOnly=t.prefixedOnly??!1,t.nonValuedAttribute=t.nonValuedAttribute??!0,t.ignoreAttributes=t.ignoreAttributes??T;const n=[et(t)],a=[ot(t)],f=[rt];return t.strict||a.unshift(O),{name:"@unocss/preset-attributify",variants:n,extractors:a,options:t,autocomplete:{extractors:f}}},ut={key:0,"h-full":"","of-hidden":""},dt=u("div",{op50:""}," Module ",-1),ft=u("div",{"i-carbon-launch":""},null,-1),mt=u("div",{op50:""}," Matched Rules ",-1),ht=u("div",{op50:""}," CSS Size ",-1),_t=u("span",{op50:""},"gzipped",-1),pt={key:0,"row-span-3":""},xt=u("div",{op50:""}," Potentially Unmatched ",-1),yt={"h-full":"","of-hidden":""},gt=B({__name:"ModuleInfo",props:{id:null},setup(t){const n=t,{data:a}=W(D(n,"id")),f=n.id.split(/\./g).pop(),h=C(null),x=U(h,"module-scrolls");function e(){fetch(`/__open-in-editor?file=${encodeURIComponent(n.id)}`)}const{extractors:s}=it({strict:!0}),c=j(async()=>{var _;const o=new Set;if(s){const d={code:((_=a.value)==null?void 0:_.code)||""};for(const g of s){const r=await g.extract(d);r==null||r.forEach(p=>o.add(p))}}return Array.from(o).filter(d=>!d.startsWith("[")).filter(d=>{var g;return!((g=a.value)!=null&&g.matched.includes(d))})}),l=C(!1),m=Z(q(()=>{var o;return(o=a.value)==null?void 0:o.css}),l);return(o,_)=>{const d=L,g=G,r=Q,p=X;return i(a)?(E(),w("div",ut,[v(g,{ref_key:"status",ref:h,grid:"~ cols-3 gap-4"},{default:A(()=>{var y;return[u("div",null,[dt,u("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:e},[v(d,{id:i(a).id,"mr-1":""},null,8,["id"]),ft])]),u("div",null,[mt,S(" "+V(i(a).matched.length),1)]),u("div",null,[ht,S(" "+V(((((y=i(a))==null?void 0:y.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),_t]),i(c).length?(E(),w("div",pt,[xt,u("code",null,V(i(c).join(", ")),1)])):M("",!0)]}),_:1},512),u("div",yt,[v(i(J),null,{default:A(()=>[v(i(N),{size:"50"},{default:A(()=>[v(r,{"h-full":"","model-value":i(a).code,"read-only":!0,mode:i(f),matched:i(a).matched,class:"scrolls module-scrolls",style:P(i(x))},null,8,["model-value","mode","matched","style"])]),_:1}),v(i(N),{size:"50"},{default:A(()=>[u("div",null,[v(p,{border:"l b gray-400/20",title:"Output CSS"},{default:A(()=>[u("label",null,[H(u("input",{"onUpdate:modelValue":_[0]||(_[0]=y=>l.value=y),type:"checkbox"},null,512),[[K,l.value]]),S(" Prettify ")])]),_:1}),v(r,{"h-full":"",b:"l main","model-value":i(m),"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:P(i(x))},null,8,["model-value","style"])])]),_:1})]),_:1})])])):M("",!0)}}}),bt=B({__name:"[id]",setup(t){const n=tt();return(a,f)=>{const h=gt;return E(),Y(h,{id:i(n).params.id},null,8,["id"])}}});export{bt as default};
|