@gem-sdk/components 17.0.0-dev.128 → 17.0.0-dev.129

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