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

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.
@@ -75,7 +75,8 @@ const ArticleListSettings = [
75
75
  default: 3,
76
76
  hide: true,
77
77
  hideUnit: true,
78
- useOnlyUnitInit: true
78
+ useOnlyUnitInit: true,
79
+ isNumber: true
79
80
  },
80
81
  {
81
82
  id: 'background',
@@ -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)=>{
@@ -17,7 +17,9 @@ const getStyle = (props)=>{
17
17
  })
18
18
  });
19
19
  const productListWrapStyle = system.createStyle({
20
- ...core.makeStyleResponsive('jc', styles?.align)
20
+ ...core.makeStyleResponsive('jc', styles?.align || {
21
+ desktop: 'center'
22
+ })
21
23
  });
22
24
  const productListContentStyle = system.createStyle({
23
25
  ...core.makeStyleResponsive('w', helpers.createStyleObject(styles?.width).content)
@@ -147,7 +147,8 @@ const ProductListSettingsV2 = [
147
147
  label: 'Row gap',
148
148
  type: 'input:unit',
149
149
  units: [
150
- 'px'
150
+ 'px',
151
+ '%'
151
152
  ],
152
153
  devices: {
153
154
  desktop: {
@@ -163,7 +164,8 @@ const ProductListSettingsV2 = [
163
164
  label: 'Column gap',
164
165
  type: 'input:unit',
165
166
  units: [
166
- 'px'
167
+ 'px',
168
+ '%'
167
169
  ],
168
170
  devices: {
169
171
  desktop: {
@@ -73,7 +73,8 @@ const ArticleListSettings = [
73
73
  default: 3,
74
74
  hide: true,
75
75
  hideUnit: true,
76
- useOnlyUnitInit: true
76
+ useOnlyUnitInit: true,
77
+ isNumber: true
77
78
  },
78
79
  {
79
80
  id: 'background',
@@ -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)=>{
@@ -15,7 +15,9 @@ const getStyle = (props)=>{
15
15
  })
16
16
  });
17
17
  const productListWrapStyle = createStyle({
18
- ...makeStyleResponsive('jc', styles?.align)
18
+ ...makeStyleResponsive('jc', styles?.align || {
19
+ desktop: 'center'
20
+ })
19
21
  });
20
22
  const productListContentStyle = createStyle({
21
23
  ...makeStyleResponsive('w', createStyleObject(styles?.width).content)
@@ -145,7 +145,8 @@ const ProductListSettingsV2 = [
145
145
  label: 'Row gap',
146
146
  type: 'input:unit',
147
147
  units: [
148
- 'px'
148
+ 'px',
149
+ '%'
149
150
  ],
150
151
  devices: {
151
152
  desktop: {
@@ -161,7 +162,8 @@ const ProductListSettingsV2 = [
161
162
  label: 'Column gap',
162
163
  type: 'input:unit',
163
164
  units: [
164
- 'px'
165
+ 'px',
166
+ '%'
165
167
  ],
166
168
  devices: {
167
169
  desktop: {
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.711",
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",