@gem-sdk/components 8.0.0-dev.123 → 8.0.0-dev.124

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.
Files changed (19) hide show
  1. package/dist/cjs/product/components/ProductImages.liquid.js +1 -1
  2. package/dist/cjs/product/components/product-images-v2/ProductImagesV2.liquid.js +4 -4
  3. package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +4 -4
  4. package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +1 -1
  5. package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +6 -6
  6. package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +1 -1
  7. package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +6 -6
  8. package/dist/cjs/product/components/product-variants/ProductVariants.liquid.js +11 -11
  9. package/dist/cjs/product/components/product-wrap/Product.liquid.js +4 -4
  10. package/dist/esm/product/components/ProductImages.liquid.js +1 -1
  11. package/dist/esm/product/components/product-images-v2/ProductImagesV2.liquid.js +7 -7
  12. package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +7 -7
  13. package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +2 -2
  14. package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +5 -5
  15. package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +2 -2
  16. package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +5 -5
  17. package/dist/esm/product/components/product-variants/ProductVariants.liquid.js +32 -32
  18. package/dist/esm/product/components/product-wrap/Product.liquid.js +5 -5
  19. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  "id":${JSON.stringify(i?.uid)},
4
4
  "setting":${JSON.stringify(t)},
5
5
  "styles":${JSON.stringify(r)},
6
- "product":{{ product | json | escape }}
6
+ "product":{{ product | json }}
7
7
  }
8
8
  `;return core.template`
9
9
  {% assign featured_image = product.featured_image %}
@@ -4,10 +4,10 @@
4
4
  "pageContext": ${JSON.stringify(l)},
5
5
  "setting":${JSON.stringify(s)},
6
6
  "styles":${JSON.stringify(r)},
7
- "productUrl":{{product.url | json | escape}},
8
- "product":{{product | json | escape}},
9
- "collectionUrl": {{ collection.url | json | escape }},
10
- "collection": {{ collection | json | escape}}
7
+ "productUrl":{{product.url | json }},
8
+ "product":{{product | json }},
9
+ "collectionUrl": {{ collection.url | json }},
10
+ "collection": {{ collection | json }}
11
11
  }
12
12
  `,p=system.createAttr({"section-id":"{{section.id}}","data-id":`${i?.uid}`}),{isOnlyFeatureAllDevices:m,isRenderGalleryGrid:n}=common.getConditionRenderGalleryImages(u?.position,s?.type),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),j=()=>core.template`
13
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}})}`}))}
@@ -4,10 +4,10 @@
4
4
  "pageContext": ${JSON.stringify(l)},
5
5
  "setting":${JSON.stringify(s)},
6
6
  "styles":${JSON.stringify(r)},
7
- "productUrl":{{product.url | json | escape}},
8
- "product":{{product | json | escape}},
9
- "collectionUrl": {{ collection.url | json | escape }},
10
- "collection": {{ collection | json | escape}}
7
+ "productUrl":{{product.url | json }},
8
+ "product":{{ product | json }},
9
+ "collectionUrl": {{ collection.url | json }},
10
+ "collection": {{ collection | json }}
11
11
  }
12
12
  `,p=system.createAttr({"section-id":"{{section.id}}","data-id":`${i?.uid}`}),{isOnlyFeatureAllDevices:m,isRenderGalleryGrid:n}=common.getConditionRenderGalleryImages(u?.position,s?.type),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),v=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),C=common.getStyleInsideLayout(u.position,v,u?.spacing),G=()=>core.template`
13
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}})}`}))}
@@ -3,7 +3,7 @@
3
3
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${a}"
5
5
  >
6
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(e)}}</script>
6
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
7
7
  {%- form 'product', product, id: product_form_id, class: 'form contents ${o}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
8
8
  <input type="hidden" name="id" value="{{ variant.id }}" />
9
9
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
@@ -1,18 +1,18 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=e=>{let{pageContext:t,rawChildren:n}=e,{productItemClass:o,gpProductClass:a}=classes.getClass(e),r=()=>core.template`
2
- ${n?.map((e,t)=>{if(e)return core.template`
3
- ${core.RenderChildren({...e,index:t})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=t=>{let{pageContext:e,rawChildren:n}=t,{productItemClass:o,gpProductClass:r}=classes.getClass(t),a=()=>core.template`
2
+ ${n?.map((t,e)=>{if(t)return core.template`
3
+ ${core.RenderChildren({...t,index:e})}
4
4
  `}).join("")}
5
5
  `;return core.template`
6
6
  <gp-product
7
7
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
8
- class="${a}"
8
+ class="${r}"
9
9
  >
10
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(t)}}</script>
10
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
11
11
  {%- form 'product', product, id: product_form_id, class: 'form contents ${o}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
12
12
  <input type="hidden" name="id" value="{{ variant.id }}" />
13
13
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
14
14
  <button type="submit" onclick="return false;" style="display:none;"></button>
15
- ${r()}
15
+ ${a()}
16
16
  {%- endform -%}
17
17
  </gp-product>
18
18
  `};exports.default=ProductListItem;
@@ -3,7 +3,7 @@
3
3
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${a}"
5
5
  >
6
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(e)}}</script>
6
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
7
7
  {%- form 'product', product, id: product_form_id, class: 'form contents ${o}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
8
8
  <input type="hidden" name="id" value="{{ variant.id }}" />
9
9
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
@@ -1,18 +1,18 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=e=>{let{pageContext:t,rawChildren:n}=e,{productItemClass:o,gpProductClass:a}=classes.getClass(e),r=()=>core.template`
2
- ${n?.map((e,t)=>{if(e)return core.template`
3
- ${core.RenderChildren({...e,index:t})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=t=>{let{pageContext:e,rawChildren:n}=t,{productItemClass:o,gpProductClass:r}=classes.getClass(t),a=()=>core.template`
2
+ ${n?.map((t,e)=>{if(t)return core.template`
3
+ ${core.RenderChildren({...t,index:e})}
4
4
  `}).join("")}
5
5
  `;return core.template`
6
6
  <gp-product
7
7
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
8
- class="${a}"
8
+ class="${r}"
9
9
  >
10
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(t)}}</script>
10
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
11
11
  {%- form 'product', product, id: product_form_id, class: 'form contents ${o}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
12
12
  <input type="hidden" name="id" value="{{ variant.id }}" />
13
13
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
14
14
  <button type="submit" onclick="return false;" style="display:none;"></button>
15
- ${r()}
15
+ ${a()}
16
16
  {%- endform -%}
17
17
  </gp-product>
18
18
  `};exports.default=ProductListItem;
@@ -71,23 +71,23 @@
71
71
  `,G=system.createAttr(getAttr.getAttrs({uid:_,hasPreSelected:v,cssClass:a?.cssClass})),k=system.createStyle(styles.getWrapperStyle(e)),W=system.createClass({"gp-flex gp-flex-col !gp-ml-0":!0}),J=()=>{let e=core.isLocalEnv?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${core.baseAssetURL}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return core.template`
72
72
  ${system.Liquid("{%- assign total_combinations = 1 -%}")}
73
73
  ${system.LiquidFor("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
74
- <gp-product-variants${G}>
74
+ <gp-product-variants ${G}>
75
75
  <script gp-data type="application/json">
76
76
  {
77
77
  "setting":${JSON.stringify(j)?.replaceAll("'","&#039;")},
78
78
  "styles":${JSON.stringify(s)},
79
- "variants":{{product.variants | json | escape}},
80
- "optionsWithValues": {{product.options_with_values | json | escape}},
81
- "variantSelected": {{ variant | json | escape }},
82
- "variantInventoryQuantity": {{product.variants | map: 'inventory_quantity' | json | escape}},
83
- "variantInventoryPolicy": {{product.variants | map: 'inventory_policy' | json | escape}},
84
- "moneyFormat": {{shop.money_format | json | escape}},
85
- "productId": {{product.id | json | escape}},
86
- "productUrl": {{product.url | json | escape}},
87
- "productHandle": {{product.handle | json | escape}},
79
+ "variants":{{product.variants | json}},
80
+ "optionsWithValues": {{product.options_with_values | json}},
81
+ "variantSelected": {{ variant | json }},
82
+ "variantInventoryQuantity": {{product.variants | map: 'inventory_quantity' | json }},
83
+ "variantInventoryPolicy": {{product.variants | map: 'inventory_policy' | json }},
84
+ "moneyFormat": {{shop.money_format | json }},
85
+ "productId": {{product.id | json }},
86
+ "productUrl": {{product.url | json }},
87
+ "productHandle": {{product.handle | json }},
88
88
  "displayState": ${JSON.stringify(g)},
89
89
  "totalVariantCombinations": {{total_combinations}},
90
- "firstAvailableVariant": {{product.selected_or_first_available_variant | json | escape}}
90
+ "firstAvailableVariant": {{product.selected_or_first_available_variant | json }}
91
91
  }
92
92
  </script>
93
93
  <div class="gp-hidden" style="--hvr-shadow: none; --hvr-shadow-tablet: none; --hvr-shadow-mobile: none"></div>
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),helpers=require("./common/helpers.js");const Product=e=>{let{children:t,setting:r,style:i,builderProps:a,rawChildren:o,advanced:s}=e,{isSyncProduct:d,productSetting:n}=r??{},c=n?.hasPreSelected??!1,{rowSetting:l,rowStyles:p,formatVariantId:u,formatProductId:f,productStatus:g,preSelectedOptionIds:m,productHandle:_,advancedStyle:y}=helpers.getData(e),v=()=>core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),helpers=require("./common/helpers.js");const Product=e=>{let{children:t,setting:r,style:i,builderProps:a,rawChildren:o,advanced:d}=e,{isSyncProduct:s,productSetting:n}=r??{},c=n?.hasPreSelected??!1,{rowSetting:l,rowStyles:p,formatVariantId:u,formatProductId:f,productStatus:g,preSelectedOptionIds:m,productHandle:_,advancedStyle:y}=helpers.getData(e),v=()=>core.template`
2
2
  {%- liquid
3
3
  if request.page_type == 'product'
4
4
  if '${g}' == '${helpers.STATIC_PRODUCT_STATUS}'
@@ -78,10 +78,10 @@
78
78
  data-uid="${a?.uid}"
79
79
  data-id="${a?.uid}"
80
80
  style="${y}"
81
- class="${s?.cssClass}"
82
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${m}], "isSyncProduct": "${d}", "hasPreSelected": ${c}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
81
+ class="${d?.cssClass}"
82
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${m}], "isSyncProduct": "${s}", "hasPreSelected": ${c}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
83
  >
84
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }}}</script>
84
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }}}</script>
85
85
  <product-form class="product-form">
86
86
  {%- form 'product', product, id: product_form_id, class: 'form contents', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
87
87
  <input type="hidden" name="id" value="{{ variant.id }}" />
@@ -3,7 +3,7 @@ import{template as t,cls as e,makeStyle as i,RenderIf as r,isLocalEnv as s,baseA
3
3
  "id":${JSON.stringify(h?.uid)},
4
4
  "setting":${JSON.stringify(j)},
5
5
  "styles":${JSON.stringify($)},
6
- "product":{{ product | json | escape }}
6
+ "product":{{ product | json }}
7
7
  }
8
8
  `;return t`
9
9
  {% assign featured_image = product.featured_image %}
@@ -1,16 +1,16 @@
1
- import{template as e,isLocalEnv as o,baseAssetURL as s,WrapRenderChildren as r,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 y,LiquidIf as $,createClass as h,If as j,Liquid as S}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=`
1
+ import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as t,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{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 y,LiquidIf as $,createClass as h,If as j,Liquid as S}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
4
  "pageContext": ${JSON.stringify(O)},
5
5
  "setting":${JSON.stringify(C)},
6
6
  "styles":${JSON.stringify(G)},
7
- "productUrl":{{product.url | json | escape}},
8
- "product":{{product | json | escape}},
9
- "collectionUrl": {{ collection.url | json | escape }},
10
- "collection": {{ collection | json | escape}}
7
+ "productUrl":{{product.url | json }},
8
+ "product":{{product | json }},
9
+ "collectionUrl": {{ collection.url | json }},
10
+ "collection": {{ collection | json }}
11
11
  }
12
12
  `,B=y({"section-id":"{{section.id}}","data-id":`${D?.uid}`}),{isOnlyFeatureAllDevices:U,isRenderGalleryGrid:k}=i(N?.position,C?.type),q=k?{}:y({"data-only-image":$("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
- ${r({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}})}`}))}
13
+ ${t({uid:D?.uid||"",customProps:z?.[0].customProps},z?.map(o=>{if(o)return e`${s({...o,isInsideProductImage:!0,imageData:{imageShape:G?.ftShape,imageAlign:G?.align,imageLayout:G?.position},dotData:{dotSize:C?.ftDotSize,dotGapToCarousel:C?.ftDotGapToCarousel,dotStyle:C?.ftDotStyle}})}`}))}
14
14
  `,H=()=>e`
15
15
  <div
16
16
  class="${J}"
@@ -40,5 +40,5 @@ import{template as e,isLocalEnv as o,baseAssetURL as s,WrapRenderChildren as r,R
40
40
  ${j(!U,H())}
41
41
  </div>
42
42
  </gp-product-images>
43
- ${j(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")}="${s}/assets-v2/gp-product-images-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
43
+ ${j(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>`)}
44
44
  `};export{ProductImages as default};
@@ -1,16 +1,16 @@
1
- import{template as e,isLocalEnv as o,baseAssetURL as s,WrapRenderChildren as r,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 y,LiquidIf as $,createClass as h,If as v,Liquid as j}from"@gem-sdk/system";import{getBorderActiveCss as S}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=`
1
+ import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as t,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{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 y,LiquidIf as $,createClass as h,If as v,Liquid as j}from"@gem-sdk/system";import{getBorderActiveCss as S}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
4
  "pageContext": ${JSON.stringify(O)},
5
5
  "setting":${JSON.stringify(C)},
6
6
  "styles":${JSON.stringify(G)},
7
- "productUrl":{{product.url | json | escape}},
8
- "product":{{product | json | escape}},
9
- "collectionUrl": {{ collection.url | json | escape }},
10
- "collection": {{ collection | json | escape}}
7
+ "productUrl":{{product.url | json }},
8
+ "product":{{ product | json }},
9
+ "collectionUrl": {{ collection.url | json }},
10
+ "collection": {{ collection | json }}
11
11
  }
12
12
  `,B=y({"section-id":"{{section.id}}","data-id":`${D?.uid}`}),{isOnlyFeatureAllDevices:U,isRenderGalleryGrid:k}=i(N?.position,C?.type),q=k?{}:y({"data-only-image":$("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
- ${r({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}})}`}))}
13
+ ${t({uid:D?.uid||"",customProps:z?.[0].customProps},z?.map(o=>{if(o)return e`${s({...o,isInsideProductImage:!0,imageData:{imageShape:G?.ftShape,imageAlign:G?.align,imageLayout:G?.position},dotData:{dotSize:C?.ftDotSize,dotGapToCarousel:C?.ftDotGapToCarousel,dotStyle:C?.ftDotStyle}})}`}))}
14
14
  `,H=()=>e`
15
15
  <div
16
16
  class="${J}"
@@ -40,5 +40,5 @@ import{template as e,isLocalEnv as o,baseAssetURL as s,WrapRenderChildren as r,R
40
40
  ${v(!U,H())}
41
41
  </div>
42
42
  </gp-product-images-v3>
43
- ${v(o,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-images-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${s}/assets-v2/gp-product-images-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
43
+ ${v(o,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-images-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-images-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
44
44
  `};export{ProductImages as default};
@@ -1,9 +1,9 @@
1
- import{template as t}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=n=>{let{pageContext:o,children:a}=n,{productItemClass:r,gpProductClass:i}=e(n);return t`
1
+ import{template as t}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=n(o);return t`
2
2
  <gp-product
3
3
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${i}"
5
5
  >
6
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(o)}}</script>
6
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
7
7
  {%- form 'product', product, id: product_form_id, class: 'form contents ${r}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
8
8
  <input type="hidden" name="id" value="{{ variant.id }}" />
9
9
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
@@ -1,18 +1,18 @@
1
- import{template as t,RenderChildren as e}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=n(o),p=()=>t`
2
- ${r?.map((n,o)=>{if(n)return t`
3
- ${e({...n,index:o})}
1
+ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e),d=()=>t`
2
+ ${r?.map((o,e)=>{if(o)return t`
3
+ ${n({...o,index:e})}
4
4
  `}).join("")}
5
5
  `;return t`
6
6
  <gp-product
7
7
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${c}"
9
9
  >
10
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(a)}}</script>
10
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
11
11
  {%- form 'product', product, id: product_form_id, class: 'form contents ${i}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
12
12
  <input type="hidden" name="id" value="{{ variant.id }}" />
13
13
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
14
14
  <button type="submit" onclick="return false;" style="display:none;"></button>
15
- ${p()}
15
+ ${d()}
16
16
  {%- endform -%}
17
17
  </gp-product>
18
18
  `};export{ProductListItem as default};
@@ -1,9 +1,9 @@
1
- import{template as t}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=n=>{let{pageContext:o,children:a}=n,{productItemClass:r,gpProductClass:i}=e(n);return t`
1
+ import{template as t}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=n(o);return t`
2
2
  <gp-product
3
3
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${i}"
5
5
  >
6
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(o)}}</script>
6
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
7
7
  {%- form 'product', product, id: product_form_id, class: 'form contents ${r}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
8
8
  <input type="hidden" name="id" value="{{ variant.id }}" />
9
9
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
@@ -1,18 +1,18 @@
1
- import{template as t,RenderChildren as e}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=n(o),p=()=>t`
2
- ${r?.map((n,o)=>{if(n)return t`
3
- ${e({...n,index:o})}
1
+ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e),d=()=>t`
2
+ ${r?.map((o,e)=>{if(o)return t`
3
+ ${n({...o,index:e})}
4
4
  `}).join("")}
5
5
  `;return t`
6
6
  <gp-product
7
7
  gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${c}"
9
9
  >
10
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(a)}}</script>
10
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
11
11
  {%- form 'product', product, id: product_form_id, class: 'form contents ${i}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
12
12
  <input type="hidden" name="id" value="{{ variant.id }}" />
13
13
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
14
14
  <button type="submit" onclick="return false;" style="display:none;"></button>
15
- ${p()}
15
+ ${d()}
16
16
  {%- endform -%}
17
17
  </gp-product>
18
18
  `};export{ProductListItem as default};
@@ -1,8 +1,8 @@
1
- import{template as e,isLocalEnv as t,baseAssetURL as i,DEVICES as s,getResponsiveValueByScreen as o}from"@gem-sdk/core";import a from"../../../text/components/Text.liquid.js";import n from"./components/variants/index.liquid.js";import r from"./components/dropdown-swatches/Dropdown.liquid.js";import p from"./components/dropdown-group/DropdownGroup.liquid.js";import{getSettingPreloadData as l}from"../../../helpers.js";import{mappingVariantStyles as d}from"./utils/mappingVariantStyles.js";import{createClass as m,createStyle as c,createAttr as u,Liquid as v,LiquidFor as f,LiquidIf as _,If as $}from"@gem-sdk/system";import{getAttrs as g}from"./common/main/getAttr.js";import{getVariantOptionGroupStyle as h,getWrapperStyle as y}from"./common/main/styles.js";import{getVariantOptionGroupClass as j,getWrapDropdownClass as w}from"./common/main/classes.js";import{getTextVariantTitleData as S,getDropdownGroupData as P}from"./common/main/getData.js";import{getWrapVariantOptionClass as b}from"./common/variants/classes.js";import{getStyleOfObject as A}from"../../helpers/function.js";import{getMarginBottomStyle as D}from"./common/variants/styles.js";import{renderOptionValuesNewFormatSwatches as N}from"./OptionVariantsNewFormat.liquid.js";import{renderOptionValuesOld as V}from"./OptionVariantsOldFormat.liquid.js";let DEFAULT_ADVANCED_DISPLAY_SETTING={desktop:!0,tablet:!0,mobile:!0},ProductVariants=E=>{let{builderProps:O,styles:T,setting:x,advanced:q}=E,{align:F,swatchItemWidth:G,dropdownItemWidth:C,swatchSpacing:I,optionTypo:k,marginBottom:L}=T??{},{label:J,optionType:z,showAsSwatches:M,layout:U,hasPreSelected:W}=x??{},R=q?.d??DEFAULT_ADVANCED_DISPLAY_SETTING,{uid:Y}=O??{},H="groupOption"===z,K=()=>{let e={};return s.forEach(t=>{let i=o(G,t);e[t]="auto"===i}),e},Q=()=>{let e={};return s.forEach(t=>{e[t]=C?.[t]==="fill"}),e},B=x?.variantPresets?d(x?.variantPresets,T):[],X=B?.map(e=>({...e,presets:{[e.optionType]:e.presets[e.optionType]}})),Z={...x,variantPresets:X},ee=e=>{let t={"'":"&apos;",'"':"&quot;"},i=e;for(let s in t)e.indexOf(s)>=0&&(i=i.replaceAll(s,t[s]));return i},et=()=>x?.variantPresets?.map(e=>`${ee(e.optionName)}($2)${e.optionType}`).join("($1)"),ei=()=>x?.variantPresets?.filter(e=>!!e?.hide)?.map(e=>e.optionName).join(","),es=({showDropdown:t,isRenderDefault:i,typeOfOption:s})=>e`
2
- ${f("value in values",n({id:"{{option.name | escape}}-{{value | escape}}",variantKey:"{{option.name | escape}}-{{option.position}}-{{ forloop.index }}",showAsSwatches:M,uid:Y,name:"{{option.name | escape}}",value:{label:"{{value | escape}}"},checked:W?"{%- if option.selected_value == value -%}true{% else %}false{%- endif -%}":"false",optionPosition:"rootForloop",typeOfOption:s,activeClass:W?"{%- if option.selected_value == value -%}option-item-active{%- endif -%}":"",...T,...Z,swatchAutoWidth:K(),optionTypo:k,isRenderDefault:i}))}
3
- ${_(t?'type == "dropdown"':"false",r({...T,...Z,swatchAutoWidth:Q(),optionTypo:k}))}`,eo=x?.variantPresets?.map(e=>({name:ee(e.optionName),type:e.optionType})).map(e=>`${e.name}($1)${e.type}`).join("($2)").toString(),ea={renderVariantItem:es,variantPresetsLiquid:eo??""},en=m(j(F)),er=c(h(I,I)),ep=S(E,"Liquid"),el=m(b(U,F)),ed=()=>e`
4
- ${v(`{%- assign presets = "${et()}" | split: '($1)' -%}`)}
5
- ${v(`{% assign hiddenPresetOptions = "${ei()}" | split: ',' %}`)}
1
+ import{template as t,isLocalEnv as i,baseAssetURL as e,DEVICES as o,getResponsiveValueByScreen as s}from"@gem-sdk/core";import n from"../../../text/components/Text.liquid.js";import a from"./components/variants/index.liquid.js";import r from"./components/dropdown-swatches/Dropdown.liquid.js";import p from"./components/dropdown-group/DropdownGroup.liquid.js";import{getSettingPreloadData as l}from"../../../helpers.js";import{mappingVariantStyles as d}from"./utils/mappingVariantStyles.js";import{createClass as m,createStyle as c,createAttr as u,Liquid as v,LiquidFor as f,LiquidIf as _,If as $}from"@gem-sdk/system";import{getAttrs as g}from"./common/main/getAttr.js";import{getVariantOptionGroupStyle as h,getWrapperStyle as y}from"./common/main/styles.js";import{getVariantOptionGroupClass as j,getWrapDropdownClass as w}from"./common/main/classes.js";import{getTextVariantTitleData as S,getDropdownGroupData as P}from"./common/main/getData.js";import{getWrapVariantOptionClass as b}from"./common/variants/classes.js";import{getStyleOfObject as A}from"../../helpers/function.js";import{getMarginBottomStyle as D}from"./common/variants/styles.js";import{renderOptionValuesNewFormatSwatches as N}from"./OptionVariantsNewFormat.liquid.js";import{renderOptionValuesOld as V}from"./OptionVariantsOldFormat.liquid.js";let DEFAULT_ADVANCED_DISPLAY_SETTING={desktop:!0,tablet:!0,mobile:!0},ProductVariants=E=>{let{builderProps:O,styles:T,setting:x,advanced:q}=E,{align:F,swatchItemWidth:G,dropdownItemWidth:C,swatchSpacing:I,optionTypo:k,marginBottom:L}=T??{},{label:J,optionType:z,showAsSwatches:M,layout:U,hasPreSelected:W}=x??{},R=q?.d??DEFAULT_ADVANCED_DISPLAY_SETTING,{uid:Y}=O??{},H="groupOption"===z,K=()=>{let t={};return o.forEach(i=>{let e=s(G,i);t[i]="auto"===e}),t},Q=()=>{let t={};return o.forEach(i=>{t[i]=C?.[i]==="fill"}),t},B=x?.variantPresets?d(x?.variantPresets,T):[],X=B?.map(t=>({...t,presets:{[t.optionType]:t.presets[t.optionType]}})),Z={...x,variantPresets:X},tt=t=>{let i={"'":"&apos;",'"':"&quot;"},e=t;for(let o in i)t.indexOf(o)>=0&&(e=e.replaceAll(o,i[o]));return e},ti=()=>x?.variantPresets?.map(t=>`${tt(t.optionName)}($2)${t.optionType}`).join("($1)"),te=()=>x?.variantPresets?.filter(t=>!!t?.hide)?.map(t=>t.optionName).join(","),to=({showDropdown:i,isRenderDefault:e,typeOfOption:o})=>t`
2
+ ${f("value in values",a({id:"{{option.name | escape}}-{{value | escape}}",variantKey:"{{option.name | escape}}-{{option.position}}-{{ forloop.index }}",showAsSwatches:M,uid:Y,name:"{{option.name | escape}}",value:{label:"{{value | escape}}"},checked:W?"{%- if option.selected_value == value -%}true{% else %}false{%- endif -%}":"false",optionPosition:"rootForloop",typeOfOption:o,activeClass:W?"{%- if option.selected_value == value -%}option-item-active{%- endif -%}":"",...T,...Z,swatchAutoWidth:K(),optionTypo:k,isRenderDefault:e}))}
3
+ ${_(i?'type == "dropdown"':"false",r({...T,...Z,swatchAutoWidth:Q(),optionTypo:k}))}`,ts=x?.variantPresets?.map(t=>({name:tt(t.optionName),type:t.optionType})).map(t=>`${t.name}($1)${t.type}`).join("($2)").toString(),tn={renderVariantItem:to,variantPresetsLiquid:ts??""},ta=m(j(F)),tr=c(h(I,I)),tp=S(E,"Liquid"),tl=m(b(U,F)),td=()=>t`
4
+ ${v(`{%- assign presets = "${ti()}" | split: '($1)' -%}`)}
5
+ ${v(`{% assign hiddenPresetOptions = "${te()}" | split: ',' %}`)}
6
6
 
7
7
  ${v(`{% assign all_option_names = options | map: 'name' %}
8
8
  {% assign filtered_options_string = '' %}
@@ -32,7 +32,7 @@ import{template as e,isLocalEnv as t,baseAssetURL as i,DEVICES as s,getResponsiv
32
32
  ${f("option in options",`
33
33
  <div
34
34
  option-name="{{option.name | escape}}"
35
- class="${el} ${_("hiddenPresetOptions contains option.name","gp-hidden")}"
35
+ class="${tl} ${_("hiddenPresetOptions contains option.name","gp-hidden")}"
36
36
  style="${A(D(L))}${v("{% if forloop.last or option.name == last_option_name %}--mb:0;--mb-mobile:0;--mb-tablet:0;{% endif %}")}"
37
37
  >
38
38
  ${v("{%- assign showVariantClass = 'variant-display' -%}")}
@@ -41,11 +41,11 @@ import{template as e,isLocalEnv as t,baseAssetURL as i,DEVICES as s,getResponsiv
41
41
  ${v("{%- assign presetDetail = preset | split: '($2)' -%}")}
42
42
  ${_("presetDetail[1] == 'dropdown' and presetDetail[0] == optionName",`${v("{%- assign showVariantClass = '' -%}")} ${v("{%- break -%}")}`)}
43
43
  `)}
44
- ${$(J,a(ep)," ")}
44
+ ${$(J,n(tp)," ")}
45
45
  <div
46
46
  variant-option-name="{{option.name | escape}}"
47
- class="${en}"
48
- style="${A(er)}"
47
+ class="${ta}"
48
+ style="${A(tr)}"
49
49
  >
50
50
  ${v("{%- assign values = option.values -%}")}
51
51
  ${v("{%- assign rootForloop = forloop.index0 -%}")}
@@ -59,47 +59,47 @@ import{template as e,isLocalEnv as t,baseAssetURL as i,DEVICES as s,getResponsiv
59
59
  {%- endif -%}
60
60
  `)}
61
61
  ${$(!W,v("{%- assign selectedValue = null -%}"),"")}
62
- ${$(M,em(),es({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
62
+ ${$(M,tm(),to({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
63
63
  </div>
64
64
  </div>`)}
65
- `,em=()=>e`
66
- ${_("shop.metafields.GEMPAGES.swatchesJSONFormat and shop.metafields.GEMPAGES.swatchesJSONFormat != blank",N(ea),V(ea))}
67
- `,ec=m(w(F)),eu=P(E),ev=()=>`
68
- <div className="${ec}">
69
- ${p(eu)}
65
+ `,tm=()=>t`
66
+ ${_("shop.metafields.GEMPAGES.swatchesJSONFormat and shop.metafields.GEMPAGES.swatchesJSONFormat != blank",N(tn),V(tn))}
67
+ `,tc=m(w(F)),tu=P(E),tv=()=>`
68
+ <div className="${tc}">
69
+ ${p(tu)}
70
70
  </div>
71
- `,ef=u(g({uid:Y,hasPreSelected:W,cssClass:q?.cssClass})),e_=c(y(E)),e$=m({"gp-flex gp-flex-col !gp-ml-0":!0}),eg=()=>{let e=t?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${i}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${l('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return e`
71
+ `,tf=u(g({uid:Y,hasPreSelected:W,cssClass:q?.cssClass})),t_=c(y(E)),t$=m({"gp-flex gp-flex-col !gp-ml-0":!0}),tg=()=>{let t=i?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${e}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${l('class="gps-link" delay',"src")}="${t}" defer="defer"></script>`};return t`
72
72
  ${v("{%- assign total_combinations = 1 -%}")}
73
73
  ${f("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
74
- <gp-product-variants${ef}>
74
+ <gp-product-variants ${tf}>
75
75
  <script gp-data type="application/json">
76
76
  {
77
77
  "setting":${JSON.stringify(Z)?.replaceAll("'","&#039;")},
78
78
  "styles":${JSON.stringify(T)},
79
- "variants":{{product.variants | json | escape}},
80
- "optionsWithValues": {{product.options_with_values | json | escape}},
81
- "variantSelected": {{ variant | json | escape }},
82
- "variantInventoryQuantity": {{product.variants | map: 'inventory_quantity' | json | escape}},
83
- "variantInventoryPolicy": {{product.variants | map: 'inventory_policy' | json | escape}},
84
- "moneyFormat": {{shop.money_format | json | escape}},
85
- "productId": {{product.id | json | escape}},
86
- "productUrl": {{product.url | json | escape}},
87
- "productHandle": {{product.handle | json | escape}},
79
+ "variants":{{product.variants | json}},
80
+ "optionsWithValues": {{product.options_with_values | json}},
81
+ "variantSelected": {{ variant | json }},
82
+ "variantInventoryQuantity": {{product.variants | map: 'inventory_quantity' | json }},
83
+ "variantInventoryPolicy": {{product.variants | map: 'inventory_policy' | json }},
84
+ "moneyFormat": {{shop.money_format | json }},
85
+ "productId": {{product.id | json }},
86
+ "productUrl": {{product.url | json }},
87
+ "productHandle": {{product.handle | json }},
88
88
  "displayState": ${JSON.stringify(R)},
89
89
  "totalVariantCombinations": {{total_combinations}},
90
- "firstAvailableVariant": {{product.selected_or_first_available_variant | json | escape}}
90
+ "firstAvailableVariant": {{product.selected_or_first_available_variant | json }}
91
91
  }
92
92
  </script>
93
93
  <div class="gp-hidden" style="--hvr-shadow: none; --hvr-shadow-tablet: none; --hvr-shadow-mobile: none"></div>
94
94
  ${v("{%- assign options = product.options_with_values -%}")}
95
95
  ${v("{%- assign variants = product.variants -%}")}
96
- ${_("options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'","<div></div>",e`<div
97
- class="${e$}"
98
- style="${e_}"
96
+ ${_("options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'","<div></div>",t`<div
97
+ class="${t$}"
98
+ style="${t_}"
99
99
  >
100
- ${$(H,ev(),ed())}
100
+ ${$(H,tv(),td())}
101
101
  </div>`)}
102
102
  </gp-product-variants>
103
103
 
104
- ${eg()}
104
+ ${tg()}
105
105
  `};export{ProductVariants as default};
@@ -1,4 +1,4 @@
1
- import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-sdk/core";import a from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as o,If as d}from"@gem-sdk/system";import{getSettingPreloadData as n,getStaticLocale as s}from"../../../helpers.js";import{getData as c,DYNAMIC_PRODUCT_STATUS as p,STATIC_PRODUCT_STATUS as l,PRODUCT_ID_LATEST as u}from"./common/helpers.js";let Product=f=>{let{children:m,setting:g,style:y,builderProps:v,rawChildren:_,advanced:$}=f,{isSyncProduct:S,productSetting:j}=g??{},I=j?.hasPreSelected??!1,{rowSetting:b,rowStyles:h,formatVariantId:q,formatProductId:P,productStatus:V,preSelectedOptionIds:k,productHandle:w,advancedStyle:E}=c(f),x=()=>t`
1
+ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-sdk/core";import o from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as d,If as a}from"@gem-sdk/system";import{getSettingPreloadData as n,getStaticLocale as s}from"../../../helpers.js";import{getData as c,DYNAMIC_PRODUCT_STATUS as p,STATIC_PRODUCT_STATUS as l,PRODUCT_ID_LATEST as u}from"./common/helpers.js";let Product=f=>{let{children:m,setting:g,style:y,builderProps:v,rawChildren:_,advanced:$}=f,{isSyncProduct:S,productSetting:j}=g??{},I=j?.hasPreSelected??!1,{rowSetting:b,rowStyles:h,formatVariantId:q,formatProductId:P,productStatus:V,preSelectedOptionIds:k,productHandle:w,advancedStyle:E}=c(f),x=()=>t`
2
2
  {%- liquid
3
3
  if request.page_type == 'product'
4
4
  if '${V}' == '${l}'
@@ -58,7 +58,7 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
58
58
  -%}
59
59
  `,B=()=>t`
60
60
  {%- assign gpBkProduct = product -%}
61
- ${d(V==p,A(),x())}
61
+ ${a(V==p,A(),x())}
62
62
  `,G=()=>t`
63
63
  {%- assign initVariantId = ${q} -%}
64
64
  {%- assign product_form_id = 'product-form-' | append: "${v?.uid}" -%}
@@ -81,19 +81,19 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
81
81
  class="${$?.cssClass}"
82
82
  gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${I}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
83
  >
84
- <script gp-data type="application/json">{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }}}</script>
84
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }}}</script>
85
85
  <product-form class="product-form">
86
86
  {%- form 'product', product, id: product_form_id, class: 'form contents', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
87
87
  <input type="hidden" name="id" value="{{ variant.id }}" />
88
88
  <input type="hidden" name="quantity" value="{{ quantity }}" />
89
89
  <button type="submit" onclick="return false;" style="display:none;"></button>
90
- ${a({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:h,setting:b,children:m,rawChildren:_})}
90
+ ${o({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:h,setting:b,children:m,rawChildren:_})}
91
91
  {%- endform -%}
92
92
  </product-form>
93
93
  </gp-product>
94
94
  {%- assign product = gpBkProduct -%}
95
95
  `;return t`
96
96
  ${B()}
97
- ${o("product != empty and product != null",O(),H())}
97
+ ${d("product != empty and product != null",O(),H())}
98
98
  ${e(i,`<script ${n('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
99
99
  `};export{Product as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "8.0.0-dev.123",
3
+ "version": "8.0.0-dev.124",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",