@gem-sdk/pages 17.0.0-dev.83 → 17.0.0-dev.84

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.
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),s=require("../libs/parse-html.js");exports.default=({children:t,...o})=>{let a=r.useShopStore(e=>e.mobileOnly);return e.jsxs(e.Fragment,{children:[s.parseHtml("custom-code-body",o?.customCodeBody),e.jsx("div",{className:r.cls({"gp-max-w-mobile gp-mx-auto gp-w-full":a}),children:t}),e.jsx(r.AddOn,{name:"cookie-bar"}),e.jsx(r.AddOn,{name:"cart-drawer"})]})};
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),s=require("../libs/parse-html.js");exports.default=({children:t,...o})=>{let a=r.useShopStore(e=>e.mobileOnly);return e.jsxs(e.Fragment,{children:[s.parseHtml("custom-code-body",o?.customCodeBody),a?e.jsx("div",{className:"gp-max-w-mobile gp-mx-auto gp-w-full",children:t}):t,e.jsx(r.AddOn,{name:"cookie-bar"}),e.jsx(r.AddOn,{name:"cart-drawer"})]})};
@@ -1,5 +1,5 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("next/head"),r=require("next/router"),a=require("../libs/parse-html.js"),n=require("react"),l=require("next/dynamic");exports.PreviewTemplate=({components:i,builderData:d,sectionData:o,themeStyle:c,fontStyle:g,elementFontStyle:u,customCodeHeader:p,customFonts:m,pageBackground:h,publicStoreFrontData:x,page:y,collection:j,dynamicCollection:f,dynamicProduct:_})=>{let{disableExternalLinks:v}=t.usePreviewSharePage(),b=r.useRouter(),{t:P}=t.useI18n(),q="custom-code-header",k=l(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),S=y?.type==="GP_COLLECTION"?k:n.Fragment;return(n.useEffect(()=>{let e=document.querySelectorAll(`[class*="${q}-"]`),t=[];e.length>1&&e.forEach(e=>{let s=e.className;if(t.includes(s)){e.remove();return}t.push(s)})},[]),n.useEffect(()=>{v()},[v]),b.isFallback)?e.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:e.jsxs("div",{className:"gp-flex gp-gap-2",children:[e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})}):e.jsxs(e.Fragment,{children:[e.jsxs(s,{children:[a.parseHtml(q,p,!0),c&&e.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:c}},"global-style"),g&&e.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:g}},"google-fonts"),u&&u.map(t=>e.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),m&&e.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:m}},g),h?.isUsePageBackground&&h?.background&&e.jsx("style",{children:`
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),r=require("next/head"),s=require("next/router"),a=require("../libs/parse-html.js"),i=require("react"),l=require("next/dynamic");exports.PreviewTemplate=({components:n,builderData:d,sectionData:o,themeStyle:c,fontStyle:g,elementFontStyle:u,customCodeHeader:p,customFonts:m,pageBackground:h,publicStoreFrontData:x,page:y,collection:j,dynamicCollection:f,dynamicProduct:_})=>{let{disableExternalLinks:v}=t.usePreviewSharePage(),P=s.useRouter(),{t:b}=t.useI18n(),q="custom-code-header",k=l(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),S=y?.type==="GP_COLLECTION"?k:i.Fragment;return(i.useEffect(()=>{let e=document.querySelectorAll(`[class*="${q}-"]`),t=[];e.length>1&&e.forEach(e=>{let r=e.className;if(t.includes(r)){e.remove();return}t.push(r)})},[]),i.useEffect(()=>{v()},[v]),P.isFallback)?e.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:e.jsxs("div",{className:"gp-flex gp-gap-2",children:[e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{children:[a.parseHtml(q,p,!0),c&&e.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:c}},"global-style"),g&&e.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:g}},"google-fonts"),u&&u.map(t=>e.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),m&&e.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:m}},g),h?.isUsePageBackground&&h?.background&&e.jsx("style",{children:`
2
2
  body {
3
3
  background: ${h.background};
4
4
  }
5
- `},`page_background_${h?.background}`)]}),e.jsx(t.PageProvider,{publicStoreFrontData:x,dynamicCollection:f,dynamicProduct:_,children:e.jsx(S,{collection:j,children:e.jsx(t.BuilderComponentProvider,{components:i,children:e.jsx("div",{id:"storefront","data-page-name":y?.name,"data-assigned-product-title":_?.productTitle,"data-assigned-collection-title":f?.collectionTitle,children:e.jsx(t.SectionProvider,{data:o,children:e.jsx(t.I18nProvider,{t:P,children:d?.map(s=>e.jsx(e.Fragment,{children:e.jsx(t.BuilderProvider,{state:s.data,lazy:s.lazy,priority:s.priority,isPreview:!0,children:e.jsx(t.Render,{uid:s.uid})},s.uid)}))})})})})})})]})};
5
+ `},`page_background_${h?.background}`)]}),e.jsx(t.PageProvider,{publicStoreFrontData:x,dynamicCollection:f,dynamicProduct:_,children:e.jsx(S,{collection:j,children:e.jsx(t.BuilderComponentProvider,{components:n,children:e.jsx("div",{id:"storefront","data-page-name":y?.name,"data-assigned-product-title":_?.productTitle,"data-assigned-collection-title":f?.collectionTitle,children:e.jsx(t.SectionProvider,{data:o,children:e.jsx(t.I18nProvider,{t:b,children:d?.map((r,s)=>e.jsx(t.LazyPriorityProvider,{priority:!!r.priority||0===s,children:e.jsx(t.BuilderProvider,{state:r.data,lazy:r.lazy,priority:r.priority,isPreview:!0,children:e.jsx(t.Render,{uid:r.uid})})},r.uid))})})})})})})]})};
@@ -1,5 +1,5 @@
1
- "use strict";var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("next-seo"),r=require("next/head"),a=require("next/router"),n=require("../libs/parse-html.js"),i=require("../components/builder/Header.js"),l=require("../components/FooterForPostPurchase.js"),o=require("next/script"),d=require("react"),c=require("../libs/hooks/usePageViewedTracking.js");exports.StaticPageV2=({components:g,builderData:u,sectionData:p,seo:m,themeStyle:h,fontStyle:x,elementFontStyle:j,customCodeHeader:f,customFonts:y,isPostPurchase:_,shopName:v,productOffers:P,publicStoreFrontData:b,dynamicDiscountOffer:S,isPreview:q,interaction:k,pageBackground:N,sellingPlanSetting:T,buyerConsentPreCheck:I,id:H,shopID:E,domainTrackingIlp:L,disableGsFont:M})=>{let $=a.useRouter(),{t:w}=s.useI18n(),F=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";c.usePageViewedTracking({id:H,shopID:E,domain:L});let A="custom-code-header";if(d.useEffect(()=>{let e=document.querySelectorAll(`[class*="${A}-"]`),s=[];e.length>1&&e.forEach(e=>{let t=e.className;if(s.includes(t)){e.remove();return}s.push(t)})},[]),$.isFallback)return e.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:e.jsxs("div",{className:"gp-flex gp-gap-2",children:[e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let B=(k?.value||[]).length>0;return e.jsxs(e.Fragment,{children:[e.jsx(t.NextSeo,{...m}),e.jsxs(r,{children:[n.parseHtml(A,f,!0),h&&e.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:h}},"global-style"),x&&!M&&e.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:x}},"google-fonts"),j&&j.map(s=>e.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:s}},s)),y&&e.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:y}},x),N?.isUsePageBackground&&N?.background&&e.jsx("style",{children:`
1
+ "use strict";var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),r=require("next-seo"),t=require("next/head"),a=require("next/router"),i=require("../libs/parse-html.js"),n=require("../components/builder/Header.js"),l=require("../components/FooterForPostPurchase.js"),o=require("next/script"),d=require("react"),c=require("../libs/hooks/usePageViewedTracking.js");exports.StaticPageV2=({components:g,builderData:u,sectionData:p,seo:m,themeStyle:h,fontStyle:x,elementFontStyle:y,customCodeHeader:j,customFonts:f,isPostPurchase:_,shopName:v,productOffers:P,publicStoreFrontData:b,dynamicDiscountOffer:S,isPreview:q,interaction:k,pageBackground:N,sellingPlanSetting:T,buyerConsentPreCheck:H,id:I,shopID:L,domainTrackingIlp:E,disableGsFont:M})=>{let $=a.useRouter(),{t:w}=s.useI18n(),F=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";c.usePageViewedTracking({id:I,shopID:L,domain:E});let z="custom-code-header";if(d.useEffect(()=>{let e=document.querySelectorAll(`[class*="${z}-"]`),s=[];e.length>1&&e.forEach(e=>{let r=e.className;if(s.includes(r)){e.remove();return}s.push(r)})},[]),$.isFallback)return e.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:e.jsxs("div",{className:"gp-flex gp-gap-2",children:[e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let A=(k?.value||[]).length>0;return e.jsxs(e.Fragment,{children:[e.jsx(r.NextSeo,{...m}),e.jsxs(t,{children:[i.parseHtml(z,j,!0),h&&e.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:h}},"global-style"),x&&!M&&e.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:x}},"google-fonts"),y&&y.map(s=>e.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:s}},s)),f&&e.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:f}},x),N?.isUsePageBackground&&N?.background&&e.jsx("style",{children:`
2
2
  body {
3
3
  background: ${N.background};
4
4
  }
5
- `},`page_background_${N?.background}`)]}),e.jsx(s.PageProvider,{productOffers:P,publicStoreFrontData:b,dynamicDiscountOffer:S,sellingPlanMeta:T,buyerConsentChecked:I,children:e.jsx(s.BuilderComponentProvider,{components:g,children:e.jsx(s.I18nProvider,{t:w,children:e.jsxs("div",{className:`${_?"gp-bg-white post-purchase-page":""} `,role:"main",children:[_&&e.jsx(i.default,{pageType:"POST_PURCHASE"}),B&&e.jsx("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(k?.value||[])}</div>`}}),e.jsx(s.SectionProvider,{data:p,children:u?.map((t,r)=>e.jsxs(s.BuilderProvider,{state:t.data,lazy:t.lazy,priority:t.priority,sectionIndex:r,isPostPurchase:_,isPreview:q,children:[e.jsx(s.Render,{uid:t.uid}),B&&e.jsx(o,{defer:!0,src:`${F}/assets-v2/gp-flow-action-lip-v7-5.js`})]},t.uid))}),_&&e.jsx(l.default,{shopName:v||""})]})})})})]})};
5
+ `},`page_background_${N?.background}`)]}),e.jsx(s.PageProvider,{productOffers:P,publicStoreFrontData:b,dynamicDiscountOffer:S,sellingPlanMeta:T,buyerConsentChecked:H,children:e.jsx(s.BuilderComponentProvider,{components:g,children:e.jsx(s.I18nProvider,{t:w,children:e.jsxs("div",{className:`${_?"gp-bg-white post-purchase-page":""} `,role:"main",children:[_&&e.jsx(n.default,{pageType:"POST_PURCHASE"}),A&&e.jsx("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(k?.value||[])}</div>`}}),e.jsx(s.SectionProvider,{data:p,children:u?.map((r,t)=>e.jsx(s.LazyPriorityProvider,{priority:!!r.priority||0===t,children:e.jsxs(s.BuilderProvider,{state:r.data,lazy:r.lazy,priority:r.priority,isPostPurchase:_,isPreview:q,children:[e.jsx(s.Render,{uid:r.uid}),A&&e.jsx(o,{defer:!0,src:`${F}/assets-v2/gp-flow-action-lip-v7-5.js`})]})},r.uid))}),_&&e.jsx(l.default,{shopName:v||""})]})})})})]})};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useShopStore as m,cls as t,AddOn as a}from"@gem-sdk/core";import{parseHtml as l}from"../libs/parse-html.js";let i=({children:i,...c})=>{let d=m(e=>e.mobileOnly);return e(o,{children:[l("custom-code-body",c?.customCodeBody),r("div",{className:t({"gp-max-w-mobile gp-mx-auto gp-w-full":d}),children:i}),r(a,{name:"cookie-bar"}),r(a,{name:"cart-drawer"})]})};export{i as default};
2
+ import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useShopStore as m,AddOn as t}from"@gem-sdk/core";import{parseHtml as a}from"../libs/parse-html.js";let l=({children:l,...i})=>{let c=m(e=>e.mobileOnly);return e(o,{children:[a("custom-code-body",i?.customCodeBody),c?r("div",{className:"gp-max-w-mobile gp-mx-auto gp-w-full",children:l}):l,r(t,{name:"cookie-bar"}),r(t,{name:"cart-drawer"})]})};export{l as default};
@@ -1,5 +1,5 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{usePreviewSharePage as l,useI18n as n,PageProvider as r,BuilderComponentProvider as s,SectionProvider as i,I18nProvider as o,BuilderProvider as d,Render as c}from"@gem-sdk/core";import g from"next/head";import{useRouter as p}from"next/router";import{parseHtml as m}from"../libs/parse-html.js";import{useEffect as u,Fragment as h}from"react";import f from"next/dynamic";let y=({components:y,builderData:_,sectionData:b,themeStyle:x,fontStyle:k,elementFontStyle:v,customCodeHeader:T,customFonts:N,pageBackground:L,publicStoreFrontData:P,page:S,collection:I,dynamicCollection:q,dynamicProduct:C})=>{let{disableExternalLinks:H}=l(),M=p(),{t:j}=n(),F="custom-code-header",$=f(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),w=S?.type==="GP_COLLECTION"?$:h;return(u(()=>{let e=document.querySelectorAll(`[class*="${F}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),u(()=>{H()},[H]),M.isFallback)?e("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:t("div",{className:"gp-flex gp-gap-2",children:[e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})}):t(a,{children:[t(g,{children:[m(F,T,!0),x&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:x}},"global-style"),k&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"google-fonts"),v&&v.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),N&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:N}},k),L?.isUsePageBackground&&L?.background&&e("style",{children:`
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{usePreviewSharePage as l,useI18n as r,PageProvider as n,BuilderComponentProvider as i,SectionProvider as s,I18nProvider as o,LazyPriorityProvider as d,BuilderProvider as c,Render as p}from"@gem-sdk/core";import g from"next/head";import{useRouter as m}from"next/router";import{parseHtml as u}from"../libs/parse-html.js";import{useEffect as h,Fragment as y}from"react";import f from"next/dynamic";let _=({components:_,builderData:b,sectionData:x,themeStyle:k,fontStyle:v,elementFontStyle:T,customCodeHeader:N,customFonts:L,pageBackground:P,publicStoreFrontData:S,page:I,collection:q,dynamicCollection:C,dynamicProduct:H})=>{let{disableExternalLinks:M}=l(),j=m(),{t:F}=r(),$="custom-code-header",w=f(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),z=I?.type==="GP_COLLECTION"?w:y;return(h(()=>{let e=document.querySelectorAll(`[class*="${$}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),h(()=>{M()},[M]),j.isFallback)?e("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:t("div",{className:"gp-flex gp-gap-2",children:[e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})}):t(a,{children:[t(g,{children:[u($,N,!0),k&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"global-style"),v&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:v}},"google-fonts"),T&&T.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),L&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:L}},v),P?.isUsePageBackground&&P?.background&&e("style",{children:`
2
2
  body {
3
- background: ${L.background};
3
+ background: ${P.background};
4
4
  }
5
- `},`page_background_${L?.background}`)]}),e(r,{publicStoreFrontData:P,dynamicCollection:q,dynamicProduct:C,children:e(w,{collection:I,children:e(s,{components:y,children:e("div",{id:"storefront","data-page-name":S?.name,"data-assigned-product-title":C?.productTitle,"data-assigned-collection-title":q?.collectionTitle,children:e(i,{data:b,children:e(o,{t:j,children:_?.map(t=>e(a,{children:e(d,{state:t.data,lazy:t.lazy,priority:t.priority,isPreview:!0,children:e(c,{uid:t.uid})},t.uid)}))})})})})})})]})};export{y as PreviewTemplate};
5
+ `},`page_background_${P?.background}`)]}),e(n,{publicStoreFrontData:S,dynamicCollection:C,dynamicProduct:H,children:e(z,{collection:q,children:e(i,{components:_,children:e("div",{id:"storefront","data-page-name":I?.name,"data-assigned-product-title":H?.productTitle,"data-assigned-collection-title":C?.collectionTitle,children:e(s,{data:x,children:e(o,{t:F,children:b?.map((t,a)=>e(d,{priority:!!t.priority||0===a,children:e(c,{state:t.data,lazy:t.lazy,priority:t.priority,isPreview:!0,children:e(p,{uid:t.uid})})},t.uid))})})})})})})]})};export{_ as PreviewTemplate};
@@ -1,5 +1,5 @@
1
- import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import{useI18n as a,PageProvider as r,BuilderComponentProvider as n,I18nProvider as l,SectionProvider as o,BuilderProvider as i,Render as p}from"@gem-sdk/core";import{NextSeo as c}from"next-seo";import d from"next/head";import{useRouter as g}from"next/router";import{parseHtml as m}from"../libs/parse-html.js";import u from"../components/builder/Header.js";import h from"../components/FooterForPostPurchase.js";import f from"next/script";import{useEffect as y}from"react";import{usePageViewedTracking as _}from"../libs/hooks/usePageViewedTracking.js";let b=({components:b,builderData:v,sectionData:x,seo:S,themeStyle:P,fontStyle:k,elementFontStyle:N,customCodeHeader:T,customFonts:j,isPostPurchase:H,shopName:I,productOffers:L,publicStoreFrontData:M,dynamicDiscountOffer:$,isPreview:E,interaction:q,pageBackground:w,sellingPlanSetting:A,buyerConsentPreCheck:F,id:O,shopID:z,domainTrackingIlp:C,disableGsFont:D})=>{let U=g(),{t:B}=a(),R=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";_({id:O,shopID:z,domain:C});let V="custom-code-header";if(y(()=>{let e=document.querySelectorAll(`[class*="${V}-"]`),t=[];e.length>1&&e.forEach(e=>{let s=e.className;if(t.includes(s)){e.remove();return}t.push(s)})},[]),U.isFallback)return e("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:t("div",{className:"gp-flex gp-gap-2",children:[e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let G=(q?.value||[]).length>0;return t(s,{children:[e(c,{...S}),t(d,{children:[m(V,T,!0),P&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:P}},"global-style"),k&&!D&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"google-fonts"),N&&N.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),j&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:j}},k),w?.isUsePageBackground&&w?.background&&e("style",{children:`
1
+ import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import{useI18n as r,PageProvider as a,BuilderComponentProvider as n,I18nProvider as l,SectionProvider as i,LazyPriorityProvider as o,BuilderProvider as p,Render as c}from"@gem-sdk/core";import{NextSeo as d}from"next-seo";import g from"next/head";import{useRouter as m}from"next/router";import{parseHtml as u}from"../libs/parse-html.js";import h from"../components/builder/Header.js";import f from"../components/FooterForPostPurchase.js";import y from"next/script";import{useEffect as _}from"react";import{usePageViewedTracking as b}from"../libs/hooks/usePageViewedTracking.js";let v=({components:v,builderData:S,sectionData:x,seo:P,themeStyle:k,fontStyle:N,elementFontStyle:T,customCodeHeader:j,customFonts:H,isPostPurchase:I,shopName:L,productOffers:M,publicStoreFrontData:$,dynamicDiscountOffer:E,isPreview:q,interaction:w,pageBackground:A,sellingPlanSetting:F,buyerConsentPreCheck:O,id:z,shopID:C,domainTrackingIlp:D,disableGsFont:U})=>{let B=m(),{t:R}=r(),V=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";b({id:z,shopID:C,domain:D});let G="custom-code-header";if(_(()=>{let e=document.querySelectorAll(`[class*="${G}-"]`),t=[];e.length>1&&e.forEach(e=>{let s=e.className;if(t.includes(s)){e.remove();return}t.push(s)})},[]),B.isFallback)return e("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:t("div",{className:"gp-flex gp-gap-2",children:[e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let J=(w?.value||[]).length>0;return t(s,{children:[e(d,{...P}),t(g,{children:[u(G,j,!0),k&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"global-style"),N&&!U&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:N}},"google-fonts"),T&&T.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),H&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:H}},N),A?.isUsePageBackground&&A?.background&&e("style",{children:`
2
2
  body {
3
- background: ${w.background};
3
+ background: ${A.background};
4
4
  }
5
- `},`page_background_${w?.background}`)]}),e(r,{productOffers:L,publicStoreFrontData:M,dynamicDiscountOffer:$,sellingPlanMeta:A,buyerConsentChecked:F,children:e(n,{components:b,children:e(l,{t:B,children:t("div",{className:`${H?"gp-bg-white post-purchase-page":""} `,role:"main",children:[H&&e(u,{pageType:"POST_PURCHASE"}),G&&e("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(q?.value||[])}</div>`}}),e(o,{data:x,children:v?.map((s,a)=>t(i,{state:s.data,lazy:s.lazy,priority:s.priority,sectionIndex:a,isPostPurchase:H,isPreview:E,children:[e(p,{uid:s.uid}),G&&e(f,{defer:!0,src:`${R}/assets-v2/gp-flow-action-lip-v7-5.js`})]},s.uid))}),H&&e(h,{shopName:I||""})]})})})})]})};export{b as StaticPageV2};
5
+ `},`page_background_${A?.background}`)]}),e(a,{productOffers:M,publicStoreFrontData:$,dynamicDiscountOffer:E,sellingPlanMeta:F,buyerConsentChecked:O,children:e(n,{components:v,children:e(l,{t:R,children:t("div",{className:`${I?"gp-bg-white post-purchase-page":""} `,role:"main",children:[I&&e(h,{pageType:"POST_PURCHASE"}),J&&e("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(w?.value||[])}</div>`}}),e(i,{data:x,children:S?.map((s,r)=>e(o,{priority:!!s.priority||0===r,children:t(p,{state:s.data,lazy:s.lazy,priority:s.priority,isPostPurchase:I,isPreview:q,children:[e(c,{uid:s.uid}),J&&e(y,{defer:!0,src:`${V}/assets-v2/gp-flow-action-lip-v7-5.js`})]})},s.uid))}),I&&e(f,{shopName:L||""})]})})})})]})};export{v as StaticPageV2};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "17.0.0-dev.83",
3
+ "version": "17.0.0-dev.84",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -27,10 +27,10 @@
27
27
  "next": "14.2.35"
28
28
  },
29
29
  "devDependencies": {
30
- "@gem-sdk/core": "17.0.0-dev.83",
31
- "@gem-sdk/plugin-cookie-bar": "17.0.0-dev.83",
32
- "@gem-sdk/plugin-quick-view": "17.0.0-dev.83",
33
- "@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.83"
30
+ "@gem-sdk/core": "17.0.0-dev.84",
31
+ "@gem-sdk/plugin-cookie-bar": "17.0.0-dev.84",
32
+ "@gem-sdk/plugin-quick-view": "17.0.0-dev.84",
33
+ "@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.84"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "next": "14.2.35"