@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:
|
|
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(
|
|
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{
|
|
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: ${
|
|
3
|
+
background: ${P.background};
|
|
4
4
|
}
|
|
5
|
-
`},`page_background_${
|
|
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};
|
package/dist/types/index.d.ts
CHANGED
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.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.
|
|
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"
|