@gem-sdk/components 2.2.0-staging.38 → 2.3.0

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 (80) hide show
  1. package/dist/cjs/article/components/ArticleImage.js +1 -2
  2. package/dist/cjs/banner/components/hero-banner/index.liquid.js +7 -4
  3. package/dist/cjs/builder.js +1 -1
  4. package/dist/cjs/button/components/Button.js +3 -3
  5. package/dist/cjs/button/components/Button.liquid.js +5 -5
  6. package/dist/cjs/carousel/components/Carousel.liquid.js +2 -3
  7. package/dist/cjs/carousel/components/plugins/AutoPlayPlugin.js +58 -17
  8. package/dist/cjs/common/const.js +1 -1
  9. package/dist/cjs/grid/setting/Section.js +7 -37
  10. package/dist/cjs/image/components/AdaptiveImage.liquid.js +5 -6
  11. package/dist/cjs/image/components/Image.js +1 -2
  12. package/dist/cjs/image/components/Image.liquid.js +4 -6
  13. package/dist/cjs/image/components/NextImage.liquid.js +3 -4
  14. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +3 -7
  15. package/dist/cjs/index.js +2 -2
  16. package/dist/cjs/index.liquid.js +2 -2
  17. package/dist/cjs/marquee/components/Marquee.liquid.js +13 -10
  18. package/dist/cjs/post-purchase/product/components/variants/Dropdown.js +1 -1
  19. package/dist/cjs/product/components/ProductButton.js +1 -1
  20. package/dist/cjs/product/components/ProductButton.liquid.js +3 -21
  21. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
  22. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +3 -3
  23. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  24. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  25. package/dist/cjs/product/components/ProductVariants/variants/combine/index.js +1 -1
  26. package/dist/cjs/product/setting/ProductList.js +1 -1
  27. package/dist/cjs/tab/hooks/useTabInteraction.js +9 -13
  28. package/dist/cjs/third-party/components/Bogos/BogosSampleContent.js +10 -9
  29. package/dist/cjs/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  30. package/dist/cjs/third-party/components/Releasit.liquid.js +2 -4
  31. package/dist/cjs/third-party/configs/BoldProductOptions.js +2 -2
  32. package/dist/cjs/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  33. package/dist/cjs/third-party/next.js +3 -3
  34. package/dist/cjs/third-party/setting/EcoboostifyShoppableReelUgc.js +2 -2
  35. package/dist/cjs/third-party/setting/Releasit.js +2 -59
  36. package/dist/cjs/third-party/setting/index.js +3 -3
  37. package/dist/cjs/video/components/HTML5Embed.js +2 -2
  38. package/dist/cjs/video/components/HTML5Embed.liquid.js +3 -6
  39. package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  40. package/dist/esm/article/components/ArticleImage.js +1 -2
  41. package/dist/esm/banner/components/hero-banner/index.liquid.js +7 -4
  42. package/dist/esm/builder.js +1 -1
  43. package/dist/esm/button/components/Button.js +3 -3
  44. package/dist/esm/button/components/Button.liquid.js +5 -5
  45. package/dist/esm/carousel/components/Carousel.liquid.js +2 -3
  46. package/dist/esm/carousel/components/plugins/AutoPlayPlugin.js +58 -17
  47. package/dist/esm/common/const.js +1 -1
  48. package/dist/esm/grid/setting/Section.js +7 -37
  49. package/dist/esm/image/components/AdaptiveImage.liquid.js +5 -6
  50. package/dist/esm/image/components/Image.js +2 -3
  51. package/dist/esm/image/components/Image.liquid.js +4 -6
  52. package/dist/esm/image/components/NextImage.liquid.js +3 -4
  53. package/dist/esm/image-comparison/components/CompareImage.liquid.js +3 -7
  54. package/dist/esm/index.js +1 -1
  55. package/dist/esm/index.liquid.js +1 -1
  56. package/dist/esm/marquee/components/Marquee.liquid.js +13 -10
  57. package/dist/esm/post-purchase/product/components/variants/Dropdown.js +1 -1
  58. package/dist/esm/product/components/ProductButton.js +1 -1
  59. package/dist/esm/product/components/ProductButton.liquid.js +3 -21
  60. package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
  61. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +3 -3
  62. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  63. package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  64. package/dist/esm/product/components/ProductVariants/variants/combine/index.js +1 -1
  65. package/dist/esm/product/setting/ProductList.js +1 -1
  66. package/dist/esm/tab/hooks/useTabInteraction.js +10 -14
  67. package/dist/esm/third-party/components/Bogos/BogosSampleContent.js +11 -10
  68. package/dist/esm/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  69. package/dist/esm/third-party/components/Releasit.liquid.js +2 -4
  70. package/dist/esm/third-party/configs/BoldProductOptions.js +2 -2
  71. package/dist/esm/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  72. package/dist/esm/third-party/next.js +3 -3
  73. package/dist/esm/third-party/setting/EcoboostifyShoppableReelUgc.js +2 -2
  74. package/dist/esm/third-party/setting/Releasit.js +2 -59
  75. package/dist/esm/third-party/setting/index.js +4 -4
  76. package/dist/esm/video/components/HTML5Embed.js +2 -2
  77. package/dist/esm/video/components/HTML5Embed.liquid.js +3 -6
  78. package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  79. package/dist/types/index.d.ts +16 -30
  80. package/package.json +3 -3
@@ -120,8 +120,8 @@ import BfSizeChartSizeGuide from './third-party/components/BfSizeChartSizeGuide.
120
120
  import AlsoBoughtCbb from './third-party/components/AlsoBoughtCbb.js';
121
121
  import HextomFreeShippingBar from './third-party/components/HextomFreeShippingBar.js';
122
122
  import EcoboostifyShoppableReelUgc from './third-party/components/EcoboostifyShoppableReelUgc.js';
123
- import EcomsendBackInStockAlert from './third-party/components/EcomsendBackInStockAlert.js';
124
123
  import AppstleBundlesDiscounts from './third-party/components/AppstleBundlesDiscounts.js';
124
+ import EcomsendBackInStockAlert from './third-party/components/EcomsendBackInStockAlert.js';
125
125
  import CartLineVariant from './cart/components/CartLineVariant.js';
126
126
  import Cart from './cart/components/Cart.js';
127
127
  import CartList from './cart/components/CartList.js';
@@ -125,7 +125,7 @@ const Button = ({ className, onClick, builderProps, builderAttrs, setting = {},
125
125
  disabled: disabled,
126
126
  children: [
127
127
  loading ? /*#__PURE__*/ jsxs("svg", {
128
- className: "gp-invisible gp-h-5 gp-w-5 gp-animate-spin group-data-[state=loading]/button:gp-visible gp-absolute",
128
+ className: "gp-invisible gp-h-5 gp-w-5 gp-animate-spin group-data-[state=loading]:gp-visible gp-absolute",
129
129
  xmlns: "http://www.w3.org/2000/svg",
130
130
  fill: "none",
131
131
  viewBox: "0 0 24 24",
@@ -152,7 +152,7 @@ const Button = ({ className, onClick, builderProps, builderAttrs, setting = {},
152
152
  children: [
153
153
  !!iconSvg && iconVisible && /*#__PURE__*/ jsx("span", {
154
154
  className: `
155
- gp-button-icon gp-transition-colors gp-duration-300 gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]/button:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)] ${shouldClearSpace && !label ? '!gp-m-0' : ''}`,
155
+ gp-button-icon gp-transition-colors gp-duration-300 gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)] ${shouldClearSpace && !label ? '!gp-m-0' : ''}`,
156
156
  style: {
157
157
  ...iconSpacingStyle,
158
158
  '--height-desktop': `${size?.desktop}`,
@@ -165,7 +165,7 @@ const Button = ({ className, onClick, builderProps, builderAttrs, setting = {},
165
165
  }),
166
166
  (!!label || !shouldClearSpace) && /*#__PURE__*/ jsx("div", {
167
167
  "data-gp-text": true,
168
- className: cls(`gp-relative group-hover/button:!gp-text-inherit gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]/button:gp-invisible [&_p]:gp-whitespace-pre-line`, styles?.typo?.attrs?.italic ? '[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]' : '', mode === 'edit' && !options?.isCannotEditing ? 'gp-text button-text' : '', nodePrice ? appendTypoClass : {}),
168
+ className: cls(`gp-relative group-hover/button:!gp-text-inherit gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line`, styles?.typo?.attrs?.italic ? '[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]' : '', mode === 'edit' && !options?.isCannotEditing ? 'gp-text button-text' : '', nodePrice ? appendTypoClass : {}),
169
169
  style: {
170
170
  ...makeStyle({
171
171
  tt: styles?.transform
@@ -1,7 +1,7 @@
1
1
  import { splitStyle, makeStyleResponsive, makeGlobalSize, composeTypographyClassName, composeTypographyStyle, composeBorderCss, composeCornerCss, getSingleColorVariable, template, cls, getGlobalColorStateClass, getGlobalColorStateStyle, composeRadius, getStyleShadowState, composeSize, getGradientBgrStyleForButton, RenderIf } from '@gem-sdk/core';
2
2
  import { getInsertLinkData, getDynamicSourceLocales } from '../../helpers.js';
3
3
 
4
- const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId, isForceValue = false })=>{
4
+ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId })=>{
5
5
  const { align, size, backgroundColor, textColor, roundedBtn, iconSpacing, globalSize } = styles;
6
6
  const { label, iconSvg, btnLink, htmlType, disabled, loading, iconAlign, iconVisible, translate, disabledLoading = true } = setting;
7
7
  const [wrapStyle, restStyle] = splitStyle([
@@ -66,7 +66,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
66
66
  color: ${getSingleColorVariable(styles?.textColor?.hover)};
67
67
  }
68
68
  `;
69
- const labelValDisplay = isForceValue ? label : getDynamicSourceLocales({
69
+ const labelValDisplay = getDynamicSourceLocales({
70
70
  val: label,
71
71
  uid: builderProps?.uidTranslate ?? builderProps?.uid,
72
72
  settingId: translate ?? 'label',
@@ -123,7 +123,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
123
123
  }}"
124
124
  >
125
125
  ${!disabledLoading ? ` <svg
126
- class="gp-invisible gp-absolute gp-h-5 gp-w-5 group-data-[state=loading]/button:gp-animate-spin group-data-[state=loading]/button:gp-visible"
126
+ class="gp-invisible gp-absolute gp-h-5 gp-w-5 group-data-[state=loading]:gp-animate-spin group-data-[state=loading]:gp-visible"
127
127
  xmlns="http://www.w3.org/2000/svg"
128
128
  fill="none"
129
129
  viewBox="0 0 24 24"
@@ -147,7 +147,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
147
147
  'gp-flex-row-reverse': iconAlign === 'right'
148
148
  })}">
149
149
  ${RenderIf(!!iconSvg && iconVisible, template`<span
150
- class="${`gp-inline-flex gp-button-icon gp-transition-colors gp-duration-300 gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]/button:gp-invisible gp-z-1 [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)]`}"
150
+ class="${`gp-inline-flex gp-button-icon gp-transition-colors gp-duration-300 gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible gp-z-1 [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)]`}"
151
151
  style="${{
152
152
  ...label ? iconSpacingStyle : {},
153
153
  '--height-desktop': `${size?.desktop}`,
@@ -157,7 +157,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
157
157
  >${iconSvg}</span>`)}
158
158
  <span
159
159
  data-gp-text
160
- class="${`gp-content-product-button group-hover/button:!gp-text-inherit gp-button-text-only gp-break-words group-data-[state=loading]/button:gp-invisible [&_p]:gp-whitespace-pre-line gp-z-1 gp-h-full gp-flex gp-items-center gp-overflow-hidden ${nodePrice ? appendTypoClass : ''}
160
+ class="${`group-hover/button:!gp-text-inherit gp-button-text-only gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line gp-z-1 gp-h-full gp-flex gp-items-center gp-overflow-hidden ${nodePrice ? appendTypoClass : ''}
161
161
  ${styles?.typo?.attrs?.italic ? '[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]' : ''}`}"
162
162
  style="${{
163
163
  ...nodePrice && appendTypoStyle,
@@ -9,7 +9,7 @@ const DEVICES = [
9
9
  'tablet',
10
10
  'desktop'
11
11
  ];
12
- const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ftShapeProductImage, ...props })=>{
12
+ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ...props })=>{
13
13
  const setting = mappingNavigationCarousel(props.setting);
14
14
  const styleHeight = makeStyleResponsive('h', getHeightByShapeGlobalSize(styles?.sizeSetting));
15
15
  const styleWidth = makeStyleWithDefault('w', getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
@@ -108,8 +108,7 @@ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId
108
108
  setting,
109
109
  styles,
110
110
  moveToIdx,
111
- isHiddenArrowWhenDisabled,
112
- ftShapeProductImage
111
+ isHiddenArrowWhenDisabled
113
112
  }).replaceAll("'", '&#039;')}' style="${{
114
113
  ...makeStyleResponsive('jc', styles?.align),
115
114
  ...rootStyles
@@ -2,15 +2,41 @@ const AutoPlayPlugin = (slider)=>{
2
2
  let autoplay = slider.options.autoplay ?? {};
3
3
  let timeout;
4
4
  let mouseOver = false;
5
+ let inViewport = false;
6
+ let observer = null;
7
+ // Thêm sự kiện cho dot nếu có
8
+ const $dots = slider?.container?.closest('[data-component-type="component"]')?.querySelector('.carousel-dots');
9
+ // Callback của IntersectionObserver
10
+ function handleIntersection(entries) {
11
+ entries.forEach((entry)=>{
12
+ // Với threshold 0, chỉ cần một phần bất kỳ hiển thị sẽ đánh dấu isIntersecting
13
+ inViewport = entry.isIntersecting;
14
+ if (inViewport) {
15
+ nextTimeout();
16
+ } else {
17
+ clearNextTimeout();
18
+ }
19
+ });
20
+ }
21
+ function initIntersectionObserver() {
22
+ // Nếu đã có observer hoặc không có container thì không khởi tạo lại
23
+ if (observer || !slider.container) return;
24
+ observer = new IntersectionObserver(handleIntersection, {
25
+ root: null,
26
+ threshold: 0
27
+ });
28
+ observer.observe(slider.container);
29
+ }
5
30
  function clearNextTimeout() {
6
31
  clearTimeout(timeout);
7
32
  }
8
33
  function nextTimeout() {
9
- clearTimeout(timeout);
34
+ clearNextTimeout();
10
35
  timeout = setTimeout(()=>{
11
- if (mouseOver || !autoplay.enable) return;
36
+ // Nếu đang hover, autoplay bị tắt hoặc slider không trong viewport thì không chuyển slide
37
+ if (mouseOver || !autoplay.enable || !inViewport) return;
12
38
  slider.next();
13
- }, autoplay?.delay ?? 2000);
39
+ }, autoplay.delay ?? 2000);
14
40
  }
15
41
  function onMouseOver() {
16
42
  mouseOver = true;
@@ -21,11 +47,15 @@ const AutoPlayPlugin = (slider)=>{
21
47
  nextTimeout();
22
48
  }
23
49
  slider.on('created', ()=>{
24
- if (autoplay.pauseOnHover) {
50
+ $dots?.addEventListener('mouseover', onMouseOver);
51
+ $dots?.addEventListener('mouseout', onMouseOut);
52
+ // Nếu tùy chọn pauseOnHover bật thì thêm sự kiện hover cho container slider
53
+ if (autoplay.pauseOnHover && slider.container) {
25
54
  slider.container.addEventListener('mouseover', onMouseOver);
26
55
  slider.container.addEventListener('mouseout', onMouseOut);
27
56
  }
28
- if (slider.options.autoplay?.enable) {
57
+ if (autoplay.enable) {
58
+ initIntersectionObserver();
29
59
  nextTimeout();
30
60
  }
31
61
  });
@@ -33,29 +63,40 @@ const AutoPlayPlugin = (slider)=>{
33
63
  slider.on('animationEnded', nextTimeout);
34
64
  slider.on('updated', (newOptions)=>{
35
65
  autoplay = newOptions.options?.autoplay ?? {};
36
- nextTimeout();
37
- });
38
- slider.on('destroyed', ()=>{
39
- slider.container.removeEventListener('mouseover', onMouseOver);
40
- slider.container.removeEventListener('mouseout', onMouseOut);
66
+ if (autoplay.enable) {
67
+ initIntersectionObserver();
68
+ nextTimeout();
69
+ }
41
70
  });
42
71
  slider.on('optionsChanged', (newOptions)=>{
43
- const $dots = slider?.container?.closest('[data-component-type="component"]')?.querySelector('.carousel-dots');
44
- $dots?.addEventListener('mouseover', onMouseOver);
45
- $dots?.addEventListener('mouseout', onMouseOut);
46
- if (newOptions.options.autoplay?.pauseOnHover !== autoplay.pauseOnHover) {
72
+ if (newOptions.options.autoplay?.pauseOnHover !== autoplay.pauseOnHover && slider.container) {
47
73
  if (newOptions.options.autoplay?.pauseOnHover) {
48
74
  slider.container.addEventListener('mouseover', onMouseOver);
49
75
  slider.container.addEventListener('mouseout', onMouseOut);
50
- }
51
- if (!newOptions.options.autoplay?.pauseOnHover) {
76
+ } else {
52
77
  slider.container.removeEventListener('mouseover', onMouseOver);
53
78
  slider.container.removeEventListener('mouseout', onMouseOut);
54
79
  mouseOver = false;
55
80
  }
56
81
  }
57
- nextTimeout();
58
82
  autoplay = newOptions.options.autoplay ?? {};
83
+ if (autoplay.enable) {
84
+ initIntersectionObserver();
85
+ nextTimeout();
86
+ }
87
+ });
88
+ slider.on('destroyed', ()=>{
89
+ if (slider.container) {
90
+ slider.container.removeEventListener('mouseover', onMouseOver);
91
+ slider.container.removeEventListener('mouseout', onMouseOut);
92
+ }
93
+ $dots?.removeEventListener('mouseover', onMouseOver);
94
+ $dots?.removeEventListener('mouseout', onMouseOut);
95
+ clearNextTimeout();
96
+ if (observer) {
97
+ observer.disconnect();
98
+ observer = null;
99
+ }
59
100
  });
60
101
  };
61
102
 
@@ -1,5 +1,5 @@
1
1
  const ELEMENT_Z_INDEX = {
2
- STICKY: 1000,
2
+ STICKY: 100000,
3
3
  DIALOG: 100001,
4
4
  CART_DRAWER: 100002,
5
5
  CART_DRAWER_CONFIRM_MODAL: 100003
@@ -256,21 +256,6 @@ const config = {
256
256
  }
257
257
  }
258
258
  },
259
- {
260
- id: 'columnGap',
261
- type: 'range',
262
- min: 0,
263
- max: 100,
264
- step: 1,
265
- units: [
266
- '%'
267
- ],
268
- devices: {
269
- desktop: {
270
- default: '0%'
271
- }
272
- }
273
- },
274
259
  {
275
260
  id: 'background',
276
261
  type: 'background',
@@ -307,29 +292,14 @@ const config = {
307
292
  ],
308
293
  ui: [
309
294
  {
310
- type: 'group',
295
+ type: 'control',
311
296
  label: {
312
297
  en: 'Layout'
313
298
  },
314
- controls: [
315
- {
316
- type: 'control',
317
- setting: {
318
- id: 'layout'
319
- },
320
- layout: 'vertical'
321
- },
322
- {
323
- type: 'control',
324
- label: {
325
- en: 'Column gap'
326
- },
327
- setting: {
328
- id: 'columnGap'
329
- },
330
- condition: `!!layout.cols && layout.cols.length > 1 && pageType == "POST_PURCHASE"`
331
- }
332
- ]
299
+ setting: {
300
+ id: 'layout'
301
+ },
302
+ layout: 'vertical'
333
303
  },
334
304
  {
335
305
  type: 'group',
@@ -366,7 +336,7 @@ const config = {
366
336
  setting: {
367
337
  id: 'verticalGutter'
368
338
  },
369
- condition: `!!layout.cols && layout.cols.length > 1 && pageType != "POST_PURCHASE"`
339
+ condition: `!!layout.cols && layout.cols.length > 1`
370
340
  }
371
341
  ]
372
342
  },
@@ -375,7 +345,7 @@ const config = {
375
345
  label: {
376
346
  en: 'Align'
377
347
  },
378
- condition: `(layout.display !== 'fill' || (layout.display === 'fill' && !!layout.cols && layout.cols.length > 1)) && pageType != "POST_PURCHASE"`,
348
+ condition: `layout.display !== 'fill' || (layout.display === 'fill' && !!layout.cols && layout.cols.length > 1)`,
379
349
  controls: [
380
350
  {
381
351
  type: 'control',
@@ -2,7 +2,7 @@ import { template, cls, RenderIf, makeStyleResponsive } from '@gem-sdk/core';
2
2
  import { getImageSrc } from '../helpers/getSrcSet.js';
3
3
  import { createBlurDataURL } from './helpers.js';
4
4
 
5
- const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyLoadImage = true, pageContext, ...props })=>{
5
+ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyloadImage = true, ...props })=>{
6
6
  const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
7
7
  const srcDesktop = getImageSrc(srcSet?.desktop, 'desktop') || fallBackImage;
8
8
  const srcTablet = (getImageSrc(srcSet?.tablet, 'tablet') ?? getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
@@ -27,17 +27,16 @@ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className,
27
27
  }}"
28
28
  />
29
29
  `, template`
30
- ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['mobile'] ?? createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
31
- ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['tablet'] ?? createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
30
+ ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyloadImage ? imagePlaceholder?.['mobile'] ?? createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
31
+ ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyloadImage ? imagePlaceholder?.['tablet'] ?? createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
32
32
  <img
33
33
  ${{
34
34
  ...props
35
35
  }}
36
36
  class="${cls(className, {
37
- gp_lazyload: enableLazyLoadImage,
38
- gp_force_load: pageContext?.isOptimizePlan
37
+ gp_lazyload: enableLazyloadImage
39
38
  })}"
40
- src="${enableLazyLoadImage ? imagePlaceholder?.['desktop'] ?? createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
39
+ src="${enableLazyloadImage ? imagePlaceholder?.['desktop'] ?? createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
41
40
  data-src="${srcDesktop}"
42
41
  width="100%"
43
42
  alt="${alt}"
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useCurrentDevice, makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
2
+ import { makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
3
3
  import Link from '../../link/components/Link.js';
4
4
  import AdaptiveImage from './AdaptiveImage.js';
5
5
  import NextImage from './NextImage.js';
@@ -8,7 +8,6 @@ import { composeAspectRatio } from './helpers.js';
8
8
  const Image = ({ styles, className, setting, builderAttrs, builderProps, style, children, onClick, onLoad })=>{
9
9
  const { image, imageLink, srcSet, isNotLazyload } = setting ?? {};
10
10
  const { customAspectRadio } = styles ?? {};
11
- useCurrentDevice();
12
11
  const { shape } = styles ?? {};
13
12
  const WrapLink = imageLink?.link ? Link : 'div';
14
13
  const opacity = {
@@ -83,7 +82,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
83
82
  setting?.isAdaptive ? /*#__PURE__*/ jsx(AdaptiveImage, {
84
83
  srcSet: setting.srcSet,
85
84
  pictureClass: "gp-contents",
86
- className: cls(className, 'gp-inline-block gp-w-full gp-max-w-full', handleConvertClassColor(styles?.borderImg)),
85
+ className: cls(className, 'gp-w-full gp-max-w-full', handleConvertClassColor(styles?.borderImg)),
87
86
  alt: setting.alt,
88
87
  style: {
89
88
  ...imageWidth,
@@ -3,7 +3,7 @@ import AdaptiveImage from './AdaptiveImage.liquid.js';
3
3
  import NextImage from './NextImage.liquid.js';
4
4
  import { getInsertLinkData } from '../../helpers.js';
5
5
 
6
- const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyLoadImage = true, pageContext })=>{
6
+ const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyloadImage = true })=>{
7
7
  const { imageLink, isNotLazyload } = setting ?? {};
8
8
  const { shape } = styles ?? {};
9
9
  const { Wrap: WrapLink, urlData } = getInsertLinkData('div', imageLink);
@@ -30,7 +30,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
30
30
  }}
31
31
  data-id="${builderProps?.uid}"
32
32
  role="presentation"
33
- class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
33
+ class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass)}"
34
34
  style="${{
35
35
  ...style,
36
36
  ...makeStyleResponsive('ta', styles?.align)
@@ -72,8 +72,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
72
72
  aspectRatio: getAspectRatioGlobalSize(styles?.shape),
73
73
  layout: styles?.objectFit,
74
74
  priority: setting?.priority,
75
- enableLazyLoadImage,
76
- pageContext
75
+ enableLazyloadImage
77
76
  }) : NextImage({
78
77
  ...setting?.image,
79
78
  priority: setting?.priority,
@@ -102,8 +101,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
102
101
  layout: styles?.objectFit
103
102
  },
104
103
  isNotLazyload,
105
- enableLazyLoadImage,
106
- pageContext
104
+ enableLazyloadImage
107
105
  })}
108
106
  </${WrapLink}>
109
107
  </div>`;
@@ -3,7 +3,7 @@ import { getNewBackupFileKey, getImageSrc, getSrcSet } from '../helpers/getSrcSe
3
3
  import { DEVICES } from '../../product/components/ProductVariants/index.js';
4
4
  import { createBlurDataURL } from './helpers.js';
5
5
 
6
- const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', srcIsLiquidCode, alt = 'Alt image', width = 2237, height = 1678, backupFileKey, backupFilePath, storage, style, priority, vw, className, base64, baseSrc, isDisableAspectStyle, isDisableObjectFit, customAttrs, customLazyload, isNotLazyload, enableLazyLoadImage = true, pageContext, srcset, sizes, ...props })=>{
6
+ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', srcIsLiquidCode, alt = 'Alt image', width = 2237, height = 1678, backupFileKey, backupFilePath, storage, style, priority, vw, className, base64, baseSrc, isDisableAspectStyle, isDisableObjectFit, customAttrs, customLazyload, isNotLazyload, enableLazyloadImage = true, srcset, sizes, ...props })=>{
7
7
  const { aspectRatio, layout, qualityPercent, qualityType } = setting ?? {};
8
8
  const newBackupFilekey = backupFileKey ? getNewBackupFileKey(backupFileKey ?? '', src) : '';
9
9
  const srcImage = srcIsLiquidCode ? baseSrc : getImageSrc({
@@ -93,13 +93,12 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
93
93
  ${customAttrs}
94
94
  draggable="false"
95
95
  class="${cls(className, {
96
- gp_lazyload: !customLazyload && enableLazyLoadImage,
97
- gp_force_load: pageContext?.isOptimizePlan
96
+ gp_lazyload: !customLazyload && enableLazyloadImage
98
97
  })}"
99
98
  ${{
100
99
  'data-src': srcImage,
101
100
  'data-srcset': srcSetImg,
102
- src: enableLazyLoadImage ? imagePlaceholder : srcImage,
101
+ src: enableLazyloadImage ? imagePlaceholder : srcImage,
103
102
  width,
104
103
  height,
105
104
  alt,
@@ -7,7 +7,7 @@ import { getSettingPreloadData } from '../../helpers.js';
7
7
  import { styleLazyPlaceholder } from './common/helpers.js';
8
8
 
9
9
  const CompareImage = (props)=>{
10
- const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid = '', styles, advanced, builderData, preload = false, enableLazyLoadImage, pageContext, translate } = props;
10
+ const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid = '', styles, advanced, builderData, preload = false, pageContext, translate } = props;
11
11
  const horizontal = !vertical;
12
12
  const leftRatio = (leftImage?.width ?? 0) / (leftImage?.height ?? 1);
13
13
  const rightRatio = (rightImage?.width ?? 0) / (rightImage?.height ?? 1);
@@ -267,9 +267,7 @@ const CompareImage = (props)=>{
267
267
  style: {
268
268
  ...initStyles.rightImage,
269
269
  ...makeStyleResponsive('objf', styles?.imageScale)
270
- },
271
- enableLazyLoadImage,
272
- pageContext
270
+ }
273
271
  })}
274
272
  ${NextImage({
275
273
  customAttrs: {
@@ -285,9 +283,7 @@ const CompareImage = (props)=>{
285
283
  style: {
286
284
  ...initStyles.rightImage,
287
285
  ...makeStyleResponsive('objf', styles?.imageScale)
288
- },
289
- enableLazyLoadImage,
290
- pageContext
286
+ }
291
287
  })}
292
288
  <div id="image-comparison-slider-${componentUid}" style="${{
293
289
  ...initStyles.slider
package/dist/esm/index.js CHANGED
@@ -218,8 +218,8 @@ export { default as BfSizeChartSizeGuide } from './third-party/components/BfSize
218
218
  export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.js';
219
219
  export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.js';
220
220
  export { default as EcoboostifyShoppableReelUgc } from './third-party/components/EcoboostifyShoppableReelUgc.js';
221
- export { default as EcomsendBackInStockAlert } from './third-party/components/EcomsendBackInStockAlert.js';
222
221
  export { default as AppstleBundlesDiscounts } from './third-party/components/AppstleBundlesDiscounts.js';
222
+ export { default as EcomsendBackInStockAlert } from './third-party/components/EcomsendBackInStockAlert.js';
223
223
  export { default as thirdPartyInstantSetting } from './third-party-instant/setting/index.js';
224
224
  export { default as InstantJudgemeReviews } from './third-party-instant/components/InstantJudgemeReviews.js';
225
225
  export { default as InstantLooxReviews } from './third-party-instant/components/InstantLooxReviews.js';
@@ -173,8 +173,8 @@ export { default as BfSizeChartSizeGuide } from './third-party/components/BfSize
173
173
  export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.liquid.js';
174
174
  export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.liquid.js';
175
175
  export { default as EcoboostifyShoppableReelUgc } from './third-party/components/EcoboostifyShoppableReelUgc.liquid.js';
176
- export { default as EcomsendBackInStockAlert } from './third-party/components/EcomsendBackInStockAlert.liquid.js';
177
176
  export { default as AppstleBundlesDiscounts } from './third-party/components/AppstleBundlesDiscounts.liquid.js';
177
+ export { default as EcomsendBackInStockAlert } from './third-party/components/EcomsendBackInStockAlert.liquid.js';
178
178
  export { default as ImageComparison } from './image-comparison/components/ImageComparison.liquid.js';
179
179
  export { default as ThirdPartySlot } from './third-party-slot/components/ThirdPartySlot.liquid.js';
180
180
  export { default as Sticky } from './sticky/components/Sticky.liquid.js';
@@ -69,7 +69,7 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
69
69
  const itemMaxWidthValue = getResponsiveValueByScreen(styles?.itemMaxWidth, currentDevice);
70
70
  return itemMaxWidthValue?.includes('%');
71
71
  };
72
- const itemMaxWidthValueByScreen = (device)=>{
72
+ const getItemMaxWidthValueByScreen = (device)=>{
73
73
  let value = getResponsiveValueByScreen(styles?.itemMaxWidth, device);
74
74
  const itemWidthTypeValue = getResponsiveValueByScreen(itemWidthType, device);
75
75
  if (itemWidthTypeValue === 'FIT_CONTENT') {
@@ -80,22 +80,25 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
80
80
  }
81
81
  return value;
82
82
  };
83
+ const getMaxWidth = (device)=>{
84
+ return getItemMaxWidthValueByScreen(device) === 'auto' ? 'unset' : getItemMaxWidthValueByScreen(device);
85
+ };
83
86
  const getWidthForWrapperItem = ()=>{
84
87
  return {
85
88
  ...makeStyleResponsive('w', {
86
- desktop: itemMaxWidthValueByScreen('desktop'),
87
- tablet: itemMaxWidthValueByScreen('tablet'),
88
- mobile: itemMaxWidthValueByScreen('mobile')
89
+ desktop: getItemMaxWidthValueByScreen('desktop'),
90
+ tablet: getItemMaxWidthValueByScreen('tablet'),
91
+ mobile: getItemMaxWidthValueByScreen('mobile')
89
92
  }),
90
93
  ...makeStyleResponsive('minw', {
91
- desktop: itemMaxWidthValueByScreen('desktop'),
92
- tablet: itemMaxWidthValueByScreen('tablet'),
93
- mobile: itemMaxWidthValueByScreen('mobile')
94
+ desktop: getItemMaxWidthValueByScreen('desktop'),
95
+ tablet: getItemMaxWidthValueByScreen('tablet'),
96
+ mobile: getItemMaxWidthValueByScreen('mobile')
94
97
  }),
95
98
  ...makeStyleResponsive('maxw', {
96
- desktop: itemMaxWidthValueByScreen('desktop'),
97
- tablet: itemMaxWidthValueByScreen('tablet'),
98
- mobile: itemMaxWidthValueByScreen('mobile')
99
+ desktop: getMaxWidth('desktop'),
100
+ tablet: getMaxWidth('tablet'),
101
+ mobile: getMaxWidth('mobile')
99
102
  })
100
103
  };
101
104
  };
@@ -65,7 +65,7 @@ const DropdownVariant = ({ option, optionPosition, optionNumber, variantGroup, v
65
65
  children: /*#__PURE__*/ jsx("span", {
66
66
  className: "gp-max-w-full",
67
67
  children: /*#__PURE__*/ jsx("span", {
68
- className: "gp-block gp-overflow-hidden gp-truncate",
68
+ className: "gp-block gp-overflow-hidden",
69
69
  children: label
70
70
  })
71
71
  })
@@ -214,7 +214,7 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
214
214
  ]);
215
215
  const isInStock = useCurrentVariantInStock();
216
216
  const isDisable = !isInStock || createCartLoading || addToCartLoading;
217
- const label = !isInStock ? !currentVariant ? 'Unavailable' : setting?.outOfStockLabel : setting?.label;
217
+ const label = !isInStock ? setting?.outOfStockLabel : setting?.label;
218
218
  if (!isInStock && isCustomOutOfStock) {
219
219
  buttonStyles.backgroundColor = {
220
220
  normal: oosBackground
@@ -184,22 +184,6 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
184
184
  pageContext,
185
185
  translate: setting?.translate
186
186
  });
187
- const labelUnavailableTranslate = getDynamicSourceLocales({
188
- val: 'Unavailable',
189
- uid: builderProps?.uid,
190
- settingId: 'unavailableLabel',
191
- isLiquid: true,
192
- pageContext,
193
- translate: setting?.translate ? 'unavailableLabel' : undefined
194
- });
195
- const labelOutOfStockTranslate = getDynamicSourceLocales({
196
- val: setting?.outOfStockLabel,
197
- uid: builderProps?.uid,
198
- settingId: 'outOfStockLabel',
199
- isLiquid: true,
200
- pageContext,
201
- translate: setting?.translate ? 'outOfStockLabel' : undefined
202
- });
203
187
  return template /* liquid */ `
204
188
  {%- liquid
205
189
  assign inventory_quantity = variant.inventory_quantity | default: 0
@@ -207,8 +191,6 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
207
191
  <gp-product-button
208
192
  class="gp-product-button"
209
193
  gp-data-wrapper="true"
210
- label-out-of-Stock="${pageContext?.isPreviewing ? labelOutOfStockTranslate : `{{${labelOutOfStockTranslate}}}`}"
211
- label-unavailable="${pageContext?.isPreviewing ? labelUnavailableTranslate : `{{${labelUnavailableTranslate}}}`}"
212
194
  gp-data='${JSON.stringify({
213
195
  setting: {
214
196
  actionEffect: setting?.actionEffect,
@@ -286,7 +268,8 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
286
268
  'gp-data-hidden': `{% if variant.available %}true{% endif %}`
287
269
  },
288
270
  setting: {
289
- label: `${pageContext?.isPreviewing ? labelOutOfStockTranslate : `{{${labelOutOfStockTranslate}}}`}`,
271
+ label: setting?.outOfStockLabel,
272
+ translate: setting?.translate ? 'outOfStockLabel' : undefined,
290
273
  htmlType: 'button',
291
274
  iconAlign: iconAlign,
292
275
  iconSvg: iconSvg,
@@ -305,8 +288,7 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
305
288
  }
306
289
  },
307
290
  pageContext,
308
- nodePrice: composeNodePrice(),
309
- isForceValue: true
291
+ nodePrice: composeNodePrice()
310
292
  })}
311
293
  </gp-product-button>
312
294
  ${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-button.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-product-button.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}