@unocss/preset-web-fonts 0.53.5 → 0.54.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 +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ function createBunnyFontsProvider(name, host) {
|
|
|
13
13
|
const formattedName = name2.toLowerCase().replace(/\s/g, "-");
|
|
14
14
|
if (!weights?.length)
|
|
15
15
|
return `${formattedName}${italic ? ":i" : ""}`;
|
|
16
|
-
let weightsAsString = weights.
|
|
16
|
+
let weightsAsString = weights.map((weight) => weight.toString());
|
|
17
17
|
const weightsHaveItalic = weightsAsString.some((weight) => weight.endsWith("i"));
|
|
18
18
|
if (!weightsHaveItalic && italic)
|
|
19
19
|
weightsAsString = weightsAsString.map((weight) => weight += "i");
|
|
@@ -93,13 +93,13 @@ function normalizedFontMeta(meta, defaultProvider) {
|
|
|
93
93
|
if (typeof meta !== "string") {
|
|
94
94
|
meta.provider = resolveProvider(meta.provider || defaultProvider);
|
|
95
95
|
if (meta.weights)
|
|
96
|
-
meta.weights = [...new Set(meta.weights.
|
|
96
|
+
meta.weights = [...new Set(meta.weights.sort((a, b) => a.toString().localeCompare(b.toString(), "en", { numeric: true })))];
|
|
97
97
|
return meta;
|
|
98
98
|
}
|
|
99
99
|
const [name, weights = ""] = meta.split(":");
|
|
100
100
|
return {
|
|
101
101
|
name,
|
|
102
|
-
weights: [...new Set(weights.split(/[,;]\s*/).filter(Boolean).
|
|
102
|
+
weights: [...new Set(weights.split(/[,;]\s*/).filter(Boolean).sort((a, b) => a.localeCompare(b, "en", { numeric: true })))],
|
|
103
103
|
provider: resolveProvider(defaultProvider)
|
|
104
104
|
};
|
|
105
105
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ function createBunnyFontsProvider(name, host) {
|
|
|
9
9
|
const formattedName = name2.toLowerCase().replace(/\s/g, "-");
|
|
10
10
|
if (!weights?.length)
|
|
11
11
|
return `${formattedName}${italic ? ":i" : ""}`;
|
|
12
|
-
let weightsAsString = weights.
|
|
12
|
+
let weightsAsString = weights.map((weight) => weight.toString());
|
|
13
13
|
const weightsHaveItalic = weightsAsString.some((weight) => weight.endsWith("i"));
|
|
14
14
|
if (!weightsHaveItalic && italic)
|
|
15
15
|
weightsAsString = weightsAsString.map((weight) => weight += "i");
|
|
@@ -89,13 +89,13 @@ function normalizedFontMeta(meta, defaultProvider) {
|
|
|
89
89
|
if (typeof meta !== "string") {
|
|
90
90
|
meta.provider = resolveProvider(meta.provider || defaultProvider);
|
|
91
91
|
if (meta.weights)
|
|
92
|
-
meta.weights = [...new Set(meta.weights.
|
|
92
|
+
meta.weights = [...new Set(meta.weights.sort((a, b) => a.toString().localeCompare(b.toString(), "en", { numeric: true })))];
|
|
93
93
|
return meta;
|
|
94
94
|
}
|
|
95
95
|
const [name, weights = ""] = meta.split(":");
|
|
96
96
|
return {
|
|
97
97
|
name,
|
|
98
|
-
weights: [...new Set(weights.split(/[,;]\s*/).filter(Boolean).
|
|
98
|
+
weights: [...new Set(weights.split(/[,;]\s*/).filter(Boolean).sort((a, b) => a.localeCompare(b, "en", { numeric: true })))],
|
|
99
99
|
provider: resolveProvider(defaultProvider)
|
|
100
100
|
};
|
|
101
101
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-web-fonts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Web Fonts support for Uno CSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"ofetch": "^1.1.1",
|
|
41
|
-
"@unocss/core": "0.
|
|
41
|
+
"@unocss/core": "0.54.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild",
|