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