@shopgate/engage 7.29.9-beta.1 → 7.29.9-beta.2

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.
@@ -1 +1 @@
1
- import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables,colors=themeConfig.colors;export var IMAGE_SPACE=72;var item=css({margin:"0 ".concat(variables.gap.big,"px"),cursor:'pointer'}).toString();var itemNotLast=css({'&:not(:last-child)':{boxShadow:"0 1px 0 0 ".concat(colors.darkGray),marginBottom:1}}).toString();var itemSelected=css({background:"var(--color-background-accent, ".concat(colors.shade7,")"),boxShadow:"-".concat(variables.gap.bigger,"px 0 0 var(--color-background-accent, ").concat(colors.shade7,"), ").concat(variables.gap.bigger,"px 0 0 var(--color-background-accent, ").concat(colors.shade7,")"),marginTop:-1}).toString();var itemWithImage=css({marginLeft:IMAGE_SPACE}).toString();var innerContainer=css({minHeight:56,position:'relative'}).toString();export default{item:item,itemNotLast:itemNotLast,itemSelected:itemSelected,itemWithImage:itemWithImage,innerContainer:innerContainer};
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/engage';var variables=themeConfig.variables,colors=themeConfig.colors;export var IMAGE_SPACE=72;var item=css({margin:"0 ".concat(variables.gap.big,"px"),cursor:'pointer'}).toString();var itemNotLast=css({'&:not(:last-child)':{boxShadow:"0 1px 0 0 ".concat(colors.darkGray),marginBottom:1}}).toString();var itemSelected=css({background:"var(--color-background-accent, ".concat(colors.shade7,")"),boxShadow:"-".concat(variables.gap.bigger,"px 0 0 var(--color-background-accent, ").concat(colors.shade7,"), ").concat(variables.gap.bigger,"px 0 0 var(--color-background-accent, ").concat(colors.shade7,")"),marginTop:-1}).toString();var itemWithImage=css({marginLeft:IMAGE_SPACE}).toString();var innerContainer=css({minHeight:56,position:'relative'}).toString();export default{item:item,itemNotLast:itemNotLast,itemSelected:itemSelected,itemWithImage:itemWithImage,innerContainer:innerContainer};
@@ -18,7 +18,7 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
18
18
  */function componentDidMount(){var _this3=this;var scrollTop=this.context.state.scrollTop;// This trick ensures the scroll position is restored correctly. Without it there where
19
19
  // situations where scroll position was restored before the content was rendered.
20
20
  // In that case restoration didn't have any effect.
21
- window.requestAnimationFrame(function(){if(_this3.ref.current===window){window.scrollTo(0,scrollTop||0);}else{_this3.ref.current.scrollTop=scrollTop;}});}/**
21
+ window.requestAnimationFrame(function(){var _this3$ref$current;if(_this3.ref.current===window){window.scrollTo(0,scrollTop||0);}else if((_this3$ref$current=_this3.ref.current)===null||_this3$ref$current===void 0?void 0:_this3$ref$current.scrollTop){_this3.ref.current.scrollTop=scrollTop||0;}});}/**
22
22
  * Removes the keyboardWillChange listener.
23
23
  */},{key:"componentWillUnmount",value:function componentWillUnmount(){var scrollTop;if(this.ref.current===window){scrollTop=window.scrollY;}else{scrollTop=this.ref.current.scrollTop;}router.update(this.context.id,{scrollTop:scrollTop},false);event.removeCallback(EVENT_KEYBOARD_WILL_CHANGE,this.handleKeyboardChange);if(isIOs){window.removeEventListener('focusin',this.handleInputFocusChange);window.removeEventListener('focusout',this.handleInputFocusChange);}}/**
24
24
  * @returns {Object}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.29.9-beta.1",
3
+ "version": "7.29.9-beta.2",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -17,12 +17,12 @@
17
17
  "dependencies": {
18
18
  "@emotion/react": "^11.14.0",
19
19
  "@shopgate/native-modules": "1.0.0-beta.25",
20
- "@shopgate/pwa-common": "7.29.9-beta.1",
21
- "@shopgate/pwa-common-commerce": "7.29.9-beta.1",
22
- "@shopgate/pwa-core": "7.29.9-beta.1",
23
- "@shopgate/pwa-ui-ios": "7.29.9-beta.1",
24
- "@shopgate/pwa-ui-material": "7.29.9-beta.1",
25
- "@shopgate/pwa-ui-shared": "7.29.9-beta.1",
20
+ "@shopgate/pwa-common": "7.29.9-beta.2",
21
+ "@shopgate/pwa-common-commerce": "7.29.9-beta.2",
22
+ "@shopgate/pwa-core": "7.29.9-beta.2",
23
+ "@shopgate/pwa-ui-ios": "7.29.9-beta.2",
24
+ "@shopgate/pwa-ui-material": "7.29.9-beta.2",
25
+ "@shopgate/pwa-ui-shared": "7.29.9-beta.2",
26
26
  "@stripe/react-stripe-js": "^1.16.5",
27
27
  "@stripe/stripe-js": "^1.3.1",
28
28
  "@virtuous/conductor": "~2.5.0",
@@ -10,4 +10,4 @@ router.update(routeId,_defineProperty({},code,stateToPersist));}},[code,remember
10
10
  * @param {Object} subcategory The subcategory entity which was selected.
11
11
  */var handleSelection=useCallback(function(categoryId,subcategory){var _updatedPickers;var subcategoryId=subcategory.id,childrenCount=subcategory.childrenCount;var selectedIndex=state.pickers.findIndex(function(picker){return picker.categoryId===categoryId;});// Get all pickers up to the selected picker and update its selectedId
12
12
  var updatedPickers=state.pickers.slice(0,selectedIndex+1);updatedPickers[updatedPickers.length-1].selectedId=subcategoryId;// Check if a new picker should be added
13
- var limitReached=((_updatedPickers=updatedPickers)===null||_updatedPickers===void 0?void 0:_updatedPickers.length)===Number(maxDepth);var appendNewPicker=!!childrenCount&&!limitReached;if(appendNewPicker){updatedPickers=updatedPickers.concat([{categoryId:subcategoryId,selectedId:null}]);}setState({pickers:updatedPickers,buttonCategoryId:!appendNewPicker?subcategoryId:null});},[maxDepth,state]);var categoryPickers=useMemo(function(){return React.createElement(React.Fragment,null,state.pickers.slice(0,maxDepth).map(function(entry,index){var categoryId=entry.categoryId,selectedId=entry.selectedId;return React.createElement(CategoryPicker,{key:"".concat(categoryId,"-").concat(code),categoryId:categoryId,selectedId:selectedId,onSelect:handleSelection,label:labels["level".concat(index+1,"Label")]||''});}));},[code,handleSelection,labels,maxDepth,state.pickers]);return React.createElement("div",{className:classes.container},showHeadline&&headline?React.createElement(WidgetHeadline,{headline:headline,className:"widget__nested-category-filter__headline"}):null,categoryPickers,React.createElement("div",{className:cx(classes.buttonContainer,'widget__nested-category-filter__button-container')},React.createElement(ButtonLink,{className:cx(classes.button,'widget__nested-category-filter__CTA-button'),href:"".concat(CATEGORY_PATH,"/").concat(bin2hex(state.buttonCategoryId)),disabled:!state.buttonCategoryId,flat:false},React.createElement(I18n.Text,{string:"common.show_products",className:"widget__nested-category-filter__CTA-button__text"}))));};export default NestedCategoryFilter;
13
+ var limitReached=((_updatedPickers=updatedPickers)===null||_updatedPickers===void 0?void 0:_updatedPickers.length)===Number(maxDepth);var appendNewPicker=!!childrenCount&&!limitReached;if(appendNewPicker){updatedPickers=updatedPickers.concat([{categoryId:subcategoryId,selectedId:null}]);}setState({pickers:updatedPickers,buttonCategoryId:!appendNewPicker?subcategoryId:null});},[maxDepth,state]);var categoryPickers=useMemo(function(){return React.createElement(React.Fragment,null,state.pickers.slice(0,maxDepth).map(function(entry,index){var categoryId=entry.categoryId,selectedId=entry.selectedId;return React.createElement(CategoryPicker,{key:"".concat(categoryId,"-").concat(code),categoryId:categoryId,selectedId:selectedId,onSelect:handleSelection,label:labels["level".concat(index+1,"Label")]||''});}));},[code,handleSelection,labels,maxDepth,state.pickers]);return React.createElement("div",{className:cx(classes.container,'widget__nested-category-filter__container')},showHeadline&&headline?React.createElement(WidgetHeadline,{headline:headline,className:"widget__nested-category-filter__headline"}):null,categoryPickers,React.createElement("div",{className:cx(classes.buttonContainer,'widget__nested-category-filter__button-container')},React.createElement(ButtonLink,{className:cx(classes.button,'widget__nested-category-filter__CTA-button'),href:"".concat(CATEGORY_PATH,"/").concat(bin2hex(state.buttonCategoryId)),disabled:!state.buttonCategoryId,flat:false},React.createElement(I18n.Text,{string:"common.show_products",className:"widget__nested-category-filter__CTA-button__text"}))));};export default NestedCategoryFilter;
@@ -1,4 +1,4 @@
1
- import React,{useCallback}from'react';import PropTypes from'prop-types';import{SheetDrawer,SheetList}from'@shopgate/engage/components';import Item from"../SheetItem";/**
1
+ import React,{useCallback}from'react';import PropTypes from'prop-types';import{SheetDrawer,SheetList}from'@shopgate/engage/components';import{makeStyles}from'@shopgate/engage/styles';import Item from"../SheetItem";var useStyles=makeStyles()({sheetList:{'& li':{margin:0}}});/**
2
2
  * The CategorySheet component.
3
3
  * @param {Object} props The component props.
4
4
  * @param {Array} props.items The list of items to display.
@@ -8,4 +8,4 @@ import React,{useCallback}from'react';import PropTypes from'prop-types';import{S
8
8
  * @param {Function} props.onSelect The selection handler.
9
9
  * @param {string} props.selectedId The currently selected item id.
10
10
  * @return {JSX.Element}
11
- */var CategorySheet=function CategorySheet(_ref){var items=_ref.items,label=_ref.label,onClose=_ref.onClose,open=_ref.open,selectedId=_ref.selectedId,onSelect=_ref.onSelect;var handleItemClick=useCallback(function(event){event.stopPropagation();onSelect(event.target.value);},[onSelect]);return React.createElement(SheetDrawer,{title:label,isOpen:open,onClose:onClose},React.createElement(SheetList,{className:"widget__nested-category-filter__sheet-list"},items.map(function(item){return React.createElement(Item,{item:item,key:item.id,onClick:handleItemClick,isSelected:item.id===selectedId});})));};CategorySheet.defaultProps={onClose:function onClose(){},onSelect:function onSelect(){},selectedId:null};export default CategorySheet;
11
+ */var CategorySheet=function CategorySheet(_ref){var items=_ref.items,label=_ref.label,onClose=_ref.onClose,open=_ref.open,selectedId=_ref.selectedId,onSelect=_ref.onSelect;var _useStyles=useStyles(),classes=_useStyles.classes;var handleItemClick=useCallback(function(event){event.stopPropagation();onSelect(event.target.value);},[onSelect]);return React.createElement(SheetDrawer,{title:label,isOpen:open,onClose:onClose},React.createElement(SheetList,{className:"widget__nested-category-filter__sheet-list ".concat(classes.sheetList)},items.map(function(item){return React.createElement(Item,{item:item,key:item.id,onClick:handleItemClick,isSelected:item.id===selectedId});})));};CategorySheet.defaultProps={onClose:function onClose(){},onSelect:function onSelect(){},selectedId:null};export default CategorySheet;
@@ -1,4 +1,4 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React from'react';import PropTypes from'prop-types';import{makeStyles}from'@shopgate/engage/styles';import{themeConfig}from'@shopgate/engage';var colors=themeConfig.colors,variables=themeConfig.variables;var bgColor=colors.darkGray;var boxShadowOffset=variables.gap.bigger;var useStyles=makeStyles()({button:{outline:0,padding:'16px 16px 16px 0',textAlign:'left',width:'100%',color:'var(--color-text-high-emphasis)'},buttonSelected:{background:"var(--color-background-accent, ".concat(bgColor,")"),boxShadow:"-".concat(boxShadowOffset,"px 0px 0px var(--color-background-accent, ").concat(bgColor,"), ").concat(boxShadowOffset,"px 0px 0px var(--color-background-accent,").concat(bgColor,")"),margin:'-1px 0',paddingTop:17,paddingBottom:17}});/**
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React from'react';import PropTypes from'prop-types';import{makeStyles}from'@shopgate/engage/styles';import{themeConfig}from'@shopgate/engage';var colors=themeConfig.colors,variables=themeConfig.variables;var bgColor=colors.darkGray;var boxShadowOffset=variables.gap.bigger;var useStyles=makeStyles()({button:{outline:0,padding:16,textAlign:'left',width:'100%',color:'var(--color-text-high-emphasis)'},buttonSelected:{background:"var(--color-background-accent, ".concat(bgColor,")"),boxShadow:"-".concat(boxShadowOffset,"px 0px 0px var(--color-background-accent, ").concat(bgColor,"), ").concat(boxShadowOffset,"px 0px 0px var(--color-background-accent,").concat(bgColor,")"),margin:'-1px 0',paddingTop:17,paddingBottom:17}});/**
2
2
  * The SheetItem component.
3
3
  * @param {Object} props The component props.
4
4
  * @param {Object} props.item The item data.