@unocss/inspector 0.55.0 → 0.55.2

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.
@@ -1,3 +1,3 @@
1
- import{d as x,r as S,u as b,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-afbd59da.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=S(null),l=b(r,"repl-scrolls"),t=k("unocss:inspector:repl",`<div class="text-sm hover:text-red">
1
+ import{d as x,r as S,u as b,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-ff9c21d6.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=S(null),l=b(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,{border:"l 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};
@@ -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-afbd59da.js"></script>
11
+ <script type="module" crossorigin src="/__unocss/assets/index-ff9c21d6.js"></script>
12
12
  <link rel="stylesheet" href="/__unocss/assets/index-aa90c21a.css">
13
13
  </head>
14
14
  <body>
package/dist/index.cjs CHANGED
@@ -6,10 +6,10 @@ const sirv = require('sirv');
6
6
  const core = require('@unocss/core');
7
7
  const gzipSize = require('gzip-size');
8
8
 
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
9
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
10
10
 
11
- const sirv__default = /*#__PURE__*/_interopDefaultLegacy(sirv);
12
- const gzipSize__default = /*#__PURE__*/_interopDefaultLegacy(gzipSize);
11
+ const sirv__default = /*#__PURE__*/_interopDefaultCompat(sirv);
12
+ const gzipSize__default = /*#__PURE__*/_interopDefaultCompat(gzipSize);
13
13
 
14
14
  const SKIP_START_COMMENT = "@unocss-skip-start";
15
15
  const SKIP_END_COMMENT = "@unocss-skip-end";
@@ -57,6 +57,7 @@ const numberRE = /^(-?\d*(?:\.\d+)?)$/i;
57
57
  const unitOnlyRE = /^(px)$/i;
58
58
 
59
59
  const cssProps = [
60
+ // basic props
60
61
  "color",
61
62
  "border-color",
62
63
  "background-color",
@@ -74,12 +75,14 @@ const cssProps = [
74
75
  "text-shadow",
75
76
  "transform",
76
77
  "box-shadow",
78
+ // positions
77
79
  "background-position",
78
80
  "left",
79
81
  "right",
80
82
  "top",
81
83
  "bottom",
82
84
  "object-position",
85
+ // sizes
83
86
  "max-height",
84
87
  "min-height",
85
88
  "max-width",
@@ -98,6 +101,7 @@ const cssProps = [
98
101
  "border-spacing",
99
102
  "letter-spacing",
100
103
  "word-spacing",
104
+ // enhances
101
105
  "stroke",
102
106
  "filter",
103
107
  "backdrop-filter",
@@ -281,23 +285,23 @@ function position(str) {
281
285
 
282
286
  const valueHandlers = {
283
287
  __proto__: null,
284
- numberWithUnit: numberWithUnit,
285
288
  auto: auto,
286
- rem: rem,
287
- px: px,
288
- number: number,
289
- percent: percent,
290
- fraction: fraction,
291
289
  bracket: bracket,
292
290
  bracketOfColor: bracketOfColor,
293
291
  bracketOfLength: bracketOfLength,
294
292
  bracketOfPosition: bracketOfPosition,
295
293
  cssvar: cssvar,
296
- time: time,
297
294
  degree: degree,
295
+ fraction: fraction,
298
296
  global: global,
297
+ number: number,
298
+ numberWithUnit: numberWithUnit,
299
+ percent: percent,
300
+ position: position,
299
301
  properties: properties,
300
- position: position
302
+ px: px,
303
+ rem: rem,
304
+ time: time
301
305
  };
302
306
 
303
307
  const handler = core.createValueHandler(valueHandlers);
@@ -980,7 +984,7 @@ async function analyzer(modules, ctx) {
980
984
  };
981
985
  }
982
986
 
983
- 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))));
987
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href))));
984
988
  function UnocssInspector(ctx) {
985
989
  async function configureServer(server) {
986
990
  await ctx.ready;
@@ -994,6 +998,7 @@ function UnocssInspector(ctx) {
994
998
  if (req.url === "/") {
995
999
  const info = {
996
1000
  version: ctx.uno.version,
1001
+ // use the resolved config from the dev server
997
1002
  root: server.config.root,
998
1003
  modules: Array.from(ctx.modules.keys()),
999
1004
  config: ctx.uno.config,
@@ -0,0 +1,6 @@
1
+ import { Plugin } from 'vite';
2
+ import { UnocssPluginContext } from '@unocss/core';
3
+
4
+ declare function UnocssInspector(ctx: UnocssPluginContext): Plugin;
5
+
6
+ export { UnocssInspector as default };
@@ -0,0 +1,6 @@
1
+ import { Plugin } from 'vite';
2
+ import { UnocssPluginContext } from '@unocss/core';
3
+
4
+ declare function UnocssInspector(ctx: UnocssPluginContext): Plugin;
5
+
6
+ export { UnocssInspector as default };
package/dist/index.mjs CHANGED
@@ -50,6 +50,7 @@ const numberRE = /^(-?\d*(?:\.\d+)?)$/i;
50
50
  const unitOnlyRE = /^(px)$/i;
51
51
 
52
52
  const cssProps = [
53
+ // basic props
53
54
  "color",
54
55
  "border-color",
55
56
  "background-color",
@@ -67,12 +68,14 @@ const cssProps = [
67
68
  "text-shadow",
68
69
  "transform",
69
70
  "box-shadow",
71
+ // positions
70
72
  "background-position",
71
73
  "left",
72
74
  "right",
73
75
  "top",
74
76
  "bottom",
75
77
  "object-position",
78
+ // sizes
76
79
  "max-height",
77
80
  "min-height",
78
81
  "max-width",
@@ -91,6 +94,7 @@ const cssProps = [
91
94
  "border-spacing",
92
95
  "letter-spacing",
93
96
  "word-spacing",
97
+ // enhances
94
98
  "stroke",
95
99
  "filter",
96
100
  "backdrop-filter",
@@ -274,23 +278,23 @@ function position(str) {
274
278
 
275
279
  const valueHandlers = {
276
280
  __proto__: null,
277
- numberWithUnit: numberWithUnit,
278
281
  auto: auto,
279
- rem: rem,
280
- px: px,
281
- number: number,
282
- percent: percent,
283
- fraction: fraction,
284
282
  bracket: bracket,
285
283
  bracketOfColor: bracketOfColor,
286
284
  bracketOfLength: bracketOfLength,
287
285
  bracketOfPosition: bracketOfPosition,
288
286
  cssvar: cssvar,
289
- time: time,
290
287
  degree: degree,
288
+ fraction: fraction,
291
289
  global: global,
290
+ number: number,
291
+ numberWithUnit: numberWithUnit,
292
+ percent: percent,
293
+ position: position,
292
294
  properties: properties,
293
- position: position
295
+ px: px,
296
+ rem: rem,
297
+ time: time
294
298
  };
295
299
 
296
300
  const handler = createValueHandler(valueHandlers);
@@ -987,6 +991,7 @@ function UnocssInspector(ctx) {
987
991
  if (req.url === "/") {
988
992
  const info = {
989
993
  version: ctx.uno.version,
994
+ // use the resolved config from the dev server
990
995
  root: server.config.root,
991
996
  modules: Array.from(ctx.modules.keys()),
992
997
  config: ctx.uno.config,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/inspector",
3
- "version": "0.55.0",
3
+ "version": "0.55.2",
4
4
  "description": "The inspector UI for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",