@gem-sdk/pages 2.0.0-dev.1190 → 2.0.0-dev.1192

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";var nextjs=require("@sentry/nextjs"),normalize=require("../helpers/normalize.js"),parseJson=require("../helpers/parse-json.js"),genCss=require("../helpers/gen-css.js"),googleFonts=require("../google-fonts.js"),customFonts=require("../custom-fonts.js"),getFallback=require("../helpers/get-fallback.js");const getSharePageProps=(e,t)=>async s=>{try{let{sharedPage:o,customFonts:a,publicToken:r}=await e([s]);if(!o||!r)return null;let{page:l,themeStyle:n,share:i,pageMeta:u,shopMeta:g}=o,{sectionPosition:m}=l??{},p=normalize.parseBuilderTemplateV2({...o,sectionPosition:m}),[c,h,F,b]=await Promise.all([googleFonts.getFontStyleFromPageTemplate(p),googleFonts.getFontFromGlobalStyle(n?.data),getFallback.getFallbackV2(t(r),p),customFonts.getCustomFonts(a)]),j=i?.thumbnails?Array.isArray(i.thumbnails)?i.thumbnails.map(e=>({url:e})):"string"==typeof i.thumbnails?[{url:i.thumbnails}]:[]:[],y={defaultTitle:g?.shop?.name??"",title:i?.title,openGraph:{site_name:g?.shop?.name??"",locale:g?.localization?.country?.isoCode??"",title:i?.title??g?.shop?.name??"",images:j},nofollow:!0,noindex:!0};return parseJson.serializableJson({seo:y,builderData:p,page:l,themeStyle:genCss.genCSS(n?.data,!1),share:i,pageMeta:u,shopMeta:g,elementFontStyle:c,fontStyle:h,swr:{fallback:F},customFonts:b,publicStoreFrontData:r?{token:r,endpoint:process.env.NEXT_PUBLIC_API_URL??""}:null})}catch(e){return nextjs.captureException(e),null}};exports.getSharePageProps=getSharePageProps;
1
+ "use strict";var nextjs=require("@sentry/nextjs"),normalize=require("../helpers/normalize.js"),parseJson=require("../helpers/parse-json.js"),genCss=require("../helpers/gen-css.js"),googleFonts=require("../google-fonts.js"),customFonts=require("../custom-fonts.js"),getFallback=require("../helpers/get-fallback.js"),sentry=require("../helpers/sentry.js");const getSharePageProps=(e,t)=>async s=>{try{let{sharedPage:r,customFonts:a,publicToken:o}=await e([s]);if(!r||!o)return null;let{page:l,themeStyle:n,share:i,pageMeta:u,shopMeta:p}=r,{sectionPosition:g}=l??{},m=normalize.parseBuilderTemplateV2({...r,sectionPosition:g}),[c,h,F,b]=await Promise.all([googleFonts.getFontStyleFromPageTemplate(m),googleFonts.getFontFromGlobalStyle(n?.data),getFallback.getFallbackV2(t(o),m),customFonts.getCustomFonts(a)]);sentry.sentryCaptureException("Share page preview","Check fallback",{fallback:F,shareInfo:i,pageTemplate:m,publicToken:o});let y=i?.thumbnails?Array.isArray(i.thumbnails)?i.thumbnails.map(e=>({url:e})):"string"==typeof i.thumbnails?[{url:i.thumbnails}]:[]:[],j={defaultTitle:p?.shop?.name??"",title:i?.title,openGraph:{site_name:p?.shop?.name??"",locale:p?.localization?.country?.isoCode??"",title:i?.title??p?.shop?.name??"",images:y},nofollow:!0,noindex:!0};return parseJson.serializableJson({seo:j,builderData:m,page:l,themeStyle:genCss.genCSS(n?.data,!1),share:i,pageMeta:u,shopMeta:p,elementFontStyle:c,fontStyle:h,swr:{fallback:F},customFonts:b,publicStoreFrontData:o?{token:o,endpoint:process.env.NEXT_PUBLIC_API_URL??""}:null})}catch(e){return nextjs.captureException(e),null}};exports.getSharePageProps=getSharePageProps;
@@ -1 +1 @@
1
- import{captureException as t}from"@sentry/nextjs";import{parseBuilderTemplateV2 as e}from"../helpers/normalize.js";import{serializableJson as r}from"../helpers/parse-json.js";import{genCSS as o}from"../helpers/gen-css.js";import{getFontStyleFromPageTemplate as a,getFontFromGlobalStyle as l}from"../google-fonts.js";import{getCustomFonts as s}from"../custom-fonts.js";import{getFallbackV2 as n}from"../helpers/get-fallback.js";let getSharePageProps=(i,m)=>async p=>{try{let{sharedPage:t,customFonts:u,publicToken:h}=await i([p]);if(!t||!h)return null;let{page:f,themeStyle:c,share:g,pageMeta:b,shopMeta:j}=t,{sectionPosition:y}=f??{},d=e({...t,sectionPosition:y}),[P,w,S,_]=await Promise.all([a(d),l(c?.data),n(m(h),d),s(u)]),x=g?.thumbnails?Array.isArray(g.thumbnails)?g.thumbnails.map(t=>({url:t})):"string"==typeof g.thumbnails?[{url:g.thumbnails}]:[]:[],A={defaultTitle:j?.shop?.name??"",title:g?.title,openGraph:{site_name:j?.shop?.name??"",locale:j?.localization?.country?.isoCode??"",title:g?.title??j?.shop?.name??"",images:x},nofollow:!0,noindex:!0};return r({seo:A,builderData:d,page:f,themeStyle:o(c?.data,!1),share:g,pageMeta:b,shopMeta:j,elementFontStyle:P,fontStyle:w,swr:{fallback:S},customFonts:_,publicStoreFrontData:h?{token:h,endpoint:process.env.NEXT_PUBLIC_API_URL??""}:null})}catch(e){return t(e),null}};export{getSharePageProps};
1
+ import{captureException as e}from"@sentry/nextjs";import{parseBuilderTemplateV2 as t}from"../helpers/normalize.js";import{serializableJson as r}from"../helpers/parse-json.js";import{genCSS as o}from"../helpers/gen-css.js";import{getFontStyleFromPageTemplate as a,getFontFromGlobalStyle as l}from"../google-fonts.js";import{getCustomFonts as s}from"../custom-fonts.js";import{getFallbackV2 as n}from"../helpers/get-fallback.js";import{sentryCaptureException as i}from"../helpers/sentry.js";let getSharePageProps=(m,p)=>async h=>{try{let{sharedPage:e,customFonts:u,publicToken:f}=await m([h]);if(!e||!f)return null;let{page:c,themeStyle:g,share:b,pageMeta:j,shopMeta:y}=e,{sectionPosition:d}=c??{},P=t({...e,sectionPosition:d}),[w,S,k,_]=await Promise.all([a(P),l(g?.data),n(p(f),P),s(u)]);i("Share page preview","Check fallback",{fallback:k,shareInfo:b,pageTemplate:P,publicToken:f});let x=b?.thumbnails?Array.isArray(b.thumbnails)?b.thumbnails.map(e=>({url:e})):"string"==typeof b.thumbnails?[{url:b.thumbnails}]:[]:[],A={defaultTitle:y?.shop?.name??"",title:b?.title,openGraph:{site_name:y?.shop?.name??"",locale:y?.localization?.country?.isoCode??"",title:b?.title??y?.shop?.name??"",images:x},nofollow:!0,noindex:!0};return r({seo:A,builderData:P,page:c,themeStyle:o(g?.data,!1),share:b,pageMeta:j,shopMeta:y,elementFontStyle:w,fontStyle:S,swr:{fallback:k},customFonts:_,publicStoreFrontData:f?{token:f,endpoint:process.env.NEXT_PUBLIC_API_URL??""}:null})}catch(t){return e(t),null}};export{getSharePageProps};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.1190",
3
+ "version": "2.0.0-dev.1192",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",