@gem-sdk/pages 1.10.16 → 1.10.20
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.
|
@@ -8,6 +8,7 @@ var react = require('react');
|
|
|
8
8
|
var googleFonts = require('../../libs/google-fonts.js');
|
|
9
9
|
var genCss = require('../../libs/helpers/gen-css.js');
|
|
10
10
|
var getStorefrontApi = require('../../libs/get-storefront-api.js');
|
|
11
|
+
var shopifyCdnWithGoogleFonts = require('../../libs/shopify-cdn-with-google-fonts.js');
|
|
11
12
|
|
|
12
13
|
const globalStyleId = 'global-style';
|
|
13
14
|
const globalFontId = 'google-font-builder';
|
|
@@ -51,6 +52,14 @@ const Toolbox = ()=>{
|
|
|
51
52
|
const themeStyle = genCss.genCSS(detail.data, detail.mobileOnly);
|
|
52
53
|
const font = Object.entries(detail.data?.font).map(([, value])=>{
|
|
53
54
|
return value;
|
|
55
|
+
}).map((item)=>{
|
|
56
|
+
if (item.type == 'custom') {
|
|
57
|
+
const isGoogleFont = shopifyCdnWithGoogleFonts.shopifyCdnWithGoogleFonts.find((ggFont)=>ggFont.family == item.family);
|
|
58
|
+
if (isGoogleFont) {
|
|
59
|
+
return isGoogleFont;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return item;
|
|
54
63
|
});
|
|
55
64
|
const fontUrl = googleFonts.createFontUrl(font);
|
|
56
65
|
const globalStyle = document.getElementById(globalStyleId);
|