@gem-sdk/pages 1.63.19 → 2.0.0-dev.161

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.
Files changed (76) hide show
  1. package/dist/cjs/components/ErrorBoundary.js +1 -0
  2. package/dist/cjs/components/ErrorFallback.js +1 -0
  3. package/dist/cjs/components/FacebookPixel.js +7 -9
  4. package/dist/cjs/components/FooterForPostPurchase.js +1 -0
  5. package/dist/cjs/components/GoogleAnalytic.js +9 -10
  6. package/dist/cjs/components/TikTokPixel.js +1 -0
  7. package/dist/cjs/components/builder/Body.js +1 -0
  8. package/dist/cjs/components/builder/Footer.js +1 -0
  9. package/dist/cjs/components/builder/Header.js +4 -5
  10. package/dist/cjs/components/builder/PopupManager.js +1 -0
  11. package/dist/cjs/components/builder/SwitchView.js +1 -0
  12. package/dist/cjs/components/builder/Toolbar.js +1 -0
  13. package/dist/cjs/components/builder/Toolbox.js +1 -0
  14. package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +1 -0
  15. package/dist/cjs/components/image-to-layout/DropElement.js +1 -0
  16. package/dist/cjs/components/image-to-layout/ImageToLayout.js +1 -0
  17. package/dist/cjs/index.js +12 -14
  18. package/dist/cjs/layouts/main.js +2 -1
  19. package/dist/cjs/libs/api/get-builder-props.js +7 -2
  20. package/dist/cjs/libs/api/get-post-purchase-props-preview.js +1 -0
  21. package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -6
  22. package/dist/cjs/libs/api/get-static-page-props-v2.js +2 -1
  23. package/dist/cjs/libs/helpers/gen-css.js +1 -1
  24. package/dist/cjs/libs/helpers/normalize.js +9 -0
  25. package/dist/cjs/libs/hooks/use-tracking-view.js +1 -0
  26. package/dist/cjs/libs/parse-html.js +23 -15
  27. package/dist/cjs/pages/404.js +1 -0
  28. package/dist/cjs/pages/500.js +1 -0
  29. package/dist/cjs/pages/CollectionGlobalProvider.js +1 -0
  30. package/dist/cjs/pages/builder.js +14 -22
  31. package/dist/cjs/pages/collection-detail.js +31 -40
  32. package/dist/cjs/pages/preview.js +1 -0
  33. package/dist/cjs/pages/product-detail.js +18 -29
  34. package/dist/cjs/pages/static-v2.js +38 -69
  35. package/dist/cjs/pages/static.js +34 -44
  36. package/dist/esm/components/ErrorBoundary.js +1 -0
  37. package/dist/esm/components/ErrorFallback.js +1 -0
  38. package/dist/esm/components/FacebookPixel.js +7 -9
  39. package/dist/esm/components/FooterForPostPurchase.js +1 -0
  40. package/dist/esm/components/GoogleAnalytic.js +9 -10
  41. package/dist/esm/components/TikTokPixel.js +1 -0
  42. package/dist/esm/components/builder/Body.js +1 -0
  43. package/dist/esm/components/builder/Footer.js +1 -0
  44. package/dist/esm/components/builder/Header.js +4 -5
  45. package/dist/esm/components/builder/PopupManager.js +1 -0
  46. package/dist/esm/components/builder/SwitchView.js +1 -0
  47. package/dist/esm/components/builder/Toolbar.js +1 -0
  48. package/dist/esm/components/builder/Toolbox.js +1 -0
  49. package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +1 -0
  50. package/dist/esm/components/image-to-layout/DropElement.js +1 -0
  51. package/dist/esm/components/image-to-layout/ImageToLayout.js +1 -0
  52. package/dist/esm/index.js +6 -7
  53. package/dist/esm/layouts/main.js +2 -1
  54. package/dist/esm/libs/api/get-builder-props.js +8 -3
  55. package/dist/esm/libs/api/get-post-purchase-props-preview.js +1 -0
  56. package/dist/esm/libs/api/get-static-page-props-preview.js +2 -7
  57. package/dist/esm/libs/api/get-static-page-props-v2.js +3 -2
  58. package/dist/esm/libs/helpers/gen-css.js +1 -1
  59. package/dist/esm/libs/helpers/normalize.js +9 -1
  60. package/dist/esm/libs/hooks/use-tracking-view.js +1 -0
  61. package/dist/esm/libs/parse-html.js +23 -15
  62. package/dist/esm/pages/404.js +1 -0
  63. package/dist/esm/pages/500.js +1 -0
  64. package/dist/esm/pages/CollectionGlobalProvider.js +1 -0
  65. package/dist/esm/pages/builder.js +14 -22
  66. package/dist/esm/pages/collection-detail.js +32 -41
  67. package/dist/esm/pages/preview.js +1 -0
  68. package/dist/esm/pages/product-detail.js +19 -30
  69. package/dist/esm/pages/static-v2.js +39 -70
  70. package/dist/esm/pages/static.js +35 -45
  71. package/dist/types/index.d.ts +37 -34
  72. package/package.json +5 -5
  73. package/dist/cjs/components/builder/InteractionSelectOnPageHeader.js +0 -191
  74. package/dist/cjs/libs/helpers/sentry.js +0 -17
  75. package/dist/esm/components/builder/InteractionSelectOnPageHeader.js +0 -187
  76. package/dist/esm/libs/helpers/sentry.js +0 -15
@@ -81,6 +81,14 @@ const parseBuilderTemplate = (data)=>{
81
81
  ...data?.themePageCustomSections ?? []
82
82
  ], data?.sectionPosition);
83
83
  };
84
+ const extractPageBackground = (data)=>{
85
+ try {
86
+ const pageBackgroundStr = data?.metafields?.find((item)=>item?.key === 'page_background')?.value;
87
+ return JSON.parse(pageBackgroundStr ?? '{}');
88
+ } catch {
89
+ return {};
90
+ }
91
+ };
84
92
  const parseBuilderLibraryTemplate = (data)=>{
85
93
  return normalizePageSectionResponseV2([
86
94
  ...data?.sections ?? []
@@ -92,4 +100,4 @@ const parseShopLibraryPageTemplate = (data)=>{
92
100
  ], data?.sectionPosition);
93
101
  };
94
102
 
95
- export { normalizeBuilderData, normalizePageSectionResponseV2, parseBuilderLibraryTemplate, parseBuilderTemplate, parseBuilderTemplateV2, parseShopLibraryPageTemplate };
103
+ export { extractPageBackground, normalizeBuilderData, normalizePageSectionResponseV2, parseBuilderLibraryTemplate, parseBuilderTemplate, parseBuilderTemplateV2, parseShopLibraryPageTemplate };
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { PageViewUpDocument } from '@gem-sdk/core';
2
3
  import { useCallback, useEffect } from 'react';
3
4
 
@@ -1,26 +1,34 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import parse, { Element, Text } from 'html-react-parser';
3
+ import Script from 'next/script';
3
4
 
4
- const parseHtml = (key, html, isHead)=>{
5
+ const parseHtml = (html, isHead)=>{
5
6
  if (!html) return undefined;
6
7
  try {
7
8
  return parse(html, {
8
9
  replace: (node)=>{
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
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
+ });
22
30
  }
23
- }, key);
31
+ }
24
32
  }
25
33
  }
26
34
  });
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { NextSeo } from 'next-seo';
3
4
  import Image from 'next/image';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { cls } from '@gem-sdk/core';
3
4
  import { NextSeo } from 'next-seo';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
3
  import { useState, useCallback, useEffect } from 'react';
3
4
  import { useCollectionsQuery } from '@gem-sdk/core';
@@ -1,7 +1,6 @@
1
+ 'use client';
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderPreviewProvider } from '@gem-sdk/core';
3
- import { NextSeo } from 'next-seo';
4
- import Head from 'next/head';
5
4
  import { useState, useMemo, useEffect } from 'react';
6
5
  import Toolbox from '../components/builder/Toolbox.js';
7
6
  import Header from '../components/builder/Header.js';
@@ -13,7 +12,7 @@ import Toolbar from '../components/builder/Toolbar.js';
13
12
  import Devices from '../components/builder/SwitchView.js';
14
13
  import Body from '../components/builder/Body.js';
15
14
 
16
- const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
15
+ const BuilderPage = ({ components, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
17
16
  const [loadSuccess, setLoadSuccess] = useState(false);
18
17
  const isDisableHeaderFooter = ()=>{
19
18
  return isThemeSectionEditor;
@@ -36,26 +35,19 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
36
35
  };
37
36
  return /*#__PURE__*/ jsxs(Fragment, {
38
37
  children: [
39
- /*#__PURE__*/ jsx(NextSeo, {
40
- ...seo
38
+ themeStyle && /*#__PURE__*/ jsx("style", {
39
+ type: "text/css",
40
+ id: "global-style",
41
+ dangerouslySetInnerHTML: {
42
+ __html: themeStyle
43
+ }
41
44
  }),
42
- /*#__PURE__*/ jsxs(Head, {
43
- children: [
44
- themeStyle && /*#__PURE__*/ jsx("style", {
45
- type: "text/css",
46
- id: "global-style",
47
- dangerouslySetInnerHTML: {
48
- __html: themeStyle
49
- }
50
- }),
51
- fontStyle && /*#__PURE__*/ jsx("style", {
52
- "data-id": "google-fonts",
53
- type: "text/css",
54
- dangerouslySetInnerHTML: {
55
- __html: fontStyle
56
- }
57
- })
58
- ]
45
+ fontStyle && /*#__PURE__*/ jsx("style", {
46
+ "data-id": "google-fonts",
47
+ type: "text/css",
48
+ dangerouslySetInnerHTML: {
49
+ __html: fontStyle
50
+ }
59
51
  }),
60
52
  /*#__PURE__*/ jsx(PageProvider, {
61
53
  children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
@@ -1,52 +1,43 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ 'use client';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
3
- import { NextSeo } from 'next-seo';
4
4
  import dynamic from 'next/dynamic';
5
- import Head from 'next/head';
6
- import { useRouter } from 'next/router';
5
+ import { Suspense } from 'react';
7
6
 
8
7
  const CollectionProvider = dynamic(()=>import('@gem-sdk/core').then((m)=>m.CollectionProvider));
9
- const CollectionDetailPage = ({ seo, components, builderData, sectionData, themeStyle, collection, fontStyle })=>{
10
- const router = useRouter();
11
- if (router.isFallback) {
12
- return /*#__PURE__*/ jsx("div", {
13
- children: "Loading..."
14
- });
15
- }
8
+ const CollectionDetailPage = ({ components, builderData, sectionData, themeStyle, collection, fontStyle })=>{
16
9
  return /*#__PURE__*/ jsxs(Fragment, {
17
10
  children: [
18
- /*#__PURE__*/ jsx(NextSeo, {
19
- ...seo
11
+ themeStyle && /*#__PURE__*/ jsx("style", {
12
+ "data-id": "global-style",
13
+ type: "text/css",
14
+ dangerouslySetInnerHTML: {
15
+ __html: themeStyle
16
+ }
20
17
  }),
21
- /*#__PURE__*/ jsxs(Head, {
22
- children: [
23
- themeStyle && /*#__PURE__*/ jsx("style", {
24
- "data-id": "global-style",
25
- type: "text/css",
26
- dangerouslySetInnerHTML: {
27
- __html: themeStyle
28
- }
29
- }),
30
- fontStyle && /*#__PURE__*/ jsx("style", {
31
- "data-id": "google-fonts",
32
- type: "text/css",
33
- dangerouslySetInnerHTML: {
34
- __html: fontStyle
35
- }
36
- })
37
- ]
18
+ fontStyle && /*#__PURE__*/ jsx("style", {
19
+ "data-id": "google-fonts",
20
+ type: "text/css",
21
+ dangerouslySetInnerHTML: {
22
+ __html: fontStyle
23
+ }
38
24
  }),
39
- /*#__PURE__*/ jsx(PageProvider, {
40
- children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
41
- components: components,
42
- children: /*#__PURE__*/ jsx(SectionProvider, {
43
- data: sectionData,
44
- children: /*#__PURE__*/ jsx(CollectionProvider, {
45
- collection: collection,
46
- children: builderData && /*#__PURE__*/ jsx(BuilderProvider, {
47
- state: builderData,
48
- children: /*#__PURE__*/ jsx(Render, {
49
- uid: "ROOT"
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
+ })
50
41
  })
51
42
  })
52
43
  })
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import dynamic from 'next/dynamic';
3
4
 
@@ -1,40 +1,29 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render, AddOn } from '@gem-sdk/core';
3
- import { NextSeo } from 'next-seo';
4
4
  import dynamic from 'next/dynamic';
5
- import Head from 'next/head';
6
- import { useRouter } from 'next/router';
5
+ import { Suspense } from 'react';
7
6
 
8
7
  const ProductProvider = dynamic(()=>import('@gem-sdk/core').then((m)=>m.ProductProvider));
9
- const ProductDetailPage = ({ themeStyle, fontStyle, seo, product, components, builderData, sectionData })=>{
10
- const router = useRouter();
11
- if (router.isFallback) {
12
- return /*#__PURE__*/ jsx("div", {
8
+ const ProductDetailPage = ({ themeStyle, fontStyle, product, components, builderData, sectionData })=>{
9
+ return /*#__PURE__*/ jsxs(Suspense, {
10
+ fallback: /*#__PURE__*/ jsx("div", {
13
11
  children: "Loading..."
14
- });
15
- }
16
- return /*#__PURE__*/ jsxs(Fragment, {
12
+ }),
17
13
  children: [
18
- /*#__PURE__*/ jsx(NextSeo, {
19
- ...seo
14
+ themeStyle && /*#__PURE__*/ jsx("style", {
15
+ "data-id": "global-style",
16
+ type: "text/css",
17
+ dangerouslySetInnerHTML: {
18
+ __html: themeStyle
19
+ }
20
20
  }),
21
- /*#__PURE__*/ jsxs(Head, {
22
- children: [
23
- themeStyle && /*#__PURE__*/ jsx("style", {
24
- "data-id": "global-style",
25
- type: "text/css",
26
- dangerouslySetInnerHTML: {
27
- __html: themeStyle
28
- }
29
- }),
30
- fontStyle && /*#__PURE__*/ jsx("style", {
31
- "data-id": "google-fonts",
32
- type: "text/css",
33
- dangerouslySetInnerHTML: {
34
- __html: fontStyle
35
- }
36
- })
37
- ]
21
+ fontStyle && /*#__PURE__*/ jsx("style", {
22
+ "data-id": "google-fonts",
23
+ type: "text/css",
24
+ dangerouslySetInnerHTML: {
25
+ __html: fontStyle
26
+ }
38
27
  }),
39
28
  /*#__PURE__*/ jsx(PageProvider, {
40
29
  children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
@@ -1,85 +1,53 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ 'use client';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
3
- import { NextSeo } from 'next-seo';
4
- import Head from 'next/head';
5
- import { useRouter } from 'next/router';
6
4
  import { useTrackingView } from '../libs/hooks/use-tracking-view.js';
7
5
  import { parseHtml } from '../libs/parse-html.js';
8
6
  import Header from '../components/builder/Header.js';
9
7
  import FooterForPostPurchase from '../components/FooterForPostPurchase.js';
10
8
  import Script from 'next/script';
11
- import { useEffect } from 'react';
12
9
 
13
- const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction })=>{
14
- const router = useRouter();
10
+ const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction, pageBackground })=>{
15
11
  const baseAssetURL = process.env.NEXT_GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
16
- useTrackingView(shopToken, pageHandle, router.isFallback);
17
- const customCodeHeaderID = 'custom-code-header';
18
- useEffect(()=>{
19
- const customCodeHeaderElement = document.querySelectorAll(`#${customCodeHeaderID}`);
20
- if (customCodeHeaderElement.length > 1) {
21
- customCodeHeaderElement.forEach((script, index)=>{
22
- if (index !== 0) script.remove();
23
- });
24
- }
25
- }, []);
26
- if (router.isFallback) {
27
- return /*#__PURE__*/ jsx("div", {
28
- className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
29
- children: /*#__PURE__*/ jsxs("div", {
30
- className: "gp-flex gp-gap-2",
31
- children: [
32
- /*#__PURE__*/ jsx("span", {
33
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
34
- }),
35
- /*#__PURE__*/ jsx("span", {
36
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
37
- }),
38
- /*#__PURE__*/ jsx("span", {
39
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
40
- })
41
- ]
42
- })
43
- });
44
- }
12
+ useTrackingView(shopToken, pageHandle);
45
13
  return /*#__PURE__*/ jsxs(Fragment, {
46
14
  children: [
47
- /*#__PURE__*/ jsx(NextSeo, {
48
- ...seo
15
+ parseHtml(customCodeHeader),
16
+ themeStyle && /*#__PURE__*/ jsx("style", {
17
+ "data-id": "global-style",
18
+ type: "text/css",
19
+ dangerouslySetInnerHTML: {
20
+ __html: themeStyle
21
+ }
49
22
  }),
50
- /*#__PURE__*/ jsxs(Head, {
51
- children: [
52
- parseHtml(customCodeHeaderID, customCodeHeader, true),
53
- themeStyle && /*#__PURE__*/ jsx("style", {
54
- "data-id": "global-style",
55
- type: "text/css",
56
- dangerouslySetInnerHTML: {
57
- __html: themeStyle
58
- }
59
- }, "global-style"),
60
- fontStyle && /*#__PURE__*/ jsx("style", {
61
- "data-id": "google-fonts",
62
- type: "text/css",
63
- dangerouslySetInnerHTML: {
64
- __html: fontStyle
65
- }
66
- }, "google-fonts"),
67
- elementFontStyle && elementFontStyle.map((fontStyle)=>/*#__PURE__*/ jsx("style", {
68
- "data-id": "google-element-fonts",
69
- type: "text/css",
70
- dangerouslySetInnerHTML: {
71
- __html: fontStyle
72
- }
73
- }, fontStyle)),
74
- customFonts && /*#__PURE__*/ jsx("style", {
75
- "data-id": "custom-element-fonts",
76
- type: "text/css",
77
- dangerouslySetInnerHTML: {
78
- __html: customFonts
79
- }
80
- }, fontStyle)
81
- ]
23
+ fontStyle && /*#__PURE__*/ jsx("style", {
24
+ "data-id": "google-fonts",
25
+ type: "text/css",
26
+ dangerouslySetInnerHTML: {
27
+ __html: fontStyle
28
+ }
82
29
  }),
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}`),
83
51
  /*#__PURE__*/ jsx(PageProvider, {
84
52
  productOffers: productOffers,
85
53
  publicStoreFrontData: publicStoreFrontData,
@@ -110,6 +78,7 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
110
78
  }),
111
79
  /*#__PURE__*/ jsx(Script, {
112
80
  defer: true,
81
+ strategy: "lazyOnload",
113
82
  src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
114
83
  })
115
84
  ]
@@ -1,52 +1,42 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ 'use client';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
3
  import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderProvider, Render } from '@gem-sdk/core';
3
- import { NextSeo } from 'next-seo';
4
- import Head from 'next/head';
5
- import { useRouter } from 'next/router';
4
+ import { Suspense } from 'react';
6
5
 
7
- const StaticPage = ({ components, builderData, sectionData, seo, themeStyle, fontStyle })=>{
8
- const router = useRouter();
9
- if (router.isFallback) {
10
- return /*#__PURE__*/ jsx("div", {
11
- className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
12
- children: /*#__PURE__*/ jsxs("div", {
13
- className: "gp-flex gp-gap-2",
14
- children: [
15
- /*#__PURE__*/ jsx("span", {
16
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_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_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
20
- }),
21
- /*#__PURE__*/ jsx("span", {
22
- className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
23
- })
24
- ]
25
- })
26
- });
27
- }
28
- return /*#__PURE__*/ jsxs(Fragment, {
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,
29
26
  children: [
30
- /*#__PURE__*/ jsx(NextSeo, {
31
- ...seo
27
+ themeStyle && /*#__PURE__*/ jsx("style", {
28
+ "data-id": "global-style",
29
+ type: "text/css",
30
+ dangerouslySetInnerHTML: {
31
+ __html: themeStyle
32
+ }
32
33
  }),
33
- /*#__PURE__*/ jsxs(Head, {
34
- children: [
35
- themeStyle && /*#__PURE__*/ jsx("style", {
36
- "data-id": "global-style",
37
- type: "text/css",
38
- dangerouslySetInnerHTML: {
39
- __html: themeStyle
40
- }
41
- }),
42
- fontStyle && /*#__PURE__*/ jsx("style", {
43
- "data-id": "google-fonts",
44
- type: "text/css",
45
- dangerouslySetInnerHTML: {
46
- __html: fontStyle
47
- }
48
- })
49
- ]
34
+ fontStyle && /*#__PURE__*/ jsx("style", {
35
+ "data-id": "google-fonts",
36
+ type: "text/css",
37
+ dangerouslySetInnerHTML: {
38
+ __html: fontStyle
39
+ }
50
40
  }),
51
41
  /*#__PURE__*/ jsx(PageProvider, {
52
42
  children: /*#__PURE__*/ jsx(BuilderComponentProvider, {