@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
@@ -29,8 +29,7 @@ const ArticleImage = ({ className, setting = {}, styles = {}, advanced, builderP
29
29
  setting: {
30
30
  ...setting,
31
31
  alt: image.alt,
32
- image,
33
- disableNoDataState: true
32
+ image
34
33
  },
35
34
  styles: styles,
36
35
  advanced: advanced
@@ -14,7 +14,7 @@ var NextImage_liquid = require('../../../image/components/NextImage.liquid.js');
14
14
  var getSrcSet = require('../../../image/helpers/getSrcSet.js');
15
15
  var helpers$1 = require('../../../image/components/helpers.js');
16
16
 
17
- const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyLoadImage = true })=>{
17
+ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyloadImage = true })=>{
18
18
  const { link, layout, verticalAlign, order, alignBanner, alt, title } = setting ?? {};
19
19
  const { background, overlayEnable, overlayColor, overlayOpacity, verticalGutter, contentWidth, hoverEffect, hoverEffectDuration, hoverEffectScale, cornerBg, borderBg, hasActiveShadow, shadowBg, sizeSetting, contentPadding } = styles ?? {};
20
20
  const enableParallax = setting?.enableParallax || false;
@@ -43,6 +43,9 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
43
43
  } else if (data.videoType === 'html5') {
44
44
  delete data.video;
45
45
  }
46
+ if (data.type !== 'image') {
47
+ delete data.image;
48
+ }
46
49
  }
47
50
  return background;
48
51
  };
@@ -131,7 +134,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
131
134
  tablet: helpers$1.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
132
135
  mobile: helpers$1.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
133
136
  };
134
- const enableLazyLoad = !setting?.preload && enableLazyLoadImage;
137
+ const enableLazyLoad = !setting?.preload && enableLazyloadImage;
135
138
  const renderInnerHeroBanner = ()=>{
136
139
  return core.template /* liquid */ `
137
140
  <div
@@ -181,7 +184,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
181
184
  alt,
182
185
  title,
183
186
  imagePlaceholder,
184
- enableLazyLoadImage
187
+ enableLazyloadImage
185
188
  })}
186
189
  <div class="${core.cls('gp-absolute gp-w-full gp-h-full')}">
187
190
  <div
@@ -224,7 +227,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
224
227
  alt: `lazy image ${device}`,
225
228
  className: `gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg ${device === 'tablet' ? 'gp_lazybg_tl' : ''} ${device === 'mobile' ? 'gp_lazybg_mb' : ''}`,
226
229
  isDisableAspectStyle: true,
227
- enableLazyLoadImage
230
+ enableLazyloadImage
228
231
  }));
229
232
  }).join('') : ''}
230
233
  </div></div>
@@ -124,8 +124,8 @@ var BfSizeChartSizeGuide = require('./third-party/components/BfSizeChartSizeGuid
124
124
  var AlsoBoughtCbb = require('./third-party/components/AlsoBoughtCbb.js');
125
125
  var HextomFreeShippingBar = require('./third-party/components/HextomFreeShippingBar.js');
126
126
  var EcoboostifyShoppableReelUgc = require('./third-party/components/EcoboostifyShoppableReelUgc.js');
127
- var EcomsendBackInStockAlert = require('./third-party/components/EcomsendBackInStockAlert.js');
128
127
  var AppstleBundlesDiscounts = require('./third-party/components/AppstleBundlesDiscounts.js');
128
+ var EcomsendBackInStockAlert = require('./third-party/components/EcomsendBackInStockAlert.js');
129
129
  var CartLineVariant = require('./cart/components/CartLineVariant.js');
130
130
  var Cart = require('./cart/components/Cart.js');
131
131
  var CartList = require('./cart/components/CartList.js');
@@ -129,7 +129,7 @@ const Button = ({ className, onClick, builderProps, builderAttrs, setting = {},
129
129
  disabled: disabled,
130
130
  children: [
131
131
  loading ? /*#__PURE__*/ jsxRuntime.jsxs("svg", {
132
- className: "gp-invisible gp-h-5 gp-w-5 gp-animate-spin group-data-[state=loading]/button:gp-visible gp-absolute",
132
+ className: "gp-invisible gp-h-5 gp-w-5 gp-animate-spin group-data-[state=loading]:gp-visible gp-absolute",
133
133
  xmlns: "http://www.w3.org/2000/svg",
134
134
  fill: "none",
135
135
  viewBox: "0 0 24 24",
@@ -156,7 +156,7 @@ const Button = ({ className, onClick, builderProps, builderAttrs, setting = {},
156
156
  children: [
157
157
  !!iconSvg && iconVisible && /*#__PURE__*/ jsxRuntime.jsx("span", {
158
158
  className: `
159
- 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' : ''}`,
159
+ 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' : ''}`,
160
160
  style: {
161
161
  ...iconSpacingStyle,
162
162
  '--height-desktop': `${size?.desktop}`,
@@ -169,7 +169,7 @@ const Button = ({ className, onClick, builderProps, builderAttrs, setting = {},
169
169
  }),
170
170
  (!!label || !shouldClearSpace) && /*#__PURE__*/ jsxRuntime.jsx("div", {
171
171
  "data-gp-text": true,
172
- className: core.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 : {}),
172
+ className: core.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 : {}),
173
173
  style: {
174
174
  ...core.makeStyle({
175
175
  tt: styles?.transform
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var core = require('@gem-sdk/core');
6
6
  var helpers = require('../../helpers.js');
7
7
 
8
- const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId, isForceValue = false })=>{
8
+ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId })=>{
9
9
  const { align, size, backgroundColor, textColor, roundedBtn, iconSpacing, globalSize } = styles;
10
10
  const { label, iconSvg, btnLink, htmlType, disabled, loading, iconAlign, iconVisible, translate, disabledLoading = true } = setting;
11
11
  const [wrapStyle, restStyle] = core.splitStyle([
@@ -70,7 +70,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
70
70
  color: ${core.getSingleColorVariable(styles?.textColor?.hover)};
71
71
  }
72
72
  `;
73
- const labelValDisplay = isForceValue ? label : helpers.getDynamicSourceLocales({
73
+ const labelValDisplay = helpers.getDynamicSourceLocales({
74
74
  val: label,
75
75
  uid: builderProps?.uidTranslate ?? builderProps?.uid,
76
76
  settingId: translate ?? 'label',
@@ -127,7 +127,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
127
127
  }}"
128
128
  >
129
129
  ${!disabledLoading ? ` <svg
130
- 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"
130
+ class="gp-invisible gp-absolute gp-h-5 gp-w-5 group-data-[state=loading]:gp-animate-spin group-data-[state=loading]:gp-visible"
131
131
  xmlns="http://www.w3.org/2000/svg"
132
132
  fill="none"
133
133
  viewBox="0 0 24 24"
@@ -151,7 +151,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
151
151
  'gp-flex-row-reverse': iconAlign === 'right'
152
152
  })}">
153
153
  ${core.RenderIf(!!iconSvg && iconVisible, core.template`<span
154
- 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)]`}"
154
+ 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)]`}"
155
155
  style="${{
156
156
  ...label ? iconSpacingStyle : {},
157
157
  '--height-desktop': `${size?.desktop}`,
@@ -161,7 +161,7 @@ const Button = ({ className, builderProps, customAttrs, pageContext, setting = {
161
161
  >${iconSvg}</span>`)}
162
162
  <span
163
163
  data-gp-text
164
- 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 : ''}
164
+ 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 : ''}
165
165
  ${styles?.typo?.attrs?.italic ? '[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]' : ''}`}"
166
166
  style="${{
167
167
  ...nodePrice && appendTypoStyle,
@@ -13,7 +13,7 @@ const DEVICES = [
13
13
  'tablet',
14
14
  'desktop'
15
15
  ];
16
- const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ftShapeProductImage, ...props })=>{
16
+ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ...props })=>{
17
17
  const setting = arrow.mappingNavigationCarousel(props.setting);
18
18
  const styleHeight = core.makeStyleResponsive('h', core.getHeightByShapeGlobalSize(styles?.sizeSetting));
19
19
  const styleWidth = core.makeStyleWithDefault('w', core.getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
@@ -112,8 +112,7 @@ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId
112
112
  setting,
113
113
  styles,
114
114
  moveToIdx,
115
- isHiddenArrowWhenDisabled,
116
- ftShapeProductImage
115
+ isHiddenArrowWhenDisabled
117
116
  }).replaceAll("'", '&#039;')}' style="${{
118
117
  ...core.makeStyleResponsive('jc', styles?.align),
119
118
  ...rootStyles
@@ -4,15 +4,41 @@ const AutoPlayPlugin = (slider)=>{
4
4
  let autoplay = slider.options.autoplay ?? {};
5
5
  let timeout;
6
6
  let mouseOver = false;
7
+ let inViewport = false;
8
+ let observer = null;
9
+ // Thêm sự kiện cho dot nếu có
10
+ const $dots = slider?.container?.closest('[data-component-type="component"]')?.querySelector('.carousel-dots');
11
+ // Callback của IntersectionObserver
12
+ function handleIntersection(entries) {
13
+ entries.forEach((entry)=>{
14
+ // Với threshold 0, chỉ cần một phần bất kỳ hiển thị sẽ đánh dấu isIntersecting
15
+ inViewport = entry.isIntersecting;
16
+ if (inViewport) {
17
+ nextTimeout();
18
+ } else {
19
+ clearNextTimeout();
20
+ }
21
+ });
22
+ }
23
+ function initIntersectionObserver() {
24
+ // Nếu đã có observer hoặc không có container thì không khởi tạo lại
25
+ if (observer || !slider.container) return;
26
+ observer = new IntersectionObserver(handleIntersection, {
27
+ root: null,
28
+ threshold: 0
29
+ });
30
+ observer.observe(slider.container);
31
+ }
7
32
  function clearNextTimeout() {
8
33
  clearTimeout(timeout);
9
34
  }
10
35
  function nextTimeout() {
11
- clearTimeout(timeout);
36
+ clearNextTimeout();
12
37
  timeout = setTimeout(()=>{
13
- if (mouseOver || !autoplay.enable) return;
38
+ // Nếu đang hover, autoplay bị tắt hoặc slider không trong viewport thì không chuyển slide
39
+ if (mouseOver || !autoplay.enable || !inViewport) return;
14
40
  slider.next();
15
- }, autoplay?.delay ?? 2000);
41
+ }, autoplay.delay ?? 2000);
16
42
  }
17
43
  function onMouseOver() {
18
44
  mouseOver = true;
@@ -23,11 +49,15 @@ const AutoPlayPlugin = (slider)=>{
23
49
  nextTimeout();
24
50
  }
25
51
  slider.on('created', ()=>{
26
- if (autoplay.pauseOnHover) {
52
+ $dots?.addEventListener('mouseover', onMouseOver);
53
+ $dots?.addEventListener('mouseout', onMouseOut);
54
+ // Nếu tùy chọn pauseOnHover bật thì thêm sự kiện hover cho container slider
55
+ if (autoplay.pauseOnHover && slider.container) {
27
56
  slider.container.addEventListener('mouseover', onMouseOver);
28
57
  slider.container.addEventListener('mouseout', onMouseOut);
29
58
  }
30
- if (slider.options.autoplay?.enable) {
59
+ if (autoplay.enable) {
60
+ initIntersectionObserver();
31
61
  nextTimeout();
32
62
  }
33
63
  });
@@ -35,29 +65,40 @@ const AutoPlayPlugin = (slider)=>{
35
65
  slider.on('animationEnded', nextTimeout);
36
66
  slider.on('updated', (newOptions)=>{
37
67
  autoplay = newOptions.options?.autoplay ?? {};
38
- nextTimeout();
39
- });
40
- slider.on('destroyed', ()=>{
41
- slider.container.removeEventListener('mouseover', onMouseOver);
42
- slider.container.removeEventListener('mouseout', onMouseOut);
68
+ if (autoplay.enable) {
69
+ initIntersectionObserver();
70
+ nextTimeout();
71
+ }
43
72
  });
44
73
  slider.on('optionsChanged', (newOptions)=>{
45
- const $dots = slider?.container?.closest('[data-component-type="component"]')?.querySelector('.carousel-dots');
46
- $dots?.addEventListener('mouseover', onMouseOver);
47
- $dots?.addEventListener('mouseout', onMouseOut);
48
- if (newOptions.options.autoplay?.pauseOnHover !== autoplay.pauseOnHover) {
74
+ if (newOptions.options.autoplay?.pauseOnHover !== autoplay.pauseOnHover && slider.container) {
49
75
  if (newOptions.options.autoplay?.pauseOnHover) {
50
76
  slider.container.addEventListener('mouseover', onMouseOver);
51
77
  slider.container.addEventListener('mouseout', onMouseOut);
52
- }
53
- if (!newOptions.options.autoplay?.pauseOnHover) {
78
+ } else {
54
79
  slider.container.removeEventListener('mouseover', onMouseOver);
55
80
  slider.container.removeEventListener('mouseout', onMouseOut);
56
81
  mouseOver = false;
57
82
  }
58
83
  }
59
- nextTimeout();
60
84
  autoplay = newOptions.options.autoplay ?? {};
85
+ if (autoplay.enable) {
86
+ initIntersectionObserver();
87
+ nextTimeout();
88
+ }
89
+ });
90
+ slider.on('destroyed', ()=>{
91
+ if (slider.container) {
92
+ slider.container.removeEventListener('mouseover', onMouseOver);
93
+ slider.container.removeEventListener('mouseout', onMouseOut);
94
+ }
95
+ $dots?.removeEventListener('mouseover', onMouseOver);
96
+ $dots?.removeEventListener('mouseout', onMouseOut);
97
+ clearNextTimeout();
98
+ if (observer) {
99
+ observer.disconnect();
100
+ observer = null;
101
+ }
61
102
  });
62
103
  };
63
104
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const ELEMENT_Z_INDEX = {
4
- STICKY: 1000,
4
+ STICKY: 100000,
5
5
  DIALOG: 100001,
6
6
  CART_DRAWER: 100002,
7
7
  CART_DRAWER_CONFIRM_MODAL: 100003
@@ -260,21 +260,6 @@ const config = {
260
260
  }
261
261
  }
262
262
  },
263
- {
264
- id: 'columnGap',
265
- type: 'range',
266
- min: 0,
267
- max: 100,
268
- step: 1,
269
- units: [
270
- '%'
271
- ],
272
- devices: {
273
- desktop: {
274
- default: '0%'
275
- }
276
- }
277
- },
278
263
  {
279
264
  id: 'background',
280
265
  type: 'background',
@@ -311,29 +296,14 @@ const config = {
311
296
  ],
312
297
  ui: [
313
298
  {
314
- type: 'group',
299
+ type: 'control',
315
300
  label: {
316
301
  en: 'Layout'
317
302
  },
318
- controls: [
319
- {
320
- type: 'control',
321
- setting: {
322
- id: 'layout'
323
- },
324
- layout: 'vertical'
325
- },
326
- {
327
- type: 'control',
328
- label: {
329
- en: 'Column gap'
330
- },
331
- setting: {
332
- id: 'columnGap'
333
- },
334
- condition: `!!layout.cols && layout.cols.length > 1 && pageType == "POST_PURCHASE"`
335
- }
336
- ]
303
+ setting: {
304
+ id: 'layout'
305
+ },
306
+ layout: 'vertical'
337
307
  },
338
308
  {
339
309
  type: 'group',
@@ -370,7 +340,7 @@ const config = {
370
340
  setting: {
371
341
  id: 'verticalGutter'
372
342
  },
373
- condition: `!!layout.cols && layout.cols.length > 1 && pageType != "POST_PURCHASE"`
343
+ condition: `!!layout.cols && layout.cols.length > 1`
374
344
  }
375
345
  ]
376
346
  },
@@ -379,7 +349,7 @@ const config = {
379
349
  label: {
380
350
  en: 'Align'
381
351
  },
382
- condition: `(layout.display !== 'fill' || (layout.display === 'fill' && !!layout.cols && layout.cols.length > 1)) && pageType != "POST_PURCHASE"`,
352
+ condition: `layout.display !== 'fill' || (layout.display === 'fill' && !!layout.cols && layout.cols.length > 1)`,
383
353
  controls: [
384
354
  {
385
355
  type: 'control',
@@ -6,7 +6,7 @@ var core = require('@gem-sdk/core');
6
6
  var getSrcSet = require('../helpers/getSrcSet.js');
7
7
  var helpers = require('./helpers.js');
8
8
 
9
- const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyLoadImage = true, pageContext, ...props })=>{
9
+ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyloadImage = true, ...props })=>{
10
10
  const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
11
11
  const srcDesktop = getSrcSet.getImageSrc(srcSet?.desktop, 'desktop') || fallBackImage;
12
12
  const srcTablet = (getSrcSet.getImageSrc(srcSet?.tablet, 'tablet') ?? getSrcSet.getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
@@ -31,17 +31,16 @@ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className,
31
31
  }}"
32
32
  />
33
33
  `, core.template`
34
- ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['mobile'] ?? helpers.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
35
- ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['tablet'] ?? helpers.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
34
+ ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyloadImage ? imagePlaceholder?.['mobile'] ?? helpers.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
35
+ ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyloadImage ? imagePlaceholder?.['tablet'] ?? helpers.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
36
36
  <img
37
37
  ${{
38
38
  ...props
39
39
  }}
40
40
  class="${core.cls(className, {
41
- gp_lazyload: enableLazyLoadImage,
42
- gp_force_load: pageContext?.isOptimizePlan
41
+ gp_lazyload: enableLazyloadImage
43
42
  })}"
44
- src="${enableLazyLoadImage ? imagePlaceholder?.['desktop'] ?? helpers.createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
43
+ src="${enableLazyloadImage ? imagePlaceholder?.['desktop'] ?? helpers.createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
45
44
  data-src="${srcDesktop}"
46
45
  width="100%"
47
46
  alt="${alt}"
@@ -12,7 +12,6 @@ var helpers = require('./helpers.js');
12
12
  const Image = ({ styles, className, setting, builderAttrs, builderProps, style, children, onClick, onLoad })=>{
13
13
  const { image, imageLink, srcSet, isNotLazyload } = setting ?? {};
14
14
  const { customAspectRadio } = styles ?? {};
15
- core.useCurrentDevice();
16
15
  const { shape } = styles ?? {};
17
16
  const WrapLink = imageLink?.link ? Link.default : 'div';
18
17
  const opacity = {
@@ -87,7 +86,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
87
86
  setting?.isAdaptive ? /*#__PURE__*/ jsxRuntime.jsx(AdaptiveImage.default, {
88
87
  srcSet: setting.srcSet,
89
88
  pictureClass: "gp-contents",
90
- className: core.cls(className, 'gp-inline-block gp-w-full gp-max-w-full', core.handleConvertClassColor(styles?.borderImg)),
89
+ className: core.cls(className, 'gp-w-full gp-max-w-full', core.handleConvertClassColor(styles?.borderImg)),
91
90
  alt: setting.alt,
92
91
  style: {
93
92
  ...imageWidth,
@@ -7,7 +7,7 @@ var AdaptiveImage_liquid = require('./AdaptiveImage.liquid.js');
7
7
  var NextImage_liquid = require('./NextImage.liquid.js');
8
8
  var helpers = require('../../helpers.js');
9
9
 
10
- const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyLoadImage = true, pageContext })=>{
10
+ const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyloadImage = true })=>{
11
11
  const { imageLink, isNotLazyload } = setting ?? {};
12
12
  const { shape } = styles ?? {};
13
13
  const { Wrap: WrapLink, urlData } = helpers.getInsertLinkData('div', imageLink);
@@ -34,7 +34,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
34
34
  }}
35
35
  data-id="${builderProps?.uid}"
36
36
  role="presentation"
37
- class="${core.cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
37
+ class="${core.cls('gp-group/image', builderProps?.uid, advanced?.cssClass)}"
38
38
  style="${{
39
39
  ...style,
40
40
  ...core.makeStyleResponsive('ta', styles?.align)
@@ -76,8 +76,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
76
76
  aspectRatio: core.getAspectRatioGlobalSize(styles?.shape),
77
77
  layout: styles?.objectFit,
78
78
  priority: setting?.priority,
79
- enableLazyLoadImage,
80
- pageContext
79
+ enableLazyloadImage
81
80
  }) : NextImage_liquid.default({
82
81
  ...setting?.image,
83
82
  priority: setting?.priority,
@@ -106,8 +105,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
106
105
  layout: styles?.objectFit
107
106
  },
108
107
  isNotLazyload,
109
- enableLazyLoadImage,
110
- pageContext
108
+ enableLazyloadImage
111
109
  })}
112
110
  </${WrapLink}>
113
111
  </div>`;
@@ -7,7 +7,7 @@ var getSrcSet = require('../helpers/getSrcSet.js');
7
7
  var index = require('../../product/components/ProductVariants/index.js');
8
8
  var helpers = require('./helpers.js');
9
9
 
10
- 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 })=>{
10
+ 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 })=>{
11
11
  const { aspectRatio, layout, qualityPercent, qualityType } = setting ?? {};
12
12
  const newBackupFilekey = backupFileKey ? getSrcSet.getNewBackupFileKey(backupFileKey ?? '', src) : '';
13
13
  const srcImage = srcIsLiquidCode ? baseSrc : getSrcSet.getImageSrc({
@@ -97,13 +97,12 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
97
97
  ${customAttrs}
98
98
  draggable="false"
99
99
  class="${core.cls(className, {
100
- gp_lazyload: !customLazyload && enableLazyLoadImage,
101
- gp_force_load: pageContext?.isOptimizePlan
100
+ gp_lazyload: !customLazyload && enableLazyloadImage
102
101
  })}"
103
102
  ${{
104
103
  'data-src': srcImage,
105
104
  'data-srcset': srcSetImg,
106
- src: enableLazyLoadImage ? imagePlaceholder : srcImage,
105
+ src: enableLazyloadImage ? imagePlaceholder : srcImage,
107
106
  width,
108
107
  height,
109
108
  alt,
@@ -11,7 +11,7 @@ var helpers$1 = require('../../helpers.js');
11
11
  var helpers = require('./common/helpers.js');
12
12
 
13
13
  const CompareImage = (props)=>{
14
- 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;
14
+ 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;
15
15
  const horizontal = !vertical;
16
16
  const leftRatio = (leftImage?.width ?? 0) / (leftImage?.height ?? 1);
17
17
  const rightRatio = (rightImage?.width ?? 0) / (rightImage?.height ?? 1);
@@ -271,9 +271,7 @@ const CompareImage = (props)=>{
271
271
  style: {
272
272
  ...initStyles.rightImage,
273
273
  ...core.makeStyleResponsive('objf', styles?.imageScale)
274
- },
275
- enableLazyLoadImage,
276
- pageContext
274
+ }
277
275
  })}
278
276
  ${NextImage_liquid.default({
279
277
  customAttrs: {
@@ -289,9 +287,7 @@ const CompareImage = (props)=>{
289
287
  style: {
290
288
  ...initStyles.rightImage,
291
289
  ...core.makeStyleResponsive('objf', styles?.imageScale)
292
- },
293
- enableLazyLoadImage,
294
- pageContext
290
+ }
295
291
  })}
296
292
  <div id="image-comparison-slider-${componentUid}" style="${{
297
293
  ...initStyles.slider
package/dist/cjs/index.js CHANGED
@@ -220,8 +220,8 @@ var BfSizeChartSizeGuide = require('./third-party/components/BfSizeChartSizeGuid
220
220
  var AlsoBoughtCbb = require('./third-party/components/AlsoBoughtCbb.js');
221
221
  var HextomFreeShippingBar = require('./third-party/components/HextomFreeShippingBar.js');
222
222
  var EcoboostifyShoppableReelUgc = require('./third-party/components/EcoboostifyShoppableReelUgc.js');
223
- var EcomsendBackInStockAlert = require('./third-party/components/EcomsendBackInStockAlert.js');
224
223
  var AppstleBundlesDiscounts = require('./third-party/components/AppstleBundlesDiscounts.js');
224
+ var EcomsendBackInStockAlert = require('./third-party/components/EcomsendBackInStockAlert.js');
225
225
  var index$x = require('./third-party-instant/setting/index.js');
226
226
  var InstantJudgemeReviews = require('./third-party-instant/components/InstantJudgemeReviews.js');
227
227
  var InstantLooxReviews = require('./third-party-instant/components/InstantLooxReviews.js');
@@ -538,8 +538,8 @@ exports.BfSizeChartSizeGuide = BfSizeChartSizeGuide.default;
538
538
  exports.AlsoBoughtCbb = AlsoBoughtCbb.default;
539
539
  exports.HextomFreeShippingBar = HextomFreeShippingBar.default;
540
540
  exports.EcoboostifyShoppableReelUgc = EcoboostifyShoppableReelUgc.default;
541
- exports.EcomsendBackInStockAlert = EcomsendBackInStockAlert.default;
542
541
  exports.AppstleBundlesDiscounts = AppstleBundlesDiscounts.default;
542
+ exports.EcomsendBackInStockAlert = EcomsendBackInStockAlert.default;
543
543
  exports.thirdPartyInstantSetting = index$x.default;
544
544
  exports.InstantJudgemeReviews = InstantJudgemeReviews.default;
545
545
  exports.InstantLooxReviews = InstantLooxReviews.default;
@@ -175,8 +175,8 @@ var BfSizeChartSizeGuide_liquid = require('./third-party/components/BfSizeChartS
175
175
  var AlsoBoughtCbb_liquid = require('./third-party/components/AlsoBoughtCbb.liquid.js');
176
176
  var HextomFreeShippingBar_liquid = require('./third-party/components/HextomFreeShippingBar.liquid.js');
177
177
  var EcoboostifyShoppableReelUgc_liquid = require('./third-party/components/EcoboostifyShoppableReelUgc.liquid.js');
178
- var EcomsendBackInStockAlert_liquid = require('./third-party/components/EcomsendBackInStockAlert.liquid.js');
179
178
  var AppstleBundlesDiscounts_liquid = require('./third-party/components/AppstleBundlesDiscounts.liquid.js');
179
+ var EcomsendBackInStockAlert_liquid = require('./third-party/components/EcomsendBackInStockAlert.liquid.js');
180
180
  var ImageComparison_liquid = require('./image-comparison/components/ImageComparison.liquid.js');
181
181
  var ThirdPartySlot_liquid = require('./third-party-slot/components/ThirdPartySlot.liquid.js');
182
182
  var Sticky_liquid = require('./sticky/components/Sticky.liquid.js');
@@ -374,8 +374,8 @@ exports.BfSizeChartSizeGuide = BfSizeChartSizeGuide_liquid.default;
374
374
  exports.AlsoBoughtCbb = AlsoBoughtCbb_liquid.default;
375
375
  exports.HextomFreeShippingBar = HextomFreeShippingBar_liquid.default;
376
376
  exports.EcoboostifyShoppableReelUgc = EcoboostifyShoppableReelUgc_liquid.default;
377
- exports.EcomsendBackInStockAlert = EcomsendBackInStockAlert_liquid.default;
378
377
  exports.AppstleBundlesDiscounts = AppstleBundlesDiscounts_liquid.default;
378
+ exports.EcomsendBackInStockAlert = EcomsendBackInStockAlert_liquid.default;
379
379
  exports.ImageComparison = ImageComparison_liquid.default;
380
380
  exports.ThirdPartySlot = ThirdPartySlot_liquid.default;
381
381
  exports.Sticky = Sticky_liquid.default;
@@ -73,7 +73,7 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
73
73
  const itemMaxWidthValue = core.getResponsiveValueByScreen(styles?.itemMaxWidth, currentDevice);
74
74
  return itemMaxWidthValue?.includes('%');
75
75
  };
76
- const itemMaxWidthValueByScreen = (device)=>{
76
+ const getItemMaxWidthValueByScreen = (device)=>{
77
77
  let value = core.getResponsiveValueByScreen(styles?.itemMaxWidth, device);
78
78
  const itemWidthTypeValue = core.getResponsiveValueByScreen(itemWidthType, device);
79
79
  if (itemWidthTypeValue === 'FIT_CONTENT') {
@@ -84,22 +84,25 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
84
84
  }
85
85
  return value;
86
86
  };
87
+ const getMaxWidth = (device)=>{
88
+ return getItemMaxWidthValueByScreen(device) === 'auto' ? 'unset' : getItemMaxWidthValueByScreen(device);
89
+ };
87
90
  const getWidthForWrapperItem = ()=>{
88
91
  return {
89
92
  ...core.makeStyleResponsive('w', {
90
- desktop: itemMaxWidthValueByScreen('desktop'),
91
- tablet: itemMaxWidthValueByScreen('tablet'),
92
- mobile: itemMaxWidthValueByScreen('mobile')
93
+ desktop: getItemMaxWidthValueByScreen('desktop'),
94
+ tablet: getItemMaxWidthValueByScreen('tablet'),
95
+ mobile: getItemMaxWidthValueByScreen('mobile')
93
96
  }),
94
97
  ...core.makeStyleResponsive('minw', {
95
- desktop: itemMaxWidthValueByScreen('desktop'),
96
- tablet: itemMaxWidthValueByScreen('tablet'),
97
- mobile: itemMaxWidthValueByScreen('mobile')
98
+ desktop: getItemMaxWidthValueByScreen('desktop'),
99
+ tablet: getItemMaxWidthValueByScreen('tablet'),
100
+ mobile: getItemMaxWidthValueByScreen('mobile')
98
101
  }),
99
102
  ...core.makeStyleResponsive('maxw', {
100
- desktop: itemMaxWidthValueByScreen('desktop'),
101
- tablet: itemMaxWidthValueByScreen('tablet'),
102
- mobile: itemMaxWidthValueByScreen('mobile')
103
+ desktop: getMaxWidth('desktop'),
104
+ tablet: getMaxWidth('tablet'),
105
+ mobile: getMaxWidth('mobile')
103
106
  })
104
107
  };
105
108
  };
@@ -69,7 +69,7 @@ const DropdownVariant = ({ option, optionPosition, optionNumber, variantGroup, v
69
69
  children: /*#__PURE__*/ jsxRuntime.jsx("span", {
70
70
  className: "gp-max-w-full",
71
71
  children: /*#__PURE__*/ jsxRuntime.jsx("span", {
72
- className: "gp-block gp-overflow-hidden gp-truncate",
72
+ className: "gp-block gp-overflow-hidden",
73
73
  children: label
74
74
  })
75
75
  })
@@ -218,7 +218,7 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
218
218
  ]);
219
219
  const isInStock = core.useCurrentVariantInStock();
220
220
  const isDisable = !isInStock || createCartLoading || addToCartLoading;
221
- const label = !isInStock ? !currentVariant ? 'Unavailable' : setting?.outOfStockLabel : setting?.label;
221
+ const label = !isInStock ? setting?.outOfStockLabel : setting?.label;
222
222
  if (!isInStock && isCustomOutOfStock) {
223
223
  buttonStyles.backgroundColor = {
224
224
  normal: oosBackground