@gem-sdk/pages 2.0.0-dev.173 → 2.0.0-dev.184

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.
@@ -122,7 +122,7 @@ const Header = (props)=>{
122
122
  })
123
123
  ]
124
124
  }),
125
- !isOriginTemplate && /*#__PURE__*/ jsxRuntime.jsx("button", {
125
+ !(isOriginTemplate || pageType === 'STATIC') && /*#__PURE__*/ jsxRuntime.jsx("button", {
126
126
  className: "gp-header gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#f4f4f4] group-hover:gp-visible",
127
127
  onClick: openPageSetting,
128
128
  children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
@@ -11,7 +11,7 @@ const MainLayout = ({ children, ...props })=>{
11
11
  const mobileOnly = core.useShopStore((s)=>s.mobileOnly);
12
12
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
13
13
  children: [
14
- parseHtml.parseHtml(props?.customCodeBody),
14
+ parseHtml.parseHtml('custom-code-body', props?.customCodeBody),
15
15
  /*#__PURE__*/ jsxRuntime.jsx("div", {
16
16
  className: core.cls({
17
17
  'gp-max-w-mobile gp-mx-auto gp-w-full': mobileOnly
@@ -45,7 +45,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
45
45
  getFallback.getFallbackV2(fetcher, pageTemplate),
46
46
  customFonts.getCustomFonts(themePageCustomFonts)
47
47
  ]);
48
- const mobileOnly = dataBuilder.isMobile ?? false;
48
+ const mobileOnly = !!dataBuilder.isMobile;
49
49
  const description = dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
50
50
  const thumbnail = parseJson.parseJson(dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
51
51
  const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
@@ -119,15 +119,15 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
119
119
  };
120
120
  const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
121
121
  const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
122
- const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
122
+ const locale = languageIsoCode && countryIsoCode ? `${languageIsoCode}-${countryIsoCode}` : null;
123
123
  return parseJson.serializableJson({
124
124
  themeStyle: genCss.genCSS(dataBuilder?.themeStyle?.data, mobileOnly),
125
125
  fontStyle,
126
126
  elementFontStyle,
127
127
  builderData: pageTemplate,
128
128
  pageType,
129
- moneyFormat: shopMeta?.shop.moneyFormat ?? null,
130
- currency: shopMeta?.localization.country.currency.isoCode ?? null,
129
+ moneyFormat: shopMeta?.shop?.moneyFormat ?? null,
130
+ currency: shopMeta?.localization?.country?.currency?.isoCode ?? null,
131
131
  languageIsoCode,
132
132
  countryIsoCode,
133
133
  locale,
@@ -143,7 +143,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
143
143
  customCodeHeader: dataBuilder.customCode?.header ?? null,
144
144
  customCodeBody: dataBuilder.customCode?.body ?? null,
145
145
  customFonts: customFonts$1,
146
- pageBackground: normalize.extractPageBackground(dataBuilder)
146
+ pageBackground: normalize.extractPageBackground(dataBuilder),
147
+ interaction: dataBuilder?.interaction
147
148
  });
148
149
  } catch (err) {
149
150
  nextjs.captureException(err);
@@ -2,35 +2,27 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var parse = require('html-react-parser');
5
- var Script = require('next/script');
6
5
 
7
- const parseHtml = (html, isHead)=>{
6
+ const parseHtml = (key, html, isHead)=>{
8
7
  if (!html) return undefined;
9
8
  try {
10
9
  return parse(html, {
11
10
  replace: (node)=>{
12
- if (node.type === 'script' && node instanceof parse.Element) {
13
- const child = node.children?.[0];
14
- if (child instanceof parse.Text) {
15
- if (isHead) return /*#__PURE__*/ jsxRuntime.jsx("script", {
16
- ...node.attribs,
17
- dangerouslySetInnerHTML: {
18
- __html: child.data
19
- }
20
- });
21
- else return /*#__PURE__*/ jsxRuntime.jsx(Script, {
22
- ...node.attribs,
23
- dangerouslySetInnerHTML: {
24
- __html: child.data
25
- }
26
- });
27
- } else {
28
- if (!isHead) {
29
- return /*#__PURE__*/ jsxRuntime.jsx(Script, {
30
- ...node.attribs
31
- });
11
+ if (node.type !== 'script' || !(node instanceof parse.Element)) return null;
12
+ const child = node.children?.[0];
13
+ if (!child) return null;
14
+ if (!(child instanceof parse.Text) && !isHead) return /*#__PURE__*/ jsxRuntime.jsx("script", {
15
+ id: key,
16
+ ...node.attribs
17
+ }, key);
18
+ if (child instanceof parse.Text && isHead) {
19
+ return /*#__PURE__*/ jsxRuntime.jsx("script", {
20
+ id: key,
21
+ ...node.attribs,
22
+ dangerouslySetInnerHTML: {
23
+ __html: child.data
32
24
  }
33
- }
25
+ }, key);
34
26
  }
35
27
  }
36
28
  });
@@ -3,6 +3,8 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var core = require('@gem-sdk/core');
6
+ var nextSeo = require('next-seo');
7
+ var Head = require('next/head');
6
8
  var react = require('react');
7
9
  var Toolbox = require('../components/builder/Toolbox.js');
8
10
  var Header = require('../components/builder/Header.js');
@@ -14,7 +16,7 @@ var Toolbar = require('../components/builder/Toolbar.js');
14
16
  var SwitchView = require('../components/builder/SwitchView.js');
15
17
  var Body = require('../components/builder/Body.js');
16
18
 
17
- const BuilderPage = ({ components, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
19
+ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
18
20
  const [loadSuccess, setLoadSuccess] = react.useState(false);
19
21
  const isDisableHeaderFooter = ()=>{
20
22
  return isThemeSectionEditor;
@@ -37,19 +39,26 @@ const BuilderPage = ({ components, themeStyle, fontStyle, sectionData, pageType,
37
39
  };
38
40
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
39
41
  children: [
40
- themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
41
- type: "text/css",
42
- id: "global-style",
43
- dangerouslySetInnerHTML: {
44
- __html: themeStyle
45
- }
42
+ /*#__PURE__*/ jsxRuntime.jsx(nextSeo.NextSeo, {
43
+ ...seo
46
44
  }),
47
- fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
48
- "data-id": "google-fonts",
49
- type: "text/css",
50
- dangerouslySetInnerHTML: {
51
- __html: fontStyle
52
- }
45
+ /*#__PURE__*/ jsxRuntime.jsxs(Head, {
46
+ children: [
47
+ themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
48
+ type: "text/css",
49
+ id: "global-style",
50
+ dangerouslySetInnerHTML: {
51
+ __html: themeStyle
52
+ }
53
+ }),
54
+ fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
55
+ "data-id": "google-fonts",
56
+ type: "text/css",
57
+ dangerouslySetInnerHTML: {
58
+ __html: fontStyle
59
+ }
60
+ })
61
+ ]
53
62
  }),
54
63
  /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
55
64
  children: /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
@@ -5,43 +5,53 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var core = require('@gem-sdk/core');
8
+ var nextSeo = require('next-seo');
8
9
  var dynamic = require('next/dynamic');
9
- var react = require('react');
10
+ var Head = require('next/head');
11
+ var router = require('next/router');
10
12
 
11
13
  const CollectionProvider = dynamic(()=>import('@gem-sdk/core').then((m)=>m.CollectionProvider));
12
- const CollectionDetailPage = ({ components, builderData, sectionData, themeStyle, collection, fontStyle })=>{
14
+ const CollectionDetailPage = ({ seo, components, builderData, sectionData, themeStyle, collection, fontStyle })=>{
15
+ const router$1 = router.useRouter();
16
+ if (router$1.isFallback) {
17
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
18
+ children: "Loading..."
19
+ });
20
+ }
13
21
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
14
22
  children: [
15
- themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
16
- "data-id": "global-style",
17
- type: "text/css",
18
- dangerouslySetInnerHTML: {
19
- __html: themeStyle
20
- }
23
+ /*#__PURE__*/ jsxRuntime.jsx(nextSeo.NextSeo, {
24
+ ...seo
21
25
  }),
22
- fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
23
- "data-id": "google-fonts",
24
- type: "text/css",
25
- dangerouslySetInnerHTML: {
26
- __html: fontStyle
27
- }
26
+ /*#__PURE__*/ jsxRuntime.jsxs(Head, {
27
+ children: [
28
+ themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
29
+ "data-id": "global-style",
30
+ type: "text/css",
31
+ dangerouslySetInnerHTML: {
32
+ __html: themeStyle
33
+ }
34
+ }),
35
+ fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
36
+ "data-id": "google-fonts",
37
+ type: "text/css",
38
+ dangerouslySetInnerHTML: {
39
+ __html: fontStyle
40
+ }
41
+ })
42
+ ]
28
43
  }),
29
- /*#__PURE__*/ jsxRuntime.jsx(react.Suspense, {
30
- fallback: /*#__PURE__*/ jsxRuntime.jsx("div", {
31
- children: "Loading..."
32
- }),
33
- children: /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
34
- children: /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
35
- components: components,
36
- children: /*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
37
- data: sectionData,
38
- children: /*#__PURE__*/ jsxRuntime.jsx(CollectionProvider, {
39
- collection: collection,
40
- children: builderData && /*#__PURE__*/ jsxRuntime.jsx(core.BuilderProvider, {
41
- state: builderData,
42
- children: /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
43
- uid: "ROOT"
44
- })
44
+ /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
45
+ children: /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
46
+ components: components,
47
+ children: /*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
48
+ data: sectionData,
49
+ children: /*#__PURE__*/ jsxRuntime.jsx(CollectionProvider, {
50
+ collection: collection,
51
+ children: builderData && /*#__PURE__*/ jsxRuntime.jsx(core.BuilderProvider, {
52
+ state: builderData,
53
+ children: /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
54
+ uid: "ROOT"
45
55
  })
46
56
  })
47
57
  })
@@ -5,29 +5,41 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var core = require('@gem-sdk/core');
8
+ var nextSeo = require('next-seo');
8
9
  var dynamic = require('next/dynamic');
9
- var react = require('react');
10
+ var Head = require('next/head');
11
+ var router = require('next/router');
10
12
 
11
13
  const ProductProvider = dynamic(()=>import('@gem-sdk/core').then((m)=>m.ProductProvider));
12
- const ProductDetailPage = ({ themeStyle, fontStyle, product, components, builderData, sectionData })=>{
13
- return /*#__PURE__*/ jsxRuntime.jsxs(react.Suspense, {
14
- fallback: /*#__PURE__*/ jsxRuntime.jsx("div", {
14
+ const ProductDetailPage = ({ themeStyle, fontStyle, seo, product, components, builderData, sectionData })=>{
15
+ const router$1 = router.useRouter();
16
+ if (router$1.isFallback) {
17
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
15
18
  children: "Loading..."
16
- }),
19
+ });
20
+ }
21
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
17
22
  children: [
18
- themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
19
- "data-id": "global-style",
20
- type: "text/css",
21
- dangerouslySetInnerHTML: {
22
- __html: themeStyle
23
- }
23
+ /*#__PURE__*/ jsxRuntime.jsx(nextSeo.NextSeo, {
24
+ ...seo
24
25
  }),
25
- fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
26
- "data-id": "google-fonts",
27
- type: "text/css",
28
- dangerouslySetInnerHTML: {
29
- __html: fontStyle
30
- }
26
+ /*#__PURE__*/ jsxRuntime.jsxs(Head, {
27
+ children: [
28
+ themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
29
+ "data-id": "global-style",
30
+ type: "text/css",
31
+ dangerouslySetInnerHTML: {
32
+ __html: themeStyle
33
+ }
34
+ }),
35
+ fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
36
+ "data-id": "google-fonts",
37
+ type: "text/css",
38
+ dangerouslySetInnerHTML: {
39
+ __html: fontStyle
40
+ }
41
+ })
42
+ ]
31
43
  }),
32
44
  /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
33
45
  children: /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
@@ -3,53 +3,94 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var core = require('@gem-sdk/core');
6
+ var nextSeo = require('next-seo');
7
+ var Head = require('next/head');
8
+ var router = require('next/router');
6
9
  var useTrackingView = require('../libs/hooks/use-tracking-view.js');
7
10
  var parseHtml = require('../libs/parse-html.js');
8
11
  var Header = require('../components/builder/Header.js');
9
12
  var FooterForPostPurchase = require('../components/FooterForPostPurchase.js');
10
13
  var Script = require('next/script');
14
+ var react = require('react');
11
15
 
12
- const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction, pageBackground })=>{
16
+ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction, pageBackground })=>{
17
+ const router$1 = router.useRouter();
13
18
  const baseAssetURL = process.env.NEXT_GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
14
- useTrackingView.useTrackingView(shopToken, pageHandle);
19
+ useTrackingView.useTrackingView(shopToken, pageHandle, router$1.isFallback);
20
+ const customCodeHeaderID = 'custom-code-header';
21
+ react.useEffect(()=>{
22
+ const customCodeHeaderElement = document.querySelectorAll(`#${customCodeHeaderID}`);
23
+ if (customCodeHeaderElement.length > 1) {
24
+ customCodeHeaderElement.forEach((script, index)=>{
25
+ if (index !== 0) script.remove();
26
+ });
27
+ }
28
+ }, []);
29
+ if (router$1.isFallback) {
30
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
31
+ className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
32
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
33
+ className: "gp-flex gp-gap-2",
34
+ children: [
35
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
36
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
37
+ }),
38
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
39
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
40
+ }),
41
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
42
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
43
+ })
44
+ ]
45
+ })
46
+ });
47
+ }
48
+ const hasInteraction = (interaction?.value || []).length > 0;
15
49
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
16
50
  children: [
17
- parseHtml.parseHtml(customCodeHeader),
18
- themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
19
- "data-id": "global-style",
20
- type: "text/css",
21
- dangerouslySetInnerHTML: {
22
- __html: themeStyle
23
- }
51
+ /*#__PURE__*/ jsxRuntime.jsx(nextSeo.NextSeo, {
52
+ ...seo
24
53
  }),
25
- fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
26
- "data-id": "google-fonts",
27
- type: "text/css",
28
- dangerouslySetInnerHTML: {
29
- __html: fontStyle
30
- }
54
+ /*#__PURE__*/ jsxRuntime.jsxs(Head, {
55
+ children: [
56
+ parseHtml.parseHtml(customCodeHeaderID, customCodeHeader, true),
57
+ themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
58
+ "data-id": "global-style",
59
+ type: "text/css",
60
+ dangerouslySetInnerHTML: {
61
+ __html: themeStyle
62
+ }
63
+ }, "global-style"),
64
+ fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
65
+ "data-id": "google-fonts",
66
+ type: "text/css",
67
+ dangerouslySetInnerHTML: {
68
+ __html: fontStyle
69
+ }
70
+ }, "google-fonts"),
71
+ elementFontStyle && elementFontStyle.map((fontStyle)=>/*#__PURE__*/ jsxRuntime.jsx("style", {
72
+ "data-id": "google-element-fonts",
73
+ type: "text/css",
74
+ dangerouslySetInnerHTML: {
75
+ __html: fontStyle
76
+ }
77
+ }, fontStyle)),
78
+ customFonts && /*#__PURE__*/ jsxRuntime.jsx("style", {
79
+ "data-id": "custom-element-fonts",
80
+ type: "text/css",
81
+ dangerouslySetInnerHTML: {
82
+ __html: customFonts
83
+ }
84
+ }, fontStyle),
85
+ pageBackground?.isUsePageBackground && pageBackground?.background && /*#__PURE__*/ jsxRuntime.jsx("style", {
86
+ children: `
87
+ body {
88
+ background: ${pageBackground.background};
89
+ }
90
+ `
91
+ }, `page_background_${pageBackground?.background}`)
92
+ ]
31
93
  }),
32
- elementFontStyle && elementFontStyle.map((fontStyle)=>/*#__PURE__*/ jsxRuntime.jsx("style", {
33
- "data-id": "google-element-fonts",
34
- type: "text/css",
35
- dangerouslySetInnerHTML: {
36
- __html: fontStyle
37
- }
38
- }, fontStyle)),
39
- customFonts && /*#__PURE__*/ jsxRuntime.jsx("style", {
40
- "data-id": "custom-element-fonts",
41
- type: "text/css",
42
- dangerouslySetInnerHTML: {
43
- __html: customFonts
44
- }
45
- }, fontStyle),
46
- pageBackground?.isUsePageBackground && pageBackground?.background && /*#__PURE__*/ jsxRuntime.jsx("style", {
47
- children: `
48
- body {
49
- background: ${pageBackground.background};
50
- }
51
- `
52
- }, `page_background_${pageBackground?.background}`),
53
94
  /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
54
95
  productOffers: productOffers,
55
96
  publicStoreFrontData: publicStoreFrontData,
@@ -61,7 +102,7 @@ const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontSt
61
102
  isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(Header.default, {
62
103
  pageType: "POST_PURCHASE"
63
104
  }),
64
- /*#__PURE__*/ jsxRuntime.jsx("div", {
105
+ hasInteraction && /*#__PURE__*/ jsxRuntime.jsx("div", {
65
106
  dangerouslySetInnerHTML: {
66
107
  __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
67
108
  }
@@ -78,9 +119,8 @@ const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontSt
78
119
  /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
79
120
  uid: builder.uid
80
121
  }),
81
- /*#__PURE__*/ jsxRuntime.jsx(Script, {
122
+ hasInteraction && /*#__PURE__*/ jsxRuntime.jsx(Script, {
82
123
  defer: true,
83
- strategy: "lazyOnload",
84
124
  src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
85
125
  })
86
126
  ]
@@ -5,42 +5,53 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var core = require('@gem-sdk/core');
8
- var react = require('react');
8
+ var nextSeo = require('next-seo');
9
+ var Head = require('next/head');
10
+ var router = require('next/router');
9
11
 
10
- const StaticPage = ({ components, builderData, sectionData, themeStyle, fontStyle })=>{
11
- const fallbackContent = /*#__PURE__*/ jsxRuntime.jsx("div", {
12
- className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
13
- children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
14
- className: "gp-flex gp-gap-2",
15
- children: [
16
- /*#__PURE__*/ jsxRuntime.jsx("span", {
17
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
18
- }),
19
- /*#__PURE__*/ jsxRuntime.jsx("span", {
20
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
21
- }),
22
- /*#__PURE__*/ jsxRuntime.jsx("span", {
23
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
24
- })
25
- ]
26
- })
27
- });
28
- return /*#__PURE__*/ jsxRuntime.jsxs(react.Suspense, {
29
- fallback: fallbackContent,
12
+ const StaticPage = ({ components, builderData, sectionData, seo, themeStyle, fontStyle })=>{
13
+ const router$1 = router.useRouter();
14
+ if (router$1.isFallback) {
15
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
16
+ className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
17
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
18
+ className: "gp-flex gp-gap-2",
19
+ children: [
20
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
21
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
22
+ }),
23
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
24
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
25
+ }),
26
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
27
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
28
+ })
29
+ ]
30
+ })
31
+ });
32
+ }
33
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
30
34
  children: [
31
- themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
32
- "data-id": "global-style",
33
- type: "text/css",
34
- dangerouslySetInnerHTML: {
35
- __html: themeStyle
36
- }
35
+ /*#__PURE__*/ jsxRuntime.jsx(nextSeo.NextSeo, {
36
+ ...seo
37
37
  }),
38
- fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
39
- "data-id": "google-fonts",
40
- type: "text/css",
41
- dangerouslySetInnerHTML: {
42
- __html: fontStyle
43
- }
38
+ /*#__PURE__*/ jsxRuntime.jsxs(Head, {
39
+ children: [
40
+ themeStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
41
+ "data-id": "global-style",
42
+ type: "text/css",
43
+ dangerouslySetInnerHTML: {
44
+ __html: themeStyle
45
+ }
46
+ }),
47
+ fontStyle && /*#__PURE__*/ jsxRuntime.jsx("style", {
48
+ "data-id": "google-fonts",
49
+ type: "text/css",
50
+ dangerouslySetInnerHTML: {
51
+ __html: fontStyle
52
+ }
53
+ })
54
+ ]
44
55
  }),
45
56
  /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
46
57
  children: /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
@@ -118,7 +118,7 @@ const Header = (props)=>{
118
118
  })
119
119
  ]
120
120
  }),
121
- !isOriginTemplate && /*#__PURE__*/ jsx("button", {
121
+ !(isOriginTemplate || pageType === 'STATIC') && /*#__PURE__*/ jsx("button", {
122
122
  className: "gp-header gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#f4f4f4] group-hover:gp-visible",
123
123
  onClick: openPageSetting,
124
124
  children: /*#__PURE__*/ jsxs("div", {
@@ -7,7 +7,7 @@ const MainLayout = ({ children, ...props })=>{
7
7
  const mobileOnly = useShopStore((s)=>s.mobileOnly);
8
8
  return /*#__PURE__*/ jsxs(Fragment, {
9
9
  children: [
10
- parseHtml(props?.customCodeBody),
10
+ parseHtml('custom-code-body', props?.customCodeBody),
11
11
  /*#__PURE__*/ jsx("div", {
12
12
  className: cls({
13
13
  'gp-max-w-mobile gp-mx-auto gp-w-full': mobileOnly
@@ -43,7 +43,7 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
43
43
  getFallbackV2(fetcher, pageTemplate),
44
44
  getCustomFonts(themePageCustomFonts)
45
45
  ]);
46
- const mobileOnly = dataBuilder.isMobile ?? false;
46
+ const mobileOnly = !!dataBuilder.isMobile;
47
47
  const description = dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
48
48
  const thumbnail = parseJson(dataBuilder?.dataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
49
49
  const shopMeta = shopifyMeta.status === 'fulfilled' ? shopifyMeta.value : undefined;
@@ -117,15 +117,15 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
117
117
  };
118
118
  const languageIsoCode = shopMeta?.localization.language.isoCode ?? null;
119
119
  const countryIsoCode = shopMeta?.localization.country.isoCode ?? null;
120
- const locale = !languageIsoCode || !countryIsoCode ? null : `${languageIsoCode}-${countryIsoCode}`;
120
+ const locale = languageIsoCode && countryIsoCode ? `${languageIsoCode}-${countryIsoCode}` : null;
121
121
  return serializableJson({
122
122
  themeStyle: genCSS(dataBuilder?.themeStyle?.data, mobileOnly),
123
123
  fontStyle,
124
124
  elementFontStyle,
125
125
  builderData: pageTemplate,
126
126
  pageType,
127
- moneyFormat: shopMeta?.shop.moneyFormat ?? null,
128
- currency: shopMeta?.localization.country.currency.isoCode ?? null,
127
+ moneyFormat: shopMeta?.shop?.moneyFormat ?? null,
128
+ currency: shopMeta?.localization?.country?.currency?.isoCode ?? null,
129
129
  languageIsoCode,
130
130
  countryIsoCode,
131
131
  locale,
@@ -141,7 +141,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
141
141
  customCodeHeader: dataBuilder.customCode?.header ?? null,
142
142
  customCodeBody: dataBuilder.customCode?.body ?? null,
143
143
  customFonts,
144
- pageBackground: extractPageBackground(dataBuilder)
144
+ pageBackground: extractPageBackground(dataBuilder),
145
+ interaction: dataBuilder?.interaction
145
146
  });
146
147
  } catch (err) {
147
148
  captureException(err);
@@ -1,34 +1,26 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import parse, { Element, Text } from 'html-react-parser';
3
- import Script from 'next/script';
4
3
 
5
- const parseHtml = (html, isHead)=>{
4
+ const parseHtml = (key, html, isHead)=>{
6
5
  if (!html) return undefined;
7
6
  try {
8
7
  return parse(html, {
9
8
  replace: (node)=>{
10
- if (node.type === 'script' && node instanceof Element) {
11
- const child = node.children?.[0];
12
- if (child instanceof Text) {
13
- if (isHead) return /*#__PURE__*/ jsx("script", {
14
- ...node.attribs,
15
- dangerouslySetInnerHTML: {
16
- __html: child.data
17
- }
18
- });
19
- else return /*#__PURE__*/ jsx(Script, {
20
- ...node.attribs,
21
- dangerouslySetInnerHTML: {
22
- __html: child.data
23
- }
24
- });
25
- } else {
26
- if (!isHead) {
27
- return /*#__PURE__*/ jsx(Script, {
28
- ...node.attribs
29
- });
9
+ if (node.type !== 'script' || !(node instanceof Element)) return null;
10
+ const child = node.children?.[0];
11
+ if (!child) return null;
12
+ if (!(child instanceof Text) && !isHead) return /*#__PURE__*/ jsx("script", {
13
+ id: key,
14
+ ...node.attribs
15
+ }, key);
16
+ if (child instanceof Text && isHead) {
17
+ return /*#__PURE__*/ jsx("script", {
18
+ id: key,
19
+ ...node.attribs,
20
+ dangerouslySetInnerHTML: {
21
+ __html: child.data
30
22
  }
31
- }
23
+ }, key);
32
24
  }
33
25
  }
34
26
  });
@@ -1,6 +1,8 @@
1
1
  'use client';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderPreviewProvider } from '@gem-sdk/core';
4
+ import { NextSeo } from 'next-seo';
5
+ import Head from 'next/head';
4
6
  import { useState, useMemo, useEffect } from 'react';
5
7
  import Toolbox from '../components/builder/Toolbox.js';
6
8
  import Header from '../components/builder/Header.js';
@@ -12,7 +14,7 @@ import Toolbar from '../components/builder/Toolbar.js';
12
14
  import Devices from '../components/builder/SwitchView.js';
13
15
  import Body from '../components/builder/Body.js';
14
16
 
15
- const BuilderPage = ({ components, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
17
+ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
16
18
  const [loadSuccess, setLoadSuccess] = useState(false);
17
19
  const isDisableHeaderFooter = ()=>{
18
20
  return isThemeSectionEditor;
@@ -35,19 +37,26 @@ const BuilderPage = ({ components, themeStyle, fontStyle, sectionData, pageType,
35
37
  };
36
38
  return /*#__PURE__*/ jsxs(Fragment, {
37
39
  children: [
38
- themeStyle && /*#__PURE__*/ jsx("style", {
39
- type: "text/css",
40
- id: "global-style",
41
- dangerouslySetInnerHTML: {
42
- __html: themeStyle
43
- }
40
+ /*#__PURE__*/ jsx(NextSeo, {
41
+ ...seo
44
42
  }),
45
- fontStyle && /*#__PURE__*/ jsx("style", {
46
- "data-id": "google-fonts",
47
- type: "text/css",
48
- dangerouslySetInnerHTML: {
49
- __html: fontStyle
50
- }
43
+ /*#__PURE__*/ jsxs(Head, {
44
+ children: [
45
+ themeStyle && /*#__PURE__*/ jsx("style", {
46
+ type: "text/css",
47
+ id: "global-style",
48
+ dangerouslySetInnerHTML: {
49
+ __html: themeStyle
50
+ }
51
+ }),
52
+ fontStyle && /*#__PURE__*/ jsx("style", {
53
+ "data-id": "google-fonts",
54
+ type: "text/css",
55
+ dangerouslySetInnerHTML: {
56
+ __html: fontStyle
57
+ }
58
+ })
59
+ ]
51
60
  }),
52
61
  /*#__PURE__*/ jsx(PageProvider, {
53
62
  children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
@@ -1,43 +1,53 @@
1
1
  'use client';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
4
+ import { NextSeo } from 'next-seo';
4
5
  import dynamic from 'next/dynamic';
5
- import { Suspense } from 'react';
6
+ import Head from 'next/head';
7
+ import { useRouter } from 'next/router';
6
8
 
7
9
  const CollectionProvider = dynamic(()=>import('@gem-sdk/core').then((m)=>m.CollectionProvider));
8
- const CollectionDetailPage = ({ components, builderData, sectionData, themeStyle, collection, fontStyle })=>{
10
+ const CollectionDetailPage = ({ seo, components, builderData, sectionData, themeStyle, collection, fontStyle })=>{
11
+ const router = useRouter();
12
+ if (router.isFallback) {
13
+ return /*#__PURE__*/ jsx("div", {
14
+ children: "Loading..."
15
+ });
16
+ }
9
17
  return /*#__PURE__*/ jsxs(Fragment, {
10
18
  children: [
11
- themeStyle && /*#__PURE__*/ jsx("style", {
12
- "data-id": "global-style",
13
- type: "text/css",
14
- dangerouslySetInnerHTML: {
15
- __html: themeStyle
16
- }
19
+ /*#__PURE__*/ jsx(NextSeo, {
20
+ ...seo
17
21
  }),
18
- fontStyle && /*#__PURE__*/ jsx("style", {
19
- "data-id": "google-fonts",
20
- type: "text/css",
21
- dangerouslySetInnerHTML: {
22
- __html: fontStyle
23
- }
22
+ /*#__PURE__*/ jsxs(Head, {
23
+ children: [
24
+ themeStyle && /*#__PURE__*/ jsx("style", {
25
+ "data-id": "global-style",
26
+ type: "text/css",
27
+ dangerouslySetInnerHTML: {
28
+ __html: themeStyle
29
+ }
30
+ }),
31
+ fontStyle && /*#__PURE__*/ jsx("style", {
32
+ "data-id": "google-fonts",
33
+ type: "text/css",
34
+ dangerouslySetInnerHTML: {
35
+ __html: fontStyle
36
+ }
37
+ })
38
+ ]
24
39
  }),
25
- /*#__PURE__*/ jsx(Suspense, {
26
- fallback: /*#__PURE__*/ jsx("div", {
27
- children: "Loading..."
28
- }),
29
- children: /*#__PURE__*/ jsx(PageProvider, {
30
- children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
31
- components: components,
32
- children: /*#__PURE__*/ jsx(SectionProvider, {
33
- data: sectionData,
34
- children: /*#__PURE__*/ jsx(CollectionProvider, {
35
- collection: collection,
36
- children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
37
- state: builderData,
38
- children: /*#__PURE__*/ jsx(Render, {
39
- uid: "ROOT"
40
- })
40
+ /*#__PURE__*/ jsx(PageProvider, {
41
+ children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
42
+ components: components,
43
+ children: /*#__PURE__*/ jsx(SectionProvider, {
44
+ data: sectionData,
45
+ children: /*#__PURE__*/ jsx(CollectionProvider, {
46
+ collection: collection,
47
+ children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
48
+ state: builderData,
49
+ children: /*#__PURE__*/ jsx(Render, {
50
+ uid: "ROOT"
41
51
  })
42
52
  })
43
53
  })
@@ -1,29 +1,41 @@
1
1
  'use client';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render, AddOn } from '@gem-sdk/core';
4
+ import { NextSeo } from 'next-seo';
4
5
  import dynamic from 'next/dynamic';
5
- import { Suspense } from 'react';
6
+ import Head from 'next/head';
7
+ import { useRouter } from 'next/router';
6
8
 
7
9
  const ProductProvider = dynamic(()=>import('@gem-sdk/core').then((m)=>m.ProductProvider));
8
- const ProductDetailPage = ({ themeStyle, fontStyle, product, components, builderData, sectionData })=>{
9
- return /*#__PURE__*/ jsxs(Suspense, {
10
- fallback: /*#__PURE__*/ jsx("div", {
10
+ const ProductDetailPage = ({ themeStyle, fontStyle, seo, product, components, builderData, sectionData })=>{
11
+ const router = useRouter();
12
+ if (router.isFallback) {
13
+ return /*#__PURE__*/ jsx("div", {
11
14
  children: "Loading..."
12
- }),
15
+ });
16
+ }
17
+ return /*#__PURE__*/ jsxs(Fragment, {
13
18
  children: [
14
- themeStyle && /*#__PURE__*/ jsx("style", {
15
- "data-id": "global-style",
16
- type: "text/css",
17
- dangerouslySetInnerHTML: {
18
- __html: themeStyle
19
- }
19
+ /*#__PURE__*/ jsx(NextSeo, {
20
+ ...seo
20
21
  }),
21
- fontStyle && /*#__PURE__*/ jsx("style", {
22
- "data-id": "google-fonts",
23
- type: "text/css",
24
- dangerouslySetInnerHTML: {
25
- __html: fontStyle
26
- }
22
+ /*#__PURE__*/ jsxs(Head, {
23
+ children: [
24
+ themeStyle && /*#__PURE__*/ jsx("style", {
25
+ "data-id": "global-style",
26
+ type: "text/css",
27
+ dangerouslySetInnerHTML: {
28
+ __html: themeStyle
29
+ }
30
+ }),
31
+ fontStyle && /*#__PURE__*/ jsx("style", {
32
+ "data-id": "google-fonts",
33
+ type: "text/css",
34
+ dangerouslySetInnerHTML: {
35
+ __html: fontStyle
36
+ }
37
+ })
38
+ ]
27
39
  }),
28
40
  /*#__PURE__*/ jsx(PageProvider, {
29
41
  children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
@@ -1,53 +1,94 @@
1
1
  'use client';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
4
+ import { NextSeo } from 'next-seo';
5
+ import Head from 'next/head';
6
+ import { useRouter } from 'next/router';
4
7
  import { useTrackingView } from '../libs/hooks/use-tracking-view.js';
5
8
  import { parseHtml } from '../libs/parse-html.js';
6
9
  import Header from '../components/builder/Header.js';
7
10
  import FooterForPostPurchase from '../components/FooterForPostPurchase.js';
8
11
  import Script from 'next/script';
12
+ import { useEffect } from 'react';
9
13
 
10
- const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction, pageBackground })=>{
14
+ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction, pageBackground })=>{
15
+ const router = useRouter();
11
16
  const baseAssetURL = process.env.NEXT_GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
12
- useTrackingView(shopToken, pageHandle);
17
+ useTrackingView(shopToken, pageHandle, router.isFallback);
18
+ const customCodeHeaderID = 'custom-code-header';
19
+ useEffect(()=>{
20
+ const customCodeHeaderElement = document.querySelectorAll(`#${customCodeHeaderID}`);
21
+ if (customCodeHeaderElement.length > 1) {
22
+ customCodeHeaderElement.forEach((script, index)=>{
23
+ if (index !== 0) script.remove();
24
+ });
25
+ }
26
+ }, []);
27
+ if (router.isFallback) {
28
+ return /*#__PURE__*/ jsx("div", {
29
+ className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
30
+ children: /*#__PURE__*/ jsxs("div", {
31
+ className: "gp-flex gp-gap-2",
32
+ children: [
33
+ /*#__PURE__*/ jsx("span", {
34
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
35
+ }),
36
+ /*#__PURE__*/ jsx("span", {
37
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
38
+ }),
39
+ /*#__PURE__*/ jsx("span", {
40
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
41
+ })
42
+ ]
43
+ })
44
+ });
45
+ }
46
+ const hasInteraction = (interaction?.value || []).length > 0;
13
47
  return /*#__PURE__*/ jsxs(Fragment, {
14
48
  children: [
15
- parseHtml(customCodeHeader),
16
- themeStyle && /*#__PURE__*/ jsx("style", {
17
- "data-id": "global-style",
18
- type: "text/css",
19
- dangerouslySetInnerHTML: {
20
- __html: themeStyle
21
- }
49
+ /*#__PURE__*/ jsx(NextSeo, {
50
+ ...seo
22
51
  }),
23
- fontStyle && /*#__PURE__*/ jsx("style", {
24
- "data-id": "google-fonts",
25
- type: "text/css",
26
- dangerouslySetInnerHTML: {
27
- __html: fontStyle
28
- }
52
+ /*#__PURE__*/ jsxs(Head, {
53
+ children: [
54
+ parseHtml(customCodeHeaderID, customCodeHeader, true),
55
+ themeStyle && /*#__PURE__*/ jsx("style", {
56
+ "data-id": "global-style",
57
+ type: "text/css",
58
+ dangerouslySetInnerHTML: {
59
+ __html: themeStyle
60
+ }
61
+ }, "global-style"),
62
+ fontStyle && /*#__PURE__*/ jsx("style", {
63
+ "data-id": "google-fonts",
64
+ type: "text/css",
65
+ dangerouslySetInnerHTML: {
66
+ __html: fontStyle
67
+ }
68
+ }, "google-fonts"),
69
+ elementFontStyle && elementFontStyle.map((fontStyle)=>/*#__PURE__*/ jsx("style", {
70
+ "data-id": "google-element-fonts",
71
+ type: "text/css",
72
+ dangerouslySetInnerHTML: {
73
+ __html: fontStyle
74
+ }
75
+ }, fontStyle)),
76
+ customFonts && /*#__PURE__*/ jsx("style", {
77
+ "data-id": "custom-element-fonts",
78
+ type: "text/css",
79
+ dangerouslySetInnerHTML: {
80
+ __html: customFonts
81
+ }
82
+ }, fontStyle),
83
+ pageBackground?.isUsePageBackground && pageBackground?.background && /*#__PURE__*/ jsx("style", {
84
+ children: `
85
+ body {
86
+ background: ${pageBackground.background};
87
+ }
88
+ `
89
+ }, `page_background_${pageBackground?.background}`)
90
+ ]
29
91
  }),
30
- elementFontStyle && elementFontStyle.map((fontStyle)=>/*#__PURE__*/ jsx("style", {
31
- "data-id": "google-element-fonts",
32
- type: "text/css",
33
- dangerouslySetInnerHTML: {
34
- __html: fontStyle
35
- }
36
- }, fontStyle)),
37
- customFonts && /*#__PURE__*/ jsx("style", {
38
- "data-id": "custom-element-fonts",
39
- type: "text/css",
40
- dangerouslySetInnerHTML: {
41
- __html: customFonts
42
- }
43
- }, fontStyle),
44
- pageBackground?.isUsePageBackground && pageBackground?.background && /*#__PURE__*/ jsx("style", {
45
- children: `
46
- body {
47
- background: ${pageBackground.background};
48
- }
49
- `
50
- }, `page_background_${pageBackground?.background}`),
51
92
  /*#__PURE__*/ jsx(PageProvider, {
52
93
  productOffers: productOffers,
53
94
  publicStoreFrontData: publicStoreFrontData,
@@ -59,7 +100,7 @@ const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontSt
59
100
  isPostPurchase && /*#__PURE__*/ jsx(Header, {
60
101
  pageType: "POST_PURCHASE"
61
102
  }),
62
- /*#__PURE__*/ jsx("div", {
103
+ hasInteraction && /*#__PURE__*/ jsx("div", {
63
104
  dangerouslySetInnerHTML: {
64
105
  __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
65
106
  }
@@ -76,9 +117,8 @@ const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontSt
76
117
  /*#__PURE__*/ jsx(Render, {
77
118
  uid: builder.uid
78
119
  }),
79
- /*#__PURE__*/ jsx(Script, {
120
+ hasInteraction && /*#__PURE__*/ jsx(Script, {
80
121
  defer: true,
81
- strategy: "lazyOnload",
82
122
  src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
83
123
  })
84
124
  ]
@@ -1,42 +1,53 @@
1
1
  'use client';
2
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
4
- import { Suspense } from 'react';
4
+ import { NextSeo } from 'next-seo';
5
+ import Head from 'next/head';
6
+ import { useRouter } from 'next/router';
5
7
 
6
- const StaticPage = ({ components, builderData, sectionData, themeStyle, fontStyle })=>{
7
- const fallbackContent = /*#__PURE__*/ jsx("div", {
8
- className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
9
- children: /*#__PURE__*/ jsxs("div", {
10
- className: "gp-flex gp-gap-2",
11
- children: [
12
- /*#__PURE__*/ jsx("span", {
13
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
14
- }),
15
- /*#__PURE__*/ jsx("span", {
16
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
17
- }),
18
- /*#__PURE__*/ jsx("span", {
19
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
20
- })
21
- ]
22
- })
23
- });
24
- return /*#__PURE__*/ jsxs(Suspense, {
25
- fallback: fallbackContent,
8
+ const StaticPage = ({ components, builderData, sectionData, seo, themeStyle, fontStyle })=>{
9
+ const router = useRouter();
10
+ if (router.isFallback) {
11
+ return /*#__PURE__*/ jsx("div", {
12
+ className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
13
+ children: /*#__PURE__*/ jsxs("div", {
14
+ className: "gp-flex gp-gap-2",
15
+ children: [
16
+ /*#__PURE__*/ jsx("span", {
17
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
18
+ }),
19
+ /*#__PURE__*/ jsx("span", {
20
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
21
+ }),
22
+ /*#__PURE__*/ jsx("span", {
23
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
24
+ })
25
+ ]
26
+ })
27
+ });
28
+ }
29
+ return /*#__PURE__*/ jsxs(Fragment, {
26
30
  children: [
27
- themeStyle && /*#__PURE__*/ jsx("style", {
28
- "data-id": "global-style",
29
- type: "text/css",
30
- dangerouslySetInnerHTML: {
31
- __html: themeStyle
32
- }
31
+ /*#__PURE__*/ jsx(NextSeo, {
32
+ ...seo
33
33
  }),
34
- fontStyle && /*#__PURE__*/ jsx("style", {
35
- "data-id": "google-fonts",
36
- type: "text/css",
37
- dangerouslySetInnerHTML: {
38
- __html: fontStyle
39
- }
34
+ /*#__PURE__*/ jsxs(Head, {
35
+ children: [
36
+ themeStyle && /*#__PURE__*/ jsx("style", {
37
+ "data-id": "global-style",
38
+ type: "text/css",
39
+ dangerouslySetInnerHTML: {
40
+ __html: themeStyle
41
+ }
42
+ }),
43
+ fontStyle && /*#__PURE__*/ jsx("style", {
44
+ "data-id": "google-fonts",
45
+ type: "text/css",
46
+ dangerouslySetInnerHTML: {
47
+ __html: fontStyle
48
+ }
49
+ })
50
+ ]
40
51
  }),
41
52
  /*#__PURE__*/ jsx(PageProvider, {
42
53
  children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
@@ -41,11 +41,11 @@ type PageBuilderProps = {
41
41
  isStorefront?: boolean;
42
42
  customFonts?: string | null;
43
43
  interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, 'id' | 'value'>>;
44
+ timezone?: string;
44
45
  pageBackground?: {
45
46
  isUsePageBackground?: boolean;
46
47
  background?: string;
47
48
  };
48
- timezone?: string;
49
49
  };
50
50
  type PageBuilderPropsV2 = {
51
51
  builderData?: {
@@ -123,7 +123,7 @@ declare const usePagePreview: (dataBuilder: ThemePageQueryResponse['themePage'],
123
123
  pageConfig: {
124
124
  mobileOnly: boolean;
125
125
  locale: string | null;
126
- languageIsoCode: ("ID" | "LT" | "AF" | "AM" | "AR" | "AZ" | "BE" | "BG" | "BM" | "BN" | "BO" | "BR" | "BS" | "CA" | "CU" | "CY" | "DE" | "DZ" | "EE" | "ES" | "ET" | "FI" | "FO" | "FR" | "GA" | "GD" | "GL" | "HR" | "HU" | "IS" | "IT" | "KI" | "KM" | "KN" | "KW" | "KY" | "LB" | "LU" | "LV" | "MG" | "MK" | "ML" | "MN" | "MR" | "MS" | "MT" | "MY" | "NE" | "NL" | "NO" | "OM" | "PA" | "PL" | "PS" | "PT" | "RO" | "RU" | "RW" | "SD" | "SE" | "SG" | "SI" | "SK" | "SL" | "SN" | "SO" | "SR" | "SV" | "TA" | "TG" | "TH" | "TK" | "TO" | "TR" | "TT" | "UG" | "UZ" | "AK" | "AS" | "CE" | "CS" | "DA" | "EL" | "EN" | "EO" | "EU" | "FA" | "FF" | "FY" | "GU" | "GV" | "HA" | "HE" | "HI" | "HY" | "IA" | "IG" | "II" | "JA" | "JV" | "KA" | "KK" | "KL" | "KO" | "KS" | "KU" | "LG" | "LN" | "LO" | "MI" | "NB" | "ND" | "NN" | "OR" | "OS" | "PT_BR" | "PT_PT" | "QU" | "RM" | "RN" | "SQ" | "SU" | "SW" | "TE" | "TI" | "UK" | "UR" | "VI" | "VO" | "WO" | "XH" | "YI" | "YO" | "ZH" | "ZH_CN" | "ZH_TW" | "ZU") | null;
126
+ languageIsoCode: ("ID" | "LT" | "AF" | "AM" | "AR" | "AZ" | "BE" | "BG" | "BM" | "BN" | "BO" | "BR" | "BS" | "CA" | "CU" | "CY" | "DE" | "DZ" | "EE" | "ES" | "ET" | "FI" | "FO" | "FR" | "GA" | "GD" | "GL" | "HR" | "HU" | "IS" | "IT" | "KI" | "KM" | "KN" | "KW" | "KY" | "LA" | "LB" | "LU" | "LV" | "MG" | "MK" | "ML" | "MN" | "MO" | "MR" | "MS" | "MT" | "MY" | "NE" | "NL" | "NO" | "OM" | "PA" | "PL" | "PS" | "PT" | "RO" | "RU" | "RW" | "SA" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SK" | "SL" | "SN" | "SO" | "SR" | "SV" | "TA" | "TG" | "TH" | "TK" | "TO" | "TR" | "TT" | "UG" | "UZ" | "AK" | "AS" | "CE" | "CKB" | "CS" | "DA" | "EL" | "EN" | "EO" | "EU" | "FA" | "FF" | "FIL" | "FY" | "GU" | "GV" | "HA" | "HE" | "HI" | "HY" | "IA" | "IG" | "II" | "JA" | "JV" | "KA" | "KK" | "KL" | "KO" | "KS" | "KU" | "LG" | "LN" | "LO" | "MI" | "NB" | "ND" | "NN" | "OR" | "OS" | "PT_BR" | "PT_PT" | "QU" | "RM" | "RN" | "SQ" | "SU" | "SW" | "TE" | "TI" | "UK" | "UR" | "VI" | "VO" | "WO" | "XH" | "YI" | "YO" | "ZH" | "ZH_CN" | "ZH_TW" | "ZU") | null;
127
127
  countryIsoCode: ("ID" | "GT" | "LT" | "AC" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AN" | "AO" | "AR" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MK" | "ML" | "MM" | "MN" | "MO" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PS" | "PT" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TA" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ") | null;
128
128
  moneyFormat: string | null;
129
129
  currency: ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BYR" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KID" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VEF" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XXX" | "YER" | "ZAR" | "ZMW") | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.173",
3
+ "version": "2.0.0-dev.184",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,10 +26,10 @@
26
26
  "next": "latest"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.0.0-dev.173",
30
- "@gem-sdk/plugin-cookie-bar": "1.58.0-dev.142",
31
- "@gem-sdk/plugin-quick-view": "1.58.0-dev.142",
32
- "@gem-sdk/plugin-sticky-add-to-cart": "1.58.0-dev.142"
29
+ "@gem-sdk/core": "2.0.0-dev.184",
30
+ "@gem-sdk/plugin-cookie-bar": "2.0.0-dev.184",
31
+ "@gem-sdk/plugin-quick-view": "2.0.0-dev.184",
32
+ "@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.184"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "next": ">=13"