@gem-sdk/pages 2.0.0-dev.1244 → 2.0.0-dev.1248

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,5 +1,5 @@
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"),dynamic=require("next/dynamic");const PreviewTemplate=({components:e,builderData:t,sectionData:s,themeStyle:r,fontStyle:n,elementFontStyle:i,customCodeHeader:a,customFonts:l,pageBackground:c,publicStoreFrontData:o,page:d,collection:u,dynamicCollection:m,dynamicProduct:g})=>{let x=router.useRouter(),{t:p}=core.useI18n(),j="custom-code-header",h=dynamic(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),y=d?.type==="GP_COLLECTION"?h:react.Fragment;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)})},[]),x.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(j,a,!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"),i&&i.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),c?.isUsePageBackground&&c?.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"),dynamic=require("next/dynamic");const PreviewTemplate=({components:e,builderData:t,sectionData:s,themeStyle:r,fontStyle:n,elementFontStyle:a,customCodeHeader:i,customFonts:l,pageBackground:c,publicStoreFrontData:o,page:u,collection:d,dynamicCollection:m,dynamicProduct:g})=>{let{disableExternalLinks:x}=core.usePreviewSharePage(),p=router.useRouter(),{t:j}=core.useI18n(),h="custom-code-header",y=dynamic(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),R=u?.type==="GP_COLLECTION"?y:react.Fragment;return(react.useEffect(()=>{let e=document.querySelectorAll(`[class*="${h}-"]`),t=[];e.length>1&&e.forEach(e=>{let s=e.className;if(t.includes(s)){e.remove();return}t.push(s)})},[]),react.useEffect(()=>{x()},[x]),p.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(h,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),c?.isUsePageBackground&&c?.background&&jsxRuntime.jsx("style",{children:`
2
2
  body {
3
3
  background: ${c.background};
4
4
  }
5
- `},`page_background_${c?.background}`)]}),jsxRuntime.jsx(core.PageProvider,{publicStoreFrontData:o,dynamicCollection:m,dynamicProduct:g,children:jsxRuntime.jsx(y,{collection:u,children:jsxRuntime.jsx(core.BuilderComponentProvider,{components:e,children:jsxRuntime.jsx("div",{id:"storefront","data-page-name":d?.name,"data-assigned-product-title":g?.productTitle,"data-assigned-collection-title":m?.collectionTitle,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_${c?.background}`)]}),jsxRuntime.jsx(core.PageProvider,{publicStoreFrontData:o,dynamicCollection:m,dynamicProduct:g,children:jsxRuntime.jsx(R,{collection:d,children:jsxRuntime.jsx(core.BuilderComponentProvider,{components:e,children:jsxRuntime.jsx("div",{id:"storefront","data-page-name":u?.name,"data-assigned-product-title":g?.productTitle,"data-assigned-collection-title":m?.collectionTitle,children:jsxRuntime.jsx(core.SectionProvider,{data:s,children:jsxRuntime.jsx(core.I18nProvider,{t:j,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;
@@ -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 n,SectionProvider as s,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,Fragment as u}from"react";import h from"next/dynamic";let PreviewTemplate=({components:f,builderData:y,sectionData:_,themeStyle:b,fontStyle:x,elementFontStyle:k,customCodeHeader:v,customFonts:T,pageBackground:N,publicStoreFrontData:P,page:L,collection:S,dynamicCollection:I,dynamicProduct:q})=>{let C=p(),{t:H}=l(),M="custom-code-header",j=h(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),w=L?.type==="GP_COLLECTION"?j:u;return(m(()=>{let e=document.querySelectorAll(`[class*="${M}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),C.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(M,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)),T&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:T}},x),N?.isUsePageBackground&&N?.background&&e("style",{children:`
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{usePreviewSharePage as l,useI18n as r,PageProvider as n,BuilderComponentProvider as s,SectionProvider as i,I18nProvider as o,BuilderProvider as d,Render as c}from"@gem-sdk/core";import p from"next/head";import{useRouter as g}from"next/router";import{parseHtml as m}from"../libs/parse-html.js";import{useEffect as u,Fragment as h}from"react";import f from"next/dynamic";let PreviewTemplate=({components:y,builderData:_,sectionData:b,themeStyle:x,fontStyle:k,elementFontStyle:v,customCodeHeader:T,customFonts:N,pageBackground:P,publicStoreFrontData:L,page:S,collection:I,dynamicCollection:q,dynamicProduct:C})=>{let{disableExternalLinks:H}=l(),M=g(),{t:j}=r(),w="custom-code-header",F=f(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),$=S?.type==="GP_COLLECTION"?F:h;return(u(()=>{let e=document.querySelectorAll(`[class*="${w}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),u(()=>{H()},[H]),M.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(p,{children:[m(w,T,!0),x&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:x}},"global-style"),k&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"google-fonts"),v&&v.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}},k),P?.isUsePageBackground&&P?.background&&e("style",{children:`
2
2
  body {
3
- background: ${N.background};
3
+ background: ${P.background};
4
4
  }
5
- `},`page_background_${N?.background}`)]}),e(r,{publicStoreFrontData:P,dynamicCollection:I,dynamicProduct:q,children:e(w,{collection:S,children:e(n,{components:f,children:e("div",{id:"storefront","data-page-name":L?.name,"data-assigned-product-title":q?.productTitle,"data-assigned-collection-title":I?.collectionTitle,children:e(s,{data:_,children:e(i,{t:H,children:y?.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_${P?.background}`)]}),e(n,{publicStoreFrontData:L,dynamicCollection:q,dynamicProduct:C,children:e($,{collection:I,children:e(s,{components:y,children:e("div",{id:"storefront","data-page-name":S?.name,"data-assigned-product-title":C?.productTitle,"data-assigned-collection-title":q?.collectionTitle,children:e(i,{data:b,children:e(o,{t:j,children:_?.map(t=>e(a,{children:e(d,{state:t.data,lazy:t.lazy,priority:t.priority,isPreview:!0,children:e(c,{uid:t.uid})},t.uid)}))})})})})})})]})};export{PreviewTemplate};
@@ -136,6 +136,7 @@ type SharePageProps = PageBuilderPropsV2 & {
136
136
  name?: string;
137
137
  sectionPosition?: string[];
138
138
  type?: string;
139
+ shopID?: string;
139
140
  };
140
141
  themeStyle?: any;
141
142
  share?: SharePageType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.0.0-dev.1244",
3
+ "version": "2.0.0-dev.1248",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "next": "14.2.20"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.0.0-dev.1244",
29
+ "@gem-sdk/core": "2.0.0-dev.1247",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.0.0-dev.1235",
31
31
  "@gem-sdk/plugin-quick-view": "2.0.0-dev.1235",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.1235"