@gem-sdk/components 2.0.0-dev.385 → 2.0.0-dev.386

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.
Files changed (30) hide show
  1. package/dist/cjs/icon/setting/configs/settings.js +5 -2
  2. package/dist/cjs/product/components/ProductBadge/common/getStyles.js +3 -2
  3. package/dist/cjs/product/components/ProductProperties/ProductProperties.liquid.js +1 -1
  4. package/dist/cjs/product/components/ProductProperties/ProductPropertyInput/common/getStyles.js +2 -2
  5. package/dist/cjs/product/components/ProductProperties/ProductPropertySelect/common/getStyles.js +2 -2
  6. package/dist/cjs/product/components/ProductProperties/common/getAttrs.js +2 -2
  7. package/dist/cjs/product/components/ProductQuantity/common/getStyles.js +19 -16
  8. package/dist/cjs/product/components/ProductQuantity/index.js +5 -3
  9. package/dist/cjs/product/setting/product-badge/configs/settings.js +8 -4
  10. package/dist/cjs/product/setting/product-badge/configs/uiV2.js +3 -3
  11. package/dist/cjs/product/setting/product-properties/configs/settingsV2.js +5 -20
  12. package/dist/cjs/product/setting/product-properties/configs/uiV2.js +169 -6
  13. package/dist/cjs/product/setting/product-quantity/configs/settings.js +48 -28
  14. package/dist/cjs/product/setting/product-quantity/configs/uiV2.js +54 -19
  15. package/dist/esm/icon/setting/configs/settings.js +5 -2
  16. package/dist/esm/product/components/ProductBadge/common/getStyles.js +3 -2
  17. package/dist/esm/product/components/ProductProperties/ProductProperties.liquid.js +1 -1
  18. package/dist/esm/product/components/ProductProperties/ProductPropertyInput/common/getStyles.js +3 -3
  19. package/dist/esm/product/components/ProductProperties/ProductPropertySelect/common/getStyles.js +3 -3
  20. package/dist/esm/product/components/ProductProperties/common/getAttrs.js +2 -2
  21. package/dist/esm/product/components/ProductQuantity/common/getStyles.js +20 -17
  22. package/dist/esm/product/components/ProductQuantity/index.js +5 -3
  23. package/dist/esm/product/setting/product-badge/configs/settings.js +8 -4
  24. package/dist/esm/product/setting/product-badge/configs/uiV2.js +3 -3
  25. package/dist/esm/product/setting/product-properties/configs/settingsV2.js +5 -20
  26. package/dist/esm/product/setting/product-properties/configs/uiV2.js +169 -6
  27. package/dist/esm/product/setting/product-quantity/configs/settings.js +48 -28
  28. package/dist/esm/product/setting/product-quantity/configs/uiV2.js +54 -19
  29. package/dist/types/index.d.ts +4 -3
  30. package/package.json +2 -2
@@ -273,7 +273,7 @@ const SettingUIV2 = [
273
273
  en: 'Shadow'
274
274
  },
275
275
  setting: {
276
- id: 'boxShadow',
276
+ id: 'buttonBoxShadow',
277
277
  state: 'hover'
278
278
  }
279
279
  }
@@ -307,15 +307,14 @@ const SettingUIV2 = [
307
307
  controls: [
308
308
  {
309
309
  setting: {
310
- id: 'typo',
311
- state: 'normal'
310
+ id: 'typo'
312
311
  },
313
312
  layout: 'vertical',
314
313
  options: {
315
314
  updateFields: [
316
315
  {
317
316
  field: 'attrs.color',
318
- settingId: 'inputColor',
317
+ settingId: 'textColor',
319
318
  state: 'normal'
320
319
  }
321
320
  ]
@@ -324,7 +323,7 @@ const SettingUIV2 = [
324
323
  settings: [
325
324
  {
326
325
  action: {
327
- controlId: 'inputColor',
326
+ controlId: 'textColor',
328
327
  valueFromField: 'attrs.color',
329
328
  groupType: 'style',
330
329
  controlType: 'style',
@@ -394,13 +393,9 @@ const SettingUIV2 = [
394
393
  label: {
395
394
  en: 'Text color'
396
395
  },
397
- controlConfig: {
398
- id: 'input-color-hover',
399
- type: 'color-picker-v2',
400
- linkWithSetting: {
401
- name: 'typo',
402
- field: 'hover.attrs.color'
403
- }
396
+ setting: {
397
+ id: 'textColor',
398
+ state: 'hover'
404
399
  }
405
400
  },
406
401
  {
@@ -436,13 +431,9 @@ const SettingUIV2 = [
436
431
  label: {
437
432
  en: 'Shadow'
438
433
  },
439
- controlConfig: {
440
- id: 'input-shadow-hover',
441
- type: 'shadow-v2',
442
- linkWithSetting: {
443
- name: 'typo',
444
- field: 'hover.attrs.textShadow'
445
- }
434
+ setting: {
435
+ id: 'inputBoxShadow',
436
+ state: 'hover'
446
437
  }
447
438
  }
448
439
  ]
@@ -531,6 +522,50 @@ const SettingUIV2 = [
531
522
  setting: {
532
523
  id: 'boxShadow',
533
524
  state: 'normal'
525
+ },
526
+ options: {
527
+ updateFields: [
528
+ {
529
+ field: 'normal.enable',
530
+ settingId: 'advanced.hasBoxShadow',
531
+ state: 'normal'
532
+ }
533
+ ]
534
+ },
535
+ controlChangeTrigger: {
536
+ settings: [
537
+ {
538
+ condition: `boxShadow.normal.enable === true`,
539
+ source: [
540
+ 'boxShadow',
541
+ 'hasBoxShadow'
542
+ ],
543
+ action: {
544
+ controlId: 'hasBoxShadow',
545
+ groupType: 'advanced',
546
+ controlType: 'advanced',
547
+ state: 'normal',
548
+ newValue: true
549
+ }
550
+ },
551
+ {
552
+ condition: `boxShadow.normal.enable === false`,
553
+ source: [
554
+ 'boxShadow',
555
+ 'hasBoxShadow'
556
+ ],
557
+ action: {
558
+ controlId: 'hasBoxShadow',
559
+ groupType: 'advanced',
560
+ controlType: 'advanced',
561
+ state: 'normal',
562
+ newValue: false
563
+ }
564
+ }
565
+ ],
566
+ options: {
567
+ noRecordHistory: true
568
+ }
534
569
  }
535
570
  }
536
571
  ]
@@ -114,7 +114,9 @@ const IconSettings = [
114
114
  type: 'shadow-v2',
115
115
  devices: {
116
116
  desktop: {
117
- default: {}
117
+ default: {
118
+ enable: false
119
+ }
118
120
  }
119
121
  },
120
122
  compoDefaultValue: {
@@ -125,7 +127,8 @@ const IconSettings = [
125
127
  blur: '12px',
126
128
  spread: '0px',
127
129
  color: 'rgba(18, 18, 18, 0.2)',
128
- angle: 45
130
+ angle: 45,
131
+ enable: true
129
132
  }
130
133
  }
131
134
  }
@@ -52,7 +52,7 @@ const getTextContentStyle = ({ styles, setting })=>{
52
52
  ...getStyleShadow({
53
53
  value: styles?.typo?.custom?.textShadow,
54
54
  styleAppliedFor: 'text-shadow',
55
- isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none'
55
+ isEnableShadow: styles?.typo?.custom?.hasShadowText
56
56
  }),
57
57
  ...getStyleBackground(!!shape?.backgroundColorInText, styles?.badgeColorV2),
58
58
  ...textBadgePadding
@@ -85,7 +85,8 @@ const getTextBadgeWrapperStyles = ({ styles, setting })=>{
85
85
  ...cornerStyles,
86
86
  ...composeShapeStyleByPosition(shape, styles?.position, isDropOutsideProductImage),
87
87
  ...getStyleBackground(!shape?.backgroundColorInText, styles?.badgeColorV2),
88
- ...paddingShape
88
+ ...paddingShape,
89
+ height: shape?.ratio === 1 ? '0px' : '100%'
89
90
  };
90
91
  };
91
92
  const getImageContainerStyles = ({ styles, setting })=>{
@@ -55,7 +55,7 @@ const ProductProperties = ({ setting, styles, builderProps, advanced, pageContex
55
55
  }} class="${liquidTagClasses}"
56
56
  style="${wrapperStyles}"
57
57
  >
58
- ${RenderIf(isDisplayLabel, `<div class="${labelWrapperClasses}">
58
+ ${RenderIf(isDisplayLabel, template`<div class="${labelWrapperClasses}">
59
59
  <label htmlFor="${uniqId}-${name}" class="${labelClasses}" style="${labelStyles}}">
60
60
  ${displayLabel}
61
61
  <span style="${labelContentStyles}">${labelContent}</span>
@@ -1,7 +1,7 @@
1
- import { composeTypographyStyle, makeStyleResponsive, makeWidth, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, composeRadius, composeShadow } from '@gem-sdk/core';
1
+ import { composeTypographyStyle, makeStyleResponsive, makeWidth, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, composeRadius, getStyleShadowState } from '@gem-sdk/core';
2
2
 
3
3
  const getStyles = (styles)=>{
4
- const { valueBgColor, valueTextColor, valueTypography, valueTypo, fullWidth, width, height, borderInput, borderRadius, shadowInput } = styles ?? {};
4
+ const { valueBgColor, valueTextColor, valueTypography, valueTypo, fullWidth, width, height, borderInput, borderRadius, hasShadowInput, shadowInput } = styles ?? {};
5
5
  const appendTypoStyle = composeTypographyStyle(valueTypo, valueTypography);
6
6
  const widthStyle = makeStyleResponsive('w', makeWidth(width, fullWidth));
7
7
  const heightStyle = height ? makeStyleResponsive('h', height) : {};
@@ -14,7 +14,7 @@ const getStyles = (styles)=>{
14
14
  ...getGlobalColorStateStyle('c', valueTextColor),
15
15
  ...heightStyle,
16
16
  ...composeRadius(borderRadius),
17
- ...composeShadow(shadowInput),
17
+ ...getStyleShadowState(shadowInput, 'box-shadow', hasShadowInput),
18
18
  ...appendTypoStyle
19
19
  };
20
20
  };
@@ -1,7 +1,7 @@
1
- import { makeStyleResponsive, makeWidth, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor, composeRadius, composeShadow, composeTypographyStyle, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle } from '@gem-sdk/core';
1
+ import { makeStyleResponsive, makeWidth, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor, composeRadius, getStyleShadowState, composeTypographyStyle, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle } from '@gem-sdk/core';
2
2
 
3
3
  const getSelectStyles = (styles)=>{
4
- const { fullWidth, width, height, borderInput, borderRadius, shadowInput } = styles ?? {};
4
+ const { fullWidth, width, height, borderInput, borderRadius, hasShadowInput, shadowInput } = styles ?? {};
5
5
  const widthStyle = makeStyleResponsive('w', makeWidth(width, fullWidth));
6
6
  const heightStyle = height ? makeStyleResponsive('h', height) : {};
7
7
  return {
@@ -11,7 +11,7 @@ const getSelectStyles = (styles)=>{
11
11
  ...handleConvertBorderWidth(borderInput),
12
12
  ...handleConvertBorderColor(borderInput),
13
13
  ...composeRadius(borderRadius),
14
- ...composeShadow(shadowInput)
14
+ ...getStyleShadowState(shadowInput, 'box-shadow', hasShadowInput)
15
15
  };
16
16
  };
17
17
  const getOptionStyles = (styles)=>{
@@ -5,13 +5,13 @@ const getWrapperLiquidAttrs = (uniqId, pageContext, setting)=>{
5
5
  return {
6
6
  'data-id': uniqId ?? '',
7
7
  'data-invalid': false,
8
- 'data-gp-setting': JSON.stringify(setting).replaceAll("'", '&#039;'),
8
+ 'data-gp-setting': JSON.stringify(setting).replaceAll(`"`, '&#34;'),
9
9
  'data-translate-setting': JSON.stringify({
10
10
  requiredMessage: requiredMessageDisplay,
11
11
  invalidEmailMessage: invalidEmailMessageDisplay,
12
12
  invalidLengthMessage: invalidLengthMessageDisplay,
13
13
  invalidNumberMessage: invalidNumberMessageDisplay
14
- })
14
+ }).replaceAll(`"`, '&#34;')
15
15
  };
16
16
  };
17
17
  const getWrapperTSXAttrs = (uniqId, currentProductId)=>{
@@ -1,4 +1,4 @@
1
- import { composeTypographyStyle, composeTypoHover, makeStyle, getGlobalColorStateStyle, handleConvertBorderStyle, handleConvertInputBorderWidth, handleConvertInputBorderColor, getStyleShadow, makeStyleResponsive, handleConvertBorderWidth, handleConvertBorderColor, composeRadius, makeStyleResponsiveState } from '@gem-sdk/core';
1
+ import { composeTypographyStyle, getResponsiveStyleShadow, makeStyle, getGlobalColorStateStyle, handleConvertBorderStyle, handleConvertInputBorderWidth, handleConvertInputBorderColor, getStyleShadow, makeStyleResponsive, handleConvertBorderWidth, handleConvertBorderColor, composeRadius, makeStyleResponsiveState } from '@gem-sdk/core';
2
2
 
3
3
  const addPxToValues = (input)=>Object.fromEntries(Object.entries(input).map(([device, states])=>[
4
4
  device,
@@ -34,16 +34,19 @@ const getInputBorderRadius = ({ qtyStyle, corner })=>{
34
34
  };
35
35
  const getInputStyle = (props)=>{
36
36
  const { styles, setting } = props;
37
- const { borderBtn, inputBackgroundColor, textColor, dividerColor, dividerStroke, corner } = styles ?? {};
37
+ const { borderBtn, inputBackgroundColor, textColor, dividerColor, dividerStroke, corner, inputBoxShadow } = styles ?? {};
38
38
  const { qtyStyle } = setting ?? {};
39
- const appendTypoStyle = composeTypographyStyle(styles?.typo?.normal, styles?.typography);
40
- const appendTypoHover = composeTypoHover(styles?.typo?.hover?.attrs);
39
+ const appendTypoStyle = composeTypographyStyle(styles?.typo, styles?.typography);
41
40
  const dividerWidth = getDividerWidth(dividerStroke);
42
41
  const dividerColorStyle = getDividerColorStyle(dividerColor);
42
+ const styleShadow = getResponsiveStyleShadow(inputBoxShadow, 'box-shadow', {
43
+ desktop: inputBoxShadow?.desktop ?? {},
44
+ tablet: inputBoxShadow?.tablet ?? inputBoxShadow?.desktop ?? {},
45
+ mobile: inputBoxShadow?.mobile ?? inputBoxShadow?.tablet ?? inputBoxShadow?.desktop ?? {}
46
+ });
43
47
  return {
44
48
  ...makeStyle({}),
45
49
  ...appendTypoStyle,
46
- ...appendTypoHover,
47
50
  ...getGlobalColorStateStyle('bg', inputBackgroundColor),
48
51
  ...getGlobalColorStateStyle('c', textColor),
49
52
  ...handleConvertBorderStyle(borderBtn),
@@ -52,21 +55,15 @@ const getInputStyle = (props)=>{
52
55
  ...qtyStyle === 'standard' ? dividerWidth : {},
53
56
  ...dividerColorStyle,
54
57
  ...getStyleShadow({
55
- value: styles?.typo?.normal?.custom?.textShadow,
58
+ value: styles?.typo?.custom?.textShadow,
56
59
  styleAppliedFor: 'text-shadow',
57
- isEnableShadow: styles?.typo?.normal?.custom?.textShadow?.type !== 'none',
58
- state: 'normal'
59
- }),
60
- ...getStyleShadow({
61
- value: styles?.typo?.hover?.attrs?.textShadow,
62
- styleAppliedFor: 'text-shadow',
63
- isEnableShadow: styles?.typo?.normal?.custom?.textShadow?.type !== 'none',
64
- state: 'hover'
60
+ isEnableShadow: styles?.typo?.custom?.hasShadowText
65
61
  }),
66
62
  ...getInputBorderRadius({
67
63
  qtyStyle,
68
64
  corner
69
- })
65
+ }),
66
+ ...styleShadow
70
67
  };
71
68
  };
72
69
  const getDeviceRadius = (device, buttonSide, corner)=>{
@@ -91,7 +88,12 @@ const getDeviceRadius = (device, buttonSide, corner)=>{
91
88
  }
92
89
  };
93
90
  };
94
- const getButtonStyle = ({ borderBtn, buttonWidth, buttonBackgroundColor, iconColor, corner, buttonSide })=>{
91
+ const getButtonStyle = ({ borderBtn, buttonWidth, buttonBackgroundColor, iconColor, corner, buttonSide, buttonBoxShadow })=>{
92
+ const styleShadow = getResponsiveStyleShadow(buttonBoxShadow, 'box-shadow', {
93
+ desktop: buttonBoxShadow?.desktop ?? {},
94
+ tablet: buttonBoxShadow?.tablet ?? buttonBoxShadow?.desktop ?? {},
95
+ mobile: buttonBoxShadow?.mobile ?? buttonBoxShadow?.tablet ?? buttonBoxShadow?.desktop ?? {}
96
+ });
95
97
  return {
96
98
  ...makeStyleResponsive('w', buttonWidth),
97
99
  ...getGlobalColorStateStyle('bg', buttonBackgroundColor),
@@ -103,7 +105,8 @@ const getButtonStyle = ({ borderBtn, buttonWidth, buttonBackgroundColor, iconCol
103
105
  ...getDeviceRadius('desktop', buttonSide, corner),
104
106
  ...getDeviceRadius('tablet', buttonSide, corner),
105
107
  ...getDeviceRadius('mobile', buttonSide, corner)
106
- })
108
+ }),
109
+ ...styleShadow
107
110
  };
108
111
  };
109
112
  const getContainerStyles = ({ inputHeight, align })=>{
@@ -15,7 +15,7 @@ const ProductQuantity = (props)=>{
15
15
  const { isInStock, ref } = useProductQuantity(props);
16
16
  const { qtyStyle, plusIcon, minusIcon } = setting;
17
17
  const defaultQty = setting.defaultQtyValue || 1;
18
- const { inputHeight, buttonBackgroundColor, backgroundColor, iconColor, inputBackgroundColor, textColor, align, borderBtn, buttonWidth, iconSizeCustom, corner } = styles;
18
+ const { inputHeight, buttonBackgroundColor, backgroundColor, iconColor, inputBackgroundColor, textColor, align, borderBtn, buttonWidth, iconSizeCustom, corner, buttonBoxShadow } = styles;
19
19
  const containerAttrs = createAttr({
20
20
  ...getContainerAttrs({
21
21
  isDisabled: !isInStock,
@@ -76,7 +76,8 @@ const ProductQuantity = (props)=>{
76
76
  buttonBackgroundColor,
77
77
  iconColor,
78
78
  corner,
79
- buttonSide: 'left'
79
+ buttonSide: 'left',
80
+ buttonBoxShadow
80
81
  })
81
82
  });
82
83
  const buttonLeftAttrs = createAttr({
@@ -100,7 +101,8 @@ const ProductQuantity = (props)=>{
100
101
  buttonBackgroundColor,
101
102
  iconColor,
102
103
  corner,
103
- buttonSide: 'right'
104
+ buttonSide: 'right',
105
+ buttonBoxShadow
104
106
  })
105
107
  });
106
108
  const buttonRightAttrs = createAttr({
@@ -103,6 +103,7 @@ const ProductBadgeSettings = [
103
103
  default: 'Sale {percent_discount} off',
104
104
  minHeight: 72,
105
105
  inputClass: '!pr-36',
106
+ isFallback: true,
106
107
  autoHeight: true,
107
108
  showPlusBtn: true,
108
109
  defaultRows: 1,
@@ -159,8 +160,9 @@ const ProductBadgeSettings = [
159
160
  },
160
161
  fontWeight: '400',
161
162
  fontFamily: 'Assistant',
163
+ hasShadowText: false,
162
164
  textShadow: {
163
- type: 'none'
165
+ enable: false
164
166
  }
165
167
  },
166
168
  attrs: {
@@ -462,6 +464,7 @@ const ProductBadgeSettings = [
462
464
  {
463
465
  id: 'imageSizeV2',
464
466
  type: 'size-setting',
467
+ hiddenShowMore: true,
465
468
  disableShapeLinkedTooltip: 'Use other badge shape to resize without proportions',
466
469
  devices: {
467
470
  desktop: {
@@ -469,7 +472,8 @@ const ProductBadgeSettings = [
469
472
  width: '20%',
470
473
  height: 'auto',
471
474
  shapeLinked: true,
472
- shape: 'original',
475
+ hiddenShape: true,
476
+ shape: 'custom',
473
477
  disableShapeLinked: true
474
478
  }
475
479
  }
@@ -504,9 +508,9 @@ const ProductBadgeSettings = [
504
508
  }
505
509
  },
506
510
  hiddenSettings: [
507
- 'shape',
508
511
  'gap',
509
- 'padding'
512
+ 'padding',
513
+ 'proportion'
510
514
  ]
511
515
  },
512
516
  {
@@ -70,9 +70,9 @@ const SettingUIV2 = [
70
70
  {
71
71
  id: 'content-badge',
72
72
  type: 'combo',
73
- iconName: 'polaris-plus',
73
+ iconName: 'polaris-edit',
74
74
  isHideClear: true,
75
- fixedValue: 'Edit',
75
+ fixedValue: 'Add...',
76
76
  popoverLabel: {
77
77
  en: 'Content'
78
78
  },
@@ -356,7 +356,7 @@ const SettingUIV2 = [
356
356
  en: 'Position'
357
357
  },
358
358
  label: {
359
- en: 'Position'
359
+ en: 'Choose'
360
360
  },
361
361
  layout: 'vertical',
362
362
  controls: [
@@ -282,7 +282,7 @@ const ProductPropertiesSettingsV2 = [
282
282
  placeholder: 'Auto',
283
283
  devices: {
284
284
  desktop: {
285
- default: '358px'
285
+ default: '100%'
286
286
  }
287
287
  },
288
288
  hide: true
@@ -475,25 +475,10 @@ const ProductPropertiesSettingsV2 = [
475
475
  {
476
476
  id: 'shadowInput',
477
477
  type: 'shadow-v2',
478
- devices: {
479
- desktop: {
480
- default: {
481
- normal: {}
482
- }
483
- }
484
- },
485
- compoDefaultValue: {
486
- desktop: {
487
- default: {
488
- normal: {
489
- type: 'shadow-1',
490
- distance: '4px',
491
- blur: '4px',
492
- spread: '0px',
493
- color: '#121212',
494
- angle: 45
495
- }
496
- }
478
+ default: {
479
+ normal: {
480
+ type: 'shadow-1',
481
+ enable: false
497
482
  }
498
483
  }
499
484
  },