@unocss/inspector 0.33.5 → 0.35.0
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_.025431c2.js +1 -0
- package/dist/client/assets/index.8d76444c.js +30 -0
- package/dist/client/assets/repl.2f791a91.js +3 -0
- package/dist/client/index.html +1 -1
- package/package.json +18 -18
- package/dist/client/assets/_id_.43e6f2af.js +0 -1
- package/dist/client/assets/index.5b30da48.js +0 -30
- package/dist/client/assets/repl.801eacb8.js +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{d as h,r as y,u as g,a as v,f as x,o as i,c as S,b as l,w as k,e as n,g as e,i as B,n as _,_ as R,h as V,j as b,k as w}from"./index.8d76444c.js";const C={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},P=n("div",null," REPL Playground ",-1),E=n("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1),N={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},U=h({name:"ReplPlayground",setup(m){const o=y(null),s=g(o,"rpel-scrolls"),t=v("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
|
+
Hello World
|
|
3
|
+
</div>`),{data:a}=x(t);return(z,r)=>{var d,u;const p=R,c=V;return i(),S("div",C,[l(p,{ref_key:"status",ref:o},{default:k(()=>[P,E]),_:1},512),n("div",N,[l(c,{modelValue:e(t),"onUpdate:modelValue":r[0]||(r[0]=f=>B(t)?t.value=f:null),mode:"html",matched:((d=e(a))==null?void 0:d.matched)||[],class:"scrolls rpel-scrolls",style:_(e(s))},null,8,["modelValue","matched","style"]),l(c,{"b-l":"","b-main":"","model-value":((u=e(a))==null?void 0:u.css)||"/* empty */","read-only":!0,mode:"css",class:"scrolls rpel-scrolls",style:_(e(s))},null,8,["model-value","style"])])])}}}),$={};function j(m,o){const s=U;return i(),w(s)}var L=b($,[["render",j]]);export{L as default};
|
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.8d76444c.js"></script>
|
|
12
12
|
<link rel="stylesheet" href="/__unocss/assets/index.73dbc9c5.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/inspector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "The inspector UI for UnoCSS",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"unocss",
|
|
7
|
-
"inspector",
|
|
8
|
-
"debugger"
|
|
9
|
-
],
|
|
10
|
-
"homepage": "https://github.com/unocss/unocss/tree/main/packages/inspector#readme",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/unocss/unocss/issues"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"funding": "https://github.com/sponsors/antfu",
|
|
8
|
+
"homepage": "https://github.com/unocss/unocss/tree/main/packages/inspector#readme",
|
|
16
9
|
"repository": {
|
|
17
10
|
"type": "git",
|
|
18
11
|
"url": "git+https://github.com/unocss/unocss.git",
|
|
19
12
|
"directory": "packages/inspector"
|
|
20
13
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/unocss/unocss/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"unocss",
|
|
19
|
+
"inspector",
|
|
20
|
+
"debugger"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": false,
|
|
25
23
|
"exports": {
|
|
26
24
|
".": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
25
|
+
"import": "./dist/index.mjs",
|
|
26
|
+
"require": "./dist/index.cjs"
|
|
29
27
|
}
|
|
30
28
|
},
|
|
29
|
+
"main": "./dist/index.cjs",
|
|
30
|
+
"module": "./dist/index.mjs",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
31
32
|
"files": [
|
|
32
33
|
"dist"
|
|
33
34
|
],
|
|
34
|
-
"sideEffects": false,
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"gzip-size": "^6.0.0",
|
|
37
37
|
"sirv": "^2.0.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as S,m as M,d as F,p as P,t as B,r as T,u as O,q as W,g as h,o as V,c as E,b,w as I,e as p,s as R,v as $,x as k,n as w,y as U,_ as Z,h as j,k as q,z as D}from"./index.5b30da48.js";const K=t=>t.split(/[\s'"`;>=]+/g).filter(S),G={name:"split",order:0,extract({code:t}){return new Set(K(t))}},z=/^(?!\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/,H=(t={})=>{var o,d,i;const n=(o=t.prefix)!=null?o:"un-",c=(d=t.prefixedOnly)!=null?d:!1,_=(i=t.trueToNonValued)!=null?i:!1;return{name:"attributify",match(l){const a=M(l);if(!a)return;let e=a[1];if(e.startsWith(n))e=e.slice(n.length);else if(c)return;const u=a[2],[,s="",r=u]=u.match(z)||[];return r==="~"||_&&r==="true"||!r?`${s}${e}`:`${s}${e}-${r}`}}},J=/(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g,L=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g,N=/[\s'"`;>]+/,Q={name:"attributify",extract:({content:t,cursor:n})=>{const c=t.matchAll(J);let _,o=0;for(const m of c){const[,x,v]=m,g=m.index+x.length;if(n>g&&n<=g+v.length){o=g,_=v;break}}if(!_)return null;const d=_.matchAll(L);let i=0,l,a;for(const m of d){const[x,v,g]=m,A=o+m.index;if(n>A&&n<=A+x.length){i=A,l=v,a=g==null?void 0:g.slice(1);break}}if(!l||l==="class"||l==="className")return null;if(a===void 0)return{extracted:l,resolveReplacement(m){return{start:i,end:i+l.length,replacement:m}}};const e=i+l.length+2;let u=N.exec(a),s=0,r;for(;u;){const[m]=u;if(n>e+s&&n<=e+s+u.index){r=a.slice(s,s+u.index);break}s+=u.index+m.length,u=N.exec(a.slice(s))}r===void 0&&(r=a.slice(s));const[,f="",y]=r.match(z)||[];return{extracted:`${f}${l}-${y}`,transformSuggestions(m){return m.filter(x=>x.startsWith(`${f}${l}-`)).map(x=>f+x.slice(f.length+l.length+1))},resolveReplacement(m){return{start:s+e,end:s+e+r.length,replacement:f+m.slice(f.length+l.length+1)}}}}},X=["v-bind:",":"],C=/[\s'"`;]+/g,Y=/<\w[\w:\.$-]*\s((?:'[\s\S]*?'|"[\s\S]*?"|`[\s\S]*?`|\{[\s\S]*?\}|[\s\S]*?)*?)>/g,tt=/([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:=(["'])([^\2]*?)\2)?/g,et=t=>{var o,d,i;const n=(o=t==null?void 0:t.ignoreAttributes)!=null?o:[],c=(d=t==null?void 0:t.nonValuedAttribute)!=null?d:!0,_=(i=t==null?void 0:t.trueToNonValued)!=null?i:!1;return{name:"attributify",extract({code:l}){const a=Array.from(l.matchAll(Y)).flatMap(e=>Array.from((e[1]||"").matchAll(tt))).flatMap(([,e,u,s])=>{if(n.includes(e))return[];for(const r of X)if(e.startsWith(r)){e=e.slice(r.length);break}if(!s){if(S(e)&&c!==!1){const r=[`[${e}=""]`];return _&&r.push(`[${e}="true"]`),r}return[]}return["class","className"].includes(e)?s.split(C).filter(S):s.split(C).filter(Boolean).map(r=>`[${e}~="${r}"]`)});return new Set(a)}}},rt=(t={})=>{var o,d,i,l,a;t.strict=(o=t.strict)!=null?o:!1,t.prefix=(d=t.prefix)!=null?d:"un-",t.prefixedOnly=(i=t.prefixedOnly)!=null?i:!1,t.nonValuedAttribute=(l=t.nonValuedAttribute)!=null?l:!0,t.ignoreAttributes=(a=t.ignoreAttributes)!=null?a:[];const n=[H(t)],c=[et(t)],_=[Q];return t.strict||c.unshift(G),{name:"@unocss/preset-attributify",variants:n,extractors:c,options:t,autocomplete:{extractors:_}}},st={key:0,"h-full":"","of-hidden":""},lt=p("div",{op50:""}," Module ",-1),nt=p("div",{"i-carbon-launch":""},null,-1),ct=p("div",{op50:""}," Matched Rules ",-1),at=p("div",{op50:""}," CSS Size ",-1),ot=p("span",{op50:""},"gzipped",-1),it={key:0,"row-span-3":""},ut=p("div",{op50:""}," Potentially Unmatched ",-1),dt={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},ft=F({props:{id:null},setup(t){const n=t,{data:c}=P(B(n,"id")),_=n.id.split(/\./g).pop(),o=T(null),d=O(o,"module-scrolls");function i(){fetch(`/__open-in-editor?file=${encodeURIComponent(n.id)}`)}const{extractors:l}=rt({strict:!0}),a=W(async()=>{var u;const e=new Set;if(l){const s={code:((u=c.value)==null?void 0:u.code)||""};for(const r of l){const f=await r.extract(s);f==null||f.forEach(y=>e.add(y))}}return Array.from(e).filter(s=>!s.startsWith("[")).filter(s=>{var r;return!((r=c.value)!=null&&r.matched.includes(s))})});return(e,u)=>{const s=U,r=Z,f=j;return h(c)?(V(),E("div",st,[b(r,{ref_key:"status",ref:o,grid:"~ cols-3 gap-4"},{default:I(()=>{var y;return[p("div",null,[lt,p("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:i},[b(s,{id:h(c).id,"mr-1":""},null,8,["id"]),nt])]),p("div",null,[ct,R(" "+$(h(c).matched.length),1)]),p("div",null,[at,R(" "+$(((((y=h(c))==null?void 0:y.gzipSize)||0)/1024).toFixed(2))+" KiB ",1),ot]),h(a).length?(V(),E("div",it,[ut,p("code",null,$(h(a).join(", ")),1)])):k("",!0)]}),_:1},512),p("div",dt,[b(f,{"h-full":"","model-value":h(c).code,"read-only":!0,mode:h(_),matched:h(c).matched,class:"scrolls module-scrolls",style:w(h(d))},null,8,["model-value","mode","matched","style"]),b(f,{"h-full":"",b:"l main","model-value":h(c).css,"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:w(h(d))},null,8,["model-value","style"])])])):k("",!0)}}}),ht=F({setup(t){const n=D();return(c,_)=>{const o=ft;return V(),q(o,{id:h(n).params.id},null,8,["id"])}}});export{ht as default};
|