@gem-sdk/pages 1.53.0-dev.82 → 1.53.0-dev.93
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/cjs/components/builder/Toolbox.js +15 -2
- package/dist/cjs/libs/api/get-static-page-props-v2.js +13 -3
- package/dist/cjs/libs/google-fonts.js +14 -11
- package/dist/cjs/store/libs-store.js +14 -0
- package/dist/esm/components/builder/Toolbox.js +15 -2
- package/dist/esm/libs/api/get-static-page-props-v2.js +14 -4
- package/dist/esm/libs/google-fonts.js +14 -11
- package/dist/esm/store/libs-store.js +12 -0
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -2
|
@@ -10,6 +10,7 @@ var googleFonts = require('../../libs/google-fonts.js');
|
|
|
10
10
|
var genCss = require('../../libs/helpers/gen-css.js');
|
|
11
11
|
var genFonts = require('../../libs/helpers/gen-fonts.js');
|
|
12
12
|
var shopifyCdnWithGoogleFonts = require('../../libs/shopify-cdn-with-google-fonts.js');
|
|
13
|
+
var libsStore = require('../../store/libs-store.js');
|
|
13
14
|
|
|
14
15
|
const globalStyleId = 'global-style';
|
|
15
16
|
const Toolbox = ()=>{
|
|
@@ -35,6 +36,8 @@ const Toolbox = ()=>{
|
|
|
35
36
|
const changeLayoutSettings = core.useShopStore((s)=>s.changeLayoutSettings);
|
|
36
37
|
const changeCreateThemeSectionCount = core.useShopStore((s)=>s.changeCreateThemeSectionCount);
|
|
37
38
|
const changeShopPlan = core.useShopStore((s)=>s.changeShopPlan);
|
|
39
|
+
const changeFontType = libsStore.libsStore((s)=>s.changeFontType);
|
|
40
|
+
const fontType = libsStore.libsStore((s)=>s.fontType);
|
|
38
41
|
const clearModal = core.useModalStore((s)=>s.clearModal);
|
|
39
42
|
const setInteractionIsSelectOnPage = core.usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
40
43
|
const setInteractionItem = core.usePageStore((s)=>s.setInteractionItem);
|
|
@@ -79,7 +82,7 @@ const Toolbox = ()=>{
|
|
|
79
82
|
const variantName = variant;
|
|
80
83
|
const url = googleFonts.createFontUrl([
|
|
81
84
|
cloneFont
|
|
82
|
-
]);
|
|
85
|
+
], undefined, fontType);
|
|
83
86
|
if (url) {
|
|
84
87
|
const googleFont = document.querySelector(`.${className}[data-font="${fontName}"][data-font-variant="${variantName}"]`);
|
|
85
88
|
if (googleFont) {
|
|
@@ -282,6 +285,13 @@ const Toolbox = ()=>{
|
|
|
282
285
|
}, [
|
|
283
286
|
changeShopPlan
|
|
284
287
|
]);
|
|
288
|
+
const onUpdateFontType = react.useCallback((e)=>{
|
|
289
|
+
const fontType = e.detail;
|
|
290
|
+
if (!fontType) return;
|
|
291
|
+
changeFontType(fontType);
|
|
292
|
+
}, [
|
|
293
|
+
changeFontType
|
|
294
|
+
]);
|
|
285
295
|
const onUpdateDynamicProduct = react.useCallback((e)=>{
|
|
286
296
|
const product = e.detail;
|
|
287
297
|
if (!product) return;
|
|
@@ -387,6 +397,7 @@ const Toolbox = ()=>{
|
|
|
387
397
|
window.addEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
388
398
|
window.addEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
389
399
|
window.addEventListener('update-interaction-setting-type', onUpdateInteractionSettingType);
|
|
400
|
+
window.addEventListener('update-font-type', onUpdateFontType);
|
|
390
401
|
return ()=>{
|
|
391
402
|
window.removeEventListener('update-shop-info', onChangeShopInfo);
|
|
392
403
|
window.removeEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -409,6 +420,7 @@ const Toolbox = ()=>{
|
|
|
409
420
|
window.removeEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
410
421
|
window.removeEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
411
422
|
window.removeEventListener('update-interaction-setting-type', onUpdateInteractionSettingType);
|
|
423
|
+
window.removeEventListener('update-font-type', onUpdateFontType);
|
|
412
424
|
};
|
|
413
425
|
}, [
|
|
414
426
|
onAddEntity,
|
|
@@ -432,7 +444,8 @@ const Toolbox = ()=>{
|
|
|
432
444
|
onUpdateSalePageProductId,
|
|
433
445
|
onUpdateInteractionItem,
|
|
434
446
|
onUpdateInteractionIsSelectOnPage,
|
|
435
|
-
onUpdateInteractionSettingType
|
|
447
|
+
onUpdateInteractionSettingType,
|
|
448
|
+
onUpdateFontType
|
|
436
449
|
]);
|
|
437
450
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
438
451
|
className: "toolbox"
|
|
@@ -18,7 +18,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
18
18
|
slug,
|
|
19
19
|
slugType: pageType
|
|
20
20
|
};
|
|
21
|
-
const [theme, storeProperty, shopifyMeta] = await Promise.allSettled([
|
|
21
|
+
const [theme, storeProperty, shopifyMeta, publishedShopMetas] = await Promise.allSettled([
|
|
22
22
|
fetcher([
|
|
23
23
|
core.PublishedThemePagesDocument,
|
|
24
24
|
variables
|
|
@@ -28,11 +28,21 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
28
28
|
]),
|
|
29
29
|
shopifyFetcher([
|
|
30
30
|
adapterShopify.ShopMetaDocument
|
|
31
|
+
]),
|
|
32
|
+
fetcher([
|
|
33
|
+
core.PublishedShopMetasDocument,
|
|
34
|
+
{
|
|
35
|
+
keys: [
|
|
36
|
+
'source_font'
|
|
37
|
+
]
|
|
38
|
+
}
|
|
31
39
|
])
|
|
32
40
|
]);
|
|
33
41
|
if (theme.status === 'rejected') {
|
|
34
42
|
throw new Error(theme.reason?.[0]);
|
|
35
43
|
}
|
|
44
|
+
const publishedShopMetaValue = publishedShopMetas.status === 'fulfilled' ? publishedShopMetas.value : undefined;
|
|
45
|
+
const sourceFont = publishedShopMetaValue?.publishedShopMetas?.find((item)=>item?.key === 'source_font');
|
|
36
46
|
const dataBuilder = theme.value.publishedThemePages?.[0];
|
|
37
47
|
const themePageCustomFonts = theme.value?.publishedThemePages?.[0]?.themePageCustomFonts;
|
|
38
48
|
if (!dataBuilder) {
|
|
@@ -40,8 +50,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
40
50
|
}
|
|
41
51
|
const pageTemplate = normalize.parseBuilderTemplateV2(dataBuilder);
|
|
42
52
|
const [elementFontStyle, fontStyle, fallback, customFonts$1] = await Promise.all([
|
|
43
|
-
googleFonts.getFontStyleFromPageTemplate(pageTemplate),
|
|
44
|
-
googleFonts.getFontFromGlobalStyle(dataBuilder?.pageStyle?.data),
|
|
53
|
+
googleFonts.getFontStyleFromPageTemplate(pageTemplate, sourceFont?.value),
|
|
54
|
+
googleFonts.getFontFromGlobalStyle(dataBuilder?.pageStyle?.data, sourceFont?.value),
|
|
45
55
|
getFallback.getFallbackV2(fetcher, pageTemplate),
|
|
46
56
|
customFonts.getCustomFonts(themePageCustomFonts)
|
|
47
57
|
]);
|
|
@@ -35,12 +35,12 @@ const composeFonts = (fonts)=>{
|
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
const createFontUrl = (fonts, option)=>{
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
38
|
+
const createFontUrl = (fonts, option, fontType)=>{
|
|
39
|
+
const mainFonts = fonts.filter((font)=>font.type === 'google' || !font.type || font.type === 'bunny');
|
|
40
|
+
if (!mainFonts.length) return;
|
|
41
41
|
const params = new URLSearchParams();
|
|
42
42
|
const display = option?.display || 'swap';
|
|
43
|
-
const uniqFonts =
|
|
43
|
+
const uniqFonts = mainFonts.filter((font, index, arr)=>{
|
|
44
44
|
return index === arr.findIndex((t)=>t.family === font.family);
|
|
45
45
|
});
|
|
46
46
|
const family = composeFonts(uniqFonts).map((font)=>{
|
|
@@ -54,13 +54,16 @@ const createFontUrl = (fonts, option)=>{
|
|
|
54
54
|
if (option?.effect) {
|
|
55
55
|
params.append('effect', option.effect);
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
const bunnyFontUrl = `https://fonts.bunny.net/css?family=${family}`;
|
|
58
|
+
const googleFontUrl = `https://fonts.googleapis.com/css?${decodeURIComponent(params.toString())}`;
|
|
59
|
+
return fontType === 'bunny' ? bunnyFontUrl : googleFontUrl;
|
|
58
60
|
};
|
|
59
|
-
|
|
61
|
+
// eslint-disable-next-line max-params
|
|
62
|
+
async function getFonts(fonts, option, isImportFontByUrl = true, fontType) {
|
|
60
63
|
/**
|
|
61
64
|
* The order of IE -> Chrome is important, other wise chrome starts loading woff1.
|
|
62
65
|
* CSS cascading 🤷♂️.
|
|
63
|
-
*/ const url = createFontUrl(fonts, option);
|
|
66
|
+
*/ const url = createFontUrl(fonts, option, fontType);
|
|
64
67
|
if (!url) return '';
|
|
65
68
|
try {
|
|
66
69
|
if (isImportFontByUrl) return `@import url('${url}');`;
|
|
@@ -82,7 +85,7 @@ async function getFonts(fonts, option, isImportFontByUrl = true) {
|
|
|
82
85
|
return '';
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
|
-
const getFontFromGlobalStyle = (data)=>{
|
|
88
|
+
const getFontFromGlobalStyle = (data, sourceFont)=>{
|
|
86
89
|
if (!data) return '';
|
|
87
90
|
try {
|
|
88
91
|
const globalStyle = JSON.parse(data);
|
|
@@ -90,14 +93,14 @@ const getFontFromGlobalStyle = (data)=>{
|
|
|
90
93
|
const fonts = Object.entries(fontData).map(([, value])=>{
|
|
91
94
|
return value;
|
|
92
95
|
});
|
|
93
|
-
return getFonts(fonts);
|
|
96
|
+
return getFonts(fonts, undefined, undefined, sourceFont);
|
|
94
97
|
} catch {
|
|
95
98
|
return '';
|
|
96
99
|
}
|
|
97
100
|
};
|
|
98
|
-
async function getFontStyleFromPageTemplate(pageTemplate) {
|
|
101
|
+
async function getFontStyleFromPageTemplate(pageTemplate, sourceFont) {
|
|
99
102
|
const fontStyle = pageTemplate.map((sectionData)=>{
|
|
100
|
-
return getFonts(genFonts.getFontsFromDataBuilder(sectionData.data));
|
|
103
|
+
return getFonts(genFonts.getFontsFromDataBuilder(sectionData.data), undefined, undefined, sourceFont);
|
|
101
104
|
});
|
|
102
105
|
return await Promise.all(fontStyle);
|
|
103
106
|
}
|
|
@@ -6,6 +6,7 @@ import { createFontUrl } from '../../libs/google-fonts.js';
|
|
|
6
6
|
import { genCSS } from '../../libs/helpers/gen-css.js';
|
|
7
7
|
import { getFontsFromDataBuilder } from '../../libs/helpers/gen-fonts.js';
|
|
8
8
|
import { shopifyCdnWithGoogleFonts } from '../../libs/shopify-cdn-with-google-fonts.js';
|
|
9
|
+
import { libsStore } from '../../store/libs-store.js';
|
|
9
10
|
|
|
10
11
|
const globalStyleId = 'global-style';
|
|
11
12
|
const Toolbox = ()=>{
|
|
@@ -31,6 +32,8 @@ const Toolbox = ()=>{
|
|
|
31
32
|
const changeLayoutSettings = useShopStore((s)=>s.changeLayoutSettings);
|
|
32
33
|
const changeCreateThemeSectionCount = useShopStore((s)=>s.changeCreateThemeSectionCount);
|
|
33
34
|
const changeShopPlan = useShopStore((s)=>s.changeShopPlan);
|
|
35
|
+
const changeFontType = libsStore((s)=>s.changeFontType);
|
|
36
|
+
const fontType = libsStore((s)=>s.fontType);
|
|
34
37
|
const clearModal = useModalStore((s)=>s.clearModal);
|
|
35
38
|
const setInteractionIsSelectOnPage = usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
36
39
|
const setInteractionItem = usePageStore((s)=>s.setInteractionItem);
|
|
@@ -75,7 +78,7 @@ const Toolbox = ()=>{
|
|
|
75
78
|
const variantName = variant;
|
|
76
79
|
const url = createFontUrl([
|
|
77
80
|
cloneFont
|
|
78
|
-
]);
|
|
81
|
+
], undefined, fontType);
|
|
79
82
|
if (url) {
|
|
80
83
|
const googleFont = document.querySelector(`.${className}[data-font="${fontName}"][data-font-variant="${variantName}"]`);
|
|
81
84
|
if (googleFont) {
|
|
@@ -278,6 +281,13 @@ const Toolbox = ()=>{
|
|
|
278
281
|
}, [
|
|
279
282
|
changeShopPlan
|
|
280
283
|
]);
|
|
284
|
+
const onUpdateFontType = useCallback((e)=>{
|
|
285
|
+
const fontType = e.detail;
|
|
286
|
+
if (!fontType) return;
|
|
287
|
+
changeFontType(fontType);
|
|
288
|
+
}, [
|
|
289
|
+
changeFontType
|
|
290
|
+
]);
|
|
281
291
|
const onUpdateDynamicProduct = useCallback((e)=>{
|
|
282
292
|
const product = e.detail;
|
|
283
293
|
if (!product) return;
|
|
@@ -383,6 +393,7 @@ const Toolbox = ()=>{
|
|
|
383
393
|
window.addEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
384
394
|
window.addEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
385
395
|
window.addEventListener('update-interaction-setting-type', onUpdateInteractionSettingType);
|
|
396
|
+
window.addEventListener('update-font-type', onUpdateFontType);
|
|
386
397
|
return ()=>{
|
|
387
398
|
window.removeEventListener('update-shop-info', onChangeShopInfo);
|
|
388
399
|
window.removeEventListener('revalidate-query', onRevalidateQuery);
|
|
@@ -405,6 +416,7 @@ const Toolbox = ()=>{
|
|
|
405
416
|
window.removeEventListener('update-interaction-is-select-on-page', onUpdateInteractionIsSelectOnPage);
|
|
406
417
|
window.removeEventListener('update-interaction-item', onUpdateInteractionItem);
|
|
407
418
|
window.removeEventListener('update-interaction-setting-type', onUpdateInteractionSettingType);
|
|
419
|
+
window.removeEventListener('update-font-type', onUpdateFontType);
|
|
408
420
|
};
|
|
409
421
|
}, [
|
|
410
422
|
onAddEntity,
|
|
@@ -428,7 +440,8 @@ const Toolbox = ()=>{
|
|
|
428
440
|
onUpdateSalePageProductId,
|
|
429
441
|
onUpdateInteractionItem,
|
|
430
442
|
onUpdateInteractionIsSelectOnPage,
|
|
431
|
-
onUpdateInteractionSettingType
|
|
443
|
+
onUpdateInteractionSettingType,
|
|
444
|
+
onUpdateFontType
|
|
432
445
|
]);
|
|
433
446
|
return /*#__PURE__*/ jsx("div", {
|
|
434
447
|
className: "toolbox"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PublishedThemePagesDocument, StorePropertyDocument } from '@gem-sdk/core';
|
|
1
|
+
import { PublishedThemePagesDocument, StorePropertyDocument, PublishedShopMetasDocument } from '@gem-sdk/core';
|
|
2
2
|
import { ShopMetaDocument } from '@gem-sdk/adapter-shopify';
|
|
3
3
|
import { getFontStyleFromPageTemplate, getFontFromGlobalStyle } from '../google-fonts.js';
|
|
4
4
|
import { genCSS } from '../helpers/gen-css.js';
|
|
@@ -16,7 +16,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
16
16
|
slug,
|
|
17
17
|
slugType: pageType
|
|
18
18
|
};
|
|
19
|
-
const [theme, storeProperty, shopifyMeta] = await Promise.allSettled([
|
|
19
|
+
const [theme, storeProperty, shopifyMeta, publishedShopMetas] = await Promise.allSettled([
|
|
20
20
|
fetcher([
|
|
21
21
|
PublishedThemePagesDocument,
|
|
22
22
|
variables
|
|
@@ -26,11 +26,21 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
26
26
|
]),
|
|
27
27
|
shopifyFetcher([
|
|
28
28
|
ShopMetaDocument
|
|
29
|
+
]),
|
|
30
|
+
fetcher([
|
|
31
|
+
PublishedShopMetasDocument,
|
|
32
|
+
{
|
|
33
|
+
keys: [
|
|
34
|
+
'source_font'
|
|
35
|
+
]
|
|
36
|
+
}
|
|
29
37
|
])
|
|
30
38
|
]);
|
|
31
39
|
if (theme.status === 'rejected') {
|
|
32
40
|
throw new Error(theme.reason?.[0]);
|
|
33
41
|
}
|
|
42
|
+
const publishedShopMetaValue = publishedShopMetas.status === 'fulfilled' ? publishedShopMetas.value : undefined;
|
|
43
|
+
const sourceFont = publishedShopMetaValue?.publishedShopMetas?.find((item)=>item?.key === 'source_font');
|
|
34
44
|
const dataBuilder = theme.value.publishedThemePages?.[0];
|
|
35
45
|
const themePageCustomFonts = theme.value?.publishedThemePages?.[0]?.themePageCustomFonts;
|
|
36
46
|
if (!dataBuilder) {
|
|
@@ -38,8 +48,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
38
48
|
}
|
|
39
49
|
const pageTemplate = parseBuilderTemplateV2(dataBuilder);
|
|
40
50
|
const [elementFontStyle, fontStyle, fallback, customFonts] = await Promise.all([
|
|
41
|
-
getFontStyleFromPageTemplate(pageTemplate),
|
|
42
|
-
getFontFromGlobalStyle(dataBuilder?.pageStyle?.data),
|
|
51
|
+
getFontStyleFromPageTemplate(pageTemplate, sourceFont?.value),
|
|
52
|
+
getFontFromGlobalStyle(dataBuilder?.pageStyle?.data, sourceFont?.value),
|
|
43
53
|
getFallbackV2(fetcher, pageTemplate),
|
|
44
54
|
getCustomFonts(themePageCustomFonts)
|
|
45
55
|
]);
|
|
@@ -33,12 +33,12 @@ const composeFonts = (fonts)=>{
|
|
|
33
33
|
};
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
const createFontUrl = (fonts, option)=>{
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
36
|
+
const createFontUrl = (fonts, option, fontType)=>{
|
|
37
|
+
const mainFonts = fonts.filter((font)=>font.type === 'google' || !font.type || font.type === 'bunny');
|
|
38
|
+
if (!mainFonts.length) return;
|
|
39
39
|
const params = new URLSearchParams();
|
|
40
40
|
const display = option?.display || 'swap';
|
|
41
|
-
const uniqFonts =
|
|
41
|
+
const uniqFonts = mainFonts.filter((font, index, arr)=>{
|
|
42
42
|
return index === arr.findIndex((t)=>t.family === font.family);
|
|
43
43
|
});
|
|
44
44
|
const family = composeFonts(uniqFonts).map((font)=>{
|
|
@@ -52,13 +52,16 @@ const createFontUrl = (fonts, option)=>{
|
|
|
52
52
|
if (option?.effect) {
|
|
53
53
|
params.append('effect', option.effect);
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
const bunnyFontUrl = `https://fonts.bunny.net/css?family=${family}`;
|
|
56
|
+
const googleFontUrl = `https://fonts.googleapis.com/css?${decodeURIComponent(params.toString())}`;
|
|
57
|
+
return fontType === 'bunny' ? bunnyFontUrl : googleFontUrl;
|
|
56
58
|
};
|
|
57
|
-
|
|
59
|
+
// eslint-disable-next-line max-params
|
|
60
|
+
async function getFonts(fonts, option, isImportFontByUrl = true, fontType) {
|
|
58
61
|
/**
|
|
59
62
|
* The order of IE -> Chrome is important, other wise chrome starts loading woff1.
|
|
60
63
|
* CSS cascading 🤷♂️.
|
|
61
|
-
*/ const url = createFontUrl(fonts, option);
|
|
64
|
+
*/ const url = createFontUrl(fonts, option, fontType);
|
|
62
65
|
if (!url) return '';
|
|
63
66
|
try {
|
|
64
67
|
if (isImportFontByUrl) return `@import url('${url}');`;
|
|
@@ -80,7 +83,7 @@ async function getFonts(fonts, option, isImportFontByUrl = true) {
|
|
|
80
83
|
return '';
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
|
-
const getFontFromGlobalStyle = (data)=>{
|
|
86
|
+
const getFontFromGlobalStyle = (data, sourceFont)=>{
|
|
84
87
|
if (!data) return '';
|
|
85
88
|
try {
|
|
86
89
|
const globalStyle = JSON.parse(data);
|
|
@@ -88,14 +91,14 @@ const getFontFromGlobalStyle = (data)=>{
|
|
|
88
91
|
const fonts = Object.entries(fontData).map(([, value])=>{
|
|
89
92
|
return value;
|
|
90
93
|
});
|
|
91
|
-
return getFonts(fonts);
|
|
94
|
+
return getFonts(fonts, undefined, undefined, sourceFont);
|
|
92
95
|
} catch {
|
|
93
96
|
return '';
|
|
94
97
|
}
|
|
95
98
|
};
|
|
96
|
-
async function getFontStyleFromPageTemplate(pageTemplate) {
|
|
99
|
+
async function getFontStyleFromPageTemplate(pageTemplate, sourceFont) {
|
|
97
100
|
const fontStyle = pageTemplate.map((sectionData)=>{
|
|
98
|
-
return getFonts(getFontsFromDataBuilder(sectionData.data));
|
|
101
|
+
return getFonts(getFontsFromDataBuilder(sectionData.data), undefined, undefined, sourceFont);
|
|
99
102
|
});
|
|
100
103
|
return await Promise.all(fontStyle);
|
|
101
104
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -189,7 +189,7 @@ declare const BuilderPage: React.FC<BuilderPageProps>;
|
|
|
189
189
|
|
|
190
190
|
declare const getStaticPaths: GetStaticPaths;
|
|
191
191
|
|
|
192
|
-
type TypographyV2FontFamilyType = 'google' | 'custom' | 'theme';
|
|
192
|
+
type TypographyV2FontFamilyType = 'google' | 'custom' | 'theme' | 'bunny';
|
|
193
193
|
|
|
194
194
|
type FontItem = {
|
|
195
195
|
type: TypographyV2FontFamilyType;
|
|
@@ -202,8 +202,8 @@ type FontOption = {
|
|
|
202
202
|
subset?: string;
|
|
203
203
|
effect?: string;
|
|
204
204
|
};
|
|
205
|
-
declare function getFonts(fonts: FontItem[], option?: FontOption, isImportFontByUrl?: boolean): Promise<string>;
|
|
206
|
-
declare const getFontFromGlobalStyle: (data?: string) => "" | Promise<string>;
|
|
205
|
+
declare function getFonts(fonts: FontItem[], option?: FontOption, isImportFontByUrl?: boolean, fontType?: string): Promise<string>;
|
|
206
|
+
declare const getFontFromGlobalStyle: (data?: string, sourceFont?: 'bunny' | 'google' | string) => "" | Promise<string>;
|
|
207
207
|
|
|
208
208
|
declare const getFontsFromDataBuilder: (dataBuilder: Record<string, any>) => FontItem[];
|
|
209
209
|
declare const getFontFromGroupSetting: (fonts: FontItem[], groupSetting: Record<string, any>) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.53.0-dev.
|
|
3
|
+
"version": "1.53.0-dev.93",
|
|
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.53.0-dev.
|
|
29
|
+
"@gem-sdk/core": "1.53.0-dev.93",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "1.53.0-dev.4",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "1.53.0-dev.4",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.53.0-dev.4"
|