@gem-sdk/components 4.0.0-staging.1212 → 4.0.0-staging.1213
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/product/components/product-images-v3/common/styles.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +5 -5
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +1 -1
- package/dist/esm/product/components/product-images-v3/common/styles.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +15 -15
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),common=require("./common.js"),productGallery=require("./productGallery.js");const DEVICES=["desktop","mobile","tablet"];function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getWrapContainerStyle=(e,t)=>{let o=common.getStyleGridLayout({position:e.position,ratioLayout:e.ratioLayout,ratioLayoutRight:e.ratioLayoutRight,isHiddenGalleryImages:!!t}),r={"--gtc":"minmax(0, 12fr)"},a={...t?r:o,...core.makeStyleResponsive("gg",e?.spacing)};return filterTruthyStyles(a)},getFeatureImageStyle=(e,{enableOrder:t,enableDisplay:o})=>{let r=()=>common.getDisplayStyle(t=>!["bottom-center","left","right","only-feature","inside-bottom","inside-left","inside-right"].includes(core.getResponsiveValueByScreen(e?.position,t)||""),"flex"),a=common.getStyleGridOrderForFeature({position:e?.position}),l={...core.makeStyleResponsive("jc",e?.align),...t&&{...a},...o&&{...r()}};return filterTruthyStyles(l)},getGalleryImageStyle=(e,t)=>{let o=common.getStyleGridOrderForGallery({position:e.position}),r=()=>{let o={},r=t??0;return DEVICES.forEach(t=>{let a=core.getResponsiveValueByScreen(e?.position,t),l=["left","right"].includes(a),i=core.getResponsiveValueByScreen(e?.spacing,t),s=["inside-left","inside-right"].includes(a),n=common.convertSpacingForIndisdeLayout(i),p=`calc(${r}px - ${n})`;o={...o,[t]:l?r+"px":s?p:"auto"}}),o},a=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom??productGallery.sizeSettingDefaultForNewLayout,shapeForInside:e.shapeForInside??productGallery.sizeSettingDefaultForNewLayout},e.position),l=common.getStyleInsideLayout(e.position,a,e?.spacing),i={...core.makeStyleResponsive("h",core.makeHeight(r())),...core.makeStyleResponsive("jc",e?.align),...o,...l};return filterTruthyStyles(i)},getGalleryGridStyle=(e,t)=>{let o=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),r=()=>{let t=(e,t,o)=>{let r=core.getResponsiveValueByScreen(t,o),a=core.getResponsiveValueByScreen(e,o),l="slider"!==a&&("bottom-center"===r||"inside-bottom"===r),i=["one-col","two-col"].includes(r||"");return l||i},r=productGallery.checkDisplayGalleryByWidth({shapeByLayout:o}),a={desktop:r.desktop&&t(e.type,e.position,"desktop"),tablet:r.tablet&&t(e.type,e.position,"tablet"),mobile:r.mobile&&t(e.type,e.position,"mobile")};return common.getDisplayStyle(e=>!a[e],"flex")},a={...r(),...core.makeStyleResponsive("cg",e?.itemSpacing),...core.makeStyleResponsive("rg",e?.itemSpacing),...core.makeStyleResponsive("jc",e?.align),...t};return filterTruthyStyles(a)},getGalleryGridItemStyle=e=>{let t=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=core.getHeightByShapeGlobalSize(t),r=productGallery.getSettingWidthForGridItem({shapeByLayout:t,itemSpacing:e.itemSpacing}),a={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...core.makeStyleResponsive("h",core.makeHeight(o)),...core.makeStyleResponsive("w",core.makeWidth(r)),...core.composeRadius({normal:e.corner})};return filterTruthyStyles(a)},getFeatureImageCarouselItemStyle=e=>{let t=core.getHeightByShapeGlobalSize(e.ftShape),o={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...core.composeRadius({normal:e?.ftCorner}),...core.makeStyleResponsive("h",core.makeHeight(t))};return filterTruthyStyles(o)},getGalleryCarouselStyle=e=>{let t=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=o=>{let r=core.getResponsiveValueByScreen(e?.position,o),a="bottom-center"===r||"inside-bottom"===r,l="inside-left"===r||"inside-right"===r||"left"===r||"right"===r,i=core.getResponsiveValueByScreen(t,o);return a||l||!i?.width?"100%":i.width},r={spacing:common.convertSpacing(e?.itemSpacing),sizeSetting:{desktop:{width:o("desktop"),height:"100%"},tablet:{width:o("tablet"),height:"100%"},mobile:{width:o("mobile"),height:"100%"}}};return filterTruthyStyles(r)},getGalleryCarouselItemStyle=e=>{let t=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=core.makeStyleResponsive("minw",core.makeWidth(productGallery.getSettingMinWidthForCarouselItem({shapeByLayout:t,position:e.position,spacing:e.itemSpacing}))),r=core.makeStyleResponsive("maxw",core.makeWidth(productGallery.getSettingMinWidthForCarouselItem({shapeByLayout:t,position:e.position,spacing:e.itemSpacing}))),a=core.makeStyleResponsive("w",core.makeWidth(productGallery.getSettingWidthForCarouselItem({shapeByLayout:t,position:e.position}))),l=core.makeStyleResponsive("h",core.makeHeight(core.getHeightByShapeGlobalSize(t))),i={"outline-color":"var(--g-c-brand, brand)",...o,...r,...a,...l,...core.composeRadius({normal:e.corner})};return filterTruthyStyles(i)},getFeaturedImageCarouselStyle=e=>{let t=t=>{let o=core.getResponsiveValueByScreen(e.ftShape,t);return o?.width??"100%"},o={playSpeed:e?.ftAnimationSpeed,sizeSetting:{desktop:{width:t("desktop"),height:"auto"},tablet:{width:t("tablet"),height:"auto"},mobile:{width:t("mobile"),height:"auto"}},align:{desktop:core.getResponsiveValueByScreen(e?.align,"desktop"),tablet:core.getResponsiveValueByScreen(e?.align,"tablet"),mobile:core.getResponsiveValueByScreen(e?.align,"mobile")},spacing:{desktop:6,tablet:6,mobile:6}};return filterTruthyStyles(o)},getFeaturedImageOnlyOneImageStyle=({setting:e,options:t})=>{let o=core.getHeightByShapeGlobalSize(e?.ftShape),r={...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(e?.ftShape,!1,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...t?.enableRadius&&core.composeRadius({normal:e?.ftCorner}),...t?.enableHeight&&core.makeStyleResponsive("h",core.makeHeight(o))};return filterTruthyStyles(r)};exports.getFeatureImageCarouselItemStyle=getFeatureImageCarouselItemStyle,exports.getFeatureImageStyle=getFeatureImageStyle,exports.getFeaturedImageCarouselStyle=getFeaturedImageCarouselStyle,exports.getFeaturedImageOnlyOneImageStyle=getFeaturedImageOnlyOneImageStyle,exports.getGalleryCarouselItemStyle=getGalleryCarouselItemStyle,exports.getGalleryCarouselStyle=getGalleryCarouselStyle,exports.getGalleryGridItemStyle=getGalleryGridItemStyle,exports.getGalleryGridStyle=getGalleryGridStyle,exports.getGalleryImageStyle=getGalleryImageStyle,exports.getWrapContainerStyle=getWrapContainerStyle;
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),common=require("./common.js"),productGallery=require("./productGallery.js");const DEVICES=["desktop","mobile","tablet"];function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getWrapContainerStyle=(e,t)=>{let o=common.getStyleGridLayout({position:e.position,ratioLayout:e.ratioLayout,ratioLayoutRight:e.ratioLayoutRight,isHiddenGalleryImages:!!t}),r={"--gtc":"minmax(0, 12fr)"},a={...t?r:o,...core.makeStyleResponsive("gg",e?.spacing)};return filterTruthyStyles(a)},getFeatureImageStyle=(e,{enableOrder:t,enableDisplay:o})=>{let r=()=>common.getDisplayStyle(t=>!["bottom-center","left","right","only-feature","inside-bottom","inside-left","inside-right"].includes(core.getResponsiveValueByScreen(e?.position,t)||""),"flex"),a=common.getStyleGridOrderForFeature({position:e?.position}),l={...core.makeStyleResponsive("jc",e?.align),...t&&{...a},...o&&{...r()}};return filterTruthyStyles(l)},getGalleryImageStyle=(e,t)=>{let o=common.getStyleGridOrderForGallery({position:e.position}),r=()=>{let o={},r=t??0;return DEVICES.forEach(t=>{let a=core.getResponsiveValueByScreen(e?.position,t),l=["left","right"].includes(a),i=core.getResponsiveValueByScreen(e?.spacing,t),s=["inside-left","inside-right"].includes(a),n=common.convertSpacingForIndisdeLayout(i),p=`calc(${r}px - ${n})`;o={...o,[t]:l?r+"px":s?p:"auto"}}),o},a=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom??productGallery.sizeSettingDefaultForNewLayout,shapeForInside:e.shapeForInside??productGallery.sizeSettingDefaultForNewLayout},e.position),l=common.getStyleInsideLayout(e.position,a,e?.spacing),i={...core.makeStyleResponsive("h",core.makeHeight(r())),...core.makeStyleResponsive("jc",e?.align),...o,...l};return filterTruthyStyles(i)},getGalleryGridStyle=(e,t)=>{let o=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),r=()=>{let t=(e,t,o)=>{let r=core.getResponsiveValueByScreen(t,o),a=core.getResponsiveValueByScreen(e,o),l="slider"!==a&&("bottom-center"===r||"inside-bottom"===r),i=["one-col","two-col"].includes(r||"");return l||i},r=productGallery.checkDisplayGalleryByWidth({shapeByLayout:o}),a={desktop:r.desktop&&t(e.type,e.position,"desktop"),tablet:r.tablet&&t(e.type,e.position,"tablet"),mobile:r.mobile&&t(e.type,e.position,"mobile")};return common.getDisplayStyle(e=>!a[e],"flex")},a={...r(),...core.makeStyleResponsive("cg",e?.itemSpacing),...core.makeStyleResponsive("rg",e?.itemSpacing),...core.makeStyleResponsive("jc",e?.align),...t};return filterTruthyStyles(a)},getGalleryGridItemStyle=e=>{let t=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=core.getHeightByShapeGlobalSize(t),r=productGallery.getSettingWidthForGridItem({shapeByLayout:t,itemSpacing:e.itemSpacing}),a={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...core.makeStyleResponsive("h",core.makeHeight(o)),...core.makeStyleResponsive("w",core.makeWidth(r)),...core.composeRadius({normal:e.corner},["normal"])};return filterTruthyStyles(a)},getFeatureImageCarouselItemStyle=e=>{let t=core.getHeightByShapeGlobalSize(e.ftShape),o={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...core.composeRadius({normal:e?.ftCorner},["normal"]),...core.makeStyleResponsive("h",core.makeHeight(t))};return filterTruthyStyles(o)},getGalleryCarouselStyle=e=>{let t=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=o=>{let r=core.getResponsiveValueByScreen(e?.position,o),a="bottom-center"===r||"inside-bottom"===r,l="inside-left"===r||"inside-right"===r||"left"===r||"right"===r,i=core.getResponsiveValueByScreen(t,o);return a||l||!i?.width?"100%":i.width},r={spacing:common.convertSpacing(e?.itemSpacing),sizeSetting:{desktop:{width:o("desktop"),height:"100%"},tablet:{width:o("tablet"),height:"100%"},mobile:{width:o("mobile"),height:"100%"}}};return filterTruthyStyles(r)},getGalleryCarouselItemStyle=e=>{let t=productGallery.getShapeByLayout({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=core.makeStyleResponsive("minw",core.makeWidth(productGallery.getSettingMinWidthForCarouselItem({shapeByLayout:t,position:e.position,spacing:e.itemSpacing}))),r=core.makeStyleResponsive("maxw",core.makeWidth(productGallery.getSettingMinWidthForCarouselItem({shapeByLayout:t,position:e.position,spacing:e.itemSpacing}))),a=core.makeStyleResponsive("w",core.makeWidth(productGallery.getSettingWidthForCarouselItem({shapeByLayout:t,position:e.position}))),l=core.makeStyleResponsive("h",core.makeHeight(core.getHeightByShapeGlobalSize(t))),i={"outline-color":"var(--g-c-brand, brand)",...o,...r,...a,...l,...core.composeRadius({normal:e.corner},["normal"])};return filterTruthyStyles(i)},getFeaturedImageCarouselStyle=e=>{let t=t=>{let o=core.getResponsiveValueByScreen(e.ftShape,t);return o?.width??"100%"},o={playSpeed:e?.ftAnimationSpeed,sizeSetting:{desktop:{width:t("desktop"),height:"auto"},tablet:{width:t("tablet"),height:"auto"},mobile:{width:t("mobile"),height:"auto"}},align:{desktop:core.getResponsiveValueByScreen(e?.align,"desktop"),tablet:core.getResponsiveValueByScreen(e?.align,"tablet"),mobile:core.getResponsiveValueByScreen(e?.align,"mobile")},spacing:{desktop:6,tablet:6,mobile:6}};return filterTruthyStyles(o)},getFeaturedImageOnlyOneImageStyle=({setting:e,options:t})=>{let o=core.getHeightByShapeGlobalSize(e?.ftShape),r={...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(e?.ftShape,!1,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...t?.enableRadius&&core.composeRadius({normal:e?.ftCorner}),...t?.enableHeight&&core.makeStyleResponsive("h",core.makeHeight(o))};return filterTruthyStyles(r)};exports.getFeatureImageCarouselItemStyle=getFeatureImageCarouselItemStyle,exports.getFeatureImageStyle=getFeatureImageStyle,exports.getFeaturedImageCarouselStyle=getFeaturedImageCarouselStyle,exports.getFeaturedImageOnlyOneImageStyle=getFeaturedImageOnlyOneImageStyle,exports.getGalleryCarouselItemStyle=getGalleryCarouselItemStyle,exports.getGalleryCarouselStyle=getGalleryCarouselStyle,exports.getGalleryGridItemStyle=getGalleryGridItemStyle,exports.getGalleryGridStyle=getGalleryGridStyle,exports.getGalleryImageStyle=getGalleryImageStyle,exports.getWrapContainerStyle=getWrapContainerStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),common=require("../../common/common.js"),productFeaturedImage=require("../../common/productFeaturedImage.js"),HTML5Embed_liquid=require("../../../../../video/components/HTML5Embed.liquid.js"),Modal3d_liquid=require("../../../../../image/components/Modal3d.liquid.js"),NextImage_liquid=require("../../../../../image/components/NextImage.liquid.js"),Video_liquid=require("../../../../../image/components/Video.liquid.js"),_function=require("../../../../helpers/function.js"),getProductImagesStyles=require("../../composables/getProductImagesStyles.js"),getProductImagesClassName=require("../../composables/getProductImagesClassName.js"),getProductImagesAttr=require("../../composables/getProductImagesAttr.js"),system=require("@gem-sdk/system"),Carousel_liquid=require("../../../../../carousel-v3/components/root/Carousel.liquid.js"),CarouselItem_liquid=require("../../../../../carousel-v3/components/item/CarouselItem.liquid.js");const FeatureImageWithGallery=({builderPropUID:e,children:t,enableLazyLoadImage:i,...a})=>{let{featuredImageCarouselClasses:s,galleryItemClasses:r,featuredCarouselItemClasses:d}=getProductImagesClassName.getProductImagesClassName(a),{featuredImageCarouselStyle:o,featureImageStyle:u,featureImageCarouselOnlyOneImageStyle:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),common=require("../../common/common.js"),productFeaturedImage=require("../../common/productFeaturedImage.js"),HTML5Embed_liquid=require("../../../../../video/components/HTML5Embed.liquid.js"),Modal3d_liquid=require("../../../../../image/components/Modal3d.liquid.js"),NextImage_liquid=require("../../../../../image/components/NextImage.liquid.js"),Video_liquid=require("../../../../../image/components/Video.liquid.js"),_function=require("../../../../helpers/function.js"),getProductImagesStyles=require("../../composables/getProductImagesStyles.js"),getProductImagesClassName=require("../../composables/getProductImagesClassName.js"),getProductImagesAttr=require("../../composables/getProductImagesAttr.js"),system=require("@gem-sdk/system"),Carousel_liquid=require("../../../../../carousel-v3/components/root/Carousel.liquid.js"),CarouselItem_liquid=require("../../../../../carousel-v3/components/item/CarouselItem.liquid.js");const FeatureImageWithGallery=({builderPropUID:e,children:t,enableLazyLoadImage:i,...a})=>{let{featuredImageCarouselClasses:s,galleryItemClasses:r,featuredCarouselItemClasses:d}=getProductImagesClassName.getProductImagesClassName({...a,builderProps:{uid:e}}),{featuredImageCarouselStyle:o,featureImageStyle:u,featureImageCarouselOnlyOneImageStyle:l,featureImageOnlyOneImageStyle:m,featureImageCarouselItemStyle:g}=getProductImagesStyles.getProductImagesStyles(a),{featuredImageCarouselSettingAttrs:c}=getProductImagesAttr.getProductImagesAttr(a),n=common.getAspectRatio(a.ftShape),p=()=>`
|
|
2
2
|
{% case featureMedia.media_type %}
|
|
3
3
|
{% when 'image' %}
|
|
4
4
|
${I()}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
{% assign otherImage = product.media[other_image_index] %}
|
|
30
30
|
${system.LiquidIf("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
|
|
31
31
|
`)}
|
|
32
|
-
${NextImage_liquid.default({srcIsLiquidCode:!0,src:system.LiquidIf("src != null",common.getSrcImage("src"),"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:system.LiquidIf("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:`${common.getSrcImage("src")}`,baseSrc:"{{src | image_url}}",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:a?.ftLayout,aspectRatio:n,qualityType:a?.qualityType,qualityPercent:a?.qualityPercent},priority:a?.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}`,enableLazyLoadImage:i})}`,_=()=>core.template`
|
|
32
|
+
${NextImage_liquid.default({srcIsLiquidCode:!0,src:system.LiquidIf("src != null",common.getSrcImage("src"),"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:system.LiquidIf("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:`${common.getSrcImage("src")}`,baseSrc:"{{src | image_url}}",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:a?.ftLayout,aspectRatio:n,qualityType:a?.qualityType,qualityPercent:a?.qualityPercent},priority:a?.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??""}`,enableLazyLoadImage:i})}`,_=()=>core.template`
|
|
33
33
|
${NextImage_liquid.default({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:a?.ftLayout,aspectRatio:n,qualityType:a?.qualityType,qualityPercent:a?.qualityPercent},priority:a?.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",enableLazyLoadImage:i})}`,b=common.getPaddingBottomByShapeSetting(a.ftShape),M=t=>`
|
|
34
34
|
${system.Liquid(`{% assign productImageWidth = 0 %}
|
|
35
35
|
{% case featureMedia.media_type %}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
{% else %}
|
|
39
39
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
40
40
|
{% endcase %}`)}
|
|
41
|
-
${CarouselItem_liquid.default({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${r(`gp-ft-image-item !gp-min-w-full !gp-max-w-full
|
|
41
|
+
${CarouselItem_liquid.default({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${r(`gp-ft-image-item !gp-min-w-full !gp-max-w-full ${t??""}`)}`,parentId:`ft-${e}-{{section.id}}-{{product.id}}`,style:g,customStyle:{width:"{{productImageWidth}}px"},children:`
|
|
42
42
|
<div
|
|
43
43
|
class="gp-w-full gp-relative ${system.LiquidIf("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
|
|
44
44
|
style="${_function.getStyleOfObject(core.makeStyleResponsive("pb",b))} ${system.LiquidIf("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
>
|
|
89
89
|
<div
|
|
90
90
|
class="gp-relative"
|
|
91
|
-
style="${_function.getStyleOfObject(
|
|
91
|
+
style="${_function.getStyleOfObject(m)}"
|
|
92
92
|
>
|
|
93
93
|
${t}
|
|
94
94
|
<div
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
product-id="{{product.id}}"
|
|
97
97
|
product-media="{{product.media.size}}"
|
|
98
98
|
class="${d($)}"
|
|
99
|
-
style="${_function.getStyleOfObject(
|
|
99
|
+
style="${_function.getStyleOfObject(l)}"
|
|
100
100
|
>
|
|
101
101
|
<div
|
|
102
102
|
class="gp-w-full gp-relative ${system.LiquidIf("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
${system.LiquidIf("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
|
|
3
3
|
${system.LiquidIf("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
|
|
4
4
|
${system.LiquidIf("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
|
|
5
|
-
${CarouselItem_liquid.default({id:"{{imageID}}",contentType:"productImage",className:`${r(
|
|
5
|
+
${CarouselItem_liquid.default({id:"{{imageID}}",contentType:"productImage",className:`${r("gp-gallery-image-item ?? ''")}`,parentId:`${e}-{{product.id}}`,builderAttrs:{"data-outline":t?"active":"deactive"},style:d,children:`
|
|
6
6
|
<div class="gp-w-full gp-relative gp-h-full"
|
|
7
7
|
|
|
8
8
|
>
|
package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
external-id="{{media.external_id}}"
|
|
54
54
|
grid-index="{{forloop.index}}"
|
|
55
55
|
data-outline="none"
|
|
56
|
-
class="${o(`gem-slider-item-${e}-{{product.id}} gp-gallery-image-item ${i} data-[outline=deactive]:after:!gp-border-transparent`)}"
|
|
56
|
+
class="${o(`gem-slider-item-${e}-{{product.id}} gp-gallery-image-item ${i??""} data-[outline=deactive]:after:!gp-border-transparent`)}"
|
|
57
57
|
style="${_function.getStyleOfObject(l)}"
|
|
58
58
|
>
|
|
59
59
|
${system.LiquidIf("media.media_type == 'external_video' or media.media_type == 'video' or media.media_type == 'model'","{% assign isMedia = true %}")}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyleResponsive as e,makeHeight as t,getHeightByShapeGlobalSize as o,makeWidth as r,composeRadius as i,getResponsiveValueByScreen as a,makeStyleWithDefault as l,getWidthByShapeGlobalSize as s}from"@gem-sdk/core";import{getStyleGridLayout as n,getStyleGridOrderForFeature as p,getStyleGridOrderForGallery as h,getStyleInsideLayout as m,convertSpacing as g,getDisplayStyle as d,convertSpacingForIndisdeLayout as F}from"./common.js";import{getShapeByLayout as y,sizeSettingDefaultForNewLayout as u,getSettingWidthForGridItem as c,getSettingMinWidthForCarouselItem as S,getSettingWidthForCarouselItem as I,checkDisplayGalleryByWidth as b}from"./productGallery.js";let DEVICES=["desktop","mobile","tablet"];function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getWrapContainerStyle=(t,o)=>{let r=n({position:t.position,ratioLayout:t.ratioLayout,ratioLayoutRight:t.ratioLayoutRight,isHiddenGalleryImages:!!o}),i={"--gtc":"minmax(0, 12fr)"},a={...o?i:r,...e("gg",t?.spacing)};return filterTruthyStyles(a)},getFeatureImageStyle=(t,{enableOrder:o,enableDisplay:r})=>{let i=()=>d(e=>!["bottom-center","left","right","only-feature","inside-bottom","inside-left","inside-right"].includes(a(t?.position,e)||""),"flex"),l=p({position:t?.position}),s={...e("jc",t?.align),...o&&{...l},...r&&{...i()}};return filterTruthyStyles(s)},getGalleryImageStyle=(o,r)=>{let i=h({position:o.position}),l=()=>{let e={},t=r??0;return DEVICES.forEach(r=>{let i=a(o?.position,r),l=["left","right"].includes(i),s=a(o?.spacing,r),n=["inside-left","inside-right"].includes(i),p=F(s),h=`calc(${t}px - ${p})`;e={...e,[r]:l?t+"px":n?h:"auto"}}),e},s=y({shape:o.shape,shapeForBottom:o.shapeForBottom,shapeFor1Col:o.shapeFor1Col,shapeFor2Col:o.shapeFor2Col,shapeForFtOnly:o.shapeForFtOnly,shapeForInsideBottom:o.shapeForInsideBottom??u,shapeForInside:o.shapeForInside??u},o.position),n=m(o.position,s,o?.spacing),p={...e("h",t(l())),...e("jc",o?.align),...i,...n};return filterTruthyStyles(p)},getGalleryGridStyle=(t,o)=>{let r=y({shape:t.shape,shapeForBottom:t.shapeForBottom,shapeFor1Col:t.shapeFor1Col,shapeFor2Col:t.shapeFor2Col,shapeForFtOnly:t.shapeForFtOnly,shapeForInsideBottom:t.shapeForInsideBottom,shapeForInside:t.shapeForInside},t.position),i=()=>{let e=(e,t,o)=>{let r=a(t,o),i=a(e,o),l="slider"!==i&&("bottom-center"===r||"inside-bottom"===r),s=["one-col","two-col"].includes(r||"");return l||s},o=b({shapeByLayout:r}),i={desktop:o.desktop&&e(t.type,t.position,"desktop"),tablet:o.tablet&&e(t.type,t.position,"tablet"),mobile:o.mobile&&e(t.type,t.position,"mobile")};return d(e=>!i[e],"flex")},l={...i(),...e("cg",t?.itemSpacing),...e("rg",t?.itemSpacing),...e("jc",t?.align),...o};return filterTruthyStyles(l)},getGalleryGridItemStyle=a=>{let l=y({shape:a.shape,shapeForBottom:a.shapeForBottom,shapeFor1Col:a.shapeFor1Col,shapeFor2Col:a.shapeFor2Col,shapeForFtOnly:a.shapeForFtOnly,shapeForInsideBottom:a.shapeForInsideBottom,shapeForInside:a.shapeForInside},a.position),s=o(l),n=c({shapeByLayout:l,itemSpacing:a.itemSpacing}),p={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...e("h",t(s)),...e("w",r(n)),...i({normal:a.corner})};return filterTruthyStyles(p)},getFeatureImageCarouselItemStyle=r=>{let a=o(r.ftShape),l={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...i({normal:r?.ftCorner}),...e("h",t(a))};return filterTruthyStyles(l)},getGalleryCarouselStyle=e=>{let t=y({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=o=>{let r=a(e?.position,o),i="bottom-center"===r||"inside-bottom"===r,l="inside-left"===r||"inside-right"===r||"left"===r||"right"===r,s=a(t,o);return i||l||!s?.width?"100%":s.width},r={spacing:g(e?.itemSpacing),sizeSetting:{desktop:{width:o("desktop"),height:"100%"},tablet:{width:o("tablet"),height:"100%"},mobile:{width:o("mobile"),height:"100%"}}};return filterTruthyStyles(r)},getGalleryCarouselItemStyle=a=>{let l=y({shape:a.shape,shapeForBottom:a.shapeForBottom,shapeFor1Col:a.shapeFor1Col,shapeFor2Col:a.shapeFor2Col,shapeForFtOnly:a.shapeForFtOnly,shapeForInsideBottom:a.shapeForInsideBottom,shapeForInside:a.shapeForInside},a.position),s=e("minw",r(S({shapeByLayout:l,position:a.position,spacing:a.itemSpacing}))),n=e("maxw",r(S({shapeByLayout:l,position:a.position,spacing:a.itemSpacing}))),p=e("w",r(I({shapeByLayout:l,position:a.position}))),h=e("h",t(o(l))),m={"outline-color":"var(--g-c-brand, brand)",...s,...n,...p,...h,...i({normal:a.corner})};return filterTruthyStyles(m)},getFeaturedImageCarouselStyle=e=>{let t=t=>{let o=a(e.ftShape,t);return o?.width??"100%"},o={playSpeed:e?.ftAnimationSpeed,sizeSetting:{desktop:{width:t("desktop"),height:"auto"},tablet:{width:t("tablet"),height:"auto"},mobile:{width:t("mobile"),height:"auto"}},align:{desktop:a(e?.align,"desktop"),tablet:a(e?.align,"tablet"),mobile:a(e?.align,"mobile")},spacing:{desktop:6,tablet:6,mobile:6}};return filterTruthyStyles(o)},getFeaturedImageOnlyOneImageStyle=({setting:r,options:a})=>{let n=o(r?.ftShape),p={...l("w",s(r?.ftShape,!1,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...a?.enableRadius&&i({normal:r?.ftCorner}),...a?.enableHeight&&e("h",t(n))};return filterTruthyStyles(p)};export{getFeatureImageCarouselItemStyle,getFeatureImageStyle,getFeaturedImageCarouselStyle,getFeaturedImageOnlyOneImageStyle,getGalleryCarouselItemStyle,getGalleryCarouselStyle,getGalleryGridItemStyle,getGalleryGridStyle,getGalleryImageStyle,getWrapContainerStyle};
|
|
1
|
+
import{makeStyleResponsive as e,makeHeight as t,getHeightByShapeGlobalSize as o,makeWidth as r,composeRadius as i,getResponsiveValueByScreen as a,makeStyleWithDefault as l,getWidthByShapeGlobalSize as s}from"@gem-sdk/core";import{getStyleGridLayout as n,getStyleGridOrderForFeature as p,getStyleGridOrderForGallery as h,getStyleInsideLayout as m,convertSpacing as g,getDisplayStyle as d,convertSpacingForIndisdeLayout as F}from"./common.js";import{getShapeByLayout as y,sizeSettingDefaultForNewLayout as u,getSettingWidthForGridItem as c,getSettingMinWidthForCarouselItem as S,getSettingWidthForCarouselItem as I,checkDisplayGalleryByWidth as b}from"./productGallery.js";let DEVICES=["desktop","mobile","tablet"];function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getWrapContainerStyle=(t,o)=>{let r=n({position:t.position,ratioLayout:t.ratioLayout,ratioLayoutRight:t.ratioLayoutRight,isHiddenGalleryImages:!!o}),i={"--gtc":"minmax(0, 12fr)"},a={...o?i:r,...e("gg",t?.spacing)};return filterTruthyStyles(a)},getFeatureImageStyle=(t,{enableOrder:o,enableDisplay:r})=>{let i=()=>d(e=>!["bottom-center","left","right","only-feature","inside-bottom","inside-left","inside-right"].includes(a(t?.position,e)||""),"flex"),l=p({position:t?.position}),s={...e("jc",t?.align),...o&&{...l},...r&&{...i()}};return filterTruthyStyles(s)},getGalleryImageStyle=(o,r)=>{let i=h({position:o.position}),l=()=>{let e={},t=r??0;return DEVICES.forEach(r=>{let i=a(o?.position,r),l=["left","right"].includes(i),s=a(o?.spacing,r),n=["inside-left","inside-right"].includes(i),p=F(s),h=`calc(${t}px - ${p})`;e={...e,[r]:l?t+"px":n?h:"auto"}}),e},s=y({shape:o.shape,shapeForBottom:o.shapeForBottom,shapeFor1Col:o.shapeFor1Col,shapeFor2Col:o.shapeFor2Col,shapeForFtOnly:o.shapeForFtOnly,shapeForInsideBottom:o.shapeForInsideBottom??u,shapeForInside:o.shapeForInside??u},o.position),n=m(o.position,s,o?.spacing),p={...e("h",t(l())),...e("jc",o?.align),...i,...n};return filterTruthyStyles(p)},getGalleryGridStyle=(t,o)=>{let r=y({shape:t.shape,shapeForBottom:t.shapeForBottom,shapeFor1Col:t.shapeFor1Col,shapeFor2Col:t.shapeFor2Col,shapeForFtOnly:t.shapeForFtOnly,shapeForInsideBottom:t.shapeForInsideBottom,shapeForInside:t.shapeForInside},t.position),i=()=>{let e=(e,t,o)=>{let r=a(t,o),i=a(e,o),l="slider"!==i&&("bottom-center"===r||"inside-bottom"===r),s=["one-col","two-col"].includes(r||"");return l||s},o=b({shapeByLayout:r}),i={desktop:o.desktop&&e(t.type,t.position,"desktop"),tablet:o.tablet&&e(t.type,t.position,"tablet"),mobile:o.mobile&&e(t.type,t.position,"mobile")};return d(e=>!i[e],"flex")},l={...i(),...e("cg",t?.itemSpacing),...e("rg",t?.itemSpacing),...e("jc",t?.align),...o};return filterTruthyStyles(l)},getGalleryGridItemStyle=a=>{let l=y({shape:a.shape,shapeForBottom:a.shapeForBottom,shapeFor1Col:a.shapeFor1Col,shapeFor2Col:a.shapeFor2Col,shapeForFtOnly:a.shapeForFtOnly,shapeForInsideBottom:a.shapeForInsideBottom,shapeForInside:a.shapeForInside},a.position),s=o(l),n=c({shapeByLayout:l,itemSpacing:a.itemSpacing}),p={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...e("h",t(s)),...e("w",r(n)),...i({normal:a.corner},["normal"])};return filterTruthyStyles(p)},getFeatureImageCarouselItemStyle=r=>{let a=o(r.ftShape),l={"max-width":"100%","outline-color":"var(--g-c-brand, brand)",...i({normal:r?.ftCorner},["normal"]),...e("h",t(a))};return filterTruthyStyles(l)},getGalleryCarouselStyle=e=>{let t=y({shape:e.shape,shapeForBottom:e.shapeForBottom,shapeFor1Col:e.shapeFor1Col,shapeFor2Col:e.shapeFor2Col,shapeForFtOnly:e.shapeForFtOnly,shapeForInsideBottom:e.shapeForInsideBottom,shapeForInside:e.shapeForInside},e.position),o=o=>{let r=a(e?.position,o),i="bottom-center"===r||"inside-bottom"===r,l="inside-left"===r||"inside-right"===r||"left"===r||"right"===r,s=a(t,o);return i||l||!s?.width?"100%":s.width},r={spacing:g(e?.itemSpacing),sizeSetting:{desktop:{width:o("desktop"),height:"100%"},tablet:{width:o("tablet"),height:"100%"},mobile:{width:o("mobile"),height:"100%"}}};return filterTruthyStyles(r)},getGalleryCarouselItemStyle=a=>{let l=y({shape:a.shape,shapeForBottom:a.shapeForBottom,shapeFor1Col:a.shapeFor1Col,shapeFor2Col:a.shapeFor2Col,shapeForFtOnly:a.shapeForFtOnly,shapeForInsideBottom:a.shapeForInsideBottom,shapeForInside:a.shapeForInside},a.position),s=e("minw",r(S({shapeByLayout:l,position:a.position,spacing:a.itemSpacing}))),n=e("maxw",r(S({shapeByLayout:l,position:a.position,spacing:a.itemSpacing}))),p=e("w",r(I({shapeByLayout:l,position:a.position}))),h=e("h",t(o(l))),m={"outline-color":"var(--g-c-brand, brand)",...s,...n,...p,...h,...i({normal:a.corner},["normal"])};return filterTruthyStyles(m)},getFeaturedImageCarouselStyle=e=>{let t=t=>{let o=a(e.ftShape,t);return o?.width??"100%"},o={playSpeed:e?.ftAnimationSpeed,sizeSetting:{desktop:{width:t("desktop"),height:"auto"},tablet:{width:t("tablet"),height:"auto"},mobile:{width:t("mobile"),height:"auto"}},align:{desktop:a(e?.align,"desktop"),tablet:a(e?.align,"tablet"),mobile:a(e?.align,"mobile")},spacing:{desktop:6,tablet:6,mobile:6}};return filterTruthyStyles(o)},getFeaturedImageOnlyOneImageStyle=({setting:r,options:a})=>{let n=o(r?.ftShape),p={...l("w",s(r?.ftShape,!1,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...a?.enableRadius&&i({normal:r?.ftCorner}),...a?.enableHeight&&e("h",t(n))};return filterTruthyStyles(p)};export{getFeatureImageCarouselItemStyle,getFeatureImageStyle,getFeaturedImageCarouselStyle,getFeaturedImageOnlyOneImageStyle,getGalleryCarouselItemStyle,getGalleryCarouselStyle,getGalleryGridItemStyle,getGalleryGridStyle,getGalleryImageStyle,getWrapContainerStyle};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r,getSrcImage as s}from"../../common/common.js";import{checkRenderFeaturedCarousel as d,getVideoHeight as o,getZoomImageClass as u,getZoomLenClass as
|
|
1
|
+
import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r,getSrcImage as s}from"../../common/common.js";import{checkRenderFeaturedCarousel as d,getVideoHeight as o,getZoomImageClass as u,getZoomLenClass as l}from"../../common/productFeaturedImage.js";import m from"../../../../../video/components/HTML5Embed.liquid.js";import g from"../../../../../image/components/Modal3d.liquid.js";import p from"../../../../../image/components/NextImage.liquid.js";import n from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as c}from"../../../../helpers/function.js";import{getProductImagesStyles as f}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as h}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as y}from"../../composables/getProductImagesAttr.js";import{LiquidIf as M,LiquidFor as $,Liquid as b,If as _,createStyle as v}from"@gem-sdk/system";import w from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import I from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";let FeatureImageWithGallery=({builderPropUID:x,children:q,enableLazyLoadImage:j,...z})=>{let{featuredImageCarouselClasses:S,galleryItemClasses:L,featuredCarouselItemClasses:P}=h({...z,builderProps:{uid:x}}),{featuredImageCarouselStyle:R,featureImageStyle:W,featureImageCarouselOnlyOneImageStyle:C,featureImageOnlyOneImageStyle:T,featureImageCarouselItemStyle:N}=f(z),{featuredImageCarouselSettingAttrs:k}=y(z),E=t(z.ftShape),O=()=>`
|
|
2
2
|
{% case featureMedia.media_type %}
|
|
3
3
|
{% when 'image' %}
|
|
4
4
|
${F()}
|
|
@@ -13,15 +13,15 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
|
|
|
13
13
|
{% else %}
|
|
14
14
|
${G()}
|
|
15
15
|
{% endcase %}
|
|
16
|
-
`,A=()=>g({src:M("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:E}),D=()=>n({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:E}),V=()=>{let a=v({...o(z?.ftLayout),...e("objf",z?.ftLayout)}),i=v({...o(z?.ftLayout)});return
|
|
16
|
+
`,A=()=>g({src:M("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:E}),D=()=>n({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:E}),V=()=>{let a=v({...o(z?.ftLayout),...e("objf",z?.ftLayout)}),i=v({...o(z?.ftLayout)});return m({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:i,style:{width:"100%","max-height":"100%",...a},className:"gp-invisible"})},F=()=>a`
|
|
17
17
|
${H(i("gp-w-full gp-transition-opacity",{"group-hover:gp-opacity-0":"other"==z.hoverEffect},"{{shouldHidden}}"))}
|
|
18
|
-
${
|
|
18
|
+
${_(z?.hoverEffect!=="none",`<div class="${i("zoom-element !gp-max-w-none",u())}">
|
|
19
19
|
${H("image-zoom",!0)}
|
|
20
20
|
</div>`," ")}
|
|
21
|
-
${
|
|
21
|
+
${_(z?.hoverEffect=="zoom"&&z?.zoomType=="glasses",`<div class="${i("zoom-lens-element",l())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
|
|
22
22
|
`,H=(e,i)=>a`
|
|
23
23
|
{% assign src = featureMedia.src %}
|
|
24
|
-
${
|
|
24
|
+
${_(i&&"other"==z.hoverEffect,`{% assign media_length = product.media | size %}
|
|
25
25
|
{% assign other_image_index = ${z.otherImage} | plus: 0 %}
|
|
26
26
|
{% if other_image_index >= media_length %}
|
|
27
27
|
{% assign other_image_index = media_length | minus: 1 %}
|
|
@@ -29,16 +29,16 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
|
|
|
29
29
|
{% assign otherImage = product.media[other_image_index] %}
|
|
30
30
|
${M("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
|
|
31
31
|
`)}
|
|
32
|
-
${p({srcIsLiquidCode:!0,src:M("src != null",s("src"),"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:M("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:`${s("src")}`,baseSrc:"{{src | image_url}}",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.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}`,enableLazyLoadImage:j})}`,G=()=>a`
|
|
32
|
+
${p({srcIsLiquidCode:!0,src:M("src != null",s("src"),"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:M("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:`${s("src")}`,baseSrc:"{{src | image_url}}",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.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??""}`,enableLazyLoadImage:j})}`,G=()=>a`
|
|
33
33
|
${p({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.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",enableLazyLoadImage:j})}`,J=r(z.ftShape),B=a=>`
|
|
34
|
-
${
|
|
34
|
+
${b(`{% assign productImageWidth = 0 %}
|
|
35
35
|
{% case featureMedia.media_type %}
|
|
36
36
|
{% when 'image' %}
|
|
37
37
|
{% assign productImageWidth = featureMedia.width %}
|
|
38
38
|
{% else %}
|
|
39
39
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
40
40
|
{% endcase %}`)}
|
|
41
|
-
${I({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${L(`gp-ft-image-item !gp-min-w-full !gp-max-w-full
|
|
41
|
+
${I({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${L(`gp-ft-image-item !gp-min-w-full !gp-max-w-full ${a??""}`)}`,parentId:`ft-${x}-{{section.id}}-{{product.id}}`,style:N,customStyle:{width:"{{productImageWidth}}px"},children:`
|
|
42
42
|
<div
|
|
43
43
|
class="gp-w-full gp-relative ${M("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
|
|
44
44
|
style="${c(e("pb",J))} ${M("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
|
|
@@ -55,7 +55,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
|
|
|
55
55
|
${$("featureMedia in product.media",`${M("featureMedia.media_type == 'image'",`${$("image in product.images",M("image.src == featureMedia.src","{% assign imageID = image.id %}{% break %}"))}`,"{% assign imageID = '' %}")}
|
|
56
56
|
${B()}`)}
|
|
57
57
|
`,p({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:z?.preload,setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none",customLazyload:!0,enableLazyLoadImage:j})),X=()=>`
|
|
58
|
-
${w({builderProps:{uid:x},rootId:`ft-${x}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:Q,rootClass:`${S}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:k,rootStyles:
|
|
58
|
+
${w({builderProps:{uid:x},rootId:`ft-${x}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:Q,rootClass:`${S}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:k,rootStyles:W,styles:R,style:{playSpeed:600},disableMarginAuto:!0,children:U})}
|
|
59
59
|
`,Y=()=>{switch(z?.preDisplay){case"1st-images":return`
|
|
60
60
|
{% assign featureMedia = product.media.first %}
|
|
61
61
|
`;case"1st-3d-mode":return $("media in product.media",M("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return $("media in product.media",M("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
|
|
@@ -63,7 +63,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
|
|
|
63
63
|
{% unless featureMedia %}
|
|
64
64
|
{% assign featureMedia = product.featured_media %}
|
|
65
65
|
{% endunless %}
|
|
66
|
-
`}},Z=()=>
|
|
66
|
+
`}},Z=()=>b(`
|
|
67
67
|
{% assign featureMedia = variant.featured_media %}
|
|
68
68
|
{% unless featureMedia %}
|
|
69
69
|
{% assign featureMedia = product.featured_media %}
|
|
@@ -84,7 +84,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
|
|
|
84
84
|
${M("featureMedia == null","{% assign productImageWidth = 1600 %}")}
|
|
85
85
|
<div
|
|
86
86
|
class='gp-feature-image-carousel gp-feature-image-only'
|
|
87
|
-
style="${c(
|
|
87
|
+
style="${c(W)}"
|
|
88
88
|
>
|
|
89
89
|
<div
|
|
90
90
|
class="gp-relative"
|
|
@@ -95,7 +95,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
|
|
|
95
95
|
type="gp-feature-image-only"
|
|
96
96
|
product-id="{{product.id}}"
|
|
97
97
|
product-media="{{product.media.size}}"
|
|
98
|
-
class="${
|
|
98
|
+
class="${P(Q)}"
|
|
99
99
|
style="${c(C)}"
|
|
100
100
|
>
|
|
101
101
|
<div
|
|
@@ -107,12 +107,12 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
|
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
|
-
`);return
|
|
110
|
+
`);return b(`
|
|
111
111
|
{% capture featureImageOnlyOne %}
|
|
112
112
|
${Z()}
|
|
113
113
|
{% endcapture %}
|
|
114
114
|
${M("product.media.size > 1",`
|
|
115
|
-
${
|
|
116
|
-
${
|
|
115
|
+
${_(K,X()," ")}
|
|
116
|
+
${_(!K,"{{ featureImageOnlyOne }}"," ")}
|
|
117
117
|
`,"{{ featureImageOnlyOne }}")}
|
|
118
118
|
`)};export{FeatureImageWithGallery as default};
|
|
@@ -2,7 +2,7 @@ import{template as e,getResponsiveValueByScreen as t}from"@gem-sdk/core";import
|
|
|
2
2
|
${C("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
|
|
3
3
|
${C("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
|
|
4
4
|
${C("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
|
|
5
|
-
${v({id:"{{imageID}}",contentType:"productImage",className:`${x(
|
|
5
|
+
${v({id:"{{imageID}}",contentType:"productImage",className:`${x("gp-gallery-image-item ?? ''")}`,parentId:`${b}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:_,children:`
|
|
6
6
|
<div class="gp-w-full gp-relative gp-h-full"
|
|
7
7
|
|
|
8
8
|
>
|
package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js
CHANGED
|
@@ -53,7 +53,7 @@ import{makeStyleResponsive as e,template as i,getResponsiveValueByScreen as a,cl
|
|
|
53
53
|
external-id="{{media.external_id}}"
|
|
54
54
|
grid-index="{{forloop.index}}"
|
|
55
55
|
data-outline="none"
|
|
56
|
-
class="${F(`gem-slider-item-${_}-{{product.id}} gp-gallery-image-item ${i} data-[outline=deactive]:after:!gp-border-transparent`)}"
|
|
56
|
+
class="${F(`gem-slider-item-${_}-{{product.id}} gp-gallery-image-item ${i??""} data-[outline=deactive]:after:!gp-border-transparent`)}"
|
|
57
57
|
style="${g(I)}"
|
|
58
58
|
>
|
|
59
59
|
${d("media.media_type == 'external_video' or media.media_type == 'video' or media.media_type == 'model'","{% assign isMedia = true %}")}
|