@gem-sdk/components 2.0.0-dev.598 → 2.0.0-dev.600
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/accordion/setting/Accordion.js +0 -3
- package/dist/cjs/banner/components/HeroBannerItem.js +2 -2
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +4 -4
- package/dist/cjs/banner/setting/uiV2.js +24 -1
- package/dist/esm/accordion/setting/Accordion.js +0 -3
- package/dist/esm/banner/components/HeroBannerItem.js +2 -2
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +4 -4
- package/dist/esm/banner/setting/uiV2.js +24 -1
- package/package.json +1 -1
|
@@ -59,7 +59,6 @@ const config = {
|
|
|
59
59
|
styles: {
|
|
60
60
|
},
|
|
61
61
|
advanced: {
|
|
62
|
-
of: 'hidden',
|
|
63
62
|
margin: {
|
|
64
63
|
bottom: 'var(--g-s-l)'
|
|
65
64
|
}
|
|
@@ -120,7 +119,6 @@ const config = {
|
|
|
120
119
|
}
|
|
121
120
|
},
|
|
122
121
|
advanced: {
|
|
123
|
-
of: 'hidden',
|
|
124
122
|
margin: {
|
|
125
123
|
bottom: 'var(--g-s-l)'
|
|
126
124
|
}
|
|
@@ -195,7 +193,6 @@ const config = {
|
|
|
195
193
|
itemGap: '16px'
|
|
196
194
|
},
|
|
197
195
|
advanced: {
|
|
198
|
-
of: 'hidden',
|
|
199
196
|
margin: {
|
|
200
197
|
bottom: 'var(--g-s-l)'
|
|
201
198
|
}
|
|
@@ -21,7 +21,7 @@ const HeroBannerItem = (props)=>{
|
|
|
21
21
|
const { enableLazyloadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
|
|
22
22
|
const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
|
|
23
23
|
const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
|
|
24
|
-
const enableLazyImage = (
|
|
24
|
+
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage && mode !== 'edit';
|
|
25
25
|
const isNotLiquid = true;
|
|
26
26
|
const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
27
27
|
const containerStyle = system.createStyle({
|
|
@@ -184,7 +184,7 @@ const HeroBannerItem = (props)=>{
|
|
|
184
184
|
style: adaptiveStyle,
|
|
185
185
|
alt: alt,
|
|
186
186
|
title: title,
|
|
187
|
-
enableLazyloadImage:
|
|
187
|
+
enableLazyloadImage: enableLazyImage
|
|
188
188
|
})
|
|
189
189
|
]
|
|
190
190
|
});
|
|
@@ -21,7 +21,7 @@ const HeroBannerItem = (props)=>{
|
|
|
21
21
|
const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
|
|
22
22
|
const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
|
|
23
23
|
const transform = '';
|
|
24
|
-
const enableLazyImage =
|
|
24
|
+
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage;
|
|
25
25
|
const isNotLiquid = false;
|
|
26
26
|
const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
27
27
|
const dataVideo = common.getResponsiveSetting(background || {}).desktop;
|
|
@@ -57,7 +57,7 @@ const HeroBannerItem = (props)=>{
|
|
|
57
57
|
});
|
|
58
58
|
const backgroundStyle = system.createStyle({
|
|
59
59
|
...getStyle.getBackgroundStyle(styles, enableParallax, transform),
|
|
60
|
-
...common.getBackgroundImageHeroBanner(background,
|
|
60
|
+
...common.getBackgroundImageHeroBanner(background, enableLazyloadImage, isNotLiquid)
|
|
61
61
|
});
|
|
62
62
|
const containBackgroundClasses = system.createClass({
|
|
63
63
|
...getClasses.getContainBackgroundClasses()
|
|
@@ -84,7 +84,7 @@ const HeroBannerItem = (props)=>{
|
|
|
84
84
|
...getClasses.getLazyBackgroundClasses(device)
|
|
85
85
|
});
|
|
86
86
|
const backgroundImageLazyload = ()=>{
|
|
87
|
-
if (
|
|
87
|
+
if (background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) return;
|
|
88
88
|
return getSrcSet.DEVICES.map((device)=>{
|
|
89
89
|
return system.If(common.getEnableBgImageByDevice(device, background), NextImage_liquid.default({
|
|
90
90
|
src: getSrcSet.getImageSrc(core.getResponsiveValueByScreen(common.getBgImage(background), device), device),
|
|
@@ -177,7 +177,7 @@ const HeroBannerItem = (props)=>{
|
|
|
177
177
|
style: adaptiveStyle,
|
|
178
178
|
alt,
|
|
179
179
|
title,
|
|
180
|
-
|
|
180
|
+
enableLazyLoadImage: enableLazyImage
|
|
181
181
|
})}
|
|
182
182
|
</div>
|
|
183
183
|
`;
|
|
@@ -97,12 +97,35 @@ const SettingUIV2 = [
|
|
|
97
97
|
label: {
|
|
98
98
|
en: 'Background'
|
|
99
99
|
},
|
|
100
|
-
conditionDisplay: 'pageType != "POST_PURCHASE"',
|
|
101
100
|
controls: [
|
|
102
101
|
{
|
|
103
102
|
setting: {
|
|
104
103
|
id: 'background'
|
|
105
104
|
},
|
|
105
|
+
options: {
|
|
106
|
+
updateFields: [
|
|
107
|
+
{
|
|
108
|
+
field: 'preload',
|
|
109
|
+
settingId: 'preload'
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
controlChangeTrigger: {
|
|
114
|
+
settings: [
|
|
115
|
+
{
|
|
116
|
+
action: {
|
|
117
|
+
controlId: 'preload',
|
|
118
|
+
valueFromField: 'preload',
|
|
119
|
+
groupType: 'setting',
|
|
120
|
+
controlType: 'setting',
|
|
121
|
+
removeDevice: true
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
options: {
|
|
126
|
+
noRecordHistory: true
|
|
127
|
+
}
|
|
128
|
+
},
|
|
106
129
|
layout: 'vertical'
|
|
107
130
|
}
|
|
108
131
|
],
|
|
@@ -55,7 +55,6 @@ const config = {
|
|
|
55
55
|
styles: {
|
|
56
56
|
},
|
|
57
57
|
advanced: {
|
|
58
|
-
of: 'hidden',
|
|
59
58
|
margin: {
|
|
60
59
|
bottom: 'var(--g-s-l)'
|
|
61
60
|
}
|
|
@@ -116,7 +115,6 @@ const config = {
|
|
|
116
115
|
}
|
|
117
116
|
},
|
|
118
117
|
advanced: {
|
|
119
|
-
of: 'hidden',
|
|
120
118
|
margin: {
|
|
121
119
|
bottom: 'var(--g-s-l)'
|
|
122
120
|
}
|
|
@@ -191,7 +189,6 @@ const config = {
|
|
|
191
189
|
itemGap: '16px'
|
|
192
190
|
},
|
|
193
191
|
advanced: {
|
|
194
|
-
of: 'hidden',
|
|
195
192
|
margin: {
|
|
196
193
|
bottom: 'var(--g-s-l)'
|
|
197
194
|
}
|
|
@@ -17,7 +17,7 @@ const HeroBannerItem = (props)=>{
|
|
|
17
17
|
const { enableLazyloadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
|
|
18
18
|
const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
|
|
19
19
|
const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
|
|
20
|
-
const enableLazyImage = (
|
|
20
|
+
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage && mode !== 'edit';
|
|
21
21
|
const isNotLiquid = true;
|
|
22
22
|
const aspectRatio = getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
23
23
|
const containerStyle = createStyle({
|
|
@@ -180,7 +180,7 @@ const HeroBannerItem = (props)=>{
|
|
|
180
180
|
style: adaptiveStyle,
|
|
181
181
|
alt: alt,
|
|
182
182
|
title: title,
|
|
183
|
-
enableLazyloadImage:
|
|
183
|
+
enableLazyloadImage: enableLazyImage
|
|
184
184
|
})
|
|
185
185
|
]
|
|
186
186
|
});
|
|
@@ -17,7 +17,7 @@ const HeroBannerItem = (props)=>{
|
|
|
17
17
|
const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
|
|
18
18
|
const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
|
|
19
19
|
const transform = '';
|
|
20
|
-
const enableLazyImage =
|
|
20
|
+
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage;
|
|
21
21
|
const isNotLiquid = false;
|
|
22
22
|
const aspectRatio = getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
23
23
|
const dataVideo = getResponsiveSetting(background || {}).desktop;
|
|
@@ -53,7 +53,7 @@ const HeroBannerItem = (props)=>{
|
|
|
53
53
|
});
|
|
54
54
|
const backgroundStyle = createStyle({
|
|
55
55
|
...getBackgroundStyle(styles, enableParallax, transform),
|
|
56
|
-
...getBackgroundImageHeroBanner(background,
|
|
56
|
+
...getBackgroundImageHeroBanner(background, enableLazyloadImage, isNotLiquid)
|
|
57
57
|
});
|
|
58
58
|
const containBackgroundClasses = createClass({
|
|
59
59
|
...getContainBackgroundClasses()
|
|
@@ -80,7 +80,7 @@ const HeroBannerItem = (props)=>{
|
|
|
80
80
|
...getLazyBackgroundClasses(device)
|
|
81
81
|
});
|
|
82
82
|
const backgroundImageLazyload = ()=>{
|
|
83
|
-
if (
|
|
83
|
+
if (background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) return;
|
|
84
84
|
return DEVICES.map((device)=>{
|
|
85
85
|
return If(getEnableBgImageByDevice(device, background), NextImage({
|
|
86
86
|
src: getImageSrc(getResponsiveValueByScreen(getBgImage(background), device), device),
|
|
@@ -173,7 +173,7 @@ const HeroBannerItem = (props)=>{
|
|
|
173
173
|
style: adaptiveStyle,
|
|
174
174
|
alt,
|
|
175
175
|
title,
|
|
176
|
-
|
|
176
|
+
enableLazyLoadImage: enableLazyImage
|
|
177
177
|
})}
|
|
178
178
|
</div>
|
|
179
179
|
`;
|
|
@@ -95,12 +95,35 @@ const SettingUIV2 = [
|
|
|
95
95
|
label: {
|
|
96
96
|
en: 'Background'
|
|
97
97
|
},
|
|
98
|
-
conditionDisplay: 'pageType != "POST_PURCHASE"',
|
|
99
98
|
controls: [
|
|
100
99
|
{
|
|
101
100
|
setting: {
|
|
102
101
|
id: 'background'
|
|
103
102
|
},
|
|
103
|
+
options: {
|
|
104
|
+
updateFields: [
|
|
105
|
+
{
|
|
106
|
+
field: 'preload',
|
|
107
|
+
settingId: 'preload'
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
controlChangeTrigger: {
|
|
112
|
+
settings: [
|
|
113
|
+
{
|
|
114
|
+
action: {
|
|
115
|
+
controlId: 'preload',
|
|
116
|
+
valueFromField: 'preload',
|
|
117
|
+
groupType: 'setting',
|
|
118
|
+
controlType: 'setting',
|
|
119
|
+
removeDevice: true
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
options: {
|
|
124
|
+
noRecordHistory: true
|
|
125
|
+
}
|
|
126
|
+
},
|
|
104
127
|
layout: 'vertical'
|
|
105
128
|
}
|
|
106
129
|
],
|