@unocss/inspector 0.52.0 → 0.52.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/dist/client/assets/_id_-7edafef9.js +1 -0
- package/dist/client/assets/{index-4facade2.js → index-1b92be1e.js} +129 -129
- package/dist/client/assets/{repl-d67a9619.js → repl-476ed53a.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/_id_-b36dfc97.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as j,t as C,d as W,x as D,y as U,r as N,u as Z,z as q,A as G,B as K,j as i,c as M,g,w as S,e as f,C as w,_ as H,o as P,k as R,D as k,E as z,n as B,h as J,v as L,i as Q,M as X,F as Y,m as ee,l as te,q as re,G as le}from"./index-1b92be1e.js";const T=/^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;function se(e={}){const m=e.prefix??"un-",l=e.prefixedOnly??!1,x=e.trueToNonValued??!1;let u;return{name:"attributify",match(y,{generator:a}){var _,c;const h=j(y);if(!h)return;let r=h[1];if(r.startsWith(m))r=r.slice(m.length);else if(l)return;const t=h[2],[,v="",n=t]=t.match(T)||[];if(n==="~"||x&&n==="true"||!n)return`${v}${r}`;if(u==null){const s=(c=(_=a==null?void 0:a.config)==null?void 0:_.separators)==null?void 0:c.join("|");s?u=new RegExp(`^(.*\\](?:${s}))(\\[[^\\]]+?\\])$`):u=!1}if(u){const[,s,d]=t.match(u)||[];if(d)return`${s}${v}${r}-${d}`}return`${v}${r}-${n}`}}}const ae=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,ne=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,F=/[\s'"`;>]+/;function ce(e){return{name:"attributify",extract:({content:m,cursor:l})=>{const x=m.matchAll(ae);let u,y=0;for(const o of x){const[,b,V]=o,$=o.index+b.length;if(l>$&&l<=$+V.length){y=$,u=V;break}}if(!u)return null;const a=u.matchAll(ne);let h=0,r,t;for(const o of a){const[b,V,$]=o,E=y+o.index;if(l>E&&l<=E+b.length){h=E,r=V,t=$==null?void 0:$.slice(1);break}}if(!r||r==="class"||r==="className"||r===":class")return null;const v=!!(e!=null&&e.prefix)&&r.startsWith(e.prefix);if(e!=null&&e.prefixedOnly&&!v)return null;const n=v?r.slice(e.prefix.length):r;if(t===void 0)return{extracted:n,transformSuggestions(o){return v?o.map(b=>e.prefix+b):o},resolveReplacement(o){return{start:h,end:h+r.length,replacement:o}}};const _=h+r.length+2;let c=F.exec(t),s=0,d;for(;c;){const[o]=c;if(l>_+s&&l<=_+s+c.index){d=t.slice(s,s+c.index);break}s+=c.index+o.length,c=F.exec(t.slice(s))}d===void 0&&(d=t.slice(s));const[,p="",A]=d.match(T)||[];return{extracted:`${p}${n}-${A}`,transformSuggestions(o){return o.filter(b=>b.startsWith(`${p}${n}-`)).map(b=>p+b.slice(p.length+n.length+1))},resolveReplacement(o){return{start:s+_,end:s+_+d.length,replacement:p+o.slice(p.length+n.length+1)}}}}}}const ie=["v-bind:",":"],O=/[\s'"`;]+/g,ue=/<[^>\s]*\s((?:'.*?'|".*?"|`.*?`|\{.*?\}|[^>]*?)*)/g,oe=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~<]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms,I=["placeholder","fill","opacity"];function de(e){const m=(e==null?void 0:e.ignoreAttributes)??I,l=(e==null?void 0:e.nonValuedAttribute)??!0,x=(e==null?void 0:e.trueToNonValued)??!1;return{name:"@unocss/preset-attributify/extractor",extract({code:u}){const y=Array.from(u.matchAll(ue)).flatMap(a=>Array.from((a[1]||"").matchAll(oe))).flatMap(([,a,...h])=>{const r=h.filter(Boolean).join("");if(m.includes(a))return[];for(const t of ie)if(a.startsWith(t)){a=a.slice(t.length);break}if(!r){if(C(a)&&l!==!1){const t=[`[${a}=""]`];return x&&t.push(`[${a}="true"]`),t}return[]}return["class","className"].includes(a)?r.split(O).filter(C):e!=null&&e.prefixedOnly&&e.prefix&&!a.startsWith(e.prefix)?[]:r.split(O).filter(t=>!!t&&t!==":").map(t=>`[${a}~="${t}"]`)});return new Set(y)}}}function fe(e={}){e.strict=e.strict??!1,e.prefix=e.prefix??"un-",e.prefixedOnly=e.prefixedOnly??!1,e.nonValuedAttribute=e.nonValuedAttribute??!0,e.ignoreAttributes=e.ignoreAttributes??I;const m=[se(e)],l=[de(e)],x=[ce(e)];return{name:"@unocss/preset-attributify",enforce:"post",variants:m,extractors:l,options:e,autocomplete:{extractors:x},extractorDefault:e.strict?!1:void 0}}const me={key:0,"h-full":"","of-hidden":""},he=f("div",{op50:""}," Module ",-1),_e=f("div",{"i-carbon-launch":""},null,-1),xe=f("div",{op50:""}," Matched Rules ",-1),pe=f("div",{op50:""}," CSS Size ",-1),ye=f("span",{op50:""},"gzipped",-1),ve={key:0,"row-span-3":""},be=f("div",{op50:""}," Potentially Unmatched ",-1),ge={"h-full":"","of-hidden":""},$e=W({__name:"ModuleInfo",props:{id:null},setup(e){const m=e,{data:l}=D(U(m,"id")),x=m.id.split(/\./g).pop(),u=N(null),y=Z(u,"module-scrolls");function a(){fetch(`/__open-in-editor?file=${encodeURIComponent(m.id)}`)}const{extractors:h}=fe({strict:!0}),r=q(async()=>{var _;const n=new Set;if(h){const c={code:((_=l.value)==null?void 0:_.code)||""};for(const s of h){const d=await s.extract(c);d==null||d.forEach(p=>n.add(p))}}return Array.from(n).filter(c=>!c.startsWith("[")).filter(c=>{var s;return!((s=l.value)!=null&&s.matched.includes(c))})}),t=N(!1),v=G(K(()=>{var n;return(n=l.value)==null?void 0:n.css}),t);return(n,_)=>{const c=Y,s=H,d=ee,p=te;return i(l)?(P(),M("div",me,[g(s,{ref_key:"status",ref:u,grid:"~ cols-3 gap-4"},{default:S(()=>{var A;return[f("div",null,[he,f("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:a},[g(c,{id:i(l).id,"mr-1":""},null,8,["id"]),_e])]),f("div",null,[xe,R(" "+k(i(l).matched.length),1)]),f("div",null,[pe,R(" "+k(((((A=i(l))==null?void 0:A.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),ye]),i(r).length?(P(),M("div",ve,[be,f("code",null,k(i(r).join(", ")),1)])):w("",!0)]}),_:1},512),f("div",ge,[g(i(X),null,{default:S(()=>[g(i(z),{size:"50"},{default:S(()=>[g(d,{"h-full":"","model-value":i(l).code,"read-only":!0,mode:i(x),matched:i(l).matched,class:"scrolls module-scrolls",style:B(i(y))},null,8,["model-value","mode","matched","style"])]),_:1}),g(i(z),{size:"50"},{default:S(()=>[f("div",null,[g(p,{border:"l b gray-400/20",title:"Output CSS"},{default:S(()=>[f("label",null,[J(f("input",{"onUpdate:modelValue":_[0]||(_[0]=A=>Q(t)?t.value=A:null),type:"checkbox"},null,512),[[L,i(t)]]),R(" Prettify ")])]),_:1}),g(d,{"h-full":"",b:"l main","model-value":i(v),"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:B(i(y))},null,8,["model-value","style"])])]),_:1})]),_:1})])])):w("",!0)}}}),Se=W({__name:"[id]",setup(e){const m=le();return(l,x)=>{const u=$e;return P(),re(u,{id:i(m).params.id},null,8,["id"])}}});export{Se as default};
|