@shopgate/engage 7.20.0-beta.2 → 7.20.0-beta.4
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/actions/addContacts.js +1 -1
- package/account/actions/deleteContact.js +1 -1
- package/account/actions/deleteCustomer.js +1 -1
- package/account/actions/fetchContacts.js +1 -1
- package/account/actions/fetchCustomer.js +1 -1
- package/account/actions/updateContact.js +1 -1
- package/account/actions/updateCustomer.js +1 -1
- package/account/reducers/index.js +2 -2
- package/cart/cart.helpers.js +8 -1
- package/cart/components/CartItem/CartItemProductLayout.js +2 -1
- package/cart/index.js +2 -1
- package/cart/streams/index.js +1 -0
- package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +1 -1
- package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +1 -1
- package/checkout/components/index.js +1 -1
- package/checkout/constants/index.js +1 -1
- package/checkout/index.js +3 -4
- package/checkout/paymentMethods/stripe/sdk.js +3 -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/Item/Item.js +3 -3
- 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/orders/index.js +1 -1
- 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/registration/components/index.js +1 -0
- package/registration/index.js +1 -1
- package/registration/streams/index.js +4 -0
- package/registration/subscriptions/index.js +4 -4
- package/styles/helpers/initCSSCustomProperties.js +2 -2
- package/styles/helpers/setPageBackgroundColor.js +2 -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/user/index.js +1 -1
- 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 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
4
|
*/export var addCustomerContacts=function addCustomerContacts(_ref){var contacts=_ref.contacts;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:ADD_CUSTOMER_CONTACT,contacts:contacts});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.addContacts').setTrusted().setInput({contacts:contacts}).dispatch();case 4:response=_context.sent;dispatch({type:ADD_CUSTOMER_CONTACT_SUCCESS,contacts:contacts});_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:ADD_CUSTOMER_CONTACT_ERROR,contacts:contacts,error:_context.t0});throw _context.t0;case 12:return _context.abrupt("return",response);case 13:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{DELETE_CUSTOMER_CONTACT,DELETE_CUSTOMER_CONTACT_SUCCESS,DELETE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{DELETE_CUSTOMER_CONTACT,DELETE_CUSTOMER_CONTACT_SUCCESS,DELETE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @param {Object} contactId Contact
|
|
4
4
|
* @returns {Function}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
4
|
*/export var deleteCustomer=function deleteCustomer(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteCustomer').setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_SUCCESS});dispatch(successLogout(false));_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 12:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
4
|
*/export var fetchCustomerContacts=function fetchCustomerContacts(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,contacts;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER_CONTACTS});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getContacts').setTrusted().dispatch();case 4:_ref3=_context.sent;contacts=_ref3.contacts;dispatch({type:FETCH_CUSTOMER_CONTACTS_SUCCESS,contacts:contacts});return _context.abrupt("return",contacts);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_CONTACTS_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants/actions";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
4
|
*/export var fetchCustomerData=function fetchCustomerData(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,customer;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getCustomer').setTrusted().dispatch();case 4:_ref3=_context.sent;customer=_ref3.customer;dispatch({type:FETCH_CUSTOMER_SUCCESS,customer:customer});return _context.abrupt("return",customer);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
4
|
*/export var updateCustomerContact=function updateCustomerContact(_ref){var contactId=_ref.contactId,contact=_ref.contact;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER_CONTACT,contactId:contactId,contact:contact});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateContact').setTrusted().setInput({contactId:contactId,contact:contact}).dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_CONTACT_ERROR,contactId:contactId,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
|
|
2
2
|
* @param {Object} customer Customer
|
|
3
3
|
* @returns {Function}
|
|
4
4
|
*/export var updateCustomerData=function updateCustomerData(customer){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER,customer:customer});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateCustomer').setInput({customer:customer}).setTrusted().dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_SUCCESS,customer:customer});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_ERROR,customer:customer,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{produce}from'immer';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR,FETCH_CUSTOMER,FETCH_CUSTOMER_SUCCESS,FETCH_CUSTOMER_ERROR}from"../constants/actions";var initialState={customer:{isFetching:false,data:null},contacts:{isFetching:false,items:[]}};/**
|
|
1
|
+
import{produce}from'immer';import{SUCCESS_LOGOUT}from'@shopgate/engage/core/constants';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR,FETCH_CUSTOMER,FETCH_CUSTOMER_SUCCESS,FETCH_CUSTOMER_ERROR}from"../constants/actions";var initialState={customer:{isFetching:false,data:null},contacts:{isFetching:false,items:[]}};/**
|
|
2
2
|
* The reducer for all checkout related state.
|
|
3
3
|
* @param {Object} state The application state.
|
|
4
4
|
* @param {Object} action The redux action.
|
|
5
5
|
* @returns {Object}
|
|
6
|
-
*/export default function checkoutReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:initialState;var action=arguments.length>1?arguments[1]:undefined;/* eslint-disable no-param-reassign */var producer=produce(function(draft){switch(action.type){case FETCH_CUSTOMER_CONTACTS:{draft.contacts.isFetching=true;break;}case FETCH_CUSTOMER_CONTACTS_ERROR:{draft.contacts.isFetching=false;break;}case FETCH_CUSTOMER_CONTACTS_SUCCESS:{draft.contacts.isFetching=false;draft.contacts.items=action.contacts;break;}case FETCH_CUSTOMER:{draft.customer.isFetching=true;break;}case FETCH_CUSTOMER_ERROR:{draft.customer.isFetching=false;break;}case FETCH_CUSTOMER_SUCCESS:{draft.customer.isFetching=false;draft.customer.data=action.customer;break;}default:break;}});/* eslint-enable no-param-reassign */return producer(state);}
|
|
6
|
+
*/export default function checkoutReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:initialState;var action=arguments.length>1?arguments[1]:undefined;/* eslint-disable no-param-reassign */var producer=produce(function(draft){switch(action.type){case FETCH_CUSTOMER_CONTACTS:{draft.contacts.isFetching=true;break;}case FETCH_CUSTOMER_CONTACTS_ERROR:{draft.contacts.isFetching=false;break;}case FETCH_CUSTOMER_CONTACTS_SUCCESS:{draft.contacts.isFetching=false;draft.contacts.items=action.contacts;break;}case FETCH_CUSTOMER:{draft.customer.isFetching=true;break;}case FETCH_CUSTOMER_ERROR:{draft.customer.isFetching=false;break;}case FETCH_CUSTOMER_SUCCESS:{draft.customer.isFetching=false;draft.customer.data=action.customer;break;}case SUCCESS_LOGOUT:{draft.customer=initialState.customer;draft.contacts=initialState.contacts;break;}default:break;}});/* eslint-enable no-param-reassign */return producer(state);}
|
package/cart/cart.helpers.js
CHANGED
|
@@ -5,4 +5,11 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
|
|
|
5
5
|
var groupedByBaseLineItemId=groupBy(merged,function(e){return e.baseLineItemId||e.id;});merged=merged.reduce(function(acc,_ref){var id=_ref.id;var group=groupedByBaseLineItemId===null||groupedByBaseLineItemId===void 0?void 0:groupedByBaseLineItemId[id];if(group){return[].concat(acc,group);}return acc;},[]);var enhanced=merged.map(function(item){if(!item.fulfillment||![ROPIS,BOPIS].includes(item.fulfillment.method)){return _extends({},item,{fulfillmentLocationId:null,fulfillmentMethod:null});}return _extends({},item,{fulfillmentLocationId:item.fulfillment.location.code,fulfillmentMethod:item.fulfillment.method});});return enhanced;}/**
|
|
6
6
|
* @param {Object} cartItem A cart item
|
|
7
7
|
* @returns {Object}
|
|
8
|
-
*/export var createCartItemPrices=function createCartItemPrices(){var cartItem=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{}
|
|
8
|
+
*/export var createCartItemPrices=function createCartItemPrices(){var cartItem=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};/**
|
|
9
|
+
* When PWA doesn't run with new services and uses a "shopgate.cart.getCart.v1" pipeline from one
|
|
10
|
+
* of the available cart extensions, we return a price array based on the response of those
|
|
11
|
+
* pipelines.
|
|
12
|
+
*/if(!hasNewServices()){var _cartItem$product3=cartItem.product,_cartItem$product4=_cartItem$product3===void 0?{}:_cartItem$product3,_cartItem$product2$pr2=_cartItem$product4.price,_price=_cartItem$product2$pr2===void 0?{}:_cartItem$product2$pr2;return{price:[],subtotal:typeof(_price===null||_price===void 0?void 0:_price.special)==='number'&&_price.special!==_price["default"]?[{price:_price["default"]},{price:_price.special}]:[{price:_price["default"]}]};}/**
|
|
13
|
+
* When running with the new services, the "shopgate.cart.getCart.v1" pipeline returns entities
|
|
14
|
+
* with different price properties. Those are handled here.
|
|
15
|
+
*/var _cartItem$product5=cartItem.product,product=_cartItem$product5===void 0?{}:_cartItem$product5,quantity=cartItem.quantity,price=cartItem.price,promoAmount=cartItem.promoAmount,extendedPrice=cartItem.extendedPrice,unitPromoAmount=cartItem.unitPromoAmount,unitDiscountAmount=cartItem.unitDiscountAmount;var _ref2=(product===null||product===void 0?void 0:product.price)||{},unit=_ref2.unit,unitSale=_ref2.unitSale,unitEffective=_ref2.unitEffective;var prices={price:[{price:unit}],subtotal:[]};if(unitSale&&unitSale!==unit){prices.price.push({price:unitSale});prices.subtotal.push({price:unit*quantity});}prices.subtotal.push({price:price});if(unitPromoAmount){prices.price.push({price:unitEffective+unitPromoAmount,isPromo:true});prices.subtotal.push({price:price+promoAmount,isPromo:true});}if(unitDiscountAmount){prices.price.push({price:unitEffective+unitPromoAmount+unitDiscountAmount,isCoupon:true});prices.subtotal.push({price:extendedPrice,isCoupon:true});}return prices;};
|
|
@@ -1,5 +1,6 @@
|
|
|
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;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React,{useMemo}from'react';import classNames from'classnames';import{Grid,Link,TextLink,ProductProperties,SurroundPortals,ConditionalWrapper,I18n}from'@shopgate/engage/components';import{CART_ITEM_IMAGE,CART_ITEM_LINK,CART_ITEM_PROPERTIES,CART_ITEM_QUANTITY_PICKER}from'@shopgate/engage/cart';import{showTaxDisclaimer}from'@shopgate/engage/market';import{bin2hex}from'@shopgate/engage/core/helpers';import{useWidgetSettings}from'@shopgate/engage/core/hooks';import{ProductImage,PriceInfo,ITEM_PATH}from'@shopgate/engage/product';import{CartItemProductChangeLocation,CartChangeFulfillmentMethod}from'@shopgate/engage/locations';import{getLineItemActiveStatus}from'@shopgate/engage/orders';import{CartItemQuantityPicker}from"./CartItemQuantityPicker";import{CartItemProductTitle}from"./CartItemProductTitle";import CartItemProductOrderDetails from"./CartItemProductOrderDetails";import CartItemProductPriceList from"./CartItemProductPriceList";import{useCartItem,useCartItemProduct}from"./CartItem.hooks";import styles from"./CartItemProductLayout.style";/**
|
|
2
2
|
* The Cart Product Layout component.
|
|
3
3
|
* @returns {JSX}
|
|
4
|
-
*/export function CartItemProductLayout(){
|
|
4
|
+
*/export function CartItemProductLayout(){// Added with PWA 6 - CCP-2372
|
|
5
|
+
var _useWidgetSettings=useWidgetSettings('@shopgate/engage/components/TaxDisclaimer'),show=_useWidgetSettings.show;// use widget setting if set to true/false, otherwise use market logic
|
|
5
6
|
var showDisclaimer=typeof show==='boolean'?show:showTaxDisclaimer;var _useCartItem=useCartItem(),registerFulfillmentAction=_useCartItem.registerFulfillmentAction,isOrderDetails=_useCartItem.isOrderDetails,isCheckoutConfirmation=_useCartItem.isCheckoutConfirmation;var context=useCartItemProduct();var cartItem=context.cartItem,product=context.product,currency=context.currency,editMode=context.editMode,handleUpdate=context.handleUpdate,toggleEditMode=context.toggleEditMode,isEditable=context.isEditable;var portalProps=useMemo(function(){return _extends({},context,{isOrderDetails:isOrderDetails,isCheckoutConfirmation:isCheckoutConfirmation,quantity:cartItem.quantity});},[cartItem.quantity,context,isCheckoutConfirmation,isOrderDetails]);var isActive=!isOrderDetails?true:getLineItemActiveStatus(cartItem===null||cartItem===void 0?void 0:cartItem.status,cartItem===null||cartItem===void 0?void 0:cartItem.subStatus);var showLineItemPromotions=useMemo(function(){if(isOrderDetails||isCheckoutConfirmation){return false;}return((cartItem===null||cartItem===void 0?void 0:cartItem.appliedPromotions)||[]).length>0;},[cartItem,isCheckoutConfirmation,isOrderDetails]);return React.createElement(React.Fragment,null,React.createElement(Grid,{className:classNames(styles.item,_defineProperty({},styles.itemInactive,!isActive))},React.createElement(Grid.Item,{className:styles.content,grow:1},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(TextLink,{href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_LINK,portalProps:portalProps},React.createElement(CartItemProductTitle,{value:product.name}))),React.createElement(Grid,{className:styles.info},React.createElement(Grid.Item,{grow:1,className:styles.properties},React.createElement(SurroundPortals,{portalName:CART_ITEM_PROPERTIES,portalProps:portalProps},React.createElement(ProductProperties,{properties:product.properties,lineClamp:2})),isOrderDetails&&React.createElement(CartItemProductOrderDetails,null)),React.createElement(Grid.Item,{grow:1,className:styles.price},isOrderDetails&&React.createElement(I18n.Text,{string:"cart.subtotal",className:styles.orderDetailsSubtotalLabel}),!showLineItemPromotions&&React.createElement(React.Fragment,null,React.createElement(CartItemProductPriceList,{isSubtotal:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo}))),showDisclaimer&&React.createElement(Grid.Item,{className:styles.disclaimerSpacer,grow:0,shrink:0})),showLineItemPromotions&&React.createElement(Grid,{className:classNames(styles.info,styles.promotionLine)},React.createElement(Grid.Item,null),React.createElement(Grid.Item,{className:styles.promotionLineItem},React.createElement(CartItemProductPriceList,{isSubtotal:true,showLabels:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo})))),React.createElement(Grid.Item,{className:styles.leftColumn},React.createElement("div",{className:styles.image,"aria-hidden":true},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(Link,{tagName:"a",href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_IMAGE,portalProps:portalProps},React.createElement(ProductImage,{src:product.featuredImageBaseUrl||product.featuredImageUrl})))),!isOrderDetails&&React.createElement(SurroundPortals,{portalName:CART_ITEM_QUANTITY_PICKER,portalProps:portalProps},React.createElement(CartItemQuantityPicker,{unit:product.unit,hasCatchWeight:product.hasCatchWeight,quantity:cartItem.quantity,editMode:editMode,onChange:handleUpdate,onToggleEditMode:toggleEditMode,disabled:!isEditable})))),React.createElement(CartItemProductChangeLocation,{cartItem:cartItem,registerAction:registerFulfillmentAction}),React.createElement(CartChangeFulfillmentMethod,{cartItem:cartItem,registerAction:registerFulfillmentAction}));}
|
package/cart/index.js
CHANGED
|
@@ -4,7 +4,8 @@ export{default as setCouponFieldError}from'@shopgate/pwa-common-commerce/cart/ac
|
|
|
4
4
|
export*from'@shopgate/pwa-common-commerce/cart/constants/index';export*from'@shopgate/pwa-common-commerce/cart/constants/PipelineErrors';export*from'@shopgate/pwa-common-commerce/cart/constants/Pipelines';export*from'@shopgate/pwa-common-commerce/cart/constants/Portals';export{FLAG_ORDERABLE,FLAG_COUPONS,FLAG_TAX_INCLUDED,FLAG_MULTI_LINE_RESERVE,CART_MAX_ITEMS,CART_INPUT_AUTO_SCROLL_DELAY}from"./cart.constants";// HELPERS
|
|
5
5
|
export*from'@shopgate/pwa-common-commerce/cart/helpers';export*from'@shopgate/pwa-common-commerce/cart/helpers/config';export{default as createPipelineErrorList}from'@shopgate/pwa-common-commerce/cart/helpers/createPipelineErrorList';export*from'@shopgate/pwa-common-commerce/cart/helpers/shipping';export*from'@shopgate/pwa-common-commerce/cart/helpers/tax';export{sortCartItems}from"./cart.helpers";// SELECTORS
|
|
6
6
|
export*from'@shopgate/pwa-common-commerce/cart/selectors';export{makeIsAddToCartButtonDisabled,getAppliedPromotionsWithoutCoupons,getPromotionCoupons,hasLineItemPromotions,hasDirectShipItems,isDirectShipOnly}from"./cart.selectors";// STREAMS
|
|
7
|
-
|
|
7
|
+
// eslint-disable-next-line import/export
|
|
8
|
+
export*from"./streams";// CONTEXTS
|
|
8
9
|
export{CartContext}from"./cart.context";// COMPONENTS
|
|
9
10
|
export{PaymentBar}from"./components/PaymentBar";export{CartItemGroup,CartItems}from"./components/CartItems";export{CartItem}from"./components/CartItem";export{CartHeaderWide}from"./components/CartHeaderWide";export{default as CartSummaryWide}from"./components/CartSummaryWide/CartSummaryWide";export{SupplementalContent}from"./components/SupplementalContent";export{default as CartItemsSubstitution}from"./components/CartItems/CartItemsSubstitution";// HOOKS
|
|
10
11
|
export{useCartContext}from"./cart.hooks";// TYPES
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from'@shopgate/pwa-common-commerce/cart/streams';
|
|
@@ -5,4 +5,4 @@ import{i18n}from'@shopgate/engage/core';var pickupFieldActions=[{type:'setVisibi
|
|
|
5
5
|
* @param {Array} options.countrySortOrder Sort order for supported countries.
|
|
6
6
|
* @param {Object} options.userLocation User location for better phone picker defaults.
|
|
7
7
|
* @returns {Object}
|
|
8
|
-
*/var generateFormConfig=function generateFormConfig(_ref){var supportedCountries=_ref.supportedCountries,countrySortOrder=_ref.countrySortOrder,userLocation=_ref.userLocation;return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions')
|
|
8
|
+
*/var generateFormConfig=function generateFormConfig(_ref){var supportedCountries=_ref.supportedCountries,countrySortOrder=_ref.countrySortOrder,userLocation=_ref.userLocation;return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions')},pickupPerson:{type:'radio',label:i18n.text('checkout.pickup_contact.form.who_will_pickup'),options:{me:i18n.text('checkout.pickup_contact.form.me'),someoneElse:i18n.text('checkout.pickup_contact.form.someone_else')}},firstName:{type:'text',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.firstName')," *")},lastName:{type:'text',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.lastName')," *")},emailAddress:{type:'email',actions:pickupFieldActions,label:"".concat(i18n.text('checkout.pickup_contact.form.emailAddress')," *")},mobile:{type:'phone_picker',label:"".concat(i18n.text('checkout.pickup_contact.form.mobile')," *"),actions:pickupFieldActions,config:{supportedCountries:supportedCountries,countrySortOrder:countrySortOrder,userLocation:userLocation}}}};};export default generateFormConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{i18n}from'@shopgate/engage/core';/**
|
|
2
2
|
* Generates form configuration.
|
|
3
3
|
* @returns {Object}
|
|
4
|
-
*/var generateFormConfig=function generateFormConfig(){return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions')
|
|
4
|
+
*/var generateFormConfig=function generateFormConfig(){return{fields:{instructions:{type:'text',label:i18n.text('checkout.pickup_contact.form.instructions')}}};};export default generateFormConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CheckoutConfirmationPickUpContact,CheckoutConfirmationOrderContact,CheckoutConfirmationBilledTo,CheckoutConfirmationShippedTo,CheckoutConfirmationOrderSummary,CheckoutConfirmationSection}from"./CheckoutConfirmation";export{SupplementalContent}from"./SupplementalContent";
|
|
1
|
+
export{CheckoutConfirmationPickUpContact,CheckoutConfirmationOrderContact,CheckoutConfirmationBilledTo,CheckoutConfirmationShippedTo,CheckoutConfirmationOrderSummary,CheckoutConfirmationSection}from"./CheckoutConfirmation";export{SupplementalContent}from"./SupplementalContent";export{default as Checkout}from"./Checkout/Checkout";export{default as GuestCheckoutPayment}from"./GuestCheckout/GuestCheckout";export{default as CheckoutConfirmation}from"./CheckoutConfirmation/CheckoutConfirmation";export{default as AddressBook}from"./AddressBook";export{default as AddressBookContact}from"./AddressBookContact";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CHECKOUT_PATTERN,GUEST_CHECKOUT_PATTERN,CHECKOUT_CONFIRMATION_PATTERN,GUEST_CHECKOUT_PAYMENT_PATTERN,CHECKOUT_ADDRESS_BOOK_PATTERN,CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN,checkoutRoutes}from"./routes";export var CHECKOUT_ACTIONS='checkout.actions';export var CHECKOUT_PICKUP_CONTACT_FORM='checkout.pickup-contact';export var CHECKOUT_MARKETING_OPTIN='checkout.marketing-optin';export var ADDRESS_TYPE_BILLING='billing';export var ADDRESS_TYPE_SHIPPING='shipping';export var ADDRESS_TYPE_PICKUP='pickup';
|
|
1
|
+
import{CHECKOUT_PATH}from'@shopgate/pwa-common/constants/RoutePaths';export*from'@shopgate/pwa-common-commerce/checkout/constants/index';export*from'@shopgate/pwa-common-commerce/checkout/constants/Pipelines';export{CHECKOUT_PATH};export{CHECKOUT_PATTERN,GUEST_CHECKOUT_PATTERN,CHECKOUT_CONFIRMATION_PATTERN,GUEST_CHECKOUT_PAYMENT_PATTERN,CHECKOUT_ADDRESS_BOOK_PATTERN,CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN,checkoutRoutes}from"./routes";export var CHECKOUT_ACTIONS='checkout.actions';export var CHECKOUT_PICKUP_CONTACT_FORM='checkout.pickup-contact';export var CHECKOUT_MARKETING_OPTIN='checkout.marketing-optin';export var ADDRESS_TYPE_BILLING='billing';export var ADDRESS_TYPE_SHIPPING='shipping';export var ADDRESS_TYPE_PICKUP='pickup';
|
package/checkout/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/** @module checkout */
|
|
1
|
+
/** @module checkout */ // ACTIONS
|
|
2
2
|
export{default as fetchCheckoutUrl}from'@shopgate/pwa-common-commerce/checkout/actions/fetchCheckoutUrl';export{fetchCheckoutOrder}from'@shopgate/engage/checkout/actions/fetchCheckoutOrder';export{updateCheckoutOrder}from'@shopgate/engage/checkout/actions/updateCheckoutOrder';export{submitCheckoutOrder}from'@shopgate/engage/checkout/actions/submitCheckoutOrder';export{initializeCheckout}from'@shopgate/engage/checkout/actions/initializeCheckout';export{fetchPaymentMethods}from'@shopgate/engage/checkout/actions/fetchPaymentMethods';export{prepareCheckout}from'@shopgate/engage/checkout/actions/prepareCheckout';export{clearCheckoutOrder,clearCheckoutCampaign}from'@shopgate/engage/checkout/action-creators';// CONSTANTS
|
|
3
|
-
export*from
|
|
3
|
+
export*from"./constants";// SELECTORS
|
|
4
4
|
export*from'@shopgate/pwa-common-commerce/checkout/selectors';export*from"./selectors/guestCheckout";export*from"./selectors/order";export*from"./selectors/route";// STREAMS
|
|
5
5
|
export*from'@shopgate/pwa-common-commerce/checkout/streams';// HOOKS
|
|
6
|
-
export*from"./hooks/common"
|
|
7
|
-
export{default as Checkout}from"./components/Checkout/Checkout";export{default as GuestCheckoutPayment}from"./components/GuestCheckout/GuestCheckout";export{default as CheckoutConfirmation}from"./components/CheckoutConfirmation/CheckoutConfirmation";export{default as AddressBook}from"./components/AddressBook";export{default as AddressBookContact}from"./components/AddressBookContact";
|
|
6
|
+
export*from"./hooks/common";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{loadStripe}from'@stripe/stripe-js';
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{loadStripe}from'@stripe/stripe-js';import{logger}from'@shopgate/engage/core/helpers';// Write a log when sdk module loads - should not happen before entering native checkout
|
|
2
|
+
logger.warn('Stripe SDK loaded');var resolve;var reject;var stripe;export var promise=new Promise(function(res,rej){resolve=res;reject=rej;});var loaded=false;/**
|
|
2
3
|
* Loads the stripe sdk
|
|
3
4
|
* @param {string} publishableKey The publishable stripe key.
|
|
4
5
|
* @returns {Stripe}
|
|
5
|
-
*/export var loadSdk=function loadSdk(publishableKey){if(loaded){return promise;}loaded=true;/** */var fn=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var stripeObject;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return loadStripe(publishableKey);case 3:stripeObject=_context.sent;stripe=stripeObject;resolve(stripeObject);return _context.abrupt("return",stripeObject);case 9:_context.prev=9;_context.t0=_context["catch"](0);reject(_context.t0);throw _context.t0;case 13:case"end":return _context.stop();}},_callee,null,[[0,9]]);}));return function fn(){return _ref.apply(this,arguments);};}();return fn();};/**
|
|
6
|
+
*/export var loadSdk=function loadSdk(publishableKey){if(loaded||!publishableKey){return promise;}loaded=true;/** */var fn=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var stripeObject;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return loadStripe(publishableKey);case 3:stripeObject=_context.sent;stripe=stripeObject;resolve(stripeObject);return _context.abrupt("return",stripeObject);case 9:_context.prev=9;_context.t0=_context["catch"](0);reject(_context.t0);throw _context.t0;case 13:case"end":return _context.stop();}},_callee,null,[[0,9]]);}));return function fn(){return _ref.apply(this,arguments);};}();return fn();};/**
|
|
6
7
|
* Returns the sdk
|
|
7
8
|
* @returns {Object}
|
|
8
9
|
* */export var getSdk=function getSdk(){return stripe;};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import PropTypes from'prop-types';/**
|
|
2
2
|
* Conditionally wraps React children with another component.
|
|
3
3
|
* @param {Object} props The component props.
|
|
4
4
|
* @returns {JSX}
|
|
5
|
-
*/var ConditionalWrapper=function ConditionalWrapper(_ref){var condition=_ref.condition,wrapper=_ref.wrapper,children=_ref.children;return
|
|
5
|
+
*/var ConditionalWrapper=function ConditionalWrapper(_ref){var condition=_ref.condition,wrapper=_ref.wrapper,wrapperFalsy=_ref.wrapperFalsy,children=_ref.children;if(condition){return wrapper(children);}return typeof wrapperFalsy==='function'?wrapperFalsy(children):children;};ConditionalWrapper.propTypes={/**
|
|
6
|
+
* When set to `true`, the component children will be wrapped by the React component which is
|
|
7
|
+
* defined in `wrapper`.
|
|
8
|
+
* When the to `false`, the component children will be wrapped by the React component which is
|
|
9
|
+
* optionally defined in `wrapperFalsy`.
|
|
10
|
+
*/condition:PropTypes.bool.isRequired,children:PropTypes.node,wrapper:PropTypes.elementType,wrapperFalsy:PropTypes.elementType};ConditionalWrapper.defaultProps={children:null,wrapper:null,wrapperFalsy:null};export default ConditionalWrapper;
|
|
@@ -2,7 +2,7 @@ var _excluded=["className","onChange","onFocus","onBlur","value","maxDecimals","
|
|
|
2
2
|
* A Quantity Input with unit support.
|
|
3
3
|
* @returns {JSX}
|
|
4
4
|
*/var QuantityInput=forwardRef(function(_ref,outerInputRef){var className=_ref.className,onChange=_ref.onChange,customOnFocus=_ref.onFocus,customOnBlur=_ref.onBlur,value=_ref.value,maxDecimals=_ref.maxDecimals,unit=_ref.unit,minValue=_ref.minValue,maxValue=_ref.maxValue,inputProps=_objectWithoutProperties(_ref,_excluded);var inputRef=outerInputRef||useRef();var _useState=useState(formatFloat(value,maxDecimals)),_useState2=_slicedToArray(_useState,2),inputValue=_useState2[0],setInputValue=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isFocused=_useState4[0],setIsFocused=_useState4[1];var onFocus=useCallback(function(event){customOnFocus(event);setIsFocused(true);},[customOnFocus]);var onBlur=useCallback(function(event){var newValue=parseFloatString(inputValue,maxDecimals);setIsFocused(false);// If invalid switch to old value.
|
|
5
|
-
if(Number.isNaN(parseFloat(inputValue))){setInputValue(formatFloat(value,maxDecimals));return;}if(newValue!==value){onChange(newValue);}customOnBlur(event,newValue);},[customOnBlur,inputValue,maxDecimals,onChange,value]);var handleChange=useCallback(function(event){var newValue=event.target.value;
|
|
5
|
+
if(Number.isNaN(parseFloat(inputValue))){setInputValue(formatFloat(value,maxDecimals));return;}if(minValue&&newValue<minValue){newValue=minValue;}if(maxValue&&newValue>maxValue){newValue=maxValue;}setInputValue("".concat(newValue));if(newValue!==value){onChange(newValue);}customOnBlur(event,newValue);},[customOnBlur,inputValue,maxDecimals,maxValue,minValue,onChange,value]);var handleChange=useCallback(function(event){var newValue=event.target.value;setInputValue(newValue);},[]);// Select the current input value after focus.
|
|
6
6
|
useLayoutEffect(function(){if(isFocused&&isIOs){inputRef.current.select();}},[inputRef,isFocused]);// Sync actual float value with displayed content.
|
|
7
7
|
useEffect(function(){setInputValue(formatFloat(value,maxDecimals));},[maxDecimals,value]);// Stop the context menu from opening.
|
|
8
8
|
useLayoutEffect(function(){inputRef.current.addEventListener('contextmenu',function(event){event.preventDefault();event.stopPropagation();return false;});},[inputRef]);var displayedValue=!isFocused&&unit?"".concat(inputValue," ").concat(unit):inputValue;return React.createElement("input",_extends({ref:inputRef},inputProps,{inputMode:maxDecimals>0?'decimal':'numeric'/* Pattern signals some browsers to use specialized keyboard (if inputmode not supported */,pattern:maxDecimals>0?'[0-9.,]*':'[0–9]*',onFocus:onFocus,onBlur:onBlur,className:className,value:displayedValue,onChange:handleChange,onClick:function onClick(event){event.preventDefault();event.stopPropagation();if(inputRef.current){inputRef.current.focus();}}}));});QuantityInput.defaultProps={className:'',maxDecimals:2,unit:null,minValue:null,maxValue:null,onFocus:function onFocus(){},onChange:function onChange(){},onBlur:function onBlur(){}};export default QuantityInput;
|
package/core/constants/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{INDEX_PATH,INDEX_PATH_DEEPLINK,LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';export{RECEIVE_SHOP_SETTINGS,ERROR_SHOP_SETTINGS,CACHE_LEASE_SHOP_SETTINGS,SHOP_SETTING_GOOGLE_SITE_VERIFICATION_CODE,SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT,SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT,SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP,SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB,SHOP_SETTING_PRODUCTS_SORT_ORDER,SHOP_SETTING_COOKIE_CONSENT_MODE,SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,SHOP_SETTING_IMAGES,SHOP_SETTING_IMAGES_PRODUCT_PLACEHOLDER,SHOP_SETTING_IMAGES_CATEGORY_PLACEHOLDER,SHOP_SETTING_IMAGES_FAVICON,SHOP_SETTING_NUMBER_OF_ADDRESS_LINES,SHOP_SETTING_REGISTRATION_MODE_SIMPLE,SHOP_SETTING_REGISTRATION_MODE_EXTENDED,SHOP_SETTING_WISHLIST_ITEM_QUANTITY_ENABLED,SHOP_SETTING_WISHLIST_ITEM_NOTES_ENABLED,SHOP_SETTING_LOAD_WISHLIST_ON_APP_START_ENABLED,SHOP_SETTING_SHOW_WISHLIST_ITEMS_COUNT_BADGE}from"./shopSettings";export{RECEIVE_MERCHANT_SETTINGS,MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED,MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED,MERCHANT_SETTINGS_CUSTOMER_ATTRIBUTES,MERCHANT_SETTINGS_FULFILLMENT_SCHEDULED_ENABLED,MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS,MERCHANT_SETTINGS_DEFAULT_CURRENCY,MERCHANT_SETTINGS_ENABLE_WEB_INDEXING,MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION,MERCHANT_SETTINGS_PRODUCTLIST_SHOW_INVENTORY}from"./merchantSettings";export{SHOPGATE_CORE_GET_SHOP_SETTINGS,EUNAUTHORIZED,EAUTHENTICATION}from"./pipelines";export*from"./actionTypes";export*from"./appFeatures";export*from"./deviceTypes";export*from"./geolocationRequest";// Core Constants
|
|
2
|
-
export*from'@shopgate/pwa-core/constants/AppEvents';export*from'@shopgate/pwa-core/constants/AppPermissions';export*from'@shopgate/pwa-core/constants/ErrorHandleTypes';export*from'@shopgate/pwa-core/constants/Pipeline';export*from'@shopgate/pwa-core/constants/ProcessTypes';export*from'@shopgate/pwa-core/constants/Scanner';export*from'@shopgate/pwa-core/constants/Trilean';// Common Constants
|
|
2
|
+
export*from'@shopgate/pwa-core/constants/ErrorManager';export*from'@shopgate/pwa-core/constants/AppEvents';export*from'@shopgate/pwa-core/constants/AppPermissions';export*from'@shopgate/pwa-core/constants/ErrorHandleTypes';export*from'@shopgate/pwa-core/constants/Pipeline';export*from'@shopgate/pwa-core/constants/ProcessTypes';export*from'@shopgate/pwa-core/constants/Scanner';export*from'@shopgate/pwa-core/constants/Trilean';// Common Constants
|
|
3
3
|
export*from'@shopgate/pwa-common/constants/ActionTypes';export*from'@shopgate/pwa-common/constants/Configuration';export*from'@shopgate/pwa-common/constants/Device';export*from'@shopgate/pwa-common/constants/DisplayOptions';export*from'@shopgate/pwa-common/constants/Pipelines';export*from'@shopgate/pwa-common/constants/Portals';// CLIENT CONSTANTS
|
|
4
4
|
export*from'@shopgate/pwa-common/constants/client';// MENU CONSTANTS
|
|
5
5
|
export*from'@shopgate/pwa-common/constants/MenuIDs';// MODAL CONSTANTS
|
|
@@ -8,7 +8,8 @@ return false;}// Supported when the feature flags contain the push opt-in flag
|
|
|
8
8
|
return window.SGAppInfo.featureFlags.Push['1'].flags.includes(APP_FEATURE_PUSH_OPT_IN);};/**
|
|
9
9
|
* Determines if the app supports the cookie consent feature
|
|
10
10
|
* @returns {boolean}
|
|
11
|
-
*/export var appSupportsCookieConsent=function appSupportsCookieConsent(){var _window2,_window2$SGAppInfo,_window2$SGAppInfo$fe,_window2$SGAppInfo$fe2,_window2$SGAppInfo$fe3;if(
|
|
11
|
+
*/export var appSupportsCookieConsent=function appSupportsCookieConsent(){var _window2,_window2$SGAppInfo,_window2$SGAppInfo$fe,_window2$SGAppInfo$fe2,_window2$SGAppInfo$fe3;if(hasWebBridge()){// Deactivated in browser mode for now
|
|
12
|
+
return false;}if(!hasSGJavaScriptBridge()){// Always supported in development
|
|
12
13
|
return true;}if(!Array.isArray((_window2=window)===null||_window2===void 0?void 0:(_window2$SGAppInfo=_window2.SGAppInfo)===null||_window2$SGAppInfo===void 0?void 0:(_window2$SGAppInfo$fe=_window2$SGAppInfo.featureFlags)===null||_window2$SGAppInfo$fe===void 0?void 0:(_window2$SGAppInfo$fe2=_window2$SGAppInfo$fe.Analytics)===null||_window2$SGAppInfo$fe2===void 0?void 0:(_window2$SGAppInfo$fe3=_window2$SGAppInfo$fe2['1'])===null||_window2$SGAppInfo$fe3===void 0?void 0:_window2$SGAppInfo$fe3.flags)){// Not supported on app versions that don't provide the featureFlags object
|
|
13
14
|
return false;}// Supported when the feature flags contain the cookie consent flag
|
|
14
15
|
return window.SGAppInfo.featureFlags.Analytics['1'].flags.includes(APP_FEATURE_COOKIE_CONSENT);};
|
package/core/helpers/i18n.js
CHANGED
|
@@ -16,7 +16,7 @@ import get from'lodash/get';import{getTranslator,getPriceFormatter,getDateFormat
|
|
|
16
16
|
*/var I18n=function I18n(){var didInit=false;/**
|
|
17
17
|
* Function that throws when called. Used in a default instance of i18n to notify developer
|
|
18
18
|
* when the module is used without initialization.
|
|
19
|
-
*/var notReadyCb=function notReadyCb(){logger.error('i18n is not yet ready. Please postpone translations until App is bootstrapped.');};return{init:function init(_ref){var _this=this;var locales=_ref.locales,lang=_ref.lang,_ref$currencyLocale=_ref.currencyLocale,currencyLocale=_ref$currencyLocale===void 0?null:_ref$currencyLocale;if(didInit){logger.warn('Looks like i18n locales are already
|
|
19
|
+
*/var notReadyCb=function notReadyCb(){logger.error('i18n is not yet ready. Please postpone translations until App is bootstrapped.');};return{init:function init(_ref){var _this=this;var locales=_ref.locales,lang=_ref.lang,_ref$currencyLocale=_ref.currencyLocale,currencyLocale=_ref$currencyLocale===void 0?null:_ref$currencyLocale;if(didInit){logger.warn('Looks like i18n locales are already initialized. Changing locales now may lead to inconsistent translations.');}didInit=true;this.text=getTranslator(locales,lang);this.textWithDefault=function(key,defaultText){var text=_this.text(key);return text===key?defaultText:text;};this.price=getPriceFormatter(currencyLocale||lang);this.date=getDateFormatter(lang);this.time=getTimeFormatter(lang);this.number=getNumberFormatter(lang);this.getSupplementalData=function(){return locales.supplementalData||{};};this.getPath=function(path){return get(locales,path);};this.getLang=function(){return lang;};// If component decides to act accordingly this information should be exposed.
|
|
20
20
|
this.ready=true;},text:notReadyCb,textWithDefault:notReadyCb,price:notReadyCb,date:notReadyCb,time:notReadyCb,number:notReadyCb,getSupplementalData:notReadyCb,getPath:notReadyCb,getLang:notReadyCb,ready:false};};/**
|
|
21
21
|
* @type {I18nHelpers}
|
|
22
22
|
*/export var i18n=I18n();/**
|
package/core/helpers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @module core */import{getCurrentRoute as getCurrentRouteHelper,router,history,parseQueryStringToObject,parseObjectToQueryString}from'@shopgate/pwa-common/helpers/router';export*from"./environment";export*from"./appFeatures";export*from"./appPermissions";export*from"./baseUrl";export*from"./bridge";export{isBeta}from"../config/isBeta";export{getFullImageSource}from"./getFullImageSource";export{getImageFormat}from"./getImageFormat";export{i18n,getWeekDaysOrder}from"./i18n";export{updateLegacyNavigationBar}from"./updateLegacyNavigationBar";export{default as nl2br}from"./nl2br";export*from"./string";export{isIOSTheme}from"./isIOSTheme";export{isTouchDevice}from"./isTouchDevice";export{generateGoogleMapsDirectionsUrl}from"./googleMaps";export{useScrollContainer}from"./scrollContainer";export{getDeviceTypeForCms}from"./deviceType";export*from"./featureFlag";// --------------- CORE --------------- //
|
|
2
|
-
export
|
|
2
|
+
export{logger,ajaxUrl,hasSGJavaScriptBridge,useBrowserConnector,hasWebBridgeCore,logDeprecationMessage}from'@shopgate/pwa-core/helpers';export{default as logGroup}from'@shopgate/pwa-core/helpers/logGroup';export*from'@shopgate/pwa-core/helpers/version';export*from'@shopgate/pwa-common/helpers/data';export*from'@shopgate/pwa-common/helpers/date';export*from'@shopgate/pwa-common/helpers/dom';export{env,isDev,isProd,isRemote,isStaging}from'@shopgate/pwa-common/helpers/environment';export{default as decodeHTML}from'@shopgate/pwa-common/helpers/html/decodeHTML';export*from'@shopgate/pwa-common/helpers/html/handleDOM';export{default as parseHTML}from'@shopgate/pwa-common/helpers/html/parseHTML';export{default as getTranslator}from'@shopgate/pwa-common/helpers/i18n/getTranslator';export{default as getPriceFormatter}from'@shopgate/pwa-common/helpers/i18n/getPriceFormatter';export{default as getDateFormatter}from'@shopgate/pwa-common/helpers/i18n/getDateFormatter';export{default as getTimeFormatter}from'@shopgate/pwa-common/helpers/i18n/getTimeFormatter';export{default as getNumberFormatter}from'@shopgate/pwa-common/helpers/i18n/getNumberFormatter';export*from'@shopgate/pwa-common/helpers/legacy';// TODO: Can only be exported once the theme uses it. causes issues with the custom routes feature.
|
|
3
3
|
/*
|
|
4
4
|
export { default as portalCollection } from '@shopgate/pwa-common/helpers/portals/portalCollection';
|
|
5
5
|
export { default as routePortals } from '@shopgate/pwa-common/helpers/portals/routePortals';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{appWillStart$}from'@shopgate/
|
|
1
|
+
import{appWillStart$}from'@shopgate/engage/core/streams';import{configuration}from'@shopgate/engage/core/collections';import{hasNewServices}from'@shopgate/engage/core/helpers';import{CONFIGURATION_COLLECTION_KEY_BASE_URL}from'@shopgate/engage/core/constants';import{reloadApp$}from"../streams";import{reloadApp}from"../action-creators";/**
|
|
2
2
|
* App subscriptions
|
|
3
3
|
* @param {Function} subscribe The subscribe function
|
|
4
|
-
*/export default function app(subscribe){subscribe(appWillStart$,function(_ref){var dispatch=_ref.dispatch;// Add global function to enable PWA reload from the console
|
|
4
|
+
*/export default function app(subscribe){subscribe(appWillStart$,function(_ref){var dispatch=_ref.dispatch;console.log("%c\u2139\uFE0F PWA uses ".concat(hasNewServices()?'NEW':'OLD'," services"),'color: blue');// Add global function to enable PWA reload from the console
|
|
5
5
|
window.reloadSGApp=function(){dispatch(reloadApp());};});subscribe(reloadApp$,function(){// A deployed app can only be reloaded on the base url. So we first set this as current route
|
|
6
6
|
// before the reload happens.
|
|
7
7
|
window.history.replaceState({},null,configuration.get(CONFIGURATION_COLLECTION_KEY_BASE_URL));window.location.reload();});}
|
|
@@ -3,12 +3,12 @@ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimi
|
|
|
3
3
|
*/var makeMapStateToProps=function makeMapStateToProps(){var isRopeProductOrderable=makeIsRopeProductOrderable(function(state,props){var _getPreferredLocation;return(_getPreferredLocation=getPreferredLocation(state,props))===null||_getPreferredLocation===void 0?void 0:_getPreferredLocation.code;},function(state,props){return props.variantId||props.productId||null;});return function(state,props){return{isBaseProduct:isBaseProductSelector(state,props),hasVariants:hasProductVariants(state,props),isOrderable:isProductOrderable(state,props),isRopeProductOrderable:isRopeProductOrderable(state,props)};};};/**
|
|
4
4
|
* @param {Function} dispatch Dispatch.
|
|
5
5
|
* @returns {Object}
|
|
6
|
-
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{showModal:function showModal(){return dispatch(showModalAction.apply(void 0,arguments));},historyPush:function historyPush(){return dispatch(historyPushAction.apply(void 0,arguments));},updateFavoriteItem:function updateFavoriteItem(productId,listId,quantity,notes){dispatch(updateFavorite(productId,listId,quantity,notes));},openCommentDialog:function openCommentDialog(productId,listId){return dispatch(openFavoritesCommentDialog(productId,listId));}};};var styles={root:css({display:'flex',position:'relative','&:not(:last-child)':{marginBottom:16}}).toString(),imageContainer:css(_defineProperty(_defineProperty(_defineProperty({flex:0.4,marginRight:18},responsiveMediaQuery('>=xs',{appAlways:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{width:120,flex:'none'})).toString(),infoContainer:css({flex:1,display:'flex',flexDirection:'column',flexWrap:'wrap',gap:8}).toString(),infoContainerRow:css({flexDirection:'row',display:'flex',justifyContent:'space-between'}).toString(),quantityContainer:css({flexDirection:'row',display:'flex',alignItems:'center',flexWrap:'wrap',gap:16}).toString(),priceContainer:css({minWidth:100}).toString(),priceInfo:css({wordBreak:'break-word',fontSize:'0.875rem',lineHeight:'0.875rem',color:'var(--color-text-low-emphasis)',padding:"".concat(variables.gap.xsmall,"px 0")}).toString(),titleWrapper:css({display:'flex',flexDirection:'column',gap:8}).toString(),titleContainer:css({marginRight:10,flex:1}).toString(),title:css({fontSize:17,fontWeight:600}).toString(),removeContainer:css({display:'flex',flexShrink:0,alignItems:'flex-start'})};/**
|
|
6
|
+
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{showModal:function showModal(){return dispatch(showModalAction.apply(void 0,arguments));},historyPush:function historyPush(){return dispatch(historyPushAction.apply(void 0,arguments));},updateFavoriteItem:function updateFavoriteItem(productId,listId,quantity,notes){dispatch(updateFavorite(productId,listId,quantity,notes));},openCommentDialog:function openCommentDialog(productId,listId){return dispatch(openFavoritesCommentDialog(productId,listId));}};};var styles={root:css({display:'flex',position:'relative','&:not(:last-child)':{marginBottom:16}}).toString(),imageContainer:css(_defineProperty(_defineProperty(_defineProperty({flex:0.4,marginRight:18},responsiveMediaQuery('>=xs',{appAlways:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{maxWidth:120,minWidth:80}),responsiveMediaQuery('>=md',{webOnly:true}),{width:120,flex:'none'})).toString(),infoContainer:css({flex:1,display:'flex',flexDirection:'column',flexWrap:'wrap',gap:8}).toString(),infoContainerRow:css({flexDirection:'row',display:'flex',justifyContent:'space-between'}).toString(),quantityContainer:css({flexDirection:'row',display:'flex',alignItems:'center',flexWrap:'wrap',gap:16}).toString(),priceContainer:css({minWidth:100}).toString(),priceContainerInner:css({display:'inline-block',textAlign:'right'}),price:css({justifyContent:'flex-end'}).toString(),priceInfo:css({wordBreak:'break-word',fontSize:'0.875rem',lineHeight:'0.875rem',color:'var(--color-text-low-emphasis)',padding:"".concat(variables.gap.xsmall,"px 0")}).toString(),titleWrapper:css({display:'flex',flexDirection:'column',gap:8}).toString(),titleContainer:css({marginRight:10,flex:1}).toString(),title:css({fontSize:17,fontWeight:600}).toString(),removeContainer:css({display:'flex',flexShrink:0,alignItems:'flex-start'})};/**
|
|
7
7
|
* Favorite Item component
|
|
8
8
|
* @return {JSX}
|
|
9
|
-
*/var FavoriteItem=function FavoriteItem(_ref){var _product$price,_product$price2,_product$price3;var listId=_ref.listId,product=_ref.product,notes=_ref.notes,quantity=_ref.quantity,remove=_ref.remove,addToCart=_ref.addToCart,isBaseProduct=_ref.isBaseProduct,isOrderable=_ref.isOrderable,isRopeProductOrderable=_ref.isRopeProductOrderable,hasVariants=_ref.hasVariants,showModal=_ref.showModal,historyPush=_ref.historyPush,updateFavoriteItem=_ref.updateFavoriteItem,openCommentDialog=_ref.openCommentDialog;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var _useState=useState(!isOrderable&&!hasVariants),_useState2=_slicedToArray(_useState,2),isDisabled=_useState2[0],setIsDisabled=_useState2[1];var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=typeof specialPrice==='number'&&specialPrice
|
|
9
|
+
*/var FavoriteItem=function FavoriteItem(_ref){var _product$price,_product$price2,_product$price3;var listId=_ref.listId,product=_ref.product,notes=_ref.notes,quantity=_ref.quantity,remove=_ref.remove,addToCart=_ref.addToCart,isBaseProduct=_ref.isBaseProduct,isOrderable=_ref.isOrderable,isRopeProductOrderable=_ref.isRopeProductOrderable,hasVariants=_ref.hasVariants,showModal=_ref.showModal,historyPush=_ref.historyPush,updateFavoriteItem=_ref.updateFavoriteItem,openCommentDialog=_ref.openCommentDialog;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var _useState=useState(!isOrderable&&!hasVariants),_useState2=_slicedToArray(_useState,2),isDisabled=_useState2[0],setIsDisabled=_useState2[1];var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=typeof specialPrice==='number'&&specialPrice>=defaultPrice;var price=hasStrikePrice?specialPrice:defaultPrice;var characteristics=(product===null||product===void 0?void 0:product.characteristics)||[];var productLink="".concat(ITEM_PATH,"/").concat(bin2hex(product.id));var notesButtonRef=useRef();var _useState3=useState(quantity),_useState4=_slicedToArray(_useState3,2),internalQuantity=_useState4[0],setInternalQuantity=_useState4[1];useEffect(function(){setInternalQuantity(quantity);},[quantity]);useLayoutEffect(function(){setIsDisabled(!isOrderable&&!hasVariants);},[hasVariants,isOrderable]);var handleOpenComment=useCallback(function(e){e.preventDefault();e.stopPropagation();openCommentDialog(product.id,listId);},[listId,openCommentDialog,product.id]);var handleAddToCart=useCallback(function(e){e.preventDefault();e.stopPropagation();if(isBaseProduct&&hasVariants){// Called for a parent product. User needs to confirm the navigation to the PDP
|
|
10
10
|
showModal({title:null,type:MODAL_VARIANT_SELECT,message:'favorites.modal.message',confirm:'favorites.modal.confirm',dismiss:'common.cancel',params:{productId:product.id}});return false;}if(hasNewServices()&&!isRopeProductOrderable){// Product is not orderable for ROPE. So users need to do some corrections. Just redirect.
|
|
11
11
|
historyPush({pathname:productLink});return false;}broadcastLiveMessage('product.adding_item',{params:{count:1}});return addToCart(e);},[addToCart,hasVariants,historyPush,isBaseProduct,isRopeProductOrderable,product.id,productLink,showModal]);var commonPortalProps=useMemo(function(){var availability=product.availability,id=product.id,name=product.name;return{availability:availability,characteristics:characteristics,id:id,name:name,price:price,listId:listId};},[characteristics,listId,price,product]);var ctaPortalProps=useMemo(function(){return{isLoading:false,noShadow:false,listId:listId,isBaseProduct:isBaseProduct,isDisabled:isDisabled,productId:product.id,handleRemoveFromCart:remove,handleAddToCart:handleAddToCart};},[handleAddToCart,isBaseProduct,isDisabled,listId,product.id,remove]);var handleChangeQuantity=useCallback(function(newQuantity){// Do nothing when quantity didn't change
|
|
12
12
|
if(newQuantity===quantity)return;updateFavoriteItem(product.id,listId,newQuantity,notes);},[listId,notes,product.id,quantity,updateFavoriteItem]);var handleDeleteComment=useCallback(function(event){event.preventDefault();event.stopPropagation();updateFavoriteItem(product.id,listId,quantity,'');setTimeout(function(){if(notesButtonRef===null||notesButtonRef===void 0?void 0:notesButtonRef.current){// Focus the add button after item deletion to improve a11y
|
|
13
13
|
notesButtonRef.current.focus();}broadcastLiveMessage('favorites.comments.removed');},300);},[listId,product.id,quantity,updateFavoriteItem]);return React.createElement(ProductListEntryProvider,{productId:product.id},React.createElement(SurroundPortals,{portalName:FAVORITES_LIST_ITEM,portalProps:product},React.createElement("div",{className:styles.root},React.createElement(Link,{className:styles.imageContainer,component:"div",href:productLink,"aria-hidden":true},React.createElement(ProductImage,{src:product.featuredImageBaseUrl,resolutions:gridResolutions})),React.createElement("div",{className:styles.infoContainer},React.createElement("div",{className:classNames(styles.infoContainerRow)},React.createElement("div",{className:styles.titleWrapper},React.createElement(SurroundPortals,{portalName:FAVORITES_PRODUCT_NAME,portalProps:commonPortalProps},React.createElement(TextLink,{href:productLink,tag:"span",className:styles.titleContainer},React.createElement("span",{className:styles.title// eslint-disable-next-line react/no-danger
|
|
14
|
-
,dangerouslySetInnerHTML:{__html:"".concat(product.name)}})))),React.createElement("div",{className:styles.removeContainer},React.createElement(Remove,{onClick:remove}))),React.createElement(ItemCharacteristics,{characteristics:characteristics}),!hasNewServices()?React.createElement(SurroundPortals,{portalName:FAVORITES_AVAILABILITY_TEXT,portalProps:commonPortalProps},React.createElement(AvailableText,{text:commonPortalProps.availability.text,state:commonPortalProps.availability.state,showWhenAvailable:true,className:styles.availability})):React.createElement(StockInfoLists,{product:product}),React.createElement("div",{className:styles.infoContainerRow},React.createElement("div",{className:styles.quantityContainer},React.createElement(SurroundPortals,{portalName:FAVORITES_QUANTITY,portalProps:commonPortalProps},React.createElement(ItemQuantity,{quantity:internalQuantity,onChange:handleChangeQuantity})),React.createElement(SurroundPortals,{portalName:FAVORITES_PRODUCT_PRICE,portalProps:commonPortalProps},React.createElement("div",{className:styles.priceContainer},hasStrikePrice?React.createElement(PriceStriked,{value:
|
|
14
|
+
,dangerouslySetInnerHTML:{__html:"".concat(product.name)}})))),React.createElement("div",{className:styles.removeContainer},React.createElement(Remove,{onClick:remove}))),React.createElement(ItemCharacteristics,{characteristics:characteristics}),!hasNewServices()?React.createElement(SurroundPortals,{portalName:FAVORITES_AVAILABILITY_TEXT,portalProps:commonPortalProps},React.createElement(AvailableText,{text:commonPortalProps.availability.text,state:commonPortalProps.availability.state,showWhenAvailable:true,className:styles.availability})):React.createElement(StockInfoLists,{product:product}),React.createElement("div",{className:styles.infoContainerRow},React.createElement("div",{className:styles.quantityContainer},React.createElement(SurroundPortals,{portalName:FAVORITES_QUANTITY,portalProps:commonPortalProps},React.createElement(ItemQuantity,{quantity:internalQuantity,onChange:handleChangeQuantity})),React.createElement(SurroundPortals,{portalName:FAVORITES_PRODUCT_PRICE,portalProps:commonPortalProps},React.createElement("div",{className:styles.priceContainer},React.createElement("div",{className:styles.priceContainerInner},hasStrikePrice?React.createElement(PriceStriked,{value:specialPrice,currency:currency}):null,React.createElement(Price,{currency:currency,discounted:hasStrikePrice,unitPrice:price,className:styles.price})),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo})))),React.createElement(SurroundPortals,{portalName:FAVORITES_ADD_TO_CART,portalProps:ctaPortalProps},React.createElement(AddToCart,{onClick:handleAddToCart,isLoading:false,isDisabled:isDisabled,"aria-label":i18n.text('product.add_to_cart')}))),React.createElement(SurroundPortals,{portalName:FAVORITES_NOTES,portalProps:commonPortalProps},React.createElement(ItemNotes,{notes:notes,onClickDeleteComment:handleDeleteComment,onClickOpenComment:handleOpenComment,notesButtonRef:notesButtonRef}))))));};FavoriteItem.defaultProps={isBaseProduct:true,isOrderable:true,isRopeProductOrderable:true,hasVariants:false,notes:undefined,quantity:1};export default connect(makeMapStateToProps,mapDispatchToProps)(FavoriteItem);
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import React,{
|
|
2
|
-
* Favorite List Label component
|
|
3
|
-
* @return {JSX}
|
|
4
|
-
*/var FavoriteListLabel=function FavoriteListLabel(_ref){var id=_ref.id,title=_ref.title,rename=_ref.rename,remove=_ref.remove;return React.createElement(Fragment,null,React.createElement("span",{className:styles.title},title),React.createElement(SurroundPortals,{portalName:FAVORITES_LIST_CONTEXT_MENU,portalProps:{id:id}},React.createElement(ContextMenu,null,React.createElement(ContextMenu.Item,{onClick:rename},i18n.text('favorites.rename_list')),React.createElement(ContextMenu.Item,{onClick:remove,disabled:id==='DEFAULT'},i18n.text('favorites.remove_list')))));};/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";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;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import React,{useState,useEffect,useCallback,useMemo}from'react';import PropTypes from'prop-types';import{connect}from'react-redux';import{showModal}from'@shopgate/engage/core/actions';import{Accordion,Card,ConditionalWrapper}from'@shopgate/engage/components';import{makeGetFavorites,getUseGetFavoriteIdsPipeline}from'@shopgate/pwa-common-commerce/favorites/selectors';import{FAVORITES_SHOW_LIMIT}from'@shopgate/engage/favorites/constants';import ListAccordionLabel from"./ListAccordionLabel";import ListContent from"./ListContent";import styles from"./styles";/**
|
|
5
2
|
* @param {Object} _ State
|
|
6
3
|
* @param {Object} props Props
|
|
7
4
|
* @returns {Object}
|
|
8
|
-
*/var makeMapStateToProps=function makeMapStateToProps(_,
|
|
5
|
+
*/var makeMapStateToProps=function makeMapStateToProps(_,_ref){var id=_ref.id;var getFavorites=makeGetFavorites(function(){return id;});return function(state){return{items:getFavorites(state),useGetFavoriteIdsPipeline:getUseGetFavoriteIdsPipeline(state)};};};/**
|
|
9
6
|
* @param {Object} dispatch Dispatch
|
|
10
7
|
* @param {Object} props The component props
|
|
11
8
|
* @returns {Object}
|
|
12
9
|
*/var mapDispatchToProps=function mapDispatchToProps(dispatch,props){return{remove:function(){var _remove=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(id){var confirmed;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return dispatch(showModal({message:'favorites.delete_list_modal.message',title:'favorites.delete_list_modal.title',params:{name:props.name}}));case 2:confirmed=_context.sent;if(confirmed){props.remove(id);}case 4:case"end":return _context.stop();}},_callee);}));function remove(_x){return _remove.apply(this,arguments);}return remove;}()};};/**
|
|
13
10
|
* Favorite List component
|
|
14
11
|
* @return {JSX}
|
|
15
|
-
*/var FavoriteList=function FavoriteList(
|
|
12
|
+
*/var FavoriteList=function FavoriteList(_ref2){var id=_ref2.id,name=_ref2.name,items=_ref2.items,_rename=_ref2.rename,remove=_ref2.remove,removeItem=_ref2.removeItem,addToCart=_ref2.addToCart,hasMultipleFavoritesListsSupport=_ref2.hasMultipleFavoritesListsSupport,useGetFavoriteIdsPipeline=_ref2.useGetFavoriteIdsPipeline;var _useState=useState(FAVORITES_SHOW_LIMIT),_useState2=_slicedToArray(_useState,2),offset=_useState2[0],setOffset=_useState2[1];var filteredItems=useMemo(function(){/**
|
|
13
|
+
* The getFavoriteIds pipeline doesn't return full products, but only product ids. Product data
|
|
14
|
+
* is selected inside the ListContent component via the ProductProvider. To avoid requests with
|
|
15
|
+
* huge response data, the favlist items are splitted into chunks, so that the ProductProvider
|
|
16
|
+
* only has to request fresh data for each chunk.
|
|
17
|
+
*
|
|
18
|
+
* As long as not all products from the list are shown, a "Load More" button is presented to the
|
|
19
|
+
* user, which will add an additional chunk of product ids to the ListContent component.
|
|
20
|
+
*/if(useGetFavoriteIdsPipeline){return items.slice(0,offset);}// When the getFavorites pipeline is used, no special handling is necessary. "items" can passed
|
|
21
|
+
// the the ListContent component as they are.
|
|
22
|
+
return items;},[items,offset,useGetFavoriteIdsPipeline]);var allFavoritesLoaded=useMemo(function(){if(useGetFavoriteIdsPipeline){return items.length-filteredItems.length>0;}/**
|
|
23
|
+
* In case of getFavorites pipeline is used, and all favorites are always loaded, "false" as
|
|
24
|
+
* return value might seem a bit weird, but the value is actually used to determine if the
|
|
25
|
+
* load more button is supposed to be shown (not needed if all favorites are already present).
|
|
26
|
+
*/return false;},[filteredItems.length,items.length,useGetFavoriteIdsPipeline]);var _useState3=useState(allFavoritesLoaded),_useState4=_slicedToArray(_useState3,2),showLoadMoreButton=_useState4[0],setShowLoadMoreButton=_useState4[1];var handleLoadMore=useCallback(function(){setOffset(offset+FAVORITES_SHOW_LIMIT);},[offset]);useEffect(function(){setShowLoadMoreButton(allFavoritesLoaded);},[offset,allFavoritesLoaded]);return React.createElement(ConditionalWrapper,{condition:hasMultipleFavoritesListsSupport,wrapperFalsy:function wrapperFalsy(children){return React.createElement("div",{className:styles.rootNoFavoritesLists},children);},wrapper:function wrapper(children){return React.createElement(Card,{className:styles.root},React.createElement(Accordion,{className:"",renderLabel:function renderLabel(){return React.createElement(ListAccordionLabel,{id:id,title:name,rename:function rename(newName){return _rename(id,newName);},remove:remove});},chevronPosition:"left",startOpened:true},children));}},React.createElement(ListContent,{listId:id,items:filteredItems,removeItem:removeItem,addToCart:addToCart,onLoadMore:handleLoadMore,showLoadMoreButton:showLoadMoreButton}));};FavoriteList.defaultProps={hasMultipleFavoritesListsSupport:false,useGetFavoriteIdsPipeline:false};export default connect(makeMapStateToProps,mapDispatchToProps)(FavoriteList);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{i18n}from'@shopgate/engage/core/helpers';import{ContextMenu,SurroundPortals}from'@shopgate/engage/components';import{FAVORITES_LIST_CONTEXT_MENU}from"../../constants/Portals";import styles from"./styles";/**
|
|
2
|
+
* Favorite List Label component
|
|
3
|
+
* @return {JSX}
|
|
4
|
+
*/var ListAccordionLabel=function ListAccordionLabel(_ref){var id=_ref.id,title=_ref.title,rename=_ref.rename,remove=_ref.remove;return React.createElement(React.Fragment,null,React.createElement("span",{className:styles.title},title),React.createElement(SurroundPortals,{portalName:FAVORITES_LIST_CONTEXT_MENU,portalProps:{id:id}},React.createElement(ContextMenu,null,React.createElement(ContextMenu.Item,{onClick:rename},i18n.text('favorites.rename_list')),React.createElement(ContextMenu.Item,{onClick:remove,disabled:id==='DEFAULT'},i18n.text('favorites.remove_list')))));};export default ListAccordionLabel;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{connect}from'react-redux';import{i18n}from'@shopgate/engage/core/helpers';import{ProductListTypeProvider,ProductProvider}from'@shopgate/engage/product/providers';import{RippleButton}from'@shopgate/engage/components';import{getUseGetFavoriteIdsPipeline}from'@shopgate/engage/favorites';import ListItemWrapper from"./ListItemWrapper";import styles from"./styles";/**
|
|
2
|
+
* @param {Object} state State
|
|
3
|
+
* @param {Object} props Props
|
|
4
|
+
* @returns {Object}
|
|
5
|
+
*/var mapStateToProps=function mapStateToProps(state,props){return{useGetFavoriteIdsPipeline:getUseGetFavoriteIdsPipeline(state,props)};};/**
|
|
6
|
+
* @param {Object} props The component props
|
|
7
|
+
* @returns {JSX.Element}
|
|
8
|
+
*/var ListContent=function ListContent(_ref){var listId=_ref.listId,items=_ref.items,removeItem=_ref.removeItem,addToCart=_ref.addToCart,useGetFavoriteIdsPipeline=_ref.useGetFavoriteIdsPipeline,showLoadMoreButton=_ref.showLoadMoreButton,onLoadMore=_ref.onLoadMore;return React.createElement(React.Fragment,null,React.createElement("div",{className:styles.divider}),items.length===0?React.createElement("span",null,i18n.text('favorites.empty')):null,React.createElement(ProductListTypeProvider,{type:"favoritesList"},useGetFavoriteIdsPipeline?items.map(function(_ref2,index){var productId=_ref2.productId;return React.createElement(ProductProvider,{productId:productId,key:productId},function(_ref3){var product=_ref3.product;return product?React.createElement(ListItemWrapper,{listId:listId,product:product,items:items,addToCart:addToCart,removeItem:removeItem,index:index,key:product.id}):null;});}):null,!useGetFavoriteIdsPipeline&&items.filter(function(_ref4){var product=_ref4.product;return product;}).map(function(_ref5,index){var product=_ref5.product,notes=_ref5.notes,quantity=_ref5.quantity;return React.createElement(ListItemWrapper,{listId:listId,product:product,notes:notes,quantity:quantity,items:items,addToCart:addToCart,removeItem:removeItem,index:index,key:product.id});})),showLoadMoreButton&&React.createElement(RippleButton,{type:"primary",className:styles.loadMoreButton,onClick:onLoadMore},i18n.text('favorites.load_more_button')));};export default connect(mapStateToProps)(ListContent);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import Item from"../Item";import styles from"./styles";/**
|
|
2
|
+
* Wrapper around the Item component to simplify item rendering based on the two different "items"
|
|
3
|
+
* lists within ListItemContent.
|
|
4
|
+
* @param {Object} props The component props
|
|
5
|
+
* @returns {JSX.Element}
|
|
6
|
+
*/var ListItemWrapper=function ListItemWrapper(_ref){var listId=_ref.listId,product=_ref.product,notes=_ref.notes,quantity=_ref.quantity,_addToCart=_ref.addToCart,removeItem=_ref.removeItem,items=_ref.items,index=_ref.index;return React.createElement("div",null,React.createElement(Item,{product:product,notes:notes,quantity:quantity,listId:listId,productId:product.id,addToCart:function addToCart(e){e.preventDefault();e.stopPropagation();return _addToCart(product,quantity);},remove:function remove(e){e.preventDefault();e.stopPropagation();removeItem(product.id);}}),index===items.length-1?null:React.createElement("div",{className:styles.divider}));};ListItemWrapper.defaultProps={notes:undefined,quantity:1};export default ListItemWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;var styles={root:css({margin:'8px 8px 10px'}).toString(),rootNoFavoritesLists:css({background:colors.light,flexGrow:1,paddingBottom:variables.gap.small,paddingLeft:'16px',paddingRight:'16px'}),title:css({flex:1}),divider:css({height:1,width:'calc(100% + 32px)',backgroundColor:'rgb(234, 234, 234)',marginLeft:-16,marginRight:-16,marginBottom:16}),loadMoreButton:css({width:'calc(100% - 32px)',margin:'16px 16px 0 16px',borderRadius:5}).toString()};export default styles;
|
|
@@ -1,14 +1,14 @@
|
|
|
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;}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,{useState,useCallback,useRef}from'react';import PropTypes from'prop-types';import{connect}from'react-redux';import{css}from'glamor';import{RippleButton,SurroundPortals}from'@shopgate/engage/components';import{hasNewServices}from'@shopgate/engage/core/helpers';import{i18n}from'@shopgate/engage/core';import{
|
|
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;}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,{useState,useCallback,useRef}from'react';import PropTypes from'prop-types';import{connect}from'react-redux';import{css}from'glamor';import{RippleButton,SurroundPortals}from'@shopgate/engage/components';import{hasNewServices}from'@shopgate/engage/core/helpers';import{i18n}from'@shopgate/engage/core';import{getFavoritesLists,isInitialLoading,getHasMultipleFavoritesListsSupport}from'@shopgate/pwa-common-commerce/favorites/selectors';import addFavoritesList from'@shopgate/pwa-common-commerce/favorites/actions/addFavoritesList';import updateFavoritesList from'@shopgate/pwa-common-commerce/favorites/actions/updateFavoritesList';import removeFavoritesList from'@shopgate/pwa-common-commerce/favorites/actions/removeFavoritesList';import{removeFavorites}from'@shopgate/pwa-common-commerce/favorites/actions/toggleFavorites';import addProductsToCart from'@shopgate/pwa-common-commerce/cart/actions/addProductsToCart';import{FulfillmentSheet,MULTI_LINE_RESERVE,STAGE_SELECT_STORE}from'@shopgate/engage/locations';import{openSheet}from'@shopgate/engage/locations/providers/FulfillmentProvider';import{getWishlistMode}from'@shopgate/engage/core/selectors/shopSettings';import{WISHLIST_MODE_PERSIST_ON_ADD}from'@shopgate/engage/core/constants/shopSettings';import{getPreferredLocation,getPreferredFulfillmentMethod,getUserSearch}from'@shopgate/engage/locations/selectors';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{makeGetEnabledFulfillmentMethods}from'@shopgate/engage/core/config';import{fetchProductLocations}from'@shopgate/engage/locations/actions';import List from"../List";import ListsModal from"./ListsModal";import CommentDialog from"../CommentDialog";import ItemFulfillmentMethod from"../ItemFulfillmentMethod";import{FAVORITES_LIST_ADD_BUTTON,FAVORITES_LIST}from"../../constants/Portals";/**
|
|
2
2
|
* @param {Object} state State
|
|
3
3
|
* @param {Object} props Props
|
|
4
4
|
* @returns {Object}
|
|
5
|
-
*/var makeMapStateToProps=function makeMapStateToProps(){var getFulfillmentMethods=makeGetEnabledFulfillmentMethods();return function(state,props){return{isInitializing:isInitialLoading(state),lists:getFavoritesLists(state),preferredLocation:getPreferredLocation(state,props),preferredFulfillmentMethod:getPreferredFulfillmentMethod(state,props),shopFulfillmentMethods:getFulfillmentMethods(state,props),wishlistMode:getWishlistMode(state),userSearch:getUserSearch(state)};};};/**
|
|
5
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getFulfillmentMethods=makeGetEnabledFulfillmentMethods();return function(state,props){return{isInitializing:isInitialLoading(state),lists:getFavoritesLists(state),preferredLocation:getPreferredLocation(state,props),preferredFulfillmentMethod:getPreferredFulfillmentMethod(state,props),shopFulfillmentMethods:getFulfillmentMethods(state,props),wishlistMode:getWishlistMode(state),userSearch:getUserSearch(state),hasMultipleFavoritesListsSupport:getHasMultipleFavoritesListsSupport(state)};};};/**
|
|
6
6
|
* @param {Object} dispatch Dispatch
|
|
7
7
|
* @returns {Object}
|
|
8
8
|
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{addList:function addList(name){return dispatch(addFavoritesList(name));},updateList:function updateList(id,name){return dispatch(updateFavoritesList(id,name));},removeList:function removeList(id){return dispatch(removeFavoritesList(id));},removeItem:function removeItem(listId,productId){return dispatch(removeFavorites(productId,false,listId));},addToCart:function addToCart(){return dispatch(addProductsToCart.apply(void 0,arguments));},fetchLocations:function fetchLocations(productId,params){return dispatch(fetchProductLocations(productId,params));}};};var styles={root:css(_defineProperty({},responsiveMediaQuery('>=md',{webOnly:true}),{margin:8})),addButton:css(_defineProperty({width:'calc(100% - 32px)',margin:16,backgroundColor:'var(--color-primary)',borderRadius:5},responsiveMediaQuery('>=md',{webOnly:true}),{width:240,"float":'right'})).toString()};/**
|
|
9
9
|
* @param {Object} props Props
|
|
10
10
|
* @returns {Object}
|
|
11
|
-
*/var FavoriteLists=function FavoriteLists(_ref){var addList=_ref.addList,updateList=_ref.updateList,removeList=_ref.removeList,_removeItem=_ref.removeItem,addToCart=_ref.addToCart,preferredFulfillmentMethod=_ref.preferredFulfillmentMethod,preferredLocation=_ref.preferredLocation,wishlistMode=_ref.wishlistMode,lists=_ref.lists,isInitializing=_ref.isInitializing,shopFulfillmentMethods=_ref.shopFulfillmentMethods,userSearch=_ref.userSearch,fetchLocations=_ref.fetchLocations;// Add to cart state.
|
|
11
|
+
*/var FavoriteLists=function FavoriteLists(_ref){var addList=_ref.addList,updateList=_ref.updateList,removeList=_ref.removeList,_removeItem=_ref.removeItem,addToCart=_ref.addToCart,preferredFulfillmentMethod=_ref.preferredFulfillmentMethod,preferredLocation=_ref.preferredLocation,wishlistMode=_ref.wishlistMode,lists=_ref.lists,isInitializing=_ref.isInitializing,shopFulfillmentMethods=_ref.shopFulfillmentMethods,userSearch=_ref.userSearch,fetchLocations=_ref.fetchLocations,hasMultipleFavoritesListsSupport=_ref.hasMultipleFavoritesListsSupport;// Add to cart state.
|
|
12
12
|
var promiseRef=useRef(null);var _useState=useState(null),_useState2=_slicedToArray(_useState,2),activeProductId=_useState2[0],setActiveProductId=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),fulfillmentMethods=_useState4[0],setFulfillmentMethods=_useState4[1];var _useState5=useState(null),_useState6=_slicedToArray(_useState5,2),fulfillmentMethod=_useState6[0],setFulfillmentMethod=_useState6[1];var _useState7=useState(false),_useState8=_slicedToArray(_useState7,2),foMethodChooser=_useState8[0],setFOMethodChooser=_useState8[1];var handleAddToCartWithMethod=useCallback(function(method){// Hide modal if visible.
|
|
13
13
|
setFOMethodChooser(false);// Handle cancellation.
|
|
14
14
|
if(!method){return;}setFulfillmentMethod(method);// Direct ship.
|
|
@@ -22,4 +22,4 @@ if(activeFulfillmentMethod&&activeLocation){addToCart([{productId:product.id,qua
|
|
|
22
22
|
setActiveProductId(product.id);if(activeFulfillmentMethod&&!activeLocation){handleAddToCartWithMethod(activeFulfillmentMethod);return promise;}if(!activeFulfillmentMethod&&!activeFulfillmentMethod){// Long path is required <- fo method and location unset.
|
|
23
23
|
setFulfillmentMethods(shopFulfillmentMethods);setFOMethodChooser(true);return promise;}// Short path is required <- fo method is unset.
|
|
24
24
|
setFulfillmentMethods(availableFulfillmentMethods);setFOMethodChooser(true);return promise;},[addToCart,fulfillmentMethod,handleAddToCartWithMethod,preferredFulfillmentMethod,preferredLocation,_removeItem,shopFulfillmentMethods,wishlistMode]);var handleMethodClose=useCallback(function(){setFOMethodChooser(false);promiseRef.current.reject();},[]);// Modal for renaming and adding.
|
|
25
|
-
var _useState9=useState(false),_useState10=_slicedToArray(_useState9,2),modalOpen=_useState10[0],setModalOpen=_useState10[1];var _useState11=useState(null),_useState12=_slicedToArray(_useState11,2),modalType=_useState12[0],setModalType=_useState12[1];var _useState13=useState(null),_useState14=_slicedToArray(_useState13,2),modalTarget=_useState14[0],setModalTarget=_useState14[1];var openAddModal=useCallback(function(){setModalOpen(true);setModalType('add_list');setModalTarget(null);},[]);var openRenameModal=useCallback(function(code){setModalOpen(true);setModalType('rename_list');setModalTarget(code);},[]);var closeModal=useCallback(function(){setModalOpen(false);setModalType(null);setModalTarget(null);},[]);var confirmModal=useCallback(function(name){if(modalType==='add_list'){addList(name);}else if(modalType==='rename_list'){updateList(modalTarget,name);}closeModal();},[addList,closeModal,modalTarget,modalType,updateList]);if(isInitializing){return null;}return React.createElement("div",{className:styles.root},lists.map(function(list){return React.createElement(SurroundPortals,{key:list.id,portalName:FAVORITES_LIST,portalProps:list},React.createElement(List,{id:list.id,name:list.name,rename:openRenameModal,remove:function remove(){return removeList(list.id);},removeItem:function removeItem(productId){return _removeItem(list.id,productId);},addToCart:function addToCart(product,quantity){return handleAddToCart(list.id,product,quantity);}}));}),modalOpen?React.createElement(ListsModal,{type:modalType,onDismiss:closeModal,onConfirm:confirmModal}):null,activeProductId?React.createElement(FulfillmentSheet,{productId:activeProductId,fulfillmentMethod:fulfillmentMethod}):null,React.createElement(CommentDialog,null),React.createElement(ItemFulfillmentMethod,{isOpen:foMethodChooser,methods:fulfillmentMethods,onSelect:handleAddToCartWithMethod,onClose:handleMethodClose}),React.createElement(SurroundPortals,{portalName:FAVORITES_LIST_ADD_BUTTON},
|
|
25
|
+
var _useState9=useState(false),_useState10=_slicedToArray(_useState9,2),modalOpen=_useState10[0],setModalOpen=_useState10[1];var _useState11=useState(null),_useState12=_slicedToArray(_useState11,2),modalType=_useState12[0],setModalType=_useState12[1];var _useState13=useState(null),_useState14=_slicedToArray(_useState13,2),modalTarget=_useState14[0],setModalTarget=_useState14[1];var openAddModal=useCallback(function(){setModalOpen(true);setModalType('add_list');setModalTarget(null);},[]);var openRenameModal=useCallback(function(code){setModalOpen(true);setModalType('rename_list');setModalTarget(code);},[]);var closeModal=useCallback(function(){setModalOpen(false);setModalType(null);setModalTarget(null);},[]);var confirmModal=useCallback(function(name){if(modalType==='add_list'){addList(name);}else if(modalType==='rename_list'){updateList(modalTarget,name);}closeModal();},[addList,closeModal,modalTarget,modalType,updateList]);if(isInitializing){return null;}return React.createElement("div",{className:styles.root},lists.map(function(list){return React.createElement(SurroundPortals,{key:list.id,portalName:FAVORITES_LIST,portalProps:list},React.createElement(List,{id:list.id,name:list.name,rename:openRenameModal,remove:function remove(){return removeList(list.id);},removeItem:function removeItem(productId){return _removeItem(list.id,productId);},addToCart:function addToCart(product,quantity){return handleAddToCart(list.id,product,quantity);},hasMultipleFavoritesListsSupport:hasMultipleFavoritesListsSupport}));}),modalOpen?React.createElement(ListsModal,{type:modalType,onDismiss:closeModal,onConfirm:confirmModal}):null,activeProductId?React.createElement(FulfillmentSheet,{productId:activeProductId,fulfillmentMethod:fulfillmentMethod}):null,React.createElement(CommentDialog,null),React.createElement(ItemFulfillmentMethod,{isOpen:foMethodChooser,methods:fulfillmentMethods,onSelect:handleAddToCartWithMethod,onClose:handleMethodClose}),React.createElement(SurroundPortals,{portalName:FAVORITES_LIST_ADD_BUTTON},hasMultipleFavoritesListsSupport?React.createElement(RippleButton,{type:"primary",className:styles.addButton,onClick:openAddModal,disabled:false},i18n.text('favorites.add_list')):null));};FavoriteLists.defaultProps={lists:[],userSearch:{},preferredFulfillmentMethod:null,shopFulfillmentMethods:[],preferredLocation:null,isInitializing:true};export default connect(makeMapStateToProps,mapDispatchToProps)(FavoriteLists);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}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,{useState,useCallback}from'react';import PropTypes from'prop-types';import{Dialog,TextField}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{themeName}from'@shopgate/pwa-common/helpers/config';import{css}from'glamor';var isIos=themeName.includes('ios');var styles={root:css({display:'flex',flexDirection:'column'}),input:css({textAlign:'left',fontSize:'1rem'}).toString()};/**
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}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,{useState,useCallback,useMemo}from'react';import PropTypes from'prop-types';import{hasNewServices}from'@shopgate/engage/core/helpers';import{Dialog,TextField}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{themeName}from'@shopgate/pwa-common/helpers/config';import{css}from'glamor';var isIos=themeName.includes('ios');var styles={root:css({display:'flex',flexDirection:'column'}),input:css({textAlign:'left',fontSize:'1rem'}).toString()};/**
|
|
2
2
|
* @param {Object} props Props
|
|
3
3
|
* @returns {Object}
|
|
4
|
-
*/var ListsModal=function ListsModal(_ref){var type=_ref.type,onConfirm=_ref.onConfirm,onDismiss=_ref.onDismiss;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),input=_useState2[0],setInput=_useState2[1];var _useState3=useState(null),_useState4=_slicedToArray(_useState3,2),error=_useState4[0],setError=_useState4[1];var onConfirmWrapped=useCallback(function(){if(input.length===0){setError(i18n.text('favorites.errors.invalid_name'));return;}onConfirm(input);},[input,onConfirm]);var onChange=useCallback(function(value){setInput(value);},[])
|
|
4
|
+
*/var ListsModal=function ListsModal(_ref){var type=_ref.type,onConfirm=_ref.onConfirm,onDismiss=_ref.onDismiss;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),input=_useState2[0],setInput=_useState2[1];var _useState3=useState(null),_useState4=_slicedToArray(_useState3,2),error=_useState4[0],setError=_useState4[1];var onConfirmWrapped=useCallback(function(){if(input.length===0){setError(i18n.text('favorites.errors.invalid_name'));return;}onConfirm(input);},[input,onConfirm]);var onChange=useCallback(function(value){setInput(value);},[]);// Favorites list name was restricted to 25 characters on PWA6 in CCP-2535
|
|
5
|
+
var textFieldMaxLength=useMemo(function(){return!hasNewServices()?'25':undefined;},[]);return React.createElement(Dialog,{onConfirm:onConfirmWrapped,onDismiss:onDismiss,modal:{title:i18n.text("favorites.".concat(type,"_modal.title")),dismiss:i18n.text("favorites.".concat(type,"_modal.dismiss")),confirm:i18n.text("favorites.".concat(type,"_modal.confirm"))}},React.createElement("div",{className:styles.root},React.createElement("span",null,i18n.text("favorites.".concat(type,"_modal.message"))),React.createElement(TextField,_extends({name:"name"},isIos?{placeholder:i18n.text("favorites.".concat(type,"_modal.label"))}:{label:i18n.text("favorites.".concat(type,"_modal.label"))},{maxLength:textFieldMaxLength,onChange:onChange,value:input,errorText:error||undefined,className:styles.input}))));};export default ListsModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./Portals";export var FAVORITES_SHOW_LIMIT=10;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as fetchFilters}from'@shopgate/pwa-common-commerce/filter/actions/fetchFilters';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as FilterItem}from"./FilterItem";export{default as PriceSlider}from"./PriceSlider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SORT_ORDER_RELEVANCE,SORT_ORDER_PRICE_ASC,SORT_ORDER_PRICE_DESC,SORT_ORDER_NAME_ASC,SORT_ORDER_NAME_DESC,SORT_ORDER_RANK_ASC,SORT_ORDER_RANK_DESC,SORT_SCOPE_CATEGORY,SORT_SCOPE_SEARCH}from"./sort";
|
|
1
|
+
export*from'@shopgate/pwa-common-commerce/filter/constants/index';export*from'@shopgate/pwa-common-commerce/filter/constants/Pipelines';export*from'@shopgate/pwa-common-commerce/filter/constants/Portals';export{SORT_ORDER_RELEVANCE,SORT_ORDER_PRICE_ASC,SORT_ORDER_PRICE_DESC,SORT_ORDER_NAME_ASC,SORT_ORDER_NAME_DESC,SORT_ORDER_RANK_ASC,SORT_ORDER_RANK_DESC,SORT_SCOPE_CATEGORY,SORT_SCOPE_SEARCH}from"./sort";
|