@gem-sdk/components 13.1.1 → 13.1.3

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";const SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"layout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:"layout.cols.length == 1 && layout.type === 'center-top'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length == 1 && layout.type === 'center'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length == 1 && layout.type === 'center-bottom'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"bottom"}},{condition:"layout.cols.length == 1 && layout.type === 'center-distributed'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-distributed' || layout.type === 'right-distributed')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-top' || layout.type === 'right-top')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length > 1 && ( layout.type === 'right' || layout.type === 'left')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-bottom' || layout.type === 'right-bottom')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"bottom"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Background"},controls:[{setting:{id:"background"},options:{updateFields:[{field:"preload",settingId:"preload"}]},controlChangeTrigger:{settings:[{action:{controlId:"preload",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{condition:"!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1},valueIfNull:{width:"100%",height:"fit-content"},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!0},valueIfNull:{enableVideoShape:!0},groupType:"style",controlType:"size-setting"}},{condition:'!!background.image.src && background.type == "image" && sizeSetting.height == "fit-content"',source:["background","sizeSetting"],action:{controlId:"sizeSetting",newValue:{shape:"original",height:""},valueIfNull:{shape:"original"},groupType:"style",controlType:"size-setting"}},{condition:'background.type != "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!1},valueIfNull:{enableVideoShape:!1},groupType:"style",controlType:"size-setting"}}],options:{noRecordHistory:!0}},layout:"vertical"}],moreSettings:{type:"collapse",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.normal",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayColor",state:"normal"},label:{en:"Color"}},{setting:{id:"overlayOpacity",state:"normal"},label:{en:"Opacity"}}]}]}},{label:{en:"Size"},controls:[{setting:{id:"sizeSetting"},layout:"vertical"},{label:{en:"Scale"},setting:{id:"videoObjectFit"},conditionDisplay:'background.type == "video"'}]},{label:{en:"Content"},controls:[{id:"contentWidth",label:{en:"Width"},controlConfig:{id:"contentWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0},{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},setting:{id:"contentPadding"}},{label:{en:"Align"},setting:{id:"verticalAlign"},conditionEnable:'layout.cols.length > 1 && layout.type != "right-distributed" && layout.type != "left-distributed"'}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBg"}},{label:{en:"Corner"},setting:{id:"cornerBg"}},{label:{en:"Shadow"},setting:{id:"shadowBg"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadowBg.enable === true",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!0}},{condition:"shadowBg.enable === false",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!1}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{type:"combo",fixedValue:"Effect",iconName:"polaris-check-clicked",label:{en:"Hover effect"},setting:{id:"hoverEffect"},controlChangeTrigger:{settings:[{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectScale"],action:{controlId:"hoverEffectScale",groupType:"style",controlType:"style",newValue:"120%"}},{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectDuration"],action:{controlId:"hoverEffectDuration",groupType:"style",controlType:"style",newValue:"0.5s"}}],options:{noRecordHistory:!0}},defaultValueWhenClear:!1,state:"hover",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.hover",defaultValueWhenClear:"transparent",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayOpacity",state:"hover"},label:{en:"Opacity"}},{setting:{id:"overlayColor",state:"hover"},controlChangeTrigger:{settings:[{condition:"overlayColor.hover == 'transparent'",source:["overlayColor","overlayOpacity"],action:{controlId:"overlayOpacity",groupType:"style",controlType:"style",state:"hover",newValue:"20%"}}],options:{noRecordHistory:!0}},compoDefaultValue:"#121212",label:{en:"Color"}}]},{label:{en:"Scale"},type:"combo",iconName:"polaris-maximize",getValueFromSettingID:"hoverEffectScale",defaultValueWhenClear:"100%",compoDefaultValue:"120%",controls:[{label:{en:"Scale"},setting:{id:"hoverEffectScale"},defaultValueWhenClear:"100%"},{type:"control",label:{en:"Time"},setting:{id:"hoverEffectDuration"}}]}]},{type:"combo",fixedValue:"Enabled",iconName:"polaris-parallax-effect",label:{en:"Parallax scroll"},setting:{id:"enableParallax"},conditionDisplay:'background.type == "image"',defaultValueWhenClear:!1,controls:[{setting:{id:"contentBanner"},layout:"vertical"},{label:{en:"Speed"},setting:{id:"speedParallax"}}]}]},{controls:[{label:{en:"Link"},setting:{id:"enableLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableLink == true'},{conditionDisplay:"enableLink == true",setting:{id:"link"},layout:"vertical"}]},{label:{en:"SEO"},controls:[{type:"combo",label:{en:"Image alt text"},iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:{en:"Image title"},iconName:"polaris-text-block",getValueFromSettingID:"title",compoDefaultValue:"Title",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"title"},layout:"vertical"}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(sizeSetting.width) >= 100 && sizeSetting.width?.includes("%"))',setting:{id:"alignBanner"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];exports.SettingUIV2=SettingUIV2;
1
+ "use strict";const SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"layout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:"layout.cols.length == 1 && layout.type === 'center-top'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length == 1 && layout.type === 'center'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length == 1 && layout.type === 'center-bottom'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"bottom"}},{condition:"layout.cols.length == 1 && layout.type === 'center-distributed'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-distributed' || layout.type === 'right-distributed')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-top' || layout.type === 'right-top')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length > 1 && ( layout.type === 'right' || layout.type === 'left')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-bottom' || layout.type === 'right-bottom')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"bottom"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Background"},controls:[{setting:{id:"background"},options:{updateFields:[{field:"preload",settingId:"preload"}]},controlChangeTrigger:{settings:[{action:{controlId:"preload",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{condition:"!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1},valueIfNull:{width:"100%",height:"fit-content"},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!0},valueIfNull:{enableVideoShape:!0},groupType:"style",controlType:"size-setting"}},{condition:'!!background.image.src && background.type == "image" && sizeSetting.height == "fit-content"',source:["background","sizeSetting"],action:{controlId:"sizeSetting",newValue:{shape:"original",height:""},valueIfNull:{shape:"original"},groupType:"style",controlType:"size-setting"}},{condition:'background.type != "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!1},valueIfNull:{enableVideoShape:!1},groupType:"style",controlType:"size-setting"}}],options:{noRecordHistory:!0,enableTriggerWhenChangeDevice:!0}},layout:"vertical"}],moreSettings:{type:"collapse",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.normal",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayColor",state:"normal"},label:{en:"Color"}},{setting:{id:"overlayOpacity",state:"normal"},label:{en:"Opacity"}}]}]}},{label:{en:"Size"},controls:[{setting:{id:"sizeSetting"},layout:"vertical"},{label:{en:"Scale"},setting:{id:"videoObjectFit"},conditionDisplay:'background.type == "video"'}]},{label:{en:"Content"},controls:[{id:"contentWidth",label:{en:"Width"},controlConfig:{id:"contentWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0},{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},setting:{id:"contentPadding"}},{label:{en:"Align"},setting:{id:"verticalAlign"},conditionEnable:'layout.cols.length > 1 && layout.type != "right-distributed" && layout.type != "left-distributed"'}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBg"}},{label:{en:"Corner"},setting:{id:"cornerBg"}},{label:{en:"Shadow"},setting:{id:"shadowBg"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadowBg.enable === true",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!0}},{condition:"shadowBg.enable === false",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!1}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{type:"combo",fixedValue:"Effect",iconName:"polaris-check-clicked",label:{en:"Hover effect"},setting:{id:"hoverEffect"},controlChangeTrigger:{settings:[{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectScale"],action:{controlId:"hoverEffectScale",groupType:"style",controlType:"style",newValue:"120%"}},{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectDuration"],action:{controlId:"hoverEffectDuration",groupType:"style",controlType:"style",newValue:"0.5s"}}],options:{noRecordHistory:!0}},defaultValueWhenClear:!1,state:"hover",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.hover",defaultValueWhenClear:"transparent",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayOpacity",state:"hover"},label:{en:"Opacity"}},{setting:{id:"overlayColor",state:"hover"},controlChangeTrigger:{settings:[{condition:"overlayColor.hover == 'transparent'",source:["overlayColor","overlayOpacity"],action:{controlId:"overlayOpacity",groupType:"style",controlType:"style",state:"hover",newValue:"20%"}}],options:{noRecordHistory:!0}},compoDefaultValue:"#121212",label:{en:"Color"}}]},{label:{en:"Scale"},type:"combo",iconName:"polaris-maximize",getValueFromSettingID:"hoverEffectScale",defaultValueWhenClear:"100%",compoDefaultValue:"120%",controls:[{label:{en:"Scale"},setting:{id:"hoverEffectScale"},defaultValueWhenClear:"100%"},{type:"control",label:{en:"Time"},setting:{id:"hoverEffectDuration"}}]}]},{type:"combo",fixedValue:"Enabled",iconName:"polaris-parallax-effect",label:{en:"Parallax scroll"},setting:{id:"enableParallax"},conditionDisplay:'background.type == "image"',defaultValueWhenClear:!1,controls:[{setting:{id:"contentBanner"},layout:"vertical"},{label:{en:"Speed"},setting:{id:"speedParallax"}}]}]},{controls:[{label:{en:"Link"},setting:{id:"enableLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableLink == true'},{conditionDisplay:"enableLink == true",setting:{id:"link"},layout:"vertical"}]},{label:{en:"SEO"},controls:[{type:"combo",label:{en:"Image alt text"},iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:{en:"Image title"},iconName:"polaris-text-block",getValueFromSettingID:"title",compoDefaultValue:"Title",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"title"},layout:"vertical"}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(sizeSetting.width) >= 100 && sizeSetting.width?.includes("%"))',setting:{id:"alignBanner"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];exports.SettingUIV2=SettingUIV2;
@@ -1 +1 @@
1
- "use strict";var constant=require("../../constant.js"),helpers=require("./helpers.js"),system=require("@gem-sdk/system"),helpers$1=require("../../helpers.js"),constants=require("../constants.js");const getContainerAttrs=(e,t)=>({...e,...t&&{"data-id":t}}),getLinkWrapperAttrs=({urlData:e,imageLink:t,title:r,isLiquid:s=!1})=>{let a=s?{...e,...t?.noFollow&&{rel:"nofollow"},title:r}:{setting:e,title:r};return t?.type!=="go-to-sales-page"?t?.link?a:{}:s?{href:constant.HREF_TO_SALES_PAGE,target:"_self"}:{setting:{href:constant.HREF_TO_SALES_PAGE,target:"_self"}}},getImageLiquidAttrs=({pageContext:e,enableLazyLoadImage:t=!1})=>({...e&&{pageContext:e},...t&&{enableLazyLoadImage:t}}),getAdaptiveImageAttrs=({styles:e,setting:t,mode:r,isLiquid:s})=>{let{alt:a,srcSet:i,priority:l,qualityPercent:g,qualityType:p}=t??{},n=helpers.getAspectRatio({styles:e,setting:t}),o=()=>{helpers$1.handleClickLink(t?.imageLink,r)},c=i?.desktop?.backupFileKey?helpers.getNewBackupFileKey(i?.desktop?.backupFileKey??"",i?.desktop?.src??""):"",A=s?helpers.getImageSrc({src:i?.desktop?.src,backupFileKey:c,backupFilePath:i?.desktop?.backupFilePath,storage:i?.desktop?.storage}):i?.desktop?.src??"",u=l?{}:{"base-src":A??"","quality-type":helpers.safeStringify(p),"quality-percent":helpers.safeStringify(g)};return{pictureClass:"gp-contents",...a&&{alt:a},...i&&{srcSet:i},...l&&constants.PRIORITY_LOAD_ATTRS,...u,...e?.objectFit&&{layout:e.objectFit},onClick:o,aspectRatio:n}},getNextImageAttrs=({styles:e,setting:t})=>{let{objectFit:r}=e??{},{vw:s,alt:a,title:i,quality:l,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:o}=t??{},c=helpers.getAspectRatio({styles:e,setting:t});return{...t?.image,...s&&{vw:s},...a&&{alt:a},...i&&{title:i},...l&&{quality:l},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:c,layout:r,qualityType:n,qualityPercent:o}}},getNextImageLiquidAttrs=e=>{let{srcset:t,setting:r,storage:s,baseSrc:a,priority:i,customAttrs:l,width:g=2237,height:p=1678,isNotLazyload:n,backupFileKey:o,backupFilePath:c,srcIsLiquidCode:A,enableLazyLoadImage:u,alt:h,title:I,src:y=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SRC,sizes:E=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SIZES}=e,_=!n&&u&&!i,d=()=>{let e=o?helpers.getNewBackupFileKey(o??"",y):"",r=A?a:helpers.getImageSrc({src:y,backupFileKey:e,backupFilePath:c,storage:s}),l=A?y:helpers.getSrcSet(e??"",s??"THEME",y),n={sizes:"100vw",src:helpers.createBlurDataURL(g,p),...r&&!i?{"base-src":r}:{},...r?{"data-src":r}:{},...l?{"data-srcset":l}:{}},u={sizes:E,src:r??"",isNotLazyload:"true",srcset:t??"",...r&&!i?{"base-src":r}:{},...i?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",..._?n:u}},L=()=>{let{qualityPercent:e,qualityType:t}=r??{},s=!i&&t&&e?{"quality-type":helpers.safeStringify(t),"quality-percent":helpers.safeStringify(e)}:{"quality-type":"","quality-percent":""};return{...h&&{alt:h},...I&&{title:I},width:g,height:p,draggable:"false",...s}};return system.createAttr({...l,...L(),...d()})},getNextImageReactAttrs=e=>{let{width:t=helpers.NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS,height:r=helpers.NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS,quality:s,priority:a,isNotLazyload:i,enableLazyLoadImage:l,base64:g=helpers.IMAGE_PLACEHOLDER,alt:p=helpers.NEXT_IMAGE_CONFIG.DEFAULT_ALT,title:n,src:o=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SRC}=e,c=!i&&l&&!a,A=()=>{let e={loading:"lazy",placeholder:"blur",...g&&{blurDataURL:g}},t={loading:"eager",fetchpriority:"high"};return{...c?e:t}},u=()=>({src:o,alt:p,title:n,width:t,height:r,quality:s}),h=u(),I=system.createAttr(A());return{...h,...I}};exports.getAdaptiveImageAttrs=getAdaptiveImageAttrs,exports.getContainerAttrs=getContainerAttrs,exports.getImageLiquidAttrs=getImageLiquidAttrs,exports.getLinkWrapperAttrs=getLinkWrapperAttrs,exports.getNextImageAttrs=getNextImageAttrs,exports.getNextImageLiquidAttrs=getNextImageLiquidAttrs,exports.getNextImageReactAttrs=getNextImageReactAttrs;
1
+ "use strict";var constant=require("../../constant.js"),helpers=require("./helpers.js"),system=require("@gem-sdk/system"),helpers$1=require("../../helpers.js"),constants=require("../constants.js");const getContainerAttrs=(e,t)=>({...e,...t&&{"data-id":t}}),getLinkWrapperAttrs=({urlData:e,imageLink:t,title:r,isLiquid:s=!1})=>{let a=s?{...e,...t?.noFollow&&{rel:"nofollow"},title:r}:{setting:e,title:r};return t?.type!=="go-to-sales-page"?t?.link?a:{}:s?{href:constant.HREF_TO_SALES_PAGE,target:"_self"}:{setting:{href:constant.HREF_TO_SALES_PAGE,target:"_self"}}},getImageLiquidAttrs=({pageContext:e,enableLazyLoadImage:t=!1})=>({...e&&{pageContext:e},...t&&{enableLazyLoadImage:t}}),getAdaptiveImageAttrs=({styles:e,setting:t,mode:r,isLiquid:s})=>{let{alt:a,srcSet:i,priority:l,qualityPercent:g,qualityType:p}=t??{},n=helpers.getAspectRatio({styles:e,setting:t}),o=()=>{helpers$1.handleClickLink(t?.imageLink,r)},c=i?.desktop?.backupFileKey?helpers.getNewBackupFileKey(i?.desktop?.backupFileKey??"",i?.desktop?.src??""):"",A=s?helpers.getImageSrc({src:i?.desktop?.src,backupFileKey:c,backupFilePath:i?.desktop?.backupFilePath,storage:i?.desktop?.storage}):i?.desktop?.src??"",u=l?{}:{"base-src":A??"","quality-type":helpers.safeStringify(p),"quality-percent":helpers.safeStringify(g)};return{pictureClass:"gp-contents",...a&&{alt:a},...i&&{srcSet:i},...l&&constants.PRIORITY_LOAD_ATTRS,...u,...e?.objectFit&&{layout:e.objectFit},onClick:o,aspectRatio:n}},getNextImageAttrs=({styles:e,setting:t})=>{let{objectFit:r}=e??{},{vw:s,alt:a,title:i,quality:l,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:o}=t??{},c=helpers.getAspectRatio({styles:e,setting:t});return{...t?.image,...s&&{vw:s},...a&&{alt:a},...i&&{title:i},...l&&{quality:l},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:c,layout:r,qualityType:n,qualityPercent:o}}},getNextImageLiquidAttrs=e=>{let{srcset:t,setting:r,storage:s,baseSrc:a,priority:i,customAttrs:l,width:g=2237,height:p=1678,isNotLazyload:n,backupFileKey:o,backupFilePath:c,srcIsLiquidCode:A,enableLazyLoadImage:u,alt:h=helpers.NEXT_IMAGE_CONFIG.DEFAULT_ALT,title:I,src:E=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SRC,sizes:_=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SIZES}=e,y=!n&&u&&!i,d=()=>{let e=o?helpers.getNewBackupFileKey(o??"",E):"",r=A?a:helpers.getImageSrc({src:E,backupFileKey:e,backupFilePath:c,storage:s}),l=A?E:helpers.getSrcSet(e??"",s??"THEME",E),n={sizes:"100vw",src:helpers.createBlurDataURL(g,p),...r&&!i?{"base-src":r}:{},...r?{"data-src":r}:{},...l?{"data-srcset":l}:{}},u={sizes:_,src:r??"",isNotLazyload:"true",srcset:t??"",...r&&!i?{"base-src":r}:{},...i?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",...y?n:u}},L=()=>{let{qualityPercent:e,qualityType:t}=r??{},s=!i&&t&&e?{"quality-type":helpers.safeStringify(t),"quality-percent":helpers.safeStringify(e)}:{"quality-type":"","quality-percent":""};return{...h&&{alt:h},...I&&{title:I},width:g,height:p,draggable:"false",...s}};return system.createAttr({...l,...L(),...d()})},getNextImageReactAttrs=e=>{let{width:t=helpers.NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS,height:r=helpers.NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS,quality:s,priority:a,isNotLazyload:i,enableLazyLoadImage:l,base64:g=helpers.IMAGE_PLACEHOLDER,alt:p=helpers.NEXT_IMAGE_CONFIG.DEFAULT_ALT,title:n,src:o=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SRC}=e,c=!i&&l&&!a,A=()=>{let e={loading:"lazy",placeholder:"blur",...g&&{blurDataURL:g}},t={loading:"eager",fetchpriority:"high"};return{...c?e:t}},u=()=>({src:o,alt:p,title:n,width:t,height:r,quality:s}),h=u(),I=system.createAttr(A());return{...h,...I}};exports.getAdaptiveImageAttrs=getAdaptiveImageAttrs,exports.getContainerAttrs=getContainerAttrs,exports.getImageLiquidAttrs=getImageLiquidAttrs,exports.getLinkWrapperAttrs=getLinkWrapperAttrs,exports.getNextImageAttrs=getNextImageAttrs,exports.getNextImageLiquidAttrs=getNextImageLiquidAttrs,exports.getNextImageReactAttrs=getNextImageReactAttrs;
@@ -1 +1 @@
1
- let SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"layout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:"layout.cols.length == 1 && layout.type === 'center-top'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length == 1 && layout.type === 'center'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length == 1 && layout.type === 'center-bottom'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"bottom"}},{condition:"layout.cols.length == 1 && layout.type === 'center-distributed'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-distributed' || layout.type === 'right-distributed')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-top' || layout.type === 'right-top')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length > 1 && ( layout.type === 'right' || layout.type === 'left')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-bottom' || layout.type === 'right-bottom')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"bottom"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Background"},controls:[{setting:{id:"background"},options:{updateFields:[{field:"preload",settingId:"preload"}]},controlChangeTrigger:{settings:[{action:{controlId:"preload",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{condition:"!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1},valueIfNull:{width:"100%",height:"fit-content"},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!0},valueIfNull:{enableVideoShape:!0},groupType:"style",controlType:"size-setting"}},{condition:'!!background.image.src && background.type == "image" && sizeSetting.height == "fit-content"',source:["background","sizeSetting"],action:{controlId:"sizeSetting",newValue:{shape:"original",height:""},valueIfNull:{shape:"original"},groupType:"style",controlType:"size-setting"}},{condition:'background.type != "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!1},valueIfNull:{enableVideoShape:!1},groupType:"style",controlType:"size-setting"}}],options:{noRecordHistory:!0}},layout:"vertical"}],moreSettings:{type:"collapse",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.normal",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayColor",state:"normal"},label:{en:"Color"}},{setting:{id:"overlayOpacity",state:"normal"},label:{en:"Opacity"}}]}]}},{label:{en:"Size"},controls:[{setting:{id:"sizeSetting"},layout:"vertical"},{label:{en:"Scale"},setting:{id:"videoObjectFit"},conditionDisplay:'background.type == "video"'}]},{label:{en:"Content"},controls:[{id:"contentWidth",label:{en:"Width"},controlConfig:{id:"contentWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0},{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},setting:{id:"contentPadding"}},{label:{en:"Align"},setting:{id:"verticalAlign"},conditionEnable:'layout.cols.length > 1 && layout.type != "right-distributed" && layout.type != "left-distributed"'}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBg"}},{label:{en:"Corner"},setting:{id:"cornerBg"}},{label:{en:"Shadow"},setting:{id:"shadowBg"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadowBg.enable === true",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!0}},{condition:"shadowBg.enable === false",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!1}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{type:"combo",fixedValue:"Effect",iconName:"polaris-check-clicked",label:{en:"Hover effect"},setting:{id:"hoverEffect"},controlChangeTrigger:{settings:[{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectScale"],action:{controlId:"hoverEffectScale",groupType:"style",controlType:"style",newValue:"120%"}},{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectDuration"],action:{controlId:"hoverEffectDuration",groupType:"style",controlType:"style",newValue:"0.5s"}}],options:{noRecordHistory:!0}},defaultValueWhenClear:!1,state:"hover",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.hover",defaultValueWhenClear:"transparent",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayOpacity",state:"hover"},label:{en:"Opacity"}},{setting:{id:"overlayColor",state:"hover"},controlChangeTrigger:{settings:[{condition:"overlayColor.hover == 'transparent'",source:["overlayColor","overlayOpacity"],action:{controlId:"overlayOpacity",groupType:"style",controlType:"style",state:"hover",newValue:"20%"}}],options:{noRecordHistory:!0}},compoDefaultValue:"#121212",label:{en:"Color"}}]},{label:{en:"Scale"},type:"combo",iconName:"polaris-maximize",getValueFromSettingID:"hoverEffectScale",defaultValueWhenClear:"100%",compoDefaultValue:"120%",controls:[{label:{en:"Scale"},setting:{id:"hoverEffectScale"},defaultValueWhenClear:"100%"},{type:"control",label:{en:"Time"},setting:{id:"hoverEffectDuration"}}]}]},{type:"combo",fixedValue:"Enabled",iconName:"polaris-parallax-effect",label:{en:"Parallax scroll"},setting:{id:"enableParallax"},conditionDisplay:'background.type == "image"',defaultValueWhenClear:!1,controls:[{setting:{id:"contentBanner"},layout:"vertical"},{label:{en:"Speed"},setting:{id:"speedParallax"}}]}]},{controls:[{label:{en:"Link"},setting:{id:"enableLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableLink == true'},{conditionDisplay:"enableLink == true",setting:{id:"link"},layout:"vertical"}]},{label:{en:"SEO"},controls:[{type:"combo",label:{en:"Image alt text"},iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:{en:"Image title"},iconName:"polaris-text-block",getValueFromSettingID:"title",compoDefaultValue:"Title",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"title"},layout:"vertical"}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(sizeSetting.width) >= 100 && sizeSetting.width?.includes("%"))',setting:{id:"alignBanner"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{SettingUIV2};
1
+ let SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"layout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:"layout.cols.length == 1 && layout.type === 'center-top'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length == 1 && layout.type === 'center'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length == 1 && layout.type === 'center-bottom'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"bottom"}},{condition:"layout.cols.length == 1 && layout.type === 'center-distributed'",source:["layout"],action:{controlId:"contentPosition1Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-distributed' || layout.type === 'right-distributed')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"space-between"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-top' || layout.type === 'right-top')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"top"}},{condition:"layout.cols.length > 1 && ( layout.type === 'right' || layout.type === 'left')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"center"}},{condition:"layout.cols.length > 1 && ( layout.type === 'left-bottom' || layout.type === 'right-bottom')",source:["layout"],action:{controlId:"contentPosition2Col",groupType:"style",controlType:"style",newValue:"bottom"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Background"},controls:[{setting:{id:"background"},options:{updateFields:[{field:"preload",settingId:"preload"}]},controlChangeTrigger:{settings:[{action:{controlId:"preload",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{condition:"!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1},valueIfNull:{width:"100%",height:"fit-content"},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!0},valueIfNull:{enableVideoShape:!0},groupType:"style",controlType:"size-setting"}},{condition:'!!background.image.src && background.type == "image" && sizeSetting.height == "fit-content"',source:["background","sizeSetting"],action:{controlId:"sizeSetting",newValue:{shape:"original",height:""},valueIfNull:{shape:"original"},groupType:"style",controlType:"size-setting"}},{condition:'background.type != "video"',source:["background"],action:{controlId:"sizeSetting",newValue:{enableVideoShape:!1},valueIfNull:{enableVideoShape:!1},groupType:"style",controlType:"size-setting"}}],options:{noRecordHistory:!0,enableTriggerWhenChangeDevice:!0}},layout:"vertical"}],moreSettings:{type:"collapse",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.normal",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayColor",state:"normal"},label:{en:"Color"}},{setting:{id:"overlayOpacity",state:"normal"},label:{en:"Opacity"}}]}]}},{label:{en:"Size"},controls:[{setting:{id:"sizeSetting"},layout:"vertical"},{label:{en:"Scale"},setting:{id:"videoObjectFit"},conditionDisplay:'background.type == "video"'}]},{label:{en:"Content"},controls:[{id:"contentWidth",label:{en:"Width"},controlConfig:{id:"contentWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0},{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},setting:{id:"contentPadding"}},{label:{en:"Align"},setting:{id:"verticalAlign"},conditionEnable:'layout.cols.length > 1 && layout.type != "right-distributed" && layout.type != "left-distributed"'}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBg"}},{label:{en:"Corner"},setting:{id:"cornerBg"}},{label:{en:"Shadow"},setting:{id:"shadowBg"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadowBg.enable === true",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!0}},{condition:"shadowBg.enable === false",source:["shadowBg","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"style",controlType:"style",newValue:!1}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{type:"combo",fixedValue:"Effect",iconName:"polaris-check-clicked",label:{en:"Hover effect"},setting:{id:"hoverEffect"},controlChangeTrigger:{settings:[{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectScale"],action:{controlId:"hoverEffectScale",groupType:"style",controlType:"style",newValue:"120%"}},{condition:"hoverEffect == true",source:["hoverEffect","hoverEffectDuration"],action:{controlId:"hoverEffectDuration",groupType:"style",controlType:"style",newValue:"0.5s"}}],options:{noRecordHistory:!0}},defaultValueWhenClear:!1,state:"hover",controls:[{label:{en:"Overlay"},type:"combo",comboType:"color",getValueFromSettingID:"overlayColor.hover",defaultValueWhenClear:"transparent",compoDefaultValue:"#121212",controls:[{setting:{id:"overlayOpacity",state:"hover"},label:{en:"Opacity"}},{setting:{id:"overlayColor",state:"hover"},controlChangeTrigger:{settings:[{condition:"overlayColor.hover == 'transparent'",source:["overlayColor","overlayOpacity"],action:{controlId:"overlayOpacity",groupType:"style",controlType:"style",state:"hover",newValue:"20%"}}],options:{noRecordHistory:!0}},compoDefaultValue:"#121212",label:{en:"Color"}}]},{label:{en:"Scale"},type:"combo",iconName:"polaris-maximize",getValueFromSettingID:"hoverEffectScale",defaultValueWhenClear:"100%",compoDefaultValue:"120%",controls:[{label:{en:"Scale"},setting:{id:"hoverEffectScale"},defaultValueWhenClear:"100%"},{type:"control",label:{en:"Time"},setting:{id:"hoverEffectDuration"}}]}]},{type:"combo",fixedValue:"Enabled",iconName:"polaris-parallax-effect",label:{en:"Parallax scroll"},setting:{id:"enableParallax"},conditionDisplay:'background.type == "image"',defaultValueWhenClear:!1,controls:[{setting:{id:"contentBanner"},layout:"vertical"},{label:{en:"Speed"},setting:{id:"speedParallax"}}]}]},{controls:[{label:{en:"Link"},setting:{id:"enableLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableLink == true'},{conditionDisplay:"enableLink == true",setting:{id:"link"},layout:"vertical"}]},{label:{en:"SEO"},controls:[{type:"combo",label:{en:"Image alt text"},iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:{en:"Image title"},iconName:"polaris-text-block",getValueFromSettingID:"title",compoDefaultValue:"Title",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"title"},layout:"vertical"}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(sizeSetting.width) >= 100 && sizeSetting.width?.includes("%"))',setting:{id:"alignBanner"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{SettingUIV2};
@@ -1 +1 @@
1
- import{HREF_TO_SALES_PAGE as t}from"../../constant.js";import{getAspectRatio as e,getNewBackupFileKey as r,getImageSrc as a,safeStringify as s,NEXT_IMAGE_CONFIG as i,getSrcSet as l,createBlurDataURL as o,IMAGE_PLACEHOLDER as g}from"./helpers.js";import{createAttr as p}from"@gem-sdk/system";import{handleClickLink as n}from"../../helpers.js";import{PRIORITY_LOAD_ATTRS as c}from"../constants.js";let getContainerAttrs=(t,e)=>({...t,...e&&{"data-id":e}}),getLinkWrapperAttrs=({urlData:e,imageLink:r,title:a,isLiquid:s=!1})=>{let i=s?{...e,...r?.noFollow&&{rel:"nofollow"},title:a}:{setting:e,title:a};return r?.type!=="go-to-sales-page"?r?.link?i:{}:s?{href:t,target:"_self"}:{setting:{href:t,target:"_self"}}},getImageLiquidAttrs=({pageContext:t,enableLazyLoadImage:e=!1})=>({...t&&{pageContext:t},...e&&{enableLazyLoadImage:e}}),getAdaptiveImageAttrs=({styles:t,setting:i,mode:l,isLiquid:o})=>{let{alt:g,srcSet:p,priority:u,qualityPercent:d,qualityType:m}=i??{},A=e({styles:t,setting:i}),y=()=>{n(i?.imageLink,l)},k=p?.desktop?.backupFileKey?r(p?.desktop?.backupFileKey??"",p?.desktop?.src??""):"",L=o?a({src:p?.desktop?.src,backupFileKey:k,backupFilePath:p?.desktop?.backupFilePath,storage:p?.desktop?.storage}):p?.desktop?.src??"",F=u?{}:{"base-src":L??"","quality-type":s(m),"quality-percent":s(d)};return{pictureClass:"gp-contents",...g&&{alt:g},...p&&{srcSet:p},...u&&c,...F,...t?.objectFit&&{layout:t.objectFit},onClick:y,aspectRatio:A}},getNextImageAttrs=({styles:t,setting:r})=>{let{objectFit:a}=t??{},{vw:s,alt:i,title:l,quality:o,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:c}=r??{},u=e({styles:t,setting:r});return{...r?.image,...s&&{vw:s},...i&&{alt:i},...l&&{title:l},...o&&{quality:o},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:u,layout:a,qualityType:n,qualityPercent:c}}},getNextImageLiquidAttrs=t=>{let{srcset:e,setting:g,storage:n,baseSrc:c,priority:u,customAttrs:d,width:m=2237,height:A=1678,isNotLazyload:y,backupFileKey:k,backupFilePath:L,srcIsLiquidCode:F,enableLazyLoadImage:b,alt:f,title:h,src:I=i.DEFAULT_SRC,sizes:q=i.DEFAULT_SIZES}=t,E=!y&&b&&!u,T=()=>{let t=k?r(k??"",I):"",s=F?c:a({src:I,backupFileKey:t,backupFilePath:L,storage:n}),i=F?I:l(t??"",n??"THEME",I),g={sizes:"100vw",src:o(m,A),...s&&!u?{"base-src":s}:{},...s?{"data-src":s}:{},...i?{"data-srcset":i}:{}},p={sizes:q,src:s??"",isNotLazyload:"true",srcset:e??"",...s&&!u?{"base-src":s}:{},...u?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",...E?g:p}},_=()=>{let{qualityPercent:t,qualityType:e}=g??{},r=!u&&e&&t?{"quality-type":s(e),"quality-percent":s(t)}:{"quality-type":"","quality-percent":""};return{...f&&{alt:f},...h&&{title:h},width:m,height:A,draggable:"false",...r}};return p({...d,..._(),...T()})},getNextImageReactAttrs=t=>{let{width:e=i.DEFAULT_WIDTH_PROPS,height:r=i.DEFAULT_HEIGHT_PROPS,quality:a,priority:s,isNotLazyload:l,enableLazyLoadImage:o,base64:n=g,alt:c=i.DEFAULT_ALT,title:u,src:d=i.DEFAULT_SRC}=t,m=!l&&o&&!s,A=()=>{let t={loading:"lazy",placeholder:"blur",...n&&{blurDataURL:n}},e={loading:"eager",fetchpriority:"high"};return{...m?t:e}},y=()=>({src:d,alt:c,title:u,width:e,height:r,quality:a}),k=y(),L=p(A());return{...k,...L}};export{getAdaptiveImageAttrs,getContainerAttrs,getImageLiquidAttrs,getLinkWrapperAttrs,getNextImageAttrs,getNextImageLiquidAttrs,getNextImageReactAttrs};
1
+ import{HREF_TO_SALES_PAGE as t}from"../../constant.js";import{getAspectRatio as e,getNewBackupFileKey as r,getImageSrc as a,safeStringify as s,NEXT_IMAGE_CONFIG as i,getSrcSet as l,createBlurDataURL as o,IMAGE_PLACEHOLDER as g}from"./helpers.js";import{createAttr as p}from"@gem-sdk/system";import{handleClickLink as n}from"../../helpers.js";import{PRIORITY_LOAD_ATTRS as c}from"../constants.js";let getContainerAttrs=(t,e)=>({...t,...e&&{"data-id":e}}),getLinkWrapperAttrs=({urlData:e,imageLink:r,title:a,isLiquid:s=!1})=>{let i=s?{...e,...r?.noFollow&&{rel:"nofollow"},title:a}:{setting:e,title:a};return r?.type!=="go-to-sales-page"?r?.link?i:{}:s?{href:t,target:"_self"}:{setting:{href:t,target:"_self"}}},getImageLiquidAttrs=({pageContext:t,enableLazyLoadImage:e=!1})=>({...t&&{pageContext:t},...e&&{enableLazyLoadImage:e}}),getAdaptiveImageAttrs=({styles:t,setting:i,mode:l,isLiquid:o})=>{let{alt:g,srcSet:p,priority:u,qualityPercent:d,qualityType:A}=i??{},m=e({styles:t,setting:i}),y=()=>{n(i?.imageLink,l)},k=p?.desktop?.backupFileKey?r(p?.desktop?.backupFileKey??"",p?.desktop?.src??""):"",L=o?a({src:p?.desktop?.src,backupFileKey:k,backupFilePath:p?.desktop?.backupFilePath,storage:p?.desktop?.storage}):p?.desktop?.src??"",F=u?{}:{"base-src":L??"","quality-type":s(A),"quality-percent":s(d)};return{pictureClass:"gp-contents",...g&&{alt:g},...p&&{srcSet:p},...u&&c,...F,...t?.objectFit&&{layout:t.objectFit},onClick:y,aspectRatio:m}},getNextImageAttrs=({styles:t,setting:r})=>{let{objectFit:a}=t??{},{vw:s,alt:i,title:l,quality:o,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:c}=r??{},u=e({styles:t,setting:r});return{...r?.image,...s&&{vw:s},...i&&{alt:i},...l&&{title:l},...o&&{quality:o},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:u,layout:a,qualityType:n,qualityPercent:c}}},getNextImageLiquidAttrs=t=>{let{srcset:e,setting:g,storage:n,baseSrc:c,priority:u,customAttrs:d,width:A=2237,height:m=1678,isNotLazyload:y,backupFileKey:k,backupFilePath:L,srcIsLiquidCode:F,enableLazyLoadImage:b,alt:f=i.DEFAULT_ALT,title:h,src:I=i.DEFAULT_SRC,sizes:T=i.DEFAULT_SIZES}=t,E=!y&&b&&!u,_=()=>{let t=k?r(k??"",I):"",s=F?c:a({src:I,backupFileKey:t,backupFilePath:L,storage:n}),i=F?I:l(t??"",n??"THEME",I),g={sizes:"100vw",src:o(A,m),...s&&!u?{"base-src":s}:{},...s?{"data-src":s}:{},...i?{"data-srcset":i}:{}},p={sizes:T,src:s??"",isNotLazyload:"true",srcset:e??"",...s&&!u?{"base-src":s}:{},...u?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",...E?g:p}},q=()=>{let{qualityPercent:t,qualityType:e}=g??{},r=!u&&e&&t?{"quality-type":s(e),"quality-percent":s(t)}:{"quality-type":"","quality-percent":""};return{...f&&{alt:f},...h&&{title:h},width:A,height:m,draggable:"false",...r}};return p({...d,...q(),..._()})},getNextImageReactAttrs=t=>{let{width:e=i.DEFAULT_WIDTH_PROPS,height:r=i.DEFAULT_HEIGHT_PROPS,quality:a,priority:s,isNotLazyload:l,enableLazyLoadImage:o,base64:n=g,alt:c=i.DEFAULT_ALT,title:u,src:d=i.DEFAULT_SRC}=t,A=!l&&o&&!s,m=()=>{let t={loading:"lazy",placeholder:"blur",...n&&{blurDataURL:n}},e={loading:"eager",fetchpriority:"high"};return{...A?t:e}},y=()=>({src:d,alt:c,title:u,width:e,height:r,quality:a}),k=y(),L=p(m());return{...k,...L}};export{getAdaptiveImageAttrs,getContainerAttrs,getImageLiquidAttrs,getLinkWrapperAttrs,getNextImageAttrs,getNextImageLiquidAttrs,getNextImageReactAttrs};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "13.1.1",
3
+ "version": "13.1.3",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "13.1.0",
29
+ "@gem-sdk/core": "13.1.3",
30
30
  "@gem-sdk/styles": "13.1.0",
31
31
  "@gem-sdk/system": "13.1.0",
32
32
  "@types/react-transition-group": "^4.4.12",