@gem-sdk/components 2.0.0-dev.706 → 2.0.0-dev.708

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.
@@ -5,31 +5,21 @@ var helpers = require('../../../../helpers.js');
5
5
  const getButtonDynamicSourceLocales = ({ setting, builderProps, pageContext })=>{
6
6
  const baseProps = {
7
7
  pageContext,
8
- isLiquid: true,
9
8
  uid: builderProps?.uid
10
9
  };
11
- const variantSelectionRequiredMessage = helpers.getDynamicSourceLocales({
12
- ...baseProps,
13
- translate: setting?.translate,
14
- settingId: 'variantSelectionRequiredMessage',
15
- val: setting?.variantSelectionRequiredMessage
16
- });
17
- const unavailableButtonLabel = helpers.getDynamicSourceLocales({
18
- ...baseProps,
19
- val: 'Unavailable',
20
- settingId: 'unavailableLabel',
21
- translate: setting?.translate ? 'unavailableLabel' : undefined
22
- });
23
- const outOfStockButtonLabel = helpers.getDynamicSourceLocales({
24
- ...baseProps,
25
- settingId: 'outOfStockLabel',
26
- val: setting?.outOfStockLabel,
27
- translate: setting?.translate ? 'outOfStockLabel' : undefined
28
- });
10
+ const getLocale = (settingId, val, translate)=>{
11
+ const locale = helpers.getDynamicSourceLocales({
12
+ ...baseProps,
13
+ translate: setting?.translate ? translate : undefined,
14
+ settingId,
15
+ val: val ?? ''
16
+ });
17
+ return locale;
18
+ };
29
19
  return {
30
- outOfStockButtonLabel: pageContext?.isPreviewing ? outOfStockButtonLabel : `{{${outOfStockButtonLabel}}}`,
31
- unavailableButtonLabel: pageContext?.isPreviewing ? unavailableButtonLabel : `{{${unavailableButtonLabel}}}`,
32
- variantSelectionRequiredMessage: pageContext?.isPreviewing ? variantSelectionRequiredMessage : `{{${variantSelectionRequiredMessage}}}`
20
+ outOfStockButtonLabel: getLocale('outOfStockLabel', setting?.outOfStockLabel, 'outOfStockLabel'),
21
+ unavailableButtonLabel: getLocale('unavailableLabel', 'Unavailable', 'unavailableLabel'),
22
+ variantSelectionRequiredMessage: getLocale('variantSelectionRequiredMessage', setting?.variantSelectionRequiredMessage, 'variantSelectionRequiredMessage')
33
23
  };
34
24
  };
35
25
 
@@ -189,6 +189,48 @@ const SettingUIV2 = [
189
189
  id: 'textBadgeShadow',
190
190
  state: 'normal'
191
191
  },
192
+ options: {
193
+ updateFields: [
194
+ {
195
+ field: 'enable',
196
+ settingId: 'hasShadow',
197
+ state: 'normal'
198
+ }
199
+ ]
200
+ },
201
+ controlChangeTrigger: {
202
+ settings: [
203
+ {
204
+ condition: `shapeShadow.normal.enable === true`,
205
+ source: [
206
+ 'shapeShadow',
207
+ 'hasShadow'
208
+ ],
209
+ action: {
210
+ controlId: 'hasShadow',
211
+ groupType: 'style',
212
+ controlType: 'style',
213
+ newValue: true
214
+ }
215
+ },
216
+ {
217
+ condition: `shapeShadow.normal.enable === false`,
218
+ source: [
219
+ 'shapeShadow',
220
+ 'hasShadow'
221
+ ],
222
+ action: {
223
+ controlId: 'hasShadow',
224
+ groupType: 'style',
225
+ controlType: 'style',
226
+ newValue: false
227
+ }
228
+ }
229
+ ],
230
+ options: {
231
+ noRecordHistory: true
232
+ }
233
+ },
192
234
  conditionDisplay: 'contentType == "text"'
193
235
  }
194
236
  ]
@@ -126,7 +126,8 @@ const ProductListPreset = [
126
126
  },
127
127
  styles: {
128
128
  position: {
129
- desktop: 'only-feature'
129
+ desktop: 'only-feature',
130
+ mobile: 'only-feature'
130
131
  }
131
132
  },
132
133
  advanced: {
@@ -519,7 +520,8 @@ const ProductListPreset = [
519
520
  },
520
521
  styles: {
521
522
  position: {
522
- desktop: 'only-feature'
523
+ desktop: 'only-feature',
524
+ mobile: 'only-feature'
523
525
  }
524
526
  },
525
527
  advanced: {
@@ -3,31 +3,21 @@ import { getDynamicSourceLocales } from '../../../../helpers.js';
3
3
  const getButtonDynamicSourceLocales = ({ setting, builderProps, pageContext })=>{
4
4
  const baseProps = {
5
5
  pageContext,
6
- isLiquid: true,
7
6
  uid: builderProps?.uid
8
7
  };
9
- const variantSelectionRequiredMessage = getDynamicSourceLocales({
10
- ...baseProps,
11
- translate: setting?.translate,
12
- settingId: 'variantSelectionRequiredMessage',
13
- val: setting?.variantSelectionRequiredMessage
14
- });
15
- const unavailableButtonLabel = getDynamicSourceLocales({
16
- ...baseProps,
17
- val: 'Unavailable',
18
- settingId: 'unavailableLabel',
19
- translate: setting?.translate ? 'unavailableLabel' : undefined
20
- });
21
- const outOfStockButtonLabel = getDynamicSourceLocales({
22
- ...baseProps,
23
- settingId: 'outOfStockLabel',
24
- val: setting?.outOfStockLabel,
25
- translate: setting?.translate ? 'outOfStockLabel' : undefined
26
- });
8
+ const getLocale = (settingId, val, translate)=>{
9
+ const locale = getDynamicSourceLocales({
10
+ ...baseProps,
11
+ translate: setting?.translate ? translate : undefined,
12
+ settingId,
13
+ val: val ?? ''
14
+ });
15
+ return locale;
16
+ };
27
17
  return {
28
- outOfStockButtonLabel: pageContext?.isPreviewing ? outOfStockButtonLabel : `{{${outOfStockButtonLabel}}}`,
29
- unavailableButtonLabel: pageContext?.isPreviewing ? unavailableButtonLabel : `{{${unavailableButtonLabel}}}`,
30
- variantSelectionRequiredMessage: pageContext?.isPreviewing ? variantSelectionRequiredMessage : `{{${variantSelectionRequiredMessage}}}`
18
+ outOfStockButtonLabel: getLocale('outOfStockLabel', setting?.outOfStockLabel, 'outOfStockLabel'),
19
+ unavailableButtonLabel: getLocale('unavailableLabel', 'Unavailable', 'unavailableLabel'),
20
+ variantSelectionRequiredMessage: getLocale('variantSelectionRequiredMessage', setting?.variantSelectionRequiredMessage, 'variantSelectionRequiredMessage')
31
21
  };
32
22
  };
33
23
 
@@ -187,6 +187,48 @@ const SettingUIV2 = [
187
187
  id: 'textBadgeShadow',
188
188
  state: 'normal'
189
189
  },
190
+ options: {
191
+ updateFields: [
192
+ {
193
+ field: 'enable',
194
+ settingId: 'hasShadow',
195
+ state: 'normal'
196
+ }
197
+ ]
198
+ },
199
+ controlChangeTrigger: {
200
+ settings: [
201
+ {
202
+ condition: `shapeShadow.normal.enable === true`,
203
+ source: [
204
+ 'shapeShadow',
205
+ 'hasShadow'
206
+ ],
207
+ action: {
208
+ controlId: 'hasShadow',
209
+ groupType: 'style',
210
+ controlType: 'style',
211
+ newValue: true
212
+ }
213
+ },
214
+ {
215
+ condition: `shapeShadow.normal.enable === false`,
216
+ source: [
217
+ 'shapeShadow',
218
+ 'hasShadow'
219
+ ],
220
+ action: {
221
+ controlId: 'hasShadow',
222
+ groupType: 'style',
223
+ controlType: 'style',
224
+ newValue: false
225
+ }
226
+ }
227
+ ],
228
+ options: {
229
+ noRecordHistory: true
230
+ }
231
+ },
190
232
  conditionDisplay: 'contentType == "text"'
191
233
  }
192
234
  ]
@@ -124,7 +124,8 @@ const ProductListPreset = [
124
124
  },
125
125
  styles: {
126
126
  position: {
127
- desktop: 'only-feature'
127
+ desktop: 'only-feature',
128
+ mobile: 'only-feature'
128
129
  }
129
130
  },
130
131
  advanced: {
@@ -517,7 +518,8 @@ const ProductListPreset = [
517
518
  },
518
519
  styles: {
519
520
  position: {
520
- desktop: 'only-feature'
521
+ desktop: 'only-feature',
522
+ mobile: 'only-feature'
521
523
  }
522
524
  },
523
525
  advanced: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.706",
3
+ "version": "2.0.0-dev.708",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",