@gem-sdk/components 2.0.0-staging.1109 → 2.0.0-staging.1111
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/icon-list-v2/hooks/useIconLineHeight.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +6 -6
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +3 -3
- package/dist/esm/icon-list-v2/hooks/useIconLineHeight.js +1 -1
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +3 -3
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +4 -4
- package/dist/esm/product/components/product-wrap/Product.liquid.js +5 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react");const useIconLineHeight=({iconWidth:e})=>{let t=React.useRef(null),[r,u]=React.useState("");return React.useEffect(()=>{if(t?.current
|
|
1
|
+
"use strict";var React=require("react");const useIconLineHeight=({iconWidth:e})=>{let t=React.useRef(null),[r,u]=React.useState("");return React.useEffect(()=>{if(t?.current){let e=window.getComputedStyle(t?.current).getPropertyValue("line-height");u(e)}},[e?.desktop]),{ref:t,lineHeight:r}};exports.useIconLineHeight=useIconLineHeight;
|
|
@@ -1,15 +1,15 @@
|
|
|
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,children:
|
|
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,children:n}=e,{productItemClass:o,gpProductClass:a}=classes.getClass(e);return core.template`
|
|
2
2
|
<gp-product
|
|
3
|
-
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
4
4
|
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 }},"pageContext" : ${JSON.stringify(t)}}'
|
|
5
5
|
class="${a}"
|
|
6
6
|
|
|
7
7
|
>
|
|
8
|
-
{%- form 'product', product, id: product_form_id, class: 'form contents ${
|
|
8
|
+
{%- form 'product', product, id: product_form_id, class: 'form contents ${o}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
9
9
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
10
10
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
11
11
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
12
|
-
${
|
|
12
|
+
${n}
|
|
13
13
|
{%- endform -%}
|
|
14
14
|
</gp-product>
|
|
15
15
|
`};exports.default=ProductListItem;
|
|
@@ -1,19 +1,19 @@
|
|
|
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:
|
|
2
|
-
${
|
|
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
3
|
${core.RenderChildren({...e,index:t})}
|
|
4
4
|
`})}
|
|
5
5
|
`;return core.template`
|
|
6
6
|
<gp-product
|
|
7
|
-
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
7
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
8
8
|
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 }},"pageContext" : ${JSON.stringify(t)}}'
|
|
9
|
-
class="${
|
|
9
|
+
class="${a}"
|
|
10
10
|
|
|
11
11
|
>
|
|
12
|
-
{%- form 'product', product, id: product_form_id, class: 'form contents ${
|
|
12
|
+
{%- form 'product', product, id: product_form_id, class: 'form contents ${o}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
13
13
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
14
14
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
15
15
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
16
|
-
${
|
|
16
|
+
${r()}
|
|
17
17
|
{%- endform -%}
|
|
18
18
|
</gp-product>
|
|
19
19
|
`};exports.default=ProductListItem;
|
|
@@ -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: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}=r??{},{rowSetting:n,rowStyles:c,formatVariantId:l,formatProductId:p,productStatus:u,preSelectedOptionIds:f,productHandle:g,advancedStyle:m}=helpers.getData(e),_=()=>core.template`
|
|
2
2
|
{%- liquid
|
|
3
3
|
if request.page_type == 'product'
|
|
4
4
|
if '${u}' == '${helpers.STATIC_PRODUCT_STATUS}'
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
data-id="${a?.uid}"
|
|
80
80
|
style="${m}"
|
|
81
81
|
class="${d?.cssClass}"
|
|
82
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${f}], "isSyncProduct": "${s}", "variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
82
|
+
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${f}], "isSyncProduct": "${s}", "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,7 +87,7 @@
|
|
|
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:c,setting:n,children:t,rawChildren:o})}
|
|
91
91
|
{%- endform -%}
|
|
92
92
|
</product-form>
|
|
93
93
|
</gp-product>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as e,useState as t,useEffect as r}from"react";let useIconLineHeight=({iconWidth:n})=>{let
|
|
1
|
+
import{useRef as e,useState as t,useEffect as r}from"react";let useIconLineHeight=({iconWidth:n})=>{let i=e(null),[o,l]=t("");return r(()=>{if(i?.current){let e=window.getComputedStyle(i?.current).getPropertyValue("line-height");l(e)}},[n?.desktop]),{ref:i,lineHeight:o}};export{useIconLineHeight};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{template as t}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=
|
|
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:c}=e(n);return t`
|
|
2
2
|
<gp-product
|
|
3
|
-
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
4
|
-
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 }},"pageContext" : ${JSON.stringify(
|
|
3
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
4
|
+
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 }},"pageContext" : ${JSON.stringify(o)}}'
|
|
5
5
|
class="${c}"
|
|
6
6
|
|
|
7
7
|
>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{template as t,RenderChildren as e}from"@gem-sdk/core";import{getClass as
|
|
2
|
-
${r?.map((o
|
|
3
|
-
${e({...
|
|
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:c,gpProductClass:i}=n(o),d=()=>t`
|
|
2
|
+
${r?.map((n,o)=>{if(n)return t`
|
|
3
|
+
${e({...n,index:o})}
|
|
4
4
|
`})}
|
|
5
5
|
`;return t`
|
|
6
6
|
<gp-product
|
|
7
|
-
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
7
|
+
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
8
8
|
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 }},"pageContext" : ${JSON.stringify(a)}}'
|
|
9
9
|
class="${i}"
|
|
10
10
|
|
|
@@ -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 a,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:I}=g??{},{rowSetting:S,rowStyles:b,formatVariantId:j,formatProductId:h,productStatus:q,preSelectedOptionIds:V,productHandle:P,advancedStyle:k}=c(f),w=()=>t`
|
|
2
2
|
{%- liquid
|
|
3
3
|
if request.page_type == 'product'
|
|
4
4
|
if '${q}' == '${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
|
`,x=()=>t`
|
|
60
60
|
{%- assign gpBkProduct = product -%}
|
|
61
|
-
${
|
|
61
|
+
${d(q==p,E(),w())}
|
|
62
62
|
`,A=()=>t`
|
|
63
63
|
{%- assign initVariantId = ${j} -%}
|
|
64
64
|
{%- assign product_form_id = 'product-form-' | append: "${v?.uid}" -%}
|
|
@@ -79,7 +79,7 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
|
|
|
79
79
|
data-id="${v?.uid}"
|
|
80
80
|
style="${k}"
|
|
81
81
|
class="${$?.cssClass}"
|
|
82
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${V}], "isSyncProduct": "${I}", "variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
82
|
+
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${V}], "isSyncProduct": "${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
|
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
|
+
${o({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:b,setting:S,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
|
${x()}
|
|
97
|
-
${
|
|
97
|
+
${a("product != empty and product != null",G(),B())}
|
|
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};
|