@gem-sdk/pages 1.58.0-dev.26 → 1.58.0-dev.40
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,6 +9,7 @@ var generateManifres = require('../helpers/generate-manifres.js');
|
|
|
9
9
|
var getFallback = require('../helpers/get-fallback.js');
|
|
10
10
|
var normalize = require('../helpers/normalize.js');
|
|
11
11
|
var parseJson = require('../helpers/parse-json.js');
|
|
12
|
+
var customFonts = require('../custom-fonts.js');
|
|
12
13
|
|
|
13
14
|
const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
14
15
|
try {
|
|
@@ -36,11 +37,13 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
36
37
|
if (!dataBuilder) {
|
|
37
38
|
throw new Error(`No data builder found for slug: /preview/${slug}`);
|
|
38
39
|
}
|
|
40
|
+
const themePageCustomFonts = dataBuilder.customFonts;
|
|
39
41
|
const pageTemplate = normalize.parseBuilderTemplateV2(dataBuilder);
|
|
40
|
-
const [elementFontStyle, fontStyle, fallback] = await Promise.all([
|
|
42
|
+
const [elementFontStyle, fontStyle, fallback, customFonts$1] = await Promise.all([
|
|
41
43
|
googleFonts.getFontStyleFromPageTemplate(pageTemplate),
|
|
42
44
|
googleFonts.getFontFromGlobalStyle(dataBuilder?.themeStyle?.data),
|
|
43
|
-
getFallback.getFallbackV2(fetcher, pageTemplate)
|
|
45
|
+
getFallback.getFallbackV2(fetcher, pageTemplate),
|
|
46
|
+
customFonts.getCustomFonts(themePageCustomFonts)
|
|
44
47
|
]);
|
|
45
48
|
const mobileOnly = dataBuilder.isMobile ?? false;
|
|
46
49
|
const description = dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
|
|
@@ -138,7 +141,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
138
141
|
facebookPixelId: dataBuilder.analytic?.fbPixelID ?? null,
|
|
139
142
|
tiktokPixelId: dataBuilder.analytic?.tiktokPixelID ?? null,
|
|
140
143
|
customCodeHeader: dataBuilder.customCode?.header ?? null,
|
|
141
|
-
customCodeBody: dataBuilder.customCode?.body ?? null
|
|
144
|
+
customCodeBody: dataBuilder.customCode?.body ?? null,
|
|
145
|
+
customFonts: customFonts$1
|
|
142
146
|
});
|
|
143
147
|
} catch (err) {
|
|
144
148
|
nextjs.captureException(err);
|
|
@@ -7,6 +7,7 @@ import { generateManifest } from '../helpers/generate-manifres.js';
|
|
|
7
7
|
import { getFallbackV2 } from '../helpers/get-fallback.js';
|
|
8
8
|
import { parseBuilderTemplateV2 } from '../helpers/normalize.js';
|
|
9
9
|
import { parseJson, serializableJson } from '../helpers/parse-json.js';
|
|
10
|
+
import { getCustomFonts } from '../custom-fonts.js';
|
|
10
11
|
|
|
11
12
|
const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
12
13
|
try {
|
|
@@ -34,11 +35,13 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
34
35
|
if (!dataBuilder) {
|
|
35
36
|
throw new Error(`No data builder found for slug: /preview/${slug}`);
|
|
36
37
|
}
|
|
38
|
+
const themePageCustomFonts = dataBuilder.customFonts;
|
|
37
39
|
const pageTemplate = parseBuilderTemplateV2(dataBuilder);
|
|
38
|
-
const [elementFontStyle, fontStyle, fallback] = await Promise.all([
|
|
40
|
+
const [elementFontStyle, fontStyle, fallback, customFonts] = await Promise.all([
|
|
39
41
|
getFontStyleFromPageTemplate(pageTemplate),
|
|
40
42
|
getFontFromGlobalStyle(dataBuilder?.themeStyle?.data),
|
|
41
|
-
getFallbackV2(fetcher, pageTemplate)
|
|
43
|
+
getFallbackV2(fetcher, pageTemplate),
|
|
44
|
+
getCustomFonts(themePageCustomFonts)
|
|
42
45
|
]);
|
|
43
46
|
const mobileOnly = dataBuilder.isMobile ?? false;
|
|
44
47
|
const description = dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
|
|
@@ -136,7 +139,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
136
139
|
facebookPixelId: dataBuilder.analytic?.fbPixelID ?? null,
|
|
137
140
|
tiktokPixelId: dataBuilder.analytic?.tiktokPixelID ?? null,
|
|
138
141
|
customCodeHeader: dataBuilder.customCode?.header ?? null,
|
|
139
|
-
customCodeBody: dataBuilder.customCode?.body ?? null
|
|
142
|
+
customCodeBody: dataBuilder.customCode?.body ?? null,
|
|
143
|
+
customFonts
|
|
140
144
|
});
|
|
141
145
|
} catch (err) {
|
|
142
146
|
captureException(err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.58.0-dev.
|
|
3
|
+
"version": "1.58.0-dev.40",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"next": "latest"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "1.58.0-dev.
|
|
29
|
+
"@gem-sdk/core": "1.58.0-dev.40",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "1.58.0-dev.25",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "1.58.0-dev.25",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.58.0-dev.25"
|