@gem-sdk/pages 17.0.0-staging.18 → 17.0.1

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 +1 @@
1
- "use strict";const EXCLUDED_FONT_FAMILIES=["sans-serif"],getFallbackFontFamilyFromGlobalStyle=(t,e)=>{if(e&&t?.type&&!t?.custom?.fontFamily){let l=e[t.type];if(l){let e=JSON.parse(JSON.stringify(t));return e.custom||(e.custom={}),e.custom.fontFamily={value:l.family,type:l.type},e}}return t},getFontsFromDataBuilder=(t,e)=>{let l=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],a=r.styles,i=r.settings;getFontFromGroupSetting(l,a,e),getFontFromGroupSetting(l,i,e)}return l},getFontFromGroupSetting=(t,e,l)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let a=e[r];if(!a)continue;let i=l?getFallbackFontFamilyFromGlobalStyle(a,l):a;for(let e of(getFontValue(t,i),o)){if(!a[e])continue;let o=l?getFallbackFontFamilyFromGlobalStyle(a[e],l):a[e];getFontValue(t,o)}}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let l=e.custom?.fontFamily;"string"==typeof l&&(l={value:e.custom?.fontFamily||"",type:"google"});let o=l?.value;if(EXCLUDED_FONT_FAMILIES.includes(o))return;let r=e.custom?.fontVariants;if(r?.length||(r=[e.custom?.fontWeight]),l&&r?.length){let a=r.map(t=>"regular"===t?"400":t),i=e.custom?.fontWeight&&a.includes(e.custom?.fontWeight)?e.custom?.fontWeight:a[0];if(i){let r=uniqueArray([i,...e?.attrs?.isAlwaysLoadBold?["700"]:[],...e?.attrs?.loadFontStyles?.includes("bold")?["700"]:[]]);if(e?.attrs?.loadFontStyles?.includes("italic")){let t=r.map(t=>"string"==typeof t&&/^\d+$/.test(t)?`${t}i`:null).filter(t=>null!==t);r.push(...t)}let n=t.find(t=>t.family==o&&r.every(e=>t.variants.includes(e)));if(!n){let e=t.find(t=>t.family==o);e?r.forEach(t=>{e.variants.includes(t)||e.variants.push(t)}):("700"!==i&&a.includes("700")&&r.push("700"),t.push({family:o||"",variants:uniqueArray(r),subsets:[],type:l.type}))}}}},extractImportUrls=t=>{let e=[...t.matchAll(/@import url\(['"]?([^'")\s]+)['"]?\)/g)];return e.map(t=>t[1]).filter(t=>!!t)};exports.extractImportUrls=extractImportUrls,exports.getFontFromGroupSetting=getFontFromGroupSetting,exports.getFontsFromDataBuilder=getFontsFromDataBuilder;
1
+ "use strict";const EXCLUDED_FONT_FAMILIES=["sans-serif"],getFallbackFontFamilyFromGlobalStyle=(t,e)=>{if(e&&t?.type&&!t?.custom?.fontFamily){let l=e[t.type];if(l){let e=JSON.parse(JSON.stringify(t));return e.custom||(e.custom={}),e.custom.fontFamily={value:l.family,type:l.type},e}}return t},getFontsFromDataBuilder=(t,e)=>{let l=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let i=t[o],n=i.styles,r=i.settings;getFontFromGroupSetting(l,n,e),getFontFromGroupSetting(l,r,e)}return l},getFontFromGroupSetting=(t,e,l)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let n=e[i];if(!n)continue;let r=l?getFallbackFontFamilyFromGlobalStyle(n,l):n;for(let e of(getFontValue(t,r),o)){if(!n[e])continue;let o=l?getFallbackFontFamilyFromGlobalStyle(n[e],l):n[e];getFontValue(t,o)}}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let l=e.custom?.fontFamily;"string"==typeof l&&(l={value:e.custom?.fontFamily||"",type:"google"});let o=l?.value;if(EXCLUDED_FONT_FAMILIES.includes(o))return;let i=e.custom?.fontVariants;if(i?.length||(i=[e.custom?.fontWeight]),l&&i?.length){let n=i.map(t=>"regular"===t?"400":t),r=e.custom?.fontWeight&&n.includes(e.custom?.fontWeight)?e.custom?.fontWeight:n[0];if(r){let i=uniqueArray([r,...e?.attrs?.isAlwaysLoadBold?["700"]:[],...e?.attrs?.loadFontStyles?.includes("bold")?["700"]:[]]);if(e?.attrs?.loadFontStyles?.includes("italic")){let t=i.map(t=>"string"==typeof t&&/^\d+$/.test(t)?`${t}i`:null).filter(t=>null!==t);i.push(...t)}let a=t.find(t=>t.family==o&&i.every(e=>t.variants.includes(e)));if(!a){let e=t.find(t=>t.family==o);e?i.forEach(t=>{e.variants.includes(t)||e.variants.push(t)}):("700"!==r&&n.includes("700")&&i.push("700"),t.push({family:o||"",variants:uniqueArray(i),subsets:[],type:l.type}))}}}};exports.getFontFromGroupSetting=getFontFromGroupSetting,exports.getFontsFromDataBuilder=getFontsFromDataBuilder;
@@ -1,5 +1,5 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),nextSeo=require("next-seo"),Head=require("next/head"),router=require("next/router"),useTrackingView=require("../libs/hooks/use-tracking-view.js"),parseHtml=require("../libs/parse-html.js"),Header=require("../components/builder/Header.js"),FooterForPostPurchase=require("../components/FooterForPostPurchase.js"),Script=require("next/script"),react=require("react"),usePageViewedTracking=require("../libs/hooks/usePageViewedTracking.js"),FontLink=require("../components/FontLink.js");const StaticPageV2=({components:e,builderData:s,sectionData:t,seo:r,themeStyle:i,fontStyle:n,elementFontStyle:a,customCodeHeader:o,shopToken:u,pageHandle:l,customFonts:c,isPostPurchase:d,shopName:g,productOffers:m,publicStoreFrontData:p,dynamicDiscountOffer:x,isPreview:j,interaction:h,pageBackground:f,sellingPlanSetting:R,buyerConsentPreCheck:P,id:k,shopID:y,domainTrackingIlp:_})=>{let S=router.useRouter(),{t:v}=core.useI18n(),b=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";useTrackingView.useTrackingView(u,l,S.isFallback),usePageViewedTracking.usePageViewedTracking({id:k,shopID:y,domain:_});let q="custom-code-header";if(react.useEffect(()=>{let e=document.querySelectorAll(`[class*="${q}-"]`),s=[];e.length>1&&e.forEach(e=>{let t=e.className;if(s.includes(t)){e.remove();return}s.push(t)})},[]),S.isFallback)return jsxRuntime.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-2",children:[jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let F=(h?.value||[]).length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(nextSeo.NextSeo,{...r}),jsxRuntime.jsxs(Head,{children:[parseHtml.parseHtml(q,o,!0),i&&jsxRuntime.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:i}},"global-style"),c&&jsxRuntime.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:c}},n),f?.isUsePageBackground&&f?.background&&jsxRuntime.jsx("style",{children:`
1
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),nextSeo=require("next-seo"),Head=require("next/head"),router=require("next/router"),useTrackingView=require("../libs/hooks/use-tracking-view.js"),parseHtml=require("../libs/parse-html.js"),Header=require("../components/builder/Header.js"),FooterForPostPurchase=require("../components/FooterForPostPurchase.js"),Script=require("next/script"),react=require("react"),usePageViewedTracking=require("../libs/hooks/usePageViewedTracking.js");const StaticPageV2=({components:e,builderData:s,sectionData:t,seo:r,themeStyle:i,fontStyle:a,elementFontStyle:n,customCodeHeader:u,shopToken:l,pageHandle:o,customFonts:c,isPostPurchase:d,shopName:g,productOffers:m,publicStoreFrontData:p,dynamicDiscountOffer:x,isPreview:j,interaction:h,pageBackground:f,sellingPlanSetting:y,buyerConsentPreCheck:R,id:_,shopID:P,domainTrackingIlp:S})=>{let v=router.useRouter(),{t:b}=core.useI18n(),k=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";useTrackingView.useTrackingView(l,o,v.isFallback),usePageViewedTracking.usePageViewedTracking({id:_,shopID:P,domain:S});let q="custom-code-header";if(react.useEffect(()=>{let e=document.querySelectorAll(`[class*="${q}-"]`),s=[];e.length>1&&e.forEach(e=>{let t=e.className;if(s.includes(t)){e.remove();return}s.push(t)})},[]),v.isFallback)return jsxRuntime.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:jsxRuntime.jsxs("div",{className:"gp-flex gp-gap-2",children:[jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),jsxRuntime.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let T=(h?.value||[]).length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(nextSeo.NextSeo,{...r}),jsxRuntime.jsxs(Head,{children:[parseHtml.parseHtml(q,u,!0),i&&jsxRuntime.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:i}},"global-style"),a&&jsxRuntime.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:a}},"google-fonts"),n&&n.map(e=>jsxRuntime.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:e}},e)),c&&jsxRuntime.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:c}},a),f?.isUsePageBackground&&f?.background&&jsxRuntime.jsx("style",{children:`
2
2
  body {
3
3
  background: ${f.background};
4
4
  }
5
- `},`page_background_${f?.background}`)]}),n&&jsxRuntime.jsx(FontLink.FontLink,{fontStyle:n,dataId:"google-fonts"}),a&&a.map((e,s)=>jsxRuntime.jsx(FontLink.FontLink,{fontStyle:e,dataId:"google-element-fonts"},s)),jsxRuntime.jsx(core.PageProvider,{productOffers:m,publicStoreFrontData:p,dynamicDiscountOffer:x,sellingPlanMeta:R,buyerConsentChecked:P,children:jsxRuntime.jsx(core.BuilderComponentProvider,{components:e,children:jsxRuntime.jsx(core.I18nProvider,{t:v,children:jsxRuntime.jsxs("div",{className:`${d?"gp-bg-white post-purchase-page":""} `,role:"main",children:[d&&jsxRuntime.jsx(Header.default,{pageType:"POST_PURCHASE"}),F&&jsxRuntime.jsx("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(h?.value||[])}</div>`}}),jsxRuntime.jsx(core.SectionProvider,{data:t,children:s?.map(e=>jsxRuntime.jsxs(core.BuilderProvider,{state:e.data,lazy:e.lazy,priority:e.priority,isPostPurchase:d,isPreview:j,children:[jsxRuntime.jsx(core.Render,{uid:e.uid}),F&&jsxRuntime.jsx(Script,{defer:!0,src:`${b}/assets-v2/gp-flow-action-lip-v7-5.js`})]},e.uid))}),d&&jsxRuntime.jsx(FooterForPostPurchase.default,{shopName:g||""})]})})})})]})};exports.StaticPageV2=StaticPageV2;
5
+ `},`page_background_${f?.background}`)]}),jsxRuntime.jsx(core.PageProvider,{productOffers:m,publicStoreFrontData:p,dynamicDiscountOffer:x,sellingPlanMeta:y,buyerConsentChecked:R,children:jsxRuntime.jsx(core.BuilderComponentProvider,{components:e,children:jsxRuntime.jsx(core.I18nProvider,{t:b,children:jsxRuntime.jsxs("div",{className:`${d?"gp-bg-white post-purchase-page":""} `,role:"main",children:[d&&jsxRuntime.jsx(Header.default,{pageType:"POST_PURCHASE"}),T&&jsxRuntime.jsx("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(h?.value||[])}</div>`}}),jsxRuntime.jsx(core.SectionProvider,{data:t,children:s?.map(e=>jsxRuntime.jsxs(core.BuilderProvider,{state:e.data,lazy:e.lazy,priority:e.priority,isPostPurchase:d,isPreview:j,children:[jsxRuntime.jsx(core.Render,{uid:e.uid}),T&&jsxRuntime.jsx(Script,{defer:!0,src:`${k}/assets-v2/gp-flow-action-lip-v7-5.js`})]},e.uid))}),d&&jsxRuntime.jsx(FooterForPostPurchase.default,{shopName:g||""})]})})})})]})};exports.StaticPageV2=StaticPageV2;
@@ -1 +1 @@
1
- let EXCLUDED_FONT_FAMILIES=["sans-serif"],getFallbackFontFamilyFromGlobalStyle=(t,e)=>{if(e&&t?.type&&!t?.custom?.fontFamily){let l=e[t.type];if(l){let e=JSON.parse(JSON.stringify(t));return e.custom||(e.custom={}),e.custom.fontFamily={value:l.family,type:l.type},e}}return t},getFontsFromDataBuilder=(t,e)=>{let l=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],a=r.styles,i=r.settings;getFontFromGroupSetting(l,a,e),getFontFromGroupSetting(l,i,e)}return l},getFontFromGroupSetting=(t,e,l)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let a=e[r];if(!a)continue;let i=l?getFallbackFontFamilyFromGlobalStyle(a,l):a;for(let e of(getFontValue(t,i),o)){if(!a[e])continue;let o=l?getFallbackFontFamilyFromGlobalStyle(a[e],l):a[e];getFontValue(t,o)}}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let l=e.custom?.fontFamily;"string"==typeof l&&(l={value:e.custom?.fontFamily||"",type:"google"});let o=l?.value;if(EXCLUDED_FONT_FAMILIES.includes(o))return;let r=e.custom?.fontVariants;if(r?.length||(r=[e.custom?.fontWeight]),l&&r?.length){let a=r.map(t=>"regular"===t?"400":t),i=e.custom?.fontWeight&&a.includes(e.custom?.fontWeight)?e.custom?.fontWeight:a[0];if(i){let r=uniqueArray([i,...e?.attrs?.isAlwaysLoadBold?["700"]:[],...e?.attrs?.loadFontStyles?.includes("bold")?["700"]:[]]);if(e?.attrs?.loadFontStyles?.includes("italic")){let t=r.map(t=>"string"==typeof t&&/^\d+$/.test(t)?`${t}i`:null).filter(t=>null!==t);r.push(...t)}let n=t.find(t=>t.family==o&&r.every(e=>t.variants.includes(e)));if(!n){let e=t.find(t=>t.family==o);e?r.forEach(t=>{e.variants.includes(t)||e.variants.push(t)}):("700"!==i&&a.includes("700")&&r.push("700"),t.push({family:o||"",variants:uniqueArray(r),subsets:[],type:l.type}))}}}},extractImportUrls=t=>{let e=[...t.matchAll(/@import url\(['"]?([^'")\s]+)['"]?\)/g)];return e.map(t=>t[1]).filter(t=>!!t)};export{extractImportUrls,getFontFromGroupSetting,getFontsFromDataBuilder};
1
+ let EXCLUDED_FONT_FAMILIES=["sans-serif"],getFallbackFontFamilyFromGlobalStyle=(t,e)=>{if(e&&t?.type&&!t?.custom?.fontFamily){let l=e[t.type];if(l){let e=JSON.parse(JSON.stringify(t));return e.custom||(e.custom={}),e.custom.fontFamily={value:l.family,type:l.type},e}}return t},getFontsFromDataBuilder=(t,e)=>{let l=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let i=t[o],n=i.styles,a=i.settings;getFontFromGroupSetting(l,n,e),getFontFromGroupSetting(l,a,e)}return l},getFontFromGroupSetting=(t,e,l)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let n=e[i];if(!n)continue;let a=l?getFallbackFontFamilyFromGlobalStyle(n,l):n;for(let e of(getFontValue(t,a),o)){if(!n[e])continue;let o=l?getFallbackFontFamilyFromGlobalStyle(n[e],l):n[e];getFontValue(t,o)}}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let l=e.custom?.fontFamily;"string"==typeof l&&(l={value:e.custom?.fontFamily||"",type:"google"});let o=l?.value;if(EXCLUDED_FONT_FAMILIES.includes(o))return;let i=e.custom?.fontVariants;if(i?.length||(i=[e.custom?.fontWeight]),l&&i?.length){let n=i.map(t=>"regular"===t?"400":t),a=e.custom?.fontWeight&&n.includes(e.custom?.fontWeight)?e.custom?.fontWeight:n[0];if(a){let i=uniqueArray([a,...e?.attrs?.isAlwaysLoadBold?["700"]:[],...e?.attrs?.loadFontStyles?.includes("bold")?["700"]:[]]);if(e?.attrs?.loadFontStyles?.includes("italic")){let t=i.map(t=>"string"==typeof t&&/^\d+$/.test(t)?`${t}i`:null).filter(t=>null!==t);i.push(...t)}let r=t.find(t=>t.family==o&&i.every(e=>t.variants.includes(e)));if(!r){let e=t.find(t=>t.family==o);e?i.forEach(t=>{e.variants.includes(t)||e.variants.push(t)}):("700"!==a&&n.includes("700")&&i.push("700"),t.push({family:o||"",variants:uniqueArray(i),subsets:[],type:l.type}))}}}};export{getFontFromGroupSetting,getFontsFromDataBuilder};
@@ -1,5 +1,5 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{useI18n as s,PageProvider as r,BuilderComponentProvider as n,I18nProvider as o,SectionProvider as i,BuilderProvider as l,Render as p}from"@gem-sdk/core";import{NextSeo as c}from"next-seo";import m from"next/head";import{useRouter as d}from"next/router";import{useTrackingView as g}from"../libs/hooks/use-tracking-view.js";import{parseHtml as u}from"../libs/parse-html.js";import f from"../components/builder/Header.js";import h from"../components/FooterForPostPurchase.js";import y from"next/script";import{useEffect as _}from"react";import{usePageViewedTracking as b}from"../libs/hooks/usePageViewedTracking.js";import{FontLink as k}from"../components/FontLink.js";let StaticPageV2=({components:v,builderData:S,sectionData:P,seo:x,themeStyle:N,fontStyle:j,elementFontStyle:T,customCodeHeader:F,shopToken:I,pageHandle:$,customFonts:w,isPostPurchase:E,shopName:H,productOffers:L,publicStoreFrontData:q,dynamicDiscountOffer:A,isPreview:M,interaction:O,pageBackground:z,sellingPlanSetting:C,buyerConsentPreCheck:D,id:U,shopID:V,domainTrackingIlp:B})=>{let R=d(),{t:G}=s(),J=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";g(I,$,R.isFallback),b({id:U,shopID:V,domain:B});let X="custom-code-header";if(_(()=>{let e=document.querySelectorAll(`[class*="${X}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),R.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 K=(O?.value||[]).length>0;return t(a,{children:[e(c,{...x}),t(m,{children:[u(X,F,!0),N&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:N}},"global-style"),w&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:w}},j),z?.isUsePageBackground&&z?.background&&e("style",{children:`
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 i,BuilderProvider as o,Render as p}from"@gem-sdk/core";import{NextSeo as c}from"next-seo";import g from"next/head";import{useRouter as m}from"next/router";import{useTrackingView as d}from"../libs/hooks/use-tracking-view.js";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 StaticPageV2=({components:v,builderData:S,sectionData:k,seo:x,themeStyle:P,fontStyle:N,elementFontStyle:T,customCodeHeader:j,shopToken:H,pageHandle:I,customFonts:L,isPostPurchase:M,shopName:$,productOffers:w,publicStoreFrontData:E,dynamicDiscountOffer:F,isPreview:q,interaction:A,pageBackground:O,sellingPlanSetting:z,buyerConsentPreCheck:C,id:D,shopID:U,domainTrackingIlp:V})=>{let B=m(),{t:R}=a(),G=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";d(H,I,B.isFallback),b({id:D,shopID:U,domain:V});let J="custom-code-header";if(_(()=>{let e=document.querySelectorAll(`[class*="${J}-"]`),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 X=(A?.value||[]).length>0;return t(s,{children:[e(c,{...x}),t(g,{children:[u(J,j,!0),P&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:P}},"global-style"),N&&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)),L&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:L}},N),O?.isUsePageBackground&&O?.background&&e("style",{children:`
2
2
  body {
3
- background: ${z.background};
3
+ background: ${O.background};
4
4
  }
5
- `},`page_background_${z?.background}`)]}),j&&e(k,{fontStyle:j,dataId:"google-fonts"}),T&&T.map((t,a)=>e(k,{fontStyle:t,dataId:"google-element-fonts"},a)),e(r,{productOffers:L,publicStoreFrontData:q,dynamicDiscountOffer:A,sellingPlanMeta:C,buyerConsentChecked:D,children:e(n,{components:v,children:e(o,{t:G,children:t("div",{className:`${E?"gp-bg-white post-purchase-page":""} `,role:"main",children:[E&&e(f,{pageType:"POST_PURCHASE"}),K&&e("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(O?.value||[])}</div>`}}),e(i,{data:P,children:S?.map(a=>t(l,{state:a.data,lazy:a.lazy,priority:a.priority,isPostPurchase:E,isPreview:M,children:[e(p,{uid:a.uid}),K&&e(y,{defer:!0,src:`${J}/assets-v2/gp-flow-action-lip-v7-5.js`})]},a.uid))}),E&&e(h,{shopName:H||""})]})})})})]})};export{StaticPageV2};
5
+ `},`page_background_${O?.background}`)]}),e(r,{productOffers:w,publicStoreFrontData:E,dynamicDiscountOffer:F,sellingPlanMeta:z,buyerConsentChecked:C,children:e(n,{components:v,children:e(l,{t:R,children:t("div",{className:`${M?"gp-bg-white post-purchase-page":""} `,role:"main",children:[M&&e(h,{pageType:"POST_PURCHASE"}),X&&e("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(A?.value||[])}</div>`}}),e(i,{data:k,children:S?.map(s=>t(o,{state:s.data,lazy:s.lazy,priority:s.priority,isPostPurchase:M,isPreview:q,children:[e(p,{uid:s.uid}),X&&e(y,{defer:!0,src:`${G}/assets-v2/gp-flow-action-lip-v7-5.js`})]},s.uid))}),M&&e(f,{shopName:$||""})]})})})})]})};export{StaticPageV2};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "17.0.0-staging.18",
3
+ "version": "17.0.1",
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-staging.14",
31
- "@gem-sdk/plugin-cookie-bar": "16.1.0-staging.0",
32
- "@gem-sdk/plugin-quick-view": "16.1.0-staging.0",
33
- "@gem-sdk/plugin-sticky-add-to-cart": "16.1.0-staging.0"
30
+ "@gem-sdk/core": "16.3.4",
31
+ "@gem-sdk/plugin-cookie-bar": "16.0.0",
32
+ "@gem-sdk/plugin-quick-view": "16.0.0",
33
+ "@gem-sdk/plugin-sticky-add-to-cart": "16.0.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "next": "14.2.35"
@@ -1 +0,0 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),Head=require("next/head"),genFonts=require("../libs/helpers/gen-fonts.js");const FontLink=({fontStyle:e,dataId:t})=>{let s=genFonts.extractImportUrls(e),n=e.replace(/@import url\(['"]?[^'")\s]+['"]?\);?/g,"").trim();return jsxRuntime.jsxs(Head,{children:[s.map(e=>jsxRuntime.jsx("link",{rel:"preload",as:"style",href:e,onLoad:"this.onload=null;this.rel='stylesheet'"},e)),n&&jsxRuntime.jsx("style",{"data-id":t,type:"text/css",dangerouslySetInnerHTML:{__html:n}})]})};exports.FontLink=FontLink;
@@ -1 +0,0 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"next/head";import{extractImportUrls as l}from"../libs/helpers/gen-fonts.js";let FontLink=({fontStyle:n,dataId:o})=>{let s=l(n),i=n.replace(/@import url\(['"]?[^'")\s]+['"]?\);?/g,"").trim();return e(r,{children:[s.map(e=>t("link",{rel:"preload",as:"style",href:e,onLoad:"this.onload=null;this.rel='stylesheet'"},e)),i&&t("style",{"data-id":o,type:"text/css",dangerouslySetInnerHTML:{__html:i}})]})};export{FontLink};