@gem-sdk/pages 1.5.23 → 1.5.36

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.
@@ -21,9 +21,14 @@ const getBuilderProps = async (fetcher, shopifyFetcher)=>{
21
21
  title: 'Preview',
22
22
  description: shopMeta?.shop.description
23
23
  } : {};
24
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
25
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
26
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
24
27
  return parseJson.serializableJson({
25
28
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
26
- locale: shopMeta?.localization.country.isoCode ?? null,
29
+ languageIsoCode,
30
+ countryIsoCode,
31
+ locale,
27
32
  swatches: parseJson.parseJson(shopData?.storeProperty?.swatchesConfig),
28
33
  swr: {
29
34
  revalidateOnMount: true
@@ -109,6 +109,9 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
109
109
  }
110
110
  ]
111
111
  };
112
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
113
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
114
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
112
115
  return parseJson.serializableJson({
113
116
  themeStyle: genCss.genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
114
117
  fontStyle,
@@ -117,7 +120,9 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
117
120
  fallback
118
121
  },
119
122
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
120
- locale: shopMeta?.localization.country.isoCode ?? null,
123
+ languageIsoCode,
124
+ countryIsoCode,
125
+ locale,
121
126
  swatches: parseJson.parseJson(shopData?.storeProperty?.swatchesConfig),
122
127
  seo,
123
128
  mobileOnly,
@@ -127,6 +127,9 @@ const getHomePageProps = (fetcher, shopifyFetcher)=>async ()=>{
127
127
  }
128
128
  ]
129
129
  };
130
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
131
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
132
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
130
133
  return parseJson.serializableJson({
131
134
  themeStyle: genCss.genCSS(dataBuilder?.pageStyle?.data),
132
135
  fontStyle,
@@ -136,7 +139,9 @@ const getHomePageProps = (fetcher, shopifyFetcher)=>async ()=>{
136
139
  fallback
137
140
  },
138
141
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
139
- locale: shopMeta?.localization.country.isoCode ?? null,
142
+ locale,
143
+ languageIsoCode,
144
+ countryIsoCode,
140
145
  swatches: parseJson.parseJson(shopData?.storeProperty?.swatchesConfig),
141
146
  seo
142
147
  });
@@ -114,13 +114,18 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
114
114
  }
115
115
  ]
116
116
  };
117
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
118
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
119
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
117
120
  return parseJson.serializableJson({
118
121
  themeStyle: genCss.genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
119
122
  fontStyle,
120
123
  builderData: pageTemplate,
121
124
  pageType,
122
125
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
123
- locale: shopMeta?.localization.country.isoCode ?? null,
126
+ languageIsoCode,
127
+ countryIsoCode,
128
+ locale,
124
129
  swr: {
125
130
  fallback
126
131
  },
@@ -111,13 +111,18 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
111
111
  }
112
112
  ]
113
113
  };
114
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
115
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
116
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
114
117
  return parseJson.serializableJson({
115
118
  themeStyle: genCss.genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
116
119
  fontStyle,
117
120
  builderData: pageTemplate,
118
121
  pageType,
119
122
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
120
- locale: shopMeta?.localization.country.isoCode ?? null,
123
+ languageIsoCode,
124
+ countryIsoCode,
125
+ locale,
121
126
  swr: {
122
127
  fallback
123
128
  },
@@ -124,13 +124,18 @@ const getStaticPageProps = (fetcher, shopifyFetcher)=>async (slug)=>{
124
124
  }
125
125
  ]
126
126
  };
127
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
128
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
129
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
127
130
  return parseJson.serializableJson({
128
131
  themeStyle: genCss.genCSS(dataBuilder?.pageStyle?.data),
129
132
  fontStyle,
130
133
  builderData: pageTemplate,
131
134
  pageType,
132
135
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
133
- locale: shopMeta?.localization.country.isoCode ?? null,
136
+ languageIsoCode,
137
+ countryIsoCode,
138
+ locale,
134
139
  swr: {
135
140
  fallback
136
141
  },
@@ -6,10 +6,9 @@ var nextSeo = require('next-seo');
6
6
  var Head = require('next/head');
7
7
  var react = require('react');
8
8
  var Toolbox = require('../components/builder/Toolbox.js');
9
- var dynamic = require('next/dynamic');
9
+ var Header = require('../components/Header.js');
10
+ var Footer = require('../components/Footer.js');
10
11
 
11
- const Header = dynamic(()=>Promise.resolve().then(function () { return require('../components/Header.js'); }));
12
- const Footer = dynamic(()=>Promise.resolve().then(function () { return require('../components/Footer.js'); }));
13
12
  const BuilderPage = ({ components , seo , themeStyle , fontStyle , sectionData })=>{
14
13
  const [loadSuccess, setLoadSuccess] = react.useState(false);
15
14
  const initState = {
@@ -46,7 +45,7 @@ const BuilderPage = ({ components , seo , themeStyle , fontStyle , sectionData
46
45
  })
47
46
  ]
48
47
  }),
49
- /*#__PURE__*/ jsxRuntime.jsx(Header, {}),
48
+ /*#__PURE__*/ jsxRuntime.jsx(Header.default, {}),
50
49
  /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
51
50
  components: components,
52
51
  children: /*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
@@ -73,7 +72,7 @@ const BuilderPage = ({ components , seo , themeStyle , fontStyle , sectionData
73
72
  }, "preview")
74
73
  })
75
74
  }),
76
- /*#__PURE__*/ jsxRuntime.jsx(Footer, {})
75
+ /*#__PURE__*/ jsxRuntime.jsx(Footer.default, {})
77
76
  ]
78
77
  });
79
78
  };
@@ -19,9 +19,14 @@ const getBuilderProps = async (fetcher, shopifyFetcher)=>{
19
19
  title: 'Preview',
20
20
  description: shopMeta?.shop.description
21
21
  } : {};
22
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
23
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
24
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
22
25
  return serializableJson({
23
26
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
24
- locale: shopMeta?.localization.country.isoCode ?? null,
27
+ languageIsoCode,
28
+ countryIsoCode,
29
+ locale,
25
30
  swatches: parseJson(shopData?.storeProperty?.swatchesConfig),
26
31
  swr: {
27
32
  revalidateOnMount: true
@@ -107,6 +107,9 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
107
107
  }
108
108
  ]
109
109
  };
110
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
111
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
112
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
110
113
  return serializableJson({
111
114
  themeStyle: genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
112
115
  fontStyle,
@@ -115,7 +118,9 @@ const getHomePagePropsV2 = (fetcher, shopifyFetcher)=>async ()=>{
115
118
  fallback
116
119
  },
117
120
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
118
- locale: shopMeta?.localization.country.isoCode ?? null,
121
+ languageIsoCode,
122
+ countryIsoCode,
123
+ locale,
119
124
  swatches: parseJson(shopData?.storeProperty?.swatchesConfig),
120
125
  seo,
121
126
  mobileOnly,
@@ -125,6 +125,9 @@ const getHomePageProps = (fetcher, shopifyFetcher)=>async ()=>{
125
125
  }
126
126
  ]
127
127
  };
128
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
129
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
130
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
128
131
  return serializableJson({
129
132
  themeStyle: genCSS(dataBuilder?.pageStyle?.data),
130
133
  fontStyle,
@@ -134,7 +137,9 @@ const getHomePageProps = (fetcher, shopifyFetcher)=>async ()=>{
134
137
  fallback
135
138
  },
136
139
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
137
- locale: shopMeta?.localization.country.isoCode ?? null,
140
+ locale,
141
+ languageIsoCode,
142
+ countryIsoCode,
138
143
  swatches: parseJson(shopData?.storeProperty?.swatchesConfig),
139
144
  seo
140
145
  });
@@ -112,13 +112,18 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
112
112
  }
113
113
  ]
114
114
  };
115
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
116
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
117
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
115
118
  return serializableJson({
116
119
  themeStyle: genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
117
120
  fontStyle,
118
121
  builderData: pageTemplate,
119
122
  pageType,
120
123
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
121
- locale: shopMeta?.localization.country.isoCode ?? null,
124
+ languageIsoCode,
125
+ countryIsoCode,
126
+ locale,
122
127
  swr: {
123
128
  fallback
124
129
  },
@@ -109,13 +109,18 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
109
109
  }
110
110
  ]
111
111
  };
112
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
113
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
114
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
112
115
  return serializableJson({
113
116
  themeStyle: genCSS(dataBuilder?.pageStyle?.data, mobileOnly),
114
117
  fontStyle,
115
118
  builderData: pageTemplate,
116
119
  pageType,
117
120
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
118
- locale: shopMeta?.localization.country.isoCode ?? null,
121
+ languageIsoCode,
122
+ countryIsoCode,
123
+ locale,
119
124
  swr: {
120
125
  fallback
121
126
  },
@@ -122,13 +122,18 @@ const getStaticPageProps = (fetcher, shopifyFetcher)=>async (slug)=>{
122
122
  }
123
123
  ]
124
124
  };
125
+ const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
126
+ const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
127
+ const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
125
128
  return serializableJson({
126
129
  themeStyle: genCSS(dataBuilder?.pageStyle?.data),
127
130
  fontStyle,
128
131
  builderData: pageTemplate,
129
132
  pageType,
130
133
  currency: shopMeta?.localization.country.currency.isoCode ?? null,
131
- locale: shopMeta?.localization.country.isoCode ?? null,
134
+ languageIsoCode,
135
+ countryIsoCode,
136
+ locale,
132
137
  swr: {
133
138
  fallback
134
139
  },
@@ -4,10 +4,9 @@ import { NextSeo } from 'next-seo';
4
4
  import Head from 'next/head';
5
5
  import { useState, useEffect } from 'react';
6
6
  import Toolbox from '../components/builder/Toolbox.js';
7
- import dynamic from 'next/dynamic';
7
+ import Header from '../components/Header.js';
8
+ import Footer from '../components/Footer.js';
8
9
 
9
- const Header = dynamic(()=>import('../components/Header.js'));
10
- const Footer = dynamic(()=>import('../components/Footer.js'));
11
10
  const BuilderPage = ({ components , seo , themeStyle , fontStyle , sectionData })=>{
12
11
  const [loadSuccess, setLoadSuccess] = useState(false);
13
12
  const initState = {
@@ -21,6 +21,8 @@ type PageBuilderProps = {
21
21
  pageHandle?: string | null;
22
22
  currency?: string | null;
23
23
  locale?: string | null;
24
+ languageIsoCode?: string | null;
25
+ countryIsoCode?: string | null;
24
26
  favicon?: string | null;
25
27
  mobileOnly?: boolean | null;
26
28
  swatches?: any[] | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.5.23",
3
+ "version": "1.5.36",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@sentry/nextjs": "7.21.1",
23
23
  "deepmerge": "4.3.0",
24
- "html-react-parser": "^3.0.8",
24
+ "html-react-parser": "3.0.9",
25
25
  "next-seo": "^5.15.0"
26
26
  },
27
27
  "devDependencies": {