@gem-sdk/components 2.0.0-staging.1092 → 2.0.0-staging.1094
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-badge/common/styles.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +3 -3
- package/dist/cjs/product/components/product-list/ProductListGridLayout.js +1 -1
- package/dist/esm/product/components/product-badge/common/styles.js +1 -1
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +7 -7
- package/dist/esm/product/components/product-list/ProductListGridLayout.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),common=require("../utils/common.js"),getShapePosition=require("../utils/getShapePosition.js"),getRotateShape=require("../utils/getRotateShape.js"),getStyleAdvanced=require("../utils/getStyleAdvanced.js"),getWhiteSpace=require("../utils/getWhiteSpace.js"),stylesV2=require("../utils/stylesV2.js"),shape=require("../utils/shape.js");const getSizeStyles=e=>{let{setting:t,styles:o}=e,r=shape.getShape(t?.shape),a=t?.contentType==="text",
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),common=require("../utils/common.js"),getShapePosition=require("../utils/getShapePosition.js"),getRotateShape=require("../utils/getRotateShape.js"),getStyleAdvanced=require("../utils/getStyleAdvanced.js"),getWhiteSpace=require("../utils/getWhiteSpace.js"),stylesV2=require("../utils/stylesV2.js"),shape=require("../utils/shape.js");const getSizeStyles=e=>{let{setting:t,styles:o}=e,r=shape.getShape(t?.shape),a=t?.contentType==="text",n=a?o?.textSizeV2:o?.imageSizeV2;return a?common.getSize(r,n):common.getSize(void 0,n)},getContainerStyle=(e,t=!1)=>{let{setting:o,styles:r,style:a,navigationPosition:n,imageData:i,dotData:s}=e,g=o?.positionWithImage==="outside",p=common.getWrapperStyle(t),l=getShapePosition.getShapePosition({positionType:r?.position,isLiquid:!1,navigationPosition:n,dataImage:{...i,...s}}),S=getSizeStyles(e),y=getStyleAdvanced.getStyleAdvanced(g?{}:{...l,...S},a);return{...!g&&{"--pos":"absolute"},...p,...y}},getTextContentStyle=({styles:e,setting:t})=>{let o=core.makeGlobalSize(e?.textSizeV2).padding,r=shape.getShape(t?.shape),a=t?.positionWithImage==="outside";return{...getWhiteSpace.getWhiteSpaceStyle(e?.textSizeV2),...common.convertToStyle(r?.textStyle),...getRotateShape.composeTextStyleByPosition(r,e?.position,a),...core.composeTypographyStyle(e?.typo),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...stylesV2.getStyleBackground(!!r?.backgroundColorInText,e?.badgeColorV2),...o}},getBorderStyles=({styles:e,setting:t})=>{let o=shape.getShape(t?.shape),r=t?.contentType==="text";return o?.supportBorder?r?stylesV2.getStyleBorder(e?.textBadgeBorder):stylesV2.getStyleBorder(e?.imageBadgeBorder):{}},getCornerStyles=({styles:e,setting:t})=>{let o=shape.getShape(t?.shape),r=t?.contentType==="text";return o?.supportCorner?r?stylesV2.getStyleCornerRadius(e?.textBadgeCorner,o?.shapeRadius):stylesV2.getStyleCornerRadius(e?.imageBadgeCorner,o?.shapeRadius):{}},getTextBadgeWrapperStyles=({styles:e,setting:t})=>{let o=shape.getShape(t?.shape),r=getBorderStyles({setting:t,styles:e}),a=t?.positionWithImage==="outside",n=getCornerStyles({setting:t,styles:e}),i=common.getShapeWrapperPadding(o?.ratio);return{...r,...n,...getRotateShape.composeShapeStyleByPosition(o,e?.position,a),...stylesV2.getStyleBackground(!o?.backgroundColorInText,e?.badgeColorV2),...i,height:o?.ratio===1?"0px":"100%"}},getImageContainerStyles=({styles:e,setting:t})=>{let o=getBorderStyles({setting:t,styles:e}),r=getCornerStyles({setting:t,styles:e}),a=core.makeGlobalSize(e?.imageSizeV2).padding;return{...o,...r,...a}},getOpacityProductBadge=(e,t,o)=>{let{"bundle-item":r,setting:a}=e,n=common.checkDiscountContentProductBadge(a?.displayContent)&&a?.contentType==="text";if(r||!n)return 1;let i=common.checkDiscountContentProductBadge(a?.displayContent),s=t?.price??0,g=t?.salePrice??0,p=g-s,l=t?.manageInventory??!1,S=t?.inventoryQuantity===0,y=i&&p<=0&&a?.contentType==="text"||l&&S;return y?"edit"!==o?0:.2:1},getSubWrapperStyle=(e,t,o)=>{let{setting:r}=e,a=r?.positionWithImage==="outside",n=getSizeStyles(e),i=o&&t?getOpacityProductBadge(e,t,o):1;return{...a?{...n,"--mb":0}:{},opacity:i}},getContentStyleInternal=e=>{let{styles:t,setting:o,builderProps:r}=e,a=o?.contentType==="text";return stylesV2.generateShadowCSS(`[id="${r?.uid}"] .product-badge-item`,a?t?.textBadgeShadow:t?.imageBadgeShadow)};exports.getContainerStyle=getContainerStyle,exports.getContentStyleInternal=getContentStyleInternal,exports.getImageContainerStyles=getImageContainerStyles,exports.getSubWrapperStyle=getSubWrapperStyle,exports.getTextBadgeWrapperStyles=getTextBadgeWrapperStyles,exports.getTextContentStyle=getTextContentStyle;
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
3
|
+
${core.RenderChildren({...e,index:t})}
|
|
4
4
|
`})}
|
|
5
5
|
`;return core.template`
|
|
6
6
|
<gp-product
|
|
@@ -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 +1 @@
|
|
|
1
|
-
import{makeGlobalSize as e,composeTypographyStyle as t,getStyleShadow as o}from"@gem-sdk/core";import{convertToStyle as r,getSize as i,getWrapperStyle as
|
|
1
|
+
import{makeGlobalSize as e,composeTypographyStyle as t,getStyleShadow as o}from"@gem-sdk/core";import{convertToStyle as r,getSize as i,getWrapperStyle as n,getShapeWrapperPadding as a,checkDiscountContentProductBadge as s}from"../utils/common.js";import{getShapePosition as p}from"../utils/getShapePosition.js";import{composeTextStyleByPosition as g,composeShapeStyleByPosition as l}from"../utils/getRotateShape.js";import{getStyleAdvanced as d}from"../utils/getStyleAdvanced.js";import{getWhiteSpaceStyle as y}from"../utils/getWhiteSpace.js";import{getStyleBackground as u,generateShadowCSS as S,getStyleBorder as m,getStyleCornerRadius as h}from"../utils/stylesV2.js";import{getShape as x}from"../utils/shape.js";let getSizeStyles=e=>{let{setting:t,styles:o}=e,r=x(t?.shape),n=t?.contentType==="text",a=n?o?.textSizeV2:o?.imageSizeV2;return n?i(r,a):i(void 0,a)},getContainerStyle=(e,t=!1)=>{let{setting:o,styles:r,style:i,navigationPosition:a,imageData:s,dotData:g}=e,l=o?.positionWithImage==="outside",y=n(t),u=p({positionType:r?.position,isLiquid:!1,navigationPosition:a,dataImage:{...s,...g}}),S=getSizeStyles(e),m=d(l?{}:{...u,...S},i);return{...!l&&{"--pos":"absolute"},...y,...m}},getTextContentStyle=({styles:i,setting:n})=>{let a=e(i?.textSizeV2).padding,s=x(n?.shape),p=n?.positionWithImage==="outside";return{...y(i?.textSizeV2),...r(s?.textStyle),...g(s,i?.position,p),...t(i?.typo),...o({value:i?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:i?.typo?.custom?.hasShadowText}),...u(!!s?.backgroundColorInText,i?.badgeColorV2),...a}},getBorderStyles=({styles:e,setting:t})=>{let o=x(t?.shape),r=t?.contentType==="text";return o?.supportBorder?r?m(e?.textBadgeBorder):m(e?.imageBadgeBorder):{}},getCornerStyles=({styles:e,setting:t})=>{let o=x(t?.shape),r=t?.contentType==="text";return o?.supportCorner?r?h(e?.textBadgeCorner,o?.shapeRadius):h(e?.imageBadgeCorner,o?.shapeRadius):{}},getTextBadgeWrapperStyles=({styles:e,setting:t})=>{let o=x(t?.shape),r=getBorderStyles({setting:t,styles:e}),i=t?.positionWithImage==="outside",n=getCornerStyles({setting:t,styles:e}),s=a(o?.ratio);return{...r,...n,...l(o,e?.position,i),...u(!o?.backgroundColorInText,e?.badgeColorV2),...s,height:o?.ratio===1?"0px":"100%"}},getImageContainerStyles=({styles:t,setting:o})=>{let r=getBorderStyles({setting:o,styles:t}),i=getCornerStyles({setting:o,styles:t}),n=e(t?.imageSizeV2).padding;return{...r,...i,...n}},getOpacityProductBadge=(e,t,o)=>{let{"bundle-item":r,setting:i}=e,n=s(i?.displayContent)&&i?.contentType==="text";if(r||!n)return 1;let a=s(i?.displayContent),p=t?.price??0,g=t?.salePrice??0,l=g-p,d=t?.manageInventory??!1,y=t?.inventoryQuantity===0,u=a&&l<=0&&i?.contentType==="text"||d&&y;return u?"edit"!==o?0:.2:1},getSubWrapperStyle=(e,t,o)=>{let{setting:r}=e,i=r?.positionWithImage==="outside",n=getSizeStyles(e),a=o&&t?getOpacityProductBadge(e,t,o):1;return{...i?{...n,"--mb":0}:{},opacity:a}},getContentStyleInternal=e=>{let{styles:t,setting:o,builderProps:r}=e,i=o?.contentType==="text";return S(`[id="${r?.uid}"] .product-badge-item`,i?t?.textBadgeShadow:t?.imageBadgeShadow)};export{getContainerStyle,getContentStyleInternal,getImageContainerStyles,getSubWrapperStyle,getTextBadgeWrapperStyles,getTextContentStyle};
|
|
@@ -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
|
|
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
4
|
`})}
|
|
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};
|