@gem-sdk/pages 2.0.0-dev.1175 → 2.0.0-dev.1183

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.
@@ -8,6 +8,6 @@
8
8
  t.src=v;s=b.getElementsByTagName(e)[0];
9
9
  s.parentNode.insertBefore(t,s)}(window, document,'script',
10
10
  'https://connect.facebook.net/en_US/fbevents.js');
11
- fbq('init', ${e});
11
+ fbq('init', '${e}');
12
12
  fbq('track', 'PageView');
13
13
  `}}):null};exports.FacebookPixel=FacebookPixel;
@@ -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");const getSharePageProps=e=>async t=>{try{let{sharedPage:s,customFonts:o,products:r,collections:n,articles:a}=await e([t]);if(!s)return null;let{page:l,themeStyle:i,share:u,pageMeta:p,shopMeta:g}=s,{sectionPosition:m}=l,c=normalize.parseBuilderTemplateV2({...s,sectionPosition:m}),[h,F,d]=await Promise.all([googleFonts.getFontStyleFromPageTemplate(c),googleFonts.getFontFromGlobalStyle(i?.data),customFonts.getCustomFonts(o)]),j={defaultTitle:g?.shop?.name??"",title:u?.title,openGraph:{site_name:g?.shop?.name??"",locale:g?.localization?.country?.isoCode??"",title:u?.title??g?.shop?.name??"",description:u?.description??g?.shop?.description??"",images:u?.thumbnails?u.thumbnails:[]},nofollow:!0,noindex:!0};return parseJson.serializableJson({seo:j,builderData:c,page:l,themeStyle:genCss.genCSS(i?.data,!1),share:u,pageMeta:p,shopMeta:g,products:r,collections:n,articles:a,elementFontStyle:h,fontStyle:F,customFonts:d})}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");const getSharePageProps=e=>async t=>{try{let{sharedPage:s,customFonts:o,products:r,collections:a,articles:n}=await e([t]);if(!s)return null;let{page:l,themeStyle:i,share:u,pageMeta:m,shopMeta:g}=s,{sectionPosition:p}=l,h=normalize.parseBuilderTemplateV2({...s,sectionPosition:p}),[c,F,y]=await Promise.all([googleFonts.getFontStyleFromPageTemplate(h),googleFonts.getFontFromGlobalStyle(i?.data),customFonts.getCustomFonts(o)]),j=u?.thumbnails?Array.isArray(u.thumbnails)?u.thumbnails.map(e=>({url:e})):"string"==typeof u.thumbnails?[{url:u.thumbnails}]:[]:[],b={defaultTitle:g?.shop?.name??"",title:u?.title,openGraph:{site_name:g?.shop?.name??"",locale:g?.localization?.country?.isoCode??"",title:u?.title??g?.shop?.name??"",images:j},nofollow:!0,noindex:!0};return parseJson.serializableJson({seo:b,builderData:h,page:l,themeStyle:genCss.genCSS(i?.data,!1),share:u,pageMeta:m,shopMeta:g,products:r,collections:a,articles:n,elementFontStyle:c,fontStyle:F,customFonts:y})}catch(e){return nextjs.captureException(e),null}};exports.getSharePageProps=getSharePageProps;
@@ -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"),parseHtml=require("../libs/parse-html.js"),react=require("react");const PreviewTemplate=({components:e,builderData:t,sectionData:s,seo:r,themeStyle:n,fontStyle:a,elementFontStyle:i,customCodeHeader:l,customFonts:u,products:o,collections:c,articles:m,pageBackground:d,publicStoreFrontData:x})=>{let g=router.useRouter(),{t:p}=core.useI18n(),j="custom-code-header";return(react.useEffect(()=>{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)})},[]),g.isFallback)?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"})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(nextSeo.NextSeo,{...r}),jsxRuntime.jsxs(Head,{children:[parseHtml.parseHtml(j,l,!0),n&&jsxRuntime.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:n}},"global-style"),a&&jsxRuntime.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:a}},"google-fonts"),i&&i.map(e=>jsxRuntime.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:e}},e)),u&&jsxRuntime.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:u}},a),d?.isUsePageBackground&&d?.background&&jsxRuntime.jsx("style",{children:`
1
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Head=require("next/head"),router=require("next/router"),parseHtml=require("../libs/parse-html.js"),react=require("react");const PreviewTemplate=({components:e,builderData:s,sectionData:t,themeStyle:r,fontStyle:n,elementFontStyle:a,customCodeHeader:i,customFonts:l,products:u,collections:c,articles:o,pageBackground:m,publicStoreFrontData:d})=>{let g=router.useRouter(),{t:x}=core.useI18n(),p="custom-code-header";return(react.useEffect(()=>{let e=document.querySelectorAll(`[class*="${p}-"]`),s=[];e.length>1&&e.forEach(e=>{let t=e.className;if(s.includes(t)){e.remove();return}s.push(t)})},[]),g.isFallback)?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"})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Head,{children:[parseHtml.parseHtml(p,i,!0),r&&jsxRuntime.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:r}},"global-style"),n&&jsxRuntime.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:n}},"google-fonts"),a&&a.map(e=>jsxRuntime.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:e}},e)),l&&jsxRuntime.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:l}},n),m?.isUsePageBackground&&m?.background&&jsxRuntime.jsx("style",{children:`
2
2
  body {
3
- background: ${d.background};
3
+ background: ${m.background};
4
4
  }
5
- `},`page_background_${d?.background}`)]}),jsxRuntime.jsx(core.PageProvider,{products:o,collections:c,articles:m,publicStoreFrontData:x,children:jsxRuntime.jsx(core.BuilderComponentProvider,{components:e,children:jsxRuntime.jsx("div",{children:jsxRuntime.jsx(core.SectionProvider,{data:s,children:jsxRuntime.jsx(core.I18nProvider,{t:p,children:t?.map(e=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(core.BuilderProvider,{state:e.data,lazy:e.lazy,priority:e.priority,isPreview:!0,children:jsxRuntime.jsx(core.Render,{uid:e.uid})},e.uid)}))})})})})})]})};exports.PreviewTemplate=PreviewTemplate;
5
+ `},`page_background_${m?.background}`)]}),jsxRuntime.jsx(core.PageProvider,{products:u,collections:c,articles:o,publicStoreFrontData:d,children:jsxRuntime.jsx(core.BuilderComponentProvider,{components:e,children:jsxRuntime.jsx("div",{children:jsxRuntime.jsx(core.SectionProvider,{data:t,children:jsxRuntime.jsx(core.I18nProvider,{t:x,children:s?.map(e=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(core.BuilderProvider,{state:e.data,lazy:e.lazy,priority:e.priority,isPreview:!0,children:jsxRuntime.jsx(core.Render,{uid:e.uid})},e.uid)}))})})})})})]})};exports.PreviewTemplate=PreviewTemplate;
@@ -8,6 +8,6 @@ import{jsx as e}from"react/jsx-runtime";import{fpixel as t}from"@gem-sdk/core";i
8
8
  t.src=v;s=b.getElementsByTagName(e)[0];
9
9
  s.parentNode.insertBefore(t,s)}(window, document,'script',
10
10
  'https://connect.facebook.net/en_US/fbevents.js');
11
- fbq('init', ${i});
11
+ fbq('init', '${i}');
12
12
  fbq('track', 'PageView');
13
13
  `}}):null};export{FacebookPixel};
@@ -1 +1 @@
1
- import{captureException as e}from"@sentry/nextjs";import{parseBuilderTemplateV2 as t}from"../helpers/normalize.js";import{serializableJson as o}from"../helpers/parse-json.js";import{genCSS as r}from"../helpers/gen-css.js";import{getFontStyleFromPageTemplate as s,getFontFromGlobalStyle as a}from"../google-fonts.js";import{getCustomFonts as i}from"../custom-fonts.js";let getSharePageProps=l=>async n=>{try{let{sharedPage:e,customFonts:m,products:p,collections:h,articles:c}=await l([n]);if(!e)return null;let{page:u,themeStyle:f,share:d,pageMeta:g,shopMeta:j}=e,{sectionPosition:y}=u,P=t({...e,sectionPosition:y}),[b,w,x]=await Promise.all([s(P),a(f?.data),i(m)]),S={defaultTitle:j?.shop?.name??"",title:d?.title,openGraph:{site_name:j?.shop?.name??"",locale:j?.localization?.country?.isoCode??"",title:d?.title??j?.shop?.name??"",description:d?.description??j?.shop?.description??"",images:d?.thumbnails?d.thumbnails:[]},nofollow:!0,noindex:!0};return o({seo:S,builderData:P,page:u,themeStyle:r(f?.data,!1),share:d,pageMeta:g,shopMeta:j,products:p,collections:h,articles:c,elementFontStyle:b,fontStyle:w,customFonts:x})}catch(t){return e(t),null}};export{getSharePageProps};
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 s}from"../google-fonts.js";import{getCustomFonts as l}from"../custom-fonts.js";let getSharePageProps=i=>async n=>{try{let{sharedPage:t,customFonts:m,products:p,collections:u,articles:h}=await i([n]);if(!t)return null;let{page:f,themeStyle:c,share:g,pageMeta:y,shopMeta:j}=t,{sectionPosition:b}=f,d=e({...t,sectionPosition:b}),[P,w,x]=await Promise.all([a(d),s(c?.data),l(m)]),S=g?.thumbnails?Array.isArray(g.thumbnails)?g.thumbnails.map(t=>({url:t})):"string"==typeof g.thumbnails?[{url:g.thumbnails}]:[]:[],z={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:S},nofollow:!0,noindex:!0};return r({seo:z,builderData:d,page:f,themeStyle:o(c?.data,!1),share:g,pageMeta:y,shopMeta:j,products:p,collections:u,articles:h,elementFontStyle:P,fontStyle:w,customFonts:x})}catch(e){return t(e),null}};export{getSharePageProps};
@@ -1,5 +1,5 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{useI18n as l,PageProvider as r,BuilderComponentProvider as s,SectionProvider as n,I18nProvider as i,BuilderProvider as o,Render as d}from"@gem-sdk/core";import{NextSeo as p}from"next-seo";import c from"next/head";import{useRouter as g}from"next/router";import{parseHtml as m}from"../libs/parse-html.js";import{useEffect as u}from"react";let PreviewTemplate=({components:h,builderData:f,sectionData:y,seo:_,themeStyle:b,fontStyle:x,elementFontStyle:k,customCodeHeader:v,customFonts:N,products:S,collections:T,articles:q,pageBackground:H,publicStoreFrontData:I})=>{let L=g(),{t:M}=l(),P="custom-code-header";return(u(()=>{let e=document.querySelectorAll(`[class*="${P}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),L.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:[e(p,{..._}),t(c,{children:[m(P,v,!0),b&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:b}},"global-style"),x&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:x}},"google-fonts"),k&&k.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}},x),H?.isUsePageBackground&&H?.background&&e("style",{children:`
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{useI18n as l,PageProvider as r,BuilderComponentProvider as s,SectionProvider as n,I18nProvider as i,BuilderProvider as o,Render as d}from"@gem-sdk/core";import c from"next/head";import{useRouter as p}from"next/router";import{parseHtml as g}from"../libs/parse-html.js";import{useEffect as m}from"react";let PreviewTemplate=({components:u,builderData:h,sectionData:f,themeStyle:y,fontStyle:_,elementFontStyle:b,customCodeHeader:x,customFonts:k,products:v,collections:N,articles:S,pageBackground:T,publicStoreFrontData:q})=>{let H=p(),{t:I}=l(),L="custom-code-header";return(m(()=>{let e=document.querySelectorAll(`[class*="${L}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),H.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(c,{children:[g(L,x,!0),y&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:y}},"global-style"),_&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:_}},"google-fonts"),b&&b.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),k&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:k}},_),T?.isUsePageBackground&&T?.background&&e("style",{children:`
2
2
  body {
3
- background: ${H.background};
3
+ background: ${T.background};
4
4
  }
5
- `},`page_background_${H?.background}`)]}),e(r,{products:S,collections:T,articles:q,publicStoreFrontData:I,children:e(s,{components:h,children:e("div",{children:e(n,{data:y,children:e(i,{t:M,children:f?.map(t=>e(a,{children:e(o,{state:t.data,lazy:t.lazy,priority:t.priority,isPreview:!0,children:e(d,{uid:t.uid})},t.uid)}))})})})})})]})};export{PreviewTemplate};
5
+ `},`page_background_${T?.background}`)]}),e(r,{products:v,collections:N,articles:S,publicStoreFrontData:q,children:e(s,{components:u,children:e("div",{children:e(n,{data:f,children:e(i,{t:I,children:h?.map(t=>e(a,{children:e(o,{state:t.data,lazy:t.lazy,priority:t.priority,isPreview:!0,children:e(d,{uid:t.uid})},t.uid)}))})})})})})]})};export{PreviewTemplate};
@@ -109,6 +109,12 @@ type SharePageAPIResponse = {
109
109
  articles: any;
110
110
  customFonts: ShopType.CustomFont[];
111
111
  };
112
+ type SharePageType = {
113
+ designerName?: string | null;
114
+ id: string;
115
+ thumbnails?: string[] | null;
116
+ title: string;
117
+ };
112
118
  type SharePageProps = PageBuilderPropsV2 & {
113
119
  publicStoreFrontData?: PublicStoreFrontData | null;
114
120
  seo?: NextSeoProps;
@@ -120,7 +126,7 @@ type SharePageProps = PageBuilderPropsV2 & {
120
126
  }[];
121
127
  page?: any;
122
128
  themeStyle?: any;
123
- share?: any;
129
+ share?: SharePageType;
124
130
  pageSections?: {
125
131
  id: BigInt;
126
132
  themePageID: BigInt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.1175",
3
+ "version": "2.0.0-dev.1183",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",