@shopgate/engage 7.28.0-beta.6 → 7.28.0-beta.7

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.
@@ -12,4 +12,4 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
12
12
  * @param {string} options.modal.dismiss Label for the dismiss button.
13
13
  * @param {Object} options.modal.params Additional parameters for i18n strings.
14
14
  * @return { Function } A redux thunk.
15
- */var grantCameraPermissions=function grantCameraPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){var _options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?false:_options$useSettingsM,_options$modal=options.modal,modal=_options$modal===void 0?{}:_options$modal;return dispatch(grantPermissions({permissionId:PERMISSION_ID_CAMERA,useSettingsModal:useSettingsModal,modal:_extends({title:null,message:'permissions.access_denied.camera_message',confirm:'permissions.access_denied.settings_button'},modal)}));};};export default grantCameraPermissions;
15
+ */var grantCameraPermissions=function grantCameraPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){var _options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?false:_options$useSettingsM,_options$modal=options.modal,modal=_options$modal===void 0?{}:_options$modal;return dispatch(grantPermissions({permissionId:PERMISSION_ID_CAMERA,useSettingsModal:useSettingsModal,modal:_extends({title:null,message:'permissions.access_denied.camera_message',confirm:'permissions.access_denied.settings_button',dismiss:'common.close'},modal)}));};};export default grantCameraPermissions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.28.0-beta.6",
3
+ "version": "7.28.0-beta.7",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -16,12 +16,12 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@shopgate/native-modules": "1.0.0-beta.25",
19
- "@shopgate/pwa-common": "7.28.0-beta.6",
20
- "@shopgate/pwa-common-commerce": "7.28.0-beta.6",
21
- "@shopgate/pwa-core": "7.28.0-beta.6",
22
- "@shopgate/pwa-ui-ios": "7.28.0-beta.6",
23
- "@shopgate/pwa-ui-material": "7.28.0-beta.6",
24
- "@shopgate/pwa-ui-shared": "7.28.0-beta.6",
19
+ "@shopgate/pwa-common": "7.28.0-beta.7",
20
+ "@shopgate/pwa-common-commerce": "7.28.0-beta.7",
21
+ "@shopgate/pwa-core": "7.28.0-beta.7",
22
+ "@shopgate/pwa-ui-ios": "7.28.0-beta.7",
23
+ "@shopgate/pwa-ui-material": "7.28.0-beta.7",
24
+ "@shopgate/pwa-ui-shared": "7.28.0-beta.7",
25
25
  "@stripe/react-stripe-js": "^1.16.5",
26
26
  "@stripe/stripe-js": "^1.3.1",
27
27
  "@virtuous/conductor": "~2.5.0",
@@ -1,4 +1,4 @@
1
1
  import{connect}from'react-redux';import{makeGetShopSettingByKey}from"../../../core/selectors/shopSettings";import{SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT}from"../../../core/constants";/**
2
2
  * Creates the mapStateToProps connector function.
3
3
  * @returns {Function}
4
- */var makeMapStateToProps=function makeMapStateToProps(){var getShopSetting=makeGetShopSettingByKey(SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,false);return function(state,props){return{displayPricePerMeasureUnit:getShopSetting(state,props)};};};export default connect(makeMapStateToProps);
4
+ */var makeMapStateToProps=function makeMapStateToProps(){var getShopSetting=makeGetShopSettingByKey(SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,true);return function(state,props){return{displayPricePerMeasureUnit:getShopSetting(state,props)};};};export default connect(makeMapStateToProps);
@@ -1,4 +1,5 @@
1
1
  function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{useMemo}from'react';import PropTypes from'prop-types';import{css}from'glamor';import classNames from'classnames';import{i18n}from'@shopgate/engage/core';import{ConditionalWrapper}from'@shopgate/engage/components';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import connect from"./PriceInfo.connector";var styles={container:css({color:themeConfig.colors.shade3}).toString(),noWrap:css({whiteSpace:'nowrap'}).toString()};/**
2
2
  * The price info component
3
3
  * @returns {JSX}
4
- */var PriceInfo=function PriceInfo(_ref){var product=_ref.product,className=_ref.className,wrapper=_ref.wrapper,displayPricePerMeasureUnit=_ref.displayPricePerMeasureUnit,externalCurrency=_ref.currency;var _ref2=product||{},_ref2$price=_ref2.price,price=_ref2$price===void 0?{}:_ref2$price,unitPriceRefValue=_ref2.unitPriceRefValue,unitPriceRefUom=_ref2.unitPriceRefUom;var pricePerMeasureUnit=price.pricePerMeasureUnit,info=price.info,currency=price.currency;var content=useMemo(function(){if(!displayPricePerMeasureUnit){return info;}if(!pricePerMeasureUnit){return null;}var unitKey="formats.unitOfMeasurement.".concat(unitPriceRefUom);var unit=i18n.text(unitKey);if(unit===unitKey){unit=unitPriceRefUom;}return i18n.text('price.pricePerMeasurementFormat',{price:i18n.price(pricePerMeasureUnit,currency||externalCurrency,2),refValue:unitPriceRefValue||'',refUom:unit});},[currency,displayPricePerMeasureUnit,externalCurrency,info,pricePerMeasureUnit,unitPriceRefUom,unitPriceRefValue]);if(!content){return null;}return React.createElement(ConditionalWrapper,{condition:!!wrapper,wrapper:wrapper},React.createElement("div",{className:classNames(styles.container,className,_defineProperty({},styles.noWrap,displayPricePerMeasureUnit)),dangerouslySetInnerHTML:{__html:content},"data-test-id":"priceInfo: ".concat(content)}));};PriceInfo.defaultProps={product:null,className:null,currency:null,wrapper:null,displayPricePerMeasureUnit:false};export default connect(PriceInfo);
4
+ */var PriceInfo=function PriceInfo(_ref){var product=_ref.product,className=_ref.className,wrapper=_ref.wrapper,displayPricePerMeasureUnit=_ref.displayPricePerMeasureUnit,externalCurrency=_ref.currency;var _ref2=product||{},_ref2$price=_ref2.price,price=_ref2$price===void 0?{}:_ref2$price,unitPriceRefValue=_ref2.unitPriceRefValue,unitPriceRefUom=_ref2.unitPriceRefUom;var pricePerMeasureUnit=price.pricePerMeasureUnit,info=price.info,currency=price.currency;var content=useMemo(function(){if(!displayPricePerMeasureUnit||!pricePerMeasureUnit){return info;}if(!pricePerMeasureUnit){return null;}var unitKey="formats.unitOfMeasurement.".concat(unitPriceRefUom);var unit=i18n.text(unitKey);if(unit===unitKey){unit=unitPriceRefUom;}return i18n.text('price.pricePerMeasurementFormat',{price:i18n.price(pricePerMeasureUnit,currency||externalCurrency,2),// Don't show base prices like 1.99€/1kg, but show 1.99€/kg instead
5
+ refValue:!!unitPriceRefValue&&unitPriceRefValue!==1?unitPriceRefValue:'',refUom:unit});},[currency,displayPricePerMeasureUnit,externalCurrency,info,pricePerMeasureUnit,unitPriceRefUom,unitPriceRefValue]);if(!content){return null;}return React.createElement(ConditionalWrapper,{condition:!!wrapper,wrapper:wrapper},React.createElement("div",{className:classNames(styles.container,className,'engage__product__price-info',_defineProperty({},styles.noWrap,content!==info)),dangerouslySetInnerHTML:{__html:content},"data-test-id":"priceInfo: ".concat(content)}));};PriceInfo.defaultProps={product:null,className:null,currency:null,wrapper:null,displayPricePerMeasureUnit:false};export default connect(PriceInfo);