@unocss/inspector 66.2.3 → 66.3.1-beta.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_-Bn5aLY0_.js +1 -0
- package/dist/client/assets/{index-8SRY6IBm.js → index-J6MUUSmm.js} +154 -154
- package/dist/client/assets/repl-C_RFehW6.js +3 -0
- package/dist/client/index.html +1 -1
- package/package.json +3 -3
- package/dist/client/assets/_id_-3UMlqmvD.js +0 -1
- package/dist/client/assets/repl-CkbHmV-7.js +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{d as g,r as h,u as x,a as S,b,f as k,c as V,o as p,e as s,g as a,w as i,_ as B,h as w,i as C,j as _,v as R,k as l,l as P,n as m,m as E,p as N,q as U}from"./index-J6MUUSmm.js";const $={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},I={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},L=g({__name:"ReplPlayground",setup(f){const r=h(null),t=x(r,"repl-scrolls"),o=S("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
|
+
Hello World
|
|
3
|
+
</div>`),n=b("unocss-inspector-safelist",!1),{data:c}=k(o,n);return(j,e)=>{const y=B,v=P,u=E;return p(),V("div",$,[s("div",{ref_key:"status",ref:r},[a(y,null,{default:i(()=>e[2]||(e[2]=[s("div",null," REPL Playground ",-1),s("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1)])),_:1,__:[2]}),a(v,{border:"b gray-400/20",title:""},{default:i(()=>[s("label",null,[w(s("input",{"onUpdate:modelValue":e[0]||(e[0]=d=>_(n)?n.value=d:null),type:"checkbox"},null,512),[[R,l(n)]]),e[3]||(e[3]=C(" Include safelist "))])]),_:1})],512),s("div",I,[a(u,{modelValue:l(o),"onUpdate:modelValue":e[1]||(e[1]=d=>_(o)?o.value=d:null),mode:"html",matched:l(c)?.matched||[],class:"scrolls repl-scrolls",style:m(l(t))},null,8,["modelValue","matched","style"]),a(u,{border:"l main","model-value":l(c)?.css||"/* empty */","read-only":!0,mode:"css",class:"scrolls repl-scrolls",style:m(l(t))},null,8,["model-value","style"])])])}}}),M={};function T(f,r){const t=L;return p(),U(t)}const z=N(M,[["render",T]]);export{z as default};
|
package/dist/client/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;400&family=Fira+Code&display=swap"
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
|
-
<script type="module" crossorigin src="/__unocss/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/__unocss/assets/index-J6MUUSmm.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/__unocss/assets/index-BGDbepRp.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/inspector",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.
|
|
4
|
+
"version": "66.3.1-beta.1",
|
|
5
5
|
"description": "The inspector UI for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"gzip-size": "^6.0.0",
|
|
39
39
|
"sirv": "^3.0.1",
|
|
40
40
|
"vue-flow-layout": "^0.1.1",
|
|
41
|
-
"@unocss/core": "66.
|
|
42
|
-
"@unocss/rule-utils": "66.
|
|
41
|
+
"@unocss/core": "66.3.1-beta.1",
|
|
42
|
+
"@unocss/rule-utils": "66.3.1-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "unbuild",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as q,t as B,d as W,x as G,y as H,r as E,u as K,z as J,A as L,B as Q,c as R,C as F,k as n,o as S,g as A,q as j,w as k,e as x,D as X,i as w,E as C,F as Y,j as M,_ as Z,G as z,m as ee,n as O,l as te,h as re,v as le,P as se,H as ne,I as ae}from"./index-8SRY6IBm.js";const D=/^(?!.*\[[^:]+:.+\]$)((?:.+:)?!?)(.*)$/;function ce(e={}){const p=e.prefix??"un-",l=e.prefixedOnly??!1,b=e.trueToNonValued??!1;let u;return{name:"attributify",match(a,{generator:g}){var y,r;const c=q(a);if(!c)return;let t=c[1];if(t.startsWith(p))t=t.slice(p.length);else if(l)return;const d=c[2],[,f="",m=d]=d.match(D)||[];if(m==="~"||b&&m==="true"||!m)return`${f}${t}`;if(u==null){const s=(r=(y=g==null?void 0:g.config)==null?void 0:y.separators)==null?void 0:r.join("|");s?u=new RegExp(`^(.*\\](?:${s}))(\\[[^\\]]+?\\])$`):u=!1}if(u){const[,s,o]=d.match(u)||[];if(o)return`${s}${f}${t}-${o}`}if(f&&m.match(/^[\d.]+$/)){const s=f.split(/([^:]*:)/g).filter(Boolean),o=s.pop()+m,i=s.join("");return[{matcher:`${f}${t}-${m}`},{matcher:`${i}${t}-${o}`}]}return`${f}${t}-${m}`}}}const oe=/(<\w[\w:.$-]*\s)((?:'[^>']*'|"[^>"]*"|`[^>`]*`|\{[^>}]*\}|[^>]*?)*)/g,ie=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF-:%]+)(?:=("[^"]*|'[^']*))?/g,I=/[\s'"`;>]+/;function ue(e){return{name:"attributify",extract:({content:p,cursor:l})=>{const b=p.matchAll(oe);let u,a=0;for(const h of b){const[,_,v]=h,$=h.index+_.length;if(l>$&&l<=$+v.length){a=$,u=v;break}}if(!u)return null;const g=u.matchAll(ie);let c=0,t,d;for(const h of g){const[_,v,$]=h,P=a+h.index;if(l>P&&l<=P+_.length){c=P,t=v,d=$==null?void 0:$.slice(1);break}}if(!t||t==="class"||t==="className"||t===":class")return null;const f=!!(e!=null&&e.prefix)&&t.startsWith(e.prefix);if(e!=null&&e.prefixedOnly&&!f)return null;const m=f?t.slice(e.prefix.length):t;if(d===void 0)return{extracted:m,resolveReplacement(h){const _=f?e.prefix.length:0;return{start:c+_,end:c+t.length,replacement:h}}};const y=c+t.length+2;let r=I.exec(d),s=0,o;for(;r;){const[h]=r;if(l>y+s&&l<=y+s+r.index){o=d.slice(s,s+r.index);break}s+=r.index+h.length,r=I.exec(d.slice(s))}o===void 0&&(o=d.slice(s));const[,i="",V]=o.match(D)||[];return{extracted:`${i}${m}-${V}`,transformSuggestions(h){return h.filter(_=>_.startsWith(`${i}${m}-`)).map(_=>i+_.slice(i.length+m.length+1))},resolveReplacement(h){return{start:s+y,end:s+y+o.length,replacement:i+h.slice(i.length+m.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 p=(e==null?void 0:e.ignoreAttributes)??U,l=(e==null?void 0:e.nonValuedAttribute)??!0,b=(e==null?void 0:e.trueToNonValued)??!1;return{name:"@unocss/preset-attributify/extractor",extract({code:u}){return Array.from(u.matchAll(N)).flatMap(a=>Array.from((a[1]||"").matchAll(fe))).flatMap(([,a,...g])=>{const c=g.filter(Boolean).join("");if(p.includes(a))return[];for(const t of de)if(a.startsWith(t)){a=a.slice(t.length);break}if(!c){if(B(a)&&l!==!1){const t=[`[${a}=""]`];return b&&t.push(`[${a}="true"]`),t}return[]}return["class","className"].includes(a)?c.split(T).filter(B):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 p=[ce(e)],l=[me(e)],b=[ue(e)];return{name:"@unocss/preset-attributify",enforce:"post",variants:p,extractors:l,options:e,autocomplete:{extractors:b},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 p=e,{data:l}=G(H(p,"id")),b=p.id.split(/\./g).pop(),u=E(null),a=K(u,"module-scrolls");function g(){fetch(`/__open-in-editor?file=${encodeURIComponent(p.id)}`)}const{extractors:c}=he({strict:!0}),t=J(async()=>{var r;const y=new Set;if(c){const s={code:((r=l.value)==null?void 0:r.code)||""};for(const o of c){const i=await o.extract(s);i==null||i.forEach(V=>y.add(V))}}return Array.from(y).filter(s=>!s.startsWith("[")).filter(s=>{var o,i;return!((i=(o=l.value)==null?void 0:o.matched)!=null&&i.some(({rawSelector:V})=>V===s))})},[]),d=E(!1),f=E("source"),m=L(Q(()=>{var y;return(y=l.value)==null?void 0:y.css}),d);return(y,r)=>{const s=X,o=Y,i=Z,V=ee,h=te,_=ne;return n(l)?(S(),R("div",xe,[A(i,{ref_key:"status",ref:u,p0:""},{default:k(()=>{var v;return[x("div",pe,[x("div",null,[r[3]||(r[3]=x("div",{op50:""}," Module ",-1)),x("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:g},[A(s,{id:n(l).id,"mr-1":""},null,8,["id"]),r[2]||(r[2]=x("div",{"i-carbon-launch":""},null,-1))])]),x("div",null,[r[4]||(r[4]=x("div",{op50:""}," Matched Rules ",-1)),w(" "+C(n(l).matched.length),1)]),x("div",null,[r[5]||(r[5]=x("div",{op50:""}," CSS Size ",-1)),w(" "+C(((((v=n(l))==null?void 0:v.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),r[6]||(r[6]=x("span",{op50:""},"gzipped",-1))]),n(t).length?(S(),R("div",ye,[r[7]||(r[7]=x("div",{op50:""}," Potentially Unmatched ",-1)),x("code",null,C(n(t).join(", ")),1)])):F("",!0)]),A(o,{modelValue:n(f),"onUpdate:modelValue":r[0]||(r[0]=$=>M(f)?f.value=$:null)},null,8,["modelValue"])]}),_:1},512),n(f)==="source"?(S(),R("div",ve,[A(n(se),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(b),matched:(v=n(l).matched)==null?void 0:v.map(({rawSelector:$})=>$),class:"scrolls module-scrolls",style:O(n(a))},null,8,["model-value","mode","matched","style"])]}),_:1}),A(n(z),{size:"50"},{default:k(()=>[x("div",null,[A(h,{border:"l b gray-400/20",title:"Output CSS"},{default:k(()=>[x("label",null,[re(x("input",{"onUpdate:modelValue":r[1]||(r[1]=v=>M(d)?d.value=v:null),type:"checkbox"},null,512),[[le,n(d)]]),r[8]||(r[8]=w(" Prettify "))])]),_:1}),A(V,{"h-full":"",border:"l main","model-value":n(m),"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,icons:n(l).icons,colors:n(l).colors},null,8,["selectors","icons","colors"]))])):F("",!0)}}}),be=W({__name:"[id]",setup(e){const p=ae();return(l,b)=>{const u=_e;return S(),j(u,{id:n(p).params.id},null,8,["id"])}}});export{be as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{d as x,r as S,u as b,a as k,b as V,f as B,c as w,o as y,e as s,g as a,w as m,_ as C,h as R,i as P,j as p,v as E,k as l,l as N,n as f,m as U,p as $,q as I}from"./index-8SRY6IBm.js";const L={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},M={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},T=x({__name:"ReplPlayground",setup(v){const r=S(null),t=b(r,"repl-scrolls"),o=k("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
|
-
Hello World
|
|
3
|
-
</div>`),n=V("unocss-inspector-safelist",!1),{data:c}=B(o,n);return(z,e)=>{var i,_;const g=C,h=N,u=U;return y(),w("div",L,[s("div",{ref_key:"status",ref:r},[a(g,null,{default:m(()=>e[2]||(e[2]=[s("div",null," REPL Playground ",-1),s("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1)])),_:1,__:[2]}),a(h,{border:"b gray-400/20",title:""},{default:m(()=>[s("label",null,[R(s("input",{"onUpdate:modelValue":e[0]||(e[0]=d=>p(n)?n.value=d:null),type:"checkbox"},null,512),[[E,l(n)]]),e[3]||(e[3]=P(" Include safelist "))])]),_:1})],512),s("div",M,[a(u,{modelValue:l(o),"onUpdate:modelValue":e[1]||(e[1]=d=>p(o)?o.value=d:null),mode:"html",matched:((i=l(c))==null?void 0:i.matched)||[],class:"scrolls repl-scrolls",style:f(l(t))},null,8,["modelValue","matched","style"]),a(u,{border:"l main","model-value":((_=l(c))==null?void 0:_.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls repl-scrolls",style:f(l(t))},null,8,["model-value","style"])])])}}}),j={};function q(v,r){const t=T;return y(),I(t)}const H=$(j,[["render",q]]);export{H as default};
|