@gem-sdk/components 4.0.0-staging.1201 → 4.0.0-staging.1202

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.
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),NextImage_liquid=require("../../../../../image/components/NextImage.liquid.js"),common=require("../../common/common.js"),productGallery=require("../../common/productGallery.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/components/root/Carousel.liquid.js"),CarouselItem_liquid=require("../../../../../carousel/components/item/CarouselItem.liquid.js");const ProductGalleryCarousel=({builderPropUID:e,children:t,enableLazyLoadImage:i,...o})=>{let{featuredImageGalleryClasses:s,galleryItemClasses:r}=getProductImagesClassName.getProductImagesClassName(o),{galleryCarouselSettingAttrs:a}=getProductImagesAttr.getProductImagesAttr(o),{galleryCarouselStyle:l,galleryCarouselItemStyle:d}=getProductImagesStyles.getProductImagesStyles(o),p=()=>{let e=(e,t,i)=>{let o=core.getResponsiveValueByScreen(t,i),s=core.getResponsiveValueByScreen(e,i),r="slider"===s&&("bottom-center"===o||"inside-bottom"===o),a=["left","right","inside-left","inside-right"].includes(o??"");return a||r},t=productGallery.checkDisplayGalleryByWidth({shapeByLayout:g}),i={desktop:t.desktop&&e(o.type,o.position,"desktop"),tablet:t.tablet&&e(o.type,o.position,"tablet"),mobile:t.mobile&&e(o.type,o.position,"mobile")};return common.getDisplayStyle(e=>!i[e],"flex")},g=productGallery.getShapeByLayout({shape:o.shape,shapeForBottom:o.shapeForBottom,shapeFor1Col:o.shapeFor1Col,shapeFor2Col:o.shapeFor2Col,shapeForFtOnly:o.shapeForFtOnly,shapeForInsideBottom:o.shapeForInsideBottom,shapeForInside:o.shapeForInside},o.position),m=(e,t)=>core.template`${NextImage_liquid.default({srcIsLiquidCode:!0,src:`${common.getSrcImage("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:e,baseSrc:"{{media.preview_image | image_url}}",style:t,className:"!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer",enableLazyLoadImage:i})}`,u=common.getPaddingBottomByShapeSetting(g),c=t=>`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),NextImage_liquid=require("../../../../../image/components/NextImage.liquid.js"),common=require("../../common/common.js"),productGallery=require("../../common/productGallery.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/components/root/Carousel.liquid.js"),CarouselItem_liquid=require("../../../../../carousel/components/item/CarouselItem.liquid.js");const ProductGalleryCarousel=({builderPropUID:e,children:t,enableLazyLoadImage:i,...o})=>{let{featuredImageGalleryClasses:s,galleryItemClasses:r}=getProductImagesClassName.getProductImagesClassName(o),{galleryCarouselSettingAttrs:a}=getProductImagesAttr.getProductImagesAttr(o),{galleryCarouselStyle:l,galleryCarouselItemStyle:d}=getProductImagesStyles.getProductImagesStyles(o),p=()=>{let e=(e,t,i)=>{let o=core.getResponsiveValueByScreen(t,i),s=core.getResponsiveValueByScreen(e,i),r="slider"===s&&("bottom-center"===o||"inside-bottom"===o),a=["left","right","inside-left","inside-right"].includes(o??"");return a||r},t=productGallery.checkDisplayGalleryByWidth({shapeByLayout:g}),i={desktop:t.desktop&&e(o.type,o.position,"desktop"),tablet:t.tablet&&e(o.type,o.position,"tablet"),mobile:t.mobile&&e(o.type,o.position,"mobile")};return common.getDisplayStyle(e=>!i[e],"flex")},g=productGallery.getShapeByLayout({shape:o.shape,shapeForBottom:o.shapeForBottom,shapeFor1Col:o.shapeFor1Col,shapeFor2Col:o.shapeFor2Col,shapeForFtOnly:o.shapeForFtOnly,shapeForInsideBottom:o.shapeForInsideBottom,shapeForInside:o.shapeForInside},o.position),m=(e,t)=>core.template`${NextImage_liquid.default({srcIsLiquidCode:!0,src:`${common.getSrcImage("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:e,baseSrc:"{{media.preview_image | image_url}}",style:t,className:"!gp-rounded-none gp-w-full gp-h-full gp-top-0 gp-left-0 gp-cursor-pointer",enableLazyLoadImage:i})}`,u=t=>`
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
5
  ${CarouselItem_liquid.default({id:"{{imageID}}",contentType:"productImage",className:`${r(`gp-gallery-image-item ${t}`)}`,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
- style="${_function.getStyleOfObject(core.makeStyleResponsive("pb",u))};"
7
+
8
8
  >
9
9
  ${m({aspectRatio:common.getAspectRatio(g),layout:o?.layout,qualityPercent:o?.qualityPercent,qualityType:o?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
10
10
 
@@ -40,7 +40,7 @@
40
40
  </svg>
41
41
  </div>
42
42
  </div>
43
- `})}`,n=()=>{let e=productGallery.getCarouselVerticalConfigByPosition(o.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(" ")}`},y=system.LiquidIf("product.media.size > 1",system.LiquidFor("media in product.media",`${system.LiquidIf("media.media_type == 'image'",system.LiquidFor("image in product.images",system.LiquidIf("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
- ${system.LiquidIf("media.id == product.featured_media.id ",c(o?.borderActive?.border!=="none"?"active":""),c())}`));return core.template`
45
- ${Carousel_liquid.default({builderProps:{uid:e},rootId:`${e}-{{product.id}}`,rootClass:`${s}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:n(),slidesClass:productGallery.getMinHeightByPosition(o.position,o.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:a,rootStyles:{...p()},styles:l,disableMarginAuto:!0,children:y})}
43
+ `})}`,c=()=>{let e=productGallery.getCarouselVerticalConfigByPosition(o.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(" ")}`},n=system.LiquidIf("product.media.size > 1",system.LiquidFor("media in product.media",`${system.LiquidIf("media.media_type == 'image'",system.LiquidFor("image in product.images",system.LiquidIf("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
+ ${system.LiquidIf("media.id == product.featured_media.id ",u(o?.borderActive?.border!=="none"?"active":""),u())}`));return core.template`
45
+ ${Carousel_liquid.default({builderProps:{uid:e},rootId:`${e}-{{product.id}}`,rootClass:`${s}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:c(),slidesClass:productGallery.getMinHeightByPosition(o.position,o.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:a,rootStyles:{...p()},styles:l,disableMarginAuto:!0,children:n})}
46
46
  `};exports.default=ProductGalleryCarousel;
@@ -1,20 +1,20 @@
1
- import{template as e,makeStyleResponsive as t,getResponsiveValueByScreen as i}from"@gem-sdk/core";import o from"../../../../../image/components/NextImage.liquid.js";import{getPaddingBottomByShapeSetting as r,getDisplayStyle as s,getAspectRatio as a,getSrcImage as p}from"../../common/common.js";import{getShapeByLayout as l,getMinHeightByPosition as d,checkDisplayGalleryByWidth as m,getZoomDisplay as g,getCarouselVerticalConfigByPosition as n}from"../../common/productGallery.js";import{getStyleOfObject as c}from"../../../../helpers/function.js";import{getProductImagesStyles as u}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as C}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as h}from"../../composables/getProductImagesAttr.js";import{LiquidIf as y,LiquidFor as b}from"@gem-sdk/system";import v from"../../../../../carousel/components/root/Carousel.liquid.js";import f from"../../../../../carousel/components/item/CarouselItem.liquid.js";let ProductGalleryCarousel=({builderPropUID:w,children:L,enableLazyLoadImage:F,...$})=>{let{featuredImageGalleryClasses:x,galleryItemClasses:I}=C($),{galleryCarouselSettingAttrs:_}=h($),{galleryCarouselStyle:k,galleryCarouselItemStyle:j}=u($),V=()=>{let e=(e,t,o)=>{let r=i(t,o),s=i(e,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),p=["left","right","inside-left","inside-right"].includes(r??"");return p||a},t=m({shapeByLayout:M}),o={desktop:t.desktop&&e($.type,$.position,"desktop"),tablet:t.tablet&&e($.type,$.position,"tablet"),mobile:t.mobile&&e($.type,$.position,"mobile")};return s(e=>!o[e],"flex")},M=l({shape:$.shape,shapeForBottom:$.shapeForBottom,shapeFor1Col:$.shapeFor1Col,shapeFor2Col:$.shapeFor2Col,shapeForFtOnly:$.shapeForFtOnly,shapeForInsideBottom:$.shapeForInsideBottom,shapeForInside:$.shapeForInside},$.position),P=(t,i)=>e`${o({srcIsLiquidCode:!0,src:`${p("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:t,baseSrc:"{{media.preview_image | image_url}}",style:i,className:"!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer",enableLazyLoadImage:F})}`,Z=r(M),q=e=>`
2
- ${y("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
3
- ${y("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
4
- ${y("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
5
- ${f({id:"{{imageID}}",contentType:"productImage",className:`${I(`gp-gallery-image-item ${e}`)}`,parentId:`${w}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:j,children:`
1
+ import{template as e,getResponsiveValueByScreen as t}from"@gem-sdk/core";import i from"../../../../../image/components/NextImage.liquid.js";import{getDisplayStyle as o,getAspectRatio as r,getSrcImage as s}from"../../common/common.js";import{getShapeByLayout as a,getMinHeightByPosition as p,checkDisplayGalleryByWidth as l,getZoomDisplay as d,getCarouselVerticalConfigByPosition as m}from"../../common/productGallery.js";import{getStyleOfObject as g}from"../../../../helpers/function.js";import{getProductImagesStyles as n}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as c}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as u}from"../../composables/getProductImagesAttr.js";import{LiquidIf as C,LiquidFor as h}from"@gem-sdk/system";import y from"../../../../../carousel/components/root/Carousel.liquid.js";import v from"../../../../../carousel/components/item/CarouselItem.liquid.js";let ProductGalleryCarousel=({builderPropUID:b,children:f,enableLazyLoadImage:w,...L})=>{let{featuredImageGalleryClasses:F,galleryItemClasses:x}=c(L),{galleryCarouselSettingAttrs:$}=u(L),{galleryCarouselStyle:I,galleryCarouselItemStyle:_}=n(L),k=()=>{let e=(e,i,o)=>{let r=t(i,o),s=t(e,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),p=["left","right","inside-left","inside-right"].includes(r??"");return p||a},i=l({shapeByLayout:j}),r={desktop:i.desktop&&e(L.type,L.position,"desktop"),tablet:i.tablet&&e(L.type,L.position,"tablet"),mobile:i.mobile&&e(L.type,L.position,"mobile")};return o(e=>!r[e],"flex")},j=a({shape:L.shape,shapeForBottom:L.shapeForBottom,shapeFor1Col:L.shapeFor1Col,shapeFor2Col:L.shapeFor2Col,shapeForFtOnly:L.shapeForFtOnly,shapeForInsideBottom:L.shapeForInsideBottom,shapeForInside:L.shapeForInside},L.position),V=(t,o)=>e`${i({srcIsLiquidCode:!0,src:`${s("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:t,baseSrc:"{{media.preview_image | image_url}}",style:o,className:"!gp-rounded-none gp-w-full gp-h-full gp-top-0 gp-left-0 gp-cursor-pointer",enableLazyLoadImage:w})}`,M=e=>`
2
+ ${C("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
3
+ ${C("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
4
+ ${C("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
5
+ ${v({id:"{{imageID}}",contentType:"productImage",className:`${x(`gp-gallery-image-item ${e}`)}`,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
- style="${c(t("pb",Z))};"
7
+
8
8
  >
9
- ${P({aspectRatio:a(M),layout:$?.layout,qualityPercent:$?.qualityPercent,qualityType:$?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
9
+ ${V({aspectRatio:r(j),layout:L?.layout,qualityPercent:L?.qualityPercent,qualityType:L?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
10
10
 
11
- ${y("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
+ ${C("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
- ${y("media.media_type == 'model'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
17
+ ${C("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 @@ import{template as e,makeStyleResponsive as t,getResponsiveValueByScreen as i}fr
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="${c(g($?.clickOpenLightBox))}"
25
+ style="${g(d(L?.clickOpenLightBox))}"
26
26
  >
27
27
  <svg
28
28
  height="100%"
@@ -40,7 +40,7 @@ import{template as e,makeStyleResponsive as t,getResponsiveValueByScreen as i}fr
40
40
  </svg>
41
41
  </div>
42
42
  </div>
43
- `})}`,B=()=>{let e=n($.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(" ")}`},A=y("product.media.size > 1",b("media in product.media",`${y("media.media_type == 'image'",b("image in product.images",y("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
- ${y("media.id == product.featured_media.id ",q($?.borderActive?.border!=="none"?"active":""),q())}`));return e`
45
- ${v({builderProps:{uid:w},rootId:`${w}-{{product.id}}`,rootClass:`${x}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:B(),slidesClass:d($.position,$.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:_,rootStyles:{...V()},styles:k,disableMarginAuto:!0,children:A})}
43
+ `})}`,P=()=>{let e=m(L.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(" ")}`},Z=C("product.media.size > 1",h("media in product.media",`${C("media.media_type == 'image'",h("image in product.images",C("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
+ ${C("media.id == product.featured_media.id ",M(L?.borderActive?.border!=="none"?"active":""),M())}`));return e`
45
+ ${y({builderProps:{uid:b},rootId:`${b}-{{product.id}}`,rootClass:`${F}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:P(),slidesClass:p(L.position,L.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:$,rootStyles:{...k()},styles:I,disableMarginAuto:!0,children:Z})}
46
46
  `};export{ProductGalleryCarousel as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "4.0.0-staging.1201",
3
+ "version": "4.0.0-staging.1202",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",