@unocss/core 0.41.0 → 0.42.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
@@ -460,7 +460,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
460
460
  };
461
461
  }
462
462
 
463
- const version = "0.41.0";
463
+ const version = "0.42.0";
464
464
 
465
465
  class UnoGenerator {
466
466
  constructor(userConfig = {}, defaults = {}) {
@@ -590,15 +590,13 @@ class UnoGenerator {
590
590
  generator: this,
591
591
  theme: this.config.theme
592
592
  };
593
- const preflightLayerSet = /* @__PURE__ */ new Set(["default"]);
594
- this.config.preflights.forEach(({ layer }) => {
595
- if (layer) {
596
- layerSet.add(layer);
597
- preflightLayerSet.add(layer);
598
- }
593
+ const preflightLayerSet = /* @__PURE__ */ new Set([]);
594
+ this.config.preflights.forEach(({ layer = "preflights" }) => {
595
+ layerSet.add(layer);
596
+ preflightLayerSet.add(layer);
599
597
  });
600
598
  preflightsMap = Object.fromEntries(await Promise.all(Array.from(preflightLayerSet).map(async (layer) => {
601
- const preflights2 = await Promise.all(this.config.preflights.filter((i) => (i.layer || "default") === layer).map(async (i) => await i.getCSS(preflightContext)));
599
+ const preflights2 = await Promise.all(this.config.preflights.filter((i) => (i.layer || "preflights") === layer).map(async (i) => await i.getCSS(preflightContext)));
602
600
  const css = preflights2.filter(Boolean).join(nl);
603
601
  return [layer, css];
604
602
  })));
package/dist/index.d.ts CHANGED
@@ -608,6 +608,8 @@ interface UnocssPluginContext<Config extends UserConfig = UserConfig> {
608
608
  tokens: Set<string>;
609
609
  /** Map for all module's raw content */
610
610
  modules: BetterMap<string, string>;
611
+ /** Module IDs that been affected by UnoCSS */
612
+ affectedModules: Set<string>;
611
613
  filter: (code: string, id: string) => boolean;
612
614
  extract: (code: string, id?: string) => Promise<void>;
613
615
  reloadConfig: () => Promise<LoadConfigResult<Config>>;
package/dist/index.mjs CHANGED
@@ -456,7 +456,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
456
456
  };
457
457
  }
458
458
 
459
- const version = "0.41.0";
459
+ const version = "0.42.0";
460
460
 
461
461
  class UnoGenerator {
462
462
  constructor(userConfig = {}, defaults = {}) {
@@ -586,15 +586,13 @@ class UnoGenerator {
586
586
  generator: this,
587
587
  theme: this.config.theme
588
588
  };
589
- const preflightLayerSet = /* @__PURE__ */ new Set(["default"]);
590
- this.config.preflights.forEach(({ layer }) => {
591
- if (layer) {
592
- layerSet.add(layer);
593
- preflightLayerSet.add(layer);
594
- }
589
+ const preflightLayerSet = /* @__PURE__ */ new Set([]);
590
+ this.config.preflights.forEach(({ layer = "preflights" }) => {
591
+ layerSet.add(layer);
592
+ preflightLayerSet.add(layer);
595
593
  });
596
594
  preflightsMap = Object.fromEntries(await Promise.all(Array.from(preflightLayerSet).map(async (layer) => {
597
- const preflights2 = await Promise.all(this.config.preflights.filter((i) => (i.layer || "default") === layer).map(async (i) => await i.getCSS(preflightContext)));
595
+ const preflights2 = await Promise.all(this.config.preflights.filter((i) => (i.layer || "preflights") === layer).map(async (i) => await i.getCSS(preflightContext)));
598
596
  const css = preflights2.filter(Boolean).join(nl);
599
597
  return [layer, css];
600
598
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/core",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "The instant on-demand Atomic CSS engine.",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",