@gem-sdk/components 23.1.3 → 24.0.0-dev.8
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/ArticleImage.js +1 -1
- package/dist/cjs/article/components/ArticleImage.liquid.js +6 -6
- package/dist/cjs/article/components/ArticleList.js +1 -1
- package/dist/cjs/article/index.js +1 -1
- package/dist/cjs/article/settings/configs/article-image/settings.js +1 -1
- package/dist/cjs/article/settings/configs/article-image/ui-v2.js +1 -1
- package/dist/cjs/button/common/helpers.js +2 -2
- package/dist/cjs/cart/components/CartList.js +1 -1
- package/dist/cjs/cart/index.js +1 -1
- package/dist/cjs/collection/index.js +1 -1
- package/dist/cjs/common/components/Loading.js +1 -1
- package/dist/cjs/common/const.js +1 -1
- package/dist/cjs/common/helpers.js +1 -0
- package/dist/cjs/common/hooks/useElementWidth.js +1 -0
- package/dist/cjs/common/hooks/useLoadingProgress.js +1 -0
- package/dist/cjs/grid/components/row/Row.liquid.js +12 -12
- package/dist/cjs/grid/components/section/Section.js +1 -1
- package/dist/cjs/grid/index.js +1 -1
- package/dist/cjs/header/components/kind/basic/index.js +1 -1
- package/dist/cjs/header/components/kind/modern/index.js +1 -1
- package/dist/cjs/header/index.js +1 -1
- package/dist/cjs/hero-banner/common/styles.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBannerItem.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBannerItem.liquid.js +5 -5
- package/dist/cjs/hero-banner/index.js +1 -1
- package/dist/cjs/image/common/adaptiveSources.js +1 -0
- package/dist/cjs/image/common/attrs.js +1 -1
- package/dist/cjs/image/common/classes.js +1 -1
- package/dist/cjs/image/common/helpers.js +2 -2
- package/dist/cjs/image/common/liquidSrcset.js +1 -0
- package/dist/cjs/image/common/listContext.js +1 -0
- package/dist/cjs/image/common/listImageContext.js +1 -0
- package/dist/cjs/image/common/sizes.js +1 -0
- package/dist/cjs/image/common/srcset.js +1 -0
- package/dist/cjs/image/components/AdaptiveImage.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +10 -12
- package/dist/cjs/image/components/Image.js +1 -1
- package/dist/cjs/image/components/Image.liquid.js +10 -10
- package/dist/cjs/image/components/NextImage.js +1 -1
- package/dist/cjs/image/components/NextImage.liquid.js +4 -5
- package/dist/cjs/image/constants.js +1 -1
- package/dist/cjs/image/index.js +1 -1
- package/dist/cjs/image/settings/configs/settings.js +1 -1
- package/dist/cjs/image/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/image-comparison/common/attrs.js +1 -1
- package/dist/cjs/image-comparison/components/CompareImage.js +1 -1
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +14 -14
- package/dist/cjs/image-comparison/components/ImageComparison.liquid.js +3 -3
- package/dist/cjs/image-comparison/index.js +1 -1
- package/dist/cjs/image-comparison/settings/configs/settings.js +1 -1
- package/dist/cjs/image-comparison/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/post-purchase/callout-banner/index.js +1 -1
- package/dist/cjs/post-purchase/product/components/ProductPrice.js +1 -1
- package/dist/cjs/post-purchase/product/components/ProductQuantity.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-offer/helpers/getOfferErrorText.js +1 -0
- package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +1 -1
- package/dist/cjs/post-purchase/product/hooks/useHandleQuantity.js +1 -1
- package/dist/cjs/post-purchase/product/index.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/dist/cjs/product/components/product-badge/ProductBadge.js +1 -1
- package/dist/cjs/product/components/product-badge/common/styles.js +1 -1
- package/dist/cjs/product/components/product-bundle/ProductBundleDiscount.js +1 -1
- package/dist/cjs/product/components/product-bundle/ProductBundleDiscountWarning.js +2 -0
- package/dist/cjs/product/components/product-bundle/common/classes.js +1 -1
- package/dist/cjs/product/components/product-bundle/hooks/useProductBundleDataState.js +3 -3
- package/dist/cjs/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
- package/dist/cjs/product/components/product-discount-tag/common/helpers.js +1 -0
- package/dist/cjs/product/components/product-images/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-images-v2/common/common.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/child/ProductGalleryGrid.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +41 -41
- package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +13 -13
- package/dist/cjs/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +23 -23
- package/dist/cjs/product/components/product-images-v2/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +3 -3
- package/dist/cjs/product/components/product-images-v3/common/common.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/child/ProductGalleryGrid.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +40 -40
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +40 -40
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +12 -12
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +12 -12
- package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +23 -23
- package/dist/cjs/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-list/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListCarouselLayout.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListCarouselLayout.liquid.js +9 -7
- package/dist/cjs/product/components/product-list/ProductListGridLayout.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListGridLayout.liquid.js +16 -14
- package/dist/cjs/product/components/product-list/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-list/common/imagePriority.js +17 -0
- package/dist/cjs/product/components/product-list/common/imagePriorityHints.js +1 -0
- package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +11 -9
- package/dist/cjs/product/components/product-list-v3/ProductListGridLayout.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListGridLayout.liquid.js +16 -14
- package/dist/cjs/product/components/product-price/hooks/useGpPrice.js +1 -1
- package/dist/cjs/product/components/product-wrap/Product.js +1 -1
- package/dist/cjs/product/components/product-wrap/hook/useProductSetting.js +1 -1
- package/dist/cjs/product/helpers/product-bundle.js +1 -1
- package/dist/cjs/product/index.js +1 -1
- package/dist/cjs/product/settings/product-image-v2/configs/setting-v2/index.js +1 -1
- package/dist/cjs/product/settings/product-image-v2/configs/ui-v2.js +1 -1
- package/dist/cjs/product/settings/product-image-v3/configs/setting-v2/index.js +1 -1
- package/dist/cjs/product/settings/product-image-v3/configs/ui-v2.js +1 -1
- package/dist/cjs/stock-counter/common/attrs.js +1 -1
- package/dist/cjs/stock-counter/common/helpers.js +23 -23
- package/dist/cjs/stock-counter/hooks/useStockCounter.js +1 -1
- package/dist/cjs/third-party/components/KlarnaMessaging.liquid.js +29 -4
- package/dist/cjs/video/common/attrs.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.liquid.js +11 -11
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +11 -11
- package/dist/cjs/video/components/LiteYouTubeEmbed.js +1 -1
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +11 -11
- package/dist/cjs/video/components/Video.liquid.js +1 -1
- package/dist/esm/article/components/ArticleImage.js +1 -1
- package/dist/esm/article/components/ArticleImage.liquid.js +7 -7
- package/dist/esm/article/components/ArticleList.js +1 -1
- package/dist/esm/article/index.js +1 -1
- package/dist/esm/article/settings/configs/article-image/settings.js +1 -1
- package/dist/esm/article/settings/configs/article-image/ui-v2.js +1 -1
- package/dist/esm/button/common/helpers.js +2 -2
- package/dist/esm/cart/components/CartList.js +1 -1
- package/dist/esm/cart/index.js +1 -1
- package/dist/esm/collection/index.js +1 -1
- package/dist/esm/common/components/Loading.js +1 -1
- package/dist/esm/common/const.js +1 -1
- package/dist/esm/common/helpers.js +1 -0
- package/dist/esm/common/hooks/useElementWidth.js +1 -0
- package/dist/esm/common/hooks/useLoadingProgress.js +1 -0
- package/dist/esm/grid/components/row/Row.liquid.js +10 -10
- package/dist/esm/grid/components/section/Section.js +1 -1
- package/dist/esm/grid/index.js +1 -1
- package/dist/esm/header/components/kind/basic/index.js +1 -1
- package/dist/esm/header/components/kind/modern/index.js +1 -1
- package/dist/esm/header/index.js +1 -1
- package/dist/esm/hero-banner/common/styles.js +1 -1
- package/dist/esm/hero-banner/components/HeroBannerItem.js +1 -1
- package/dist/esm/hero-banner/components/HeroBannerItem.liquid.js +10 -10
- package/dist/esm/hero-banner/index.js +1 -1
- package/dist/esm/image/common/adaptiveSources.js +1 -0
- package/dist/esm/image/common/attrs.js +1 -1
- package/dist/esm/image/common/classes.js +1 -1
- package/dist/esm/image/common/helpers.js +2 -2
- package/dist/esm/image/common/liquidSrcset.js +1 -0
- package/dist/esm/image/common/listContext.js +1 -0
- package/dist/esm/image/common/listImageContext.js +1 -0
- package/dist/esm/image/common/sizes.js +1 -0
- package/dist/esm/image/common/srcset.js +1 -0
- package/dist/esm/image/components/AdaptiveImage.js +1 -1
- package/dist/esm/image/components/AdaptiveImage.liquid.js +11 -13
- package/dist/esm/image/components/Image.js +1 -1
- package/dist/esm/image/components/Image.liquid.js +3 -3
- package/dist/esm/image/components/NextImage.js +1 -1
- package/dist/esm/image/components/NextImage.liquid.js +5 -6
- package/dist/esm/image/constants.js +1 -1
- package/dist/esm/image/index.js +1 -1
- package/dist/esm/image/settings/configs/settings.js +1 -1
- package/dist/esm/image/settings/configs/ui-v2.js +1 -1
- package/dist/esm/image-comparison/common/attrs.js +1 -1
- package/dist/esm/image-comparison/components/CompareImage.js +1 -1
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +17 -17
- package/dist/esm/image-comparison/components/ImageComparison.liquid.js +3 -3
- package/dist/esm/image-comparison/index.js +1 -1
- package/dist/esm/image-comparison/settings/configs/settings.js +1 -1
- package/dist/esm/image-comparison/settings/configs/ui-v2.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/post-purchase/callout-banner/index.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductPrice.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductQuantity.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/helpers/getOfferErrorText.js +1 -0
- package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +1 -1
- package/dist/esm/post-purchase/product/hooks/useHandleQuantity.js +1 -1
- package/dist/esm/post-purchase/product/index.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/dist/esm/product/components/product-badge/ProductBadge.js +1 -1
- package/dist/esm/product/components/product-badge/common/styles.js +1 -1
- package/dist/esm/product/components/product-bundle/ProductBundleDiscount.js +1 -1
- package/dist/esm/product/components/product-bundle/ProductBundleDiscountWarning.js +2 -0
- package/dist/esm/product/components/product-bundle/common/classes.js +1 -1
- package/dist/esm/product/components/product-bundle/hooks/useProductBundleDataState.js +3 -3
- package/dist/esm/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
- package/dist/esm/product/components/product-discount-tag/common/helpers.js +1 -0
- package/dist/esm/product/components/product-images/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-images-v2/common/common.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/child/ProductGalleryGrid.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +35 -35
- package/dist/esm/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +13 -13
- package/dist/esm/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +29 -29
- package/dist/esm/product/components/product-images-v2/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +3 -3
- package/dist/esm/product/components/product-images-v3/common/common.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/child/ProductGalleryGrid.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +24 -24
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +24 -24
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +5 -5
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +5 -5
- package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +30 -30
- package/dist/esm/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-list/ProductList.js +1 -1
- package/dist/esm/product/components/product-list/ProductListCarouselLayout.js +1 -1
- package/dist/esm/product/components/product-list/ProductListCarouselLayout.liquid.js +11 -9
- package/dist/esm/product/components/product-list/ProductListGridLayout.js +1 -1
- package/dist/esm/product/components/product-list/ProductListGridLayout.liquid.js +18 -16
- package/dist/esm/product/components/product-list/common/helpers.js +1 -1
- package/dist/esm/product/components/product-list/common/imagePriority.js +17 -0
- package/dist/esm/product/components/product-list/common/imagePriorityHints.js +1 -0
- package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +12 -10
- package/dist/esm/product/components/product-list-v3/ProductListGridLayout.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListGridLayout.liquid.js +18 -16
- package/dist/esm/product/components/product-price/hooks/useGpPrice.js +1 -1
- package/dist/esm/product/components/product-wrap/Product.js +1 -1
- package/dist/esm/product/components/product-wrap/hook/useProductSetting.js +1 -1
- package/dist/esm/product/helpers/product-bundle.js +1 -1
- package/dist/esm/product/index.js +1 -1
- package/dist/esm/product/settings/product-image-v2/configs/setting-v2/index.js +1 -1
- package/dist/esm/product/settings/product-image-v2/configs/ui-v2.js +1 -1
- package/dist/esm/product/settings/product-image-v3/configs/setting-v2/index.js +1 -1
- package/dist/esm/product/settings/product-image-v3/configs/ui-v2.js +1 -1
- package/dist/esm/stock-counter/common/attrs.js +1 -1
- package/dist/esm/stock-counter/common/helpers.js +21 -21
- package/dist/esm/stock-counter/components/StockCounter.liquid.js +1 -1
- package/dist/esm/stock-counter/hooks/useStockCounter.js +1 -1
- package/dist/esm/third-party/components/KlarnaMessaging.liquid.js +30 -5
- package/dist/esm/video/common/attrs.js +1 -1
- package/dist/esm/video/components/HTML5Embed.js +1 -1
- package/dist/esm/video/components/HTML5Embed.liquid.js +8 -8
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +11 -11
- package/dist/esm/video/components/LiteYouTubeEmbed.js +1 -1
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +9 -9
- package/dist/esm/video/components/Video.liquid.js +1 -1
- package/dist/types/index.d.ts +26 -8
- package/package.json +11 -8
package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),i=require("../../composables/getProductImagesClassName.js"),
|
|
2
|
-
${
|
|
3
|
-
${m.If(
|
|
4
|
-
${
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),i=require("../../composables/getProductImagesClassName.js"),t=require("../../common/productFeaturedImage.js"),a=require("../../composables/getProductImagesStyles.js"),s=require("../../../../../image/common/liquidSrcset.js"),d=require("../../common/productGallery.js"),o=require("../../../../../video/components/HTML5Embed.liquid.js"),r=require("../../../../../image/components/NextImage.liquid.js"),l=require("../../../../../image/components/Modal3d.liquid.js"),m=require("@gem-sdk/system"),p=require("../../../../../image/components/Video.liquid.js"),u=require("../../../../helpers/function.js"),g=require("../../common/common.js");exports.default=({builderPropUID:c,wrapperStyle:n,children:y,pageContext:h,...f})=>{let{galleryItemClasses:C,galleryGridWrapperClasses:v}=i.getProductImagesClassName(f),{galleryGridStyles:q,galleryGridItemStyles:L}=a.getProductImagesStyles(f),w=d.getShapeByLayout({shape:f.shape,shapeForBottom:f.shapeForBottom,shapeFor1Col:f.shapeFor1Col,shapeFor2Col:f.shapeFor2Col,shapeForFtOnly:f.shapeForFtOnly,shapeForInsideBottom:f.shapeForInsideBottom,shapeForInside:f.shapeForInside},f.position),_=(i=!1)=>{let t={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(a=>{let s=e.getResponsiveValueByScreen(f?.position,a)||"",d="one-col"===s||"two-col"===s;t[a]=(i?!d:d)?"block":"none"}),e.makeStyleResponsive("d",t)},b=()=>_(),I=()=>_(!0),$=s.getLiquidImageSrcset({liquidSrc:"media.preview_image",sizeTarget:"ProductFeatureImage",qualityType:f.qualityType,qualityPercent:f.qualityPercent}),x=(i,a)=>e.template`
|
|
2
|
+
${r.default({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:$,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:i,style:a,className:"!gp-rounded-none"})}
|
|
3
|
+
${m.If(f?.galleryHoverEffect!=="none",`<div class="${e.cls("zoom-element !gp-max-w-none gp-w-full gp-h-full",t.getZoomImageClass())}">
|
|
4
|
+
${r.default({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:$,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:i,style:a,className:"!gp-rounded-none gp-w-full gp-h-full"})}
|
|
5
5
|
</div>`," ")}
|
|
6
|
-
${m.If(
|
|
6
|
+
${m.If(f?.galleryHoverEffect=="zoom"&&f?.galleryZoomType=="glasses",`<div class="${e.cls("zoom-lens-element",t.getZoomLenClass())}" style="opacity: 0; background-image: url('{{media.preview_image | product_img_url: '1024x1024'}}')">
|
|
7
7
|
</div>
|
|
8
8
|
`," ")}
|
|
9
|
-
|
|
9
|
+
`,S=()=>l.default({src:m.LiquidIf("media.sources.first.url contains '.glb'","{{ media.sources.first.url }}","{{media.sources.last.url}}"),alt:"{{media.preview_image.alt}}",poster:"{{media.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%",height:"100%"},aspectRatio:g.getAspectRatio(w)}),F=()=>p.default({src:"{{mediaSourceVideo}}",alt:"{{media.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"}}),j=()=>o.default({src:"{{mediaSourceVideo}}",title:"{{media.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{media.preview_image.src | product_img_url: '1024x1024'}}",thumbnailImage:{srcset:$&&m.LiquidIf("media.preview_image != blank",$)},poster:{altText:"{{media.alt | escape}}"},style:{width:"100%","max-height":"100%"}}),V=()=>e.template`
|
|
10
10
|
${m.LiquidIf("media.media_type == 'video' or media.media_type == 'external_video'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
|
|
11
11
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
12
|
<rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.7441 4.57034C11.9017 4.47655 12.098 4.47655 12.2555 4.57034L18.5889 8.33957C18.7404 8.42971 18.8332 8.59296 18.8332 8.76923V15.2308C18.8332 15.407 18.7404 15.5703 18.5889 15.6604L12.2555 19.4297C12.098 19.5234 11.9017 19.5234 11.7441 19.4297L5.41079 15.6604C5.25932 15.5703 5.1665 15.407 5.1665 15.2308V8.76923C5.1665 8.59296 5.25932 8.42971 5.41079 8.33957L11.7441 4.57034ZM6.1665 9.64865V14.9465L11.4998 18.1206V12.8227L6.1665 9.64865ZM12.4998 12.8227V18.1206L17.8332 14.9465V9.64865L12.4998 12.8227ZM17.3555 8.76923L11.9998 11.9566L6.64417 8.76923L11.9998 5.58185L17.3555 8.76923Z" fill="#F9F9F9"/>
|
|
20
20
|
</svg>
|
|
21
21
|
</div>`)}
|
|
22
|
-
${
|
|
22
|
+
${x({aspectRatio:g.getAspectRatio(w),layout:f?.layout,qualityType:f?.qualityType,qualityPercent:f?.qualityPercent},{width:"100%",height:"100%"})}
|
|
23
23
|
|
|
24
24
|
<div class="gp-absolute gp-inset-0 gp-flex gp-cursor-pointer gp-items-center gp-justify-center gp-bg-black/50 gp-opacity-0 gp-transition-opacity gp-duration-100 group-hover:gp-opacity-100"
|
|
25
|
-
style="${
|
|
25
|
+
style="${u.getStyleOfObject(d.getZoomDisplay(f?.clickOpenLightBox))}" >
|
|
26
26
|
<svg
|
|
27
27
|
height="100%"
|
|
28
28
|
width="100%"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
/>
|
|
40
40
|
</svg>
|
|
41
41
|
</div>
|
|
42
|
-
`,
|
|
42
|
+
`,k=i=>`
|
|
43
43
|
${m.LiquidIf("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
|
|
44
44
|
${m.LiquidIf("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}{% assign mediaSource = media | json %}")}
|
|
45
45
|
${m.LiquidIf("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
|
|
@@ -53,41 +53,41 @@
|
|
|
53
53
|
external-id="{{media.external_id}}"
|
|
54
54
|
grid-index="{{forloop.index}}"
|
|
55
55
|
data-outline="none"
|
|
56
|
-
class="${
|
|
57
|
-
style="${
|
|
56
|
+
class="${C(`gem-slider-item-${c}-{{product.id}} gp-gallery-image-item ${i??""} data-[outline=deactive]:after:!gp-border-transparent`)}"
|
|
57
|
+
style="${u.getStyleOfObject(L)}"
|
|
58
58
|
>
|
|
59
59
|
${m.LiquidIf("media.media_type == 'external_video' or media.media_type == 'video' or media.media_type == 'model'","{% assign isMedia = true %}")}
|
|
60
60
|
|
|
61
61
|
${m.LiquidIf("media.media_type == 'external_video' or media.media_type == 'video'","{% assign isVideo = true %}")}
|
|
62
62
|
|
|
63
|
-
<div class="gp-w-full" style="${m.LiquidIf("media == null or media.media_type == 'image'","display: block !important;")} ${m.LiquidIf("isVideo == true",
|
|
64
|
-
${m.LiquidIf("media != null",
|
|
63
|
+
<div class="gp-w-full" style="${m.LiquidIf("media == null or media.media_type == 'image'","display: block !important;")} ${m.LiquidIf("isVideo == true",u.getStyleOfObject({...I()}))}">
|
|
64
|
+
${m.LiquidIf("media != null",V(),M())}
|
|
65
65
|
</div>
|
|
66
66
|
|
|
67
67
|
<div class="${m.LiquidIf("isMedia","gp-flex gp-justify-center gp-items-center")}"
|
|
68
|
-
style="${m.LiquidIf("isMedia",
|
|
68
|
+
style="${m.LiquidIf("isMedia",u.getStyleOfObject({...e.makeStyleResponsive("aspect",g.getAspectRatio(w))}))} ${u.getStyleOfObject({...b()})}"
|
|
69
69
|
>
|
|
70
70
|
{% case media.media_type %}
|
|
71
71
|
{% when 'external_video' %}
|
|
72
72
|
{% assign mediaSourceVideo = media | external_video_url %}
|
|
73
|
-
${
|
|
73
|
+
${F()}
|
|
74
74
|
{% when 'video' %}
|
|
75
75
|
{% assign mediaSourceVideo = media.sources.last.url %}
|
|
76
|
-
${
|
|
76
|
+
${j()}
|
|
77
77
|
{% when 'model' %}
|
|
78
|
-
${
|
|
78
|
+
${S()}
|
|
79
79
|
{% endcase %}
|
|
80
80
|
</div>
|
|
81
81
|
{% assign isVideo= false %}
|
|
82
82
|
{% assign isMedia= false %}
|
|
83
|
-
</div>`,
|
|
84
|
-
${
|
|
83
|
+
</div>`,M=()=>e.template`
|
|
84
|
+
${r.default({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",setting:{aspectRatio:g.getAspectRatio(w),layout:f?.layout,qualityType:f?.qualityType,qualityPercent:f?.qualityPercent},className:"!gp-rounded-none"})}`;return m.Liquid(`
|
|
85
85
|
<div type="grid-gallery"
|
|
86
86
|
class="${v}"
|
|
87
|
-
style="${
|
|
87
|
+
style="${u.getStyleOfObject(q)}}"
|
|
88
88
|
>
|
|
89
89
|
${m.LiquidFor("media in product.media",`${m.LiquidIf("media.media_type == 'image'",m.LiquidFor("image in product.images",m.LiquidIf("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
|
|
90
|
-
${m.LiquidIf("media.id == product.featured_media.id ",
|
|
91
|
-
${m.LiquidIf("product.media.size > 0",
|
|
92
|
-
${m.LiquidIf("product.media.size < 1",
|
|
90
|
+
${m.LiquidIf("media.id == product.featured_media.id ",k(f?.borderActive?.border!=="none"?"active":""),k())}`)}
|
|
91
|
+
${m.LiquidIf("product.media.size > 0",y)}
|
|
92
|
+
${m.LiquidIf("product.media.size < 1",k())}
|
|
93
93
|
</div>`)};
|
package/dist/cjs/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../../carousel-v3/components/item/CarouselItem.js"),o=require("../../../../../carousel-v3/components/root/Carousel.js"),i=require("@gem-sdk/core"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../../carousel-v3/components/item/CarouselItem.js"),o=require("../../../../../carousel-v3/components/root/Carousel.js"),i=require("@gem-sdk/core"),s=require("../../common/productFeaturedImage.js"),l=require("../../../../../image/components/NextImage.js"),d=require("../child/ProductFeatureVideo.js");require("../../../../../modal/components/confirm.js");var r=require("../../../../../modal/components/Modal.js"),n=require("../child/MediaIcon.js"),a=require("react");const p={desktop:"finest"};exports.default=({builderPropUID:u,productImages:c,open:m,imageRatio:g,onHandleClose:h})=>{let b=i.useFeaturedImageGlobal(),j=a.useMemo(()=>{let e=c?.findIndex(e=>e.id===b?.id);return e&&e>0?e:0},[c,b]),f={desktop:c&&c.length>1,mobile:c&&c?.length>1,tablet:c&&c?.length>1},y=i.useEditorMode(),k=e=>"edit"!==y&&["VIDEO","EXTERNAL_VIDEO"].includes(e?.contentType||"");return e.jsx(r.default,{setting:{open:m},styles:{width:"80%"},closeOnClickOutside:!0,onClose:()=>{h(),console.log("onHandleClose")},disableIframeClickEvent:!0,contentClass:"mobile:!gp-w-[100%] gp-px-2 gp-pb-10",children:e.jsx(o.default,{setting:{loop:{desktop:!1,mobile:!1,tablet:!1},slidesToShow:{desktop:1,tablet:1,mobile:1},defaultCurrentSlider:j,dot:{desktop:!0,mobile:!0,tablet:!0},dotStyle:{desktop:"outside",mobile:"outside",tablet:"outside"},dotColor:{desktop:"#E2E2E2",mobile:"#E2E2E2",tablet:"#E2E2E2"},dotActiveColor:{desktop:"#121212",mobile:"#121212",tablet:"#121212"},dotSize:{desktop:12},dotGapToCarousel:{desktop:12},navigationEnable:f,navigationStyle:{desktop:"outside"},arrowIconSize:{desktop:24},initialSlide:j},styles:{sizeSetting:{desktop:{height:"80vh"},tablet:{height:"80vh"},mobile:{height:"60vh"}},playSpeed:0},moveToIdx:j,hiddenDotWhenOnlyOne:!0,isHiddenArrowWhenDisabled:!0,isDisableResetSlide:!0,builderProps:{uid:u},fullHeight:!0,children:c?.map(o=>e.jsx(t.default,{className:`gem-slider-item gem-slider-item-${u} gp-flex gp-items-center gp-justify-center gp-px-4`,children:k(o)?e.jsx(d.default,{type:o?.contentType,url:o.src??"",thumbnail:o?.previewImage,aspectRatio:g}):e.jsxs(e.Fragment,{children:[e.jsx(l.default,{src:s.isFeatureMedia(o?.contentType)?o?.previewImage:o?.src,width:o?.width,height:o?.height,alt:o?.alt,"content-type":o?.contentType,setting:{aspectRatio:g,qualityType:p},className:i.cls("gp-h-full gp-w-full gp-object-contain")},o?.id),e.jsx(n.default,{contentType:o?.contentType??""})]})},o?.id))})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../common/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../common/helpers.js"),r=require("../../../common/const.js"),o=require("@gem-sdk/core"),d=require("react"),a=require("../../../common/components/Loading.js"),l=require("next/dynamic"),s=require("./common/helpers.js"),i=require("../SalePageProductListWarning.js"),n=require("../../../dialog/common/helpers.js"),c=require("./ProductListCarouselLayout.js"),u=require("./ProductListGridLayout.js"),g=require("./common/classes.js"),m=require("./common/styles.js"),P=require("@gem-sdk/system"),h=require("next/head");const T=l(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:a.default});exports.default=l=>{let{children:C,styles:O,builderProps:S,setting:f,builderAttrs:p}=l,{isRelatedProduct:I,productSetting:y}=s.getData(l),R=y.relatedTag&&y.relatedTag[0],{isEditMode:_,isPreviewSharePageMode:b}=o.useRenderMode(),U=o.useCurrentDevice(),v=o.usePageType(),D=o.usePageStore(e=>e.dynamicProduct),j=o.usePageStore(e=>e.dynamicCollection),[E,L]=d.useState(1),[x,k]=d.useState(!0),[q,M]=d.useState(),[N,w]=d.useState(!1),[Q,W]=d.useState(),F="GP_FUNNEL_PAGE"===v;"GP_COLLECTION"!=v||[r.PRODUCT_LIST_PRODUCT_SOURCE.Collection,r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection].includes(y?.productSrc)||(y.productSrc=r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection);let G=y?.productSrc??r.PRODUCT_LIST_PRODUCT_SOURCE.Collection;G===r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection&&(y.collectionId=j?.collectionId||"latest");let A=D?.productId&&D?.productId!==y.relatedProductId?D?.productId:y.relatedProductId,B=o.useFetchHandle(),H=o.usePageStore(e=>e.publicStoreFrontData),z=d.useMemo(()=>o.hasPublicStoreFrontData(H)?o.createStoreFrontFetcher(H):B,[H]),{data:$,error:K,isLoading:V}=o.useProductQuery(I&&A?A:void 0,{revalidateOnMount:_||b},z),J=y.relatedTag&&"tags"===y.relatedTag[0]&&(!$?.tags||$?.tags.length===0),X=y.relatedTag&&"collection"===y.relatedTag[0]&&(!$?.collections?.edges||$?.collections.edges.length===0),Y=y.relatedTag&&"vendor"===y.relatedTag[0]&&!$?.vendor,Z=o.useProductsQueryAll(q,{revalidateOnMount:_||b},z),ee=_||b,et=o.useProductsQuery(G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?y?.productIds:void 0,{revalidateOnMount:ee},{defaultSelectedProductCount:y?.numOfSelectedProducts,selectedStatus:ee&&y?.productIds?.length?o.PICKED_PRODUCT_STATUSES:void 0}),er=d.useMemo(()=>({id:y?.collectionId??"latest",numberOfProducts:f?.numberOfProducts??4,orderBy:f?.orderBy}),[y?.collectionId,Number(f?.numberOfProducts),f?.orderBy]),eo=o.useCollectionQuery(G!==r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?er:void 0,{revalidateOnMount:ee});d.useEffect(()=>{if(I&&$&&y.relatedTag&&"recommended-product"!==y.relatedType){let e;switch(w(!1),y.hasRelatedExclude&&(e=y?.relatedExclude&&y.relatedExclude.split(",").map(e=>e.trim())),y.relatedTag[0]){case"vendor":M({first:f?.numberOfProducts,vendor:y.relatedTag&&"vendor"===y.relatedTag[0]?$?.vendor:"",idNEQ:$.id}),W($.id);break;case"collection":{let t=$?.collections?.edges.map(e=>e.node?.id);if(!t||t?.length===0){w(!0);break}M(e&&e.length>0?{first:f?.numberOfProducts,idNEQ:$.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t},{titleNotIn:e}]}]}:{first:f?.numberOfProducts,idNEQ:$.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t}]}]}),W($.id);break}case"tags":if(!$.tags||0===$.tags.length){w(!0);break}M(e&&e.length>0?{first:f?.numberOfProducts,idNEQ:$.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:$.tags},{nameNotIn:e}]}]}:{first:f?.numberOfProducts,idNEQ:$.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:$.tags}]}]}),W($.id)}}},[$,y.relatedType,y.relatedTag,f?.numberOfProducts,y.relatedExclude,y.hasRelatedExclude,I]);let ed=G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct,ea=ed?et:eo,el=ea.isValidating,es=ea.error,ei=t.isQueryLoading({hasQuery:ee&&(!ed||!!y?.productIds),data:ea.data,error:ea.error,isLoading:ea.isLoading}),en=s.isRelatedProductsLoading({isRelatedProduct:I,relatedType:y.relatedType,hasRelatedTag:s.hasQueryableRelatedTag({relatedTag:y.relatedTag}),relatedProductIdAssigned:A,canRevalidateOnMount:ee,mainProduct:{data:$,error:K,isLoading:V},relatedQuery:q,relatedQuerySource:Q,mainProductId:$?.id,isNotFoundRelatedProduct:N,relatedProducts:{data:Z.data,error:Z.error,isLoading:Z.isLoading}}),ec=ei||en,eu=eo.data?.collections?.edges?.[0]?.node,eg=G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?o.flattenConnection(et.data?.products):o.flattenConnection(eu?.products),em=Z?.data?.products?o.flattenConnection(Z?.data?.products):void 0,eP=I&&em?em:G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct&&y?.productIds?.length?y?.productIds?.map(e=>eg?.find(t=>t?.baseID===e)).filter(Boolean)??eg:G!==r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?eg:eg.filter((e,t)=>t<(y?.numOfSelectedProducts??4)),eh=d.useMemo(()=>N&&I&&_||!eP.length&&!ec&&x&&_,[x,ec,N,I,_,eP.length]),eT=d.useMemo(()=>!eP||N&&I,[N,I,eP]),eC=d.useMemo(()=>{if(!f?.sameHeight)return[];let e=0,t=Math.ceil((eP?.length??0)/+(f?.slidesToShow?.[U]??1));return Array.from(Array(eP?.length??0)).map((r,o)=>(o>=+(f?.slidesToShow?.[U]??1)*(e+1)&&++e,{gridRow:`${1+E*e}/${E+1+E*e}`,marginBottom:e+1<t?n.getPropertyByDevice(O?.horizontalGutter,U):void 0}))},[f?.sameHeight,f?.slidesToShow,E,eP?.length,U,O?.horizontalGutter]),eO=d.useMemo(()=>el||ec||es||!eP||N&&I,[es,ec,N,I,el,eP]);d.useEffect(()=>{eO||setTimeout(()=>{let{builderData:e}=S??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&L(r.childElementCount||1)},_?0:500)},[S,eO,_]);let eS=d.useMemo(()=>({collection:eu,products:eP,settings:{loop:f?.loop??{desktop:!1},scrollMode:f?.scrollMode??{desktop:"snap"},slidesToShow:f?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:O?.layout,dot:f?.dot,dotStyle:f?.dotStyle,arrow:f?.arrow,controlOverContent:f?.controlOverContent,sameHeight:f?.sameHeight},styles:{horizontalGutter:O?.horizontalGutter,verticalGutter:O?.verticalGutter,fullWidth:O?.fullWidth,spacing:O?.spacing,width:O?.width,height:O?.height}}),[eu,eP,f,O]);if(S?.isPreview&&F)return e.jsx(e.Fragment,{});if(eh)return e.jsx(e.Fragment,{children:P.If(x,e.jsx(T,{builderAttrs:p,collectionHandle:eu?.handle,productSrc:G,onClose:()=>k(!1),children:C,relatedTagString:R,assignProductNoTags:J||X||Y,noAssignedProduct:!A}))});let{productListWrapStyle:ef,productListContentStyle:ep,productListWrapAlignStyle:eI}=m.getStyle(l),{productListWrapClass:ey}=g.getClass(l);return e.jsxs("div",{...p,className:ey,style:ef,children:[!!O?.preloadBgImage&&e.jsxs(h,{children:[!!O.backgroundImage?.desktop?.image?.src&&e.jsx("link",{rel:"preload",href:O.backgroundImage.desktop.image.src,as:"image"}),!!O.backgroundImage?.tablet?.image?.src&&e.jsx("link",{rel:"preload",href:O.backgroundImage?.tablet?.image?.src,as:"image"}),!!O.backgroundImage?.mobile?.image?.src&&e.jsx("link",{rel:"preload",href:O.backgroundImage?.mobile?.image?.src,as:"image"})]}),el||ec?e.jsx(a.default,{label:t.getElementLabel({builderData:S?.builderData})}):es?e.jsxs("div",{children:["Error: ",es?.message]}):eT?e.jsx("div",{children:"Products not found"}):e.jsx(o.ProductListProvider,{...eS,children:e.jsx("div",{className:"gp-flex gp-w-full",style:eI,children:e.jsxs("div",{style:ep,children:[F&&e.jsx(i.default,{}),e.jsx(e.Fragment,{children:P.If(O?.layout==="grid",e.jsx(u.default,{...l,productSortedById:eP,generateGridRowArray:eC}),e.jsx(c.default,{...l,productSortedById:eP}))})]})})}),o.filterToolbarPreview(C,!0)]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),s=require("../../../grid/components/ChildrenDroppable.js"),t=require("../../../carousel/components/item/CarouselItem.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),s=require("../../../grid/components/ChildrenDroppable.js"),t=require("../../../image/common/listImageContext.js"),o=require("./common/imagePriorityHints.js"),i=require("./common/imagePriority.js"),l=require("../../../carousel/components/item/CarouselItem.js"),a=require("../../../carousel/components/root/Carousel.js"),d=require("./common/classes.js"),u=require("./common/helpers.js"),n=require("./common/styles.js"),m=require("./common/attrs.js");exports.default=c=>{let{children:j,builderProps:g,productSortedById:p,advanced:q,setting:x}=c,h=r.useEditorMode(),{carouselConfigSetting:y,carouselConfigStyle:C}=u.getData(c),{productListAttr:P,getAttrProductItemEditor:v}=m.getAttr(c),{carouselItemStyle:I}=n.getStyle(c),{carouselClass:S,productItemClass:b}=d.getClass(c);return e.jsx(a.default,{advanced:q,builderProps:{uid:g?.uid},rootAttrs:{...P},rootClass:S,setting:y,styles:C,children:p?.map((a,d)=>e.jsx(l.default,{style:I,children:e.jsx(r.ProductProvider,{product:a,readOnly:!0,children:e.jsx(t.ListImageContext.Provider,{value:o.getListImageHints({slidesToShow:x?.slidesToShow,rows:i.LIST_PRELOAD_ROWS.CAROUSEL,index:d+1}),children:e.jsx("div",{..."edit"===h?v(a?.baseID):{},className:b,children:r.isEmptyChildren(j)?e.jsx(s.default,{}):j})})})},a?.baseID))})};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../carousel/components/item/CarouselItem.liquid.js"),
|
|
2
|
-
${
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./common/imagePriority.js"),t=require("../../../carousel/components/item/CarouselItem.liquid.js"),r=require("../../../carousel/components/root/Carousel.liquid.js"),i=require("./ProductListCarouselItem.liquid.js"),o=require("../../../helpers.js"),s=require("./common/classes.js"),d=require("./common/helpers.js"),u=require("./common/styles.js"),l=require("@gem-sdk/core");exports.default=a=>{let{builderProps:c,advanced:n,productSrc:p,productListId:m}=a,{carouselConfigSetting:g,carouselConfigStyle:f}=d.getData(a),{carouselItemStyle:_}=u.getStyle(a),{carouselClass:q}=s.getClass(a),$=e.getListImagePriorityLiquid({slidesToShow:a.setting?.slidesToShow,rows:e.LIST_PRELOAD_ROWS.CAROUSEL});return l.template`
|
|
2
|
+
${r.default({advanced:n,builderProps:{...c},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${c?.uid}`,rootClass:q,setting:g,styles:f,children:`
|
|
3
3
|
{%- assign count = 0 -%}
|
|
4
4
|
{%- for product in products limit: limit -%}
|
|
5
5
|
{%- if product.id != empty -%}
|
|
6
6
|
{%- assign count = count | plus: 1 -%}
|
|
7
|
+
${$.item}
|
|
7
8
|
{%- assign variant = product.selected_or_first_available_variant -%}
|
|
8
|
-
{%- assign product_form_id = 'product-form-' | append: "${
|
|
9
|
-
${
|
|
10
|
-
${
|
|
9
|
+
{%- assign product_form_id = 'product-form-' | append: "${c?.uid}" | append: product.id -%}
|
|
10
|
+
${t.default({builderProps:{...c},style:_,parentId:`product-list-carousel-${c?.uid} gp-child-item-${c?.uid}`,parentStyle:f,background:g?.background,children:`
|
|
11
|
+
${i.default({...a})}
|
|
11
12
|
`})}
|
|
12
13
|
{%- endif -%}
|
|
13
14
|
{% endfor %}
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
${$.reset}
|
|
16
|
+
{%- if count == 0 and ${m.length} == 0 -%}
|
|
17
|
+
{% if '${p}' == 'RelatedProduct' -%}
|
|
16
18
|
<div>${o.getStaticLocale("ProductList","no_related_products")}</div>
|
|
17
19
|
{% else %}
|
|
18
20
|
<div>${o.getStaticLocale("ProductList","no_products_found")}</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),i=require("@gem-sdk/core"),s=require("../../../grid/components/ChildrenDroppable.js"),t=require("../../../image/common/listImageContext.js"),o=require("./common/imagePriorityHints.js"),l=require("./common/imagePriority.js"),m=require("./common/classes.js"),d=require("./common/styles.js"),a=require("./common/attrs.js");exports.default=n=>{let{children:c,productSortedById:u,generateGridRowArray:g,setting:j}=n,h=i.useEditorMode(),{gridLayoutStyle:p}=d.getStyle(n),{gridLayoutClass:y,productItemClass:x}=m.getClass(n),{productListAttr:q,getAttrProductItemEditor:v}=a.getAttr(n);return e.jsx("div",{...q,style:p,className:y,children:u?.length?u?.map((m,d)=>e.jsx(i.ProductProvider,{product:m,readOnly:!0,children:e.jsx(t.ListImageContext.Provider,{value:o.getListImageHints({slidesToShow:j?.slidesToShow,rows:l.LIST_PRELOAD_ROWS.GRID,index:d+1}),children:e.jsx("div",{..."edit"===h?v(m?.baseID):{},className:x,style:{"--grchild":j?.sameHeight?g?.[d]?.gridRow:void 0,"--mbchild":g?.[d]?.marginBottom},children:i.isEmptyChildren(c)?e.jsx(s.default,{}):r.Children.map(c,e=>r.isValidElement(e)?r.createElement(e.type,{...e.props,key:e.key}):null)})})},m?.baseID)):null})};
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./ProductListGridItem.liquid.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./common/imagePriority.js"),t=require("./ProductListGridItem.liquid.js"),i=require("../../../helpers.js"),s=require("@gem-sdk/core"),r=require("./common/classes.js"),o=require("./common/styles.js"),d=require("./common/attrs.js");exports.default=a=>{let{setting:l,builderProps:n,styles:c,productListId:u,productSrc:p}=a,{gridLayoutStyle:m}=o.getStyle(a),{gridLayoutClass:g}=r.getClass(a),{productListAttr:f}=d.getAttr(a),$=e.getListImagePriorityLiquid({slidesToShow:l?.slidesToShow,rows:e.LIST_PRELOAD_ROWS.GRID}),h=()=>s.template`
|
|
2
2
|
{%- assign count = 0 -%}
|
|
3
3
|
{%- for product in products limit: limit -%}
|
|
4
4
|
{%- if product.id != empty -%}
|
|
5
5
|
{%- assign count = count | plus: 1 -%}
|
|
6
|
+
${$.item}
|
|
6
7
|
{%- assign variant = product.selected_or_first_available_variant -%}
|
|
7
|
-
{%- assign product_form_id = 'product-form-' | append: "${
|
|
8
|
-
${
|
|
8
|
+
{%- assign product_form_id = 'product-form-' | append: "${n?.uid}" | append: product.id -%}
|
|
9
|
+
${t.default({...a})}
|
|
9
10
|
{%- endif -%}
|
|
10
11
|
{% endfor %}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
${$.reset}
|
|
13
|
+
{%- if count == 0 and ${u?.length} == 0 -%}
|
|
14
|
+
{% if '${p}' == 'RelatedProduct' -%}
|
|
15
|
+
<div>${i.getStaticLocale("ProductList","no_related_products")}</div>
|
|
14
16
|
{% else %}
|
|
15
|
-
<div>${
|
|
17
|
+
<div>${i.getStaticLocale("ProductList","no_products_found")}</div>
|
|
16
18
|
{%- endif -%}
|
|
17
19
|
{%- endif -%}
|
|
18
|
-
`;return
|
|
20
|
+
`;return s.template`
|
|
19
21
|
<div
|
|
20
|
-
${
|
|
21
|
-
style="${
|
|
22
|
+
${f}
|
|
23
|
+
style="${m}"
|
|
22
24
|
class="${g}"
|
|
23
25
|
>
|
|
24
|
-
${
|
|
26
|
+
${s.RenderIf(l?.sameHeight,s.template`
|
|
25
27
|
<gp-same-height
|
|
26
28
|
class="gp-contents"
|
|
27
29
|
style="visibility: hidden"
|
|
28
30
|
>
|
|
29
|
-
<script gp-data type="application/json">${JSON.stringify({targetUid:
|
|
31
|
+
<script gp-data type="application/json">${JSON.stringify({targetUid:n?.builderData?.childrens?.[0],slidesToShow:l?.slidesToShow,rowGap:c?.horizontalGutter})}
|
|
30
32
|
</script>
|
|
31
|
-
${`${
|
|
33
|
+
${`${h()}`}
|
|
32
34
|
</gp-same-height>
|
|
33
35
|
`)}
|
|
34
|
-
${
|
|
36
|
+
${s.RenderIf(!l?.sameHeight,s.template`${h()}`)}
|
|
35
37
|
</div>
|
|
36
38
|
`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../../../carousel/components/dot/common/helpers.js"),t=require("../../product-images/common/productFeaturedImage.js"),
|
|
1
|
+
"use strict";var e=require("../../../../carousel/components/dot/common/helpers.js"),t=require("../../product-images/common/productFeaturedImage.js"),r=require("../../../helpers/product.js"),o=require("../../../../common/helpers.js");require("../../../../common/const.js"),require("react/jsx-runtime"),require("@gem-sdk/core"),require("react");const d="gid://shopify/Collection/",c="gid://shopify/Product/",i=["vendor","collection","tags"];exports.PREFIX_COLLECTION_ID=d,exports.PREFIX_PRODUCT_ID=c,exports.getData=t=>{let{setting:o,styles:d}=t,c=o?.productSetting??{},i="RelatedProduct"===c.productSrc,l=e.getUpdatedDotStyle(o?.dot,o?.dotStyle),u={dotSize:{desktop:12},dotGapToCarousel:{desktop:16},arrowIconSize:{desktop:24},showWhenHover:!1,rtl:!1,...o};delete u.childItem;let a={...d,sizeSetting:{...r.getSizeSetting({adaptiveHeight:d?.adaptiveHeight,height:d?.height,fullWidth:{desktop:!0}})},spacing:d?.spacing};return delete a.backgroundColor,delete a.backgroundImage,{isRelatedProduct:i,productSetting:c,dotStyle:l,carouselConfigSetting:u,carouselConfigStyle:a}},exports.getDataLiquid=e=>{let{setting:r,styles:o}=e,i=r?.productSetting,l=i?.relatedTag,u=i?.hasRelatedExclude,a=(l&&"collection"===l[0]?i?.relatedCollectionExclude:i?.relatedTagsExclude)??"",n=a?.split(",").map(e=>e.trim()).toString(),s=i?.productSrc??"Collection",p=i?.collectionId?.replace(d,"")??"latest",g=i?.productSrc==="PickProduct"&&i?.productIds?.length===0,m=o?.layout==="grid",h=t.convertUnitToNumber(r?.numberOfProducts,4),S="PickProduct"===s&&i?.productIds?.length?i?.productIds.map(e=>e.replace(c,"")):[],P="PickProduct"===s&&i?.productHandles?.length?i?.productHandles:[],y=r?.orderBy&&r?.orderBy!=="none",I=(i?.productSrc==="Collection"||i?.productSrc==="DynamicCollection")&&y?r?.orderBy?.split("_"):"none",k=y&&I?.[0]==="TITLE"?"| sort: 'title'":"| sort: 'updated_at'",C=I?.[I.length-1]==="DESC";return{hasRelatedExclude:u,relatedExcludeTrim:n,collectionID:p,isLatestProducts:g,isGrid:m,numberOfProducts:h,productListId:S,productListHandles:P,sortedBy:k,isReverse:C,productSrc:s,productSetting:i,isSorted:y,relatedTag:l,productNumber:"PickProduct"===s?g?4:i?.numOfSelectedProducts??4:h,collectionHandle:i?.collectionHandle}},exports.hasQueryableRelatedTag=({relatedTag:e})=>!!e?.[0]&&i.includes(e[0]),exports.isRelatedProductsLoading=({isRelatedProduct:e,relatedType:t,hasRelatedTag:r,relatedProductIdAssigned:d,canRevalidateOnMount:c,mainProduct:i,mainProductId:l,relatedQuery:u,relatedQuerySource:a,isNotFoundRelatedProduct:n,relatedProducts:s})=>{if(!e)return!1;let p="recommended-product"!==t&&r&&!!d,g=p&&!!i.data&&a!==l&&!n;return c?o.isQueryLoading({hasQuery:p,...i})||g||o.isQueryLoading({hasQuery:!!u,...s}):i.isLoading||s.isLoading};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var e=require("@gem-sdk/core"),I=require("../../../../image/common/sizes.js");const i={desktop:4,tablet:2,mobile:2},s=I=>e.DEVICES.map(s=>{let t=Number(e.getResponsiveValueByScreen(I,s));return Math.max(1,Math.floor(t||i[s]))}),t=e=>100/Math.min(...s(e)),_=({slidesToShow:e,rows:I})=>{let i=s(e);return{eagerLimit:Math.max(...i)*I,highLimit:Math.min(...i),sizes:`${Number(t(e).toFixed(2))}vw`}};exports.LIST_PRELOAD_ROWS={GRID:2,CAROUSEL:1},exports.getListImagePriority=_,exports.getListImagePriorityLiquid=({slidesToShow:i,rows:s,indexVar:a="count"})=>{let{eagerLimit:r,highLimit:L}=_({slidesToShow:i,rows:s}),S=I.getImageSizes({slotVw:t(i)});return{item:`{%- liquid
|
|
2
|
+
if ${a} <= ${r}
|
|
3
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.LOADING} = 'eager'
|
|
4
|
+
else
|
|
5
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.LOADING} = 'lazy'
|
|
6
|
+
endif
|
|
7
|
+
if ${a} <= ${L}
|
|
8
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.FETCH_PRIORITY} = 'high'
|
|
9
|
+
else
|
|
10
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.FETCH_PRIORITY} = 'auto'
|
|
11
|
+
endif
|
|
12
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.SIZES} = '${S}'
|
|
13
|
+
-%}`,reset:`{%- liquid
|
|
14
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.LOADING} = nil
|
|
15
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.FETCH_PRIORITY} = nil
|
|
16
|
+
assign ${e.LIST_IMAGE_LIQUID_VARS.SIZES} = nil
|
|
17
|
+
-%}`}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=require("./imagePriority.js");exports.getListImageHints=({slidesToShow:e,rows:i,index:r})=>{let{eagerLimit:a,highLimit:g,sizes:s}=t.getListImagePriority({slidesToShow:e,rows:i});return{loading:r<=a?"eager":"lazy",fetchpriority:r<=g?"high":"auto",sizes:s}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../common/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../common/helpers.js"),r=require("../../../common/const.js"),o=require("@gem-sdk/core"),s=require("react"),l=require("../../../common/components/Loading.js"),i=require("next/dynamic"),d=require("./hooks/useRelatedProductIDAssigned.js"),u=require("../SalePageProductListWarning.js"),a=require("../../../dialog/common/helpers.js"),n=require("./hooks/useProductRelatedQuery.js"),c=require("./ProductListCarouselLayout.js"),g=require("./constants/index.js"),m=require("./hooks/useCollectionQuery.js"),P=require("./hooks/useProductsQuery.js"),C=require("./ProductListGridLayout.js"),h=require("./common/classes.js"),T=require("./common/helpers.js"),S=require("./common/styles.js"),O=require("@gem-sdk/system"),p=require("next/head");const _=i(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:l.default});exports.default=i=>{let{children:f,styles:R,builderProps:U,setting:y,builderAttrs:D}=i,{isRelatedProduct:j,productSetting:I}=T.getData(i),{isEditMode:L,isPreviewSharePageMode:b}=o.useRenderMode(),x=o.useCurrentDevice(),k=o.usePageType(),q=o.usePageStore(e=>e.dynamicCollection),[E,v]=s.useState(1),[N,w]=s.useState(!0),M=s.useRef(),A="GP_FUNNEL_PAGE"===k;"GP_COLLECTION"!=k||[r.PRODUCT_LIST_PRODUCT_SOURCE.Collection,r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection].includes(I?.productSrc)||(I.productSrc=r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection);let G=I?.productSrc??r.PRODUCT_LIST_PRODUCT_SOURCE.Collection;G===r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection&&(I.collectionId=q?.collectionId||"latest");let B=Number.isNaN(Number(y?.numberOfProducts))?g.DEFAULT_COLLECTION_NUMBER_OF_PRODUCTS:Number(y?.numberOfProducts),{relatedProductIdAssigned:F}=d.default({productSetting:I}),{isNotFoundRelatedProduct:Q,relatedProducts:H,isNoRelatedProductData:z,relatedTagString:W,isLoading:$}=n.default({productSetting:I,isRelatedProduct:j,relatedProductIdAssigned:F,numberOfProducts:B}),K=L||b,V=P.useProductsQuery({productIds:I?.productIds,defaultSelectedProductCount:I?.numOfSelectedProducts,productSrc:G,selectedStatus:K&&I?.productIds?.length?o.PICKED_PRODUCT_STATUSES:void 0}),J=m.useCollectionQuery({productSrc:G,collectionID:I?.collectionId??"latest",numberOfProducts:B,orderBy:y?.orderBy}),X=G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct,Y=X?V:J,Z=X?!!I?.productIds:G===r.PRODUCT_LIST_PRODUCT_SOURCE.Collection||G===r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection,ee=$||t.isQueryLoading({hasQuery:Z,data:Y.data,error:Y.error,isLoading:Y.isLoading}),et=Y.error,er=Y.isValidating,eo=J.data?.collections?.edges?.[0]?.node,es=G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?o.flattenConnection(V.data?.products):o.flattenConnection(eo?.products),el=o.usePageStore(e=>e.assignedProductIds),ei=o.usePageStore(e=>e.isApplyAllProducts),ed=s.useMemo(()=>(el??[]).length>0&&!ei||ei,[el,ei]),eu=H?.data?.products&&ed?o.flattenConnection(H?.data?.products):[],ea=j?eu:G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct&&I?.productIds?.length?I?.productIds?.map(e=>es?.find(t=>t?.baseID===e)).filter(Boolean)??es:G!==r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?es:es.filter((e,t)=>t<(I?.numOfSelectedProducts??4)),en=s.useMemo(()=>Q&&j&&L||!ea.length&&!ee&&N&&L,[N,ee,Q,j,L,ea.length]),ec=s.useMemo(()=>!ea||Q&&j,[Q,j,ea]),eg=s.useMemo(()=>{if(!y?.sameHeight)return[];let e=0,t=Math.ceil((ea?.length??0)/+(y?.slidesToShow?.[x]??1));return Array.from(Array(ea?.length??0)).map((r,o)=>(o>=+(y?.slidesToShow?.[x]??1)*(e+1)&&++e,{gridRow:`${1+E*e}/${E+1+E*e}`,marginBottom:e+1<t?a.getPropertyByDevice(R?.horizontalGutter,x):void 0}))},[y?.sameHeight,y?.slidesToShow,E,ea?.length,x,R?.horizontalGutter]),em=s.useMemo(()=>er||ee||et||!ea||Q&&j,[et,ee,Q,j,er,ea]);s.useEffect(()=>{if(!em)return M.current=setTimeout(()=>{let{builderData:e}=U??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&v(r.childElementCount||1)},L?0:500),()=>{clearTimeout(M.current)}},[U,em,L,ea]);let eP=s.useMemo(()=>({collection:eo,products:ea,settings:{loop:y?.loop??{desktop:!1},scrollMode:y?.scrollMode??{desktop:"snap"},slidesToShow:y?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:R?.layout,dot:y?.dot,dotStyle:y?.dotStyle,arrow:y?.arrow,controlOverContent:y?.controlOverContent,sameHeight:y?.sameHeight},styles:{horizontalGutter:R?.horizontalGutter,verticalGutter:R?.verticalGutter,fullWidth:R?.fullWidth,spacing:R?.spacing,width:R?.width,height:R?.height}}),[eo,ea,y,R]);if(U?.isPreview&&A)return e.jsx(e.Fragment,{});if(en)return e.jsx(e.Fragment,{children:O.If(N,e.jsx(_,{builderAttrs:D,collectionHandle:eo?.handle,productSrc:G,onClose:()=>w(!1),children:f,relatedTagString:W,assignProductNoTags:z,noAssignedProduct:!F}))});let{productListWrapStyle:eC,productListContentStyle:eh,productListWrapAlignStyle:eT}=S.getStyle(i),{productListWrapClass:eS}=h.getClass(i);return e.jsxs("div",{...D,className:eS,style:eC,children:[!!R?.preloadBgImage&&e.jsxs(p,{children:[!!R.backgroundImage?.desktop?.image?.src&&e.jsx("link",{rel:"preload",href:R.backgroundImage.desktop.image.src,as:"image"}),!!R.backgroundImage?.tablet?.image?.src&&e.jsx("link",{rel:"preload",href:R.backgroundImage?.tablet?.image?.src,as:"image"}),!!R.backgroundImage?.mobile?.image?.src&&e.jsx("link",{rel:"preload",href:R.backgroundImage?.mobile?.image?.src,as:"image"})]}),ee||er?e.jsx(l.default,{label:t.getElementLabel({builderData:U?.builderData})}):et?e.jsxs("div",{children:["Error: ",et?.message]}):ec?e.jsx("div",{children:"Products not found"}):e.jsx(o.ProductListProvider,{...eP,children:e.jsx("div",{className:"gp-flex gp-w-full",style:eT,children:e.jsxs("div",{style:eh,children:[A&&e.jsx(u.default,{}),e.jsx(e.Fragment,{children:O.If(R?.layout==="grid",e.jsx(C.default,{...i,productSortedById:ea,generateGridRowArray:eg}),e.jsx(c.default,{...i,productSortedById:ea}))})]})})}),o.filterToolbarPreview(f,!0)]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../carousel-v3/components/item/CarouselItem.js"),s=require("../../../carousel-v3/components/root/Carousel.js"),t=require("@gem-sdk/core"),o=require("../../../grid/components/ChildrenDroppable.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../carousel-v3/components/item/CarouselItem.js"),s=require("../../../carousel-v3/components/root/Carousel.js"),t=require("@gem-sdk/core"),o=require("../product-list/common/imagePriorityHints.js"),i=require("../../../grid/components/ChildrenDroppable.js"),l=require("../../../image/common/listImageContext.js"),d=require("../product-list/common/imagePriority.js"),u=require("./common/classes.js"),a=require("./common/helpers.js"),n=require("./common/styles.js"),m=require("./common/attrs.js");exports.default=c=>{let{children:j,builderProps:p,productSortedById:g,advanced:q,setting:x}=c,h=t.useEditorMode(),{carouselConfigSetting:v,carouselConfigStyle:y}=a.getData(c),{productListAttr:C,getAttrProductItemEditor:P}=m.getAttr(c),{carouselItemStyle:I}=n.getStyle(c),{carouselClass:L,productItemClass:S}=u.getClass(c);return e.jsx(s.default,{advanced:q,builderProps:{uid:p?.uid},rootAttrs:{...C},rootClass:L,setting:v,styles:y,isProductList:!0,children:g?.map((s,u)=>e.jsx(r.default,{style:I,children:e.jsx(t.ProductProvider,{product:s,readOnly:!0,children:e.jsx(l.ListImageContext.Provider,{value:o.getListImageHints({slidesToShow:x?.slidesToShow,rows:d.LIST_PRELOAD_ROWS.CAROUSEL,index:u+1}),children:e.jsx("div",{..."edit"===h?P(s?.baseID):{},className:S,children:t.isEmptyChildren(j)?e.jsx(i.default,{}):j})})})},s?.baseID))})};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../carousel-v3/components/item/CarouselItem.liquid.js"),t=require("../../../carousel-v3/components/root/Carousel.liquid.js"),r=require("./ProductListCarouselItem.liquid.js"),
|
|
2
|
-
${t.default({advanced:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../carousel-v3/components/item/CarouselItem.liquid.js"),t=require("../../../carousel-v3/components/root/Carousel.liquid.js"),r=require("../product-list/common/imagePriority.js"),i=require("./ProductListCarouselItem.liquid.js"),o=require("../../../helpers.js"),s=require("./common/classes.js"),d=require("./common/helpers.js"),u=require("./common/styles.js"),l=require("@gem-sdk/core");exports.default=a=>{let{builderProps:c,advanced:n,productSrc:p,productListId:m}=a,{carouselConfigSetting:g,carouselConfigStyle:f}=d.getData(a),{carouselItemStyle:_}=u.getStyle(a),{carouselClass:q}=s.getClass(a),$=r.getListImagePriorityLiquid({slidesToShow:a.setting?.slidesToShow,rows:r.LIST_PRELOAD_ROWS.CAROUSEL});return l.template`
|
|
2
|
+
${t.default({advanced:n,builderProps:{...c},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${c?.uid}`,rootClass:q,setting:g,styles:f,isProductList:!0,children:`
|
|
3
3
|
{%- assign count = 0 -%}
|
|
4
4
|
{%- for product in products limit: limit -%}
|
|
5
5
|
{%- if product.id != empty -%}
|
|
6
6
|
{%- assign count = count | plus: 1 -%}
|
|
7
|
+
${$.item}
|
|
7
8
|
{%- assign variant = product.selected_or_first_available_variant -%}
|
|
8
|
-
{%- assign product_form_id = 'product-form-' | append: "${
|
|
9
|
-
${e.default({builderProps:{...
|
|
10
|
-
${
|
|
9
|
+
{%- assign product_form_id = 'product-form-' | append: "${c?.uid}" | append: product.id -%}
|
|
10
|
+
${e.default({builderProps:{...c},style:_,parentId:`product-list-carousel-${c?.uid} gp-child-item-${c?.uid}`,parentStyle:f,parentSettings:g,background:g?.background,children:`
|
|
11
|
+
${i.default({...a})}
|
|
11
12
|
`})}
|
|
12
13
|
{%- endif -%}
|
|
13
14
|
{% endfor %}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
${$.reset}
|
|
16
|
+
{%- if count == 0 and ${m.length} == 0 -%}
|
|
17
|
+
{% if '${p}' == 'RelatedProduct' -%}
|
|
18
|
+
<div>${o.getStaticLocale("ProductList","no_related_products")}</div>
|
|
17
19
|
{% else %}
|
|
18
|
-
<div>${
|
|
20
|
+
<div>${o.getStaticLocale("ProductList","no_products_found")}</div>
|
|
19
21
|
{%- endif -%}
|
|
20
22
|
{%- endif -%}
|
|
21
23
|
`,carouselType:"product_list"})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@gem-sdk/core"),s=require("../../../grid/components/ChildrenDroppable.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@gem-sdk/core"),i=require("../product-list/common/imagePriorityHints.js"),s=require("../../../grid/components/ChildrenDroppable.js"),o=require("../../../image/common/listImageContext.js"),l=require("../product-list/common/imagePriority.js"),d=require("./common/classes.js"),m=require("./common/styles.js"),a=require("./common/attrs.js");exports.default=n=>{let{children:c,productSortedById:u,generateGridRowArray:g,setting:p}=n,j=t.useEditorMode(),{gridLayoutStyle:h}=m.getStyle(n),{gridLayoutClass:y,productItemClass:x}=d.getClass(n),{productListAttr:q,getAttrProductItemEditor:v}=a.getAttr(n);return e.jsx("div",{...q,style:h,className:y,children:u?.length?u?.map((d,m)=>e.jsx(t.ProductProvider,{product:d,readOnly:!0,children:e.jsx(o.ListImageContext.Provider,{value:i.getListImageHints({slidesToShow:p?.slidesToShow,rows:l.LIST_PRELOAD_ROWS.GRID,index:m+1}),children:e.jsx("div",{..."edit"===j?v(d?.baseID):{},className:x,style:{"--grchild":p?.sameHeight?g?.[m]?.gridRow:void 0,"--mbchild":g?.[m]?.marginBottom},children:t.isEmptyChildren(c)?e.jsx(s.default,{}):r.Children.map(c,e=>r.isValidElement(e)?r.createElement(e.type,{...e.props,key:e.key}):null)})})},d?.baseID)):null})};
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./ProductListGridItem.liquid.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../product-list/common/imagePriority.js"),t=require("./ProductListGridItem.liquid.js"),i=require("../../../helpers.js"),s=require("@gem-sdk/core"),r=require("./common/classes.js"),o=require("./common/styles.js"),d=require("./common/attrs.js");exports.default=a=>{let{setting:l,builderProps:c,styles:n,productListId:u,productSrc:p}=a,{gridLayoutStyle:m}=o.getStyle(a),{gridLayoutClass:g}=r.getClass(a),{productListAttr:f}=d.getAttr(a),$=e.getListImagePriorityLiquid({slidesToShow:l?.slidesToShow,rows:e.LIST_PRELOAD_ROWS.GRID}),h=()=>s.template`
|
|
2
2
|
{%- assign count = 0 -%}
|
|
3
3
|
{%- for product in products limit: limit -%}
|
|
4
4
|
{%- if product.id != empty -%}
|
|
5
5
|
{%- assign count = count | plus: 1 -%}
|
|
6
|
+
${$.item}
|
|
6
7
|
{%- assign variant = product.selected_or_first_available_variant -%}
|
|
7
|
-
{%- assign product_form_id = 'product-form-' | append: "${
|
|
8
|
-
${
|
|
8
|
+
{%- assign product_form_id = 'product-form-' | append: "${c?.uid}" | append: product.id -%}
|
|
9
|
+
${t.default({...a})}
|
|
9
10
|
{%- endif -%}
|
|
10
11
|
{% endfor %}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
${$.reset}
|
|
13
|
+
{%- if count == 0 and ${u?.length} == 0 -%}
|
|
14
|
+
{% if '${p}' == 'RelatedProduct' -%}
|
|
15
|
+
<div>${i.getStaticLocale("ProductList","no_related_products")}</div>
|
|
14
16
|
{% else %}
|
|
15
|
-
<div>${
|
|
17
|
+
<div>${i.getStaticLocale("ProductList","no_products_found")}</div>
|
|
16
18
|
{%- endif -%}
|
|
17
19
|
{%- endif -%}
|
|
18
|
-
`;return
|
|
20
|
+
`;return s.template`
|
|
19
21
|
<div
|
|
20
|
-
${
|
|
21
|
-
style="${
|
|
22
|
+
${f}
|
|
23
|
+
style="${m}"
|
|
22
24
|
class="${g}"
|
|
23
25
|
>
|
|
24
|
-
${
|
|
26
|
+
${s.RenderIf(l?.sameHeight,s.template`
|
|
25
27
|
<gp-same-height
|
|
26
28
|
class="gp-contents"
|
|
27
29
|
style="visibility: hidden"
|
|
28
30
|
>
|
|
29
|
-
<script gp-data type="application/json">${JSON.stringify({targetUid:
|
|
31
|
+
<script gp-data type="application/json">${JSON.stringify({targetUid:c?.builderData?.childrens?.[0],slidesToShow:l?.slidesToShow,rowGap:n?.horizontalGutter})}
|
|
30
32
|
</script>
|
|
31
|
-
${`${
|
|
33
|
+
${`${h()}`}
|
|
32
34
|
</gp-same-height>
|
|
33
35
|
`)}
|
|
34
|
-
${
|
|
36
|
+
${s.RenderIf(!l?.sameHeight,s.template`${h()}`)}
|
|
35
37
|
</div>
|
|
36
38
|
`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@gem-sdk/core"),r=require("../../../helpers/product-bundle.js"),t=require("../../product-variants/common/common.js"),u=require("react");exports.useGpPrice=i=>{let{setting:
|
|
1
|
+
"use strict";var e=require("@gem-sdk/core"),r=require("../../../helpers/product-bundle.js"),t=require("../../product-variants/common/common.js"),u=require("react");exports.useGpPrice=i=>{let{setting:n,builderProps:o}=i,a=u.useRef(null),c=e.useEditorMode(),{quantity:s,hasUpdatePrice:d}=e.useQuantity(),m=e.useCurrentVariant(),{useProductCompareAtPrice:l}=e.useProductBundleDiscount(),p=i["bundle-item"],b=e.convertDecimalToNumber(m?.price)??0,g=e.convertDecimalToNumber(m?.salePrice)??0,y=n?.priceType==="compare",{trigger:M}=e.useInteraction(),h=e.useProduct(),q=h?.baseID?.replace("gid://shopify/Product/",""),P=e.useShopStore(e=>e.showPriceCurrency),{moneyFormat:v}=e.useMoneyFormat(),N=u.useMemo(()=>{if(!p)return!0;let e=Number(p.quantity);return Number.isInteger(e)&&e>0},[p?.quantity]),D=u.useMemo(()=>{let e=Number(p?.discountValue);return Number.isFinite(e)&&e>0},[p?.discountValue]),T=u.useMemo(()=>p?N?Number(p.quantity):1:d&&s||1,[s,d,p?.quantity,N]),w=u.useMemo(()=>p&&N?r.calculateBundleFixedDiscount(b,{...p,quantity:T},r.getMoneyFormatDecimals(v)):0,[p?.quantity,p?.discountType,p?.discountValue,N,b,T,v]),F=u.useMemo(()=>D?l?(g||b)*T:b*T:g*T,[D,b,T,g,l]),f=u.useMemo(()=>{let e=b*T;return y?F:w?Math.max(0,e-w):e},[b,T,w,F,y]),C=u.useMemo(()=>!!y&&(!(g>b)||!(g>=0)),[y,g,b]),I=(e,r)=>{M({event:"price"===r?"gp:rollback:price-change":"gp:rollback:compare-price-change",selector:`[data-id="${o?.uid}"]`,element:a.current}),M({event:"price"===r?"gp:price-change":"gp:compare-price-change",data:e,selector:`[data-id="${o?.uid}"]`,element:a.current})};t.useTransition(e=>{e!==b&&I(b,"price")},[b]),t.useTransition(e=>{e!==g&&I(g,"compare")},[g]);let V=e.useFormatMoney(f??0,P||!1),k=y&&!f;return{elementRef:a,moneyFormatted:V,currentProductId:q,isNoComparePrice:k,isNoComparePriceILP:"edit"!==c&&k,emitNoDataSignal:()=>{if("edit"!==c)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:o?.uid,value:!f&&y,tag:"ProductPrice"}});window.dispatchEvent(e)},shouldHiddenComparePrice:C}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),t=require("../../../grid/components/ChildrenDroppable.js"),s=require("./hook/useProductSetting.js"),i=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),t=require("../../../grid/components/ChildrenDroppable.js"),s=require("./hook/useProductSetting.js"),i=require("../../../common/helpers.js");require("../../../common/const.js"),require("react");var o=require("../../../common/components/Loading.js"),d=require("./common/helpers.js"),n=require("@gem-sdk/system"),u=require("../../../grid/components/row/Row.js"),l=require("next/dynamic");const c=l(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:o.default});exports.default=l=>{let{builderProps:a,children:m,setting:j,style:g,builderAttrs:h}=l,{isAuto:p}=j??{},{isLoadingProduct:x,isProductPage:q,isProductNotFound:f,showProductNotFound:P,errorLoadProduct:b,product:y,isEditor:v,productProviderData:F,setShowProductNotFound:D}=s.useProductSetting(l),{rowSetting:k,rowStyles:C}=d.getData(l);return q&&p?e.jsx(e.Fragment,{children:r.isEmptyChildren(m)?e.jsx(t.default,{}):m}):e.jsx(e.Fragment,{children:n.If(!f,e.jsx(e.Fragment,{children:x?e.jsx(o.default,{label:i.getElementLabel({builderData:a?.builderData})}):e.jsx(e.Fragment,{children:b?e.jsxs("div",{children:["Error: ",b?.message]}):y?e.jsx(r.ProductProvider,{...F,children:e.jsx(u.default,{builderProps:a,builderAttrs:h,style:g,styles:C,setting:k,customAttrs:v?{"data-product-id":y?.baseID?.replace("gid://shopify/Product/","")??""}:void 0,children:r.isEmptyChildren(m)?e.jsx(t.default,{}):m})}):null})}),e.jsx(e.Fragment,{children:n.If(P,e.jsx(c,{builderAttrs:h,productSrc:"PickProduct",onClose:()=>D(!1),children:m}))}))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@gem-sdk/core"),
|
|
1
|
+
"use strict";var e=require("@gem-sdk/core"),r=require("../../../../common/helpers.js");require("../../../../common/const.js"),require("react/jsx-runtime");var t=require("react"),a=require("./useProductQuery.js");exports.useProductSetting=u=>{let{setting:d}=u,{productSetting:i,quantity:s,readOnly:o,isSyncProduct:c}=d??{},n=e.usePageType(),P=e.usePageStore(e=>e.dynamicProduct),{isEditMode:l}=e.useRenderMode(),m=i?.productId??"latest",y=i?.productStatus=="dynamic"?{...i,...P}:i,S=y?.initialVariantId,g=y?.initialVariantBaseId,{productData:{data:p,isLoading:q,error:h}}=a.default({id:m}),[j,I]=t.useState(!0),Q=r.isQueryLoading({hasQuery:!!m,data:p,error:h,isLoading:q}),k=(h||!p&&!Q)&&l,v=t.useMemo(()=>({product:p,initialVariantId:S,initialVariantBaseId:g,quantity:s,readOnly:o,isSyncProduct:c,key:`uid-${p?.id}-${S??""}`,hasPreSelected:i?.hasPreSelected}),[g,S,c,p,i?.hasPreSelected,s,o]);return{forceProductSetting:y,isProductPage:"PRODUCT"===n,isProductNotFound:k,showProductNotFound:j,isLoadingProduct:Q,product:p,errorLoadProduct:h,isEditor:l,productProviderData:v,setShowProductNotFound:I}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("@gem-sdk/core"),t=require("../components/constants/product-bundle.js");const o=t=>({discountPercentAmount:0,discountAmount:e.formatMoney("0",t)}),r=e=>{let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0},n=(e,t)=>Math.round((t-e)/t*100),u=(t,o,r)=>e.formatMoney((o-t).toString(),r),i=(e,o,n=2)=>{let u=Number(o?.discountValue);if(!Number.isFinite(u)||u<0)return 0;if(o?.discountType===t.DiscountType.Percentage){let t=r(o?.quantity);return void 0===t?0:m(e*(u/100),n)*t}return o?.discountType===t.DiscountType.FixedAmount?u:0},c=e=>e?.includes("amount_no_decimals")?0:2,m=(e,t=2)=>{let o=10**t;return Math.floor(Math.round(1e6*(e*o))/1e6)/o},a=(e,t)=>Math.round(e/t*100);exports.applyBundleDiscountAmount=m=>{let{currentVariant:s,bundleItem:d,options:l}=m;if(!l?.useProductCompareAtPrice&&d?.discountType===t.DiscountType.NoDiscount||!d||!s?.price)return o(l?.moneyFormat||"${{amount}}");let p=e.convertDecimalToNumber(s?.price)??0,y=e.convertDecimalToNumber(s?.salePrice)??p,F=r(d.quantity);if(void 0===F)return o(l?.moneyFormat||"${{amount}}");let P=i(p,d,c(l?.moneyFormat)),f=a(P,F*p),A=p*F-P,D=y*F;return y<=p&&P<=0?o(l?.moneyFormat||"${{amount}}"):{discountPercentAmount:l?.useProductCompareAtPrice?n(A,D):f,discountAmount:l?.useProductCompareAtPrice?u(A,D,l?.moneyFormat):e.formatMoney(P.toString(),l?.moneyFormat)}},exports.calculateBundleFixedDiscount=i,exports.floorToMinorUnit=m,exports.getMoneyFormatDecimals=c;
|