@shopgate/engage 7.32.0-beta.1 → 7.32.0-beta.3
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/README.md +0 -1
- package/admin-preview/constants/index.d.ts +0 -12
- package/admin-preview/constants/index.d.ts.map +1 -1
- package/admin-preview/constants/index.js +0 -16
- package/admin-preview/helpers/_internal/detection.d.ts +53 -0
- package/admin-preview/helpers/_internal/detection.d.ts.map +1 -0
- package/admin-preview/helpers/_internal/detection.js +93 -0
- package/admin-preview/helpers/index.d.ts +7 -0
- package/admin-preview/helpers/index.d.ts.map +1 -1
- package/admin-preview/helpers/index.js +12 -4
- package/cart/components/CartItem/CartItemProductProvider.connector.js +0 -2
- package/cart/components/CartItem/CartItemProductProvider.js +3 -30
- package/cart/components/CartItem/CartItemProductProvider.types.js +0 -1
- package/cart/components/PaymentBar/PaymentBarContent.js +1 -1
- package/components/Logo/index.d.ts.map +1 -1
- package/components/Logo/index.js +3 -6
- package/components/PickerUtilize/index.d.ts +2 -1
- package/components/PickerUtilize/index.d.ts.map +1 -1
- package/components/View/components/Above/index.d.ts.map +1 -1
- package/components/View/components/Above/index.js +3 -1
- package/components/View/components/Below/index.d.ts.map +1 -1
- package/components/View/components/Below/index.js +3 -1
- package/components/View/components/Content/index.d.ts +2 -1
- package/components/View/components/Content/index.d.ts.map +1 -1
- package/components/v2/ButtonBase/Ripple.d.ts +2 -1
- package/components/v2/ButtonBase/Ripple.d.ts.map +1 -1
- package/development/components/SimulatedInsets/SimulatedInsetBottom.js +3 -3
- package/development/components/SimulatedInsets/SimulatedInsetTop.js +2 -2
- package/favorites/components/Item/Item.js +5 -2
- package/favorites/components/Lists/Lists.js +13 -1
- package/locations/components/FulfillmentSheet/FulfillmentSheetContent.js +4 -8
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +1 -5
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +1 -5
- package/package.json +11 -11
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.js +2 -2
- package/page/constants/index.js +5 -3
- package/product/components/FilterBar/components/Content/components/FilterButton/index.js +2 -6
- package/product/components/FilterBar/components/Content/components/Sort/index.js +1 -5
- package/product/components/ProductName/ProductName.d.ts +1 -1
- package/product/components/ProductName/ProductName.d.ts.map +1 -1
- package/product/components/ProductName/ProductNameContent.d.ts +2 -1
- package/product/components/ProductName/ProductNameContent.d.ts.map +1 -1
- package/product/components/ProductRatingStars/ProductRatingStars.d.ts +1 -1
- package/product/components/RelationsSlider/RelationsSheet.js +1 -5
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +1 -1
- package/styles/index.d.ts +1 -1
- package/styles/index.d.ts.map +1 -1
- package/styles/index.js +1 -1
- package/styles/theme/createTheme/createComponents.d.ts +2 -2
- package/styles/theme/createTheme/createComponents.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.js +0 -1
- package/styles/theme/createTheme/createComponents.types.d.ts +20 -0
- package/styles/theme/createTheme/createComponents.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.types.js +20 -0
- package/styles/theme/createTheme/createSpacing.js +4 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts +2 -2
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts.map +1 -1
- package/styles/theme/createTheme/index.d.ts.map +1 -1
- package/styles/theme/createTheme/index.js +2 -1
- package/styles/theme/createTheme/layout.d.ts +23 -0
- package/styles/theme/createTheme/layout.d.ts.map +1 -0
- package/styles/theme/createTheme/layout.js +20 -0
- package/styles/theme/createTheme/transitions.d.ts +4 -0
- package/styles/theme/createTheme/transitions.js +3 -1
- package/styles/theme/createTheme/types.d.ts +25 -4
- package/styles/theme/createTheme/types.d.ts.map +1 -1
- package/styles/theme/createTheme/types.js +8 -1
- package/styles/theme/hocs/index.d.ts +2 -0
- package/styles/theme/hocs/index.d.ts.map +1 -0
- package/styles/theme/hocs/index.js +1 -0
- package/styles/theme/hocs/withTheme.d.ts +21 -0
- package/styles/theme/hocs/withTheme.d.ts.map +1 -0
- package/styles/theme/hocs/withTheme.js +33 -0
- package/styles/theme/index.d.ts +1 -0
- package/styles/theme/index.d.ts.map +1 -1
- package/styles/theme/index.js +2 -1
- package/styles/theme/providers/ActiveBreakpointProvider.d.ts +1 -1
- package/styles/theme/providers/ThemeProvider.d.ts +3 -3
- package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
- package/styles/theme/providers/ThemeProvider.js +11 -15
package/README.md
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
<div align="center">
|
|
10
10
|
|
|
11
|
-
[](https://travis-ci.org/shopgate/pwa)
|
|
12
11
|
[](https://coveralls.io/github/shopgate/pwa?branch=v6.X)
|
|
13
12
|
[](https://github.com/shopgate/pwa/releases)
|
|
14
13
|
[](https://lernajs.io/)
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
export declare const PAGE_PREVIEW_PATTERN = "/shopgate-internal-page-preview";
|
|
2
|
-
/**
|
|
3
|
-
* Whether the app is currently in page admin preview mode.
|
|
4
|
-
*/
|
|
5
|
-
export declare const IS_PAGE_ADMIN_PREVIEW_ACTIVE: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Whether the app is currently in frontend settings admin preview mode.
|
|
8
|
-
*/
|
|
9
|
-
export declare const IS_FRONTEND_SETTINGS_ADMIN_PREVIEW_ACTIVE: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Whether the app is currently in admin preview mode (pages or frontend settings).
|
|
12
|
-
*/
|
|
13
|
-
export declare const IS_ADMIN_PREVIEW_ACTIVE: boolean;
|
|
14
2
|
/**
|
|
15
3
|
* List of allowed origins for cms page preview iFrame communication.
|
|
16
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../admin-preview/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,oCAAoC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../admin-preview/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,oCAAoC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,6BAA6B,UAMzC,CAAC"}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import "core-js/modules/es.array.includes.js";
|
|
2
1
|
export const PAGE_PREVIEW_PATTERN = '/shopgate-internal-page-preview';
|
|
3
2
|
|
|
4
|
-
/**
|
|
5
|
-
* Whether the app is currently in page admin preview mode.
|
|
6
|
-
*/
|
|
7
|
-
export const IS_PAGE_ADMIN_PREVIEW_ACTIVE = window.location.pathname.startsWith(PAGE_PREVIEW_PATTERN);
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Whether the app is currently in frontend settings admin preview mode.
|
|
11
|
-
*/
|
|
12
|
-
export const IS_FRONTEND_SETTINGS_ADMIN_PREVIEW_ACTIVE = window.location.search.includes('frontendSettingsPreview=true');
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Whether the app is currently in admin preview mode (pages or frontend settings).
|
|
16
|
-
*/
|
|
17
|
-
export const IS_ADMIN_PREVIEW_ACTIVE = IS_PAGE_ADMIN_PREVIEW_ACTIVE || IS_FRONTEND_SETTINGS_ADMIN_PREVIEW_ACTIVE;
|
|
18
|
-
|
|
19
3
|
/**
|
|
20
4
|
* List of allowed origins for cms page preview iFrame communication.
|
|
21
5
|
*/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal to the admin-preview package - do not import this module from anywhere else. Consume
|
|
3
|
+
* the isAdminPreviewActive / isPageAdminPreviewActive / isFrontendSettingsAdminPreviewActive
|
|
4
|
+
* helpers from @shopgate/engage/admin-preview/helpers instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FRONTEND_SETTINGS_PREVIEW_PARAM = "frontendSettingsPreview=true";
|
|
7
|
+
/**
|
|
8
|
+
* Detects whether the app is in page admin preview mode. Once detected, the result is latched for
|
|
9
|
+
* the lifetime of the document, because the url is not guaranteed to keep the preview marker.
|
|
10
|
+
* @returns True if the app is in page admin preview mode, false otherwise.
|
|
11
|
+
*/
|
|
12
|
+
export declare const detectPageAdminPreview: () => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Detects whether the app is in frontend settings admin preview mode. Once detected, the result is
|
|
15
|
+
* latched for the lifetime of the document, because the app keeps navigating while the preview is
|
|
16
|
+
* open and the query param only exists on the url it started on.
|
|
17
|
+
* @returns True if the app is in frontend settings admin preview mode, false otherwise.
|
|
18
|
+
*/
|
|
19
|
+
export declare const detectFrontendSettingsAdminPreview: () => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Detects whether the app is in admin preview mode (pages or frontend settings).
|
|
22
|
+
* @returns True if the app is in admin preview mode, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
export declare const detectAdminPreview: () => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the current detection state. Exposed on window as SGAdminPreviewDebug so the values can
|
|
27
|
+
* be inspected on a deployed build, from the console of the preview iframe:
|
|
28
|
+
*
|
|
29
|
+
* window.SGAdminPreviewDebug()
|
|
30
|
+
*
|
|
31
|
+
* Compare initialHref with currentHref to see whether the url changed since the app booted, and
|
|
32
|
+
* check latched to see whether a result came from the latch rather than the current url.
|
|
33
|
+
* @returns A snapshot of everything detection depends on.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getAdminPreviewDebugInfo: () => {
|
|
36
|
+
initialHref: string;
|
|
37
|
+
currentHref: string;
|
|
38
|
+
pathname: string;
|
|
39
|
+
search: string;
|
|
40
|
+
urlChangedSinceBoot: boolean;
|
|
41
|
+
isInIframe: boolean;
|
|
42
|
+
referrer: string;
|
|
43
|
+
latched: {
|
|
44
|
+
page: boolean;
|
|
45
|
+
frontendSettings: boolean;
|
|
46
|
+
};
|
|
47
|
+
detected: {
|
|
48
|
+
page: boolean;
|
|
49
|
+
frontendSettings: boolean;
|
|
50
|
+
any: boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../../../admin-preview/helpers/_internal/detection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,+BAA+B,iCAAiC,CAAC;AAsB9E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAO,OAQzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,QAAO,OAWrD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,OAC4B,CAAC;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;CAiBnC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import "core-js/modules/es.array.includes.js";
|
|
2
|
+
/**
|
|
3
|
+
* Internal to the admin-preview package - do not import this module from anywhere else. Consume
|
|
4
|
+
* the isAdminPreviewActive / isPageAdminPreviewActive / isFrontendSettingsAdminPreviewActive
|
|
5
|
+
* helpers from @shopgate/engage/admin-preview/helpers instead.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { PAGE_PREVIEW_PATTERN } from "../../constants";
|
|
9
|
+
export const FRONTEND_SETTINGS_PREVIEW_PARAM = 'frontendSettingsPreview=true';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The url as it was when this module was first evaluated. Captured here because detection can run
|
|
13
|
+
* again later, when the url may already have been rewritten.
|
|
14
|
+
*/
|
|
15
|
+
const INITIAL_HREF = window.location.href;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Preview mode is latched in memory rather than persisted. Session storage is scoped per origin
|
|
19
|
+
* per tab, not per iframe - the admin shows the preview in same-origin iframes on several screens
|
|
20
|
+
* within one tab, so a persisted flag from one screen would leak into the next. Module state is
|
|
21
|
+
* per document, so each iframe gets its own.
|
|
22
|
+
*
|
|
23
|
+
* The latches only ever go false -> true. Detection must not fall back to re-reading the url,
|
|
24
|
+
* because the frontend settings preview navigates the app normally: once the admin opens another
|
|
25
|
+
* page, the query param is gone from the url even though preview mode is still on.
|
|
26
|
+
*/
|
|
27
|
+
let pageAdminPreviewLatched = false;
|
|
28
|
+
let frontendSettingsAdminPreviewLatched = false;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Detects whether the app is in page admin preview mode. Once detected, the result is latched for
|
|
32
|
+
* the lifetime of the document, because the url is not guaranteed to keep the preview marker.
|
|
33
|
+
* @returns True if the app is in page admin preview mode, false otherwise.
|
|
34
|
+
*/
|
|
35
|
+
export const detectPageAdminPreview = () => {
|
|
36
|
+
if (pageAdminPreviewLatched) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
pageAdminPreviewLatched = window.location.pathname.startsWith(PAGE_PREVIEW_PATTERN);
|
|
40
|
+
return pageAdminPreviewLatched;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Detects whether the app is in frontend settings admin preview mode. Once detected, the result is
|
|
45
|
+
* latched for the lifetime of the document, because the app keeps navigating while the preview is
|
|
46
|
+
* open and the query param only exists on the url it started on.
|
|
47
|
+
* @returns True if the app is in frontend settings admin preview mode, false otherwise.
|
|
48
|
+
*/
|
|
49
|
+
export const detectFrontendSettingsAdminPreview = () => {
|
|
50
|
+
if (frontendSettingsAdminPreviewLatched) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
frontendSettingsAdminPreviewLatched = window.location.search.includes(FRONTEND_SETTINGS_PREVIEW_PARAM);
|
|
54
|
+
return frontendSettingsAdminPreviewLatched;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Detects whether the app is in admin preview mode (pages or frontend settings).
|
|
59
|
+
* @returns True if the app is in admin preview mode, false otherwise.
|
|
60
|
+
*/
|
|
61
|
+
export const detectAdminPreview = () => detectPageAdminPreview() || detectFrontendSettingsAdminPreview();
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns the current detection state. Exposed on window as SGAdminPreviewDebug so the values can
|
|
65
|
+
* be inspected on a deployed build, from the console of the preview iframe:
|
|
66
|
+
*
|
|
67
|
+
* window.SGAdminPreviewDebug()
|
|
68
|
+
*
|
|
69
|
+
* Compare initialHref with currentHref to see whether the url changed since the app booted, and
|
|
70
|
+
* check latched to see whether a result came from the latch rather than the current url.
|
|
71
|
+
* @returns A snapshot of everything detection depends on.
|
|
72
|
+
*/
|
|
73
|
+
export const getAdminPreviewDebugInfo = () => ({
|
|
74
|
+
initialHref: INITIAL_HREF,
|
|
75
|
+
currentHref: window.location.href,
|
|
76
|
+
pathname: window.location.pathname,
|
|
77
|
+
search: window.location.search,
|
|
78
|
+
urlChangedSinceBoot: INITIAL_HREF !== window.location.href,
|
|
79
|
+
isInIframe: window.parent !== window,
|
|
80
|
+
referrer: document.referrer,
|
|
81
|
+
latched: {
|
|
82
|
+
page: pageAdminPreviewLatched,
|
|
83
|
+
frontendSettings: frontendSettingsAdminPreviewLatched
|
|
84
|
+
},
|
|
85
|
+
detected: {
|
|
86
|
+
page: detectPageAdminPreview(),
|
|
87
|
+
frontendSettings: detectFrontendSettingsAdminPreview(),
|
|
88
|
+
any: detectAdminPreview()
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// @ts-expect-error - debug-only global, intentionally not on the Window type.
|
|
93
|
+
window.SGAdminPreviewDebug = getAdminPreviewDebugInfo;
|
|
@@ -13,4 +13,11 @@ export declare const isPageAdminPreviewActive: () => boolean;
|
|
|
13
13
|
* @returns True if the app is in frontend settings admin preview mode, false otherwise.
|
|
14
14
|
*/
|
|
15
15
|
export declare const isFrontendSettingsAdminPreviewActive: () => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if navigation is blocked. Page admin preview renders a single page in an iframe, so
|
|
18
|
+
* leaving that page would only ever show the admin something it did not ask to preview.
|
|
19
|
+
* Frontend settings preview is not affected - it previews styling on the regular app.
|
|
20
|
+
* @returns True if the app must not navigate, false otherwise.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isNavigationBlocked: () => boolean;
|
|
16
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../admin-preview/helpers/index.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../admin-preview/helpers/index.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,OAClB,CAAC;AAEvB;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAO,OAClB,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,oCAAoC,QAAO,OAClB,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAAO,OACX,CAAC"}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { detectAdminPreview, detectFrontendSettingsAdminPreview, detectPageAdminPreview } from "./_internal/detection";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Checks if the app is currently in admin preview mode (pages or frontend settings).
|
|
5
5
|
* @returns True if the app is in admin preview mode, false otherwise.
|
|
6
6
|
*/
|
|
7
|
-
export const isAdminPreviewActive = () =>
|
|
7
|
+
export const isAdminPreviewActive = () => detectAdminPreview();
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Checks if the app is currently in page admin preview mode.
|
|
11
11
|
* @returns True if the app is in page admin preview mode, false otherwise.
|
|
12
12
|
*/
|
|
13
|
-
export const isPageAdminPreviewActive = () =>
|
|
13
|
+
export const isPageAdminPreviewActive = () => detectPageAdminPreview();
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Checks if the app is currently in frontend settings admin preview mode.
|
|
17
17
|
* @returns True if the app is in frontend settings admin preview mode, false otherwise.
|
|
18
18
|
*/
|
|
19
|
-
export const isFrontendSettingsAdminPreviewActive = () =>
|
|
19
|
+
export const isFrontendSettingsAdminPreviewActive = () => detectFrontendSettingsAdminPreview();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Checks if navigation is blocked. Page admin preview renders a single page in an iframe, so
|
|
23
|
+
* leaving that page would only ever show the admin something it did not ask to preview.
|
|
24
|
+
* Frontend settings preview is not affected - it previews styling on the regular app.
|
|
25
|
+
* @returns True if the app must not navigate, false otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export const isNavigationBlocked = () => isPageAdminPreviewActive();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { connect } from 'react-redux';
|
|
2
|
-
import { isAndroid } from '@shopgate/pwa-common/selectors/client';
|
|
3
2
|
import deleteProductsFromCart from '@shopgate/pwa-common-commerce/cart/actions/deleteProductsFromCart';
|
|
4
3
|
import updateProductsInCart from '@shopgate/pwa-common-commerce/cart/actions/updateProductsInCart';
|
|
5
4
|
import { getCurrency } from '@shopgate/pwa-common-commerce/cart/selectors';
|
|
@@ -15,7 +14,6 @@ import { getCurrency } from '@shopgate/pwa-common-commerce/cart/selectors';
|
|
|
15
14
|
* @returns {StateProps} The extended component props.
|
|
16
15
|
*/
|
|
17
16
|
const mapStateToProps = state => ({
|
|
18
|
-
isAndroid: isAndroid(state),
|
|
19
17
|
currency: getCurrency(state)
|
|
20
18
|
});
|
|
21
19
|
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import "core-js/modules/es.regexp.flags.js";
|
|
2
2
|
import React, { useMemo, useCallback, useState, useRef } from 'react';
|
|
3
|
-
import { getAbsoluteHeight } from '@shopgate/pwa-common/helpers/dom';
|
|
4
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
3
|
import { CART_ITEM_TYPE_PRODUCT } from '@shopgate/pwa-common-commerce/cart/constants';
|
|
6
4
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { CART_INPUT_AUTO_SCROLL_DELAY } from "../../cart.constants";
|
|
8
5
|
import Context from "./CartItemProductProvider.context";
|
|
9
6
|
import connect from "./CartItemProductProvider.connector";
|
|
10
7
|
import CartItemProductProviderLegacy from "./CartItemProductProviderLegacy";
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
const {
|
|
13
|
-
variables
|
|
14
|
-
} = themeConfig;
|
|
15
8
|
|
|
16
9
|
/**
|
|
17
10
|
* @typedef {import('./CartItemProductProvider.types').OwnProps} OwnProps
|
|
@@ -28,6 +21,7 @@ const {
|
|
|
28
21
|
* @param {Props} props The component props.
|
|
29
22
|
* @returns {JSX.Element}
|
|
30
23
|
*/
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
25
|
const CartItemProductProvider = ({
|
|
32
26
|
currency,
|
|
33
27
|
deleteProduct,
|
|
@@ -36,7 +30,6 @@ const CartItemProductProvider = ({
|
|
|
36
30
|
cartItem,
|
|
37
31
|
isEditable,
|
|
38
32
|
children,
|
|
39
|
-
isAndroid,
|
|
40
33
|
currencyOverride
|
|
41
34
|
}) => {
|
|
42
35
|
const {
|
|
@@ -66,25 +59,6 @@ const CartItemProductProvider = ({
|
|
|
66
59
|
updateProduct(id, updatedQuantity);
|
|
67
60
|
}, [id, updateProduct]);
|
|
68
61
|
const toggleEditMode = useCallback(isEnabled => {
|
|
69
|
-
if (isAndroid && isEnabled) {
|
|
70
|
-
/**
|
|
71
|
-
* When the user focuses the quantity input, the keyboard will pop up an overlap the input.
|
|
72
|
-
* Therefor the input has to be scrolled into the viewport again. Since between the focus and
|
|
73
|
-
* the keyboard appearance some time ticks away, the execution of the scroll code is delayed.
|
|
74
|
-
*
|
|
75
|
-
* This should not happen on iOS devices, since their web views behave different.
|
|
76
|
-
*/
|
|
77
|
-
setTimeout(() => {
|
|
78
|
-
const yOffset = -(window.innerHeight / 2) + getAbsoluteHeight(cartItemRef.current) + variables.paymentBar.height;
|
|
79
|
-
if (cartItemRef.current) {
|
|
80
|
-
cartItemRef.current.scrollIntoView({
|
|
81
|
-
behavior: 'smooth',
|
|
82
|
-
yOffset
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}, CART_INPUT_AUTO_SCROLL_DELAY);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
62
|
// Give the keyboard some time to slide out after blur, before further actions are taken.
|
|
89
63
|
setTimeout(() => {
|
|
90
64
|
if (onFocus) {
|
|
@@ -92,7 +66,7 @@ const CartItemProductProvider = ({
|
|
|
92
66
|
}
|
|
93
67
|
}, isEnabled ? 300 : 0);
|
|
94
68
|
setEditMode(isEnabled);
|
|
95
|
-
}, [
|
|
69
|
+
}, [onFocus]);
|
|
96
70
|
const value = useMemo(() => {
|
|
97
71
|
const isLinkable = flags?.disableLink !== true;
|
|
98
72
|
const allowQuantityChange = flags?.disableQuantityField !== true;
|
|
@@ -140,7 +114,6 @@ CartItemProductProvider.defaultProps = {
|
|
|
140
114
|
isEditable: true,
|
|
141
115
|
onFocus: () => {},
|
|
142
116
|
currencyOverride: null,
|
|
143
|
-
currency: null
|
|
144
|
-
isAndroid: false
|
|
117
|
+
currency: null
|
|
145
118
|
};
|
|
146
119
|
export default connect(CartItemProductProvider);
|
|
@@ -20,7 +20,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
20
20
|
boxShadow: '0 -4px 5px -2px rgba(0, 0, 0, 0.1)',
|
|
21
21
|
position: 'relative',
|
|
22
22
|
zIndex: 2,
|
|
23
|
-
paddingBottom:
|
|
23
|
+
paddingBottom: theme.layout.safeArea.bottom
|
|
24
24
|
},
|
|
25
25
|
container: {
|
|
26
26
|
padding: isIOSTheme() ? theme.spacing(1) : theme.spacing(2),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Logo/index.jsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Logo/index.jsx"],"names":[],"mappings":";;;;;QAyBY,GAAG;;;;;;;;;;;;;;;;;;;sBAxBO,YAAY"}
|
package/components/Logo/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
|
-
import appConfig
|
|
4
|
+
import appConfig from '@shopgate/pwa-common/helpers/config';
|
|
5
5
|
import noop from 'lodash/noop';
|
|
6
6
|
import connect from "./connector";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const {
|
|
9
|
-
variables
|
|
10
|
-
} = themeConfig;
|
|
11
8
|
const useStyles = makeStyles()(theme => ({
|
|
12
9
|
container: {
|
|
13
10
|
alignItems: 'center',
|
|
@@ -16,8 +13,8 @@ const useStyles = makeStyles()(theme => ({
|
|
|
16
13
|
},
|
|
17
14
|
image: {
|
|
18
15
|
margin: '0 auto',
|
|
19
|
-
maxHeight:
|
|
20
|
-
maxWidth: `calc(var(--page-content-width) - ${
|
|
16
|
+
maxHeight: theme.components.navigator.height,
|
|
17
|
+
maxWidth: `calc(var(--page-content-width) - (${theme.components.navigator.height} * 3) - ${theme.spacing(4)}px)`,
|
|
21
18
|
overflow: 'hidden',
|
|
22
19
|
textOverflow: 'ellipsis',
|
|
23
20
|
whiteSpace: 'nowrap'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/PickerUtilize/index.jsx"],"names":[],"mappings":"AAkHe
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/PickerUtilize/index.jsx"],"names":[],"mappings":"AAkHe,yDAMd;;kBAxH0C,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Above/index.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Above/index.jsx"],"names":[],"mappings":";AAIA;;GAEG;AACH,8BAFa,GAAG,CAoBf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTheme } from '@shopgate/engage/styles';
|
|
2
3
|
import { ViewContext } from "../../context";
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -6,6 +7,7 @@ import { ViewContext } from "../../context";
|
|
|
6
7
|
*/
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
function ViewAbove() {
|
|
10
|
+
const theme = useTheme();
|
|
9
11
|
return /*#__PURE__*/_jsx(ViewContext.Consumer, {
|
|
10
12
|
children: ({
|
|
11
13
|
top
|
|
@@ -15,7 +17,7 @@ function ViewAbove() {
|
|
|
15
17
|
}
|
|
16
18
|
const styles = {
|
|
17
19
|
flexShrink: 0,
|
|
18
|
-
height: `calc(${top}px +
|
|
20
|
+
height: `calc(${top}px + ${theme.layout.safeArea.top})`
|
|
19
21
|
};
|
|
20
22
|
return /*#__PURE__*/_jsx("div", {
|
|
21
23
|
"aria-hidden": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Below/index.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Below/index.jsx"],"names":[],"mappings":";AAIA;;GAEG;AACH,8BAFa,GAAG,CAoBf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTheme } from '@shopgate/engage/styles';
|
|
2
3
|
import { ViewContext } from "../../context";
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -6,6 +7,7 @@ import { ViewContext } from "../../context";
|
|
|
6
7
|
*/
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
function ViewBelow() {
|
|
10
|
+
const theme = useTheme();
|
|
9
11
|
return /*#__PURE__*/_jsx(ViewContext.Consumer, {
|
|
10
12
|
children: ({
|
|
11
13
|
bottom
|
|
@@ -15,7 +17,7 @@ function ViewBelow() {
|
|
|
15
17
|
}
|
|
16
18
|
const styles = {
|
|
17
19
|
flexShrink: 0,
|
|
18
|
-
height: `calc(${bottom}px +
|
|
20
|
+
height: `calc(${bottom}px + ${theme.layout.safeArea.bottom})`
|
|
19
21
|
};
|
|
20
22
|
return /*#__PURE__*/_jsx("div", {
|
|
21
23
|
"aria-hidden": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Content/index.jsx"],"names":[],"mappings":"AAiQe
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../components/View/components/Content/index.jsx"],"names":[],"mappings":"AAiQe,yDAUd;;kBApQM,OAAO"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { RippleItem as RippleModel } from './hooks';
|
|
2
3
|
interface RippleProps {
|
|
3
4
|
ripples: RippleModel[];
|
|
@@ -5,6 +6,6 @@ interface RippleProps {
|
|
|
5
6
|
/**
|
|
6
7
|
* The Ripple component renders the ripple effect for button interactions.
|
|
7
8
|
*/
|
|
8
|
-
declare function Ripple({ ripples }: RippleProps):
|
|
9
|
+
declare function Ripple({ ripples }: RippleProps): React.JSX.Element;
|
|
9
10
|
export default Ripple;
|
|
10
11
|
//# sourceMappingURL=Ripple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ripple.d.ts","sourceRoot":"","sources":["../../../../components/v2/ButtonBase/Ripple.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Ripple.d.ts","sourceRoot":"","sources":["../../../../components/v2/ButtonBase/Ripple.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAqDzD,UAAU,WAAW;IACnB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,iBAAS,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,WAAW,qBAiBvC;AAwDD,eAAe,MAAM,CAAC"}
|
|
@@ -2,14 +2,14 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const useStyles = makeStyles()({
|
|
5
|
+
const useStyles = makeStyles()(theme => ({
|
|
6
6
|
container: {
|
|
7
7
|
position: 'fixed',
|
|
8
8
|
bottom: 0,
|
|
9
9
|
display: 'flex',
|
|
10
10
|
justifyContent: 'center',
|
|
11
11
|
alignItems: 'center',
|
|
12
|
-
height:
|
|
12
|
+
height: theme.layout.safeArea.bottom,
|
|
13
13
|
width: '100%',
|
|
14
14
|
zIndex: 10000000,
|
|
15
15
|
pointerEvents: 'auto',
|
|
@@ -26,7 +26,7 @@ const useStyles = makeStyles()({
|
|
|
26
26
|
border: '1px solid rgba(255, 255, 255, 0.5)',
|
|
27
27
|
boxSizing: 'content-box'
|
|
28
28
|
}
|
|
29
|
-
});
|
|
29
|
+
}));
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Renders a simulated iOS bottom inset in development.
|
|
@@ -11,7 +11,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
11
11
|
display: 'flex',
|
|
12
12
|
justifyContent: 'space-between',
|
|
13
13
|
alignItems: 'center',
|
|
14
|
-
height:
|
|
14
|
+
height: theme.layout.safeArea.top,
|
|
15
15
|
width: '100%',
|
|
16
16
|
zIndex: 10000000,
|
|
17
17
|
pointerEvents: 'auto',
|
|
@@ -38,7 +38,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
38
38
|
notch: {
|
|
39
39
|
flex: 1,
|
|
40
40
|
background: 'black',
|
|
41
|
-
height:
|
|
41
|
+
height: `calc(${theme.layout.safeArea.top} - 16px)`,
|
|
42
42
|
maxWidth: 150,
|
|
43
43
|
borderRadius: 16,
|
|
44
44
|
border: '1px solid rgba(255, 255, 255, 0.5)'
|
|
@@ -193,8 +193,11 @@ const FavoriteItem = ({
|
|
|
193
193
|
});
|
|
194
194
|
return false;
|
|
195
195
|
}
|
|
196
|
-
if (hasNewServices() &&
|
|
197
|
-
// Product is not orderable for ROPE
|
|
196
|
+
if (hasNewServices() && isRopeProductOrderable === false) {
|
|
197
|
+
// Product is explicitly not orderable for ROPE (a fulfillment method other than direct ship
|
|
198
|
+
// that isn't available for the current product/location). Users need to correct the
|
|
199
|
+
// selection on the PDP, so redirect. `null` means ROPE doesn't apply (direct ship) and must
|
|
200
|
+
// fall through to the regular add-to-cart below.
|
|
198
201
|
historyPush({
|
|
199
202
|
pathname: productLink
|
|
200
203
|
});
|
|
@@ -9,7 +9,7 @@ import updateFavoritesList from '@shopgate/pwa-common-commerce/favorites/actions
|
|
|
9
9
|
import removeFavoritesList from '@shopgate/pwa-common-commerce/favorites/actions/removeFavoritesList';
|
|
10
10
|
import { removeFavorites } from '@shopgate/pwa-common-commerce/favorites/actions/toggleFavorites';
|
|
11
11
|
import addProductsToCart from '@shopgate/pwa-common-commerce/cart/actions/addProductsToCart';
|
|
12
|
-
import { FulfillmentSheet, MULTI_LINE_RESERVE, STAGE_SELECT_STORE } from '@shopgate/engage/locations';
|
|
12
|
+
import { FulfillmentSheet, MULTI_LINE_RESERVE, STAGE_SELECT_STORE, DIRECT_SHIP } from '@shopgate/engage/locations';
|
|
13
13
|
import { openSheet } from '@shopgate/engage/locations/providers/FulfillmentProvider';
|
|
14
14
|
import { getWishlistMode } from '@shopgate/engage/settings/selectors/shopSettings';
|
|
15
15
|
import { WISHLIST_MODE_PERSIST_ON_ADD } from '@shopgate/engage/settings/constants/shopSettings';
|
|
@@ -174,6 +174,18 @@ const FavoriteLists = ({
|
|
|
174
174
|
[activeFulfillmentMethod] = availableFulfillmentMethods;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
// Direct ship needs neither a location nor an explicit method selection. When it's the only
|
|
178
|
+
// available fulfillment method for the product, add straight to the cart without prompting
|
|
179
|
+
// the user with the fulfillment method chooser.
|
|
180
|
+
if (!activeFulfillmentMethod && availableFulfillmentMethods.length === 1 && availableFulfillmentMethods[0] === DIRECT_SHIP) {
|
|
181
|
+
addToCart([{
|
|
182
|
+
productId: product.id,
|
|
183
|
+
quantity
|
|
184
|
+
}]);
|
|
185
|
+
promiseRef.current.resolve();
|
|
186
|
+
return promise;
|
|
187
|
+
}
|
|
188
|
+
|
|
177
189
|
// If all options are already configured immediately add it to the cart.
|
|
178
190
|
if (activeFulfillmentMethod && activeLocation) {
|
|
179
191
|
addToCart([{
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
4
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
4
|
import { FulfillmentContext } from "../../locations.context";
|
|
6
5
|
import { STAGE_SELECT_STORE, STAGE_RESERVE_FORM, STAGE_RESPONSE_SUCCESS, STAGE_RESPONSE_ERROR, STAGE_FULFILLMENT_METHOD } from "../../constants";
|
|
7
6
|
import SheetDrawer from "../../../components/SheetDrawer";
|
|
@@ -10,19 +9,16 @@ import { ReserveForm } from "../ReserveForm";
|
|
|
10
9
|
import { ReservationSuccess, ReservationError } from "../ReservationResponses";
|
|
11
10
|
import { FulfillmentPath } from "../FulfillmentPath";
|
|
12
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
const {
|
|
14
|
-
variables
|
|
15
|
-
} = themeConfig;
|
|
16
|
-
const useStyles = makeStyles()({
|
|
12
|
+
const useStyles = makeStyles()(theme => ({
|
|
17
13
|
sheet: {
|
|
18
|
-
maxHeight: `calc(var(--vh-100, 100vh) - ${
|
|
14
|
+
maxHeight: `calc(var(--vh-100, 100vh) - ${theme.components.navigator.height})`,
|
|
19
15
|
[responsiveMediaQuery('>sm', {
|
|
20
16
|
webOnly: true
|
|
21
17
|
})]: {
|
|
22
|
-
maxHeight: `calc(var(--vh-80, 80vh) - ${
|
|
18
|
+
maxHeight: `calc(var(--vh-80, 80vh) - ${theme.components.navigator.height})`
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
|
-
});
|
|
21
|
+
}));
|
|
26
22
|
|
|
27
23
|
/**
|
|
28
24
|
* Renders the content of the fulfillment sheet.
|
|
@@ -3,12 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { RippleButton, I18n, Typography } from '@shopgate/engage/components';
|
|
4
4
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
5
5
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
6
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
7
6
|
import { getTimeSlotDisplayText } from "./time";
|
|
8
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const {
|
|
10
|
-
variables
|
|
11
|
-
} = themeConfig;
|
|
12
8
|
const useStyles = makeStyles()(theme => ({
|
|
13
9
|
wrapper: {
|
|
14
10
|
color: theme.palette.text.primary,
|
|
@@ -20,7 +16,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
20
16
|
margin: theme.spacing(0, 2),
|
|
21
17
|
borderBottom: `1px solid ${theme.components.border.light}`,
|
|
22
18
|
alignItems: 'center',
|
|
23
|
-
height:
|
|
19
|
+
height: theme.components.filterBar.height
|
|
24
20
|
},
|
|
25
21
|
innerStandalone: {
|
|
26
22
|
borderBottom: 'none'
|