@gem-sdk/components 2.0.0-dev.303 → 2.0.0-dev.305
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/banner/setting/presets/heroBanner1Col.js +14 -0
- package/dist/cjs/banner/setting/presets/heroBannerContentLeft.js +13 -0
- package/dist/cjs/banner/setting/presets/heroBannerContentRight.js +12 -0
- package/dist/cjs/banner/setting/presets/heroBannerParallax.js +14 -0
- package/dist/cjs/banner/setting/setting.js +6 -18
- package/dist/cjs/banner/setting/uiV1.js +1 -2
- package/dist/cjs/banner/setting/uiV2.js +4 -5
- package/dist/cjs/form/setting/form-dropdown/configs/uiV2.js +12 -0
- package/dist/cjs/post-purchase/button/common/getClasses.js +1 -1
- package/dist/cjs/post-purchase/button/common/getStyles.js +1 -1
- package/dist/cjs/post-purchase/callout-banner/components/CalloutText.js +2 -1
- package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +0 -8
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +1 -0
- package/dist/cjs/post-purchase/countdown-timer/components/common/getStyles.js +1 -1
- package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +1 -7
- package/dist/cjs/post-purchase/product/settings/accept-button/configs/settings.js +2 -1
- package/dist/cjs/product/components/ProductTag.js +9 -1
- package/dist/esm/banner/setting/presets/heroBanner1Col.js +14 -0
- package/dist/esm/banner/setting/presets/heroBannerContentLeft.js +13 -0
- package/dist/esm/banner/setting/presets/heroBannerContentRight.js +12 -0
- package/dist/esm/banner/setting/presets/heroBannerParallax.js +14 -0
- package/dist/esm/banner/setting/setting.js +6 -18
- package/dist/esm/banner/setting/uiV1.js +1 -2
- package/dist/esm/banner/setting/uiV2.js +4 -5
- package/dist/esm/form/setting/form-dropdown/configs/uiV2.js +12 -0
- package/dist/esm/post-purchase/button/common/getClasses.js +1 -1
- package/dist/esm/post-purchase/button/common/getStyles.js +2 -2
- package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +2 -1
- package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +1 -8
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +1 -0
- package/dist/esm/post-purchase/countdown-timer/components/common/getStyles.js +2 -2
- package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +1 -7
- package/dist/esm/post-purchase/product/settings/accept-button/configs/settings.js +2 -1
- package/dist/esm/product/components/ProductTag.js +10 -2
- package/package.json +4 -4
|
@@ -42,6 +42,20 @@ const heroBanner1Col = {
|
|
|
42
42
|
contentWidth: {
|
|
43
43
|
desktop: '1200px'
|
|
44
44
|
},
|
|
45
|
+
sizeSetting: {
|
|
46
|
+
desktop: {
|
|
47
|
+
shape: 'custom',
|
|
48
|
+
widthHeightLinked: false,
|
|
49
|
+
width: '100%',
|
|
50
|
+
height: '600px'
|
|
51
|
+
},
|
|
52
|
+
mobile: {
|
|
53
|
+
shape: 'custom',
|
|
54
|
+
widthHeightLinked: false,
|
|
55
|
+
width: '1200px',
|
|
56
|
+
height: '600px'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
45
59
|
background: {
|
|
46
60
|
desktop: {
|
|
47
61
|
image: {
|
|
@@ -48,6 +48,19 @@ const heroBannerContentLeft = {
|
|
|
48
48
|
contentWidth: {
|
|
49
49
|
desktop: '1200px'
|
|
50
50
|
},
|
|
51
|
+
sizeSetting: {
|
|
52
|
+
desktop: {
|
|
53
|
+
shape: 'original',
|
|
54
|
+
widthHeightLinked: true,
|
|
55
|
+
width: '100%'
|
|
56
|
+
},
|
|
57
|
+
mobile: {
|
|
58
|
+
shape: 'custom',
|
|
59
|
+
widthHeightLinked: false,
|
|
60
|
+
width: '100%',
|
|
61
|
+
height: 'auto'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
51
64
|
background: {
|
|
52
65
|
desktop: {
|
|
53
66
|
image: {
|
|
@@ -57,6 +57,18 @@ const heroBannerContentRight = {
|
|
|
57
57
|
contentWidth: {
|
|
58
58
|
desktop: '1200px'
|
|
59
59
|
},
|
|
60
|
+
sizeSetting: {
|
|
61
|
+
desktop: {
|
|
62
|
+
shape: 'original',
|
|
63
|
+
widthHeightLinked: true,
|
|
64
|
+
width: '100%'
|
|
65
|
+
},
|
|
66
|
+
mobile: {
|
|
67
|
+
shape: 'original',
|
|
68
|
+
widthHeightLinked: true,
|
|
69
|
+
width: '100%'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
60
72
|
background: {
|
|
61
73
|
desktop: {
|
|
62
74
|
image: {
|
|
@@ -42,6 +42,20 @@ const heroBannerParallax = {
|
|
|
42
42
|
contentWidth: {
|
|
43
43
|
desktop: '1200px'
|
|
44
44
|
},
|
|
45
|
+
sizeSetting: {
|
|
46
|
+
desktop: {
|
|
47
|
+
shape: 'custom',
|
|
48
|
+
widthHeightLinked: false,
|
|
49
|
+
width: '100%',
|
|
50
|
+
height: '600px'
|
|
51
|
+
},
|
|
52
|
+
mobile: {
|
|
53
|
+
shape: 'custom',
|
|
54
|
+
widthHeightLinked: false,
|
|
55
|
+
width: '1200px',
|
|
56
|
+
height: '600px'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
45
59
|
background: {
|
|
46
60
|
desktop: {
|
|
47
61
|
image: {
|
|
@@ -402,16 +402,18 @@ const SettingsV1 = [
|
|
|
402
402
|
devices: {
|
|
403
403
|
desktop: {
|
|
404
404
|
default: {
|
|
405
|
-
shape: '
|
|
405
|
+
shape: 'custom',
|
|
406
406
|
widthHeightLinked: false,
|
|
407
|
-
width: '100%'
|
|
407
|
+
width: '100%',
|
|
408
|
+
height: '600px'
|
|
408
409
|
}
|
|
409
410
|
},
|
|
410
411
|
mobile: {
|
|
411
412
|
default: {
|
|
412
413
|
shape: 'custom',
|
|
413
|
-
|
|
414
|
-
width: '
|
|
414
|
+
widthHeightLinked: false,
|
|
415
|
+
width: '1200px',
|
|
416
|
+
height: '600px'
|
|
415
417
|
}
|
|
416
418
|
}
|
|
417
419
|
},
|
|
@@ -783,20 +785,6 @@ const SettingsV1 = [
|
|
|
783
785
|
hover: true
|
|
784
786
|
}
|
|
785
787
|
},
|
|
786
|
-
{
|
|
787
|
-
id: 'borderBg',
|
|
788
|
-
type: 'border',
|
|
789
|
-
label: 'Border',
|
|
790
|
-
default: {
|
|
791
|
-
borderType: 'style-1',
|
|
792
|
-
border: 'solid',
|
|
793
|
-
width: '0px 0px 0px 0px',
|
|
794
|
-
position: 'all',
|
|
795
|
-
borderWidth: '0px',
|
|
796
|
-
color: '#000000',
|
|
797
|
-
isCustom: true
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
788
|
{
|
|
801
789
|
id: 'cornerBg',
|
|
802
790
|
type: 'radius-preset',
|
|
@@ -102,10 +102,10 @@ const SettingUIV2 = [
|
|
|
102
102
|
type: 'padding-v2',
|
|
103
103
|
compoDefaultValue: {
|
|
104
104
|
default: {
|
|
105
|
-
top: '
|
|
106
|
-
right: '
|
|
107
|
-
bottom: '
|
|
108
|
-
left: '
|
|
105
|
+
top: '80px',
|
|
106
|
+
right: '0px',
|
|
107
|
+
bottom: '80px',
|
|
108
|
+
left: '0px',
|
|
109
109
|
linked: false
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -198,7 +198,6 @@ const SettingUIV2 = [
|
|
|
198
198
|
},
|
|
199
199
|
iconName: 'polaris-star',
|
|
200
200
|
getValueFromSettingID: 'speedParallax',
|
|
201
|
-
isHideClear: true,
|
|
202
201
|
controls: [
|
|
203
202
|
{
|
|
204
203
|
layout: 'vertical',
|
|
@@ -175,6 +175,18 @@ const SettingUIV2 = [
|
|
|
175
175
|
type: 'border-v2',
|
|
176
176
|
linkWithSetting: {
|
|
177
177
|
name: 'wrapperBorder'
|
|
178
|
+
},
|
|
179
|
+
compoDefaultValue: {
|
|
180
|
+
desktop: {
|
|
181
|
+
default: {
|
|
182
|
+
normal: {
|
|
183
|
+
border: 'solid',
|
|
184
|
+
color: '#121212',
|
|
185
|
+
width: '1px',
|
|
186
|
+
borderWidth: '1px'
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
178
190
|
}
|
|
179
191
|
}
|
|
180
192
|
},
|
|
@@ -16,7 +16,7 @@ const getButtonClass = (setting)=>{
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
const getTextClass = (mode)=>{
|
|
19
|
-
const classList = '!gp-inline-flex gp-py-2';
|
|
19
|
+
const classList = '!gp-inline-flex gp-py-2 gp-leading-[1.3]';
|
|
20
20
|
return {
|
|
21
21
|
...core.composeClasses(classList),
|
|
22
22
|
'button-text': mode === 'edit'
|
|
@@ -29,7 +29,7 @@ const getButtonStyles = (disabled, setting)=>{
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
const getContainerStyle = (styles)=>helpers.filterTruthyStyles({
|
|
32
|
-
...core.
|
|
32
|
+
...core.makeStyleResponsiveWidth(styles?.width)
|
|
33
33
|
});
|
|
34
34
|
const getWrapperStyle = (styles)=>{
|
|
35
35
|
const wrapperStyles = {
|
|
@@ -8,6 +8,7 @@ var Text = require('../../text/components/Text.js');
|
|
|
8
8
|
var system = require('@gem-sdk/system');
|
|
9
9
|
var getClasses = require('./common/getClasses.js');
|
|
10
10
|
var getStyles = require('./common/getStyles.js');
|
|
11
|
+
var core = require('@gem-sdk/core');
|
|
11
12
|
|
|
12
13
|
const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
|
|
13
14
|
const { width, align } = styles;
|
|
@@ -19,7 +20,7 @@ const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderPr
|
|
|
19
20
|
})
|
|
20
21
|
});
|
|
21
22
|
const containerStyle = system.createStyle({
|
|
22
|
-
...
|
|
23
|
+
...core.makeStyleResponsiveWidth(width)
|
|
23
24
|
});
|
|
24
25
|
const textStyles = {
|
|
25
26
|
...getStyles.getTextStyles(styles)
|
|
@@ -31,13 +31,6 @@ var CalloutBorderColorEnum;
|
|
|
31
31
|
CalloutBorderColorEnum["critical"] = '#facccc';
|
|
32
32
|
CalloutBorderColorEnum["none"] = '#D9D9D9';
|
|
33
33
|
})(CalloutBorderColorEnum || (CalloutBorderColorEnum = {}));
|
|
34
|
-
const makeStyleResponsiveWidth = (value, unit)=>{
|
|
35
|
-
return {
|
|
36
|
-
[`--w`]: unit ? `${value?.desktop}${unit}` : value?.desktop === 'default' ? '1200px' : value?.desktop,
|
|
37
|
-
[`--w-tablet`]: unit ? `${value?.tablet}${unit}` : value?.tablet === 'default' ? '1200px' : value?.tablet,
|
|
38
|
-
[`--w-mobile`]: unit ? `${value?.mobile}${unit}` : value?.mobile === 'default' ? '1200px' : value?.mobile
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
34
|
const getCalloutBoxContainerStyles = (styles)=>{
|
|
42
35
|
return helpers.filterTruthyStyles({
|
|
43
36
|
backgroundColor: styles?.backgroundColor ? CalloutBgColorEnum[styles?.backgroundColor] : '#FAFAFA',
|
|
@@ -48,4 +41,3 @@ const getCalloutBoxContainerStyles = (styles)=>{
|
|
|
48
41
|
exports.getCalloutBoxContainerStyles = getCalloutBoxContainerStyles;
|
|
49
42
|
exports.getCalloutTextStyle = getCalloutTextStyle;
|
|
50
43
|
exports.getTextStyles = getTextStyles;
|
|
51
|
-
exports.makeStyleResponsiveWidth = makeStyleResponsiveWidth;
|
|
@@ -7,7 +7,7 @@ const pdBanner = '17px';
|
|
|
7
7
|
const brBanner = '3px';
|
|
8
8
|
const getTextCountdownWrapperStyles = (width, bgColor)=>{
|
|
9
9
|
const styles = {
|
|
10
|
-
...core.
|
|
10
|
+
...core.makeStyleResponsiveWidth(width),
|
|
11
11
|
backgroundColor: helper.makeBgColor(bgColor),
|
|
12
12
|
borderWidth: '1px',
|
|
13
13
|
borderStyle: 'solid',
|
|
@@ -14,6 +14,7 @@ const CountdownTimerSettings = [
|
|
|
14
14
|
label: 'Message',
|
|
15
15
|
type: 'input',
|
|
16
16
|
default: 'Offer expires in:',
|
|
17
|
+
placeholder: 'Add...',
|
|
17
18
|
clearButton: false
|
|
18
19
|
},
|
|
19
20
|
{
|
|
@@ -158,13 +159,6 @@ const CountdownTimerSettings = [
|
|
|
158
159
|
type: 'text',
|
|
159
160
|
tooltip: 'Align right',
|
|
160
161
|
iconName: 'polaris-text-align-right'
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
label: 'Justify',
|
|
164
|
-
value: 'justify',
|
|
165
|
-
type: 'text',
|
|
166
|
-
tooltip: 'Align justify',
|
|
167
|
-
iconName: 'gp-text-align-justify'
|
|
168
162
|
}
|
|
169
163
|
],
|
|
170
164
|
default: 'left'
|
|
@@ -21,9 +21,17 @@ const ProductTag = ({ setting, styles, builderProps, ...passProps })=>{
|
|
|
21
21
|
const mode = core.useEditorMode();
|
|
22
22
|
const product = core.useProduct();
|
|
23
23
|
const currentVariant = core.useCurrentVariant();
|
|
24
|
+
const { quantity, hasUpdatePrice } = core.useQuantity();
|
|
25
|
+
const quantityProduct = React.useMemo(()=>{
|
|
26
|
+
return hasUpdatePrice && customContent?.unit !== 'percentage' ? quantity || 1 : 1;
|
|
27
|
+
}, [
|
|
28
|
+
hasUpdatePrice,
|
|
29
|
+
customContent?.unit,
|
|
30
|
+
quantity
|
|
31
|
+
]);
|
|
24
32
|
const price = currentVariant?.price ?? 0;
|
|
25
33
|
const salePrice = currentVariant?.salePrice ?? 0;
|
|
26
|
-
const priceSave = salePrice - price;
|
|
34
|
+
const priceSave = (salePrice - price) * quantityProduct;
|
|
27
35
|
const moneyFormatted = core.useFormatMoney(priceSave < 0 ? 0 : priceSave, setting?.moneyWithCurrentFormat || false);
|
|
28
36
|
const customDisplayWithUnit = React.useMemo(()=>{
|
|
29
37
|
if (!salePrice && salePrice !== 0 || !price && price !== 0) return `${customContent?.unit === 'percentage' ? '0%' : moneyFormatted}`;
|
|
@@ -40,6 +40,20 @@ const heroBanner1Col = {
|
|
|
40
40
|
contentWidth: {
|
|
41
41
|
desktop: '1200px'
|
|
42
42
|
},
|
|
43
|
+
sizeSetting: {
|
|
44
|
+
desktop: {
|
|
45
|
+
shape: 'custom',
|
|
46
|
+
widthHeightLinked: false,
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '600px'
|
|
49
|
+
},
|
|
50
|
+
mobile: {
|
|
51
|
+
shape: 'custom',
|
|
52
|
+
widthHeightLinked: false,
|
|
53
|
+
width: '1200px',
|
|
54
|
+
height: '600px'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
43
57
|
background: {
|
|
44
58
|
desktop: {
|
|
45
59
|
image: {
|
|
@@ -46,6 +46,19 @@ const heroBannerContentLeft = {
|
|
|
46
46
|
contentWidth: {
|
|
47
47
|
desktop: '1200px'
|
|
48
48
|
},
|
|
49
|
+
sizeSetting: {
|
|
50
|
+
desktop: {
|
|
51
|
+
shape: 'original',
|
|
52
|
+
widthHeightLinked: true,
|
|
53
|
+
width: '100%'
|
|
54
|
+
},
|
|
55
|
+
mobile: {
|
|
56
|
+
shape: 'custom',
|
|
57
|
+
widthHeightLinked: false,
|
|
58
|
+
width: '100%',
|
|
59
|
+
height: 'auto'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
49
62
|
background: {
|
|
50
63
|
desktop: {
|
|
51
64
|
image: {
|
|
@@ -55,6 +55,18 @@ const heroBannerContentRight = {
|
|
|
55
55
|
contentWidth: {
|
|
56
56
|
desktop: '1200px'
|
|
57
57
|
},
|
|
58
|
+
sizeSetting: {
|
|
59
|
+
desktop: {
|
|
60
|
+
shape: 'original',
|
|
61
|
+
widthHeightLinked: true,
|
|
62
|
+
width: '100%'
|
|
63
|
+
},
|
|
64
|
+
mobile: {
|
|
65
|
+
shape: 'original',
|
|
66
|
+
widthHeightLinked: true,
|
|
67
|
+
width: '100%'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
58
70
|
background: {
|
|
59
71
|
desktop: {
|
|
60
72
|
image: {
|
|
@@ -40,6 +40,20 @@ const heroBannerParallax = {
|
|
|
40
40
|
contentWidth: {
|
|
41
41
|
desktop: '1200px'
|
|
42
42
|
},
|
|
43
|
+
sizeSetting: {
|
|
44
|
+
desktop: {
|
|
45
|
+
shape: 'custom',
|
|
46
|
+
widthHeightLinked: false,
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '600px'
|
|
49
|
+
},
|
|
50
|
+
mobile: {
|
|
51
|
+
shape: 'custom',
|
|
52
|
+
widthHeightLinked: false,
|
|
53
|
+
width: '1200px',
|
|
54
|
+
height: '600px'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
43
57
|
background: {
|
|
44
58
|
desktop: {
|
|
45
59
|
image: {
|
|
@@ -400,16 +400,18 @@ const SettingsV1 = [
|
|
|
400
400
|
devices: {
|
|
401
401
|
desktop: {
|
|
402
402
|
default: {
|
|
403
|
-
shape: '
|
|
403
|
+
shape: 'custom',
|
|
404
404
|
widthHeightLinked: false,
|
|
405
|
-
width: '100%'
|
|
405
|
+
width: '100%',
|
|
406
|
+
height: '600px'
|
|
406
407
|
}
|
|
407
408
|
},
|
|
408
409
|
mobile: {
|
|
409
410
|
default: {
|
|
410
411
|
shape: 'custom',
|
|
411
|
-
|
|
412
|
-
width: '
|
|
412
|
+
widthHeightLinked: false,
|
|
413
|
+
width: '1200px',
|
|
414
|
+
height: '600px'
|
|
413
415
|
}
|
|
414
416
|
}
|
|
415
417
|
},
|
|
@@ -781,20 +783,6 @@ const SettingsV1 = [
|
|
|
781
783
|
hover: true
|
|
782
784
|
}
|
|
783
785
|
},
|
|
784
|
-
{
|
|
785
|
-
id: 'borderBg',
|
|
786
|
-
type: 'border',
|
|
787
|
-
label: 'Border',
|
|
788
|
-
default: {
|
|
789
|
-
borderType: 'style-1',
|
|
790
|
-
border: 'solid',
|
|
791
|
-
width: '0px 0px 0px 0px',
|
|
792
|
-
position: 'all',
|
|
793
|
-
borderWidth: '0px',
|
|
794
|
-
color: '#000000',
|
|
795
|
-
isCustom: true
|
|
796
|
-
}
|
|
797
|
-
},
|
|
798
786
|
{
|
|
799
787
|
id: 'cornerBg',
|
|
800
788
|
type: 'radius-preset',
|
|
@@ -100,10 +100,10 @@ const SettingUIV2 = [
|
|
|
100
100
|
type: 'padding-v2',
|
|
101
101
|
compoDefaultValue: {
|
|
102
102
|
default: {
|
|
103
|
-
top: '
|
|
104
|
-
right: '
|
|
105
|
-
bottom: '
|
|
106
|
-
left: '
|
|
103
|
+
top: '80px',
|
|
104
|
+
right: '0px',
|
|
105
|
+
bottom: '80px',
|
|
106
|
+
left: '0px',
|
|
107
107
|
linked: false
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -196,7 +196,6 @@ const SettingUIV2 = [
|
|
|
196
196
|
},
|
|
197
197
|
iconName: 'polaris-star',
|
|
198
198
|
getValueFromSettingID: 'speedParallax',
|
|
199
|
-
isHideClear: true,
|
|
200
199
|
controls: [
|
|
201
200
|
{
|
|
202
201
|
layout: 'vertical',
|
|
@@ -173,6 +173,18 @@ const SettingUIV2 = [
|
|
|
173
173
|
type: 'border-v2',
|
|
174
174
|
linkWithSetting: {
|
|
175
175
|
name: 'wrapperBorder'
|
|
176
|
+
},
|
|
177
|
+
compoDefaultValue: {
|
|
178
|
+
desktop: {
|
|
179
|
+
default: {
|
|
180
|
+
normal: {
|
|
181
|
+
border: 'solid',
|
|
182
|
+
color: '#121212',
|
|
183
|
+
width: '1px',
|
|
184
|
+
borderWidth: '1px'
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
176
188
|
}
|
|
177
189
|
}
|
|
178
190
|
},
|
|
@@ -14,7 +14,7 @@ const getButtonClass = (setting)=>{
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
const getTextClass = (mode)=>{
|
|
17
|
-
const classList = '!gp-inline-flex gp-py-2';
|
|
17
|
+
const classList = '!gp-inline-flex gp-py-2 gp-leading-[1.3]';
|
|
18
18
|
return {
|
|
19
19
|
...composeClasses(classList),
|
|
20
20
|
'button-text': mode === 'edit'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { filterTruthyStyles } from '../../../helpers.js';
|
|
2
|
-
import {
|
|
2
|
+
import { makeStyleResponsiveWidth, makeStyle } from '@gem-sdk/core';
|
|
3
3
|
import { buttonColor, postPurchaseFontWeight } from '../../utils/helper.js';
|
|
4
4
|
|
|
5
5
|
const getButtonStyles = (disabled, setting)=>{
|
|
@@ -27,7 +27,7 @@ const getButtonStyles = (disabled, setting)=>{
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
const getContainerStyle = (styles)=>filterTruthyStyles({
|
|
30
|
-
...
|
|
30
|
+
...makeStyleResponsiveWidth(styles?.width)
|
|
31
31
|
});
|
|
32
32
|
const getWrapperStyle = (styles)=>{
|
|
33
33
|
const wrapperStyles = {
|
|
@@ -3,7 +3,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import Text from '../../text/components/Text.js';
|
|
4
4
|
import { createClass, createStyle, createAttr } from '@gem-sdk/system';
|
|
5
5
|
import { getCalloutTextWrapperClasses } from './common/getClasses.js';
|
|
6
|
-
import {
|
|
6
|
+
import { getCalloutTextStyle, getTextStyles } from './common/getStyles.js';
|
|
7
|
+
import { makeStyleResponsiveWidth } from '@gem-sdk/core';
|
|
7
8
|
|
|
8
9
|
const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
|
|
9
10
|
const { width, align } = styles;
|
|
@@ -29,13 +29,6 @@ var CalloutBorderColorEnum;
|
|
|
29
29
|
CalloutBorderColorEnum["critical"] = '#facccc';
|
|
30
30
|
CalloutBorderColorEnum["none"] = '#D9D9D9';
|
|
31
31
|
})(CalloutBorderColorEnum || (CalloutBorderColorEnum = {}));
|
|
32
|
-
const makeStyleResponsiveWidth = (value, unit)=>{
|
|
33
|
-
return {
|
|
34
|
-
[`--w`]: unit ? `${value?.desktop}${unit}` : value?.desktop === 'default' ? '1200px' : value?.desktop,
|
|
35
|
-
[`--w-tablet`]: unit ? `${value?.tablet}${unit}` : value?.tablet === 'default' ? '1200px' : value?.tablet,
|
|
36
|
-
[`--w-mobile`]: unit ? `${value?.mobile}${unit}` : value?.mobile === 'default' ? '1200px' : value?.mobile
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
32
|
const getCalloutBoxContainerStyles = (styles)=>{
|
|
40
33
|
return filterTruthyStyles({
|
|
41
34
|
backgroundColor: styles?.backgroundColor ? CalloutBgColorEnum[styles?.backgroundColor] : '#FAFAFA',
|
|
@@ -43,4 +36,4 @@ const getCalloutBoxContainerStyles = (styles)=>{
|
|
|
43
36
|
});
|
|
44
37
|
};
|
|
45
38
|
|
|
46
|
-
export { getCalloutBoxContainerStyles, getCalloutTextStyle, getTextStyles
|
|
39
|
+
export { getCalloutBoxContainerStyles, getCalloutTextStyle, getTextStyles };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeStyleResponsiveWidth, filterTruthyStyles } from '@gem-sdk/core';
|
|
2
2
|
import { makeBgColor, makeBorderColor } from '../../../utils/helper.js';
|
|
3
3
|
|
|
4
4
|
const pdBanner = '17px';
|
|
5
5
|
const brBanner = '3px';
|
|
6
6
|
const getTextCountdownWrapperStyles = (width, bgColor)=>{
|
|
7
7
|
const styles = {
|
|
8
|
-
...
|
|
8
|
+
...makeStyleResponsiveWidth(width),
|
|
9
9
|
backgroundColor: makeBgColor(bgColor),
|
|
10
10
|
borderWidth: '1px',
|
|
11
11
|
borderStyle: 'solid',
|
|
@@ -12,6 +12,7 @@ const CountdownTimerSettings = [
|
|
|
12
12
|
label: 'Message',
|
|
13
13
|
type: 'input',
|
|
14
14
|
default: 'Offer expires in:',
|
|
15
|
+
placeholder: 'Add...',
|
|
15
16
|
clearButton: false
|
|
16
17
|
},
|
|
17
18
|
{
|
|
@@ -156,13 +157,6 @@ const CountdownTimerSettings = [
|
|
|
156
157
|
type: 'text',
|
|
157
158
|
tooltip: 'Align right',
|
|
158
159
|
iconName: 'polaris-text-align-right'
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
label: 'Justify',
|
|
162
|
-
value: 'justify',
|
|
163
|
-
type: 'text',
|
|
164
|
-
tooltip: 'Align justify',
|
|
165
|
-
iconName: 'gp-text-align-justify'
|
|
166
160
|
}
|
|
167
161
|
],
|
|
168
162
|
default: 'left'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useMoneyFormat, makeGlobalSize, useEditorMode, useProduct, useCurrentVariant, useFormatMoney, useProductBundleDiscount, formatMoney, getGlobalColorClass, cls, makeStyleResponsive, makeStyle, getRadiusCSSFromGlobal, getCustomRadius } from '@gem-sdk/core';
|
|
3
|
+
import { useMoneyFormat, makeGlobalSize, useEditorMode, useProduct, useCurrentVariant, useQuantity, useFormatMoney, useProductBundleDiscount, formatMoney, getGlobalColorClass, cls, makeStyleResponsive, makeStyle, getRadiusCSSFromGlobal, getCustomRadius } from '@gem-sdk/core';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import Text from '../../text/components/Text.js';
|
|
6
6
|
import { DiscountType } from './constants/product-bundle.js';
|
|
@@ -17,9 +17,17 @@ const ProductTag = ({ setting, styles, builderProps, ...passProps })=>{
|
|
|
17
17
|
const mode = useEditorMode();
|
|
18
18
|
const product = useProduct();
|
|
19
19
|
const currentVariant = useCurrentVariant();
|
|
20
|
+
const { quantity, hasUpdatePrice } = useQuantity();
|
|
21
|
+
const quantityProduct = useMemo(()=>{
|
|
22
|
+
return hasUpdatePrice && customContent?.unit !== 'percentage' ? quantity || 1 : 1;
|
|
23
|
+
}, [
|
|
24
|
+
hasUpdatePrice,
|
|
25
|
+
customContent?.unit,
|
|
26
|
+
quantity
|
|
27
|
+
]);
|
|
20
28
|
const price = currentVariant?.price ?? 0;
|
|
21
29
|
const salePrice = currentVariant?.salePrice ?? 0;
|
|
22
|
-
const priceSave = salePrice - price;
|
|
30
|
+
const priceSave = (salePrice - price) * quantityProduct;
|
|
23
31
|
const moneyFormatted = useFormatMoney(priceSave < 0 ? 0 : priceSave, setting?.moneyWithCurrentFormat || false);
|
|
24
32
|
const customDisplayWithUnit = useMemo(()=>{
|
|
25
33
|
if (!salePrice && salePrice !== 0 || !price && price !== 0) return `${customContent?.unit === 'percentage' ? '0%' : moneyFormatted}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.305",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/get-control-relationship.js && node ./scripts/get-element-relationship.js"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
26
|
-
"@gem-sdk/styles": "2.0.0-dev.
|
|
27
|
-
"@gem-sdk/system": "2.0.0-dev.
|
|
25
|
+
"@gem-sdk/core": "2.0.0-dev.305",
|
|
26
|
+
"@gem-sdk/styles": "2.0.0-dev.305",
|
|
27
|
+
"@gem-sdk/system": "2.0.0-dev.305",
|
|
28
28
|
"@types/react-transition-group": "^4.4.5"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|