@gem-sdk/pages 1.9.44 → 1.9.52
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.
|
@@ -9,12 +9,12 @@ async function getFontForUA(url, UA) {
|
|
|
9
9
|
}
|
|
10
10
|
}).then((res)=>res.text());
|
|
11
11
|
}
|
|
12
|
-
const createFontUrl = (
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
12
|
+
const createFontUrl = (fonts, option)=>{
|
|
13
|
+
const googleFonts = fonts.filter((font)=>font.type === 'google' || !font.type);
|
|
14
|
+
if (!googleFonts.length) return;
|
|
15
15
|
const params = new URLSearchParams();
|
|
16
16
|
const display = option?.display || 'swap';
|
|
17
|
-
const family =
|
|
17
|
+
const family = googleFonts.filter((font, index, arr)=>{
|
|
18
18
|
return index === arr.findIndex((t)=>t.family === font.family);
|
|
19
19
|
}).map((font)=>{
|
|
20
20
|
return `${font.family.replace(/ /g, '+')}:${font.variants.join(',')}`;
|
|
@@ -49,11 +49,11 @@ const getFontFromGlobalStyle = (data)=>{
|
|
|
49
49
|
if (!data) return '';
|
|
50
50
|
try {
|
|
51
51
|
const globalStyle = JSON.parse(data);
|
|
52
|
-
const
|
|
53
|
-
const
|
|
52
|
+
const fontData = globalStyle?.font ?? {};
|
|
53
|
+
const fonts = Object.entries(fontData).map(([, value])=>{
|
|
54
54
|
return value;
|
|
55
|
-
})
|
|
56
|
-
return getFonts(
|
|
55
|
+
});
|
|
56
|
+
return getFonts(fonts);
|
|
57
57
|
} catch {
|
|
58
58
|
return '';
|
|
59
59
|
}
|
|
@@ -7,12 +7,12 @@ async function getFontForUA(url, UA) {
|
|
|
7
7
|
}
|
|
8
8
|
}).then((res)=>res.text());
|
|
9
9
|
}
|
|
10
|
-
const createFontUrl = (
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
10
|
+
const createFontUrl = (fonts, option)=>{
|
|
11
|
+
const googleFonts = fonts.filter((font)=>font.type === 'google' || !font.type);
|
|
12
|
+
if (!googleFonts.length) return;
|
|
13
13
|
const params = new URLSearchParams();
|
|
14
14
|
const display = option?.display || 'swap';
|
|
15
|
-
const family =
|
|
15
|
+
const family = googleFonts.filter((font, index, arr)=>{
|
|
16
16
|
return index === arr.findIndex((t)=>t.family === font.family);
|
|
17
17
|
}).map((font)=>{
|
|
18
18
|
return `${font.family.replace(/ /g, '+')}:${font.variants.join(',')}`;
|
|
@@ -47,11 +47,11 @@ const getFontFromGlobalStyle = (data)=>{
|
|
|
47
47
|
if (!data) return '';
|
|
48
48
|
try {
|
|
49
49
|
const globalStyle = JSON.parse(data);
|
|
50
|
-
const
|
|
51
|
-
const
|
|
50
|
+
const fontData = globalStyle?.font ?? {};
|
|
51
|
+
const fonts = Object.entries(fontData).map(([, value])=>{
|
|
52
52
|
return value;
|
|
53
|
-
})
|
|
54
|
-
return getFonts(
|
|
53
|
+
});
|
|
54
|
+
return getFonts(fonts);
|
|
55
55
|
} catch {
|
|
56
56
|
return '';
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.52",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"test": "jest -c ./../../helpers/jest.config.ts"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@sentry/nextjs": "7.
|
|
22
|
+
"@sentry/nextjs": "7.47.0",
|
|
23
23
|
"deepmerge": "4.3.1",
|
|
24
24
|
"html-react-parser": "3.0.15",
|
|
25
|
-
"next-seo": "^
|
|
25
|
+
"next-seo": "^6.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@gem-sdk/core": "*",
|