@gem-sdk/core 2.0.0-staging.1040 → 2.0.0-staging.1042

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.
@@ -32,6 +32,7 @@
32
32
  }
33
33
  content {
34
34
  excerptHtml
35
+ html
35
36
  }
36
37
  isSample
37
38
  platformCreatedAt
@@ -1 +1 @@
1
- "use strict";var constant=require("./constant.js"),colors=require("./colors.js"),makeStyle=require("./make-style.js"),getResonsiveValue=require("./get-resonsive-value.js"),device=require("../constants/device.js");const isEmptyBg=e=>e?.videoHtml5===void 0&&e?.video===void 0&&!e?.videoType,getBgVideoByDevice=(e,t="desktop")=>{let g=e?.[t];if(isEmptyBg(g)&&"desktop"!==t){let t=e?.tablet;g=isEmptyBg(t)?e?.desktop:t}return g},getStyleBackgroundByDevice=(e,t)=>e?{...t?.ignoreBackgroundColor?{}:{...getStyleBgColor(e)},...t?.ignoreBackgroundImage?{}:{...getStyleBgImage(e,t)},...t?.ignoreBackgroundImageProperties?{}:{...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e)},...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?colors.isColor(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let g={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return makeStyle.makeStyleResponsive("bgi",g)},getBgImageByDevice=(e,t,g)=>{let o=e?.[t]?.type==="video";if(o)return;if(e?.[t]?.type==="color")return"url()";let i=e?.[t]?.image?.backupFileKey,r=e?.[t]?.image?.storage,l=e?.[t]?.image?.src,a=i,s=l?.match(/\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];return(i&&s&&s!=i&&(a=s),"FILE_CONTENT"===r&&g?.liquid&&a&&(l=`{{ "${a.replace(".jpeg",".jpg")}" | file_url }}`),("THEME"===r||!r)&&g?.liquid&&a&&(l=`{{ "${a}" | asset_url }}`),"string"==typeof l&&l)?`url(${l})`:void 0!==l?"none":void 0},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgp",t)},getBgPositionByDevice=(e,t)=>{let g=e?.[t]?.position;return g&&`${g.x}% ${g.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${colors.getSingleColorVariable(e)};`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},g={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...g.desktop?.wrapper,...g.tablet?.wrapper,...g.mobile?.wrapper},content:{...g.desktop?.content,...g.tablet?.content,...g.mobile?.content}}},makeFixedBgAttachmentByDevice=(e,t)=>{let g=constant.devicesMapping[e]??"";return"fixed"===t?{wrapper:{[`--pos${g}`]:"absolute",[`--top${g}`]:"0",[`--left${g}`]:"0",[`--w${g}`]:"100%",[`--h${g}`]:"100%"},content:{[`--pos${g}`]:"fixed",[`--w${g}`]:"100vw",[`--h${g}`]:"100vh",[`--bga${g}`]:"unset"}}:{wrapper:{[`--pos${g}`]:"absolute"},content:{[`--w${g}`]:"100%",[`--h${g}`]:"100%",[`--pos${g}`]:"absolute",[`--bga${g}`]:t}}},getGradientBgrStyleForButton=e=>{if(!e)return;let t={};for(let g of Object.keys(e)){let o=e[g];if(!o?.startsWith(GRADIENT_BGR_KEY))continue;let i="normal"===g?"--bgi":"--hvr-bgi";t[i]=o}return t},GRADIENT_BGR_KEY="linear-gradient",getCombinedBackgroundImage=e=>{if(!e)return;let{color:t,image:g}=e,o=g?.src&&g?.src?.trim()!=="",i=t?.includes(GRADIENT_BGR_KEY);return o&&i?`url("${g?.src}"), ${t}`:o?`url("${g?.src}")`:i?t:void 0},getGradientImageBgrStyleByDevice=e=>{if(!e)return;let t={};return device.DEVICES.forEach(g=>{let o=e[g];if(!o)return;let i="desktop"!==g?`-${g}`:"";o.color&&Object.assign(t,{[`--bgc${i}`]:o.color});let r=getCombinedBackgroundImage(o);r&&Object.assign(t,{[`--bgi${i}`]:r})}),t},getGradientBgrStyleByDevice=(e,t)=>{if(!e)return;let g={};return device.DEVICES.forEach(o=>{if(e[o]?.color?.includes(GRADIENT_BGR_KEY)){let i=`${getBgImageByDevice(e,o)||"url()"}, ${e[o]?.color}`;Object.assign(g,{[`--bgc${"desktop"!==o?"-"+o:""}`]:e[o]?.color,[`--bgi${"desktop"!==o?"-"+o:""}`]:t?.[o]?i:`${e[o]?.color}`})}}),g},getBgByDevice=e=>{let{backgroundColor:t,backgroundImage:g}=e;if(!t&&!g)return;let o={desktop:getResonsiveValue.getResponsiveValueByScreen(g,"desktop"),tablet:getResonsiveValue.getResponsiveValueByScreen(g,"tablet"),mobile:getResonsiveValue.getResponsiveValueByScreen(g,"mobile")},i={};return device.DEVICES.forEach(e=>{let r=getResonsiveValue.getResponsiveValueByScreen(t,e),l=g?getBgImageByDevice(o,e):void 0;r?.includes(GRADIENT_BGR_KEY)?Object.assign(i,{[`--bgi${"desktop"!==e?"-"+e:""}`]:r}):Object.assign(i,{[`--bgc${"desktop"!==e?"-"+e:""}`]:r,[`--bgi${"desktop"!==e?"-"+e:""}`]:"none"}),l&&"none"!==l&&Object.assign(i,{[`--bgi${"desktop"!==e?"-"+e:""}`]:l})}),{...i,...getStyleBgPosition(g),...getStyleBgSize(g),...getStyleBgRepeat(g),...getStyleBgAttachment(g)}};exports.GRADIENT_BGR_KEY=GRADIENT_BGR_KEY,exports.composeBackgroundCss=composeBackgroundCss,exports.getBgByDevice=getBgByDevice,exports.getBgImageByDevice=getBgImageByDevice,exports.getBgVideoByDevice=getBgVideoByDevice,exports.getColor=getColor,exports.getCombinedBackgroundImage=getCombinedBackgroundImage,exports.getGradientBgrStyleByDevice=getGradientBgrStyleByDevice,exports.getGradientBgrStyleForButton=getGradientBgrStyleForButton,exports.getGradientImageBgrStyleByDevice=getGradientImageBgrStyleByDevice,exports.getStyleBackgroundByDevice=getStyleBackgroundByDevice,exports.getStyleBgColor=getStyleBgColor,exports.makeFixedBgAttachment=makeFixedBgAttachment;
1
+ "use strict";var constant=require("./constant.js"),colors=require("./colors.js"),makeStyle=require("./make-style.js"),getResonsiveValue=require("./get-resonsive-value.js"),device=require("../constants/device.js");const isEmptyBg=e=>e?.videoHtml5===void 0&&e?.video===void 0&&!e?.videoType,getBgVideoByDevice=(e,t="desktop")=>{let g=e?.[t];if(isEmptyBg(g)&&"desktop"!==t){let t=e?.tablet;g=isEmptyBg(t)?e?.desktop:t}return g},getStyleBackgroundByDevice=(e,t)=>e?{...t?.ignoreBackgroundColor?{}:{...getStyleBgColor(e)},...t?.ignoreBackgroundImage?{}:{...getStyleBgImage(e,t)},...t?.ignoreBackgroundImageProperties?{}:{...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e)},...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?colors.isColor(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let g={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return makeStyle.makeStyleResponsive("bgi",g)},getBgImageByDevice=(e,t,g)=>{let o=e?.[t]?.type==="video";if(o)return;if(e?.[t]?.type==="color")return"url()";let i=e?.[t]?.image?.backupFileKey,r=e?.[t]?.image?.storage,l=e?.[t]?.image?.src,a=i,s=l?.match(/\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];return(i&&s&&s!=i&&(a=s),"FILE_CONTENT"===r&&g?.liquid&&a&&(l=`{{ "${a.replace(".jpeg",".jpg")}" | file_url }}`),("THEME"===r||!r)&&g?.liquid&&a&&(l=`{{ "${a}" | asset_url }}`),"string"==typeof l&&l)?`url(${l})`:void 0!==l?"none":void 0},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgp",t)},getBgPositionByDevice=(e,t)=>{let g=e?.[t]?.position;return g&&`${g.x}% ${g.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${colors.getSingleColorVariable(e)};`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},g={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...g.desktop?.wrapper,...g.tablet?.wrapper,...g.mobile?.wrapper},content:{...g.desktop?.content,...g.tablet?.content,...g.mobile?.content}}},makeFixedBgAttachmentByDevice=(e,t)=>{let g=constant.devicesMapping[e]??"";return"fixed"===t?{wrapper:{[`--pos${g}`]:"absolute",[`--top${g}`]:"0",[`--left${g}`]:"0",[`--w${g}`]:"100%",[`--h${g}`]:"100%"},content:{[`--pos${g}`]:"fixed",[`--w${g}`]:"100vw",[`--h${g}`]:"100vh",[`--bga${g}`]:"unset"}}:{wrapper:{[`--pos${g}`]:"absolute"},content:{[`--w${g}`]:"100%",[`--h${g}`]:"100%",[`--pos${g}`]:"absolute",[`--bga${g}`]:t}}},getGradientBgrStyleForButton=e=>{if(!e)return;let t={};for(let g of Object.keys(e)){let o=e[g];if(!o?.startsWith(GRADIENT_BGR_KEY))continue;let i="normal"===g?"--bgi":"--hvr-bgi";t[i]=o}return t},GRADIENT_BGR_KEY="linear-gradient",getCombinedBackgroundImage=e=>{if(!e)return;let{color:t,image:g}=e,o=g?.src&&g?.src?.trim()!=="",i=t?.includes(GRADIENT_BGR_KEY);return o&&i?`url('${g?.src}'), ${t}`:o?`url('${g?.src}')`:i?t:void 0},getGradientImageBgrStyleByDevice=e=>{if(!e)return;let t={};return device.DEVICES.forEach(g=>{let o=e[g];if(!o)return;let i="desktop"!==g?`-${g}`:"";o.color&&Object.assign(t,{[`--bgc${i}`]:o.color});let r=getCombinedBackgroundImage(o);r&&Object.assign(t,{[`--bgi${i}`]:r})}),t},getGradientBgrStyleByDevice=(e,t)=>{if(!e)return;let g={};return device.DEVICES.forEach(o=>{if(e[o]?.color?.includes(GRADIENT_BGR_KEY)){let i=`${getBgImageByDevice(e,o)||"url()"}, ${e[o]?.color}`;Object.assign(g,{[`--bgc${"desktop"!==o?"-"+o:""}`]:e[o]?.color,[`--bgi${"desktop"!==o?"-"+o:""}`]:t?.[o]?i:`${e[o]?.color}`})}}),g},getBgByDevice=e=>{let{backgroundColor:t,backgroundImage:g}=e;if(!t&&!g)return;let o={desktop:getResonsiveValue.getResponsiveValueByScreen(g,"desktop"),tablet:getResonsiveValue.getResponsiveValueByScreen(g,"tablet"),mobile:getResonsiveValue.getResponsiveValueByScreen(g,"mobile")},i={};return device.DEVICES.forEach(e=>{let r=getResonsiveValue.getResponsiveValueByScreen(t,e),l=g?getBgImageByDevice(o,e):void 0;r?.includes(GRADIENT_BGR_KEY)?Object.assign(i,{[`--bgi${"desktop"!==e?"-"+e:""}`]:r}):Object.assign(i,{[`--bgc${"desktop"!==e?"-"+e:""}`]:r,[`--bgi${"desktop"!==e?"-"+e:""}`]:"none"}),l&&"none"!==l&&Object.assign(i,{[`--bgi${"desktop"!==e?"-"+e:""}`]:l})}),{...i,...getStyleBgPosition(g),...getStyleBgSize(g),...getStyleBgRepeat(g),...getStyleBgAttachment(g)}};exports.GRADIENT_BGR_KEY=GRADIENT_BGR_KEY,exports.composeBackgroundCss=composeBackgroundCss,exports.getBgByDevice=getBgByDevice,exports.getBgImageByDevice=getBgImageByDevice,exports.getBgVideoByDevice=getBgVideoByDevice,exports.getColor=getColor,exports.getCombinedBackgroundImage=getCombinedBackgroundImage,exports.getGradientBgrStyleByDevice=getGradientBgrStyleByDevice,exports.getGradientBgrStyleForButton=getGradientBgrStyleForButton,exports.getGradientImageBgrStyleByDevice=getGradientImageBgrStyleByDevice,exports.getStyleBackgroundByDevice=getStyleBackgroundByDevice,exports.getStyleBgColor=getStyleBgColor,exports.makeFixedBgAttachment=makeFixedBgAttachment;
@@ -32,6 +32,7 @@ let BlogsDocument=`
32
32
  }
33
33
  content {
34
34
  excerptHtml
35
+ html
35
36
  }
36
37
  isSample
37
38
  platformCreatedAt
@@ -1 +1 @@
1
- import{devicesMapping as e}from"./constant.js";import{isColor as t,getSingleColorVariable as g}from"./colors.js";import{makeStyleResponsive as o}from"./make-style.js";import{getResponsiveValueByScreen as i}from"./get-resonsive-value.js";import{DEVICES as r}from"../constants/device.js";let isEmptyBg=e=>e?.videoHtml5===void 0&&e?.video===void 0&&!e?.videoType,getBgVideoByDevice=(e,t="desktop")=>{let g=e?.[t];if(isEmptyBg(g)&&"desktop"!==t){let t=e?.tablet;g=isEmptyBg(t)?e?.desktop:t}return g},getStyleBackgroundByDevice=(e,t)=>e?{...t?.ignoreBackgroundColor?{}:{...getStyleBgColor(e)},...t?.ignoreBackgroundImage?{}:{...getStyleBgImage(e,t)},...t?.ignoreBackgroundImageProperties?{}:{...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e)},...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return o("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?t(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let g={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return o("bgi",g)},getBgImageByDevice=(e,t,g)=>{let o=e?.[t]?.type==="video";if(o)return;if(e?.[t]?.type==="color")return"url()";let i=e?.[t]?.image?.backupFileKey,r=e?.[t]?.image?.storage,l=e?.[t]?.image?.src,a=i,B=l?.match(/\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];return(i&&B&&B!=i&&(a=B),"FILE_CONTENT"===r&&g?.liquid&&a&&(l=`{{ "${a.replace(".jpeg",".jpg")}" | file_url }}`),("THEME"===r||!r)&&g?.liquid&&a&&(l=`{{ "${a}" | asset_url }}`),"string"==typeof l&&l)?`url(${l})`:void 0!==l?"none":void 0},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return o("bgp",t)},getBgPositionByDevice=(e,t)=>{let g=e?.[t]?.position;return g&&`${g.x}% ${g.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return o("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return o("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return o("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${g(e)};`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},g={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...g.desktop?.wrapper,...g.tablet?.wrapper,...g.mobile?.wrapper},content:{...g.desktop?.content,...g.tablet?.content,...g.mobile?.content}}},makeFixedBgAttachmentByDevice=(t,g)=>{let o=e[t]??"";return"fixed"===g?{wrapper:{[`--pos${o}`]:"absolute",[`--top${o}`]:"0",[`--left${o}`]:"0",[`--w${o}`]:"100%",[`--h${o}`]:"100%"},content:{[`--pos${o}`]:"fixed",[`--w${o}`]:"100vw",[`--h${o}`]:"100vh",[`--bga${o}`]:"unset"}}:{wrapper:{[`--pos${o}`]:"absolute"},content:{[`--w${o}`]:"100%",[`--h${o}`]:"100%",[`--pos${o}`]:"absolute",[`--bga${o}`]:g}}},getGradientBgrStyleForButton=e=>{if(!e)return;let t={};for(let g of Object.keys(e)){let o=e[g];if(!o?.startsWith(GRADIENT_BGR_KEY))continue;let i="normal"===g?"--bgi":"--hvr-bgi";t[i]=o}return t},GRADIENT_BGR_KEY="linear-gradient",getCombinedBackgroundImage=e=>{if(!e)return;let{color:t,image:g}=e,o=g?.src&&g?.src?.trim()!=="",i=t?.includes(GRADIENT_BGR_KEY);return o&&i?`url("${g?.src}"), ${t}`:o?`url("${g?.src}")`:i?t:void 0},getGradientImageBgrStyleByDevice=e=>{if(!e)return;let t={};return r.forEach(g=>{let o=e[g];if(!o)return;let i="desktop"!==g?`-${g}`:"";o.color&&Object.assign(t,{[`--bgc${i}`]:o.color});let r=getCombinedBackgroundImage(o);r&&Object.assign(t,{[`--bgi${i}`]:r})}),t},getGradientBgrStyleByDevice=(e,t)=>{if(!e)return;let g={};return r.forEach(o=>{if(e[o]?.color?.includes(GRADIENT_BGR_KEY)){let i=`${getBgImageByDevice(e,o)||"url()"}, ${e[o]?.color}`;Object.assign(g,{[`--bgc${"desktop"!==o?"-"+o:""}`]:e[o]?.color,[`--bgi${"desktop"!==o?"-"+o:""}`]:t?.[o]?i:`${e[o]?.color}`})}}),g},getBgByDevice=e=>{let{backgroundColor:t,backgroundImage:g}=e;if(!t&&!g)return;let o={desktop:i(g,"desktop"),tablet:i(g,"tablet"),mobile:i(g,"mobile")},l={};return r.forEach(e=>{let r=i(t,e),a=g?getBgImageByDevice(o,e):void 0;r?.includes(GRADIENT_BGR_KEY)?Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:r}):Object.assign(l,{[`--bgc${"desktop"!==e?"-"+e:""}`]:r,[`--bgi${"desktop"!==e?"-"+e:""}`]:"none"}),a&&"none"!==a&&Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:a})}),{...l,...getStyleBgPosition(g),...getStyleBgSize(g),...getStyleBgRepeat(g),...getStyleBgAttachment(g)}};export{GRADIENT_BGR_KEY,composeBackgroundCss,getBgByDevice,getBgImageByDevice,getBgVideoByDevice,getColor,getCombinedBackgroundImage,getGradientBgrStyleByDevice,getGradientBgrStyleForButton,getGradientImageBgrStyleByDevice,getStyleBackgroundByDevice,getStyleBgColor,makeFixedBgAttachment};
1
+ import{devicesMapping as e}from"./constant.js";import{isColor as t,getSingleColorVariable as g}from"./colors.js";import{makeStyleResponsive as o}from"./make-style.js";import{getResponsiveValueByScreen as i}from"./get-resonsive-value.js";import{DEVICES as r}from"../constants/device.js";let isEmptyBg=e=>e?.videoHtml5===void 0&&e?.video===void 0&&!e?.videoType,getBgVideoByDevice=(e,t="desktop")=>{let g=e?.[t];if(isEmptyBg(g)&&"desktop"!==t){let t=e?.tablet;g=isEmptyBg(t)?e?.desktop:t}return g},getStyleBackgroundByDevice=(e,t)=>e?{...t?.ignoreBackgroundColor?{}:{...getStyleBgColor(e)},...t?.ignoreBackgroundImage?{}:{...getStyleBgImage(e,t)},...t?.ignoreBackgroundImageProperties?{}:{...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e)},...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return o("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?t(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let g={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return o("bgi",g)},getBgImageByDevice=(e,t,g)=>{let o=e?.[t]?.type==="video";if(o)return;if(e?.[t]?.type==="color")return"url()";let i=e?.[t]?.image?.backupFileKey,r=e?.[t]?.image?.storage,l=e?.[t]?.image?.src,a=i,B=l?.match(/\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];return(i&&B&&B!=i&&(a=B),"FILE_CONTENT"===r&&g?.liquid&&a&&(l=`{{ "${a.replace(".jpeg",".jpg")}" | file_url }}`),("THEME"===r||!r)&&g?.liquid&&a&&(l=`{{ "${a}" | asset_url }}`),"string"==typeof l&&l)?`url(${l})`:void 0!==l?"none":void 0},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return o("bgp",t)},getBgPositionByDevice=(e,t)=>{let g=e?.[t]?.position;return g&&`${g.x}% ${g.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return o("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return o("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return o("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${g(e)};`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},g={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...g.desktop?.wrapper,...g.tablet?.wrapper,...g.mobile?.wrapper},content:{...g.desktop?.content,...g.tablet?.content,...g.mobile?.content}}},makeFixedBgAttachmentByDevice=(t,g)=>{let o=e[t]??"";return"fixed"===g?{wrapper:{[`--pos${o}`]:"absolute",[`--top${o}`]:"0",[`--left${o}`]:"0",[`--w${o}`]:"100%",[`--h${o}`]:"100%"},content:{[`--pos${o}`]:"fixed",[`--w${o}`]:"100vw",[`--h${o}`]:"100vh",[`--bga${o}`]:"unset"}}:{wrapper:{[`--pos${o}`]:"absolute"},content:{[`--w${o}`]:"100%",[`--h${o}`]:"100%",[`--pos${o}`]:"absolute",[`--bga${o}`]:g}}},getGradientBgrStyleForButton=e=>{if(!e)return;let t={};for(let g of Object.keys(e)){let o=e[g];if(!o?.startsWith(GRADIENT_BGR_KEY))continue;let i="normal"===g?"--bgi":"--hvr-bgi";t[i]=o}return t},GRADIENT_BGR_KEY="linear-gradient",getCombinedBackgroundImage=e=>{if(!e)return;let{color:t,image:g}=e,o=g?.src&&g?.src?.trim()!=="",i=t?.includes(GRADIENT_BGR_KEY);return o&&i?`url('${g?.src}'), ${t}`:o?`url('${g?.src}')`:i?t:void 0},getGradientImageBgrStyleByDevice=e=>{if(!e)return;let t={};return r.forEach(g=>{let o=e[g];if(!o)return;let i="desktop"!==g?`-${g}`:"";o.color&&Object.assign(t,{[`--bgc${i}`]:o.color});let r=getCombinedBackgroundImage(o);r&&Object.assign(t,{[`--bgi${i}`]:r})}),t},getGradientBgrStyleByDevice=(e,t)=>{if(!e)return;let g={};return r.forEach(o=>{if(e[o]?.color?.includes(GRADIENT_BGR_KEY)){let i=`${getBgImageByDevice(e,o)||"url()"}, ${e[o]?.color}`;Object.assign(g,{[`--bgc${"desktop"!==o?"-"+o:""}`]:e[o]?.color,[`--bgi${"desktop"!==o?"-"+o:""}`]:t?.[o]?i:`${e[o]?.color}`})}}),g},getBgByDevice=e=>{let{backgroundColor:t,backgroundImage:g}=e;if(!t&&!g)return;let o={desktop:i(g,"desktop"),tablet:i(g,"tablet"),mobile:i(g,"mobile")},l={};return r.forEach(e=>{let r=i(t,e),a=g?getBgImageByDevice(o,e):void 0;r?.includes(GRADIENT_BGR_KEY)?Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:r}):Object.assign(l,{[`--bgc${"desktop"!==e?"-"+e:""}`]:r,[`--bgi${"desktop"!==e?"-"+e:""}`]:"none"}),a&&"none"!==a&&Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:a})}),{...l,...getStyleBgPosition(g),...getStyleBgSize(g),...getStyleBgRepeat(g),...getStyleBgAttachment(g)}};export{GRADIENT_BGR_KEY,composeBackgroundCss,getBgByDevice,getBgImageByDevice,getBgVideoByDevice,getColor,getCombinedBackgroundImage,getGradientBgrStyleByDevice,getGradientBgrStyleForButton,getGradientImageBgrStyleByDevice,getStyleBackgroundByDevice,getStyleBgColor,makeFixedBgAttachment};
@@ -35285,24 +35285,24 @@ type BlogsQueryVariables = Exact$1<{
35285
35285
  articlesOrderBy?: InputMaybe$1<ArticleOrder$1>;
35286
35286
  }>;
35287
35287
  type BlogsQueryResponse = {
35288
- blogs?: Maybe$1<(Pick<BlogConnection$1, 'totalCount'> & {
35289
- edges: Array<(Pick<BlogEdge$1, 'cursor'> & {
35290
- node?: Maybe$1<(Pick<Blog$1, 'baseID' | 'description' | 'descriptionMeta' | 'handle' | 'id' | 'platform' | 'tags' | 'templateSuffix' | 'title' | 'titleMeta'> & {
35291
- articles?: Maybe$1<(Pick<ArticleConnection$1, 'totalCount'> & {
35292
- edges: Array<(Pick<ArticleEdge$1, 'cursor'> & {
35293
- node?: Maybe$1<(Pick<Article$2, 'id' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'isSample' | 'platformCreatedAt' | 'platformUpdatedAt' | 'publishedAt' | 'author'> & {
35288
+ blogs?: Maybe$1<Pick<BlogConnection$1, 'totalCount'> & {
35289
+ edges: Array<Pick<BlogEdge$1, 'cursor'> & {
35290
+ node?: Maybe$1<Pick<Blog$1, 'baseID' | 'description' | 'descriptionMeta' | 'handle' | 'id' | 'platform' | 'tags' | 'templateSuffix' | 'title' | 'titleMeta'> & {
35291
+ articles?: Maybe$1<Pick<ArticleConnection$1, 'totalCount'> & {
35292
+ edges: Array<Pick<ArticleEdge$1, 'cursor'> & {
35293
+ node?: Maybe$1<Pick<Article$2, 'id' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'isSample' | 'platformCreatedAt' | 'platformUpdatedAt' | 'publishedAt' | 'author'> & {
35294
35294
  tags?: Maybe$1<Array<Maybe$1<Pick<Tag$1, 'name'>>>>;
35295
35295
  content?: Maybe$1<Pick<ArticleContent$1, 'excerptHtml'>>;
35296
35296
  media?: Maybe$1<Pick<Media$1, 'width' | 'src' | 'height'>>;
35297
- })>;
35298
- })>;
35299
- })>;
35300
- })>;
35301
- })>;
35297
+ }>;
35298
+ }>;
35299
+ }>;
35300
+ }>;
35301
+ }>;
35302
35302
  pageInfo?: Maybe$1<Pick<PageInfo$1, 'endCursor' | 'hasNextPage' | 'hasPreviousPage' | 'startCursor'>>;
35303
- })>;
35303
+ }>;
35304
35304
  };
35305
- declare const BlogsDocument = "\n query blogs($after: Cursor, $before: Cursor, $first: Int, $last: Int, $orderBy: BlogOrder, $where: BlogWhereInput, $articlesOrderBy: ArticleOrder) {\n blogs(\n after: $after\n before: $before\n first: $first\n last: $last\n orderBy: $orderBy\n where: $where\n ) {\n edges {\n cursor\n node {\n baseID\n description\n descriptionMeta\n handle\n articles(orderBy: $articlesOrderBy) {\n edges {\n cursor\n node {\n id\n title\n handle\n description\n templateSuffix\n titleMeta\n descriptionMeta\n baseID\n tags {\n name\n }\n content {\n excerptHtml\n }\n isSample\n platformCreatedAt\n platformUpdatedAt\n publishedAt\n author\n media {\n width\n src\n height\n }\n }\n }\n totalCount\n }\n id\n platform\n tags\n templateSuffix\n title\n titleMeta\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n totalCount\n }\n}\n ";
35305
+ declare const BlogsDocument = "\n query blogs($after: Cursor, $before: Cursor, $first: Int, $last: Int, $orderBy: BlogOrder, $where: BlogWhereInput, $articlesOrderBy: ArticleOrder) {\n blogs(\n after: $after\n before: $before\n first: $first\n last: $last\n orderBy: $orderBy\n where: $where\n ) {\n edges {\n cursor\n node {\n baseID\n description\n descriptionMeta\n handle\n articles(orderBy: $articlesOrderBy) {\n edges {\n cursor\n node {\n id\n title\n handle\n description\n templateSuffix\n titleMeta\n descriptionMeta\n baseID\n tags {\n name\n }\n content {\n excerptHtml\n html\n }\n isSample\n platformCreatedAt\n platformUpdatedAt\n publishedAt\n author\n media {\n width\n src\n height\n }\n }\n }\n totalCount\n }\n id\n platform\n tags\n templateSuffix\n title\n titleMeta\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n totalCount\n }\n}\n ";
35306
35306
 
35307
35307
  type LibraryTemplateQueryVariables = Exact<{
35308
35308
  libraryTemplateId: Scalars['ID'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "2.0.0-staging.1040",
3
+ "version": "2.0.0-staging.1042",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",