@gem-sdk/pages 1.58.0-dev.13 → 1.58.0-dev.22
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/InteractionSelectOnPageHeader.js +1 -1
- package/dist/cjs/libs/api/get-static-page-props-preview.js +12 -13
- package/dist/esm/components/builder/InteractionSelectOnPageHeader.js +1 -1
- package/dist/esm/libs/api/get-static-page-props-preview.js +13 -14
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -105,7 +105,7 @@ const InteractionSelectOnPageHeader = ()=>{
|
|
|
105
105
|
})
|
|
106
106
|
]
|
|
107
107
|
}),
|
|
108
|
-
openDropdown &&
|
|
108
|
+
openDropdown && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
109
109
|
ref: popupRef,
|
|
110
110
|
className: "gp-p-2 gp-flex gp-flex-col gp-absolute gp-top-[calc(100%_+_4px)] gp-w-[280px] gp-bg-[#151515] gp-rounded-xl gp-text-white",
|
|
111
111
|
children: [
|
|
@@ -19,9 +19,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
19
19
|
};
|
|
20
20
|
const [theme, storeProperty, shopifyMeta] = await Promise.allSettled([
|
|
21
21
|
fetcher([
|
|
22
|
-
core.
|
|
23
|
-
variables
|
|
24
|
-
'previewPage'
|
|
22
|
+
core.PreviewThemePageDocument,
|
|
23
|
+
variables
|
|
25
24
|
]),
|
|
26
25
|
fetcher([
|
|
27
26
|
core.StorePropertyDocument
|
|
@@ -33,19 +32,19 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
33
32
|
if (theme.status === 'rejected') {
|
|
34
33
|
throw new Error(theme.reason?.[0]);
|
|
35
34
|
}
|
|
36
|
-
const dataBuilder = theme.value.
|
|
35
|
+
const dataBuilder = theme.value.previewThemePage;
|
|
37
36
|
if (!dataBuilder) {
|
|
38
37
|
throw new Error(`No data builder found for slug: /preview/${slug}`);
|
|
39
38
|
}
|
|
40
39
|
const pageTemplate = normalize.parseBuilderTemplateV2(dataBuilder);
|
|
41
40
|
const [elementFontStyle, fontStyle, fallback] = await Promise.all([
|
|
42
41
|
googleFonts.getFontStyleFromPageTemplate(pageTemplate),
|
|
43
|
-
googleFonts.getFontFromGlobalStyle(dataBuilder?.
|
|
42
|
+
googleFonts.getFontFromGlobalStyle(dataBuilder?.themeStyle?.data),
|
|
44
43
|
getFallback.getFallbackV2(fetcher, pageTemplate)
|
|
45
44
|
]);
|
|
46
45
|
const mobileOnly = dataBuilder.isMobile ?? false;
|
|
47
|
-
const description = dataBuilder?.
|
|
48
|
-
const thumbnail = parseJson.parseJson(dataBuilder?.
|
|
46
|
+
const description = dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
|
|
47
|
+
const thumbnail = parseJson.parseJson(dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
|
|
49
48
|
const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
|
|
50
49
|
const shopData = storeProperty.status === 'fulfilled' ? storeProperty.value : undefined;
|
|
51
50
|
const favicon = shopData?.storeProperty?.favicon ?? '/favicon/favicon-32x32.png';
|
|
@@ -119,7 +118,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
119
118
|
const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
|
|
120
119
|
const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
|
|
121
120
|
return parseJson.serializableJson({
|
|
122
|
-
themeStyle: genCss.genCSS(dataBuilder?.
|
|
121
|
+
themeStyle: genCss.genCSS(dataBuilder?.themeStyle?.data, mobileOnly),
|
|
123
122
|
fontStyle,
|
|
124
123
|
elementFontStyle,
|
|
125
124
|
builderData: pageTemplate,
|
|
@@ -135,11 +134,11 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
135
134
|
swatches: parseJson.parseJson(shopData?.storeProperty?.swatchesConfig),
|
|
136
135
|
seo,
|
|
137
136
|
mobileOnly,
|
|
138
|
-
gaTrackingId: dataBuilder.
|
|
139
|
-
facebookPixelId: dataBuilder.
|
|
140
|
-
tiktokPixelId: dataBuilder.
|
|
141
|
-
customCodeHeader: dataBuilder.
|
|
142
|
-
customCodeBody: dataBuilder.
|
|
137
|
+
gaTrackingId: dataBuilder.analytic?.gaTrackingID ?? null,
|
|
138
|
+
facebookPixelId: dataBuilder.analytic?.fbPixelID ?? null,
|
|
139
|
+
tiktokPixelId: dataBuilder.analytic?.tiktokPixelID ?? null,
|
|
140
|
+
customCodeHeader: dataBuilder.customCode?.header ?? null,
|
|
141
|
+
customCodeBody: dataBuilder.customCode?.body ?? null
|
|
143
142
|
});
|
|
144
143
|
} catch (err) {
|
|
145
144
|
nextjs.captureException(err);
|
|
@@ -101,7 +101,7 @@ const InteractionSelectOnPageHeader = ()=>{
|
|
|
101
101
|
})
|
|
102
102
|
]
|
|
103
103
|
}),
|
|
104
|
-
openDropdown &&
|
|
104
|
+
openDropdown && /*#__PURE__*/ jsxs("div", {
|
|
105
105
|
ref: popupRef,
|
|
106
106
|
className: "gp-p-2 gp-flex gp-flex-col gp-absolute gp-top-[calc(100%_+_4px)] gp-w-[280px] gp-bg-[#151515] gp-rounded-xl gp-text-white",
|
|
107
107
|
children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PreviewThemePageDocument, StorePropertyDocument } from '@gem-sdk/core';
|
|
2
2
|
import { ShopMetaDocument } from '@gem-sdk/adapter-shopify';
|
|
3
3
|
import { captureException } from '@sentry/nextjs';
|
|
4
4
|
import { getFontStyleFromPageTemplate, getFontFromGlobalStyle } from '../google-fonts.js';
|
|
@@ -17,9 +17,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
17
17
|
};
|
|
18
18
|
const [theme, storeProperty, shopifyMeta] = await Promise.allSettled([
|
|
19
19
|
fetcher([
|
|
20
|
-
|
|
21
|
-
variables
|
|
22
|
-
'previewPage'
|
|
20
|
+
PreviewThemePageDocument,
|
|
21
|
+
variables
|
|
23
22
|
]),
|
|
24
23
|
fetcher([
|
|
25
24
|
StorePropertyDocument
|
|
@@ -31,19 +30,19 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
31
30
|
if (theme.status === 'rejected') {
|
|
32
31
|
throw new Error(theme.reason?.[0]);
|
|
33
32
|
}
|
|
34
|
-
const dataBuilder = theme.value.
|
|
33
|
+
const dataBuilder = theme.value.previewThemePage;
|
|
35
34
|
if (!dataBuilder) {
|
|
36
35
|
throw new Error(`No data builder found for slug: /preview/${slug}`);
|
|
37
36
|
}
|
|
38
37
|
const pageTemplate = parseBuilderTemplateV2(dataBuilder);
|
|
39
38
|
const [elementFontStyle, fontStyle, fallback] = await Promise.all([
|
|
40
39
|
getFontStyleFromPageTemplate(pageTemplate),
|
|
41
|
-
getFontFromGlobalStyle(dataBuilder?.
|
|
40
|
+
getFontFromGlobalStyle(dataBuilder?.themeStyle?.data),
|
|
42
41
|
getFallbackV2(fetcher, pageTemplate)
|
|
43
42
|
]);
|
|
44
43
|
const mobileOnly = dataBuilder.isMobile ?? false;
|
|
45
|
-
const description = dataBuilder?.
|
|
46
|
-
const thumbnail = parseJson(dataBuilder?.
|
|
44
|
+
const description = dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
|
|
45
|
+
const thumbnail = parseJson(dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
|
|
47
46
|
const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
|
|
48
47
|
const shopData = storeProperty.status === 'fulfilled' ? storeProperty.value : undefined;
|
|
49
48
|
const favicon = shopData?.storeProperty?.favicon ?? '/favicon/favicon-32x32.png';
|
|
@@ -117,7 +116,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
117
116
|
const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
|
|
118
117
|
const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
|
|
119
118
|
return serializableJson({
|
|
120
|
-
themeStyle: genCSS(dataBuilder?.
|
|
119
|
+
themeStyle: genCSS(dataBuilder?.themeStyle?.data, mobileOnly),
|
|
121
120
|
fontStyle,
|
|
122
121
|
elementFontStyle,
|
|
123
122
|
builderData: pageTemplate,
|
|
@@ -133,11 +132,11 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
|
|
|
133
132
|
swatches: parseJson(shopData?.storeProperty?.swatchesConfig),
|
|
134
133
|
seo,
|
|
135
134
|
mobileOnly,
|
|
136
|
-
gaTrackingId: dataBuilder.
|
|
137
|
-
facebookPixelId: dataBuilder.
|
|
138
|
-
tiktokPixelId: dataBuilder.
|
|
139
|
-
customCodeHeader: dataBuilder.
|
|
140
|
-
customCodeBody: dataBuilder.
|
|
135
|
+
gaTrackingId: dataBuilder.analytic?.gaTrackingID ?? null,
|
|
136
|
+
facebookPixelId: dataBuilder.analytic?.fbPixelID ?? null,
|
|
137
|
+
tiktokPixelId: dataBuilder.analytic?.tiktokPixelID ?? null,
|
|
138
|
+
customCodeHeader: dataBuilder.customCode?.header ?? null,
|
|
139
|
+
customCodeBody: dataBuilder.customCode?.body ?? null
|
|
141
140
|
});
|
|
142
141
|
} catch (err) {
|
|
143
142
|
captureException(err);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -257,4 +257,4 @@ type BuilderPageProps = {
|
|
|
257
257
|
};
|
|
258
258
|
declare const BuilderPage: React.FC<BuilderPageProps>;
|
|
259
259
|
|
|
260
|
-
export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, CollectionPageProps, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PreviewPage, ProductDetailPage, ProductPageProps, StaticPage, StaticPageProps, StaticPagePropsV2, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, usePagePreview, useTrackingView };
|
|
260
|
+
export { AppPropsWithLayout, BuilderPage, CollectionDetailPage, CollectionPageProps, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, NextPageWithLayout, Page404, Page500, PageBuilderProps, PageBuilderPropsV2, PreviewPage, ProductDetailPage, ProductPageProps, StaticPage, StaticPageProps, StaticPagePropsV2, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, genCSS, getBuilderProps, getCollectionProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, usePagePreview, useTrackingView };
|
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.22",
|
|
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.20",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "1.58.0-dev.13",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "1.58.0-dev.13",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.58.0-dev.13"
|