@gem-sdk/pages 17.0.0-dev.61 → 17.0.0-dev.65
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/libs/api/get-static-page-props-v2.js +1 -1
- package/dist/cjs/libs/data/fonts.js +1 -0
- package/dist/cjs/libs/google-fonts.js +7 -1
- package/dist/cjs/libs/helpers/gen-fonts.js +1 -1
- package/dist/cjs/pages/static-v2.js +3 -3
- package/dist/esm/libs/api/get-static-page-props-v2.js +1 -1
- package/dist/esm/libs/data/fonts.js +1 -0
- package/dist/esm/libs/google-fonts.js +7 -1
- package/dist/esm/libs/helpers/gen-fonts.js +1 -1
- package/dist/esm/pages/static-v2.js +3 -3
- package/package.json +2 -2
- package/dist/cjs/components/FontLink.js +0 -1
- package/dist/esm/components/FontLink.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
let t=["sans-serif"],e=(t,e)=>{if(e&&t?.type&&!t?.custom?.fontFamily){let l=e[t.type];if(l){let e=JSON.parse(JSON.stringify(t));return e.custom||(e.custom={}),e.custom.fontFamily={value:l.family,type:l.type},e}}return t},l=(t,e)=>{let l=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let
|
|
1
|
+
let t=["sans-serif"],e=(t,e)=>{if(e&&t?.type&&!t?.custom?.fontFamily){let l=e[t.type];if(l){let e=JSON.parse(JSON.stringify(t));return e.custom||(e.custom={}),e.custom.fontFamily={value:l.family,type:l.type},e}}return t},l=(t,e)=>{let l=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let s=t[o],n=s.styles,r=s.settings;i(l,n,e),i(l,r,e)}return l},i=(t,l,i)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let n in l)if(Object.prototype.hasOwnProperty.call(l,n)){let r=l[n];if(!r)continue;let a=i?e(r,i):r;for(let l of(s(t,a),o)){if(!r[l])continue;let o=i?e(r[l],i):r[l];s(t,o)}}},o=t=>Array.from(new Set(t)),s=(e,l)=>{let i=l.custom?.fontFamily;"string"==typeof i&&(i={value:l.custom?.fontFamily||"",type:"google"});let s=i?.value;if(t.includes(s))return;let n=l.custom?.fontVariants;if(n?.length||(n=[l.custom?.fontWeight]),i&&n?.length){let t=n.map(t=>"regular"===t?"400":t),r=l.custom?.fontWeight&&t.includes(l.custom?.fontWeight)?l.custom?.fontWeight:t[0];if(r){let n=o([r,...l?.attrs?.isAlwaysLoadBold?["700"]:[],...l?.attrs?.loadFontStyles?.includes("bold")?["700"]:[]]);if(l?.attrs?.loadFontStyles?.includes("italic")){let t=n.map(t=>"string"==typeof t&&/^\d+$/.test(t)?`${t}i`:null).filter(t=>null!==t);n.push(...t)}let a=e.find(t=>t.family==s&&n.every(e=>t.variants.includes(e)));if(!a){let l=e.find(t=>t.family==s);l?n.forEach(t=>{l.variants.includes(t)||l.variants.push(t)}):("700"!==r&&t.includes("700")&&n.push("700"),e.push({family:s||"",variants:o(n),subsets:[],type:i.type}))}}}};export{i as getFontFromGroupSetting,l as getFontsFromDataBuilder};
|
|
@@ -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 a,PageProvider as r,BuilderComponentProvider as n,I18nProvider as l,SectionProvider as o,BuilderProvider as i,Render as p}from"@gem-sdk/core";import{NextSeo as c}from"next-seo";import m from"next/head";import{useRouter as d}from"next/router";import{useTrackingView as g}from"../libs/hooks/use-tracking-view.js";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:k,sectionData:S,seo:x,themeStyle:P,fontStyle:N,elementFontStyle:T,customCodeHeader:j,shopToken:H,pageHandle:I,customFonts:L,isPostPurchase:M,shopName:$,productOffers:w,publicStoreFrontData:E,dynamicDiscountOffer:F,isPreview:q,interaction:A,pageBackground:O,sellingPlanSetting:z,buyerConsentPreCheck:C,id:D,shopID:U,domainTrackingIlp:B})=>{let R=d(),{t:V}=a(),G=process.env.NEXT_GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";g(H,I,R.isFallback),b({id:D,shopID:U,domain:B});let J="custom-code-header";if(_(()=>{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)})},[]),R.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 X=(A?.value||[]).length>0;return t(s,{children:[e(c,{...x}),t(m,{children:[u(J,j,!0),P&&e("style",{"data-id":"global-style",type:"text/css",dangerouslySetInnerHTML:{__html:P}},"global-style"),N&&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)),L&&e("style",{"data-id":"custom-element-fonts",type:"text/css",dangerouslySetInnerHTML:{__html:L}},N),O?.isUsePageBackground&&O?.background&&e("style",{children:`
|
|
2
2
|
body {
|
|
3
|
-
background: ${
|
|
3
|
+
background: ${O.background};
|
|
4
4
|
}
|
|
5
|
-
`},`page_background_${
|
|
5
|
+
`},`page_background_${O?.background}`)]}),e(r,{productOffers:w,publicStoreFrontData:E,dynamicDiscountOffer:F,sellingPlanMeta:z,buyerConsentChecked:C,children:e(n,{components:v,children:e(l,{t:V,children:t("div",{className:`${M?"gp-bg-white post-purchase-page":""} `,role:"main",children:[M&&e(h,{pageType:"POST_PURCHASE"}),X&&e("div",{dangerouslySetInnerHTML:{__html:`<div id="gp-interaction" style="display: none;">${JSON.stringify(A?.value||[])}</div>`}}),e(o,{data:S,children:k?.map(s=>t(i,{state:s.data,lazy:s.lazy,priority:s.priority,isPostPurchase:M,isPreview:q,children:[e(p,{uid:s.uid}),X&&e(y,{defer:!0,src:`${G}/assets-v2/gp-flow-action-lip-v7-5.js`})]},s.uid))}),M&&e(f,{shopName:$||""})]})})})})]})};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.65",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"next": "14.2.35"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/core": "17.0.0-dev.
|
|
30
|
+
"@gem-sdk/core": "17.0.0-dev.63",
|
|
31
31
|
"@gem-sdk/plugin-cookie-bar": "17.0.0-dev.38",
|
|
32
32
|
"@gem-sdk/plugin-quick-view": "17.0.0-dev.38",
|
|
33
33
|
"@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.38"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("next/head"),t=require("../libs/helpers/gen-fonts.js");exports.FontLink=({fontStyle:s,dataId:l})=>{let i=t.extractImportUrls(s),n=s.replace(/@import url\(['"]?[^'")\s]+['"]?\);?/g,"").trim();return e.jsxs(r,{children:[i.map(r=>e.jsx("link",{rel:"stylesheet",href:r},r)),n&&e.jsx("style",{"data-id":l,type:"text/css",dangerouslySetInnerHTML:{__html:n}})]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"next/head";import{extractImportUrls as l}from"../libs/helpers/gen-fonts.js";let n=({fontStyle:n,dataId:s})=>{let i=l(n),m=n.replace(/@import url\(['"]?[^'")\s]+['"]?\);?/g,"").trim();return e(r,{children:[i.map(e=>t("link",{rel:"stylesheet",href:e},e)),m&&t("style",{"data-id":s,type:"text/css",dangerouslySetInnerHTML:{__html:m}})]})};export{n as FontLink};
|