@shopgate/pwa-common 7.30.0-alpha.8 → 7.30.0-beta.1

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 (106) hide show
  1. package/App.js +28 -13
  2. package/actions/app/handleUniversalLink.js +0 -2
  3. package/collections/AuthRoutes.js +15 -13
  4. package/collections/Configuration.js +11 -10
  5. package/collections/EmbeddedMedia.js +21 -19
  6. package/collections/PersistedReducers.js +11 -9
  7. package/collections/Redirects.js +15 -13
  8. package/collections/media-providers/MediaProvider.js +23 -21
  9. package/collections/media-providers/Vimeo.js +28 -22
  10. package/collections/media-providers/YouTube.js +17 -10
  11. package/components/Backdrop/index.js +15 -13
  12. package/components/Backdrop/spec.js +3 -2
  13. package/components/Button/index.js +41 -29
  14. package/components/Button/spec.js +16 -10
  15. package/components/Checkbox/index.js +36 -28
  16. package/components/Checkbox/spec.js +40 -27
  17. package/components/Consume/index.js +4 -1
  18. package/components/CountdownTimer/index.js +27 -20
  19. package/components/CountdownTimer/spec.js +39 -38
  20. package/components/Drawer/index.js +31 -23
  21. package/components/Drawer/spec.js +7 -6
  22. package/components/Dropdown/index.js +27 -18
  23. package/components/Ellipsis/index.js +5 -3
  24. package/components/Ellipsis/spec.js +5 -3
  25. package/components/EmbeddedMedia/index.js +9 -6
  26. package/components/EmbeddedMedia/spec.js +11 -2
  27. package/components/ErrorBoundary/index.js +26 -16
  28. package/components/Grid/components/Item/index.js +13 -6
  29. package/components/Grid/components/Item/spec.js +4 -3
  30. package/components/Grid/index.js +13 -6
  31. package/components/Grid/spec.js +4 -3
  32. package/components/HtmlSanitizer/index.js +42 -45
  33. package/components/HtmlSanitizer/spec.js +31 -21
  34. package/components/I18n/components/FormatDate/index.js +11 -4
  35. package/components/I18n/components/FormatDate/spec.js +22 -14
  36. package/components/I18n/components/FormatNumber/index.js +8 -6
  37. package/components/I18n/components/FormatNumber/spec.js +10 -5
  38. package/components/I18n/components/FormatPrice/index.js +5 -3
  39. package/components/I18n/components/FormatPrice/spec.js +22 -14
  40. package/components/I18n/components/FormatTime/index.js +11 -4
  41. package/components/I18n/components/FormatTime/spec.js +22 -14
  42. package/components/I18n/components/I18nProvider/index.js +18 -11
  43. package/components/I18n/components/I18nProvider/spec.js +2 -1
  44. package/components/I18n/components/Placeholder/index.js +10 -3
  45. package/components/I18n/components/Placeholder/spec.js +12 -5
  46. package/components/I18n/components/Translate/index.js +12 -8
  47. package/components/I18n/components/Translate/spec.js +9 -6
  48. package/components/Icon/index.js +2 -1
  49. package/components/Image/Image.js +23 -21
  50. package/components/Image/ImageInner.js +2 -1
  51. package/components/InfiniteContainer/index.js +59 -53
  52. package/components/InfiniteContainer/spec.js +10 -5
  53. package/components/Input/components/MultiLineInput.js +33 -26
  54. package/components/Input/components/SimpleInput.js +70 -54
  55. package/components/Input/index.js +7 -17
  56. package/components/Input/spec.js +12 -11
  57. package/components/KeyboardConsumer/index.js +19 -13
  58. package/components/Link/index.js +28 -20
  59. package/components/Link/spec.js +13 -9
  60. package/components/List/components/Item/index.js +5 -3
  61. package/components/List/index.js +5 -3
  62. package/components/List/spec.js +6 -9
  63. package/components/Loading/index.js +1 -3
  64. package/components/Modal/index.js +13 -10
  65. package/components/ModalContainer/spec.js +24 -20
  66. package/components/Picker/components/Button/index.js +18 -12
  67. package/components/Picker/components/List/index.js +19 -16
  68. package/components/Picker/components/Modal/index.js +34 -25
  69. package/components/Picker/index.js +44 -33
  70. package/components/Picker/spec.js +4 -1
  71. package/components/Portal/index.js +26 -17
  72. package/components/ProductCharacteristics/index.js +65 -57
  73. package/components/RangeSlider/components/Handle/index.js +7 -5
  74. package/components/RangeSlider/index.js +98 -84
  75. package/components/Route/RouteNotFound.js +30 -19
  76. package/components/Route/index.js +31 -21
  77. package/components/Router/index.js +51 -34
  78. package/components/ScannerContainer/index.js +17 -10
  79. package/components/Select/components/Item/index.js +5 -3
  80. package/components/Select/index.js +59 -47
  81. package/components/Select/spec.js +7 -6
  82. package/components/SelectBox/components/Item/index.js +23 -13
  83. package/components/SelectBox/index.js +83 -80
  84. package/components/SelectBox/spec.js +8 -5
  85. package/components/SurroundPortals/index.js +15 -11
  86. package/components/Swiper/components/SwiperItem/index.js +6 -5
  87. package/components/Swiper/components/SwiperItem/spec.js +12 -4
  88. package/components/Swiper/index.js +23 -20
  89. package/components/Toaster/index.js +4 -1
  90. package/components/Transition/index.js +19 -12
  91. package/components/Widgets/components/Widget/index.js +27 -16
  92. package/components/Widgets/components/Widget/spec.js +6 -5
  93. package/components/Widgets/components/WidgetGrid/index.js +27 -19
  94. package/components/Widgets/components/WidgetGrid/spec.js +5 -4
  95. package/components/Widgets/index.js +33 -26
  96. package/components/Widgets/spec.js +32 -18
  97. package/helpers/data/index.js +1 -1
  98. package/helpers/portals/portalCollection.js +13 -10
  99. package/helpers/redux/mutable.js +2 -2
  100. package/package.json +5 -6
  101. package/providers/loading/index.js +71 -57
  102. package/providers/toast/index.js +39 -28
  103. package/reducers/modal/index.js +1 -1
  104. package/store/index.js +1 -1
  105. package/subscriptions/helpers/buildRegisterUrl.js +1 -0
  106. package/components/Input/components/DateInput.js +0 -273
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import { i18n } from '@shopgate/engage/core';
4
4
  import I18n from "../../index";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  jest.unmock('@shopgate/engage/core/helpers/i18n');
6
7
  describe('<FormatPrice />', () => {
7
8
  const locales = {
@@ -18,20 +19,27 @@ describe('<FormatPrice />', () => {
18
19
  describe('Given the component was mounted to the DOM', () => {
19
20
  let renderedElement;
20
21
  it('should match snapshot', () => {
21
- renderedElement = mount(/*#__PURE__*/React.createElement(I18n.Provider, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
22
- className: "only-price"
23
- }, /*#__PURE__*/React.createElement(I18n.Price, {
24
- price: price,
25
- currency: currency
26
- })), /*#__PURE__*/React.createElement("span", {
27
- className: "text-with-price"
28
- }, /*#__PURE__*/React.createElement(I18n.Text, {
29
- string: "greeting"
30
- }, /*#__PURE__*/React.createElement(I18n.Price, {
31
- forKey: "price",
32
- price: price,
33
- currency: currency
34
- }))))));
22
+ renderedElement = mount(/*#__PURE__*/_jsx(I18n.Provider, {
23
+ children: /*#__PURE__*/_jsxs("div", {
24
+ children: [/*#__PURE__*/_jsx("span", {
25
+ className: "only-price",
26
+ children: /*#__PURE__*/_jsx(I18n.Price, {
27
+ price: price,
28
+ currency: currency
29
+ })
30
+ }), /*#__PURE__*/_jsx("span", {
31
+ className: "text-with-price",
32
+ children: /*#__PURE__*/_jsx(I18n.Text, {
33
+ string: "greeting",
34
+ children: /*#__PURE__*/_jsx(I18n.Price, {
35
+ forKey: "price",
36
+ price: price,
37
+ currency: currency
38
+ })
39
+ })
40
+ })]
41
+ })
42
+ }));
35
43
  expect(renderedElement).toMatchSnapshot();
36
44
  });
37
45
  it('should render formatted price', () => {
@@ -7,13 +7,16 @@ import { i18n } from '@shopgate/engage/core/helpers/i18n';
7
7
  * @param {Object} props The component props.
8
8
  * @returns {JSX}
9
9
  */
10
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
10
11
  const FormatTime = ({
11
12
  timestamp,
12
13
  format
13
- }) => /*#__PURE__*/React.createElement(Fragment, null, FormatTime.format({
14
- timestamp,
15
- format
16
- }));
14
+ }) => /*#__PURE__*/_jsx(_Fragment, {
15
+ children: FormatTime.format({
16
+ timestamp,
17
+ format
18
+ })
19
+ });
17
20
  FormatTime.format = ({
18
21
  timestamp,
19
22
  format
@@ -23,6 +26,10 @@ FormatTime.format = ({
23
26
  }
24
27
  return i18n.time(timestamp, format);
25
28
  };
29
+ FormatTime.propTypes = {
30
+ timestamp: PropTypes.number.isRequired,
31
+ format: PropTypes.string
32
+ };
26
33
  FormatTime.defaultProps = {
27
34
  format: 'medium'
28
35
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import { i18n } from '@shopgate/engage/core';
4
4
  import I18n from "../../index";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  jest.unmock('@shopgate/engage/core/helpers/i18n');
6
7
  describe('<FormatTime />', () => {
7
8
  const locales = {
@@ -17,20 +18,27 @@ describe('<FormatTime />', () => {
17
18
  });
18
19
  describe('Given the component was mounted to the DOM', () => {
19
20
  // TODO: Handle snapshot test.
20
- const renderedElement = mount(/*#__PURE__*/React.createElement(I18n.Provider, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
21
- className: "only-time"
22
- }, /*#__PURE__*/React.createElement(I18n.Time, {
23
- timestamp: timestamp,
24
- format: format
25
- })), /*#__PURE__*/React.createElement("span", {
26
- className: "text-with-time"
27
- }, /*#__PURE__*/React.createElement(I18n.Text, {
28
- string: "greeting"
29
- }, /*#__PURE__*/React.createElement(I18n.Time, {
30
- forKey: "time",
31
- timestamp: timestamp,
32
- format: format
33
- }))))));
21
+ const renderedElement = mount(/*#__PURE__*/_jsx(I18n.Provider, {
22
+ children: /*#__PURE__*/_jsxs("div", {
23
+ children: [/*#__PURE__*/_jsx("span", {
24
+ className: "only-time",
25
+ children: /*#__PURE__*/_jsx(I18n.Time, {
26
+ timestamp: timestamp,
27
+ format: format
28
+ })
29
+ }), /*#__PURE__*/_jsx("span", {
30
+ className: "text-with-time",
31
+ children: /*#__PURE__*/_jsx(I18n.Text, {
32
+ string: "greeting",
33
+ children: /*#__PURE__*/_jsx(I18n.Time, {
34
+ forKey: "time",
35
+ timestamp: timestamp,
36
+ format: format
37
+ })
38
+ })
39
+ })]
40
+ })
41
+ }));
34
42
  it('should render formatted time', () => {
35
43
  const text = renderedElement.find('.only-time').text();
36
44
  expect(text).toBe(formattedTime);
@@ -1,3 +1,4 @@
1
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
1
2
  import React, { Component } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { i18n } from '@shopgate/engage/core/helpers/i18n';
@@ -7,53 +8,59 @@ import { logger } from '@shopgate/pwa-core/helpers';
7
8
  * A React component that provides child components with i18n features.
8
9
  * @returns {React.Component}
9
10
  */
10
- export default class I18nProvider extends Component {
11
+ let I18nProvider = /*#__PURE__*/function (_Component) {
11
12
  /**
12
13
  * @inheritDoc
13
14
  */
14
- constructor(props) {
15
- super(props);
15
+ function I18nProvider(props) {
16
+ var _this;
17
+ _this = _Component.call(this, props) || this;
16
18
  // eslint-disable-next-line react/prop-types
17
19
  /**
18
20
  * Gets a shortcut to i18n functionality with preset language.
19
21
  * @returns {Object}
20
22
  */
21
- this.getI18nInstance = () => ({
23
+ _this.getI18nInstance = () => ({
22
24
  __: i18n.text,
23
25
  _p: i18n.price,
24
26
  _d: i18n.date,
25
27
  _t: i18n.time,
26
28
  _n: i18n.number
27
29
  });
28
- if (this.props.lang || this.props.locales) {
30
+ if (_this.props.lang || _this.props.locales) {
29
31
  logger.warn(`===== I18nProvider deprecated =====\nI18nProvider and it's related components (@shopgate/pwa-common/component/I18n) or context types are deprecated and will be removed in @shopgate/engage v7.0.0.\nPlease use { i18n } from @shopgate/engage/core.\n===================================
30
32
  `);
31
33
  }
34
+ return _this;
32
35
  }
33
36
 
34
37
  /**
35
38
  * Provides context for child components.
36
39
  * @returns {Object}
37
40
  */
38
- getChildContext() {
41
+ _inheritsLoose(I18nProvider, _Component);
42
+ var _proto = I18nProvider.prototype;
43
+ _proto.getChildContext = function getChildContext() {
39
44
  return {
40
45
  i18n: this.getI18nInstance
41
46
  };
42
- }
47
+ };
43
48
  /**
44
49
  * Renders the component.
45
50
  * @returns {JSX}
46
51
  */
47
- render() {
52
+ _proto.render = function render() {
48
53
  const {
49
54
  children
50
55
  } = this.props;
51
56
  return children ? /*#__PURE__*/React.cloneElement(children) : null;
52
- }
53
- }
57
+ };
58
+ return I18nProvider;
59
+ }(Component);
54
60
  I18nProvider.childContextTypes = {
55
61
  i18n: PropTypes.func.isRequired
56
62
  };
57
63
  I18nProvider.defaultProps = {
58
64
  children: null
59
- };
65
+ };
66
+ export { I18nProvider as default };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { shallow } from 'enzyme';
3
3
  import { i18n as i18nHelper } from '@shopgate/engage/core';
4
4
  import I18nProvider from "./index";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  jest.unmock('@shopgate/engage/core/helpers/i18n');
6
7
  describe('<I18nProvider />', () => {
7
8
  const locales = {
@@ -16,7 +17,7 @@ describe('<I18nProvider />', () => {
16
17
  let renderedElement;
17
18
  let renderedInstance;
18
19
  it('should match snapshot', () => {
19
- renderedElement = shallow(/*#__PURE__*/React.createElement(I18nProvider, null));
20
+ renderedElement = shallow(/*#__PURE__*/_jsx(I18nProvider, {}));
20
21
  renderedInstance = renderedElement.instance();
21
22
  expect(renderedElement).toMatchSnapshot();
22
23
  });
@@ -1,4 +1,4 @@
1
- import React, { Fragment } from 'react';
1
+ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
4
  /**
@@ -7,6 +7,13 @@ import PropTypes from 'prop-types';
7
7
  * @param {Object} context The component context.
8
8
  * @returns {JSX}
9
9
  */
10
- const Placeholder = props => /*#__PURE__*/React.createElement(Fragment, null, props.children);
11
- Placeholder.format = props => /*#__PURE__*/React.createElement(Placeholder, props);
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const Placeholder = props => props.children;
12
+ Placeholder.format = props => /*#__PURE__*/_jsx(Placeholder, {
13
+ ...props
14
+ });
15
+ Placeholder.propTypes = {
16
+ children: PropTypes.node.isRequired,
17
+ forKey: PropTypes.string.isRequired
18
+ };
12
19
  export default Placeholder;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import { i18n } from '@shopgate/engage/core';
4
4
  import I18n from "../../index";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  jest.unmock('@shopgate/engage/core/helpers/i18n');
6
7
  describe('<Placeholder />', () => {
7
8
  const locales = {
@@ -15,11 +16,17 @@ describe('<Placeholder />', () => {
15
16
  describe('Given the component was mounted to the DOM', () => {
16
17
  let renderedElement;
17
18
  it('should render', () => {
18
- renderedElement = mount(/*#__PURE__*/React.createElement(I18n.Provider, null, /*#__PURE__*/React.createElement(I18n.Text, {
19
- string: "greeting"
20
- }, /*#__PURE__*/React.createElement(I18n.Placeholder, {
21
- forKey: "world"
22
- }, /*#__PURE__*/React.createElement("strong", null, "WORLD")), "/")));
19
+ renderedElement = mount(/*#__PURE__*/_jsx(I18n.Provider, {
20
+ children: /*#__PURE__*/_jsxs(I18n.Text, {
21
+ string: "greeting",
22
+ children: [/*#__PURE__*/_jsx(I18n.Placeholder, {
23
+ forKey: "world",
24
+ children: /*#__PURE__*/_jsx("strong", {
25
+ children: "WORLD"
26
+ })
27
+ }), "/"]
28
+ })
29
+ }));
23
30
  expect(renderedElement).toMatchSnapshot();
24
31
  });
25
32
  it('should render with a placeholder text', () => {
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import "core-js/modules/es.array.reduce.js";
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
@@ -24,6 +23,7 @@ import { i18n } from '@shopgate/engage/core/helpers/i18n';
24
23
  * also handle human readable texts that contain text replacement placeholders.
25
24
  * @returns {JSX.Element} The translated string as JSX component.
26
25
  */
26
+ import { jsx as _jsx } from "react/jsx-runtime";
27
27
  const Translate = ({
28
28
  string,
29
29
  children,
@@ -38,10 +38,12 @@ const Translate = ({
38
38
  return string;
39
39
  }
40
40
  if (!i18n.ready) {
41
- return /*#__PURE__*/React.createElement("span", _extends({
41
+ return /*#__PURE__*/_jsx("span", {
42
42
  className: className,
43
- role: role
44
- }, rest), string);
43
+ role: role,
44
+ ...rest,
45
+ children: string
46
+ });
45
47
  }
46
48
 
47
49
  // When the input string is malformed, return the original string rather than raising an error.
@@ -64,14 +66,16 @@ const Translate = ({
64
66
 
65
67
  // Create a new array containing the separated chunks of the text and merge the substitutions.
66
68
  // The result can be an array with multiple strings and will be joined together.
67
- formatted = stringParts.reduce((result, text, index) => [...result, text, childrenArray[index]], []);
69
+ formatted = stringParts.reduce((result, text, index) => [].concat(result, [text, childrenArray[index]]), []);
68
70
  } catch (e) {
69
71
  logger.error('i18n error for string %s', string, e);
70
72
  }
71
- return /*#__PURE__*/React.createElement("span", _extends({
73
+ return /*#__PURE__*/_jsx("span", {
72
74
  className: className,
73
- role: role
74
- }, rest), !transform ? formatted : transform(renderToString(formatted)));
75
+ role: role,
76
+ ...rest,
77
+ children: !transform ? formatted : transform(renderToString(formatted))
78
+ });
75
79
  };
76
80
  Translate.defaultProps = {
77
81
  children: null,
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import { i18n } from '@shopgate/engage/core';
4
4
  import I18n from "../../index";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  jest.unmock('@shopgate/engage/core/helpers/i18n');
6
7
  describe('<Translate />', () => {
7
8
  const locales = {
@@ -14,12 +15,14 @@ describe('<Translate />', () => {
14
15
  describe('Given the component was mounted to the DOM', () => {
15
16
  let renderedElement;
16
17
  it('should match snapshot', () => {
17
- renderedElement = mount(/*#__PURE__*/React.createElement(I18n.Provider, null, /*#__PURE__*/React.createElement(I18n.Text, {
18
- string: "greeting",
19
- params: {
20
- name: 'Test'
21
- }
22
- })));
18
+ renderedElement = mount(/*#__PURE__*/_jsx(I18n.Provider, {
19
+ children: /*#__PURE__*/_jsx(I18n.Text, {
20
+ string: "greeting",
21
+ params: {
22
+ name: 'Test'
23
+ }
24
+ })
25
+ }));
23
26
  expect(renderedElement).toMatchSnapshot();
24
27
  });
25
28
  it('should render translated text', () => {
@@ -11,7 +11,8 @@ import styles from "./style";
11
11
  * @param {number} [props.size=24] The icon size
12
12
  * @returns {JSX.Element}
13
13
  */
14
- const Icon = props => /*#__PURE__*/React.createElement("svg", {
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ const Icon = props => /*#__PURE__*/_jsx("svg", {
15
16
  className: `${styles} ${props.className} common__icon`,
16
17
  viewBox: props.viewBox,
17
18
  xmlns: "http://www.w3.org/2000/svg",
@@ -6,6 +6,7 @@ import { themeConfig } from '@shopgate/engage';
6
6
  import { getFullImageSource } from '@shopgate/engage/core/helpers';
7
7
  import styles from "./style";
8
8
  import ImageInner from "./ImageInner";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
9
10
  const {
10
11
  colors: themeColors
11
12
  } = themeConfig;
@@ -134,7 +135,7 @@ const Image = ({
134
135
  }, [ratio, resolutions]);
135
136
  if (unwrapped) {
136
137
  if (!(src && !parentRendersPlaceholder)) return null;
137
- return /*#__PURE__*/React.createElement(ImageInner, {
138
+ return /*#__PURE__*/_jsx(ImageInner, {
138
139
  ref: imgRef,
139
140
  src: sources.main,
140
141
  className: classNames(classNameImg),
@@ -154,26 +155,27 @@ const Image = ({
154
155
  });
155
156
  }
156
157
  const containerStyle = styles.container(backgroundColor, paddingHackRatio);
157
- return /*#__PURE__*/React.createElement("div", {
158
- className: classNames(containerStyle, className, 'common__image__container')
159
- }, src && !parentRendersPlaceholder && /*#__PURE__*/React.createElement(ImageInner, {
160
- ref: imgRef,
161
- src: sources.main,
162
- className: classNames(classNameImg),
163
- style: {
164
- aspectRatio,
165
- ...(isInView && sources.preview && {
166
- backgroundImage: `url(${sources.preview})`,
167
- backgroundSize: 'contain',
168
- backgroundRepeat: 'no-repeat',
169
- backgroundPosition: 'center'
170
- })
171
- },
172
- alt: alt,
173
- lazy: lazy,
174
- onLoad: handleOnLoad,
175
- onError: handleOnError
176
- }));
158
+ return /*#__PURE__*/_jsx("div", {
159
+ className: classNames(containerStyle, className, 'common__image__container'),
160
+ children: src && !parentRendersPlaceholder && /*#__PURE__*/_jsx(ImageInner, {
161
+ ref: imgRef,
162
+ src: sources.main,
163
+ className: classNames(classNameImg),
164
+ style: {
165
+ aspectRatio,
166
+ ...(isInView && sources.preview && {
167
+ backgroundImage: `url(${sources.preview})`,
168
+ backgroundSize: 'contain',
169
+ backgroundRepeat: 'no-repeat',
170
+ backgroundPosition: 'center'
171
+ })
172
+ },
173
+ alt: alt,
174
+ lazy: lazy,
175
+ onLoad: handleOnLoad,
176
+ onError: handleOnError
177
+ })
178
+ });
177
179
  };
178
180
  const defaultResolutions = [{
179
181
  width: 440,
@@ -10,6 +10,7 @@ import styles from "./style";
10
10
  * @param {Function} ref The component reference
11
11
  * @returns {JSX.Element}
12
12
  */
13
+ import { jsx as _jsx } from "react/jsx-runtime";
13
14
  const ImageInner = /*#__PURE__*/forwardRef(({
14
15
  src,
15
16
  className,
@@ -18,7 +19,7 @@ const ImageInner = /*#__PURE__*/forwardRef(({
18
19
  onLoad,
19
20
  onError,
20
21
  style
21
- }, ref) => /*#__PURE__*/React.createElement("img", {
22
+ }, ref) => /*#__PURE__*/_jsx("img", {
22
23
  ref: ref,
23
24
  loading: lazy ? 'lazy' : 'eager',
24
25
  src: src,