@gem-sdk/components 23.0.0-staging.2 → 23.0.0-staging.20
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/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/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/grid/components/row/Row.liquid.js +12 -12
- 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/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/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/common/styles.js +1 -1
- 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 +42 -42
- 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.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +39 -39
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +38 -38
- 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-images-v3/composables/getProductImagesStyles.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +4 -4
- 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/ProductListGridItem.liquid.js +4 -4
- 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/imagePriority.js +17 -0
- package/dist/cjs/product/components/product-list/common/imagePriorityHints.js +1 -0
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +2 -3
- 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/ProductListGridItem.liquid.js +4 -4
- 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-wrap/Product.liquid.js +13 -13
- 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/video/components/HTML5Embed.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.liquid.js +9 -9
- 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/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/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/grid/components/row/Row.liquid.js +10 -10
- 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/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/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/common/styles.js +1 -1
- 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 +24 -24
- 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.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-images-v3/composables/getProductImagesStyles.js +1 -1
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.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/ProductListGridItem.liquid.js +1 -1
- 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/imagePriority.js +17 -0
- package/dist/esm/product/components/product-list/common/imagePriorityHints.js +1 -0
- package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +6 -7
- 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/ProductListGridItem.liquid.js +1 -1
- 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-wrap/Product.liquid.js +7 -7
- 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/video/components/HTML5Embed.js +1 -1
- package/dist/esm/video/components/HTML5Embed.liquid.js +9 -9
- 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 +20 -5
- package/package.json +9 -6
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../common/productFeaturedImage.js"),i=require("../../common/common.js"),a=require("@gem-sdk/core"),t=require("../../composables/getProductImagesClassName.js"),r=require("../../../../../carousel/components/item/CarouselItem.liquid.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../common/productFeaturedImage.js"),i=require("../../common/common.js"),a=require("@gem-sdk/core"),t=require("../../composables/getProductImagesClassName.js"),r=require("../../../../../carousel/components/item/CarouselItem.liquid.js"),d=require("../../composables/getProductImagesStyles.js"),s=require("../../../../../image/common/liquidSrcset.js"),u=require("../../../../../carousel/components/root/Carousel.liquid.js"),o=require("../../composables/getProductImagesAttr.js"),l=require("../../../../../video/components/HTML5Embed.liquid.js"),g=require("../../../../../image/components/NextImage.liquid.js"),n=require("../../../../../image/components/Modal3d.liquid.js"),c=require("@gem-sdk/system"),m=require("../../../../../image/components/Video.liquid.js"),p=require("../../../../helpers/function.js");exports.default=({builderPropUID:f,children:y,pageContext:h,...q})=>{let{featuredImageCarouselClasses:I,galleryItemClasses:b,featuredCarouselItemClasses:M}=t.getProductImagesClassName(q),{featuredImageCarouselStyle:_,featureImageStyle:$,featureImageCarouselOnlyOneImageStyle:v,featureImageOnlyOneImageStyle:w,featureImageCarouselItemStyle:L}=d.getProductImagesStyles(q),{featuredImageCarouselSettingAttrs:S}=o.getProductImagesAttr(q),j=i.getAspectRatio(q.ftShape),x=()=>`
|
|
2
2
|
{% case featureMedia.media_type %}
|
|
3
3
|
{% when 'image' %}
|
|
4
|
-
${
|
|
4
|
+
${z()}
|
|
5
5
|
{% when 'external_video' %}
|
|
6
6
|
{% assign mediaSourceVideo = featureMedia | external_video_url %}
|
|
7
7
|
${O()}
|
|
8
8
|
{% when 'video' %}
|
|
9
9
|
{% assign mediaSourceVideo = featureMedia.sources.last.url %}
|
|
10
|
-
${
|
|
10
|
+
${R()}
|
|
11
11
|
{% when 'model' %}
|
|
12
|
-
${
|
|
12
|
+
${P()}
|
|
13
13
|
{% else %}
|
|
14
|
-
${
|
|
14
|
+
${T()}
|
|
15
15
|
{% endcase %}
|
|
16
|
-
`,
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
16
|
+
`,P=()=>n.default({src:c.LiquidIf("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:j}),O=()=>m.default({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:j}),R=()=>l.default({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,style:{width:"100%","max-height":"100%"},className:"gp-invisible"}),z=()=>a.template`
|
|
17
|
+
${C(a.cls("gp-w-full gp-transition-opacity",{"group-hover:gp-opacity-0":"other"==q.hoverEffect},"{{shouldHidden}}"))}
|
|
18
|
+
${c.If(q?.hoverEffect!=="none",`<div class="${a.cls("zoom-element !gp-max-w-none",e.getZoomImageClass())}">
|
|
19
|
+
${C("image-zoom",!0)}
|
|
20
20
|
</div>`," ")}
|
|
21
|
-
${
|
|
22
|
-
`,
|
|
21
|
+
${c.If(q?.hoverEffect=="zoom"&&q?.zoomType=="glasses",`<div class="${a.cls("zoom-lens-element",e.getZoomLenClass())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
|
|
22
|
+
`,C=(e,i)=>{let t=s.getLiquidImageSrcset({liquidSrc:"src",sizeTarget:"ProductFeatureImage",qualityType:q.qualityType,qualityPercent:q.qualityPercent});return a.template`
|
|
23
23
|
{% assign src = featureMedia.src %}
|
|
24
|
-
${
|
|
25
|
-
{% assign other_image_index = ${
|
|
24
|
+
${c.If(i&&"other"==q.hoverEffect,`{% assign media_length = product.media | size %}
|
|
25
|
+
{% assign other_image_index = ${q.otherImage} | plus: 0 %}
|
|
26
26
|
{% if other_image_index >= media_length %}
|
|
27
27
|
{% assign other_image_index = media_length | minus: 1 %}
|
|
28
28
|
{% endif %}
|
|
29
29
|
{% assign otherImage = product.media[other_image_index] %}
|
|
30
|
-
${
|
|
30
|
+
${c.LiquidIf("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
|
|
31
31
|
`)}
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
32
|
+
${g.default({srcIsLiquidCode:!0,src:c.LiquidIf("src != null","{{src | image_url}}","https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:c.LiquidIf("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:c.LiquidIf("src != null",t),setting:{layout:q?.ftLayout,aspectRatio:j,qualityType:q?.qualityType,qualityPercent:q?.qualityPercent},priority:q?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e}`})}`},T=()=>a.template`
|
|
33
|
+
${g.default({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",setting:{layout:q?.ftLayout,aspectRatio:j,qualityType:q?.qualityType,qualityPercent:q?.qualityPercent},priority:q?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none"})}`,k=i.getPaddingBottomByShapeSetting(q.ftShape),N=e.checkRenderFeaturedCarousel(q),W="gp-featured-image-wrapper",F=c.LiquidIf("product.media.size > 0",`${y||""} {% assign largestRatio = 0 %}
|
|
34
|
+
${c.LiquidFor("featureMedia in product.media",`
|
|
35
35
|
{% assign height = featureMedia.height | times: 1.0 %}
|
|
36
36
|
{% assign width = featureMedia.width | times: 1.0 %}
|
|
37
37
|
{% assign ratio = height | divided_by: width %}
|
|
38
|
-
${
|
|
38
|
+
${c.LiquidIf("ratio > largestRatio","{% assign largestRatio = ratio %}")}
|
|
39
39
|
`)}
|
|
40
|
-
${
|
|
40
|
+
${c.LiquidFor("featureMedia in product.media",`${c.LiquidIf("featureMedia.media_type == 'image'",`${c.LiquidFor("image in product.images",c.LiquidIf("image.src == featureMedia.src","{% assign imageID = image.id %}{% break %}"))}`,"{% assign imageID = '' %}")}
|
|
41
41
|
|
|
42
|
-
${
|
|
42
|
+
${c.Liquid(`{% assign productImageWidth = 0 %}
|
|
43
43
|
{% case featureMedia.media_type %}
|
|
44
44
|
{% when 'image' %}
|
|
45
45
|
{% assign productImageWidth = featureMedia.width %}
|
|
46
46
|
{% else %}
|
|
47
47
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
48
48
|
{% endcase %}`)}
|
|
49
|
-
${r.default({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${
|
|
49
|
+
${r.default({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${b("gp-ft-image-item !gp-min-w-full !gp-max-w-full' undefined")}`,parentId:`${f}-{{section.id}}-{{product.id}}`,style:L,customStyle:{width:"{{productImageWidth}}px"},children:`
|
|
50
50
|
<div
|
|
51
|
-
class="gp-w-full gp-relative ${
|
|
52
|
-
style="${
|
|
51
|
+
class="gp-w-full gp-relative ${c.LiquidIf("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
|
|
52
|
+
style="${p.getStyleOfObject(a.makeStyleResponsive("pb",k))} ${c.LiquidIf("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
|
|
53
53
|
>
|
|
54
|
-
${
|
|
54
|
+
${x()}
|
|
55
55
|
</div>
|
|
56
56
|
`})}`)}
|
|
57
|
-
`,
|
|
57
|
+
`,g.default({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:q?.preload,setting:{layout:q?.ftLayout,aspectRatio:j,qualityType:q?.qualityType,qualityPercent:q?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none"}));return c.Liquid(`
|
|
58
58
|
{% capture featureImageOnlyOne %}
|
|
59
|
-
${
|
|
59
|
+
${c.Liquid(`
|
|
60
60
|
{% assign featureMedia = variant.featured_media %}
|
|
61
61
|
{% unless featureMedia %}
|
|
62
62
|
{% assign featureMedia = product.featured_media %}
|
|
63
63
|
{% endunless %}
|
|
64
|
-
${
|
|
64
|
+
${c.LiquidIf("product.media.size > 1",(()=>{switch(q?.preDisplay){case"1st-images":return`
|
|
65
65
|
{% assign featureMedia = product.media.first %}
|
|
66
|
-
`;case"1st-3d-mode":return
|
|
66
|
+
`;case"1st-3d-mode":return c.LiquidFor("media in product.media",c.LiquidIf("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return c.LiquidFor("media in product.media",c.LiquidIf("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
|
|
67
67
|
{% assign featureMedia = variant.featured_media %}
|
|
68
68
|
{% unless featureMedia %}
|
|
69
69
|
{% assign featureMedia = product.featured_media %}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
{% assign height = featureMedia.height | times: 1.0 %}
|
|
74
74
|
{% assign width = featureMedia.width | times: 1.0 %}
|
|
75
75
|
{% assign ratio = height | divided_by: width %}
|
|
76
|
-
${
|
|
76
|
+
${c.LiquidIf("ratio > largestRatio","{% assign largestRatio = ratio %}")}
|
|
77
77
|
{% assign productImageWidth = 0 %}
|
|
78
78
|
{% case featureMedia.media_type %}
|
|
79
79
|
{% when 'image' %}
|
|
@@ -81,38 +81,38 @@
|
|
|
81
81
|
{% else %}
|
|
82
82
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
83
83
|
{% endcase %}
|
|
84
|
-
${
|
|
84
|
+
${c.LiquidIf("featureMedia == null","{% assign productImageWidth = 1600 %}")}
|
|
85
85
|
<div
|
|
86
86
|
class='gp-feature-image-carousel gp-feature-image-only'
|
|
87
|
-
style="${
|
|
87
|
+
style="${p.getStyleOfObject($)}"
|
|
88
88
|
>
|
|
89
89
|
<div
|
|
90
90
|
class="gp-relative"
|
|
91
|
-
style="${
|
|
91
|
+
style="${p.getStyleOfObject(w)}"
|
|
92
92
|
>
|
|
93
|
-
${
|
|
93
|
+
${y}
|
|
94
94
|
<div
|
|
95
95
|
type="gp-feature-image-only"
|
|
96
96
|
product-id="{{product.id}}"
|
|
97
97
|
product-media="{{product.media.size}}"
|
|
98
|
-
class="${
|
|
99
|
-
style="${
|
|
98
|
+
class="${M(W)}"
|
|
99
|
+
style="${p.getStyleOfObject(v)}"
|
|
100
100
|
>
|
|
101
101
|
<div
|
|
102
|
-
class="gp-w-full gp-relative ${
|
|
103
|
-
style="${
|
|
102
|
+
class="gp-w-full gp-relative ${c.LiquidIf("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
|
|
103
|
+
style="${p.getStyleOfObject(a.makeStyleResponsive("pb",k))} ${c.LiquidIf("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
|
|
104
104
|
>
|
|
105
|
-
${
|
|
105
|
+
${x()}
|
|
106
106
|
</div>
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
110
|
`)}
|
|
111
111
|
{% endcapture %}
|
|
112
|
-
${
|
|
113
|
-
${
|
|
114
|
-
${
|
|
112
|
+
${c.LiquidIf("product.media.size > 1",`
|
|
113
|
+
${c.If(N,`
|
|
114
|
+
${u.default({builderProps:{uid:f},rootId:`ft-${f}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:W,rootClass:`${I}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:S,rootStyles:$,styles:_,style:{playSpeed:600},disableMarginAuto:!0,children:F})}
|
|
115
115
|
`," ")}
|
|
116
|
-
${
|
|
116
|
+
${c.If(!N,"{{ featureImageOnlyOne }}"," ")}
|
|
117
117
|
`,"{{ featureImageOnlyOne }}")}
|
|
118
118
|
`)};
|
package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../composables/getProductImagesClassName.js"),r=require("../../composables/getProductImagesStyles.js"),s=require("../../composables/getProductImagesAttr.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../composables/getProductImagesClassName.js"),r=require("../../composables/getProductImagesStyles.js"),s=require("../../composables/getProductImagesAttr.js"),i=require("../../common/productGallery.js"),a=require("../../hooks/useGalleryCarousel.js"),o=require("../../common/productFeaturedImage.js"),l=require("../../../../../image/components/NextImage.js"),u=require("../../../../../carousel/components/item/CarouselItem.js"),d=require("../../../../../carousel/components/root/Carousel.js"),c=require("../lightbox/ButtonOpenLightBox.js"),m=require("../../common/common.js"),n=require("@gem-sdk/core"),g=require("../child/MediaIcon.js"),p=require("@gem-sdk/system");exports.default=y=>{let{builderPropUID:j,productImages:q,activeIndexFormFeatureImage:h,onClickFeatureArrow:I,builderPropsClass:x,arrow:C,priorityFeatureImage:P,...b}=y,v=n.useCurrentDevice(),{galleryItemClasses:f}=t.getProductImagesClassName(b),{galleryCarouselSettingAttrs:T}=s.getProductImagesAttr(b),{galleryCarouselStyle:A,galleryCarouselItemStyle:w}=r.getProductImagesStyles(b),{moveToIdx:M,isDisplay:N,shapeByLayout:k,isEnableBorderActive:G,isShowButtonLightbox:F,filteredProductImages:L,handleClickCarouselItem:$,safeMoveToIdx:B,setSliderReady:D}=a.useGalleryCarousel(y);return e.jsx(e.Fragment,{children:N&&e.jsx(d.default,{parentClass:x,rootClass:x,setting:T,styles:A,slidesClass:i.getEditorMinHeightClass(v,b.position,b.navigationPosition),builderProps:{uid:`${j}-carousel`},moveToIdx:B,isHiddenArrowWhenDisabled:!0,disableMarginAuto:!0,onLoaded:e=>{e&&D(!0)},children:L?.map((t,r)=>{let s=r===M,i=o.isFeatureMedia(t.contentType)?t.previewImage:t.src;return e.jsxs(u.default,{contentType:"productImage",className:f(`gp-gallery-image-item gem-slider-item-${j} ${s&&G?"gem-slider-item-active":""}`),onClickItem:()=>$(t?.id),style:w,"data-id":t?.id,"data-border":s&&b?.borderActive?"active":"deactive",children:[e.jsx(l.default,{sizeTarget:"GalleryList",listAware:!0,src:i,width:t?.width,height:t?.height,alt:t?.alt,setting:{aspectRatio:m.getAspectRatio(k),layout:b?.layout,qualityPercent:b?.qualityPercent,qualityType:b?.qualityType},style:{width:"100%",height:"100%",cursor:"pointer"},className:"product-list-image"}),e.jsx(g.default,{contentType:t?.contentType||""}),p.If(F,e.jsx(c.default,{}))]},t?.id)})})})};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),i=require("../../common/productGallery.js"),t=require("../../common/common.js"),o=require("../../composables/getProductImagesClassName.js"),s=require("../../../../../carousel/components/item/CarouselItem.liquid.js"),
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${s.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${o}`)}`,parentId:`${m}-{{product.id}}`,builderAttrs:{"data-outline":o?"active":"deactive"},style:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),i=require("../../common/productGallery.js"),t=require("../../common/common.js"),o=require("../../composables/getProductImagesClassName.js"),s=require("../../../../../carousel/components/item/CarouselItem.liquid.js"),r=require("../../composables/getProductImagesStyles.js"),a=require("../../../../../image/common/liquidSrcset.js"),l=require("../../../../../carousel/components/root/Carousel.liquid.js"),d=require("../../composables/getProductImagesAttr.js"),p=require("../../../../../image/components/NextImage.liquid.js"),g=require("../../../../helpers/function.js"),u=require("@gem-sdk/system");exports.default=({builderPropUID:m,children:n,pageContext:c,...C})=>{let{featuredImageGalleryClasses:y,galleryItemClasses:h}=o.getProductImagesClassName(C),{galleryCarouselSettingAttrs:v}=d.getProductImagesAttr(C),{galleryCarouselStyle:b,galleryCarouselItemStyle:f}=r.getProductImagesStyles(C),q=i.getShapeByLayout({shape:C.shape,shapeForBottom:C.shapeForBottom,shapeFor1Col:C.shapeFor1Col,shapeFor2Col:C.shapeFor2Col,shapeForFtOnly:C.shapeForFtOnly,shapeForInsideBottom:C.shapeForInsideBottom,shapeForInside:C.shapeForInside},C.position),L=a.getLiquidImageSrcset({liquidSrc:"media.preview_image",sizeTarget:"GalleryList",qualityType:C.qualityType,qualityPercent:C.qualityPercent}),w=(i,t)=>e.template`${p.default({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:L,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:i,style:t,className:"!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer"})}`,I=t.getPaddingBottomByShapeSetting(q),F=o=>`
|
|
2
|
+
${u.LiquidIf("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
|
|
3
|
+
${u.LiquidIf("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
|
|
4
|
+
${u.LiquidIf("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
|
|
5
|
+
${s.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${o}`)}`,parentId:`${m}-{{product.id}}`,builderAttrs:{"data-outline":o?"active":"deactive"},style:f,children:`
|
|
6
6
|
<div class="gp-w-full gp-relative"
|
|
7
|
-
style="${
|
|
7
|
+
style="${g.getStyleOfObject(e.makeStyleResponsive("pb",I))};"
|
|
8
8
|
>
|
|
9
|
-
${
|
|
9
|
+
${w({aspectRatio:t.getAspectRatio(q),layout:C?.layout,qualityPercent:C?.qualityPercent,qualityType:C?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
|
|
10
10
|
|
|
11
|
-
${
|
|
11
|
+
${u.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" >
|
|
12
12
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13
13
|
<rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
|
|
14
14
|
<path d="M17.6869 12.2646L17.6868 12.2646L6.78379 18.4464C6.78378 18.4464 6.78376 18.4464 6.78374 18.4464C6.52931 18.5903 6.1665 18.4179 6.1665 18.0416V5.95844C6.1665 5.58218 6.52917 5.40981 6.7836 5.55354C6.78366 5.55357 6.78373 5.55361 6.78379 5.55365L17.6868 11.7354L17.6869 11.7354C17.8819 11.846 17.8819 12.154 17.6869 12.2646Z" stroke="#F9F9F9" stroke-miterlimit="10"/>
|
|
15
15
|
</svg>
|
|
16
16
|
</div>`)}
|
|
17
|
-
${
|
|
17
|
+
${u.LiquidIf("media.media_type == 'model'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
|
|
18
18
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
|
|
20
20
|
<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"/>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</div>`)}
|
|
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="${g.getStyleOfObject(i.getZoomDisplay(C?.clickOpenLightBox))}"
|
|
26
26
|
>
|
|
27
27
|
<svg
|
|
28
28
|
height="100%"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</svg>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
|
-
`})}`,
|
|
44
|
-
${
|
|
45
|
-
${
|
|
43
|
+
`})}`,x=u.LiquidIf("product.media.size > 1",u.LiquidFor("media in product.media",`${u.LiquidIf("media.media_type == 'image'",u.LiquidFor("image in product.images",u.LiquidIf("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
|
|
44
|
+
${u.LiquidIf("media.id == product.featured_media.id ",F(C?.borderActive?.border!=="none"?"active":""),F())}`));return e.template`
|
|
45
|
+
${l.default({builderProps:{uid:m},rootId:`${m}-{{product.id}}`,rootClass:`${y}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:(()=>{let e=i.getCarouselVerticalConfigByPosition(C.position),t=[e.desktop?"gp-px-0":"gp-py-0",e.tablet?"tablet:gp-px-0":"tablet:gp-py-0",e.mobile?"mobile:gp-px-0":"mobile:gp-py-0"];return` ${t.join(" ")}`})(),slidesClass:i.getMinHeightByPosition(C.position,C.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:v,rootStyles:{...(()=>{let o=(i,t,o)=>{let s=e.getResponsiveValueByScreen(t,o),r=e.getResponsiveValueByScreen(i,o),a="slider"===r&&("bottom-center"===s||"inside-bottom"===s),l=["left","right","inside-left","inside-right"].includes(s??"");return l||a},s=i.checkDisplayGalleryByWidth({shapeByLayout:q}),r={desktop:s.desktop&&o(C.type,C.position,"desktop"),tablet:s.tablet&&o(C.type,C.position,"tablet"),mobile:s.mobile&&o(C.type,C.position,"mobile")};return t.getDisplayStyle(e=>!r[e],"flex")})()},styles:b,disableMarginAuto:!0,children:x})}
|
|
46
46
|
`};
|
package/dist/cjs/product/components/product-images-v2/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"),u=require("../../../../../image/components/Video.liquid.js"),g=require("../../../../helpers/function.js"),p=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)},I=()=>_(),b=()=>_(!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:p.getAspectRatio(w)}),F=()=>u.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,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:p.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="${g.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="${i?"active":"deactive"}"
|
|
56
|
-
class="${
|
|
57
|
-
style="${
|
|
56
|
+
class="${C(`gem-slider-item-${c}-{{product.id}} gp-gallery-image-item ${i}`)}"
|
|
57
|
+
style="${g.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-h-full 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-h-full gp-w-full" style="${m.LiquidIf("media == null or media.media_type == 'image'","display: block !important;")} ${m.LiquidIf("isVideo == true",g.getStyleOfObject({...b()}))}">
|
|
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",g.getStyleOfObject({...e.makeStyleResponsive("aspect",p.getAspectRatio(w))}))} ${g.getStyleOfObject({...I()})}"
|
|
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:p.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="${g.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-v2/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("@gem-sdk/core"),o=require("../../common/productFeaturedImage.js"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),o=require("../../common/productFeaturedImage.js"),s=require("../../../../../image/components/NextImage.js"),i=require("../../../../../carousel/components/item/CarouselItem.js"),l=require("../../../../../carousel/components/root/Carousel.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 u={desktop:"finest"};exports.default=({builderPropUID:p,productImages:c,open:m,imageRatio:g,onHandleClose:h})=>{let b=t.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=t.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(l.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}},styles:{sizeSetting:{desktop:{height:"80vh"},tablet:{height:"80vh"},mobile:{height:"60vh"}}},moveToIdx:j,hiddenDotWhenOnlyOne:!0,isHiddenArrowWhenDisabled:!0,builderProps:{uid:p},fullHeight:!0,children:c?.map(l=>e.jsx(i.default,{className:`gem-slider-item gem-slider-item-${p} gp-flex gp-items-center gp-justify-center gp-px-4`,children:k(l)?e.jsx(d.default,{type:l?.contentType,url:l.src??"",aspectRatio:g}):e.jsxs(e.Fragment,{children:[e.jsx(s.default,{src:o.isFeatureMedia(l?.contentType)?l?.previewImage:l?.src,width:l?.width,height:l?.height,alt:l?.alt,"content-type":l?.contentType,setting:{aspectRatio:g,qualityType:u},className:t.cls("gp-h-full gp-w-full gp-object-contain")},l?.id),e.jsx(n.default,{contentType:l?.contentType??""})]})},l?.id))})})};
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"collectionUrl": {{ collection.url | json }},
|
|
10
10
|
"collection": {% if collection %}{"handle":{{ collection.handle | json }}}{% else %}null{% endif %}
|
|
11
11
|
}
|
|
12
|
-
`,q=o.createAttr({"section-id":"{{section.id}}","data-id":`${y?.uid}`}),{isOnlyFeatureAllDevices:v,isRenderGalleryGrid:C}=e.getConditionRenderGalleryImages(I?.position,m?.type),F=C?{}:o.createAttr({"data-only-image":o.LiquidIf("product.media.size > 1","false","true")}),{wrapperClasses:L,productImagesGalleryClasses:P}=s.getProductImagesClassName(c),O=o.createClass({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),D=o.createClass({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:b,wrapContainerStyleOnlyOneImage:G,galleryImageStyle:z}=l.getProductImagesStyles(I),A=r.getShapeByLayout({shape:I.shape,shapeForBottom:I.shapeForBottom,shapeFor1Col:I.shapeFor1Col,shapeFor2Col:I.shapeFor2Col,shapeForFtOnly:I.shapeForFtOnly,shapeForInsideBottom:I.shapeForInsideBottom??r.sizeSettingDefaultForNewLayout,shapeForInside:I.shapeForInside??r.sizeSettingDefaultForNewLayout},I.position),N=e.getStyleInsideLayout(I.position,A,I?.spacing),_=()=>t.template`
|
|
13
|
-
${t.WrapRenderChildren({uid:y?.uid||"",customProps:h?.[0].customProps},h?.map(
|
|
12
|
+
`,q=o.createAttr({"section-id":"{{section.id}}","data-id":`${y?.uid}`}),{isOnlyFeatureAllDevices:v,isRenderGalleryGrid:C}=e.getConditionRenderGalleryImages(I?.position,m?.type),F=C?{}:o.createAttr({"data-only-image":o.LiquidIf("product.media.size > 1","false","true")}),{wrapperClasses:L,productImagesGalleryClasses:P}=s.getProductImagesClassName(c),O=o.createClass({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),D=o.createClass({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:b,wrapContainerStyleOnlyOneImage:G,galleryImageStyle:z}=l.getProductImagesStyles(I),A=r.getShapeByLayout({shape:I.shape,shapeForBottom:I.shapeForBottom,shapeFor1Col:I.shapeFor1Col,shapeFor2Col:I.shapeFor2Col,shapeForFtOnly:I.shapeForFtOnly,shapeForInsideBottom:I.shapeForInsideBottom??r.sizeSettingDefaultForNewLayout,shapeForInside:I.shapeForInside??r.sizeSettingDefaultForNewLayout},I.position),N=e.getStyleInsideLayout(I.position,A,I?.spacing),_=(e=!1)=>t.template`
|
|
13
|
+
${t.WrapRenderChildren({uid:y?.uid||"",customProps:h?.[0].customProps},h?.map(i=>{if(i)return t.template`${t.RenderChildren({...i,isInsideProductImage:!0,isInsideImageList:e,imageData:{imageShape:f?.ftShape,imageAlign:f?.align,imageLayout:f?.position},dotData:{dotSize:m?.ftDotSize,dotGapToCarousel:m?.ftDotGapToCarousel,dotStyle:m?.ftDotStyle}})}`}))}
|
|
14
14
|
`;return t.template`
|
|
15
15
|
${o.If(m?.borderActive?.border!=="none",o.LiquidIf("product.media.size > 1",`<style>${p.getBorderActiveCss({settings:I,uid:y?.uid,type:"Liquid"})}</style>`),"")}
|
|
16
16
|
${o.Liquid(`
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
${{...F}}
|
|
36
36
|
>
|
|
37
37
|
${o.LiquidIf("product.media.size > 1",a.default({builderPropUID:`gp-gallery-${y?.uid}`,...I,pageContext:S}))}
|
|
38
|
-
${o.If(C,u.default({builderPropUID:y?.uid,wrapperStyle:{...N},children:_(),...I,pageContext:S}))}
|
|
38
|
+
${o.If(C,u.default({builderPropUID:y?.uid,wrapperStyle:{...N},children:_(!0),...I,pageContext:S}))}
|
|
39
39
|
</div>
|
|
40
40
|
`)}
|
|
41
41
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@gem-sdk/core"),t=require("../../../../carousel-v3/common/selectors.js");const o=({carouselInstanceUID:e,builderPropUID:t})=>`${e??t}-carousel`,r=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},l=t=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t,r)?.shapeValue;if(l)o={...o,[r]:l};else{let l=e.getResponsiveValueByScreen(t,r)?.shape;switch(l){case"square":o={...o,[r]:"1/1"};break;case"vertical":o={...o,[r]:"3/4"};break;case"horizontal":o={...o,[r]:"4/3"};break;case"original":o={...o,[r]:""}}}}),e.makeAspectRatio(o)},
|
|
1
|
+
"use strict";var e=require("@gem-sdk/core"),t=require("../../../../carousel-v3/common/selectors.js");const o=({carouselInstanceUID:e,builderPropUID:t})=>`${e??t}-carousel`,r=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},l=t=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t,r)?.shapeValue;if(l)o={...o,[r]:l};else{let l=e.getResponsiveValueByScreen(t,r)?.shape;switch(l){case"square":o={...o,[r]:"1/1"};break;case"vertical":o={...o,[r]:"3/4"};break;case"horizontal":o={...o,[r]:"4/3"};break;case"original":o={...o,[r]:""}}}}),e.makeAspectRatio(o)},s=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},i=e=>{let t=e.match(/\d+/g);return t?t[0]:e},n=["only-feature","one-col","two-col"];exports.checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",r=e?.["--bbrr"]||"0px",l=e?.["--btlr"]||"0px",s=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==r||"0px"!==l||"0px"!==s},exports.convertSpacing=e=>{if(!e)return{desktop:5};let t=r(e.desktop,5),o=r(e.tablet,t),l=r(e.mobile,o);return{desktop:t,tablet:o,mobile:l}},exports.convertSpacingForIndisdeLayout=s,exports.convertUnitToNumber=r,exports.getAspectRatio=l,exports.getConditionRenderGalleryImages=(t,o)=>{let r=!0,l=!1;return["desktop","mobile","tablet"].forEach(s=>{let i=e.getResponsiveValueByScreen(t,s),n=e.getResponsiveValueByScreen(o,s);i&&"only-feature"!==i&&(r=!1),(["two-col","one-col"].includes(i)||"images"===n)&&(l=!0)}),{isOnlyFeatureAllDevices:r,isRenderGalleryGrid:l}},exports.getDisplayStyle=(e,t)=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{o={...o,[`--d${"desktop"===r?"":`-${r}`}`]:`${e(r)?"none":t}`}}),o},exports.getFeatureGalleryComponentKey=(t,o,r)=>{let l=e.getResponsiveValueByScreen(t?.ftShape,o)?.shape==="original",s=l?e.getResponsiveValueByScreen(t?.ftNavigationPosition,o):"";return[JSON.stringify(t?.position),s,o,r].join("|")},exports.getGalleryCarouselRootId=o,exports.getGalleryCarouselSelector=e=>t.getCarouselElementSelector(o(e)),exports.getGalleryCarouselShouldInitByLayout=t=>{let o={};return e.DEVICES.forEach(r=>{let l=e.getResponsiveValueByScreen(t,r);o[r]=null==l||!n.includes(l)}),o},exports.getPaddingBottomByShapeSetting=t=>{let o=l(t),r={desktop:"auto",mobile:"auto",tablet:"auto"};return["desktop","mobile","tablet"].forEach(l=>{let s=e.getResponsiveValueByScreen(t,l),n=s?.height,a=s?.width||"",u=i(n||""),p=a.toString().match(/px/g)?i(a):a;if(n&&a&&!isNaN(Number(u))&&!isNaN(Number(p))){r={...r,[l]:`${Number(u)/Number(p)*100}%`};return}if(n&&!isNaN(Number(u))){r={...r,[l]:n};return}let c=o?.[l]!=="auto"&&o?.[l]?o?.[l]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";r={...r,[l]:`calc((${c})*100%)`}}),r},exports.getProductImagesCarouselInstanceId=(e,t)=>{let o=e=>e.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),r=o(e||"product-images"),l=o(t);return[r||"product-images",l||"instance"].join("-")},exports.getStyleGridLayout=t=>{let o={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let r=!1;e.DEVICES.forEach(l=>{let s=e.getResponsiveValueByScreen(t.position,l),i=e.getResponsiveValueByScreen(t.ratioLayout,l),n=e.getResponsiveValueByScreen(t.ratioLayoutRight,l),a="desktop"===l?"--gtc":`--gtc-${l}`,u="desktop"===l?"--gtr":`--gtr-${l}`,p="left"===s?i:n,c=["left","right"].includes(s||"");c&&p?(r=!0,Object.assign(o={...o,[a]:`minmax(0, ${p[0]}fr) minmax(0, ${p[1]}fr)`},{[u]:"fit-content(0)"})):r&&Object.assign(o,{[u]:"unset"})})}return o},exports.getStyleGridOrderForFeature=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t.position,r),s="desktop"===r?"--o":`--o-${r}`;o={...o,[s]:"left"===l?"1":"0"}}),o},exports.getStyleGridOrderForGallery=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t.position,r),s="desktop"===r?"--o":`--o-${r}`;o={...o,[s]:"left"===l?"0":"1"}}),o},exports.getStyleInsideLayout=(t,o,r)=>{let l={},i={},n={},a={},u={},p={};return["desktop","mobile","tablet"].forEach(c=>{let d=e.getResponsiveValueByScreen(t,c),g=e.getResponsiveValueByScreen(o,c)?.width,m=e.getResponsiveValueByScreen(r,c);if(l={...l,[c]:["inside-bottom","inside-left","inside-right"].includes(d)?"absolute":"static"},["inside-bottom"].includes(d)){let e=s(m);g=`calc(100% - ${e})`}["bottom-center","two-col","one-col"].includes(d)&&(g="100%"),n={...n,[c]:"inside-bottom"===d?`${m}`:"auto"},a={...a,[c]:["inside-left","inside-right"].includes(d)?`${m}`:"auto"},p={...p,[c]:["inside-bottom","inside-left"].includes(d)?`${m}`:"auto"},u={...u,[c]:"inside-right"===d?`${m}`:"auto"},i={...i,[c]:g}}),{...e.makeStyleResponsive("pos",l),...e.makeStyleResponsive("w",e.removeNullUndefined(i)),...e.makeStyleResponsive("bottom",e.removeNullUndefined(n)),...e.makeStyleResponsive("top",e.removeNullUndefined(a)),...e.makeStyleResponsive("left",e.removeNullUndefined(p)),...e.makeStyleResponsive("right",e.removeNullUndefined(u))}},exports.getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,r=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:r}},exports.setDefaultWhenUndefineSetting=e=>({...e,setting:{...e.setting}}),exports.shouldRenderProductImageGallery=(e,t)=>(t??e).length>1;
|
package/dist/cjs/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.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("@gem-sdk/core"),r=require("../../common/productFeaturedImage.js"),o=require("../../../../../image/components/NextImage.js"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),r=require("../../common/productFeaturedImage.js"),o=require("../../../../../image/components/NextImage.js"),a=require("./ProductFeatureVideo.js"),s=require("react"),i=require("./MediaIcon.js");const c={src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:480,height:480,alt:"no image",contentType:"IMAGE"};var n=s.memo(({image:n,imageShowWhenHover:l,setting:u,aspectRatio:h})=>{let p=t.useProduct(),f=t.useCurrentDevice(),m=t.useShopStore(e=>e.storefrontUrl),{isEditMode:d,isPreviewSharePageMode:g}=t.useRenderMode(),y=s.useMemo(()=>"none"!==t.getResponsiveValueByScreen(u.ftClickOpenLightBox,f),[f,u.ftClickOpenLightBox]),v=s.useMemo(()=>!d&&["VIDEO","EXTERNAL_VIDEO"].includes(n?.contentType||"")&&!y,[d,n?.contentType,y]),T=s.useMemo(()=>n?{...n,src:v?n.src:r.isFeatureMedia(n?.contentType)?n?.previewImage:n.src}:c,[n,v]),w=s.useMemo(()=>{if(g)return"javascript:void(0)";if(!m)return"#";let e=new URL(m);return p?`${e.protocol}//${e.host}/products/${p.handle}`:"#"},[m,p,g]),x=s.useMemo(()=>u?.hoverEffect!=="none"&&!r.isFeatureMedia(T?.contentType),[T?.contentType,u?.hoverEffect]),j=s.useMemo(()=>u?.hoverEffect=="zoom"&&u?.zoomType=="glasses"&&!r.isFeatureMedia(T?.contentType),[T?.contentType,u?.hoverEffect,u?.zoomType]),E=s.useCallback(e=>"IMAGE"!==e.contentType?e.previewImage:e.src,[]),b=s.useMemo(()=>l?"other"!==u.hoverEffect?E(T):E(l):c.src,[l,T,u.hoverEffect,E]);return e.jsx(e.Fragment,{children:(r=>{if("product-link"===t.getResponsiveValueByScreen(u.ftClickOpenLightBox,f)){let t=u.ftClickOpenNewTab?"_blank":"_self";return e.jsx("a",{title:p?.title,href:w,className:"gp-w-full",target:t,children:r})}return r})(e.jsx(e.Fragment,{children:v?e.jsx(a.default,{type:T?.contentType,url:T.src??"",thumbnail:T?.previewImage,aspectRatio:h}):e.jsxs(e.Fragment,{children:[e.jsx(o.default,{sizeTarget:"ProductFeatureImage",listAware:!0,src:T.src,width:T?.width,height:T?.height,alt:T?.alt,setting:{qualityType:u?.qualityType,qualityPercent:u?.qualityPercent,aspectRatio:h,layout:u?.ftLayout},priority:u?.preload,className:"featured-image-only",style:{width:"100%",height:"100%",cursor:"pointer"}}),e.jsx(i.default,{contentType:T?.contentType??""}),x&&e.jsx(o.default,{sizeTarget:"ProductFeatureImage",listAware:!0,src:b,width:u?.hoverEffect==="other"?l?.width:T.width,height:u?.hoverEffect==="other"?l?.height:T.height,alt:u?.hoverEffect==="other"?l?.alt:T.alt,setting:{qualityType:u?.qualityType,qualityPercent:u?.qualityPercent,layout:u.ftLayout,aspectRatio:h},style:{width:"100%",height:"100%"},className:t.cls("hover-image featured-image-only !gp-max-w-none",r.getZoomImageClass()),priority:u?.preload}),j&&e.jsx("div",{className:t.cls(r.getZoomLenClass(),"room-len"),style:{...t.makeStyle({bgi:`url("${T?.src}")`})}})]})}))})});exports.default=n;
|
package/dist/cjs/product/components/product-images-v3/components/child/ProductGalleryGrid.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../common/productFeaturedImage.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../common/productFeaturedImage.js"),a=require("../../composables/getProductImagesClassName.js"),o=require("../../composables/getProductImagesStyles.js"),r=require("@gem-sdk/core"),s=require("../../common/hoverAction.js"),i=require("../../hooks/useProductGalleryGrid.js"),l=require("../../../../../image/components/NextImage.js"),c=require("../lightbox/ButtonOpenLightBox.js"),u=require("./ProductFeatureVideo.js"),n=require("../../common/common.js"),d=require("./MediaIcon.js"),m=require("react").memo(m=>{let{builderPropUID:g,productImages:y,onHandleClick:p,activeIndexFromFeatureImage:h,children:v,isHiddenInteraction:j,...q}=m,{isDisplay:x,shapeByLayout:T,imageActiveIndex:f,enableOpenLightBox:I,isEnableBorderActive:P,filteredProductImages:w}=i.useProductGalleryGrid(m),M=r.useCurrentDevice(),{isEditMode:R}=r.useRenderMode(),b=r.getResponsiveValueByScreen(q.position,M)||"",F=["one-col","two-col"].includes(b),A="bottom-center"===b,{galleryGridWrapperClasses:E,galleryItemClasses:N}=a.getProductImagesClassName(q),{galleryGridStyles:O,galleryGridItemStyles:B}=o.getProductImagesStyles(q),C=A?"none":q.galleryHoverEffect;return e.jsx(e.Fragment,{children:x&&e.jsxs("div",{"data-slot":"children","data-id":g,className:E,style:O,"gp-data-hidden":`${j}`,children:[w?.map((a,o)=>{let i=o===f,m=t.isFeatureMedia(a.contentType)?a.previewImage:a.src,y=!R&&F&&!I&&["VIDEO","EXTERNAL_VIDEO"].includes(a?.contentType||"");return e.jsxs("div",{"aria-hidden":!0,className:N(`gp-gallery-image-item gem-slider-item-${g} ${i&&P?"gem-slider-item-active":""}`),onClick:()=>p(a?.id||"",I),style:B,onMouseMove:e=>s.handleMouseMove(e,{hoverEffect:C,zoom:q.galleryZoom,zoomType:q.galleryZoomType}),onMouseOut:e=>s.handleMouseOut(e),"data-border":i&&q?.borderActive?"active":"deactive",children:[y?e.jsx(u.default,{type:a?.contentType,url:a?.src??"",thumbnail:a?.previewImage,aspectRatio:n.getAspectRatio(T)}):e.jsxs(e.Fragment,{children:[e.jsx(l.default,{sizeTarget:"ProductFeatureImage",listAware:!0,src:m,width:a?.width,height:a?.height,alt:a?.alt,setting:{qualityType:q?.qualityType,qualityPercent:q?.qualityPercent,aspectRatio:n.getAspectRatio(T),layout:q?.layout},style:{width:"100%",height:"100%"}},a?.id),e.jsx(d.default,{contentType:a?.contentType||""})]}),q?.galleryHoverEffect!=="none"&&!t.isFeatureMedia(a?.contentType)&&e.jsx(l.default,{sizeTarget:"ProductFeatureImage",listAware:!0,src:m,width:a?.width,height:a?.height,alt:a?.alt,setting:{qualityType:q?.qualityType,qualityPercent:q?.qualityPercent,layout:q.layout,aspectRatio:n.getAspectRatio(T)},className:r.cls("hover-image !gp-max-w-none",t.getZoomImageClass())}),q?.galleryHoverEffect=="zoom"&&q?.galleryZoomType=="glasses"&&["one-col","two-col"].includes(r.getResponsiveValueByScreen(q.position,M)||"")&&!t.isFeatureMedia(a?.contentType)&&e.jsx("div",{className:r.cls(t.getZoomLenClass(),"room-len"),style:{...r.makeStyle({bgi:`url("${a?.src}")`})}}),r.getResponsiveValueByScreen(q?.clickOpenLightBox,M)&&e.jsx(c.default,{})]},a?.id)}),v]})})});exports.default=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../common/common.js"),t=require("../../composables/getProductImagesClassName.js"),i=require("@gem-sdk/core"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../common/common.js"),t=require("../../composables/getProductImagesClassName.js"),i=require("@gem-sdk/core"),l=require("../../hooks/useFeatureImageWithGallery.js"),s=require("../../composables/getProductImagesStyles.js"),u=require("../child/ProductFeaturedImageCarousel.js"),a=require("../gallery-carousel/GalleryCarousel.js"),d=require("react"),n=require("../child/ProductGalleryGrid.js");exports.default=o=>{let{setting:c,styles:m,builderProps:g,gallery:p,featureGallery:I,onHandleClickImage:f,priorityFeatureImage:h,children:b,noDataChildren:y,isFilterByVariantEnabled:v}=o,{isEditMode:C}=i.useRenderMode(),x=d.useRef(null),j=i.useCurrentDevice(),P=i.useUniqProductID(),q=r.getProductImagesCarouselInstanceId(g?.uid,P),F=d.useRef(p);F.current=p;let k=d.useRef(I??p);k.current=I??p;let R=d.useRef(null);d.useEffect(()=>()=>{R.current?.(),R.current=null},[]);let w=d.useCallback((e,r)=>{if(e.destroyed||r.destroyed)return;let t=k.current[e.realIndex]?.id;if(void 0===t)return;let i=F.current.findIndex(e=>e?.id===t);if(r.slides?.forEach(e=>e.classList.remove("gem-slider-item-active")),i<0)return;let l=r.slides?.[i];l?.classList.add("gem-slider-item-active");let s=l?.getBoundingClientRect(),u=r.el?.getBoundingClientRect();if(!s||!u){r.slideTo(i);return}let a=r.params?.direction==="vertical"?s.top>=u.top-1&&s.bottom<=u.bottom+1:s.left>=u.left-1&&s.right<=u.right+1;a||r.slideTo(i)},[]),G=d.useCallback(e=>{if(!x.current)return;let r=x.current.getSwiper();if(r&&e){if(R.current?.(),R.current=null,v){let t=()=>w(r,e);r.on("slideChange",t),R.current=()=>{r.destroyed||r.off("slideChange",t)},t();return}r.thumbs&&r.thumbs.swiper&&r.thumbs.swiper?.realIndex===void 0&&(r.thumbs.swiper=e,r.thumbs.init(),r.thumbs.update(!0),r.update())}},[v,w]),D={...c,...m},{isShowCarousel:U,featureImageHeight:H,featureWrapperImage:N,onClickFeatureArrow:L,activeIndexFromFeatureImage:S,setOnClickFeatureArrow:$,onHandleLoadedFeatureImage:A,setActiveIndexFromFeatureImage:E}=l.useFeatureImageWithGallery(o),M=d.useMemo(()=>{if(void 0===S)return;let e=(I??p)[S]?.id;if(void 0===e)return;let r=p.findIndex(r=>r?.id===e);return r>-1?r:void 0},[S,I,p]);if(p?.[0]?.id==="noImageError"&&C)return e.jsx(e.Fragment,{children:y});let{ftImageGalleryClasses:T,imageGalleryWrapperClasses:B}=t.getProductImagesClassName(o),W=r.shouldRenderProductImageGallery(p,I),{wrapperFeaturedImageStyle:_,featureImageStyle:K,galleryImageStyle:O}=s.getProductImagesStyles(D,{isGalleryVisible:W,featureImageHeight:H}),V=`${r.getFeatureGalleryComponentKey(D,j,U)}|${v?"variant-filtered":"all-media"}`;return e.jsxs("div",{className:i.cls("gp-grid gp-w-full gp-relative"),style:_,children:[e.jsxs("div",{className:T,style:K,children:[b,e.jsx(u.default,{ref:x,imgRef:N,productImages:I??p,enableThumbsLink:!v,...D,onHandleClick:(e,r)=>f(e||"",r,!0),onHandleLoaded:A,onHandleUpdateActiveIndex:E,onClickArrow:e=>$(e),builderPropUID:g?.uid,carouselInstanceUID:q,builderPropsClass:`gp-product-images-feature-${g?.uid}`})]}),W&&e.jsx("div",{className:B,style:O,children:U?e.jsx(a.default,{productImages:p,position:D?.position,...D,builderPropUID:g?.uid,carouselInstanceUID:q,onHandleClick:(e,r)=>f(e||"",r),onSwiperReady:G,activeIndexFormFeatureImage:M,priorityFeatureImage:h,onClickFeatureArrow:L,builderPropsClass:`gp-product-images-gallery-${g?.uid}`}):e.jsx(n.default,{productImages:p,...D,builderPropUID:g?.uid,onHandleClick:(e,r)=>f(e||"",r),activeIndexFromFeatureImage:M,isHiddenInteraction:!0})})]},V)};
|