@shopgate/engage 6.23.0-beta.5 → 6.23.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/engage",
|
|
3
|
-
"version": "6.23.0-beta.
|
|
3
|
+
"version": "6.23.0-beta.7",
|
|
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.23.0-beta.
|
|
19
|
-
"@shopgate/pwa-common-commerce": "6.23.0-beta.
|
|
20
|
-
"@shopgate/pwa-core": "6.23.0-beta.
|
|
21
|
-
"@shopgate/pwa-ui-ios": "6.23.0-beta.
|
|
22
|
-
"@shopgate/pwa-ui-material": "6.23.0-beta.
|
|
23
|
-
"@shopgate/pwa-ui-shared": "6.23.0-beta.
|
|
18
|
+
"@shopgate/pwa-common": "6.23.0-beta.7",
|
|
19
|
+
"@shopgate/pwa-common-commerce": "6.23.0-beta.7",
|
|
20
|
+
"@shopgate/pwa-core": "6.23.0-beta.7",
|
|
21
|
+
"@shopgate/pwa-ui-ios": "6.23.0-beta.7",
|
|
22
|
+
"@shopgate/pwa-ui-material": "6.23.0-beta.7",
|
|
23
|
+
"@shopgate/pwa-ui-shared": "6.23.0-beta.7",
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import React from'react';import PropTypes from'prop-types';import I18n from'@shopgate/pwa-common/components/I18n';import styles from"./style";/**
|
|
2
2
|
* The Shipping Label component.
|
|
3
3
|
* @param {Object} props The component props.
|
|
4
|
-
* @returns {JSX}
|
|
4
|
+
* @returns {JSX.Element}
|
|
5
5
|
*/var Label=function Label(_ref){var className=_ref.className,price=_ref.price,currency=_ref.currency;return/*#__PURE__*/ (// eslint-disable-next-line jsx-a11y/aria-role
|
|
6
6
|
React.createElement("div",{role:"text",className:"".concat(className," ").concat(styles.text)},price>0?/*#__PURE__*/React.createElement(I18n.Text,{string:"shipping.cost"},/*#__PURE__*/React.createElement(I18n.Price,{forKey:"price",price:price,currency:currency})):/*#__PURE__*/React.createElement(I18n.Text,{string:"shipping.free"})));};Label.defaultProps={className:''};export default Label;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useCallback,useState}from'react';import{Button,Grid,I18n,Link,Switch}from'@shopgate/engage/components';import PropTypes from'prop-types';import{PRIVACY_PATH}from'@shopgate/engage/page';import{appConfig}from'@shopgate/engage';import{i18n}from'@shopgate/engage/core';import classNames from'classnames';import styles from"./style";import connect from"./connector";/**
|
|
2
2
|
* The PrivacySettings component.
|
|
3
3
|
* @returns {JSX.Element}
|
|
4
|
-
*/var PrivacySettings=function PrivacySettings(_ref){var acceptAllCookies=_ref.acceptAllCookies,acceptSelectedCookies=_ref.acceptSelectedCookies,comfortCookiesAcceptedState=_ref.comfortCookiesAcceptedState,statisticsCookiesAcceptedState=_ref.statisticsCookiesAcceptedState;var _appConfig$cookieCons=appConfig.cookieConsent;_appConfig$cookieCons=_appConfig$cookieCons===void 0?{}:_appConfig$cookieCons;var settingsComfortText=_appConfig$cookieCons.settingsComfortText,settingsComfortTitle=_appConfig$cookieCons.settingsComfortTitle,settingsStatisticsText=_appConfig$cookieCons.settingsStatisticsText,settingsStatisticsTitle=_appConfig$cookieCons.settingsStatisticsTitle,settingsRequiredText=_appConfig$cookieCons.settingsRequiredText,settingsRequiredTitle=_appConfig$cookieCons.settingsRequiredTitle;var _useState=useState(comfortCookiesAcceptedState!==null?comfortCookiesAcceptedState:false),_useState2=_slicedToArray(_useState,2),areComfortCookiesSelected=_useState2[0],setAreComfortCookiesSelected=_useState2[1];var _useState3=useState(statisticsCookiesAcceptedState!==null?statisticsCookiesAcceptedState:false),_useState4=_slicedToArray(_useState3,2),areStatisticsCookiesSelected=_useState4[0],setAreStatisticsCookiesSelected=_useState4[1];var handleChangeComfortCookies=useCallback(function(){setAreComfortCookiesSelected(!areComfortCookiesSelected);},[areComfortCookiesSelected]);var handleChangeStatisticsCookies=useCallback(function(){setAreStatisticsCookiesSelected(!areStatisticsCookiesSelected);},[areStatisticsCookiesSelected]);var handleAcceptAllCookies=useCallback(function(){setAreStatisticsCookiesSelected(true);setAreComfortCookiesSelected(true);acceptAllCookies();},[acceptAllCookies]);return/*#__PURE__*/React.createElement(Grid,{component:"div",className:styles.container},/*#__PURE__*/React.createElement(Grid.Item,{component:"div",className:styles.item}
|
|
4
|
+
*/var PrivacySettings=function PrivacySettings(_ref){var acceptAllCookies=_ref.acceptAllCookies,acceptSelectedCookies=_ref.acceptSelectedCookies,comfortCookiesAcceptedState=_ref.comfortCookiesAcceptedState,statisticsCookiesAcceptedState=_ref.statisticsCookiesAcceptedState;var _appConfig$cookieCons=appConfig.cookieConsent;_appConfig$cookieCons=_appConfig$cookieCons===void 0?{}:_appConfig$cookieCons;var settingsComfortText=_appConfig$cookieCons.settingsComfortText,settingsComfortTitle=_appConfig$cookieCons.settingsComfortTitle,settingsStatisticsText=_appConfig$cookieCons.settingsStatisticsText,settingsStatisticsTitle=_appConfig$cookieCons.settingsStatisticsTitle,settingsRequiredText=_appConfig$cookieCons.settingsRequiredText,settingsRequiredTitle=_appConfig$cookieCons.settingsRequiredTitle,showComfortCookiesToggle=_appConfig$cookieCons.showComfortCookiesToggle;var _useState=useState(comfortCookiesAcceptedState!==null?comfortCookiesAcceptedState:false),_useState2=_slicedToArray(_useState,2),areComfortCookiesSelected=_useState2[0],setAreComfortCookiesSelected=_useState2[1];var _useState3=useState(statisticsCookiesAcceptedState!==null?statisticsCookiesAcceptedState:false),_useState4=_slicedToArray(_useState3,2),areStatisticsCookiesSelected=_useState4[0],setAreStatisticsCookiesSelected=_useState4[1];var handleChangeComfortCookies=useCallback(function(){setAreComfortCookiesSelected(!areComfortCookiesSelected);},[areComfortCookiesSelected]);var handleChangeStatisticsCookies=useCallback(function(){setAreStatisticsCookiesSelected(!areStatisticsCookiesSelected);},[areStatisticsCookiesSelected]);var handleAcceptAllCookies=useCallback(function(){setAreStatisticsCookiesSelected(true);setAreComfortCookiesSelected(true);acceptAllCookies();},[acceptAllCookies]);return/*#__PURE__*/React.createElement(Grid,{component:"div",className:styles.container},/*#__PURE__*/React.createElement(Grid.Item,{component:"div",className:styles.item},showComfortCookiesToggle?/*#__PURE__*/React.createElement(Grid.Item,{component:"div",className:styles.switchWrapper},/*#__PURE__*/React.createElement(Switch,{onChange:handleChangeComfortCookies,checked:areComfortCookiesSelected,a11yFallbackText:"".concat(i18n.text(settingsComfortTitle||'cookieSettings.comfortTitle'),". ").concat(i18n.text(settingsComfortText||'cookieSettings.comfort'))},/*#__PURE__*/React.createElement("span",{className:styles.title},/*#__PURE__*/React.createElement(I18n.Text,{string:settingsComfortTitle||'cookieSettings.comfortTitle'})),/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement(I18n.Text,{string:settingsComfortText||'cookieSettings.comfort'})))):null,/*#__PURE__*/React.createElement(Grid.Item,{component:"div",className:styles.switchWrapper},/*#__PURE__*/React.createElement(Switch,{onChange:handleChangeStatisticsCookies,checked:areStatisticsCookiesSelected,a11yFallbackText:"".concat(i18n.text(settingsStatisticsTitle||'cookieSettings.statisticsTitle'),". ").concat(i18n.text(settingsStatisticsText||'cookieSettings.statistics'))},/*#__PURE__*/React.createElement("span",{className:styles.title},/*#__PURE__*/React.createElement(I18n.Text,{string:settingsStatisticsTitle||'cookieSettings.statisticsTitle'})),/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement(I18n.Text,{string:settingsStatisticsText||'cookieSettings.statistics'})))),/*#__PURE__*/React.createElement(Grid.Item,{component:"div",className:styles.switchWrapper},/*#__PURE__*/React.createElement(Switch,{disabled:true,checked:true,a11yFallbackText:"".concat(i18n.text(settingsRequiredTitle||'cookieSettings.requiredTitle'),". ").concat(i18n.text(settingsRequiredText||'cookieSettings.required'))},/*#__PURE__*/React.createElement("span",{className:styles.title},/*#__PURE__*/React.createElement(I18n.Text,{string:settingsRequiredTitle||'cookieSettings.requiredTitle'})),/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement(I18n.Text,{string:settingsRequiredText||'cookieSettings.required'}))))),/*#__PURE__*/React.createElement(Grid.Item,{component:"div",className:styles.buttonWrapper},/*#__PURE__*/React.createElement(Button,{onClick:function onClick(){return handleAcceptAllCookies();},type:"primary",className:classNames(styles.button,'privacy-settings__button-accept-all')},/*#__PURE__*/React.createElement(I18n.Text,{string:"cookieConsentModal.buttonAcceptAll"})),/*#__PURE__*/React.createElement(Button,{onClick:function onClick(){return acceptSelectedCookies({comfortCookiesAccepted:areComfortCookiesSelected,statisticsCookiesAccepted:areStatisticsCookiesSelected});},type:"simple",className:classNames(styles.button,'privacy-settings__button-accept-selected')},/*#__PURE__*/React.createElement(I18n.Text,{string:"cookieConsentModal.modalButtonConfirmSelected"}))),/*#__PURE__*/React.createElement(Grid.Item,{component:"div"},/*#__PURE__*/React.createElement(I18n.Text,{string:"cookieSettings.privacy"},/*#__PURE__*/React.createElement(I18n.Placeholder,{forKey:"privacyLink"},/*#__PURE__*/React.createElement(Link,{href:PRIVACY_PATH,tag:"span"},/*#__PURE__*/React.createElement(I18n.Text,{string:"cookieConsentModal.privacyText",className:styles.link}))))));};PrivacySettings.defaultProps={comfortCookiesAcceptedState:null,statisticsCookiesAcceptedState:null};export default connect(PrivacySettings);
|
|
@@ -5,10 +5,10 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
5
5
|
*/export var navigateBackToCookieModal$=main$.filter(function(_ref){var action=_ref.action;return action.type===ROUTE_WILL_LEAVE;}).filter(function(_ref2){var action=_ref2.action;return action.route.pathname===PRIVACY_SETTINGS_PATTERN;});/**
|
|
6
6
|
* determine whether to show the cookie consent modal at app start
|
|
7
7
|
* @param {Function} subscribe The subscribe function
|
|
8
|
-
*/export default function cookieConsent(subscribe){subscribe(appDidStart$,/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3){var dispatch,getState,state,isCookieConsentActivated,isCookieConsentHandled,comfortCookiesAccepted,statisticsCookiesAccepted;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch=_ref3.dispatch,getState=_ref3.getState;state=getState();
|
|
8
|
+
*/export default function cookieConsent(subscribe){subscribe(appDidStart$,/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3){var dispatch,getState,state,_appConfig$cookieCons,isCookieConsentActivated,isCookieConsentHandled,comfortCookiesAccepted,statisticsCookiesAccepted;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch=_ref3.dispatch,getState=_ref3.getState;state=getState();_appConfig$cookieCons=appConfig.cookieConsent;_appConfig$cookieCons=_appConfig$cookieCons===void 0?{}:_appConfig$cookieCons;isCookieConsentActivated=_appConfig$cookieCons.isCookieConsentActivated;isCookieConsentHandled=getIsCookieConsentHandled(state);/**
|
|
9
9
|
* if merchant has not activated the cookie feature OR if merchant has activated cookie feature
|
|
10
10
|
* and user has chosen cookies already trigger stream to run code that depends on the cookie
|
|
11
11
|
* consent.
|
|
12
|
-
*/if(!(!isCookieConsentActivated||isCookieConsentActivated&&isCookieConsentHandled||!appSupportsCookieConsent())){_context.next=
|
|
12
|
+
*/if(!(!isCookieConsentActivated||isCookieConsentActivated&&isCookieConsentHandled||!appSupportsCookieConsent())){_context.next=14;break;}comfortCookiesAccepted=getAreComfortCookiesAccepted(state);statisticsCookiesAccepted=getAreStatisticsCookiesAccepted(state);dispatch(handleCookieConsent({comfortCookiesAccepted:comfortCookiesAccepted,statisticsCookiesAccepted:statisticsCookiesAccepted}));if(!(appSupportsCookieConsent()&&(comfortCookiesAccepted||statisticsCookiesAccepted))){_context.next=13;break;}_context.next=13;return dispatch(grantAppTrackingTransparencyPermission());case 13:return _context.abrupt("return");case 14:// if merchant has activated cookie feature but user has not chosen cookies yet:
|
|
13
13
|
// show cookie consent modal to make user choose them
|
|
14
|
-
if(isCookieConsentActivated&&!isCookieConsentHandled){dispatch(showCookieConsentModal());}case
|
|
14
|
+
if(isCookieConsentActivated&&!isCookieConsentHandled){dispatch(showCookieConsentModal());}case 15:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref4.apply(this,arguments);};}());subscribe(navigateBackToCookieModal$,function(_ref5){var dispatch=_ref5.dispatch,getState=_ref5.getState;var isCookieConsentActivated=appConfig.cookieConsent.isCookieConsentActivated;var isCookieConsentHandled=getIsCookieConsentHandled(getState());if(isCookieConsentActivated&&!isCookieConsentHandled){dispatch(showCookieConsentModal());}});}
|