@gem-sdk/pages 1.58.0-staging.34 → 1.58.0-staging.40

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.
@@ -8,10 +8,29 @@ var parseHtml = require('../libs/parse-html.js');
8
8
  var Header = require('../components/builder/Header.js');
9
9
  var FooterForPostPurchase = require('../components/FooterForPostPurchase.js');
10
10
  var Script = require('next/script');
11
+ var react = require('react');
11
12
 
12
- const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction })=>{
13
+ const StaticPageV2 = (props)=>{
14
+ const { components, builderData, sectionData, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction } = props;
13
15
  const baseAssetURL = process.env.NEXT_GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
14
16
  useTrackingView.useTrackingView(shopToken, pageHandle);
17
+ const fallbackContent = /*#__PURE__*/ jsxRuntime.jsx("div", {
18
+ className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
19
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
20
+ className: "gp-flex gp-gap-2",
21
+ children: [
22
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
23
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"
24
+ }),
25
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
26
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"
27
+ }),
28
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
29
+ className: "gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"
30
+ })
31
+ ]
32
+ })
33
+ });
15
34
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
16
35
  children: [
17
36
  parseHtml.parseHtml(customCodeHeader),
@@ -43,46 +62,49 @@ const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontSt
43
62
  __html: customFonts
44
63
  }
45
64
  }, fontStyle),
46
- /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
47
- productOffers: productOffers,
48
- publicStoreFrontData: publicStoreFrontData,
49
- children: /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
50
- components: components,
51
- children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
52
- className: `${isPostPurchase ? 'gp-bg-white post-purchase-page' : ''} `,
53
- children: [
54
- isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(Header.default, {
55
- pageType: "POST_PURCHASE"
56
- }),
57
- /*#__PURE__*/ jsxRuntime.jsx("div", {
58
- dangerouslySetInnerHTML: {
59
- __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
60
- }
61
- }),
62
- /*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
63
- data: sectionData,
64
- children: builderData?.map((builder)=>/*#__PURE__*/ jsxRuntime.jsxs(core.BuilderProvider, {
65
- state: builder.data,
66
- lazy: builder.lazy,
67
- priority: builder.priority,
68
- isPostPurchase: isPostPurchase,
69
- isPreview: isPreview,
70
- children: [
71
- /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
72
- uid: builder.uid
73
- }),
74
- /*#__PURE__*/ jsxRuntime.jsx(Script, {
75
- defer: true,
76
- strategy: "lazyOnload",
77
- src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
78
- })
79
- ]
80
- }, builder.uid))
81
- }),
82
- isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(FooterForPostPurchase.default, {
83
- shopName: shopName || ''
84
- })
85
- ]
65
+ /*#__PURE__*/ jsxRuntime.jsx(react.Suspense, {
66
+ fallback: fallbackContent,
67
+ children: /*#__PURE__*/ jsxRuntime.jsx(core.PageProvider, {
68
+ productOffers: productOffers,
69
+ publicStoreFrontData: publicStoreFrontData,
70
+ children: /*#__PURE__*/ jsxRuntime.jsx(core.BuilderComponentProvider, {
71
+ components: components,
72
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
73
+ className: `${isPostPurchase ? 'gp-bg-white post-purchase-page' : ''} `,
74
+ children: [
75
+ isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(Header.default, {
76
+ pageType: "POST_PURCHASE"
77
+ }),
78
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
79
+ dangerouslySetInnerHTML: {
80
+ __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
81
+ }
82
+ }),
83
+ /*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
84
+ data: sectionData,
85
+ children: builderData?.map((builder)=>/*#__PURE__*/ jsxRuntime.jsxs(core.BuilderProvider, {
86
+ state: builder.data,
87
+ lazy: builder.lazy,
88
+ priority: builder.priority,
89
+ isPostPurchase: isPostPurchase,
90
+ isPreview: isPreview,
91
+ children: [
92
+ /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
93
+ uid: builder.uid
94
+ }),
95
+ /*#__PURE__*/ jsxRuntime.jsx(Script, {
96
+ defer: true,
97
+ strategy: "lazyOnload",
98
+ src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
99
+ })
100
+ ]
101
+ }, builder.uid))
102
+ }),
103
+ isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(FooterForPostPurchase.default, {
104
+ shopName: shopName || ''
105
+ })
106
+ ]
107
+ })
86
108
  })
87
109
  })
88
110
  })
@@ -6,10 +6,29 @@ import { parseHtml } from '../libs/parse-html.js';
6
6
  import Header from '../components/builder/Header.js';
7
7
  import FooterForPostPurchase from '../components/FooterForPostPurchase.js';
8
8
  import Script from 'next/script';
9
+ import { Suspense } from 'react';
9
10
 
10
- const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction })=>{
11
+ const StaticPageV2 = (props)=>{
12
+ const { components, builderData, sectionData, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction } = props;
11
13
  const baseAssetURL = process.env.NEXT_GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
12
14
  useTrackingView(shopToken, pageHandle);
15
+ const fallbackContent = /*#__PURE__*/ jsx("div", {
16
+ className: "gp-flex gp-h-[100vh] gp-items-center gp-justify-center",
17
+ children: /*#__PURE__*/ jsxs("div", {
18
+ className: "gp-flex gp-gap-2",
19
+ children: [
20
+ /*#__PURE__*/ 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__*/ 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__*/ 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
+ });
13
32
  return /*#__PURE__*/ jsxs(Fragment, {
14
33
  children: [
15
34
  parseHtml(customCodeHeader),
@@ -41,46 +60,49 @@ const StaticPageV2 = ({ components, builderData, sectionData, themeStyle, fontSt
41
60
  __html: customFonts
42
61
  }
43
62
  }, fontStyle),
44
- /*#__PURE__*/ jsx(PageProvider, {
45
- productOffers: productOffers,
46
- publicStoreFrontData: publicStoreFrontData,
47
- children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
48
- components: components,
49
- children: /*#__PURE__*/ jsxs("div", {
50
- className: `${isPostPurchase ? 'gp-bg-white post-purchase-page' : ''} `,
51
- children: [
52
- isPostPurchase && /*#__PURE__*/ jsx(Header, {
53
- pageType: "POST_PURCHASE"
54
- }),
55
- /*#__PURE__*/ jsx("div", {
56
- dangerouslySetInnerHTML: {
57
- __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
58
- }
59
- }),
60
- /*#__PURE__*/ jsx(SectionProvider, {
61
- data: sectionData,
62
- children: builderData?.map((builder)=>/*#__PURE__*/ jsxs(BuilderProvider, {
63
- state: builder.data,
64
- lazy: builder.lazy,
65
- priority: builder.priority,
66
- isPostPurchase: isPostPurchase,
67
- isPreview: isPreview,
68
- children: [
69
- /*#__PURE__*/ jsx(Render, {
70
- uid: builder.uid
71
- }),
72
- /*#__PURE__*/ jsx(Script, {
73
- defer: true,
74
- strategy: "lazyOnload",
75
- src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
76
- })
77
- ]
78
- }, builder.uid))
79
- }),
80
- isPostPurchase && /*#__PURE__*/ jsx(FooterForPostPurchase, {
81
- shopName: shopName || ''
82
- })
83
- ]
63
+ /*#__PURE__*/ jsx(Suspense, {
64
+ fallback: fallbackContent,
65
+ children: /*#__PURE__*/ jsx(PageProvider, {
66
+ productOffers: productOffers,
67
+ publicStoreFrontData: publicStoreFrontData,
68
+ children: /*#__PURE__*/ jsx(BuilderComponentProvider, {
69
+ components: components,
70
+ children: /*#__PURE__*/ jsxs("div", {
71
+ className: `${isPostPurchase ? 'gp-bg-white post-purchase-page' : ''} `,
72
+ children: [
73
+ isPostPurchase && /*#__PURE__*/ jsx(Header, {
74
+ pageType: "POST_PURCHASE"
75
+ }),
76
+ /*#__PURE__*/ jsx("div", {
77
+ dangerouslySetInnerHTML: {
78
+ __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
79
+ }
80
+ }),
81
+ /*#__PURE__*/ jsx(SectionProvider, {
82
+ data: sectionData,
83
+ children: builderData?.map((builder)=>/*#__PURE__*/ jsxs(BuilderProvider, {
84
+ state: builder.data,
85
+ lazy: builder.lazy,
86
+ priority: builder.priority,
87
+ isPostPurchase: isPostPurchase,
88
+ isPreview: isPreview,
89
+ children: [
90
+ /*#__PURE__*/ jsx(Render, {
91
+ uid: builder.uid
92
+ }),
93
+ /*#__PURE__*/ jsx(Script, {
94
+ defer: true,
95
+ strategy: "lazyOnload",
96
+ src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
97
+ })
98
+ ]
99
+ }, builder.uid))
100
+ }),
101
+ isPostPurchase && /*#__PURE__*/ jsx(FooterForPostPurchase, {
102
+ shopName: shopName || ''
103
+ })
104
+ ]
105
+ })
84
106
  })
85
107
  })
86
108
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.58.0-staging.34",
3
+ "version": "1.58.0-staging.40",
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-staging.34",
29
+ "@gem-sdk/core": "1.58.0-staging.39",
30
30
  "@gem-sdk/plugin-cookie-bar": "1.58.0-staging.25",
31
31
  "@gem-sdk/plugin-quick-view": "1.58.0-staging.25",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "1.58.0-staging.25"