@gem-sdk/components 23.1.0 → 23.1.2
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/product-list/ProductListCarouselItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +2 -3
- package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +13 -13
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +1 -1
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +6 -7
- package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +1 -1
- package/dist/esm/product/components/product-wrap/Product.liquid.js +7 -7
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/classes.js"),e=require("@gem-sdk/core");exports.default=n=>{let{pageContext:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/classes.js"),e=require("@gem-sdk/core");exports.default=n=>{let{pageContext:a,children:o}=n,{productItemClass:r,gpProductClass:i}=t.getClass(n);return e.template`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
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(
|
|
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(a)}}</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 }}" />
|
|
10
10
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
11
|
-
${
|
|
11
|
+
${o}
|
|
12
12
|
{%- endform -%}
|
|
13
13
|
</gp-product>
|
|
14
14
|
`};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@gem-sdk/core"),e=require("./common/classes.js");exports.default=n=>{let{pageContext:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@gem-sdk/core"),e=require("./common/classes.js");exports.default=n=>{let{pageContext:a,rawChildren:o}=n,{productItemClass:r,gpProductClass:i}=e.getClass(n);return t.template`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
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(
|
|
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(a)}}</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 }}" />
|
|
10
10
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
11
11
|
${t.template`
|
|
12
|
-
${
|
|
12
|
+
${o?.map((e,n)=>{if(e)return t.template`
|
|
13
13
|
${t.RenderChildren({...e,index:n})}
|
|
14
14
|
`}).join("")}
|
|
15
15
|
`}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/classes.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/classes.js"),e=require("@gem-sdk/core");exports.default=n=>{let{pageContext:a,children:o}=n,{productItemClass:r,gpProductClass:i}=t.getClass(n);return e.template`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
|
-
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 }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
5
4
|
class="${i}"
|
|
6
5
|
>
|
|
7
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(a)}}</script>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@gem-sdk/core"),e=require("./common/classes.js");exports.default=n=>{let{pageContext:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@gem-sdk/core"),e=require("./common/classes.js");exports.default=n=>{let{pageContext:a,rawChildren:o}=n,{productItemClass:r,gpProductClass:i}=e.getClass(n);return t.template`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
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(
|
|
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(a)}}</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 }}" />
|
|
10
10
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
11
11
|
${t.template`
|
|
12
|
-
${
|
|
12
|
+
${o?.map((e,n)=>{if(e)return t.template`
|
|
13
13
|
${t.RenderChildren({...e,index:n})}
|
|
14
14
|
`}).join("")}
|
|
15
15
|
`}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/helpers.js"),e=require("@gem-sdk/core"),i=require("../../../helpers.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/helpers.js"),e=require("@gem-sdk/core"),i=require("../../../helpers.js"),a=require("../../../grid/components/row/Row.liquid.js"),r=require("@gem-sdk/system");exports.default=d=>{let{children:n,setting:o,style:s,builderProps:c,rawChildren:l,advanced:p}=d,{isSyncProduct:u,productSetting:f}=o??{},g=f?.hasPreSelected??!1,{rowSetting:m,rowStyles:_,formatVariantId:y,formatProductId:v,productStatus:$,preSelectedOptionIds:S,productHandle:I,advancedStyle:P}=t.getData(d);return e.template`
|
|
2
2
|
${e.template`
|
|
3
3
|
{%- assign gpBkProduct = product -%}
|
|
4
|
-
${
|
|
4
|
+
${r.If($==t.DYNAMIC_PRODUCT_STATUS,e.template`
|
|
5
5
|
{%- liquid
|
|
6
6
|
if request.page_type != 'product'
|
|
7
7
|
assign product = all_products['${I}']
|
|
8
|
-
assign productId = '${
|
|
8
|
+
assign productId = '${v}' | times: 1
|
|
9
9
|
if product == empty or product == null
|
|
10
10
|
paginate collections.all.products by 100000
|
|
11
11
|
for item in collections.all.products
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
{%- liquid
|
|
22
22
|
if request.page_type == 'product'
|
|
23
23
|
if '${$}' == '${t.STATIC_PRODUCT_STATUS}'
|
|
24
|
-
if '${
|
|
24
|
+
if '${v}' == '${t.PRODUCT_ID_LATEST}'
|
|
25
25
|
paginate collections.all.products by 100000
|
|
26
26
|
assign product = collections.all.products | sort: 'created_at' | reverse | first
|
|
27
27
|
endpaginate
|
|
28
28
|
else
|
|
29
29
|
assign product = all_products['${I}']
|
|
30
|
-
assign productId = '${
|
|
30
|
+
assign productId = '${v}' | times: 1
|
|
31
31
|
if product == empty or product == null
|
|
32
32
|
paginate collections.all.products by 100000
|
|
33
33
|
for item in collections.all.products
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
endif
|
|
41
41
|
endif
|
|
42
42
|
else
|
|
43
|
-
if '${
|
|
43
|
+
if '${v}' == '${t.PRODUCT_ID_LATEST}'
|
|
44
44
|
paginate collections.all.products by 100000
|
|
45
45
|
assign product = collections.all.products | sort: 'created_at'| reverse | first
|
|
46
46
|
endpaginate
|
|
47
47
|
else
|
|
48
48
|
assign product = all_products['${I}']
|
|
49
|
-
assign productId = '${
|
|
49
|
+
assign productId = '${v}' | times: 1
|
|
50
50
|
if product == empty or product == null
|
|
51
51
|
paginate collections.all.products by 100000
|
|
52
52
|
for item in collections.all.products
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
-%}
|
|
62
62
|
`)}
|
|
63
63
|
`}
|
|
64
|
-
${
|
|
64
|
+
${r.LiquidIf("product != empty and product != null",e.template`
|
|
65
65
|
${e.template`
|
|
66
|
-
{%- assign initVariantId = ${
|
|
66
|
+
{%- assign initVariantId = ${y} -%}
|
|
67
67
|
{%- assign product_form_id = 'product-form-' | append: "${c?.uid}" -%}
|
|
68
|
-
${
|
|
69
|
-
${
|
|
68
|
+
${y?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
|
|
69
|
+
${y?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
|
|
70
70
|
{%-if productSelectedVariant == empty or productSelectedVariant == null -%}
|
|
71
71
|
{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}
|
|
72
72
|
{%- endif -%}
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
data-id="${c?.uid}"
|
|
83
83
|
style="${P}"
|
|
84
84
|
class="${p?.cssClass}"
|
|
85
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${S}], "isSyncProduct": "${u}", "hasPreSelected": ${g}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
85
|
+
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${S}], "isSyncProduct": "${u}", "hasPreSelected": ${g}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
86
86
|
>
|
|
87
87
|
<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>
|
|
88
88
|
<product-form class="product-form">
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
91
91
|
<input type="hidden" name="quantity" value="{{ quantity }}" />
|
|
92
92
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
93
|
-
${
|
|
93
|
+
${a.default({builderProps:{...c,uid:c?.uid,uidInteraction:`${c?.uid}-row`},style:s,styles:_,setting:m,children:n,rawChildren:l})}
|
|
94
94
|
{%- endform -%}
|
|
95
95
|
</product-form>
|
|
96
96
|
</gp-product>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{getClass as t}from"./common/classes.js";import{template as n}from"@gem-sdk/core";let o=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=t(o);return n`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
6
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>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let o=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=e(o);return t`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${c}"
|
|
5
5
|
>
|
|
6
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(a)}}</script>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import{getClass as t}from"./common/classes.js";import{template as n}from"@gem-sdk/core";let
|
|
1
|
+
import{getClass as t}from"./common/classes.js";import{template as n}from"@gem-sdk/core";let o=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=t(o);return n`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
|
-
|
|
5
|
-
class="${r}"
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
|
+
class="${i}"
|
|
6
5
|
>
|
|
7
|
-
<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(
|
|
8
|
-
{%- form 'product', product, id: product_form_id, class: 'form contents ${
|
|
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
|
+
{%- form 'product', product, id: product_form_id, class: 'form contents ${r}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
9
8
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
10
9
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
11
10
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
12
11
|
${a}
|
|
13
12
|
{%- endform -%}
|
|
14
13
|
</gp-product>
|
|
15
|
-
`};export{
|
|
14
|
+
`};export{o as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let o=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=e(o);return t`
|
|
2
2
|
<gp-product
|
|
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${c}"
|
|
5
5
|
>
|
|
6
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(a)}}</script>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{getData as t,DYNAMIC_PRODUCT_STATUS as e,STATIC_PRODUCT_STATUS as i,PRODUCT_ID_LATEST as r}from"./common/helpers.js";import{RenderIf as
|
|
1
|
+
import{getData as t,DYNAMIC_PRODUCT_STATUS as e,STATIC_PRODUCT_STATUS as i,PRODUCT_ID_LATEST as r}from"./common/helpers.js";import{RenderIf as a,isLocalEnv as o,baseAssetURL as d,template as n}from"@gem-sdk/core";import{getSettingPreloadData as s,getStaticLocale as c}from"../../../helpers.js";import l from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as p,If as u}from"@gem-sdk/system";let f=f=>{let{children:m,setting:g,style:y,builderProps:_,rawChildren:v,advanced:$}=f,{isSyncProduct:S,productSetting:h}=g??{},j=h?.hasPreSelected??!1,{rowSetting:I,rowStyles:b,formatVariantId:P,formatProductId:q,productStatus:V,preSelectedOptionIds:k,productHandle:w,advancedStyle:E}=t(f);return n`
|
|
2
2
|
${n`
|
|
3
3
|
{%- assign gpBkProduct = product -%}
|
|
4
4
|
${u(V==e,n`
|
|
@@ -64,7 +64,7 @@ import{getData as t,DYNAMIC_PRODUCT_STATUS as e,STATIC_PRODUCT_STATUS as i,PRODU
|
|
|
64
64
|
${p("product != empty and product != null",n`
|
|
65
65
|
${n`
|
|
66
66
|
{%- assign initVariantId = ${P} -%}
|
|
67
|
-
{%- assign product_form_id = 'product-form-' | append: "${
|
|
67
|
+
{%- assign product_form_id = 'product-form-' | append: "${_?.uid}" -%}
|
|
68
68
|
${P?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
|
|
69
69
|
${P?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
|
|
70
70
|
{%-if productSelectedVariant == empty or productSelectedVariant == null -%}
|
|
@@ -78,11 +78,11 @@ import{getData as t,DYNAMIC_PRODUCT_STATUS as e,STATIC_PRODUCT_STATUS as i,PRODU
|
|
|
78
78
|
{% endunless %}
|
|
79
79
|
`}
|
|
80
80
|
<gp-product
|
|
81
|
-
data-uid="${
|
|
82
|
-
data-id="${
|
|
81
|
+
data-uid="${_?.uid}"
|
|
82
|
+
data-id="${_?.uid}"
|
|
83
83
|
style="${E}"
|
|
84
84
|
class="${$?.cssClass}"
|
|
85
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${j}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
85
|
+
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${j}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
86
86
|
>
|
|
87
87
|
<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>
|
|
88
88
|
<product-form class="product-form">
|
|
@@ -90,7 +90,7 @@ import{getData as t,DYNAMIC_PRODUCT_STATUS as e,STATIC_PRODUCT_STATUS as i,PRODU
|
|
|
90
90
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
91
91
|
<input type="hidden" name="quantity" value="{{ quantity }}" />
|
|
92
92
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
93
|
-
${l({builderProps:{...
|
|
93
|
+
${l({builderProps:{..._,uid:_?.uid,uidInteraction:`${_?.uid}-row`},style:y,styles:b,setting:I,children:m,rawChildren:v})}
|
|
94
94
|
{%- endform -%}
|
|
95
95
|
</product-form>
|
|
96
96
|
</gp-product>
|
|
@@ -98,5 +98,5 @@ import{getData as t,DYNAMIC_PRODUCT_STATUS as e,STATIC_PRODUCT_STATUS as i,PRODU
|
|
|
98
98
|
`,n`
|
|
99
99
|
<div class="gp-text-center">${c("Product","product_not_found")}</div>
|
|
100
100
|
`)}
|
|
101
|
-
${o
|
|
101
|
+
${a(o,`<script ${s('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${s('class="gps-link" delay',"src")}="${d}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
102
102
|
`};export{f as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@gem-sdk/core": "23.0.0",
|
|
36
|
-
"@gem-sdk/styles": "23.
|
|
36
|
+
"@gem-sdk/styles": "23.1.1",
|
|
37
37
|
"@gem-sdk/system": "23.0.0",
|
|
38
38
|
"@thedutchcoder/postcss-rem-to-px": "0.0.2",
|
|
39
39
|
"@types/react-transition-group": "^4.4.12",
|