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

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";exports.PublishedThemePageMetafields=void 0,function(e){e.CUSTOM_CODE_HEADER="custom_code_header",e.CUSTOM_CODE_BODY="custom_code_body",e.ANALYTICS_GA_TRACKING_ID="analytics_ga_tracking_id",e.ANALYTICS_FB_PIXEL_ID="analytics_fb_pixel_id",e.ANALYTICS_TIKTOK_PIXEL_ID="analytics_tiktok_pixel_id",e.GLOBAL_META_DESCRIPTION="global-meta-description",e.GLOBAL_META_TITLE="global-meta-title",e.GLOBAL_META_THUMBNAIL="global-meta-thumbnail",e.NOINDEX_KEY="noindex",e.NOFOLLOW_KEY="nofollow"}(exports.PublishedThemePageMetafields||(exports.PublishedThemePageMetafields={})),exports.LIBRARY_TYPE_ENUM=void 0,function(e){e.TEMPLATES="templates",e.SECTIONS="sections",e.POST_PURCHASE_UPSELL="post-purchase-upsell",e.THEME_SECTIONS="theme-sections",e.EXISTING_PAGES="existing-page",e.OFFER_PAGE_TEMPLATES="offer-page-templates"}(exports.LIBRARY_TYPE_ENUM||(exports.LIBRARY_TYPE_ENUM={}));
1
+ "use strict";exports.PublishedThemePageMetafields=void 0,function(e){e.CUSTOM_CODE_HEADER="custom_code_header",e.CUSTOM_CODE_BODY="custom_code_body",e.ANALYTICS_GA_TRACKING_ID="analytics_ga_tracking_id",e.ANALYTICS_FB_PIXEL_ID="analytics_fb_pixel_id",e.ANALYTICS_TIKTOK_PIXEL_ID="analytics_tiktok_pixel_id",e.GLOBAL_META_DESCRIPTION="global-meta-description",e.GLOBAL_META_TITLE="global-meta-title",e.GLOBAL_META_THUMBNAIL="global-meta-thumbnail",e.NOINDEX_KEY="noindex",e.NOFOLLOW_KEY="nofollow",e.ILP_DISABLE_GS_FONT="ilp_disable_gs_font"}(exports.PublishedThemePageMetafields||(exports.PublishedThemePageMetafields={})),exports.LIBRARY_TYPE_ENUM=void 0,function(e){e.TEMPLATES="templates",e.SECTIONS="sections",e.POST_PURCHASE_UPSELL="post-purchase-upsell",e.THEME_SECTIONS="theme-sections",e.EXISTING_PAGES="existing-page",e.OFFER_PAGE_TEMPLATES="offer-page-templates"}(exports.LIBRARY_TYPE_ENUM||(exports.LIBRARY_TYPE_ENUM={}));
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),adapterShopify=require("@gem-sdk/adapter-shopify"),googleFonts=require("../google-fonts.js"),genCss=require("../helpers/gen-css.js"),getFallback=require("../helpers/get-fallback.js"),normalize=require("../helpers/normalize.js"),parseJson=require("../helpers/parse-json.js"),nextjs=require("@sentry/nextjs"),index=require("../../constants/index.js"),getMetafield=require("../helpers/get-metafield.js"),customFonts=require("../custom-fonts.js"),generateSeoLinks=require("../helpers/generate-seo-links.js");const getHomePagePropsV2=(e,a)=>async()=>{try{let t={slugType:"STATIC"},[s,l,i,o]=await Promise.allSettled([e([core.PublishedThemePagesDocument,t]),e([core.StorePropertyDocument]),a([adapterShopify.ShopMetaDocument]),e([core.PublishedShopMetasDocument,{keys:["source_font",index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===s.status)throw Error(s.reason?.[0]);let d="fulfilled"===o.status?o.value:void 0,n=d?.publishedShopMetas?.find(e=>e?.key==="source_font"),r=s.value?.publishedThemePages?.[0],u=s.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!r)throw Error("No data builder found for Home page");let g=normalize.parseBuilderTemplateV2(r),[h,m,p,c]=await Promise.all([googleFonts.getStaticFontFacesFromPageTemplate({pageTemplate:g,sourceFont:n?.value,data:r?.pageStyle?.data}),googleFonts.getStaticFontFacesFromGlobalStyle({data:r?.pageStyle?.data,sourceFont:n?.value}),getFallback.getFallbackV2(e,g),customFonts.getCustomFonts(u)]),P=r.isMobile??!1,f=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,r?.metafields)||d?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,T=parseJson.parseJson(getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,r?.metafields)||d?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),M="fulfilled"===i.status?i.value:void 0,y="fulfilled"===l.status?l.value:void 0,b=y?.storeProperty?.favicon??"/favicon/favicon-32x32.png",S={defaultTitle:M?.shop.name,title:r?.name??"Home",description:f??M?.shop.description,openGraph:{locale:M?.localization.country.isoCode,title:r?.name??M?.shop.name,description:f??M?.shop.description,images:T?[T]:[]},additionalMetaTags:[{name:"theme-color",content:"#000000"}],canonical:`https://${y?.storeProperty?.primaryDomain}/`,additionalLinkTags:generateSeoLinks.generateSeoLinks({favicon:b,shopMeta:M})},_=M?.localization.language.isoCode??null,A=M?.localization.country.isoCode??null,I=_&&A?`${_}-${A}`:null;return parseJson.serializableJson({id:s.value?.publishedThemePages?.[0]?.id??null,shopID:s.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:genCss.genCSS(r?.pageStyle?.data,P),fontStyle:m,elementFontStyle:h,builderData:g,swr:{fallback:p},moneyFormat:M?.shop.moneyFormat??null,currency:M?.localization.country.currency.isoCode??null,languageIsoCode:_,countryIsoCode:A,locale:I,swatches:parseJson.parseJson(y?.storeProperty?.swatchesConfig),seo:S,mobileOnly:P,gaTrackingId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_GA_TRACKING_ID,r?.metafields)??null,facebookPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_FB_PIXEL_ID,r?.metafields)??null,tiktokPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_TIKTOK_PIXEL_ID,r?.metafields)??null,customCodeHeader:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_HEADER,r?.metafields)??null,customCodeBody:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_BODY,r?.metafields)??null,pageHandle:r.handle??null,customFonts:c})}catch(e){throw nextjs.captureException(e),e}};exports.getHomePagePropsV2=getHomePagePropsV2;
1
+ "use strict";var core=require("@gem-sdk/core"),adapterShopify=require("@gem-sdk/adapter-shopify"),googleFonts=require("../google-fonts.js"),genCss=require("../helpers/gen-css.js"),getFallback=require("../helpers/get-fallback.js"),normalize=require("../helpers/normalize.js"),parseJson=require("../helpers/parse-json.js"),nextjs=require("@sentry/nextjs"),index=require("../../constants/index.js"),getMetafield=require("../helpers/get-metafield.js"),customFonts=require("../custom-fonts.js"),generateSeoLinks=require("../helpers/generate-seo-links.js");const getHomePagePropsV2=(e,t)=>async()=>{try{let a={slugType:"STATIC"},[l,s,i,o]=await Promise.allSettled([e([core.PublishedThemePagesDocument,a]),e([core.StorePropertyDocument.toString()]),t([adapterShopify.ShopMetaDocument]),e([core.PublishedShopMetasDocument,{keys:["source_font",index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===l.status)throw Error(l.reason?.[0]);let d="fulfilled"===o.status?o.value:void 0,n=d?.publishedShopMetas?.find(e=>e?.key==="source_font"),r=l.value?.publishedThemePages?.[0],u=l.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!r)throw Error("No data builder found for Home page");let g=normalize.parseBuilderTemplateV2(r),[h,m,P,p]=await Promise.all([googleFonts.getStaticFontFacesFromPageTemplate({pageTemplate:g,sourceFont:n?.value,data:r?.pageStyle?.data}),googleFonts.getStaticFontFacesFromGlobalStyle({data:r?.pageStyle?.data,sourceFont:n?.value}),getFallback.getFallbackV2(e,g),customFonts.getCustomFonts(u)]),f=r.isMobile??!1,c=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,r?.metafields)||d?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,T=parseJson.parseJson(getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,r?.metafields)||d?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),M="true"===getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ILP_DISABLE_GS_FONT,r?.metafields),y="fulfilled"===i.status?i.value:void 0,b="fulfilled"===s.status?s.value:void 0,S=b?.storeProperty?.favicon??"/favicon/favicon-32x32.png",_={defaultTitle:y?.shop.name,title:r?.name??"Home",description:c??y?.shop.description,openGraph:{locale:y?.localization.country.isoCode,title:r?.name??y?.shop.name,description:c??y?.shop.description,images:T?[T]:[]},additionalMetaTags:[{name:"theme-color",content:"#000000"}],canonical:`https://${b?.storeProperty?.primaryDomain}/`,additionalLinkTags:generateSeoLinks.generateSeoLinks({favicon:S,shopMeta:y})},I=y?.localization.language.isoCode??null,A=y?.localization.country.isoCode??null,L=I&&A?`${I}-${A}`:null;return parseJson.serializableJson({id:l.value?.publishedThemePages?.[0]?.id??null,shopID:l.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:genCss.genCSS(r?.pageStyle?.data,f),fontStyle:m,elementFontStyle:h,builderData:g,swr:{fallback:P},moneyFormat:y?.shop.moneyFormat??null,currency:y?.localization.country.currency.isoCode??null,languageIsoCode:I,countryIsoCode:A,locale:L,swatches:parseJson.parseJson(b?.storeProperty?.swatchesConfig),seo:_,mobileOnly:f,disableGsFont:M,gaTrackingId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_GA_TRACKING_ID,r?.metafields)??null,facebookPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_FB_PIXEL_ID,r?.metafields)??null,tiktokPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_TIKTOK_PIXEL_ID,r?.metafields)??null,customCodeHeader:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_HEADER,r?.metafields)??null,customCodeBody:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_BODY,r?.metafields)??null,pageHandle:r.handle??null,customFonts:p})}catch(e){throw nextjs.captureException(e),e}};exports.getHomePagePropsV2=getHomePagePropsV2;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),adapterShopify=require("@gem-sdk/adapter-shopify"),googleFonts=require("../google-fonts.js"),genCss=require("../helpers/gen-css.js"),getFallback=require("../helpers/get-fallback.js"),normalize=require("../helpers/normalize.js"),parseJson=require("../helpers/parse-json.js"),nextjs=require("@sentry/nextjs"),customFonts=require("../custom-fonts.js"),getMetafield=require("../helpers/get-metafield.js"),index=require("../../constants/index.js"),generateSeoLinks=require("../helpers/generate-seo-links.js");const getStaticPagePropsV2=(e,a)=>async t=>{try{let l="STATIC",i={slug:t,slugType:l},[s,o,d,n]=await Promise.allSettled([e([core.PublishedThemePagesDocument,i]),e([core.StorePropertyDocument]),a([adapterShopify.ShopMetaDocument]),e([core.PublishedShopMetasDocument,{keys:["source_font",index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===s.status)throw Error(s.reason?.[0]);let r="fulfilled"===n.status?n.value:void 0,u=r?.publishedShopMetas?.find(e=>e?.key==="source_font"),h=s.value.publishedThemePages?.[0],g=s.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!h)throw Error(`No data builder found for slug: /${t}`);let P=normalize.parseBuilderTemplateV2(h),[m,f,c,p]=await Promise.all([googleFonts.getStaticFontFacesFromPageTemplate({pageTemplate:P,sourceFont:u?.value,data:h?.pageStyle?.data}),googleFonts.getStaticFontFacesFromGlobalStyle({data:h?.pageStyle?.data,sourceFont:u?.value}),getFallback.getFallbackV2(e,P),customFonts.getCustomFonts(g)]),T=h.isMobile??!1,M=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,h?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,y=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_TITLE,h?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_TITLE)?.value,b=parseJson.parseJson(getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,h?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),S=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.NOINDEX_KEY,h?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.NOINDEX_KEY)?.value,_=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.NOFOLLOW_KEY,h?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.NOFOLLOW_KEY)?.value,L="fulfilled"===d.status?d.value:void 0,x="fulfilled"===o.status?o.value:void 0,A=x?.storeProperty?.favicon??"/favicon/favicon-32x32.png",I={defaultTitle:L?.shop.name,title:y||h?.name,description:M??L?.shop.description,openGraph:{locale:L?.localization.country.isoCode,title:(y||h?.name)??L?.shop.name,description:M??L?.shop.description,images:b?[b]:[]},noindex:"true"===S,nofollow:"true"===_,canonical:`https://${x?.storeProperty?.primaryDomain}/${t}`,additionalMetaTags:[{name:"theme-color",content:"#000000"}],additionalLinkTags:generateSeoLinks.generateSeoLinks({favicon:A,shopMeta:L})},E=L?.localization.language.isoCode??null,B=L?.localization.country.isoCode??null,O=E&&B?`${E}-${B}`:null;return parseJson.serializableJson({id:s.value?.publishedThemePages?.[0]?.id??null,shopID:s.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:genCss.genCSS(h?.pageStyle?.data,T),fontStyle:f,elementFontStyle:m,builderData:P,pageType:l,moneyFormat:L?.shop.moneyFormat??null,currency:L?.localization.country.currency.isoCode??null,languageIsoCode:E,countryIsoCode:B,locale:O,swr:{fallback:c},swatches:parseJson.parseJson(x?.storeProperty?.swatchesConfig),seo:I,mobileOnly:T,gaTrackingId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_GA_TRACKING_ID,h?.metafields)??null,facebookPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_FB_PIXEL_ID,h?.metafields)??null,tiktokPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_TIKTOK_PIXEL_ID,h?.metafields)??null,customCodeHeader:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_HEADER,h?.metafields)??null,customCodeBody:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_BODY,h?.metafields)??null,pageHandle:h.handle??null,customFonts:p,interaction:h?.interaction,pageBackground:normalize.extractPageBackground(h)})}catch(e){throw nextjs.captureException(e),e}};exports.getStaticPagePropsV2=getStaticPagePropsV2;
1
+ "use strict";var core=require("@gem-sdk/core"),adapterShopify=require("@gem-sdk/adapter-shopify"),googleFonts=require("../google-fonts.js"),genCss=require("../helpers/gen-css.js"),getFallback=require("../helpers/get-fallback.js"),normalize=require("../helpers/normalize.js"),parseJson=require("../helpers/parse-json.js"),nextjs=require("@sentry/nextjs"),customFonts=require("../custom-fonts.js"),getMetafield=require("../helpers/get-metafield.js"),index=require("../../constants/index.js"),generateSeoLinks=require("../helpers/generate-seo-links.js");const getStaticPagePropsV2=(e,t)=>async a=>{try{let l="STATIC",i={slug:a,slugType:l},[s,o,d,n]=await Promise.allSettled([e([core.PublishedThemePagesDocument,i]),e([core.StorePropertyDocument.toString()]),t([adapterShopify.ShopMetaDocument]),e([core.PublishedShopMetasDocument,{keys:["source_font",index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===s.status)throw Error(s.reason?.[0]);let r="fulfilled"===n.status?n.value:void 0,u=r?.publishedShopMetas?.find(e=>e?.key==="source_font"),g=s.value.publishedThemePages?.[0],h=s.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!g)throw Error(`No data builder found for slug: /${a}`);let P=normalize.parseBuilderTemplateV2(g),[m,f,c,p]=await Promise.all([googleFonts.getStaticFontFacesFromPageTemplate({pageTemplate:P,sourceFont:u?.value,data:g?.pageStyle?.data}),googleFonts.getStaticFontFacesFromGlobalStyle({data:g?.pageStyle?.data,sourceFont:u?.value}),getFallback.getFallbackV2(e,P),customFonts.getCustomFonts(h)]),T=g.isMobile??!1,M=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION,g?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_DESCRIPTION)?.value,y=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_TITLE,g?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_TITLE)?.value,b=parseJson.parseJson(getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL,g?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.GLOBAL_META_THUMBNAIL)?.value),S=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.NOINDEX_KEY,g?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.NOINDEX_KEY)?.value,_=getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.NOFOLLOW_KEY,g?.metafields)||r?.publishedShopMetas?.find(e=>e?.key===index.PublishedThemePageMetafields.NOFOLLOW_KEY)?.value;console.log("\uD83D\uDE80 ~ getStaticPagePropsV2 ~ dataBuilder?.metafields:",g?.metafields);let L="true"===getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ILP_DISABLE_GS_FONT,g?.metafields);console.log("\uD83D\uDE80 ~ getStaticPagePropsV2 ~ disableGsFont 1:",L);let I="fulfilled"===d.status?d.value:void 0,x="fulfilled"===o.status?o.value:void 0,A=x?.storeProperty?.favicon??"/favicon/favicon-32x32.png",B={defaultTitle:I?.shop.name,title:y||g?.name,description:M??I?.shop.description,openGraph:{locale:I?.localization.country.isoCode,title:(y||g?.name)??I?.shop.name,description:M??I?.shop.description,images:b?[b]:[]},noindex:"true"===S,nofollow:"true"===_,canonical:`https://${x?.storeProperty?.primaryDomain}/${a}`,additionalMetaTags:[{name:"theme-color",content:"#000000"}],additionalLinkTags:generateSeoLinks.generateSeoLinks({favicon:A,shopMeta:I})},E=I?.localization.language.isoCode??null,F=I?.localization.country.isoCode??null,O=E&&F?`${E}-${F}`:null;return parseJson.serializableJson({id:s.value?.publishedThemePages?.[0]?.id??null,shopID:s.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:genCss.genCSS(g?.pageStyle?.data,T),fontStyle:f,elementFontStyle:m,builderData:P,pageType:l,moneyFormat:I?.shop.moneyFormat??null,currency:I?.localization.country.currency.isoCode??null,languageIsoCode:E,countryIsoCode:F,locale:O,swr:{fallback:c},swatches:parseJson.parseJson(x?.storeProperty?.swatchesConfig),seo:B,mobileOnly:T,disableGsFont:L,gaTrackingId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_GA_TRACKING_ID,g?.metafields)??null,facebookPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_FB_PIXEL_ID,g?.metafields)??null,tiktokPixelId:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.ANALYTICS_TIKTOK_PIXEL_ID,g?.metafields)??null,customCodeHeader:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_HEADER,g?.metafields)??null,customCodeBody:getMetafield.getPublishedThemePageMetafieldByKey(index.PublishedThemePageMetafields.CUSTOM_CODE_BODY,g?.metafields)??null,pageHandle:g.handle??null,customFonts:p,interaction:g?.interaction,pageBackground:normalize.extractPageBackground(g)})}catch(e){throw nextjs.captureException(e),e}};exports.getStaticPagePropsV2=getStaticPagePropsV2;
@@ -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"),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:_,disableGsFont:S})=>{let v=router.useRouter(),{t:b}=core.useI18n(),q=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";useTrackingView.useTrackingView(u,l,v.isFallback),usePageViewedTracking.usePageViewedTracking({id:k,shopID:y,domain:_});let F="custom-code-header";if(react.useEffect(()=>{let e=document.querySelectorAll(`[class*="${F}-"]`),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(F,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:`
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}`)]}),n&&!S&&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: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:`${q}/assets-v2/gp-flow-action-lip-v7-5.js`})]},e.uid))}),d&&jsxRuntime.jsx(FooterForPostPurchase.default,{shopName:g||""})]})})})})]})};exports.StaticPageV2=StaticPageV2;
@@ -1 +1 @@
1
- var PublishedThemePageMetafields,LIBRARY_TYPE_ENUM;!function(e){e.CUSTOM_CODE_HEADER="custom_code_header",e.CUSTOM_CODE_BODY="custom_code_body",e.ANALYTICS_GA_TRACKING_ID="analytics_ga_tracking_id",e.ANALYTICS_FB_PIXEL_ID="analytics_fb_pixel_id",e.ANALYTICS_TIKTOK_PIXEL_ID="analytics_tiktok_pixel_id",e.GLOBAL_META_DESCRIPTION="global-meta-description",e.GLOBAL_META_TITLE="global-meta-title",e.GLOBAL_META_THUMBNAIL="global-meta-thumbnail",e.NOINDEX_KEY="noindex",e.NOFOLLOW_KEY="nofollow"}(PublishedThemePageMetafields||(PublishedThemePageMetafields={})),function(e){e.TEMPLATES="templates",e.SECTIONS="sections",e.POST_PURCHASE_UPSELL="post-purchase-upsell",e.THEME_SECTIONS="theme-sections",e.EXISTING_PAGES="existing-page",e.OFFER_PAGE_TEMPLATES="offer-page-templates"}(LIBRARY_TYPE_ENUM||(LIBRARY_TYPE_ENUM={}));export{LIBRARY_TYPE_ENUM,PublishedThemePageMetafields};
1
+ var PublishedThemePageMetafields,LIBRARY_TYPE_ENUM;!function(_){_.CUSTOM_CODE_HEADER="custom_code_header",_.CUSTOM_CODE_BODY="custom_code_body",_.ANALYTICS_GA_TRACKING_ID="analytics_ga_tracking_id",_.ANALYTICS_FB_PIXEL_ID="analytics_fb_pixel_id",_.ANALYTICS_TIKTOK_PIXEL_ID="analytics_tiktok_pixel_id",_.GLOBAL_META_DESCRIPTION="global-meta-description",_.GLOBAL_META_TITLE="global-meta-title",_.GLOBAL_META_THUMBNAIL="global-meta-thumbnail",_.NOINDEX_KEY="noindex",_.NOFOLLOW_KEY="nofollow",_.ILP_DISABLE_GS_FONT="ilp_disable_gs_font"}(PublishedThemePageMetafields||(PublishedThemePageMetafields={})),function(_){_.TEMPLATES="templates",_.SECTIONS="sections",_.POST_PURCHASE_UPSELL="post-purchase-upsell",_.THEME_SECTIONS="theme-sections",_.EXISTING_PAGES="existing-page",_.OFFER_PAGE_TEMPLATES="offer-page-templates"}(LIBRARY_TYPE_ENUM||(LIBRARY_TYPE_ENUM={}));export{LIBRARY_TYPE_ENUM,PublishedThemePageMetafields};
@@ -1 +1 @@
1
- import{PublishedThemePagesDocument as e,StorePropertyDocument as o,PublishedShopMetasDocument as t}from"@gem-sdk/core";import{ShopMetaDocument as a}from"@gem-sdk/adapter-shopify";import{getStaticFontFacesFromPageTemplate as l,getStaticFontFacesFromGlobalStyle as s}from"../google-fonts.js";import{genCSS as i}from"../helpers/gen-css.js";import{getFallbackV2 as r}from"../helpers/get-fallback.js";import{parseBuilderTemplateV2 as n}from"../helpers/normalize.js";import{parseJson as m,serializableJson as d}from"../helpers/parse-json.js";import{captureException as p}from"@sentry/nextjs";import{PublishedThemePageMetafields as u}from"../../constants/index.js";import{getPublishedThemePageMetafieldByKey as f}from"../helpers/get-metafield.js";import{getCustomFonts as c}from"../custom-fonts.js";import{generateSeoLinks as h}from"../helpers/generate-seo-links.js";let getHomePagePropsV2=(g,T)=>async()=>{try{let p={slugType:"STATIC"},[_,y,A,I]=await Promise.allSettled([g([e,p]),g([o]),T([a]),g([t,{keys:["source_font",u.GLOBAL_META_DESCRIPTION,u.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===_.status)throw Error(_.reason?.[0]);let L="fulfilled"===I.status?I.value:void 0,P=L?.publishedShopMetas?.find(e=>e?.key==="source_font"),C=_.value?.publishedThemePages?.[0],v=_.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!C)throw Error("No data builder found for Home page");let E=n(C),[S,M,O,D]=await Promise.all([l({pageTemplate:E,sourceFont:P?.value,data:C?.pageStyle?.data}),s({data:C?.pageStyle?.data,sourceFont:P?.value}),r(g,E),c(v)]),k=C.isMobile??!1,b=f(u.GLOBAL_META_DESCRIPTION,C?.metafields)||L?.publishedShopMetas?.find(e=>e?.key===u.GLOBAL_META_DESCRIPTION)?.value,j=m(f(u.GLOBAL_META_THUMBNAIL,C?.metafields)||L?.publishedShopMetas?.find(e=>e?.key===u.GLOBAL_META_THUMBNAIL)?.value),B="fulfilled"===A.status?A.value:void 0,N="fulfilled"===y.status?y.value:void 0,H=N?.storeProperty?.favicon??"/favicon/favicon-32x32.png",G={defaultTitle:B?.shop.name,title:C?.name??"Home",description:b??B?.shop.description,openGraph:{locale:B?.localization.country.isoCode,title:C?.name??B?.shop.name,description:b??B?.shop.description,images:j?[j]:[]},additionalMetaTags:[{name:"theme-color",content:"#000000"}],canonical:`https://${N?.storeProperty?.primaryDomain}/`,additionalLinkTags:h({favicon:H,shopMeta:B})},w=B?.localization.language.isoCode??null,x=B?.localization.country.isoCode??null,F=w&&x?`${w}-${x}`:null;return d({id:_.value?.publishedThemePages?.[0]?.id??null,shopID:_.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:i(C?.pageStyle?.data,k),fontStyle:M,elementFontStyle:S,builderData:E,swr:{fallback:O},moneyFormat:B?.shop.moneyFormat??null,currency:B?.localization.country.currency.isoCode??null,languageIsoCode:w,countryIsoCode:x,locale:F,swatches:m(N?.storeProperty?.swatchesConfig),seo:G,mobileOnly:k,gaTrackingId:f(u.ANALYTICS_GA_TRACKING_ID,C?.metafields)??null,facebookPixelId:f(u.ANALYTICS_FB_PIXEL_ID,C?.metafields)??null,tiktokPixelId:f(u.ANALYTICS_TIKTOK_PIXEL_ID,C?.metafields)??null,customCodeHeader:f(u.CUSTOM_CODE_HEADER,C?.metafields)??null,customCodeBody:f(u.CUSTOM_CODE_BODY,C?.metafields)??null,pageHandle:C.handle??null,customFonts:D})}catch(e){throw p(e),e}};export{getHomePagePropsV2};
1
+ import{PublishedThemePagesDocument as e,StorePropertyDocument as o,PublishedShopMetasDocument as t}from"@gem-sdk/core";import{ShopMetaDocument as a}from"@gem-sdk/adapter-shopify";import{getStaticFontFacesFromPageTemplate as l,getStaticFontFacesFromGlobalStyle as s}from"../google-fonts.js";import{genCSS as i}from"../helpers/gen-css.js";import{getFallbackV2 as r}from"../helpers/get-fallback.js";import{parseBuilderTemplateV2 as n}from"../helpers/normalize.js";import{parseJson as m,serializableJson as d}from"../helpers/parse-json.js";import{captureException as p}from"@sentry/nextjs";import{PublishedThemePageMetafields as u}from"../../constants/index.js";import{getPublishedThemePageMetafieldByKey as f}from"../helpers/get-metafield.js";import{getCustomFonts as c}from"../custom-fonts.js";import{generateSeoLinks as h}from"../helpers/generate-seo-links.js";let getHomePagePropsV2=(g,T)=>async()=>{try{let p={slugType:"STATIC"},[_,I,A,y]=await Promise.allSettled([g([e,p]),g([o.toString()]),T([a]),g([t,{keys:["source_font",u.GLOBAL_META_DESCRIPTION,u.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===_.status)throw Error(_.reason?.[0]);let L="fulfilled"===y.status?y.value:void 0,P=L?.publishedShopMetas?.find(e=>e?.key==="source_font"),C=_.value?.publishedThemePages?.[0],S=_.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!C)throw Error("No data builder found for Home page");let E=n(C),[v,M,O,D]=await Promise.all([l({pageTemplate:E,sourceFont:P?.value,data:C?.pageStyle?.data}),s({data:C?.pageStyle?.data,sourceFont:P?.value}),r(g,E),c(S)]),k=C.isMobile??!1,B=f(u.GLOBAL_META_DESCRIPTION,C?.metafields)||L?.publishedShopMetas?.find(e=>e?.key===u.GLOBAL_META_DESCRIPTION)?.value,b=m(f(u.GLOBAL_META_THUMBNAIL,C?.metafields)||L?.publishedShopMetas?.find(e=>e?.key===u.GLOBAL_META_THUMBNAIL)?.value),j="true"===f(u.ILP_DISABLE_GS_FONT,C?.metafields),N="fulfilled"===A.status?A.value:void 0,G="fulfilled"===I.status?I.value:void 0,H=G?.storeProperty?.favicon??"/favicon/favicon-32x32.png",w={defaultTitle:N?.shop.name,title:C?.name??"Home",description:B??N?.shop.description,openGraph:{locale:N?.localization.country.isoCode,title:C?.name??N?.shop.name,description:B??N?.shop.description,images:b?[b]:[]},additionalMetaTags:[{name:"theme-color",content:"#000000"}],canonical:`https://${G?.storeProperty?.primaryDomain}/`,additionalLinkTags:h({favicon:H,shopMeta:N})},F=N?.localization.language.isoCode??null,x=N?.localization.country.isoCode??null,z=F&&x?`${F}-${x}`:null;return d({id:_.value?.publishedThemePages?.[0]?.id??null,shopID:_.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:i(C?.pageStyle?.data,k),fontStyle:M,elementFontStyle:v,builderData:E,swr:{fallback:O},moneyFormat:N?.shop.moneyFormat??null,currency:N?.localization.country.currency.isoCode??null,languageIsoCode:F,countryIsoCode:x,locale:z,swatches:m(G?.storeProperty?.swatchesConfig),seo:w,mobileOnly:k,disableGsFont:j,gaTrackingId:f(u.ANALYTICS_GA_TRACKING_ID,C?.metafields)??null,facebookPixelId:f(u.ANALYTICS_FB_PIXEL_ID,C?.metafields)??null,tiktokPixelId:f(u.ANALYTICS_TIKTOK_PIXEL_ID,C?.metafields)??null,customCodeHeader:f(u.CUSTOM_CODE_HEADER,C?.metafields)??null,customCodeBody:f(u.CUSTOM_CODE_BODY,C?.metafields)??null,pageHandle:C.handle??null,customFonts:D})}catch(e){throw p(e),e}};export{getHomePagePropsV2};
@@ -1 +1 @@
1
- import{PublishedThemePagesDocument as e,StorePropertyDocument as o,PublishedShopMetasDocument as t}from"@gem-sdk/core";import{ShopMetaDocument as a}from"@gem-sdk/adapter-shopify";import{getStaticFontFacesFromPageTemplate as l,getStaticFontFacesFromGlobalStyle as s}from"../google-fonts.js";import{genCSS as i}from"../helpers/gen-css.js";import{getFallbackV2 as r}from"../helpers/get-fallback.js";import{parseBuilderTemplateV2 as n,extractPageBackground as d}from"../helpers/normalize.js";import{parseJson as u,serializableJson as p}from"../helpers/parse-json.js";import{captureException as m}from"@sentry/nextjs";import{getCustomFonts as f}from"../custom-fonts.js";import{getPublishedThemePageMetafieldByKey as c}from"../helpers/get-metafield.js";import{PublishedThemePageMetafields as h}from"../../constants/index.js";import{generateSeoLinks as T}from"../helpers/generate-seo-links.js";let getStaticPagePropsV2=(_,g)=>async L=>{try{let m="STATIC",A={slug:L,slugType:m},[I,y,E,O]=await Promise.allSettled([_([e,A]),_([o]),g([a]),_([t,{keys:["source_font",h.GLOBAL_META_DESCRIPTION,h.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===I.status)throw Error(I.reason?.[0]);let S="fulfilled"===O.status?O.value:void 0,M=S?.publishedShopMetas?.find(e=>e?.key==="source_font"),P=I.value.publishedThemePages?.[0],v=I.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!P)throw Error(`No data builder found for slug: /${L}`);let C=n(P),[k,N,D,b]=await Promise.all([l({pageTemplate:C,sourceFont:M?.value,data:P?.pageStyle?.data}),s({data:P?.pageStyle?.data,sourceFont:M?.value}),r(_,C),f(v)]),B=P.isMobile??!1,j=c(h.GLOBAL_META_DESCRIPTION,P?.metafields)||S?.publishedShopMetas?.find(e=>e?.key===h.GLOBAL_META_DESCRIPTION)?.value,G=c(h.GLOBAL_META_TITLE,P?.metafields)||S?.publishedShopMetas?.find(e=>e?.key===h.GLOBAL_META_TITLE)?.value,w=u(c(h.GLOBAL_META_THUMBNAIL,P?.metafields)||S?.publishedShopMetas?.find(e=>e?.key===h.GLOBAL_META_THUMBNAIL)?.value),F=c(h.NOINDEX_KEY,P?.metafields)||S?.publishedShopMetas?.find(e=>e?.key===h.NOINDEX_KEY)?.value,Y=c(h.NOFOLLOW_KEY,P?.metafields)||S?.publishedShopMetas?.find(e=>e?.key===h.NOFOLLOW_KEY)?.value,x="fulfilled"===E.status?E.value:void 0,K="fulfilled"===y.status?y.value:void 0,H=K?.storeProperty?.favicon??"/favicon/favicon-32x32.png",z={defaultTitle:x?.shop.name,title:G||P?.name,description:j??x?.shop.description,openGraph:{locale:x?.localization.country.isoCode,title:(G||P?.name)??x?.shop.name,description:j??x?.shop.description,images:w?[w]:[]},noindex:"true"===F,nofollow:"true"===Y,canonical:`https://${K?.storeProperty?.primaryDomain}/${L}`,additionalMetaTags:[{name:"theme-color",content:"#000000"}],additionalLinkTags:T({favicon:H,shopMeta:x})},R=x?.localization.language.isoCode??null,U=x?.localization.country.isoCode??null,$=R&&U?`${R}-${U}`:null;return p({id:I.value?.publishedThemePages?.[0]?.id??null,shopID:I.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:i(P?.pageStyle?.data,B),fontStyle:N,elementFontStyle:k,builderData:C,pageType:m,moneyFormat:x?.shop.moneyFormat??null,currency:x?.localization.country.currency.isoCode??null,languageIsoCode:R,countryIsoCode:U,locale:$,swr:{fallback:D},swatches:u(K?.storeProperty?.swatchesConfig),seo:z,mobileOnly:B,gaTrackingId:c(h.ANALYTICS_GA_TRACKING_ID,P?.metafields)??null,facebookPixelId:c(h.ANALYTICS_FB_PIXEL_ID,P?.metafields)??null,tiktokPixelId:c(h.ANALYTICS_TIKTOK_PIXEL_ID,P?.metafields)??null,customCodeHeader:c(h.CUSTOM_CODE_HEADER,P?.metafields)??null,customCodeBody:c(h.CUSTOM_CODE_BODY,P?.metafields)??null,pageHandle:P.handle??null,customFonts:b,interaction:P?.interaction,pageBackground:d(P)})}catch(e){throw m(e),e}};export{getStaticPagePropsV2};
1
+ import{PublishedThemePagesDocument as e,StorePropertyDocument as t,PublishedShopMetasDocument as o}from"@gem-sdk/core";import{ShopMetaDocument as a}from"@gem-sdk/adapter-shopify";import{getStaticFontFacesFromPageTemplate as l,getStaticFontFacesFromGlobalStyle as s}from"../google-fonts.js";import{genCSS as i}from"../helpers/gen-css.js";import{getFallbackV2 as r}from"../helpers/get-fallback.js";import{parseBuilderTemplateV2 as n,extractPageBackground as d}from"../helpers/normalize.js";import{parseJson as u,serializableJson as p}from"../helpers/parse-json.js";import{captureException as m}from"@sentry/nextjs";import{getCustomFonts as f}from"../custom-fonts.js";import{getPublishedThemePageMetafieldByKey as c}from"../helpers/get-metafield.js";import{PublishedThemePageMetafields as h}from"../../constants/index.js";import{generateSeoLinks as g}from"../helpers/generate-seo-links.js";let getStaticPagePropsV2=(T,_)=>async L=>{try{let m="STATIC",I={slug:L,slugType:m},[A,y,E,S]=await Promise.allSettled([T([e,I]),T([t.toString()]),_([a]),T([o,{keys:["source_font",h.GLOBAL_META_DESCRIPTION,h.GLOBAL_META_THUMBNAIL]}])]);if("rejected"===A.status)throw Error(A.reason?.[0]);let O="fulfilled"===S.status?S.value:void 0,P=O?.publishedShopMetas?.find(e=>e?.key==="source_font"),M=A.value.publishedThemePages?.[0],v=A.value?.publishedThemePages?.[0]?.themePageCustomFonts;if(!M)throw Error(`No data builder found for slug: /${L}`);let C=n(M),[N,k,B,D]=await Promise.all([l({pageTemplate:C,sourceFont:P?.value,data:M?.pageStyle?.data}),s({data:M?.pageStyle?.data,sourceFont:P?.value}),r(T,C),f(v)]),b=M.isMobile??!1,G=c(h.GLOBAL_META_DESCRIPTION,M?.metafields)||O?.publishedShopMetas?.find(e=>e?.key===h.GLOBAL_META_DESCRIPTION)?.value,j=c(h.GLOBAL_META_TITLE,M?.metafields)||O?.publishedShopMetas?.find(e=>e?.key===h.GLOBAL_META_TITLE)?.value,F=u(c(h.GLOBAL_META_THUMBNAIL,M?.metafields)||O?.publishedShopMetas?.find(e=>e?.key===h.GLOBAL_META_THUMBNAIL)?.value),w=c(h.NOINDEX_KEY,M?.metafields)||O?.publishedShopMetas?.find(e=>e?.key===h.NOINDEX_KEY)?.value,Y=c(h.NOFOLLOW_KEY,M?.metafields)||O?.publishedShopMetas?.find(e=>e?.key===h.NOFOLLOW_KEY)?.value;console.log("\uD83D\uDE80 ~ getStaticPagePropsV2 ~ dataBuilder?.metafields:",M?.metafields);let x="true"===c(h.ILP_DISABLE_GS_FONT,M?.metafields);console.log("\uD83D\uDE80 ~ getStaticPagePropsV2 ~ disableGsFont 1:",x);let K="fulfilled"===E.status?E.value:void 0,H="fulfilled"===y.status?y.value:void 0,z=H?.storeProperty?.favicon??"/favicon/favicon-32x32.png",R={defaultTitle:K?.shop.name,title:j||M?.name,description:G??K?.shop.description,openGraph:{locale:K?.localization.country.isoCode,title:(j||M?.name)??K?.shop.name,description:G??K?.shop.description,images:F?[F]:[]},noindex:"true"===w,nofollow:"true"===Y,canonical:`https://${H?.storeProperty?.primaryDomain}/${L}`,additionalMetaTags:[{name:"theme-color",content:"#000000"}],additionalLinkTags:g({favicon:z,shopMeta:K})},U=K?.localization.language.isoCode??null,$=K?.localization.country.isoCode??null,V=U&&$?`${U}-${$}`:null;return p({id:A.value?.publishedThemePages?.[0]?.id??null,shopID:A.value?.publishedThemePages?.[0]?.shopID??null,themeStyle:i(M?.pageStyle?.data,b),fontStyle:k,elementFontStyle:N,builderData:C,pageType:m,moneyFormat:K?.shop.moneyFormat??null,currency:K?.localization.country.currency.isoCode??null,languageIsoCode:U,countryIsoCode:$,locale:V,swr:{fallback:B},swatches:u(H?.storeProperty?.swatchesConfig),seo:R,mobileOnly:b,disableGsFont:x,gaTrackingId:c(h.ANALYTICS_GA_TRACKING_ID,M?.metafields)??null,facebookPixelId:c(h.ANALYTICS_FB_PIXEL_ID,M?.metafields)??null,tiktokPixelId:c(h.ANALYTICS_TIKTOK_PIXEL_ID,M?.metafields)??null,customCodeHeader:c(h.CUSTOM_CODE_HEADER,M?.metafields)??null,customCodeBody:c(h.CUSTOM_CODE_BODY,M?.metafields)??null,pageHandle:M.handle??null,customFonts:D,interaction:M?.interaction,pageBackground:d(M)})}catch(e){throw m(e),e}};export{getStaticPagePropsV2};
@@ -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 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,disableGsFont:R})=>{let G=d(),{t:J}=s(),X=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";g(I,$,G.isFallback),b({id:U,shopID:V,domain:B});let K="custom-code-header";if(_(()=>{let e=document.querySelectorAll(`[class*="${K}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),G.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 Q=(O?.value||[]).length>0;return t(a,{children:[e(c,{...x}),t(m,{children:[u(K,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:`
2
2
  body {
3
3
  background: ${z.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_${z?.background}`)]}),j&&!R&&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:J,children:t("div",{className:`${E?"gp-bg-white post-purchase-page":""} `,role:"main",children:[E&&e(f,{pageType:"POST_PURCHASE"}),Q&&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}),Q&&e(y,{defer:!0,src:`${X}/assets-v2/gp-flow-action-lip-v7-5.js`})]},a.uid))}),E&&e(h,{shopName:H||""})]})})})})]})};export{StaticPageV2};
@@ -108,6 +108,7 @@ type StaticPagePropsV2 = PageBuilderPropsV2 & {
108
108
  id?: string | null;
109
109
  shopID?: string | null;
110
110
  domainTrackingIlp?: string;
111
+ disableGsFont?: boolean;
111
112
  isPostPurchase?: boolean;
112
113
  shopName?: string;
113
114
  productOffers?: ProductOffer[];
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.0-staging.22",
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": "17.0.0-staging.20",
31
+ "@gem-sdk/plugin-cookie-bar": "17.0.0-staging.20",
32
+ "@gem-sdk/plugin-quick-view": "17.0.0-staging.20",
33
+ "@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-staging.20"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "next": "14.2.35"