@gem-sdk/components 3.0.5 → 3.0.8
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/ProductListGridItem.liquid.js +4 -4
- package/dist/cjs/product/components/product-list/ProductListGridLayout.js +1 -1
- package/dist/cjs/third-party-slot/common/helpers.js +1 -1
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +8 -8
- package/dist/esm/product/components/product-list/ProductListGridLayout.js +1 -1
- package/dist/esm/third-party-slot/common/helpers.js +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js")
|
|
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`
|
|
2
2
|
${o?.map((e,t)=>{if(e)return core.template`
|
|
3
|
-
${core.RenderChildren({...e,index:t
|
|
4
|
-
`})}
|
|
3
|
+
${core.RenderChildren({...e,index:t})}
|
|
4
|
+
`}).join("")}
|
|
5
5
|
`;return core.template`
|
|
6
6
|
<gp-product
|
|
7
7
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
@@ -9,7 +9,7 @@
|
|
|
9
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 ${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>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../../grid/components/ChildrenDroppable.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),attrs=require("./common/attrs.js");const ProductListGridLayout=e=>{let{children:r,productSortedById:t,generateGridRowArray:s,setting:i}=e,l=core.useEditorMode(),{gridLayoutStyle:a
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../../grid/components/ChildrenDroppable.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),attrs=require("./common/attrs.js");const ProductListGridLayout=e=>{let{children:r,productSortedById:t,generateGridRowArray:s,setting:i}=e,l=core.useEditorMode(),{gridLayoutStyle:a}=styles.getStyle(e),{gridLayoutClass:o,productItemClass:c}=classes.getClass(e),{productListAttr:d,getAttrProductItemEditor:n}=attrs.getAttr(e);return jsxRuntime.jsx("div",{...d,style:a,className:o,children:t?.length?t?.map((e,t)=>jsxRuntime.jsx(core.ProductProvider,{product:e,readOnly:!0,children:jsxRuntime.jsx("div",{..."edit"===l?n(e?.baseID):{},className:c,style:{"--grchild":i?.sameHeight?s?.[t]?.gridRow:void 0,"--mbchild":s?.[t]?.marginBottom},children:core.isEmptyChildren(r)?jsxRuntime.jsx(ChildrenDroppable.default,{}):React.Children.map(r,e=>React.isValidElement(e)?React.createElement(e.type,{...e.props,key:e.key}):null)})},e?.baseID)):null})};exports.default=ProductListGridLayout;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{template as t,RenderChildren as e}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";
|
|
2
|
-
${
|
|
3
|
-
${e({...o,index:n
|
|
4
|
-
`})}
|
|
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`
|
|
2
|
+
${r?.map((o,n)=>{if(o)return t`
|
|
3
|
+
${e({...o,index:n})}
|
|
4
|
+
`}).join("")}
|
|
5
5
|
`;return t`
|
|
6
6
|
<gp-product
|
|
7
7
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
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(
|
|
9
|
-
class="${
|
|
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}"
|
|
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 ${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
|
-
${
|
|
16
|
+
${i()}
|
|
17
17
|
{%- endform -%}
|
|
18
18
|
</gp-product>
|
|
19
19
|
`};export{ProductListItem as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{Children as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Children as o,isValidElement as t,createElement as e}from"react";import{useEditorMode as m,ProductProvider as i,isEmptyChildren as s}from"@gem-sdk/core";import l from"../../../grid/components/ChildrenDroppable.js";import{getStyle as a}from"./common/styles.js";import{getClass as d}from"./common/classes.js";import{getAttr as c}from"./common/attrs.js";let ProductListGridLayout=p=>{let{children:n,productSortedById:u,generateGridRowArray:y,setting:f}=p,h=m(),{gridLayoutStyle:g}=a(p),{gridLayoutClass:j,productItemClass:b}=d(p),{productListAttr:L,getAttrProductItemEditor:k}=c(p);return r("div",{...L,style:g,className:j,children:u?.length?u?.map((m,a)=>r(i,{product:m,readOnly:!0,children:r("div",{..."edit"===h?k(m?.baseID):{},className:b,style:{"--grchild":f?.sameHeight?y?.[a]?.gridRow:void 0,"--mbchild":y?.[a]?.marginBottom},children:s(n)?r(l,{}):o.map(n,r=>t(r)?e(r.type,{...r.props,key:r.key}):null)})},m?.baseID)):null})};export{ProductListGridLayout as default};
|
|
@@ -35,6 +35,6 @@ import{template as e}from"@gem-sdk/core";import{createClass as i}from"@gem-sdk/s
|
|
|
35
35
|
{% elsif request.design_mode or request.visual_preview_mode %}
|
|
36
36
|
${r}
|
|
37
37
|
{% else %}
|
|
38
|
-
<div class="${t}"
|
|
38
|
+
<div class="${t}"></div>
|
|
39
39
|
{% endif %}
|
|
40
40
|
`};export{ICON_SHOPIFY_SLOT,renderThirdPartySlot};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "3.0.
|
|
28
|
+
"@gem-sdk/core": "3.0.6",
|
|
29
29
|
"@gem-sdk/styles": "3.0.0",
|
|
30
30
|
"@gem-sdk/system": "3.0.0",
|
|
31
31
|
"tsup": "^8.5.0",
|