@gem-sdk/pages 1.48.0-dev.34 → 1.48.0-dev.72

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.
@@ -139,7 +139,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
139
139
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
140
140
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
141
141
  customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
142
- customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
142
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
143
+ interaction: dataBuilder?.interaction
143
144
  });
144
145
  } catch (err) {
145
146
  nextjs.captureException(err);
@@ -141,7 +141,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
141
141
  customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
142
142
  customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
143
143
  pageHandle: dataBuilder.handle ?? null,
144
- customFonts: customFonts$1
144
+ customFonts: customFonts$1,
145
+ interaction: dataBuilder?.interaction
145
146
  });
146
147
  } catch (err) {
147
148
  nextjs.captureException(err);
@@ -9,9 +9,11 @@ var useTrackingView = require('../libs/hooks/use-tracking-view.js');
9
9
  var parseHtml = require('../libs/parse-html.js');
10
10
  var Header = require('../components/builder/Header.js');
11
11
  var FooterForPostPurchase = require('../components/FooterForPostPurchase.js');
12
+ var Script = require('next/script');
12
13
 
13
- const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview })=>{
14
+ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction })=>{
14
15
  const router$1 = router.useRouter();
16
+ const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
15
17
  useTrackingView.useTrackingView(shopToken, pageHandle, router$1.isFallback);
16
18
  if (router$1.isFallback) {
17
19
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
@@ -79,17 +81,28 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
79
81
  isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(Header.default, {
80
82
  pageType: "POST_PURCHASE"
81
83
  }),
84
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
85
+ dangerouslySetInnerHTML: {
86
+ __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
87
+ }
88
+ }),
82
89
  /*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
83
90
  data: sectionData,
84
- children: builderData?.map((builder)=>/*#__PURE__*/ jsxRuntime.jsx(core.BuilderProvider, {
91
+ children: builderData?.map((builder)=>/*#__PURE__*/ jsxRuntime.jsxs(core.BuilderProvider, {
85
92
  state: builder.data,
86
93
  lazy: builder.lazy,
87
94
  priority: builder.priority,
88
95
  isPostPurchase: isPostPurchase,
89
96
  isPreview: isPreview,
90
- children: /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
91
- uid: builder.uid
92
- })
97
+ children: [
98
+ /*#__PURE__*/ jsxRuntime.jsx(core.Render, {
99
+ uid: builder.uid
100
+ }),
101
+ /*#__PURE__*/ jsxRuntime.jsx(Script, {
102
+ defer: true,
103
+ src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
104
+ })
105
+ ]
93
106
  }, builder.uid))
94
107
  }),
95
108
  isPostPurchase && /*#__PURE__*/ jsxRuntime.jsx(FooterForPostPurchase.default, {
@@ -137,7 +137,8 @@ const getStaticPagePropsPreview = (fetcher, shopifyFetcher)=>async (slug)=>{
137
137
  facebookPixelId: dataBuilder.themePageAnalytic?.fbPixelID ?? null,
138
138
  tiktokPixelId: dataBuilder.themePageAnalytic?.tiktokPixelID ?? null,
139
139
  customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
140
- customCodeBody: dataBuilder.themePageCustomCode?.body ?? null
140
+ customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
141
+ interaction: dataBuilder?.interaction
141
142
  });
142
143
  } catch (err) {
143
144
  captureException(err);
@@ -139,7 +139,8 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
139
139
  customCodeHeader: dataBuilder.themePageCustomCode?.header ?? null,
140
140
  customCodeBody: dataBuilder.themePageCustomCode?.body ?? null,
141
141
  pageHandle: dataBuilder.handle ?? null,
142
- customFonts
142
+ customFonts,
143
+ interaction: dataBuilder?.interaction
143
144
  });
144
145
  } catch (err) {
145
146
  captureException(err);
@@ -7,9 +7,11 @@ import { useTrackingView } from '../libs/hooks/use-tracking-view.js';
7
7
  import { parseHtml } from '../libs/parse-html.js';
8
8
  import Header from '../components/builder/Header.js';
9
9
  import FooterForPostPurchase from '../components/FooterForPostPurchase.js';
10
+ import Script from 'next/script';
10
11
 
11
- const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview })=>{
12
+ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, fontStyle, elementFontStyle, customCodeHeader, shopToken, pageHandle, customFonts, isPostPurchase, shopName, productOffers, publicStoreFrontData, isPreview, interaction })=>{
12
13
  const router = useRouter();
14
+ const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
13
15
  useTrackingView(shopToken, pageHandle, router.isFallback);
14
16
  if (router.isFallback) {
15
17
  return /*#__PURE__*/ jsx("div", {
@@ -77,17 +79,28 @@ const StaticPageV2 = ({ components, builderData, sectionData, seo, themeStyle, f
77
79
  isPostPurchase && /*#__PURE__*/ jsx(Header, {
78
80
  pageType: "POST_PURCHASE"
79
81
  }),
82
+ /*#__PURE__*/ jsx("div", {
83
+ dangerouslySetInnerHTML: {
84
+ __html: `<div id="gp-interaction" style="display: none;">${JSON.stringify(interaction?.value || [])}</div>`
85
+ }
86
+ }),
80
87
  /*#__PURE__*/ jsx(SectionProvider, {
81
88
  data: sectionData,
82
- children: builderData?.map((builder)=>/*#__PURE__*/ jsx(BuilderProvider, {
89
+ children: builderData?.map((builder)=>/*#__PURE__*/ jsxs(BuilderProvider, {
83
90
  state: builder.data,
84
91
  lazy: builder.lazy,
85
92
  priority: builder.priority,
86
93
  isPostPurchase: isPostPurchase,
87
94
  isPreview: isPreview,
88
- children: /*#__PURE__*/ jsx(Render, {
89
- uid: builder.uid
90
- })
95
+ children: [
96
+ /*#__PURE__*/ jsx(Render, {
97
+ uid: builder.uid
98
+ }),
99
+ /*#__PURE__*/ jsx(Script, {
100
+ defer: true,
101
+ src: `${baseAssetURL}/assets-v2/gp-flow-action-lip.js`
102
+ })
103
+ ]
91
104
  }, builder.uid))
92
105
  }),
93
106
  isPostPurchase && /*#__PURE__*/ jsx(FooterForPostPurchase, {
@@ -40,6 +40,7 @@ type PageBuilderProps = {
40
40
  customCodeBody?: string | null;
41
41
  isStorefront?: boolean;
42
42
  customFonts?: string | null;
43
+ interaction?: ShopType.Maybe<Pick<ShopType.PublishedPageInteraction, "id" | "value">>;
43
44
  };
44
45
  type PageBuilderPropsV2 = {
45
46
  builderData?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "1.48.0-dev.34",
3
+ "version": "1.48.0-dev.72",
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.48.0-dev.33",
29
+ "@gem-sdk/core": "1.48.0-dev.72",
30
30
  "@gem-sdk/plugin-cookie-bar": "1.48.0-dev.3",
31
31
  "@gem-sdk/plugin-quick-view": "1.48.0-dev.3",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "1.48.0-dev.3"