@gem-sdk/pages 2.0.0-dev.1187 → 2.0.0-dev.1189
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:
|
|
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"),fetcher=require("../fetcher.js");const getSharePageProps=(e,t)=>async s=>{try{let{sharedPage:r,customFonts:a,publicToken:o}=await e([s]);if(!r)return null;let{page:l,themeStyle:n,share:i,pageMeta:u,shopMeta:g}=r,{sectionPosition:c}=l??{},m=normalize.parseBuilderTemplateV2({...r,sectionPosition:c}),p=o?fetcher.createFetcher(o):t,[h,F,b,j]=await Promise.all([googleFonts.getFontStyleFromPageTemplate(m),googleFonts.getFontFromGlobalStyle(n?.data),getFallback.getFallbackV2(p,m),customFonts.getCustomFonts(a)]),f=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:f},nofollow:!0,noindex:!0};return parseJson.serializableJson({seo:y,builderData:m,page:l,themeStyle:genCss.genCSS(n?.data,!1),share:i,pageMeta:u,shopMeta:g,elementFontStyle:h,fontStyle:F,swr:{fallback:b},customFonts:j,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
|
|
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 s,getFontFromGlobalStyle as a}from"../google-fonts.js";import{getCustomFonts as l}from"../custom-fonts.js";import{getFallbackV2 as n}from"../helpers/get-fallback.js";import{createFetcher as i}from"../fetcher.js";let getSharePageProps=(m,p)=>async u=>{try{let{sharedPage:t,customFonts:h,publicToken:f}=await m([u]);if(!t)return null;let{page:c,themeStyle:g,share:j,pageMeta:b,shopMeta:y}=t,{sectionPosition:d}=c??{},P=e({...t,sectionPosition:d}),w=f?i(f):p,[S,_,x,A]=await Promise.all([s(P),a(g?.data),n(w,P),l(h)]),k=j?.thumbnails?Array.isArray(j.thumbnails)?j.thumbnails.map(t=>({url:t})):"string"==typeof j.thumbnails?[{url:j.thumbnails}]:[]:[],z={defaultTitle:y?.shop?.name??"",title:j?.title,openGraph:{site_name:y?.shop?.name??"",locale:y?.localization?.country?.isoCode??"",title:j?.title??y?.shop?.name??"",images:k},nofollow:!0,noindex:!0};return r({seo:z,builderData:P,page:c,themeStyle:o(g?.data,!1),share:j,pageMeta:b,shopMeta:y,elementFontStyle:S,fontStyle:_,swr:{fallback:x},customFonts:A,publicStoreFrontData:f?{token:f,endpoint:process.env.NEXT_PUBLIC_API_URL}:null})}catch(e){return t(e),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.
|
|
3
|
+
"version": "2.0.0-dev.1189",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"next": "14.2.20"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
30
|
-
"@gem-sdk/plugin-cookie-bar": "2.0.0-dev.
|
|
31
|
-
"@gem-sdk/plugin-quick-view": "2.0.0-dev.
|
|
32
|
-
"@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.
|
|
29
|
+
"@gem-sdk/core": "2.0.0-dev.1188",
|
|
30
|
+
"@gem-sdk/plugin-cookie-bar": "2.0.0-dev.1188",
|
|
31
|
+
"@gem-sdk/plugin-quick-view": "2.0.0-dev.1188",
|
|
32
|
+
"@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.1188"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"next": ">=14"
|