@unocss/inspector 0.50.2 → 0.50.4
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_-96a87cbc.js +1 -0
- package/dist/client/assets/{index-97af6c40.js → index-afaac97b.js} +83 -83
- package/dist/client/assets/{repl-379a7326.js → repl-3d08153e.js} +1 -1
- package/dist/client/favicon.svg +3 -19
- package/dist/client/index.html +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_id_-60bd1559.js +0 -1
- package/dist/client/icon.svg +0 -11
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as x,r as b,u as S,a as k,b as V,f as B,o as h,c as w,e as s,g as a,w as m,h as C,i as p,v as R,j as e,k as P,n as f,_ as E,l as N,m as U,p as $,q as I}from"./index-
|
|
1
|
+
import{d as x,r as b,u as S,a as k,b as V,f as B,o as h,c as w,e as s,g as a,w as m,h as C,i as p,v as R,j as e,k as P,n as f,_ as E,l as N,m as U,p as $,q as I}from"./index-afaac97b.js";const L={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},M=s("div",null," REPL Playground ",-1),T=s("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1),j={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},q=x({__name:"ReplPlayground",setup(y){const r=b(null),l=S(r,"repl-scrolls"),t=k("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
2
|
Hello World
|
|
3
3
|
</div>`),o=V("unocss-inspector-safelist",!1),{data:d}=B(t,o);return(H,n)=>{var i,_;const v=E,g=N,u=U;return h(),w("div",L,[s("div",{ref_key:"status",ref:r},[a(v,null,{default:m(()=>[M,T]),_:1}),a(g,{border:"b gray-400/20",title:""},{default:m(()=>[s("label",null,[C(s("input",{"onUpdate:modelValue":n[0]||(n[0]=c=>p(o)?o.value=c:null),type:"checkbox"},null,512),[[R,e(o)]]),P(" Include safelist ")])]),_:1})],512),s("div",j,[a(u,{modelValue:e(t),"onUpdate:modelValue":n[1]||(n[1]=c=>p(t)?t.value=c:null),mode:"html",matched:((i=e(d))==null?void 0:i.matched)||[],class:"scrolls repl-scrolls",style:f(e(l))},null,8,["modelValue","matched","style"]),a(u,{"b-l":"","b-main":"","model-value":((_=e(d))==null?void 0:_.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls repl-scrolls",style:f(e(l))},null,8,["model-value","style"])])])}}}),z={};function D(y,r){const l=q;return h(),I(l)}const A=$(z,[["render",D]]);export{A as default};
|
package/dist/client/favicon.svg
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
<svg width="220" height="220" viewBox="0 0 220 220" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
@media (prefers-color-scheme: dark) {
|
|
7
|
-
.a {
|
|
8
|
-
fill: #eee;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
</style>
|
|
12
|
-
<path
|
|
13
|
-
d="M117.722 167.444C117.722 139.83 140.108 117.444 167.722 117.444V117.444C195.336 117.444 217.722 139.83 217.722 167.444V167.444C217.722 195.058 195.336 217.444 167.722 217.444V217.444C140.108 217.444 117.722 195.058 117.722 167.444V167.444Z"
|
|
14
|
-
class="a" fill="#333333" fill-opacity="0.6" />
|
|
15
|
-
<path
|
|
16
|
-
d="M117.722 52.5561C117.722 24.9419 140.108 2.55614 167.722 2.55614V2.55614C195.336 2.55614 217.722 24.9419 217.722 52.5561V97.5561C217.722 100.318 215.483 102.556 212.722 102.556H122.722C119.961 102.556 117.722 100.318 117.722 97.5561V52.5561Z"
|
|
17
|
-
class="a" fill="#333333" fill-opacity="0.3" />
|
|
18
|
-
<path
|
|
19
|
-
d="M102.278 167.444C102.278 195.058 79.8922 217.444 52.278 217.444V217.444C24.6637 217.444 2.27796 195.058 2.27796 167.444L2.27796 122.444C2.27796 119.682 4.51654 117.444 7.27796 117.444L97.278 117.444C100.039 117.444 102.278 119.682 102.278 122.444L102.278 167.444Z"
|
|
20
|
-
class="a" fill="#333333" />
|
|
2
|
+
<path d="M117.444 167.888C117.444 140.273 139.83 117.888 167.444 117.888V117.888C195.058 117.888 217.444 140.273 217.444 167.888V167.888C217.444 195.502 195.058 217.888 167.444 217.888V217.888C139.83 217.888 117.444 195.502 117.444 167.888V167.888Z" fill="#858585"/>
|
|
3
|
+
<path d="M117.444 53C117.444 25.3858 139.83 3 167.444 3V3C195.058 3 217.444 25.3858 217.444 53V98C217.444 100.761 215.205 103 212.444 103H122.444C119.683 103 117.444 100.761 117.444 98V53Z" fill="#CCCCCC"/>
|
|
4
|
+
<path d="M102 167.888C102 195.502 79.6142 217.888 52 217.888V217.888C24.3858 217.888 2 195.502 2 167.888L2.00001 122.888C2.00001 120.126 4.23859 117.888 7.00001 117.888L97 117.888C99.7614 117.888 102 120.126 102 122.888L102 167.888Z" fill="#4D4D4D"/>
|
|
21
5
|
</svg>
|
package/dist/client/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;400&family=Fira+Code&display=swap" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="/__unocss/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/__unocss/assets/index-afaac97b.js"></script>
|
|
12
12
|
<link rel="stylesheet" href="/__unocss/assets/index-7b636008.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const node_path = require('node:path');
|
|
4
|
+
const node_url = require('node:url');
|
|
5
5
|
const sirv = require('sirv');
|
|
6
6
|
const gzipSize = require('gzip-size');
|
|
7
7
|
|
|
@@ -10,11 +10,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
const sirv__default = /*#__PURE__*/_interopDefaultLegacy(sirv);
|
|
11
11
|
const gzipSize__default = /*#__PURE__*/_interopDefaultLegacy(gzipSize);
|
|
12
12
|
|
|
13
|
-
const _dirname = typeof __dirname !== "undefined" ? __dirname :
|
|
13
|
+
const _dirname = typeof __dirname !== "undefined" ? __dirname : node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
14
14
|
function UnocssInspector(ctx) {
|
|
15
15
|
async function configureServer(server) {
|
|
16
16
|
await ctx.ready;
|
|
17
|
-
server.middlewares.use("/__unocss", sirv__default(
|
|
17
|
+
server.middlewares.use("/__unocss", sirv__default(node_path.resolve(_dirname, "../dist/client"), {
|
|
18
18
|
single: true,
|
|
19
19
|
dev: true
|
|
20
20
|
}));
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as O,t as k,x as I,d as B,y as W,z as j,r as C,u as D,A as U,B as Z,C as q,j as d,c as M,g as v,w as A,e as m,D as N,_ as G,o as R,k as S,E as V,F as P,n as w,h as H,v as K,i as J,M as L,G as Q,m as X,l as Y,q as tt,H as et}from"./index-97af6c40.js";const F=/^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/,lt=(t={})=>{const c=t.prefix??"un-",o=t.prefixedOnly??!1,p=t.trueToNonValued??!1;let f;return{name:"attributify",match(g,{generator:e}){var h,u;const s=O(g);if(!s)return;let n=s[1];if(n.startsWith(c))n=n.slice(c.length);else if(o)return;const r=s[2],[,i="",a=r]=r.match(F)||[];if(a==="~"||p&&a==="true"||!a)return`${i}${n}`;if(f==null){const _=(u=(h=e==null?void 0:e.config)==null?void 0:h.separators)==null?void 0:u.join("|");_?f=new RegExp(`^(.*\\](?:${_}))(\\[[^\\]]+?\\])$`):f=!1}if(f){const[,_,l]=r.match(f)||[];if(l)return`${_}${i}${n}-${l}`}return`${i}${n}-${a}`}}},rt=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,st=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,z=/[\s'"`;>]+/,nt={name:"attributify",extract:({content:t,cursor:c})=>{const o=t.matchAll(rt);let p,f=0;for(const l of o){const[,x,y]=l,b=l.index+x.length;if(c>b&&c<=b+y.length){f=b,p=y;break}}if(!p)return null;const g=p.matchAll(st);let e=0,s,n;for(const l of g){const[x,y,b]=l,$=f+l.index;if(c>$&&c<=$+x.length){e=$,s=y,n=b==null?void 0:b.slice(1);break}}if(!s||s==="class"||s==="className"||s===":class")return null;if(n===void 0)return{extracted:s,resolveReplacement(l){return{start:e,end:e+s.length,replacement:l}}};const r=e+s.length+2;let i=z.exec(n),a=0,h;for(;i;){const[l]=i;if(c>r+a&&c<=r+a+i.index){h=n.slice(a,a+i.index);break}a+=i.index+l.length,i=z.exec(n.slice(a))}h===void 0&&(h=n.slice(a));const[,u="",_]=h.match(F)||[];return{extracted:`${u}${s}-${_}`,transformSuggestions(l){return l.filter(x=>x.startsWith(`${u}${s}-`)).map(x=>u+x.slice(u.length+s.length+1))},resolveReplacement(l){return{start:a+r,end:a+r+h.length,replacement:u+l.slice(u.length+s.length+1)}}}}},at=["v-bind:",":"],E=/[\s'"`;]+/g,ct=/<[^>\s]*\s((?:'.*?'|".*?"|`.*?`|\{.*?\}|[^>]*?)*)/g,ot=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms,T=["placeholder","fill","opacity"],it=t=>{const c=(t==null?void 0:t.ignoreAttributes)??T,o=(t==null?void 0:t.nonValuedAttribute)??!0,p=(t==null?void 0:t.trueToNonValued)??!1;return{name:"attributify",extract({code:f}){const g=Array.from(f.matchAll(ct)).flatMap(e=>Array.from((e[1]||"").matchAll(ot))).flatMap(([,e,...s])=>{const n=s.filter(Boolean).join("");if(c.includes(e))return[];for(const r of at)if(e.startsWith(r)){e=e.slice(r.length);break}if(!n){if(k(e)&&o!==!1){const r=[`[${e}=""]`];return p&&r.push(`[${e}="true"]`),r}return[]}if(["class","className"].includes(e))return n.split(E).filter(k);{if(t!=null&&t.prefixedOnly&&t.prefix&&!e.startsWith(t.prefix))return[];const r=Array.from(n.matchAll(/(?:[\?:].*?)(["'])([^\1]*?)\1/gms)).map(([,,i])=>i.split(E)).flat();return(r.length?r:n.split(E)).filter(i=>Boolean(i)&&i!==":").map(i=>`[${e}~="${i}"]`)}});return new Set(g)}}},ut=(t={})=>{t.strict=t.strict??!1,t.prefix=t.prefix??"un-",t.prefixedOnly=t.prefixedOnly??!1,t.nonValuedAttribute=t.nonValuedAttribute??!0,t.ignoreAttributes=t.ignoreAttributes??T;const c=[lt(t)],o=[it(t)],p=[nt];return t.strict||o.unshift(I),{name:"@unocss/preset-attributify",variants:c,extractors:o,options:t,autocomplete:{extractors:p}}},dt={key:0,"h-full":"","of-hidden":""},ft=m("div",{op50:""}," Module ",-1),mt=m("div",{"i-carbon-launch":""},null,-1),ht=m("div",{op50:""}," Matched Rules ",-1),_t=m("div",{op50:""}," CSS Size ",-1),pt=m("span",{op50:""},"gzipped",-1),xt={key:0,"row-span-3":""},yt=m("div",{op50:""}," Potentially Unmatched ",-1),gt={"h-full":"","of-hidden":""},vt=B({__name:"ModuleInfo",props:{id:null},setup(t){const c=t,{data:o}=W(j(c,"id")),p=c.id.split(/\./g).pop(),f=C(null),g=D(f,"module-scrolls");function e(){fetch(`/__open-in-editor?file=${encodeURIComponent(c.id)}`)}const{extractors:s}=ut({strict:!0}),n=U(async()=>{var h;const a=new Set;if(s){const u={code:((h=o.value)==null?void 0:h.code)||""};for(const _ of s){const l=await _.extract(u);l==null||l.forEach(x=>a.add(x))}}return Array.from(a).filter(u=>!u.startsWith("[")).filter(u=>{var _;return!((_=o.value)!=null&&_.matched.includes(u))})}),r=C(!1),i=Z(q(()=>{var a;return(a=o.value)==null?void 0:a.css}),r);return(a,h)=>{const u=Q,_=G,l=X,x=Y;return d(o)?(R(),M("div",dt,[v(_,{ref_key:"status",ref:f,grid:"~ cols-3 gap-4"},{default:A(()=>{var y;return[m("div",null,[ft,m("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:e},[v(u,{id:d(o).id,"mr-1":""},null,8,["id"]),mt])]),m("div",null,[ht,S(" "+V(d(o).matched.length),1)]),m("div",null,[_t,S(" "+V(((((y=d(o))==null?void 0:y.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),pt]),d(n).length?(R(),M("div",xt,[yt,m("code",null,V(d(n).join(", ")),1)])):N("",!0)]}),_:1},512),m("div",gt,[v(d(L),null,{default:A(()=>[v(d(P),{size:"50"},{default:A(()=>[v(l,{"h-full":"","model-value":d(o).code,"read-only":!0,mode:d(p),matched:d(o).matched,class:"scrolls module-scrolls",style:w(d(g))},null,8,["model-value","mode","matched","style"])]),_:1}),v(d(P),{size:"50"},{default:A(()=>[m("div",null,[v(x,{border:"l b gray-400/20",title:"Output CSS"},{default:A(()=>[m("label",null,[H(m("input",{"onUpdate:modelValue":h[0]||(h[0]=y=>J(r)?r.value=y:null),type:"checkbox"},null,512),[[K,d(r)]]),S(" Prettify ")])]),_:1}),v(l,{"h-full":"",b:"l main","model-value":d(i),"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:w(d(g))},null,8,["model-value","style"])])]),_:1})]),_:1})])])):N("",!0)}}}),At=B({__name:"[id]",setup(t){const c=et();return(o,p)=>{const f=vt;return R(),tt(f,{id:d(c).params.id},null,8,["id"])}}});export{At as default};
|
package/dist/client/icon.svg
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<svg width="220" height="220" viewBox="0 0 220 220" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
3
|
-
d="M117.722 167.444C117.722 139.83 140.108 117.444 167.722 117.444V117.444C195.336 117.444 217.722 139.83 217.722 167.444V167.444C217.722 195.058 195.336 217.444 167.722 217.444V217.444C140.108 217.444 117.722 195.058 117.722 167.444V167.444Z"
|
|
4
|
-
fill="#333333" fill-opacity="0.6" />
|
|
5
|
-
<path
|
|
6
|
-
d="M117.722 52.5561C117.722 24.9419 140.108 2.55614 167.722 2.55614V2.55614C195.336 2.55614 217.722 24.9419 217.722 52.5561V97.5561C217.722 100.318 215.483 102.556 212.722 102.556H122.722C119.961 102.556 117.722 100.318 117.722 97.5561V52.5561Z"
|
|
7
|
-
fill="#333333" fill-opacity="0.3" />
|
|
8
|
-
<path
|
|
9
|
-
d="M102.278 167.444C102.278 195.058 79.8922 217.444 52.278 217.444V217.444C24.6637 217.444 2.27796 195.058 2.27796 167.444L2.27796 122.444C2.27796 119.682 4.51654 117.444 7.27796 117.444L97.278 117.444C100.039 117.444 102.278 119.682 102.278 122.444L102.278 167.444Z"
|
|
10
|
-
fill="#333333" />
|
|
11
|
-
</svg>
|