@gem-sdk/components 2.0.0-staging.1058 → 2.0.0-staging.1061

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 core=require("@gem-sdk/core");const getButtonClasses=({uid:t,styles:e,className:s,shouldRenderLink:o})=>({...s&&{[s]:!0},...t&&{[t]:!0},"gp-text-center":o,"gp-max-w-full":e?.textOverFlow||!1,"gp-scale-[1.1]":e?.animation?.normal==="grow","gp-animate-bounce":e?.animation?.normal==="bounce","hover:gp-scale-[1.1]":e?.animation?.hover==="grow","hover:gp-animate-bounce":e?.animation?.hover==="bounce","gp-button-base gp-group gp-relative gp-inline-flex gp-max-w-full gp-items-center gp-justify-center gp-no-underline gp-transition-colors gp-duration-200 disabled:gp-btn-disabled disabled:gp-opacity-30":!0,[core.getGlobalColorStateClass("text",e?.textColor)]:!0,[core.composeTypographyClassName(e?.typo,e?.typography)]:!0}),getButtonWrapperClasses=(t,e,s)=>({[t]:!0,...e?.includes("gp-button-atc")&&s&&{[s]:!0}}),getButtonContentWrapperClasses=t=>({"gp-inline-flex":!0,"gp-flex-row-reverse":t?.iconAlign==="right"&&!!t?.label}),getButtonContainerClasses=()=>({"gp-flex gp-flex-col":!0}),getButtonLabelClasses=(t,e)=>({"gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line":!0,"[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]":t?.typo?.attrs?.italic,"gp-text button-text":e}),getButtonIconClasses=(t,e,s)=>({"!gp-m-0":e&&!t||!s,"gp-button-icon gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)]":!0});exports.getButtonClasses=getButtonClasses,exports.getButtonContainerClasses=getButtonContainerClasses,exports.getButtonContentWrapperClasses=getButtonContentWrapperClasses,exports.getButtonIconClasses=getButtonIconClasses,exports.getButtonLabelClasses=getButtonLabelClasses,exports.getButtonWrapperClasses=getButtonWrapperClasses;
1
+ "use strict";var core=require("@gem-sdk/core");const getButtonClasses=({uid:t,styles:e,className:s,shouldRenderLink:o,advanced:n})=>({...s&&{[s]:!0},...t&&{[t]:!0},"gp-text-center":o,"gp-max-w-full":e?.textOverFlow||!1,"gp-scale-[1.1]":e?.animation?.normal==="grow","gp-animate-bounce":e?.animation?.normal==="bounce","hover:gp-scale-[1.1]":e?.animation?.hover==="grow","hover:gp-animate-bounce":e?.animation?.hover==="bounce","gp-button-base gp-group gp-relative gp-inline-flex gp-max-w-full gp-items-center gp-justify-center gp-no-underline gp-transition-colors gp-duration-200 disabled:gp-btn-disabled disabled:gp-opacity-30":!0,[core.getGlobalColorStateClass("text",e?.textColor)]:!0,[core.composeTypographyClassName(e?.typo,e?.typography)]:!0,...s?.includes("gp-button-atc")&&n&&{[n?.cssClass]:!0}}),getButtonWrapperClasses=(t,e,s)=>({[t]:!0,...!e?.includes("gp-button-atc")&&s&&{[s]:!0}}),getButtonContentWrapperClasses=t=>({"gp-inline-flex":!0,"gp-flex-row-reverse":t?.iconAlign==="right"&&!!t?.label}),getButtonContainerClasses=()=>({"gp-flex gp-flex-col":!0}),getButtonLabelClasses=(t,e)=>({"gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line":!0,"[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]":t?.typo?.attrs?.italic,"gp-text button-text":e}),getButtonIconClasses=(t,e,s)=>({"!gp-m-0":e&&!t||!s,"gp-button-icon gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)]":!0});exports.getButtonClasses=getButtonClasses,exports.getButtonContainerClasses=getButtonContainerClasses,exports.getButtonContentWrapperClasses=getButtonContentWrapperClasses,exports.getButtonIconClasses=getButtonIconClasses,exports.getButtonLabelClasses=getButtonLabelClasses,exports.getButtonWrapperClasses=getButtonWrapperClasses;
@@ -1,4 +1,4 @@
1
- "use strict";var core=require("@gem-sdk/core");const getButtonWrapperStyles=(e,t)=>({...e,...core.makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle,...getTypographyStyles(e).withoutTextColorStyles};return t?o:core.filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...core.getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return core.composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?core.makeStyleResponsive("mr",o):core.makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=core.makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=core.composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":core.getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...core.getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},s=o?.[t],a=r?.[t];if(!s&&!a)return"";let l=`url(${s?.image?.src})`,n=a?`, ${a}`:"";return a?.includes?.(core.GRADIENT_BGR_KEY)&&s?.image?.src?`${l}${n}`:a?.includes?.(core.GRADIENT_BGR_KEY)&&!s?.image?.src?a:s?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return core.makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},s={...t,hover:t?.hover||t?.normal};return{...core.getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:s}),...core.getGlobalColorStateStyle("bg",s)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:s,roundedBtnV2:a}=e??{},l=ignoreStateNoneValue(s||{},'value?.border !== "none"'),n=ignoreStateNoneValue(a||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:n,builderAttrs:o,enableHoverEffect:r});return`
1
+ "use strict";var core=require("@gem-sdk/core");const getButtonWrapperStyles=(e,t)=>({...e,...core.makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle,...getTypographyStyles(e).withoutTextColorStyles};return t?o:core.filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...core.getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return core.composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?core.makeStyleResponsive("mr",o):core.makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=core.makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=core.composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":core.getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...core.getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},s=o?.[t],a=r?.[t];if(!s&&!a)return"";let l=`url(${s?.image?.src})`,n=a?`, ${a}`:"";return a?.includes?.(core.GRADIENT_BGR_KEY)&&s?.image?.src?`${l}${n}`:a?.includes?.(core.GRADIENT_BGR_KEY)&&!s?.image?.src?a:s?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return core.makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},s={...t,hover:t?.hover||t?.normal};return{...core.getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:s}),...core.getGlobalColorStateStyle("bg",s)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:s,roundedBtnV2:a}=e??{},l=ignoreStateNoneValue(s||{},"value?.border !== undefined"),n=ignoreStateNoneValue(a||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:n,builderAttrs:o,enableHoverEffect:r});return`
2
2
  ${g.normalStyles}
3
3
  ${g.hoverStyles}
4
4
  `.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r,enableHoverEffect:s})=>{let a=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},n=l({styleObj:t,state:"normal"}),g=l({styleObj:s?t:void 0,state:"hover"}),d=l({styleObj:o,state:"normal"}),i=l({styleObj:o,state:"hover"}),u=`
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers$1=require("../../helpers.js"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),ButtonIcon=require("./ButtonIcon.js"),ButtonLabel=require("./ButtonLabel.js"),ButtonLoadingIndicator=require("./ButtonLoadingIndicator.js"),helpers=require("../common/helpers.js");const Button=e=>{let{children:s,advanced:t,className:a,nodePrice:l,customAttrs:r,styles:n={},setting:o={},builderProps:u,builderAttrs:c,wrapClassName:i="",onClick:y}=e,{iconSvg:m,btnLink:d,htmlType:g,loading:j,disabled:x,shouldClearSpace:p,enableBtnLink:B}=o,{enableTextStyle:C=!0}=n,h=core.useEditorMode(),I=core.usePageType(),{customCss:f,wrapStyle:b,restStyle:L,dataState:q,dataIdAttr:S,isShowIcon:R,isScrollToElement:k,getArialLabel:v,getLabelToDisplay:T,checkIsShowLabel:N,checkIsEditableLabel:M}=helpers.getData(e),{HTMLTag:_,urlData:H,shouldRenderLink:W}=helpers.getInsertLinkData({enableBtnLink:B,htmlType:g,setting:d,defaultTag:"button",pageType:I}),A=system.createStyle({...styles.getButtonStyles(n,o.enableHoverEffect)}),D=system.createStyle({...styles.getTypoStyles(n)}),E=system.createStyle({...styles.getTypoStyles(n),...styles.getButtonIconStyles(n,o)}),P=system.createStyle({...styles.getButtonWrapperStyles(L,n)}),$=system.createClass({...classes.getButtonClasses({styles:n,className:a,shouldRenderLink:W,uid:u?.uid})}),O=system.createClass({...classes.getButtonIconClasses(T(),p,C)}),w=system.createClass({...classes.getButtonLabelClasses(n,M({mode:h}))}),z=system.createClass({...classes.getButtonWrapperClasses(i,a,t?.cssClass)}),F=system.createClass({...classes.getButtonContentWrapperClasses(o)}),G=system.createClass({...classes.getButtonContainerClasses()}),J=system.createAttr({...attrs.getButtonAttributes({disabled:x,dataState:q,dataId:S,arialLabel:v()})}),K=e=>{y?.(e),helpers$1.handleClickLink(d,h)};return jsxRuntime.jsx("div",{style:b,className:G,children:jsxRuntime.jsxs("div",{...c,style:P,className:z,children:[jsxRuntime.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:f}}),system.If(k,jsxRuntime.jsx("a",{className:"gp-trigger-button-link gp-hidden",href:H.href,target:H.target})),jsxRuntime.jsxs(_,{...J,...r,..."button"!==_&&{setting:H},style:A,className:$,onClick:K,children:[system.If(j,jsxRuntime.jsx(ButtonLoadingIndicator.default,{})),jsxRuntime.jsxs("div",{className:F,children:[system.If(R,jsxRuntime.jsx(ButtonIcon.default,{iconSvg:m??"",styles:E,classes:O})),system.If(C&&N(),jsxRuntime.jsx(ButtonLabel.default,{label:T(),styles:D,classes:w}))]}),system.If(!!l,l??"")]}),s]})})};exports.default=Button;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers$1=require("../../helpers.js"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),ButtonIcon=require("./ButtonIcon.js"),ButtonLabel=require("./ButtonLabel.js"),ButtonLoadingIndicator=require("./ButtonLoadingIndicator.js"),helpers=require("../common/helpers.js");const Button=e=>{let{children:s,advanced:t,className:a,nodePrice:l,customAttrs:r,styles:n={},setting:o={},builderProps:u,builderAttrs:c,wrapClassName:i="",onClick:y}=e,{iconSvg:m,btnLink:d,htmlType:g,loading:j,disabled:x,shouldClearSpace:p,enableBtnLink:B}=o,{enableTextStyle:C=!0}=n,h=core.useEditorMode(),I=core.usePageType(),{customCss:f,wrapStyle:b,restStyle:L,dataState:q,dataIdAttr:S,isShowIcon:R,isScrollToElement:k,getArialLabel:v,getLabelToDisplay:T,checkIsShowLabel:N,checkIsEditableLabel:M}=helpers.getData(e),{HTMLTag:_,urlData:H,shouldRenderLink:W}=helpers.getInsertLinkData({enableBtnLink:B,htmlType:g,setting:d,defaultTag:"button",pageType:I}),A=system.createStyle({...styles.getButtonStyles(n,o.enableHoverEffect)}),D=system.createStyle({...styles.getTypoStyles(n)}),E=system.createStyle({...styles.getTypoStyles(n),...styles.getButtonIconStyles(n,o)}),P=system.createStyle({...styles.getButtonWrapperStyles(L,n)}),$=system.createClass({...classes.getButtonClasses({styles:n,className:a,shouldRenderLink:W,uid:u?.uid,advanced:t})}),O=system.createClass({...classes.getButtonIconClasses(T(),p,C)}),w=system.createClass({...classes.getButtonLabelClasses(n,M({mode:h}))}),z=system.createClass({...classes.getButtonWrapperClasses(i,a,t?.cssClass)}),F=system.createClass({...classes.getButtonContentWrapperClasses(o)}),G=system.createClass({...classes.getButtonContainerClasses()}),J=system.createAttr({...attrs.getButtonAttributes({disabled:x,dataState:q,dataId:S,arialLabel:v()})}),K=e=>{y?.(e),helpers$1.handleClickLink(d,h)};return jsxRuntime.jsx("div",{style:b,className:G,children:jsxRuntime.jsxs("div",{...c,style:P,className:z,children:[jsxRuntime.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:f}}),system.If(k,jsxRuntime.jsx("a",{className:"gp-trigger-button-link gp-hidden",href:H.href,target:H.target})),jsxRuntime.jsxs(_,{...J,...r,..."button"!==_&&{setting:H},style:A,className:$,onClick:K,children:[system.If(j,jsxRuntime.jsx(ButtonLoadingIndicator.default,{})),jsxRuntime.jsxs("div",{className:F,children:[system.If(R,jsxRuntime.jsx(ButtonIcon.default,{iconSvg:m??"",styles:E,classes:O})),system.If(C&&N(),jsxRuntime.jsx(ButtonLabel.default,{label:T(),styles:D,classes:w}))]}),system.If(!!l,l??"")]}),s]})})};exports.default=Button;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../../helpers.js"),ButtonIcon_liquid=require("./ButtonIcon.liquid.js"),ButtonLabel_liquid=require("./ButtonLabel.liquid.js"),ButtonLoadingIndicator_liquid=require("./ButtonLoadingIndicator.liquid.js"),helpers=require("../common/helpers.js");const Button=e=>{let{advanced:s,className:t,nodePrice:a,customAttrs:l,styles:r={},setting:i={},builderProps:o,wrapClassName:n=""}=e,{iconSvg:u,btnLink:c,htmlType:d,disabled:y,enableBtnLink:g,shouldClearSpace:p,disabledLoading:m=!0}=i,{enableTextStyle:$=!0}=r,{customCss:q,wrapStyle:f,restStyle:B,dataState:L,dataIdAttr:S,isShowIcon:b,isScrollToElement:I,getArialLabel:C,getLabelToDisplay:v,checkIsShowLabel:h,checkIsEditableLabel:j}=helpers.getData(e),{HTMLTag:_,urlData:k,shouldRenderLink:E}=helpers.getInsertLinkData({enableBtnLink:g,htmlType:d,setting:c,defaultTag:"button",isLiquid:!0}),T=system.createStyle({...styles.getButtonStyles(r,i?.enableHoverEffect)}),A=system.createStyle({...styles.getTypoStyles(r)}),D=system.createStyle({...styles.getTypoStyles(r),...styles.getButtonIconStyles(r,i)}),P=system.createStyle({...styles.getButtonWrapperStyles(B,r)}),x=system.createClass({...classes.getButtonClasses({styles:r,className:t,shouldRenderLink:E,uid:o?.uid})}),M=system.createClass({...classes.getButtonIconClasses(v({isLiquid:!0}),p,$)}),O=system.createClass({...classes.getButtonLabelClasses(r,j({isLiquid:!0}))}),W=system.createClass({...classes.getButtonWrapperClasses(n,t,s?.cssClass)}),G=system.createClass({...classes.getButtonContentWrapperClasses(i)}),H=system.createClass({...classes.getButtonContainerClasses()}),R=system.createAttr({...attrs.getButtonAttributes({disabled:y,dataState:L,dataId:S,arialLabel:C({isLiquid:!0})})}),N=system.createStateOrContext({btnLink:i?.btnLink});return system.Liquid(core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../../helpers.js"),ButtonIcon_liquid=require("./ButtonIcon.liquid.js"),ButtonLabel_liquid=require("./ButtonLabel.liquid.js"),ButtonLoadingIndicator_liquid=require("./ButtonLoadingIndicator.liquid.js"),helpers=require("../common/helpers.js");const Button=e=>{let{advanced:s,className:t,nodePrice:a,customAttrs:l,styles:r={},setting:i={},builderProps:o,wrapClassName:n=""}=e,{iconSvg:u,btnLink:c,htmlType:d,disabled:y,enableBtnLink:g,shouldClearSpace:p,disabledLoading:m=!0}=i,{enableTextStyle:$=!0}=r,{customCss:q,wrapStyle:f,restStyle:B,dataState:L,dataIdAttr:S,isShowIcon:b,isScrollToElement:I,getArialLabel:C,getLabelToDisplay:v,checkIsShowLabel:h,checkIsEditableLabel:j}=helpers.getData(e),{HTMLTag:_,urlData:k,shouldRenderLink:E}=helpers.getInsertLinkData({enableBtnLink:g,htmlType:d,setting:c,defaultTag:"button",isLiquid:!0}),T=system.createStyle({...styles.getButtonStyles(r,i?.enableHoverEffect)}),A=system.createStyle({...styles.getTypoStyles(r)}),D=system.createStyle({...styles.getTypoStyles(r),...styles.getButtonIconStyles(r,i)}),P=system.createStyle({...styles.getButtonWrapperStyles(B,r)}),x=system.createClass({...classes.getButtonClasses({styles:r,className:t,shouldRenderLink:E,uid:o?.uid,advanced:s})}),M=system.createClass({...classes.getButtonIconClasses(v({isLiquid:!0}),p,$)}),O=system.createClass({...classes.getButtonLabelClasses(r,j({isLiquid:!0}))}),W=system.createClass({...classes.getButtonWrapperClasses(n,t,s?.cssClass)}),G=system.createClass({...classes.getButtonContentWrapperClasses(i)}),H=system.createClass({...classes.getButtonContainerClasses()}),R=system.createAttr({...attrs.getButtonAttributes({disabled:y,dataState:L,dataId:S,arialLabel:C({isLiquid:!0})})}),N=system.createStateOrContext({btnLink:i?.btnLink});return system.Liquid(core.template`
2
2
  <gp-button
3
3
  gp-data='${core.dataStringify(N)}'
4
4
  style="${{...f}}"
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core");const NoDataState=({title:e,description:t,elementType:r,builderAttrs:s,descriptionActions:n,primaryBtnTitle:i,secondaryBtnTitle:p,primaryBtnCb:l,secondaryBtnCb:c,additionalMedia:o,icon:a=!0,rawMode:d,children:g})=>{let u=React.useRef(null),x=core.useEditorMode(),[m,b]=React.useState("row"),f=()=>{let e=u.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},j=()=>{let e=u.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},h=()=>{if("edit"!==x)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:s?.["data-uid"]??s?.uid,value:!0,tag:s?.["data-component-tag"]??s?.tag}});window.dispatchEvent(e)},C={syncProduct:f,syncArticle:j};return React.useEffect(()=>{let e=new ResizeObserver(()=>{let e=u.current?u.current?.offsetWidth:0;b(e>272?"row":"column")});return u.current&&e.observe(u.current),()=>{e?.disconnect()}},[]),jsxRuntime.jsxs("div",{...s,ref:u,className:core.cls("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",d?"gp-p-0":"gp-p-2"),onClick:h,children:[jsxRuntime.jsxs("div",{className:core.cls("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===r?"gp-bg-[#FFF1DF]":"",d?"gp-justify-center":""),style:{flexDirection:m},children:[a&&!d&&jsxRuntime.jsx("div",{className:core.cls("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===r?"":"gp-bg-[#FDB913]"),children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===r?"#916A00":"#212121"})]})}),jsxRuntime.jsxs("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[e&&jsxRuntime.jsx("p",{className:core.cls("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:e}}),t&&jsxRuntime.jsxs("p",{className:core.cls(d?"gp-mb-0":"gp-mb-[4px]","primary"===r?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[t," ",n?.map((e,t)=>{let r=t?"or":"",s="string"==typeof e.callback?C?.[e.callback]:e.callback;return jsxRuntime.jsxs("span",{children:[" ",r," ",jsxRuntime.jsx("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:s,children:e.text})]},`description-action-${t}`)})]}),(i||p)&&jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[jsxRuntime.jsx("button",{onClick:l,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:i}),jsxRuntime.jsx("button",{onClick:c,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:p})]})]})]}),o&&jsxRuntime.jsx("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:o}}),core.filterToolbarPreview(g,!0)]})};exports.default=NoDataState;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core");const NoDataState=({title:e,description:t,elementType:r,builderAttrs:s,descriptionActions:n,primaryBtnTitle:i,secondaryBtnTitle:p,primaryBtnCb:l,secondaryBtnCb:c,additionalMedia:o,customClass:a,icon:d=!0,rawMode:g,children:u})=>{let x=React.useRef(null),m=core.useEditorMode(),[b,f]=React.useState("row"),j=()=>{let e=x.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},h=()=>{let e=x.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},C=()=>{if("edit"!==m)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:s?.["data-uid"]??s?.uid,value:!0,tag:s?.["data-component-tag"]??s?.tag}});window.dispatchEvent(e)},w={syncProduct:j,syncArticle:h};return React.useEffect(()=>{let e=new ResizeObserver(()=>{let e=x.current?x.current?.offsetWidth:0;f(e>272?"row":"column")});return x.current&&e.observe(x.current),()=>{e?.disconnect()}},[]),jsxRuntime.jsxs("div",{...s,ref:x,className:core.cls("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",g?"gp-p-0":"gp-p-2"),onClick:C,children:[jsxRuntime.jsxs("div",{className:core.cls("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===r?"gp-bg-[#FFF1DF]":"",g?"gp-justify-center":"",a||""),style:{flexDirection:b},children:[d&&!g&&jsxRuntime.jsx("div",{className:core.cls("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===r?"":"gp-bg-[#FDB913]"),children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===r?"#916A00":"#212121"})]})}),jsxRuntime.jsxs("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[e&&jsxRuntime.jsx("p",{className:core.cls("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:e}}),t&&jsxRuntime.jsxs("p",{className:core.cls(g?"gp-mb-0":"gp-mb-[4px]","primary"===r?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[t," ",n?.map((e,t)=>{let r=t?"or":"",s="string"==typeof e.callback?w?.[e.callback]:e.callback;return jsxRuntime.jsxs("span",{children:[" ",r," ",jsxRuntime.jsx("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:s,children:e.text})]},`description-action-${t}`)})]}),(i||p)&&jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[jsxRuntime.jsx("button",{onClick:l,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:i}),jsxRuntime.jsx("button",{onClick:c,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:p})]})]})]}),o&&jsxRuntime.jsx("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:o}}),core.filterToolbarPreview(u,!0)]})};exports.default=NoDataState;
@@ -1 +1 @@
1
- "use strict";var helpers=require("../../../common/helpers.js"),core=require("@gem-sdk/core");const composeClasses=e=>helpers.filterTruthy(e),composeContainerClasses=({setting:e,advanced:s,builderProps:o,type:l})=>{let{hideOnClient:r}=e??{};return composeClasses({[o?.uid]:!!o?.uid,"!gp-hidden":r&&"liquid"===l,[s?.cssClass]:!!s?.cssClass,"flex flex-col":!0})},composeInnerClasses=(e,s)=>{let{typography:o,size:l}=e??{},{uid:r}=s??{},t=core.composeTypographyClassName(e?.typo,o);return composeClasses({"gp-form-item":!0,[t]:!!t,[core.genSizeClass(l?.type)]:!!l?.type,"!gp-outline-none !gp-bg-none":!0,[`email-form-${r}`]:!0})},getClassTitle=()=>({"gp-text-16":!0,"gp-text-[#121212]":!0});exports.composeContainerClasses=composeContainerClasses,exports.composeInnerClasses=composeInnerClasses,exports.getClassTitle=getClassTitle;
1
+ "use strict";var helpers=require("../../../common/helpers.js"),core=require("@gem-sdk/core");const composeClasses=e=>helpers.filterTruthy(e),composeContainerClasses=({setting:e,advanced:s,builderProps:o,type:l})=>{let{hideOnClient:r}=e??{};return composeClasses({[o?.uid]:!!o?.uid,"!gp-hidden":r&&"liquid"===l,[s?.cssClass]:!!s?.cssClass,"flex flex-col":!0})},composeInnerClasses=(e,s)=>{let{typography:o,size:l,hideOnClient:r}=e??{},{uid:t}=s??{},p=core.composeTypographyClassName(e?.typo,o);return composeClasses({"gp-form-item":!0,[p]:!!p,[core.genSizeClass(l?.type)]:!!l?.type,"!gp-outline-none !gp-bg-none":!0,"gp-opacity-50":r,[`email-form-${t}`]:!0})},getClassTitle=()=>({"gp-text-16":!0,"gp-text-[#121212]":!0});exports.composeContainerClasses=composeContainerClasses,exports.composeInnerClasses=composeInnerClasses,exports.getClassTitle=getClassTitle;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const FormDropdownSettings=[{id:"setting",controls:[{id:"placeholder",type:"input",label:"Placeholder",default:"Choose your option"},{id:"placeholderColor",type:"color-picker-v2",label:"Color",default:"#A3A3A3"},{id:"defaultOption",type:"input",label:"Default option"},{id:"name",type:"input",label:"name",default:"contact[options]"},{id:"childItem",type:"child-item",label:"",default:["Option 1","Option 2","Option 3"],labelItem:"option",isEnableCountItem:!0,labelAddMore:"Add more"},{id:"translate",type:"input",default:"childItem"},{id:"required",type:"toggle",label:"Placeholder",default:!0},{id:"typo",type:"typography-v2",label:"Text styles",default:{type:"paragraph-1",attrs:{color:"text-1"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0,textShadow:!0}},{id:"textColor",type:"colorpicker",label:"Text color",default:"text-1"},{id:"size",label:"Field size",type:"size",default:{type:"medium"},ignoreReRender:!0},{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!0},tablet:{default:!0},mobile:{default:!0}}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"background",type:"background-media",ignoreReRender:!0,hideImage:!0,devices:{desktop:{default:{type:"color",color:"transparent"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD"}}}}]},{id:"style",controls:[{id:"globalSize",type:"size-setting",devices:{desktop:{default:{width:"100%",height:"Auto",padding:{type:"custom",top:"12px",bottom:"12px",left:"12px",right:"12px"}}}},settingConfig:{width:{displayOptions:["full","auto","small","large","medium"],sizeConfig:{small:"100px",medium:"116px",large:"132px"}},height:{displayOptions:["auto","small","large","medium"],sizeConfig:{small:"28px",medium:"36px",large:"44px"}}},hiddenSettings:["shape","gap"]},{id:"border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0},hover:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"}}}}},{id:"backgroundColorV2Active",type:"color-picker-v2",enableGradient:!0},{id:"borderActive",type:"border",emptyOnClear:!0,state:{active:!0}},{id:"roundedActive",type:"radius-preset",default:{active:{radiusType:"small"}},state:{active:!0}},{id:"boxShadowActive",type:"shadow-v2",label:"Button Shadow",hideOnState:{active:!0},default:{active:{type:"shadow-1",distance:"4px",blur:"12px",spread:"0px",color:"rgba(0, 0, 0, 0.20)",angle:90}},state:{active:!0}}]}];exports.default=FormDropdownSettings;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const FormDropdownSettings=[{id:"setting",controls:[{id:"placeholder",type:"input",label:"Placeholder",default:"Choose your option"},{id:"placeholderColor",type:"color-picker-v2",label:"Color",default:"#A3A3A3"},{id:"defaultOption",type:"input",label:"Default option"},{id:"name",type:"input",label:"name",default:"contact[options]"},{id:"childItem",type:"child-item",label:"",default:["Option 1","Option 2","Option 3"],labelItem:"option",isEnableCountItem:!0,labelAddMore:"Add more",childTemplate:{default:""}},{id:"translate",type:"input",default:"childItem"},{id:"required",type:"toggle",label:"Placeholder",default:!0},{id:"typo",type:"typography-v2",label:"Text styles",default:{type:"paragraph-1",attrs:{color:"text-1"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0,textShadow:!0}},{id:"textColor",type:"colorpicker",label:"Text color",default:"text-1"},{id:"size",label:"Field size",type:"size",default:{type:"medium"},ignoreReRender:!0},{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!0},tablet:{default:!0},mobile:{default:!0}}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"background",type:"background-media",ignoreReRender:!0,hideImage:!0,devices:{desktop:{default:{type:"color",color:"transparent"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD"}}}}]},{id:"style",controls:[{id:"globalSize",type:"size-setting",devices:{desktop:{default:{width:"100%",height:"Auto",padding:{type:"custom",top:"12px",bottom:"12px",left:"12px",right:"12px"}}}},settingConfig:{width:{displayOptions:["full","auto","small","large","medium"],sizeConfig:{small:"100px",medium:"116px",large:"132px"}},height:{displayOptions:["auto","small","large","medium"],sizeConfig:{small:"28px",medium:"36px",large:"44px"}}},hiddenSettings:["shape","gap"]},{id:"border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0},hover:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"}}}}},{id:"backgroundColorV2Active",type:"color-picker-v2",enableGradient:!0},{id:"borderActive",type:"border",emptyOnClear:!0,state:{active:!0}},{id:"roundedActive",type:"radius-preset",default:{active:{radiusType:"small"}},state:{active:!0}},{id:"boxShadowActive",type:"shadow-v2",label:"Button Shadow",hideOnState:{active:!0},default:{active:{type:"shadow-1",distance:"4px",blur:"12px",spread:"0px",color:"rgba(0, 0, 0, 0.20)",angle:90}},state:{active:!0}}]}];exports.default=FormDropdownSettings;
@@ -1 +1 @@
1
- "use strict";const SettingUIV2=[{messageConfig:{type:"info",message:"This element can only be used in the Contact Form to send data to Shopify"}},{label:{en:"Size"},controls:[{id:"Width",label:{en:"Width"},controlConfig:{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"width"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},layout:"horizontal"},{label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",inputType:"number",units:["px"],linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]}},{label:{en:"Padding"},controlConfig:{id:"height",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"}}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"normal"},options:{updateFields:[{field:"normal.enable",settingId:"hasBoxShadowBtn",state:"normal"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.normal.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!0}},{condition:"boxShadowBtn.normal.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Icon"},setting:{id:"iconVisible"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},setting:{id:"iconSvg"},conditionDisplay:"iconVisible == true"},{label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"iconVisible == true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"iconVisible == true"}]},{label:{en:"Text styles"},controls:[{layout:"vertical",setting:{id:"typo"},options:{hideLabel:!0,fullWidth:!0,updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Hover"},iconName:"polaris-check-hover",type:"combo",fixedValue:"Styled",setting:{id:"enableHoverEffect"},popoverLabel:{en:"Hover"},state:"hover",controls:[{type:"group",label:{en:"Background"},controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}}]},{type:"group",label:{en:"Text"},controls:[{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}}]},{type:"group",label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"hover"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"hover"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"hover"},options:{updateFields:[{field:"hover.enable",settingId:"hasBoxShadowBtn",state:"hover"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.hover.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!0}},{condition:"boxShadowBtn.hover.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!1}}],options:{noRecordHistory:!0}}}]}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];exports.SettingUIV2=SettingUIV2;
1
+ "use strict";const SettingUIV2=[{messageConfig:{type:"info",message:"This element can only be used in the Contact Form to send data to Shopify"}},{label:{en:"Size"},controls:[{id:"Width",label:{en:"Width"},controlConfig:{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"width"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},layout:"horizontal"},{label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",inputType:"number",units:["px"],linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]}},{label:{en:"Padding"},controlConfig:{id:"height",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"}}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"normal"},options:{updateFields:[{field:"normal.enable",settingId:"hasBoxShadowBtn",state:"normal"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.normal.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!0}},{condition:"boxShadowBtn.normal.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Icon"},setting:{id:"iconVisible"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},setting:{id:"iconSvg"},conditionDisplay:"iconVisible == true"},{label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"iconVisible == true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"iconVisible == true"}]},{label:{en:"Text styles"},controls:[{layout:"vertical",setting:{id:"typo"},options:{hideLabel:!0,fullWidth:!0,updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Hover"},iconName:"polaris-check-hover",type:"combo",fixedValue:"Styled",setting:{id:"enableHoverEffect"},popoverLabel:{en:"Hover"},state:"hover",controls:[{type:"group",label:{en:"Background"},controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}}]},{type:"group",label:{en:"Text"},controls:[{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}}]},{type:"group",label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"hover"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"hover"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"hover"},options:{updateFields:[{field:"hover.enable",settingId:"hasBoxShadowBtn",state:"hover"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.hover.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!0}},{condition:"boxShadowBtn.hover.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!1}}],options:{noRecordHistory:!0}}}]}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',setting:{id:"align"},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 core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let l={};return core.DEVICES.map(i=>{let n=core.getResponsiveValueByScreen(e,i),a=core.getResponsiveValueByScreen(t,i),s=core.getResponsiveValueByScreen(o,i);l={...l,[i]:1>=(n?.cols?.length||1)?a:s}}),l},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},l={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},i={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(l,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(l,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(l,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return i},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(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"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,l)=>{if(!e)return"";let i=getBgImage(e),n=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(i,t),t,l)})`,s=n?.color?`, ${n.color}`:"";return n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type==="image"?`${a}${s}`:n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type!=="image"?`${n.color}`:n?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let l={};return core.DEVICES.forEach(i=>{l={...l,[i]:getBgImageByScreen(e,i,t,o)}}),core.makeStyleResponsive("bgi",l)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(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}}},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]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let l=core.getAspectRatioGlobalSize(t),i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=core.getResponsiveValueByScreen(t,i),a=!!getDataVideoHeroBannerResponsive(i,e),s=n?.shape,r=n?.height,g="original"===s&&"fit-content"!==r,p=g&&a;p&&(l={...l,[i]:"16/9"}),o&&o[i]&&getDataVideoHeroBannerResponsive(i,e)?.data?.videoType==="html5"&&(l={...l,[i]:o[i]})}),core.makeStyleResponsive("aspect",l)},mapContentPositionToHorizontal=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},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,s=i?.height,r="original"===a&&"fit-content"!==s&&!n;o={...o,[l]:r?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let n=(o-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":i?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:i?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(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 n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:s,bbrr:r,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),c=calcRounderClipPath(parseInt(s??"0"),o,l),b=calcRounderClipPath(parseInt(r??"0"),l,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${d}px)`},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}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?i.desktop:n.desktop,s=1>=(l?.tablet?.cols?.length||1)?i.tablet:n.tablet,r=1>=(l?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===s,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===r}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(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}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=core.getResponsiveValueByScreen(e,o);t={...t,[o]:l}}),core.cls("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}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,s=i?.height,r="original"===a&&"fit-content"!==s;o={...o,[l]:r&&!n}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=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||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o,hoverEffect:l}=e??{},i=!t?.normal||o?.normal=="0%"||!o?.normal,n=!t?.hover||o?.hover=="0%"||!l||!o?.hover;return{disableOpacity:i,disableHoverOpacity:n}};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let l={};return core.DEVICES.map(i=>{let n=core.getResponsiveValueByScreen(e,i),a=core.getResponsiveValueByScreen(t,i),s=core.getResponsiveValueByScreen(o,i);l={...l,[i]:1>=(n?.cols?.length||1)?a:s}}),l},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},l={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},i={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(l,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(l,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(l,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return i},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(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"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,l)=>{if(!e)return"";let i=getBgImage(e),n=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(i,t),t,l)})`,s=n?.color?`, ${n.color}`:"";return n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type==="image"?`${a}${s}`:n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type!=="image"?`${n.color}`:n?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let l={};return core.DEVICES.forEach(i=>{l={...l,[i]:getBgImageByScreen(e,i,t,o)}}),core.makeStyleResponsive("bgi",l)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(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}}},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]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let l=core.getAspectRatioGlobalSize(t),i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=core.getResponsiveValueByScreen(t,i),a=!!getDataVideoHeroBannerResponsive(i,e),s=n?.shape,r=n?.height,g="original"===s&&"fit-content"!==r,p=g&&a;p&&(l={...l,[i]:"16/9"}),o&&o[i]&&getDataVideoHeroBannerResponsive(i,e)?.data?.videoType==="html5"&&(l={...l,[i]:o[i]})}),core.makeStyleResponsive("aspect",l)},mapContentPositionToHorizontal=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},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,s=i?.height,r="original"===a&&"fit-content"!==s&&!n;o={...o,[l]:r?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let n=(o-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":i?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:i?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(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 n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:s,bbrr:r,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),c=calcRounderClipPath(parseInt(s??"0"),o,l),b=calcRounderClipPath(parseInt(r??"0"),l,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${d}px)`},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}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?i.desktop:n.desktop,s=1>=(l?.tablet?.cols?.length||1)?i.tablet:n.tablet,r=1>=(l?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===s,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===r}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(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}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=core.getResponsiveValueByScreen(e,o);t={...t,[o]:l}}),core.cls("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}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,s=i?.height,r="original"===a&&"fit-content"!==s;o={...o,[l]:r&&!n}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=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||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o,hoverEffect:l}=e??{},i=!t?.normal||o?.normal=="0%"||!o?.normal,n=!l;return{disableOpacity:i,disableHoverOpacity:n}};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t,r)=>{let{sizeSetting:l,background:o}=e??{},{ratioOptions:i,aspectRatio:a}=t??{},s={...r,...helpers.getVisibilityStyle(r),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(l,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...helpers.getStyleAspectRatioHeroBannerCustom(o,l,helpers.getAspectRatioSettings(i,a)),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(l))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:r,background:l,borderBg:o,cornerBg:i,shadowBg:a,hasActiveShadow:s}=e??{},{ratioOptions:y,aspectRatio:g}=t??{},S={...helpers.getStyleAspectRatioHeroBannerCustom(l,r,helpers.getAspectRatioSettings(y,g)),...core.makeStyle({bs:o?.border??o?.border,bw:o?.width??o?.width,bc:core.getSingleColorVariable(o?.color)}),...core.getRadiusStyleActiveState({...i,active:{...i||{},radiusType:"custom"}}),...l?{...core.getStyleBgColor(l)}:{},...core.getStyleShadow({value:a,styleAppliedFor:"box-shadow",isEnableShadow:s})};return filterTruthyStyles(S)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r}=e??{},l=core.getGlobalColorStateStyle("bgc",t),o=core.makeStyleState("op",r),{disableOpacity:i,disableHoverOpacity:a}=helpers.opacityEnabledData(e);i&&(delete l?.["--bgc"],delete o?.["--op"]),a&&(delete l?.["--hvr-bgc"],delete o?.["--hvr-op"]);let s={...l,...o,"--top":"0","--left":"0"};return filterTruthyStyles(s)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...core.getResponsiveStylePadding(t)};return filterTruthyStyles(r)},getAdaptiveStyle=e=>{let{sizeSetting:t,background:r}=e??{},l={...helpers.getDisplayStyleByFitContent(t,r),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(t)),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(t,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(l)},getBackgroundStyle=(e,t,r)=>{let{hoverEffectScale:l,background:o,hoverEffectDuration:i}=e??{},a={...helpers.getStyleHeroBannerBg(helpers.getResponsiveSetting(o||{}),t),...core.getStyleBackgroundByDevice(o,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${i??0}s`,"--scale":helpers.formatHoverScale(l),...core.makeStyleResponsive("pos",helpers.getAttachmentDevice(o)),transform:r,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(a)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":helpers.getClipPath(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...core.makeStyleResponsive("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...core.makeStyleResponsive("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};exports.getAdaptiveStyle=getAdaptiveStyle,exports.getBackgroundStyle=getBackgroundStyle,exports.getContainBackgroundStyle=getContainBackgroundStyle,exports.getContainerStyle=getContainerStyle,exports.getHtml5VideoStyle=getHtml5VideoStyle,exports.getOverlayStyle=getOverlayStyle,exports.getRowStyle=getRowStyle,exports.getStyle=getStyle,exports.getYoutubeIframeStyle=getYoutubeIframeStyle;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t,r)=>{let{sizeSetting:l,background:o}=e??{},{ratioOptions:a,aspectRatio:i}=t??{},s={...r,...helpers.getVisibilityStyle(r),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(l,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...helpers.getStyleAspectRatioHeroBannerCustom(o,l,helpers.getAspectRatioSettings(a,i)),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(l))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:r,background:l,borderBg:o,cornerBg:a,shadowBg:i,hasActiveShadow:s}=e??{},{ratioOptions:y,aspectRatio:g}=t??{},S={...helpers.getStyleAspectRatioHeroBannerCustom(l,r,helpers.getAspectRatioSettings(y,g)),...core.makeStyle({bs:o?.border??o?.border,bw:o?.width??o?.width,bc:core.getSingleColorVariable(o?.color)}),...core.getRadiusStyleActiveState({...a,active:{...a||{},radiusType:"custom"}}),...l?{...core.getStyleBgColor(l)}:{},...core.getStyleShadow({value:i,styleAppliedFor:"box-shadow",isEnableShadow:s})};return filterTruthyStyles(S)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r}=e??{},l=core.makeStyleState("op",r),{disableOpacity:o,disableHoverOpacity:a}=helpers.opacityEnabledData(e),i=core.getGlobalColorStateStyle("bgc",{...t,hover:t?.hover||"transparent"});o&&(delete i?.["--bgc"],delete l?.["--op"]),a&&(delete i?.["--hvr-bgc"],delete l?.["--hvr-op"]);let s={...i,...l,"--top":"0","--left":"0"};return filterTruthyStyles(s)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...core.getResponsiveStylePadding(t)};return filterTruthyStyles(r)},getAdaptiveStyle=e=>{let{sizeSetting:t,background:r}=e??{},l={...helpers.getDisplayStyleByFitContent(t,r),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(t)),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(t,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(l)},getBackgroundStyle=(e,t,r)=>{let{hoverEffectScale:l,background:o,hoverEffectDuration:a}=e??{},i={...helpers.getStyleHeroBannerBg(helpers.getResponsiveSetting(o||{}),t),...core.getStyleBackgroundByDevice(o,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${parseInt(`${a}`)??0}s`,"--scale":helpers.formatHoverScale(l),...core.makeStyleResponsive("pos",helpers.getAttachmentDevice(o)),transform:r,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(i)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":helpers.getClipPath(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...core.makeStyleResponsive("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...core.makeStyleResponsive("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};exports.getAdaptiveStyle=getAdaptiveStyle,exports.getBackgroundStyle=getBackgroundStyle,exports.getContainBackgroundStyle=getContainBackgroundStyle,exports.getContainerStyle=getContainerStyle,exports.getHtml5VideoStyle=getHtml5VideoStyle,exports.getOverlayStyle=getOverlayStyle,exports.getRowStyle=getRowStyle,exports.getStyle=getStyle,exports.getYoutubeIframeStyle=getYoutubeIframeStyle;
@@ -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,hiddenShape:!0},valueIfNull:{width:"100%",height:"fit-content",hiddenShape:!0},groupType:"style",controlType:"size-setting"}},{condition:"!!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{hiddenShape:!1},valueIfNull:{hiddenShape:!1},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video" && background.videoType == "html5"',source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1,hiddenShape:!0},valueIfNull:{hiddenShape:!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:[{label:{en:"Video ratio"},setting:{id:"aspectRatio"},conditionDisplay:'background.type == "video" && background.videoType == "html5"'},{conditionDisplay:'aspectRatio === \'custom\' && background.type == "video" && background.videoType == "html5"',setting:{id:"ratioOptions"},label:{en:"Ratio"}},{setting:{id:"sizeSetting"},layout:"vertical"}]},{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 && hoverEffectScale == "100%"',source:["hoverEffect","hoverEffectScale"],action:{controlId:"hoverEffectScale",groupType:"style",controlType:"style",newValue:"120%"}}],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"},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,hiddenShape:!0},valueIfNull:{width:"100%",height:"fit-content",hiddenShape:!0},groupType:"style",controlType:"size-setting"}},{condition:"!!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{hiddenShape:!1},valueIfNull:{hiddenShape:!1},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video" && background.videoType == "html5"',source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1,hiddenShape:!0},valueIfNull:{hiddenShape:!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:[{label:{en:"Video ratio"},setting:{id:"aspectRatio"},conditionDisplay:'background.type == "video" && background.videoType == "html5"'},{conditionDisplay:'aspectRatio === \'custom\' && background.type == "video" && background.videoType == "html5"',setting:{id:"ratioOptions"},label:{en:"Ratio"}},{setting:{id:"sizeSetting"},layout:"vertical"}]},{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"},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,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGpDiscountTag=require("./hooks/useGpDiscountTag.js");const ProductTag=({setting:e,styles:s,builderProps:t,...i})=>{let{customContent:a}=e??{},l=i["bundle-item"],{textAlign:o}=s??{},{mode:r,product:n,salePrice:u,priceSave:d,currentProductId:c,unitCustomDisplay:x,shouldPlaceholderNoDiscount:m}=useGpDiscountTag.useGpDiscountTag({setting:e,styles:s,builderProps:t,...i});if(m)return jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:jsxRuntime.jsx(NoDataState.default,{builderAttrs:t?.builderData,elementType:"secondary",description:"No discount",rawMode:!0})});let p=system.createStyle(styles.getWrapperTextStyle(s)),y=system.createStyle(styles.getContainerStyle(s)),j=system.createClass(classes.getWrapperTextClass(s)),g=system.createClass(classes.getContainerClass()),f=system.createClass(classes.getRootClass({mode:r,salePrice:u,priceSave:d,bundleItem:l}));return jsxRuntime.jsx("div",{className:f,style:{...core.makeStyleResponsive("ta",o)},id:`shopify-text-element-${t?.uid}`,"data-id":t?.uid,"data-product-id":c,"gp-data-hidden":"false",children:system.If(!n," ",jsxRuntime.jsx("div",{className:g,style:y,children:jsxRuntime.jsx("div",{className:j,style:p,children:jsxRuntime.jsxs("div",{className:"gp-flex gp-break-all",children:[jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${t?.uid}-prefix`},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:x,options:{isCannotEditing:!0},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${t?.uid}-suffix`}}})]})})}))})};exports.default=ProductTag;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGpDiscountTag=require("./hooks/useGpDiscountTag.js");const ProductTag=({setting:e,styles:s,builderProps:t,...i})=>{let{customContent:a}=e??{},l=i["bundle-item"],{textAlign:o}=s??{},{mode:r,product:u,salePrice:n,priceSave:d,currentProductId:c,unitCustomDisplay:x,shouldPlaceholderNoDiscount:m}=useGpDiscountTag.useGpDiscountTag({setting:e,styles:s,builderProps:t,...i});if(m)return jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:jsxRuntime.jsx(NoDataState.default,{builderAttrs:t?.builderData,elementType:"secondary",description:"No discount",rawMode:!0,customClass:"!gp-p-[5px]"})});let p=system.createStyle(styles.getWrapperTextStyle(s)),y=system.createStyle(styles.getContainerStyle(s)),j=system.createClass(classes.getWrapperTextClass(s)),g=system.createClass(classes.getContainerClass()),f=system.createClass(classes.getRootClass({mode:r,salePrice:n,priceSave:d,bundleItem:l}));return jsxRuntime.jsx("div",{className:f,style:{...core.makeStyleResponsive("ta",o)},id:`shopify-text-element-${t?.uid}`,"data-id":t?.uid,"data-product-id":c,"gp-data-hidden":"false",children:system.If(!u," ",jsxRuntime.jsx("div",{className:g,style:y,children:jsxRuntime.jsx("div",{className:j,style:p,children:jsxRuntime.jsxs("div",{className:"gp-flex gp-break-all",children:[jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${t?.uid}-prefix`},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:x,options:{isCannotEditing:!0},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${t?.uid}-suffix`}}})]})})}))})};exports.default=ProductTag;
@@ -1 +1 @@
1
- import{getGlobalColorStateClass as t,composeTypographyClassName as e}from"@gem-sdk/core";let getButtonClasses=({uid:g,styles:n,className:p,shouldRenderLink:o})=>({...p&&{[p]:!0},...g&&{[g]:!0},"gp-text-center":o,"gp-max-w-full":n?.textOverFlow||!1,"gp-scale-[1.1]":n?.animation?.normal==="grow","gp-animate-bounce":n?.animation?.normal==="bounce","hover:gp-scale-[1.1]":n?.animation?.hover==="grow","hover:gp-animate-bounce":n?.animation?.hover==="bounce","gp-button-base gp-group gp-relative gp-inline-flex gp-max-w-full gp-items-center gp-justify-center gp-no-underline gp-transition-colors gp-duration-200 disabled:gp-btn-disabled disabled:gp-opacity-30":!0,[t("text",n?.textColor)]:!0,[e(n?.typo,n?.typography)]:!0}),getButtonWrapperClasses=(t,e,g)=>({[t]:!0,...e?.includes("gp-button-atc")&&g&&{[g]:!0}}),getButtonContentWrapperClasses=t=>({"gp-inline-flex":!0,"gp-flex-row-reverse":t?.iconAlign==="right"&&!!t?.label}),getButtonContainerClasses=()=>({"gp-flex gp-flex-col":!0}),getButtonLabelClasses=(t,e)=>({"gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line":!0,"[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]":t?.typo?.attrs?.italic,"gp-text button-text":e}),getButtonIconClasses=(t,e,g)=>({"!gp-m-0":e&&!t||!g,"gp-button-icon gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)]":!0});export{getButtonClasses,getButtonContainerClasses,getButtonContentWrapperClasses,getButtonIconClasses,getButtonLabelClasses,getButtonWrapperClasses};
1
+ import{getGlobalColorStateClass as t,composeTypographyClassName as e}from"@gem-sdk/core";let getButtonClasses=({uid:g,styles:n,className:p,shouldRenderLink:o,advanced:a})=>({...p&&{[p]:!0},...g&&{[g]:!0},"gp-text-center":o,"gp-max-w-full":n?.textOverFlow||!1,"gp-scale-[1.1]":n?.animation?.normal==="grow","gp-animate-bounce":n?.animation?.normal==="bounce","hover:gp-scale-[1.1]":n?.animation?.hover==="grow","hover:gp-animate-bounce":n?.animation?.hover==="bounce","gp-button-base gp-group gp-relative gp-inline-flex gp-max-w-full gp-items-center gp-justify-center gp-no-underline gp-transition-colors gp-duration-200 disabled:gp-btn-disabled disabled:gp-opacity-30":!0,[t("text",n?.textColor)]:!0,[e(n?.typo,n?.typography)]:!0,...p?.includes("gp-button-atc")&&a&&{[a?.cssClass]:!0}}),getButtonWrapperClasses=(t,e,g)=>({[t]:!0,...!e?.includes("gp-button-atc")&&g&&{[g]:!0}}),getButtonContentWrapperClasses=t=>({"gp-inline-flex":!0,"gp-flex-row-reverse":t?.iconAlign==="right"&&!!t?.label}),getButtonContainerClasses=()=>({"gp-flex gp-flex-col":!0}),getButtonLabelClasses=(t,e)=>({"gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line":!0,"[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]":t?.typo?.attrs?.italic,"gp-text button-text":e}),getButtonIconClasses=(t,e,g)=>({"!gp-m-0":e&&!t||!g,"gp-button-icon gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)]":!0});export{getButtonClasses,getButtonContainerClasses,getButtonContentWrapperClasses,getButtonIconClasses,getButtonLabelClasses,getButtonWrapperClasses};
@@ -1,7 +1,7 @@
1
- import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadius,makeGlobalSize,composeTypographyStyle,getColor,getStyleShadow,getStyleBackgroundImage,getGlobalColorStateStyle,makeStyleState,composeBorderCss,composeCornerCss,GRADIENT_BGR_KEY}from"@gem-sdk/core";let getButtonWrapperStyles=(e,t)=>({...e,...makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle,...getTypographyStyles(e).withoutTextColorStyles};return t?o:filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?makeStyleResponsive("mr",o):makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},a=o?.[t],n=r?.[t];if(!a&&!n)return"";let l=`url(${a?.image?.src})`,s=n?`, ${n}`:"";return n?.includes?.(GRADIENT_BGR_KEY)&&a?.image?.src?`${l}${s}`:n?.includes?.(GRADIENT_BGR_KEY)&&!a?.image?.src?n:a?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},a={...t,hover:t?.hover||t?.normal};return{...getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:a}),...getGlobalColorStateStyle("bg",a)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:a,roundedBtnV2:n}=e??{},l=ignoreStateNoneValue(a||{},'value?.border !== "none"'),s=ignoreStateNoneValue(n||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:s,builderAttrs:o,enableHoverEffect:r});return`
1
+ import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadius,makeGlobalSize,composeTypographyStyle,getColor,getStyleShadow,getStyleBackgroundImage,getGlobalColorStateStyle,makeStyleState,composeBorderCss,composeCornerCss,GRADIENT_BGR_KEY}from"@gem-sdk/core";let getButtonWrapperStyles=(e,t)=>({...e,...makeStyleResponsive("ta",t?.align)}),getButtonStyles=(e,t)=>{let o={...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle,...getTypographyStyles(e).withoutTextColorStyles};return t?o:filterHoverVariables(o)},getButtonIconStyles=(e,t)=>({...getIconSpacingStyle(e,t),"--height-desktop":`${e?.size?.desktop}`,"--height-tablet":`${e?.size?.desktop||e?.size?.tablet}`,"--height-mobile":`${e?.size?.mobile||e?.size?.tablet||e?.size?.desktop}`}),ignoreStateNoneValue=(obj,condition)=>Object.entries(obj).reduce((acc,[key,value])=>((!["hover","focus","normal","active"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.type !== undefined ");return{...getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},"value?.radiusType !== undefined");return composeRadius(t)},getIconSpacingStyle=(e,t)=>{let o=e?.iconSpacing||{desktop:"8px"};return t?.iconAlign==="left"?makeStyleResponsive("mr",o):makeStyleResponsive("ml",o)},getSizeStyles=e=>{let t=makeGlobalSize(e?.globalSize);return{...t.width,...t.height,...t.padding}},getTypographyStyles=e=>{let t=composeTypographyStyle(e?.typo,e?.typography),o={"--c":t?.["--c"]},r={...t};return delete r["--c"],{textColorStyle:{"--hvr-c":getColor(e?.textColor?.hover),...o},withoutTextColorStyles:r}},getTypoStyles=e=>({...getTypographyStyles(e).withoutTextColorStyles,...getStyleShadow({styleAppliedFor:"text-shadow",value:e?.typo?.custom?.textShadow,isEnableShadow:e?.typo?.custom?.hasShadowText}),"word-break":"break-word"}),getBgImageUrl=(e,t)=>{let{backgroundImage:o,backgroundColorV2:r}=e||{},a=o?.[t],n=r?.[t];if(!a&&!n)return"";let l=`url(${a?.image?.src})`,s=n?`, ${n}`:"";return n?.includes?.(GRADIENT_BGR_KEY)&&a?.image?.src?`${l}${s}`:n?.includes?.(GRADIENT_BGR_KEY)&&!a?.image?.src?n:a?.image?.src?l:""},getBackgroundImageSource=e=>{let t={normal:getBgImageUrl(e,"normal"),hover:getBgImageUrl(e,"hover")};return makeStyleState("bgi",t)},getBackgroundStyles=e=>{let{backgroundColorV2:t,backgroundImage:o}=e||{},r={...o,hover:o?.hover?.image?o?.hover:o?.normal},a={...t,hover:t?.hover||t?.normal};return{...getStyleBackgroundImage(r,{ignoreBackgroundImage:!0}),...getBackgroundImageSource({backgroundImage:r,backgroundColorV2:a}),...getGlobalColorStateStyle("bg",a)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o,enableHoverEffect:r})=>{if(!t)return"";let{borderBtnV2:a,roundedBtnV2:n}=e??{},l=ignoreStateNoneValue(a||{},"value?.border !== undefined"),s=ignoreStateNoneValue(n||{},"value?.radiusType !== undefined"),g=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:s,builderAttrs:o,enableHoverEffect:r});return`
2
2
  ${g.normalStyles}
3
3
  ${g.hoverStyles}
4
- `.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r,enableHoverEffect:a})=>{let n=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},s=l({styleObj:t,state:"normal"}),g=l({styleObj:a?t:void 0,state:"hover"}),i=l({styleObj:o,state:"normal"}),d=l({styleObj:o,state:"hover"}),u=`
4
+ `.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r,enableHoverEffect:a})=>{let n=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},s=l({styleObj:t,state:"normal"}),g=l({styleObj:a?t:void 0,state:"hover"}),d=l({styleObj:o,state:"normal"}),i=l({styleObj:o,state:"hover"}),u=`
5
5
  content: "";
6
6
  height: 100%;
7
7
  width: 100%;
@@ -10,7 +10,7 @@ import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadiu
10
10
  top: 0;
11
11
  left: 0;
12
12
  ${composeBorderCss(s)}
13
- ${composeCornerCss(i)}
13
+ ${composeCornerCss(d)}
14
14
  `,y=`
15
15
  [data-id="${e}"].gp-button-base::before, [data-id="${e}-interaction"].gp-button-base::before {
16
16
  ${u}
@@ -18,7 +18,7 @@ import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadiu
18
18
  `,S=`
19
19
  [data-id="${e}"]:hover::before, [data-id="${e}-interaction"]:hover::before {
20
20
  ${composeBorderCss(g)}
21
- ${composeCornerCss(d)}
21
+ ${composeCornerCss(i)}
22
22
  }
23
23
  `;if("ProductButton"===n){let t=r?.["data-is-in-stock"]??!1;y=`
24
24
  [data-is-in-stock="${t}"]>.${e}.gp-button-base::before {
@@ -27,6 +27,6 @@ import{makeStyleResponsive,filterHoverVariables,getStyleShadowState,composeRadiu
27
27
  `,S=`
28
28
  [data-is-in-stock="${t}"]>.${e}.gp-button-base:hover::before {
29
29
  ${composeBorderCss(g)}
30
- ${composeCornerCss(d)}
30
+ ${composeCornerCss(i)}
31
31
  }
32
32
  `}return{normalStyles:y,hoverStyles:S}};export{generateBorderCornerStyles,getButtonIconStyles,getButtonStyles,getButtonWrapperStyles,getCustomCssStyles,getRadiusStyles,getShadowStyles,getTypoStyles};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useEditorMode as s,usePageType as o}from"@gem-sdk/core";import{createStyle as r,createClass as m,createAttr as l,If as a}from"@gem-sdk/system";import{handleClickLink as i}from"../../helpers.js";import{getButtonAttributes as n}from"../common/attrs.js";import{getButtonStyles as c,getTypoStyles as d,getButtonIconStyles as f,getButtonWrapperStyles as p}from"../common/styles.js";import{getButtonClasses as g,getButtonIconClasses as u,getButtonLabelClasses as h,getButtonWrapperClasses as y,getButtonContentWrapperClasses as j,getButtonContainerClasses as b}from"../common/classes.js";import v from"./ButtonIcon.js";import B from"./ButtonLabel.js";import L from"./ButtonLoadingIndicator.js";import{getData as N,getInsertLinkData as k}from"../common/helpers.js";let Button=I=>{let{children:T,advanced:x,className:H,nodePrice:C,customAttrs:M,styles:S={},setting:_={},builderProps:E,builderAttrs:q,wrapClassName:w="",onClick:z}=I,{iconSvg:A,btnLink:D,htmlType:F,loading:G,disabled:J,shouldClearSpace:K,enableBtnLink:O}=_,{enableTextStyle:P=!0}=S,Q=s(),R=o(),{customCss:U,wrapStyle:V,restStyle:W,dataState:X,dataIdAttr:Y,isShowIcon:Z,isScrollToElement:$,getArialLabel:tt,getLabelToDisplay:te,checkIsShowLabel:ts,checkIsEditableLabel:to}=N(I),{HTMLTag:tr,urlData:tm,shouldRenderLink:tl}=k({enableBtnLink:O,htmlType:F,setting:D,defaultTag:"button",pageType:R}),ta=r({...c(S,_.enableHoverEffect)}),ti=r({...d(S)}),tn=r({...d(S),...f(S,_)}),tc=r({...p(W,S)}),td=m({...g({styles:S,className:H,shouldRenderLink:tl,uid:E?.uid})}),tf=m({...u(te(),K,P)}),tp=m({...h(S,to({mode:Q}))}),tg=m({...y(w,H,x?.cssClass)}),tu=m({...j(_)}),th=m({...b()}),ty=l({...n({disabled:J,dataState:X,dataId:Y,arialLabel:tt()})}),tj=t=>{z?.(t),i(D,Q)};return t("div",{style:V,className:th,children:e("div",{...q,style:tc,className:tg,children:[t("style",{type:"text/css",dangerouslySetInnerHTML:{__html:U}}),a($,t("a",{className:"gp-trigger-button-link gp-hidden",href:tm.href,target:tm.target})),e(tr,{...ty,...M,..."button"!==tr&&{setting:tm},style:ta,className:td,onClick:tj,children:[a(G,t(L,{})),e("div",{className:tu,children:[a(Z,t(v,{iconSvg:A??"",styles:tn,classes:tf})),a(P&&ts(),t(B,{label:te(),styles:ti,classes:tp}))]}),a(!!C,C??"")]}),T]})})};export{Button as default};
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useEditorMode as s,usePageType as o}from"@gem-sdk/core";import{createStyle as r,createClass as m,createAttr as l,If as a}from"@gem-sdk/system";import{handleClickLink as i}from"../../helpers.js";import{getButtonAttributes as n}from"../common/attrs.js";import{getButtonStyles as c,getTypoStyles as d,getButtonIconStyles as f,getButtonWrapperStyles as p}from"../common/styles.js";import{getButtonClasses as g,getButtonIconClasses as u,getButtonLabelClasses as h,getButtonWrapperClasses as y,getButtonContentWrapperClasses as j,getButtonContainerClasses as b}from"../common/classes.js";import v from"./ButtonIcon.js";import B from"./ButtonLabel.js";import L from"./ButtonLoadingIndicator.js";import{getData as N,getInsertLinkData as k}from"../common/helpers.js";let Button=I=>{let{children:T,advanced:x,className:H,nodePrice:C,customAttrs:M,styles:S={},setting:_={},builderProps:E,builderAttrs:q,wrapClassName:w="",onClick:z}=I,{iconSvg:A,btnLink:D,htmlType:F,loading:G,disabled:J,shouldClearSpace:K,enableBtnLink:O}=_,{enableTextStyle:P=!0}=S,Q=s(),R=o(),{customCss:U,wrapStyle:V,restStyle:W,dataState:X,dataIdAttr:Y,isShowIcon:Z,isScrollToElement:$,getArialLabel:tt,getLabelToDisplay:te,checkIsShowLabel:ts,checkIsEditableLabel:to}=N(I),{HTMLTag:tr,urlData:tm,shouldRenderLink:tl}=k({enableBtnLink:O,htmlType:F,setting:D,defaultTag:"button",pageType:R}),ta=r({...c(S,_.enableHoverEffect)}),ti=r({...d(S)}),tn=r({...d(S),...f(S,_)}),tc=r({...p(W,S)}),td=m({...g({styles:S,className:H,shouldRenderLink:tl,uid:E?.uid,advanced:x})}),tf=m({...u(te(),K,P)}),tp=m({...h(S,to({mode:Q}))}),tg=m({...y(w,H,x?.cssClass)}),tu=m({...j(_)}),th=m({...b()}),ty=l({...n({disabled:J,dataState:X,dataId:Y,arialLabel:tt()})}),tj=t=>{z?.(t),i(D,Q)};return t("div",{style:V,className:th,children:e("div",{...q,style:tc,className:tg,children:[t("style",{type:"text/css",dangerouslySetInnerHTML:{__html:U}}),a($,t("a",{className:"gp-trigger-button-link gp-hidden",href:tm.href,target:tm.target})),e(tr,{...ty,...M,..."button"!==tr&&{setting:tm},style:ta,className:td,onClick:tj,children:[a(G,t(L,{})),e("div",{className:tu,children:[a(Z,t(v,{iconSvg:A??"",styles:tn,classes:tf})),a(P&&ts(),t(B,{label:te(),styles:ti,classes:tp}))]}),a(!!C,C??"")]}),T]})})};export{Button as default};
@@ -1,4 +1,4 @@
1
- import{template as s,dataStringify as t,isLocalEnv as i,baseAssetURL as e}from"@gem-sdk/core";import{createStyle as o,createClass as r,createAttr as l,createStateOrContext as a,Liquid as d,If as m}from"@gem-sdk/system";import{getButtonAttributes as n}from"../common/attrs.js";import{getButtonStyles as p,getTypoStyles as c,getButtonIconStyles as u,getButtonWrapperStyles as $}from"../common/styles.js";import{getButtonClasses as f,getButtonIconClasses as g,getButtonLabelClasses as b,getButtonWrapperClasses as L,getButtonContentWrapperClasses as y,getButtonContainerClasses as j}from"../common/classes.js";import{getSettingPreloadData as v}from"../../helpers.js";import q from"./ButtonIcon.liquid.js";import k from"./ButtonLabel.liquid.js";import S from"./ButtonLoadingIndicator.liquid.js";import{getData as h,getInsertLinkData as B}from"../common/helpers.js";let Button=E=>{let{advanced:I,className:T,nodePrice:A,customAttrs:G,styles:H={},setting:M={},builderProps:_,wrapClassName:x=""}=E,{iconSvg:C,btnLink:N,htmlType:O,disabled:P,enableBtnLink:R,shouldClearSpace:V,disabledLoading:w=!0}=M,{enableTextStyle:z=!0}=H,{customCss:D,wrapStyle:F,restStyle:J,dataState:K,dataIdAttr:Q,isShowIcon:U,isScrollToElement:W,getArialLabel:X,getLabelToDisplay:Y,checkIsShowLabel:Z,checkIsEditableLabel:ss}=h(E),{HTMLTag:st,urlData:si,shouldRenderLink:se}=B({enableBtnLink:R,htmlType:O,setting:N,defaultTag:"button",isLiquid:!0}),so=o({...p(H,M?.enableHoverEffect)}),sr=o({...c(H)}),sl=o({...c(H),...u(H,M)}),sa=o({...$(J,H)}),sd=r({...f({styles:H,className:T,shouldRenderLink:se,uid:_?.uid})}),sm=r({...g(Y({isLiquid:!0}),V,z)}),sn=r({...b(H,ss({isLiquid:!0}))}),sp=r({...L(x,T,I?.cssClass)}),sc=r({...y(M)}),su=r({...j()}),s$=l({...n({disabled:P,dataState:K,dataId:Q,arialLabel:X({isLiquid:!0})})}),sf=a({btnLink:M?.btnLink});return d(s`
1
+ import{template as s,dataStringify as t,isLocalEnv as i,baseAssetURL as e}from"@gem-sdk/core";import{createStyle as o,createClass as r,createAttr as l,createStateOrContext as a,Liquid as d,If as m}from"@gem-sdk/system";import{getButtonAttributes as n}from"../common/attrs.js";import{getButtonStyles as p,getTypoStyles as c,getButtonIconStyles as u,getButtonWrapperStyles as $}from"../common/styles.js";import{getButtonClasses as f,getButtonIconClasses as g,getButtonLabelClasses as b,getButtonWrapperClasses as L,getButtonContentWrapperClasses as y,getButtonContainerClasses as j}from"../common/classes.js";import{getSettingPreloadData as v}from"../../helpers.js";import q from"./ButtonIcon.liquid.js";import k from"./ButtonLabel.liquid.js";import S from"./ButtonLoadingIndicator.liquid.js";import{getData as h,getInsertLinkData as B}from"../common/helpers.js";let Button=E=>{let{advanced:I,className:T,nodePrice:A,customAttrs:G,styles:H={},setting:M={},builderProps:_,wrapClassName:x=""}=E,{iconSvg:C,btnLink:N,htmlType:O,disabled:P,enableBtnLink:R,shouldClearSpace:V,disabledLoading:w=!0}=M,{enableTextStyle:z=!0}=H,{customCss:D,wrapStyle:F,restStyle:J,dataState:K,dataIdAttr:Q,isShowIcon:U,isScrollToElement:W,getArialLabel:X,getLabelToDisplay:Y,checkIsShowLabel:Z,checkIsEditableLabel:ss}=h(E),{HTMLTag:st,urlData:si,shouldRenderLink:se}=B({enableBtnLink:R,htmlType:O,setting:N,defaultTag:"button",isLiquid:!0}),so=o({...p(H,M?.enableHoverEffect)}),sr=o({...c(H)}),sl=o({...c(H),...u(H,M)}),sa=o({...$(J,H)}),sd=r({...f({styles:H,className:T,shouldRenderLink:se,uid:_?.uid,advanced:I})}),sm=r({...g(Y({isLiquid:!0}),V,z)}),sn=r({...b(H,ss({isLiquid:!0}))}),sp=r({...L(x,T,I?.cssClass)}),sc=r({...y(M)}),su=r({...j()}),s$=l({...n({disabled:P,dataState:K,dataId:Q,arialLabel:X({isLiquid:!0})})}),sf=a({btnLink:M?.btnLink});return d(s`
2
2
  <gp-button
3
3
  gp-data='${t(sf)}'
4
4
  style="${{...F}}"
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,useState as p,useEffect as n}from"react";import{useEditorMode as l,cls as i,filterToolbarPreview as g}from"@gem-sdk/core";let NoDataState=({title:a,description:d,elementType:o,builderAttrs:c,descriptionActions:s,primaryBtnTitle:u,secondaryBtnTitle:m,primaryBtnCb:b,secondaryBtnCb:f,additionalMedia:x,icon:h=!0,rawMode:C,children:w})=>{let v=r(null),y=l(),[N,k]=p("row"),A=()=>{let e=v.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},E=()=>{let e=v.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},L=()=>{if("edit"!==y)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:c?.["data-uid"]??c?.uid,value:!0,tag:c?.["data-component-tag"]??c?.tag}});window.dispatchEvent(e)},M={syncProduct:A,syncArticle:E};return n(()=>{let e=new ResizeObserver(()=>{let e=v.current?v.current?.offsetWidth:0;k(e>272?"row":"column")});return v.current&&e.observe(v.current),()=>{e?.disconnect()}},[]),e("div",{...c,ref:v,className:i("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",C?"gp-p-0":"gp-p-2"),onClick:L,children:[e("div",{className:i("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===o?"gp-bg-[#FFF1DF]":"",C?"gp-justify-center":""),style:{flexDirection:N},children:[h&&!C&&t("div",{className:i("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===o?"":"gp-bg-[#FDB913]"),children:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===o?"#916A00":"#212121"}),t("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===o?"#916A00":"#212121"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===o?"#916A00":"#212121"})]})}),e("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[a&&t("p",{className:i("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:a}}),d&&e("p",{className:i(C?"gp-mb-0":"gp-mb-[4px]","primary"===o?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[d," ",s?.map((r,p)=>{let n=p?"or":"",l="string"==typeof r.callback?M?.[r.callback]:r.callback;return e("span",{children:[" ",n," ",t("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:l,children:r.text})]},`description-action-${p}`)})]}),(u||m)&&e("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[t("button",{onClick:b,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:u}),t("button",{onClick:f,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:m})]})]})]}),x&&t("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:x}}),g(w,!0)]})};export{NoDataState as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,useState as p,useEffect as n}from"react";import{useEditorMode as l,cls as i,filterToolbarPreview as g}from"@gem-sdk/core";let NoDataState=({title:a,description:d,elementType:o,builderAttrs:c,descriptionActions:s,primaryBtnTitle:u,secondaryBtnTitle:m,primaryBtnCb:b,secondaryBtnCb:f,additionalMedia:x,customClass:h,icon:C=!0,rawMode:w,children:v})=>{let y=r(null),N=l(),[k,A]=p("row"),E=()=>{let e=y.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},L=()=>{let e=y.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},M=()=>{if("edit"!==N)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:c?.["data-uid"]??c?.uid,value:!0,tag:c?.["data-component-tag"]??c?.tag}});window.dispatchEvent(e)},D={syncProduct:E,syncArticle:L};return n(()=>{let e=new ResizeObserver(()=>{let e=y.current?y.current?.offsetWidth:0;A(e>272?"row":"column")});return y.current&&e.observe(y.current),()=>{e?.disconnect()}},[]),e("div",{...c,ref:y,className:i("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",w?"gp-p-0":"gp-p-2"),onClick:M,children:[e("div",{className:i("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===o?"gp-bg-[#FFF1DF]":"",w?"gp-justify-center":"",h||""),style:{flexDirection:k},children:[C&&!w&&t("div",{className:i("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===o?"":"gp-bg-[#FDB913]"),children:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===o?"#916A00":"#212121"}),t("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===o?"#916A00":"#212121"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===o?"#916A00":"#212121"})]})}),e("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[a&&t("p",{className:i("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:a}}),d&&e("p",{className:i(w?"gp-mb-0":"gp-mb-[4px]","primary"===o?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[d," ",s?.map((r,p)=>{let n=p?"or":"",l="string"==typeof r.callback?D?.[r.callback]:r.callback;return e("span",{children:[" ",n," ",t("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:l,children:r.text})]},`description-action-${p}`)})]}),(u||m)&&e("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[t("button",{onClick:b,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:u}),t("button",{onClick:f,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:m})]})]})]}),x&&t("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:x}}),g(v,!0)]})};export{NoDataState as default};
@@ -1 +1 @@
1
- import{filterTruthy as e}from"../../../common/helpers.js";import{composeTypographyClassName as s,genSizeClass as o}from"@gem-sdk/core";let composeClasses=s=>e(s),composeContainerClasses=({setting:e,advanced:s,builderProps:o,type:l})=>{let{hideOnClient:t}=e??{};return composeClasses({[o?.uid]:!!o?.uid,"!gp-hidden":t&&"liquid"===l,[s?.cssClass]:!!s?.cssClass,"flex flex-col":!0})},composeInnerClasses=(e,l)=>{let{typography:t,size:p}=e??{},{uid:m}=l??{},n=s(e?.typo,t);return composeClasses({"gp-form-item":!0,[n]:!!n,[o(p?.type)]:!!p?.type,"!gp-outline-none !gp-bg-none":!0,[`email-form-${m}`]:!0})},getClassTitle=()=>({"gp-text-16":!0,"gp-text-[#121212]":!0});export{composeContainerClasses,composeInnerClasses,getClassTitle};
1
+ import{filterTruthy as e}from"../../../common/helpers.js";import{composeTypographyClassName as s,genSizeClass as o}from"@gem-sdk/core";let composeClasses=s=>e(s),composeContainerClasses=({setting:e,advanced:s,builderProps:o,type:t})=>{let{hideOnClient:l}=e??{};return composeClasses({[o?.uid]:!!o?.uid,"!gp-hidden":l&&"liquid"===t,[s?.cssClass]:!!s?.cssClass,"flex flex-col":!0})},composeInnerClasses=(e,t)=>{let{typography:l,size:p,hideOnClient:m}=e??{},{uid:n}=t??{},r=s(e?.typo,l);return composeClasses({"gp-form-item":!0,[r]:!!r,[o(p?.type)]:!!p?.type,"!gp-outline-none !gp-bg-none":!0,"gp-opacity-50":m,[`email-form-${n}`]:!0})},getClassTitle=()=>({"gp-text-16":!0,"gp-text-[#121212]":!0});export{composeContainerClasses,composeInnerClasses,getClassTitle};
@@ -1 +1 @@
1
- let FormDropdownSettings=[{id:"setting",controls:[{id:"placeholder",type:"input",label:"Placeholder",default:"Choose your option"},{id:"placeholderColor",type:"color-picker-v2",label:"Color",default:"#A3A3A3"},{id:"defaultOption",type:"input",label:"Default option"},{id:"name",type:"input",label:"name",default:"contact[options]"},{id:"childItem",type:"child-item",label:"",default:["Option 1","Option 2","Option 3"],labelItem:"option",isEnableCountItem:!0,labelAddMore:"Add more"},{id:"translate",type:"input",default:"childItem"},{id:"required",type:"toggle",label:"Placeholder",default:!0},{id:"typo",type:"typography-v2",label:"Text styles",default:{type:"paragraph-1",attrs:{color:"text-1"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0,textShadow:!0}},{id:"textColor",type:"colorpicker",label:"Text color",default:"text-1"},{id:"size",label:"Field size",type:"size",default:{type:"medium"},ignoreReRender:!0},{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!0},tablet:{default:!0},mobile:{default:!0}}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"background",type:"background-media",ignoreReRender:!0,hideImage:!0,devices:{desktop:{default:{type:"color",color:"transparent"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD"}}}}]},{id:"style",controls:[{id:"globalSize",type:"size-setting",devices:{desktop:{default:{width:"100%",height:"Auto",padding:{type:"custom",top:"12px",bottom:"12px",left:"12px",right:"12px"}}}},settingConfig:{width:{displayOptions:["full","auto","small","large","medium"],sizeConfig:{small:"100px",medium:"116px",large:"132px"}},height:{displayOptions:["auto","small","large","medium"],sizeConfig:{small:"28px",medium:"36px",large:"44px"}}},hiddenSettings:["shape","gap"]},{id:"border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0},hover:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"}}}}},{id:"backgroundColorV2Active",type:"color-picker-v2",enableGradient:!0},{id:"borderActive",type:"border",emptyOnClear:!0,state:{active:!0}},{id:"roundedActive",type:"radius-preset",default:{active:{radiusType:"small"}},state:{active:!0}},{id:"boxShadowActive",type:"shadow-v2",label:"Button Shadow",hideOnState:{active:!0},default:{active:{type:"shadow-1",distance:"4px",blur:"12px",spread:"0px",color:"rgba(0, 0, 0, 0.20)",angle:90}},state:{active:!0}}]}];export{FormDropdownSettings as default};
1
+ let FormDropdownSettings=[{id:"setting",controls:[{id:"placeholder",type:"input",label:"Placeholder",default:"Choose your option"},{id:"placeholderColor",type:"color-picker-v2",label:"Color",default:"#A3A3A3"},{id:"defaultOption",type:"input",label:"Default option"},{id:"name",type:"input",label:"name",default:"contact[options]"},{id:"childItem",type:"child-item",label:"",default:["Option 1","Option 2","Option 3"],labelItem:"option",isEnableCountItem:!0,labelAddMore:"Add more",childTemplate:{default:""}},{id:"translate",type:"input",default:"childItem"},{id:"required",type:"toggle",label:"Placeholder",default:!0},{id:"typo",type:"typography-v2",label:"Text styles",default:{type:"paragraph-1",attrs:{color:"text-1"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0,textShadow:!0}},{id:"textColor",type:"colorpicker",label:"Text color",default:"text-1"},{id:"size",label:"Field size",type:"size",default:{type:"medium"},ignoreReRender:!0},{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!0},tablet:{default:!0},mobile:{default:!0}}},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"background",type:"background-media",ignoreReRender:!0,hideImage:!0,devices:{desktop:{default:{type:"color",color:"transparent"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD"}}}}]},{id:"style",controls:[{id:"globalSize",type:"size-setting",devices:{desktop:{default:{width:"100%",height:"Auto",padding:{type:"custom",top:"12px",bottom:"12px",left:"12px",right:"12px"}}}},settingConfig:{width:{displayOptions:["full","auto","small","large","medium"],sizeConfig:{small:"100px",medium:"116px",large:"132px"}},height:{displayOptions:["auto","small","large","medium"],sizeConfig:{small:"28px",medium:"36px",large:"44px"}}},hiddenSettings:["shape","gap"]},{id:"border",type:"border-v2",devices:{desktop:{default:{normal:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0},hover:{borderType:"none",border:"none",borderWidth:"1px",width:"1px 1px 1px 1px",color:"#121212",isCustom:!0}}}},compoDefaultValue:{desktop:{default:{normal:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#121212",width:"1px",borderWidth:"1px"}}}}},{id:"backgroundColorV2Active",type:"color-picker-v2",enableGradient:!0},{id:"borderActive",type:"border",emptyOnClear:!0,state:{active:!0}},{id:"roundedActive",type:"radius-preset",default:{active:{radiusType:"small"}},state:{active:!0}},{id:"boxShadowActive",type:"shadow-v2",label:"Button Shadow",hideOnState:{active:!0},default:{active:{type:"shadow-1",distance:"4px",blur:"12px",spread:"0px",color:"rgba(0, 0, 0, 0.20)",angle:90}},state:{active:!0}}]}];export{FormDropdownSettings as default};
@@ -1 +1 @@
1
- let SettingUIV2=[{messageConfig:{type:"info",message:"This element can only be used in the Contact Form to send data to Shopify"}},{label:{en:"Size"},controls:[{id:"Width",label:{en:"Width"},controlConfig:{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"width"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},layout:"horizontal"},{label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",inputType:"number",units:["px"],linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]}},{label:{en:"Padding"},controlConfig:{id:"height",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"}}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"normal"},options:{updateFields:[{field:"normal.enable",settingId:"hasBoxShadowBtn",state:"normal"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.normal.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!0}},{condition:"boxShadowBtn.normal.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Icon"},setting:{id:"iconVisible"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},setting:{id:"iconSvg"},conditionDisplay:"iconVisible == true"},{label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"iconVisible == true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"iconVisible == true"}]},{label:{en:"Text styles"},controls:[{layout:"vertical",setting:{id:"typo"},options:{hideLabel:!0,fullWidth:!0,updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Hover"},iconName:"polaris-check-hover",type:"combo",fixedValue:"Styled",setting:{id:"enableHoverEffect"},popoverLabel:{en:"Hover"},state:"hover",controls:[{type:"group",label:{en:"Background"},controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}}]},{type:"group",label:{en:"Text"},controls:[{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}}]},{type:"group",label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"hover"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"hover"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"hover"},options:{updateFields:[{field:"hover.enable",settingId:"hasBoxShadowBtn",state:"hover"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.hover.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!0}},{condition:"boxShadowBtn.hover.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!1}}],options:{noRecordHistory:!0}}}]}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Align is not supported when width is 100%"}}]}];export{SettingUIV2};
1
+ let SettingUIV2=[{messageConfig:{type:"info",message:"This element can only be used in the Contact Form to send data to Shopify"}},{label:{en:"Size"},controls:[{id:"Width",label:{en:"Width"},controlConfig:{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"width"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},layout:"horizontal"},{label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",inputType:"number",units:["px"],linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]}},{label:{en:"Padding"},controlConfig:{id:"height",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"}}}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"normal"},options:{updateFields:[{field:"normal.enable",settingId:"hasBoxShadowBtn",state:"normal"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.normal.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!0}},{condition:"boxShadowBtn.normal.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"normal",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:{en:"Icon"},setting:{id:"iconVisible"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},setting:{id:"iconSvg"},conditionDisplay:"iconVisible == true"},{label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"iconVisible == true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"iconVisible == true"}]},{label:{en:"Text styles"},controls:[{layout:"vertical",setting:{id:"typo"},options:{hideLabel:!0,fullWidth:!0,updateFields:[{field:"attrs.color",settingId:"textColor",state:"normal"}]},controlChangeTrigger:{settings:[{action:{controlId:"textColor",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Hover"},iconName:"polaris-check-hover",type:"combo",fixedValue:"Styled",setting:{id:"enableHoverEffect"},popoverLabel:{en:"Hover"},state:"hover",controls:[{type:"group",label:{en:"Background"},controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}}]},{type:"group",label:{en:"Text"},controls:[{label:{en:"Text color"},setting:{id:"textColor",state:"hover"}}]},{type:"group",label:{en:"Shape"},controls:[{label:{en:"Border"},setting:{id:"borderBtnV2",state:"hover"}},{label:{en:"Corner"},setting:{id:"roundedBtnV2",state:"hover"}},{label:{en:"Shadow"},setting:{id:"boxShadowBtn",state:"hover"},options:{updateFields:[{field:"hover.enable",settingId:"hasBoxShadowBtn",state:"hover"}]},controlChangeTrigger:{settings:[{condition:"boxShadowBtn.hover.enable === true",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!0}},{condition:"boxShadowBtn.hover.enable === false",source:["boxShadowBtn","hasBoxShadowBtn"],action:{controlId:"hasBoxShadowBtn",groupType:"style",controlType:"style",state:"hover",newValue:!1}}],options:{noRecordHistory:!0}}}]}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',setting:{id:"align"},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{getResponsiveValueByScreen as e,getAspectRatioGlobalSize as t,makeStyleResponsive as o,DEVICES as l,getValueByDevice as i,GRADIENT_BGR_KEY as n,cls as a}from"@gem-sdk/core";import{getImageSrc as r,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as g}from"../../constant.js";let getContentPosition=(t,o,i)=>{let n={};return l.map(l=>{let a=e(t,l),r=e(o,l),s=e(i,l);n={...n,[l]:1>=(a?.cols?.length||1)?r:s}}),n},getAspectRatioSettings=(t,o)=>{let l={desktop:t?.desktop?.width,tablet:t?.tablet?.width,mobile:t?.mobile?.width},i={desktop:t?.desktop?.height,tablet:t?.tablet?.height,mobile:t?.mobile?.height},n={desktop:o?.desktop==="custom"?`${e(l,"desktop")}/${e(i,"desktop")}`:o?.desktop==="cover"?"unset":o?.desktop,tablet:o?.tablet==="custom"?`${e(l,"tablet")}/${e(i,"tablet")}`:o?.tablet==="cover"?"unset":o?.tablet,mobile:o?.mobile==="custom"?`${e(l,"mobile")}/${e(i,"mobile")}`:o?.mobile==="cover"?"unset":o?.mobile};return n},getEnableBgImageByDevice=(t,o)=>{if(!e(getBgImage(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"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(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)}},getBgImageByScreen=(t,o,l,i)=>{if(!t)return"";let a=getBgImage(t),s=e(t,o),g=l?`url(${imagePlaceholder(t)[o]})`:`url(${r(e(a,o),o,i)})`,p=s?.color?`, ${s.color}`:"";return s?.color?.includes(n)&&s?.type==="image"?`${g}${p}`:s?.color?.includes(n)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?g:"url()"},getBackgroundImageHeroBanner=(e,t=!1,i=!1)=>{if(!e)return;let n={};return l.forEach(o=>{n={...n,[o]:getBgImageByScreen(e,o,t,i)}}),o("bgi",n)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(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}}},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]}),{}):{},getStyleAspectRatioHeroBannerCustom=(l,i,n)=>{let a=t(i),r=["desktop","mobile","tablet"];return r.forEach(t=>{let o=e(i,t),r=!!getDataVideoHeroBannerResponsive(t,l),s=o?.shape,g=o?.height,p="original"===s&&"fit-content"!==g,b=p&&r;b&&(a={...a,[t]:"16/9"}),n&&n[t]&&getDataVideoHeroBannerResponsive(t,l)?.data?.videoType==="html5"&&(a={...a,[t]:n[t]})}),o("aspect",a)},mapContentPositionToHorizontal=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},getDisplayStyleByFitContent=(t,l)=>{let i={desktop:"none",tablet:"none",mobile:"none"},n=["desktop","mobile","tablet"];return n.forEach(o=>{let n=e(t,o),a=!!getDataVideoHeroBannerResponsive(o,l),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s&&!a;i={...i,[o]:g?"block":"none"}}),o("d",i)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let n=(o-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:t?"150%":i?"100vh":"100%"}}),o("h",l)},getWidthHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:i?"100vw":"100%"}}),o("w",l)},getTopHeroBanner=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),o("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(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 n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),b=calcRounderClipPath(parseInt(r??"0"),o,l),c=calcRounderClipPath(parseInt(s??"0"),l,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${b}px ${c}px ${d}px)`},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}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?i.desktop:n.desktop,r=1>=(l?.tablet?.cols?.length||1)?i.tablet:n.tablet,s=1>=(l?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(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}},getClassForStretchContent=t=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=e(t,l);o={...o,[l]:i}}),a("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}`)},getClassForContentByFitContent=(t,o)=>{let l={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=e(t,i),a=!!getDataVideoHeroBannerResponsive(i,o),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s;l={...l,[i]:g&&!a}}),a(l.desktop?"!gp-absolute":"",l.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",l.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=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||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>l.some(t=>{let o=i(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:g,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o,hoverEffect:l}=e??{},i=!t?.normal||o?.normal=="0%"||!o?.normal,n=!t?.hover||o?.hover=="0%"||!l||!o?.hover;return{disableOpacity:i,disableHoverOpacity:n}};export{debounce,fallbackImg,formatHoverScale,getAspectRatioSettings,getAttachmentDevice,getBackgroundImageHeroBanner,getBannerLink,getBgImage,getClassAlignBanner,getClassContentPosition,getClassForContentByFitContent,getClassForStretchContent,getClassSpaceBetween,getClassSpaceBetweenLeftRight,getClipPath,getContentPosition,getDataVideoHeroBannerResponsive,getDisplayStyleByFitContent,getEnableBgImageByDevice,getPercentageVisible,getResponsiveSetting,getStyleAspectRatioHeroBannerCustom,getStyleHeroBannerBg,getVisibilityStyle,getWidth,horizontalAlign,imagePlaceholder,isScaleImage,mapContentPositionToHorizontal,opacityEnabledData,scrollToContentBanner,showVideoType};
1
+ import{getResponsiveValueByScreen as e,getAspectRatioGlobalSize as t,makeStyleResponsive as l,DEVICES as o,getValueByDevice as i,GRADIENT_BGR_KEY as n,cls as a}from"@gem-sdk/core";import{getImageSrc as r,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as g}from"../../constant.js";let getContentPosition=(t,l,i)=>{let n={};return o.map(o=>{let a=e(t,o),r=e(l,o),s=e(i,o);n={...n,[o]:1>=(a?.cols?.length||1)?r:s}}),n},getAspectRatioSettings=(t,l)=>{let o={desktop:t?.desktop?.width,tablet:t?.tablet?.width,mobile:t?.mobile?.width},i={desktop:t?.desktop?.height,tablet:t?.tablet?.height,mobile:t?.mobile?.height},n={desktop:l?.desktop==="custom"?`${e(o,"desktop")}/${e(i,"desktop")}`:l?.desktop==="cover"?"unset":l?.desktop,tablet:l?.tablet==="custom"?`${e(o,"tablet")}/${e(i,"tablet")}`:l?.tablet==="cover"?"unset":l?.tablet,mobile:l?.mobile==="custom"?`${e(o,"mobile")}/${e(i,"mobile")}`:l?.mobile==="cover"?"unset":l?.mobile};return n},getEnableBgImageByDevice=(t,l)=>{if(!e(getBgImage(l),t))return!1;if(!l?.[t]){if("mobile"===t)return l?.tablet?.type==="image"||l?.desktop?.type==="image"&&!l?.tablet;if("tablet"===t)return l?.desktop?.type==="image"}return l?.[t]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(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)}},getBgImageByScreen=(t,l,o,i)=>{if(!t)return"";let a=getBgImage(t),s=e(t,l),g=o?`url(${imagePlaceholder(t)[l]})`:`url(${r(e(a,l),l,i)})`,p=s?.color?`, ${s.color}`:"";return s?.color?.includes(n)&&s?.type==="image"?`${g}${p}`:s?.color?.includes(n)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?g:"url()"},getBackgroundImageHeroBanner=(e,t=!1,i=!1)=>{if(!e)return;let n={};return o.forEach(l=>{n={...n,[l]:getBgImageByScreen(e,l,t,i)}}),l("bgi",n)},getAttachmentDevice=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let o=e?.[l]?.attachment;t={...t,[l]:"fixed"===o?"fixed":"absolute"}}),t},horizontalAlign=(e,t,l)=>mapContentPositionToHorizontal(getContentPosition(e,t,l)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(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}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,l)=>({...t,[l]:e?.[l]!=="none"?"flex":e?.[l]}),{}):{},getStyleAspectRatioHeroBannerCustom=(o,i,n)=>{let a=t(i),r=["desktop","mobile","tablet"];return r.forEach(t=>{let l=e(i,t),r=!!getDataVideoHeroBannerResponsive(t,o),s=l?.shape,g=l?.height,p="original"===s&&"fit-content"!==g,b=p&&r;b&&(a={...a,[t]:"16/9"}),n&&n[t]&&getDataVideoHeroBannerResponsive(t,o)?.data?.videoType==="html5"&&(a={...a,[t]:n[t]})}),l("aspect",a)},mapContentPositionToHorizontal=e=>{let t={};for(let l in e)"top"===e[l]?t[l]="start":"bottom"===e[l]?t[l]="end":t[l]="center";return t},getDisplayStyleByFitContent=(t,o)=>{let i={desktop:"none",tablet:"none",mobile:"none"},n=["desktop","mobile","tablet"];return n.forEach(l=>{let n=e(t,l),a=!!getDataVideoHeroBannerResponsive(l,o),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s&&!a;i={...i,[l]:g?"block":"none"}}),l("d",i)},getWidth=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let o=e?.[l];o&&(t={...t,[l]:"default"===o?"var(--g-ct-w, 1200px)":o})}),t},getPercentageVisible=(e,t)=>{let{top:l,height:o}=e,i=-o;if(l<i)return 0;if(l>t)return 100;let n=(l-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":i?"100vh":"100%"}}),l("h",o)},getWidthHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:i?"100vw":"100%"}}),l("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(l=>{t={...t,[l]:e[l]?.attachment==="fixed"?"0px":""}}),l("top",t)},getStyleHeroBannerBg=(e,t)=>{let l=getHeightHeroBanner(e,t),o=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...l,...o,...i}},calcRounderClipPath=(e,t=0,l=0)=>{let o=t,i=t;if(t>l?o=l:i=l,e>=999){let t=e-o;return t>0?t:0}let n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[l,o,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),l,n),b=calcRounderClipPath(parseInt(r??"0"),l,o),c=calcRounderClipPath(parseInt(s??"0"),o,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${b}px ${c}px ${d}px)`},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}),getClassSpaceBetween=(e,t,l)=>{let o=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(l),a=1>=(o?.desktop?.cols?.length||1)?i.desktop:n.desktop,r=1>=(o?.tablet?.cols?.length||1)?i.tablet:n.tablet,s=1>=(o?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":o.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":o.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":o.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":o.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":o.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":o.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":o.mobile?.cols?.length===1&&"space-between"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":o.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":o.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":o.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),l=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",o=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":l,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":o,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},getClassForStretchContent=t=>{let l={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=e(t,o);l={...l,[o]:i}}),a("space-between"===l.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===l.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${t?.tablet}`,"space-between"===l.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${t?.mobile}`)},getClassForContentByFitContent=(t,l)=>{let o={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=e(t,i),a=!!getDataVideoHeroBannerResponsive(i,l),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s;o={...o,[i]:g&&!a}}),a(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},l=e.desktop||"center",o=e.tablet||l,i=e.mobile||o;return{[`gp-justify-${t[l||"center"]}`]:!!l,[`tablet:gp-justify-${t[o||"center"]}`]:!!o,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,l=e.tablet?e.tablet:t,o=e.mobile?e.mobile:l;return{desktop:t,tablet:l,mobile:o}},showVideoType=e=>o.some(t=>{let l=i(e,t);return l?.type!=="color"&&l?.type!=="image"&&!!l&&(l?.videoType==="html5"&&l?.videoHtml5||l?.videoType==="youtube"&&l?.video)});function debounce(e,t){let l;return function(...o){clearTimeout(l),l=setTimeout(()=>e.apply(this,o),t)}}let fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:g,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:l,hoverEffect:o}=e??{},i=!t?.normal||l?.normal=="0%"||!l?.normal,n=!o;return{disableOpacity:i,disableHoverOpacity:n}};export{debounce,fallbackImg,formatHoverScale,getAspectRatioSettings,getAttachmentDevice,getBackgroundImageHeroBanner,getBannerLink,getBgImage,getClassAlignBanner,getClassContentPosition,getClassForContentByFitContent,getClassForStretchContent,getClassSpaceBetween,getClassSpaceBetweenLeftRight,getClipPath,getContentPosition,getDataVideoHeroBannerResponsive,getDisplayStyleByFitContent,getEnableBgImageByDevice,getPercentageVisible,getResponsiveSetting,getStyleAspectRatioHeroBannerCustom,getStyleHeroBannerBg,getVisibilityStyle,getWidth,horizontalAlign,imagePlaceholder,isScaleImage,mapContentPositionToHorizontal,opacityEnabledData,scrollToContentBanner,showVideoType};
@@ -1 +1 @@
1
- import{makeStyleWithDefault as t,getWidthByShapeGlobalSize as e,makeStyleResponsive as r,getHeightByShapeGlobalSize as l,makeStyle as o,getSingleColorVariable as i,getRadiusStyleActiveState as y,getStyleBgColor as n,getStyleShadow as g,getGlobalColorStateStyle as u,makeStyleState as a,getResponsiveStylePadding as s,getStyleBackgroundByDevice as c}from"@gem-sdk/core";import{getVisibilityStyle as S,getStyleAspectRatioHeroBannerCustom as d,getAspectRatioSettings as h,getDisplayStyleByFitContent as p,getStyleHeroBannerBg as b,formatHoverScale as f,getAttachmentDevice as m,getClipPath as w,opacityEnabledData as T,getResponsiveSetting as v}from"./helpers.js";function filterTruthyStyles(t){return Object.fromEntries(Object.entries(t||{}).filter(([,t])=>!!t))}let getStyle=(o,i,y)=>{let{sizeSetting:n,background:g}=o??{},{ratioOptions:u,aspectRatio:a}=i??{},s={...y,...S(y),...t("w",e(n,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...d(g,n,h(u,a)),...r("h",l(n))};return filterTruthyStyles(s)},getContainerStyle=(t,e)=>{let{sizeSetting:r,background:l,borderBg:u,cornerBg:a,shadowBg:s,hasActiveShadow:c}=t??{},{ratioOptions:S,aspectRatio:p}=e??{},b={...d(l,r,h(S,p)),...o({bs:u?.border??u?.border,bw:u?.width??u?.width,bc:i(u?.color)}),...y({...a,active:{...a||{},radiusType:"custom"}}),...l?{...n(l)}:{},...g({value:s,styleAppliedFor:"box-shadow",isEnableShadow:c})};return filterTruthyStyles(b)},getOverlayStyle=t=>{let{overlayColor:e,overlayOpacity:r}=t??{},l=u("bgc",e),o=a("op",r),{disableOpacity:i,disableHoverOpacity:y}=T(t);i&&(delete l?.["--bgc"],delete o?.["--op"]),y&&(delete l?.["--hvr-bgc"],delete o?.["--hvr-op"]);let n={...l,...o,"--top":"0","--left":"0"};return filterTruthyStyles(n)},getRowStyle=t=>{let{contentPadding:e}=t??{},r={...s(e)};return filterTruthyStyles(r)},getAdaptiveStyle=o=>{let{sizeSetting:i,background:y}=o??{},n={...p(i,y),...r("h",l(i)),...t("w",e(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(n)},getBackgroundStyle=(t,e,l)=>{let{hoverEffectScale:o,background:i,hoverEffectDuration:y}=t??{},n={...b(v(i||{}),e),...c(i,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${y??0}s`,"--scale":f(o),...r("pos",m(i)),transform:l,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(n)},getContainBackgroundStyle=t=>{let{borderBg:e,cornerBg:r}=t??{},l={"clip-path":w(e?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=t=>{let e={...r("aspect",t)};return filterTruthyStyles(e)},getYoutubeIframeStyle=t=>{let e={...r("aspect",t),"pointer-event":"none"};return filterTruthyStyles(e)};export{getAdaptiveStyle,getBackgroundStyle,getContainBackgroundStyle,getContainerStyle,getHtml5VideoStyle,getOverlayStyle,getRowStyle,getStyle,getYoutubeIframeStyle};
1
+ import{makeStyleWithDefault as t,getWidthByShapeGlobalSize as e,makeStyleResponsive as r,getHeightByShapeGlobalSize as l,makeStyle as o,getSingleColorVariable as i,getRadiusStyleActiveState as n,getStyleBgColor as y,getStyleShadow as g,makeStyleState as a,getGlobalColorStateStyle as u,getResponsiveStylePadding as s,getStyleBackgroundByDevice as c}from"@gem-sdk/core";import{getVisibilityStyle as S,getStyleAspectRatioHeroBannerCustom as d,getAspectRatioSettings as h,getDisplayStyleByFitContent as p,getStyleHeroBannerBg as b,formatHoverScale as f,getAttachmentDevice as m,getClipPath as w,opacityEnabledData as v,getResponsiveSetting as T}from"./helpers.js";function filterTruthyStyles(t){return Object.fromEntries(Object.entries(t||{}).filter(([,t])=>!!t))}let getStyle=(o,i,n)=>{let{sizeSetting:y,background:g}=o??{},{ratioOptions:a,aspectRatio:u}=i??{},s={...n,...S(n),...t("w",e(y,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...d(g,y,h(a,u)),...r("h",l(y))};return filterTruthyStyles(s)},getContainerStyle=(t,e)=>{let{sizeSetting:r,background:l,borderBg:a,cornerBg:u,shadowBg:s,hasActiveShadow:c}=t??{},{ratioOptions:S,aspectRatio:p}=e??{},b={...d(l,r,h(S,p)),...o({bs:a?.border??a?.border,bw:a?.width??a?.width,bc:i(a?.color)}),...n({...u,active:{...u||{},radiusType:"custom"}}),...l?{...y(l)}:{},...g({value:s,styleAppliedFor:"box-shadow",isEnableShadow:c})};return filterTruthyStyles(b)},getOverlayStyle=t=>{let{overlayColor:e,overlayOpacity:r}=t??{},l=a("op",r),{disableOpacity:o,disableHoverOpacity:i}=v(t),n=u("bgc",{...e,hover:e?.hover||"transparent"});o&&(delete n?.["--bgc"],delete l?.["--op"]),i&&(delete n?.["--hvr-bgc"],delete l?.["--hvr-op"]);let y={...n,...l,"--top":"0","--left":"0"};return filterTruthyStyles(y)},getRowStyle=t=>{let{contentPadding:e}=t??{},r={...s(e)};return filterTruthyStyles(r)},getAdaptiveStyle=o=>{let{sizeSetting:i,background:n}=o??{},y={...p(i,n),...r("h",l(i)),...t("w",e(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(y)},getBackgroundStyle=(t,e,l)=>{let{hoverEffectScale:o,background:i,hoverEffectDuration:n}=t??{},y={...b(T(i||{}),e),...c(i,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${parseInt(`${n}`)??0}s`,"--scale":f(o),...r("pos",m(i)),transform:l,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(y)},getContainBackgroundStyle=t=>{let{borderBg:e,cornerBg:r}=t??{},l={"clip-path":w(e?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=t=>{let e={...r("aspect",t)};return filterTruthyStyles(e)},getYoutubeIframeStyle=t=>{let e={...r("aspect",t),"pointer-event":"none"};return filterTruthyStyles(e)};export{getAdaptiveStyle,getBackgroundStyle,getContainBackgroundStyle,getContainerStyle,getHtml5VideoStyle,getOverlayStyle,getRowStyle,getStyle,getYoutubeIframeStyle};
@@ -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,hiddenShape:!0},valueIfNull:{width:"100%",height:"fit-content",hiddenShape:!0},groupType:"style",controlType:"size-setting"}},{condition:"!!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{hiddenShape:!1},valueIfNull:{hiddenShape:!1},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video" && background.videoType == "html5"',source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1,hiddenShape:!0},valueIfNull:{hiddenShape:!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:[{label:{en:"Video ratio"},setting:{id:"aspectRatio"},conditionDisplay:'background.type == "video" && background.videoType == "html5"'},{conditionDisplay:'aspectRatio === \'custom\' && background.type == "video" && background.videoType == "html5"',setting:{id:"ratioOptions"},label:{en:"Ratio"}},{setting:{id:"sizeSetting"},layout:"vertical"}]},{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 && hoverEffectScale == "100%"',source:["hoverEffect","hoverEffectScale"],action:{controlId:"hoverEffectScale",groupType:"style",controlType:"style",newValue:"120%"}}],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"},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,hiddenShape:!0},valueIfNull:{width:"100%",height:"fit-content",hiddenShape:!0},groupType:"style",controlType:"size-setting"}},{condition:"!!background.image.src",source:["background"],action:{controlId:"sizeSetting",newValue:{hiddenShape:!1},valueIfNull:{hiddenShape:!1},groupType:"style",controlType:"size-setting"}},{condition:'background.type == "video" && background.videoType == "html5"',source:["background"],action:{controlId:"sizeSetting",newValue:{shapeLinked:!1,hiddenShape:!0},valueIfNull:{hiddenShape:!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:[{label:{en:"Video ratio"},setting:{id:"aspectRatio"},conditionDisplay:'background.type == "video" && background.videoType == "html5"'},{conditionDisplay:'aspectRatio === \'custom\' && background.type == "video" && background.videoType == "html5"',setting:{id:"ratioOptions"},label:{en:"Ratio"}},{setting:{id:"sizeSetting"},layout:"vertical"}]},{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"},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,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{makeStyleResponsive as o}from"@gem-sdk/core";import s from"../../../common/components/NoDataState.js";import i from"../../../common/components/TooltipHover.js";import l from"../../../text/components/Text.js";import{createStyle as r,createClass as d,If as n}from"@gem-sdk/system";import{getWrapperTextStyle as m,getContainerStyle as a}from"./common/styles.js";import{getWrapperTextClass as p,getContainerClass as c,getRootClass as u}from"./common/classes.js";import{useGpDiscountTag as x}from"./hooks/useGpDiscountTag.js";let ProductTag=({setting:f,styles:g,builderProps:y,...h})=>{let{customContent:b}=f??{},j=h["bundle-item"],{textAlign:N}=g??{},{mode:T,product:v,salePrice:k,priceSave:w,currentProductId:A,unitCustomDisplay:D,shouldPlaceholderNoDiscount:F}=x({setting:f,styles:g,builderProps:y,...h});if(F)return e(i,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:e(s,{builderAttrs:y?.builderData,elementType:"secondary",description:"No discount",rawMode:!0})});let S=r(m(g)),$=r(a(g)),q=d(p(g)),I=d(c()),P=d(u({mode:T,salePrice:k,priceSave:w,bundleItem:j}));return e("div",{className:P,style:{...o("ta",N)},id:`shopify-text-element-${y?.uid}`,"data-id":y?.uid,"data-product-id":A,"gp-data-hidden":"false",children:n(!v," ",e("div",{className:I,style:$,children:e("div",{className:q,style:S,children:t("div",{className:"gp-flex gp-break-all",children:[e(l,{styles:g,setting:{...f,text:b?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${y?.uid}-prefix`},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:D,options:{isCannotEditing:!0},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:b?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${y?.uid}-suffix`}}})]})})}))})};export{ProductTag as default};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{makeStyleResponsive as s}from"@gem-sdk/core";import o from"../../../common/components/NoDataState.js";import i from"../../../common/components/TooltipHover.js";import l from"../../../text/components/Text.js";import{createStyle as r,createClass as d,If as m}from"@gem-sdk/system";import{getWrapperTextStyle as n,getContainerStyle as a}from"./common/styles.js";import{getWrapperTextClass as p,getContainerClass as c,getRootClass as u}from"./common/classes.js";import{useGpDiscountTag as x}from"./hooks/useGpDiscountTag.js";let ProductTag=({setting:f,styles:g,builderProps:y,...h})=>{let{customContent:b}=f??{},j=h["bundle-item"],{textAlign:N}=g??{},{mode:T,product:v,salePrice:k,priceSave:w,currentProductId:A,unitCustomDisplay:D,shouldPlaceholderNoDiscount:F}=x({setting:f,styles:g,builderProps:y,...h});if(F)return e(i,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:e(o,{builderAttrs:y?.builderData,elementType:"secondary",description:"No discount",rawMode:!0,customClass:"!gp-p-[5px]"})});let S=r(n(g)),$=r(a(g)),q=d(p(g)),C=d(c()),I=d(u({mode:T,salePrice:k,priceSave:w,bundleItem:j}));return e("div",{className:I,style:{...s("ta",N)},id:`shopify-text-element-${y?.uid}`,"data-id":y?.uid,"data-product-id":A,"gp-data-hidden":"false",children:m(!v," ",e("div",{className:C,style:$,children:e("div",{className:q,style:S,children:t("div",{className:"gp-flex gp-break-all",children:[e(l,{styles:g,setting:{...f,text:b?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${y?.uid}-prefix`},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:D,options:{isCannotEditing:!0},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:b?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${y?.uid}-suffix`}}})]})})}))})};export{ProductTag as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.1058",
3
+ "version": "2.0.0-staging.1061",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@gem-sdk/core": "2.0.0-staging.1057",
29
- "@gem-sdk/styles": "2.0.0-staging.1037",
29
+ "@gem-sdk/styles": "2.0.0-staging.1059",
30
30
  "@gem-sdk/system": "2.0.0-staging.1037",
31
31
  "tsup": "^8.5.0",
32
32
  "@types/react-transition-group": "^4.4.12",