@shopgate/engage 7.20.0-beta.1 → 7.20.0-beta.10

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.
Files changed (140) hide show
  1. package/account/actions/addContacts.js +1 -1
  2. package/account/actions/deleteContact.js +1 -1
  3. package/account/actions/deleteCustomer.js +1 -1
  4. package/account/actions/fetchContacts.js +1 -1
  5. package/account/actions/fetchCustomer.js +1 -1
  6. package/account/actions/updateContact.js +1 -1
  7. package/account/actions/updateCustomer.js +1 -1
  8. package/account/components/Account/Account.js +1 -1
  9. package/account/reducers/index.js +2 -2
  10. package/cart/cart.helpers.js +8 -1
  11. package/cart/components/CartItem/CartItemProductLayout.js +2 -1
  12. package/cart/index.js +2 -1
  13. package/cart/streams/index.js +1 -0
  14. package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +1 -1
  15. package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +1 -1
  16. package/checkout/components/index.js +1 -1
  17. package/checkout/constants/index.js +1 -1
  18. package/checkout/index.js +3 -4
  19. package/checkout/paymentMethods/stripe/sdk.js +3 -2
  20. package/components/ChipLayout/style.js +2 -2
  21. package/components/ConditionalWrapper/ConditionalWrapper.js +7 -2
  22. package/components/QuantityInput/QuantityInput.js +5 -4
  23. package/components/ResponsiveContainer/ResponsiveContainer.js +2 -6
  24. package/components/ResponsiveContainer/breakpoints.js +2 -1
  25. package/components/ResponsiveContainer/hooks.js +20 -0
  26. package/components/ScrollHeader/index.js +2 -2
  27. package/components/ScrollHeader/style.js +1 -1
  28. package/core/constants/index.js +1 -1
  29. package/core/helpers/appFeatures.js +2 -1
  30. package/core/helpers/i18n.js +1 -1
  31. package/core/helpers/index.js +1 -1
  32. package/core/hooks/index.js +1 -1
  33. package/core/streams/index.js +1 -1
  34. package/core/subscriptions/app.js +2 -2
  35. package/favorites/components/Item/Item.js +6 -6
  36. package/favorites/components/List/List.js +17 -6
  37. package/favorites/components/List/ListAccordionLabel.js +4 -0
  38. package/favorites/components/List/ListContent.js +8 -0
  39. package/favorites/components/List/ListItemWrapper.js +6 -0
  40. package/favorites/components/List/styles.js +1 -0
  41. package/favorites/components/Lists/Lists.js +4 -4
  42. package/favorites/components/Lists/ListsModal.js +3 -2
  43. package/favorites/constants/index.js +1 -0
  44. package/filter/actions/index.js +1 -0
  45. package/filter/components/PriceSlider/style.js +1 -3
  46. package/filter/components/index.js +1 -0
  47. package/filter/constants/index.js +1 -1
  48. package/filter/helpers/buildInitialFilters.js +1 -1
  49. package/filter/helpers/translateFilterLabel.js +3 -3
  50. package/filter/index.js +2 -7
  51. package/filter/selectors/index.js +1 -1
  52. package/filter/streams/index.js +1 -0
  53. package/i18n/locale/cs-cz/countries.json +255 -0
  54. package/i18n/locale/de-de/countries.json +26 -28
  55. package/i18n/locale/el-gr/countries.json +255 -0
  56. package/i18n/locale/en-us/countries.json +12 -14
  57. package/i18n/locale/es-es/countries.json +65 -67
  58. package/i18n/locale/fi-fi/countries.json +255 -0
  59. package/i18n/locale/fr-fr/countries.json +85 -87
  60. package/i18n/locale/hu-hu/countries.json +255 -0
  61. package/i18n/locale/it-it/countries.json +11 -13
  62. package/i18n/locale/nl-nl/countries.json +42 -44
  63. package/i18n/locale/pl-pl/countries.json +255 -0
  64. package/i18n/locale/pt-pt/countries.json +128 -130
  65. package/i18n/locale/ro-ro/countries.json +255 -0
  66. package/i18n/locale/sv-se/countries.json +255 -0
  67. package/locations/action-creators/receiveInventories.js +3 -5
  68. package/locations/components/StoreList/StoreListSearch.js +3 -1
  69. package/locations/subscriptions.js +2 -2
  70. package/orders/index.js +1 -1
  71. package/package.json +7 -7
  72. package/page/selectors/index.js +7 -1
  73. package/product/components/Options/components/Content/spec.js +1 -1
  74. package/product/components/ProductSlider/index.js +1 -1
  75. package/product/components/QuantityPicker/hooks.js +5 -0
  76. package/product/components/QuantityPicker/index.js +2 -2
  77. package/product/components/Rating/spec.js +1 -1
  78. package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +2 -2
  79. package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -2
  80. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +6 -3
  81. package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +7 -0
  82. package/product/components/UnitQuantityPicker/index.js +1 -1
  83. package/product/components/index.js +1 -1
  84. package/product/providers/ProductListType/context.js +2 -1
  85. package/product/providers/ProductListType/index.js +2 -1
  86. package/product/providers/index.js +1 -1
  87. package/product/selectors/product.js +12 -2
  88. package/push-opt-in/components/PushOptInModal/index.js +5 -6
  89. package/push-opt-in/subscriptions/optInTrigger.js +3 -5
  90. package/registration/components/index.js +1 -0
  91. package/registration/index.js +1 -1
  92. package/registration/streams/index.js +4 -0
  93. package/registration/subscriptions/index.js +4 -4
  94. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/style.js +1 -2
  95. package/reviews/components/Reviews/components/RatingCount/style.js +1 -2
  96. package/reviews/index.js +3 -1
  97. package/styles/helpers/initCSSCustomProperties.js +2 -2
  98. package/styles/helpers/loadCustomStyles.js +2 -2
  99. package/styles/helpers/setPageBackgroundColor.js +2 -1
  100. package/tracking/action-creators/cookieConsent.js +24 -0
  101. package/tracking/action-creators/index.js +1 -4
  102. package/tracking/actions/cookieConsent.js +21 -0
  103. package/tracking/actions/index.js +1 -0
  104. package/tracking/components/CookieConsentModal/connector.js +6 -0
  105. package/tracking/components/CookieConsentModal/index.js +9 -0
  106. package/tracking/components/CookieConsentModal/style.js +1 -0
  107. package/tracking/components/CookieConsentModal/tracking-opt-in.svg +18 -0
  108. package/tracking/components/PrivacySettings/connector.js +6 -0
  109. package/tracking/components/PrivacySettings/index.js +4 -0
  110. package/tracking/components/PrivacySettings/style.js +1 -0
  111. package/tracking/components/index.js +1 -1
  112. package/tracking/constants/index.js +0 -1
  113. package/tracking/reducers/cookieConsentModal.js +6 -0
  114. package/tracking/reducers/cookieSettings.js +6 -0
  115. package/tracking/reducers/index.js +1 -0
  116. package/tracking/selectors/cookieConsent.js +35 -0
  117. package/tracking/selectors/index.js +1 -4
  118. package/tracking/streams/cookieConsent.js +46 -0
  119. package/tracking/streams/index.js +1 -1
  120. package/tracking/subscriptions/analytics.js +11 -0
  121. package/tracking/subscriptions/cookieConsent.js +13 -0
  122. package/tracking/subscriptions/index.js +1 -4
  123. package/user/index.js +1 -1
  124. package/i18n/locale/ru-ru/countries.json +0 -251
  125. package/product/components/QuantityPicker/helpers.js +0 -5
  126. package/tracking/components/CookieConsent/CookieConsent.connector.js +0 -4
  127. package/tracking/components/CookieConsent/CookieConsent.js +0 -4
  128. package/tracking/components/CookieConsent/CookieConsentButtons.js +0 -3
  129. package/tracking/components/CookieConsent/CookieConsentCheckboxes.js +0 -3
  130. package/tracking/components/CookieConsent/CookieConsentContent.js +0 -4
  131. package/tracking/components/CookieConsent/CookieConsentMessage.js +0 -4
  132. package/tracking/components/CookieConsent/index.js +0 -1
  133. package/tracking/helpers/index.js +0 -7
  134. package/tracking/hooks/index.js +0 -4
  135. package/tracking/index.js +0 -1
  136. package/tracking/providers/CookieConsentProvider.connector.js +0 -4
  137. package/tracking/providers/CookieConsentProvider.context.js +0 -1
  138. package/tracking/providers/CookieConsentProvider.js +0 -8
  139. /package/product/{components/ProductProvider → providers/Product}/connector.js +0 -0
  140. /package/product/{components/ProductProvider → providers/Product}/index.js +0 -0
@@ -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,{Fragment}from'react';import PropTypes from'prop-types';import{connect}from'react-redux';import{css}from'glamor';import{i18n,showModal}from'@shopgate/engage/core';import{Accordion,Card,ContextMenu,SurroundPortals}from'@shopgate/engage/components';import{ProductListTypeProvider}from'@shopgate/engage/product';import{makeGetFavorites}from'@shopgate/pwa-common-commerce/favorites/selectors';import{FAVORITES_LIST_CONTEXT_MENU}from"../../constants/Portals";import Item from"../Item";var styles={root:css({margin:'8px 8px 10px'}).toString(),title:css({flex:1}).toString(),divider:css({height:1,width:'calc(100% + 32px)',backgroundColor:'rgb(234, 234, 234)',marginLeft:-16,marginRight:-16,marginBottom:16}).toString()};/**
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(_,_ref2){var id=_ref2.id;var getFavorites=makeGetFavorites(function(){return id;});return function(state){return{items:getFavorites(state)};};};/**
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(_ref3){var id=_ref3.id,name=_ref3.name,items=_ref3.items,_rename=_ref3.rename,remove=_ref3.remove,removeItem=_ref3.removeItem,_addToCart=_ref3.addToCart;return React.createElement(Card,{className:styles.root},React.createElement(Accordion,{className:"",openWithChevron:true,renderLabel:function renderLabel(){return React.createElement(FavoriteListLabel,{id:id,title:name,rename:function rename(newName){return _rename(id,newName);},remove:remove});},chevronPosition:"left",startOpened:true},React.createElement("div",{className:styles.divider}),items.length===0?React.createElement("span",null,i18n.text('favorites.empty')):null,React.createElement(ProductListTypeProvider,{type:"favoritesList"},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("div",{key:product.id},React.createElement(Item,{product:product,notes:notes,quantity:quantity,listId:id,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}));}))));};export default connect(makeMapStateToProps,mapDispatchToProps)(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{appConfig}from'@shopgate/engage';import{getFavoritesLists,isInitialLoading}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";var _appConfig$favoritesM=appConfig.favoritesMode,_appConfig$favoritesM2=_appConfig$favoritesM===void 0?{}:_appConfig$favoritesM,hasMultipleFavoritesLists=_appConfig$favoritesM2.hasMultipleFavoritesLists;/**
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},hasNewServices()||hasMultipleFavoritesLists?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);
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);},[]);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"))},{onChange:onChange,value:input,errorText:error||undefined,className:styles.input}))));};export default ListsModal;
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';
@@ -1,3 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from"../../../styles";var shadows=themeConfig.shadows,colors=themeConfig.colors,variables=themeConfig.variables;var wrapper=css({padding:"".concat(variables.gap.big*0.75,"px ").concat(variables.gap.big,"px")}).toString();var price=css({// Before the custom properties the accent color was used for this class.
2
- color:"var(--color-primary, ".concat(colors.accent,")"),display:'inline-block',fontWeight:500,textAlign:'center'}).toString();var editableContainer=css({position:'relative'});var editableField=css(_defineProperty({position:'absolute',top:0,left:0,textAlign:'center',background:'transparent',zIndex:2,textIndent:-800,outline:'none',padding:0,margin:0,border:'1px solid transparent',borderRadius:3,lineHeight:1,':focus':{background:colors.light,textIndent:0,borderColor:colors.shade5}},responsiveMediaQuery('>=xs',{webOnly:true}),{borderColor:'var(--color-primary)',padding:'4px 0',top:-4,':focus':{borderColor:'var(--color-primary)'}}));var rangeSlider={container:css({paddingTop:variables.gap.big,paddingBottom:variables.gap.big}).toString(),outerRange:css({background:colors.darkGray,height:8,position:'relative'}).toString(),range:css({// Before the custom properties the accent color was used for this class.
3
- background:"var(--color-primary, ".concat(colors.accent,")"),position:'absolute',height:'100%',marginLeft:variables.gap.small,marginRight:variables.gap.small}).toString(),handleInner:css({background:colors.light,boxShadow:shadows.filter.priceSlider,borderRadius:'50%',width:variables.gap.big*1.5,height:variables.gap.big*1.5}).toString(),handleOuter:css({}).toString()};var srOnly=css({position:'absolute',width:1,height:1,padding:0,margin:-1,overflow:'hidden',clip:'rect(0, 0, 0, 0)',whiteSpace:'nowrap',border:0});export default{wrapper:wrapper,price:price,rangeSlider:rangeSlider,editableContainer:editableContainer,editableField:editableField,srOnly:srOnly};
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from"../../../styles";var shadows=themeConfig.shadows,colors=themeConfig.colors,variables=themeConfig.variables;var wrapper=css({padding:"".concat(variables.gap.big*0.75,"px ").concat(variables.gap.big,"px")}).toString();var price=css({color:"var(--color-secondary, ".concat(colors.accent,")"),display:'inline-block',fontWeight:500,textAlign:'center'}).toString();var editableContainer=css({position:'relative'});var editableField=css(_defineProperty({position:'absolute',top:0,left:0,textAlign:'center',background:'transparent',zIndex:2,textIndent:-800,outline:'none',padding:0,margin:0,border:'1px solid transparent',borderRadius:3,lineHeight:1,':focus':{background:colors.light,textIndent:0,borderColor:colors.shade5}},responsiveMediaQuery('>=xs',{webOnly:true}),{borderColor:'var(--color-primary)',padding:'4px 0',top:-4,':focus':{borderColor:'var(--color-primary)'}}));var rangeSlider={container:css({paddingTop:variables.gap.big,paddingBottom:variables.gap.big}).toString(),outerRange:css({background:colors.darkGray,height:8,position:'relative'}).toString(),range:css({background:"var(--color-secondary, ".concat(colors.accent,")"),position:'absolute',height:'100%',marginLeft:variables.gap.small,marginRight:variables.gap.small}).toString(),handleInner:css({background:colors.light,boxShadow:shadows.filter.priceSlider,borderRadius:'50%',width:variables.gap.big*1.5,height:variables.gap.big*1.5}).toString(),handleOuter:css({}).toString()};var srOnly=css({position:'absolute',width:1,height:1,padding:0,margin:-1,overflow:'hidden',clip:'rect(0, 0, 0, 0)',whiteSpace:'nowrap',border:0});export default{wrapper:wrapper,price:price,rangeSlider:rangeSlider,editableContainer:editableContainer,editableField:editableField,srOnly:srOnly};
@@ -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";
@@ -1,4 +1,4 @@
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);}import{FILTER_TYPE_RANGE}from'@shopgate/engage/filter';/**
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);}import{FILTER_TYPE_RANGE}from'@shopgate/engage/filter/constants';/**
2
2
  * @param {Object} filters The available filters.
3
3
  * @param {Object} activeFilters The selected filters.
4
4
  * @returns {Object}
@@ -1,6 +1,6 @@
1
1
  import{i18n}from"../../core/helpers/i18n";/**
2
2
  * Translate filter label
3
- * @param {Object} id filter id.
4
- * @param {Object} label filter label.
5
- * @returns {Object}
3
+ * @param {string} id filter id.
4
+ * @param {string} label filter label.
5
+ * @returns {string}
6
6
  */export function translateFilterLabel(id,label){return i18n.textWithDefault("filter.label.".concat(id),label);}
package/filter/index.js CHANGED
@@ -1,7 +1,2 @@
1
- /** @module filter */ // ACTIONS
2
- export{default as fetchFilters}from'@shopgate/pwa-common-commerce/filter/actions/fetchFilters';// CONSTANTS
3
- 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';// SELECTORS
4
- export*from'@shopgate/pwa-common-commerce/filter/selectors';// STREAMS
5
- export*from'@shopgate/pwa-common-commerce/filter/streams';// COMPONENTS
6
- export{default as FilterItem}from"./components/FilterItem";export{default as PriceSlider}from"./components/PriceSlider";// HELPERS
7
- export*from"./helpers";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"./constants";export{makeExtendedSortOptionsSupported,makeGetDefaultSortOrder}from"./selectors";export{SortProvider}from"./providers";export{withSort}from"./hocs";export{useSort}from"./hooks";
1
+ /** @module filter */export*from"./actions";export*from"./components";export*from"./constants";export*from"./helpers";export*from"./hocs";export*from"./hooks";export*from"./providers";export*from"./selectors";// eslint-disable-next-line import/export
2
+ export*from"./streams";
@@ -1,4 +1,4 @@
1
- import{createSelector}from'reselect';import{SORT_RELEVANCE}from'@shopgate/pwa-common/constants/DisplayOptions';import{SHOP_SETTING_PRODUCTS_SORT_ORDER}from"../../core/constants";import{SORT_ORDER_RANK_DESC,SORT_SCOPE_CATEGORY,SORT_SCOPE_SEARCH,SORT_ORDER_NAME_ASC,isSortOrderSupported,mapSortOrderFromShopSettings}from"../constants/sort";import{makeGetShopSettingByKey}from"../../core/selectors/shopSettings";/**
1
+ import{createSelector}from'reselect';import{SORT_RELEVANCE}from'@shopgate/pwa-common/constants/DisplayOptions';import{SHOP_SETTING_PRODUCTS_SORT_ORDER}from"../../core/constants";import{SORT_ORDER_RANK_DESC,SORT_SCOPE_CATEGORY,SORT_SCOPE_SEARCH,SORT_ORDER_NAME_ASC,isSortOrderSupported,mapSortOrderFromShopSettings}from"../constants/sort";import{makeGetShopSettingByKey}from"../../core/selectors/shopSettings";export*from'@shopgate/pwa-common-commerce/filter/selectors';/**
2
2
  * Tries to determine the sort scope by selector props.
3
3
  * @param {Object} props Selector props.
4
4
  * @returns {string}
@@ -0,0 +1 @@
1
+ export*from'@shopgate/pwa-common-commerce/filter/streams';
@@ -0,0 +1,255 @@
1
+ {
2
+ "AF": "Afghánistán",
3
+ "AX": "Ålandy",
4
+ "AL": "Albánie",
5
+ "DZ": "Alžírsko",
6
+ "AS": "Americká Samoa",
7
+ "VI": "Americké Panenské ostrovy",
8
+ "AD": "Andorra",
9
+ "AO": "Angola",
10
+ "AI": "Anguilla",
11
+ "AQ": "Antarktida",
12
+ "AG": "Antigua a Barbuda",
13
+ "AR": "Argentina",
14
+ "AM": "Arménie",
15
+ "AW": "Aruba",
16
+ "AC": "Ascension",
17
+ "AU": "Austrálie",
18
+ "AZ": "Ázerbájdžán",
19
+ "BS": "Bahamy",
20
+ "BH": "Bahrajn",
21
+ "BD": "Bangladéš",
22
+ "BB": "Barbados",
23
+ "BE": "Belgie",
24
+ "BZ": "Belize",
25
+ "BY": "Bělorusko",
26
+ "BJ": "Benin",
27
+ "BM": "Bermudy",
28
+ "BT": "Bhútán",
29
+ "BO": "Bolívie",
30
+ "BA": "Bosna a Hercegovina",
31
+ "BW": "Botswana",
32
+ "BR": "Brazílie",
33
+ "IO": "Britské indickooceánské území",
34
+ "VG": "Britské Panenské ostrovy",
35
+ "BN": "Brunej",
36
+ "BG": "Bulharsko",
37
+ "BF": "Burkina Faso",
38
+ "BI": "Burundi",
39
+ "TD": "Čad",
40
+ "ME": "Černá Hora",
41
+ "CZ": "Česko",
42
+ "EA": "Ceuta a Melilla",
43
+ "CL": "Chile",
44
+ "HR": "Chorvatsko",
45
+ "CN": "Čína",
46
+ "CK": "Cookovy ostrovy",
47
+ "CW": "Curaçao",
48
+ "DK": "Dánsko",
49
+ "DG": "Diego Garcia",
50
+ "DM": "Dominika",
51
+ "DO": "Dominikánská republika",
52
+ "DJ": "Džibutsko",
53
+ "EG": "Egypt",
54
+ "EC": "Ekvádor",
55
+ "ER": "Eritrea",
56
+ "EE": "Estonsko",
57
+ "SZ": "Eswatini",
58
+ "ET": "Etiopie",
59
+ "FO": "Faerské ostrovy",
60
+ "FK": "Falklandy",
61
+ "FJ": "Fidži",
62
+ "PH": "Filipíny",
63
+ "FI": "Finsko",
64
+ "FR": "Francie",
65
+ "GF": "Francouzská Guyana",
66
+ "TF": "Francouzská jižní území",
67
+ "PF": "Francouzská Polynésie",
68
+ "GA": "Gabon",
69
+ "GM": "Gambie",
70
+ "GH": "Ghana",
71
+ "GI": "Gibraltar",
72
+ "GD": "Grenada",
73
+ "GL": "Grónsko",
74
+ "GE": "Gruzie",
75
+ "GP": "Guadeloupe",
76
+ "GU": "Guam",
77
+ "GT": "Guatemala",
78
+ "GG": "Guernsey",
79
+ "GN": "Guinea",
80
+ "GW": "Guinea-Bissau",
81
+ "GY": "Guyana",
82
+ "HT": "Haiti",
83
+ "HN": "Honduras",
84
+ "HK": "Hongkong",
85
+ "IN": "Indie",
86
+ "ID": "Indonésie",
87
+ "IQ": "Irák",
88
+ "IR": "Írán",
89
+ "IE": "Irsko",
90
+ "IS": "Island",
91
+ "IT": "Itálie",
92
+ "IL": "Izrael",
93
+ "JM": "Jamajka",
94
+ "JP": "Japonsko",
95
+ "YE": "Jemen",
96
+ "JE": "Jersey",
97
+ "ZA": "Jihoafrická republika",
98
+ "GS": "Jižní Georgie a Jižní Sandwichovy ostrovy",
99
+ "KR": "Jižní Korea",
100
+ "SS": "Jižní Súdán",
101
+ "JO": "Jordánsko",
102
+ "KY": "Kajmanské ostrovy",
103
+ "KH": "Kambodža",
104
+ "CM": "Kamerun",
105
+ "CA": "Kanada",
106
+ "IC": "Kanárské ostrovy",
107
+ "CV": "Kapverdy",
108
+ "BQ": "Karibské Nizozemí",
109
+ "QA": "Katar",
110
+ "KZ": "Kazachstán",
111
+ "KE": "Keňa",
112
+ "KI": "Kiribati",
113
+ "CC": "Kokosové ostrovy",
114
+ "CO": "Kolumbie",
115
+ "KM": "Komory",
116
+ "CG": "Kongo - Brazzaville",
117
+ "CD": "Kongo - Kinshasa",
118
+ "XK": "Kosovo",
119
+ "CR": "Kostarika",
120
+ "CU": "Kuba",
121
+ "KW": "Kuvajt",
122
+ "CY": "Kypr",
123
+ "KG": "Kyrgyzstán",
124
+ "LA": "Laos",
125
+ "LS": "Lesotho",
126
+ "LB": "Libanon",
127
+ "LR": "Libérie",
128
+ "LY": "Libye",
129
+ "LI": "Lichtenštejnsko",
130
+ "LT": "Litva",
131
+ "LV": "Lotyšsko",
132
+ "LU": "Lucembursko",
133
+ "MO": "Macao",
134
+ "MG": "Madagaskar",
135
+ "HU": "Maďarsko",
136
+ "MY": "Malajsie",
137
+ "MW": "Malawi",
138
+ "MV": "Maledivy",
139
+ "ML": "Mali",
140
+ "MT": "Malta",
141
+ "MA": "Maroko",
142
+ "MH": "Marshallovy ostrovy",
143
+ "MQ": "Martinik",
144
+ "MU": "Mauricius",
145
+ "MR": "Mauritánie",
146
+ "YT": "Mayotte",
147
+ "UM": "Menší odlehlé ostrovy USA",
148
+ "MX": "Mexiko",
149
+ "FM": "Mikronésie",
150
+ "MD": "Moldavsko",
151
+ "MC": "Monako",
152
+ "MN": "Mongolsko",
153
+ "MS": "Montserrat",
154
+ "MZ": "Mosambik",
155
+ "MM": "Myanmar (Barma)",
156
+ "NA": "Namibie",
157
+ "NR": "Nauru",
158
+ "DE": "Německo",
159
+ "NP": "Nepál",
160
+ "NE": "Niger",
161
+ "NG": "Nigérie",
162
+ "NI": "Nikaragua",
163
+ "NU": "Niue",
164
+ "NL": "Nizozemsko",
165
+ "NF": "Norfolkovy ostrovy",
166
+ "NO": "Norsko",
167
+ "NC": "Nová Kaledonie",
168
+ "NZ": "Nový Zéland",
169
+ "OM": "Omán",
170
+ "IM": "Ostrov Man",
171
+ "PK": "Pákistán",
172
+ "PW": "Palau",
173
+ "PS": "Palestinská území",
174
+ "PA": "Panama",
175
+ "PG": "Papua-Nová Guinea",
176
+ "PY": "Paraguay",
177
+ "PE": "Peru",
178
+ "PN": "Pitcairnovy ostrovy",
179
+ "CI": "Pobřeží slonoviny",
180
+ "PL": "Polsko",
181
+ "PR": "Portoriko",
182
+ "PT": "Portugalsko",
183
+ "AT": "Rakousko",
184
+ "GR": "Řecko",
185
+ "RE": "Réunion",
186
+ "GQ": "Rovníková Guinea",
187
+ "RO": "Rumunsko",
188
+ "RU": "Rusko",
189
+ "RW": "Rwanda",
190
+ "SB": "Šalamounovy ostrovy",
191
+ "SV": "Salvador",
192
+ "WS": "Samoa",
193
+ "SM": "San Marino",
194
+ "SA": "Saúdská Arábie",
195
+ "SN": "Senegal",
196
+ "KP": "Severní Korea",
197
+ "MK": "Severní Makedonie",
198
+ "MP": "Severní Mariany",
199
+ "SC": "Seychely",
200
+ "SL": "Sierra Leone",
201
+ "SG": "Singapur",
202
+ "SK": "Slovensko",
203
+ "SI": "Slovinsko",
204
+ "SO": "Somálsko",
205
+ "ES": "Španělsko",
206
+ "SJ": "Špicberky a Jan Mayen",
207
+ "AE": "Spojené arabské emiráty",
208
+ "GB": "Spojené království",
209
+ "US": "Spojené státy",
210
+ "RS": "Srbsko",
211
+ "LK": "Srí Lanka",
212
+ "CF": "Středoafrická republika",
213
+ "SD": "Súdán",
214
+ "SR": "Surinam",
215
+ "SH": "Svatá Helena",
216
+ "LC": "Svatá Lucie",
217
+ "BL": "Svatý Bartoloměj",
218
+ "KN": "Svatý Kryštof a Nevis",
219
+ "SX": "Svatý Martin",
220
+ "MF": "Svatý Martin",
221
+ "PM": "Svatý Pierre a Miquelon",
222
+ "ST": "Svatý Tomáš a Princův ostrov",
223
+ "VC": "Svatý Vincenc a Grenadiny",
224
+ "SE": "Švédsko",
225
+ "CH": "Švýcarsko",
226
+ "SY": "Sýrie",
227
+ "TJ": "Tádžikistán",
228
+ "TZ": "Tanzanie",
229
+ "TW": "Tchaj-wan",
230
+ "TH": "Thajsko",
231
+ "TG": "Togo",
232
+ "TK": "Tokelau",
233
+ "TO": "Tonga",
234
+ "TT": "Trinidad a Tobago",
235
+ "TA": "Tristan da Cunha",
236
+ "TN": "Tunisko",
237
+ "TR": "Turecko",
238
+ "TM": "Turkmenistán",
239
+ "TC": "Turks a Caicos",
240
+ "TV": "Tuvalu",
241
+ "UG": "Uganda",
242
+ "UA": "Ukrajina",
243
+ "UY": "Uruguay",
244
+ "UZ": "Uzbekistán",
245
+ "CX": "Vánoční ostrov",
246
+ "VU": "Vanuatu",
247
+ "VA": "Vatikán",
248
+ "VE": "Venezuela",
249
+ "VN": "Vietnam",
250
+ "TL": "Východní Timor",
251
+ "WF": "Wallis a Futuna",
252
+ "ZM": "Zambie",
253
+ "EH": "Západní Sahara",
254
+ "ZW": "Zimbabwe"
255
+ }