@unocss/transformer-directives 0.39.2 → 0.41.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/index.cjs CHANGED
@@ -44,7 +44,7 @@ async function transformDirectives(code, uno, options, filename, originalCode, o
44
44
  }
45
45
  if (!body)
46
46
  return;
47
- const classNames = core.expandVariantGroup(body).split(/\s+/g);
47
+ const classNames = core.expandVariantGroup(body).split(/\s+/g).map((className) => className.trim().replace(/\\/, ""));
48
48
  const utils = (await Promise.all(classNames.map((i) => uno.parseToken(i, "-")))).filter(core.notNull).flat().sort((a, b) => a[0] - b[0]).sort((a, b) => (a[3] ? uno.parentOrders.get(a[3]) ?? 0 : 0) - (b[3] ? uno.parentOrders.get(b[3]) ?? 0 : 0)).reduce((acc, item) => {
49
49
  const target = acc.find((i) => i[1] === item[1] && i[3] === item[3]);
50
50
  if (target)
package/dist/index.mjs CHANGED
@@ -40,7 +40,7 @@ async function transformDirectives(code, uno, options, filename, originalCode, o
40
40
  }
41
41
  if (!body)
42
42
  return;
43
- const classNames = expandVariantGroup(body).split(/\s+/g);
43
+ const classNames = expandVariantGroup(body).split(/\s+/g).map((className) => className.trim().replace(/\\/, ""));
44
44
  const utils = (await Promise.all(classNames.map((i) => uno.parseToken(i, "-")))).filter(notNull).flat().sort((a, b) => a[0] - b[0]).sort((a, b) => (a[3] ? uno.parentOrders.get(a[3]) ?? 0 : 0) - (b[3] ? uno.parentOrders.get(b[3]) ?? 0 : 0)).reduce((acc, item) => {
45
45
  const target = acc.find((i) => i[1] === item[1] && i[3] === item[3]);
46
46
  if (target)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/transformer-directives",
3
- "version": "0.39.2",
3
+ "version": "0.41.0",
4
4
  "description": "UnoCSS transformer for `@apply` directive",
5
5
  "author": "hannoeru <me@hanlee.co>",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@unocss/core": "0.39.2",
34
+ "@unocss/core": "0.41.0",
35
35
  "css-tree": "^2.1.0"
36
36
  },
37
37
  "devDependencies": {