@unocss/inspector 66.6.0-beta.1 → 66.6.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_-CiHreCiF.js → _id_-DEOrAJwO.js} +1 -1
- package/dist/client/assets/{index-JjKgwI2w.js → index-BYGoiv1F.js} +121 -121
- package/dist/client/assets/{repl-CNmsOEK1.js → repl-DKGHtYvd.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/index.mjs +3 -0
- package/package.json +7 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as q,t as B,x as G,d as W,y as H,
|
|
1
|
+
import{s as q,t as B,x as G,d as W,y as H,u as J,z as K,j as l,o as k,c as w,g as _,w as V,e as p,A as L,k as R,B as E,C as F,D as Q,i as M,_ as X,E as z,m as Y,n as O,l as Z,h as tt,v as et,P as rt,q as j,F as st,r as C,G as lt,H as nt,I as at,J as ot}from"./index-BYGoiv1F.js";const D=/^(?!.*\[[^:]+:.+\]$)((?:.+:)?!?)(.*)$/;function it(e={}){const h=e.prefix??"un-",s=e.prefixedOnly??!1,g=e.trueToNonValued??!1;let i;return{name:"attributify",match(n,{generator:b}){const a=G(n);if(!a)return;let r=a[1];if(r.startsWith(h))r=r.slice(h.length);else if(s)return;const u=a[2],[,d="",f=u]=u.match(D)||[];if(f==="~"||g&&f==="true"||!f)return`${d}${r}`;if(i==null){const c=b?.config?.separators?.join("|");c?i=new RegExp(`^(.*\\](?:${c}))(\\[[^\\]]+?\\])$`):i=!1}if(i){const[,c,t]=u.match(i)||[];if(t)return`${c}${d}${r}-${t}`}if(d&&f.match(/^[\d.]+$/)){const c=d.split(/([^:]*:)/g).filter(Boolean),t=c.pop()+f,o=c.join("");return[{matcher:`${d}${r}-${f}`},{matcher:`${o}${r}-${t}`}]}return`${d}${r}-${f}`}}}const ct=/(<\w[\w:.$-]*\s)((?:'[^>']*'|"[^>"]*"|`[^>`]*`|\{[^>}]*\}|[^>]*?)*)/g,ut=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF-:%]+)(?:=("[^"]*|'[^']*))?/g,I=/[\s'"`;>]+/;function dt(e){return{name:"attributify",extract:({content:h,cursor:s})=>{const g=h.matchAll(ct);let i,n=0;for(const m of g){const[,x,v]=m,A=m.index+x.length;if(s>A&&s<=A+v.length){n=A,i=v;break}}if(!i)return null;const b=i.matchAll(ut);let a=0,r,u;for(const m of b){const[x,v,A]=m,P=n+m.index;if(s>P&&s<=P+x.length){a=P,r=v,u=A?.slice(1);break}}if(!r||r==="class"||r==="className"||r===":class")return null;const d=!!e?.prefix&&r.startsWith(e.prefix);if(e?.prefixedOnly&&!d)return null;const f=d?r.slice(e.prefix.length):r;if(u===void 0)return{extracted:f,resolveReplacement(m){const x=d?e.prefix.length:0;return{start:a+x,end:a+r.length,replacement:m}}};const c=a+r.length+2;let t=I.exec(u),o=0,$;for(;t;){const[m]=t;if(s>c+o&&s<=c+o+t.index){$=u.slice(o,o+t.index);break}o+=t.index+m.length,t=I.exec(u.slice(o))}$===void 0&&($=u.slice(o));const[,y="",S]=$.match(D)||[];return{extracted:`${y}${f}-${S}`,transformSuggestions(m){return m.filter(x=>x.startsWith(`${y}${f}-`)).map(x=>y+x.slice(y.length+f.length+1))},resolveReplacement(m){return{start:o+c,end:o+c+$.length,replacement:y+m.slice(y.length+f.length+1)}}}}}}const ft=["v-bind:",":"],T=/[\s'"`;]+/g,N=/<[^>\s]*\s((?:'[^']*'|"[^"]*"|`[^`]*`|\{[^}]*\}|=>|[^>]*?)*)/g,mt=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF:!%.~<-]+)=?(?:"([^"]*)"|'([^']*)'|\{([^}]*)\})?/g,U=["placeholder","fill","opacity","stroke-opacity"];function pt(e){const h=e?.ignoreAttributes??U,s=e?.nonValuedAttribute??!0,g=e?.trueToNonValued??!1;return{name:"@unocss/preset-attributify/extractor",extract({code:i}){return Array.from(i.matchAll(N)).flatMap(n=>Array.from((n[1]||"").matchAll(mt))).flatMap(([,n,...b])=>{const a=b.filter(Boolean).join("");if(h.includes(n))return[];for(const r of ft)if(n.startsWith(r)){n=n.slice(r.length);break}if(!a){if(B(n)&&s!==!1){const r=[`[${n}=""]`];return g&&r.push(`[${n}="true"]`),r}return[]}return["class","className"].includes(n)?a.split(T).filter(B):N.test(a)?(N.lastIndex=0,this.extract({code:a})):e?.prefixedOnly&&e.prefix&&!n.startsWith(e.prefix)?[]:a.split(T).filter(r=>!!r&&r!==":").map(r=>`[${n}~="${r}"]`)})}}}const ht=q((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,{name:"@unocss/preset-attributify",enforce:"post",variants:[it(e)],extractors:[pt(e)],options:e,autocomplete:{extractors:[dt(e)]},extractorDefault:e.strict?!1:void 0}));var xt=ht;const yt={key:0,"h-full":"","of-hidden":"",flex:"","flex-col":""},vt={p:"4",grid:"~ cols-4 gap-4"},_t={key:0,"row-span-3":""},gt={key:0,"h-full":"","of-hidden":""},$t=W({__name:"ModuleInfo",props:{id:{}},setup(e){const h=e,{data:s}=H(at(h,"id")),g=h.id.split(/\./g).pop(),i=C(null),n=J(i,"module-scrolls");function b(){fetch(`/__open-in-editor?file=${encodeURIComponent(h.id)}`)}const{extractors:a}=xt({strict:!0}),r=K(async()=>{const c=new Set;if(a){const t={code:s.value?.code||""};for(const o of a)(await o.extract(t))?.forEach(y=>c.add(y))}return Array.from(c).filter(t=>!t.startsWith("[")).filter(t=>!s.value?.matched?.some(({rawSelector:o})=>o===t))},[]),u=C(!1),d=C("source"),f=lt(nt(()=>s.value?.css),u);return(c,t)=>{const o=L,$=Q,y=X,S=Y,m=Z,x=st;return l(s)?(k(),w("div",yt,[_(y,{ref_key:"status",ref:i,p0:""},{default:V(()=>[p("div",vt,[p("div",null,[t[3]||(t[3]=p("div",{op50:""}," Module ",-1)),p("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:b},[_(o,{id:l(s).id,"mr-1":""},null,8,["id"]),t[2]||(t[2]=p("div",{"i-carbon-launch":""},null,-1))])]),p("div",null,[t[4]||(t[4]=p("div",{op50:""}," Matched Rules ",-1)),R(" "+E(l(s).matched.length),1)]),p("div",null,[t[5]||(t[5]=p("div",{op50:""}," CSS Size ",-1)),R(" "+E(((l(s)?.gzipSize||0)/1024).toFixed(2))+" KiB ",1),t[6]||(t[6]=p("span",{op50:""},"gzipped",-1))]),l(r).length?(k(),w("div",_t,[t[7]||(t[7]=p("div",{op50:""}," Potentially Unmatched ",-1)),p("code",null,E(l(r).join(", ")),1)])):F("",!0)]),_($,{modelValue:l(d),"onUpdate:modelValue":t[0]||(t[0]=v=>M(d)?d.value=v:null)},null,8,["modelValue"])]),_:1},512),l(d)==="source"?(k(),w("div",gt,[_(l(rt),null,{default:V(()=>[_(l(z),{size:"50"},{default:V(()=>[_(S,{"h-full":"","model-value":l(s).code,"read-only":!0,mode:l(g),matched:l(s).matched?.map(({rawSelector:v})=>v),class:"scrolls module-scrolls",style:O(l(n))},null,8,["model-value","mode","matched","style"])]),_:1}),_(l(z),{size:"50"},{default:V(()=>[p("div",null,[_(m,{border:"l b gray-400/20",title:"Output CSS"},{default:V(()=>[p("label",null,[tt(p("input",{"onUpdate:modelValue":t[1]||(t[1]=v=>M(u)?u.value=v:null),type:"checkbox"},null,512),[[et,l(u)]]),t[8]||(t[8]=R(" Prettify ",-1))])]),_:1}),_(S,{"h-full":"",border:"l main","model-value":l(f),"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:O(l(n))},null,8,["model-value","style"])])]),_:1})]),_:1})])):(k(),j(x,{key:1,"flex-grow":"","overflow-y-auto":"",selectors:l(s).matched,icons:l(s).icons,colors:l(s).colors},null,8,["selectors","icons","colors"]))])):F("",!0)}}}),At=W({__name:"[id]",setup(e){const h=ot();return(s,g)=>{const i=$t;return k(),j(i,{id:l(h).params.id},null,8,["id"])}}});export{At as default};
|