@gem-sdk/components 11.2.2 → 11.2.3
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-title/ProductTitle.liquid.js +10 -3
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +25 -25
- package/dist/esm/product/components/product-title/ProductTitle.liquid.js +10 -3
- package/dist/esm/product/components/product-wrap/Product.liquid.js +26 -26
- package/package.json +1 -1
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),Text_liquid=require("../../../text/components/Text.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("./common/helpers.js");const ProductTitle=e=>{let{setting:t}=e,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),Text_liquid=require("../../../text/components/Text.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("./common/helpers.js");const ProductTitle=e=>{let{setting:t,builderProps:r}=e,s=`<p>${helpers.getStaticLocale("ProductTitle","product_not_found")}</p>`,l=()=>Text_liquid.default(helpers$1.getTextProps(e)),i=system.createAttr({href:"{{ product.url }}",title:"{{ product.title }}"}),o=t?.linkProduct,c=system.createClass({"gp-product-title-link-wrapper":!0}),p=system.createStateOrContext({setting:{linkProduct:t?.linkProduct},uid:r?.uid}),u=()=>{let e=core.isLocalEnv?"{{ 'gp-product-title-v7-5.js' | asset_url }}":`${core.baseAssetURL}/assets-v2/gp-product-title-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return system.LiquidUnless("product",`${s}`,core.template`
|
|
2
|
+
<gp-product-title
|
|
3
|
+
gp-data='${core.dataStringify(p)}'
|
|
4
|
+
>
|
|
5
|
+
${system.If(o,core.template`<a ${i} class="${c}">
|
|
6
|
+
${l()}
|
|
7
|
+
</a>`,core.template`${l()}`)}
|
|
8
|
+
</gp-product-title>
|
|
9
|
+
${u()}
|
|
10
|
+
`)};exports.default=ProductTitle;
|
|
@@ -1,14 +1,14 @@
|
|
|
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}=r??{},{rowSetting:
|
|
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
|
-
if '${
|
|
5
|
-
if '${
|
|
4
|
+
if '${g}' == '${helpers.STATIC_PRODUCT_STATUS}'
|
|
5
|
+
if '${f}' == '${helpers.PRODUCT_ID_LATEST}'
|
|
6
6
|
paginate collections.all.products by 100000
|
|
7
7
|
assign product = collections.all.products | sort: 'created_at' | reverse | first
|
|
8
8
|
endpaginate
|
|
9
9
|
else
|
|
10
|
-
assign product = all_products['${
|
|
11
|
-
assign productId = '${
|
|
10
|
+
assign product = all_products['${_}']
|
|
11
|
+
assign productId = '${f}' | times: 1
|
|
12
12
|
if product == empty or product == null
|
|
13
13
|
paginate collections.all.products by 100000
|
|
14
14
|
for item in collections.all.products
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
endif
|
|
22
22
|
endif
|
|
23
23
|
else
|
|
24
|
-
if '${
|
|
24
|
+
if '${f}' == '${helpers.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
|
-
assign product = all_products['${
|
|
30
|
-
assign productId = '${
|
|
29
|
+
assign product = all_products['${_}']
|
|
30
|
+
assign productId = '${f}' | 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,11 +40,11 @@
|
|
|
40
40
|
endif
|
|
41
41
|
endif
|
|
42
42
|
-%}
|
|
43
|
-
|
|
43
|
+
`,$=()=>core.template`
|
|
44
44
|
{%- liquid
|
|
45
45
|
if request.page_type != 'product'
|
|
46
|
-
assign product = all_products['${
|
|
47
|
-
assign productId = '${
|
|
46
|
+
assign product = all_products['${_}']
|
|
47
|
+
assign productId = '${f}' | times: 1
|
|
48
48
|
if product == empty or product == null
|
|
49
49
|
paginate collections.all.products by 100000
|
|
50
50
|
for item in collections.all.products
|
|
@@ -56,30 +56,30 @@
|
|
|
56
56
|
endif
|
|
57
57
|
endif
|
|
58
58
|
-%}
|
|
59
|
-
`,
|
|
59
|
+
`,S=()=>core.template`
|
|
60
60
|
{%- assign gpBkProduct = product -%}
|
|
61
|
-
${system.If(
|
|
62
|
-
|
|
63
|
-
{%- assign initVariantId = ${
|
|
61
|
+
${system.If(g==helpers.DYNAMIC_PRODUCT_STATUS,$(),v())}
|
|
62
|
+
`,h=()=>core.template`
|
|
63
|
+
{%- assign initVariantId = ${u} -%}
|
|
64
64
|
{%- assign product_form_id = 'product-form-' | append: "${a?.uid}" -%}
|
|
65
|
-
${
|
|
66
|
-
${
|
|
65
|
+
${u?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
|
|
66
|
+
${u?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
|
|
67
67
|
{%-if productSelectedVariant == empty or productSelectedVariant == null -%}
|
|
68
68
|
{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}
|
|
69
69
|
{%- endif -%}
|
|
70
70
|
{%-if variant == empty or variant == null -%}
|
|
71
71
|
{%- assign variant = product.selected_or_first_available_variant -%}
|
|
72
72
|
{%- endif -%}
|
|
73
|
-
`,S=()=>core.template`
|
|
74
|
-
<div class="gp-text-center">${helpers$1.getStaticLocale("Product","product_not_found")}</div>
|
|
75
73
|
`,I=()=>core.template`
|
|
76
|
-
|
|
74
|
+
<div class="gp-text-center">${helpers$1.getStaticLocale("Product","product_not_found")}</div>
|
|
75
|
+
`,q=()=>core.template`
|
|
76
|
+
${h()}
|
|
77
77
|
<gp-product
|
|
78
78
|
data-uid="${a?.uid}"
|
|
79
79
|
data-id="${a?.uid}"
|
|
80
|
-
style="${
|
|
80
|
+
style="${y}"
|
|
81
81
|
class="${d?.cssClass}"
|
|
82
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${
|
|
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
|
gp-data='{"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 }}}'
|
|
84
84
|
>
|
|
85
85
|
<product-form class="product-form">
|
|
@@ -87,13 +87,13 @@
|
|
|
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
|
-
${Row_liquid.default({builderProps:{...a,uid:a?.uid,uidInteraction:`${a?.uid}-row`},style:i,styles:
|
|
90
|
+
${Row_liquid.default({builderProps:{...a,uid:a?.uid,uidInteraction:`${a?.uid}-row`},style:i,styles:p,setting:l,children:t,rawChildren:o})}
|
|
91
91
|
{%- endform -%}
|
|
92
92
|
</product-form>
|
|
93
93
|
</gp-product>
|
|
94
94
|
{%- assign product = gpBkProduct -%}
|
|
95
95
|
`;return core.template`
|
|
96
|
-
${
|
|
97
|
-
${system.LiquidIf("product != empty and product != null",
|
|
96
|
+
${S()}
|
|
97
|
+
${system.LiquidIf("product != empty and product != null",q(),I())}
|
|
98
98
|
${core.RenderIf(core.isLocalEnv,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
99
99
|
`};exports.default=Product;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import{template as t}from"@gem-sdk/core";import{getStaticLocale as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import{template as t,dataStringify as r,isLocalEnv as e,baseAssetURL as o}from"@gem-sdk/core";import{getStaticLocale as p,getSettingPreloadData as s}from"../../../helpers.js";import i from"../../../text/components/Text.liquid.js";import{createAttr as l,createClass as d,createStateOrContext as u,LiquidUnless as c,If as m}from"@gem-sdk/system";import{getTextProps as a}from"./common/helpers.js";let ProductTitle=n=>{let{setting:$,builderProps:f}=n,g=`<p>${p("ProductTitle","product_not_found")}</p>`,k=()=>i(a(n)),P=l({href:"{{ product.url }}",title:"{{ product.title }}"}),j=$?.linkProduct,S=d({"gp-product-title-link-wrapper":!0}),T=u({setting:{linkProduct:$?.linkProduct},uid:f?.uid}),h=()=>{let t=e?"{{ 'gp-product-title-v7-5.js' | asset_url }}":`${o}/assets-v2/gp-product-title-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${s('class="gps-link" delay',"src")}="${t}" defer="defer"></script>`};return c("product",`${g}`,t`
|
|
2
|
+
<gp-product-title
|
|
3
|
+
gp-data='${r(T)}'
|
|
4
|
+
>
|
|
5
|
+
${m(j,t`<a ${P} class="${S}">
|
|
6
|
+
${k()}
|
|
7
|
+
</a>`,t`${k()}`)}
|
|
8
|
+
</gp-product-title>
|
|
9
|
+
${h()}
|
|
10
|
+
`)};export{ProductTitle as default};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{template as t,RenderIf as e,isLocalEnv as
|
|
1
|
+
import{template as t,RenderIf as e,isLocalEnv as r,baseAssetURL as i}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:I}=g??{},b=I?.hasPreSelected??!1,{rowSetting:j,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
|
-
if '${
|
|
5
|
-
if '${
|
|
4
|
+
if '${V}' == '${l}'
|
|
5
|
+
if '${P}' == '${u}'
|
|
6
6
|
paginate collections.all.products by 100000
|
|
7
7
|
assign product = collections.all.products | sort: 'created_at' | reverse | first
|
|
8
8
|
endpaginate
|
|
9
9
|
else
|
|
10
|
-
assign product = all_products['${
|
|
11
|
-
assign productId = '${
|
|
10
|
+
assign product = all_products['${w}']
|
|
11
|
+
assign productId = '${P}' | times: 1
|
|
12
12
|
if product == empty or product == null
|
|
13
13
|
paginate collections.all.products by 100000
|
|
14
14
|
for item in collections.all.products
|
|
@@ -21,13 +21,13 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
|
|
|
21
21
|
endif
|
|
22
22
|
endif
|
|
23
23
|
else
|
|
24
|
-
if '${
|
|
24
|
+
if '${P}' == '${u}'
|
|
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
|
-
assign product = all_products['${
|
|
30
|
-
assign productId = '${
|
|
29
|
+
assign product = all_products['${w}']
|
|
30
|
+
assign productId = '${P}' | 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,11 +40,11 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
|
|
|
40
40
|
endif
|
|
41
41
|
endif
|
|
42
42
|
-%}
|
|
43
|
-
`,
|
|
43
|
+
`,A=()=>t`
|
|
44
44
|
{%- liquid
|
|
45
45
|
if request.page_type != 'product'
|
|
46
|
-
assign product = all_products['${
|
|
47
|
-
assign productId = '${
|
|
46
|
+
assign product = all_products['${w}']
|
|
47
|
+
assign productId = '${P}' | times: 1
|
|
48
48
|
if product == empty or product == null
|
|
49
49
|
paginate collections.all.products by 100000
|
|
50
50
|
for item in collections.all.products
|
|
@@ -56,30 +56,30 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
|
|
|
56
56
|
endif
|
|
57
57
|
endif
|
|
58
58
|
-%}
|
|
59
|
-
`,
|
|
59
|
+
`,B=()=>t`
|
|
60
60
|
{%- assign gpBkProduct = product -%}
|
|
61
|
-
${d(
|
|
62
|
-
`,
|
|
63
|
-
{%- assign initVariantId = ${
|
|
61
|
+
${d(V==p,A(),x())}
|
|
62
|
+
`,G=()=>t`
|
|
63
|
+
{%- assign initVariantId = ${q} -%}
|
|
64
64
|
{%- assign product_form_id = 'product-form-' | append: "${v?.uid}" -%}
|
|
65
|
-
${
|
|
66
|
-
${
|
|
65
|
+
${q?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
|
|
66
|
+
${q?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
|
|
67
67
|
{%-if productSelectedVariant == empty or productSelectedVariant == null -%}
|
|
68
68
|
{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}
|
|
69
69
|
{%- endif -%}
|
|
70
70
|
{%-if variant == empty or variant == null -%}
|
|
71
71
|
{%- assign variant = product.selected_or_first_available_variant -%}
|
|
72
72
|
{%- endif -%}
|
|
73
|
-
`,
|
|
73
|
+
`,H=()=>t`
|
|
74
74
|
<div class="gp-text-center">${s("Product","product_not_found")}</div>
|
|
75
|
-
`,
|
|
76
|
-
${
|
|
75
|
+
`,O=()=>t`
|
|
76
|
+
${G()}
|
|
77
77
|
<gp-product
|
|
78
78
|
data-uid="${v?.uid}"
|
|
79
79
|
data-id="${v?.uid}"
|
|
80
|
-
style="${
|
|
80
|
+
style="${E}"
|
|
81
81
|
class="${$?.cssClass}"
|
|
82
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${
|
|
82
|
+
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${b}, "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
|
gp-data='{"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 }}}'
|
|
84
84
|
>
|
|
85
85
|
<product-form class="product-form">
|
|
@@ -87,13 +87,13 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
|
|
|
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
|
+
${a({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:h,setting:j,children:m,rawChildren:_})}
|
|
91
91
|
{%- endform -%}
|
|
92
92
|
</product-form>
|
|
93
93
|
</gp-product>
|
|
94
94
|
{%- assign product = gpBkProduct -%}
|
|
95
95
|
`;return t`
|
|
96
|
-
${
|
|
97
|
-
${
|
|
98
|
-
${e(
|
|
96
|
+
${B()}
|
|
97
|
+
${o("product != empty and product != null",O(),H())}
|
|
98
|
+
${e(r,`<script ${n('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n('class="gps-link" delay',"src")}="${i}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
99
99
|
`};export{Product as default};
|