@gem-sdk/components 2.0.0-dev.480 → 2.0.0-dev.482
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/article/components/ArticleList.js +1 -2
- package/dist/cjs/article/components/ArticleList.liquid.js +1 -1
- package/dist/cjs/article/setting/ArticleList.js +7 -591
- package/dist/cjs/article/setting/configs/ArticleList/presets.js +346 -0
- package/dist/cjs/article/setting/configs/ArticleList/settings.js +315 -0
- package/dist/cjs/article/setting/configs/ArticleList/uiV2.js +201 -0
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +1 -1
- package/dist/cjs/banner/components/HeroBanner.liquid.js +2 -2
- package/dist/cjs/banner/components/HeroBannerItem.js +15 -7
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +13 -11
- package/dist/cjs/banner/components/common/common.js +13 -29
- package/dist/cjs/banner/components/common/getClasses.js +2 -1
- package/dist/cjs/banner/components/common/getStyle.js +2 -0
- package/dist/cjs/banner/components/hooks/useHeroBanner.js +2 -7
- package/dist/cjs/banner/setting/setting.js +12 -0
- package/dist/cjs/banner/setting/uiV2.js +28 -6
- package/dist/cjs/countdown-timer/setting/configs/settings.js +51 -6
- package/dist/cjs/countdown-timer/setting/configs/uiV2.js +177 -100
- package/dist/cjs/dialog/setting/configs/settings.js +2 -2
- package/dist/cjs/product/components/ProductDiscountTag/index.liquid.js +3 -2
- package/dist/cjs/product/components/ProductSKU/Sku.liquid.js +3 -2
- package/dist/cjs/product/setting/product-price/configs/uiV2.js +1 -1
- package/dist/cjs/sticky/components/Sticky.liquid.js +6 -0
- package/dist/cjs/stock-counter/setting/configs/settingsV2.js +7 -6
- package/dist/cjs/stock-counter/setting/configs/uiV2.js +36 -6
- package/dist/esm/article/components/ArticleList.js +1 -2
- package/dist/esm/article/components/ArticleList.liquid.js +1 -1
- package/dist/esm/article/setting/ArticleList.js +7 -591
- package/dist/esm/article/setting/configs/ArticleList/presets.js +344 -0
- package/dist/esm/article/setting/configs/ArticleList/settings.js +313 -0
- package/dist/esm/article/setting/configs/ArticleList/uiV2.js +199 -0
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +1 -1
- package/dist/esm/banner/components/HeroBanner.liquid.js +2 -2
- package/dist/esm/banner/components/HeroBannerItem.js +16 -8
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +12 -10
- package/dist/esm/banner/components/common/common.js +15 -30
- package/dist/esm/banner/components/common/getClasses.js +2 -1
- package/dist/esm/banner/components/common/getStyle.js +2 -0
- package/dist/esm/banner/components/hooks/useHeroBanner.js +4 -9
- package/dist/esm/banner/setting/setting.js +12 -0
- package/dist/esm/banner/setting/uiV2.js +28 -6
- package/dist/esm/countdown-timer/setting/configs/settings.js +51 -6
- package/dist/esm/countdown-timer/setting/configs/uiV2.js +177 -100
- package/dist/esm/dialog/setting/configs/settings.js +2 -2
- package/dist/esm/product/components/ProductDiscountTag/index.liquid.js +3 -2
- package/dist/esm/product/components/ProductSKU/Sku.liquid.js +4 -3
- package/dist/esm/product/setting/product-price/configs/uiV2.js +1 -1
- package/dist/esm/sticky/components/Sticky.liquid.js +6 -0
- package/dist/esm/stock-counter/setting/configs/settingsV2.js +8 -7
- package/dist/esm/stock-counter/setting/configs/uiV2.js +36 -6
- package/dist/types/index.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const uiV2 = [
|
|
4
|
+
{
|
|
5
|
+
label: {
|
|
6
|
+
en: 'Article source'
|
|
7
|
+
},
|
|
8
|
+
controls: [
|
|
9
|
+
{
|
|
10
|
+
setting: {
|
|
11
|
+
id: 'articleSetting'
|
|
12
|
+
},
|
|
13
|
+
layout: 'vertical'
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: {
|
|
19
|
+
en: 'Display'
|
|
20
|
+
},
|
|
21
|
+
controls: [
|
|
22
|
+
{
|
|
23
|
+
label: {
|
|
24
|
+
en: 'Columns'
|
|
25
|
+
},
|
|
26
|
+
setting: {
|
|
27
|
+
id: 'slideToShow'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: {
|
|
34
|
+
en: 'Grid'
|
|
35
|
+
},
|
|
36
|
+
controls: [
|
|
37
|
+
{
|
|
38
|
+
label: {
|
|
39
|
+
en: 'Columns gap'
|
|
40
|
+
},
|
|
41
|
+
setting: {
|
|
42
|
+
id: 'verticalGutter'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: {
|
|
47
|
+
en: 'Rows gap'
|
|
48
|
+
},
|
|
49
|
+
setting: {
|
|
50
|
+
id: 'horizontalGutter'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: {
|
|
57
|
+
en: 'Size'
|
|
58
|
+
},
|
|
59
|
+
controls: [
|
|
60
|
+
{
|
|
61
|
+
id: 'Width',
|
|
62
|
+
label: {
|
|
63
|
+
en: 'Width'
|
|
64
|
+
},
|
|
65
|
+
controlConfig: {
|
|
66
|
+
id: 'width',
|
|
67
|
+
type: 'dropdown:input',
|
|
68
|
+
label: 'Width',
|
|
69
|
+
inputType: 'number',
|
|
70
|
+
units: [
|
|
71
|
+
'px',
|
|
72
|
+
'%'
|
|
73
|
+
],
|
|
74
|
+
hideUnit: false,
|
|
75
|
+
linkWithSetting: {
|
|
76
|
+
name: 'width'
|
|
77
|
+
},
|
|
78
|
+
displayOptions: [
|
|
79
|
+
{
|
|
80
|
+
label: 'Full',
|
|
81
|
+
value: '100%',
|
|
82
|
+
showValue: true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: 'Default',
|
|
86
|
+
value: 'default',
|
|
87
|
+
showValue: true
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
layout: 'horizontal'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: {
|
|
95
|
+
en: 'Padding'
|
|
96
|
+
},
|
|
97
|
+
controlConfig: {
|
|
98
|
+
id: 'padding',
|
|
99
|
+
type: 'padding-v2',
|
|
100
|
+
linkWithSetting: {
|
|
101
|
+
name: 'spacing-setting',
|
|
102
|
+
field: 'padding'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: {
|
|
110
|
+
en: 'Background'
|
|
111
|
+
},
|
|
112
|
+
controls: [
|
|
113
|
+
{
|
|
114
|
+
setting: {
|
|
115
|
+
id: 'background'
|
|
116
|
+
},
|
|
117
|
+
layout: 'vertical'
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: {
|
|
123
|
+
en: 'Shape'
|
|
124
|
+
},
|
|
125
|
+
controls: [
|
|
126
|
+
{
|
|
127
|
+
label: {
|
|
128
|
+
en: 'Border'
|
|
129
|
+
},
|
|
130
|
+
setting: {
|
|
131
|
+
id: 'border',
|
|
132
|
+
state: 'normal'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: {
|
|
137
|
+
en: 'Corner'
|
|
138
|
+
},
|
|
139
|
+
setting: {
|
|
140
|
+
id: 'rounded',
|
|
141
|
+
state: 'normal'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: {
|
|
146
|
+
en: 'Shadow'
|
|
147
|
+
},
|
|
148
|
+
setting: {
|
|
149
|
+
id: 'boxShadow',
|
|
150
|
+
state: 'normal'
|
|
151
|
+
},
|
|
152
|
+
options: {
|
|
153
|
+
updateFields: [
|
|
154
|
+
{
|
|
155
|
+
field: 'enable',
|
|
156
|
+
settingId: 'advanced.hasBoxShadow',
|
|
157
|
+
state: 'normal'
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
controlChangeTrigger: {
|
|
162
|
+
settings: [
|
|
163
|
+
{
|
|
164
|
+
condition: `boxShadow.normal.enable === true`,
|
|
165
|
+
source: [
|
|
166
|
+
'boxShadow',
|
|
167
|
+
'hasBoxShadow'
|
|
168
|
+
],
|
|
169
|
+
action: {
|
|
170
|
+
controlId: 'hasBoxShadow',
|
|
171
|
+
groupType: 'advanced',
|
|
172
|
+
controlType: 'advanced',
|
|
173
|
+
state: 'normal',
|
|
174
|
+
newValue: true
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
condition: `boxShadow.normal.enable === false`,
|
|
179
|
+
source: [
|
|
180
|
+
'boxShadow',
|
|
181
|
+
'hasBoxShadow'
|
|
182
|
+
],
|
|
183
|
+
action: {
|
|
184
|
+
controlId: 'hasBoxShadow',
|
|
185
|
+
groupType: 'advanced',
|
|
186
|
+
controlType: 'advanced',
|
|
187
|
+
state: 'normal',
|
|
188
|
+
newValue: false
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
options: {
|
|
193
|
+
noRecordHistory: true
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
];
|
|
200
|
+
|
|
201
|
+
exports.uiV2 = uiV2;
|
|
@@ -7,9 +7,9 @@ var getAttr = require('./common/getAttr.js');
|
|
|
7
7
|
var getStyle = require('./common/getStyle.js');
|
|
8
8
|
var getClasses = require('./common/getClasses.js');
|
|
9
9
|
var system = require('@gem-sdk/system');
|
|
10
|
-
var common = require('./common/common.js');
|
|
11
10
|
var core = require('@gem-sdk/core');
|
|
12
11
|
var helpers = require('../../helpers.js');
|
|
12
|
+
var common = require('./common/common.js');
|
|
13
13
|
|
|
14
14
|
const HeroBanner = (props)=>{
|
|
15
15
|
const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
|
|
@@ -17,7 +17,7 @@ const HeroBanner = (props)=>{
|
|
|
17
17
|
const { cssClass } = advanced ?? {};
|
|
18
18
|
const { urlData } = helpers.getInsertLinkData('', link);
|
|
19
19
|
const stateDataHeroBanner = system.createStateOrContext({
|
|
20
|
-
background: common.
|
|
20
|
+
background: common.getResponsiveSetting(styles?.background || {}),
|
|
21
21
|
uid: builderProps?.uid,
|
|
22
22
|
enableParallax: Number(setting?.speedParallax || 0) > 0,
|
|
23
23
|
speedParallax: Number(setting?.speedParallax) || 0,
|
|
@@ -56,6 +56,11 @@ const HeroBannerItem = (props)=>{
|
|
|
56
56
|
});
|
|
57
57
|
const backgroundStyle = system.createStyle({
|
|
58
58
|
...getStyle.getBackgroundStyle(styles, Number(speedParallax || 0) > 0 || false, transform),
|
|
59
|
+
...core.getGradientBgrStyleByDevice(background, {
|
|
60
|
+
desktop: true,
|
|
61
|
+
tablet: true,
|
|
62
|
+
mobile: true
|
|
63
|
+
}),
|
|
59
64
|
...common.getBackgroundImageHeroBanner(background, enableLazyImage, isNotLiquid)
|
|
60
65
|
});
|
|
61
66
|
const containBackgroundClasses = system.createClass({
|
|
@@ -80,23 +85,26 @@ const HeroBannerItem = (props)=>{
|
|
|
80
85
|
...getClasses.getIframeYoutubeClasses()
|
|
81
86
|
});
|
|
82
87
|
const embed = React.useMemo(()=>{
|
|
83
|
-
if (common.showVideoType(background))
|
|
88
|
+
if (!common.showVideoType(background)) return;
|
|
89
|
+
if (dataVideo?.videoType === 'html5' && !dataVideo.videoHtml5) return null;
|
|
90
|
+
if (dataVideo?.videoType === 'youtube' && !dataVideo.video) return null;
|
|
91
|
+
if (dataVideo?.videoType === 'html5' && dataVideo?.videoHtml5) {
|
|
84
92
|
return /*#__PURE__*/ jsxRuntime.jsx(HTML5Embed.default, {
|
|
85
93
|
muted: true,
|
|
86
|
-
loop: dataVideo?.
|
|
94
|
+
loop: dataVideo?.loop,
|
|
87
95
|
controls: false,
|
|
88
96
|
autoplay: true,
|
|
89
|
-
src: dataVideo?.
|
|
97
|
+
src: dataVideo?.videoHtml5 || '',
|
|
90
98
|
title: "Video",
|
|
91
99
|
style: html5VideoStyle,
|
|
92
100
|
className: html5VideoClasses
|
|
93
101
|
});
|
|
94
102
|
}
|
|
95
|
-
const youtubeUrl = dataVideo?.
|
|
103
|
+
const youtubeUrl = dataVideo?.video ?? '';
|
|
96
104
|
const videoId = common$1.getYoutubeVideoId(youtubeUrl);
|
|
97
|
-
const isLoop = dataVideo?.
|
|
105
|
+
const isLoop = dataVideo?.loop ? 1 : 0;
|
|
98
106
|
const params = `&loop=${isLoop}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
|
|
99
|
-
if (dataVideo?.
|
|
107
|
+
if (dataVideo?.videoType === 'youtube' && videoId && common$1.youtubeVideoRegex.test(youtubeUrl)) {
|
|
100
108
|
return /*#__PURE__*/ jsxRuntime.jsx(LiteYouTubeEmbed.default, {
|
|
101
109
|
id: videoId,
|
|
102
110
|
isHeroBanner: true,
|
|
@@ -107,7 +115,7 @@ const HeroBannerItem = (props)=>{
|
|
|
107
115
|
adNetwork: false,
|
|
108
116
|
noCookie: true,
|
|
109
117
|
muted: true,
|
|
110
|
-
lazy: dataVideo?.
|
|
118
|
+
lazy: dataVideo?.lazyLoad ?? true,
|
|
111
119
|
style: youtubeIframeStyle,
|
|
112
120
|
wrapperClass: wrapperYoutubeClasses,
|
|
113
121
|
iframeClass: iframeYoutubeClasses
|
|
@@ -13,7 +13,8 @@ var common = require('./common/common.js');
|
|
|
13
13
|
var getSrcSet = require('../../image/helpers/getSrcSet.js');
|
|
14
14
|
var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
15
15
|
var LiteYouTubeEmbed_liquid = require('../../video/components/LiteYouTubeEmbed.liquid.js');
|
|
16
|
-
var common$
|
|
16
|
+
var common$2 = require('../../video/helpers/common.js');
|
|
17
|
+
var common$1 = require('../../grid/row/commons/common.js');
|
|
17
18
|
|
|
18
19
|
const HeroBannerItem = (props)=>{
|
|
19
20
|
const { enableLazyloadImage, setting, styles, children, builderProps, rawChildren } = props;
|
|
@@ -23,12 +24,12 @@ const HeroBannerItem = (props)=>{
|
|
|
23
24
|
const enableLazyImage = setting?.preload || !enableLazyloadImage;
|
|
24
25
|
const isNotLiquid = false;
|
|
25
26
|
const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
26
|
-
const dataVideo = common.
|
|
27
|
+
const dataVideo = common.getResponsiveSetting(background || {}).desktop;
|
|
27
28
|
const containerStyle = system.createStyle({
|
|
28
29
|
...getStyle.getContainerStyle(styles, setting)
|
|
29
30
|
});
|
|
30
31
|
const containerClasses = system.createClass({
|
|
31
|
-
...getClasses.getContainerClasses(setting)
|
|
32
|
+
...getClasses.getContainerClasses(setting, styles)
|
|
32
33
|
});
|
|
33
34
|
const overlayStyle = system.createStyle({
|
|
34
35
|
...getStyle.getOverlayStyle(styles)
|
|
@@ -95,24 +96,25 @@ const HeroBannerItem = (props)=>{
|
|
|
95
96
|
}).join('');
|
|
96
97
|
};
|
|
97
98
|
const embed = ()=>{
|
|
98
|
-
if (common.showVideoType(background))
|
|
99
|
+
if (!common.showVideoType(background)) return;
|
|
100
|
+
if (common$1.isRenderHtmlVideo(background)) {
|
|
99
101
|
return HTML5Embed_liquid.default({
|
|
100
102
|
uid: builderProps?.uid,
|
|
101
103
|
muted: true,
|
|
102
|
-
loop: dataVideo?.
|
|
104
|
+
loop: dataVideo?.loop,
|
|
103
105
|
controls: false,
|
|
104
106
|
autoplay: true,
|
|
105
|
-
src: dataVideo?.
|
|
107
|
+
src: dataVideo?.videoHtml5 || '',
|
|
106
108
|
title: 'Video',
|
|
107
109
|
style: html5VideoStyle,
|
|
108
110
|
className: html5VideoClasses
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
|
-
const youtubeUrl = dataVideo?.
|
|
112
|
-
const videoId = common$
|
|
113
|
+
const youtubeUrl = dataVideo?.video ?? '';
|
|
114
|
+
const videoId = common$2.getYoutubeVideoId(youtubeUrl);
|
|
113
115
|
const isLoop = false;
|
|
114
116
|
const params = `&loop=${isLoop}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
|
|
115
|
-
if (dataVideo?.
|
|
117
|
+
if (dataVideo?.videoType === 'youtube' && videoId && common$2.youtubeVideoRegex.test(youtubeUrl)) {
|
|
116
118
|
return LiteYouTubeEmbed_liquid.default({
|
|
117
119
|
uid: builderProps?.uid,
|
|
118
120
|
id: videoId,
|
|
@@ -124,7 +126,7 @@ const HeroBannerItem = (props)=>{
|
|
|
124
126
|
adNetwork: false,
|
|
125
127
|
noCookie: true,
|
|
126
128
|
muted: true,
|
|
127
|
-
lazy: dataVideo?.
|
|
129
|
+
lazy: dataVideo?.lazyLoad ?? true,
|
|
128
130
|
preload: true,
|
|
129
131
|
style: youtubeIframeStyle,
|
|
130
132
|
wrapperClass: wrapperYoutubeClasses,
|
|
@@ -145,7 +147,7 @@ const HeroBannerItem = (props)=>{
|
|
|
145
147
|
${backgroundImageLazyload()}
|
|
146
148
|
${embed()}
|
|
147
149
|
</div>
|
|
148
|
-
${system.If(!!overlayColor, core.template`<div aria-label="Overlay" role="banner" class="${overlayClasses}" style="${overlayStyle}"
|
|
150
|
+
${system.If(!!overlayColor, core.template`<div aria-label="Overlay" role="banner" class="${overlayClasses}" style="${overlayStyle}"> </div>`)}
|
|
149
151
|
</div>
|
|
150
152
|
${Row_liquid.default({
|
|
151
153
|
className: rowClasses,
|
|
@@ -62,9 +62,9 @@ const getBgImage = (background)=>{
|
|
|
62
62
|
const getBackgroundImageHeroBanner = (background, enableLazyImage = false, isNotLiquid = false)=>{
|
|
63
63
|
const srcSet = getBgImage(background);
|
|
64
64
|
return core.makeStyleResponsive('bgi', {
|
|
65
|
-
desktop: `url('${
|
|
66
|
-
tablet: `url('${
|
|
67
|
-
mobile: `url('${
|
|
65
|
+
desktop: `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'desktop'), 'desktop', isNotLiquid) : imagePlaceholder}')`,
|
|
66
|
+
tablet: `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'tablet'), 'tablet', isNotLiquid) : imagePlaceholder}')`,
|
|
67
|
+
mobile: `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'mobile'), 'mobile', isNotLiquid) : imagePlaceholder}')`
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
70
|
const getAttachmentDevice = (background)=>{
|
|
@@ -213,26 +213,6 @@ const getDisplayStyleByFitContent = (globalSize, background)=>{
|
|
|
213
213
|
});
|
|
214
214
|
return core.makeStyleResponsive('d', result);
|
|
215
215
|
};
|
|
216
|
-
const cleanUnusedData = (background)=>{
|
|
217
|
-
for(const device in background){
|
|
218
|
-
const data = background?.[device];
|
|
219
|
-
if (!data) return;
|
|
220
|
-
if (data.type !== 'video') {
|
|
221
|
-
delete data.video;
|
|
222
|
-
delete data.videoType;
|
|
223
|
-
delete data.videoHtml5;
|
|
224
|
-
delete data.loop;
|
|
225
|
-
} else if (data.videoType === 'youtube') {
|
|
226
|
-
delete data.videoHtml5;
|
|
227
|
-
} else if (data.videoType === 'html5') {
|
|
228
|
-
delete data.video;
|
|
229
|
-
}
|
|
230
|
-
if (data.type !== 'image') {
|
|
231
|
-
delete data.image;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return background;
|
|
235
|
-
};
|
|
236
216
|
const getWidth = (width)=>{
|
|
237
217
|
let result = {};
|
|
238
218
|
const DEVICES = [
|
|
@@ -457,11 +437,16 @@ const getResponsiveSetting = (setting)=>{
|
|
|
457
437
|
};
|
|
458
438
|
};
|
|
459
439
|
const showVideoType = (background)=>{
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
440
|
+
const DEVICES = [
|
|
441
|
+
'desktop',
|
|
442
|
+
'tablet',
|
|
443
|
+
'mobile'
|
|
444
|
+
];
|
|
445
|
+
return DEVICES.some((item)=>{
|
|
446
|
+
const bg = core.getValueByDevice(background, item);
|
|
447
|
+
if (bg) return bg.videoType === 'html5' && bg.videoHtml5 || bg.videoType === 'youtube' && bg.video;
|
|
448
|
+
return false;
|
|
449
|
+
});
|
|
465
450
|
};
|
|
466
451
|
function debounce(func, wait) {
|
|
467
452
|
let timeout;
|
|
@@ -472,7 +457,6 @@ function debounce(func, wait) {
|
|
|
472
457
|
}
|
|
473
458
|
|
|
474
459
|
exports.bgiEnableByDevice = bgiEnableByDevice;
|
|
475
|
-
exports.cleanUnusedData = cleanUnusedData;
|
|
476
460
|
exports.debounce = debounce;
|
|
477
461
|
exports.getAspectRatioSettings = getAspectRatioSettings;
|
|
478
462
|
exports.getAttachmentDevice = getAttachmentDevice;
|
|
@@ -35,7 +35,8 @@ const getContainerClasses = (setting, styles)=>{
|
|
|
35
35
|
};
|
|
36
36
|
const getOverlayClasses = (styles)=>{
|
|
37
37
|
const { overlayColor } = styles ?? {};
|
|
38
|
-
let classList = 'gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300
|
|
38
|
+
let classList = 'gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300 ';
|
|
39
|
+
if (overlayColor?.hover) classList += ` group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]`;
|
|
39
40
|
if (core.getGlobalColorStateClass('bg', overlayColor)) classList += ` ${core.getGlobalColorStateClass('bg', overlayColor)}`;
|
|
40
41
|
return composeClasses(classList);
|
|
41
42
|
};
|
|
@@ -50,6 +50,8 @@ const getContainerStyle = (styles, setting)=>{
|
|
|
50
50
|
};
|
|
51
51
|
const getOverlayStyle = (styles)=>{
|
|
52
52
|
const { overlayColor, overlayOpacity } = styles ?? {};
|
|
53
|
+
console.log('111', core.getGlobalColorStateStyle('bgc', overlayColor));
|
|
54
|
+
console.log('22', core.makeStyleState('op', overlayOpacity));
|
|
53
55
|
const composeStyles = {
|
|
54
56
|
...core.getGlobalColorStateStyle('bgc', overlayColor),
|
|
55
57
|
...core.makeStyleState('op', overlayOpacity),
|
|
@@ -69,14 +69,9 @@ const useHeroBanner = (styles, setting, currentDevice)=>{
|
|
|
69
69
|
elementRef,
|
|
70
70
|
bgRef
|
|
71
71
|
]);
|
|
72
|
-
const dataVideo =
|
|
73
|
-
return common.getDataVideoHeroBannerResponsive(currentDevice, background);
|
|
74
|
-
}, [
|
|
75
|
-
background,
|
|
76
|
-
currentDevice
|
|
77
|
-
]);
|
|
72
|
+
const dataVideo = core.getBgVideoByDevice(background, currentDevice);
|
|
78
73
|
const isShowVideoHtml5 = React.useMemo(()=>{
|
|
79
|
-
return Boolean(dataVideo?.
|
|
74
|
+
return Boolean(dataVideo?.videoHtml5 && dataVideo.videoType === 'html5');
|
|
80
75
|
}, [
|
|
81
76
|
dataVideo
|
|
82
77
|
]);
|
|
@@ -141,6 +141,12 @@ const SettingsV2 = [
|
|
|
141
141
|
label: 'Preload',
|
|
142
142
|
default: false
|
|
143
143
|
},
|
|
144
|
+
{
|
|
145
|
+
id: 'enableLink',
|
|
146
|
+
label: '',
|
|
147
|
+
type: 'toggle',
|
|
148
|
+
default: true
|
|
149
|
+
},
|
|
144
150
|
{
|
|
145
151
|
id: 'link',
|
|
146
152
|
type: 'pick-link',
|
|
@@ -352,6 +358,12 @@ const SettingsV2 = [
|
|
|
352
358
|
default: 'auto'
|
|
353
359
|
}
|
|
354
360
|
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: 'contentBanner',
|
|
364
|
+
type: 'banner',
|
|
365
|
+
message: `The background image should be taller than the Hero Banner`,
|
|
366
|
+
closable: true
|
|
355
367
|
}
|
|
356
368
|
]
|
|
357
369
|
},
|
|
@@ -312,14 +312,26 @@ const SettingUIV2 = [
|
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
314
|
type: 'combo',
|
|
315
|
+
fixedValue: 'Enabled',
|
|
316
|
+
iconName: 'polaris-parallax-effect',
|
|
315
317
|
label: {
|
|
316
318
|
en: 'Parallax scroll'
|
|
317
319
|
},
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
320
|
+
setting: {
|
|
321
|
+
id: 'enableParallax'
|
|
322
|
+
},
|
|
323
|
+
defaultValueWhenClear: false,
|
|
321
324
|
controls: [
|
|
322
325
|
{
|
|
326
|
+
setting: {
|
|
327
|
+
id: 'contentBanner'
|
|
328
|
+
},
|
|
329
|
+
layout: 'vertical'
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
label: {
|
|
333
|
+
en: 'Speed'
|
|
334
|
+
},
|
|
323
335
|
layout: 'vertical',
|
|
324
336
|
setting: {
|
|
325
337
|
id: 'speedParallax'
|
|
@@ -330,11 +342,21 @@ const SettingUIV2 = [
|
|
|
330
342
|
]
|
|
331
343
|
},
|
|
332
344
|
{
|
|
333
|
-
label: {
|
|
334
|
-
en: 'Link'
|
|
335
|
-
},
|
|
336
345
|
controls: [
|
|
337
346
|
{
|
|
347
|
+
label: {
|
|
348
|
+
en: 'Link'
|
|
349
|
+
},
|
|
350
|
+
setting: {
|
|
351
|
+
id: 'enableLink'
|
|
352
|
+
},
|
|
353
|
+
options: {
|
|
354
|
+
labelVariant: 'primary',
|
|
355
|
+
toggleStyle: 'switch'
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
conditionDisplay: 'enableLink == true',
|
|
338
360
|
setting: {
|
|
339
361
|
id: 'link'
|
|
340
362
|
},
|
|
@@ -19,7 +19,7 @@ const CountdownSettings = [
|
|
|
19
19
|
id: 'behaviour',
|
|
20
20
|
label: 'Type',
|
|
21
21
|
type: 'select',
|
|
22
|
-
default: '
|
|
22
|
+
default: 'evergreen',
|
|
23
23
|
options: [
|
|
24
24
|
{
|
|
25
25
|
label: 'To specific date',
|
|
@@ -380,6 +380,18 @@ const CountdownSettings = [
|
|
|
380
380
|
{
|
|
381
381
|
id: 'style',
|
|
382
382
|
controls: [
|
|
383
|
+
{
|
|
384
|
+
id: 'enableLabelTextStyle',
|
|
385
|
+
label: '',
|
|
386
|
+
type: 'toggle',
|
|
387
|
+
default: true
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
id: 'enableNumberTextStyle',
|
|
391
|
+
label: '',
|
|
392
|
+
type: 'toggle',
|
|
393
|
+
default: true
|
|
394
|
+
},
|
|
383
395
|
{
|
|
384
396
|
id: 'textNumberGroup',
|
|
385
397
|
label: 'Text Number',
|
|
@@ -472,6 +484,36 @@ const CountdownSettings = [
|
|
|
472
484
|
}
|
|
473
485
|
}
|
|
474
486
|
},
|
|
487
|
+
{
|
|
488
|
+
id: 'padding',
|
|
489
|
+
type: 'padding-v2',
|
|
490
|
+
devices: {
|
|
491
|
+
desktop: {
|
|
492
|
+
default: {
|
|
493
|
+
padding: {
|
|
494
|
+
type: 'custom',
|
|
495
|
+
top: '12px',
|
|
496
|
+
left: '24px',
|
|
497
|
+
bottom: '12px',
|
|
498
|
+
right: '24px'
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
compoDefaultValue: {
|
|
504
|
+
desktop: {
|
|
505
|
+
default: {
|
|
506
|
+
padding: {
|
|
507
|
+
type: 'custom',
|
|
508
|
+
top: '12px',
|
|
509
|
+
left: '24px',
|
|
510
|
+
bottom: '12px',
|
|
511
|
+
right: '24px'
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
},
|
|
475
517
|
{
|
|
476
518
|
id: 'itemSettingGroup',
|
|
477
519
|
type: 'group',
|
|
@@ -486,7 +528,9 @@ const CountdownSettings = [
|
|
|
486
528
|
{
|
|
487
529
|
id: 'verticalGap',
|
|
488
530
|
label: 'Vertical Gap',
|
|
489
|
-
type: 'input:
|
|
531
|
+
type: 'input:slider',
|
|
532
|
+
min: 0,
|
|
533
|
+
max: 120,
|
|
490
534
|
units: [
|
|
491
535
|
'px'
|
|
492
536
|
],
|
|
@@ -496,17 +540,18 @@ const CountdownSettings = [
|
|
|
496
540
|
{
|
|
497
541
|
id: 'horizontalGap',
|
|
498
542
|
label: 'Horizontal Gap',
|
|
499
|
-
type: 'input:
|
|
543
|
+
type: 'input:slider',
|
|
544
|
+
min: 0,
|
|
545
|
+
max: 120,
|
|
500
546
|
units: [
|
|
501
547
|
'px'
|
|
502
548
|
],
|
|
503
|
-
default: '8px'
|
|
504
|
-
placeholder: 'Auto'
|
|
549
|
+
default: '8px'
|
|
505
550
|
},
|
|
506
551
|
{
|
|
507
552
|
id: 'itemPadding',
|
|
508
553
|
label: 'Padding',
|
|
509
|
-
type: '
|
|
554
|
+
type: 'padding-v2',
|
|
510
555
|
default: {
|
|
511
556
|
type: 'medium'
|
|
512
557
|
},
|