@shopgate/engage 6.19.4 → 6.19.5-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "6.19.4",
3
+ "version": "6.19.5-beta.1",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -15,12 +15,12 @@
15
15
  "connect"
16
16
  ],
17
17
  "dependencies": {
18
- "@shopgate/pwa-common": "6.19.4",
19
- "@shopgate/pwa-common-commerce": "6.19.4",
20
- "@shopgate/pwa-core": "6.19.4",
21
- "@shopgate/pwa-ui-ios": "6.19.4",
22
- "@shopgate/pwa-ui-material": "6.19.4",
23
- "@shopgate/pwa-ui-shared": "6.19.4",
18
+ "@shopgate/pwa-common": "6.19.5-beta.1",
19
+ "@shopgate/pwa-common-commerce": "6.19.5-beta.1",
20
+ "@shopgate/pwa-core": "6.19.5-beta.1",
21
+ "@shopgate/pwa-ui-ios": "6.19.5-beta.1",
22
+ "@shopgate/pwa-ui-material": "6.19.5-beta.1",
23
+ "@shopgate/pwa-ui-shared": "6.19.5-beta.1",
24
24
  "@virtuous/conductor": "~2.4.0",
25
25
  "babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
26
26
  "babel-plugin-transform-es3-property-literals": "^6.8.0",
@@ -1,5 +1,8 @@
1
1
  import React,{Fragment}from'react';import PropTypes from'prop-types';import Portal from'@shopgate/pwa-common/components/Portal';import{PRODUCT_PRICE_STRIKED,PRODUCT_PRICE_STRIKED_AFTER,PRODUCT_PRICE_STRIKED_BEFORE}from'@shopgate/pwa-common-commerce/product/constants/Portals';import{withPriceCalculation}from'@shopgate/engage/product';import I18n from'@shopgate/pwa-common/components/I18n';import PlaceholderLabel from'@shopgate/pwa-ui-shared/PlaceholderLabel';import StrikePrice from'@shopgate/pwa-ui-shared/PriceStriked';import{useWidgetSettings}from'@shopgate/engage/core/hooks/useWidgetSettings';import connect from"./connector";import styles from"./style";/**
2
+ * @param {Object} props The component props.
3
+ * @return {JSX}
4
+ */var Content=function Content(_ref){var price=_ref.price;var _useWidgetSettings=useWidgetSettings('@shopgate/engage/product/components/Header/PriceStriked'),_useWidgetSettings$ms=_useWidgetSettings.msrpLabel,msrpLabel=_useWidgetSettings$ms===void 0?'price.msrp':_useWidgetSettings$ms,unitPriceStrikedLabel=_useWidgetSettings.unitPriceStrikedLabel;return React.createElement(PlaceholderLabel,{className:styles.placeholder,ready:price!==null},price&&price.msrp>0&&price.unitPrice!==price.msrp&&React.createElement(Fragment,null,!!msrpLabel&&React.createElement(I18n.Text,{string:msrpLabel,className:styles.msrp}),React.createElement(StrikePrice,{className:styles.msrpStriked,value:price.msrp,currency:price.currency})),price&&!price.msrp&&price.unitPriceStriked>0&&React.createElement(Fragment,null,!!unitPriceStrikedLabel&&React.createElement(I18n.Text,{string:unitPriceStrikedLabel,className:styles.msrp}),React.createElement(StrikePrice,{value:price.unitPriceStriked,currency:price.currency,className:unitPriceStrikedLabel?styles.msrpStriked:''})));};/**
2
5
  * The PriceStriked component.
3
6
  * @param {Object} props The component props.
4
7
  * @return {JSX}
5
- */var PriceStriked=function PriceStriked(_ref){var price=_ref.price;var _useWidgetSettings=useWidgetSettings('@shopgate/engage/product/components/Header/PriceStriked'),_useWidgetSettings$ms=_useWidgetSettings.msrpLabel,msrpLabel=_useWidgetSettings$ms===void 0?'price.msrp':_useWidgetSettings$ms,unitPriceStrikedLabel=_useWidgetSettings.unitPriceStrikedLabel;return React.createElement(Fragment,null,React.createElement(Portal,{name:PRODUCT_PRICE_STRIKED_BEFORE}),React.createElement(Portal,{name:PRODUCT_PRICE_STRIKED},React.createElement(PlaceholderLabel,{className:styles.placeholder,ready:price!==null},price&&price.msrp>0&&price.unitPrice!==price.msrp&&React.createElement(Fragment,null,!!msrpLabel&&React.createElement(I18n.Text,{string:msrpLabel,className:styles.msrp}),React.createElement(StrikePrice,{className:styles.msrpStriked,value:price.msrp,currency:price.currency})),price&&!price.msrp&&price.unitPriceStriked>0&&React.createElement(Fragment,null,!!unitPriceStrikedLabel&&React.createElement(I18n.Text,{string:unitPriceStrikedLabel,className:styles.msrp}),React.createElement(StrikePrice,{value:price.unitPriceStriked,currency:price.currency,className:unitPriceStrikedLabel?styles.msrpStriked:''})))),React.createElement(Portal,{name:PRODUCT_PRICE_STRIKED_AFTER}));};PriceStriked.defaultProps={price:null};export default connect(withPriceCalculation(PriceStriked));
8
+ */var PriceStriked=function PriceStriked(props){return React.createElement(Fragment,null,React.createElement(Portal,{name:PRODUCT_PRICE_STRIKED_BEFORE}),React.createElement(Portal,{name:PRODUCT_PRICE_STRIKED},React.createElement(Content,props)),React.createElement(Portal,{name:PRODUCT_PRICE_STRIKED_AFTER}));};Content.defaultProps={price:null};export default connect(withPriceCalculation(PriceStriked));
@@ -7,4 +7,4 @@ import React,{Fragment}from'react';import PropTypes from'prop-types';import{isBe
7
7
  * @param {boolean} props.hideName Whether the name should be hidden.
8
8
  * @param {number} props.titleRows The max number of rows for the product title.
9
9
  * @return {JSX}
10
- */function ProductCard(props){var product=props.product,hidePrice=props.hidePrice,hideRating=props.hideRating,hideName=props.hideName,titleRows=props.titleRows;var _getProductImageSetti=getProductImageSettings(),gridResolutions=_getProductImageSetti.ListImage;var _useWidgetSettings=useWidgetSettings('@shopgate/engage/rating'),_useWidgetSettings$sh=_useWidgetSettings.showEmptyRatingStars,showEmptyRatingStars=_useWidgetSettings$sh===void 0?false:_useWidgetSettings$sh;var showRatings=false;if(!hideRating&&product.rating&&product.rating.average>0){showRatings=true;}else if(!hideRating&&showEmptyRatingStars&&product.rating){showRatings=true;}return React.createElement(Link,{className:"engage__product-card",tagName:"a",href:getProductRoute(product.id),itemProp:"item",itemScope:true,itemType:"http://schema.org/Product"},isBeta()&&product.featuredMedia?React.createElement(FeaturedMedia,{type:product.featuredMedia.type,url:product.featuredMedia.url,altText:product.featuredMedia.altText}):React.createElement(ProductImage,{src:product.featuredImageBaseUrl,resolutions:gridResolutions,alt:product.name,itemProp:"image"}),React.createElement(ProductBadges,{location:location,productId:product.id},!!(!hidePrice&&product.price.discount)&&React.createElement("div",{className:styles.badgeWrapper},React.createElement(Portal,{name:portals.PRODUCT_ITEM_DISCOUNT_BEFORE,props:{productId:product.id}}),React.createElement(Portal,{name:portals.PRODUCT_ITEM_DISCOUNT,props:{productId:product.id}},React.createElement(DiscountBadge,{text:"-".concat(product.price.discount,"%")})),React.createElement(Portal,{name:portals.PRODUCT_ITEM_DISCOUNT_AFTER,props:{productId:product.id}}))),!(hidePrice&&hideRating)&&React.createElement("div",{className:styles.details},showRatings&&React.createElement(RatingStars,{value:product.rating.average}),React.createElement(Swatches,{productId:product.id}),!hideName&&React.createElement("div",{itemProp:"name",className:styles.title,"data-test-id":"Productname: ".concat(product.name)},React.createElement(Ellipsis,{rows:titleRows||3},product.name)),React.createElement(MapPriceHint,{productId:product.id}),React.createElement(OrderQuantityHint,{productId:product.id}),!hidePrice&&React.createElement(Fragment,null,React.createElement(Portal,{name:portals.PRODUCT_ITEM_PRICE_BEFORE,props:{productId:product.id,location:location}}),React.createElement(Portal,{name:portals.PRODUCT_ITEM_PRICE,props:{productId:product.id,location:location}},React.createElement(ProductGridPrice,{price:product.price})),React.createElement(Portal,{name:portals.PRODUCT_ITEM_PRICE_AFTER,props:{productId:product.id,location:location}}))));}export default ProductCard;
10
+ */function ProductCard(props){var product=props.product,hidePrice=props.hidePrice,hideRating=props.hideRating,hideName=props.hideName,titleRows=props.titleRows,linkState=props.linkState,linkReplace=props.linkReplace,linkHref=props.linkHref;var _getProductImageSetti=getProductImageSettings(),gridResolutions=_getProductImageSetti.ListImage;var _useWidgetSettings=useWidgetSettings('@shopgate/engage/rating'),_useWidgetSettings$sh=_useWidgetSettings.showEmptyRatingStars,showEmptyRatingStars=_useWidgetSettings$sh===void 0?false:_useWidgetSettings$sh;var showRatings=false;if(!hideRating&&product.rating&&product.rating.average>0){showRatings=true;}else if(!hideRating&&showEmptyRatingStars&&product.rating){showRatings=true;}return React.createElement(Link,{className:"engage__product-card",tagName:"a",href:linkHref||getProductRoute(product.id),itemProp:"item",itemScope:true,itemType:"http://schema.org/Product",state:linkState,replace:linkReplace},isBeta()&&product.featuredMedia?React.createElement(FeaturedMedia,{type:product.featuredMedia.type,url:product.featuredMedia.url,altText:product.featuredMedia.altText}):React.createElement(ProductImage,{src:product.featuredImageBaseUrl,resolutions:gridResolutions,alt:product.name,itemProp:"image"}),React.createElement(ProductBadges,{location:location,productId:product.id},!!(!hidePrice&&product.price.discount)&&React.createElement("div",{className:styles.badgeWrapper},React.createElement(Portal,{name:portals.PRODUCT_ITEM_DISCOUNT_BEFORE,props:{productId:product.id}}),React.createElement(Portal,{name:portals.PRODUCT_ITEM_DISCOUNT,props:{productId:product.id}},React.createElement(DiscountBadge,{text:"-".concat(product.price.discount,"%")})),React.createElement(Portal,{name:portals.PRODUCT_ITEM_DISCOUNT_AFTER,props:{productId:product.id}}))),!(hidePrice&&hideRating)&&React.createElement("div",{className:styles.details},showRatings&&React.createElement(RatingStars,{value:product.rating.average}),React.createElement(Swatches,{productId:product.id}),!hideName&&React.createElement("div",{itemProp:"name",className:styles.title,"data-test-id":"Productname: ".concat(product.name)},React.createElement(Ellipsis,{rows:titleRows||3},product.name)),React.createElement(MapPriceHint,{productId:product.id}),React.createElement(OrderQuantityHint,{productId:product.id}),!hidePrice&&React.createElement(Fragment,null,React.createElement(Portal,{name:portals.PRODUCT_ITEM_PRICE_BEFORE,props:{productId:product.id,location:location}}),React.createElement(Portal,{name:portals.PRODUCT_ITEM_PRICE,props:{productId:product.id,location:location}},React.createElement(ProductGridPrice,{price:product.price})),React.createElement(Portal,{name:portals.PRODUCT_ITEM_PRICE_AFTER,props:{productId:product.id,location:location}}))));}ProductCard.defaultProps={linkState:{},linkReplace:false,linkHref:''};export default ProductCard;