@gem-sdk/components 2.0.0-dev.481 → 2.0.0-dev.483

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 (50) hide show
  1. package/dist/cjs/article/components/ArticleList.js +1 -2
  2. package/dist/cjs/article/components/ArticleList.liquid.js +1 -1
  3. package/dist/cjs/article/setting/ArticleList.js +7 -591
  4. package/dist/cjs/article/setting/configs/ArticleList/presets.js +346 -0
  5. package/dist/cjs/article/setting/configs/ArticleList/settings.js +315 -0
  6. package/dist/cjs/article/setting/configs/ArticleList/uiV2.js +201 -0
  7. package/dist/cjs/banner/components/HeroBanner.liquid.js +2 -2
  8. package/dist/cjs/banner/components/HeroBannerItem.js +15 -7
  9. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +13 -11
  10. package/dist/cjs/banner/components/common/common.js +13 -29
  11. package/dist/cjs/banner/components/common/getClasses.js +2 -1
  12. package/dist/cjs/banner/components/common/getStyle.js +2 -0
  13. package/dist/cjs/banner/components/hooks/useHeroBanner.js +2 -7
  14. package/dist/cjs/banner/setting/setting.js +6 -0
  15. package/dist/cjs/banner/setting/uiV2.js +15 -3
  16. package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +2 -2
  17. package/dist/cjs/form/components/newsletter/common/composeStyles.js +4 -3
  18. package/dist/cjs/form/setting/newsletter/configs/settings.js +4 -2
  19. package/dist/cjs/form/setting/newsletter/configs/uiV2.js +2 -0
  20. package/dist/cjs/product/components/ProductDiscountTag/index.liquid.js +3 -2
  21. package/dist/cjs/product/components/ProductSKU/Sku.liquid.js +3 -2
  22. package/dist/cjs/product/setting/product-price/configs/uiV2.js +1 -1
  23. package/dist/cjs/stock-counter/setting/configs/settingsV2.js +7 -6
  24. package/dist/cjs/stock-counter/setting/configs/uiV2.js +36 -6
  25. package/dist/esm/article/components/ArticleList.js +1 -2
  26. package/dist/esm/article/components/ArticleList.liquid.js +1 -1
  27. package/dist/esm/article/setting/ArticleList.js +7 -591
  28. package/dist/esm/article/setting/configs/ArticleList/presets.js +344 -0
  29. package/dist/esm/article/setting/configs/ArticleList/settings.js +313 -0
  30. package/dist/esm/article/setting/configs/ArticleList/uiV2.js +199 -0
  31. package/dist/esm/banner/components/HeroBanner.liquid.js +2 -2
  32. package/dist/esm/banner/components/HeroBannerItem.js +16 -8
  33. package/dist/esm/banner/components/HeroBannerItem.liquid.js +12 -10
  34. package/dist/esm/banner/components/common/common.js +15 -30
  35. package/dist/esm/banner/components/common/getClasses.js +2 -1
  36. package/dist/esm/banner/components/common/getStyle.js +2 -0
  37. package/dist/esm/banner/components/hooks/useHeroBanner.js +4 -9
  38. package/dist/esm/banner/setting/setting.js +6 -0
  39. package/dist/esm/banner/setting/uiV2.js +15 -3
  40. package/dist/esm/form/components/newsletter/Newsletter.liquid.js +2 -2
  41. package/dist/esm/form/components/newsletter/common/composeStyles.js +4 -3
  42. package/dist/esm/form/setting/newsletter/configs/settings.js +4 -2
  43. package/dist/esm/form/setting/newsletter/configs/uiV2.js +2 -0
  44. package/dist/esm/product/components/ProductDiscountTag/index.liquid.js +3 -2
  45. package/dist/esm/product/components/ProductSKU/Sku.liquid.js +4 -3
  46. package/dist/esm/product/setting/product-price/configs/uiV2.js +1 -1
  47. package/dist/esm/stock-counter/setting/configs/settingsV2.js +8 -7
  48. package/dist/esm/stock-counter/setting/configs/uiV2.js +36 -6
  49. package/dist/types/index.d.ts +2 -0
  50. 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.cleanUnusedData(common.getResponsiveSetting(styles?.background || {})),
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?.data.loop,
94
+ loop: dataVideo?.loop,
87
95
  controls: false,
88
96
  autoplay: true,
89
- src: dataVideo?.data.videoHtml5 || '',
97
+ src: dataVideo?.videoHtml5 || '',
90
98
  title: "Video",
91
99
  style: html5VideoStyle,
92
100
  className: html5VideoClasses
93
101
  });
94
102
  }
95
- const youtubeUrl = dataVideo?.data.video ?? '';
103
+ const youtubeUrl = dataVideo?.video ?? '';
96
104
  const videoId = common$1.getYoutubeVideoId(youtubeUrl);
97
- const isLoop = dataVideo?.data.loop ? 1 : 0;
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?.data.videoType === 'youtube' && videoId && common$1.youtubeVideoRegex.test(youtubeUrl)) {
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?.data.lazyLoad ?? true,
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$1 = require('../../video/helpers/common.js');
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.getDataVideoHeroBannerResponsive('desktop', background);
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?.data?.loop,
104
+ loop: dataVideo?.loop,
103
105
  controls: false,
104
106
  autoplay: true,
105
- src: dataVideo?.data?.videoHtml5 || '',
107
+ src: dataVideo?.videoHtml5 || '',
106
108
  title: 'Video',
107
109
  style: html5VideoStyle,
108
110
  className: html5VideoClasses
109
111
  });
110
112
  }
111
- const youtubeUrl = dataVideo?.data?.video ?? '';
112
- const videoId = common$1.getYoutubeVideoId(youtubeUrl);
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?.data?.videoType === 'youtube' && videoId && common$1.youtubeVideoRegex.test(youtubeUrl)) {
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?.data?.lazyLoad ?? true,
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}"></div>`)}
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('${getEnableBgImageByDevice('desktop', background) ? !enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'desktop'), 'desktop', isNotLiquid) : imagePlaceholder : ''}')`,
66
- tablet: `url('${getEnableBgImageByDevice('tablet', background) ? !enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'tablet'), 'tablet', isNotLiquid) : imagePlaceholder : ''}')`,
67
- mobile: `url('${getEnableBgImageByDevice('mobile', background) ? !enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'mobile'), 'mobile', isNotLiquid) : imagePlaceholder : ''}')`
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 backgroundResponsive = cleanUnusedData(getResponsiveSetting(background || {}));
461
- const showVideoType = backgroundResponsive?.desktop?.type == 'video' && backgroundResponsive?.desktop?.videoType == 'html5';
462
- const showVideoTypeTablet = backgroundResponsive?.tablet?.type == 'video' && backgroundResponsive?.tablet?.videoType == 'html5';
463
- const showVideoTypeMobile = backgroundResponsive?.mobile?.type == 'video' && backgroundResponsive?.mobile?.videoType == 'html5';
464
- return showVideoType || showVideoTypeTablet || showVideoTypeMobile;
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 group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]';
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 = React.useMemo(()=>{
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?.data.videoHtml5 && dataVideo.data.videoType === 'html5');
74
+ return Boolean(dataVideo?.videoHtml5 && dataVideo.videoType === 'html5');
80
75
  }, [
81
76
  dataVideo
82
77
  ]);
@@ -358,6 +358,12 @@ const SettingsV2 = [
358
358
  default: 'auto'
359
359
  }
360
360
  }
361
+ },
362
+ {
363
+ id: 'contentBanner',
364
+ type: 'banner',
365
+ message: `The background image should be taller than the Hero Banner`,
366
+ closable: true
361
367
  }
362
368
  ]
363
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
- iconName: 'polaris-parallax-effect',
319
- getValueFromSettingID: 'speedParallax',
320
- compoDefaultValue: 0.6,
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'
@@ -31,8 +31,8 @@ const Newsletter = ({ builderProps, setting, children, style, formType, advanced
31
31
  const composedContainerStyles = system.createStyle(composeStyles.composeContainerStylesForm(style));
32
32
  const anchorAttrs = composeAttrs.composeAnchorAttrs(builderProps, setting);
33
33
  const composedFormClasses = system.createClass(composeClasses.composeFormClasses());
34
- const composedFormStylesError = system.createStyle(composeStyles.composeFormStyles('error'));
35
- const composedFormStylesSuccess = system.createStyle(composeStyles.composeFormStyles('success'));
34
+ const composedFormStylesError = system.createStyle(composeStyles.composeFormStyles('error', setting));
35
+ const composedFormStylesSuccess = system.createStyle(composeStyles.composeFormStyles('success', setting));
36
36
  const formAttrsError = composeAttrs.composeFormAttrs(builderProps, 'error');
37
37
  const formAttrsSuccess = composeAttrs.composeFormAttrs(builderProps, 'success');
38
38
  const popoverAttrs = composeAttrs.composePopoverAttrs(builderProps);
@@ -8,20 +8,21 @@ const composeContainerStylesForm = (style)=>{
8
8
  ...style
9
9
  });
10
10
  };
11
- const composeFormStyles = (type)=>{
11
+ const composeFormStyles = (type, setting)=>{
12
+ const { errorColor, successColor } = setting ?? {};
12
13
  if (type === 'success') {
13
14
  return composeStyles({
14
15
  'background-color': '#F2FFEC',
15
16
  left: '50%',
16
17
  transform: 'translateX(-50%)',
17
- color: '#009D3E'
18
+ color: successColor
18
19
  });
19
20
  }
20
21
  return composeStyles({
21
22
  'background-color': '#FFE9E9',
22
23
  left: '50%',
23
24
  transform: 'translateX(-50%)',
24
- color: '#EA3335'
25
+ color: errorColor
25
26
  });
26
27
  };
27
28
  const popoverStyles = (builderProps)=>`
@@ -46,7 +46,8 @@ const NewsletterSettings = [
46
46
  label: 'Success Message',
47
47
  default: "Thanks for contacting us. We'll get back to you as soon as possible.",
48
48
  autoHeight: true,
49
- minHeight: 58
49
+ minHeight: 58,
50
+ compoDefaultValue: "Thanks for contacting us. We'll get back to you as soon as possible."
50
51
  },
51
52
  {
52
53
  id: 'successColor',
@@ -61,7 +62,8 @@ const NewsletterSettings = [
61
62
  label: 'Error Message',
62
63
  default: 'Can’t send email. Please try again later.',
63
64
  autoHeight: true,
64
- minHeight: 58
65
+ minHeight: 58,
66
+ compoDefaultValue: 'Can’t send email. Please try again later.'
65
67
  },
66
68
  {
67
69
  id: 'errorColor',
@@ -25,6 +25,7 @@ const SettingUIV2 = [
25
25
  getValueFromSettingID: 'successMessage',
26
26
  isHideClear: true,
27
27
  disableScrollbar: true,
28
+ compoDefaultValue: "Thanks for contacting us. We'll get back to you as soon as possible.",
28
29
  popoverLabel: {
29
30
  en: 'Success message'
30
31
  },
@@ -57,6 +58,7 @@ const SettingUIV2 = [
57
58
  getValueFromSettingID: 'errorMessage',
58
59
  isHideClear: true,
59
60
  disableScrollbar: true,
61
+ compoDefaultValue: 'Can’t send email. Please try again later.',
60
62
  popoverLabel: {
61
63
  en: 'Error message'
62
64
  },
@@ -34,6 +34,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
34
34
  const wrapperTextClass = system.createClass(getClasses.getWrapperTextClass(styles));
35
35
  const containerClass = system.createClass(getClasses.getContainerClass());
36
36
  const productTagClass = system.createClass(getClasses.getProductTagClass(advanced));
37
+ const isTypePercentage = customContent?.unit === 'percentage';
37
38
  const renderScript = ()=>{
38
39
  const jsURL = core.isLocalEnv ? `{{ 'gp-product-tag.js' | asset_url }}` : `${core.baseAssetURL}/assets-v2/gp-product-tag.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;
39
40
  return `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${jsURL}" defer="defer"></script>`;
@@ -46,7 +47,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
46
47
  assign prefixVal = ${pageContext?.isPreviewing ? JSON.stringify(prefixVal) : prefixVal}
47
48
  assign suffixVal = ${pageContext?.isPreviewing ? JSON.stringify(suffixVal) : suffixVal}
48
49
  %}
49
- ${system.LiquidIf('salePrice == null or price == null', system.Liquid(`{% assign pricePercentage = prefixVal ${system.If(customContent?.unit === 'percentage', `| append: ' 0% '`, `| ${moneyFormat} | append: ' '`)} | append: suffixVal %}`), `${system.If(customContent?.unit === 'percentage', `{% assign salePercent = priceSave | divided_by: salePrice | times: 100 | round %}
50
+ ${system.LiquidIf('salePrice == null or price == null', system.Liquid(`{% assign pricePercentage = prefixVal ${system.If(isTypePercentage, `| append: ' 0% '`, `| ${moneyFormat} | append: ' '`)} | append: suffixVal %}`), `${system.If(isTypePercentage, `{% assign salePercent = priceSave | divided_by: salePrice | times: 100 | round %}
50
51
  {% assign pricePercentage = prefixVal | append: ' ' | append: salePercent | append: '% ' | append: suffixVal %}`, system.LiquidIf('priceSave > 0', `{% assign priceSaveMoney = priceSave | ${moneyFormat} %}
51
52
  {% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`, `{% assign priceSaveMoney = 0 | ${moneyFormat} %}
52
53
  {% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`))}`)}
@@ -55,7 +56,7 @@ const ProductTag = ({ setting, styles, builderProps, advanced, pageContext })=>{
55
56
  class="${productTagClass}"
56
57
  style="${rootStyle}"
57
58
  data-id="${builderProps?.uid}"
58
- data-disabled="{%- if priceSave > 0 -%} false {%- else -%} true {%- endif -%}"
59
+ data-disabled="${system.LiquidIf(`${system.If(isTypePercentage, 'salePercent', 'priceSave')} > 0`, `false`, `true`)}"
59
60
  gp-data='{"setting":${JSON.stringify(setting).replaceAll("'", '&#039;')}, "id": "${builderProps?.uid}", "locale": "{{shop.locale}}", "currency": "{{shop.currency}}", "moneyFormat": "{{ ${setting?.moneyWithCurrentFormat ? 'shop.money_with_currency_format' : 'shop.money_format'} | replace: '"', '\\"' | escape }}"}'
60
61
  price-save="{{priceSave}}"
61
62
  >
@@ -8,7 +8,8 @@ var Text_liquid = require('../../../text/components/Text.liquid.js');
8
8
  var system = require('@gem-sdk/system');
9
9
 
10
10
  const ProductSku = ({ setting, styles, advanced, builderProps })=>{
11
- const labelContent = setting?.label && setting.label.trim().length ? `${setting.label}` : '';
11
+ const isCapitalize = styles?.typo?.attrs?.transform === 'capitalize';
12
+ const labelContent = setting?.label && setting.label.trim().length ? `${isCapitalize ? setting.label.toString().toLocaleLowerCase() : setting.label}` : '';
12
13
  // remove underlineLink from element 7.5
13
14
  if (styles?.disableHoverColor) delete styles.underlineLink;
14
15
  const renderScript = ()=>{
@@ -24,7 +25,7 @@ const ProductSku = ({ setting, styles, advanced, builderProps })=>{
24
25
  styles: styles,
25
26
  setting: {
26
27
  ...setting,
27
- text: `{% if currentVariant.sku.size > 0 %} ${labelContent} {{ currentVariant.sku }} {% endif %}`,
28
+ text: `${system.LiquidIf('currentVariant.sku.size > 0 ', `${labelContent} ${system.If(isCapitalize, `{{ currentVariant.sku | downcase }}`, `{{ currentVariant.sku }}`)}`)}`,
28
29
  excludeFlex: true,
29
30
  isForceValue: true
30
31
  },
@@ -82,7 +82,7 @@ const SettingUIV2 = [
82
82
  },
83
83
  getValueFromSettingID: 'lineColor',
84
84
  comboType: 'color',
85
- defaultValueWhenClear: '',
85
+ defaultValueWhenClear: 'transparent',
86
86
  compoDefaultValue: 'text-1',
87
87
  controls: [
88
88
  {