@unocss/core 0.45.26 → 0.45.29

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
@@ -416,7 +416,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
416
416
  };
417
417
  }
418
418
 
419
- const version = "0.45.26";
419
+ const version = "0.45.29";
420
420
 
421
421
  class UnoGenerator {
422
422
  constructor(userConfig = {}, defaults = {}) {
@@ -491,25 +491,14 @@ class UnoGenerator {
491
491
  this._cache.set(cacheKey, null);
492
492
  return;
493
493
  }
494
- const context = this.makeContext(
495
- raw,
496
- [alias || applied[0], applied[1], applied[2], applied[3]]
497
- );
494
+ const context = this.makeContext(raw, [alias || applied[0], applied[1], applied[2], applied[3]]);
498
495
  if (this.config.details)
499
496
  context.variants = [...applied[3]];
500
497
  const expanded = this.expandShortcut(context.currentSelector, context);
501
- if (expanded) {
502
- const utils = await this.stringifyShortcuts(context.variantMatch, context, expanded[0], expanded[1]);
503
- if (utils?.length) {
504
- this._cache.set(cacheKey, utils);
505
- return utils;
506
- }
507
- } else {
508
- const utils = (await this.parseUtil(context.variantMatch, context))?.map((i) => this.stringifyUtil(i, context)).filter(notNull);
509
- if (utils?.length) {
510
- this._cache.set(cacheKey, utils);
511
- return utils;
512
- }
498
+ const utils = expanded ? await this.stringifyShortcuts(context.variantMatch, context, expanded[0], expanded[1]) : (await this.parseUtil(context.variantMatch, context))?.map((i) => this.stringifyUtil(i, context)).filter(notNull);
499
+ if (utils?.length) {
500
+ this._cache.set(cacheKey, utils);
501
+ return utils;
513
502
  }
514
503
  this._cache.set(cacheKey, null);
515
504
  }
@@ -813,7 +802,7 @@ class UnoGenerator {
813
802
  }
814
803
  }
815
804
  if (isString(result))
816
- result = expandVariantGroup(result).split(/\s+/g);
805
+ result = expandVariantGroup(result.trim()).split(/\s+/g);
817
806
  if (!result) {
818
807
  const [raw, inputWithoutVariant] = isString(input) ? this.matchVariants(input) : input;
819
808
  if (raw !== inputWithoutVariant) {
package/dist/index.mjs CHANGED
@@ -412,7 +412,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
412
412
  };
413
413
  }
414
414
 
415
- const version = "0.45.26";
415
+ const version = "0.45.29";
416
416
 
417
417
  class UnoGenerator {
418
418
  constructor(userConfig = {}, defaults = {}) {
@@ -487,25 +487,14 @@ class UnoGenerator {
487
487
  this._cache.set(cacheKey, null);
488
488
  return;
489
489
  }
490
- const context = this.makeContext(
491
- raw,
492
- [alias || applied[0], applied[1], applied[2], applied[3]]
493
- );
490
+ const context = this.makeContext(raw, [alias || applied[0], applied[1], applied[2], applied[3]]);
494
491
  if (this.config.details)
495
492
  context.variants = [...applied[3]];
496
493
  const expanded = this.expandShortcut(context.currentSelector, context);
497
- if (expanded) {
498
- const utils = await this.stringifyShortcuts(context.variantMatch, context, expanded[0], expanded[1]);
499
- if (utils?.length) {
500
- this._cache.set(cacheKey, utils);
501
- return utils;
502
- }
503
- } else {
504
- const utils = (await this.parseUtil(context.variantMatch, context))?.map((i) => this.stringifyUtil(i, context)).filter(notNull);
505
- if (utils?.length) {
506
- this._cache.set(cacheKey, utils);
507
- return utils;
508
- }
494
+ const utils = expanded ? await this.stringifyShortcuts(context.variantMatch, context, expanded[0], expanded[1]) : (await this.parseUtil(context.variantMatch, context))?.map((i) => this.stringifyUtil(i, context)).filter(notNull);
495
+ if (utils?.length) {
496
+ this._cache.set(cacheKey, utils);
497
+ return utils;
509
498
  }
510
499
  this._cache.set(cacheKey, null);
511
500
  }
@@ -809,7 +798,7 @@ class UnoGenerator {
809
798
  }
810
799
  }
811
800
  if (isString(result))
812
- result = expandVariantGroup(result).split(/\s+/g);
801
+ result = expandVariantGroup(result.trim()).split(/\s+/g);
813
802
  if (!result) {
814
803
  const [raw, inputWithoutVariant] = isString(input) ? this.matchVariants(input) : input;
815
804
  if (raw !== inputWithoutVariant) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/core",
3
- "version": "0.45.26",
3
+ "version": "0.45.29",
4
4
  "description": "The instant on-demand Atomic CSS engine.",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -37,8 +37,8 @@
37
37
  "dist"
38
38
  ],
39
39
  "devDependencies": {
40
- "magic-string": "^0.26.3",
41
- "unconfig": "^0.3.6"
40
+ "magic-string": "^0.26.6",
41
+ "unconfig": "^0.3.7"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "unbuild",