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