@gem-sdk/components 2.0.0-staging.1106 → 2.0.0-staging.1108

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.
@@ -1,11 +1,11 @@
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:o}=e,{productItemClass:a,gpProductClass:r}=classes.getClass(e);return core.template`
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:o}=e,{productItemClass:n,gpProductClass:a}=classes.getClass(e);return core.template`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "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
- class="${r}"
5
+ class="${a}"
6
6
 
7
7
  >
8
- {%- form 'product', product, id: product_form_id, class: 'form contents ${a}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
8
+ {%- form 'product', product, id: product_form_id, class: 'form contents ${n}', 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>
@@ -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:o}=e,{productItemClass:r,gpProductClass:a}=classes.getClass(e),n=()=>core.template`
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:o}=e,{productItemClass:r,gpProductClass:n}=classes.getClass(e),a=()=>core.template`
2
2
  ${o?.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 }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
7
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "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="${a}"
9
+ class="${n}"
10
10
 
11
11
  >
12
12
  {%- form 'product', product, id: product_form_id, class: 'form contents ${r}', 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
- ${n()}
16
+ ${a()}
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:d,advanced:o}=e,{isSyncProduct:s}=r??{},{rowSetting:c,rowStyles:n,formatVariantId:l,formatProductId:p,productStatus:u,preSelectedOptionIds:f,productHandle:g,advancedStyle:m}=helpers.getData(e),_=()=>core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),helpers=require("./common/helpers.js");const Product=e=>{let{children:t,setting:r,style:i,builderProps:a,rawChildren:o,advanced:d}=e,{isSyncProduct:s}=r??{},{rowSetting:c,rowStyles:n,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}'
@@ -56,10 +56,10 @@
56
56
  endif
57
57
  endif
58
58
  -%}
59
- `,$=()=>core.template`
59
+ `,v=()=>core.template`
60
60
  {%- assign gpBkProduct = product -%}
61
61
  ${system.If(u==helpers.DYNAMIC_PRODUCT_STATUS,y(),_())}
62
- `,v=()=>core.template`
62
+ `,$=()=>core.template`
63
63
  {%- assign initVariantId = ${l} -%}
64
64
  {%- assign product_form_id = 'product-form-' | append: "${a?.uid}" -%}
65
65
  ${l?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
@@ -73,13 +73,13 @@
73
73
  `,S=()=>core.template`
74
74
  <div class="gp-text-center">${helpers$1.getStaticLocale("Product","product_not_found")}</div>
75
75
  `,I=()=>core.template`
76
- ${v()}
76
+ ${$()}
77
77
  <gp-product
78
78
  data-uid="${a?.uid}"
79
79
  data-id="${a?.uid}"
80
80
  style="${m}"
81
- class="${o?.cssClass}"
82
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${f}], "isSyncProduct": "${s}", "variantSelected": {{ variant | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
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 }}" }'
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:n,setting:c,children:t,rawChildren:d})}
90
+ ${Row_liquid.default({builderProps:{...a,uid:a?.uid,uidInteraction:`${a?.uid}-row`},style:i,styles:n,setting:c,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
- ${$()}
96
+ ${v()}
97
97
  ${system.LiquidIf("product != empty and product != null",I(),S())}
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,6 +1,6 @@
1
1
  import{template as t}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:n,children:a}=o,{productItemClass:r,gpProductClass:c}=e(o);return t`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "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(n)}}'
5
5
  class="${c}"
6
6
 
@@ -1,19 +1,19 @@
1
- import{template as t,RenderChildren as e}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=n=>{let{pageContext:a,rawChildren:r}=n,{productItemClass:c,gpProductClass:d}=o(n),i=()=>t`
1
+ import{template as t,RenderChildren as e}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=n=>{let{pageContext:a,rawChildren:r}=n,{productItemClass:c,gpProductClass:i}=o(n),d=()=>t`
2
2
  ${r?.map((o,n)=>{if(o)return t`
3
3
  ${e({...o,index:n})}
4
4
  `})}
5
5
  `;return t`
6
6
  <gp-product
7
- gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
7
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_policy": {{ variant.inventory_policy }}, "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
- class="${d}"
9
+ class="${i}"
10
10
 
11
11
  >
12
12
  {%- form 'product', product, id: product_form_id, class: 'form contents ${c}', 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
- ${i()}
16
+ ${d()}
17
17
  {%- endform -%}
18
18
  </gp-product>
19
19
  `};export{ProductListItem as default};
@@ -1,4 +1,4 @@
1
- import{template as t,RenderIf as e,isLocalEnv as r,baseAssetURL as i}from"@gem-sdk/core";import d from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as o,If as a}from"@gem-sdk/system";import{getSettingPreloadData as s,getStaticLocale as n}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:_,rawChildren:v,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`
1
+ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-sdk/core";import d from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as o,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: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}'
@@ -61,7 +61,7 @@ import{template as t,RenderIf as e,isLocalEnv as r,baseAssetURL as i}from"@gem-s
61
61
  ${a(q==p,E(),w())}
62
62
  `,A=()=>t`
63
63
  {%- assign initVariantId = ${j} -%}
64
- {%- assign product_form_id = 'product-form-' | append: "${_?.uid}" -%}
64
+ {%- assign product_form_id = 'product-form-' | append: "${v?.uid}" -%}
65
65
  ${j?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
66
66
  ${j?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
67
67
  {%-if productSelectedVariant == empty or productSelectedVariant == null -%}
@@ -71,15 +71,15 @@ import{template as t,RenderIf as e,isLocalEnv as r,baseAssetURL as i}from"@gem-s
71
71
  {%- assign variant = product.selected_or_first_available_variant -%}
72
72
  {%- endif -%}
73
73
  `,B=()=>t`
74
- <div class="gp-text-center">${n("Product","product_not_found")}</div>
74
+ <div class="gp-text-center">${s("Product","product_not_found")}</div>
75
75
  `,G=()=>t`
76
76
  ${A()}
77
77
  <gp-product
78
- data-uid="${_?.uid}"
79
- data-id="${_?.uid}"
78
+ data-uid="${v?.uid}"
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 }}, "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_policy": {{ variant.inventory_policy }}, "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 @@ import{template as t,RenderIf as e,isLocalEnv as r,baseAssetURL as i}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
- ${d({builderProps:{..._,uid:_?.uid,uidInteraction:`${_?.uid}-row`},style:y,styles:b,setting:S,children:m,rawChildren:v})}
90
+ ${d({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>
@@ -95,5 +95,5 @@ import{template as t,RenderIf as e,isLocalEnv as r,baseAssetURL as i}from"@gem-s
95
95
  `;return t`
96
96
  ${x()}
97
97
  ${o("product != empty and product != null",G(),B())}
98
- ${e(r,`<script ${s('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${s('class="gps-link" delay',"src")}="${i}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
98
+ ${e(i,`<script ${n('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
99
99
  `};export{Product as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.1106",
3
+ "version": "2.0.0-staging.1108",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",