@unocss/preset-uno 0.55.7 → 0.56.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
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ const core = require('@unocss/core');
5
6
  const presetWind = require('@unocss/preset-wind');
6
- const utils = require('@unocss/preset-mini/utils');
7
+ const ruleUtils = require('@unocss/rule-utils');
7
8
 
8
9
  function mixComponent(v1, v2, w) {
9
10
  return `calc(${v2} + (${v1} - ${v2}) * ${w} / 100)`;
@@ -12,7 +13,7 @@ function mixColor(color1, color2, weight) {
12
13
  const colors = [color1, color2];
13
14
  const cssColors = [];
14
15
  for (let c = 0; c < 2; ++c) {
15
- const color = typeof colors[c] === "string" ? utils.parseCssColor(colors[c]) : colors[c];
16
+ const color = typeof colors[c] === "string" ? ruleUtils.parseCssColor(colors[c]) : colors[c];
16
17
  if (!color || !["rgb", "rgba"].includes(color.type))
17
18
  return;
18
19
  cssColors.push(color);
@@ -52,11 +53,11 @@ function variantColorMix() {
52
53
  body: (body) => {
53
54
  body.forEach((v) => {
54
55
  if (v[1]) {
55
- const color = utils.parseCssColor(`${v[1]}`);
56
+ const color = ruleUtils.parseCssColor(`${v[1]}`);
56
57
  if (color) {
57
58
  const mixed = fns[m[1]](color, m[2]);
58
59
  if (mixed)
59
- v[1] = utils.colorToString(mixed);
60
+ v[1] = ruleUtils.colorToString(mixed);
60
61
  }
61
62
  }
62
63
  });
@@ -68,7 +69,7 @@ function variantColorMix() {
68
69
  };
69
70
  }
70
71
 
71
- function presetUno(options = {}) {
72
+ const presetUno = core.definePreset((options = {}) => {
72
73
  const wind = presetWind.presetWind(options);
73
74
  return {
74
75
  ...wind,
@@ -78,7 +79,7 @@ function presetUno(options = {}) {
78
79
  variantColorMix()
79
80
  ]
80
81
  };
81
- }
82
+ });
82
83
 
83
84
  exports.default = presetUno;
84
85
  exports.presetUno = presetUno;
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { Preset } from '@unocss/core';
2
- import { PresetMiniOptions, Theme } from '@unocss/preset-mini';
1
+ import * as _unocss_core from '@unocss/core';
2
+ import { PresetMiniOptions } from '@unocss/preset-mini';
3
3
  export { Theme } from '@unocss/preset-mini';
4
4
 
5
5
  interface PresetUnoOptions extends PresetMiniOptions {
6
6
  }
7
- declare function presetUno(options?: PresetUnoOptions): Preset<Theme>;
7
+ declare const presetUno: _unocss_core.PresetFactory<object, PresetUnoOptions>;
8
8
 
9
9
  export { type PresetUnoOptions, presetUno as default, presetUno };
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { Preset } from '@unocss/core';
2
- import { PresetMiniOptions, Theme } from '@unocss/preset-mini';
1
+ import * as _unocss_core from '@unocss/core';
2
+ import { PresetMiniOptions } from '@unocss/preset-mini';
3
3
  export { Theme } from '@unocss/preset-mini';
4
4
 
5
5
  interface PresetUnoOptions extends PresetMiniOptions {
6
6
  }
7
- declare function presetUno(options?: PresetUnoOptions): Preset<Theme>;
7
+ declare const presetUno: _unocss_core.PresetFactory<object, PresetUnoOptions>;
8
8
 
9
9
  export { type PresetUnoOptions, presetUno as default, presetUno };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Preset } from '@unocss/core';
2
- import { PresetMiniOptions, Theme } from '@unocss/preset-mini';
1
+ import * as _unocss_core from '@unocss/core';
2
+ import { PresetMiniOptions } from '@unocss/preset-mini';
3
3
  export { Theme } from '@unocss/preset-mini';
4
4
 
5
5
  interface PresetUnoOptions extends PresetMiniOptions {
6
6
  }
7
- declare function presetUno(options?: PresetUnoOptions): Preset<Theme>;
7
+ declare const presetUno: _unocss_core.PresetFactory<object, PresetUnoOptions>;
8
8
 
9
9
  export { type PresetUnoOptions, presetUno as default, presetUno };
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
+ import { definePreset } from '@unocss/core';
1
2
  import { presetWind } from '@unocss/preset-wind';
2
- import { parseCssColor, colorToString } from '@unocss/preset-mini/utils';
3
+ import { parseCssColor, colorToString } from '@unocss/rule-utils';
3
4
 
4
5
  function mixComponent(v1, v2, w) {
5
6
  return `calc(${v2} + (${v1} - ${v2}) * ${w} / 100)`;
@@ -64,7 +65,7 @@ function variantColorMix() {
64
65
  };
65
66
  }
66
67
 
67
- function presetUno(options = {}) {
68
+ const presetUno = definePreset((options = {}) => {
68
69
  const wind = presetWind(options);
69
70
  return {
70
71
  ...wind,
@@ -74,6 +75,6 @@ function presetUno(options = {}) {
74
75
  variantColorMix()
75
76
  ]
76
77
  };
77
- }
78
+ });
78
79
 
79
80
  export { presetUno as default, presetUno };
package/dist/theme.d.cts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from '@unocss/preset-mini/theme';
2
- import '@unocss/preset-mini/utils';
2
+ import '@unocss/rule-utils';
3
3
  import '@unocss/preset-mini/colors';
package/dist/theme.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from '@unocss/preset-mini/theme';
2
- import '@unocss/preset-mini/utils';
2
+ import '@unocss/rule-utils';
3
3
  import '@unocss/preset-mini/colors';
package/dist/theme.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from '@unocss/preset-mini/theme';
2
- import '@unocss/preset-mini/utils';
2
+ import '@unocss/rule-utils';
3
3
  import '@unocss/preset-mini/colors';
package/dist/utils.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const utils = require('@unocss/preset-mini/utils');
3
+ const ruleUtils = require('@unocss/rule-utils');
4
4
 
5
5
 
6
6
 
7
- Object.keys(utils).forEach(function (k) {
8
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = utils[k];
7
+ Object.keys(ruleUtils).forEach(function (k) {
8
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = ruleUtils[k];
9
9
  });
package/dist/utils.d.cts CHANGED
@@ -1 +1 @@
1
- export * from '@unocss/preset-mini/utils';
1
+ export * from '@unocss/rule-utils';
package/dist/utils.d.mts CHANGED
@@ -1 +1 @@
1
- export * from '@unocss/preset-mini/utils';
1
+ export * from '@unocss/rule-utils';
package/dist/utils.d.ts CHANGED
@@ -1 +1 @@
1
- export * from '@unocss/preset-mini/utils';
1
+ export * from '@unocss/rule-utils';
package/dist/utils.mjs CHANGED
@@ -1 +1 @@
1
- export * from '@unocss/preset-mini/utils';
1
+ export * from '@unocss/rule-utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-uno",
3
- "version": "0.55.7",
3
+ "version": "0.56.0",
4
4
  "description": "The default preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -50,9 +50,10 @@
50
50
  "*.css"
51
51
  ],
52
52
  "dependencies": {
53
- "@unocss/core": "0.55.7",
54
- "@unocss/preset-mini": "0.55.7",
55
- "@unocss/preset-wind": "0.55.7"
53
+ "@unocss/core": "0.56.0",
54
+ "@unocss/preset-mini": "0.56.0",
55
+ "@unocss/preset-wind": "0.56.0",
56
+ "@unocss/rule-utils": "0.56.0"
56
57
  },
57
58
  "scripts": {
58
59
  "build": "unbuild",