@gem-sdk/components 5.0.5 → 5.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/carousel-v3/components/root/Carousel.liquid.js +14 -13
- package/dist/cjs/product/components/product-bundle/ProductBundleDiscount.js +1 -1
- package/dist/cjs/product/components/product-bundle/hooks/useProductBundleDataState.js +81 -23
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +3 -4
- package/dist/esm/carousel-v3/components/root/Carousel.liquid.js +14 -13
- package/dist/esm/product/components/product-bundle/ProductBundleDiscount.js +1 -1
- package/dist/esm/product/components/product-bundle/hooks/useProductBundleDataState.js +81 -23
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +12 -13
- package/dist/types/index.d.ts +4 -0
- package/package.json +2 -2
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Arrow_liquid=require("../arrow/Arrow.liquid.js"),Dots_liquid=require("../dot/Dots.liquid.js"),helpers=require("../arrow/common/helpers.js"),helpers$1=require("./common/helpers.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),attrs=require("./common/attrs.js"),helpers$2=require("../../../helpers.js");const Carousel=e=>{let{children:r,builderAttrs:s,builderProps:o,styles:t,isHiddenArrowWhenDisabled:l=!0,hiddenDotWhenOnlyOne:a,rootId:i,rawChildren:d,conditionAppendJs:c}=e,
|
|
2
|
-
${d?.length?core.WrapRenderChildren({uid:o?.uid??"",customProps:d[0]?.customProps},d.map((e,r)=>{if(e)return core.template`${core.RenderChildren({...e,index:r,parentSettings:
|
|
3
|
-
<gp-carousel-v3 gp-data='${
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Arrow_liquid=require("../arrow/Arrow.liquid.js"),Dots_liquid=require("../dot/Dots.liquid.js"),helpers=require("../arrow/common/helpers.js"),helpers$1=require("./common/helpers.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),attrs=require("./common/attrs.js"),helpers$2=require("../../../helpers.js");const Carousel=e=>{let{children:r,builderAttrs:s,builderProps:o,styles:t,isHiddenArrowWhenDisabled:l=!0,hiddenDotWhenOnlyOne:a,rootId:i,rawChildren:d,conditionAppendJs:c,productBadgeLiquid:n}=e,u=helpers.mappingNavigationCarousel(e.setting),p={...e,setting:u},{arrowButtonSize:$,arrowBackgroundColor:v,arrowGapToEachSide:g="16",roundedArrow:h,arrowIconSize:m,arrowCustomColor:S,arrowBorder:w,arrowShadow:q,showWhenHover:y}=u??{},{uniqueComponentId:C,loopConfig:f,arrowShowConfig:j,stateData:_}=helpers$1.getData(p),{rootClassRender:A,wrapperClassRender:D,wrapperInnerClass:k,sliderClass:P}=classes.getClass(p),{sliderWrapperStyle:E,rootStyleRender:I,wrapperStyleRender:b,wrapperInnerStyle:z}=styles.getStyle(p),{rootAttrRender:R,sliderAttr:x}=attrs.getAttr(p),G=()=>core.RenderIf(core.isLocalEnv,`<script ${helpers$2.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-carousel-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$2.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-carousel-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`),O=e=>{let r="next"===e;return Arrow_liquid.default({uid:o?.uid,componentId:C,custom:u?.arrowCustom??"",showArrow:j,arrowButtonSize:$||{},arrowIconSize:m||{},arrowBackgroundColor:v??"",arrowCustomColor:S,gapToEachSize:g,showWhenHover:y,arrowBorder:w||{},arrowCorner:h||{},arrowShadow:q||{},left:!r,onClick:e=>{e.stopPropagation()},vertical:u?.vertical,isHiddenWhenDisabled:l,rootId:i})},T=()=>core.template`
|
|
2
|
+
${d?.length?core.WrapRenderChildren({uid:o?.uid??"",customProps:d[0]?.customProps},d.map((e,r)=>{if(e)return core.template`${core.RenderChildren({...e,index:r,parentSettings:u,parentStyle:t,background:u?.background,parentUid:o?.uid})}`})):r??`<div>${helpers$2.getStaticLocale("Carousel","no_slider")}</div>`}`;return core.template`
|
|
3
|
+
<gp-carousel-v3 gp-data='${_}' ${R} style="${I}" class="${A}">
|
|
4
4
|
<div
|
|
5
5
|
${s}
|
|
6
|
-
class="${
|
|
7
|
-
style="${
|
|
6
|
+
class="${D}"
|
|
7
|
+
style="${b}"
|
|
8
8
|
>
|
|
9
|
-
<div class="${
|
|
10
|
-
${
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
<div class="${k}" style="${z}">
|
|
10
|
+
${n??""}
|
|
11
|
+
${O("prev")}
|
|
12
|
+
<div ${x} style="${E}">
|
|
13
|
+
<div class="${P}">
|
|
14
|
+
${T()}
|
|
14
15
|
</div>
|
|
15
16
|
</div>
|
|
16
|
-
${
|
|
17
|
+
${O("next")}
|
|
17
18
|
</div>
|
|
18
|
-
${Dots_liquid.default({loop:
|
|
19
|
+
${Dots_liquid.default({loop:f,showDots:u?.dot,dotStyle:u?.dotStyle,dotGapToCarousel:u?.dotGapToCarousel,dotSize:u?.dotSize,vertical:u?.vertical,uniqueComponentId:C,hiddenWhenOnlyOne:a})}
|
|
19
20
|
</div>
|
|
20
21
|
</gp-carousel-v3>
|
|
21
|
-
${c?`{% if ${c} %} ${
|
|
22
|
+
${c?`{% if ${c} %} ${G()} {% endif %}`:G()}
|
|
22
23
|
|
|
23
24
|
`};exports.default=Carousel;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../../common/components/NoDataState.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useProductBundleDataState=require("./hooks/useProductBundleDataState.js"),useProductBundleDiscountState=require("./hooks/useProductBundleDiscountState.js"),ProductBundleDiscountChildrenItem=require("./ProductBundleDiscountChildrenItem.js");const ProductBundleDiscount=({builderAttrs:e,style:t,children:s,setting:u,styles:n,advanced:l})=>{let{isEditMode:r,isPreviewSharePageMode:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../../common/components/NoDataState.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useProductBundleDataState=require("./hooks/useProductBundleDataState.js"),useProductBundleDiscountState=require("./hooks/useProductBundleDiscountState.js"),ProductBundleDiscountChildrenItem=require("./ProductBundleDiscountChildrenItem.js");const ProductBundleDiscount=({builderAttrs:e,style:t,children:s,setting:u,styles:n,advanced:l})=>{let{isEditMode:r,isPreviewSharePageMode:a}=core.useRenderMode(),{isSelected:i,setSelected:d}=useProductBundleDiscountState.default(u),{emitRedirectSetupPage:c,redirectGuideline:o,svgVertical:m,svgHorizontal:y}=useProductBundleDataState.default(),j=system.createClass(classes.getContainerClasses(u,l?.cssClass)),S=system.createClass(classes.getNoDiscountClasses),h=system.createStyle(styles.getSizeSettings(n)?.gap),D=system.createStyle(styles.getContainerStyles(h,n,t));if(!u?.bundleItems?.length&&r)return jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Increase AOV with bundle quantity.",descriptionActions:[{text:"Setup bundle discount",callback:c},{text:"read guideline",callback:o}],additionalMedia:u?.layout=="horizontal-layout"?y:m});let x=(e,t)=>{if(u?.hideNoDiscountItem&&e?.discountType==="no_discount")return null;let l=s?.[t];if(React.isValidElement(l))return jsxRuntime.jsx(ProductBundleDiscountChildrenItem.default,{index:t,childItem:l,setting:u,styles:n,isSelected:i(t),setSelected:d,bundleItem:e},t)},p=(core.isEmptyChildren(s)||u?.bundleItems?.length==0)&&!a;return jsxRuntime.jsxs("div",{...e,className:j,style:D,children:[system.If(p,jsxRuntime.jsx("div",{className:S,children:"This product has no bundle discount"})),u?.bundleItems?.map((e,t)=>x(e,t))]})};exports.default=ProductBundleDiscount;
|