@gem-sdk/pages 1.58.0-dev.13 → 1.58.0-dev.15

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.
@@ -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.PreviewPageDocument,
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.previewPage;
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?.pageStyle?.data),
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?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
48
- const thumbnail = parseJson.parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
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?.pageStyle?.data, mobileOnly),
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.themePageAnalytic?.gaTrackingID ?? null,
139
- facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
140
- tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
141
- customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
142
- customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
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);
@@ -1,4 +1,4 @@
1
- import { PreviewPageDocument, StorePropertyDocument } from '@gem-sdk/core';
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
- PreviewPageDocument,
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.previewPage;
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?.pageStyle?.data),
40
+ getFontFromGlobalStyle(dataBuilder?.themeStyle?.data),
42
41
  getFallbackV2(fetcher, pageTemplate)
43
42
  ]);
44
43
  const mobileOnly = dataBuilder.isMobile ?? false;
45
- const description = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
46
- const thumbnail = parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
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?.pageStyle?.data, mobileOnly),
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.themePageAnalytic?.gaTrackingID ?? null,
137
- facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
138
- tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
139
- customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
140
- customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.58.0-dev.13",
3
+ "version": "1.58.0-dev.15",
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.13",
29
+ "@gem-sdk/core": "1.58.0-dev.15",
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"