@gem-sdk/pages 17.0.0-dev.83 → 17.0.0-dev.84
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.
package/dist/cjs/layouts/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),s=require("../libs/parse-html.js");exports.default=({children:t,...o})=>{let a=r.useShopStore(e=>e.mobileOnly);return e.jsxs(e.Fragment,{children:[s.parseHtml("custom-code-body",o?.customCodeBody),e.jsx("div",{className:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),s=require("../libs/parse-html.js");exports.default=({children:t,...o})=>{let a=r.useShopStore(e=>e.mobileOnly);return e.jsxs(e.Fragment,{children:[s.parseHtml("custom-code-body",o?.customCodeBody),a?e.jsx("div",{className:"gp-max-w-mobile gp-mx-auto gp-w-full",children:t}):t,e.jsx(r.AddOn,{name:"cookie-bar"}),e.jsx(r.AddOn,{name:"cart-drawer"})]})};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),r=require("next/head"),s=require("next/router"),a=require("../libs/parse-html.js"),i=require("react"),l=require("next/dynamic");exports.PreviewTemplate=({components:n,builderData:d,sectionData:o,themeStyle:c,fontStyle:g,elementFontStyle:u,customCodeHeader:p,customFonts:m,pageBackground:h,publicStoreFrontData:x,page:y,collection:j,dynamicCollection:f,dynamicProduct:_})=>{let{disableExternalLinks:v}=t.usePreviewSharePage(),P=s.useRouter(),{t:b}=t.useI18n(),q="custom-code-header",k=l(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),S=y?.type==="GP_COLLECTION"?k:i.Fragment;return(i.useEffect(()=>{let e=document.querySelectorAll(`[class*="${q}-"]`),t=[];e.length>1&&e.forEach(e=>{let r=e.className;if(t.includes(r)){e.remove();return}t.push(r)})},[]),i.useEffect(()=>{v()},[v]),P.isFallback)?e.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:e.jsxs("div",{className:"gp-flex gp-gap-2",children:[e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{children:[a.parseHtml(q,p,!0),c&&e.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:c}},"global-style"),g&&e.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:g}},"google-fonts"),u&&u.map(t=>e.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),m&&e.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:m}},g),h?.isUsePageBackground&&h?.background&&e.jsx("style",{children:`
|
|
2
2
|
body {
|
|
3
3
|
background: ${h.background};
|
|
4
4
|
}
|
|
5
|
-
`},`page_background_${h?.background}`)]}),e.jsx(t.PageProvider,{publicStoreFrontData:x,dynamicCollection:f,dynamicProduct:_,children:e.jsx(S,{collection:j,children:e.jsx(t.BuilderComponentProvider,{components:
|
|
5
|
+
`},`page_background_${h?.background}`)]}),e.jsx(t.PageProvider,{publicStoreFrontData:x,dynamicCollection:f,dynamicProduct:_,children:e.jsx(S,{collection:j,children:e.jsx(t.BuilderComponentProvider,{components:n,children:e.jsx("div",{id:"storefront","data-page-name":y?.name,"data-assigned-product-title":_?.productTitle,"data-assigned-collection-title":f?.collectionTitle,children:e.jsx(t.SectionProvider,{data:o,children:e.jsx(t.I18nProvider,{t:b,children:d?.map((r,s)=>e.jsx(t.LazyPriorityProvider,{priority:!!r.priority||0===s,children:e.jsx(t.BuilderProvider,{state:r.data,lazy:r.lazy,priority:r.priority,isPreview:!0,children:e.jsx(t.Render,{uid:r.uid})})},r.uid))})})})})})})]})};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),r=require("next-seo"),t=require("next/head"),a=require("next/router"),i=require("../libs/parse-html.js"),n=require("../components/builder/Header.js"),l=require("../components/FooterForPostPurchase.js"),o=require("next/script"),d=require("react"),c=require("../libs/hooks/usePageViewedTracking.js");exports.StaticPageV2=({components:g,builderData:u,sectionData:p,seo:m,themeStyle:h,fontStyle:x,elementFontStyle:y,customCodeHeader:j,customFonts:f,isPostPurchase:_,shopName:v,productOffers:P,publicStoreFrontData:b,dynamicDiscountOffer:S,isPreview:q,interaction:k,pageBackground:N,sellingPlanSetting:T,buyerConsentPreCheck:H,id:I,shopID:L,domainTrackingIlp:E,disableGsFont:M})=>{let $=a.useRouter(),{t:w}=s.useI18n(),F=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";c.usePageViewedTracking({id:I,shopID:L,domain:E});let z="custom-code-header";if(d.useEffect(()=>{let e=document.querySelectorAll(`[class*="${z}-"]`),s=[];e.length>1&&e.forEach(e=>{let r=e.className;if(s.includes(r)){e.remove();return}s.push(r)})},[]),$.isFallback)return e.jsx("div",{className:"gp-flex gp-h-[100vh] gp-items-center gp-justify-center",children:e.jsxs("div",{className:"gp-flex gp-gap-2",children:[e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_200ms_linear_alternate] gp-rounded-full gp-bg-slate-800"}),e.jsx("span",{className:"gp-aspect-square gp-h-2 gp-animate-[flashing_500ms_infinite_500ms_alternate] gp-rounded-full gp-bg-slate-800"})]})});let A=(k?.value||[]).length>0;return e.jsxs(e.Fragment,{children:[e.jsx(r.NextSeo,{...m}),e.jsxs(t,{children:[i.parseHtml(z,j,!0),h&&e.jsx("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:h}},"global-style"),x&&!M&&e.jsx("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:x}},"google-fonts"),y&&y.map(s=>e.jsx("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:s}},s)),f&&e.jsx("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:f}},x),N?.isUsePageBackground&&N?.background&&e.jsx("style",{children:`
|
|
2
2
|
body {
|
|
3
3
|
background: ${N.background};
|
|
4
4
|
}
|
|
5
|
-
`},`page_background_${N?.background}`)]}),e.jsx(s.PageProvider,{productOffers:P,publicStoreFrontData:b,dynamicDiscountOffer:S,sellingPlanMeta:T,buyerConsentChecked:
|
|
5
|
+
`},`page_background_${N?.background}`)]}),e.jsx(s.PageProvider,{productOffers:P,publicStoreFrontData:b,dynamicDiscountOffer:S,sellingPlanMeta:T,buyerConsentChecked:H,children:e.jsx(s.BuilderComponentProvider,{components:g,children:e.jsx(s.I18nProvider,{t:w,children:e.jsxs("div",{className:`${_?"gp-bg-white post-purchase-page":""} `,role:"main",children:[_&&e.jsx(n.default,{pageType:"POST_PURCHASE"}),A&&e.jsx("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(k?.value||[])}</div>`}}),e.jsx(s.SectionProvider,{data:p,children:u?.map((r,t)=>e.jsx(s.LazyPriorityProvider,{priority:!!r.priority||0===t,children:e.jsxs(s.BuilderProvider,{state:r.data,lazy:r.lazy,priority:r.priority,isPostPurchase:_,isPreview:q,children:[e.jsx(s.Render,{uid:r.uid}),A&&e.jsx(o,{defer:!0,src:`${F}/assets-v2/gp-flow-action-lip-v7-5.js`})]})},r.uid))}),_&&e.jsx(l.default,{shopName:v||""})]})})})})]})};
|
package/dist/esm/layouts/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useShopStore as m,
|
|
2
|
+
import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useShopStore as m,AddOn as t}from"@gem-sdk/core";import{parseHtml as a}from"../libs/parse-html.js";let l=({children:l,...i})=>{let c=m(e=>e.mobileOnly);return e(o,{children:[a("custom-code-body",i?.customCodeBody),c?r("div",{className:"gp-max-w-mobile gp-mx-auto gp-w-full",children:l}):l,r(t,{name:"cookie-bar"}),r(t,{name:"cart-drawer"})]})};export{l as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{usePreviewSharePage as l,useI18n as
|
|
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 i,SectionProvider as s,I18nProvider as o,LazyPriorityProvider as d,BuilderProvider as c,Render as p}from"@gem-sdk/core";import g from"next/head";import{useRouter as m}from"next/router";import{parseHtml as u}from"../libs/parse-html.js";import{useEffect as h,Fragment as y}from"react";import f from"next/dynamic";let _=({components:_,builderData:b,sectionData:x,themeStyle:k,fontStyle:v,elementFontStyle:T,customCodeHeader:N,customFonts:L,pageBackground:P,publicStoreFrontData:S,page:I,collection:q,dynamicCollection:C,dynamicProduct:H})=>{let{disableExternalLinks:M}=l(),j=m(),{t:F}=r(),$="custom-code-header",w=f(()=>import("@gem-sdk/core").then(e=>e.CollectionProvider)),z=I?.type==="GP_COLLECTION"?w:y;return(h(()=>{let e=document.querySelectorAll(`[class*="${$}-"]`),t=[];e.length>1&&e.forEach(e=>{let a=e.className;if(t.includes(a)){e.remove();return}t.push(a)})},[]),h(()=>{M()},[M]),j.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(g,{children:[u($,N,!0),k&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"global-style"),v&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:v}},"google-fonts"),T&&T.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),L&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:L}},v),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:S,dynamicCollection:C,dynamicProduct:H,children:e(z,{collection:q,children:e(i,{components:_,children:e("div",{id:"storefront","data-page-name":I?.name,"data-assigned-product-title":H?.productTitle,"data-assigned-collection-title":C?.collectionTitle,children:e(s,{data:x,children:e(o,{t:F,children:b?.map((t,a)=>e(d,{priority:!!t.priority||0===a,children:e(c,{state:t.data,lazy:t.lazy,priority:t.priority,isPreview:!0,children:e(p,{uid:t.uid})})},t.uid))})})})})})})]})};export{_ as PreviewTemplate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import{useI18n as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import{useI18n as r,PageProvider as a,BuilderComponentProvider as n,I18nProvider as l,SectionProvider as i,LazyPriorityProvider as o,BuilderProvider as p,Render as c}from"@gem-sdk/core";import{NextSeo as d}from"next-seo";import g from"next/head";import{useRouter as m}from"next/router";import{parseHtml as u}from"../libs/parse-html.js";import h from"../components/builder/Header.js";import f from"../components/FooterForPostPurchase.js";import y from"next/script";import{useEffect as _}from"react";import{usePageViewedTracking as b}from"../libs/hooks/usePageViewedTracking.js";let v=({components:v,builderData:S,sectionData:x,seo:P,themeStyle:k,fontStyle:N,elementFontStyle:T,customCodeHeader:j,customFonts:H,isPostPurchase:I,shopName:L,productOffers:M,publicStoreFrontData:$,dynamicDiscountOffer:E,isPreview:q,interaction:w,pageBackground:A,sellingPlanSetting:F,buyerConsentPreCheck:O,id:z,shopID:C,domainTrackingIlp:D,disableGsFont:U})=>{let B=m(),{t:R}=r(),V=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";b({id:z,shopID:C,domain:D});let G="custom-code-header";if(_(()=>{let e=document.querySelectorAll(`[class*="${G}-"]`),t=[];e.length>1&&e.forEach(e=>{let s=e.className;if(t.includes(s)){e.remove();return}t.push(s)})},[]),B.isFallback)return 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"})]})});let J=(w?.value||[]).length>0;return t(s,{children:[e(d,{...P}),t(g,{children:[u(G,j,!0),k&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:k}},"global-style"),N&&!U&&e("style",{"data-id":"google-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:N}},"google-fonts"),T&&T.map(t=>e("style",{"data-id":"google-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:t}},t)),H&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:H}},N),A?.isUsePageBackground&&A?.background&&e("style",{children:`
|
|
2
2
|
body {
|
|
3
|
-
background: ${
|
|
3
|
+
background: ${A.background};
|
|
4
4
|
}
|
|
5
|
-
`},`page_background_${
|
|
5
|
+
`},`page_background_${A?.background}`)]}),e(a,{productOffers:M,publicStoreFrontData:$,dynamicDiscountOffer:E,sellingPlanMeta:F,buyerConsentChecked:O,children:e(n,{components:v,children:e(l,{t:R,children:t("div",{className:`${I?"gp-bg-white post-purchase-page":""} `,role:"main",children:[I&&e(h,{pageType:"POST_PURCHASE"}),J&&e("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(w?.value||[])}</div>`}}),e(i,{data:x,children:S?.map((s,r)=>e(o,{priority:!!s.priority||0===r,children:t(p,{state:s.data,lazy:s.lazy,priority:s.priority,isPostPurchase:I,isPreview:q,children:[e(c,{uid:s.uid}),J&&e(y,{defer:!0,src:`${V}/assets-v2/gp-flow-action-lip-v7-5.js`})]})},s.uid))}),I&&e(f,{shopName:L||""})]})})})})]})};export{v as StaticPageV2};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "17.0.0-dev.
|
|
3
|
+
"version": "17.0.0-dev.84",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"next": "14.2.35"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/core": "17.0.0-dev.
|
|
31
|
-
"@gem-sdk/plugin-cookie-bar": "17.0.0-dev.
|
|
32
|
-
"@gem-sdk/plugin-quick-view": "17.0.0-dev.
|
|
33
|
-
"@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.
|
|
30
|
+
"@gem-sdk/core": "17.0.0-dev.84",
|
|
31
|
+
"@gem-sdk/plugin-cookie-bar": "17.0.0-dev.84",
|
|
32
|
+
"@gem-sdk/plugin-quick-view": "17.0.0-dev.84",
|
|
33
|
+
"@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.84"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"next": "14.2.35"
|