@gem-sdk/pages 17.0.0-dev.82 → 17.0.0-dev.83

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.
Files changed (51) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/libs/api/get-builder-props.js +1 -0
  3. package/dist/cjs/libs/api/get-collection-props.js +1 -0
  4. package/dist/cjs/libs/api/get-collection-share-page-props.js +1 -0
  5. package/dist/cjs/libs/api/get-home-page-props-v2.js +1 -0
  6. package/dist/cjs/libs/api/get-home-page-props.js +1 -0
  7. package/dist/cjs/libs/api/get-post-purchase-props-preview.js +1 -0
  8. package/dist/cjs/libs/api/get-preview-content-props.js +1 -0
  9. package/dist/cjs/libs/api/get-preview-props.js +1 -0
  10. package/dist/cjs/libs/api/get-product-props.js +1 -0
  11. package/dist/cjs/libs/api/get-share-page-props.js +1 -0
  12. package/dist/cjs/libs/api/get-static-page-props-preview.js +1 -0
  13. package/dist/cjs/libs/api/get-static-page-props-v2.js +1 -0
  14. package/dist/cjs/libs/api/get-static-page-props.js +1 -0
  15. package/dist/cjs/libs/custom-fonts.js +8 -0
  16. package/dist/cjs/libs/data/fonts.js +1 -0
  17. package/dist/cjs/libs/getStaticPaths.js +1 -0
  18. package/dist/cjs/libs/google-fonts.js +7 -1
  19. package/dist/cjs/libs/helpers/gen-favicon.js +1 -0
  20. package/dist/cjs/libs/helpers/generate-seo-links.js +1 -0
  21. package/dist/cjs/libs/helpers/get-metafield.js +1 -0
  22. package/dist/cjs/libs/helpers/normalize.js +1 -1
  23. package/dist/cjs/libs/helpers/parse-json.js +1 -1
  24. package/dist/esm/index.js +1 -1
  25. package/dist/esm/libs/api/get-builder-props.js +1 -0
  26. package/dist/esm/libs/api/get-collection-props.js +1 -0
  27. package/dist/esm/libs/api/get-collection-share-page-props.js +1 -0
  28. package/dist/esm/libs/api/get-home-page-props-v2.js +1 -0
  29. package/dist/esm/libs/api/get-home-page-props.js +1 -0
  30. package/dist/esm/libs/api/get-post-purchase-props-preview.js +1 -0
  31. package/dist/esm/libs/api/get-preview-content-props.js +1 -0
  32. package/dist/esm/libs/api/get-preview-props.js +1 -0
  33. package/dist/esm/libs/api/get-product-props.js +1 -0
  34. package/dist/esm/libs/api/get-share-page-props.js +1 -0
  35. package/dist/esm/libs/api/get-static-page-props-preview.js +1 -0
  36. package/dist/esm/libs/api/get-static-page-props-v2.js +1 -0
  37. package/dist/esm/libs/api/get-static-page-props.js +1 -0
  38. package/dist/esm/libs/custom-fonts.js +8 -0
  39. package/dist/esm/libs/data/fonts.js +1 -0
  40. package/dist/esm/libs/getStaticPaths.js +1 -0
  41. package/dist/esm/libs/google-fonts.js +7 -1
  42. package/dist/esm/libs/helpers/gen-favicon.js +1 -0
  43. package/dist/esm/libs/helpers/generate-seo-links.js +1 -0
  44. package/dist/esm/libs/helpers/get-metafield.js +1 -0
  45. package/dist/esm/libs/helpers/normalize.js +1 -1
  46. package/dist/esm/libs/helpers/parse-json.js +1 -1
  47. package/dist/types/index.d.ts +125 -90
  48. package/package.json +9 -21
  49. package/dist/cjs/server.js +0 -14
  50. package/dist/esm/server.js +0 -14
  51. package/dist/types/server.d.ts +0 -156
@@ -0,0 +1 @@
1
+ let t=async()=>({paths:[],fallback:!0});export{t as getStaticPaths};
@@ -1 +1,7 @@
1
- import{checkNotInOptionFont as t}from"./helpers/check-option-font.js";import{sentryCaptureException as e}from"./helpers/sentry.js";import{THEME_FONT_CSS_KEYS as r}from"./constants/theme-font-keys.js";import{googleFontFamilies as n}from"../constants/googleFontV1.js";async function o(t,r){try{return fetch(t,{headers:{"User-Agent":r}}).then(n=>200===n.status?n.text():(e("getFontForUA",`Unexpected status ${n.status}`,{url:t,UA:r}),""))}catch(n){return e("getFontForUA","Error fetching font",{url:t,UA:r,error:n}),""}}let i=t=>{let e=t.filter((t,e,r)=>e===r.findIndex(e=>e.family===t.family));return e.map(e=>{let r=t.filter(t=>t.family===e.family).reduce((t,e)=>[...t,...e.variants],[]).filter((t,e,r)=>e===r.findIndex(e=>e===t));return{...e,variants:r}})},l={"Roboto Flex":"https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap"},a=t=>t?.trim().replace(/\s+/g,"+")??"",s=t=>t.includes("fonts.googleapis.com/css2")?"css2":t.includes("fonts.bunny.net")?"bunny":"css1",f=t=>{let e=a(t);return l[t]??l[e]},c={regular:"400",normal:"400",bold:"700",italic:"400italic"},p=new Set(n),u=[...r,...r.map(t=>`--g-${t}`)],g=(e,r,n)=>{if(("google"===r||"google"===e.type)&&!p.has(e.family))return!1;let o="google"===e.type||"bunny"===e.type,i="theme"===e.type&&n,l=t(e.family,r);return!(o&&l)&&(o||!e.type||i)},y=t=>{let e=String(t).toLowerCase().trim();return c[e]??t},m=t=>{let e=t=>{let e=String(t).toLowerCase().trim(),r=e.includes("italic"),n=e.replace("italic","").trim(),o=c[n]??n,i=parseInt(o,10)||400;return{weight:i,isItalic:r}};return[...t].sort((t,r)=>{let n=e(t),o=e(r);return n.weight!==o.weight?n.weight-o.weight:n.isItalic!==o.isItalic?n.isItalic?1:-1:0})},h=(t,e,r)=>{let n=i(t).map(t=>{let e=t.variants.map(t=>y(t)),r=m(e);return`${t.family.replace(/ /g,"+")}:${r.join(",")}`}).join("|");if("sans-serif"===n)return;let o=new URLSearchParams;return(o.append("family",n),o.append("display",r?.display||"swap"),"bunny"===e)?`https://fonts.bunny.net/css?${decodeURIComponent(o.toString())}`:(r?.subset&&o.append("subset",r.subset),r?.effect&&o.append("effect",r.effect),`https://fonts.googleapis.com/css?${decodeURIComponent(o.toString())}`)},d=(t,e,r,n)=>{let o=t.filter(t=>g(t,r||"google",n));if(!o.length)return;let i=o.filter((t,e,r)=>e===r.findIndex(e=>e.family===t.family)),l=[],a=[];for(let t of i){let e=f(t.family);e&&"bunny"!==r?l.push(e):a.push(t)}let s=a.length?h(a,r||"google",e):void 0;return l.length&&s?[...l,s]:s?[s,...l]:l};async function b(t,r,n=!0,i){let l=t.filter(t=>!u.includes(t.family)),a=d(l,r,i),f=Array.isArray(a)?a:a?[a]:[];if(!f.length)return"";if(n)return f.map(t=>`@import url('${t}');`).join("");let c="",p="";for(let t of f)try{let[e,r]=await Promise.all([o(t,"Mozilla/5.0 (Windows NT 10.0; Trident/7.0; rv:11.0) like Gecko"),o(t,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36")]),n=`${e}${r}`;c+=n,p+=`@import url('${t}');`}catch(n){let r=s(t);e("getFonts",`Error fetching font ${r}`,{url:t,fontType:i,fontApiVersion:r,error:String(n)}),p+="",c+=""}let g=new TextEncoder().encode(c).length;return g<51200?c:p}let w=(t,e)=>{let r="400";if(null!=t){let e=String(t).toLowerCase().trim();r=y(e)}let n=r,o=e&&"italic"===e.toLowerCase();return o&&!r.includes("italic")&&(n=r.includes("i")?r:`${r}italic`),n},F=t=>{let e=t?.typography??{},r=t?.font??{},n=new Map;Object.entries(e).forEach(([t,e])=>{if(!e||"object"!=typeof e)return;let o=t.startsWith("heading-")||t.startsWith("subheading-")?r.heading?"heading":void 0:t.startsWith("paragraph-")&&r.body?"body":void 0,i=e.desktop,l=i?.fontFamily,a=l||o;["desktop","mobile","tablet"].forEach(t=>{let o=e[t];if(!o||"object"!=typeof o)return;let l=o.fontFamily||a;if(!l||"string"!=typeof l||!r[l])return;let s=o.fontWeight??i?.fontWeight,f=o.fontStyle??i?.fontStyle;if(null==s)return;let c=w(s,f);n.has(l)||n.set(l,new Set),n.get(l).add(c)})});let o={};return n.forEach((t,e)=>{let n=r[e];n&&(o[e]={variants:Array.from(t).sort(),family:n.family,type:n.type})}),o},S=async(t,e)=>{if(!t)return"";try{let r=JSON.parse(t),n=r?.font??{},o=Object.values(n),l=F(r);Object.keys(l).length>0&&(o=Object.entries(n).filter(([t])=>l[t]).map(([t,e])=>({...e,variants:l[t].variants})));let a=i(o);return b(a,void 0,void 0,e)}catch{return""}},j=(t,e)=>{if(!t)return"";try{let r=JSON.parse(t),n=r?.font??{},o=Object.entries(n).map(([,t])=>t);return b(o,void 0,void 0,e)}catch{return""}};export{i as composeFonts,d as createFontUrls,F as extractTypographyVariants,j as getFontFromGlobalStyle,S as getFontLinkFromGlobalStyle,b as getFonts};
1
+ import{checkNotInOptionFont as t}from"./helpers/check-option-font.js";import{getFontsFromDataBuilder as e}from"./helpers/gen-fonts.js";import{sentryCaptureException as n}from"./helpers/sentry.js";import{THEME_FONT_CSS_KEYS as r}from"./constants/theme-font-keys.js";import{googleFontFamilies as i}from"../constants/googleFontV1.js";import a from"./data/fonts.js";let l="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36";async function o(t,e){try{return fetch(t,{headers:{"User-Agent":e}}).then(r=>200===r.status?r.text():(n("getFontForUA",`Unexpected status ${r.status}`,{url:t,UA:e}),""))}catch(r){return n("getFontForUA","Error fetching font",{url:t,UA:e,error:r}),""}}let s=t=>{let e=t.filter((t,e,n)=>e===n.findIndex(e=>e.family===t.family));return e.map(e=>{let n=t.filter(t=>t.family===e.family).reduce((t,e)=>[...t,...e.variants],[]).filter((t,e,n)=>e===n.findIndex(e=>e===t));return{...e,variants:n}})},f={"Roboto Flex":"https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap"},c=t=>t?.trim().replace(/\s+/g,"+")??"",y=t=>t.includes("fonts.googleapis.com/css2")?"css2":t.includes("fonts.bunny.net")?"bunny":"css1",u=t=>{let e=c(t);return f[t]??f[e]},p={regular:"400",normal:"400",bold:"700",italic:"400italic"},g=new Set(i),m=[...r,...r.map(t=>`--g-${t}`)],h=(e,n,r)=>{if(("google"===n||"google"===e.type)&&!g.has(e.family))return!1;let i="google"===e.type||"bunny"===e.type,a="theme"===e.type&&r,l=t(e.family,n);return!(i&&l)&&(i||!e.type||a)},d=t=>{let e=String(t).toLowerCase().trim();return p[e]??t},b=t=>{let e=t=>{let e=String(t).toLowerCase().trim(),n=e.includes("italic"),r=e.replace("italic","").trim(),i=p[r]??r,a=parseInt(i,10)||400;return{weight:a,isItalic:n}};return[...t].sort((t,n)=>{let r=e(t),i=e(n);return r.weight!==i.weight?r.weight-i.weight:r.isItalic!==i.isItalic?r.isItalic?1:-1:0})},v=(t,e,n)=>{let r=s(t).map(t=>{let e=t.variants.map(t=>d(t)),n=b(e);return`${t.family.replace(/ /g,"+")}:${n.join(",")}`}).join("|");if("sans-serif"===r)return;let i=new URLSearchParams;return(i.append("family",r),i.append("display",n?.display||"swap"),"bunny"===e)?`https://fonts.bunny.net/css?${decodeURIComponent(i.toString())}`:(n?.subset&&i.append("subset",n.subset),n?.effect&&i.append("effect",n.effect),`https://fonts.googleapis.com/css?${decodeURIComponent(i.toString())}`)},S=(t,e,n,r)=>{let i=t.filter(t=>h(t,n||"google",r));if(!i.length)return;let a=i.filter((t,e,n)=>e===n.findIndex(e=>e.family===t.family)),l=[],o=[];for(let t of a){let e=u(t.family);e&&"bunny"!==n?l.push(e):o.push(t)}let s=o.length?v(o,n||"google",e):void 0;return l.length&&s?[...l,s]:s?[s,...l]:l};async function w(t,e,r=!0,i){let a=t.filter(t=>!m.includes(t.family)),s=S(a,e,i),f=Array.isArray(s)?s:s?[s]:[];if(!f.length)return"";if(r)return f.map(t=>`@import url('${t}');`).join("");let c="",u="";for(let t of f)try{let[e,n]=await Promise.all([o(t,"Mozilla/5.0 (Windows NT 10.0; Trident/7.0; rv:11.0) like Gecko"),o(t,l)]),r=`${e}${n}`;c+=r,u+=`@import url('${t}');`}catch(r){let e=y(t);n("getFonts",`Error fetching font ${e}`,{url:t,fontType:i,fontApiVersion:e,error:String(r)}),u+="",c+=""}let p=new TextEncoder().encode(c).length;return p<51200?c:u}let F=(t,n)=>{let r=[];return t.forEach(t=>{r.push(...e(t.data,n))}),s(r)},$=(t,e)=>{let n="400";if(null!=t){let e=String(t).toLowerCase().trim();n=d(e)}let r=n,i=e&&"italic"===e.toLowerCase();return i&&!n.includes("italic")&&(r=n.includes("i")?n:`${n}italic`),r},j="heading-",O="subheading-",W="paragraph-",k=t=>{let e=t?.typography??{},n=t?.font??{},r=new Map;Object.entries(e).forEach(([t,e])=>{if(!e||"object"!=typeof e)return;let i=t.startsWith(j)||t.startsWith(O)?n.heading?"heading":void 0:t.startsWith(W)&&n.body?"body":void 0,a=e.desktop,l=a?.fontFamily,o=l||i;["desktop","mobile","tablet"].forEach(t=>{let i=e[t];if(!i||"object"!=typeof i)return;let l=i.fontFamily||o;if(!l||"string"!=typeof l||!n[l])return;let s=i.fontWeight??a?.fontWeight,f=i.fontStyle??a?.fontStyle;if(null==s)return;let c=$(s,f);r.has(l)||r.set(l,new Set),r.get(l).add(c)})});let i={};return r.forEach((t,e)=>{let r=n[e];r&&(i[e]={variants:Array.from(t).sort(),family:r.family,type:r.type})}),i},E=t=>{let e=t?.typography??{},n=t?.font??{},r=t?.font??{},i={};return Object.entries(e).forEach(([t,e])=>{if(!e||"object"!=typeof e)return;let a=e.desktop,l=e.mobile,o=e.tablet,s=t.startsWith(j)||t.startsWith(O)?r.heading?"heading":void 0:t.startsWith(W)&&r.body?"body":void 0,f=a?.fontFamily||l?.fontFamily||o?.fontFamily||s;if(!f||"string"!=typeof f)return;let c=n[f],y=r[f],u=c?.family||y?.family||f,p=c?.type||y?.type||"google";u&&(i[t]={family:u,type:p})}),i},I=async(t,e)=>{if(!t)return"";try{let n=JSON.parse(t),r=n?.font??{},i=Object.values(r),a=k(n);Object.keys(a).length>0&&(i=Object.entries(r).filter(([t])=>a[t]).map(([t,e])=>({...e,variants:a[t].variants})));let l=s(i);return w(l,void 0,void 0,e)}catch{return""}},x=(t,e)=>{if(!t)return"";try{let n=JSON.parse(t),r=n?.font??{},i=Object.entries(r).map(([,t])=>t);return w(i,void 0,void 0,e)}catch{return""}};async function A(t,e,n){let r,i=null;if(n)try{i=JSON.parse(n),r=E(i)}catch{}let a=F(t,r);if(!i){if(0===a.length)return[];let t=await w(a,void 0,void 0,e);return t?[t]:[]}let l=k(i),o=new Map,s=new Map,f=(t,e)=>`${t}::${e}`;for(let t of Object.values(l)){if(t.type){let e=f(t.family,t.type),n=o.get(e);if(!n){o.set(e,new Set(t.variants));continue}t.variants.forEach(t=>n.add(t));continue}let e=s.get(t.family);if(!e){s.set(t.family,new Set(t.variants));continue}t.variants.forEach(t=>e.add(t))}if(0===(a=a.map(t=>{let e=o.get(f(t.family,t.type))||s.get(t.family);if(!e)return t;let n=t.variants.filter(t=>!e.has(t));return 0===n.length?null:{...t,variants:n}}).filter(t=>null!==t)).length)return[];let c=await w(a,void 0,void 0,e);return c?[c]:[]}let C=null;function M({fontFamily:t,fontStyle:e,fontWeight:n,src:r,fontDisplay:i}){let a=r.replace(/^"|"$/g,""),l=`@font-face {
2
+ `;return l+=` font-family: '${t}';
3
+ font-style: ${e};
4
+ font-weight: ${n};
5
+ `,i&&(l+=` font-display: ${i};
6
+ `),l+=` src: ${a};
7
+ }`}function T({variant:t}){let e=t.trim().toLowerCase();if("regular"===e||"400"===e)return{fontStyle:"normal",fontWeight:"400"};if("italic"===e)return{fontStyle:"italic",fontWeight:"400"};if("bold"===e||"700"===e)return{fontStyle:"normal",fontWeight:"700"};let n=e.endsWith("i")||e.endsWith("italic"),r=e.replace(/i(talic)?$/,"").trim()||"400";return{fontStyle:n?"italic":"normal",fontWeight:r}}async function L({fonts:t,sourceFont:e}){let r=t.filter(t=>!m.includes(t.family));if(!r.length)return"";let i="bunny"===e,s=i?null:function(){if(C)return C;for(let t of(C={},a.fonts)){let e=`${t.fontFamily}_${t.fontStyle}_${t.fontWeight}`.replace(/\s+/g,"");C[e]=t}return C}(),f=await Promise.all(r.map(async t=>{let r=[],i=[];for(let e of t.variants){if(s){let{fontStyle:n,fontWeight:i}=T({variant:e}),a=`${t.family}_${n}_${i}`.replace(/\s+/g,""),l=s[a];if(l){r.push(M(l));continue}}i.push(e)}if(i.length){let a=S([{...t,variants:i}],void 0,e),s=Array.isArray(a)?a:a?[a]:[],f=await Promise.all(s.map(t=>o(t,l)));for(let e=0;e<f.length;e++){let a=f[e];a?r.push(a):n("resolveFontFaces","API fallback returned empty CSS",{family:t.family,variants:i,url:s[e]})}}return r.length?r.join("\n"):""}));return f.filter(Boolean).join("\n")}async function U({data:t,sourceFont:e}){if(!t)return"";try{let n="string"==typeof t?JSON.parse(t):t,r=n?.font??{},i=Object.values(r),a=k(n);return Object.keys(a).length>0&&(i=Object.entries(r).filter(([t])=>a[t]).map(([t,e])=>Object.assign({},e,{variants:a[t].variants}))),L({fonts:s(i),sourceFont:e})}catch{return""}}async function P({pageTemplate:t,sourceFont:e,data:n}){let r,i=null;if(n)try{i="string"==typeof n?JSON.parse(n):n,r=E(i)}catch{}let a=F(t,r);if(!i){if(!a.length)return[];let t=await L({fonts:a,sourceFont:e});return t?[t]:[]}let l=k(i),o=new Map,s=new Map,f=(t,e)=>`${t}::${e}`;for(let t of Object.values(l))if(t.type){let e=f(t.family,t.type),n=o.get(e);n?t.variants.forEach(t=>n.add(t)):o.set(e,new Set(t.variants))}else{let e=s.get(t.family);e?t.variants.forEach(t=>e.add(t)):s.set(t.family,new Set(t.variants))}if(!(a=a.map(t=>{let e=o.get(f(t.family,t.type))||s.get(t.family);if(!e)return t;let n=t.variants.filter(t=>!e.has(t));return n.length?Object.assign({},t,{variants:n}):null}).filter(t=>null!==t)).length)return[];let c=await L({fonts:a,sourceFont:e});return c?[c]:[]}export{s as composeFonts,S as createFontUrls,k as extractTypographyVariants,x as getFontFromGlobalStyle,I as getFontLinkFromGlobalStyle,A as getFontStyleFromPageTemplate,w as getFonts,U as getStaticFontFacesFromGlobalStyle,P as getStaticFontFacesFromPageTemplate,E as mapTypographyToFontFamily,T as parseVariant,M as staticFontToCSS};
@@ -0,0 +1 @@
1
+ let e=(e,i)=>{if(!e)return"/favicon/favicon-32x32.png";let n=e.split("."),o=n.pop();return["jpg","jpeg","png","gif","webp","ico"].includes(o?.toLocaleLowerCase())?`${n.join(".")}_x${i}.${o}`:e};export{e as genResizeFaviconUrl};
@@ -0,0 +1 @@
1
+ import{genResizeFaviconUrl as e}from"./gen-favicon.js";let i=i=>[{rel:"icon",sizes:"32x32",href:e(i,32)},{rel:"icon",sizes:"16x16",href:e(i,16)},{rel:"apple-touch-icon",sizes:"180x180",href:e(i,180)}],r=({favicon:e})=>[...i(e)];export{i as generateFaviconLinks,r as generateSeoLinks};
@@ -0,0 +1 @@
1
+ let e=(e,l)=>l?.find(l=>l?.key===e)?.value;export{e as getPublishedThemePageMetafieldByKey};
@@ -1 +1 @@
1
- let e=e=>{let t={};return!function e(t,i={}){if(t){let{childrens:n,dateModified:r,editorConfigs:o,...l}=t;if("section"===l.type)i[l.uid]=l;else{let t=n?.map(e=>e?.uid)??[];i[l.uid]={...l,childrens:t},n&&n.map(t=>e(t,i))}}}(e,t),{...t}},t=(e,t)=>{let i=t?.filter(t=>e?.some(e=>e?.id===t)),n=i?.map(t=>e?.find(e=>e?.id===t))??[],r=e?.filter(e=>(!e?.id||!i?.includes(e.id))&&!e?.deletedAt)??[];return n.concat(r)};function i(i,n){let r=t(i,n),o=r.map(e=>{if(!e?.component)return!1;try{let t=JSON.parse(e.component);return t}catch{return!1}}).filter(Boolean);return o.map(t=>({uid:t.uid,lazy:!!t.settings?.lazy,priority:!!t.settings?.priority,data:e(t)}))}let n=e=>i([...e?.pageSections??[],...e?.themePageCustomSections??[],...e?.themeSections??[]],e?.sectionPosition);export{e as normalizeBuilderData,i as normalizePageSectionResponseV2,n as parseBuilderTemplateV2};
1
+ let e=e=>{let t={};return!function e(t,i={}){if(t){let{childrens:r,dateModified:n,editorConfigs:o,...a}=t;if("section"===a.type)i[a.uid]=a;else{let t=r?.map(e=>e?.uid)??[];i[a.uid]={...a,childrens:t},r&&r.map(t=>e(t,i))}}}(e,t),{...t}},t=(e,t)=>{let i=t?.filter(t=>e?.some(e=>e?.id===t)),r=i?.map(t=>e?.find(e=>e?.id===t))??[],n=e?.filter(e=>(!e?.id||!i?.includes(e.id))&&!e?.deletedAt)??[];return r.concat(n)};function i(i,r){let n=t(i,r),o=n.map(e=>{if(!e?.component)return!1;try{let t=JSON.parse(e.component);return t}catch{return!1}}).filter(Boolean);return o.map(t=>({uid:t.uid,lazy:!!t.settings?.lazy,priority:!!t.settings?.priority,data:e(t)}))}let r=e=>i([...e?.pageSections??[],...e?.themePageCustomSections??[],...e?.themeSections??[]],e?.sectionPosition),n=i=>(function(i,r){let n=t(i,r),o=n.map(e=>{if(!e?.component)return!1;try{let t=JSON.parse(e.component);return t}catch{return!1}}).filter(Boolean);return e({uid:"ROOT",tag:"Root",childrens:o})})([...i?.pageSections??[],...i?.themePageCustomSections??[]],i?.sectionPosition),o=e=>{try{let t=e?.metafields?.find(e=>e?.key==="page_background")?.value;return JSON.parse(t??"{}")}catch{return{}}},a=e=>i([...e?.sections??[]],e?.sectionPosition),s=e=>i([...e?.shopLibrarySections??[]],e?.sectionPosition);export{o as extractPageBackground,e as normalizeBuilderData,i as normalizePageSectionResponseV2,a as parseBuilderLibraryTemplate,n as parseBuilderTemplate,r as parseBuilderTemplateV2,s as parseShopLibraryPageTemplate};
@@ -1 +1 @@
1
- let r=r=>{if(!r)return null;try{return JSON.parse(r)}catch(r){return null}};export{r as parseJson};
1
+ let r=r=>{if(!r)return null;try{return JSON.parse(r)}catch(r){return null}},e=r=>JSON.parse(JSON.stringify(r));export{r as parseJson,e as serializableJson};
@@ -1,97 +1,13 @@
1
- import { FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, ShopType, PublishedThemePageSelectFragment, BuilderState, SectionData as SectionData$1, RenderMode, CollectionQueryResponse, PublicStoreFrontData, ProductSelectFragment, ProductOffer, AppAPIType, TypographyV2FontFamilyType } from '@gem-sdk/core';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import { BuilderState, SectionData as SectionData$1, ShopType, RenderMode, CollectionQueryResponse, PublicStoreFrontData, ProductSelectFragment, ProductOffer, AppAPIType, FetchFunc, ThemePageQueryResponse, StorePropertyQueryResponse, PublishedThemePageSelectFragment, TypographyV2FontFamilyType } from '@gem-sdk/core';
2
+ import { NextPage, GetStaticPaths } from 'next';
3
3
  import * as next_seo from 'next-seo';
4
4
  import { NextSeoProps } from 'next-seo';
5
- import { ShopMetaQueryResponse } from '@gem-sdk/adapter-shopify';
6
- import { NextPage } from 'next';
7
5
  import { AppProps } from 'next/app';
8
6
  import { SWRConfig } from 'swr';
9
7
  import * as React$1 from 'react';
10
8
  import React__default, { Component } from 'react';
11
-
12
- declare const createFetcher: (token?: string | null) => FetchFunc;
13
- declare const createAppAPIFetcher: (token?: string | null, shopID?: string) => FetchFunc;
14
- declare const createShopifyFetcher: (storefrontToken?: string, handle?: string) => FetchFunc;
15
- declare const createTemplateFetcher: (handle: string) => FetchFunc;
16
-
17
- declare const getLayout: (page: React.ReactElement, pageProps?: any) => react_jsx_runtime.JSX.Element;
18
-
19
- declare const genCSS: (input?: string | Record<string, any>, mobileOnly?: boolean) => string;
20
-
21
- type SendPageViewedTrackingParams = {
22
- id: string | number | null | undefined;
23
- shopID: string | number | null | undefined;
24
- domain?: string;
25
- };
26
- declare const sendPageViewedTracking: (params: SendPageViewedTrackingParams) => void;
27
-
28
- declare const usePagePreview: (dataBuilder: ThemePageQueryResponse["themePage"], storeProperty: PromiseSettledResult<StorePropertyQueryResponse>, shopifyMeta?: PromiseSettledResult<ShopMetaQueryResponse>) => {
29
- seo: next_seo.NextSeoProps;
30
- pageConfig: {
31
- mobileOnly: boolean;
32
- locale: string | null;
33
- languageIsoCode: ("ID" | "AF" | "AM" | "AR" | "AZ" | "BE" | "BG" | "BM" | "BN" | "BO" | "BR" | "BS" | "CA" | "CU" | "CY" | "DE" | "DZ" | "EE" | "ES" | "ET" | "FI" | "FO" | "FR" | "GA" | "GD" | "GL" | "HR" | "HU" | "IS" | "IT" | "KI" | "KM" | "KN" | "KW" | "KY" | "LA" | "LB" | "LT" | "LU" | "LV" | "MG" | "MK" | "ML" | "MN" | "MO" | "MR" | "MS" | "MT" | "MY" | "NE" | "NL" | "NO" | "OM" | "PA" | "PL" | "PS" | "PT" | "RO" | "RU" | "RW" | "SA" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SK" | "SL" | "SN" | "SO" | "SR" | "SV" | "TA" | "TG" | "TH" | "TK" | "TO" | "TR" | "TT" | "UG" | "UZ" | "AK" | "AS" | "CE" | "CKB" | "CS" | "DA" | "EL" | "EN" | "EO" | "EU" | "FA" | "FF" | "FIL" | "FY" | "GU" | "GV" | "HA" | "HE" | "HI" | "HY" | "IA" | "IG" | "II" | "JA" | "JV" | "KA" | "KK" | "KL" | "KO" | "KS" | "KU" | "LG" | "LN" | "LO" | "MI" | "NB" | "ND" | "NN" | "OR" | "OS" | "PT_BR" | "PT_PT" | "QU" | "RM" | "RN" | "SQ" | "SU" | "SW" | "TE" | "TI" | "UK" | "UR" | "VI" | "VO" | "WO" | "XH" | "YI" | "YO" | "ZH" | "ZH_CN" | "ZH_TW" | "ZU") | null;
34
- countryIsoCode: ("ID" | "AC" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AN" | "AO" | "AR" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MK" | "ML" | "MM" | "MN" | "MO" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PS" | "PT" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TA" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ") | null;
35
- moneyFormat: string | null;
36
- currency: ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BYR" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KID" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VEF" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XXX" | "YER" | "ZAR" | "ZMW") | null;
37
- swatches: any;
38
- };
39
- };
40
-
41
- type IUsePageViewedTrackingParams = {
42
- id?: string | number | null;
43
- shopID?: string | number | null;
44
- enabled?: boolean;
45
- domain?: string;
46
- };
47
- declare const usePageViewedTracking: ({ id, shopID, enabled, domain, }: IUsePageViewedTrackingParams) => void;
48
-
49
- declare function isBot(input: string): boolean;
50
-
51
- type SectionData = {
52
- id: string;
53
- component?: string;
54
- [key: string]: any;
55
- };
56
- declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<SectionData>[], orders?: string[]): {
57
- uid: string;
58
- lazy: boolean;
59
- priority: boolean;
60
- data: any;
61
- }[];
62
- type ParseBuilderTemplateV2Props = PublishedThemePageSelectFragment & {
63
- themeSections?: {
64
- id: string;
65
- name: string;
66
- content: string;
67
- }[];
68
- };
69
- declare const parseBuilderTemplateV2: (data?: ParseBuilderTemplateV2Props) => {
70
- uid: string;
71
- lazy: boolean;
72
- priority: boolean;
73
- data: any;
74
- }[];
75
-
76
- declare const getFallbackV2: (fetcher: FetchFunc, data: {
77
- data: any;
78
- }[], isStorefront?: boolean, disableIsSample?: boolean) => Promise<{}>;
79
-
80
- type RetryConfig = {
81
- retries?: number;
82
- delay?: number;
83
- retryIf?: (error: any) => boolean;
84
- };
85
- declare const retryWithDelay: <T = unknown>(fn: () => T, config?: RetryConfig) => Promise<T>;
86
-
87
- type Props$4 = {
88
- trackingId?: string | null;
89
- params?: {
90
- page_id?: string;
91
- source_shop_id?: string;
92
- };
93
- };
94
- declare const SharePageTracking: ({ trackingId, params }: Props$4) => react_jsx_runtime.JSX.Element | null;
9
+ import * as react_jsx_runtime from 'react/jsx-runtime';
10
+ import { ShopMetaQueryResponse } from '@gem-sdk/adapter-shopify';
95
11
 
96
12
  type PageBuilderProps = {
97
13
  seo?: NextSeoProps;
@@ -260,6 +176,125 @@ type SharePageProps = PageBuilderPropsV2 & {
260
176
  trackingId?: string | null;
261
177
  };
262
178
 
179
+ declare const getCollectionProps: (fetcher: FetchFunc) => (handle?: string) => Promise<CollectionDetailPageProps>;
180
+
181
+ declare const getCollectionSharePageProps: (fetcher: FetchFunc) => (baseId?: string) => Promise<{
182
+ collection: any;
183
+ }>;
184
+
185
+ declare const getHomePageProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderProps>;
186
+
187
+ declare const getHomePagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => () => Promise<PageBuilderPropsV2>;
188
+
189
+ declare const getPreviewProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (pageType: ShopType.PublishedThemePageType, slug?: string) => Promise<PageBuilderProps>;
190
+
191
+ type Props$5 = Pick<PageBuilderProps, 'swr' | 'themeStyle' | 'seo' | 'currency' | 'locale' | 'swatches'>;
192
+ declare const getBuilderProps: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => Promise<Props$5>;
193
+
194
+ declare const getProductProps: (fetcher: FetchFunc) => (handle?: string) => Promise<ProductPageProps>;
195
+
196
+ declare const getStaticPagePropsV2: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
197
+
198
+ declare const getSharePageProps: (fetcher: FetchFunc) => (slug: string) => Promise<SharePageProps | null>;
199
+
200
+ declare const getPostPurchasePropsPreview: (fetcher: FetchFunc, librarySaleFunnelID?: string, storeFrontFetcher?: FetchFunc) => (data: {
201
+ id: string;
202
+ currentOfferID: string;
203
+ isLibraryTemplate?: boolean;
204
+ isShopLibraryPage?: boolean;
205
+ sellingPlanSetting?: Record<string, any>;
206
+ }) => Promise<Omit<StaticPagePropsV2, "publicStoreFrontData">>;
207
+
208
+ declare const getStaticPagePropsPreview: (fetcher: FetchFunc, shopifyFetcher: FetchFunc) => (slug: string) => Promise<PageBuilderPropsV2>;
209
+
210
+ declare const getSharePageContentProps: (fetcher: FetchFunc) => (slug: string) => Promise<SharePageProps | null>;
211
+
212
+ declare const createFetcher: (token?: string | null) => FetchFunc;
213
+ declare const createAppAPIFetcher: (token?: string | null, shopID?: string) => FetchFunc;
214
+ declare const createShopifyFetcher: (storefrontToken?: string, handle?: string) => FetchFunc;
215
+ declare const createTemplateFetcher: (handle: string) => FetchFunc;
216
+
217
+ declare const getLayout: (page: React.ReactElement, pageProps?: any) => react_jsx_runtime.JSX.Element;
218
+
219
+ declare const genCSS: (input?: string | Record<string, any>, mobileOnly?: boolean) => string;
220
+
221
+ type SendPageViewedTrackingParams = {
222
+ id: string | number | null | undefined;
223
+ shopID: string | number | null | undefined;
224
+ domain?: string;
225
+ };
226
+ declare const sendPageViewedTracking: (params: SendPageViewedTrackingParams) => void;
227
+
228
+ declare const usePagePreview: (dataBuilder: ThemePageQueryResponse["themePage"], storeProperty: PromiseSettledResult<StorePropertyQueryResponse>, shopifyMeta?: PromiseSettledResult<ShopMetaQueryResponse>) => {
229
+ seo: next_seo.NextSeoProps;
230
+ pageConfig: {
231
+ mobileOnly: boolean;
232
+ locale: string | null;
233
+ languageIsoCode: ("ID" | "AF" | "AM" | "AR" | "AZ" | "BE" | "BG" | "BM" | "BN" | "BO" | "BR" | "BS" | "CA" | "CU" | "CY" | "DE" | "DZ" | "EE" | "ES" | "ET" | "FI" | "FO" | "FR" | "GA" | "GD" | "GL" | "HR" | "HU" | "IS" | "IT" | "KI" | "KM" | "KN" | "KW" | "KY" | "LA" | "LB" | "LT" | "LU" | "LV" | "MG" | "MK" | "ML" | "MN" | "MO" | "MR" | "MS" | "MT" | "MY" | "NE" | "NL" | "NO" | "OM" | "PA" | "PL" | "PS" | "PT" | "RO" | "RU" | "RW" | "SA" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SK" | "SL" | "SN" | "SO" | "SR" | "SV" | "TA" | "TG" | "TH" | "TK" | "TO" | "TR" | "TT" | "UG" | "UZ" | "AK" | "AS" | "CE" | "CKB" | "CS" | "DA" | "EL" | "EN" | "EO" | "EU" | "FA" | "FF" | "FIL" | "FY" | "GU" | "GV" | "HA" | "HE" | "HI" | "HY" | "IA" | "IG" | "II" | "JA" | "JV" | "KA" | "KK" | "KL" | "KO" | "KS" | "KU" | "LG" | "LN" | "LO" | "MI" | "NB" | "ND" | "NN" | "OR" | "OS" | "PT_BR" | "PT_PT" | "QU" | "RM" | "RN" | "SQ" | "SU" | "SW" | "TE" | "TI" | "UK" | "UR" | "VI" | "VO" | "WO" | "XH" | "YI" | "YO" | "ZH" | "ZH_CN" | "ZH_TW" | "ZU") | null;
234
+ countryIsoCode: ("ID" | "AC" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AN" | "AO" | "AR" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MK" | "ML" | "MM" | "MN" | "MO" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PS" | "PT" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TA" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ") | null;
235
+ moneyFormat: string | null;
236
+ currency: ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BYR" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KID" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VEF" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XXX" | "YER" | "ZAR" | "ZMW") | null;
237
+ swatches: any;
238
+ };
239
+ };
240
+
241
+ type IUsePageViewedTrackingParams = {
242
+ id?: string | number | null;
243
+ shopID?: string | number | null;
244
+ enabled?: boolean;
245
+ domain?: string;
246
+ };
247
+ declare const usePageViewedTracking: ({ id, shopID, enabled, domain, }: IUsePageViewedTrackingParams) => void;
248
+
249
+ declare function isBot(input: string): boolean;
250
+
251
+ type SectionData = {
252
+ id: string;
253
+ component?: string;
254
+ [key: string]: any;
255
+ };
256
+ declare function normalizePageSectionResponseV2(sections?: ShopType.Maybe<SectionData>[], orders?: string[]): {
257
+ uid: string;
258
+ lazy: boolean;
259
+ priority: boolean;
260
+ data: any;
261
+ }[];
262
+ type ParseBuilderTemplateV2Props = PublishedThemePageSelectFragment & {
263
+ themeSections?: {
264
+ id: string;
265
+ name: string;
266
+ content: string;
267
+ }[];
268
+ };
269
+ declare const parseBuilderTemplateV2: (data?: ParseBuilderTemplateV2Props) => {
270
+ uid: string;
271
+ lazy: boolean;
272
+ priority: boolean;
273
+ data: any;
274
+ }[];
275
+
276
+ declare const getFallbackV2: (fetcher: FetchFunc, data: {
277
+ data: any;
278
+ }[], isStorefront?: boolean, disableIsSample?: boolean) => Promise<{}>;
279
+
280
+ type RetryConfig = {
281
+ retries?: number;
282
+ delay?: number;
283
+ retryIf?: (error: any) => boolean;
284
+ };
285
+ declare const retryWithDelay: <T = unknown>(fn: () => T, config?: RetryConfig) => Promise<T>;
286
+
287
+ type Props$4 = {
288
+ trackingId?: string | null;
289
+ params?: {
290
+ page_id?: string;
291
+ source_shop_id?: string;
292
+ };
293
+ };
294
+ declare const SharePageTracking: ({ trackingId, params }: Props$4) => react_jsx_runtime.JSX.Element | null;
295
+
296
+ declare const getStaticPaths: GetStaticPaths;
297
+
263
298
  type FontType = 'bunny' | 'google';
264
299
 
265
300
  type FontItem = {
@@ -305,7 +340,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
305
340
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
306
341
  reset: () => void;
307
342
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
308
- render(): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React$1.ReactNode> | Promise<React$1.AwaitedReactNode> | null | undefined;
343
+ render(): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<React$1.AwaitedReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
309
344
  }
310
345
 
311
346
  type Props$3 = {
@@ -349,5 +384,5 @@ declare const StaticPageV2: React.FC<StaticPagePropsV2 & AdditionalPageBuilderPr
349
384
 
350
385
  declare const PreviewTemplate: React.FC<SharePageProps & AdditionalPageBuilderProps>;
351
386
 
352
- export { BuilderPage, BuilderUpsellPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, Page404, Page500, PreviewPage, PreviewTemplate, ProductDetailPage, SharePageTracking, StaticPage, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, createTemplateFetcher, genCSS, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFontLinkFromGlobalStyle, getFonts, getFontsFromDataBuilder, getLayout, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, sendPageViewedTracking, usePagePreview, usePageViewedTracking };
387
+ export { BuilderPage, BuilderUpsellPage, CollectionDetailPage, ErrorBoundary, ErrorFallback, FacebookPixel, GoogleAnalytic, Page404, Page500, PreviewPage, PreviewTemplate, ProductDetailPage, SharePageTracking, StaticPage, StaticPageV2, TikTokPixel, createAppAPIFetcher, createFetcher, createShopifyFetcher, createTemplateFetcher, genCSS, getBuilderProps, getCollectionProps, getCollectionSharePageProps, getFallbackV2, getFontFromGlobalStyle, getFontFromGroupSetting, getFontLinkFromGlobalStyle, getFonts, getFontsFromDataBuilder, getHomePageProps, getHomePagePropsV2, getLayout, getPostPurchasePropsPreview, getPreviewProps, getProductProps, getSharePageContentProps, getSharePageProps, getStaticPagePropsPreview, getStaticPagePropsV2, getStaticPaths, getStorefrontApi, isBot, normalizePageSectionResponseV2, parseBuilderTemplateV2, retryWithDelay, sendPageViewedTracking, usePagePreview, usePageViewedTracking };
353
388
  export type { AppPropsWithLayout, NextPageWithLayout, PageBuilderProps, PageBuilderPropsV2, SharePageAPIResponse, SharePageProps, StaticPagePropsV2 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "17.0.0-dev.82",
3
+ "version": "17.0.0-dev.83",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -10,10 +10,10 @@
10
10
  "scripts": {
11
11
  "cleanup": "rimraf es dist lib",
12
12
  "prebuild": "yarn cleanup",
13
- "pre:publish": "node ./scripts/convert-publish.js -p",
14
- "post:publish": "node ./scripts/convert-publish.js",
15
- "watch": "rollup -c ./scripts/rollup.config.mjs -w",
16
- "build": "rollup -c ./scripts/rollup.config.mjs --environment NODE_ENV:production",
13
+ "pre:publish": "node ./../../helpers/convert-publish.js -p",
14
+ "post:publish": "node ./../../helpers/convert-publish.js",
15
+ "watch": "rollup -c ./../../helpers/rollup.config.mjs -w",
16
+ "build": "rollup -c ./../../helpers/rollup.config.mjs --environment NODE_ENV:production",
17
17
  "lint": "oxlint --format=stylish ./src",
18
18
  "type-check": "yarn tsc --noEmit",
19
19
  "test": "jest -c ./../../helpers/jest.config.ts",
@@ -27,21 +27,14 @@
27
27
  "next": "14.2.35"
28
28
  },
29
29
  "devDependencies": {
30
- "@gem-sdk/core": "17.0.0-dev.82",
31
- "@gem-sdk/plugin-cookie-bar": "17.0.0-dev.80",
32
- "@gem-sdk/plugin-quick-view": "17.0.0-dev.80",
33
- "@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.80"
30
+ "@gem-sdk/core": "17.0.0-dev.83",
31
+ "@gem-sdk/plugin-cookie-bar": "17.0.0-dev.83",
32
+ "@gem-sdk/plugin-quick-view": "17.0.0-dev.83",
33
+ "@gem-sdk/plugin-sticky-add-to-cart": "17.0.0-dev.83"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "next": "14.2.35"
37
37
  },
38
- "typesVersions": {
39
- "*": {
40
- "server": [
41
- "./dist/types/server.d.ts"
42
- ]
43
- }
44
- },
45
38
  "module": "dist/esm/index.js",
46
39
  "types": "dist/types/index.d.ts",
47
40
  "exports": {
@@ -50,11 +43,6 @@
50
43
  "import": "./dist/esm/index.js",
51
44
  "require": "./dist/cjs/index.js",
52
45
  "types": "./dist/types/index.d.ts"
53
- },
54
- "./server": {
55
- "import": "./dist/esm/server.js",
56
- "require": "./dist/cjs/server.js",
57
- "types": "./dist/types/server.d.ts"
58
46
  }
59
47
  }
60
48
  }