@gem-sdk/components 2.0.0-dev.596 → 2.0.0-dev.598

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 (29) hide show
  1. package/dist/cjs/banner/components/HeroBannerItem.js +3 -3
  2. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +2 -2
  3. package/dist/cjs/button/components/common/styles.js +20 -3
  4. package/dist/cjs/image/components/NextImage.liquid.js +1 -0
  5. package/dist/cjs/image/setting/configs/settings.js +2 -2
  6. package/dist/cjs/image/setting/configs/uiV2.js +2 -0
  7. package/dist/cjs/image-comparison/components/common/helpers.js +2 -1
  8. package/dist/cjs/image-comparison/components/hooks/useCompareImage.js +5 -3
  9. package/dist/cjs/image-comparison/setting/configs/settings.js +8 -7
  10. package/dist/cjs/image-comparison/setting/configs/uiV2.js +42 -41
  11. package/dist/cjs/product/components/ProductButton/common/styles.js +6 -3
  12. package/dist/cjs/product/components/ProductButton/components/PriceLayout.liquid.js +2 -2
  13. package/dist/cjs/product/setting/product-view-more/configs/settings.js +2 -2
  14. package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +2 -32
  15. package/dist/esm/banner/components/HeroBannerItem.js +3 -3
  16. package/dist/esm/banner/components/HeroBannerItem.liquid.js +2 -2
  17. package/dist/esm/button/components/common/styles.js +21 -4
  18. package/dist/esm/image/components/NextImage.liquid.js +1 -0
  19. package/dist/esm/image/setting/configs/settings.js +2 -2
  20. package/dist/esm/image/setting/configs/uiV2.js +2 -0
  21. package/dist/esm/image-comparison/components/common/helpers.js +2 -1
  22. package/dist/esm/image-comparison/components/hooks/useCompareImage.js +5 -3
  23. package/dist/esm/image-comparison/setting/configs/settings.js +8 -7
  24. package/dist/esm/image-comparison/setting/configs/uiV2.js +42 -41
  25. package/dist/esm/product/components/ProductButton/common/styles.js +6 -3
  26. package/dist/esm/product/components/ProductButton/components/PriceLayout.liquid.js +2 -2
  27. package/dist/esm/product/setting/product-view-more/configs/settings.js +2 -2
  28. package/dist/esm/product/setting/product-view-more/configs/uiV2.js +2 -32
  29. package/package.json +1 -1
@@ -19,7 +19,7 @@ var common$1 = require('../../video/helpers/common.js');
19
19
  const HeroBannerItem = (props)=>{
20
20
  const mode = core.useEditorMode();
21
21
  const { enableLazyloadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
22
- const { layout, verticalAlign, speedParallax, alt, title } = setting ?? {};
22
+ const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
23
23
  const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
24
24
  const enableLazyImage = (setting?.preload || !enableLazyloadImage) && mode !== 'edit';
25
25
  const isNotLiquid = true;
@@ -55,7 +55,7 @@ const HeroBannerItem = (props)=>{
55
55
  ...getClasses.getBackgroundClasses(hoverEffect)
56
56
  });
57
57
  const backgroundStyle = system.createStyle({
58
- ...getStyle.getBackgroundStyle(styles, Number(speedParallax || 0) > 0 || false, transform),
58
+ ...getStyle.getBackgroundStyle(styles, enableParallax, transform),
59
59
  ...core.getGradientBgrStyleByDevice(background, {
60
60
  desktop: true,
61
61
  tablet: true,
@@ -184,7 +184,7 @@ const HeroBannerItem = (props)=>{
184
184
  style: adaptiveStyle,
185
185
  alt: alt,
186
186
  title: title,
187
- enableLazyloadImage: enableLazyloadImage
187
+ enableLazyloadImage: enableLazyloadImage && mode != 'edit'
188
188
  })
189
189
  ]
190
190
  });
@@ -18,7 +18,7 @@ var common$1 = require('../../grid/row/commons/common.js');
18
18
 
19
19
  const HeroBannerItem = (props)=>{
20
20
  const { enableLazyloadImage, setting, styles, children, builderProps, rawChildren } = props;
21
- const { layout, verticalAlign, speedParallax, alt, title } = setting ?? {};
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
24
  const enableLazyImage = setting?.preload || !enableLazyloadImage;
@@ -56,7 +56,7 @@ const HeroBannerItem = (props)=>{
56
56
  ...getClasses.getBackgroundClasses(hoverEffect)
57
57
  });
58
58
  const backgroundStyle = system.createStyle({
59
- ...getStyle.getBackgroundStyle(styles, Number(speedParallax || 0) > 0, transform),
59
+ ...getStyle.getBackgroundStyle(styles, enableParallax, transform),
60
60
  ...common.getBackgroundImageHeroBanner(background, enableLazyImage, isNotLiquid)
61
61
  });
62
62
  const containBackgroundClasses = system.createClass({
@@ -14,7 +14,8 @@ const getButtonStyles = (styles)=>({
14
14
  ...getSizeStyles(styles),
15
15
  ...getRadiusStyles(styles),
16
16
  ...getShadowStyles(styles),
17
- ...getBackgroundStyles(styles)
17
+ ...getBackgroundStyles(styles),
18
+ ...getTypographyStyles(styles).textColorStyle
18
19
  });
19
20
  const getButtonIconStyles = (styles, settings)=>{
20
21
  return {
@@ -51,10 +52,26 @@ const getSizeStyles = (styles)=>{
51
52
  ...composeGlobalSize.padding
52
53
  };
53
54
  };
55
+ const getTypographyStyles = (styles)=>{
56
+ const typographyStyle = core.composeTypographyStyle(styles?.typo, styles?.typography);
57
+ const colorObj = {
58
+ '--c': typographyStyle?.['--c']
59
+ };
60
+ const otherProps = {
61
+ ...typographyStyle
62
+ };
63
+ delete otherProps['--c'];
64
+ return {
65
+ textColorStyle: {
66
+ ...colorObj,
67
+ ...core.makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover))
68
+ },
69
+ withoutTextColorStyles: otherProps
70
+ };
71
+ };
54
72
  const getTypoStyles = (styles)=>{
55
73
  return {
56
- ...core.makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover)),
57
- ...core.composeTypographyStyle(styles?.typo, styles?.typography),
74
+ ...getTypographyStyles(styles).withoutTextColorStyles,
58
75
  ...core.getStyleShadow({
59
76
  styleAppliedFor: 'text-shadow',
60
77
  value: styles?.typo?.custom?.textShadow,
@@ -32,6 +32,7 @@ const NextImage = (props)=>{
32
32
  return core.template`
33
33
  <img
34
34
  ${nextImageAttrs}
35
+ id="${props?.id}"
35
36
  style="${nextImageStyles}"
36
37
  class="${nextImageClasses}"
37
38
  />`;
@@ -98,7 +98,7 @@ const ImageSettings = [
98
98
  minHeight: 56,
99
99
  autoHeight: true,
100
100
  placeholder: 'E.g: Classic white crewneck t-shirt with minimalist design',
101
- default: 'Describes the appearance of the image'
101
+ default: undefined
102
102
  },
103
103
  {
104
104
  id: 'title',
@@ -108,7 +108,7 @@ const ImageSettings = [
108
108
  minHeight: 56,
109
109
  autoHeight: true,
110
110
  placeholder: 'E.g: White t-shirt',
111
- default: 'Title'
111
+ default: undefined
112
112
  }
113
113
  ]
114
114
  },
@@ -353,6 +353,7 @@ const SettingUIV2 = [
353
353
  },
354
354
  iconName: 'polaris-text-block',
355
355
  getValueFromSettingID: 'alt',
356
+ compoDefaultValue: 'Describes the appearance of the image',
356
357
  isHideClear: true,
357
358
  controls: [
358
359
  {
@@ -374,6 +375,7 @@ const SettingUIV2 = [
374
375
  iconName: 'polaris-text-block',
375
376
  getValueFromSettingID: 'title',
376
377
  isHideClear: true,
378
+ compoDefaultValue: 'Title',
377
379
  controls: [
378
380
  {
379
381
  label: {
@@ -131,7 +131,8 @@ const generateTranslateByDevices = ({ isHorizontal, labelPositionHoz, labelPosit
131
131
  return translateByDevices;
132
132
  };
133
133
  const getSliderPositionPercentage = (defaultPercentage)=>{
134
- return (defaultPercentage ?? 50) / 100;
134
+ const percentage = typeof defaultPercentage === 'string' ? parseInt(defaultPercentage ?? 0) : defaultPercentage;
135
+ return (percentage ?? 50) / 100;
135
136
  };
136
137
 
137
138
  exports.composeAspectRatio = composeAspectRatio;
@@ -19,9 +19,11 @@ const useCompareImage = ({ props, aspectRatio })=>{
19
19
  const leftImageRef = React.useRef(null);
20
20
  const { onListener, saveToElementInteractionData } = core.useInteraction();
21
21
  const ref = React.useRef(null);
22
- const memoAspectRatio = React.useMemo(()=>aspectRatio || styles?.aspectRatio, [
23
- aspectRatio,
24
- styles?.aspectRatio
22
+ const memoAspectRatio = React.useMemo(()=>aspectRatio, [
23
+ leftImage,
24
+ rightImage,
25
+ styles?.aspectRatio,
26
+ styles?.customAspectRadio
25
27
  ]);
26
28
  React.useEffect(()=>{
27
29
  const selector = `[data-id="${props?.componentUid}"]`;
@@ -34,7 +34,8 @@ const ImageComparisonSettings = [
34
34
  height: 600
35
35
  },
36
36
  hiddenSetting: {
37
- seo: true
37
+ seo: true,
38
+ optimizeLCP: true
38
39
  }
39
40
  }
40
41
  ]
@@ -53,7 +54,8 @@ const ImageComparisonSettings = [
53
54
  height: 600
54
55
  },
55
56
  hiddenSetting: {
56
- seo: true
57
+ seo: true,
58
+ optimizeLCP: true
57
59
  }
58
60
  }
59
61
  ]
@@ -255,9 +257,8 @@ const ImageComparisonSettings = [
255
257
  devices: {
256
258
  desktop: {
257
259
  default: {
258
- shape: 'square',
259
- shapeValue: '1/1',
260
- width: '100%',
260
+ shape: 'horizontal',
261
+ width: '600px',
261
262
  height: undefined,
262
263
  shapeLinked: true
263
264
  }
@@ -378,7 +379,7 @@ const ImageComparisonSettings = [
378
379
  border: 'none',
379
380
  borderWidth: '1px',
380
381
  width: '1px 1px 1px 1px',
381
- color: '#121212',
382
+ color: 'line-1',
382
383
  isCustom: true
383
384
  }
384
385
  }
@@ -387,7 +388,7 @@ const ImageComparisonSettings = [
387
388
  desktop: {
388
389
  default: {
389
390
  border: 'solid',
390
- color: '#121212',
391
+ color: 'line-1',
391
392
  width: '1px',
392
393
  borderWidth: '1px'
393
394
  }
@@ -256,64 +256,59 @@ const SettingUIV2 = [
256
256
  },
257
257
  {
258
258
  label: {
259
- en: 'Position'
259
+ en: 'Background'
260
260
  },
261
+ conditionDisplay: `enableLabel === true`,
261
262
  setting: {
262
- id: 'labelPositionHoz'
263
- },
264
- conditionDisplay: `enableLabel === true && direction === 'horizontal'`
263
+ id: 'labelBackgroundColor'
264
+ }
265
265
  },
266
266
  {
267
267
  label: {
268
- en: 'Position'
268
+ en: 'Border'
269
269
  },
270
+ conditionDisplay: `enableLabel === true`,
270
271
  setting: {
271
- id: 'labelPositionVer'
272
+ id: 'labelBorder'
273
+ }
274
+ },
275
+ {
276
+ label: {
277
+ en: 'Corner'
272
278
  },
273
- conditionDisplay: `enableLabel === true && direction === 'vertical'`
279
+ conditionDisplay: `enableLabel === true`,
280
+ setting: {
281
+ id: 'labelRounded'
282
+ }
274
283
  },
275
284
  {
276
285
  label: {
277
- en: 'Background'
286
+ en: 'Shadow'
278
287
  },
279
288
  conditionDisplay: `enableLabel === true`,
280
289
  setting: {
281
- id: 'labelBackgroundColor'
290
+ id: 'labelShadow'
282
291
  }
283
- }
284
- ],
285
- moreSettings: {
286
- type: 'collapse',
287
- controls: [
288
- {
289
- label: {
290
- en: 'Border'
291
- },
292
- conditionDisplay: `enableLabel === true`,
293
- setting: {
294
- id: 'labelBorder'
295
- }
292
+ },
293
+ {
294
+ label: {
295
+ en: 'Position'
296
296
  },
297
- {
298
- label: {
299
- en: 'Corner'
300
- },
301
- conditionDisplay: `enableLabel === true`,
302
- setting: {
303
- id: 'labelRounded'
304
- }
297
+ setting: {
298
+ id: 'labelPositionHoz'
305
299
  },
306
- {
307
- label: {
308
- en: 'Shadow'
309
- },
310
- conditionDisplay: `enableLabel === true`,
311
- setting: {
312
- id: 'labelShadow'
313
- }
314
- }
315
- ]
316
- }
300
+ conditionDisplay: `enableLabel === true && direction === 'horizontal'`
301
+ },
302
+ {
303
+ label: {
304
+ en: 'Position'
305
+ },
306
+ setting: {
307
+ id: 'labelPositionVer'
308
+ },
309
+ conditionDisplay: `enableLabel === true && direction === 'vertical'`
310
+ }
311
+ ]
317
312
  },
318
313
  {
319
314
  label: {
@@ -452,6 +447,9 @@ const SettingUIV2 = [
452
447
  type: 'combo',
453
448
  iconName: 'polaris-text-title',
454
449
  isHideClear: true,
450
+ popoverLabel: {
451
+ en: 'SEO'
452
+ },
455
453
  controls: [
456
454
  {
457
455
  label: {
@@ -478,6 +476,9 @@ const SettingUIV2 = [
478
476
  type: 'combo',
479
477
  iconName: 'polaris-text-title',
480
478
  isHideClear: true,
479
+ popoverLabel: {
480
+ en: 'SEO'
481
+ },
481
482
  controls: [
482
483
  {
483
484
  label: {
@@ -52,13 +52,16 @@ const getSoldOutButtonStyles = (styles)=>{
52
52
  if (oosBackgroundV2) {
53
53
  buttonSoldOutStyles.backgroundColorV2 = {
54
54
  desktop: {
55
- normal: oosBackgroundV2?.desktop?.normal
55
+ normal: oosBackgroundV2?.desktop?.normal,
56
+ hover: buttonSoldOutStyles.backgroundColorV2?.desktop?.hover
56
57
  },
57
58
  tablet: {
58
- normal: oosBackgroundV2?.tablet?.normal
59
+ normal: oosBackgroundV2?.tablet?.normal,
60
+ hover: buttonSoldOutStyles.backgroundColorV2?.tablet?.hover
59
61
  },
60
62
  mobile: {
61
- normal: oosBackgroundV2?.mobile?.normal
63
+ normal: oosBackgroundV2?.mobile?.normal,
64
+ hover: buttonSoldOutStyles.backgroundColorV2?.mobile?.hover
62
65
  }
63
66
  };
64
67
  }
@@ -13,10 +13,10 @@ const PriceLayout = ({ components, separator, showPrice, showSeparator })=>{
13
13
  }), BlankSpace_liquid.default());
14
14
  return core.template`
15
15
  ${separatorComponent}
16
- ${showPrice && components.map((component, index)=>core.template`
16
+ ${showPrice ? components.map((component, index)=>core.template`
17
17
  ${component()}
18
18
  ${index < components.length - 1 ? BlankSpace_liquid.default() : ''}
19
- `).join('')}
19
+ `).join('') : ''}
20
20
  `;
21
21
  };
22
22
 
@@ -46,7 +46,7 @@ const ProductViewMoreSettings = [
46
46
  tooltip: 'Align right'
47
47
  }
48
48
  ],
49
- default: 'left'
49
+ default: 'right'
50
50
  },
51
51
  {
52
52
  id: 'shouldClearSpace',
@@ -405,7 +405,7 @@ const ProductViewMoreSettings = [
405
405
  default: {
406
406
  type: 'paragraph-1',
407
407
  attrs: {
408
- color: 'text-1'
408
+ color: 'text-3'
409
409
  }
410
410
  },
411
411
  hiddenSetting: {
@@ -26,29 +26,14 @@ const SettingUIV2 = [
26
26
  field: 'width'
27
27
  },
28
28
  displayOptions: [
29
- {
30
- label: 'Fit content',
31
- value: 'Auto',
32
- showValue: true
33
- },
34
29
  {
35
30
  label: 'Full',
36
31
  value: '100%',
37
32
  showValue: true
38
33
  },
39
34
  {
40
- label: 'Small',
41
- value: '100px',
42
- showValue: true
43
- },
44
- {
45
- label: 'Medium',
46
- value: '116px',
47
- showValue: true
48
- },
49
- {
50
- label: 'Large',
51
- value: '132px',
35
+ label: 'Fit content',
36
+ value: 'Auto',
52
37
  showValue: true
53
38
  }
54
39
  ]
@@ -78,21 +63,6 @@ const SettingUIV2 = [
78
63
  label: 'Fit content',
79
64
  value: 'Auto',
80
65
  showValue: true
81
- },
82
- {
83
- label: 'Small',
84
- value: '28px',
85
- showValue: true
86
- },
87
- {
88
- label: 'Medium',
89
- value: '36px',
90
- showValue: true
91
- },
92
- {
93
- label: 'Large',
94
- value: '44px',
95
- showValue: true
96
66
  }
97
67
  ]
98
68
  },
@@ -15,7 +15,7 @@ import { getYoutubeVideoId, youtubeVideoRegex } from '../../video/helpers/common
15
15
  const HeroBannerItem = (props)=>{
16
16
  const mode = useEditorMode();
17
17
  const { enableLazyloadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
18
- const { layout, verticalAlign, speedParallax, alt, title } = setting ?? {};
18
+ const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
19
19
  const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
20
20
  const enableLazyImage = (setting?.preload || !enableLazyloadImage) && mode !== 'edit';
21
21
  const isNotLiquid = true;
@@ -51,7 +51,7 @@ const HeroBannerItem = (props)=>{
51
51
  ...getBackgroundClasses(hoverEffect)
52
52
  });
53
53
  const backgroundStyle = createStyle({
54
- ...getBackgroundStyle(styles, Number(speedParallax || 0) > 0 || false, transform),
54
+ ...getBackgroundStyle(styles, enableParallax, transform),
55
55
  ...getGradientBgrStyleByDevice(background, {
56
56
  desktop: true,
57
57
  tablet: true,
@@ -180,7 +180,7 @@ const HeroBannerItem = (props)=>{
180
180
  style: adaptiveStyle,
181
181
  alt: alt,
182
182
  title: title,
183
- enableLazyloadImage: enableLazyloadImage
183
+ enableLazyloadImage: enableLazyloadImage && mode != 'edit'
184
184
  })
185
185
  ]
186
186
  });
@@ -14,7 +14,7 @@ import { isRenderHtmlVideo } from '../../grid/row/commons/common.js';
14
14
 
15
15
  const HeroBannerItem = (props)=>{
16
16
  const { enableLazyloadImage, setting, styles, children, builderProps, rawChildren } = props;
17
- const { layout, verticalAlign, speedParallax, alt, title } = setting ?? {};
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
20
  const enableLazyImage = setting?.preload || !enableLazyloadImage;
@@ -52,7 +52,7 @@ const HeroBannerItem = (props)=>{
52
52
  ...getBackgroundClasses(hoverEffect)
53
53
  });
54
54
  const backgroundStyle = createStyle({
55
- ...getBackgroundStyle(styles, Number(speedParallax || 0) > 0, transform),
55
+ ...getBackgroundStyle(styles, enableParallax, transform),
56
56
  ...getBackgroundImageHeroBanner(background, enableLazyImage, isNotLiquid)
57
57
  });
58
58
  const containBackgroundClasses = createClass({
@@ -1,4 +1,4 @@
1
- import { makeStyleResponsive, getStyleShadowState, composeRadius, makeGlobalSize, makeStyleResponsiveState, composeTypographyStyle, getStyleShadow, getStyleBackgroundImageByDevice, getGlobalColorStateResponsiveStyle, getSingleColorVariable, composeBorderCss, composeCornerCss } from '@gem-sdk/core';
1
+ import { makeStyleResponsive, getStyleShadowState, composeRadius, makeGlobalSize, composeTypographyStyle, makeStyleResponsiveState, getStyleShadow, getStyleBackgroundImageByDevice, getGlobalColorStateResponsiveStyle, getSingleColorVariable, composeBorderCss, composeCornerCss } from '@gem-sdk/core';
2
2
 
3
3
  const MEDIA_QUERIES = {
4
4
  TABLET: '@media only screen and (max-width: 1024px) and (min-width: 768px)',
@@ -12,7 +12,8 @@ const getButtonStyles = (styles)=>({
12
12
  ...getSizeStyles(styles),
13
13
  ...getRadiusStyles(styles),
14
14
  ...getShadowStyles(styles),
15
- ...getBackgroundStyles(styles)
15
+ ...getBackgroundStyles(styles),
16
+ ...getTypographyStyles(styles).textColorStyle
16
17
  });
17
18
  const getButtonIconStyles = (styles, settings)=>{
18
19
  return {
@@ -49,10 +50,26 @@ const getSizeStyles = (styles)=>{
49
50
  ...composeGlobalSize.padding
50
51
  };
51
52
  };
53
+ const getTypographyStyles = (styles)=>{
54
+ const typographyStyle = composeTypographyStyle(styles?.typo, styles?.typography);
55
+ const colorObj = {
56
+ '--c': typographyStyle?.['--c']
57
+ };
58
+ const otherProps = {
59
+ ...typographyStyle
60
+ };
61
+ delete otherProps['--c'];
62
+ return {
63
+ textColorStyle: {
64
+ ...colorObj,
65
+ ...makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover))
66
+ },
67
+ withoutTextColorStyles: otherProps
68
+ };
69
+ };
52
70
  const getTypoStyles = (styles)=>{
53
71
  return {
54
- ...makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover)),
55
- ...composeTypographyStyle(styles?.typo, styles?.typography),
72
+ ...getTypographyStyles(styles).withoutTextColorStyles,
56
73
  ...getStyleShadow({
57
74
  styleAppliedFor: 'text-shadow',
58
75
  value: styles?.typo?.custom?.textShadow,
@@ -28,6 +28,7 @@ const NextImage = (props)=>{
28
28
  return template`
29
29
  <img
30
30
  ${nextImageAttrs}
31
+ id="${props?.id}"
31
32
  style="${nextImageStyles}"
32
33
  class="${nextImageClasses}"
33
34
  />`;
@@ -96,7 +96,7 @@ const ImageSettings = [
96
96
  minHeight: 56,
97
97
  autoHeight: true,
98
98
  placeholder: 'E.g: Classic white crewneck t-shirt with minimalist design',
99
- default: 'Describes the appearance of the image'
99
+ default: undefined
100
100
  },
101
101
  {
102
102
  id: 'title',
@@ -106,7 +106,7 @@ const ImageSettings = [
106
106
  minHeight: 56,
107
107
  autoHeight: true,
108
108
  placeholder: 'E.g: White t-shirt',
109
- default: 'Title'
109
+ default: undefined
110
110
  }
111
111
  ]
112
112
  },
@@ -351,6 +351,7 @@ const SettingUIV2 = [
351
351
  },
352
352
  iconName: 'polaris-text-block',
353
353
  getValueFromSettingID: 'alt',
354
+ compoDefaultValue: 'Describes the appearance of the image',
354
355
  isHideClear: true,
355
356
  controls: [
356
357
  {
@@ -372,6 +373,7 @@ const SettingUIV2 = [
372
373
  iconName: 'polaris-text-block',
373
374
  getValueFromSettingID: 'title',
374
375
  isHideClear: true,
376
+ compoDefaultValue: 'Title',
375
377
  controls: [
376
378
  {
377
379
  label: {
@@ -129,7 +129,8 @@ const generateTranslateByDevices = ({ isHorizontal, labelPositionHoz, labelPosit
129
129
  return translateByDevices;
130
130
  };
131
131
  const getSliderPositionPercentage = (defaultPercentage)=>{
132
- return (defaultPercentage ?? 50) / 100;
132
+ const percentage = typeof defaultPercentage === 'string' ? parseInt(defaultPercentage ?? 0) : defaultPercentage;
133
+ return (percentage ?? 50) / 100;
133
134
  };
134
135
 
135
136
  export { composeAspectRatio, composeLabelPosition, composeResponsiveAspectRatio, generateTranslateByDevices, getAspectRatioData, getLabelPosition, getSliderPositionPercentage };
@@ -17,9 +17,11 @@ const useCompareImage = ({ props, aspectRatio })=>{
17
17
  const leftImageRef = useRef(null);
18
18
  const { onListener, saveToElementInteractionData } = useInteraction();
19
19
  const ref = useRef(null);
20
- const memoAspectRatio = useMemo(()=>aspectRatio || styles?.aspectRatio, [
21
- aspectRatio,
22
- styles?.aspectRatio
20
+ const memoAspectRatio = useMemo(()=>aspectRatio, [
21
+ leftImage,
22
+ rightImage,
23
+ styles?.aspectRatio,
24
+ styles?.customAspectRadio
23
25
  ]);
24
26
  useEffect(()=>{
25
27
  const selector = `[data-id="${props?.componentUid}"]`;
@@ -32,7 +32,8 @@ const ImageComparisonSettings = [
32
32
  height: 600
33
33
  },
34
34
  hiddenSetting: {
35
- seo: true
35
+ seo: true,
36
+ optimizeLCP: true
36
37
  }
37
38
  }
38
39
  ]
@@ -51,7 +52,8 @@ const ImageComparisonSettings = [
51
52
  height: 600
52
53
  },
53
54
  hiddenSetting: {
54
- seo: true
55
+ seo: true,
56
+ optimizeLCP: true
55
57
  }
56
58
  }
57
59
  ]
@@ -253,9 +255,8 @@ const ImageComparisonSettings = [
253
255
  devices: {
254
256
  desktop: {
255
257
  default: {
256
- shape: 'square',
257
- shapeValue: '1/1',
258
- width: '100%',
258
+ shape: 'horizontal',
259
+ width: '600px',
259
260
  height: undefined,
260
261
  shapeLinked: true
261
262
  }
@@ -376,7 +377,7 @@ const ImageComparisonSettings = [
376
377
  border: 'none',
377
378
  borderWidth: '1px',
378
379
  width: '1px 1px 1px 1px',
379
- color: '#121212',
380
+ color: 'line-1',
380
381
  isCustom: true
381
382
  }
382
383
  }
@@ -385,7 +386,7 @@ const ImageComparisonSettings = [
385
386
  desktop: {
386
387
  default: {
387
388
  border: 'solid',
388
- color: '#121212',
389
+ color: 'line-1',
389
390
  width: '1px',
390
391
  borderWidth: '1px'
391
392
  }
@@ -254,64 +254,59 @@ const SettingUIV2 = [
254
254
  },
255
255
  {
256
256
  label: {
257
- en: 'Position'
257
+ en: 'Background'
258
258
  },
259
+ conditionDisplay: `enableLabel === true`,
259
260
  setting: {
260
- id: 'labelPositionHoz'
261
- },
262
- conditionDisplay: `enableLabel === true && direction === 'horizontal'`
261
+ id: 'labelBackgroundColor'
262
+ }
263
263
  },
264
264
  {
265
265
  label: {
266
- en: 'Position'
266
+ en: 'Border'
267
267
  },
268
+ conditionDisplay: `enableLabel === true`,
268
269
  setting: {
269
- id: 'labelPositionVer'
270
+ id: 'labelBorder'
271
+ }
272
+ },
273
+ {
274
+ label: {
275
+ en: 'Corner'
270
276
  },
271
- conditionDisplay: `enableLabel === true && direction === 'vertical'`
277
+ conditionDisplay: `enableLabel === true`,
278
+ setting: {
279
+ id: 'labelRounded'
280
+ }
272
281
  },
273
282
  {
274
283
  label: {
275
- en: 'Background'
284
+ en: 'Shadow'
276
285
  },
277
286
  conditionDisplay: `enableLabel === true`,
278
287
  setting: {
279
- id: 'labelBackgroundColor'
288
+ id: 'labelShadow'
280
289
  }
281
- }
282
- ],
283
- moreSettings: {
284
- type: 'collapse',
285
- controls: [
286
- {
287
- label: {
288
- en: 'Border'
289
- },
290
- conditionDisplay: `enableLabel === true`,
291
- setting: {
292
- id: 'labelBorder'
293
- }
290
+ },
291
+ {
292
+ label: {
293
+ en: 'Position'
294
294
  },
295
- {
296
- label: {
297
- en: 'Corner'
298
- },
299
- conditionDisplay: `enableLabel === true`,
300
- setting: {
301
- id: 'labelRounded'
302
- }
295
+ setting: {
296
+ id: 'labelPositionHoz'
303
297
  },
304
- {
305
- label: {
306
- en: 'Shadow'
307
- },
308
- conditionDisplay: `enableLabel === true`,
309
- setting: {
310
- id: 'labelShadow'
311
- }
312
- }
313
- ]
314
- }
298
+ conditionDisplay: `enableLabel === true && direction === 'horizontal'`
299
+ },
300
+ {
301
+ label: {
302
+ en: 'Position'
303
+ },
304
+ setting: {
305
+ id: 'labelPositionVer'
306
+ },
307
+ conditionDisplay: `enableLabel === true && direction === 'vertical'`
308
+ }
309
+ ]
315
310
  },
316
311
  {
317
312
  label: {
@@ -450,6 +445,9 @@ const SettingUIV2 = [
450
445
  type: 'combo',
451
446
  iconName: 'polaris-text-title',
452
447
  isHideClear: true,
448
+ popoverLabel: {
449
+ en: 'SEO'
450
+ },
453
451
  controls: [
454
452
  {
455
453
  label: {
@@ -476,6 +474,9 @@ const SettingUIV2 = [
476
474
  type: 'combo',
477
475
  iconName: 'polaris-text-title',
478
476
  isHideClear: true,
477
+ popoverLabel: {
478
+ en: 'SEO'
479
+ },
479
480
  controls: [
480
481
  {
481
482
  label: {
@@ -50,13 +50,16 @@ const getSoldOutButtonStyles = (styles)=>{
50
50
  if (oosBackgroundV2) {
51
51
  buttonSoldOutStyles.backgroundColorV2 = {
52
52
  desktop: {
53
- normal: oosBackgroundV2?.desktop?.normal
53
+ normal: oosBackgroundV2?.desktop?.normal,
54
+ hover: buttonSoldOutStyles.backgroundColorV2?.desktop?.hover
54
55
  },
55
56
  tablet: {
56
- normal: oosBackgroundV2?.tablet?.normal
57
+ normal: oosBackgroundV2?.tablet?.normal,
58
+ hover: buttonSoldOutStyles.backgroundColorV2?.tablet?.hover
57
59
  },
58
60
  mobile: {
59
- normal: oosBackgroundV2?.mobile?.normal
61
+ normal: oosBackgroundV2?.mobile?.normal,
62
+ hover: buttonSoldOutStyles.backgroundColorV2?.mobile?.hover
60
63
  }
61
64
  };
62
65
  }
@@ -9,10 +9,10 @@ const PriceLayout = ({ components, separator, showPrice, showSeparator })=>{
9
9
  }), BlankSpace());
10
10
  return template`
11
11
  ${separatorComponent}
12
- ${showPrice && components.map((component, index)=>template`
12
+ ${showPrice ? components.map((component, index)=>template`
13
13
  ${component()}
14
14
  ${index < components.length - 1 ? BlankSpace() : ''}
15
- `).join('')}
15
+ `).join('') : ''}
16
16
  `;
17
17
  };
18
18
 
@@ -44,7 +44,7 @@ const ProductViewMoreSettings = [
44
44
  tooltip: 'Align right'
45
45
  }
46
46
  ],
47
- default: 'left'
47
+ default: 'right'
48
48
  },
49
49
  {
50
50
  id: 'shouldClearSpace',
@@ -403,7 +403,7 @@ const ProductViewMoreSettings = [
403
403
  default: {
404
404
  type: 'paragraph-1',
405
405
  attrs: {
406
- color: 'text-1'
406
+ color: 'text-3'
407
407
  }
408
408
  },
409
409
  hiddenSetting: {
@@ -24,29 +24,14 @@ const SettingUIV2 = [
24
24
  field: 'width'
25
25
  },
26
26
  displayOptions: [
27
- {
28
- label: 'Fit content',
29
- value: 'Auto',
30
- showValue: true
31
- },
32
27
  {
33
28
  label: 'Full',
34
29
  value: '100%',
35
30
  showValue: true
36
31
  },
37
32
  {
38
- label: 'Small',
39
- value: '100px',
40
- showValue: true
41
- },
42
- {
43
- label: 'Medium',
44
- value: '116px',
45
- showValue: true
46
- },
47
- {
48
- label: 'Large',
49
- value: '132px',
33
+ label: 'Fit content',
34
+ value: 'Auto',
50
35
  showValue: true
51
36
  }
52
37
  ]
@@ -76,21 +61,6 @@ const SettingUIV2 = [
76
61
  label: 'Fit content',
77
62
  value: 'Auto',
78
63
  showValue: true
79
- },
80
- {
81
- label: 'Small',
82
- value: '28px',
83
- showValue: true
84
- },
85
- {
86
- label: 'Medium',
87
- value: '36px',
88
- showValue: true
89
- },
90
- {
91
- label: 'Large',
92
- value: '44px',
93
- showValue: true
94
64
  }
95
65
  ]
96
66
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.596",
3
+ "version": "2.0.0-dev.598",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",