@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.
- package/dist/cjs/product/components/ProductImages.liquid.js +1 -1
- package/dist/cjs/product/components/product-images-v2/ProductImagesV2.liquid.js +4 -4
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +4 -4
- package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +6 -6
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +6 -6
- package/dist/cjs/product/components/product-variants/ProductVariants.liquid.js +11 -11
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +4 -4
- package/dist/esm/product/components/ProductImages.liquid.js +1 -1
- package/dist/esm/product/components/product-images-v2/ProductImagesV2.liquid.js +7 -7
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +7 -7
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +2 -2
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +5 -5
- package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +2 -2
- package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +5 -5
- package/dist/esm/product/components/product-variants/ProductVariants.liquid.js +32 -32
- package/dist/esm/product/components/product-wrap/Product.liquid.js +5 -5
- package/package.json +1 -1
|
@@ -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
|
|
8
|
-
"product":{{product | json
|
|
9
|
-
"collectionUrl": {{ collection.url | json
|
|
10
|
-
"collection": {{ collection | json
|
|
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
|
|
8
|
-
"product":{{product | json
|
|
9
|
-
"collectionUrl": {{ collection.url | json
|
|
10
|
-
"collection": {{ collection | json
|
|
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
|
|
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=
|
|
2
|
-
${n?.map((e
|
|
3
|
-
${core.RenderChildren({...
|
|
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="${
|
|
8
|
+
class="${r}"
|
|
9
9
|
>
|
|
10
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json
|
|
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
|
-
${
|
|
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
|
|
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=
|
|
2
|
-
${n?.map((e
|
|
3
|
-
${core.RenderChildren({...
|
|
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="${
|
|
8
|
+
class="${r}"
|
|
9
9
|
>
|
|
10
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json
|
|
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
|
-
${
|
|
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("'","'")},
|
|
78
78
|
"styles":${JSON.stringify(s)},
|
|
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
|
|
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
|
|
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:
|
|
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="${
|
|
82
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${m}], "isSyncProduct": "${
|
|
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
|
|
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
|
|
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
|
|
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
|
|
8
|
-
"product":{{product | json
|
|
9
|
-
"collectionUrl": {{ collection.url | json
|
|
10
|
-
"collection": {{ collection | json
|
|
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
|
-
${
|
|
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")}="${
|
|
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
|
|
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
|
|
8
|
-
"product":{{product | json
|
|
9
|
-
"collectionUrl": {{ collection.url | json
|
|
10
|
-
"collection": {{ collection | json
|
|
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
|
-
${
|
|
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")}="${
|
|
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
|
|
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
|
|
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
|
|
2
|
-
${r?.map((
|
|
3
|
-
${
|
|
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
|
|
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
|
-
${
|
|
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
|
|
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
|
|
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
|
|
2
|
-
${r?.map((
|
|
3
|
-
${
|
|
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
|
|
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
|
-
${
|
|
15
|
+
${d()}
|
|
16
16
|
{%- endform -%}
|
|
17
17
|
</gp-product>
|
|
18
18
|
`};export{ProductListItem as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{template as
|
|
2
|
-
${f("value in values",
|
|
3
|
-
${_(
|
|
4
|
-
${v(`{%- assign presets = "${
|
|
5
|
-
${v(`{% assign hiddenPresetOptions = "${
|
|
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={"'":"'",'"':"""},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="${
|
|
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,
|
|
44
|
+
${$(J,n(tp)," ")}
|
|
45
45
|
<div
|
|
46
46
|
variant-option-name="{{option.name | escape}}"
|
|
47
|
-
class="${
|
|
48
|
-
style="${A(
|
|
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,
|
|
62
|
+
${$(M,tm(),to({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
63
63
|
</div>
|
|
64
64
|
</div>`)}
|
|
65
|
-
`,
|
|
66
|
-
${_("shop.metafields.GEMPAGES.swatchesJSONFormat and shop.metafields.GEMPAGES.swatchesJSONFormat != blank",N(
|
|
67
|
-
`,
|
|
68
|
-
<div className="${
|
|
69
|
-
${p(
|
|
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
|
-
`,
|
|
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${
|
|
74
|
+
<gp-product-variants ${tf}>
|
|
75
75
|
<script gp-data type="application/json">
|
|
76
76
|
{
|
|
77
77
|
"setting":${JSON.stringify(Z)?.replaceAll("'","'")},
|
|
78
78
|
"styles":${JSON.stringify(T)},
|
|
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
|
|
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
|
|
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>",
|
|
97
|
-
class="${
|
|
98
|
-
style="${
|
|
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,
|
|
100
|
+
${$(H,tv(),td())}
|
|
101
101
|
</div>`)}
|
|
102
102
|
</gp-product-variants>
|
|
103
103
|
|
|
104
|
-
${
|
|
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
|
|
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
|
-
${
|
|
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
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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};
|