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