@gem-sdk/components 22.0.0-dev.70 → 22.0.0-dev.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var e=require("@gem-sdk/core"),t=require("../../image/common/helpers.js"),o=require("../../image/types.js"),r=require("../../constant.js"),l=require("./const.js");const i=(t,o,r)=>{let l={};return e.DEVICES.map(i=>{let s=e.getResponsiveValueByScreen(t,i),a=e.getResponsiveValueByScreen(o,i),n=e.getResponsiveValueByScreen(r,i);l={...l,[i]:1>=(s?.cols?.length||1)?a:n}}),l},s=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},a=e=>{let o=s(e);return{desktop:t.createBlurDataURL(o?.desktop?.width??0,o?.desktop?.height??0),tablet:t.createBlurDataURL(o?.tablet?.width??o?.desktop?.width??0,o?.tablet?.height??o?.desktop?.width??0),mobile:t.createBlurDataURL(o?.mobile?.width??o?.tablet?.width??o?.desktop?.width??0,o?.mobile?.height??o?.tablet?.height??o?.desktop?.width??0)}},n=(o,r,l,i)=>{if(!o)return"";let n=s(o),p=e.getResponsiveValueByScreen(o,r),b=l?`url(${a(o)[r]})`:`url(${t.getImageSrc(e.getResponsiveValueByScreen(n,r),r,i)})`,g=p?.color?`, ${p.color}`:"";return p?.color?.includes(e.GRADIENT_BGR_KEY)&&p?.type==="image"?`${b}${g}`:p?.color?.includes(e.GRADIENT_BGR_KEY)&&p?.type!=="image"?`${p.color}`:p?.type==="image"?b:"url()"},p=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},b=(e,t)=>{if(!e)return t;let o=e?.shapeVideo;return"custom"===o?e?.shapeValue||t:void 0!==o?o:e?.shapeValue??t},g=({shapeByDevice:e,fallbackRatio:t,device:o,currentResult:r})=>{let l=b(e,t);return l?{...r,[o]:l}:r},c=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},u=(e,t)=>{if(!e)return;if(!t)return e.shapeValue;let o=e.shapeVideo;return"custom"===o?e.shapeValue:o},d=(t,o)=>{let r=!1,l=e.DEVICES.reduce((l,i)=>{let s=e.getResponsiveValueByScreen(t,i),a=e.getResponsiveValueByScreen(o,i),n=u(s,a?.type==="video");return n&&(l[i]=n,r=!0),l},{});return{aspectRatio:r?l:void 0}},m=(t,o,r)=>e.DEVICES.reduce((l,i)=>{let s=e.getValueByDevice(t,i),a=s?.type==="video"?s?.videoType:void 0,n=e.getValueByDevice(o,i),p=r?.[i];return p&&"youtube"===a&&"cover"!==n&&(l[i]=p),l},{}),y=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,h=(t,o)=>{let r={};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=i?.type==="image"&&o,a=y({enableParallax:s,attachment:t[l]?.attachment});r={...r,[l]:s?"150%":a?"100vh":"100%"}}),e.makeStyleResponsive("h",r)},f=(t,o)=>{let r={};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=i?.type==="image"&&o,a=y({enableParallax:s,attachment:t[l]?.attachment});r={...r,[l]:a?"100vw":"100%"}}),e.makeStyleResponsive("w",r)},I=t=>{let o={};return["desktop","mobile","tablet"].forEach(e=>{o={...o,[e]:t[e]?.attachment==="fixed"?"0px":""}}),e.makeStyleResponsive("top",o)},v=(e,t=0,o=0)=>{let r=t,l=t;if(t>o?r=o:l=o,e>=999){let t=e-r;return t>0?t:0}let i=e-l;return i>0?i:0},k=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let r=t[e]?.cols??[],l=r.length<=1,i=o[e];if(l&&i)return["space-between","top","center","bottom"].includes(i)?i:void 0},S=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,r=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:r}},x=(t,o)=>{if(!t||!o)return 16/9;let r=e.getResponsiveValueByScreen(t,o),l=r?.videoCustomRatio;if(l?.width&&l?.height){let e=Number(l.width),t=Number(l.height);if(e>0&&t>0)return e/t}return 16/9},C=e=>{switch(e){case"top":default:return{top:"0%",transform:`translate(-50%, 0%) scale(${l.VIDEO_IFRAME_SCALE})`};case"bottom":return{top:"100%",transform:`translate(-50%, -100%) scale(${l.VIDEO_IFRAME_SCALE})`};case"center":return{top:"50%",transform:`translate(-50%, -50%) scale(${l.VIDEO_IFRAME_SCALE})`}}};exports.collectAspectRatioByDevice=d,exports.collectYoutubeAspectRatio=m,exports.debounce=function(e,t){let o;return function(...r){clearTimeout(o),o=setTimeout(()=>e.apply(this,r),t)}},exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",exports.getAspectRatio=(e,t)=>{let{aspectRatio:o}=d(e,t);return o},exports.getAttachmentDevice=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let r=e?.[o]?.attachment;t={...t,[o]:"fixed"===r?"fixed":"absolute"}}),t},exports.getBackgroundImageHeroBanner=(t,o=!1,r=!1)=>{if(!t)return;let l={};return e.DEVICES.forEach(e=>{l={...l,[e]:n(t,e,o,r)}}),e.makeStyleResponsive("bgi",l)},exports.getBannerLink=e=>{let t=e?.link;return t?.type===o.LINK_ACTION.GO_TO_SALES_PAGE?{type:o.LINK_ACTION.GO_TO_SALES_PAGE,link:r.HREF_TO_SALES_PAGE,target:"_self"}:t},exports.getBgImage=s,exports.getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),exports.getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",r=e.tablet||o,l=e.mobile||r;return{[`gp-justify-${t[o]}`]:!0,[`tablet:gp-justify-${t[r]}`]:!0,[`mobile:gp-justify-${t[l]}`]:!0}},exports.getClassForContentByFitContent=(t,o)=>{let r={desktop:!1,tablet:!1,mobile:!1};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=!!p(l,o),a=i?.shape,n=i?.height;r={...r,[l]:"original"===a&&"fit-content"!==n&&!s}}),e.cls(r.desktop?"!gp-absolute":"",r.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",r.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},exports.getClassForStretchContent=t=>{let o={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t,r);o={...o,[r]:l}}),e.cls("space-between"===o.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===o.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${t?.tablet}`,"space-between"===o.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${t?.mobile}`)},exports.getClassSpaceBetween=(t,o)=>{let r=S(t),l=S(o),i={desktop:k({device:"desktop",settingLayoutRes:r,contentPosition1ColRes:l}),tablet:k({device:"tablet",settingLayoutRes:r,contentPosition1ColRes:l}),mobile:k({device:"mobile",settingLayoutRes:r,contentPosition1ColRes:l})},s={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(3)]:gp-absolute [&>*:nth-child(3)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(3)]:gp-absolute tablet:[&>*:nth-child(3)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(3)]:gp-absolute mobile:[&>*:nth-child(3)]:gp-hidden"},top:{desktop:"!gp-content-stretch [&>*]:!gp-justify-start",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start"},center:{desktop:"!gp-content-stretch [&>*]:!gp-justify-center",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center"},bottom:{desktop:"!gp-content-stretch [&>*]:!gp-justify-end",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end"}},a={};return e.DEVICES.forEach(e=>{let t=i[e],o=s?.[t]?.[e];a[o]=!0}),a},exports.getClassSpaceBetweenLeftRight=e=>{let t=S(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",r=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",l=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":r,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":l,"mobile:!gp-h-auto":!l}},exports.getClipPath=(e,t)=>{if(!t)return`${l.DEFAULT_CLIP_PATH}`;let[o,r,i,s]=(e??"0 0 0 0").split(" ").map(e=>parseInt(e??"0")||0),{btlr:a,btrr:n,bbrr:p,bblr:b}=t,g=v(parseInt(a??"0")||0,o,s),c=v(parseInt(n??"0")||0,o,r),u=v(parseInt(p??"0")||0,r,i),d=v(parseInt(b??"0")||0,i,s);return[g,c,u,d].every(e=>0===e)?`${l.DEFAULT_CLIP_PATH}`:`inset(0 0 0 round ${g}px ${c}px ${u}px ${d}px)`},exports.getContainerRatio=e=>{if(!e)return 0;let{width:t,height:o}=e.getBoundingClientRect();return t&&o?t/o:0},exports.getContentPosition=i,exports.getDataVideoHeroBannerResponsive=p,exports.getDisplayStyleByFitContent=(t,o)=>{let r={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=!!p(l,o),a=i?.shape,n=i?.height;r={...r,[l]:"original"!==a||"fit-content"===n||s?"none":"block"}}),e.makeStyleResponsive("d",r)},exports.getEnableBgImageByDevice=(t,o)=>{if(!e.getResponsiveValueByScreen(s(o),t))return!1;if(!o?.[t]){if("mobile"===t)return o?.tablet?.type==="image"||o?.desktop?.type==="image"&&!o?.tablet;if("tablet"===t)return o?.desktop?.type==="image"}return o?.[t]?.type==="image"},exports.getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,r="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||r},exports.getPercentageVisible=(e,t)=>{let{top:o,height:r}=e,l=-r;return o<l?0:o>t?100:Math.min(Math.max((o-l)/(t-l)*100,0),100)},exports.getResponsiveSetting=S,exports.getStyleAspectRatioHeroBannerCustom=(t,o)=>{let r=e.getAspectRatioGlobalSize(o);return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(o,l),s=!!p(l,t);s&&(r=g({shapeByDevice:i,fallbackRatio:"auto",device:l,currentResult:r}))}),e.makeStyleResponsive("aspect",r)},exports.getStyleHeroBannerBg=(e,t)=>{let o=h(e,t),r=f(e,t),l=I(e);return{...o,...r,...l}},exports.getVideoAspectRatio=x,exports.getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},exports.getWidth=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let r=e?.[o];r&&(t={...t,[o]:"default"===r?"var(--g-ct-w, 1200px)":r})}),t},exports.getYoutubeAspectRatio=(e,t,o)=>{let r=m(e,t,o);return Object.keys(r).length?r:void 0},exports.horizontalAlign=(e,t,o)=>c(i(e,t,o)),exports.imagePlaceholder=a,exports.isScaleImage=y,exports.mapContentPositionToHorizontal=c,exports.opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},r=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:r}},exports.resetVideoIframeStyle=e=>{e&&(e.style.removeProperty("width"),e.style.removeProperty("height"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("transform"),e.style.removeProperty("position"))},exports.resetVideoWrapperStyle=e=>{e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("width"),e.style.removeProperty("height")},exports.scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),exports.setVideoIframeAlign=(e,t)=>{if(!e)return;let o=C(t);e.style.top=o.top,e.style.transform=o.transform},exports.setVideoWrapperStyle=e=>{Object.assign(e.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"})},exports.showVideoType=t=>e.DEVICES.some(o=>{let r=e.getValueByDevice(t,o);return r?.type!=="color"&&r?.type!=="image"&&!!r&&(r?.videoType==="html5"&&r?.videoHtml5||r?.videoType==="youtube"&&r?.video)}),exports.updateVideoIframeSize=({iframeEl:t,containerRatio:o,videoObjectFit:r,background:i,currentDevice:s,isYoutubeVideoMigrated:a})=>{let n,p;let b=x(i,s),g=e.getResponsiveValueByScreen(i,s);if(!t||!o)return;let c=g?.videoAlign||"top",u=C(c);if("contain"===r){Object.assign(t.style,{position:"absolute",top:"50%",left:"50%",width:"100%",height:"100%",maxWidth:"none",transform:`translate(-50%, -50%) scale(${l.VIDEO_IFRAME_SCALE})`});return}o>=b?(n=100,p=o/b*100):(p=100,n=b/o*100),Object.assign(t.style,{position:"absolute",top:u.top,left:"50%",width:a?"500%":`${n}%`,height:a?"100%":`${p}%`,maxWidth:"none",transform:u.transform})};
1
+ "use strict";var e=require("@gem-sdk/core"),t=require("../../image/common/helpers.js"),o=require("../../image/types.js"),r=require("../../constant.js"),l=require("./const.js");const i=(t,o,r)=>{let l={};return e.DEVICES.map(i=>{let s=e.getResponsiveValueByScreen(t,i),a=e.getResponsiveValueByScreen(o,i),n=e.getResponsiveValueByScreen(r,i);l={...l,[i]:1>=(s?.cols?.length||1)?a:n}}),l},s=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},a=e=>{let o=s(e);return{desktop:t.createBlurDataURL(o?.desktop?.width??0,o?.desktop?.height??0),tablet:t.createBlurDataURL(o?.tablet?.width??o?.desktop?.width??0,o?.tablet?.height??o?.desktop?.width??0),mobile:t.createBlurDataURL(o?.mobile?.width??o?.tablet?.width??o?.desktop?.width??0,o?.mobile?.height??o?.tablet?.height??o?.desktop?.width??0)}},n=(o,r,l,i)=>{if(!o)return"";let n=s(o),p=e.getResponsiveValueByScreen(o,r),b=l?`url(${a(o)[r]})`:`url(${t.getImageSrc(e.getResponsiveValueByScreen(n,r),r,i)})`,g=p?.color?`, ${p.color}`:"";return p?.color?.includes(e.GRADIENT_BGR_KEY)&&p?.type==="image"?`${b}${g}`:p?.color?.includes(e.GRADIENT_BGR_KEY)&&p?.type!=="image"?`${p.color}`:p?.type==="image"?b:"url()"},p=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},b=({shapeByDevice:e})=>{let t=e?.shapeVideo;return"custom"===t?e?.shapeValue:void 0!==t?t:e?.shapeValue},g=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},c=(e,t)=>{if(!e)return;if(!t)return e.shapeValue;let o=e.shapeVideo;return"custom"===o?e.shapeValue:o},u=(t,o)=>{let r=!1,l=e.DEVICES.reduce((l,i)=>{let s=e.getResponsiveValueByScreen(t,i),a=e.getResponsiveValueByScreen(o,i),n=c(s,a?.type==="video");return n&&(l[i]=n,r=!0),l},{});return{aspectRatio:r?l:void 0}},d=(t,o,r)=>e.DEVICES.reduce((l,i)=>{let s=e.getValueByDevice(t,i),a=s?.type==="video"?s?.videoType:void 0,n=e.getValueByDevice(o,i),p=r?.[i];return p&&"youtube"===a&&"cover"!==n&&(l[i]=p),l},{}),m=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,y=(t,o)=>{let r={};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=i?.type==="image"&&o,a=m({enableParallax:s,attachment:t[l]?.attachment});r={...r,[l]:s?"150%":a?"100vh":"100%"}}),e.makeStyleResponsive("h",r)},h=(t,o)=>{let r={};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=i?.type==="image"&&o,a=m({enableParallax:s,attachment:t[l]?.attachment});r={...r,[l]:a?"100vw":"100%"}}),e.makeStyleResponsive("w",r)},f=t=>{let o={};return["desktop","mobile","tablet"].forEach(e=>{o={...o,[e]:t[e]?.attachment==="fixed"?"0px":""}}),e.makeStyleResponsive("top",o)},I=(e,t=0,o=0)=>{let r=t,l=t;if(t>o?r=o:l=o,e>=999){let t=e-r;return t>0?t:0}let i=e-l;return i>0?i:0},v=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let r=t[e]?.cols??[],l=r.length<=1,i=o[e];if(l&&i)return["space-between","top","center","bottom"].includes(i)?i:void 0},S=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,r=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:r}},k=(t,o)=>{if(!t||!o)return 16/9;let r=e.getResponsiveValueByScreen(t,o),l=r?.videoCustomRatio;if(l?.width&&l?.height){let e=Number(l.width),t=Number(l.height);if(e>0&&t>0)return e/t}return 16/9},x=e=>{switch(e){case"top":default:return{top:"0%",transform:`translate(-50%, 0%) scale(${l.VIDEO_IFRAME_SCALE})`};case"bottom":return{top:"100%",transform:`translate(-50%, -100%) scale(${l.VIDEO_IFRAME_SCALE})`};case"center":return{top:"50%",transform:`translate(-50%, -50%) scale(${l.VIDEO_IFRAME_SCALE})`}}};exports.collectAspectRatioByDevice=u,exports.collectYoutubeAspectRatio=d,exports.debounce=function(e,t){let o;return function(...r){clearTimeout(o),o=setTimeout(()=>e.apply(this,r),t)}},exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",exports.getAspectRatio=(e,t)=>{let{aspectRatio:o}=u(e,t);return o},exports.getAttachmentDevice=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let r=e?.[o]?.attachment;t={...t,[o]:"fixed"===r?"fixed":"absolute"}}),t},exports.getBackgroundImageHeroBanner=(t,o=!1,r=!1)=>{if(!t)return;let l={};return e.DEVICES.forEach(e=>{l={...l,[e]:n(t,e,o,r)}}),e.makeStyleResponsive("bgi",l)},exports.getBannerLink=e=>{let t=e?.link;return t?.type===o.LINK_ACTION.GO_TO_SALES_PAGE?{type:o.LINK_ACTION.GO_TO_SALES_PAGE,link:r.HREF_TO_SALES_PAGE,target:"_self"}:t},exports.getBgImage=s,exports.getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),exports.getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",r=e.tablet||o,l=e.mobile||r;return{[`gp-justify-${t[o]}`]:!0,[`tablet:gp-justify-${t[r]}`]:!0,[`mobile:gp-justify-${t[l]}`]:!0}},exports.getClassForContentByFitContent=(t,o)=>{let r={desktop:!1,tablet:!1,mobile:!1};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=!!p(l,o),a=i?.shape,n=i?.height;r={...r,[l]:"original"===a&&"fit-content"!==n&&!s}}),e.cls(r.desktop?"!gp-absolute":"",r.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",r.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},exports.getClassForStretchContent=t=>{let o={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t,r);o={...o,[r]:l}}),e.cls("space-between"===o.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===o.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${t?.tablet}`,"space-between"===o.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${t?.mobile}`)},exports.getClassSpaceBetween=(t,o)=>{let r=S(t),l=S(o),i={desktop:v({device:"desktop",settingLayoutRes:r,contentPosition1ColRes:l}),tablet:v({device:"tablet",settingLayoutRes:r,contentPosition1ColRes:l}),mobile:v({device:"mobile",settingLayoutRes:r,contentPosition1ColRes:l})},s={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(3)]:gp-absolute [&>*:nth-child(3)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(3)]:gp-absolute tablet:[&>*:nth-child(3)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(3)]:gp-absolute mobile:[&>*:nth-child(3)]:gp-hidden"},top:{desktop:"!gp-content-stretch [&>*]:!gp-justify-start",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start"},center:{desktop:"!gp-content-stretch [&>*]:!gp-justify-center",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center"},bottom:{desktop:"!gp-content-stretch [&>*]:!gp-justify-end",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end"}},a={};return e.DEVICES.forEach(e=>{let t=i[e],o=s?.[t]?.[e];a[o]=!0}),a},exports.getClassSpaceBetweenLeftRight=e=>{let t=S(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",r=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",l=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":r,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":l,"mobile:!gp-h-auto":!l}},exports.getClipPath=(e,t)=>{if(!t)return`${l.DEFAULT_CLIP_PATH}`;let[o,r,i,s]=(e??"0 0 0 0").split(" ").map(e=>parseInt(e??"0")||0),{btlr:a,btrr:n,bbrr:p,bblr:b}=t,g=I(parseInt(a??"0")||0,o,s),c=I(parseInt(n??"0")||0,o,r),u=I(parseInt(p??"0")||0,r,i),d=I(parseInt(b??"0")||0,i,s);return[g,c,u,d].every(e=>0===e)?`${l.DEFAULT_CLIP_PATH}`:`inset(0 0 0 round ${g}px ${c}px ${u}px ${d}px)`},exports.getContainerRatio=e=>{if(!e)return 0;let{width:t,height:o}=e.getBoundingClientRect();return t&&o?t/o:0},exports.getContentPosition=i,exports.getDataVideoHeroBannerResponsive=p,exports.getDisplayStyleByFitContent=(t,o)=>{let r={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(l=>{let i=e.getResponsiveValueByScreen(t,l),s=!!p(l,o),a=i?.shape,n=i?.height;r={...r,[l]:"original"!==a||"fit-content"===n||s?"none":"block"}}),e.makeStyleResponsive("d",r)},exports.getEnableBgImageByDevice=(t,o)=>{if(!e.getResponsiveValueByScreen(s(o),t))return!1;if(!o?.[t]){if("mobile"===t)return o?.tablet?.type==="image"||o?.desktop?.type==="image"&&!o?.tablet;if("tablet"===t)return o?.desktop?.type==="image"}return o?.[t]?.type==="image"},exports.getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,r="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||r},exports.getPercentageVisible=(e,t)=>{let{top:o,height:r}=e,l=-r;return o<l?0:o>t?100:Math.min(Math.max((o-l)/(t-l)*100,0),100)},exports.getResponsiveSetting=S,exports.getStyleAspectRatioHeroBannerCustom=(t,o)=>{let r=e.getAspectRatioGlobalSize(o),l={};return["desktop","mobile","tablet"].forEach(i=>{let s=e.getResponsiveValueByScreen(o,i),a=!!p(i,t),n=a?b({shapeByDevice:s}):r[i];l[i]=n||"auto"}),e.makeStyleResponsive("aspect",l)},exports.getStyleHeroBannerBg=(e,t)=>{let o=y(e,t),r=h(e,t),l=f(e);return{...o,...r,...l}},exports.getVideoAspectRatio=k,exports.getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},exports.getWidth=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let r=e?.[o];r&&(t={...t,[o]:"default"===r?"var(--g-ct-w, 1200px)":r})}),t},exports.getYoutubeAspectRatio=(e,t,o)=>{let r=d(e,t,o);return Object.keys(r).length?r:void 0},exports.horizontalAlign=(e,t,o)=>g(i(e,t,o)),exports.imagePlaceholder=a,exports.isScaleImage=m,exports.mapContentPositionToHorizontal=g,exports.opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},r=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:r}},exports.resetVideoIframeStyle=e=>{e&&(e.style.removeProperty("width"),e.style.removeProperty("height"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("transform"),e.style.removeProperty("position"))},exports.resetVideoWrapperStyle=e=>{e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("width"),e.style.removeProperty("height")},exports.scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),exports.setVideoIframeAlign=(e,t)=>{if(!e)return;let o=x(t);e.style.top=o.top,e.style.transform=o.transform},exports.setVideoWrapperStyle=e=>{Object.assign(e.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"})},exports.showVideoType=t=>e.DEVICES.some(o=>{let r=e.getValueByDevice(t,o);return r?.type!=="color"&&r?.type!=="image"&&!!r&&(r?.videoType==="html5"&&r?.videoHtml5||r?.videoType==="youtube"&&r?.video)}),exports.updateVideoIframeSize=({iframeEl:t,containerRatio:o,videoObjectFit:r,background:i,currentDevice:s,isYoutubeVideoMigrated:a})=>{let n,p;let b=k(i,s),g=e.getResponsiveValueByScreen(i,s);if(!t||!o)return;let c=g?.videoAlign||"top",u=x(c);if("contain"===r){Object.assign(t.style,{position:"absolute",top:"50%",left:"50%",width:"100%",height:"100%",maxWidth:"none",transform:`translate(-50%, -50%) scale(${l.VIDEO_IFRAME_SCALE})`});return}o>=b?(n=100,p=o/b*100):(p=100,n=b/o*100),Object.assign(t.style,{position:"absolute",top:u.top,left:"50%",width:a?"500%":`${n}%`,height:a?"100%":`${p}%`,maxWidth:"none",transform:u.transform})};
@@ -1 +1 @@
1
- "use strict";var e=require("./ProductFeatureImage.js"),t=require("./ProductGalleryImage.js");const l=[{id:"setting",controls:[{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e.productSelectDisplaySetting},{id:"featured-image",type:"group",label:"Featured Image",controls:e.productFeatureImageSetting},{id:"gallery-images",type:"group",label:"Gallery Images",controls:t.productGalleryImageSetting},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:100,max:400,step:50,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:e.productFeatureImageStyle},{id:"galleryStyles",type:"group",label:"Gallery",controls:t.productGalleryImageStyle},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];exports.ProductImageSettingsV2=l;
1
+ "use strict";var e=require("./ProductFeatureImage.js"),t=require("./ProductGalleryImage.js");const l=[{id:"setting",controls:[{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e.productSelectDisplaySetting},{id:"featured-image",type:"group",label:"Featured Image",controls:e.productFeatureImageSetting},{id:"gallery-images",type:"group",label:"Gallery Images",controls:t.productGalleryImageSetting},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:20,max:400,step:20,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:e.productFeatureImageStyle},{id:"galleryStyles",type:"group",label:"Gallery",controls:t.productGalleryImageStyle},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];exports.ProductImageSettingsV2=l;
@@ -1 +1 @@
1
- "use strict";var e=require("./ProductFeatureImage.js"),t=require("./ProductGalleryImage.js");const l=[{id:"setting",controls:[{id:"filterByVariant",type:"select",label:"Filter images by variant",default:"all_images",options:[{label:"All images",value:"all_images"},{label:"Selected variant",value:"selected_variant"}]},{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e.productSelectDisplaySetting},{id:"featured-image",type:"group",label:"Featured Image",controls:e.productFeatureImageSetting},{id:"gallery-images",type:"group",label:"Gallery Images",controls:t.productGalleryImageSetting},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:100,max:400,step:50,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:e.productFeatureImageStyle},{id:"galleryStyles",type:"group",label:"Gallery",controls:t.productGalleryImageStyle},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];exports.ProductImageSettingsV2=l;
1
+ "use strict";var e=require("./ProductFeatureImage.js"),t=require("./ProductGalleryImage.js");const l=[{id:"setting",controls:[{id:"filterByVariant",type:"select",label:"Filter images by variant",default:"all_images",options:[{label:"All images",value:"all_images"},{label:"Selected variant",value:"selected_variant"}]},{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e.productSelectDisplaySetting},{id:"featured-image",type:"group",label:"Featured Image",controls:e.productFeatureImageSetting},{id:"gallery-images",type:"group",label:"Gallery Images",controls:t.productGalleryImageSetting},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:20,max:400,step:200,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:e.productFeatureImageStyle},{id:"galleryStyles",type:"group",label:"Gallery",controls:t.productGalleryImageStyle},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];exports.ProductImageSettingsV2=l;
@@ -1 +1 @@
1
- import{DEVICES as e,makeStyleResponsive as t,getValueByDevice as o,getAspectRatioGlobalSize as l,getResponsiveValueByScreen as i,cls as r,GRADIENT_BGR_KEY as a}from"@gem-sdk/core";import{getImageSrc as n,createBlurDataURL as s}from"../../image/common/helpers.js";import{LINK_ACTION as p}from"../../image/types.js";import{HREF_TO_SALES_PAGE as b}from"../../constant.js";import{DEFAULT_CLIP_PATH as g,VIDEO_IFRAME_SCALE as d}from"./const.js";let c=(t,o,l)=>{let r={};return e.map(e=>{let a=i(t,e),n=i(o,e),s=i(l,e);r={...r,[e]:1>=(a?.cols?.length||1)?n:s}}),r},m=(e,t)=>{if(!i(u(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},u=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},h=e=>{let t=u(e);return{desktop:s(t?.desktop?.width??0,t?.desktop?.height??0),tablet:s(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:s(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},y=(e,t,o,l)=>{if(!e)return"";let r=u(e),s=i(e,t),p=o?`url(${h(e)[t]})`:`url(${n(i(r,t),t,l)})`,b=s?.color?`, ${s.color}`:"";return s?.color?.includes(a)&&s?.type==="image"?`${p}${b}`:s?.color?.includes(a)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?p:"url()"},f=(o,l=!1,i=!1)=>{if(!o)return;let r={};return e.forEach(e=>{r={...r,[e]:y(o,e,l,i)}}),t("bgi",r)},I=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},v=(e,t,o)=>P(c(e,t,o)),k=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),w=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},C=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},A=(e,t)=>{if(!e)return t;let o=e?.shapeVideo;return"custom"===o?e?.shapeValue||t:void 0!==o?o:e?.shapeValue??t},j=({shapeByDevice:e,fallbackRatio:t,device:o,currentResult:l})=>{let i=A(e,t);return i?{...l,[o]:i}:l},S=(e,o)=>{let r=l(o);return["desktop","mobile","tablet"].forEach(t=>{let l=i(o,t),a=!!w(t,e);a&&(r=j({shapeByDevice:l,fallbackRatio:"auto",device:t,currentResult:r}))}),t("aspect",r)},P=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},Z=(e,o)=>{let l={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=!!w(t,o),n=r?.shape,s=r?.height;l={...l,[t]:"original"!==n||"fit-content"===s||a?"none":"block"}}),t("d",l)},B=(e,t)=>{if(!e)return;if(!t)return e.shapeValue;let o=e.shapeVideo;return"custom"===o?e.shapeValue:o},x=(t,o)=>{let l=!1,r=e.reduce((e,r)=>{let a=i(t,r),n=i(o,r),s=B(a,n?.type==="video");return s&&(e[r]=s,l=!0),e},{});return{aspectRatio:l?r:void 0}},$=(t,l,i)=>e.reduce((e,r)=>{let a=o(t,r),n=a?.type==="video"?a?.videoType:void 0,s=o(l,r),p=i?.[r];return p&&"youtube"===n&&"cover"!==s&&(e[r]=p),e},{}),T=(e,t)=>{let{aspectRatio:o}=x(e,t);return o},D=(e,t,o)=>{let l=$(e,t,o);return Object.keys(l).length?l:void 0},R=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},V=(e,t)=>{let{top:o,height:l}=e,i=-l;return o<i?0:o>t?100:Math.min(Math.max((o-i)/(t-i)*100,0),100)},E=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,G=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=E({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:a?"150%":n?"100vh":"100%"}}),t("h",l)},z=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=E({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:n?"100vw":"100%"}}),t("w",l)},M=e=>{let o={};return["desktop","mobile","tablet"].forEach(t=>{o={...o,[t]:e[t]?.attachment==="fixed"?"0px":""}}),t("top",o)},W=(e,t)=>{let o=G(e,t),l=z(e,t),i=M(e);return{...o,...l,...i}},L=(e,t=0,o=0)=>{let l=t,i=t;if(t>o?l=o:i=o,e>=999){let t=e-l;return t>0?t:0}let r=e-i;return r>0?r:0},H=(e,t)=>{if(!t)return`${g}`;let[o,l,i,r]=(e??"0 0 0 0").split(" ").map(e=>parseInt(e??"0")||0),{btlr:a,btrr:n,bbrr:s,bblr:p}=t,b=L(parseInt(a??"0")||0,o,r),d=L(parseInt(n??"0")||0,o,l),c=L(parseInt(s??"0")||0,l,i),m=L(parseInt(p??"0")||0,i,r);return[b,d,c,m].every(e=>0===e)?`${g}`:`inset(0 0 0 round ${b}px ${d}px ${c}px ${m}px)`},N=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),O=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let l=t[e]?.cols??[],i=l.length<=1,r=o[e];if(i&&r)return["space-between","top","center","bottom"].includes(r)?r:void 0},J=(t,o)=>{let l=_(t),i=_(o),r={desktop:O({device:"desktop",settingLayoutRes:l,contentPosition1ColRes:i}),tablet:O({device:"tablet",settingLayoutRes:l,contentPosition1ColRes:i}),mobile:O({device:"mobile",settingLayoutRes:l,contentPosition1ColRes:i})},a={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(3)]:gp-absolute [&>*:nth-child(3)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(3)]:gp-absolute tablet:[&>*:nth-child(3)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(3)]:gp-absolute mobile:[&>*:nth-child(3)]:gp-hidden"},top:{desktop:"!gp-content-stretch [&>*]:!gp-justify-start",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start"},center:{desktop:"!gp-content-stretch [&>*]:!gp-justify-center",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center"},bottom:{desktop:"!gp-content-stretch [&>*]:!gp-justify-end",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end"}},n={};return e.forEach(e=>{let t=r[e],o=a?.[t]?.[e];n[o]=!0}),n},K=e=>{let t=_(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},X=e=>{let t={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(o=>{let l=i(e,o);t={...t,[o]:l}}),r("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},F=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1};return["desktop","mobile","tablet"].forEach(l=>{let r=i(e,l),a=!!w(l,t),n=r?.shape,s=r?.height;o={...o,[l]:"original"===n&&"fit-content"!==s&&!a}}),r(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},Y=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,i=e.mobile||l;return{[`gp-justify-${t[o]}`]:!0,[`tablet:gp-justify-${t[l]}`]:!0,[`mobile:gp-justify-${t[i]}`]:!0}},_=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},U=t=>e.some(e=>{let l=o(t,e);return l?.type!=="color"&&l?.type!=="image"&&!!l&&(l?.videoType==="html5"&&l?.videoHtml5||l?.videoType==="youtube"&&l?.video)});function Q(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let q="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",ee=e=>{let t=e?.link;return t?.type===p.GO_TO_SALES_PAGE?{type:p.GO_TO_SALES_PAGE,link:b,target:"_self"}:t},et=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",eo=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},el=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l},ei=(e,t)=>{if(!e||!t)return 16/9;let o=i(e,t),l=o?.videoCustomRatio;if(l?.width&&l?.height){let e=Number(l.width),t=Number(l.height);if(e>0&&t>0)return e/t}return 16/9},er=e=>{e&&(e.style.removeProperty("width"),e.style.removeProperty("height"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("transform"),e.style.removeProperty("position"))},ea=e=>{Object.assign(e.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"})},en=e=>{e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("width"),e.style.removeProperty("height")},es=e=>{if(!e)return 0;let{width:t,height:o}=e.getBoundingClientRect();return t&&o?t/o:0},ep=e=>{switch(e){case"top":default:return{top:"0%",transform:`translate(-50%, 0%) scale(${d})`};case"bottom":return{top:"100%",transform:`translate(-50%, -100%) scale(${d})`};case"center":return{top:"50%",transform:`translate(-50%, -50%) scale(${d})`}}},eb=(e,t)=>{if(!e)return;let o=ep(t);e.style.top=o.top,e.style.transform=o.transform},eg=({iframeEl:e,containerRatio:t,videoObjectFit:o,background:l,currentDevice:r,isYoutubeVideoMigrated:a})=>{let n,s;let p=ei(l,r),b=i(l,r);if(!e||!t)return;let g=b?.videoAlign||"top",c=ep(g);if("contain"===o){Object.assign(e.style,{position:"absolute",top:"50%",left:"50%",width:"100%",height:"100%",maxWidth:"none",transform:`translate(-50%, -50%) scale(${d})`});return}t>=p?(n=100,s=t/p*100):(s=100,n=p/t*100),Object.assign(e.style,{position:"absolute",top:c.top,left:"50%",width:a?"500%":`${n}%`,height:a?"100%":`${s}%`,maxWidth:"none",transform:c.transform})};export{x as collectAspectRatioByDevice,$ as collectYoutubeAspectRatio,Q as debounce,q as fallbackImg,et as formatHoverScale,T as getAspectRatio,I as getAttachmentDevice,f as getBackgroundImageHeroBanner,ee as getBannerLink,u as getBgImage,N as getClassAlignBanner,Y as getClassContentPosition,F as getClassForContentByFitContent,X as getClassForStretchContent,J as getClassSpaceBetween,K as getClassSpaceBetweenLeftRight,H as getClipPath,es as getContainerRatio,c as getContentPosition,w as getDataVideoHeroBannerResponsive,Z as getDisplayStyleByFitContent,m as getEnableBgImageByDevice,el as getOpacityHover,V as getPercentageVisible,_ as getResponsiveSetting,S as getStyleAspectRatioHeroBannerCustom,W as getStyleHeroBannerBg,ei as getVideoAspectRatio,C as getVisibilityStyle,R as getWidth,D as getYoutubeAspectRatio,v as horizontalAlign,h as imagePlaceholder,E as isScaleImage,P as mapContentPositionToHorizontal,eo as opacityEnabledData,er as resetVideoIframeStyle,en as resetVideoWrapperStyle,k as scrollToContentBanner,eb as setVideoIframeAlign,ea as setVideoWrapperStyle,U as showVideoType,eg as updateVideoIframeSize};
1
+ import{DEVICES as e,makeStyleResponsive as t,getValueByDevice as o,getAspectRatioGlobalSize as l,getResponsiveValueByScreen as i,cls as r,GRADIENT_BGR_KEY as a}from"@gem-sdk/core";import{getImageSrc as n,createBlurDataURL as s}from"../../image/common/helpers.js";import{LINK_ACTION as p}from"../../image/types.js";import{HREF_TO_SALES_PAGE as b}from"../../constant.js";import{DEFAULT_CLIP_PATH as g,VIDEO_IFRAME_SCALE as d}from"./const.js";let m=(t,o,l)=>{let r={};return e.map(e=>{let a=i(t,e),n=i(o,e),s=i(l,e);r={...r,[e]:1>=(a?.cols?.length||1)?n:s}}),r},c=(e,t)=>{if(!i(u(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},u=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},h=e=>{let t=u(e);return{desktop:s(t?.desktop?.width??0,t?.desktop?.height??0),tablet:s(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:s(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},y=(e,t,o,l)=>{if(!e)return"";let r=u(e),s=i(e,t),p=o?`url(${h(e)[t]})`:`url(${n(i(r,t),t,l)})`,b=s?.color?`, ${s.color}`:"";return s?.color?.includes(a)&&s?.type==="image"?`${p}${b}`:s?.color?.includes(a)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?p:"url()"},f=(o,l=!1,i=!1)=>{if(!o)return;let r={};return e.forEach(e=>{r={...r,[e]:y(o,e,l,i)}}),t("bgi",r)},I=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},v=(e,t,o)=>S(m(e,t,o)),k=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),w=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},C=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},A=({shapeByDevice:e})=>{let t=e?.shapeVideo;return"custom"===t?e?.shapeValue:void 0!==t?t:e?.shapeValue},j=(e,o)=>{let r=l(o),a={};return["desktop","mobile","tablet"].forEach(t=>{let l=i(o,t),n=!!w(t,e),s=n?A({shapeByDevice:l}):r[t];a[t]=s||"auto"}),t("aspect",a)},S=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},P=(e,o)=>{let l={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=!!w(t,o),n=r?.shape,s=r?.height;l={...l,[t]:"original"!==n||"fit-content"===s||a?"none":"block"}}),t("d",l)},Z=(e,t)=>{if(!e)return;if(!t)return e.shapeValue;let o=e.shapeVideo;return"custom"===o?e.shapeValue:o},B=(t,o)=>{let l=!1,r=e.reduce((e,r)=>{let a=i(t,r),n=i(o,r),s=Z(a,n?.type==="video");return s&&(e[r]=s,l=!0),e},{});return{aspectRatio:l?r:void 0}},x=(t,l,i)=>e.reduce((e,r)=>{let a=o(t,r),n=a?.type==="video"?a?.videoType:void 0,s=o(l,r),p=i?.[r];return p&&"youtube"===n&&"cover"!==s&&(e[r]=p),e},{}),$=(e,t)=>{let{aspectRatio:o}=B(e,t);return o},T=(e,t,o)=>{let l=x(e,t,o);return Object.keys(l).length?l:void 0},D=e=>{let t={};return["desktop","mobile","tablet"].forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},R=(e,t)=>{let{top:o,height:l}=e,i=-l;return o<i?0:o>t?100:Math.min(Math.max((o-i)/(t-i)*100,0),100)},V=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,E=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=V({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:a?"150%":n?"100vh":"100%"}}),t("h",l)},G=(e,o)=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=i(e,t),a=r?.type==="image"&&o,n=V({enableParallax:a,attachment:e[t]?.attachment});l={...l,[t]:n?"100vw":"100%"}}),t("w",l)},z=e=>{let o={};return["desktop","mobile","tablet"].forEach(t=>{o={...o,[t]:e[t]?.attachment==="fixed"?"0px":""}}),t("top",o)},M=(e,t)=>{let o=E(e,t),l=G(e,t),i=z(e);return{...o,...l,...i}},W=(e,t=0,o=0)=>{let l=t,i=t;if(t>o?l=o:i=o,e>=999){let t=e-l;return t>0?t:0}let r=e-i;return r>0?r:0},L=(e,t)=>{if(!t)return`${g}`;let[o,l,i,r]=(e??"0 0 0 0").split(" ").map(e=>parseInt(e??"0")||0),{btlr:a,btrr:n,bbrr:s,bblr:p}=t,b=W(parseInt(a??"0")||0,o,r),d=W(parseInt(n??"0")||0,o,l),m=W(parseInt(s??"0")||0,l,i),c=W(parseInt(p??"0")||0,i,r);return[b,d,m,c].every(e=>0===e)?`${g}`:`inset(0 0 0 round ${b}px ${d}px ${m}px ${c}px)`},H=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),N=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let l=t[e]?.cols??[],i=l.length<=1,r=o[e];if(i&&r)return["space-between","top","center","bottom"].includes(r)?r:void 0},O=(t,o)=>{let l=Y(t),i=Y(o),r={desktop:N({device:"desktop",settingLayoutRes:l,contentPosition1ColRes:i}),tablet:N({device:"tablet",settingLayoutRes:l,contentPosition1ColRes:i}),mobile:N({device:"mobile",settingLayoutRes:l,contentPosition1ColRes:i})},a={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(3)]:gp-absolute [&>*:nth-child(3)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(3)]:gp-absolute tablet:[&>*:nth-child(3)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(3)]:gp-absolute mobile:[&>*:nth-child(3)]:gp-hidden"},top:{desktop:"!gp-content-stretch [&>*]:!gp-justify-start",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start"},center:{desktop:"!gp-content-stretch [&>*]:!gp-justify-center",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center"},bottom:{desktop:"!gp-content-stretch [&>*]:!gp-justify-end",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end"}},n={};return e.forEach(e=>{let t=r[e],o=a?.[t]?.[e];n[o]=!0}),n},J=e=>{let t=Y(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},K=e=>{let t={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(o=>{let l=i(e,o);t={...t,[o]:l}}),r("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},X=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1};return["desktop","mobile","tablet"].forEach(l=>{let r=i(e,l),a=!!w(l,t),n=r?.shape,s=r?.height;o={...o,[l]:"original"===n&&"fit-content"!==s&&!a}}),r(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},F=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,i=e.mobile||l;return{[`gp-justify-${t[o]}`]:!0,[`tablet:gp-justify-${t[l]}`]:!0,[`mobile:gp-justify-${t[i]}`]:!0}},Y=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},_=t=>e.some(e=>{let l=o(t,e);return l?.type!=="color"&&l?.type!=="image"&&!!l&&(l?.videoType==="html5"&&l?.videoHtml5||l?.videoType==="youtube"&&l?.video)});function U(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let Q="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",q=e=>{let t=e?.link;return t?.type===p.GO_TO_SALES_PAGE?{type:p.GO_TO_SALES_PAGE,link:b,target:"_self"}:t},ee=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",et=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},eo=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l},el=(e,t)=>{if(!e||!t)return 16/9;let o=i(e,t),l=o?.videoCustomRatio;if(l?.width&&l?.height){let e=Number(l.width),t=Number(l.height);if(e>0&&t>0)return e/t}return 16/9},ei=e=>{e&&(e.style.removeProperty("width"),e.style.removeProperty("height"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("transform"),e.style.removeProperty("position"))},er=e=>{Object.assign(e.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"})},ea=e=>{e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("width"),e.style.removeProperty("height")},en=e=>{if(!e)return 0;let{width:t,height:o}=e.getBoundingClientRect();return t&&o?t/o:0},es=e=>{switch(e){case"top":default:return{top:"0%",transform:`translate(-50%, 0%) scale(${d})`};case"bottom":return{top:"100%",transform:`translate(-50%, -100%) scale(${d})`};case"center":return{top:"50%",transform:`translate(-50%, -50%) scale(${d})`}}},ep=(e,t)=>{if(!e)return;let o=es(t);e.style.top=o.top,e.style.transform=o.transform},eb=({iframeEl:e,containerRatio:t,videoObjectFit:o,background:l,currentDevice:r,isYoutubeVideoMigrated:a})=>{let n,s;let p=el(l,r),b=i(l,r);if(!e||!t)return;let g=b?.videoAlign||"top",m=es(g);if("contain"===o){Object.assign(e.style,{position:"absolute",top:"50%",left:"50%",width:"100%",height:"100%",maxWidth:"none",transform:`translate(-50%, -50%) scale(${d})`});return}t>=p?(n=100,s=t/p*100):(s=100,n=p/t*100),Object.assign(e.style,{position:"absolute",top:m.top,left:"50%",width:a?"500%":`${n}%`,height:a?"100%":`${s}%`,maxWidth:"none",transform:m.transform})};export{B as collectAspectRatioByDevice,x as collectYoutubeAspectRatio,U as debounce,Q as fallbackImg,ee as formatHoverScale,$ as getAspectRatio,I as getAttachmentDevice,f as getBackgroundImageHeroBanner,q as getBannerLink,u as getBgImage,H as getClassAlignBanner,F as getClassContentPosition,X as getClassForContentByFitContent,K as getClassForStretchContent,O as getClassSpaceBetween,J as getClassSpaceBetweenLeftRight,L as getClipPath,en as getContainerRatio,m as getContentPosition,w as getDataVideoHeroBannerResponsive,P as getDisplayStyleByFitContent,c as getEnableBgImageByDevice,eo as getOpacityHover,R as getPercentageVisible,Y as getResponsiveSetting,j as getStyleAspectRatioHeroBannerCustom,M as getStyleHeroBannerBg,el as getVideoAspectRatio,C as getVisibilityStyle,D as getWidth,T as getYoutubeAspectRatio,v as horizontalAlign,h as imagePlaceholder,V as isScaleImage,S as mapContentPositionToHorizontal,et as opacityEnabledData,ei as resetVideoIframeStyle,ea as resetVideoWrapperStyle,k as scrollToContentBanner,ep as setVideoIframeAlign,er as setVideoWrapperStyle,_ as showVideoType,eb as updateVideoIframeSize};
@@ -1 +1 @@
1
- import{productSelectDisplaySetting as e,productFeatureImageSetting as t,productFeatureImageStyle as l}from"./ProductFeatureImage.js";import{productGalleryImageSetting as a,productGalleryImageStyle as i}from"./ProductGalleryImage.js";let o=[{id:"setting",controls:[{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e},{id:"featured-image",type:"group",label:"Featured Image",controls:t},{id:"gallery-images",type:"group",label:"Gallery Images",controls:a},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:100,max:400,step:50,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:l},{id:"galleryStyles",type:"group",label:"Gallery",controls:i},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];export{o as ProductImageSettingsV2};
1
+ import{productSelectDisplaySetting as e,productFeatureImageSetting as t,productFeatureImageStyle as l}from"./ProductFeatureImage.js";import{productGalleryImageSetting as a,productGalleryImageStyle as i}from"./ProductGalleryImage.js";let o=[{id:"setting",controls:[{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e},{id:"featured-image",type:"group",label:"Featured Image",controls:t},{id:"gallery-images",type:"group",label:"Gallery Images",controls:a},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:20,max:400,step:20,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:l},{id:"galleryStyles",type:"group",label:"Gallery",controls:i},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];export{o as ProductImageSettingsV2};
@@ -1 +1 @@
1
- import{productSelectDisplaySetting as e,productFeatureImageSetting as t,productFeatureImageStyle as l}from"./ProductFeatureImage.js";import{productGalleryImageSetting as a,productGalleryImageStyle as i}from"./ProductGalleryImage.js";let o=[{id:"setting",controls:[{id:"filterByVariant",type:"select",label:"Filter images by variant",default:"all_images",options:[{label:"All images",value:"all_images"},{label:"Selected variant",value:"selected_variant"}]},{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e},{id:"featured-image",type:"group",label:"Featured Image",controls:t},{id:"gallery-images",type:"group",label:"Gallery Images",controls:a},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:100,max:400,step:50,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:l},{id:"galleryStyles",type:"group",label:"Gallery",controls:i},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];export{o as ProductImageSettingsV2};
1
+ import{productSelectDisplaySetting as e,productFeatureImageSetting as t,productFeatureImageStyle as l}from"./ProductFeatureImage.js";import{productGalleryImageSetting as a,productGalleryImageStyle as i}from"./ProductGalleryImage.js";let o=[{id:"setting",controls:[{id:"filterByVariant",type:"select",label:"Filter images by variant",default:"all_images",options:[{label:"All images",value:"all_images"},{label:"Selected variant",value:"selected_variant"}]},{id:"displayByVariant",label:"Option Label",type:"toggle",default:!1},{id:"variantSelect",type:"variant:listing"},{id:"select-display",type:"group",label:"Select images to display",controls:e},{id:"featured-image",type:"group",label:"Featured Image",controls:t},{id:"gallery-images",type:"group",label:"Gallery Images",controls:a},{id:"qualityType",type:"select",label:"Quality",devices:{desktop:{default:"high"}},options:[{title:"Finest",value:"finest"},{title:"High",value:"high"},{title:"Medium",value:"medium"},{title:"Custom",value:"custom",tooltip:"You can choose it for advanced page loading optimization."}]},{id:"preload",type:"toggle",label:"Preload",default:!1},{id:"qualityPercent",type:"input:slider",label:"",units:["%"],min:20,max:400,step:200,useOnlyUnitInit:!0,devices:{desktop:{default:100}}}]},{id:"style",controls:[{id:"position",label:"Layout",type:"layout-selector",iconViewBox:"0 0 50 50",enableItemBackground:!0,itemPerRow:3,itemSpacing:"large",enableItemOpacity:!0,options:[{label:"Featured top",value:"bottom-center",type:"p-image-layout",iconName:"gp-product-image-layout-bottom"},{label:"Featured right",value:"left",type:"p-image-layout",iconName:"gp-product-image-layout-left"},{label:"Featured left",value:"right",type:"p-image-layout",iconName:"gp-product-image-layout-right"},{label:"Image list inside bottom",value:"inside-bottom",type:"p-image-layout",iconName:"gp-product-image-layout-bottom-inside"},{label:"Image list inside left",value:"inside-left",type:"p-image-layout",iconName:"gp-product-image-layout-left-inside"},{label:"Image list inside right",value:"inside-right",type:"p-image-layout",iconName:"gp-product-image-layout-right-inside"},{label:"Featured only",value:"only-feature",type:"p-image-layout",iconName:"gp-product-image-layout-featured-only"},{label:"Image list 1 col",value:"one-col",type:"p-image-layout",iconName:"gp-product-image-layout-one-col",noPadding:"y"},{label:"Image list 2 col",value:"two-col",type:"p-image-layout",iconName:"gp-product-image-layout-two-col"}],devices:{desktop:{default:"bottom-center"},mobile:{default:"bottom-center"}}},{id:"spacing",label:"Spacing Item",type:"input:slider",units:["px"],ignoreMax:!0,max:40,devices:{desktop:{default:"8px"}}},{id:"ratioLayout",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[2,10],devices:{desktop:{default:[2,10]}}},{id:"ratioLayoutRight",label:"Ratio",type:"column-with-slider",fallbackArrayValue:[10,2],devices:{desktop:{default:[10,2]}}},{id:"dimensions",type:"group",label:"Featured Image",controls:l},{id:"galleryStyles",type:"group",label:"Gallery",controls:i},{id:"align",label:"Alignment",type:"segment",options:[{label:"Start",value:"flex-start",type:"align-flex",tooltip:"Align left"},{label:"Center",value:"center",type:"align-flex",tooltip:"Align center"},{label:"End",value:"flex-end",type:"align-flex",tooltip:"Align right"}],devices:{desktop:{default:"flex-start"}}}]}];export{o as ProductImageSettingsV2};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "22.0.0-dev.70",
3
+ "version": "22.0.0-dev.73",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js && node ./scripts/translate/en-keys-usage.js"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "22.0.0-dev.64",
29
+ "@gem-sdk/core": "22.0.0-dev.71",
30
30
  "@gem-sdk/styles": "22.0.0-dev.69",
31
31
  "@gem-sdk/system": "22.0.0-dev.63",
32
32
  "@types/react-transition-group": "^4.4.12",