@gem-sdk/components 2.6.0-staging.28 → 2.6.0-staging.29
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.
- package/dist/cjs/banner/components/hero-banner/index.liquid.js +4 -4
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +6 -5
- package/dist/cjs/image/components/Image.liquid.js +3 -3
- package/dist/cjs/image/components/NextImage.liquid.js +4 -3
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +4 -2
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +4 -4
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
- package/dist/cjs/video/components/HTML5Embed.liquid.js +3 -1
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +4 -3
- package/dist/esm/banner/components/hero-banner/index.liquid.js +4 -4
- package/dist/esm/image/components/AdaptiveImage.liquid.js +6 -5
- package/dist/esm/image/components/Image.liquid.js +3 -3
- package/dist/esm/image/components/NextImage.liquid.js +4 -3
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +4 -2
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +4 -4
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
- package/dist/esm/video/components/HTML5Embed.liquid.js +3 -1
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +4 -3
- package/dist/types/index.d.ts +4 -5
- package/package.json +2 -2
|
@@ -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,
|
|
17
|
+
const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, pageContext })=>{
|
|
18
18
|
const { link, layout, verticalAlign, order, alignBanner, alt, title, isGoToSalesPage } = setting ?? {};
|
|
19
19
|
const { urlData } = helpers.getLinkDataConfigs({
|
|
20
20
|
defaultWrap: '',
|
|
@@ -137,7 +137,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
137
137
|
tablet: helpers$1.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
|
|
138
138
|
mobile: helpers$1.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
|
|
139
139
|
};
|
|
140
|
-
const enableLazyLoad = !setting?.preload &&
|
|
140
|
+
const enableLazyLoad = !setting?.preload && pageContext?.enableLazyLoadImage;
|
|
141
141
|
const renderInnerHeroBanner = ()=>{
|
|
142
142
|
return core.template /* liquid */ `
|
|
143
143
|
<div
|
|
@@ -187,7 +187,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
187
187
|
alt,
|
|
188
188
|
title,
|
|
189
189
|
imagePlaceholder,
|
|
190
|
-
|
|
190
|
+
pageContext,
|
|
191
191
|
fallBackImg: common.fallBackImg
|
|
192
192
|
})}
|
|
193
193
|
<div class="${core.cls('gp-absolute gp-w-full gp-h-full')}">
|
|
@@ -231,7 +231,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
231
231
|
alt: `lazy image ${device}`,
|
|
232
232
|
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' : ''}`,
|
|
233
233
|
isDisableAspectStyle: true,
|
|
234
|
-
|
|
234
|
+
pageContext
|
|
235
235
|
}));
|
|
236
236
|
}).join('') : ''}
|
|
237
237
|
</div></div>
|
|
@@ -6,11 +6,12 @@ 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,
|
|
9
|
+
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, pageContext, fallBackImg, ...props })=>{
|
|
10
10
|
const fallBackImage = fallBackImg || '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;
|
|
13
13
|
const srcMobile = (getSrcSet.getImageSrc(srcSet?.mobile, 'mobile') ?? getSrcSet.getImageSrc(srcSet?.tablet, 'mobile') ?? getSrcSet.getImageSrc(srcSet?.desktop, 'mobile')) || fallBackImage;
|
|
14
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
14
15
|
return core.template`
|
|
15
16
|
<picture style="border-radius: inherit" class="${core.cls(pictureClass)}">
|
|
16
17
|
${core.RenderIf(priority, core.template`
|
|
@@ -31,16 +32,16 @@ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className,
|
|
|
31
32
|
}}"
|
|
32
33
|
/>
|
|
33
34
|
`, core.template`
|
|
34
|
-
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${
|
|
35
|
-
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${
|
|
35
|
+
${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}" />` : ''}
|
|
36
|
+
${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
37
|
<img
|
|
37
38
|
${{
|
|
38
39
|
...props
|
|
39
40
|
}}
|
|
40
41
|
class="${core.cls(className, {
|
|
41
|
-
gp_lazyload:
|
|
42
|
+
gp_lazyload: enableLazyLoadImage
|
|
42
43
|
})}"
|
|
43
|
-
src="${
|
|
44
|
+
src="${enableLazyLoadImage ? imagePlaceholder?.['desktop'] ?? helpers.createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
|
|
44
45
|
data-src="${srcDesktop}"
|
|
45
46
|
width="100%"
|
|
46
47
|
alt="${alt}"
|
|
@@ -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,
|
|
10
|
+
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, pageContext })=>{
|
|
11
11
|
const { imageLink, isNotLazyload, isGoToSalesPage } = setting ?? {};
|
|
12
12
|
const { Wrap: WrapLink, urlData, shouldRenderLink } = helpers.getLinkDataConfigs({
|
|
13
13
|
defaultWrap: 'div',
|
|
@@ -82,7 +82,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
82
82
|
aspectRatio: core.getAspectRatioGlobalSize(styles?.shape),
|
|
83
83
|
layout: styles?.objectFit,
|
|
84
84
|
priority: setting?.priority,
|
|
85
|
-
|
|
85
|
+
pageContext
|
|
86
86
|
}) : NextImage_liquid.default({
|
|
87
87
|
...setting?.image,
|
|
88
88
|
priority: setting?.priority,
|
|
@@ -111,7 +111,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
111
111
|
layout: styles?.objectFit
|
|
112
112
|
},
|
|
113
113
|
isNotLazyload,
|
|
114
|
-
|
|
114
|
+
pageContext
|
|
115
115
|
})}
|
|
116
116
|
</${WrapLink}>
|
|
117
117
|
</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,
|
|
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, pageContext, 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({
|
|
@@ -17,6 +17,7 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
|
|
|
17
17
|
storage
|
|
18
18
|
});
|
|
19
19
|
const srcSetImg = srcIsLiquidCode ? src : getSrcSet.getSrcSet(newBackupFilekey ?? '', storage ?? 'THEME', src);
|
|
20
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
20
21
|
const getObjectFit = ()=>{
|
|
21
22
|
if (isDisableObjectFit) return {};
|
|
22
23
|
return core.makeStyleResponsive('objf', layout);
|
|
@@ -97,12 +98,12 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
|
|
|
97
98
|
${customAttrs}
|
|
98
99
|
draggable="false"
|
|
99
100
|
class="${core.cls(className, {
|
|
100
|
-
gp_lazyload: !customLazyload &&
|
|
101
|
+
gp_lazyload: !customLazyload && enableLazyLoadImage
|
|
101
102
|
})}"
|
|
102
103
|
${{
|
|
103
104
|
'data-src': srcImage,
|
|
104
105
|
'data-srcset': srcSetImg,
|
|
105
|
-
src:
|
|
106
|
+
src: enableLazyLoadImage ? imagePlaceholder : srcImage,
|
|
106
107
|
width,
|
|
107
108
|
height,
|
|
108
109
|
alt,
|
|
@@ -271,7 +271,8 @@ const CompareImage = (props)=>{
|
|
|
271
271
|
style: {
|
|
272
272
|
...initStyles.rightImage,
|
|
273
273
|
...core.makeStyleResponsive('objf', styles?.imageScale)
|
|
274
|
-
}
|
|
274
|
+
},
|
|
275
|
+
pageContext
|
|
275
276
|
})}
|
|
276
277
|
${NextImage_liquid.default({
|
|
277
278
|
customAttrs: {
|
|
@@ -287,7 +288,8 @@ const CompareImage = (props)=>{
|
|
|
287
288
|
style: {
|
|
288
289
|
...initStyles.rightImage,
|
|
289
290
|
...core.makeStyleResponsive('objf', styles?.imageScale)
|
|
290
|
-
}
|
|
291
|
+
},
|
|
292
|
+
pageContext
|
|
291
293
|
})}
|
|
292
294
|
<div id="image-comparison-slider-${componentUid}" style="${{
|
|
293
295
|
...initStyles.slider
|
package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js
CHANGED
|
@@ -13,7 +13,7 @@ var NextImage_liquid = require('../../../../image/components/NextImage.liquid.js
|
|
|
13
13
|
var Video_liquid = require('../../../../image/components/Video.liquid.js');
|
|
14
14
|
var _function = require('../../../helpers/function.js');
|
|
15
15
|
|
|
16
|
-
const ProductFeaturedImageCarousel = ({ builderPropUID, children,
|
|
16
|
+
const ProductFeaturedImageCarousel = ({ builderPropUID, children, pageContext, ...setting })=>{
|
|
17
17
|
const ftAspectRatio = common.getAspectRatio(setting.ftShape);
|
|
18
18
|
const getStyleFeaturedImageDisplay = ()=>{
|
|
19
19
|
return common.getDisplayStyle((device)=>![
|
|
@@ -158,7 +158,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
|
|
|
158
158
|
},
|
|
159
159
|
priority: setting?.preload,
|
|
160
160
|
className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${className}`,
|
|
161
|
-
|
|
161
|
+
pageContext
|
|
162
162
|
})}`;
|
|
163
163
|
};
|
|
164
164
|
const renderNoImage = ()=>{
|
|
@@ -176,7 +176,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
|
|
|
176
176
|
},
|
|
177
177
|
priority: setting?.preload,
|
|
178
178
|
className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
|
|
179
|
-
|
|
179
|
+
pageContext
|
|
180
180
|
})}`;
|
|
181
181
|
};
|
|
182
182
|
const getValueFromValueContainUnit = (value)=>{
|
|
@@ -403,7 +403,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
|
|
|
403
403
|
},
|
|
404
404
|
className: `gp-w-full featured-image-only !gp-rounded-none`,
|
|
405
405
|
customLazyload: true,
|
|
406
|
-
|
|
406
|
+
pageContext
|
|
407
407
|
})}
|
|
408
408
|
{%- endif -%}
|
|
409
409
|
`
|
|
@@ -10,7 +10,7 @@ var common = require('../common/common.js');
|
|
|
10
10
|
var productGallery = require('../common/productGallery.js');
|
|
11
11
|
var _function = require('../../../helpers/function.js');
|
|
12
12
|
|
|
13
|
-
const ProductGalleryCarousel = ({ builderPropUID, children,
|
|
13
|
+
const ProductGalleryCarousel = ({ builderPropUID, children, pageContext, ...setting })=>{
|
|
14
14
|
const getCarouselDisplay = ()=>{
|
|
15
15
|
const isDisplayCarousel = (type, position, device)=>{
|
|
16
16
|
const layout = core.getResponsiveValueByScreen(position, device);
|
|
@@ -90,7 +90,7 @@ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyloadImage,
|
|
|
90
90
|
customLazyload: true,
|
|
91
91
|
style: style,
|
|
92
92
|
className: '!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer',
|
|
93
|
-
|
|
93
|
+
pageContext
|
|
94
94
|
})}`;
|
|
95
95
|
};
|
|
96
96
|
const aspectRatioToPaddingBottom = ()=>{
|
|
@@ -12,7 +12,7 @@ var Modal3d_liquid = require('../../../../image/components/Modal3d.liquid.js');
|
|
|
12
12
|
var Video_liquid = require('../../../../image/components/Video.liquid.js');
|
|
13
13
|
var HTML5Embed_liquid = require('../../../../video/components/HTML5Embed.liquid.js');
|
|
14
14
|
|
|
15
|
-
const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children,
|
|
15
|
+
const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, pageContext, ...setting })=>{
|
|
16
16
|
const getGridDisplay = ()=>{
|
|
17
17
|
const isDisplayGrid = (type, position, device)=>{
|
|
18
18
|
const layout = core.getResponsiveValueByScreen(position, device);
|
|
@@ -101,7 +101,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
|
|
|
101
101
|
style: style,
|
|
102
102
|
className: '!gp-rounded-none',
|
|
103
103
|
customLazyload: false,
|
|
104
|
-
|
|
104
|
+
pageContext
|
|
105
105
|
})}
|
|
106
106
|
${setting?.galleryHoverEffect !== 'none' ? `<div class="${core.cls('zoom-element !gp-max-w-none', productFeaturedImage.getZoomImageClass())}">
|
|
107
107
|
${NextImage_liquid.default({
|
|
@@ -115,7 +115,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
|
|
|
115
115
|
style: style,
|
|
116
116
|
className: '!gp-rounded-none gp-w-full gp-h-full',
|
|
117
117
|
customLazyload: false,
|
|
118
|
-
|
|
118
|
+
pageContext
|
|
119
119
|
})}
|
|
120
120
|
</div>` : ''}
|
|
121
121
|
${setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' ? `
|
|
@@ -298,7 +298,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
|
|
|
298
298
|
},
|
|
299
299
|
className: '!gp-rounded-none',
|
|
300
300
|
customLazyload: false,
|
|
301
|
-
|
|
301
|
+
pageContext
|
|
302
302
|
})}`;
|
|
303
303
|
};
|
|
304
304
|
return core.template`
|
|
@@ -11,7 +11,7 @@ var helpers = require('../../../../helpers.js');
|
|
|
11
11
|
var productGallery = require('../common/productGallery.js');
|
|
12
12
|
|
|
13
13
|
const ProductImages = (productImageProps)=>{
|
|
14
|
-
const { setting, styles, builderProps, style, advanced, rawChildren, pageContext
|
|
14
|
+
const { setting, styles, builderProps, style, advanced, rawChildren, pageContext } = productImageProps;
|
|
15
15
|
const settings = {
|
|
16
16
|
...setting,
|
|
17
17
|
...styles
|
|
@@ -116,7 +116,7 @@ const ProductImages = (productImageProps)=>{
|
|
|
116
116
|
builderPropUID: `gp-carousel-${builderProps?.uid}`,
|
|
117
117
|
...settings,
|
|
118
118
|
children: renderProductBadge(),
|
|
119
|
-
|
|
119
|
+
pageContext
|
|
120
120
|
})}
|
|
121
121
|
${common.shouldSkipLiquidRenderForSingleImage(settings?.position, core.template`
|
|
122
122
|
<div
|
|
@@ -132,7 +132,7 @@ const ProductImages = (productImageProps)=>{
|
|
|
132
132
|
${ProductGalleryCarousel_liquid.default({
|
|
133
133
|
builderPropUID: `gp-gallery-${builderProps?.uid}`,
|
|
134
134
|
...settings,
|
|
135
|
-
|
|
135
|
+
pageContext
|
|
136
136
|
})}
|
|
137
137
|
</div>
|
|
138
138
|
${ProductGalleryGrid_liquid.default({
|
|
@@ -142,7 +142,7 @@ const ProductImages = (productImageProps)=>{
|
|
|
142
142
|
},
|
|
143
143
|
children: renderProductBadge(),
|
|
144
144
|
...settings,
|
|
145
|
-
|
|
145
|
+
pageContext
|
|
146
146
|
})}
|
|
147
147
|
`)}
|
|
148
148
|
</div>
|
|
@@ -7,6 +7,7 @@ var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
|
7
7
|
var helpers = require('../../helpers.js');
|
|
8
8
|
|
|
9
9
|
const HTML5Embed = (props)=>{
|
|
10
|
+
const { pageContext } = props;
|
|
10
11
|
const videoId = `gp-video-${props.uid}`;
|
|
11
12
|
const preloadThumbnail = props.autoplay && props.thumbnail;
|
|
12
13
|
const offLazyVideo = !props.lazy && props.isVideoComponent;
|
|
@@ -23,7 +24,8 @@ const HTML5Embed = (props)=>{
|
|
|
23
24
|
'--op': 0,
|
|
24
25
|
'--z': -1,
|
|
25
26
|
display: 'none'
|
|
26
|
-
}
|
|
27
|
+
},
|
|
28
|
+
pageContext
|
|
27
29
|
})}
|
|
28
30
|
${core.RenderIf(props.autoplay, `<script>
|
|
29
31
|
document.addEventListener("DOMContentLoaded", (event) => {
|
|
@@ -7,7 +7,7 @@ var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
|
7
7
|
var helpers = require('../../helpers.js');
|
|
8
8
|
|
|
9
9
|
const LiteYouTubeEmbed = (props)=>{
|
|
10
|
-
const { style, lazy, preload } = props;
|
|
10
|
+
const { style, lazy, preload, pageContext } = props;
|
|
11
11
|
const videoUid = `gp-video-${props.uid}`;
|
|
12
12
|
const videoId = encodeURIComponent(props.id);
|
|
13
13
|
const videoTitle = props.title;
|
|
@@ -42,7 +42,7 @@ const LiteYouTubeEmbed = (props)=>{
|
|
|
42
42
|
data-title="${videoTitle}"
|
|
43
43
|
style="${{
|
|
44
44
|
...core.makeStyleResponsive('bgi', {
|
|
45
|
-
desktop: preload ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
|
|
45
|
+
desktop: preload || !pageContext?.enableLazyLoadImage ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
|
|
46
46
|
}),
|
|
47
47
|
...style
|
|
48
48
|
}}"
|
|
@@ -52,7 +52,8 @@ const LiteYouTubeEmbed = (props)=>{
|
|
|
52
52
|
src: posterUrl,
|
|
53
53
|
alt: 'Poster',
|
|
54
54
|
className: `gp-invisible gp-w-full gp-h-full gp_lazyforbg`,
|
|
55
|
-
isDisableAspectStyle: true
|
|
55
|
+
isDisableAspectStyle: true,
|
|
56
|
+
pageContext
|
|
56
57
|
})}
|
|
57
58
|
<button
|
|
58
59
|
type="button"
|
|
@@ -10,7 +10,7 @@ import NextImage from '../../../image/components/NextImage.liquid.js';
|
|
|
10
10
|
import { getImageSrc, DEVICES } from '../../../image/helpers/getSrcSet.js';
|
|
11
11
|
import { createBlurDataURL } from '../../../image/components/helpers.js';
|
|
12
12
|
|
|
13
|
-
const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced,
|
|
13
|
+
const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, pageContext })=>{
|
|
14
14
|
const { link, layout, verticalAlign, order, alignBanner, alt, title, isGoToSalesPage } = setting ?? {};
|
|
15
15
|
const { urlData } = getLinkDataConfigs({
|
|
16
16
|
defaultWrap: '',
|
|
@@ -133,7 +133,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
133
133
|
tablet: createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
|
|
134
134
|
mobile: createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
|
|
135
135
|
};
|
|
136
|
-
const enableLazyLoad = !setting?.preload &&
|
|
136
|
+
const enableLazyLoad = !setting?.preload && pageContext?.enableLazyLoadImage;
|
|
137
137
|
const renderInnerHeroBanner = ()=>{
|
|
138
138
|
return template /* liquid */ `
|
|
139
139
|
<div
|
|
@@ -183,7 +183,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
183
183
|
alt,
|
|
184
184
|
title,
|
|
185
185
|
imagePlaceholder,
|
|
186
|
-
|
|
186
|
+
pageContext,
|
|
187
187
|
fallBackImg
|
|
188
188
|
})}
|
|
189
189
|
<div class="${cls('gp-absolute gp-w-full gp-h-full')}">
|
|
@@ -227,7 +227,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
227
227
|
alt: `lazy image ${device}`,
|
|
228
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' : ''}`,
|
|
229
229
|
isDisableAspectStyle: true,
|
|
230
|
-
|
|
230
|
+
pageContext
|
|
231
231
|
}));
|
|
232
232
|
}).join('') : ''}
|
|
233
233
|
</div></div>
|
|
@@ -2,11 +2,12 @@ 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,
|
|
5
|
+
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, pageContext, fallBackImg, ...props })=>{
|
|
6
6
|
const fallBackImage = fallBackImg || '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;
|
|
9
9
|
const srcMobile = (getImageSrc(srcSet?.mobile, 'mobile') ?? getImageSrc(srcSet?.tablet, 'mobile') ?? getImageSrc(srcSet?.desktop, 'mobile')) || fallBackImage;
|
|
10
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
10
11
|
return template`
|
|
11
12
|
<picture style="border-radius: inherit" class="${cls(pictureClass)}">
|
|
12
13
|
${RenderIf(priority, template`
|
|
@@ -27,16 +28,16 @@ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className,
|
|
|
27
28
|
}}"
|
|
28
29
|
/>
|
|
29
30
|
`, template`
|
|
30
|
-
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${
|
|
31
|
-
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${
|
|
31
|
+
${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}" />` : ''}
|
|
32
|
+
${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
33
|
<img
|
|
33
34
|
${{
|
|
34
35
|
...props
|
|
35
36
|
}}
|
|
36
37
|
class="${cls(className, {
|
|
37
|
-
gp_lazyload:
|
|
38
|
+
gp_lazyload: enableLazyLoadImage
|
|
38
39
|
})}"
|
|
39
|
-
src="${
|
|
40
|
+
src="${enableLazyLoadImage ? imagePlaceholder?.['desktop'] ?? createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
|
|
40
41
|
data-src="${srcDesktop}"
|
|
41
42
|
width="100%"
|
|
42
43
|
alt="${alt}"
|
|
@@ -3,7 +3,7 @@ import AdaptiveImage from './AdaptiveImage.liquid.js';
|
|
|
3
3
|
import NextImage from './NextImage.liquid.js';
|
|
4
4
|
import { getLinkDataConfigs } from '../../helpers.js';
|
|
5
5
|
|
|
6
|
-
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced,
|
|
6
|
+
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, pageContext })=>{
|
|
7
7
|
const { imageLink, isNotLazyload, isGoToSalesPage } = setting ?? {};
|
|
8
8
|
const { Wrap: WrapLink, urlData, shouldRenderLink } = getLinkDataConfigs({
|
|
9
9
|
defaultWrap: 'div',
|
|
@@ -78,7 +78,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
78
78
|
aspectRatio: getAspectRatioGlobalSize(styles?.shape),
|
|
79
79
|
layout: styles?.objectFit,
|
|
80
80
|
priority: setting?.priority,
|
|
81
|
-
|
|
81
|
+
pageContext
|
|
82
82
|
}) : NextImage({
|
|
83
83
|
...setting?.image,
|
|
84
84
|
priority: setting?.priority,
|
|
@@ -107,7 +107,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
107
107
|
layout: styles?.objectFit
|
|
108
108
|
},
|
|
109
109
|
isNotLazyload,
|
|
110
|
-
|
|
110
|
+
pageContext
|
|
111
111
|
})}
|
|
112
112
|
</${WrapLink}>
|
|
113
113
|
</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,
|
|
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, pageContext, 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({
|
|
@@ -13,6 +13,7 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
|
|
|
13
13
|
storage
|
|
14
14
|
});
|
|
15
15
|
const srcSetImg = srcIsLiquidCode ? src : getSrcSet(newBackupFilekey ?? '', storage ?? 'THEME', src);
|
|
16
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
16
17
|
const getObjectFit = ()=>{
|
|
17
18
|
if (isDisableObjectFit) return {};
|
|
18
19
|
return makeStyleResponsive('objf', layout);
|
|
@@ -93,12 +94,12 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
|
|
|
93
94
|
${customAttrs}
|
|
94
95
|
draggable="false"
|
|
95
96
|
class="${cls(className, {
|
|
96
|
-
gp_lazyload: !customLazyload &&
|
|
97
|
+
gp_lazyload: !customLazyload && enableLazyLoadImage
|
|
97
98
|
})}"
|
|
98
99
|
${{
|
|
99
100
|
'data-src': srcImage,
|
|
100
101
|
'data-srcset': srcSetImg,
|
|
101
|
-
src:
|
|
102
|
+
src: enableLazyLoadImage ? imagePlaceholder : srcImage,
|
|
102
103
|
width,
|
|
103
104
|
height,
|
|
104
105
|
alt,
|
|
@@ -267,7 +267,8 @@ const CompareImage = (props)=>{
|
|
|
267
267
|
style: {
|
|
268
268
|
...initStyles.rightImage,
|
|
269
269
|
...makeStyleResponsive('objf', styles?.imageScale)
|
|
270
|
-
}
|
|
270
|
+
},
|
|
271
|
+
pageContext
|
|
271
272
|
})}
|
|
272
273
|
${NextImage({
|
|
273
274
|
customAttrs: {
|
|
@@ -283,7 +284,8 @@ const CompareImage = (props)=>{
|
|
|
283
284
|
style: {
|
|
284
285
|
...initStyles.rightImage,
|
|
285
286
|
...makeStyleResponsive('objf', styles?.imageScale)
|
|
286
|
-
}
|
|
287
|
+
},
|
|
288
|
+
pageContext
|
|
287
289
|
})}
|
|
288
290
|
<div id="image-comparison-slider-${componentUid}" style="${{
|
|
289
291
|
...initStyles.slider
|
package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js
CHANGED
|
@@ -9,7 +9,7 @@ import NextImage from '../../../../image/components/NextImage.liquid.js';
|
|
|
9
9
|
import Video from '../../../../image/components/Video.liquid.js';
|
|
10
10
|
import { getStyleOfObject } from '../../../helpers/function.js';
|
|
11
11
|
|
|
12
|
-
const ProductFeaturedImageCarousel = ({ builderPropUID, children,
|
|
12
|
+
const ProductFeaturedImageCarousel = ({ builderPropUID, children, pageContext, ...setting })=>{
|
|
13
13
|
const ftAspectRatio = getAspectRatio(setting.ftShape);
|
|
14
14
|
const getStyleFeaturedImageDisplay = ()=>{
|
|
15
15
|
return getDisplayStyle((device)=>![
|
|
@@ -154,7 +154,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
|
|
|
154
154
|
},
|
|
155
155
|
priority: setting?.preload,
|
|
156
156
|
className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${className}`,
|
|
157
|
-
|
|
157
|
+
pageContext
|
|
158
158
|
})}`;
|
|
159
159
|
};
|
|
160
160
|
const renderNoImage = ()=>{
|
|
@@ -172,7 +172,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
|
|
|
172
172
|
},
|
|
173
173
|
priority: setting?.preload,
|
|
174
174
|
className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
|
|
175
|
-
|
|
175
|
+
pageContext
|
|
176
176
|
})}`;
|
|
177
177
|
};
|
|
178
178
|
const getValueFromValueContainUnit = (value)=>{
|
|
@@ -399,7 +399,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
|
|
|
399
399
|
},
|
|
400
400
|
className: `gp-w-full featured-image-only !gp-rounded-none`,
|
|
401
401
|
customLazyload: true,
|
|
402
|
-
|
|
402
|
+
pageContext
|
|
403
403
|
})}
|
|
404
404
|
{%- endif -%}
|
|
405
405
|
`
|
|
@@ -6,7 +6,7 @@ import { convertSpacing, getDisplayStyle, getAspectRatio, getSrcImage } from '..
|
|
|
6
6
|
import { getShapeByLayout, getSettingMinWidthForCarouselItem, getSettingWidthForCarouselItem, getMinHeightByPosition, getSliderPerShowConfig, getAllowDotConfig, getDotStyleConfig, getCarouselVerticalConfigByPosition, checkDisplayGalleryByWidth, getZoomDisplay } from '../common/productGallery.js';
|
|
7
7
|
import { getStyleOfObject } from '../../../helpers/function.js';
|
|
8
8
|
|
|
9
|
-
const ProductGalleryCarousel = ({ builderPropUID, children,
|
|
9
|
+
const ProductGalleryCarousel = ({ builderPropUID, children, pageContext, ...setting })=>{
|
|
10
10
|
const getCarouselDisplay = ()=>{
|
|
11
11
|
const isDisplayCarousel = (type, position, device)=>{
|
|
12
12
|
const layout = getResponsiveValueByScreen(position, device);
|
|
@@ -86,7 +86,7 @@ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyloadImage,
|
|
|
86
86
|
customLazyload: true,
|
|
87
87
|
style: style,
|
|
88
88
|
className: '!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer',
|
|
89
|
-
|
|
89
|
+
pageContext
|
|
90
90
|
})}`;
|
|
91
91
|
};
|
|
92
92
|
const aspectRatioToPaddingBottom = ()=>{
|
|
@@ -8,7 +8,7 @@ import Model3d from '../../../../image/components/Modal3d.liquid.js';
|
|
|
8
8
|
import Video from '../../../../image/components/Video.liquid.js';
|
|
9
9
|
import HTML5Embed from '../../../../video/components/HTML5Embed.liquid.js';
|
|
10
10
|
|
|
11
|
-
const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children,
|
|
11
|
+
const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, pageContext, ...setting })=>{
|
|
12
12
|
const getGridDisplay = ()=>{
|
|
13
13
|
const isDisplayGrid = (type, position, device)=>{
|
|
14
14
|
const layout = getResponsiveValueByScreen(position, device);
|
|
@@ -97,7 +97,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
|
|
|
97
97
|
style: style,
|
|
98
98
|
className: '!gp-rounded-none',
|
|
99
99
|
customLazyload: false,
|
|
100
|
-
|
|
100
|
+
pageContext
|
|
101
101
|
})}
|
|
102
102
|
${setting?.galleryHoverEffect !== 'none' ? `<div class="${cls('zoom-element !gp-max-w-none', getZoomImageClass())}">
|
|
103
103
|
${NextImage({
|
|
@@ -111,7 +111,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
|
|
|
111
111
|
style: style,
|
|
112
112
|
className: '!gp-rounded-none gp-w-full gp-h-full',
|
|
113
113
|
customLazyload: false,
|
|
114
|
-
|
|
114
|
+
pageContext
|
|
115
115
|
})}
|
|
116
116
|
</div>` : ''}
|
|
117
117
|
${setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' ? `
|
|
@@ -294,7 +294,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
|
|
|
294
294
|
},
|
|
295
295
|
className: '!gp-rounded-none',
|
|
296
296
|
customLazyload: false,
|
|
297
|
-
|
|
297
|
+
pageContext
|
|
298
298
|
})}`;
|
|
299
299
|
};
|
|
300
300
|
return template`
|
|
@@ -7,7 +7,7 @@ import { getSettingPreloadData } from '../../../../helpers.js';
|
|
|
7
7
|
import { getShapeByLayout, sizeSettingDefaultForNewLayout } from '../common/productGallery.js';
|
|
8
8
|
|
|
9
9
|
const ProductImages = (productImageProps)=>{
|
|
10
|
-
const { setting, styles, builderProps, style, advanced, rawChildren, pageContext
|
|
10
|
+
const { setting, styles, builderProps, style, advanced, rawChildren, pageContext } = productImageProps;
|
|
11
11
|
const settings = {
|
|
12
12
|
...setting,
|
|
13
13
|
...styles
|
|
@@ -112,7 +112,7 @@ const ProductImages = (productImageProps)=>{
|
|
|
112
112
|
builderPropUID: `gp-carousel-${builderProps?.uid}`,
|
|
113
113
|
...settings,
|
|
114
114
|
children: renderProductBadge(),
|
|
115
|
-
|
|
115
|
+
pageContext
|
|
116
116
|
})}
|
|
117
117
|
${shouldSkipLiquidRenderForSingleImage(settings?.position, template`
|
|
118
118
|
<div
|
|
@@ -128,7 +128,7 @@ const ProductImages = (productImageProps)=>{
|
|
|
128
128
|
${ProductGalleryCarousel({
|
|
129
129
|
builderPropUID: `gp-gallery-${builderProps?.uid}`,
|
|
130
130
|
...settings,
|
|
131
|
-
|
|
131
|
+
pageContext
|
|
132
132
|
})}
|
|
133
133
|
</div>
|
|
134
134
|
${ProductGalleryGrid({
|
|
@@ -138,7 +138,7 @@ const ProductImages = (productImageProps)=>{
|
|
|
138
138
|
},
|
|
139
139
|
children: renderProductBadge(),
|
|
140
140
|
...settings,
|
|
141
|
-
|
|
141
|
+
pageContext
|
|
142
142
|
})}
|
|
143
143
|
`)}
|
|
144
144
|
</div>
|
|
@@ -3,6 +3,7 @@ import NextImage from '../../image/components/NextImage.liquid.js';
|
|
|
3
3
|
import { getSettingPreloadData } from '../../helpers.js';
|
|
4
4
|
|
|
5
5
|
const HTML5Embed = (props)=>{
|
|
6
|
+
const { pageContext } = props;
|
|
6
7
|
const videoId = `gp-video-${props.uid}`;
|
|
7
8
|
const preloadThumbnail = props.autoplay && props.thumbnail;
|
|
8
9
|
const offLazyVideo = !props.lazy && props.isVideoComponent;
|
|
@@ -19,7 +20,8 @@ const HTML5Embed = (props)=>{
|
|
|
19
20
|
'--op': 0,
|
|
20
21
|
'--z': -1,
|
|
21
22
|
display: 'none'
|
|
22
|
-
}
|
|
23
|
+
},
|
|
24
|
+
pageContext
|
|
23
25
|
})}
|
|
24
26
|
${RenderIf(props.autoplay, `<script>
|
|
25
27
|
document.addEventListener("DOMContentLoaded", (event) => {
|
|
@@ -3,7 +3,7 @@ import NextImage from '../../image/components/NextImage.liquid.js';
|
|
|
3
3
|
import { getSettingPreloadData } from '../../helpers.js';
|
|
4
4
|
|
|
5
5
|
const LiteYouTubeEmbed = (props)=>{
|
|
6
|
-
const { style, lazy, preload } = props;
|
|
6
|
+
const { style, lazy, preload, pageContext } = props;
|
|
7
7
|
const videoUid = `gp-video-${props.uid}`;
|
|
8
8
|
const videoId = encodeURIComponent(props.id);
|
|
9
9
|
const videoTitle = props.title;
|
|
@@ -38,7 +38,7 @@ const LiteYouTubeEmbed = (props)=>{
|
|
|
38
38
|
data-title="${videoTitle}"
|
|
39
39
|
style="${{
|
|
40
40
|
...makeStyleResponsive('bgi', {
|
|
41
|
-
desktop: preload ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
|
|
41
|
+
desktop: preload || !pageContext?.enableLazyLoadImage ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
|
|
42
42
|
}),
|
|
43
43
|
...style
|
|
44
44
|
}}"
|
|
@@ -48,7 +48,8 @@ const LiteYouTubeEmbed = (props)=>{
|
|
|
48
48
|
src: posterUrl,
|
|
49
49
|
alt: 'Poster',
|
|
50
50
|
className: `gp-invisible gp-w-full gp-h-full gp_lazyforbg`,
|
|
51
|
-
isDisableAspectStyle: true
|
|
51
|
+
isDisableAspectStyle: true,
|
|
52
|
+
pageContext
|
|
52
53
|
})}
|
|
53
54
|
<button
|
|
54
55
|
type="button"
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5817,7 +5817,6 @@ type PropTypes = ProductImagesProps$1 & React.ComponentPropsWithoutRef<'div'> &
|
|
|
5817
5817
|
children?: any;
|
|
5818
5818
|
} & {
|
|
5819
5819
|
pageContext?: PageContext;
|
|
5820
|
-
enableLazyloadImage?: boolean;
|
|
5821
5820
|
};
|
|
5822
5821
|
declare const ProductImages: (productImageProps: PropTypes) => string;
|
|
5823
5822
|
|
|
@@ -6316,7 +6315,7 @@ type CountdownLiquidProps = BaseProps<{
|
|
|
6316
6315
|
};
|
|
6317
6316
|
declare const Countdown: ({ builderProps, setting, styles, advanced, pageContext, }: CountdownLiquidProps) => string;
|
|
6318
6317
|
|
|
6319
|
-
declare const Image: ({ styles, className, setting, builderAttrs, builderProps, style, advanced,
|
|
6318
|
+
declare const Image: ({ styles, className, setting, builderAttrs, builderProps, style, advanced, pageContext, }: {
|
|
6320
6319
|
className?: string | undefined;
|
|
6321
6320
|
children?: React.ReactNode;
|
|
6322
6321
|
onClick?: React.MouseEventHandler<any> | undefined;
|
|
@@ -6378,7 +6377,7 @@ declare const Image: ({ styles, className, setting, builderAttrs, builderProps,
|
|
|
6378
6377
|
} & {
|
|
6379
6378
|
advanced?: any;
|
|
6380
6379
|
} & {
|
|
6381
|
-
|
|
6380
|
+
pageContext?: PageContext | undefined;
|
|
6382
6381
|
}) => string;
|
|
6383
6382
|
|
|
6384
6383
|
type VideoProps = {} & BasePropsWrap<{
|
|
@@ -6443,7 +6442,7 @@ declare const TabItem: ({ children, builderAttrs, style, className, parentUid }:
|
|
|
6443
6442
|
parentUid?: string | undefined;
|
|
6444
6443
|
}) => string;
|
|
6445
6444
|
|
|
6446
|
-
declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced,
|
|
6445
|
+
declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, pageContext, }: _gem_sdk_core.BaseProps<{
|
|
6447
6446
|
link?: {
|
|
6448
6447
|
link?: string | undefined;
|
|
6449
6448
|
target?: string | undefined;
|
|
@@ -6509,7 +6508,7 @@ declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style,
|
|
|
6509
6508
|
} & {
|
|
6510
6509
|
rawChildren?: any[] | undefined;
|
|
6511
6510
|
advanced?: any;
|
|
6512
|
-
|
|
6511
|
+
pageContext?: PageContext | undefined;
|
|
6513
6512
|
}) => string;
|
|
6514
6513
|
|
|
6515
6514
|
declare const CSSCode: ({ setting, style, advanced, builderAttrs, builderProps }: CSSCodeProps) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.6.0-staging.
|
|
3
|
+
"version": "2.6.0-staging.29",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"format": "prettier --write \"./src/**/*.{ts,tsx}\""
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@gem-sdk/core": "2.6.0-staging.
|
|
24
|
+
"@gem-sdk/core": "2.6.0-staging.29",
|
|
25
25
|
"@gem-sdk/styles": "2.6.0-staging.13",
|
|
26
26
|
"@types/react-transition-group": "^4.4.5"
|
|
27
27
|
},
|