@shopgate/engage 7.20.0-beta.1 → 7.20.0-beta.3
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/account/reducers/index.js +2 -2
- package/cart/cart.helpers.js +8 -1
- package/cart/index.js +2 -1
- package/cart/streams/index.js +1 -0
- package/checkout/constants/index.js +1 -1
- package/checkout/index.js +2 -2
- package/components/ConditionalWrapper/ConditionalWrapper.js +7 -2
- package/components/QuantityInput/QuantityInput.js +1 -1
- package/core/constants/index.js +1 -1
- package/core/helpers/appFeatures.js +2 -1
- package/core/helpers/i18n.js +1 -1
- package/core/helpers/index.js +1 -1
- package/core/subscriptions/app.js +2 -2
- package/favorites/components/List/List.js +17 -6
- package/favorites/components/List/ListAccordionLabel.js +4 -0
- package/favorites/components/List/ListContent.js +8 -0
- package/favorites/components/List/ListItemWrapper.js +6 -0
- package/favorites/components/List/styles.js +1 -0
- package/favorites/components/Lists/Lists.js +4 -4
- package/favorites/components/Lists/ListsModal.js +3 -2
- package/favorites/constants/index.js +1 -0
- package/filter/actions/index.js +1 -0
- package/filter/components/index.js +1 -0
- package/filter/constants/index.js +1 -1
- package/filter/helpers/buildInitialFilters.js +1 -1
- package/filter/helpers/translateFilterLabel.js +3 -3
- package/filter/index.js +2 -7
- package/filter/selectors/index.js +1 -1
- package/filter/streams/index.js +1 -0
- package/locations/subscriptions.js +2 -2
- package/package.json +7 -7
- package/page/selectors/index.js +7 -1
- package/product/components/ProductSlider/index.js +1 -1
- package/product/components/QuantityPicker/hooks.js +5 -0
- package/product/components/QuantityPicker/index.js +2 -2
- package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +2 -2
- package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -2
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +6 -3
- package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +7 -0
- package/product/components/UnitQuantityPicker/index.js +1 -1
- package/product/components/index.js +1 -1
- package/product/providers/ProductListType/context.js +2 -1
- package/product/providers/ProductListType/index.js +2 -1
- package/product/providers/index.js +1 -1
- package/push-opt-in/components/PushOptInModal/index.js +5 -6
- package/push-opt-in/subscriptions/optInTrigger.js +3 -5
- package/reviews/index.js +3 -1
- package/tracking/action-creators/cookieConsent.js +24 -0
- package/tracking/action-creators/index.js +1 -4
- package/tracking/actions/cookieConsent.js +21 -0
- package/tracking/actions/index.js +1 -0
- package/tracking/components/CookieConsentModal/connector.js +6 -0
- package/tracking/components/CookieConsentModal/index.js +9 -0
- package/tracking/components/CookieConsentModal/style.js +1 -0
- package/tracking/components/CookieConsentModal/tracking-opt-in.svg +18 -0
- package/tracking/components/PrivacySettings/connector.js +6 -0
- package/tracking/components/PrivacySettings/index.js +4 -0
- package/tracking/components/PrivacySettings/style.js +1 -0
- package/tracking/components/index.js +1 -1
- package/tracking/constants/index.js +0 -1
- package/tracking/reducers/cookieConsentModal.js +6 -0
- package/tracking/reducers/cookieSettings.js +6 -0
- package/tracking/reducers/index.js +1 -0
- package/tracking/selectors/cookieConsent.js +35 -0
- package/tracking/selectors/index.js +1 -4
- package/tracking/streams/cookieConsent.js +46 -0
- package/tracking/streams/index.js +1 -1
- package/tracking/subscriptions/analytics.js +11 -0
- package/tracking/subscriptions/cookieConsent.js +13 -0
- package/tracking/subscriptions/index.js +1 -4
- package/product/components/QuantityPicker/helpers.js +0 -5
- package/tracking/components/CookieConsent/CookieConsent.connector.js +0 -4
- package/tracking/components/CookieConsent/CookieConsent.js +0 -4
- package/tracking/components/CookieConsent/CookieConsentButtons.js +0 -3
- package/tracking/components/CookieConsent/CookieConsentCheckboxes.js +0 -3
- package/tracking/components/CookieConsent/CookieConsentContent.js +0 -4
- package/tracking/components/CookieConsent/CookieConsentMessage.js +0 -4
- package/tracking/components/CookieConsent/index.js +0 -1
- package/tracking/helpers/index.js +0 -7
- package/tracking/hooks/index.js +0 -4
- package/tracking/index.js +0 -1
- package/tracking/providers/CookieConsentProvider.connector.js +0 -4
- package/tracking/providers/CookieConsentProvider.context.js +0 -1
- package/tracking/providers/CookieConsentProvider.js +0 -8
- /package/product/{components/ProductProvider → providers/Product}/connector.js +0 -0
- /package/product/{components/ProductProvider → providers/Product}/index.js +0 -0
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React,{Fragment}from'react';import{i18n}from'@shopgate/engage/core/helpers/i18n';import{TextLink,I18n}from'@shopgate/engage/components';import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{useCookieConsent}from"../../hooks";var variables=themeConfig.variables;var styles={container:css({}),message:css({paddingRight:variables.gap.xsmall}).toString(),link:css({textDecoration:'underline'}).toString()};/**
|
|
2
|
-
* The CookieConsentMessage component
|
|
3
|
-
* @returns {JSX}
|
|
4
|
-
*/var CookieConsentMessage=function CookieConsentMessage(){var _useCookieConsent=useCookieConsent(),privacyPolicyLink=_useCookieConsent.privacyPolicyLink;return React.createElement("div",{className:styles.container},React.createElement(I18n.Text,{string:"tracking.cookieConsent.message",className:styles.message}),privacyPolicyLink&&React.createElement(Fragment,null,React.createElement(TextLink,{className:styles.link,href:privacyPolicyLink},i18n.text('tracking.cookieConsent.learnMore')),"."));};export default CookieConsentMessage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as CookieConsent}from"./CookieConsent";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{COOKIE_CONSENT_COOKIE_NAME_STATUS,COOKIE_CONSENT_COOKIE_NAME_PREFS,COOKIE_CONSENT_STATUS_ALLOW,COOKIE_CONSENT_PREF_ANALYTICS}from"../constants";/**
|
|
2
|
-
* @param {string} name The cookie name
|
|
3
|
-
* @returns {string}
|
|
4
|
-
*/var getCookieValue=function getCookieValue(name){var b=document.cookie.match("(^|;)\\s*".concat(name,"\\s*=\\s*([^;]+)"));return b?b.pop():'';};/**
|
|
5
|
-
* Checks if tracking is allowed
|
|
6
|
-
* @returns {bool}
|
|
7
|
-
*/export var isTrackingAllowed=function isTrackingAllowed(){var status=getCookieValue(COOKIE_CONSENT_COOKIE_NAME_STATUS);var prefs=getCookieValue(COOKIE_CONSENT_COOKIE_NAME_PREFS);if(status!==COOKIE_CONSENT_STATUS_ALLOW){return false;}try{prefs=JSON.parse(decodeURIComponent(prefs));if(!Array.isArray(prefs)){prefs=[];}}catch(e){prefs=[];}return prefs.includes(COOKIE_CONSENT_PREF_ANALYTICS);};
|
package/tracking/hooks/index.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from'react';import CookieConsent from"../providers/CookieConsentProvider.context";/**
|
|
2
|
-
* Returns the value of the cookie consent provider state.
|
|
3
|
-
* @returns {Object}
|
|
4
|
-
*/export var useCookieConsent=function useCookieConsent(){return React.useContext(CookieConsent);};
|
package/tracking/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{CookieConsent}from"./components";export{initializeTracking$}from"./streams";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{connect}from'react-redux';import{initTracking}from"../action-creators";import{hasCookieConsent,hasStrictCookieConsent,makeGetPrivacyPolicyLink}from"../selectors";/**
|
|
2
|
-
* Creates the mapStateToProps connector function.
|
|
3
|
-
* @returns {Function}
|
|
4
|
-
*/var makeMapStateToProps=function makeMapStateToProps(){var getPrivacyPolicyLink=makeGetPrivacyPolicyLink();return function(state){return{privacyPolicyLink:getPrivacyPolicyLink(state),hasCookieConsent:hasCookieConsent(state),hasStrictCookieConsent:hasStrictCookieConsent(state)};};};var mapDispatchToProps={initTracking:initTracking};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import React from'react';var initialContext={};export default React.createContext(initialContext);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_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,{useMemo,useCallback,useState,useLayoutEffect}from'react';import PropTypes from'prop-types';import{useCookies}from'react-cookie';import{i18n}from'@shopgate/engage/core';import{COOKIE_CONSENT_COOKIE_NAME_STATUS,COOKIE_CONSENT_COOKIE_NAME_PREFS,COOKIE_CONSENT_STATUS_ALLOW,COOKIE_CONSENT_STATUS_DENY,COOKIE_CONSENT_PREF_NEEDED,COOKIE_CONSENT_PREF_ANALYTICS}from"../constants";import Context from"./CookieConsentProvider.context";import connect from"./CookieConsentProvider.connector";/**
|
|
2
|
-
* @returns {JSX}
|
|
3
|
-
*/var CookieConsentProvider=function CookieConsentProvider(_ref){var privacyPolicyLink=_ref.privacyPolicyLink,hasCookieConsent=_ref.hasCookieConsent,hasStrictCookieConsent=_ref.hasStrictCookieConsent,initTracking=_ref.initTracking,children=_ref.children;var _useCookies=useCookies([COOKIE_CONSENT_COOKIE_NAME_STATUS,COOKIE_CONSENT_COOKIE_NAME_PREFS]),_useCookies2=_slicedToArray(_useCookies,2),cookies=_useCookies2[0],setCookie=_useCookies2[1];var _useState=useState(hasCookieConsent&&![COOKIE_CONSENT_STATUS_ALLOW,COOKIE_CONSENT_STATUS_DENY].includes(cookies[COOKIE_CONSENT_COOKIE_NAME_STATUS])),_useState2=_slicedToArray(_useState,2),isVisible=_useState2[0],setIsVisible=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),allowAnalytics=_useState4[0],setAllowAnalytics=_useState4[1];var _useState5=useState(0),_useState6=_slicedToArray(_useState5,2),fadeOutDelay=_useState6[0],setFadeOutDelay=_useState6[1];useLayoutEffect(function(){var status=cookies[COOKIE_CONSENT_COOKIE_NAME_STATUS];if([COOKIE_CONSENT_STATUS_ALLOW,COOKIE_CONSENT_STATUS_DENY].includes(status)){setTimeout(function(){setIsVisible(false);},fadeOutDelay);}},[cookies,fadeOutDelay]);var saveCookies=useCallback(function(){var allowed=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var analyticsAllowed=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var status=allowed?COOKIE_CONSENT_STATUS_ALLOW:COOKIE_CONSENT_STATUS_DENY;var prefs=[COOKIE_CONSENT_PREF_NEEDED].concat(analyticsAllowed?[COOKIE_CONSENT_PREF_ANALYTICS]:[]);var expires=new Date();expires.setFullYear(expires.getFullYear()+1);setCookie(COOKIE_CONSENT_COOKIE_NAME_STATUS,status,{expires:expires});setCookie(COOKIE_CONSENT_COOKIE_NAME_PREFS,prefs,{expires:expires});if(analyticsAllowed){// Initialize the tracking if allowed
|
|
4
|
-
initTracking();}},[initTracking,setCookie]);var onClickPrimary=useCallback(function(){if(hasStrictCookieConsent){// In strict mode the button saves the current configuration
|
|
5
|
-
saveCookies(true,allowAnalytics);return;}// In normal mode analytics are accepted
|
|
6
|
-
setAllowAnalytics(true);// Removal of the banner needs to be postponed, so that the user can see the added checkmark
|
|
7
|
-
setFadeOutDelay(1000);saveCookies(true,true);},[allowAnalytics,hasStrictCookieConsent,saveCookies]);var onClickSecondary=useCallback(function(){var strict=hasStrictCookieConsent;// In strict mode the button denies cookies
|
|
8
|
-
saveCookies(!strict,strict?false:allowAnalytics);},[allowAnalytics,hasStrictCookieConsent,saveCookies]);var onClickAllowAnalytics=useCallback(function(){setAllowAnalytics(!allowAnalytics);},[allowAnalytics]);var buttonLabels=useMemo(function(){if(hasStrictCookieConsent){return{secondary:i18n.text('tracking.cookieConsent.decline'),primary:i18n.text('tracking.cookieConsent.save')};}return{secondary:i18n.text('tracking.cookieConsent.allowSelected'),primary:i18n.text('tracking.cookieConsent.allowAll')};},[hasStrictCookieConsent]);var value=useMemo(function(){return{isVisible:isVisible,allowAnalytics:allowAnalytics,privacyPolicyLink:privacyPolicyLink,buttonLabels:buttonLabels,onClickPrimary:onClickPrimary,onClickSecondary:onClickSecondary,onClickAllowAnalytics:onClickAllowAnalytics};},[isVisible,allowAnalytics,privacyPolicyLink,buttonLabels,onClickPrimary,onClickSecondary,onClickAllowAnalytics]);return React.createElement(Context.Provider,{value:value},children);};CookieConsentProvider.defaultProps={children:null,privacyPolicyLink:null,hasCookieConsent:false,hasStrictCookieConsent:false};export default connect(CookieConsentProvider);
|
|
File without changes
|
|
File without changes
|