@gem-sdk/components 12.0.0-dev.91 → 12.0.0-dev.92

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,5 +1,5 @@
1
- "use strict";const generateBadgeContent=(n,i)=>`
2
- {% assign content = ${i?JSON.stringify(n):n} %}
1
+ "use strict";const generateBadgeContent=(n,t)=>`
2
+ {% assign content = ${t?JSON.stringify(n):n} %}
3
3
 
4
4
  {%if content.size > 0 %}
5
5
  {% if variant.compare_at_price and variant.compare_at_price > 0 %}
@@ -14,7 +14,7 @@
14
14
  {% assign amountDiscountValue = amountDiscount | money_without_trailing_zeros %}
15
15
  {% assign price = variant.price | divided_by: 100 %}
16
16
  {% assign minPriceValue = product.variants | map: "price" | sort | first | money_without_trailing_zeros %}
17
- {% assign inventoryQuantityValue = variant.inventory_quantity %}
17
+ {% assign inventoryQuantityValue = variant.inventory_quantity | default: 0 %}
18
18
 
19
19
  {% assign percentDiscountKey = "{percent_discount}" %}
20
20
  {% assign amountDiscountKey = "{amount_discount}" %}
@@ -1,6 +1,6 @@
1
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,children:n}=t,{productItemClass:o,gpProductClass:a}=classes.getClass(t);return core.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 }}, "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 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${a}"
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>
@@ -4,7 +4,7 @@
4
4
  `}).join("")}
5
5
  `;return core.template`
6
6
  <gp-product
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 }}"}'
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${r}"
9
9
  >
10
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>
@@ -1,6 +1,6 @@
1
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,children:n}=t,{productItemClass:o,gpProductClass:a}=classes.getClass(t);return core.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 }}, "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 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${a}"
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>
@@ -4,7 +4,7 @@
4
4
  `}).join("")}
5
5
  `;return core.template`
6
6
  <gp-product
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 }}"}'
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${r}"
9
9
  >
10
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>
@@ -79,7 +79,7 @@
79
79
  data-id="${a?.uid}"
80
80
  style="${y}"
81
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 }}" }'
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 | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
83
  >
84
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">
@@ -14,7 +14,7 @@ let generateBadgeContent=(n,i)=>`
14
14
  {% assign amountDiscountValue = amountDiscount | money_without_trailing_zeros %}
15
15
  {% assign price = variant.price | divided_by: 100 %}
16
16
  {% assign minPriceValue = product.variants | map: "price" | sort | first | money_without_trailing_zeros %}
17
- {% assign inventoryQuantityValue = variant.inventory_quantity %}
17
+ {% assign inventoryQuantityValue = variant.inventory_quantity | default: 0 %}
18
18
 
19
19
  {% assign percentDiscountKey = "{percent_discount}" %}
20
20
  {% assign amountDiscountKey = "{amount_discount}" %}
@@ -1,6 +1,6 @@
1
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
- 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 }}, "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,10 +1,10 @@
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})}
1
+ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=e(o),d=()=>t`
2
+ ${r?.map((e,o)=>{if(e)return t`
3
+ ${n({...e,index:o})}
4
4
  `}).join("")}
5
5
  `;return t`
6
6
  <gp-product
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 }}"}'
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${c}"
9
9
  >
10
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>
@@ -1,6 +1,6 @@
1
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
- 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 }}, "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,10 +1,10 @@
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})}
1
+ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=e(o),d=()=>t`
2
+ ${r?.map((e,o)=>{if(e)return t`
3
+ ${n({...e,index:o})}
4
4
  `}).join("")}
5
5
  `;return t`
6
6
  <gp-product
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 }}"}'
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 | default: 0 }}, "formId": "{{ product_form_id }}"}'
8
8
  class="${c}"
9
9
  >
10
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>
@@ -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="${E}"
81
81
  class="${$?.cssClass}"
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 }}" }'
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 | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
83
  >
84
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">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "12.0.0-dev.91",
3
+ "version": "12.0.0-dev.92",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",