@gem-sdk/components 2.0.0-dev.481 → 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.
Files changed (42) 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/product/components/ProductDiscountTag/index.liquid.js +3 -2
  17. package/dist/cjs/product/components/ProductSKU/Sku.liquid.js +3 -2
  18. package/dist/cjs/product/setting/product-price/configs/uiV2.js +1 -1
  19. package/dist/cjs/stock-counter/setting/configs/settingsV2.js +7 -6
  20. package/dist/cjs/stock-counter/setting/configs/uiV2.js +36 -6
  21. package/dist/esm/article/components/ArticleList.js +1 -2
  22. package/dist/esm/article/components/ArticleList.liquid.js +1 -1
  23. package/dist/esm/article/setting/ArticleList.js +7 -591
  24. package/dist/esm/article/setting/configs/ArticleList/presets.js +344 -0
  25. package/dist/esm/article/setting/configs/ArticleList/settings.js +313 -0
  26. package/dist/esm/article/setting/configs/ArticleList/uiV2.js +199 -0
  27. package/dist/esm/banner/components/HeroBanner.liquid.js +2 -2
  28. package/dist/esm/banner/components/HeroBannerItem.js +16 -8
  29. package/dist/esm/banner/components/HeroBannerItem.liquid.js +12 -10
  30. package/dist/esm/banner/components/common/common.js +15 -30
  31. package/dist/esm/banner/components/common/getClasses.js +2 -1
  32. package/dist/esm/banner/components/common/getStyle.js +2 -0
  33. package/dist/esm/banner/components/hooks/useHeroBanner.js +4 -9
  34. package/dist/esm/banner/setting/setting.js +6 -0
  35. package/dist/esm/banner/setting/uiV2.js +15 -3
  36. package/dist/esm/product/components/ProductDiscountTag/index.liquid.js +3 -2
  37. package/dist/esm/product/components/ProductSKU/Sku.liquid.js +4 -3
  38. package/dist/esm/product/setting/product-price/configs/uiV2.js +1 -1
  39. package/dist/esm/stock-counter/setting/configs/settingsV2.js +8 -7
  40. package/dist/esm/stock-counter/setting/configs/uiV2.js +36 -6
  41. package/dist/types/index.d.ts +2 -0
  42. 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'
@@ -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
  {
@@ -67,7 +67,7 @@ const StockCounterSettingsV2 = [
67
67
  {
68
68
  id: 'remaining',
69
69
  type: 'input:stepper',
70
- default: 16
70
+ default: 4
71
71
  },
72
72
  {
73
73
  id: 'displayCondition',
@@ -103,7 +103,7 @@ const StockCounterSettingsV2 = [
103
103
  id: 'oosIcon',
104
104
  label: '',
105
105
  type: 'icon',
106
- default: `<svg width="100%" height="100%" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> <path d="M7.75193 0.0658784C7.90565 -0.0219595 8.09435 -0.0219595 8.24807 0.0658784L11.9981 2.20874C12.1539 2.29776 12.25 2.46343 12.25 2.64286V6.63841L15.7481 8.63731C15.9039 8.72633 16 8.892 16 9.07143V13.3571C16 13.5366 15.9039 13.7022 15.7481 13.7913L11.9981 15.9341C11.8444 16.022 11.6556 16.022 11.5019 15.9341L8 13.933L4.49807 15.9341C4.34435 16.022 4.15565 16.022 4.00193 15.9341L0.25193 13.7913C0.096143 13.7022 0 13.5366 0 13.3571V9.07143C0 8.892 0.096143 8.72633 0.251931 8.63731L3.75 6.63841V2.64286C3.75 2.46343 3.84614 2.29776 4.00193 2.20874L7.75193 0.0658784ZM4.25 7.50445L1.50778 9.07143L4.25 10.6384L6.99222 9.07143L4.25 7.50445ZM7.5 9.93302L4.75 11.5044V14.6384L7.5 13.067V9.93302ZM8.5 13.067L11.25 14.6384V11.5044L8.5 9.93302V13.067ZM9.00778 9.07143L11.75 10.6384L14.4922 9.07143L11.75 7.50445L9.00778 9.07143ZM11.25 6.63841V3.50445L8.5 5.07588V8.20984L11.25 6.63841ZM7.5 8.20984V5.07588L4.75 3.50445V6.63841L7.5 8.20984ZM5.25778 2.64286L8 4.20984L10.7422 2.64286L8 1.07588L5.25778 2.64286ZM15 9.93302L12.25 11.5044V14.6384L15 13.067V9.93302ZM3.75 14.6384V11.5044L1 9.93302V13.067L3.75 14.6384Z" fill="currentColor"/> </svg>`
106
+ default: `<svg data-name="boxes" width="100%" height="100%" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> <path d="M7.75193 0.0658784C7.90565 -0.0219595 8.09435 -0.0219595 8.24807 0.0658784L11.9981 2.20874C12.1539 2.29776 12.25 2.46343 12.25 2.64286V6.63841L15.7481 8.63731C15.9039 8.72633 16 8.892 16 9.07143V13.3571C16 13.5366 15.9039 13.7022 15.7481 13.7913L11.9981 15.9341C11.8444 16.022 11.6556 16.022 11.5019 15.9341L8 13.933L4.49807 15.9341C4.34435 16.022 4.15565 16.022 4.00193 15.9341L0.25193 13.7913C0.096143 13.7022 0 13.5366 0 13.3571V9.07143C0 8.892 0.096143 8.72633 0.251931 8.63731L3.75 6.63841V2.64286C3.75 2.46343 3.84614 2.29776 4.00193 2.20874L7.75193 0.0658784ZM4.25 7.50445L1.50778 9.07143L4.25 10.6384L6.99222 9.07143L4.25 7.50445ZM7.5 9.93302L4.75 11.5044V14.6384L7.5 13.067V9.93302ZM8.5 13.067L11.25 14.6384V11.5044L8.5 9.93302V13.067ZM9.00778 9.07143L11.75 10.6384L14.4922 9.07143L11.75 7.50445L9.00778 9.07143ZM11.25 6.63841V3.50445L8.5 5.07588V8.20984L11.25 6.63841ZM7.5 8.20984V5.07588L4.75 3.50445V6.63841L7.5 8.20984ZM5.25778 2.64286L8 4.20984L10.7422 2.64286L8 1.07588L5.25778 2.64286ZM15 9.93302L12.25 11.5044V14.6384L15 13.067V9.93302ZM3.75 14.6384V11.5044L1 9.93302V13.067L3.75 14.6384Z" fill="currentColor"/> </svg>`
107
107
  },
108
108
  {
109
109
  id: 'hiddenCounterWhenOutOfStock',
@@ -131,8 +131,9 @@ const StockCounterSettingsV2 = [
131
131
  type: 'textarea',
132
132
  autoHeight: true,
133
133
  showPlusBtn: true,
134
- default: `<${_const.DEFAULT_HIGHLIGHT_TAG}>HURRY!</${_const.DEFAULT_HIGHLIGHT_TAG}> ONLY ${_const.DEFAULT_QUANTITY_TEMPLATE} LEFT`,
134
+ default: `Only ${_const.DEFAULT_QUANTITY_TEMPLATE} left`,
135
135
  info: `Use ${_const.DEFAULT_QUANTITY_TEMPLATE} to represent remaining number`,
136
+ minHeight: 56,
136
137
  suggestContents: [
137
138
  {
138
139
  message: '%number%',
@@ -151,7 +152,7 @@ const StockCounterSettingsV2 = [
151
152
  label: 'Continue Selling When Out Of Stock Message',
152
153
  type: 'textarea',
153
154
  autoHeight: true,
154
- default: '<mark>Restock soon!</mark> PREORDER NOW',
155
+ default: 'Restock soon! PREORDER NOW',
155
156
  info: 'Turn out-of-stock productions into pre-orders'
156
157
  },
157
158
  {
@@ -159,7 +160,7 @@ const StockCounterSettingsV2 = [
159
160
  label: 'Unlimited Quantity Message',
160
161
  type: 'textarea',
161
162
  autoHeight: true,
162
- default: '<mark>HURRY!</mark> LET BUY NOW'
163
+ default: 'Hurry! LET BUY NOW'
163
164
  }
164
165
  ]
165
166
  },
@@ -178,7 +179,7 @@ const StockCounterSettingsV2 = [
178
179
  id: 'icon',
179
180
  label: '',
180
181
  type: 'icon',
181
- default: `<svg style="width: 100%; height: 100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M176.64 11.488A16 16 0 0 1 192 0h128a16 16 0 0 1 15.168 21.056L278.208 192H400a16 16 0 0 1 12.64 25.824l-224 288a16 16 0 0 1 -27.936 -14.528L218.336 304H112a16 16 0 0 1 -15.36 -20.512l80 -272z" /></svg>`
182
+ default: `<svg data-name="Lightning" style="width: 100%; height: 100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path fill="currentColor" strokeLinecap="round" strokeLinejoin="round" fill="currentColor" d="M176.64 11.488A16 16 0 0 1 192 0h128a16 16 0 0 1 15.168 21.056L278.208 192H400a16 16 0 0 1 12.64 25.824l-224 288a16 16 0 0 1 -27.936 -14.528L218.336 304H112a16 16 0 0 1 -15.36 -20.512l80 -272z" /></svg>`
182
183
  }
183
184
  ]
184
185
  },