@unocss/core 0.20.4 → 0.21.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
@@ -336,7 +336,6 @@ function resolveConfig(userConfig = {}, defaults = {}) {
336
336
  ...sortedPresets.map((p) => p.theme || {}),
337
337
  config.theme || {}
338
338
  ].reduce((a, p) => mergeDeep(a, p), {});
339
- const options = Object.assign({}, ...config.presets?.map((p) => Array.isArray(p) ? p : [p]).flat(1).map((p) => p.options ?? {}) || []);
340
339
  return {
341
340
  mergeSelectors: true,
342
341
  warn: true,
@@ -357,12 +356,11 @@ function resolveConfig(userConfig = {}, defaults = {}) {
357
356
  preflights: mergePresets("preflights"),
358
357
  variants: mergePresets("variants").map(normalizeVariant),
359
358
  shortcuts: resolveShortcuts(mergePresets("shortcuts")),
360
- extractors,
361
- options
359
+ extractors
362
360
  };
363
361
  }
364
362
 
365
- const version = "0.20.4";
363
+ const version = "0.21.0";
366
364
 
367
365
  class UnoGenerator {
368
366
  constructor(userConfig = {}, defaults = {}) {
@@ -391,8 +389,7 @@ class UnoGenerator {
391
389
  return code;
392
390
  },
393
391
  code,
394
- id,
395
- options: this.config.options
392
+ id
396
393
  };
397
394
  for (const extractor of this.config.extractors) {
398
395
  const result = await extractor.extract(context);
@@ -453,8 +450,7 @@ class UnoGenerator {
453
450
  theme: this.config.theme,
454
451
  generator: this,
455
452
  variantHandlers: applied[2],
456
- constructCSS: (...args) => this.constructCustomCSS(context, ...args),
457
- options: this.config.options
453
+ constructCSS: (...args) => this.constructCustomCSS(context, ...args)
458
454
  };
459
455
  const expanded = this.expandShortcut(applied[1], context);
460
456
  if (expanded) {
@@ -527,8 +523,7 @@ class UnoGenerator {
527
523
  const context = {
528
524
  rawSelector: raw,
529
525
  theme: this.config.theme,
530
- generator: this,
531
- options: this.config.options
526
+ generator: this
532
527
  };
533
528
  while (true) {
534
529
  applied = false;
package/dist/index.d.ts CHANGED
@@ -91,10 +91,6 @@ interface RuleContext<Theme extends {} = {}> {
91
91
  * Variants and selector escaping will be handled automatically.
92
92
  */
93
93
  constructCSS: (body: CSSEntries | CSSObject, overrideSelector?: string) => string;
94
- /**
95
- * User-provided options from preset.
96
- */
97
- readonly options: PresetOptions;
98
94
  }
99
95
  interface VariantContext<Theme extends {} = {}> {
100
96
  /**
@@ -109,16 +105,11 @@ interface VariantContext<Theme extends {} = {}> {
109
105
  * The theme object
110
106
  */
111
107
  theme: Theme;
112
- /**
113
- * User-provided options from preset.
114
- */
115
- readonly options: PresetOptions;
116
108
  }
117
109
  interface ExtractorContext {
118
110
  readonly original: string;
119
111
  code: string;
120
112
  id?: string;
121
- readonly options: PresetOptions;
122
113
  }
123
114
  interface Extractor {
124
115
  name: string;
@@ -325,7 +316,6 @@ interface ResolvedConfig extends Omit<RequiredByKey<UserConfig, 'mergeSelectors'
325
316
  rulesSize: number;
326
317
  rulesDynamic: (DynamicRule | undefined)[];
327
318
  rulesStaticMap: Record<string, [number, CSSObject | CSSEntries, RuleMeta | undefined] | undefined>;
328
- options: PresetOptions;
329
319
  }
330
320
  interface GenerateResult {
331
321
  css: string;
package/dist/index.mjs CHANGED
@@ -332,7 +332,6 @@ function resolveConfig(userConfig = {}, defaults = {}) {
332
332
  ...sortedPresets.map((p) => p.theme || {}),
333
333
  config.theme || {}
334
334
  ].reduce((a, p) => mergeDeep(a, p), {});
335
- const options = Object.assign({}, ...config.presets?.map((p) => Array.isArray(p) ? p : [p]).flat(1).map((p) => p.options ?? {}) || []);
336
335
  return {
337
336
  mergeSelectors: true,
338
337
  warn: true,
@@ -353,12 +352,11 @@ function resolveConfig(userConfig = {}, defaults = {}) {
353
352
  preflights: mergePresets("preflights"),
354
353
  variants: mergePresets("variants").map(normalizeVariant),
355
354
  shortcuts: resolveShortcuts(mergePresets("shortcuts")),
356
- extractors,
357
- options
355
+ extractors
358
356
  };
359
357
  }
360
358
 
361
- const version = "0.20.4";
359
+ const version = "0.21.0";
362
360
 
363
361
  class UnoGenerator {
364
362
  constructor(userConfig = {}, defaults = {}) {
@@ -387,8 +385,7 @@ class UnoGenerator {
387
385
  return code;
388
386
  },
389
387
  code,
390
- id,
391
- options: this.config.options
388
+ id
392
389
  };
393
390
  for (const extractor of this.config.extractors) {
394
391
  const result = await extractor.extract(context);
@@ -449,8 +446,7 @@ class UnoGenerator {
449
446
  theme: this.config.theme,
450
447
  generator: this,
451
448
  variantHandlers: applied[2],
452
- constructCSS: (...args) => this.constructCustomCSS(context, ...args),
453
- options: this.config.options
449
+ constructCSS: (...args) => this.constructCustomCSS(context, ...args)
454
450
  };
455
451
  const expanded = this.expandShortcut(applied[1], context);
456
452
  if (expanded) {
@@ -523,8 +519,7 @@ class UnoGenerator {
523
519
  const context = {
524
520
  rawSelector: raw,
525
521
  theme: this.config.theme,
526
- generator: this,
527
- options: this.config.options
522
+ generator: this
528
523
  };
529
524
  while (true) {
530
525
  applied = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/core",
3
- "version": "0.20.4",
3
+ "version": "0.21.0",
4
4
  "description": "The instant on-demand Atomic CSS engine.",
5
5
  "keywords": [
6
6
  "unocss",