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