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