@gem-sdk/components 2.1.13-staging.0 → 2.1.13-staging.10
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/article/components/ArticleList.liquid.js +6 -2
- package/dist/cjs/banner/components/hero-banner/index.liquid.js +12 -10
- package/dist/cjs/builder.js +21 -1
- package/dist/cjs/common/const.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +6 -5
- package/dist/cjs/image/components/Image.js +22 -3
- package/dist/cjs/image/components/Image.liquid.js +6 -5
- package/dist/cjs/image/components/NextImage.liquid.js +4 -3
- package/dist/cjs/image/components/NoDataImage.js +133 -0
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +7 -3
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/index.liquid.js +22 -2
- package/dist/cjs/post-purchase/product/components/ProductDiscountTag.js +5 -2
- package/dist/cjs/post-purchase/product/components/ProductOffer.js +16 -3
- package/dist/cjs/post-purchase/product/components/ProductPrice.js +3 -1
- package/dist/cjs/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
- package/dist/cjs/post-purchase/product/constants/ProductOfferPlaceholder.js +127 -0
- package/dist/cjs/post-purchase/product/hooks/useDynamicProduct.js +28 -0
- package/dist/cjs/post-purchase/product/settings/ProductOffer.js +26 -0
- 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/tab/hooks/useTabInteraction.js +13 -9
- package/dist/cjs/text/components/Text.js +0 -1
- package/dist/cjs/third-party/components/AlsoBoughtCbb.js +32 -0
- package/dist/cjs/third-party/components/AlsoBoughtCbb.liquid.js +21 -0
- package/dist/cjs/third-party/components/BfSizeChartSizeGuide.js +32 -0
- package/dist/cjs/third-party/components/BfSizeChartSizeGuide.liquid.js +12 -0
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.js +32 -0
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.js +32 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.js +32 -0
- package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.liquid.js +12 -0
- package/dist/cjs/third-party/components/GloColorSwatchvariantImage.js +32 -0
- package/dist/cjs/third-party/components/GloColorSwatchvariantImage.liquid.js +12 -0
- package/dist/cjs/third-party/components/HextomFreeShippingBar.js +32 -0
- package/dist/cjs/third-party/components/HextomFreeShippingBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/OkendoReviewsLoyalty.js +32 -0
- package/dist/cjs/third-party/components/OkendoReviewsLoyalty.liquid.js +12 -0
- package/dist/cjs/third-party/components/StellarDeliveryDatePickup.js +32 -0
- package/dist/cjs/third-party/components/StellarDeliveryDatePickup.liquid.js +21 -0
- package/dist/cjs/third-party/components/TrustedsiteTrustBadges.js +32 -0
- package/dist/cjs/third-party/components/TrustedsiteTrustBadges.liquid.js +12 -0
- package/dist/cjs/third-party/configs/AlsoBoughtCbb.js +12 -0
- package/dist/cjs/third-party/configs/BfSizeChartSizeGuide.js +12 -0
- package/dist/cjs/third-party/configs/EssentialAnnouncementBar.js +12 -0
- package/dist/cjs/third-party/configs/EssentialCountdownTimerBar.js +12 -0
- package/dist/cjs/third-party/configs/EstimatedDeliveryDatePlus.js +12 -0
- package/dist/cjs/third-party/configs/GloColorSwatchvariantImage.js +12 -0
- package/dist/cjs/third-party/configs/HextomFreeShippingBar.js +12 -0
- package/dist/cjs/third-party/configs/OkendoReviewsLoyalty.js +12 -0
- package/dist/cjs/third-party/configs/StellarDeliveryDatePickup.js +12 -0
- package/dist/cjs/third-party/configs/TrustedsiteTrustBadges.js +12 -0
- package/dist/cjs/third-party/helpers/thirdParty.js +1 -1
- package/dist/cjs/third-party/next.js +51 -1
- package/dist/cjs/third-party/setting/AlsoBoughtCbb.js +127 -0
- package/dist/cjs/third-party/setting/BfSizeChartSizeGuide.js +131 -0
- package/dist/cjs/third-party/setting/EssentialAnnouncementBar.js +142 -0
- package/dist/cjs/third-party/setting/EssentialCountdownTimerBar.js +142 -0
- package/dist/cjs/third-party/setting/EstimatedDeliveryDatePlus.js +128 -0
- package/dist/cjs/third-party/setting/GloColorSwatchvariantImage.js +152 -0
- package/dist/cjs/third-party/setting/HextomFreeShippingBar.js +128 -0
- package/dist/cjs/third-party/setting/OkendoReviewsLoyalty.js +171 -0
- package/dist/cjs/third-party/setting/StellarDeliveryDatePickup.js +127 -0
- package/dist/cjs/third-party/setting/TrustedsiteTrustBadges.js +177 -0
- package/dist/cjs/third-party/setting/index.js +21 -1
- package/dist/cjs/video/components/HTML5Embed.js +2 -2
- package/dist/cjs/video/components/HTML5Embed.liquid.js +6 -3
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +4 -2
- package/dist/esm/article/components/ArticleList.liquid.js +6 -2
- package/dist/esm/banner/components/hero-banner/index.liquid.js +12 -10
- package/dist/esm/builder.js +21 -1
- package/dist/esm/common/const.js +1 -1
- package/dist/esm/image/components/AdaptiveImage.liquid.js +6 -5
- package/dist/esm/image/components/Image.js +23 -4
- package/dist/esm/image/components/Image.liquid.js +6 -5
- package/dist/esm/image/components/NextImage.liquid.js +4 -3
- package/dist/esm/image/components/NoDataImage.js +129 -0
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +7 -3
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.liquid.js +11 -1
- package/dist/esm/post-purchase/product/components/ProductDiscountTag.js +5 -2
- package/dist/esm/post-purchase/product/components/ProductOffer.js +16 -3
- package/dist/esm/post-purchase/product/components/ProductPrice.js +3 -1
- package/dist/esm/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
- package/dist/esm/post-purchase/product/constants/ProductOfferPlaceholder.js +125 -0
- package/dist/esm/post-purchase/product/hooks/useDynamicProduct.js +26 -0
- package/dist/esm/post-purchase/product/settings/ProductOffer.js +26 -0
- 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/tab/hooks/useTabInteraction.js +14 -10
- package/dist/esm/text/components/Text.js +0 -1
- package/dist/esm/third-party/components/AlsoBoughtCbb.js +28 -0
- package/dist/esm/third-party/components/AlsoBoughtCbb.liquid.js +17 -0
- package/dist/esm/third-party/components/BfSizeChartSizeGuide.js +28 -0
- package/dist/esm/third-party/components/BfSizeChartSizeGuide.liquid.js +8 -0
- package/dist/esm/third-party/components/EssentialAnnouncementBar.js +28 -0
- package/dist/esm/third-party/components/EssentialAnnouncementBar.liquid.js +8 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.js +28 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.liquid.js +8 -0
- package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.js +28 -0
- package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.liquid.js +8 -0
- package/dist/esm/third-party/components/GloColorSwatchvariantImage.js +28 -0
- package/dist/esm/third-party/components/GloColorSwatchvariantImage.liquid.js +8 -0
- package/dist/esm/third-party/components/HextomFreeShippingBar.js +28 -0
- package/dist/esm/third-party/components/HextomFreeShippingBar.liquid.js +8 -0
- package/dist/esm/third-party/components/OkendoReviewsLoyalty.js +28 -0
- package/dist/esm/third-party/components/OkendoReviewsLoyalty.liquid.js +8 -0
- package/dist/esm/third-party/components/StellarDeliveryDatePickup.js +28 -0
- package/dist/esm/third-party/components/StellarDeliveryDatePickup.liquid.js +17 -0
- package/dist/esm/third-party/components/TrustedsiteTrustBadges.js +28 -0
- package/dist/esm/third-party/components/TrustedsiteTrustBadges.liquid.js +8 -0
- package/dist/esm/third-party/configs/AlsoBoughtCbb.js +8 -0
- package/dist/esm/third-party/configs/BfSizeChartSizeGuide.js +8 -0
- package/dist/esm/third-party/configs/EssentialAnnouncementBar.js +8 -0
- package/dist/esm/third-party/configs/EssentialCountdownTimerBar.js +8 -0
- package/dist/esm/third-party/configs/EstimatedDeliveryDatePlus.js +8 -0
- package/dist/esm/third-party/configs/GloColorSwatchvariantImage.js +8 -0
- package/dist/esm/third-party/configs/HextomFreeShippingBar.js +8 -0
- package/dist/esm/third-party/configs/OkendoReviewsLoyalty.js +8 -0
- package/dist/esm/third-party/configs/StellarDeliveryDatePickup.js +8 -0
- package/dist/esm/third-party/configs/TrustedsiteTrustBadges.js +8 -0
- package/dist/esm/third-party/helpers/thirdParty.js +1 -1
- package/dist/esm/third-party/next.js +51 -1
- package/dist/esm/third-party/setting/AlsoBoughtCbb.js +123 -0
- package/dist/esm/third-party/setting/BfSizeChartSizeGuide.js +127 -0
- package/dist/esm/third-party/setting/EssentialAnnouncementBar.js +138 -0
- package/dist/esm/third-party/setting/EssentialCountdownTimerBar.js +138 -0
- package/dist/esm/third-party/setting/EstimatedDeliveryDatePlus.js +124 -0
- package/dist/esm/third-party/setting/GloColorSwatchvariantImage.js +148 -0
- package/dist/esm/third-party/setting/HextomFreeShippingBar.js +124 -0
- package/dist/esm/third-party/setting/OkendoReviewsLoyalty.js +167 -0
- package/dist/esm/third-party/setting/StellarDeliveryDatePickup.js +123 -0
- package/dist/esm/third-party/setting/TrustedsiteTrustBadges.js +173 -0
- package/dist/esm/third-party/setting/index.js +224 -204
- package/dist/esm/video/components/HTML5Embed.js +2 -2
- package/dist/esm/video/components/HTML5Embed.liquid.js +6 -3
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +4 -2
- package/dist/types/index.d.ts +172 -7
- package/package.json +2 -2
|
@@ -56,8 +56,12 @@ const ArticleList = ({ setting, styles, className, children, advanced, builderPr
|
|
|
56
56
|
assign all_articles = all_articles | concat: articleByHandle
|
|
57
57
|
endfor
|
|
58
58
|
else
|
|
59
|
-
assign
|
|
60
|
-
|
|
59
|
+
assign current_blog_handle = blogs['${blogHandle}']
|
|
60
|
+
if gp_enable_custom_dynamic_blog == true
|
|
61
|
+
assign current_blog_handle = blogs[blog.handle]
|
|
62
|
+
endif
|
|
63
|
+
assign all_articles = current_blog_handle.articles | limit: limit | sort: "${articleOrderBy.replace('_REVERSE', '').toLowerCase()}" ${articleOrderBy.includes('_REVERSE') ? '| reverse' : ''}
|
|
64
|
+
assign blogTitle = current_blog_handle.title
|
|
61
65
|
endif
|
|
62
66
|
|
|
63
67
|
%}
|
|
@@ -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, 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;
|
|
@@ -134,6 +134,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
134
134
|
tablet: helpers$1.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
|
|
135
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)
|
|
136
136
|
};
|
|
137
|
+
const enableLazyLoad = !setting?.preload && enableLazyLoadImage;
|
|
137
138
|
const renderInnerHeroBanner = ()=>{
|
|
138
139
|
return core.template /* liquid */ `
|
|
139
140
|
<div
|
|
@@ -183,7 +184,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
183
184
|
alt,
|
|
184
185
|
title,
|
|
185
186
|
imagePlaceholder,
|
|
186
|
-
|
|
187
|
+
enableLazyLoadImage
|
|
187
188
|
})}
|
|
188
189
|
<div class="${core.cls('gp-absolute gp-w-full gp-h-full')}">
|
|
189
190
|
<div
|
|
@@ -197,9 +198,10 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
197
198
|
'clip-path': index.getClipPath(borderBg?.width, cornerBg)
|
|
198
199
|
}}"
|
|
199
200
|
>
|
|
200
|
-
<div class="${core.cls('hero-banner-bg-parallax gp-hero-banner-image-background
|
|
201
|
+
<div class="${core.cls('hero-banner-bg-parallax gp-hero-banner-image-background', {
|
|
201
202
|
'gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)]': hoverEffect,
|
|
202
|
-
'gp-transition-transform': hoverEffect
|
|
203
|
+
'gp-transition-transform': hoverEffect,
|
|
204
|
+
gp_lazybg: enableLazyLoad
|
|
203
205
|
})}"
|
|
204
206
|
style="${{
|
|
205
207
|
...core.getStyleBackgroundByDevice(background, {
|
|
@@ -208,15 +210,16 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
208
210
|
liquid: true
|
|
209
211
|
}),
|
|
210
212
|
...core.makeStyleResponsive('bgi', {
|
|
211
|
-
desktop: `url('${bgiEnableByDevice['desktop'] ?
|
|
212
|
-
tablet: `url('${bgiEnableByDevice['tablet'] ?
|
|
213
|
-
mobile: `url('${bgiEnableByDevice['mobile'] ?
|
|
213
|
+
desktop: `url('${bgiEnableByDevice['desktop'] ? !enableLazyLoad ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'desktop'), 'desktop') : imagePlaceholder['desktop'] : ''}')`,
|
|
214
|
+
tablet: `url('${bgiEnableByDevice['tablet'] ? !enableLazyLoad ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'tablet'), 'tablet') : imagePlaceholder['tablet'] : ''}')`,
|
|
215
|
+
mobile: `url('${bgiEnableByDevice['mobile'] ? !enableLazyLoad ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'mobile'), 'mobile') : imagePlaceholder['mobile'] : ''}')`
|
|
214
216
|
}),
|
|
215
217
|
'--duration': `${hoverEffectDuration ?? 0}s`,
|
|
216
218
|
'--scale': hoverEffectScale ?? 1,
|
|
217
219
|
...core.makeStyleResponsive('pos', getAttachmentDevice()),
|
|
218
220
|
...index.getStyleHeroBannerBg(backgroundResponsive || {}, enableParallax)
|
|
219
221
|
}}"
|
|
222
|
+
${embed()}
|
|
220
223
|
>
|
|
221
224
|
${!setting?.preload ? getSrcSet.DEVICES.map((device)=>{
|
|
222
225
|
return core.RenderIf(getEnableBgImageByDevice(device), NextImage_liquid.default({
|
|
@@ -224,11 +227,10 @@ 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
|
-
|
|
230
|
+
enableLazyLoadImage
|
|
228
231
|
}));
|
|
229
232
|
}).join('') : ''}
|
|
230
|
-
</div>
|
|
231
|
-
${embed()} </div>
|
|
233
|
+
</div></div>
|
|
232
234
|
</div>
|
|
233
235
|
${core.RenderIf(overlayEnable, core.template`<div
|
|
234
236
|
aria-label="Overlay"
|
package/dist/cjs/builder.js
CHANGED
|
@@ -111,8 +111,18 @@ var TrustreviewsProductReviews = require('./third-party/components/TrustreviewsP
|
|
|
111
111
|
var MyappgurusProductReviews = require('./third-party/components/MyappgurusProductReviews.js');
|
|
112
112
|
var HulkProductOptions = require('./third-party/components/HulkProductOptions.js');
|
|
113
113
|
var TrustshopProductReviews = require('./third-party/components/TrustshopProductReviews.js');
|
|
114
|
+
var StellarDeliveryDatePickup = require('./third-party/components/StellarDeliveryDatePickup.js');
|
|
115
|
+
var EssentialCountdownTimerBar = require('./third-party/components/EssentialCountdownTimerBar.js');
|
|
116
|
+
var EssentialAnnouncementBar = require('./third-party/components/EssentialAnnouncementBar.js');
|
|
117
|
+
var OkendoReviewsLoyalty = require('./third-party/components/OkendoReviewsLoyalty.js');
|
|
118
|
+
var EstimatedDeliveryDatePlus = require('./third-party/components/EstimatedDeliveryDatePlus.js');
|
|
114
119
|
var HextomCountdownTimerBar = require('./third-party/components/HextomCountdownTimerBar.js');
|
|
115
120
|
var TrustBadgesBear = require('./third-party/components/TrustBadgesBear.js');
|
|
121
|
+
var TrustedsiteTrustBadges = require('./third-party/components/TrustedsiteTrustBadges.js');
|
|
122
|
+
var GloColorSwatchvariantImage = require('./third-party/components/GloColorSwatchvariantImage.js');
|
|
123
|
+
var BfSizeChartSizeGuide = require('./third-party/components/BfSizeChartSizeGuide.js');
|
|
124
|
+
var AlsoBoughtCbb = require('./third-party/components/AlsoBoughtCbb.js');
|
|
125
|
+
var HextomFreeShippingBar = require('./third-party/components/HextomFreeShippingBar.js');
|
|
116
126
|
var CartLineVariant = require('./cart/components/CartLineVariant.js');
|
|
117
127
|
var Cart = require('./cart/components/Cart.js');
|
|
118
128
|
var CartList = require('./cart/components/CartList.js');
|
|
@@ -247,6 +257,11 @@ var PostPurchaseCountdownTimer = require('./post-purchase/countdown-timer/compon
|
|
|
247
257
|
var Text$1 = require('./post-purchase/text/Text.js');
|
|
248
258
|
|
|
249
259
|
var builder = {
|
|
260
|
+
EstimatedDeliveryDatePlus: EstimatedDeliveryDatePlus.default,
|
|
261
|
+
OkendoReviewsLoyalty: OkendoReviewsLoyalty.default,
|
|
262
|
+
EssentialAnnouncementBar: EssentialAnnouncementBar.default,
|
|
263
|
+
EssentialCountdownTimerBar: EssentialCountdownTimerBar.default,
|
|
264
|
+
StellarDeliveryDatePickup: StellarDeliveryDatePickup.default,
|
|
250
265
|
TrustshopProductReviews: TrustshopProductReviews.default,
|
|
251
266
|
HulkProductOptions: HulkProductOptions.default,
|
|
252
267
|
TrustreviewsProductReviews: TrustreviewsProductReviews.default,
|
|
@@ -483,7 +498,12 @@ var builder = {
|
|
|
483
498
|
MarqueeItem: MarqueeItem.default,
|
|
484
499
|
ProductBadge: index$8.default,
|
|
485
500
|
HextomCountdownTimerBar: HextomCountdownTimerBar.default,
|
|
486
|
-
TrustBadgesBear: TrustBadgesBear.default
|
|
501
|
+
TrustBadgesBear: TrustBadgesBear.default,
|
|
502
|
+
TrustedsiteTrustBadges: TrustedsiteTrustBadges.default,
|
|
503
|
+
GloColorSwatchvariantImage: GloColorSwatchvariantImage.default,
|
|
504
|
+
BfSizeChartSizeGuide: BfSizeChartSizeGuide.default,
|
|
505
|
+
AlsoBoughtCbb: AlsoBoughtCbb.default,
|
|
506
|
+
HextomFreeShippingBar: HextomFreeShippingBar.default
|
|
487
507
|
};
|
|
488
508
|
|
|
489
509
|
exports.default = builder;
|
package/dist/cjs/common/const.js
CHANGED
|
@@ -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,
|
|
9
|
+
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyLoadImage = true, pageContext, ...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,16 +31,17 @@ 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="${
|
|
35
|
-
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${
|
|
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:
|
|
41
|
+
gp_lazyload: enableLazyLoadImage,
|
|
42
|
+
gp_force_load: pageContext?.isOptimizePlan
|
|
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}"
|
|
@@ -8,10 +8,13 @@ var Link = require('../../link/components/Link.js');
|
|
|
8
8
|
var AdaptiveImage = require('./AdaptiveImage.js');
|
|
9
9
|
var NextImage = require('./NextImage.js');
|
|
10
10
|
var helpers = require('./helpers.js');
|
|
11
|
+
var NoDataImage = require('./NoDataImage.js');
|
|
12
|
+
var React = require('react');
|
|
11
13
|
|
|
12
14
|
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, children, onClick, onLoad })=>{
|
|
13
15
|
const { image, imageLink, srcSet, isNotLazyload } = setting ?? {};
|
|
14
16
|
const { customAspectRadio } = styles ?? {};
|
|
17
|
+
const currentDevice = core.useCurrentDevice();
|
|
15
18
|
const { shape } = styles ?? {};
|
|
16
19
|
const WrapLink = imageLink?.link ? Link.default : 'div';
|
|
17
20
|
const opacity = {
|
|
@@ -56,6 +59,18 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
56
59
|
custom: customAspectRadio
|
|
57
60
|
})
|
|
58
61
|
};
|
|
62
|
+
const isShowNoDataState = React.useMemo(()=>{
|
|
63
|
+
if (setting?.disableNoDataState) return false;
|
|
64
|
+
if (currentDevice === 'mobile') return !setting?.srcSet?.mobile?.src && !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
|
|
65
|
+
if (currentDevice === 'tablet') return !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
|
|
66
|
+
return !setting?.srcSet?.desktop?.src;
|
|
67
|
+
}, [
|
|
68
|
+
currentDevice,
|
|
69
|
+
setting?.disableNoDataState,
|
|
70
|
+
setting?.srcSet?.desktop?.src,
|
|
71
|
+
setting?.srcSet?.mobile?.src,
|
|
72
|
+
setting?.srcSet?.tablet?.src
|
|
73
|
+
]);
|
|
59
74
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
60
75
|
...builderAttrs,
|
|
61
76
|
"data-id": builderProps?.uid,
|
|
@@ -80,14 +95,18 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
80
95
|
style: {
|
|
81
96
|
...core.getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
82
97
|
borderRadius: 'inherit',
|
|
83
|
-
overflow: 'hidden',
|
|
84
98
|
...core.makeStyleResponsive('jc', styles?.align)
|
|
85
99
|
},
|
|
86
100
|
children: [
|
|
87
|
-
|
|
101
|
+
isShowNoDataState ? /*#__PURE__*/ jsxRuntime.jsx(NoDataImage.default, {
|
|
102
|
+
style: {
|
|
103
|
+
...imageWidth,
|
|
104
|
+
...imageHeight
|
|
105
|
+
}
|
|
106
|
+
}) : setting?.isAdaptive ? /*#__PURE__*/ jsxRuntime.jsx(AdaptiveImage.default, {
|
|
88
107
|
srcSet: setting.srcSet,
|
|
89
108
|
pictureClass: "gp-contents",
|
|
90
|
-
className: core.cls(className, 'gp-w-full gp-max-w-full', core.handleConvertClassColor(styles?.borderImg)),
|
|
109
|
+
className: core.cls(className, 'gp-inline-block gp-w-full gp-max-w-full', core.handleConvertClassColor(styles?.borderImg)),
|
|
91
110
|
alt: setting.alt,
|
|
92
111
|
style: {
|
|
93
112
|
...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,
|
|
10
|
+
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyLoadImage = true, pageContext })=>{
|
|
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)}"
|
|
37
|
+
class="${core.cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
|
|
38
38
|
style="${{
|
|
39
39
|
...style,
|
|
40
40
|
...core.makeStyleResponsive('ta', styles?.align)
|
|
@@ -50,7 +50,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
50
50
|
style="${{
|
|
51
51
|
...core.getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
52
52
|
'border-radius': 'inherit',
|
|
53
|
-
overflow: 'hidden',
|
|
54
53
|
...core.makeStyleResponsive('jc', styles?.align)
|
|
55
54
|
}}"
|
|
56
55
|
>
|
|
@@ -77,7 +76,8 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
77
76
|
aspectRatio: core.getAspectRatioGlobalSize(styles?.shape),
|
|
78
77
|
layout: styles?.objectFit,
|
|
79
78
|
priority: setting?.priority,
|
|
80
|
-
|
|
79
|
+
enableLazyLoadImage,
|
|
80
|
+
pageContext
|
|
81
81
|
}) : NextImage_liquid.default({
|
|
82
82
|
...setting?.image,
|
|
83
83
|
priority: setting?.priority,
|
|
@@ -106,7 +106,8 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
106
106
|
layout: styles?.objectFit
|
|
107
107
|
},
|
|
108
108
|
isNotLazyload,
|
|
109
|
-
|
|
109
|
+
enableLazyLoadImage,
|
|
110
|
+
pageContext
|
|
110
111
|
})}
|
|
111
112
|
</${WrapLink}>
|
|
112
113
|
</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, enableLazyLoadImage = true, 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({
|
|
@@ -97,12 +97,13 @@ 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 &&
|
|
100
|
+
gp_lazyload: !customLazyload && enableLazyLoadImage,
|
|
101
|
+
gp_force_load: pageContext?.isOptimizePlan
|
|
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,
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var AdaptiveImage = require('./AdaptiveImage.js');
|
|
7
|
+
|
|
8
|
+
const NoDataImage = ({ style })=>{
|
|
9
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10
|
+
className: "gp-w-full gp-h-full gp-bg-[#F9F9F9] gp-flex gp-items-center gp-justify-center",
|
|
11
|
+
children: [
|
|
12
|
+
AdaptiveImage.default({
|
|
13
|
+
pictureClass: 'gp-w-full',
|
|
14
|
+
srcSet: {
|
|
15
|
+
desktop: {
|
|
16
|
+
src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
style: {
|
|
20
|
+
...style,
|
|
21
|
+
'--op': 0,
|
|
22
|
+
'--z': -1
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
26
|
+
className: "gp-absolute gp-flex gp-justify-center gp-items-center",
|
|
27
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
28
|
+
width: "40",
|
|
29
|
+
height: "40",
|
|
30
|
+
viewBox: "0 0 40 40",
|
|
31
|
+
fill: "none",
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ jsxRuntime.jsxs("g", {
|
|
35
|
+
clipPath: "url(#clip0_942_39561)",
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
38
|
+
width: "40",
|
|
39
|
+
height: "40",
|
|
40
|
+
fill: "#F9F9F9"
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
43
|
+
x: "4",
|
|
44
|
+
width: "32",
|
|
45
|
+
height: "40",
|
|
46
|
+
rx: "2",
|
|
47
|
+
fill: "#E2E2E2"
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
50
|
+
y: "26",
|
|
51
|
+
width: "40",
|
|
52
|
+
height: "14",
|
|
53
|
+
fill: "url(#paint0_linear_942_39561)"
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
56
|
+
x: "8",
|
|
57
|
+
y: "4",
|
|
58
|
+
width: "24",
|
|
59
|
+
height: "24",
|
|
60
|
+
rx: "1",
|
|
61
|
+
fill: "#F9F9F9"
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ jsxRuntime.jsx("circle", {
|
|
64
|
+
cx: "15.2809",
|
|
65
|
+
cy: "11.3688",
|
|
66
|
+
r: "1.36884",
|
|
67
|
+
fill: "#D2D2D2"
|
|
68
|
+
}),
|
|
69
|
+
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
70
|
+
d: "M13.1916 17.7343L15.3456 15.0797C15.4185 14.9896 15.5086 14.9168 15.6101 14.8659C15.7115 14.815 15.822 14.7872 15.9343 14.7844C16.0466 14.7815 16.1583 14.8036 16.2619 14.8492C16.3656 14.8949 16.459 14.963 16.536 15.0492L17.5432 16.1758L21.4803 11.2146C21.5573 11.1174 21.6542 11.0397 21.7637 10.9874C21.8732 10.9351 21.9925 10.9094 22.1127 10.9123C22.2329 10.9153 22.3509 10.9467 22.458 11.0043C22.5651 11.0619 22.6585 11.1442 22.7312 11.245L27.4383 17.7671C27.5283 17.8921 27.5834 18.0411 27.5974 18.1973C27.6114 18.3535 27.5838 18.5108 27.5176 18.6513C27.4514 18.7919 27.3493 18.9102 27.2228 18.993C27.0963 19.0758 26.9503 19.1198 26.8014 19.12L13.8002 19.1251C13.6473 19.1251 13.4975 19.0789 13.3688 18.992C13.24 18.9051 13.1375 18.7812 13.0735 18.6348C13.0095 18.4885 12.9866 18.326 13.0075 18.1664C13.0285 18.0068 13.0923 17.8569 13.1916 17.7343Z",
|
|
71
|
+
fill: "#D2D2D2"
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
74
|
+
x: "24.3333",
|
|
75
|
+
y: "24.3333",
|
|
76
|
+
width: "15.3333",
|
|
77
|
+
height: "15.3333",
|
|
78
|
+
rx: "7.66667",
|
|
79
|
+
fill: "white"
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
82
|
+
x: "24.3333",
|
|
83
|
+
y: "24.3333",
|
|
84
|
+
width: "15.3333",
|
|
85
|
+
height: "15.3333",
|
|
86
|
+
rx: "7.66667",
|
|
87
|
+
stroke: "#C4C4C4",
|
|
88
|
+
strokeWidth: "0.666667"
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
91
|
+
d: "M33.813 34.5199C34.0083 34.7152 34.3249 34.7152 34.5201 34.5199C34.7154 34.3246 34.7154 34.0081 34.5201 33.8128L32.707 31.9997L34.5201 30.1866C34.7154 29.9913 34.7154 29.6747 34.5201 29.4795C34.3249 29.2842 34.0083 29.2842 33.813 29.4795L31.9999 31.2926L30.1868 29.4795C29.9915 29.2842 29.675 29.2842 29.4797 29.4795C29.2844 29.6747 29.2844 29.9913 29.4797 30.1866L31.2928 31.9997L29.4797 33.8128C29.2844 34.0081 29.2844 34.3246 29.4797 34.5199C29.675 34.7152 29.9915 34.7152 30.1868 34.5199L31.9999 32.7068L33.813 34.5199Z",
|
|
92
|
+
fill: "#676767"
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
}),
|
|
96
|
+
/*#__PURE__*/ jsxRuntime.jsxs("defs", {
|
|
97
|
+
children: [
|
|
98
|
+
/*#__PURE__*/ jsxRuntime.jsxs("linearGradient", {
|
|
99
|
+
id: "paint0_linear_942_39561",
|
|
100
|
+
x1: "20",
|
|
101
|
+
y1: "26",
|
|
102
|
+
x2: "20",
|
|
103
|
+
y2: "40",
|
|
104
|
+
gradientUnits: "userSpaceOnUse",
|
|
105
|
+
children: [
|
|
106
|
+
/*#__PURE__*/ jsxRuntime.jsx("stop", {
|
|
107
|
+
stopColor: "#F9F9F9",
|
|
108
|
+
stopOpacity: "0"
|
|
109
|
+
}),
|
|
110
|
+
/*#__PURE__*/ jsxRuntime.jsx("stop", {
|
|
111
|
+
offset: "1",
|
|
112
|
+
stopColor: "#F9F9F9"
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ jsxRuntime.jsx("clipPath", {
|
|
117
|
+
id: "clip0_942_39561",
|
|
118
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("rect", {
|
|
119
|
+
width: "40",
|
|
120
|
+
height: "40",
|
|
121
|
+
fill: "white"
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
exports.default = NoDataImage;
|
|
@@ -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, 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, enableLazyLoadImage, 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,7 +271,9 @@ const CompareImage = (props)=>{
|
|
|
271
271
|
style: {
|
|
272
272
|
...initStyles.rightImage,
|
|
273
273
|
...core.makeStyleResponsive('objf', styles?.imageScale)
|
|
274
|
-
}
|
|
274
|
+
},
|
|
275
|
+
enableLazyLoadImage,
|
|
276
|
+
pageContext
|
|
275
277
|
})}
|
|
276
278
|
${NextImage_liquid.default({
|
|
277
279
|
customAttrs: {
|
|
@@ -287,7 +289,9 @@ const CompareImage = (props)=>{
|
|
|
287
289
|
style: {
|
|
288
290
|
...initStyles.rightImage,
|
|
289
291
|
...core.makeStyleResponsive('objf', styles?.imageScale)
|
|
290
|
-
}
|
|
292
|
+
},
|
|
293
|
+
enableLazyLoadImage,
|
|
294
|
+
pageContext
|
|
291
295
|
})}
|
|
292
296
|
<div id="image-comparison-slider-${componentUid}" style="${{
|
|
293
297
|
...initStyles.slider
|
package/dist/cjs/index.js
CHANGED
|
@@ -207,8 +207,18 @@ var TrustreviewsProductReviews = require('./third-party/components/TrustreviewsP
|
|
|
207
207
|
var MyappgurusProductReviews = require('./third-party/components/MyappgurusProductReviews.js');
|
|
208
208
|
var HulkProductOptions = require('./third-party/components/HulkProductOptions.js');
|
|
209
209
|
var TrustshopProductReviews = require('./third-party/components/TrustshopProductReviews.js');
|
|
210
|
+
var StellarDeliveryDatePickup = require('./third-party/components/StellarDeliveryDatePickup.js');
|
|
211
|
+
var EssentialCountdownTimerBar = require('./third-party/components/EssentialCountdownTimerBar.js');
|
|
212
|
+
var EssentialAnnouncementBar = require('./third-party/components/EssentialAnnouncementBar.js');
|
|
213
|
+
var OkendoReviewsLoyalty = require('./third-party/components/OkendoReviewsLoyalty.js');
|
|
214
|
+
var EstimatedDeliveryDatePlus = require('./third-party/components/EstimatedDeliveryDatePlus.js');
|
|
210
215
|
var HextomCountdownTimerBar = require('./third-party/components/HextomCountdownTimerBar.js');
|
|
211
216
|
var TrustBadgesBear = require('./third-party/components/TrustBadgesBear.js');
|
|
217
|
+
var TrustedsiteTrustBadges = require('./third-party/components/TrustedsiteTrustBadges.js');
|
|
218
|
+
var GloColorSwatchvariantImage = require('./third-party/components/GloColorSwatchvariantImage.js');
|
|
219
|
+
var BfSizeChartSizeGuide = require('./third-party/components/BfSizeChartSizeGuide.js');
|
|
220
|
+
var AlsoBoughtCbb = require('./third-party/components/AlsoBoughtCbb.js');
|
|
221
|
+
var HextomFreeShippingBar = require('./third-party/components/HextomFreeShippingBar.js');
|
|
212
222
|
var index$x = require('./third-party-instant/setting/index.js');
|
|
213
223
|
var InstantJudgemeReviews = require('./third-party-instant/components/InstantJudgemeReviews.js');
|
|
214
224
|
var InstantLooxReviews = require('./third-party-instant/components/InstantLooxReviews.js');
|
|
@@ -511,8 +521,18 @@ exports.TrustreviewsProductReviews = TrustreviewsProductReviews.default;
|
|
|
511
521
|
exports.MyappgurusProductReviews = MyappgurusProductReviews.default;
|
|
512
522
|
exports.HulkProductOptions = HulkProductOptions.default;
|
|
513
523
|
exports.TrustshopProductReviews = TrustshopProductReviews.default;
|
|
524
|
+
exports.StellarDeliveryDatePickup = StellarDeliveryDatePickup.default;
|
|
525
|
+
exports.EssentialCountdownTimerBar = EssentialCountdownTimerBar.default;
|
|
526
|
+
exports.EssentialAnnouncementBar = EssentialAnnouncementBar.default;
|
|
527
|
+
exports.OkendoReviewsLoyalty = OkendoReviewsLoyalty.default;
|
|
528
|
+
exports.EstimatedDeliveryDatePlus = EstimatedDeliveryDatePlus.default;
|
|
514
529
|
exports.HextomCountdownTimerBar = HextomCountdownTimerBar.default;
|
|
515
530
|
exports.TrustBadgesBear = TrustBadgesBear.default;
|
|
531
|
+
exports.TrustedsiteTrustBadges = TrustedsiteTrustBadges.default;
|
|
532
|
+
exports.GloColorSwatchvariantImage = GloColorSwatchvariantImage.default;
|
|
533
|
+
exports.BfSizeChartSizeGuide = BfSizeChartSizeGuide.default;
|
|
534
|
+
exports.AlsoBoughtCbb = AlsoBoughtCbb.default;
|
|
535
|
+
exports.HextomFreeShippingBar = HextomFreeShippingBar.default;
|
|
516
536
|
exports.thirdPartyInstantSetting = index$x.default;
|
|
517
537
|
exports.InstantJudgemeReviews = InstantJudgemeReviews.default;
|
|
518
538
|
exports.InstantLooxReviews = InstantLooxReviews.default;
|
package/dist/cjs/index.liquid.js
CHANGED
|
@@ -161,9 +161,19 @@ var SeoantTrustBadgesIcon_liquid = require('./third-party/components/SeoantTrust
|
|
|
161
161
|
var TrustreviewsProductReviews_liquid = require('./third-party/components/TrustreviewsProductReviews.liquid.js');
|
|
162
162
|
var MyappgurusProductReviews_liquid = require('./third-party/components/MyappgurusProductReviews.liquid.js');
|
|
163
163
|
var HulkProductOptions_liquid = require('./third-party/components/HulkProductOptions.liquid.js');
|
|
164
|
+
var TrustshopProductReviews_liquid = require('./third-party/components/TrustshopProductReviews.liquid.js');
|
|
165
|
+
var StellarDeliveryDatePickup_liquid = require('./third-party/components/StellarDeliveryDatePickup.liquid.js');
|
|
166
|
+
var EssentialCountdownTimerBar_liquid = require('./third-party/components/EssentialCountdownTimerBar.liquid.js');
|
|
167
|
+
var EssentialAnnouncementBar_liquid = require('./third-party/components/EssentialAnnouncementBar.liquid.js');
|
|
168
|
+
var OkendoReviewsLoyalty_liquid = require('./third-party/components/OkendoReviewsLoyalty.liquid.js');
|
|
169
|
+
var EstimatedDeliveryDatePlus_liquid = require('./third-party/components/EstimatedDeliveryDatePlus.liquid.js');
|
|
164
170
|
var HextomCountdownTimerBar_liquid = require('./third-party/components/HextomCountdownTimerBar.liquid.js');
|
|
165
171
|
var TrustBadgesBear_liquid = require('./third-party/components/TrustBadgesBear.liquid.js');
|
|
166
|
-
var
|
|
172
|
+
var TrustedsiteTrustBadges_liquid = require('./third-party/components/TrustedsiteTrustBadges.liquid.js');
|
|
173
|
+
var GloColorSwatchvariantImage_liquid = require('./third-party/components/GloColorSwatchvariantImage.liquid.js');
|
|
174
|
+
var BfSizeChartSizeGuide_liquid = require('./third-party/components/BfSizeChartSizeGuide.liquid.js');
|
|
175
|
+
var AlsoBoughtCbb_liquid = require('./third-party/components/AlsoBoughtCbb.liquid.js');
|
|
176
|
+
var HextomFreeShippingBar_liquid = require('./third-party/components/HextomFreeShippingBar.liquid.js');
|
|
167
177
|
var ImageComparison_liquid = require('./image-comparison/components/ImageComparison.liquid.js');
|
|
168
178
|
var ThirdPartySlot_liquid = require('./third-party-slot/components/ThirdPartySlot.liquid.js');
|
|
169
179
|
var Sticky_liquid = require('./sticky/components/Sticky.liquid.js');
|
|
@@ -347,9 +357,19 @@ exports.SeoantTrustBadgesIcon = SeoantTrustBadgesIcon_liquid.default;
|
|
|
347
357
|
exports.TrustreviewsProductReviews = TrustreviewsProductReviews_liquid.default;
|
|
348
358
|
exports.MyappgurusProductReviews = MyappgurusProductReviews_liquid.default;
|
|
349
359
|
exports.HulkProductOptions = HulkProductOptions_liquid.default;
|
|
360
|
+
exports.TrustshopProductReviews = TrustshopProductReviews_liquid.default;
|
|
361
|
+
exports.StellarDeliveryDatePickup = StellarDeliveryDatePickup_liquid.default;
|
|
362
|
+
exports.EssentialCountdownTimerBar = EssentialCountdownTimerBar_liquid.default;
|
|
363
|
+
exports.EssentialAnnouncementBar = EssentialAnnouncementBar_liquid.default;
|
|
364
|
+
exports.OkendoReviewsLoyalty = OkendoReviewsLoyalty_liquid.default;
|
|
365
|
+
exports.EstimatedDeliveryDatePlus = EstimatedDeliveryDatePlus_liquid.default;
|
|
350
366
|
exports.HextomCountdownTimerBar = HextomCountdownTimerBar_liquid.default;
|
|
351
367
|
exports.TrustBadgesBear = TrustBadgesBear_liquid.default;
|
|
352
|
-
exports.
|
|
368
|
+
exports.TrustedsiteTrustBadges = TrustedsiteTrustBadges_liquid.default;
|
|
369
|
+
exports.GloColorSwatchvariantImage = GloColorSwatchvariantImage_liquid.default;
|
|
370
|
+
exports.BfSizeChartSizeGuide = BfSizeChartSizeGuide_liquid.default;
|
|
371
|
+
exports.AlsoBoughtCbb = AlsoBoughtCbb_liquid.default;
|
|
372
|
+
exports.HextomFreeShippingBar = HextomFreeShippingBar_liquid.default;
|
|
353
373
|
exports.ImageComparison = ImageComparison_liquid.default;
|
|
354
374
|
exports.ThirdPartySlot = ThirdPartySlot_liquid.default;
|
|
355
375
|
exports.Sticky = Sticky_liquid.default;
|
|
@@ -5,26 +5,29 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var core = require('@gem-sdk/core');
|
|
7
7
|
var Text = require('../../text/Text.js');
|
|
8
|
+
var useDynamicProduct = require('../hooks/useDynamicProduct.js');
|
|
8
9
|
|
|
9
10
|
const PostPurchaseProductDiscountTag = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
|
|
10
11
|
const currentProduct = core.useProduct();
|
|
11
12
|
const currentProductId = currentProduct?.baseID?.replace('gid://shopify/Product/', '');
|
|
12
13
|
const currentOfferDiscount = core.useProductOfferDiscount();
|
|
14
|
+
const { isDynamicProduct, isEnableDynamicDiscount } = useDynamicProduct.useDynamicProduct();
|
|
13
15
|
const { typo } = styles;
|
|
14
16
|
const { message } = setting;
|
|
17
|
+
const hasDiscount = !!currentOfferDiscount || isDynamicProduct && isEnableDynamicDiscount;
|
|
15
18
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16
19
|
...builderAttrs,
|
|
17
20
|
className: core.cls(builderProps?.uid, 'gp-flex gp-w-full'),
|
|
18
21
|
style: {
|
|
19
22
|
...style,
|
|
20
|
-
opacity:
|
|
23
|
+
opacity: hasDiscount ? 1 : 0.2
|
|
21
24
|
},
|
|
22
25
|
id: `shopify-text-element-${builderProps?.uid}`,
|
|
23
26
|
"data-product-id": currentProductId,
|
|
24
27
|
children: [
|
|
25
28
|
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
26
29
|
setting: {
|
|
27
|
-
text:
|
|
30
|
+
text: hasDiscount ? message : message?.replace(new RegExp(/\{\{Discount\}\}/, 'gi'), '0%')
|
|
28
31
|
},
|
|
29
32
|
styles: {
|
|
30
33
|
typo
|
|
@@ -11,14 +11,20 @@ var Loading = require('../../../common/components/Loading.js');
|
|
|
11
11
|
var ProductVariant = require('./ProductVariant.js');
|
|
12
12
|
var helper = require('../../utils/helper.js');
|
|
13
13
|
var index = require('../helpers/index.js');
|
|
14
|
+
var ProductOfferPlaceholder = require('../constants/ProductOfferPlaceholder.js');
|
|
15
|
+
var useDynamicProduct = require('../hooks/useDynamicProduct.js');
|
|
14
16
|
|
|
15
17
|
const PostPurchaseProductOffer = ({ styles, builderAttrs, builderProps, children, setting })=>{
|
|
16
18
|
const mode = core.useEditorMode();
|
|
17
|
-
const { productSetting, productOfferLayout, inlineAlignment, ...rowSetting } = setting || {};
|
|
19
|
+
const { productSetting, productOfferLayout, inlineAlignment, discountAndShippingFee, ...rowSetting } = setting || {};
|
|
18
20
|
const { productOfferColumnGap, productOfferVerticalGutter, productOfferWidth, ...rowStyles } = styles || {};
|
|
19
21
|
const productOffers = core.usePageStore((s)=>s.productOffers);
|
|
20
22
|
const publicStoreFrontData = core.usePageStore((s)=>s.publicStoreFrontData);
|
|
21
|
-
const
|
|
23
|
+
const { isDynamicProduct } = useDynamicProduct.useDynamicProduct();
|
|
24
|
+
const dynamicDiscountOffer = core.usePageStore((s)=>s.dynamicDiscountOffer);
|
|
25
|
+
const totalProduct = React.useMemo(()=>isDynamicProduct ? dynamicDiscountOffer?.appliedProductCount : productOffers?.length, [
|
|
26
|
+
dynamicDiscountOffer?.appliedProductCount,
|
|
27
|
+
isDynamicProduct,
|
|
22
28
|
productOffers?.length
|
|
23
29
|
]);
|
|
24
30
|
const sortedProductBaseIDs = React.useMemo(()=>{
|
|
@@ -44,7 +50,14 @@ const PostPurchaseProductOffer = ({ styles, builderAttrs, builderProps, children
|
|
|
44
50
|
const products = React.useMemo(()=>core.flattenConnection(productData.data?.products), [
|
|
45
51
|
productData.data?.products
|
|
46
52
|
]);
|
|
47
|
-
const productSortedById =
|
|
53
|
+
const productSortedById = React.useMemo(()=>{
|
|
54
|
+
return isDynamicProduct && dynamicDiscountOffer?.appliedProductCount ? Array(dynamicDiscountOffer.appliedProductCount).fill(ProductOfferPlaceholder.productOfferPlaceholder) : sortedProductBaseIDs?.map((id)=>products?.find((el)=>el?.baseID === id)).filter(Boolean);
|
|
55
|
+
}, [
|
|
56
|
+
isDynamicProduct,
|
|
57
|
+
dynamicDiscountOffer?.appliedProductCount,
|
|
58
|
+
sortedProductBaseIDs,
|
|
59
|
+
products
|
|
60
|
+
]);
|
|
48
61
|
const getStyles = ()=>{
|
|
49
62
|
return {
|
|
50
63
|
...core.makeStyleResponsive('cg', productOfferColumnGap),
|