@gem-sdk/components 2.0.0-dev.709 → 2.0.0-dev.710

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.
@@ -81,6 +81,7 @@ const getDeviceStyles = ({ uid, device, styles, composeGlobalSize })=>{
81
81
  ${core.composeBorderCss(styles?.borderBtnV2?.hover)}
82
82
  ${core.composeCornerCss(styles?.roundedBtnV2?.hover)}
83
83
  ${core.composeBackgroundCss(styles?.backgroundColorV2?.hover)}
84
+ ${styles?.backgroundColorV2?.hover && `background-image: unset !important;`}
84
85
  }
85
86
  `;
86
87
  };
@@ -33,9 +33,11 @@ const Button = ({ setting, advanced, styles: styles$1, pageContext, builderProps
33
33
  setting: {
34
34
  label: setting?.label
35
35
  },
36
- totalVariant: '{{product.variants.size}}'
36
+ totalVariant: '{{total_combinations}}'
37
37
  });
38
38
  return core.template`
39
+ ${system.Liquid(`{%- assign total_combinations = 1 -%}`)}
40
+ ${system.LiquidFor(`option in product.options_with_values`, `{%- assign total_combinations = total_combinations | times: option.values.size -%}`)}
39
41
  ${system.Liquid(`
40
42
  {%- liquid
41
43
  assign inventory_quantity = variant.inventory_quantity | default: 0
@@ -110,7 +110,7 @@ const ProductBadge = (props)=>{
110
110
  gp-data='${core.dataStringify(createDataState)}'
111
111
  class="containerClass"
112
112
  style="${containerStyle}"
113
- data-display-content="${displayContentVal}"
113
+ data-display-content="${pageContext?.isPreviewing ? displayContentVal : core.sanitizeLiquid(`{{${displayContentVal}}}`)}"
114
114
  >
115
115
  <div class="${wrapperClass}">
116
116
  <div
@@ -38,7 +38,7 @@ const getGPProductButtonState = (styles, setting)=>{
38
38
  },
39
39
  variantID: '{{variant.id}}',
40
40
  disabled: `{{variant.available}}`,
41
- totalVariant: '{{product.variants.size}}'
41
+ totalVariant: '{{total_combinations}}'
42
42
  };
43
43
  };
44
44
  const renderSeparator = (separator)=>{
@@ -79,6 +79,7 @@ const getDeviceStyles = ({ uid, device, styles, composeGlobalSize })=>{
79
79
  ${composeBorderCss(styles?.borderBtnV2?.hover)}
80
80
  ${composeCornerCss(styles?.roundedBtnV2?.hover)}
81
81
  ${composeBackgroundCss(styles?.backgroundColorV2?.hover)}
82
+ ${styles?.backgroundColorV2?.hover && `background-image: unset !important;`}
82
83
  }
83
84
  `;
84
85
  };
@@ -1,5 +1,5 @@
1
1
  import { template, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
- import { createClass, createStateOrContext, Liquid, If } from '@gem-sdk/system';
2
+ import { createClass, createStateOrContext, Liquid, LiquidFor, If } from '@gem-sdk/system';
3
3
  import { getDynamicSourceLocales, getSettingPreloadData } from '../../../../helpers.js';
4
4
  import { getButtonClasses } from '../common/classes.js';
5
5
  import { getButtonStyles } from '../common/styles.js';
@@ -29,9 +29,11 @@ const Button = ({ setting, advanced, styles, pageContext, builderProps, classNam
29
29
  setting: {
30
30
  label: setting?.label
31
31
  },
32
- totalVariant: '{{product.variants.size}}'
32
+ totalVariant: '{{total_combinations}}'
33
33
  });
34
34
  return template`
35
+ ${Liquid(`{%- assign total_combinations = 1 -%}`)}
36
+ ${LiquidFor(`option in product.options_with_values`, `{%- assign total_combinations = total_combinations | times: option.values.size -%}`)}
35
37
  ${Liquid(`
36
38
  {%- liquid
37
39
  assign inventory_quantity = variant.inventory_quantity | default: 0
@@ -1,4 +1,4 @@
1
- import { template, dataStringify, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
1
+ import { template, dataStringify, sanitizeLiquid, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { getDynamicSourceLocales, getSettingPreloadData } from '../../../helpers.js';
3
3
  import { checkDiscountContentProductBadge } from './utils/common.js';
4
4
  import { generateBadgeContent } from './utils/generateLiquidContent.js';
@@ -106,7 +106,7 @@ const ProductBadge = (props)=>{
106
106
  gp-data='${dataStringify(createDataState)}'
107
107
  class="containerClass"
108
108
  style="${containerStyle}"
109
- data-display-content="${displayContentVal}"
109
+ data-display-content="${pageContext?.isPreviewing ? displayContentVal : sanitizeLiquid(`{{${displayContentVal}}}`)}"
110
110
  >
111
111
  <div class="${wrapperClass}">
112
112
  <div
@@ -36,7 +36,7 @@ const getGPProductButtonState = (styles, setting)=>{
36
36
  },
37
37
  variantID: '{{variant.id}}',
38
38
  disabled: `{{variant.available}}`,
39
- totalVariant: '{{product.variants.size}}'
39
+ totalVariant: '{{total_combinations}}'
40
40
  };
41
41
  };
42
42
  const renderSeparator = (separator)=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.709",
3
+ "version": "2.0.0-dev.710",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  "scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
26
26
  },
27
27
  "devDependencies": {
28
- "@gem-sdk/core": "2.0.0-dev.704",
28
+ "@gem-sdk/core": "2.0.0-dev.710",
29
29
  "@gem-sdk/styles": "2.0.0-dev.703",
30
30
  "@gem-sdk/system": "2.0.0-dev.695",
31
31
  "@types/react-transition-group": "^4.4.5",