@shopgate/pwa-common 7.29.1-beta.1 → 7.30.0-alpha.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.
package/App.js CHANGED
@@ -1,4 +1,7 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}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);});};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}import React,{Component}from'react';import PropTypes from'prop-types';import{Provider}from'react-redux';import{CookiesProvider}from'react-cookie';import{loadCustomStyles}from'@shopgate/engage/styles';import ErrorBoundary from"./components/ErrorBoundary";import{appDidStart}from"./action-creators/app";import I18n from"./components/I18n";import{getIsSessionExpired}from"./selectors/user";import logout from"./actions/user/logout";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}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);});};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}import React,{Component}from'react';import PropTypes from'prop-types';import{Provider}from'react-redux';import{CookiesProvider}from'react-cookie';import{loadCustomStyles}from'@shopgate/engage/styles';import{isDev}from"./helpers/environment";import ErrorBoundary from"./components/ErrorBoundary";import{appDidStart}from"./action-creators/app";import I18n from"./components/I18n";import{getIsSessionExpired}from"./selectors/user";import logout from"./actions/user/logout";// Suppress specific console logs in development mode
2
+ if(isDev){var filters=[// tss-react / emotion SSR warning - we don't care since we don't use SSR
3
+ 'is potentially unsafe when doing server-side rendering. Try changing it to',// Webpack warning about named imports from JSON files - we already see it in the terminal
4
+ 'from default-exporting module (only default export is available soon)'];var originalError=console.error;var originalWarn=console.warn;console.error=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}var msg=args.join(' ');if(filters.some(function(f){return msg.includes(f);}))return;originalError.apply(void 0,args);};console.warn=function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}var msg=args.join(' ');if(filters.some(function(f){return msg.includes(f);}))return;originalWarn.apply(void 0,args);};}/**
2
5
  * The application component.
3
6
  * It sets up the store and the react router. The router's children (routes) come from
4
7
  * the theme's Main.jsx file which uses this component as the root element.
@@ -1,25 +1,9 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}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,{Component}from'react';import PropTypes from'prop-types';import Transition from'react-inline-transition-group';import{toggleBodyScroll}from'@shopgate/engage/styles/helpers';import style from"./style";/**
2
- * Backdrop component.
3
- */var Backdrop=/*#__PURE__*/function(_Component){/**
4
- * @param {Object} props The component props
5
- */function Backdrop(props){var _this2;_classCallCheck(this,Backdrop);_this2=_callSuper(this,Backdrop,[props]);_this2.bodyScrollRef=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);return _this2;}/**
6
- * Sets the initial state for the body scroll lock
7
- */_inherits(Backdrop,_Component);return _createClass(Backdrop,[{key:"componentDidMount",value:function componentDidMount(){var _this$props=this.props,isVisible=_this$props.isVisible,lockBodyScroll=_this$props.lockBodyScroll;if(lockBodyScroll){toggleBodyScroll(isVisible,this.bodyScrollRef);}}/**
8
- * Toggles the body scroll lock when the visibility state changes
9
- * @param {Object} nextProps The next component props
10
- */},{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(nextProps){var isVisible=nextProps.isVisible,lockBodyScroll=nextProps.lockBodyScroll;if(isVisible===this.props.isVisible){return;}if(lockBodyScroll){toggleBodyScroll(isVisible,this.bodyScrollRef);}}/**
11
- * Only update when the `isVisible` prop changes.
12
- * @param {Object} nextProps The next set of component props.
13
- * @return {boolean}
14
- */},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(nextProps){return this.props.isVisible!==nextProps.isVisible;}/**
15
- * Removes the body scroll lock when the component unmounts
16
- */},{key:"componentWillUnmount",value:function componentWillUnmount(){var lockBodyScroll=this.props.lockBodyScroll;if(lockBodyScroll){toggleBodyScroll(false,this.bodyScrollRef);}}/**
17
- * Renders the component.
18
- * @returns {JSX}
19
- */},{key:"render",value:function render(){var opacity=this.props.opacity/100;var transition={base:{background:this.props.color,opacity:0,transition:"opacity ".concat(this.props.duration,"ms ease-out"),zIndex:this.props.level,pointerEvents:'auto'},appear:{opacity:opacity,pointerEvents:'auto'},enter:{opacity:opacity,pointerEvents:'auto'},leave:{opacity:0,pointerEvents:'none'}};var className="".concat(style," ").concat(this.props.className," common__backdrop");return React.createElement(Transition,{childrenStyles:transition},this.props.isVisible?React.createElement("div",{"data-test-id":"Backdrop",key:"backdrop","aria-hidden":true,className:className,onClick:this.props.onClick}):null);}}]);}(Component);/**
20
- * The component prop types.
21
- * @type {Object}
22
- */ /**
23
- * The component default props.
24
- * @type {Object}
25
- */_defineProperty(Backdrop,"defaultProps",{className:'',color:'#000',duration:200,isVisible:false,level:2,onClick:function onClick(){},opacity:50,lockBodyScroll:true});export default Backdrop;
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 React,{useEffect,useMemo,useRef}from'react';import PropTypes from'prop-types';import{Transition}from'react-transition-group';import{toggleBodyScroll}from'@shopgate/engage/styles/helpers';import style from"./style";/**
2
+ * Backdrop component
3
+ * @param {Object} props The component props.
4
+ * @returns {JSX.Element}
5
+ */function Backdrop(_ref){var className=_ref.className,color=_ref.color,duration=_ref.duration,isVisible=_ref.isVisible,level=_ref.level,lockBodyScroll=_ref.lockBodyScroll,onClick=_ref.onClick,opacity=_ref.opacity;// Stable id for body scroll lock
6
+ var bodyScrollRef=useRef(Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2));var nodeRef=useRef(null);// Lock / unlock body scroll based on visibility
7
+ useEffect(function(){if(!lockBodyScroll)return undefined;var refId=bodyScrollRef.current;toggleBodyScroll(isVisible,refId);return function(){toggleBodyScroll(false,refId);};},[isVisible,lockBodyScroll]);var baseStyle=useMemo(function(){return{background:color,zIndex:level,transition:"opacity ".concat(duration,"ms ease-out"),// start hidden by default; pointer events only when shown
8
+ opacity:0,pointerEvents:'none'};},[color,level,duration]);var targetOpacity=useMemo(function(){return opacity/100;},[opacity]);// Map Transition states to inline styles (equivalent to your old childrenStyles)
9
+ var transitionStyles=useMemo(function(){return{entering:{opacity:targetOpacity,pointerEvents:'auto'},entered:{opacity:targetOpacity,pointerEvents:'auto'},exiting:{opacity:0,pointerEvents:'none'},exited:{opacity:0,pointerEvents:'none'},unmounted:{opacity:0,pointerEvents:'none'}};},[targetOpacity]);var combinedClassName="".concat(style," ").concat(className," common__backdrop");return React.createElement(Transition,{"in":isVisible,timeout:duration,mountOnEnter:true,unmountOnExit:true,appear:true,nodeRef:nodeRef},function(state){return React.createElement("div",{ref:nodeRef,"data-test-id":"Backdrop","aria-hidden":true,className:combinedClassName,onClick:onClick,style:_extends({},baseStyle,{},transitionStyles[state])});});}Backdrop.defaultProps={className:'',color:'#000',duration:200,isVisible:false,level:2,onClick:function onClick(){},opacity:50,lockBodyScroll:true};export default React.memo(Backdrop,function(prev,next){return prev.isVisible===next.isVisible&&prev.className===next.className&&prev.color===next.color&&prev.duration===next.duration&&prev.level===next.level&&prev.lockBodyScroll===next.lockBodyScroll&&prev.opacity===next.opacity&&prev.onClick===next.onClick;});
@@ -1 +1 @@
1
- import React from'react';import{shallow}from'enzyme';import Backdrop from"./index";describe('<Backdrop />',function(){var mockOpen;beforeEach(function(){mockOpen=jest.fn();});it('should render',function(){var wrapper=shallow(React.createElement(Backdrop,{isVisible:true}));expect(wrapper).toMatchSnapshot();});it('should execute callback when Backdrop is clicked',function(){var wrapper=shallow(React.createElement(Backdrop,{isVisible:true,onClick:mockOpen}));wrapper.find('div').simulate('click');expect(mockOpen).toBeCalled();});});
1
+ import React from'react';import{shallow,mount}from'enzyme';import Backdrop from"./index";describe('<Backdrop />',function(){var mockOpen;beforeEach(function(){mockOpen=jest.fn();});it('should render',function(){var wrapper=shallow(React.createElement(Backdrop,{isVisible:true}));expect(wrapper).toMatchSnapshot();});it('should execute callback when Backdrop is clicked',function(){var wrapper=mount(React.createElement(Backdrop,{isVisible:true,onClick:mockOpen}));wrapper.find('div').simulate('click');expect(mockOpen).toBeCalled();});});
@@ -1,4 +1,5 @@
1
- var _excluded=["children","className"];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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React from'react';import PropTypes from'prop-types';import classNames from'classnames';import{SwiperSlide}from'swiper/swiper-react';import{item}from"./styles";/**
1
+ var _excluded=["children","className"];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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React from'react';import PropTypes from'prop-types';import classNames from'classnames';// eslint-disable-next-line import/no-unresolved
2
+ import{SwiperSlide}from'swiper/react';import{item}from"./styles";/**
2
3
  * @typedef {import('swiper/react').SwiperSlideProps} SwiperSlideProps
3
4
  */ /**
4
5
  * The basic swiper item component.
@@ -1,4 +1,4 @@
1
- var _excluded=["maxIndicators","indicators","controls","aria-hidden","disabled","autoPlay","interval","classNames","className","onSlideChange","onBreakpoint","additionalModules","loop","children","paginationType"];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);}function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useMemo,useCallback,useEffect,useRef,useState}from'react';import PropTypes from'prop-types';import cls from'classnames';import{A11y,Autoplay,FreeMode,Navigation,Pagination,Zoom}from'swiper/modules';import'swiper/swiper.min.css';import'swiper/modules/a11y.min.css';import'swiper/modules/pagination.min.css';import'swiper/modules/navigation.min.css';import'swiper/modules/zoom.min.css';import{useReduceMotion}from'@shopgate/engage/a11y/hooks';import SwiperItem from"./components/SwiperItem";import OriginalSwiper from"./components/OriginalSwiper";import{container,innerContainer,zoomFix,buttonNext,buttonPrev}from"./styles";/**
1
+ var _excluded=["maxIndicators","indicators","controls","aria-hidden","disabled","autoPlay","interval","classNames","className","onSlideChange","onBreakpoint","additionalModules","loop","children","paginationType"];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);}function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}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 _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useMemo,useCallback,useEffect,useRef,useState}from'react';import PropTypes from'prop-types';import cls from'classnames';import{A11y,Autoplay,FreeMode,Navigation,Pagination,Zoom}from'swiper/modules';/* eslint-disable import/no-unresolved */import{Swiper as OriginalSwiper}from'swiper/react';import'swiper/css';import'swiper/css/a11y';import'swiper/css/pagination';import'swiper/css/navigation';import'swiper/css/zoom';/* eslint-enable import/no-unresolved */import{useReduceMotion}from'@shopgate/engage/a11y/hooks';import SwiperItem from"./components/SwiperItem";import{container,innerContainer,zoomFix,buttonNext,buttonPrev}from"./styles";/**
2
2
  * @typedef {import('swiper/react').SwiperProps} SwiperCmpProps
3
3
  */ /**
4
4
  * @typedef {import('swiper/react').SwiperClass} SwiperClass
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common",
3
- "version": "7.29.1-beta.1",
3
+ "version": "7.30.0-alpha.2",
4
4
  "description": "Common library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@redux-devtools/extension": "^3.3.0",
19
19
  "@sentry/browser": "6.0.1",
20
- "@shopgate/pwa-benchmark": "7.29.1-beta.1",
20
+ "@shopgate/pwa-benchmark": "7.30.0-alpha.2",
21
21
  "@virtuous/conductor": "~2.5.0",
22
22
  "@virtuous/react-conductor": "~2.5.0",
23
23
  "@virtuous/redux-persister": "1.1.0-beta.7",
@@ -27,11 +27,10 @@
27
27
  "gsap": "^3.6.0",
28
28
  "history": "^4.9.0",
29
29
  "intl-messageformat": "^7.8.3",
30
- "jsdom": "11.1.0",
30
+ "jsdom": "11.12.0",
31
31
  "path-match": "^1.2.4",
32
32
  "react-dotdotdot": "~1.3.0",
33
- "react-helmet": "^5.1.3",
34
- "react-inline-transition-group": "^2.2.1",
33
+ "react-helmet": "^6.1.0",
35
34
  "react-portal": "^3.1.0",
36
35
  "react-redux": "^8.1.3",
37
36
  "redux": "^4.2.1",
@@ -43,9 +42,9 @@
43
42
  "url-search-params": "^0.10.0"
44
43
  },
45
44
  "devDependencies": {
46
- "@shopgate/pwa-core": "7.29.1-beta.1",
45
+ "@shopgate/pwa-core": "7.30.0-alpha.2",
47
46
  "@types/react-portal": "^3.0.9",
48
- "lodash": "^4.17.4",
47
+ "lodash": "^4.17.21",
49
48
  "prop-types": "~15.8.1",
50
49
  "react": "~16.14.0",
51
50
  "react-dom": "~16.14.0"
@@ -1,12 +0,0 @@
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 React,{forwardRef}from'react';import{Swiper}from'swiper/swiper-react';/**
2
- * @typedef {import('swiper/react').SwiperProps} SwiperProps
3
- */ /**
4
- * @typedef {import('swiper/react').SwiperRef} SwiperRef
5
- */ /**
6
- * Extracted usage of the original Swiper component to a separate file to get type hints inside
7
- * the index.jsx file.
8
- */var OriginalSwiper=forwardRef(/**
9
- * @param {SwiperProps} props The component props.
10
- * @param {SwiperRef} ref The ref to the Swiper instance.
11
- * @returns {React.Node}
12
- */function(props,ref){return React.createElement(Swiper,_extends({ref:ref},props));});export default OriginalSwiper;