@gem-sdk/components 2.0.0-staging.1124 → 2.0.0-staging.1125
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,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),common=require("./common/common.js"),FeatureImageWithGallery_liquid=require("./components/feature-gallery/FeatureImageWithGallery.liquid.js"),GalleryCarousel_liquid=require("./components/gallery-carousel/GalleryCarousel.liquid.js"),GalleryGrid_liquid=require("./components/gallery-grid/GalleryGrid.liquid.js"),helpers=require("../../../helpers.js"),productGallery=require("./common/productGallery.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getProductImagesStyles=require("./composables/getProductImagesStyles.js"),system=require("@gem-sdk/system"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),_function=require("../../helpers/function.js");const ProductImages=e=>{let t=common.setDefaultWhenUndefineSetting(e),{setting:s,styles:r,builderProps:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),common=require("./common/common.js"),FeatureImageWithGallery_liquid=require("./components/feature-gallery/FeatureImageWithGallery.liquid.js"),GalleryCarousel_liquid=require("./components/gallery-carousel/GalleryCarousel.liquid.js"),GalleryGrid_liquid=require("./components/gallery-grid/GalleryGrid.liquid.js"),helpers=require("../../../helpers.js"),productGallery=require("./common/productGallery.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getProductImagesStyles=require("./composables/getProductImagesStyles.js"),system=require("@gem-sdk/system"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),_function=require("../../helpers/function.js");const ProductImages=e=>{let t=common.setDefaultWhenUndefineSetting(e),{setting:s,styles:r,builderProps:i,style:a}=t,{rawChildren:o,pageContext:l}=e,{enableLazyLoadImage:d}=l??{},u={...s,...r},c=`
|
|
2
2
|
{
|
|
3
|
-
"id":${JSON.stringify(
|
|
3
|
+
"id":${JSON.stringify(i?.uid)},
|
|
4
4
|
"pageContext": ${JSON.stringify(l)},
|
|
5
5
|
"setting":${JSON.stringify(s)},
|
|
6
6
|
"styles":${JSON.stringify(r)},
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
"collectionUrl": {{ collection.url | json | escape }},
|
|
10
10
|
"collection": {{ collection | json | escape}}
|
|
11
11
|
}
|
|
12
|
-
`,p=system.createAttr({"section-id":"{{section.id}}","data-id":`${
|
|
13
|
-
${core.WrapRenderChildren({uid:
|
|
14
|
-
`,
|
|
12
|
+
`,p=system.createAttr({"section-id":"{{section.id}}","data-id":`${i?.uid}`}),{isOnlyFeatureAllDevices:m,isRenderGalleryGrid:n}=common.getConditionRenderGalleryImages(u?.position),g=n?{}:system.createAttr({"data-only-image":system.LiquidIf("product.media.size > 1","false","true")}),{wrapperClasses:y,productImagesGalleryClasses:f}=getProductImagesClassName.getProductImagesClassName(e),I=system.createClass({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),$=system.createClass({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:h,wrapContainerStyleOnlyOneImage:S,galleryImageStyle:q}=getProductImagesStyles.getProductImagesStyles(u),C=productGallery.getShapeByLayout({shape:u.shape,shapeForBottom:u.shapeForBottom,shapeFor1Col:u.shapeFor1Col,shapeFor2Col:u.shapeFor2Col,shapeForFtOnly:u.shapeForFtOnly,shapeForInsideBottom:u.shapeForInsideBottom??productGallery.sizeSettingDefaultForNewLayout,shapeForInside:u.shapeForInside??productGallery.sizeSettingDefaultForNewLayout},u.position),G=common.getStyleInsideLayout(u.position,C,u?.spacing),v=()=>core.template`
|
|
13
|
+
${core.WrapRenderChildren({uid:i?.uid||"",customProps:o?.[0].customProps},o?.map(e=>{if(e)return core.template`${core.RenderChildren({...e,isInsideProductImage:!0,imageData:{imageShape:r?.ftShape,imageAlign:r?.align,imageLayout:r?.position},dotData:{dotSize:s?.ftDotSize,dotGapToCarousel:s?.ftDotGapToCarousel,dotStyle:s?.ftDotStyle}})}`}))}
|
|
14
|
+
`,j=()=>core.template`
|
|
15
15
|
<div
|
|
16
|
-
class="${
|
|
17
|
-
style="${_function.getStyleOfObject(
|
|
18
|
-
${{...
|
|
16
|
+
class="${f}"
|
|
17
|
+
style="${_function.getStyleOfObject(q)}"
|
|
18
|
+
${{...g}}
|
|
19
19
|
>
|
|
20
|
-
${GalleryCarousel_liquid.default({builderPropUID:`gp-gallery-${
|
|
21
|
-
${GalleryGrid_liquid.default({builderPropUID:
|
|
20
|
+
${system.LiquidIf("product.media.size > 1",GalleryCarousel_liquid.default({builderPropUID:`gp-gallery-${i?.uid}`,...u,enableLazyLoadImage:d}))}
|
|
21
|
+
${system.If(n,GalleryGrid_liquid.default({builderPropUID:i?.uid,wrapperStyle:{...G},children:v(),...u,enableLazyLoadImage:d}))}
|
|
22
22
|
</div>
|
|
23
|
-
`,
|
|
24
|
-
${system.If(
|
|
23
|
+
`,P=()=>s?.borderActive?.border!=="none";return core.template`
|
|
24
|
+
${system.If(P(),system.LiquidIf("product.media.size > 1",`<style>${getBorderActiveCss.getBorderActiveCss({settings:u,uid:i?.uid,type:"Liquid"})}</style>`),"")}
|
|
25
25
|
${system.Liquid(`
|
|
26
26
|
{% assign featured_image = product.featured_image %}
|
|
27
27
|
${system.LiquidIf("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
<gp-product-images
|
|
30
30
|
gp-data='${c}'
|
|
31
31
|
${{...p}}
|
|
32
|
-
style="${{...
|
|
33
|
-
class="${
|
|
32
|
+
style="${{...a}}"
|
|
33
|
+
class="${y}"
|
|
34
34
|
>
|
|
35
35
|
<div
|
|
36
|
-
class="${system.LiquidIf("product.media.size > 1",`${
|
|
37
|
-
style="${system.LiquidIf("product.media.size > 1",_function.getStyleOfObject(
|
|
36
|
+
class="${system.LiquidIf("product.media.size > 1",`${I}`,`${$}`)}"
|
|
37
|
+
style="${system.LiquidIf("product.media.size > 1",_function.getStyleOfObject(h),_function.getStyleOfObject(S))}"
|
|
38
38
|
>
|
|
39
|
-
${FeatureImageWithGallery_liquid.default({builderPropUID:`gp-carousel-${
|
|
40
|
-
${system.If(!
|
|
39
|
+
${FeatureImageWithGallery_liquid.default({builderPropUID:`gp-carousel-${i?.uid}`,...u,children:v(),enableLazyLoadImage:d})}
|
|
40
|
+
${system.If(!m,j())}
|
|
41
41
|
</div>
|
|
42
42
|
</gp-product-images>
|
|
43
43
|
${system.If(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-images-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-images-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as s,RenderChildren as t}from"@gem-sdk/core";import{getConditionRenderGalleryImages as i,getStyleInsideLayout as a,setDefaultWhenUndefineSetting as p}from"./common/common.js";import l from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import d from"./components/gallery-carousel/GalleryCarousel.liquid.js";import m from"./components/gallery-grid/GalleryGrid.liquid.js";import{getSettingPreloadData as c}from"../../../helpers.js";import{getShapeByLayout as u,sizeSettingDefaultForNewLayout as n}from"./common/productGallery.js";import{getProductImagesClassName as g}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as f}from"./composables/getProductImagesStyles.js";import{createAttr as $,LiquidIf as y,createClass as h,If as S,Liquid as j}from"@gem-sdk/system";import{getBorderActiveCss as v}from"./common/getBorderActiveCss.js";import{getStyleOfObject as F}from"../../helpers/function.js";let ProductImages=I=>{let P=p(I),{setting:C,styles:G,builderProps:D,style:b}=P,{rawChildren:
|
|
1
|
+
import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as s,RenderChildren as t}from"@gem-sdk/core";import{getConditionRenderGalleryImages as i,getStyleInsideLayout as a,setDefaultWhenUndefineSetting as p}from"./common/common.js";import l from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import d from"./components/gallery-carousel/GalleryCarousel.liquid.js";import m from"./components/gallery-grid/GalleryGrid.liquid.js";import{getSettingPreloadData as c}from"../../../helpers.js";import{getShapeByLayout as u,sizeSettingDefaultForNewLayout as n}from"./common/productGallery.js";import{getProductImagesClassName as g}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as f}from"./composables/getProductImagesStyles.js";import{createAttr as $,LiquidIf as y,createClass as h,If as S,Liquid as j}from"@gem-sdk/system";import{getBorderActiveCss as v}from"./common/getBorderActiveCss.js";import{getStyleOfObject as F}from"../../helpers/function.js";let ProductImages=I=>{let P=p(I),{setting:C,styles:G,builderProps:D,style:b}=P,{rawChildren:z,pageContext:O}=I,{enableLazyLoadImage:_}=O??{},N={...C,...G},A=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(D?.uid)},
|
|
4
|
-
"pageContext": ${JSON.stringify(
|
|
4
|
+
"pageContext": ${JSON.stringify(O)},
|
|
5
5
|
"setting":${JSON.stringify(C)},
|
|
6
6
|
"styles":${JSON.stringify(G)},
|
|
7
7
|
"productUrl":{{product.url | json | escape}},
|
|
@@ -9,19 +9,19 @@ import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as s,R
|
|
|
9
9
|
"collectionUrl": {{ collection.url | json | escape }},
|
|
10
10
|
"collection": {{ collection | json | escape}}
|
|
11
11
|
}
|
|
12
|
-
`,B=$({"section-id":"{{section.id}}","data-id":`${D?.uid}`}),U
|
|
13
|
-
${s({uid:D?.uid||"",customProps:
|
|
14
|
-
`,
|
|
12
|
+
`,B=$({"section-id":"{{section.id}}","data-id":`${D?.uid}`}),{isOnlyFeatureAllDevices:U,isRenderGalleryGrid:k}=i(N?.position),q=k?{}:$({"data-only-image":y("product.media.size > 1","false","true")}),{wrapperClasses:E,productImagesGalleryClasses:J}=g(I),w=h({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),T=h({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:x,wrapContainerStyleOnlyOneImage:L,galleryImageStyle:M}=f(N),R=u({shape:N.shape,shapeForBottom:N.shapeForBottom,shapeFor1Col:N.shapeFor1Col,shapeFor2Col:N.shapeFor2Col,shapeForFtOnly:N.shapeForFtOnly,shapeForInsideBottom:N.shapeForInsideBottom??n,shapeForInside:N.shapeForInside??n},N.position),V=a(N.position,R,N?.spacing),W=()=>e`
|
|
13
|
+
${s({uid:D?.uid||"",customProps:z?.[0].customProps},z?.map(o=>{if(o)return e`${t({...o,isInsideProductImage:!0,imageData:{imageShape:G?.ftShape,imageAlign:G?.align,imageLayout:G?.position},dotData:{dotSize:C?.ftDotSize,dotGapToCarousel:C?.ftDotGapToCarousel,dotStyle:C?.ftDotStyle}})}`}))}
|
|
14
|
+
`,H=()=>e`
|
|
15
15
|
<div
|
|
16
|
-
class="${
|
|
17
|
-
style="${F(
|
|
18
|
-
${{...
|
|
16
|
+
class="${J}"
|
|
17
|
+
style="${F(M)}"
|
|
18
|
+
${{...q}}
|
|
19
19
|
>
|
|
20
|
-
${d({builderPropUID:`gp-gallery-${D?.uid}`,...N,enableLazyLoadImage:
|
|
21
|
-
${m({builderPropUID:D?.uid,wrapperStyle:{...
|
|
20
|
+
${y("product.media.size > 1",d({builderPropUID:`gp-gallery-${D?.uid}`,...N,enableLazyLoadImage:_}))}
|
|
21
|
+
${S(k,m({builderPropUID:D?.uid,wrapperStyle:{...V},children:W(),...N,enableLazyLoadImage:_}))}
|
|
22
22
|
</div>
|
|
23
|
-
`,
|
|
24
|
-
${S(
|
|
23
|
+
`,K=()=>C?.borderActive?.border!=="none";return e`
|
|
24
|
+
${S(K(),y("product.media.size > 1",`<style>${v({settings:N,uid:D?.uid,type:"Liquid"})}</style>`),"")}
|
|
25
25
|
${j(`
|
|
26
26
|
{% assign featured_image = product.featured_image %}
|
|
27
27
|
${y("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
@@ -30,14 +30,14 @@ import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as s,R
|
|
|
30
30
|
gp-data='${A}'
|
|
31
31
|
${{...B}}
|
|
32
32
|
style="${{...b}}"
|
|
33
|
-
class="${
|
|
33
|
+
class="${E}"
|
|
34
34
|
>
|
|
35
35
|
<div
|
|
36
|
-
class="${y("product.media.size > 1",`${
|
|
37
|
-
style="${y("product.media.size > 1",F(
|
|
36
|
+
class="${y("product.media.size > 1",`${w}`,`${T}`)}"
|
|
37
|
+
style="${y("product.media.size > 1",F(x),F(L))}"
|
|
38
38
|
>
|
|
39
|
-
${l({builderPropUID:`gp-carousel-${D?.uid}`,...N,children:
|
|
40
|
-
${S(!
|
|
39
|
+
${l({builderPropUID:`gp-carousel-${D?.uid}`,...N,children:W(),enableLazyLoadImage:_})}
|
|
40
|
+
${S(!U,H())}
|
|
41
41
|
</div>
|
|
42
42
|
</gp-product-images>
|
|
43
43
|
${S(o,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-images-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-images-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|