@gem-sdk/components 2.0.0-staging.766 → 2.0.0-staging.768
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.
- package/dist/cjs/button/common/styles.js +14 -8
- package/dist/cjs/product/components/product-button/PriceComponent.js +1 -1
- package/dist/cjs/product/components/product-button/PriceComponent.liquid.js +1 -1
- package/dist/cjs/product/components/product-button/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-button/common/styles.js +1 -1
- package/dist/cjs/product/components/product-price/common/helpers.js +1 -1
- package/dist/cjs/product/setting/product-button/configs/settings.js +2 -2
- package/dist/cjs/product/setting/product-button/configs/ui-v2.js +1 -1
- package/dist/cjs/text/common/styles.js +1 -1
- package/dist/esm/button/common/styles.js +10 -4
- package/dist/esm/product/components/product-button/PriceComponent.js +1 -1
- package/dist/esm/product/components/product-button/PriceComponent.liquid.js +1 -1
- package/dist/esm/product/components/product-button/common/helpers.js +1 -1
- package/dist/esm/product/components/product-button/common/styles.js +1 -1
- package/dist/esm/product/components/product-price/common/helpers.js +3 -3
- package/dist/esm/product/setting/product-button/configs/settings.js +2 -2
- package/dist/esm/product/setting/product-button/configs/ui-v2.js +1 -1
- package/dist/esm/text/common/styles.js +1 -1
- package/dist/types/index.d.ts +13 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../helpers.js");const getButtonWrapperStyles=(e,t)=>({...e,...core.makeStyleResponsive("ta",t?.align)}),getButtonStyles=e=>({...getSizeStyles(e),...getRadiusStyles(e),...getShadowStyles(e),...getBackgroundStyles(e),...getTypographyStyles(e).textColorStyle}),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"].includes(key)||eval(condition))&&(acc[key]=value),acc),{}),getShadowStyles=e=>{let{boxShadowBtn:t,hasBoxShadowBtn:o}=e||{},r=ignoreStateNoneValue(t||{},"value?.enable !== false");return{...core.getStyleShadowState(r,"box-shadow",o)}},getRadiusStyles=e=>{let t=ignoreStateNoneValue(e?.roundedBtnV2||{},'value?.radiusType !== "none"');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?.textColorHover?.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"}),getBackgroundStyles=e=>{let{backgroundImage:t,backgroundColorV2:o}=e||{},r={...t,...!o?.hover&&{hover:t?.hover||t?.normal}},s={...o,hover:o?.hover||o?.normal},l=Object.entries(s||{}).reduce((e,[t])=>((!r?.[t]||helpers.isEmptyObject(r?.[t]))&&s?.[t]&&(e[t]=s[t]),e),{});return{...core.getStyleBackgroundImage(r),...core.getGlobalColorStateStyle("bg",l),...core.getGradientBgrStyleForButton(l)}},getCustomCssStyles=({styles:e,uid:t,builderAttrs:o})=>{if(!t)return"";let{borderBtnV2:r,roundedBtnV2:s}=e??{},l=ignoreStateNoneValue(r||{},'value?.borderType !== "none"'),n=ignoreStateNoneValue(s||{},'value?.radiusType !== "none"'),a=generateBorderCornerStyles({uid:t,borderBtn:l,roundedBtn:n,builderAttrs:o});return`
|
|
2
2
|
${a.normalStyles}
|
|
3
3
|
${a.hoverStyles}
|
|
4
|
-
`.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r})=>{let s=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},n=l({styleObj:t,state:"normal"}),a=l({styleObj:t,state:"hover"}),y=l({styleObj:o,state:"normal"}),
|
|
4
|
+
`.trim()},generateBorderCornerStyles=({uid:e,borderBtn:t,roundedBtn:o,builderAttrs:r})=>{let s=r?.["data-component-tag"],l=({styleObj:e,state:t})=>{if(e)return e?.[t]},n=l({styleObj:t,state:"normal"}),a=l({styleObj:t,state:"hover"}),y=l({styleObj:o,state:"normal"}),g=l({styleObj:o,state:"hover"}),S=`
|
|
5
5
|
content: "";
|
|
6
6
|
height: 100%;
|
|
7
7
|
width: 100%;
|
|
@@ -13,14 +13,20 @@
|
|
|
13
13
|
${core.composeCornerCss(y)}
|
|
14
14
|
`,d=`
|
|
15
15
|
.${e}.gp-button-base::before {
|
|
16
|
-
${
|
|
16
|
+
${S}
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
`,i=`
|
|
19
|
+
.${e}:hover::before {
|
|
20
|
+
${core.composeBorderCss(a)}
|
|
21
|
+
${core.composeCornerCss(g)}
|
|
22
|
+
}
|
|
23
|
+
`;if("ProductButton"===s){let t=r?.["data-is-in-stock"]??!1;d=`
|
|
19
24
|
[data-is-in-stock="${t}"]>.${e}.gp-button-base::before {
|
|
20
|
-
${
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
${S}
|
|
26
|
+
}
|
|
27
|
+
`,i=`
|
|
28
|
+
[data-is-in-stock="${t}"]>.${e}.gp-button-base:hover::before {
|
|
23
29
|
${core.composeBorderCss(a)}
|
|
24
|
-
${core.composeCornerCss(
|
|
30
|
+
${core.composeCornerCss(g)}
|
|
25
31
|
}
|
|
26
|
-
|
|
32
|
+
`}return{normalStyles:d,hoverStyles:i}};exports.generateBorderCornerStyles=generateBorderCornerStyles,exports.getButtonIconStyles=getButtonIconStyles,exports.getButtonStyles=getButtonStyles,exports.getButtonWrapperStyles=getButtonWrapperStyles,exports.getCustomCssStyles=getCustomCssStyles,exports.getRadiusStyles=getRadiusStyles,exports.getShadowStyles=getShadowStyles,exports.getTypoStyles=getTypoStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),ProductPrice=require("../product-price/ProductPrice.js"),classes=require("./common/classes.js");const PriceComponent=({priceType:e,settings:s})=>{let{lineThrough:r,typo:t}=s,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),ProductPrice=require("../product-price/ProductPrice.js"),classes=require("./common/classes.js");const PriceComponent=({priceType:e,settings:s})=>{let{lineThrough:r,typo:t,opacityPrice:c}=s,u=system.createClass(classes.getProductPriceClasses());return jsxRuntime.jsx(ProductPrice.default,{setting:{priceType:e},styles:{typo:t,lineThrough:r,opacityPrice:c},classNames:u})};exports.default=PriceComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var system=require("@gem-sdk/system"),ProductPrice_liquid=require("../product-price/ProductPrice.liquid.js"),classes=require("./common/classes.js");const PriceComponent=({priceType:e,settings:s})=>{let{lineThrough:r,typo:t}=s,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var system=require("@gem-sdk/system"),ProductPrice_liquid=require("../product-price/ProductPrice.liquid.js"),classes=require("./common/classes.js");const PriceComponent=({priceType:e,settings:s})=>{let{lineThrough:r,typo:t,opacityPrice:c}=s,i=system.createClass(classes.getProductPriceClasses());return ProductPrice_liquid.ProductPrice({setting:{priceType:e},styles:{typo:t,lineThrough:r,opacityPrice:c},classNames:i})};exports.default=PriceComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var constants=require("./constants.js");const checkIconVisibility=e=>e?.enableIcon===!0,getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:removeColorFromTypo(e?.priceTypo)}),getRenderComparePriceSettings=e=>({lineThrough:!0,typo:removeColorFromTypo(e?.compareAtPriceTypo)}),getGPProductButtonState=(e,t)=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:t?.label?.replaceAll("'","'"),errorMessage:t?.errorMessage?.replaceAll("'","'"),successMessage:t?.successMessage?.replaceAll("'","'"),outOfStockLabel:t?.outOfStockLabel?.replaceAll("'","'"),customURL:{link:t?.customURL?.link?.replaceAll("'","'"),target:t?.customURL?.target}},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),renderSeparator=e=>{let t=e??"horizontal-line";return({dot:constants.SEPARATOR.DOT,"vertical-line":constants.SEPARATOR.VERTICAL_LINE,"horizontal-line":constants.SEPARATOR.HORIZONTAL_LINE})[t]??constants.SEPARATOR.HORIZONTAL_LINE},removeColorFromTypo=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);exports.checkIconVisibility=checkIconVisibility,exports.getGPProductButtonState=getGPProductButtonState,exports.getRenderComparePriceSettings=getRenderComparePriceSettings,exports.getRenderRegularPriceSettings=getRenderRegularPriceSettings,exports.renderSeparator=renderSeparator;
|
|
1
|
+
"use strict";var constants=require("./constants.js");const checkIconVisibility=e=>e?.enableIcon===!0,getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:removeColorFromTypo(e?.priceTypo)}),getRenderComparePriceSettings=e=>({lineThrough:!0,typo:removeColorFromTypo(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),getGPProductButtonState=(e,t)=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:t?.label?.replaceAll("'","'"),errorMessage:t?.errorMessage?.replaceAll("'","'"),successMessage:t?.successMessage?.replaceAll("'","'"),outOfStockLabel:t?.outOfStockLabel?.replaceAll("'","'"),customURL:{link:t?.customURL?.link?.replaceAll("'","'"),target:t?.customURL?.target}},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),renderSeparator=e=>{let t=e??"horizontal-line";return({dot:constants.SEPARATOR.DOT,"vertical-line":constants.SEPARATOR.VERTICAL_LINE,"horizontal-line":constants.SEPARATOR.HORIZONTAL_LINE})[t]??constants.SEPARATOR.HORIZONTAL_LINE},removeColorFromTypo=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);exports.checkIconVisibility=checkIconVisibility,exports.getGPProductButtonState=getGPProductButtonState,exports.getRenderComparePriceSettings=getRenderComparePriceSettings,exports.getRenderRegularPriceSettings=getRenderRegularPriceSettings,exports.renderSeparator=renderSeparator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getButtonStyle=(t,e)=>({...t,...core.makeStyleResponsive("ta",e?.align)}),getButtonBaseStyles=()=>({size:{desktop:"1em",tablet:"1em",mobile:"1em"}}),getAddToCartButtonStyles=t=>({...t,...getButtonBaseStyles(),enableTextStyle:!0}),getSoldOutButtonStyles=t=>{let{isCustomOutOfStock:e,oosBorder:o,oosShadow:l,oosRounded:r,oosBorderV2:a,oosShadowV2:n,oosTextColor:S,oosRoundedV2:s,oosBackground:y,oosTextColorV2:p,oosBackgroundV2:B,oosEnableShadow:g,...u}=t??{},d=
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getButtonStyle=(t,e)=>({...t,...core.makeStyleResponsive("ta",e?.align)}),getButtonBaseStyles=()=>({size:{desktop:"1em",tablet:"1em",mobile:"1em"}}),getAddToCartButtonStyles=t=>({...t,...getButtonBaseStyles(),enableTextStyle:!0}),getSoldOutButtonStyles=t=>{let{isCustomOutOfStock:e,oosBorder:o,oosShadow:l,oosRounded:r,oosBorderV2:a,oosShadowV2:n,oosTextColor:S,oosRoundedV2:s,oosBackground:y,oosTextColorV2:p,oosBackgroundV2:B,oosEnableShadow:g,...u}=t??{},d=JSON.parse(JSON.stringify(u));e&&Object.assign(d,{backgroundColor:{normal:y},textColor:{normal:S},borderBtn:o,hasBoxShadowBtn:{normal:g},boxShadowBtn:{normal:l},roundedBtn:{normal:r}});let m=(t,e,o)=>{o&&(t[e]={normal:o?.normal,hover:t[e]?.hover})};return m(d,"backgroundColorV2",B),m(d,"boxShadowBtn",{normal:l}),m(d,"hasBoxShadowBtn",{normal:g}),m(d,"roundedBtnV2",s),m(d,"borderBtnV2",a),p?.normal&&(d.typo=d.typo??{},d.typo.attrs=d.typo.attrs??{},d.typo.attrs.color=p.normal),{...getButtonBaseStyles(),...d}},getSplitStyle=t=>{let[e,o]=core.splitStyle(["pos","top","left","bottom","right","z"],t);return{wrapStyle:e,restStyle:o}},getSeparatorStyle=()=>({...core.makeStyle({mr:"8px",ml:"8px"})}),getBlankSpaceStyle=()=>({"--mr":"2px","--ml":"2px",display:"block !important"});exports.getAddToCartButtonStyles=getAddToCartButtonStyles,exports.getBlankSpaceStyle=getBlankSpaceStyle,exports.getButtonBaseStyles=getButtonBaseStyles,exports.getButtonStyle=getButtonStyle,exports.getSeparatorStyle=getSeparatorStyle,exports.getSoldOutButtonStyles=getSoldOutButtonStyles,exports.getSplitStyle=getSplitStyle;
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
{% if variant.price %}
|
|
9
9
|
{{ variant.price | ${n?.showPriceCurrency?"money_with_currency":"money"}}}
|
|
10
10
|
{% endif %}
|
|
11
|
-
`;return{id:`p-price-${i?.uid}`,styles:{...c,lineThrough:p&&c?.lineThrough,lineColor:{normal:c?.lineColor}},setting:{text:r??`${p?l():s()}`,excludeFlex:!0},className:core.cls("gp-price",{"gp-money":!p,"gp-product-compare-price":p},a,t)}};exports.getTextProps=getTextProps;
|
|
11
|
+
`;return{id:`p-price-${i?.uid}`,styles:{...c,lineThrough:p&&c?.lineThrough,lineColor:{normal:c?.lineColor},opacity:o?.opacityPrice},setting:{text:r??`${p?l():s()}`,excludeFlex:!0},className:core.cls("gp-price",{"gp-money":!p,"gp-product-compare-price":p},a,t)}};exports.getTextProps=getTextProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const ProductButtonSettings=[{id:"setting",controls:[{id:"buttonLayoutGroup",type:"group",controls:[{id:"buttonLayout",label:"Layout",type:"layout-selector",iconViewBox:"0 0 72 72",enableItemBackground:!0,itemSpacing:"large",itemPerRow:1,default:"cart-icon",options:[{value:"cart-full",iconName:"gp-product-button-cart-full-layout"},{value:"cart-price",iconName:"gp-product-button-cart-price-layout"},{value:"cart-only",iconName:"gp-product-button-cart-only-layout"},{value:"cart-price-icon",iconName:"gp-product-button-price-icon-layout"},{value:"cart-icon",iconName:"gp-product-button-cart-item-layout"}]},{id:"priceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0},{id:"compareAtPriceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0}]},{id:"priceLayout",type:"option:illustration",enableTooltip:!1,label:"Layout",options:[{value:"price-only",type:"image",svgName:"gp-product-button-price-only-layout"},{value:"price-before",type:"image",svgName:"gp-product-button-price-before-layout"},{value:"price-after",type:"image",svgName:"gp-product-button-price-after-layout"}],default:"price-only"},{id:"button-text-group",type:"group",label:"Product Button",controls:[{id:"label",type:"input",label:"Button Text",default:"Add to cart"},{id:"translate",type:"input",default:"label,outOfStockLabel,unavailableLabel,variantSelectionRequiredMessage"},{id:"outOfStockLabel",type:"input",label:"Out Of Stock Message",clearButton:!1,default:"Out of stock"},{id:"unavailableLabel",type:"input",label:"Unavailable",default:"Unavailable"},{id:"actionEffect",label:"After Add To Cart Action",type:"select",options:[{title:"Keep shopping",value:"continue-shopping"},{title:"Go to checkout",value:"buy-now"},{title:"Open cart",value:"open-cart-drawer"},{title:"Open URL",value:"go-to-url"}],default:"open-cart-drawer"},{id:"customURL",label:"Custom URL",type:"pick-link",default:{link:"/cart",target:"_self"},isHiddenOpenLinkSelect:!0,hide:!0},{id:"enableMessage",type:"toggle",default:!0},{id:"successMessage",type:"textarea",label:"Success",minHeight:58,default:"Add product to cart successfully",autoHeight:!0},{id:"errorMessage",type:"textarea",label:"Error",minHeight:58,default:"Cannot add product to cart",autoHeight:!0},{id:"variantSelectionRequiredMessage",type:"textarea",label:"Error Message",minHeight:78,default:"Please select a variant to add product to cart",autoHeight:!0}]},{id:"group-icon",type:"group",label:"Icon",controls:[{id:"iconSvg",label:"SVG icon",type:"icon",hide:!0,default:`<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508414779109605736">
|
|
1
|
+
"use strict";const ProductButtonSettings=[{id:"setting",controls:[{id:"buttonLayoutGroup",type:"group",controls:[{id:"buttonLayout",label:"Layout",type:"layout-selector",iconViewBox:"0 0 72 72",enableItemBackground:!0,itemSpacing:"large",itemPerRow:1,default:"cart-icon",options:[{value:"cart-full",iconName:"gp-product-button-cart-full-layout"},{value:"cart-price",iconName:"gp-product-button-cart-price-layout"},{value:"cart-only",iconName:"gp-product-button-cart-only-layout"},{value:"cart-price-icon",iconName:"gp-product-button-price-icon-layout"},{value:"cart-icon",iconName:"gp-product-button-cart-item-layout"}]},{id:"priceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0},{id:"compareAtPriceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0},{id:"opacityPrice",type:"input:slider",step:1,min:0,max:100,ignoreMax:!0,default:50}]},{id:"priceLayout",type:"option:illustration",enableTooltip:!1,label:"Layout",options:[{value:"price-only",type:"image",svgName:"gp-product-button-price-only-layout"},{value:"price-before",type:"image",svgName:"gp-product-button-price-before-layout"},{value:"price-after",type:"image",svgName:"gp-product-button-price-after-layout"}],default:"price-only"},{id:"button-text-group",type:"group",label:"Product Button",controls:[{id:"label",type:"input",label:"Button Text",default:"Add to cart"},{id:"translate",type:"input",default:"label,outOfStockLabel,unavailableLabel,variantSelectionRequiredMessage"},{id:"outOfStockLabel",type:"input",label:"Out Of Stock Message",clearButton:!1,default:"Out of stock"},{id:"unavailableLabel",type:"input",label:"Unavailable",default:"Unavailable"},{id:"actionEffect",label:"After Add To Cart Action",type:"select",options:[{title:"Keep shopping",value:"continue-shopping"},{title:"Go to checkout",value:"buy-now"},{title:"Open cart",value:"open-cart-drawer"},{title:"Open URL",value:"go-to-url"}],default:"open-cart-drawer"},{id:"customURL",label:"Custom URL",type:"pick-link",default:{link:"/cart",target:"_self"},isHiddenOpenLinkSelect:!0,hide:!0},{id:"enableMessage",type:"toggle",default:!0},{id:"successMessage",type:"textarea",label:"Success",minHeight:58,default:"Add product to cart successfully",autoHeight:!0},{id:"errorMessage",type:"textarea",label:"Error",minHeight:58,default:"Cannot add product to cart",autoHeight:!0},{id:"variantSelectionRequiredMessage",type:"textarea",label:"Error Message",minHeight:78,default:"Please select a variant to add product to cart",autoHeight:!0}]},{id:"group-icon",type:"group",label:"Icon",controls:[{id:"iconSvg",label:"SVG icon",type:"icon",hide:!0,default:`<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508414779109605736">
|
|
2
2
|
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M233.21,56.31A12,12,0,0,0,224,52H66L60.53,21.85A12,12,0,0,0,48.73,12H24a12,12,0,0,0,0,24H38.71L63.62,173a28,28,0,0,0,4.07,10.21A32,32,0,1,0,123,196h34a32,32,0,1,0,31-24H91.17a4,4,0,0,1-3.93-3.28L84.92,156H196.1a28,28,0,0,0,27.55-23l12.16-66.86A12,12,0,0,0,233.21,56.31ZM100,204a8,8,0,1,1-8-8A8,8,0,0,1,100,204Zm88,8a8,8,0,1,1,8-8A8,8,0,0,1,188,212Zm12-83.28A4,4,0,0,1,196.1,132H80.56L70.38,76H209.62Z"></path></svg>`,compoDefaultValue:`<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508414779109605736">
|
|
3
|
-
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M233.21,56.31A12,12,0,0,0,224,52H66L60.53,21.85A12,12,0,0,0,48.73,12H24a12,12,0,0,0,0,24H38.71L63.62,173a28,28,0,0,0,4.07,10.21A32,32,0,1,0,123,196h34a32,32,0,1,0,31-24H91.17a4,4,0,0,1-3.93-3.28L84.92,156H196.1a28,28,0,0,0,27.55-23l12.16-66.86A12,12,0,0,0,233.21,56.31ZM100,204a8,8,0,1,1-8-8A8,8,0,0,1,100,204Zm88,8a8,8,0,1,1,8-8A8,8,0,0,1,188,212Zm12-83.28A4,4,0,0,1,196.1,132H80.56L70.38,76H209.62Z"></path></svg>`},{id:"iconAlign",label:"Icon Alignment",type:"option:value",hide:!0,options:[{label:"Left",value:"left"},{label:"Right",value:"right"}],default:"left"}]},{id:"errorType",type:"option:value",options:[{value:"built-in",label:"Shopify",tooltip:"Show default error message from Shopify"},{value:"custom",label:"Custom",tooltip:"Customize error message"}],default:"built-in"},{id:"shouldClearSpace",label:"",type:"toggle",default:!1},{id:"separator",label:"Separator",type:"option:value",options:[{value:"horizontal-line",iconName:"gp-product-button-horizontal-line-separator"},{value:"dot",iconName:"gp-product-button-dot-separator"},{value:"vertical-line",iconName:"gp-product-button-vertical-line-separator"}],default:"horizontal-line"}]},{id:"style",controls:[{id:"iconSpacing",type:"input:slider",units:["px"],step:1,min:0,max:40,ignoreMax:!0,devices:{desktop:{default:"8px"}}},{id:"behavior-state",type:"behavior-state",controls:[{id:"backgroundColor",type:"colorpicker",label:"Background Color",default:{normal:"brand",hover:"highlight"},state:{hover:!0,normal:!0}},{id:"textColor",type:"colorpicker",label:"Text Color",default:{normal:"text-3"},state:{hover:!0,normal:!0}},{id:"borderBtn",type:"border",label:"Border Style",default:{normal:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"},hover:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"}},state:{hover:!0,normal:!0}},{id:"hasBoxShadowBtn",type:"toggle",label:"Enable Button Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"roundedBtn",type:"radius-preset",label:"Border Radius",default:{normal:{radiusType:"none"}},state:{hover:!0,normal:!0}}]},{id:"backgroundColorV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"boxShadowBtn",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:45,enable:!0}}},{id:"roundedBtnV2",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},hover:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}},compoDefaultValue:{normal:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"},hover:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"}}},{id:"borderBtnV2",type:"border-v2",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:{normal:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}},{id:"textColorHover",type:"color-picker-v2",default:{hover:"text-3"},compoDefaultValue:{hover:"text-3"}},{id:"oosBackgroundV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"oosTextColorV2",type:"color-picker-v2",default:{normal:"text-3"},compoDefaultValue:{normal:"text-3"}},{id:"oosBorderV2",type:"border-v2",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:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}},{id:"
|
|
3
|
+
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M233.21,56.31A12,12,0,0,0,224,52H66L60.53,21.85A12,12,0,0,0,48.73,12H24a12,12,0,0,0,0,24H38.71L63.62,173a28,28,0,0,0,4.07,10.21A32,32,0,1,0,123,196h34a32,32,0,1,0,31-24H91.17a4,4,0,0,1-3.93-3.28L84.92,156H196.1a28,28,0,0,0,27.55-23l12.16-66.86A12,12,0,0,0,233.21,56.31ZM100,204a8,8,0,1,1-8-8A8,8,0,0,1,100,204Zm88,8a8,8,0,1,1,8-8A8,8,0,0,1,188,212Zm12-83.28A4,4,0,0,1,196.1,132H80.56L70.38,76H209.62Z"></path></svg>`},{id:"iconAlign",label:"Icon Alignment",type:"option:value",hide:!0,options:[{label:"Left",value:"left"},{label:"Right",value:"right"}],default:"left"}]},{id:"errorType",type:"option:value",options:[{value:"built-in",label:"Shopify",tooltip:"Show default error message from Shopify"},{value:"custom",label:"Custom",tooltip:"Customize error message"}],default:"built-in"},{id:"shouldClearSpace",label:"",type:"toggle",default:!1},{id:"separator",label:"Separator",type:"option:value",options:[{value:"horizontal-line",iconName:"gp-product-button-horizontal-line-separator"},{value:"dot",iconName:"gp-product-button-dot-separator"},{value:"vertical-line",iconName:"gp-product-button-vertical-line-separator"}],default:"horizontal-line"}]},{id:"style",controls:[{id:"iconSpacing",type:"input:slider",units:["px"],step:1,min:0,max:40,ignoreMax:!0,devices:{desktop:{default:"8px"}}},{id:"behavior-state",type:"behavior-state",controls:[{id:"backgroundColor",type:"colorpicker",label:"Background Color",default:{normal:"brand",hover:"highlight"},state:{hover:!0,normal:!0}},{id:"textColor",type:"colorpicker",label:"Text Color",default:{normal:"text-3"},state:{hover:!0,normal:!0}},{id:"borderBtn",type:"border",label:"Border Style",default:{normal:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"},hover:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"}},state:{hover:!0,normal:!0}},{id:"hasBoxShadowBtn",type:"toggle",label:"Enable Button Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"roundedBtn",type:"radius-preset",label:"Border Radius",default:{normal:{radiusType:"none"}},state:{hover:!0,normal:!0}}]},{id:"backgroundColorV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"boxShadowBtn",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:45,enable:!0}}},{id:"roundedBtnV2",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},hover:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}},compoDefaultValue:{normal:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"},hover:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"}}},{id:"borderBtnV2",type:"border-v2",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:{normal:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}},{id:"textColorHover",type:"color-picker-v2",default:{hover:"text-3"},compoDefaultValue:{hover:"text-3"}},{id:"oosBackgroundV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"oosTextColorV2",type:"color-picker-v2",default:{normal:"text-3"},compoDefaultValue:{normal:"text-3"}},{id:"oosBorderV2",type:"border-v2",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:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}},{id:"oosEnableShadow",type:"toggle",label:"Enable Button Shadow",default:!1,hide:!0},{id:"oosShadow",type:"shadow-v2",compoDefaultValue:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:45,enable:!0}},{id:"oosRoundedV2",label:"Border Radius",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},hover:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}},compoDefaultValue:{normal:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"},hover:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"}}},{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:"typo",type:"typography-v2",label:"Typography",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{textAlign:!0},ignoreReRender:!0},{id:"enableIcon",type:"toggle",default:!0},{id:"enablePrice",type:"toggle",default:!1},{id:"enableSeparator",type:"toggle",default:!1},{id:"transform",label:"Text Transform",type:"select",options:[{value:"default",title:"None"},{value:"capitalize",title:"Capitalize"},{value:"uppercase",title:"Uppercase"},{value:"lowercase",title:"Lowercase"}],default:"default"},{id:"button-dimensions",type:"group",label:"Dimensions",controls:[{id:"btnSpacing",label:"Inside space",type:"size",default:{type:"medium"},ignoreReRender:!0},{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"width",type:"input:unit",label:"Width",emptyOnClear:!0,min:0,units:["px","%"],hide:!0,devices:{desktop:{default:"100%"}}}]},{id:"icon-dimensions",type:"group",label:"Icon Dimension",hide:!0,controls:[{id:"iconSizeAuto",type:"toggle",label:"Auto Size",default:!0},{id:"size",label:"Size Icon",type:"select",options:[{title:"Large",value:"1.2em"},{title:"medium",value:"1em"},{title:"Small",value:"0.8em"}],devices:{desktop:{default:"1em"}}},{id:"iconDimension",type:"input:slider",label:"Size",hide:!0,min:0,max:100,step:1,units:["px","em","rem"],devices:{desktop:{default:"24px"}}}]},{id:"success-group",type:"group",label:"Success Message",controls:[{id:"successTypo",type:"typography-v2",label:"Typography",default:{type:"paragraph-2",attrs:{color:"success"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0}},{id:"successColor",type:"colorpicker",label:"Text Color",default:"success"}]},{id:"error-group",type:"group",label:"Error Message",controls:[{id:"errorTypo",type:"typography-v2",label:"Typography",default:{type:"paragraph-2",attrs:{color:"error"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0}},{id:"errorColor",type:"colorpicker",label:"Text Color",default:"error"}]},{id:"outofstock-group",type:"group",label:"Out of Stock",controls:[{id:"isCustomOutOfStock",label:"Custom Style",type:"toggle",default:!1},{id:"oosBackground",type:"colorpicker",label:"Background Color",default:"brand",hide:!0},{id:"oosTextColor",type:"colorpicker",label:"Text Color",default:"text-3",hide:!0},{id:"oosIconColor",type:"colorpicker",label:"Text Color",default:"text-3",hide:!0},{id:"oosBorder",type:"border",label:"Border Style",default:{normal:{borderType:"none",border:"none",isCustom:!1,borderWidth:"1px",width:"1px 1px 1px 1px"}},hide:!0},{id:"oosRounded",type:"radius-preset",label:"Border Radius",default:{radiusType:"none"},hide:!0}]},{id:"globalSize",type:"size-setting",devices:{desktop:{default:{width:"100%",height:"Auto",padding:{type:"medium",top:"12px",bottom:"12px",left:"24px",right:"24px"}}}},settingConfig:{width:{displayOptions:["full","auto"]},height:{displayOptions:["auto"]}},hiddenSettings:["shape","gap"]}]}];exports.ProductButtonSettings=ProductButtonSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"buttonLayout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-before"}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}}],options:{noRecordHistory:!0}}}]},{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"},{id:"Height",label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",label:"height",inputType:"number",units:["px"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},controlConfig:{id:"padding",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"},compoDefaultValue:{desktop:{default:{type:"medium",top:"12px",bottom:"12px",left:"24px",right:"24px"}}}}}]},{label:{en:"Background"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},conditionDisplay:'pageType != "POST_PURCHASE"',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:"enableIcon"},options:{labelVariant:"primary",toggleStyle:"switch"}},{type:"control",setting:{id:"iconSvg"},label:{en:"Icon"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"enableIcon === true"}]},{label:{en:"Text"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Add to cart",getValueFromSettingID:"label",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"label"}}]},{setting:{id:"typo"},layout:"vertical"}]},{controls:[{label:{en:"Separator"},setting:{id:"enableSeparator"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},conditionDisplay:"enableSeparator === true",setting:{id:"separator"}}]},{controls:[{label:{en:"Price"},setting:{id:"enablePrice"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Layout"},conditionDisplay:"enablePrice === true",setting:{id:"priceLayout"},layout:"vertical"},{label:{en:"Product price"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Product price text style"},isHideClear:!0,controls:[{layout:"vertical",setting:{id:"priceTypo"}}]},{label:{en:"Compare-at"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Compare-at text style"},isHideClear:!0,controls:[{layout:"vertical",setting:{id:"compareAtPriceTypo"}}]}]},{label:{en:"Hover effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColorHover",state:"hover"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}},{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}}}]},{label:{en:"Out of stock state"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Out of stock",getValueFromSettingID:"outOfStockLabel",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"outOfStockLabel"}}]},{label:{en:"Background"},setting:{id:"oosBackgroundV2",state:"normal"}},{label:{en:"Text color"},setting:{id:"oosTextColorV2",state:"normal"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}}],moreSettings:{type:"collapse",controls:[{label:{en:"Border"},setting:{id:"oosBorderV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"oosRoundedV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"oosShadowV2",state:"normal"}}]}},{label:{en:"Redirect to"},controls:[{type:"control",label:{en:"After click"},setting:{id:"actionEffect"}},{type:"control",conditionDisplay:"actionEffect === 'go-to-url'",layout:"vertical",setting:{id:"customURL"}},{label:{en:"Message"},conditionDisplay:"actionEffect === 'continue-shopping'",setting:{id:"enableMessage"}},{label:{en:"Success"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",getValueFromSettingID:"successMessage",compoDefaultValue:"Add product to cart successfully",iconName:"polaris-check-circle",isHideClear:!0,popoverLabel:{en:"Success message"},controls:[{label:{en:"Content"},setting:{id:"successMessage"}},{layout:"vertical",setting:{id:"successTypo"}}]},{label:{en:"Error"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",fixedValue:"Edit",iconName:"polaris-alert-bubble",getValueFromSettingID:"errorMessage",compoDefaultValue:"Cannot add product to cart",isHideClear:!0,popoverLabel:{en:"Error message"},controls:[{label:{en:"Source"},setting:{id:"errorType"}},{label:{en:"Add failed"},conditionDisplay:"errorType === 'custom'",setting:{id:"errorMessage"}},{label:{en:"Not select variant"},conditionDisplay:"errorType === 'custom'",setting:{id:"variantSelectionRequiredMessage"}},{layout:"vertical",setting:{id:"errorTypo"}}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(globalSize.width === "default" || (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
|
+
"use strict";const SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"buttonLayout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-before"}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}}],options:{noRecordHistory:!0}}}]},{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"},{id:"Height",label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",label:"height",inputType:"number",units:["px"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},controlConfig:{id:"padding",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"},compoDefaultValue:{desktop:{default:{type:"medium",top:"12px",bottom:"12px",left:"24px",right:"24px"}}}}}]},{label:{en:"Background"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},conditionDisplay:'pageType != "POST_PURCHASE"',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:"enableIcon"},options:{labelVariant:"primary",toggleStyle:"switch"}},{type:"control",setting:{id:"iconSvg"},label:{en:"Icon"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"enableIcon === true"}]},{label:{en:"Text"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Add to cart",getValueFromSettingID:"label",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"label"}}]},{setting:{id:"typo"},layout:"vertical"}]},{controls:[{label:{en:"Separator"},setting:{id:"enableSeparator"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},conditionDisplay:"enableSeparator === true",setting:{id:"separator"}}]},{controls:[{label:{en:"Price"},setting:{id:"enablePrice"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Layout"},conditionDisplay:"enablePrice === true",setting:{id:"priceLayout"},layout:"vertical"},{label:{en:"Product price"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Product price text style"},isHideClear:!0,controls:[{layout:"vertical",setting:{id:"priceTypo"}}]},{label:{en:"Compare-at"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Compare-at text style"},isHideClear:!0,controls:[{setting:{id:"opacityPrice"},label:{en:"Opacity"}},{layout:"vertical",setting:{id:"compareAtPriceTypo"}}]}]},{label:{en:"Hover effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColorHover",state:"hover"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}},{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}}}]},{label:{en:"Out of stock state"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Out of stock",getValueFromSettingID:"outOfStockLabel",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"outOfStockLabel"}}]},{label:{en:"Background"},setting:{id:"oosBackgroundV2",state:"normal"}},{label:{en:"Text color"},setting:{id:"oosTextColorV2",state:"normal"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}}],moreSettings:{type:"collapse",controls:[{label:{en:"Border"},setting:{id:"oosBorderV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"oosRoundedV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"oosShadow"},options:{updateFields:[{field:"enable",settingId:"oosEnableShadow"}]},controlChangeTrigger:{settings:[{condition:"oosShadow.enable === true",source:["oosShadow","oosEnableShadow"],action:{controlId:"oosEnableShadow",groupType:"style",controlType:"style",newValue:!0}},{condition:"oosShadow.enable === false",source:["oosShadow","oosEnableShadow"],action:{controlId:"oosEnableShadow",groupType:"style",controlType:"style",newValue:!1}}],options:{noRecordHistory:!0}}}]}},{label:{en:"Redirect to"},controls:[{type:"control",label:{en:"After click"},setting:{id:"actionEffect"}},{type:"control",conditionDisplay:"actionEffect === 'go-to-url'",layout:"vertical",setting:{id:"customURL"}},{label:{en:"Message"},conditionDisplay:"actionEffect === 'continue-shopping'",setting:{id:"enableMessage"}},{label:{en:"Success"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",getValueFromSettingID:"successMessage",compoDefaultValue:"Add product to cart successfully",iconName:"polaris-check-circle",isHideClear:!0,popoverLabel:{en:"Success message"},controls:[{label:{en:"Content"},setting:{id:"successMessage"}},{layout:"vertical",setting:{id:"successTypo"}}]},{label:{en:"Error"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",fixedValue:"Edit",iconName:"polaris-alert-bubble",getValueFromSettingID:"errorMessage",compoDefaultValue:"Cannot add product to cart",isHideClear:!0,popoverLabel:{en:"Error message"},controls:[{label:{en:"Source"},setting:{id:"errorType"}},{label:{en:"Add failed"},conditionDisplay:"errorType === 'custom'",setting:{id:"errorMessage"}},{label:{en:"Not select variant"},conditionDisplay:"errorType === 'custom'",setting:{id:"variantSelectionRequiredMessage"}},{layout:"vertical",setting:{id:"errorTypo"}}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(globalSize.width === "default" || (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("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo),"word-break":"break-word",...core.getStyleBackgroundByDevice(t?.background),...o.padding,...core.getGradientBgrStyleByDevice(t?.background),overflow:"hidden"
|
|
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)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo),"word-break":"break-word",...core.getStyleBackgroundByDevice(t?.background),...o.padding,...core.getGradientBgrStyleByDevice(t?.background),overflow:"hidden",opacity:`${e?.opacityPrice}%`,...core.makeStyle({tdl:r.join(" ")})};return filterTruthyStyles(l)},getTextStyleInline=e=>{let t={...core.composeTypographyStyle(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};exports.getContainerStyle=getContainerStyle,exports.getStyle=getStyle,exports.getTextStyle=getTextStyle,exports.getTextStyleInline=getTextStyleInline;
|
|
@@ -15,12 +15,18 @@ import{makeStyleResponsive,getStyleShadowState,composeRadius,makeGlobalSize,comp
|
|
|
15
15
|
.${e}.gp-button-base::before {
|
|
16
16
|
${u}
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
`,y=`
|
|
19
|
+
.${e}:hover::before {
|
|
20
|
+
${composeBorderCss(a)}
|
|
21
|
+
${composeCornerCss(d)}
|
|
22
|
+
}
|
|
23
|
+
`;if("ProductButton"===l){let t=r?.["data-is-in-stock"]??!1;g=`
|
|
19
24
|
[data-is-in-stock="${t}"]>.${e}.gp-button-base::before {
|
|
20
25
|
${u}
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
}
|
|
27
|
+
`,y=`
|
|
28
|
+
[data-is-in-stock="${t}"]>.${e}.gp-button-base:hover::before {
|
|
23
29
|
${composeBorderCss(a)}
|
|
24
30
|
${composeCornerCss(d)}
|
|
25
31
|
}
|
|
26
|
-
|
|
32
|
+
`}return{normalStyles:g,hoverStyles:y}};export{generateBorderCornerStyles,getButtonIconStyles,getButtonStyles,getButtonWrapperStyles,getCustomCssStyles,getRadiusStyles,getShadowStyles,getTypoStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{createClass as r}from"@gem-sdk/system";import t from"../product-price/ProductPrice.js";import{getProductPriceClasses as o}from"./common/classes.js";let PriceComponent=({priceType:m,settings:s})=>{let{lineThrough:c,typo:i}=s,
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{createClass as r}from"@gem-sdk/system";import t from"../product-price/ProductPrice.js";import{getProductPriceClasses as o}from"./common/classes.js";let PriceComponent=({priceType:m,settings:s})=>{let{lineThrough:c,typo:i,opacityPrice:p}=s,n=r(o());return e(t,{setting:{priceType:m},styles:{typo:i,lineThrough:c,opacityPrice:p},classNames:n})};export{PriceComponent as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createClass as e}from"@gem-sdk/system";import{ProductPrice as t}from"../product-price/ProductPrice.liquid.js";import{getProductPriceClasses as o}from"./common/classes.js";let PriceComponent=({priceType:r,settings:s})=>{let{lineThrough:m,typo:i}=s,
|
|
1
|
+
import{createClass as e}from"@gem-sdk/system";import{ProductPrice as t}from"../product-price/ProductPrice.liquid.js";import{getProductPriceClasses as o}from"./common/classes.js";let PriceComponent=({priceType:r,settings:s})=>{let{lineThrough:m,typo:i,opacityPrice:c}=s,p=e(o());return t({setting:{priceType:r},styles:{typo:i,lineThrough:m,opacityPrice:c},classNames:p})};export{PriceComponent as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SEPARATOR as e}from"./constants.js";let checkIconVisibility=e=>e?.enableIcon===!0,getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:removeColorFromTypo(e?.priceTypo)}),getRenderComparePriceSettings=e=>({lineThrough:!0,typo:removeColorFromTypo(e?.compareAtPriceTypo)}),getGPProductButtonState=(e,r)=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:r?.errorType,actionEffect:r?.actionEffect,enableMessage:r?.enableMessage,label:r?.label?.replaceAll("'","'"),errorMessage:r?.errorMessage?.replaceAll("'","'"),successMessage:r?.successMessage?.replaceAll("'","'"),outOfStockLabel:r?.outOfStockLabel?.replaceAll("'","'"),customURL:{link:r?.customURL?.link?.replaceAll("'","'"),target:r?.customURL?.target}},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),renderSeparator=r=>{let t=r??"horizontal-line";return({dot:e.DOT,"vertical-line":e.VERTICAL_LINE,"horizontal-line":e.HORIZONTAL_LINE})[t]??e.HORIZONTAL_LINE},removeColorFromTypo=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);export{checkIconVisibility,getGPProductButtonState,getRenderComparePriceSettings,getRenderRegularPriceSettings,renderSeparator};
|
|
1
|
+
import{SEPARATOR as e}from"./constants.js";let checkIconVisibility=e=>e?.enableIcon===!0,getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:removeColorFromTypo(e?.priceTypo)}),getRenderComparePriceSettings=e=>({lineThrough:!0,typo:removeColorFromTypo(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),getGPProductButtonState=(e,r)=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:r?.errorType,actionEffect:r?.actionEffect,enableMessage:r?.enableMessage,label:r?.label?.replaceAll("'","'"),errorMessage:r?.errorMessage?.replaceAll("'","'"),successMessage:r?.successMessage?.replaceAll("'","'"),outOfStockLabel:r?.outOfStockLabel?.replaceAll("'","'"),customURL:{link:r?.customURL?.link?.replaceAll("'","'"),target:r?.customURL?.target}},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),renderSeparator=r=>{let t=r??"horizontal-line";return({dot:e.DOT,"vertical-line":e.VERTICAL_LINE,"horizontal-line":e.HORIZONTAL_LINE})[t]??e.HORIZONTAL_LINE},removeColorFromTypo=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);export{checkIconVisibility,getGPProductButtonState,getRenderComparePriceSettings,getRenderRegularPriceSettings,renderSeparator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitStyle as t,makeStyleResponsive as e,makeStyle as o}from"@gem-sdk/core";let getButtonStyle=(t,o)=>({...t,...e("ta",o?.align)}),getButtonBaseStyles=()=>({size:{desktop:"1em",tablet:"1em",mobile:"1em"}}),getAddToCartButtonStyles=t=>({...t,...getButtonBaseStyles(),enableTextStyle:!0}),getSoldOutButtonStyles=t=>{let{isCustomOutOfStock:e,oosBorder:o,oosShadow:l,oosRounded:r,oosBorderV2:a,oosShadowV2:n,oosTextColor:S,oosRoundedV2:
|
|
1
|
+
import{splitStyle as t,makeStyleResponsive as e,makeStyle as o}from"@gem-sdk/core";let getButtonStyle=(t,o)=>({...t,...e("ta",o?.align)}),getButtonBaseStyles=()=>({size:{desktop:"1em",tablet:"1em",mobile:"1em"}}),getAddToCartButtonStyles=t=>({...t,...getButtonBaseStyles(),enableTextStyle:!0}),getSoldOutButtonStyles=t=>{let{isCustomOutOfStock:e,oosBorder:o,oosShadow:l,oosRounded:r,oosBorderV2:a,oosShadowV2:n,oosTextColor:S,oosRoundedV2:s,oosBackground:B,oosTextColorV2:m,oosBackgroundV2:y,oosEnableShadow:g,...p}=t??{},d=JSON.parse(JSON.stringify(p));e&&Object.assign(d,{backgroundColor:{normal:B},textColor:{normal:S},borderBtn:o,hasBoxShadowBtn:{normal:g},boxShadowBtn:{normal:l},roundedBtn:{normal:r}});let u=(t,e,o)=>{o&&(t[e]={normal:o?.normal,hover:t[e]?.hover})};return u(d,"backgroundColorV2",y),u(d,"boxShadowBtn",{normal:l}),u(d,"hasBoxShadowBtn",{normal:g}),u(d,"roundedBtnV2",s),u(d,"borderBtnV2",a),m?.normal&&(d.typo=d.typo??{},d.typo.attrs=d.typo.attrs??{},d.typo.attrs.color=m.normal),{...getButtonBaseStyles(),...d}},getSplitStyle=e=>{let[o,l]=t(["pos","top","left","bottom","right","z"],e);return{wrapStyle:o,restStyle:l}},getSeparatorStyle=()=>({...o({mr:"8px",ml:"8px"})}),getBlankSpaceStyle=()=>({"--mr":"2px","--ml":"2px",display:"block !important"});export{getAddToCartButtonStyles,getBlankSpaceStyle,getButtonBaseStyles,getButtonStyle,getSeparatorStyle,getSoldOutButtonStyles,getSplitStyle};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{getGlobalColorClass as e,cls as r}from"@gem-sdk/core";let getTextProps=(i,o)=>{let{setting:c,styles:
|
|
1
|
+
import{getGlobalColorClass as e,cls as r}from"@gem-sdk/core";let getTextProps=(i,o)=>{let{setting:c,styles:t,builderProps:n,classNames:p,pageContext:a}=i,l=c?.priceType==="compare",m=e("decoration",t?.lineColor),y=()=>`
|
|
2
2
|
{% if variant.compare_at_price %}
|
|
3
3
|
{{ variant.compare_at_price | ${a?.showPriceCurrency?"money_with_currency":"money"}}}
|
|
4
4
|
{% else %}
|
|
5
5
|
|
|
6
6
|
{% endif %}
|
|
7
|
-
`,
|
|
7
|
+
`,s=()=>`
|
|
8
8
|
{% if variant.price %}
|
|
9
9
|
{{ variant.price | ${a?.showPriceCurrency?"money_with_currency":"money"}}}
|
|
10
10
|
{% endif %}
|
|
11
|
-
`;return{id:`p-price-${
|
|
11
|
+
`;return{id:`p-price-${n?.uid}`,styles:{...t,lineThrough:l&&t?.lineThrough,lineColor:{normal:t?.lineColor},opacity:c?.opacityPrice},setting:{text:o??`${l?y():s()}`,excludeFlex:!0},className:r("gp-price",{"gp-money":!l,"gp-product-compare-price":l},m,p)}};export{getTextProps};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let ProductButtonSettings=[{id:"setting",controls:[{id:"buttonLayoutGroup",type:"group",controls:[{id:"buttonLayout",label:"Layout",type:"layout-selector",iconViewBox:"0 0 72 72",enableItemBackground:!0,itemSpacing:"large",itemPerRow:1,default:"cart-icon",options:[{value:"cart-full",iconName:"gp-product-button-cart-full-layout"},{value:"cart-price",iconName:"gp-product-button-cart-price-layout"},{value:"cart-only",iconName:"gp-product-button-cart-only-layout"},{value:"cart-price-icon",iconName:"gp-product-button-price-icon-layout"},{value:"cart-icon",iconName:"gp-product-button-cart-item-layout"}]},{id:"priceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0},{id:"compareAtPriceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0}]},{id:"priceLayout",type:"option:illustration",enableTooltip:!1,label:"Layout",options:[{value:"price-only",type:"image",svgName:"gp-product-button-price-only-layout"},{value:"price-before",type:"image",svgName:"gp-product-button-price-before-layout"},{value:"price-after",type:"image",svgName:"gp-product-button-price-after-layout"}],default:"price-only"},{id:"button-text-group",type:"group",label:"Product Button",controls:[{id:"label",type:"input",label:"Button Text",default:"Add to cart"},{id:"translate",type:"input",default:"label,outOfStockLabel,unavailableLabel,variantSelectionRequiredMessage"},{id:"outOfStockLabel",type:"input",label:"Out Of Stock Message",clearButton:!1,default:"Out of stock"},{id:"unavailableLabel",type:"input",label:"Unavailable",default:"Unavailable"},{id:"actionEffect",label:"After Add To Cart Action",type:"select",options:[{title:"Keep shopping",value:"continue-shopping"},{title:"Go to checkout",value:"buy-now"},{title:"Open cart",value:"open-cart-drawer"},{title:"Open URL",value:"go-to-url"}],default:"open-cart-drawer"},{id:"customURL",label:"Custom URL",type:"pick-link",default:{link:"/cart",target:"_self"},isHiddenOpenLinkSelect:!0,hide:!0},{id:"enableMessage",type:"toggle",default:!0},{id:"successMessage",type:"textarea",label:"Success",minHeight:58,default:"Add product to cart successfully",autoHeight:!0},{id:"errorMessage",type:"textarea",label:"Error",minHeight:58,default:"Cannot add product to cart",autoHeight:!0},{id:"variantSelectionRequiredMessage",type:"textarea",label:"Error Message",minHeight:78,default:"Please select a variant to add product to cart",autoHeight:!0}]},{id:"group-icon",type:"group",label:"Icon",controls:[{id:"iconSvg",label:"SVG icon",type:"icon",hide:!0,default:`<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508414779109605736">
|
|
1
|
+
let ProductButtonSettings=[{id:"setting",controls:[{id:"buttonLayoutGroup",type:"group",controls:[{id:"buttonLayout",label:"Layout",type:"layout-selector",iconViewBox:"0 0 72 72",enableItemBackground:!0,itemSpacing:"large",itemPerRow:1,default:"cart-icon",options:[{value:"cart-full",iconName:"gp-product-button-cart-full-layout"},{value:"cart-price",iconName:"gp-product-button-cart-price-layout"},{value:"cart-only",iconName:"gp-product-button-cart-only-layout"},{value:"cart-price-icon",iconName:"gp-product-button-price-icon-layout"},{value:"cart-icon",iconName:"gp-product-button-cart-item-layout"}]},{id:"priceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0},{id:"compareAtPriceTypo",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{color:!0,textAlign:!0},ignoreReRender:!0},{id:"opacityPrice",type:"input:slider",step:1,min:0,max:100,ignoreMax:!0,default:50}]},{id:"priceLayout",type:"option:illustration",enableTooltip:!1,label:"Layout",options:[{value:"price-only",type:"image",svgName:"gp-product-button-price-only-layout"},{value:"price-before",type:"image",svgName:"gp-product-button-price-before-layout"},{value:"price-after",type:"image",svgName:"gp-product-button-price-after-layout"}],default:"price-only"},{id:"button-text-group",type:"group",label:"Product Button",controls:[{id:"label",type:"input",label:"Button Text",default:"Add to cart"},{id:"translate",type:"input",default:"label,outOfStockLabel,unavailableLabel,variantSelectionRequiredMessage"},{id:"outOfStockLabel",type:"input",label:"Out Of Stock Message",clearButton:!1,default:"Out of stock"},{id:"unavailableLabel",type:"input",label:"Unavailable",default:"Unavailable"},{id:"actionEffect",label:"After Add To Cart Action",type:"select",options:[{title:"Keep shopping",value:"continue-shopping"},{title:"Go to checkout",value:"buy-now"},{title:"Open cart",value:"open-cart-drawer"},{title:"Open URL",value:"go-to-url"}],default:"open-cart-drawer"},{id:"customURL",label:"Custom URL",type:"pick-link",default:{link:"/cart",target:"_self"},isHiddenOpenLinkSelect:!0,hide:!0},{id:"enableMessage",type:"toggle",default:!0},{id:"successMessage",type:"textarea",label:"Success",minHeight:58,default:"Add product to cart successfully",autoHeight:!0},{id:"errorMessage",type:"textarea",label:"Error",minHeight:58,default:"Cannot add product to cart",autoHeight:!0},{id:"variantSelectionRequiredMessage",type:"textarea",label:"Error Message",minHeight:78,default:"Please select a variant to add product to cart",autoHeight:!0}]},{id:"group-icon",type:"group",label:"Icon",controls:[{id:"iconSvg",label:"SVG icon",type:"icon",hide:!0,default:`<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508414779109605736">
|
|
2
2
|
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M233.21,56.31A12,12,0,0,0,224,52H66L60.53,21.85A12,12,0,0,0,48.73,12H24a12,12,0,0,0,0,24H38.71L63.62,173a28,28,0,0,0,4.07,10.21A32,32,0,1,0,123,196h34a32,32,0,1,0,31-24H91.17a4,4,0,0,1-3.93-3.28L84.92,156H196.1a28,28,0,0,0,27.55-23l12.16-66.86A12,12,0,0,0,233.21,56.31ZM100,204a8,8,0,1,1-8-8A8,8,0,0,1,100,204Zm88,8a8,8,0,1,1,8-8A8,8,0,0,1,188,212Zm12-83.28A4,4,0,0,1,196.1,132H80.56L70.38,76H209.62Z"></path></svg>`,compoDefaultValue:`<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor" data-id="508414779109605736">
|
|
3
|
-
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M233.21,56.31A12,12,0,0,0,224,52H66L60.53,21.85A12,12,0,0,0,48.73,12H24a12,12,0,0,0,0,24H38.71L63.62,173a28,28,0,0,0,4.07,10.21A32,32,0,1,0,123,196h34a32,32,0,1,0,31-24H91.17a4,4,0,0,1-3.93-3.28L84.92,156H196.1a28,28,0,0,0,27.55-23l12.16-66.86A12,12,0,0,0,233.21,56.31ZM100,204a8,8,0,1,1-8-8A8,8,0,0,1,100,204Zm88,8a8,8,0,1,1,8-8A8,8,0,0,1,188,212Zm12-83.28A4,4,0,0,1,196.1,132H80.56L70.38,76H209.62Z"></path></svg>`},{id:"iconAlign",label:"Icon Alignment",type:"option:value",hide:!0,options:[{label:"Left",value:"left"},{label:"Right",value:"right"}],default:"left"}]},{id:"errorType",type:"option:value",options:[{value:"built-in",label:"Shopify",tooltip:"Show default error message from Shopify"},{value:"custom",label:"Custom",tooltip:"Customize error message"}],default:"built-in"},{id:"shouldClearSpace",label:"",type:"toggle",default:!1},{id:"separator",label:"Separator",type:"option:value",options:[{value:"horizontal-line",iconName:"gp-product-button-horizontal-line-separator"},{value:"dot",iconName:"gp-product-button-dot-separator"},{value:"vertical-line",iconName:"gp-product-button-vertical-line-separator"}],default:"horizontal-line"}]},{id:"style",controls:[{id:"iconSpacing",type:"input:slider",units:["px"],step:1,min:0,max:40,ignoreMax:!0,devices:{desktop:{default:"8px"}}},{id:"behavior-state",type:"behavior-state",controls:[{id:"backgroundColor",type:"colorpicker",label:"Background Color",default:{normal:"brand",hover:"highlight"},state:{hover:!0,normal:!0}},{id:"textColor",type:"colorpicker",label:"Text Color",default:{normal:"text-3"},state:{hover:!0,normal:!0}},{id:"borderBtn",type:"border",label:"Border Style",default:{normal:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"},hover:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"}},state:{hover:!0,normal:!0}},{id:"hasBoxShadowBtn",type:"toggle",label:"Enable Button Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"roundedBtn",type:"radius-preset",label:"Border Radius",default:{normal:{radiusType:"none"}},state:{hover:!0,normal:!0}}]},{id:"backgroundColorV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"boxShadowBtn",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:45,enable:!0}}},{id:"roundedBtnV2",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},hover:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}},compoDefaultValue:{normal:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"},hover:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"}}},{id:"borderBtnV2",type:"border-v2",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:{normal:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}},{id:"textColorHover",type:"color-picker-v2",default:{hover:"text-3"},compoDefaultValue:{hover:"text-3"}},{id:"oosBackgroundV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"oosTextColorV2",type:"color-picker-v2",default:{normal:"text-3"},compoDefaultValue:{normal:"text-3"}},{id:"oosBorderV2",type:"border-v2",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:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}},{id:"
|
|
3
|
+
<path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M233.21,56.31A12,12,0,0,0,224,52H66L60.53,21.85A12,12,0,0,0,48.73,12H24a12,12,0,0,0,0,24H38.71L63.62,173a28,28,0,0,0,4.07,10.21A32,32,0,1,0,123,196h34a32,32,0,1,0,31-24H91.17a4,4,0,0,1-3.93-3.28L84.92,156H196.1a28,28,0,0,0,27.55-23l12.16-66.86A12,12,0,0,0,233.21,56.31ZM100,204a8,8,0,1,1-8-8A8,8,0,0,1,100,204Zm88,8a8,8,0,1,1,8-8A8,8,0,0,1,188,212Zm12-83.28A4,4,0,0,1,196.1,132H80.56L70.38,76H209.62Z"></path></svg>`},{id:"iconAlign",label:"Icon Alignment",type:"option:value",hide:!0,options:[{label:"Left",value:"left"},{label:"Right",value:"right"}],default:"left"}]},{id:"errorType",type:"option:value",options:[{value:"built-in",label:"Shopify",tooltip:"Show default error message from Shopify"},{value:"custom",label:"Custom",tooltip:"Customize error message"}],default:"built-in"},{id:"shouldClearSpace",label:"",type:"toggle",default:!1},{id:"separator",label:"Separator",type:"option:value",options:[{value:"horizontal-line",iconName:"gp-product-button-horizontal-line-separator"},{value:"dot",iconName:"gp-product-button-dot-separator"},{value:"vertical-line",iconName:"gp-product-button-vertical-line-separator"}],default:"horizontal-line"}]},{id:"style",controls:[{id:"iconSpacing",type:"input:slider",units:["px"],step:1,min:0,max:40,ignoreMax:!0,devices:{desktop:{default:"8px"}}},{id:"behavior-state",type:"behavior-state",controls:[{id:"backgroundColor",type:"colorpicker",label:"Background Color",default:{normal:"brand",hover:"highlight"},state:{hover:!0,normal:!0}},{id:"textColor",type:"colorpicker",label:"Text Color",default:{normal:"text-3"},state:{hover:!0,normal:!0}},{id:"borderBtn",type:"border",label:"Border Style",default:{normal:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"},hover:{border:"none",isCustom:!0,position:"all",borderWidth:"1px",width:"1px 1px 1px 1px"}},state:{hover:!0,normal:!0}},{id:"hasBoxShadowBtn",type:"toggle",label:"Enable Button Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"roundedBtn",type:"radius-preset",label:"Border Radius",default:{normal:{radiusType:"none"}},state:{hover:!0,normal:!0}}]},{id:"backgroundColorV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"boxShadowBtn",type:"shadow-v2",default:{normal:{}},compoDefaultValue:{normal:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:45,enable:!0}}},{id:"roundedBtnV2",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},hover:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}},compoDefaultValue:{normal:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"},hover:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"}}},{id:"borderBtnV2",type:"border-v2",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:{normal:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}}},{id:"textColorHover",type:"color-picker-v2",default:{hover:"text-3"},compoDefaultValue:{hover:"text-3"}},{id:"oosBackgroundV2",type:"color-picker-v2",default:{normal:"brand",hover:"highlight"},compoDefaultValue:{normal:"brand",hover:"highlight"},enableGradient:!0},{id:"oosTextColorV2",type:"color-picker-v2",default:{normal:"text-3"},compoDefaultValue:{normal:"text-3"}},{id:"oosBorderV2",type:"border-v2",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:{normal:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"},hover:{border:"solid",color:"#212121",width:"1px",borderWidth:"1px"}}},{id:"oosEnableShadow",type:"toggle",label:"Enable Button Shadow",default:!1,hide:!0},{id:"oosShadow",type:"shadow-v2",compoDefaultValue:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"#121212",angle:45,enable:!0}},{id:"oosRoundedV2",label:"Border Radius",type:"corner-v2",default:{normal:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},hover:{btrr:"0px",bblr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"}},compoDefaultValue:{normal:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"},hover:{btrr:"8px",bblr:"8px",bbrr:"8px",btlr:"8px",radiusType:"rounded"}}},{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:"typo",type:"typography-v2",label:"Typography",default:{type:"paragraph-1",attrs:{color:"text-3"}},hiddenSetting:{textAlign:!0},ignoreReRender:!0},{id:"enableIcon",type:"toggle",default:!0},{id:"enablePrice",type:"toggle",default:!1},{id:"enableSeparator",type:"toggle",default:!1},{id:"transform",label:"Text Transform",type:"select",options:[{value:"default",title:"None"},{value:"capitalize",title:"Capitalize"},{value:"uppercase",title:"Uppercase"},{value:"lowercase",title:"Lowercase"}],default:"default"},{id:"button-dimensions",type:"group",label:"Dimensions",controls:[{id:"btnSpacing",label:"Inside space",type:"size",default:{type:"medium"},ignoreReRender:!0},{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"width",type:"input:unit",label:"Width",emptyOnClear:!0,min:0,units:["px","%"],hide:!0,devices:{desktop:{default:"100%"}}}]},{id:"icon-dimensions",type:"group",label:"Icon Dimension",hide:!0,controls:[{id:"iconSizeAuto",type:"toggle",label:"Auto Size",default:!0},{id:"size",label:"Size Icon",type:"select",options:[{title:"Large",value:"1.2em"},{title:"medium",value:"1em"},{title:"Small",value:"0.8em"}],devices:{desktop:{default:"1em"}}},{id:"iconDimension",type:"input:slider",label:"Size",hide:!0,min:0,max:100,step:1,units:["px","em","rem"],devices:{desktop:{default:"24px"}}}]},{id:"success-group",type:"group",label:"Success Message",controls:[{id:"successTypo",type:"typography-v2",label:"Typography",default:{type:"paragraph-2",attrs:{color:"success"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0}},{id:"successColor",type:"colorpicker",label:"Text Color",default:"success"}]},{id:"error-group",type:"group",label:"Error Message",controls:[{id:"errorTypo",type:"typography-v2",label:"Typography",default:{type:"paragraph-2",attrs:{color:"error"}},ignoreReRender:!0,hiddenSetting:{textAlign:!0}},{id:"errorColor",type:"colorpicker",label:"Text Color",default:"error"}]},{id:"outofstock-group",type:"group",label:"Out of Stock",controls:[{id:"isCustomOutOfStock",label:"Custom Style",type:"toggle",default:!1},{id:"oosBackground",type:"colorpicker",label:"Background Color",default:"brand",hide:!0},{id:"oosTextColor",type:"colorpicker",label:"Text Color",default:"text-3",hide:!0},{id:"oosIconColor",type:"colorpicker",label:"Text Color",default:"text-3",hide:!0},{id:"oosBorder",type:"border",label:"Border Style",default:{normal:{borderType:"none",border:"none",isCustom:!1,borderWidth:"1px",width:"1px 1px 1px 1px"}},hide:!0},{id:"oosRounded",type:"radius-preset",label:"Border Radius",default:{radiusType:"none"},hide:!0}]},{id:"globalSize",type:"size-setting",devices:{desktop:{default:{width:"100%",height:"Auto",padding:{type:"medium",top:"12px",bottom:"12px",left:"24px",right:"24px"}}}},settingConfig:{width:{displayOptions:["full","auto"]},height:{displayOptions:["auto"]}},hiddenSettings:["shape","gap"]}]}];export{ProductButtonSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"buttonLayout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-before"}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}}],options:{noRecordHistory:!0}}}]},{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"},{id:"Height",label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",label:"height",inputType:"number",units:["px"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},controlConfig:{id:"padding",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"},compoDefaultValue:{desktop:{default:{type:"medium",top:"12px",bottom:"12px",left:"24px",right:"24px"}}}}}]},{label:{en:"Background"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},conditionDisplay:'pageType != "POST_PURCHASE"',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:"enableIcon"},options:{labelVariant:"primary",toggleStyle:"switch"}},{type:"control",setting:{id:"iconSvg"},label:{en:"Icon"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"enableIcon === true"}]},{label:{en:"Text"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Add to cart",getValueFromSettingID:"label",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"label"}}]},{setting:{id:"typo"},layout:"vertical"}]},{controls:[{label:{en:"Separator"},setting:{id:"enableSeparator"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},conditionDisplay:"enableSeparator === true",setting:{id:"separator"}}]},{controls:[{label:{en:"Price"},setting:{id:"enablePrice"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Layout"},conditionDisplay:"enablePrice === true",setting:{id:"priceLayout"},layout:"vertical"},{label:{en:"Product price"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Product price text style"},isHideClear:!0,controls:[{layout:"vertical",setting:{id:"priceTypo"}}]},{label:{en:"Compare-at"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Compare-at text style"},isHideClear:!0,controls:[{layout:"vertical",setting:{id:"compareAtPriceTypo"}}]}]},{label:{en:"Hover effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColorHover",state:"hover"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}},{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}}}]},{label:{en:"Out of stock state"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Out of stock",getValueFromSettingID:"outOfStockLabel",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"outOfStockLabel"}}]},{label:{en:"Background"},setting:{id:"oosBackgroundV2",state:"normal"}},{label:{en:"Text color"},setting:{id:"oosTextColorV2",state:"normal"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}}],moreSettings:{type:"collapse",controls:[{label:{en:"Border"},setting:{id:"oosBorderV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"oosRoundedV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"oosShadowV2",state:"normal"}}]}},{label:{en:"Redirect to"},controls:[{type:"control",label:{en:"After click"},setting:{id:"actionEffect"}},{type:"control",conditionDisplay:"actionEffect === 'go-to-url'",layout:"vertical",setting:{id:"customURL"}},{label:{en:"Message"},conditionDisplay:"actionEffect === 'continue-shopping'",setting:{id:"enableMessage"}},{label:{en:"Success"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",getValueFromSettingID:"successMessage",compoDefaultValue:"Add product to cart successfully",iconName:"polaris-check-circle",isHideClear:!0,popoverLabel:{en:"Success message"},controls:[{label:{en:"Content"},setting:{id:"successMessage"}},{layout:"vertical",setting:{id:"successTypo"}}]},{label:{en:"Error"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",fixedValue:"Edit",iconName:"polaris-alert-bubble",getValueFromSettingID:"errorMessage",compoDefaultValue:"Cannot add product to cart",isHideClear:!0,popoverLabel:{en:"Error message"},controls:[{label:{en:"Source"},setting:{id:"errorType"}},{label:{en:"Add failed"},conditionDisplay:"errorType === 'custom'",setting:{id:"errorMessage"}},{label:{en:"Not select variant"},conditionDisplay:"errorType === 'custom'",setting:{id:"variantSelectionRequiredMessage"}},{layout:"vertical",setting:{id:"errorTypo"}}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(globalSize.width === "default" || (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
|
+
let SettingUIV2=[{label:{en:"Layout"},controls:[{setting:{id:"buttonLayout"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-full"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-before"}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-only"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}},{condition:'buttonLayout === "cart-price-icon"',source:["buttonLayout"],action:{controlId:"priceLayout",groupType:"setting",controlType:"setting",newValue:"price-only"}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableIcon",groupType:"style",controlType:"style",newValue:!0}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enableSeparator",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"enablePrice",groupType:"style",controlType:"style",newValue:!1}},{condition:'buttonLayout === "cart-icon"',source:["buttonLayout"],action:{controlId:"shouldClearSpace",groupType:"setting",controlType:"setting",newValue:!1}}],options:{noRecordHistory:!0}}}]},{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"},{id:"Height",label:{en:"Height"},controlConfig:{id:"height",type:"dropdown:input",label:"height",inputType:"number",units:["px"],hideUnit:!1,linkWithSetting:{name:"globalSize",field:"height"},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0}]},layout:"horizontal"},{label:{en:"Padding"},controlConfig:{id:"padding",type:"padding-v2",linkWithSetting:{name:"globalSize",field:"padding"},compoDefaultValue:{desktop:{default:{type:"medium",top:"12px",bottom:"12px",left:"24px",right:"24px"}}}}}]},{label:{en:"Background"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Color"},setting:{id:"backgroundColorV2",state:"normal"}}]},{label:{en:"Shape"},conditionDisplay:'pageType != "POST_PURCHASE"',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:"enableIcon"},options:{labelVariant:"primary",toggleStyle:"switch"}},{type:"control",setting:{id:"iconSvg"},label:{en:"Icon"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Position"},setting:{id:"iconAlign"},conditionDisplay:"enableIcon === true"},{type:"control",label:{en:"Gap"},setting:{id:"iconSpacing"},conditionDisplay:"enableIcon === true"}]},{label:{en:"Text"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Add to cart",getValueFromSettingID:"label",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"label"}}]},{setting:{id:"typo"},layout:"vertical"}]},{controls:[{label:{en:"Separator"},setting:{id:"enableSeparator"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Icon"},conditionDisplay:"enableSeparator === true",setting:{id:"separator"}}]},{controls:[{label:{en:"Price"},setting:{id:"enablePrice"},options:{labelVariant:"primary",toggleStyle:"switch"}},{label:{en:"Layout"},conditionDisplay:"enablePrice === true",setting:{id:"priceLayout"},layout:"vertical"},{label:{en:"Product price"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Product price text style"},isHideClear:!0,controls:[{layout:"vertical",setting:{id:"priceTypo"}}]},{label:{en:"Compare-at"},conditionDisplay:"enablePrice === true",type:"combo",fixedValue:"Edit",iconName:"polaris-text-title",popoverLabel:{en:"Compare-at text style"},isHideClear:!0,controls:[{setting:{id:"opacityPrice"},label:{en:"Opacity"}},{layout:"vertical",setting:{id:"compareAtPriceTypo"}}]}]},{label:{en:"Hover effect"},conditionDisplay:'pageType != "POST_PURCHASE"',controls:[{label:{en:"Background"},setting:{id:"backgroundColorV2",state:"hover"}},{label:{en:"Text color"},setting:{id:"textColorHover",state:"hover"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}},{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}}}]},{label:{en:"Out of stock state"},controls:[{type:"combo",label:{en:"Content"},iconName:"polaris-text-block",fixedValue:"Out of stock",getValueFromSettingID:"outOfStockLabel",isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"outOfStockLabel"}}]},{label:{en:"Background"},setting:{id:"oosBackgroundV2",state:"normal"}},{label:{en:"Text color"},setting:{id:"oosTextColorV2",state:"normal"},compoDefaultValue:{desktop:{default:{normal:"#121212"}}}}],moreSettings:{type:"collapse",controls:[{label:{en:"Border"},setting:{id:"oosBorderV2",state:"normal"}},{label:{en:"Corner"},setting:{id:"oosRoundedV2",state:"normal"}},{label:{en:"Shadow"},setting:{id:"oosShadow"},options:{updateFields:[{field:"enable",settingId:"oosEnableShadow"}]},controlChangeTrigger:{settings:[{condition:"oosShadow.enable === true",source:["oosShadow","oosEnableShadow"],action:{controlId:"oosEnableShadow",groupType:"style",controlType:"style",newValue:!0}},{condition:"oosShadow.enable === false",source:["oosShadow","oosEnableShadow"],action:{controlId:"oosEnableShadow",groupType:"style",controlType:"style",newValue:!1}}],options:{noRecordHistory:!0}}}]}},{label:{en:"Redirect to"},controls:[{type:"control",label:{en:"After click"},setting:{id:"actionEffect"}},{type:"control",conditionDisplay:"actionEffect === 'go-to-url'",layout:"vertical",setting:{id:"customURL"}},{label:{en:"Message"},conditionDisplay:"actionEffect === 'continue-shopping'",setting:{id:"enableMessage"}},{label:{en:"Success"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",getValueFromSettingID:"successMessage",compoDefaultValue:"Add product to cart successfully",iconName:"polaris-check-circle",isHideClear:!0,popoverLabel:{en:"Success message"},controls:[{label:{en:"Content"},setting:{id:"successMessage"}},{layout:"vertical",setting:{id:"successTypo"}}]},{label:{en:"Error"},conditionDisplay:"enableMessage === true && actionEffect === 'continue-shopping'",type:"combo",fixedValue:"Edit",iconName:"polaris-alert-bubble",getValueFromSettingID:"errorMessage",compoDefaultValue:"Cannot add product to cart",isHideClear:!0,popoverLabel:{en:"Error message"},controls:[{label:{en:"Source"},setting:{id:"errorType"}},{label:{en:"Add failed"},conditionDisplay:"errorType === 'custom'",setting:{id:"errorMessage"}},{label:{en:"Not select variant"},conditionDisplay:"errorType === 'custom'",setting:{id:"variantSelectionRequiredMessage"}},{layout:"vertical",setting:{id:"errorTypo"}}]}]},{controls:[{label:{en:"Align"},conditionEnable:'!(globalSize.width === "default" || (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{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as n,getResponsiveStyleShadowWithoutState as i,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as h,getGlobalColorStateStyle as s,composeTypographyStyle as y,getStyleBackgroundByDevice as
|
|
1
|
+
import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as n,getResponsiveStyleShadowWithoutState as i,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as h,getGlobalColorStateStyle as s,composeTypographyStyle as y,getStyleBackgroundByDevice as p,getGradientBgrStyleByDevice as c}from"@gem-sdk/core";import{formatThickness as u}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(r,o)=>{let l={...e({mr:r?.spacing,mb:r?.spacing}),...t("ta",r?.align),...o,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(l)},getContainerStyle=(e,r)=>{let{tagWidth:o}=r??{},l={...t("jc",e?.align),...o};return filterTruthyStyles(l)},getTextStyle=(g,S)=>{let w=r(S?.globalSize),m=[g?.lineThrough&&"line-through",g?.typo?.attrs?.underline&&"underline"].filter(Boolean),x={...w?.width?.["--w"]?w.width:{"--w":"100%"},...e({tdc:o(g?.lineColor?.normal),tdt:u(g?.thickness)}),...l(g?.shapeBorder),...n(g?.shapeRounded),...i(g?.shapeBoxShadow,"box-shadow",g?.shapeBoxShadow),...a({value:g?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:g?.typo?.custom?.hasShadowText}),...t("ta",g?.textAlign),...t("line-clamp",d(g?.lineClamp,g?.hasLineClamp)),...g?.textColor?h(g.textColor):s("c",g?.color),...y(g?.typo),"word-break":"break-word",...p(S?.background),...w.padding,...c(S?.background),overflow:"hidden",opacity:`${g?.opacityPrice}%`,...e({tdl:m.join(" ")})};return filterTruthyStyles(x)},getTextStyleInline=e=>{let t={...y(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};export{getContainerStyle,getStyle,getTextStyle,getTextStyleInline};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ type TextProps = BasePropsWrap<{
|
|
|
79
79
|
text?: string | number;
|
|
80
80
|
translate?: string;
|
|
81
81
|
htmlTag?: React.ElementType;
|
|
82
|
+
opacityPrice?: number;
|
|
82
83
|
options?: {
|
|
83
84
|
useState?: boolean;
|
|
84
85
|
uniqueId?: string | undefined;
|
|
@@ -132,12 +133,14 @@ type TextProps = BasePropsWrap<{
|
|
|
132
133
|
shapeBoxShadow?: ObjectDevices$1<ShadowProps$1>;
|
|
133
134
|
isForceValue?: boolean;
|
|
134
135
|
lineThrough?: boolean;
|
|
136
|
+
opacityPrice?: number;
|
|
135
137
|
}> & Omit<React.ComponentPropsWithoutRef<'p'>, ''>;
|
|
136
138
|
|
|
137
139
|
declare const Text$2: React.ForwardRefExoticComponent<_gem_sdk_core.BaseProps<{
|
|
138
140
|
text?: string | number | undefined;
|
|
139
141
|
translate?: string | undefined;
|
|
140
142
|
htmlTag?: React.ElementType<any> | undefined;
|
|
143
|
+
opacityPrice?: number | undefined;
|
|
141
144
|
options?: {
|
|
142
145
|
useState?: boolean | undefined;
|
|
143
146
|
uniqueId?: string | undefined;
|
|
@@ -182,6 +185,7 @@ declare const Text$2: React.ForwardRefExoticComponent<_gem_sdk_core.BaseProps<{
|
|
|
182
185
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
183
186
|
isForceValue?: boolean | undefined;
|
|
184
187
|
lineThrough?: boolean | undefined;
|
|
188
|
+
opacityPrice?: number | undefined;
|
|
185
189
|
}, Record<string, any>> & {
|
|
186
190
|
builderAttrs?: Record<string, any> | undefined;
|
|
187
191
|
style?: React.CSSProperties | undefined;
|
|
@@ -3439,7 +3443,7 @@ type ProductButtonProps = BasePropsWrap<{
|
|
|
3439
3443
|
enableMessage?: boolean;
|
|
3440
3444
|
enableSuccessMessage?: boolean;
|
|
3441
3445
|
enableErrorMessage?: boolean;
|
|
3442
|
-
opacityPrice?:
|
|
3446
|
+
opacityPrice?: number;
|
|
3443
3447
|
separator?: Separator;
|
|
3444
3448
|
} & Pick<NonNullable<ButtonProps['setting']>, 'iconAlign' | 'iconSvg' | 'iconVisible'>, ButtonProps['styles'] & {
|
|
3445
3449
|
successTypo?: NonNullable<TextProps['styles']>['typo'];
|
|
@@ -5740,6 +5744,7 @@ declare const _default$3: {
|
|
|
5740
5744
|
text?: string | number | undefined;
|
|
5741
5745
|
translate?: string | undefined;
|
|
5742
5746
|
htmlTag?: React.ElementType<any> | undefined;
|
|
5747
|
+
opacityPrice?: number | undefined;
|
|
5743
5748
|
options?: {
|
|
5744
5749
|
useState?: boolean | undefined;
|
|
5745
5750
|
uniqueId?: string | undefined;
|
|
@@ -5784,6 +5789,7 @@ declare const _default$3: {
|
|
|
5784
5789
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
5785
5790
|
isForceValue?: boolean | undefined;
|
|
5786
5791
|
lineThrough?: boolean | undefined;
|
|
5792
|
+
opacityPrice?: number | undefined;
|
|
5787
5793
|
}, Record<string, any>> & {
|
|
5788
5794
|
builderAttrs?: Record<string, any> | undefined;
|
|
5789
5795
|
style?: React.CSSProperties | undefined;
|
|
@@ -6292,6 +6298,7 @@ declare const Text: ({ id, styles, builderAttrs, style, setting, advanced, build
|
|
|
6292
6298
|
text?: string | number | undefined;
|
|
6293
6299
|
translate?: string | undefined;
|
|
6294
6300
|
htmlTag?: React.ElementType<any> | undefined;
|
|
6301
|
+
opacityPrice?: number | undefined;
|
|
6295
6302
|
options?: {
|
|
6296
6303
|
useState?: boolean | undefined;
|
|
6297
6304
|
uniqueId?: string | undefined;
|
|
@@ -6336,6 +6343,7 @@ declare const Text: ({ id, styles, builderAttrs, style, setting, advanced, build
|
|
|
6336
6343
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
6337
6344
|
isForceValue?: boolean | undefined;
|
|
6338
6345
|
lineThrough?: boolean | undefined;
|
|
6346
|
+
opacityPrice?: number | undefined;
|
|
6339
6347
|
}, Record<string, any>> & {
|
|
6340
6348
|
builderAttrs?: Record<string, any> | undefined;
|
|
6341
6349
|
style?: React.CSSProperties | undefined;
|
|
@@ -6377,6 +6385,7 @@ declare const ProductTag: ({ setting, styles, builderProps, advanced, pageContex
|
|
|
6377
6385
|
text?: string | number | undefined;
|
|
6378
6386
|
translate?: string | undefined;
|
|
6379
6387
|
htmlTag?: React.ElementType<any> | undefined;
|
|
6388
|
+
opacityPrice?: number | undefined;
|
|
6380
6389
|
options?: {
|
|
6381
6390
|
useState?: boolean | undefined;
|
|
6382
6391
|
uniqueId?: string | undefined;
|
|
@@ -6435,6 +6444,7 @@ declare const ProductTag: ({ setting, styles, builderProps, advanced, pageContex
|
|
|
6435
6444
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
6436
6445
|
isForceValue?: boolean | undefined;
|
|
6437
6446
|
lineThrough?: boolean | undefined;
|
|
6447
|
+
opacityPrice?: number | undefined;
|
|
6438
6448
|
} & {
|
|
6439
6449
|
textAlign?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.AlignProp>> | undefined;
|
|
6440
6450
|
backgroundColor?: _gem_sdk_core.ColorValueType | undefined;
|
|
@@ -7435,6 +7445,7 @@ declare const _default$2: {
|
|
|
7435
7445
|
text?: string | number | undefined;
|
|
7436
7446
|
translate?: string | undefined;
|
|
7437
7447
|
htmlTag?: React.ElementType<any> | undefined;
|
|
7448
|
+
opacityPrice?: number | undefined;
|
|
7438
7449
|
options?: {
|
|
7439
7450
|
useState?: boolean | undefined;
|
|
7440
7451
|
uniqueId?: string | undefined;
|
|
@@ -7479,6 +7490,7 @@ declare const _default$2: {
|
|
|
7479
7490
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
7480
7491
|
isForceValue?: boolean | undefined;
|
|
7481
7492
|
lineThrough?: boolean | undefined;
|
|
7493
|
+
opacityPrice?: number | undefined;
|
|
7482
7494
|
}, Record<string, any>> & {
|
|
7483
7495
|
builderAttrs?: Record<string, any> | undefined;
|
|
7484
7496
|
style?: React.CSSProperties | undefined;
|