@shopgate/pwa-common 7.30.3 → 7.31.0-alpha.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 (112) hide show
  1. package/App.js +0 -2
  2. package/actions/app/handleLink.js +1 -0
  3. package/collections/AuthRoutes.js +1 -0
  4. package/collections/PersistedReducers.js +1 -0
  5. package/collections/media-providers/Vimeo.js +1 -1
  6. package/collections/media-providers/style.js +1 -1
  7. package/components/Backdrop/index.js +18 -3
  8. package/components/Button/index.js +40 -52
  9. package/components/Checkbox/index.js +1 -1
  10. package/components/Drawer/index.js +118 -132
  11. package/components/Drawer/spec.js +4 -2
  12. package/components/Dropdown/index.js +52 -68
  13. package/components/Grid/components/Item/index.js +37 -40
  14. package/components/Grid/index.js +36 -34
  15. package/components/HtmlSanitizer/index.js +60 -7
  16. package/components/I18n/components/FormatNumber/spec.js +1 -0
  17. package/components/Icon/index.d.ts +36 -0
  18. package/components/Icon/index.d.ts.map +1 -0
  19. package/components/Icon/index.js +39 -28
  20. package/components/Image/Image.js +27 -6
  21. package/components/Image/ImageInner.js +32 -25
  22. package/components/InfiniteContainer/index.js +5 -7
  23. package/components/InfiniteContainer/spec.js +13 -17
  24. package/components/Link/index.js +75 -84
  25. package/components/List/components/Item/index.js +19 -10
  26. package/components/List/spec.js +1 -3
  27. package/components/Loading/index.d.ts +6 -0
  28. package/components/Loading/index.d.ts.map +1 -0
  29. package/components/Modal/index.js +41 -7
  30. package/components/Picker/index.js +18 -194
  31. package/components/Portal/index.d.ts +50 -0
  32. package/components/Portal/index.d.ts.map +1 -0
  33. package/components/ProductCharacteristics/index.js +14 -276
  34. package/components/RangeSlider/index.js +15 -258
  35. package/components/Select/components/Item/index.js +18 -7
  36. package/components/Select/index.js +108 -144
  37. package/components/Select/spec.js +49 -16
  38. package/components/SelectBox/components/Item/index.js +49 -51
  39. package/components/SelectBox/index.js +140 -160
  40. package/components/SurroundPortals/index.d.ts +24 -0
  41. package/components/SurroundPortals/index.d.ts.map +1 -0
  42. package/components/SurroundPortals/index.js +3 -13
  43. package/components/Swiper/components/SwiperItem/index.js +13 -4
  44. package/components/Swiper/components/SwiperItem/spec.js +3 -2
  45. package/components/Swiper/index.js +80 -12
  46. package/components/Widgets/components/Widget/index.js +54 -56
  47. package/components/Widgets/components/Widget/spec.js +12 -8
  48. package/components/Widgets/components/WidgetGrid/index.js +39 -53
  49. package/components/Widgets/components/WidgetGrid/spec.js +12 -8
  50. package/constants/Configuration.js +2 -1
  51. package/constants/Portals.d.ts +101 -0
  52. package/constants/Portals.d.ts.map +1 -0
  53. package/helpers/config/index.d.ts +94 -0
  54. package/helpers/config/index.d.ts.map +1 -0
  55. package/helpers/config/mock.d.ts +23 -0
  56. package/helpers/config/mock.d.ts.map +1 -0
  57. package/helpers/config/theme.d.ts +7 -0
  58. package/helpers/config/theme.d.ts.map +1 -0
  59. package/helpers/data/index.d.ts +35 -0
  60. package/helpers/data/index.d.ts.map +1 -0
  61. package/helpers/data/index.js +1 -0
  62. package/helpers/html/handleDOM.js +1 -0
  63. package/helpers/portals/portalCollection.d.ts +30 -0
  64. package/helpers/portals/portalCollection.d.ts.map +1 -0
  65. package/helpers/style/index.js +1 -0
  66. package/helpers/validation/index.d.ts +10 -0
  67. package/helpers/validation/index.d.ts.map +1 -0
  68. package/package.json +4 -3
  69. package/selectors/client.js +1 -0
  70. package/styles/reset/form.js +46 -51
  71. package/styles/reset/media.js +21 -19
  72. package/styles/reset/root.js +28 -26
  73. package/styles/reset/table.js +9 -7
  74. package/styles/reset/typography.js +24 -22
  75. package/subscriptions/error.js +1 -0
  76. package/subscriptions/helpers/handleLinks.js +1 -0
  77. package/subscriptions/router.js +1 -0
  78. package/tsconfig.build.json +16 -0
  79. package/tsconfig.json +3 -0
  80. package/components/Backdrop/style.js +0 -11
  81. package/components/Button/style.js +0 -6
  82. package/components/Drawer/style.js +0 -37
  83. package/components/Dropdown/style.js +0 -4
  84. package/components/Grid/components/Item/style.js +0 -23
  85. package/components/Grid/style.js +0 -14
  86. package/components/Icon/style.js +0 -6
  87. package/components/Image/style.js +0 -32
  88. package/components/Link/style.js +0 -10
  89. package/components/List/components/Item/style.js +0 -16
  90. package/components/Modal/style.js +0 -36
  91. package/components/Picker/components/Button/index.js +0 -42
  92. package/components/Picker/components/Button/style.js +0 -19
  93. package/components/Picker/components/List/index.js +0 -38
  94. package/components/Picker/components/List/style.js +0 -17
  95. package/components/Picker/components/Modal/index.js +0 -76
  96. package/components/Picker/components/Modal/style.js +0 -78
  97. package/components/Picker/spec.js +0 -88
  98. package/components/ProductCharacteristics/connector.js +0 -41
  99. package/components/ProductCharacteristics/context.js +0 -2
  100. package/components/ProductCharacteristics/helpers/index.js +0 -162
  101. package/components/RangeSlider/components/Handle/index.js +0 -34
  102. package/components/RangeSlider/components/Handle/style.js +0 -14
  103. package/components/RangeSlider/helper.js +0 -85
  104. package/components/RangeSlider/style.js +0 -14
  105. package/components/Select/components/Item/style.js +0 -4
  106. package/components/Select/style.js +0 -17
  107. package/components/SelectBox/components/Item/style.js +0 -7
  108. package/components/SelectBox/style.js +0 -18
  109. package/components/Swiper/components/SwiperItem/styles.js +0 -5
  110. package/components/Swiper/styles.js +0 -76
  111. package/components/Widgets/components/Widget/style.js +0 -27
  112. package/components/Widgets/components/WidgetGrid/style.js +0 -8
@@ -1,67 +1,65 @@
1
- import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
- import React, { Component, Suspense } from 'react';
1
+ import React, { Suspense, memo } from 'react';
3
2
  import PropTypes from 'prop-types';
4
- import isEqual from 'lodash/isEqual';
3
+ import { makeStyles } from '@shopgate/engage/styles';
5
4
  import Loading from "../../../Loading";
6
5
  import Grid from "../../../Grid";
7
- import styles from "./style";
8
- /**
9
- * The widget component.
10
- */
11
6
  import { jsx as _jsx } from "react/jsx-runtime";
12
- let Widget = /*#__PURE__*/function (_Component) {
13
- function Widget() {
14
- return _Component.apply(this, arguments) || this;
15
- }
16
- _inheritsLoose(Widget, _Component);
17
- var _proto = Widget.prototype;
18
- /**
19
- * @param {Object} nextProps The next component props.
20
- * @return {boolean}
21
- */
22
- _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
23
- if (this.props.component !== nextProps.component) return true;
24
- if (!isEqual(this.props.config, nextProps.config)) return true;
25
- return false;
7
+ const useStyles = makeStyles()((_t, {
8
+ col,
9
+ row,
10
+ width,
11
+ height
12
+ }) => ({
13
+ widgetCell: {
14
+ gridColumnStart: col + 1,
15
+ gridColumnEnd: col + width + 1,
16
+ gridRowStart: row + 1,
17
+ gridRowEnd: row + height + 1
26
18
  }
19
+ }));
27
20
 
28
- /**
29
- * @return {JSX}
30
- */;
31
- _proto.render = function render() {
32
- const {
33
- col,
34
- row,
35
- height,
36
- settings,
37
- width
38
- } = this.props.config;
39
- if (!this.props.component) {
40
- return null;
41
- }
42
- return /*#__PURE__*/_jsx(Grid.Item, {
43
- className: `common__widgets__widget ${styles.widgetCell({
44
- col,
45
- row,
46
- height,
47
- width
48
- })}`,
49
- component: "div",
50
- children: /*#__PURE__*/_jsx("div", {
51
- className: styles.content,
52
- children: /*#__PURE__*/_jsx(Suspense, {
53
- fallback: /*#__PURE__*/_jsx(Loading, {}),
54
- children: /*#__PURE__*/React.createElement(this.props.component, {
55
- settings,
56
- ratio: [width, height]
57
- })
21
+ /**
22
+ * @param {Object} props Props.
23
+ * @returns {JSX.Element|null}
24
+ */
25
+ const Widget = ({
26
+ config,
27
+ component: Comp
28
+ }) => {
29
+ const {
30
+ col,
31
+ row,
32
+ height,
33
+ settings,
34
+ width
35
+ } = config;
36
+ const {
37
+ classes,
38
+ cx
39
+ } = useStyles({
40
+ col,
41
+ row,
42
+ width,
43
+ height
44
+ });
45
+ if (!Comp) {
46
+ return null;
47
+ }
48
+ return /*#__PURE__*/_jsx(Grid.Item, {
49
+ className: cx('common__widgets__widget', classes.widgetCell),
50
+ component: "div",
51
+ children: /*#__PURE__*/_jsx("div", {
52
+ children: /*#__PURE__*/_jsx(Suspense, {
53
+ fallback: /*#__PURE__*/_jsx(Loading, {}),
54
+ children: /*#__PURE__*/React.createElement(Comp, {
55
+ settings,
56
+ ratio: [width, height]
58
57
  })
59
58
  })
60
- });
61
- };
62
- return Widget;
63
- }(Component);
59
+ })
60
+ });
61
+ };
64
62
  Widget.defaultProps = {
65
63
  component: null
66
64
  };
67
- export default Widget;
65
+ export default /*#__PURE__*/memo(Widget);
@@ -3,14 +3,18 @@ import { mount } from 'enzyme';
3
3
  import Grid from "../../../Grid";
4
4
  import Widget from "./index";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- jest.mock('react', () => ({
7
- ...jest.requireActual('react'),
8
- Suspense: function Suspense({
9
- children
10
- }) {
11
- return children;
12
- }
13
- }));
6
+ jest.mock('react', () => {
7
+ const actual = jest.requireActual('react');
8
+ return {
9
+ ...actual,
10
+ memo: c => c,
11
+ Suspense: function Suspense({
12
+ children
13
+ }) {
14
+ return children;
15
+ }
16
+ };
17
+ });
14
18
 
15
19
  /**
16
20
  * A dummy component.
@@ -1,65 +1,51 @@
1
- import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
- import React, { Component } from 'react';
3
- import isEqual from 'lodash/isEqual';
1
+ import React, { memo, useMemo } from 'react';
4
2
  import PropTypes from 'prop-types';
5
3
  import sortBy from 'lodash/sortBy';
4
+ import { makeStyles } from '@shopgate/engage/styles';
6
5
  import Widget from "../Widget";
7
- import styles from "./style";
8
6
  import shouldShowWidget from "../../helpers/shouldShowWidget";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ const useStyles = makeStyles()(() => ({
9
+ root: {
10
+ display: 'grid',
11
+ gridTemplateColumns: 'repeat(12, 1fr)',
12
+ gridAutoRows: 'auto',
13
+ gridAutoFlow: 'row dense',
14
+ position: 'relative'
15
+ }
16
+ }));
9
17
 
10
18
  /**
11
19
  * The WidgetGrid component.
20
+ * @param {Object} props Props.
21
+ * @returns {JSX.Element|null}
12
22
  */
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- let WidgetGrid = /*#__PURE__*/function (_Component) {
15
- function WidgetGrid() {
16
- return _Component.apply(this, arguments) || this;
17
- }
18
- _inheritsLoose(WidgetGrid, _Component);
19
- var _proto = WidgetGrid.prototype;
20
- /**
21
- * @param {Object} nextProps The next component props.
22
- * @return {boolean}
23
- */
24
- _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
25
- if (!isEqual(this.props.components, nextProps.components)) return true;
26
- if (!isEqual(this.props.config, nextProps.config)) return true;
27
- return false;
23
+ const WidgetGrid = ({
24
+ components,
25
+ config
26
+ }) => {
27
+ const {
28
+ classes,
29
+ cx
30
+ } = useStyles();
31
+ const widgets = useMemo(() => sortBy(config, ['row']).filter(w => shouldShowWidget(w.settings)), [config]);
32
+ if (!config.length) {
33
+ return null;
28
34
  }
29
-
30
- /**
31
- * Render the component.
32
- * @return {JSX}
33
- */;
34
- _proto.render = function render() {
35
- const {
36
- components,
37
- config
38
- } = this.props;
39
- if (!config.length) {
40
- return null;
41
- }
42
-
43
- // TODO: This should not happen within every render call.
44
- // Sort the widgets by row. This has to happen to take care of the z-index flow.
45
- const widgets = sortBy(config, ['row']).filter(w => shouldShowWidget(w.settings));
46
- return /*#__PURE__*/_jsx("div", {
47
- className: `${styles} common__widgets__widget-grid`,
48
- children: Object.keys(widgets).map(key => {
49
- const widget = widgets[key];
50
- const widgetKey = `w${key}`;
51
- // Map to the correct widget component using the `type` key inside the widget.
52
- const WidgetComponent = components[widget.type];
53
- return /*#__PURE__*/_jsx(Widget, {
54
- config: widget,
55
- component: WidgetComponent
56
- }, widgetKey);
57
- })
58
- });
59
- };
60
- return WidgetGrid;
61
- }(Component);
35
+ return /*#__PURE__*/_jsx("div", {
36
+ className: cx(classes.root, 'common__widgets__widget-grid'),
37
+ children: Object.keys(widgets).map(key => {
38
+ const widget = widgets[key];
39
+ const widgetKey = `w${key}`;
40
+ const WidgetComponent = components[widget.type];
41
+ return /*#__PURE__*/_jsx(Widget, {
42
+ config: widget,
43
+ component: WidgetComponent
44
+ }, widgetKey);
45
+ })
46
+ });
47
+ };
62
48
  WidgetGrid.defaultProps = {
63
49
  config: []
64
50
  };
65
- export default WidgetGrid;
51
+ export default /*#__PURE__*/memo(WidgetGrid);
@@ -2,14 +2,18 @@ import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import WidgetGrid from "./index";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
- jest.mock('react', () => ({
6
- ...jest.requireActual('react'),
7
- Suspense: function Suspense({
8
- children
9
- }) {
10
- return children;
11
- }
12
- }));
5
+ jest.mock('react', () => {
6
+ const actual = jest.requireActual('react');
7
+ return {
8
+ ...actual,
9
+ memo: c => c,
10
+ Suspense: function Suspense({
11
+ children
12
+ }) {
13
+ return children;
14
+ }
15
+ };
16
+ });
13
17
 
14
18
  /**
15
19
  * A mock Image component.
@@ -33,4 +33,5 @@ export const IS_CONNECT_EXTENSION_ATTACHED = 'IS_CONNECT_EXTENSION_ATTACHED';
33
33
  * );
34
34
  */
35
35
  export const CONFIGURATION_COLLECTION_CREATE_EXTERNAL_IMAGE_URL = 'CONFIGURATION_COLLECTION_CREATE_EXTERNAL_IMAGE_URL';
36
- export const CONFIGURATION_COLLECTION_KEY_THEME_TYPOGRAPHY = 'CONFIGURATION_COLLECTION_KEY_THEME_TYPOGRAPHY';
36
+ export const CONFIGURATION_COLLECTION_KEY_THEME_TYPOGRAPHY = 'CONFIGURATION_COLLECTION_KEY_THEME_TYPOGRAPHY';
37
+ export const CONFIGURATION_COLLECTION_KEY_UNIVERSAL_LINK_HANDLER = 'universalLinkHandler';
@@ -0,0 +1,101 @@
1
+ export const BEFORE: "before";
2
+ export const AFTER: "after";
3
+ export const LEFT: "left";
4
+ export const CENTER: "center";
5
+ export const RIGHT: "right";
6
+ export const BELOW: "below";
7
+ export const APP_GLOBALS: "app.globals";
8
+ export const APP_ROUTES: "app.routes";
9
+ export const VIEW_CONTENT_BEFORE: "view.content.before";
10
+ export const VIEW_CONTENT: "view.content";
11
+ export const VIEW_CONTENT_AFTER: "view.content.after";
12
+ export const PAGE_CONTENT_BEFORE: "page.content.before";
13
+ export const PAGE_CONTENT: "page.content";
14
+ export const PAGE_CONTENT_AFTER: "page.content.after";
15
+ export const PAGE_LOGIN_BEFORE: "page.login.before";
16
+ export const PAGE_LOGIN: "page.login";
17
+ export const PAGE_LOGIN_AFTER: "page.login.after";
18
+ export const PAGE_LOGIN_FORM_BEFORE: "page.login.form.before";
19
+ export const PAGE_LOGIN_FORM: "page.login.form";
20
+ export const PAGE_LOGIN_FORM_AFTER: "page.login.form.after";
21
+ export const PAGE_LOGIN_REGISTER_LINK_BEFORE: "page.login.register-link.before";
22
+ export const PAGE_LOGIN_REGISTER_LINK: "page.login.register-link";
23
+ export const PAGE_LOGIN_REGISTER_LINK_AFTER: "page.login.register-link.after";
24
+ export const NAV_MENU_CONTENT_BEFORE: "nav-menu.content.before";
25
+ export const NAV_MENU_CONTENT_AFTER: "nav-menu.content.after";
26
+ export const NAV_MENU_QUICK_LINKS: "nav-menu.quick-links";
27
+ export const NAV_MENU_QUICK_LINKS_BEFORE: "nav-menu.quick-links.before";
28
+ export const NAV_MENU_QUICK_LINKS_AFTER: "nav-menu.quick-links.after";
29
+ export const NAV_MENU_QUICK_LINKS_ITEMS: "nav-menu.quick-links.items";
30
+ export const NAV_MENU_QUICK_LINKS_ITEMS_BEFORE: "nav-menu.quick-links.items.before";
31
+ export const NAV_MENU_QUICK_LINKS_ITEMS_AFTER: "nav-menu.quick-links.items.after";
32
+ export const NAV_MENU_HOME_BEFORE: "nav-menu.home.before";
33
+ export const NAV_MENU_HOME: "nav-menu.home";
34
+ export const NAV_MENU_HOME_AFTER: "nav-menu.home.after";
35
+ export const NAV_MENU_SCANNER_BEFORE: "nav-menu.scanner.before";
36
+ export const NAV_MENU_SCANNER: "nav-menu.scanner";
37
+ export const NAV_MENU_SCANNER_AFTER: "nav-menu.scanner.after";
38
+ export const NAV_MENU_TERMS_BEFORE: "nav-menu.terms.before";
39
+ export const NAV_MENU_TERMS: "nav-menu.terms";
40
+ export const NAV_MENU_TERMS_AFTER: "nav-menu.terms.after";
41
+ export const NAV_MENU_PRIVACY_BEFORE: "nav-menu.privacy.before";
42
+ export const NAV_MENU_PRIVACY: "nav-menu.privacy";
43
+ export const NAV_MENU_PRIVACY_AFTER: "nav-menu.privacy.after";
44
+ export const NAV_MENU_PRIVACY_SETTINGS_BEFORE: "nav-menu.privacy-settings.before";
45
+ export const NAV_MENU_PRIVACY_SETTINGS: "nav-menu.privacy-settings";
46
+ export const NAV_MENU_PRIVACY_SETTINGS_AFTER: "nav-menu.privacy-settings.after";
47
+ export const NAV_MENU_IMPRINT_BEFORE: "nav-menu.imprint.before";
48
+ export const NAV_MENU_IMPRINT: "nav-menu.imprint";
49
+ export const NAV_MENU_IMPRINT_AFTER: "nav-menu.imprint.after";
50
+ export const NAV_MENU_STORE_INFORMATION_BEFORE: "nav-menu.store-information.before";
51
+ export const NAV_MENU_STORE_INFORMATION: "nav-menu.store-information";
52
+ export const NAV_MENU_STORE_INFORMATION_AFTER: "nav-menu.store-information.after";
53
+ export const NAV_MENU_STORE_INFORMATION_MORE_BEFORE: "nav-menu.store-information-more.before";
54
+ export const NAV_MENU_STORE_INFORMATION_MORE: "nav-menu.store-information-more";
55
+ export const NAV_MENU_STORE_INFORMATION_MORE_AFTER: "nav-menu.store-information-more.after";
56
+ export const NAV_MENU_STORE_INFORMATION_ABOUT_BEFORE: "nav-menu.store-information-about.before";
57
+ export const NAV_MENU_STORE_INFORMATION_ABOUT: "nav-menu.store-information-about";
58
+ export const NAV_MENU_STORE_INFORMATION_ABOUT_AFTER: "nav-menu.store-information-about.after";
59
+ export const NAV_MENU_MY_ACCOUNT_BEFORE: "nav-menu.my-account.before";
60
+ export const NAV_MENU_MY_ACCOUNT: "nav-menu.my-account";
61
+ export const NAV_MENU_MY_ACCOUNT_AFTER: "nav-menu.my-account.after";
62
+ export const NAV_MENU_LOGOUT_BEFORE: "nav-menu.logout.before";
63
+ export const NAV_MENU_LOGOUT: "nav-menu.logout";
64
+ export const NAV_MENU_LOGOUT_AFTER: "nav-menu.logout.after";
65
+ export const NO_RESULTS_CONTENT_BEFORE: "no-results.content.before";
66
+ export const NO_RESULTS_CONTENT: "no-results.content";
67
+ export const NO_RESULTS_CONTENT_AFTER: "no-results.content.after";
68
+ export const USER_MENU_CONTAINER_BEFORE: "user-menu.container.before";
69
+ export const USER_MENU_CONTAINER: "user-menu.container";
70
+ export const USER_MENU_CONTAINER_AFTER: "user-menu.container.after";
71
+ export const APP_BAR_DEFAULT_BEFORE: "app-bar.default.before";
72
+ export const APP_BAR_DEFAULT: "app-bar.default";
73
+ export const APP_BAR_DEFAULT_AFTER: "app-bar.default.after";
74
+ export const APP_BAR_BACK_BEFORE: "app-bar.back.before";
75
+ export const APP_BAR_BACK: "app-bar.back";
76
+ export const APP_BAR_BACK_AFTER: "app-bar.back.after";
77
+ export const APP_BAR_CLOSE_BEFORE: "app-bar.close.before";
78
+ export const APP_BAR_CLOSE: "app-bar.close";
79
+ export const APP_BAR_CLOSE_AFTER: "app-bar.close.after";
80
+ export const APP_BAR_SIMPLE_BEFORE: "app-bar.simple.before";
81
+ export const APP_BAR_SIMPLE: "app-bar.simple";
82
+ export const APP_BAR_SIMPLE_AFTER: "app-bar.simple.after";
83
+ export const APP_BAR_LEFT: "app-bar.left";
84
+ export const APP_BAR_LEFT_BEFORE: "app-bar.left.before";
85
+ export const APP_BAR_LEFT_AFTER: "app-bar.left.after";
86
+ export const APP_BAR_CENTER: "app-bar.center";
87
+ export const APP_BAR_CENTER_BEFORE: "app-bar.center.before";
88
+ export const APP_BAR_CENTER_AFTER: "app-bar.center.after";
89
+ export const APP_BAR_RIGHT: "app-bar.right";
90
+ export const APP_BAR_RIGHT_BEFORE: "app-bar.right.before";
91
+ export const APP_BAR_RIGHT_AFTER: "app-bar.right.after";
92
+ export const APP_BAR_BELOW: "app-bar.below";
93
+ export const APP_BAR_BELOW_BEFORE: "app-bar.below.before";
94
+ export const APP_BAR_BELOW_AFTER: "app-bar.below.after";
95
+ export const APP_BAR_CART_BUTTON: "app-bar.cart-button";
96
+ export const APP_BAR_CART_BUTTON_BEFORE: "app-bar.cart-button.before";
97
+ export const APP_BAR_CART_BUTTON_AFTER: "app-bar.cart-button.after";
98
+ export const APP_BAR_CONTENT: "app-bar.content";
99
+ export const APP_BAR_CONTENT_BEFORE: "app-bar.content.before";
100
+ export const APP_BAR_CONTENT_AFTER: "app-bar.content.after";
101
+ //# sourceMappingURL=Portals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Portals.d.ts","sourceRoot":"","sources":["../../constants/Portals.js"],"names":[],"mappings":"AAqCA,qBAAsB,QAAQ,CAAC;AAC/B,oBAAqB,OAAO,CAAC;AAC7B,mBAAoB,MAAM,CAAC;AAC3B,qBAAsB,QAAQ,CAAC;AAC/B,oBAAqB,OAAO,CAAC;AAC7B,oBAAqB,OAAO,CAAC;AAE7B,wCAA+C;AAC/C,sCAA6C;AAE7C,wDAAkE;AAClE,0CAAiD;AACjD,sDAAgE;AAEhE,wDAAkE;AAClE,0CAAiD;AACjD,sDAAgE;AAEhE,oDAA8D;AAC9D,sCAA6C;AAC7C,kDAA4D;AAE5D,8DAA2E;AAC3E,gDAA0D;AAC1D,4DAAyE;AAEzE,gFAA6F;AAC7F,kEAA4E;AAC5E,8EAA2F;AAE3F,gEAA0E;AAC1E,8DAAwE;AAExE,0DAAiE;AACjE,wEAAkF;AAClF,sEAAgF;AAEhF,sEAAgF;AAChF,oFAAiG;AACjG,kFAA+F;AAE/F,0DAAoE;AACpE,4CAAmD;AACnD,wDAAkE;AAElE,gEAA0E;AAC1E,kDAAyD;AACzD,8DAAwE;AAExE,4DAAsE;AACtE,8CAAqD;AACrD,0DAAoE;AAEpE,gEAA0E;AAC1E,kDAAyD;AACzD,8DAAwE;AAExE,kFAA4F;AAC5F,oEAA2E;AAC3E,gFAA0F;AAE1F,gEAA0E;AAC1E,kDAAyD;AACzD,8DAAwE;AAExE,oFAA8F;AAC9F,sEAA6E;AAC7E,kFAA4F;AAE5F,8FAAwG;AACxG,gFAAuF;AACvF,4FAAsG;AAEtG,gGAA0G;AAC1G,kFAAyF;AACzF,8FAAwG;AAExG,sEAAgF;AAChF,wDAA+D;AAC/D,oEAA8E;AAE9E,8DAAwE;AACxE,gDAAuD;AACvD,4DAAsE;AAEtE,oEAA8E;AAC9E,sDAA6D;AAC7D,kEAA4E;AAE5E,sEAAgF;AAChF,wDAA+D;AAC/D,oEAA8E;AAE9E,8DAAwE;AACxE,gDAAuD;AACvD,4DAAsE;AAEtE,wDAAkE;AAClE,0CAAiD;AACjD,sDAAgE;AAEhE,0DAAoE;AACpE,4CAAmD;AACnD,wDAAkE;AAElE,4DAAsE;AACtE,8CAAqD;AACrD,0DAAoE;AAEpE,0CAAiD;AACjD,wDAAkE;AAClE,sDAAgE;AAEhE,8CAAqD;AACrD,4DAAsE;AACtE,0DAAoE;AAEpE,4CAAmD;AACnD,0DAAoE;AACpE,wDAAkE;AAElE,4CAAmD;AACnD,0DAAoE;AACpE,wDAAkE;AAElE,wDAA+D;AAC/D,sEAAgF;AAChF,oEAA8E;AAE9E,gDAAuD;AACvD,8DAAqE;AACrE,4DAAmE"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Takes an object with app config values and safely injects it into the current app config.
3
+ * @param {Object} newConfig Contains new config fields to inject into the existing destination.
4
+ * @param {ArrayItemComparator|null} [arrayComparator] Defines how to compare array items.
5
+ */
6
+ export function writeToConfig(newConfig: Object, arrayComparator?: ArrayItemComparator | null): void;
7
+ /**
8
+ * @type {string} package version from package.json
9
+ */
10
+ export const pckVersion: string;
11
+ /**
12
+ * The components.json config from the theme.
13
+ * @type {Object}
14
+ */
15
+ export const componentsConfig: Object;
16
+ /**
17
+ * The theme name.
18
+ * @type {string}
19
+ */
20
+ export const themeName: string;
21
+ /**
22
+ * The resolved theme configuration.
23
+ * @type {ThemeConfig}
24
+ */
25
+ export const themeConfig: ThemeConfig;
26
+ /** @mixes ThemeColors */
27
+ export const themeColors: any;
28
+ /** @mixes ThemeShadows */
29
+ export const themeShadows: any;
30
+ /** @mixes ThemeVariables */
31
+ export const themeVariables: any;
32
+ /** @mixes ThemeIcons */
33
+ export const themeIcons: any;
34
+ /**
35
+ * A comparator for array items as they occur on different levels within the default app config.
36
+ * It identifies items uniquely to avoid duplicates when merging configs.
37
+ * Items identified as equal are merged together by the caller. Non-equals are added to the result.
38
+ *
39
+ * @type {ArrayItemComparator} Callback implementation for "assignObjectDeep"
40
+ * @param {string} path Allows identification of the current elements to be compared
41
+ * @param {*} prev Item that already exists in the config.
42
+ * @param {*} next Item to be compared against.
43
+ * @returns {boolean} Returns true if the items are considered equal and false if not
44
+ */
45
+ export const appConfigArrayItemComparator: ArrayItemComparator;
46
+ export function equalStructureComparator(path?: string, prev?: any, next?: any, prevIndex: number, nextIndex: number): boolean;
47
+ export const shopNumber: any;
48
+ export default appConfig;
49
+ /**
50
+ * The app.json config from the theme which will automatically be resolved.
51
+ * Be careful when changing existing properties on the fly, reassignments should never be done!
52
+ * @mixes AppConfig
53
+ */
54
+ declare const appConfig: string | {
55
+ appId: string;
56
+ browserConnector: boolean;
57
+ colors: {};
58
+ forgotPasswordUrl: null;
59
+ hasFavorites: boolean;
60
+ hasReviews: boolean;
61
+ showWriteReview: boolean;
62
+ language: string;
63
+ logo: string;
64
+ marketId: string;
65
+ publicPath: string;
66
+ shopName: string;
67
+ webCheckoutShopify: null;
68
+ hasNoScanner: boolean;
69
+ apiUrl: string;
70
+ shopCNAME: null;
71
+ currency: string;
72
+ showGmdMenuSubHeaders: boolean;
73
+ benchmark: boolean;
74
+ sentry: {};
75
+ theme: {};
76
+ cartShippingHideAnonymousLegacy: null;
77
+ cartShippingTextAnonymousLegacy: null;
78
+ variantSelectionMode: null;
79
+ product: {
80
+ variantPreselect: boolean;
81
+ };
82
+ cart: {};
83
+ scanner: {};
84
+ favorites: {};
85
+ tracking: {
86
+ hasWebTrackingEngage: boolean;
87
+ useSkuAsProductId: boolean;
88
+ };
89
+ webTrackingEngage: {
90
+ android: string;
91
+ ios: string;
92
+ };
93
+ } | undefined;
94
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/config/index.js"],"names":[],"mappings":"AAyJA;;;;GAIG;AACH,yCAHW,MAAM,oBACN,mBAAmB,GAAC,IAAI,QAKlC;AA/GD;;GAEG;AACH,yBAFU,MAAM,CAEsB;AAWtC;;;GAGG;AACH,+BAFU,MAAM,CAKd;AASF;;;GAGG;AACH,wBAFU,MAAM,CAEsC;AAEtD;;;GAGG;AACH,0BAFU,WAAW,CAEkC;AAEvD,yBAAyB;AACzB,8BAA8C;AAC9C,0BAA0B;AAC1B,+BAAgD;AAChD,4BAA4B;AAC5B,iCAAoD;AACpD,wBAAwB;AACxB,6BAA4C;AAK5C;;;;;;;;;;GAUG;AACH,2CANU,mBAAmB,CA8B3B;AAWK,gDAPI,MAAM,SACN,GAAC,SACD,GAAC,aACD,MAAM,aACN,MAAM,GACJ,OAAO,CAGK;AAiBzB,6BAAkE;;AA/FlE;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA8F"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @typedef {Object} ThemeConfig
3
+ * @property {ThemeColors} colors
4
+ * @property {ThemeShadows} shadows
5
+ * @property {ThemeVariables} variables
6
+ * @property {ThemeIcons} icons
7
+ */
8
+ /** @type {ThemeConfig} */
9
+ export const themeConfig: ThemeConfig;
10
+ export namespace mockThemeConfig {
11
+ let colors: ThemeColors;
12
+ let shadows: ThemeShadows;
13
+ let variables: ThemeVariables;
14
+ let icons: ThemeIcons;
15
+ }
16
+ export const themeName: "theme";
17
+ export type ThemeConfig = {
18
+ colors: ThemeColors;
19
+ shadows: ThemeShadows;
20
+ variables: ThemeVariables;
21
+ icons: ThemeIcons;
22
+ };
23
+ //# sourceMappingURL=mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../helpers/config/mock.js"],"names":[],"mappings":"AA2LA;;;;;;GAMG;AAEH,0BAA0B;AAC1B,0BADW,WAAW,CAWpB;;gBAjBY,WAAW;iBACX,YAAY;mBACZ,cAAc;eACd,UAAU;;AAkBxB,wBAAyB,OAAO,CAAC;;YArBnB,WAAW;aACX,YAAY;eACZ,cAAc;WACd,UAAU"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Builds and returns a new theme config object.
3
+ * @param {Object} appConfig The app config.
4
+ * @returns {Object}
5
+ */
6
+ export function buildThemeConfig(appConfig: Object): Object;
7
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../helpers/config/theme.js"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,4CAHW,MAAM,GACJ,MAAM,CAmClB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @callback ArrayItemComparator
3
+ * @param {string} path
4
+ * @param {*} prev
5
+ * @param {*} next
6
+ * @param {number} prevIndex
7
+ * @param {number} nextIndex
8
+ * @returns {boolean}
9
+ */
10
+ /**
11
+ * Takes a destination object and a source and merges the source object into the destination.
12
+ * Differing properties will replaced. References are kept where possible.
13
+ * @param {Object} destination Object to mutate
14
+ * @param {Object} source Object which contains the properties to assign to the destination
15
+ * @param {boolean} [warn] Enables log output on mismatching types. Defaults to 'true'.
16
+ * @param {ArrayItemComparator|null} [arrayComparator] Defines how to compare array items.
17
+ * @param {string} [path] Path that specifies the position of a given merge within the object tree.
18
+ */
19
+ export function assignObjectDeep(destination: Object, source: Object, warn?: boolean, arrayComparator?: ArrayItemComparator | null, path?: string): void;
20
+ export function shift([, ...newArray]: any[]): any[];
21
+ export function objectWithoutProps(obj: Object, keys?: any[]): Object;
22
+ export function isExternal(url: string): boolean;
23
+ export function isHTTPS(url?: string): boolean;
24
+ export function getActualImageSource(src: string, { width, height }: {
25
+ width: number;
26
+ height: number;
27
+ }): string;
28
+ export function findIndex(arr: any[], fn: Function): number;
29
+ export function bin2hex(str: string | number): string;
30
+ export function hex2bin(str: string): string | boolean;
31
+ export function sortObject(src: Object, comparator?: Function): Object;
32
+ export function transformDisplayOptions(displayOptions: string): string;
33
+ export function validateSelectorParams(selector: Function, defaultResult?: Object): Function;
34
+ export type ArrayItemComparator = (path: string, prev: any, next: any, prevIndex: number, nextIndex: number) => boolean;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/data/index.js"],"names":[],"mappings":"AAuNA;;;;;;;;GAQG;AACH;;;;;;;;GAQG;AACH,8CANW,MAAM,UACN,MAAM,SACN,OAAO,oBACP,mBAAmB,GAAC,IAAI,SACxB,MAAM,QA+DhB;AAtRM,qDAA2C;AAQ3C,wCAJI,MAAM,iBAEL,MAAM,CAYjB;AAOM,gCAHI,MAAM,GACL,OAAO,CAGwD;AAOpE,8BAHI,MAAM,GACL,OAAO,CAE4C;AAWxD,0CAPI,MAAM,qBAEd;IAA0B,KAAK,EAAvB,MAAM;IACY,MAAM,EAAxB,MAAM;CACd,GACU,MAAM,CAelB;AAQM,qDAFK,MAAM,CAYjB;AAQM,6BAJI,MAAM,GAAC,MAAM,GAEZ,MAAM,CAgBjB;AAQM,6BAJI,MAAM,GAEJ,MAAM,GAAC,OAAO,CAuB1B;AAgBM,gCAJI,MAAM,0BAEL,MAAM,CAoBjB;AAOM,wDAHI,MAAM,GACJ,MAAM,CAkBlB;AAQM,2EAHI,MAAM,YAShB;yCAIU,MAAM,QACN,GAAC,QACD,GAAC,aACD,MAAM,aACN,MAAM,KACJ,OAAO"}
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.array.includes.js";
1
2
  import "core-js/modules/es.array.reduce.js";
2
3
  import "core-js/modules/es.string.replace.js";
3
4
  import { logger } from '@shopgate/pwa-core/helpers';
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.array.includes.js";
1
2
  import "core-js/modules/es.array.reduce.js";
2
3
  import "core-js/modules/es.string.replace.js";
3
4
  import event from '@shopgate/pwa-core/classes/Event/index';
@@ -0,0 +1,30 @@
1
+ declare const _default: PortalCollection;
2
+ export default _default;
3
+ /**
4
+ * The portals collection.
5
+ */
6
+ declare class PortalCollection {
7
+ /**
8
+ * Returns the portal definitions.
9
+ * @return {Object}
10
+ */
11
+ getPortals(): Object;
12
+ /**
13
+ * Registers the portal definitions.
14
+ * @param {Object} [portals={}] The portals to register.
15
+ */
16
+ registerPortals(portals?: Object): void;
17
+ portals: Object | undefined;
18
+ /**
19
+ * Registers the portal config.
20
+ * @param {Object} [config={}] The portals config.
21
+ */
22
+ registerConfig(config?: Object): void;
23
+ config: Object | undefined;
24
+ /**
25
+ * Returns the portal config.
26
+ * @return {Object}
27
+ */
28
+ getConfig(): Object;
29
+ }
30
+ //# sourceMappingURL=portalCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portalCollection.d.ts","sourceRoot":"","sources":["../../../helpers/portals/portalCollection.js"],"names":[],"mappings":";;AAAA;;GAEG;AACH;IACE;;;OAGG;IACH,cAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,0BAFW,MAAM,QAIhB;IADC,4BAAsB;IAGxB;;;OAGG;IACH,wBAFW,MAAM,QAIhB;IADC,2BAAoB;IAGtB;;;OAGG;IACH,aAFY,MAAM,CAIjB;CACF"}
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.array.includes.js";
1
2
  import { logger } from '@shopgate/pwa-core/helpers';
2
3
  import { isNumber } from "../validation";
3
4
 
@@ -0,0 +1,10 @@
1
+ export function isArray(prop: any): boolean;
2
+ export function isObject(prop: any): boolean;
3
+ export function isNumeric(prop: any): boolean;
4
+ export function isNumber(prop: any): boolean;
5
+ export function isInteger(prop: any): boolean;
6
+ export function isBoolean(prop: any): boolean;
7
+ export function isFunction(prop: any): boolean;
8
+ export function isUndefined(prop: any): boolean;
9
+ export function isPromise(prop: any): boolean;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/validation/index.js"],"names":[],"mappings":"AAKO,8BAHI,GAAC,GACA,OAAO,CAIlB;AAOM,+BAHI,GAAC,GACA,OAAO,CAIlB;AAOM,gCAHI,GAAC,GACA,OAAO,CAKlB;AAOM,+BAHI,GAAC,GACA,OAAO,CAKlB;AAOM,gCAHI,GAAC,GACA,OAAO,CAIlB;AAOM,gCAHI,GAAC,GACA,OAAO,CAIlB;AAOM,iCAHI,GAAC,GACA,OAAO,CAIlB;AAOM,kCAHI,GAAC,GACA,OAAO,CAIlB;AAOM,gCAHI,GAAC,GACA,OAAO,CAMlB"}