@gem-sdk/components 2.0.0-dev.332 → 2.0.0-dev.334

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 (38) hide show
  1. package/dist/cjs/post-purchase/product/settings/product-image/ProductFeatureImage.js +33 -0
  2. package/dist/cjs/post-purchase/product/settings/product-image/ProductGalleryImage.js +85 -0
  3. package/dist/cjs/post-purchase/product/settings/product-image/ProductImageLayoutSetting.js +69 -0
  4. package/dist/cjs/post-purchase/product/settings/product-image/ProductImages.js +3 -1
  5. package/dist/cjs/post-purchase/product/settings/product-image/uiV1.js +42 -0
  6. package/dist/cjs/product/components/ProductBadge/common/getAttrs.js +74 -0
  7. package/dist/cjs/product/components/ProductBadge/common/getClasses.js +79 -0
  8. package/dist/cjs/product/components/ProductBadge/common/getStyles.js +144 -0
  9. package/dist/cjs/product/components/ProductBadge/constants.js +1 -9
  10. package/dist/cjs/product/components/ProductBadge/index.js +125 -117
  11. package/dist/cjs/product/components/ProductBadge/index.liquid.js +97 -111
  12. package/dist/cjs/product/components/ProductBadge/utils/common.js +11 -0
  13. package/dist/cjs/product/components/ProductBadge/utils/getRotateShape.js +10 -5
  14. package/dist/cjs/product/components/ProductBadge/utils/shape.js +14 -1
  15. package/dist/cjs/product/index.js +1 -1
  16. package/dist/cjs/product/setting/product-badge/configs/settings.js +72 -93
  17. package/dist/cjs/product/setting/product-badge/configs/uiV2.js +93 -15
  18. package/dist/esm/post-purchase/product/settings/product-image/ProductFeatureImage.js +31 -0
  19. package/dist/esm/post-purchase/product/settings/product-image/ProductGalleryImage.js +83 -0
  20. package/dist/esm/post-purchase/product/settings/product-image/ProductImageLayoutSetting.js +67 -0
  21. package/dist/esm/post-purchase/product/settings/product-image/ProductImages.js +3 -1
  22. package/dist/esm/post-purchase/product/settings/product-image/uiV1.js +40 -0
  23. package/dist/esm/product/components/ProductBadge/common/getAttrs.js +67 -0
  24. package/dist/esm/product/components/ProductBadge/common/getClasses.js +70 -0
  25. package/dist/esm/product/components/ProductBadge/common/getStyles.js +137 -0
  26. package/dist/esm/product/components/ProductBadge/constants.js +2 -5
  27. package/dist/esm/product/components/ProductBadge/index.js +128 -120
  28. package/dist/esm/product/components/ProductBadge/index.liquid.js +99 -113
  29. package/dist/esm/product/components/ProductBadge/utils/common.js +12 -2
  30. package/dist/esm/product/components/ProductBadge/utils/getRotateShape.js +10 -5
  31. package/dist/esm/product/components/ProductBadge/utils/shape.js +14 -1
  32. package/dist/esm/product/index.js +1 -1
  33. package/dist/esm/product/setting/product-badge/configs/settings.js +72 -93
  34. package/dist/esm/product/setting/product-badge/configs/uiV2.js +93 -15
  35. package/dist/types/index.d.ts +1 -3
  36. package/package.json +2 -2
  37. package/dist/cjs/product/components/ProductBadge/hooks/useProductBadgeStyles.js +0 -83
  38. package/dist/esm/product/components/ProductBadge/hooks/useProductBadgeStyles.js +0 -81
@@ -1,132 +1,118 @@
1
- import { makeGlobalSize, template, dataStringify, RenderIf, composeTypographyClassName, composeTypographyStyle, getStyleShadow, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
1
+ import { template, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { getSettingPreloadData } from '../../../helpers.js';
3
- import { WRAPPER_CLASS, SHAPE_CLASS, CONTENT_CLASS, IS_LIQUID } from './constants.js';
4
- import { getAlignShape, getSize, convertToStyle, getWrapperStyle, getShapeWrapperPadding, checkDiscountContentProductBadge } from './utils/common.js';
5
- import { getShapePosition } from './utils/getShapePosition.js';
6
- import { composeShapeStyleByPosition, composeTextStyleByPosition } from './utils/getRotateShape.js';
7
- import { getStyleAdvanced } from './utils/getStyleAdvanced.js';
3
+ import { checkDiscountContentProductBadge } from './utils/common.js';
8
4
  import { generateBadgeContent } from './utils/generateLiquidContent.js';
9
- import { getWhiteSpaceStyle } from './utils/getWhiteSpace.js';
10
5
  import { renderBadgeInFirstTime } from './utils/renderBadgeLiquid.js';
11
- import { getShape } from './utils/shape.js';
12
- import { getStyleShadowV2, getStyleBackground, getStyleBorder, getStyleCornerRadius } from './utils/stylesV2.js';
6
+ import { createStyle, createClass, createAttr } from '@gem-sdk/system';
7
+ import { getWrapperClasses, getSubWrapperClass, getTextContainerClasses, getTextWrapperClasses, getTextContentClasses, getImageContainerClasses, getImageClasses } from './common/getClasses.js';
8
+ import { getContainerStyle, getSubWrapperStyle, getContentStyleInternal, getTextBadgeWrapperStyles, getTextContentStyle, getImageContainerStyles } from './common/getStyles.js';
9
+ import { getSubWrapperAttrs, getContainerAttrs, getTextContentAttrs, getImageAttr } from './common/getAttrs.js';
13
10
 
14
- const ProductBadge = ({ styles, builderProps, isInsideProductImage, builderAttrs, setting, style, imageData, dotData })=>{
15
- const isTextBadge = setting?.contentType === 'text';
16
- const shape = getShape(setting?.shape);
17
- const shapeAlignClass = getAlignShape(styles?.align, isInsideProductImage);
18
- const shapePosition = getShapePosition({
19
- positionType: styles?.position,
20
- isLiquid: IS_LIQUID,
21
- navigationPosition: undefined,
22
- dataImage: {
23
- ...imageData,
24
- ...dotData
25
- }
26
- });
27
- const wrapperStyles = getWrapperStyle(IS_LIQUID);
28
- // currently use imageSize v1, update later
29
- const badgeSize = isTextBadge ? styles?.textSizeV2 : styles?.imageSize;
30
- const sizeStyles = isTextBadge ? getSize(shape, badgeSize) : getSize(undefined, badgeSize);
31
- const getBorderStyles = ()=>{
32
- return isTextBadge ? shape?.supportBorder ? getStyleBorder(styles?.textBadgeBorder) : {} : getStyleBorder(styles?.imageBadgeBorder);
33
- };
34
- const getCornerStyles = ()=>isTextBadge ? getStyleCornerRadius(styles?.textBadgeCorner, shape?.shapeRadius) : getStyleCornerRadius(styles?.imageBadgeCorner, shape?.shapeRadius);
35
- const borderStyles = getBorderStyles();
36
- const cornerStyles = getCornerStyles();
37
- const paddingShape = getShapeWrapperPadding(shape?.ratio);
38
- const textBadgePadding = makeGlobalSize(styles?.textSizeV2).padding;
39
- const imageBadgePadding = makeGlobalSize(styles?.imageSizeV2).padding;
40
- const isDropOutsideProductImage = setting?.positionWithImage === 'outside';
11
+ const ProductBadge = (props)=>{
12
+ const { styles, setting } = props;
13
+ const isTextBadge = setting?.shape !== 'image';
41
14
  const isDiscountContent = checkDiscountContentProductBadge(setting?.displayContent);
42
- const shadowStyles = getStyleShadowV2('.product-badge-item', isTextBadge ? styles?.textBadgeShadow : styles?.imageBadgeShadow);
15
+ const containerStyle = createStyle({
16
+ ...getContainerStyle(props)
17
+ });
18
+ const wrapperClass = createClass({
19
+ ...getWrapperClasses(props)
20
+ });
21
+ const subWrapperClass = createClass({
22
+ ...getSubWrapperClass(props)
23
+ });
24
+ const subWrapperStyle = createStyle({
25
+ ...getSubWrapperStyle(props)
26
+ });
27
+ const subWrapperAttrs = createAttr({
28
+ ...getSubWrapperAttrs(props)
29
+ });
30
+ const contentStyleInternal = getContentStyleInternal(props);
31
+ const textContentContainerClasses = createClass({
32
+ ...getTextContainerClasses()
33
+ });
34
+ const containerAttrs = createAttr({
35
+ ...getContainerAttrs(props)
36
+ });
37
+ const textContentWrapperClasses = createClass({
38
+ ...getTextWrapperClasses()
39
+ });
40
+ const textContentWrapperStyle = createStyle({
41
+ ...getTextBadgeWrapperStyles({
42
+ setting,
43
+ styles
44
+ })
45
+ });
46
+ const textContentClasses = createClass({
47
+ ...getTextContentClasses(styles)
48
+ });
49
+ const textContentStyle = createStyle({
50
+ ...getTextContentStyle({
51
+ setting,
52
+ styles
53
+ })
54
+ });
55
+ const textContentAttrs = createAttr({
56
+ ...getTextContentAttrs()
57
+ });
58
+ const imageContainerClasses = createClass({
59
+ ...getImageContainerClasses()
60
+ });
61
+ const imageContainerStyles = createStyle({
62
+ ...getImageContainerStyles({
63
+ setting,
64
+ styles
65
+ })
66
+ });
67
+ const imageClass = createClass({
68
+ ...getImageClasses()
69
+ });
70
+ const imageAttr = createAttr({
71
+ ...getImageAttr({
72
+ setting
73
+ })
74
+ });
43
75
  return template`
44
76
  {% if product %}
45
77
  ${generateBadgeContent(setting?.displayContent)}
46
78
  ${renderBadgeInFirstTime(setting?.displayTrigger, isDiscountContent, isTextBadge)}
47
79
  <gp-product-badge
48
- data-id="${builderProps?.uid}"
49
- class="gp-product-badge !gp-max-w-none gp-shrink-0 ${builderProps?.uid} ${builderProps?.builderData?.advanced?.cssClass || ''} {{className}}"
50
- id="g-product-badge-${builderProps?.uid}"
51
- gp-data='${dataStringify({
52
- displayContent: setting?.displayContent,
53
- minPrice: '{{ minPriceValue }}',
54
- variantIDs: '{{ product.variants | map: "id" | json | escape }}',
55
- variantInventoryQuantities: '{{ product.variants | map: "inventory_quantity" | json | escape }}',
56
- amountDiscount: '{{amountDiscountValue}}',
57
- percentDiscount: '{{percentDiscountValue}}',
58
- price: '{{price}}',
59
- displayTrigger: setting?.displayTrigger,
60
- uid: builderProps?.uid,
61
- productCreatedAt: '{{product.created_at | date: "%Y-%m-%d" }}',
62
- productTags: '{{ product.tags | join: "," }}',
63
- isTextBadge
64
- })}'
65
- style="${{
66
- ...!isDropOutsideProductImage && {
67
- '--pos': 'absolute'
68
- },
69
- ...wrapperStyles,
70
- ...getStyleAdvanced(!isDropOutsideProductImage ? {
71
- ...shapePosition,
72
- ...sizeStyles
73
- } : {}, style)
74
- }}"
80
+ ${{
81
+ ...containerAttrs
82
+ }}
83
+ class="containerClass"
84
+ style="${containerStyle}"
75
85
  >
76
- <div class="${shapeAlignClass} ${isDropOutsideProductImage && isTextBadge ? '' : 'gp-h-full'}">
77
- <style>${shadowStyles}</style>
86
+ <div class="${wrapperClass}">
78
87
  <div
79
88
  ${{
80
- ...builderAttrs
89
+ ...subWrapperAttrs
81
90
  }}
82
- id=${builderProps?.uid}
83
- class="${!isDropOutsideProductImage && 'gp-h-full'}"
84
- style="${{
85
- ...isDropOutsideProductImage && sizeStyles
86
- }}"
91
+ class="${subWrapperClass}"
92
+ style="${subWrapperStyle}"
87
93
  >
88
- ${RenderIf(isTextBadge, template`
89
- <div class="${WRAPPER_CLASS} product-badge-item">
90
- <div
91
- class="${SHAPE_CLASS}"
92
- style="
93
- ${{
94
- ...convertToStyle(shape?.shapeStyle),
95
- ...composeShapeStyleByPosition(shape, styles?.position, isDropOutsideProductImage),
96
- ...getStyleBackground(!shape?.backgroundColorInText, styles?.badgeColorV2),
97
- ...paddingShape,
98
- ...borderStyles,
99
- ...cornerStyles
94
+ <style>${contentStyleInternal}</style>
95
+ ${RenderIf(isTextBadge, template`
96
+ <div class="${textContentContainerClasses}">
97
+ <div
98
+ class="${textContentWrapperClasses}"
99
+ style="${textContentWrapperStyle}"
100
+ >
101
+ <pre
102
+ ${{
103
+ ...textContentAttrs
100
104
  }}
101
- "
102
- >
103
- <pre
104
- id="product-badge-content"
105
- class="${CONTENT_CLASS} ${composeTypographyClassName(styles?.typo)}"
106
- style="${{
107
- ...getWhiteSpaceStyle(styles?.textSize),
108
- ...convertToStyle(shape?.textStyle),
109
- ...composeTextStyleByPosition(shape, styles?.position, isDropOutsideProductImage),
110
- ...composeTypographyStyle(styles?.typo),
111
- ...getStyleBackground(!!shape?.backgroundColorInText, styles?.badgeColorV2),
112
- ...getStyleShadow({
113
- value: styles?.typo?.custom?.textShadow,
114
- styleAppliedFor: 'text-shadow',
115
- isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none'
116
- }),
117
- ...textBadgePadding
118
- }}"
119
- >{{ content | replace: percentDiscountKey, percentDiscountValue | replace: amountDiscountKey, amountDiscountValue | replace: inventoryQuantityKey, inventoryQuantityValue | replace: minPriceKey, minPriceValue }}</pre>
120
- </div>
121
- </div>`, template`<div class="product-badge-item gp-w-full gp-h-full" style="${{
122
- ...imageBadgePadding,
123
- ...borderStyles,
124
- ...cornerStyles
125
- }}">
126
- <img src="${setting?.image?.src}" alt="${setting?.image?.alt}" loading="lazy"
127
- class="gp-object-cover gp-w-full gp-h-full"
128
- />
129
- </div>`)}
105
+ class="${textContentClasses}"
106
+ style="${textContentStyle}"
107
+ >{{ content | replace: percentDiscountKey, percentDiscountValue | replace: amountDiscountKey, amountDiscountValue | replace: inventoryQuantityKey, inventoryQuantityValue | replace: minPriceKey, minPriceValue }}</pre>
108
+ </div>
109
+ </div>`, template`<div class="${imageContainerClasses}" style="${imageContainerStyles}">
110
+ <img ${{
111
+ ...imageAttr
112
+ }}>
113
+ class="${imageClass}"
114
+ />
115
+ </div>`)}
130
116
  </div>
131
117
  </div>
132
118
  </gp-product-badge>
@@ -1,4 +1,4 @@
1
- import { cls, makeStyleResponsive, getResponsiveValueByScreen, formatMoney } from '@gem-sdk/core';
1
+ import { cls, formatMoney, makeStyleResponsive, getResponsiveValueByScreen } from '@gem-sdk/core';
2
2
  import { applyBundleDiscountAmount } from '../../../helpers/product-bundle.js';
3
3
  import { DiscountType } from '../../constants/product-bundle.js';
4
4
 
@@ -232,5 +232,15 @@ const getDeviceSpecificStyle = (style, currentDevice)=>{
232
232
  }
233
233
  return undefined;
234
234
  };
235
+ const getIsNoDiscountState = ({ props, product, currentVariant, moneyFormat, useProductCompareAtPrice })=>{
236
+ const { setting, 'bundle-item': bundleItem } = props;
237
+ const isDiscountContent = checkDiscountContentProductBadge(setting?.displayContent);
238
+ return isDiscountContent && checkNoDiscountState({
239
+ detail: product,
240
+ currentVariant,
241
+ bundleItem,
242
+ useProductCompareAtPrice
243
+ }, moneyFormat);
244
+ };
235
245
 
236
- export { checkDiscountContentProductBadge, checkNoDiscountState, convertToStyle, deviceWithSurfix, getAlignShape, getBadgeContent, getDeviceSpecificStyle, getShapePlacementClass, getShapeWrapperPadding, getSize, getWidthByShapeSize, getWrapperStyle };
246
+ export { checkDiscountContentProductBadge, checkNoDiscountState, convertToStyle, deviceWithSurfix, getAlignShape, getBadgeContent, getDeviceSpecificStyle, getIsNoDiscountState, getShapePlacementClass, getShapeWrapperPadding, getSize, getWidthByShapeSize, getWrapperStyle };
@@ -13,8 +13,11 @@ const composeShapeStyleByPosition = (shape, positionType, isDropOutsideProductIm
13
13
  if (!/\bright\b|\bbottom\b/.test(placement)) return;
14
14
  const key = `--t${device === 'desktop' ? '' : `-${device}`}`;
15
15
  let rotation = '';
16
- if (shape.id === SHAPE_ID.RIBBON && !isDropOutsideProductImage) {
17
- rotation = getRibbonRotation(placement);
16
+ if ([
17
+ SHAPE_ID.RIBBON,
18
+ SHAPE_ID.TRIANGLE
19
+ ].includes(shape.id) && !isDropOutsideProductImage) {
20
+ rotation = getRotation(placement);
18
21
  }
19
22
  if (isRibbon2Or3(shape.id, placement) && !isDropOutsideProductImage) {
20
23
  rotation = 'rotate(180deg)';
@@ -28,7 +31,7 @@ const composeShapeStyleByPosition = (shape, positionType, isDropOutsideProductIm
28
31
  });
29
32
  return result;
30
33
  };
31
- const getRibbonRotation = (placement)=>{
34
+ const getRotation = (placement)=>{
32
35
  switch(true){
33
36
  case placement === 'bottom-left':
34
37
  return 'rotate(-90deg)';
@@ -60,7 +63,9 @@ const composeTextStyleByPosition = (shape, positionType, isDropOutsideProductIma
60
63
  let rotation = '';
61
64
  const key = `--t${device === 'desktop' ? '' : `-${device}`}`;
62
65
  if (shape.id === SHAPE_ID.RIBBON && !isDropOutsideProductImage) {
63
- rotation = `translate(-10%, -30%) ${getTextRibbonRotation(placement)}`;
66
+ rotation = `translate(-10%, -30%) ${getRibbonRotation(placement)}`;
67
+ } else if (shape.id === SHAPE_ID.TRIANGLE && !isDropOutsideProductImage) {
68
+ rotation = `translate(-20%, -75%) ${getRibbonRotation(placement)}`;
64
69
  } else if (shape.id === SHAPE_ID.VERTICAL_RECTANGLE) {
65
70
  rotation = [
66
71
  'bottom',
@@ -78,7 +83,7 @@ const composeTextStyleByPosition = (shape, positionType, isDropOutsideProductIma
78
83
  });
79
84
  return result;
80
85
  };
81
- const getTextRibbonRotation = (placement)=>{
86
+ const getRibbonRotation = (placement)=>{
82
87
  switch(true){
83
88
  case placement.includes('bottom'):
84
89
  return 'rotate(135deg)';
@@ -80,8 +80,21 @@ const productBadgeShape = [
80
80
  wrapperWidth: 'auto',
81
81
  wrapperHeight: 'auto',
82
82
  shapeStyle: {
83
- clipPath: 'polygon( 0% 100%,14.744% 50%,0% 0%,82.051% 0%,100% 50%,82.051% 100%,0% 100% )'
83
+ clipPath: 'polygon( 0% 100%,14.744% 50%,0% 0%,82.051% 0%,100% 50%,82.051% 100%,0% 100%)'
84
84
  }
85
+ },
86
+ {
87
+ id: SHAPE_ID.TRIANGLE,
88
+ wrapperWidth: '132px',
89
+ wrapperHeight: '132px',
90
+ shapeStyle: {
91
+ clipPath: 'polygon(0% 0%, 0% 100%, 100% 0%)'
92
+ },
93
+ textStyle: {
94
+ '--t': 'translate(-20%, -75%) rotate(-45deg)',
95
+ width: 'calc(100% * sqrt(2))'
96
+ },
97
+ ratio: 1
85
98
  }
86
99
  ];
87
100
  const shapeMap = new Map(productBadgeShape.map((shape)=>[
@@ -19,8 +19,8 @@ export { default as ProductList } from './components/ProductList/ProductList.js'
19
19
  import './components/ProductBundle/common/styles.js';
20
20
  import './components/ProductBundle/common/classes.js';
21
21
  import './components/ProductBadge/constants.js';
22
- import './components/ProductBadge/utils/shape.js';
23
22
  import './components/ProductBadge/types.js';
23
+ import './components/ProductBadge/utils/shape.js';
24
24
  import config from './setting/Product.js';
25
25
  import config$1 from './setting/ProductQuantity.js';
26
26
  import config$2 from './setting/ProductTitle.js';
@@ -31,20 +31,68 @@ const ProductBadgeSettings = [
31
31
  }
32
32
  },
33
33
  {
34
- id: 'contentType',
35
- type: 'layout-segment',
34
+ id: 'shape',
35
+ type: 'badge-style',
36
36
  label: 'Content',
37
- iconViewBox: '0 0 116 72',
37
+ iconViewBox: '0 0 80 48',
38
38
  enableItemBackground: true,
39
- default: 'text',
39
+ itemPerRow: 2,
40
+ itemSpacing: 'large',
41
+ default: 'horizontal_rectangle',
40
42
  options: [
41
43
  {
42
- value: 'text',
43
- type: 'badge-layout'
44
+ value: 'image',
45
+ label: 'Image',
46
+ type: 'badge-layout',
47
+ iconName: 'gp-product-badge-image'
44
48
  },
45
49
  {
46
- value: 'image',
47
- type: 'badge-layout'
50
+ value: 'horizontal_rectangle',
51
+ label: 'Text horizontal',
52
+ type: 'badge-layout',
53
+ iconName: 'gp-product-badge-horizontal-rectangle'
54
+ },
55
+ {
56
+ value: 'ribbon',
57
+ label: 'Text corner 1',
58
+ type: 'badge-layout',
59
+ iconName: 'gp-product-badge-ribbon'
60
+ },
61
+ {
62
+ value: 'ribbon_2',
63
+ label: 'Text ribbon 1',
64
+ type: 'badge-layout',
65
+ iconName: 'gp-product-badge-ribbon-2'
66
+ },
67
+ {
68
+ value: 'triangle',
69
+ label: 'Text corner 2',
70
+ type: 'badge-layout',
71
+ iconName: 'gp-product-badge-triangle'
72
+ },
73
+ {
74
+ value: 'ribbon_3',
75
+ label: 'Text ribbon 2',
76
+ type: 'badge-layout',
77
+ iconName: 'gp-product-badge-ribbon-3'
78
+ },
79
+ {
80
+ value: 'square',
81
+ label: 'Text square',
82
+ type: 'badge-layout',
83
+ iconName: 'gp-product-badge-square'
84
+ },
85
+ {
86
+ value: 'star',
87
+ label: 'Text star',
88
+ type: 'badge-layout',
89
+ iconName: 'gp-product-badge-star'
90
+ },
91
+ {
92
+ value: 'vertical_rectangle',
93
+ label: 'Text vertical',
94
+ type: 'badge-layout',
95
+ iconName: 'gp-product-badge-vertical-rectangle'
48
96
  }
49
97
  ]
50
98
  },
@@ -78,10 +126,10 @@ const ProductBadgeSettings = [
78
126
  ]
79
127
  },
80
128
  {
81
- id: 'shape',
129
+ id: 'contentType',
82
130
  label: 'Shape',
83
- type: 'shape-selector',
84
- default: 'horizontal_rectangle'
131
+ type: 'input',
132
+ default: 'text'
85
133
  }
86
134
  ]
87
135
  },
@@ -104,10 +152,18 @@ const ProductBadgeSettings = [
104
152
  custom: {
105
153
  fontSize: {
106
154
  desktop: '15px'
155
+ },
156
+ lineHeight: {
157
+ desktop: '120%'
158
+ },
159
+ fontWeight: '400',
160
+ fontFamily: 'Assistant',
161
+ textShadow: {
162
+ type: 'none'
107
163
  }
108
164
  },
109
165
  attrs: {
110
- color: 'text-3'
166
+ color: '#121212'
111
167
  }
112
168
  },
113
169
  hiddenSetting: {
@@ -360,19 +416,13 @@ const ProductBadgeSettings = [
360
416
  default: false
361
417
  },
362
418
  {
363
- id: 'textSize',
419
+ id: 'textSizeV2',
364
420
  type: 'size-setting',
365
- label: '',
366
- disableShapeLinkedTooltip: 'Use other badge shape to resize without proportions',
367
421
  devices: {
368
422
  desktop: {
369
423
  default: {
370
424
  width: 'auto',
371
425
  height: 'auto',
372
- shapeLinked: false,
373
- disableShapeLinked: true,
374
- hiddenShape: true,
375
- shape: 'custom',
376
426
  padding: {
377
427
  top: '8px',
378
428
  bottom: '8px',
@@ -382,41 +432,6 @@ const ProductBadgeSettings = [
382
432
  }
383
433
  }
384
434
  },
385
- settingConfig: {
386
- width: {
387
- displayOptions: [
388
- 'auto'
389
- ]
390
- },
391
- height: {
392
- displayOptions: [
393
- 'auto'
394
- ]
395
- }
396
- },
397
- hiddenSettings: [
398
- 'gap',
399
- 'proportion'
400
- ]
401
- },
402
- {
403
- id: 'textSizeV2',
404
- type: 'size-setting',
405
- devices: {
406
- desktop: {
407
- default: {
408
- width: 'Auto',
409
- height: 'Auto',
410
- padding: {
411
- type: 'medium',
412
- top: '4px',
413
- bottom: '4px',
414
- left: '16px',
415
- right: '16px'
416
- }
417
- }
418
- }
419
- },
420
435
  settingConfig: {
421
436
  width: {
422
437
  displayOptions: [
@@ -452,9 +467,8 @@ const ProductBadgeSettings = [
452
467
  ]
453
468
  },
454
469
  {
455
- id: 'imageSize',
470
+ id: 'imageSizeV2',
456
471
  type: 'size-setting',
457
- label: '',
458
472
  disableShapeLinkedTooltip: 'Use other badge shape to resize without proportions',
459
473
  devices: {
460
474
  desktop: {
@@ -467,42 +481,6 @@ const ProductBadgeSettings = [
467
481
  }
468
482
  }
469
483
  },
470
- settingConfig: {
471
- width: {
472
- displayOptions: [
473
- 'auto'
474
- ]
475
- },
476
- height: {
477
- displayOptions: [
478
- 'auto'
479
- ]
480
- }
481
- },
482
- hiddenSettings: [
483
- 'gap',
484
- 'proportion',
485
- 'padding'
486
- ]
487
- },
488
- {
489
- id: 'imageSizeV2',
490
- type: 'size-setting',
491
- devices: {
492
- desktop: {
493
- default: {
494
- width: 'Auto',
495
- height: 'Auto',
496
- padding: {
497
- type: 'medium',
498
- top: '4px',
499
- bottom: '4px',
500
- left: '16px',
501
- right: '16px'
502
- }
503
- }
504
- }
505
- },
506
484
  settingConfig: {
507
485
  width: {
508
486
  displayOptions: [
@@ -534,7 +512,8 @@ const ProductBadgeSettings = [
534
512
  },
535
513
  hiddenSettings: [
536
514
  'shape',
537
- 'gap'
515
+ 'gap',
516
+ 'padding'
538
517
  ]
539
518
  },
540
519
  {