@gem-sdk/components 22.0.0-staging.48 → 23.0.0-dev.14
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.liquid.js +2 -2
- package/dist/cjs/article/components/ArticleList.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/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/hero-banner/components/HeroBannerItem.liquid.js +5 -5
- 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/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.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/settings/configs/settings.js +1 -1
- package/dist/cjs/image/settings/configs/ui-v2.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/settings/configs/settings.js +1 -1
- package/dist/cjs/image-comparison/settings/configs/ui-v2.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/hooks/useProductOfferData.js +1 -1
- package/dist/cjs/post-purchase/product/hooks/useHandleQuantity.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/file-upload/UploadFile.liquid.js +16 -16
- package/dist/cjs/product/components/file-upload/common/classes.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-discount-tag/ProductDiscountTag.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/feature-gallery/FeatureImageWithGallery.liquid.js +42 -42
- 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-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/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.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/composables/getProductImagesStyles.js +1 -1
- package/dist/cjs/product/components/product-list/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-list/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +2 -3
- package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-wrap/Product.js +1 -1
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +13 -13
- package/dist/cjs/product/components/product-wrap/hook/useProductSetting.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.liquid.js +9 -9
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +11 -11
- 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.liquid.js +3 -3
- package/dist/esm/article/components/ArticleList.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/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/hero-banner/components/HeroBannerItem.liquid.js +9 -9
- 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/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.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/settings/configs/settings.js +1 -1
- package/dist/esm/image/settings/configs/ui-v2.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/settings/configs/settings.js +1 -1
- package/dist/esm/image-comparison/settings/configs/ui-v2.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/hooks/useProductOfferData.js +1 -1
- package/dist/esm/post-purchase/product/hooks/useHandleQuantity.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/file-upload/UploadFile.liquid.js +19 -19
- package/dist/esm/product/components/file-upload/common/classes.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-discount-tag/ProductDiscountTag.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/feature-gallery/FeatureImageWithGallery.liquid.js +24 -24
- 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-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/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.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/composables/getProductImagesStyles.js +1 -1
- package/dist/esm/product/components/product-list/ProductList.js +1 -1
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +1 -1
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +1 -1
- package/dist/esm/product/components/product-list/common/helpers.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +6 -7
- package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +1 -1
- package/dist/esm/product/components/product-wrap/Product.js +1 -1
- package/dist/esm/product/components/product-wrap/Product.liquid.js +7 -7
- package/dist/esm/product/components/product-wrap/hook/useProductSetting.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.liquid.js +9 -9
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +11 -11
- 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 +5 -5
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../common/productFeaturedImage.js"),i=require("../../common/common.js"),a=require("../../common/classes.js"),t=require("@gem-sdk/core"),r=require("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),d=require("../../composables/getProductImagesClassName.js"),s=require("../../../../../carousel-v3/components/root/CarouselEmbla.liquid.js"),u=require("../../composables/getProductImagesStyles.js"),o=require("@gem-sdk/system"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../common/productFeaturedImage.js"),i=require("../../common/common.js"),a=require("../../common/classes.js"),t=require("@gem-sdk/core"),r=require("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),d=require("../../composables/getProductImagesClassName.js"),s=require("../../../../../carousel-v3/components/root/CarouselEmbla.liquid.js"),u=require("../../composables/getProductImagesStyles.js"),o=require("../../../../../image/common/liquidSrcset.js"),l=require("@gem-sdk/system"),g=require("../../composables/getProductImagesAttr.js"),m=require("../../../../../video/components/HTML5Embed.liquid.js"),c=require("../../../../../image/components/NextImage.liquid.js"),p=require("../../../../../image/components/Modal3d.liquid.js"),n=require("../../../../../image/components/Video.liquid.js"),f=require("../../../../helpers/function.js");exports.default=({builderPropUID:y,children:h,pageContext:q,...I})=>{let{featuredImageCarouselClasses:_,galleryItemClasses:M,featuredCarouselItemClasses:b}=d.getProductImagesClassName({...I,builderProps:{uid:y}}),{featuredImageCarouselStyle:v,featureImageStyle:$,featureImageCarouselOnlyOneImageStyle:w,featureImageOnlyOneImageStyle:L,featureImageCarouselItemStyle:S}=u.getProductImagesStyles(I),{featuredImageCarouselSettingAttrs:j}=g.getProductImagesAttr(I),x=i.getAspectRatio(I.ftShape),P=l.If("other"==I.hoverEffect,l.LiquidIf("product.media.size > 1","group-hover:gp-opacity-0")),R=()=>`
|
|
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
|
+
${T()}
|
|
8
8
|
{% when 'video' %}
|
|
9
9
|
{% assign mediaSourceVideo = featureMedia.sources.last.url %}
|
|
10
|
-
${
|
|
10
|
+
${C()}
|
|
11
11
|
{% when 'model' %}
|
|
12
12
|
${O()}
|
|
13
13
|
{% else %}
|
|
14
|
-
${
|
|
14
|
+
${k()}
|
|
15
15
|
{% endcase %}
|
|
16
|
-
`,O=()=>p.default({src:
|
|
17
|
-
${E(t.cls("gp-w-full gp-transition-opacity",
|
|
18
|
-
${
|
|
16
|
+
`,O=()=>p.default({src:l.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:x}),T=()=>n.default({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:x}),C=()=>{let i=l.createStyle({...e.getVideoHeight({ftLayout:I?.ftLayout,ftShape:I?.ftShape}),...t.makeStyleResponsive("objf",I?.ftLayout)}),a=l.createStyle({...e.getVideoHeight({ftLayout:I?.ftLayout,ftShape:I?.ftShape})});return m.default({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:a,poster:{altText:"{{featureMedia.alt | escape}}"},style:{width:"100%","max-height":"100%",...i},className:"gp-invisible"})},z=()=>t.template`
|
|
17
|
+
${E(t.cls("gp-w-full gp-transition-opacity",P,"{{shouldHidden}}"))}
|
|
18
|
+
${l.If(I?.hoverEffect!=="none",`<div class="${t.cls("zoom-element !gp-max-w-none",e.getZoomImageClass())}">
|
|
19
19
|
${E("image-zoom",!0)}
|
|
20
20
|
</div>`," ")}
|
|
21
|
-
${
|
|
22
|
-
`,E=(e,a)
|
|
21
|
+
${l.If(I?.hoverEffect=="zoom"&&I?.zoomType=="glasses",`<div class="${t.cls("zoom-lens-element",e.getZoomLenClass())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
|
|
22
|
+
`,E=(e,i)=>{let a=o.getLiquidImageSrcset({liquidSrc:"src",sizeTarget:"ProductFeatureImage",qualityType:I.qualityType,qualityPercent:I.qualityPercent});return t.template`
|
|
23
23
|
{% assign src = featureMedia.src %}
|
|
24
|
-
${
|
|
24
|
+
${l.If(i&&"other"==I.hoverEffect,`{% assign media_length = product.media | size %}
|
|
25
25
|
{% assign other_image_index = ${I.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
|
+
${l.LiquidIf("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
|
|
31
31
|
`)}
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
32
|
+
${c.default({srcIsLiquidCode:!0,src:l.LiquidIf("src != null","{{src | image_url}}","https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:l.LiquidIf("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:l.LiquidIf("src != null",a),setting:{layout:I?.ftLayout,aspectRatio:x,qualityType:I?.qualityType,qualityPercent:I?.qualityPercent},priority:I?.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??""}`})}`},k=()=>t.template`
|
|
33
|
+
${c.default({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",setting:{layout:I?.ftLayout,aspectRatio:x,qualityType:I?.qualityType,qualityPercent:I?.qualityPercent},priority:I?.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"})}`,A=i.getPaddingBottomByShapeSetting(I.ftShape),N=e.checkRenderFeaturedCarousel(I),F="gp-featured-image-wrapper",W=l.LiquidIf("product.media.size > 0",`{% assign largestRatio = 0 %}
|
|
34
|
+
${l.LiquidFor("featureMedia in product.media",`
|
|
35
|
+
${l.LiquidIf("featureMedia.media_type == 'video' and featureMedia.preview_image",`{% assign height = featureMedia.preview_image.height | times: 1.0 %}
|
|
36
36
|
{% assign width = featureMedia.preview_image.width | times: 1.0 %}`,`{% assign height = featureMedia.height | times: 1.0 %}
|
|
37
37
|
{% assign width = featureMedia.width | times: 1.0 %}`)}
|
|
38
38
|
{% assign ratio = height | divided_by: width %}
|
|
39
|
-
${
|
|
39
|
+
${l.LiquidIf("ratio > largestRatio","{% assign largestRatio = ratio %}")}
|
|
40
40
|
`)}
|
|
41
|
-
${
|
|
41
|
+
${l.LiquidFor("featureMedia in product.media",`${l.LiquidIf("featureMedia.media_type == 'image'",`${l.LiquidFor("image in product.images",l.LiquidIf("image.src == featureMedia.src","{% assign imageID = image.id %}{% break %}"))}`,"{% assign imageID = '' %}")}
|
|
42
42
|
|
|
43
|
-
${
|
|
43
|
+
${l.Liquid(`{% assign productImageWidth = 0 %}
|
|
44
44
|
{% case featureMedia.media_type %}
|
|
45
45
|
{% when 'image' %}
|
|
46
46
|
{% assign productImageWidth = featureMedia.width %}
|
|
47
47
|
{% else %}
|
|
48
48
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
49
49
|
{% endcase %}`)}
|
|
50
|
-
${r.default({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${
|
|
50
|
+
${r.default({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${M("gp-ft-image-item !gp-min-w-full !gp-max-w-full ")}`,parentId:`ft-${y}-{{section.id}}-{{product.id}}`,style:S,customStyle:{width:"{{productImageWidth}}px"},children:`
|
|
51
51
|
<div
|
|
52
|
-
class="gp-w-full gp-relative ${
|
|
53
|
-
style="${
|
|
52
|
+
class="gp-w-full gp-relative ${l.LiquidIf("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")} ${l.LiquidIf("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'",`{{ '${a.FEATURE_MEDIA_CENTER_CLASSES}' }}`)}"
|
|
53
|
+
style="${f.getStyleOfObject(t.makeStyleResponsive("pb",A))}"
|
|
54
54
|
>
|
|
55
55
|
${R()}
|
|
56
56
|
</div>
|
|
57
57
|
`})}`)}
|
|
58
|
-
`,
|
|
58
|
+
`,c.default({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:I?.preload,setting:{layout:I?.ftLayout,aspectRatio:x,qualityType:I?.qualityType,qualityPercent:I?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none"}));return l.Liquid(`
|
|
59
59
|
{% capture featureImageOnlyOne %}
|
|
60
|
-
${
|
|
60
|
+
${l.Liquid(`
|
|
61
61
|
{% assign featureMedia = variant.featured_media %}
|
|
62
62
|
{% unless featureMedia %}
|
|
63
63
|
{% assign featureMedia = product.featured_media %}
|
|
64
64
|
{% endunless %}
|
|
65
|
-
${
|
|
65
|
+
${l.LiquidIf("product.media.size > 1",(()=>{switch(I?.preDisplay){case"1st-images":return`
|
|
66
66
|
{% assign featureMedia = product.media.first %}
|
|
67
|
-
`;case"1st-3d-mode":return
|
|
67
|
+
`;case"1st-3d-mode":return l.LiquidFor("media in product.media",l.LiquidIf("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return l.LiquidFor("media in product.media",l.LiquidIf("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
|
|
68
68
|
{% assign featureMedia = variant.featured_media %}
|
|
69
69
|
{% unless featureMedia %}
|
|
70
70
|
{% assign featureMedia = product.featured_media %}
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
{% assign height = featureMedia.height | times: 1.0 %}
|
|
75
75
|
{% assign width = featureMedia.width | times: 1.0 %}
|
|
76
76
|
{% assign ratio = height | divided_by: width %}
|
|
77
|
-
${
|
|
77
|
+
${l.LiquidIf("ratio > largestRatio","{% assign largestRatio = ratio %}")}
|
|
78
78
|
{% assign productImageWidth = 0 %}
|
|
79
79
|
{% case featureMedia.media_type %}
|
|
80
80
|
{% when 'image' %}
|
|
@@ -82,26 +82,26 @@
|
|
|
82
82
|
{% else %}
|
|
83
83
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
84
84
|
{% endcase %}
|
|
85
|
-
${
|
|
85
|
+
${l.LiquidIf("featureMedia == null","{% assign productImageWidth = 1600 %}")}
|
|
86
86
|
<div
|
|
87
87
|
class='gp-feature-image-carousel gp-feature-image-only'
|
|
88
|
-
style="${
|
|
88
|
+
style="${f.getStyleOfObject($)}"
|
|
89
89
|
>
|
|
90
90
|
<div
|
|
91
91
|
class="gp-relative"
|
|
92
|
-
style="${
|
|
92
|
+
style="${f.getStyleOfObject(L)}"
|
|
93
93
|
>
|
|
94
94
|
${h}
|
|
95
95
|
<div
|
|
96
96
|
type="gp-feature-image-only"
|
|
97
97
|
product-id="{{product.id}}"
|
|
98
98
|
product-media="{{product.media.size}}"
|
|
99
|
-
class="${
|
|
100
|
-
style="${
|
|
99
|
+
class="${b(F)}"
|
|
100
|
+
style="${f.getStyleOfObject(w)}"
|
|
101
101
|
>
|
|
102
102
|
<div
|
|
103
|
-
class="gp-w-full gp-relative ${
|
|
104
|
-
style="${
|
|
103
|
+
class="gp-w-full gp-relative ${l.LiquidIf("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
|
|
104
|
+
style="${f.getStyleOfObject(t.makeStyleResponsive("pb",A))} ${l.LiquidIf("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
|
|
105
105
|
>
|
|
106
106
|
${R()}
|
|
107
107
|
</div>
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
</div>
|
|
111
111
|
`)}
|
|
112
112
|
{% endcapture %}
|
|
113
|
-
${
|
|
114
|
-
${
|
|
115
|
-
${s.default({builderProps:{uid:
|
|
113
|
+
${l.LiquidIf("product.media.size > 1",`
|
|
114
|
+
${l.If(N,`
|
|
115
|
+
${s.default({builderProps:{uid:y},rootId:`ft-${y}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:F,rootClass:`${_}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:j,rootStyles:$,styles:v,style:{playSpeed:600},disableMarginAuto:!0,children:W,productBadgeLiquid:h||"",carouselType:"feature_image"})}
|
|
116
116
|
`," ")}
|
|
117
|
-
${
|
|
117
|
+
${l.If(!N,"{{ featureImageOnlyOne }}"," ")}
|
|
118
118
|
`,"{{ featureImageOnlyOne }}")}
|
|
119
119
|
`)};
|
|
@@ -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("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${o.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${e??""}`)}`,parentId:`${
|
|
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("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),r=require("../../composables/getProductImagesClassName.js"),s=require("../../../../../carousel-v3/components/root/Carousel.liquid.js"),a=require("../../composables/getProductImagesStyles.js"),l=require("../../../../../image/common/liquidSrcset.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}=r.getProductImagesClassName(C),{galleryCarouselSettingAttrs:v}=d.getProductImagesAttr(C),{galleryCarouselStyle:L,galleryCarouselItemStyle:f}=a.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),b=l.getLiquidImageSrcset({liquidSrc:"media.preview_image",sizeTarget:"GalleryList",qualityType:C.qualityType,qualityPercent:C.qualityPercent}),I=(i,t)=>e.template`${p.default({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:b,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-top-0 gp-left-0 gp-cursor-pointer"})}`,w=e=>`
|
|
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
|
+
${o.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${e??""}`)}`,parentId:`${m}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:f,children:`
|
|
6
6
|
<div class="gp-w-full gp-relative gp-h-full"
|
|
7
7
|
|
|
8
8
|
>
|
|
9
|
-
${
|
|
9
|
+
${I({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
|
+
`})}`,F=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 ",w(C?.borderActive?.border!=="none"?"active":""),w())}`));return e.template`
|
|
45
|
+
${s.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 r=e.getResponsiveValueByScreen(t,o),s=e.getResponsiveValueByScreen(i,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),l=["left","right","inside-left","inside-right"].includes(r??"");return l||a},r=i.checkDisplayGalleryByWidth({shapeByLayout:q}),s={desktop:r.desktop&&o(C.type,C.position,"desktop"),tablet:r.tablet&&o(C.type,C.position,"tablet"),mobile:r.mobile&&o(C.type,C.position,"mobile")};return t.getDisplayStyle(e=>!s[e],"flex")})()},styles:L,disableMarginAuto:!0,children:F,shouldInitByLayout:t.getGalleryCarouselShouldInitByLayout(C.position),carouselType:"feature_image_thumbs"})}
|
|
46
46
|
`};
|
|
@@ -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("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${o.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${e??""}`)}`,parentId:`${
|
|
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("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),r=require("../../composables/getProductImagesClassName.js"),s=require("../../../../../carousel-v3/components/root/CarouselEmbla.liquid.js"),a=require("../../composables/getProductImagesStyles.js"),l=require("../../../../../image/common/liquidSrcset.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}=r.getProductImagesClassName(C),{galleryCarouselSettingAttrs:v}=d.getProductImagesAttr(C),{galleryCarouselStyle:L,galleryCarouselItemStyle:f}=a.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),b=l.getLiquidImageSrcset({liquidSrc:"media.preview_image",sizeTarget:"GalleryList",qualityType:C.qualityType,qualityPercent:C.qualityPercent}),I=(i,t)=>e.template`${p.default({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:b,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-top-0 gp-left-0 gp-cursor-pointer"})}`,w=e=>`
|
|
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
|
+
${o.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${e??""}`)}`,parentId:`${m}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:f,children:`
|
|
6
6
|
<div class="gp-w-full gp-relative gp-h-full"
|
|
7
7
|
|
|
8
8
|
>
|
|
9
|
-
${
|
|
9
|
+
${I({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
|
+
`})}`,F=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 ",w(C?.borderActive?.border!=="none"?"active":""),w())}`));return e.template`
|
|
45
|
+
${s.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 r=e.getResponsiveValueByScreen(t,o),s=e.getResponsiveValueByScreen(i,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),l=["left","right","inside-left","inside-right"].includes(r??"");return l||a},r=i.checkDisplayGalleryByWidth({shapeByLayout:q}),s={desktop:r.desktop&&o(C.type,C.position,"desktop"),tablet:r.tablet&&o(C.type,C.position,"tablet"),mobile:r.mobile&&o(C.type,C.position,"mobile")};return t.getDisplayStyle(e=>!s[e],"flex")})()},styles:L,disableMarginAuto:!0,children:F,shouldInitByLayout:t.getGalleryCarouselShouldInitByLayout(C.position),carouselType:"feature_image_thumbs"})}
|
|
46
46
|
`};
|
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'}}",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>`)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../common/styles.js"),t=require("@gem-sdk/system");exports.getProductImagesStyles=(l
|
|
1
|
+
"use strict";var e=require("../common/styles.js"),t=require("@gem-sdk/system");exports.getProductImagesStyles=(a,l)=>{let r=t.createStyle(e.getWrapContainerStyle(a)),y=t.createStyle(e.getWrapContainerStyle(a,!0)),g=t.createStyle(e.getWrapContainerStyle(a,l?.isGalleryVisible===!1)),S=t.createStyle(e.getFeatureImageStyle(a,{enableOrder:!0,enableDisplay:!0})),s=t.createStyle(e.getFeaturedImageOnlyOneImageStyle({setting:a,options:{enableRadius:!0,enableHeight:!0}})),i=t.createStyle(e.getGalleryImageStyle(a,l?.featureImageHeight)),m=t.createStyle(e.getFeaturedImageCarouselStyle(a)),u=t.createStyle({...e.getFeatureImageCarouselItemStyle(a)}),c=t.createStyle({...e.getFeatureImageCarouselItemStyle(a),width:"{{productImageWidth}}px"}),n=t.createStyle(e.getGalleryGridStyle(a)),o=t.createStyle(e.getGalleryGridItemStyle(a)),I=t.createStyle(e.getGalleryCarouselStyle(a)),d=t.createStyle(e.getGalleryCarouselItemStyle(a));return{wrapContainerStyle:r,wrapContainerStyleOnlyOneImage:y,wrapperFeaturedImageStyle:g,featureImageStyle:S,featureImageOnlyOneImageStyle:s,galleryImageStyle:i,featuredImageCarouselStyle:m,featureImageCarouselItemStyle:u,featureImageCarouselOnlyOneImageStyle:c,galleryGridStyles:n,galleryGridItemStyles:o,galleryCarouselStyle:I,galleryCarouselItemStyle:d}};
|
|
@@ -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"),s=require("next/dynamic"),l=require("../SalePageProductListWarning.js"),i=require("../../../dialog/common/helpers.js"),n=require("./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=s(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:a.default});exports.default=s=>{let{children:C,styles:f,builderProps:S,setting:O,builderAttrs:p}=s,{isRelatedProduct:I,productSetting:y}=n.getData(s),R=y.relatedTag&&y.relatedTag[0],{isEditMode:_,isPreviewSharePageMode:U}=o.useRenderMode(),b=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:_||U},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:_||U},z),ee=_||U,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:O?.numberOfProducts??4,orderBy:O?.orderBy}),[y?.collectionId,Number(O?.numberOfProducts),O?.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:O?.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:O?.numberOfProducts,idNEQ:$.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t},{titleNotIn:e}]}]}:{first:O?.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:O?.numberOfProducts,idNEQ:$.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:$.tags},{nameNotIn:e}]}]}:{first:O?.numberOfProducts,idNEQ:$.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:$.tags}]}]}),W($.id)}}},[$,y.relatedType,y.relatedTag,O?.numberOfProducts,y.relatedExclude,y.hasRelatedExclude,I]);let ed=G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct,ea=ed?et:eo,es=ea.isValidating,el=ea.error,ei=t.isQueryLoading({hasQuery:ee&&(!ed||!!y?.productIds),data:ea.data,error:ea.error,isLoading:ea.isLoading}),en=n.isRelatedProductsLoading({isRelatedProduct:I,relatedType:y.relatedType,hasRelatedTag:!!y.relatedTag?.length,relatedProductIdAssigned:A,canRefetchMainProduct: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(!O?.sameHeight)return[];let e=0,t=Math.ceil((eP?.length??0)/+(O?.slidesToShow?.[b]??1));return Array.from(Array(eP?.length??0)).map((r,o)=>(o>=+(O?.slidesToShow?.[b]??1)*(e+1)&&++e,{gridRow:`${1+E*e}/${E+1+E*e}`,marginBottom:e+1<t?i.getPropertyByDevice(f?.horizontalGutter,b):void 0}))},[O?.sameHeight,O?.slidesToShow,E,eP?.length,b,f?.horizontalGutter]),ef=d.useMemo(()=>es||ec||el||!eP||N&&I,[el,ec,N,I,es,eP]);d.useEffect(()=>{ef||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,ef,_]);let eS=d.useMemo(()=>({collection:eu,products:eP,settings:{loop:O?.loop??{desktop:!1},scrollMode:O?.scrollMode??{desktop:"snap"},slidesToShow:O?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:f?.layout,dot:O?.dot,dotStyle:O?.dotStyle,arrow:O?.arrow,controlOverContent:O?.controlOverContent,sameHeight:O?.sameHeight},styles:{horizontalGutter:f?.horizontalGutter,verticalGutter:f?.verticalGutter,fullWidth:f?.fullWidth,spacing:f?.spacing,width:f?.width,height:f?.height}}),[eu,eP,O,f]);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:eO,productListContentStyle:ep,productListWrapAlignStyle:eI}=m.getStyle(s),{productListWrapClass:ey}=g.getClass(s);return e.jsxs("div",{...p,className:ey,style:eO,children:[!!f?.preloadBgImage&&e.jsxs(h,{children:[!!f.backgroundImage?.desktop?.image?.src&&e.jsx("link",{rel:"preload",href:f.backgroundImage.desktop.image.src,as:"image"}),!!f.backgroundImage?.tablet?.image?.src&&e.jsx("link",{rel:"preload",href:f.backgroundImage?.tablet?.image?.src,as:"image"}),!!f.backgroundImage?.mobile?.image?.src&&e.jsx("link",{rel:"preload",href:f.backgroundImage?.mobile?.image?.src,as:"image"})]}),es||ec?e.jsx(a.default,{label:t.getElementLabel(S?.builderData)}):el?e.jsxs("div",{children:["Error: ",el?.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(l.default,{}),e.jsx(e.Fragment,{children:P.If(f?.layout==="grid",e.jsx(u.default,{...s,productSortedById:eP,generateGridRowArray:eC}),e.jsx(c.default,{...s,productSortedById:eP}))})]})})}),o.filterToolbarPreview(C,!0)]})};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/classes.js"),e=require("@gem-sdk/core");exports.default=n=>{let{pageContext:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/classes.js"),e=require("@gem-sdk/core");exports.default=n=>{let{pageContext:a,children:o}=n,{productItemClass:r,gpProductClass:i}=t.getClass(n);return e.template`
|
|
2
2
|
<gp-product
|
|
3
|
-
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
6
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(
|
|
6
|
+
<script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
|
|
7
7
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${r}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
8
8
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
9
9
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
10
10
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
11
|
-
${
|
|
11
|
+
${o}
|
|
12
12
|
{%- endform -%}
|
|
13
13
|
</gp-product>
|
|
14
14
|
`};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@gem-sdk/core"),e=require("./common/classes.js");exports.default=n=>{let{pageContext:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@gem-sdk/core"),e=require("./common/classes.js");exports.default=n=>{let{pageContext:a,rawChildren:o}=n,{productItemClass:r,gpProductClass:i}=e.getClass(n);return t.template`
|
|
2
2
|
<gp-product
|
|
3
|
-
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
6
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(
|
|
6
|
+
<script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
|
|
7
7
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${r}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
8
8
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
9
9
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
10
10
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
11
11
|
${t.template`
|
|
12
|
-
${
|
|
12
|
+
${o?.map((e,n)=>{if(e)return t.template`
|
|
13
13
|
${t.RenderChildren({...e,index:n})}
|
|
14
14
|
`}).join("")}
|
|
15
15
|
`}
|
|
@@ -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/";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 n={...d,sizeSetting:{...r.getSizeSetting({adaptiveHeight:d?.adaptiveHeight,height:d?.height,fullWidth:{desktop:!0}})},spacing:d?.spacing};return delete n.backgroundColor,delete n.backgroundImage,{isRelatedProduct:i,productSetting:c,dotStyle:l,carouselConfigSetting:u,carouselConfigStyle:n}},exports.getDataLiquid=e=>{let{setting:r,styles:o}=e,i=r?.productSetting,l=i?.relatedTag,u=i?.hasRelatedExclude,n=(l&&"collection"===l[0]?i?.relatedCollectionExclude:i?.relatedTagsExclude)??"",a=n?.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:[],I=r?.orderBy&&r?.orderBy!=="none",y=(i?.productSrc==="Collection"||i?.productSrc==="DynamicCollection")&&I?r?.orderBy?.split("_"):"none",k=I&&y?.[0]==="TITLE"?"| sort: 'title'":"| sort: 'updated_at'",C=y?.[y.length-1]==="DESC";return{hasRelatedExclude:u,relatedExcludeTrim:a,collectionID:p,isLatestProducts:g,isGrid:m,numberOfProducts:h,productListId:S,productListHandles:P,sortedBy:k,isReverse:C,productSrc:s,productSetting:i,isSorted:I,relatedTag:l,productNumber:"PickProduct"===s?g?4:i?.numOfSelectedProducts??4:h,collectionHandle:i?.collectionHandle}},exports.isRelatedProductsLoading=({isRelatedProduct:e,relatedType:t,hasRelatedTag:r,relatedProductIdAssigned:d,canRefetchMainProduct:c,mainProduct:i,mainProductId:l,relatedQuery:u,relatedQuerySource:n,isNotFoundRelatedProduct:a,relatedProducts:s})=>{if(!e)return!1;let p="recommended-product"!==t&&r&&!!d,g=p&&!!i.data&&n!==l&&!a;return o.isQueryLoading({hasQuery:p&&c,...i})||g||o.isQueryLoading({hasQuery:!!u,...s})};
|