@shopgate/engage 6.21.0-rc.4 → 6.21.0

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.
@@ -2,7 +2,7 @@ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeo
2
2
  * The ViewContent component.
3
3
  */var ViewContent=/*#__PURE__*/function(_Component){_inherits(ViewContent,_Component);var _super=_createSuper(ViewContent);/**
4
4
  * @param {Object} props The component props.
5
- */function ViewContent(props){var _this;_classCallCheck(this,ViewContent);_this=_super.call(this,props);_defineProperty(_assertThisInitialized(_this),"handleKeyboardChange",function(_ref){var open=_ref.open,overlap=_ref.overlap;var height=open?overlap:0;if(_this.props.visible&&height!==_this.state.keyboardHeight){_this.setState({keyboardHeight:height});}});_defineProperty(_assertThisInitialized(_this),"handleSwipe",function(e,x,y,isFlick,velocity){var swipeEvent=new CustomEvent('swipe',{detail:{event:e,x:x,y:y,isFlick:isFlick,velocity:velocity}});_this.ref.current.dispatchEvent(swipeEvent);});_this.ref=/*#__PURE__*/React.createRef();_this.state={keyboardHeight:0};_this.props.setContentRef(_this.ref);event.addCallback(EVENT_KEYBOARD_WILL_CHANGE,_this.handleKeyboardChange);return _this;}/**
5
+ */function ViewContent(props){var _this;_classCallCheck(this,ViewContent);_this=_super.call(this,props);_defineProperty(_assertThisInitialized(_this),"handleKeyboardChange",function(_ref){var open=_ref.open,overlap=_ref.overlap;if(_this.props.noKeyboardListener){return;}var height=open?overlap:0;if(_this.props.visible&&height!==_this.state.keyboardHeight){_this.setState({keyboardHeight:height});}});_defineProperty(_assertThisInitialized(_this),"handleSwipe",function(e,x,y,isFlick,velocity){var swipeEvent=new CustomEvent('swipe',{detail:{event:e,x:x,y:y,isFlick:isFlick,velocity:velocity}});_this.ref.current.dispatchEvent(swipeEvent);});_this.ref=/*#__PURE__*/React.createRef();_this.state={keyboardHeight:0};_this.props.setContentRef(_this.ref);event.addCallback(EVENT_KEYBOARD_WILL_CHANGE,_this.handleKeyboardChange);return _this;}/**
6
6
  * @param {Object} props The component props.
7
7
  * @param {Object} state The component state.
8
8
  * @returns {Object}
@@ -18,4 +18,4 @@ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeo
18
18
  * @param {boolean} overlap The height of the keyboard.
19
19
  */},{key:"render",value:/**
20
20
  * @return {JSX}
21
- */function render(){return/*#__PURE__*/React.createElement(Swipeable,{onSwiped:this.handleSwipe,flickThreshold:0.6,delta:10},/*#__PURE__*/React.createElement("article",{className:"".concat(styles," engage__view__content ").concat(this.props.className),ref:this.ref,style:this.style},/*#__PURE__*/React.createElement(Helmet,{title:appConfig.shopName}),/*#__PURE__*/React.createElement(Above,null),/*#__PURE__*/React.createElement(ConditionalWrapper,{condition:!this.props.noContentPortal,wrapper:function wrapper(children){return/*#__PURE__*/React.createElement(SurroundPortals,{portalName:VIEW_CONTENT},children);}},this.props.children),/*#__PURE__*/React.createElement(Below,null)));}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(props,state){if(props.visible||state.keyboardHeight===0){return null;}return{keyboardHeight:0};}}]);return ViewContent;}(Component);_defineProperty(ViewContent,"contextType",RouteContext);_defineProperty(ViewContent,"defaultProps",{className:'',children:null,noScrollOnKeyboard:false,noContentPortal:false});export default(function(props){return/*#__PURE__*/React.createElement(RouteContext.Consumer,null,function(_ref2){var visible=_ref2.visible,_ref2$pattern=_ref2.pattern,pattern=_ref2$pattern===void 0?'':_ref2$pattern;return/*#__PURE__*/React.createElement(ViewContent,_extends({},props,{visible:visible,className:"route_".concat(pattern.replace(/[:/]/g,'_'))}));});});
21
+ */function render(){return/*#__PURE__*/React.createElement(Swipeable,{onSwiped:this.handleSwipe,flickThreshold:0.6,delta:10},/*#__PURE__*/React.createElement("article",{className:"".concat(styles," engage__view__content ").concat(this.props.className),ref:this.ref,style:this.style},/*#__PURE__*/React.createElement(Helmet,{title:appConfig.shopName}),/*#__PURE__*/React.createElement(Above,null),/*#__PURE__*/React.createElement(ConditionalWrapper,{condition:!this.props.noContentPortal,wrapper:function wrapper(children){return/*#__PURE__*/React.createElement(SurroundPortals,{portalName:VIEW_CONTENT},children);}},this.props.children),/*#__PURE__*/React.createElement(Below,null)));}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(props,state){if(props.visible||state.keyboardHeight===0){return null;}return{keyboardHeight:0};}}]);return ViewContent;}(Component);_defineProperty(ViewContent,"contextType",RouteContext);_defineProperty(ViewContent,"defaultProps",{className:'',children:null,noScrollOnKeyboard:false,noContentPortal:false,noKeyboardListener:false});export default(function(props){return/*#__PURE__*/React.createElement(RouteContext.Consumer,null,function(_ref2){var visible=_ref2.visible,_ref2$pattern=_ref2.pattern,pattern=_ref2$pattern===void 0?'':_ref2$pattern;return/*#__PURE__*/React.createElement(ViewContent,_extends({},props,{visible:visible,className:"route_".concat(pattern.replace(/[:/]/g,'_'))}));});});
@@ -3,7 +3,7 @@ export{ViewContext};/**
3
3
  * The View container component.
4
4
  * @param {Object} props The component props.
5
5
  * @return {JSX}
6
- */function ViewContainer(_ref){var background=_ref.background,children=_ref.children,noScrollOnKeyboard=_ref.noScrollOnKeyboard,visible=_ref.visible,ariaHidden=_ref['aria-hidden'],noContentPortal=_ref.noContentPortal;if(visible){setBackgroundColor(background);}var style={display:visible?'block':'none'};return/*#__PURE__*/React.createElement(ViewProvider,null,/*#__PURE__*/React.createElement(ViewContext.Consumer,null,function(_ref2){var setContentRef=_ref2.setContentRef,ariaHiddenContext=_ref2.ariaHidden;return/*#__PURE__*/React.createElement("section",{className:"".concat(styles," engage__view"),style:style,"aria-hidden":ariaHidden||ariaHiddenContext},/*#__PURE__*/React.createElement(Content,{noScrollOnKeyboard:noScrollOnKeyboard,setContentRef:setContentRef,noContentPortal:noContentPortal},children));}));}ViewContainer.defaultProps={'aria-hidden':true,background:colors.light,children:null,noScrollOnKeyboard:false,noContentPortal:false};/**
6
+ */function ViewContainer(_ref){var background=_ref.background,children=_ref.children,noScrollOnKeyboard=_ref.noScrollOnKeyboard,visible=_ref.visible,ariaHidden=_ref['aria-hidden'],noContentPortal=_ref.noContentPortal,noKeyboardListener=_ref.noKeyboardListener;if(visible){setBackgroundColor(background);}var style={display:visible?'block':'none'};return/*#__PURE__*/React.createElement(ViewProvider,null,/*#__PURE__*/React.createElement(ViewContext.Consumer,null,function(_ref2){var setContentRef=_ref2.setContentRef,ariaHiddenContext=_ref2.ariaHidden;return/*#__PURE__*/React.createElement("section",{className:"".concat(styles," engage__view"),style:style,"aria-hidden":ariaHidden||ariaHiddenContext},/*#__PURE__*/React.createElement(Content,{noScrollOnKeyboard:noScrollOnKeyboard,noKeyboardListener:noKeyboardListener,setContentRef:setContentRef,noContentPortal:noContentPortal},children));}));}ViewContainer.defaultProps={'aria-hidden':true,background:colors.light,children:null,noScrollOnKeyboard:false,noContentPortal:false,noKeyboardListener:false};/**
7
7
  * @param {Object} props The component props.
8
8
  * @returns {JSX}
9
9
  */export default function View(props){return/*#__PURE__*/React.createElement(RouteContext.Consumer,null,function(_ref3){var visible=_ref3.visible;return/*#__PURE__*/React.createElement(ViewContainer,_extends({},props,{visible:visible}));});}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "6.21.0-rc.4",
3
+ "version": "6.21.0",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -15,12 +15,12 @@
15
15
  "connect"
16
16
  ],
17
17
  "dependencies": {
18
- "@shopgate/pwa-common": "6.21.0-rc.4",
19
- "@shopgate/pwa-common-commerce": "6.21.0-rc.4",
20
- "@shopgate/pwa-core": "6.21.0-rc.4",
21
- "@shopgate/pwa-ui-ios": "6.21.0-rc.4",
22
- "@shopgate/pwa-ui-material": "6.21.0-rc.4",
23
- "@shopgate/pwa-ui-shared": "6.21.0-rc.4",
18
+ "@shopgate/pwa-common": "6.21.0",
19
+ "@shopgate/pwa-common-commerce": "6.21.0",
20
+ "@shopgate/pwa-core": "6.21.0",
21
+ "@shopgate/pwa-ui-ios": "6.21.0",
22
+ "@shopgate/pwa-ui-material": "6.21.0",
23
+ "@shopgate/pwa-ui-shared": "6.21.0",
24
24
  "@virtuous/conductor": "~2.4.0",
25
25
  "babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
26
26
  "babel-plugin-transform-es3-property-literals": "^6.8.0",