@gem-sdk/components 17.0.0-staging.11 → 17.0.0-staging.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var constants=require("./constants.js");const LIQUID_EXPRESSION_REGEX=/^\s*\{\{[\s\S]*\}\}\s*$/,appendLiquidEscapeFilter=e=>e.replace(/\s*\}\}\s*$/,"| escape | replace: '"', '
|
|
1
|
+
"use strict";var constants=require("./constants.js");const LIQUID_EXPRESSION_REGEX=/^\s*\{\{[\s\S]*\}\}\s*$/,appendLiquidEscapeFilter=e=>e.replace(/\s*\}\}\s*$/,"| escape | replace: '"', '\"' }}"),escapeSingleQuoteForAttr=e=>{if(null==e)return e;let t=e.toString();return LIQUID_EXPRESSION_REGEX.test(t)?appendLiquidEscapeFilter(t):t.replaceAll("'","'").replaceAll("’","'")},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=({styles:e,setting:t,successMessage:r,errorMessage:o})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:escapeSingleQuoteForAttr(t?.label),errorMessage:escapeSingleQuoteForAttr(o??t?.errorMessage),successMessage:escapeSingleQuoteForAttr(r??t?.successMessage),outOfStockLabel:escapeSingleQuoteForAttr(t?.outOfStockLabel),customURL:{link:escapeSingleQuoteForAttr(t?.customURL?.link),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
|
-
import{SEPARATOR as e}from"./constants.js";let LIQUID_EXPRESSION_REGEX=/^\s*\{\{[\s\S]*\}\}\s*$/,appendLiquidEscapeFilter=e=>e.replace(/\s*\}\}\s*$/,"| escape | replace: '"', '
|
|
1
|
+
import{SEPARATOR as e}from"./constants.js";let LIQUID_EXPRESSION_REGEX=/^\s*\{\{[\s\S]*\}\}\s*$/,appendLiquidEscapeFilter=e=>e.replace(/\s*\}\}\s*$/,"| escape | replace: '"', '\"' }}"),escapeSingleQuoteForAttr=e=>{if(null==e)return e;let t=e.toString();return LIQUID_EXPRESSION_REGEX.test(t)?appendLiquidEscapeFilter(t):t.replaceAll("'","'").replaceAll("’","'")},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=({styles:e,setting:t,successMessage:r,errorMessage:o})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:escapeSingleQuoteForAttr(t?.label),errorMessage:escapeSingleQuoteForAttr(o??t?.errorMessage),successMessage:escapeSingleQuoteForAttr(r??t?.successMessage),outOfStockLabel:escapeSingleQuoteForAttr(t?.outOfStockLabel),customURL:{link:escapeSingleQuoteForAttr(t?.customURL?.link),target:t?.customURL?.target}},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),renderSeparator=t=>{let r=t??"horizontal-line";return({dot:e.DOT,"vertical-line":e.VERTICAL_LINE,"horizontal-line":e.HORIZONTAL_LINE})[r]??e.HORIZONTAL_LINE},removeColorFromTypo=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);export{checkIconVisibility,getGPProductButtonState,getRenderComparePriceSettings,getRenderRegularPriceSettings,renderSeparator};
|