@shopgate/engage 7.32.0-beta.7 → 7.32.0-beta.8
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/account/components/Profile/ProfileAddressBook.d.ts.map +1 -1
- package/account/components/Profile/ProfileAddressBook.js +13 -22
- package/account/components/Profile/ProfileAddressCard.d.ts.map +1 -1
- package/account/components/Profile/ProfileAddressCard.js +8 -18
- package/account/components/Profile/ProfileForm.d.ts.map +1 -1
- package/account/components/Profile/ProfileForm.js +15 -42
- package/account/components/ProfileContact/ProfileContact.js +13 -21
- package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.d.ts.map +1 -1
- package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.js +40 -6
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts +7 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts.map +1 -1
- package/admin-preview/initialization/_internal/initialFrontendSettings.d.ts +32 -0
- package/admin-preview/initialization/_internal/initialFrontendSettings.d.ts.map +1 -0
- package/admin-preview/initialization/_internal/initialFrontendSettings.js +43 -0
- package/admin-preview/initialization/awaitInitialFrontendSettings.d.ts +22 -0
- package/admin-preview/initialization/awaitInitialFrontendSettings.d.ts.map +1 -0
- package/admin-preview/initialization/awaitInitialFrontendSettings.js +84 -0
- package/back-in-stock/components/BackInStockButton/index.js +5 -5
- package/cart/components/CartItem/CartItemProductLayout.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.js +7 -14
- package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.js +6 -24
- package/cart/components/CartSummaryWide/CartSummaryWide.js +2 -2
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.js +9 -23
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.js +8 -30
- package/cart/components/PaymentBar/testUtils/mockFactories.js +4 -11
- package/category/components/CategoryImage/index.js +13 -2
- package/checkout/components/AddressBook/AddressList.js +14 -23
- package/checkout/components/Checkout/CheckoutActions.js +4 -3
- package/checkout/components/Checkout/CheckoutAddress.js +8 -0
- package/checkout/components/Checkout/CheckoutSection.js +6 -2
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +6 -7
- package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.js +7 -17
- package/components/Card/Card.js +1 -1
- package/components/ChipLayout/index.js +2 -4
- package/components/NavigationHandler/connector.js +1 -1
- package/components/NavigationHandler/spec.js +10 -1
- package/components/Paper/Paper.d.ts +1 -2
- package/components/Paper/Paper.d.ts.map +1 -1
- package/components/Tabs/components/Tab.d.ts.map +1 -1
- package/components/Tabs/components/Tab.js +14 -16
- package/components/Typography/Typography.d.ts +1 -1
- package/components/v2/Button/Button.d.ts +24 -13
- package/components/v2/Button/Button.d.ts.map +1 -1
- package/components/v2/Button/Button.js +89 -37
- package/components/v2/ButtonBase/ButtonBase.d.ts +50 -10
- package/components/v2/ButtonBase/ButtonBase.d.ts.map +1 -1
- package/components/v2/ButtonBase/ButtonBase.js +153 -16
- package/components/v2/ButtonBase/hooks.d.ts +0 -1
- package/components/v2/ButtonBase/hooks.d.ts.map +1 -1
- package/components/v2/ButtonBase/hooks.js +36 -12
- package/components/v2/ButtonGroup/ButtonGroup.d.ts +11 -5
- package/components/v2/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/components/v2/ButtonGroup/ButtonGroup.js +30 -18
- package/components/v2/CircularProgress/CircularProgress.d.ts.map +1 -1
- package/components/v2/CircularProgress/CircularProgress.js +10 -5
- package/core/hooks/useNavigation.d.ts +10 -2
- package/core/hooks/useNavigation.d.ts.map +1 -1
- package/core/hooks/useNavigation.js +1 -2
- package/core/initialization/index.d.ts.map +1 -1
- package/core/initialization/index.js +24 -5
- package/core/router/conductor.d.ts +9 -0
- package/core/router/helpers.d.ts +28 -15
- package/core/router/helpers.d.ts.map +1 -1
- package/core/router/helpers.js +8 -8
- package/development/components/DevelopmentSettings/DevelopmentSettings.js +3 -3
- package/favorites/components/FavoriteButtonWide/FavoriteButtonWide.js +7 -17
- package/favorites/components/List/List.d.ts.map +1 -1
- package/favorites/components/List/List.js +0 -1
- package/favorites/components/List/ListContent.js +4 -5
- package/favorites/components/Lists/Lists.js +4 -5
- package/filter/components/FilterPageContent/components/ApplyButton/index.js +8 -10
- package/filter/components/FilterPageContent/components/ResetButton/index.js +8 -6
- package/locations/components/ChangeLocationButton/ChangeLocationButton.js +10 -14
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +4 -8
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.js +1 -1
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +8 -13
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.js +10 -10
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +8 -14
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.js +9 -10
- package/locations/components/ReserveForm/ReserveForm.js +6 -7
- package/locations/components/StoreDetails/components/GetDirectionsButton.js +2 -4
- package/locations/components/StoreDetails/components/StoreDetails.js +5 -10
- package/locations/components/StoreDetails/components/StoresNearbyListItem.js +13 -21
- package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +5 -11
- package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +5 -11
- package/locations/components/StoreList/StoreSelectLocationButton.js +5 -11
- package/login/components/ForgotPassword/ForgotPassword.js +11 -23
- package/orders/components/OrderDetails/OrderDetailsAuthenticate.js +5 -7
- package/package.json +7 -7
- package/page/components/NotFound.d.ts.map +1 -1
- package/page/components/NotFound.js +7 -6
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.d.ts +1 -1
- package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.js +2 -2
- package/page/components/WidgetVideo/WidgetVideo.d.ts +1 -1
- package/page/components/WidgetVideo/WidgetVideo.d.ts.map +1 -1
- package/page/helpers/index.d.ts +5 -2
- package/page/helpers/index.d.ts.map +1 -1
- package/page/helpers/index.js +8 -5
- package/page/widgets/Button/Button.js +2 -3
- package/page/widgets/NestedCategoryFilter/NestedCategoryFilter.js +8 -8
- package/page/widgets/ProductList/ProductList.js +18 -14
- package/page/widgets/Video/hooks.d.ts +2 -2
- package/product/components/ProductGrid/components/Item/components/ItemImage/index.js +1 -11
- package/product/components/ProductGrid/components/Item/index.js +3 -2
- package/product/components/ProductImage/ProductImage.d.ts.map +1 -1
- package/product/components/ProductImage/ProductImage.js +7 -2
- package/product/components/ProductImage/ProductImagePlaceholder.js +3 -3
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.d.ts.map +1 -1
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +14 -33
- package/push-opt-in/components/PushOptInModal/index.js +4 -4
- package/registration/components/Registration/RegistrationFormActions.js +4 -4
- package/reviews/components/Reviews/components/AllReviewsLink/index.js +6 -6
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/index.js +4 -3
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +28 -22
- package/reviews/components/Reviews/spec.js +5 -6
- package/settings/reducers/appSettings.d.ts.map +1 -1
- package/settings/reducers/appSettings.js +9 -1
- package/settings/selectors/appSettings.d.ts +16 -0
- package/settings/selectors/appSettings.d.ts.map +1 -1
- package/settings/selectors/appSettings.js +11 -1
- package/settings/types/appSettings.d.ts +23 -2
- package/settings/types/appSettings.d.ts.map +1 -1
- package/styles/helpers/index.d.ts +1 -0
- package/styles/helpers/index.js +1 -0
- package/styles/helpers/loadFontCss.d.ts +22 -0
- package/styles/helpers/loadFontCss.d.ts.map +1 -0
- package/styles/helpers/loadFontCss.js +138 -0
- package/styles/helpers/loadThemeCss.d.ts.map +1 -1
- package/styles/helpers/loadThemeCss.js +11 -0
- package/styles/theme/createTheme/createComponents.types.d.ts +25 -0
- package/styles/theme/createTheme/createComponents.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.types.js +25 -0
- package/styles/theme/createTheme/createShape.d.ts +2 -3
- package/styles/theme/createTheme/createShape.d.ts.map +1 -1
- package/styles/theme/createTheme/createShape.js +1 -2
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts +3 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts.map +1 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.js +4 -2
- package/styles/theme/createTheme/createTypography.d.ts +2 -1
- package/styles/theme/createTheme/createTypography.js +58 -18
- package/styles/theme/createTheme/index.js +1 -1
- package/styles/theme/index.d.ts +1 -0
- package/styles/theme/index.d.ts.map +1 -1
- package/tracking/components/CookieConsentModal/index.js +3 -4
- package/tracking/components/PrivacySettings/index.js +3 -3
- package/cart/components/PaymentBar/PaymentBarReserveButton.connector.js +0 -6
- package/cart/components/PaymentBar/PaymentBarReserveButton.js +0 -71
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.connector.js +0 -16
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.js +0 -52
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileAddressBook.d.ts","sourceRoot":"","sources":["../../../../account/components/Profile/ProfileAddressBook.jsx"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ProfileAddressBook.d.ts","sourceRoot":"","sources":["../../../../account/components/Profile/ProfileAddressBook.jsx"],"names":[],"mappings":";;;QA8Ca,GAAG;;;;;;;;;;sBA5CM,YAAY"}
|
|
@@ -3,7 +3,8 @@ import { connect } from 'react-redux';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { i18n, historyPush } from '@shopgate/engage/core';
|
|
5
5
|
import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
6
|
-
import {
|
|
6
|
+
import { Typography } from '@shopgate/engage/components';
|
|
7
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
7
8
|
import AddressCard from "./ProfileAddressCard";
|
|
8
9
|
import { useProfileContext } from "./Profile.provider";
|
|
9
10
|
import { PROFILE_ADDRESS_PATH } from "../../constants/routes";
|
|
@@ -16,7 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
16
17
|
const mapDispatchToProps = dispatch => ({
|
|
17
18
|
push: props => dispatch(historyPush(props))
|
|
18
19
|
});
|
|
19
|
-
const useStyles = makeStyles()(
|
|
20
|
+
const useStyles = makeStyles()(() => ({
|
|
20
21
|
container: {
|
|
21
22
|
display: 'flex',
|
|
22
23
|
flexDirection: 'row',
|
|
@@ -24,25 +25,16 @@ const useStyles = makeStyles()(theme => ({
|
|
|
24
25
|
margin: -4
|
|
25
26
|
},
|
|
26
27
|
button: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[responsiveMediaQuery('<md', {
|
|
36
|
-
webOnly: false
|
|
37
|
-
})]: {
|
|
38
|
-
width: '100%',
|
|
39
|
-
marginRight: 0
|
|
40
|
-
}
|
|
28
|
+
marginTop: 8,
|
|
29
|
+
textTransform: 'none',
|
|
30
|
+
marginRight: 16,
|
|
31
|
+
[responsiveMediaQuery('<md', {
|
|
32
|
+
webOnly: false
|
|
33
|
+
})]: {
|
|
34
|
+
width: '100%',
|
|
35
|
+
marginRight: 0
|
|
41
36
|
}
|
|
42
37
|
},
|
|
43
|
-
ripple: {
|
|
44
|
-
padding: '8px 16px'
|
|
45
|
-
},
|
|
46
38
|
actions: {
|
|
47
39
|
display: 'flex',
|
|
48
40
|
justifyContent: 'flex-end',
|
|
@@ -86,10 +78,9 @@ const ProfileAddressBook = ({
|
|
|
86
78
|
}, contact.id))
|
|
87
79
|
}), /*#__PURE__*/_jsx("div", {
|
|
88
80
|
className: classes.actions,
|
|
89
|
-
children: /*#__PURE__*/_jsx(
|
|
81
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
82
|
+
color: "primary",
|
|
90
83
|
className: classes.button,
|
|
91
|
-
rippleClassName: classes.ripple,
|
|
92
|
-
type: "primary",
|
|
93
84
|
onClick: () => push({
|
|
94
85
|
pathname: PROFILE_ADDRESS_PATH
|
|
95
86
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileAddressCard.d.ts","sourceRoot":"","sources":["../../../../account/components/Profile/ProfileAddressCard.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ProfileAddressCard.d.ts","sourceRoot":"","sources":["../../../../account/components/Profile/ProfileAddressCard.jsx"],"names":[],"mappings":";AA+DA;;GAEG;AACH;;;;;;IAFa,GAAG,CAkGf;;;;;;;;;;;;;;;;sBAjKqB,YAAY"}
|
|
@@ -3,10 +3,11 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
4
4
|
import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
5
5
|
import { useAddressBook, ADDRESS_TYPE_BILLING, ADDRESS_TYPE_SHIPPING } from '@shopgate/engage/checkout';
|
|
6
|
-
import {
|
|
6
|
+
import { Card, ContextMenu, Typography } from '@shopgate/engage/components';
|
|
7
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
7
8
|
import iso3166 from "../../../components/Form/Builder/helpers/iso-3166-2";
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const useStyles = makeStyles()(
|
|
10
|
+
const useStyles = makeStyles()(() => ({
|
|
10
11
|
root: {
|
|
11
12
|
margin: '5px 5px 10px',
|
|
12
13
|
padding: 16,
|
|
@@ -55,19 +56,8 @@ const useStyles = makeStyles()(theme => ({
|
|
|
55
56
|
flex: 1
|
|
56
57
|
},
|
|
57
58
|
button: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
'&&': {
|
|
62
|
-
marginTop: 8,
|
|
63
|
-
borderRadius: 5,
|
|
64
|
-
fontSize: theme.typography.body2.fontSize,
|
|
65
|
-
padding: 0,
|
|
66
|
-
textTransform: 'none'
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
ripple: {
|
|
70
|
-
padding: '8px 16px'
|
|
59
|
+
marginTop: 8,
|
|
60
|
+
textTransform: 'none'
|
|
71
61
|
}
|
|
72
62
|
}));
|
|
73
63
|
|
|
@@ -161,10 +151,10 @@ const ProfileAddressCard = ({
|
|
|
161
151
|
}) : null]
|
|
162
152
|
}), /*#__PURE__*/_jsx("div", {
|
|
163
153
|
className: cx(classes.column, classes.selectButtonColumn),
|
|
164
|
-
children: isCheckout ? /*#__PURE__*/_jsx(
|
|
154
|
+
children: isCheckout ? /*#__PURE__*/_jsx(Button, {
|
|
155
|
+
color: "primary",
|
|
156
|
+
size: "small",
|
|
165
157
|
className: classes.button,
|
|
166
|
-
rippleClassName: classes.ripple,
|
|
167
|
-
type: "secondary",
|
|
168
158
|
disabled: selected,
|
|
169
159
|
onClick: selectContact,
|
|
170
160
|
children: i18n.text(`account.profile.address_book.${selected ? 'selected' : 'select'}`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileForm.d.ts","sourceRoot":"","sources":["../../../../account/components/Profile/ProfileForm.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ProfileForm.d.ts","sourceRoot":"","sources":["../../../../account/components/Profile/ProfileForm.jsx"],"names":[],"mappings":";AA2CA;;GAEG;AACH,qFA+DG;kBA7GqD,OAAO"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useMemo, useCallback, forwardRef } from 'react';
|
|
2
2
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
3
3
|
import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
4
|
-
import { FormBuilder
|
|
4
|
+
import { FormBuilder } from '@shopgate/engage/components';
|
|
5
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
5
6
|
import { StylePresets } from '@shopgate/engage/components/Form';
|
|
6
7
|
import { useProfileContext } from "./Profile.provider";
|
|
7
8
|
import generateFormConfig from "./Profile.config";
|
|
@@ -24,42 +25,15 @@ const useStyles = makeStyles()(theme => ({
|
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
button: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
padding: 0,
|
|
35
|
-
[responsiveMediaQuery('<md', {
|
|
36
|
-
webOnly: false
|
|
37
|
-
})]: {
|
|
38
|
-
marginRight: 0
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
buttonDelete: {
|
|
43
|
-
'&&': {
|
|
44
|
-
marginTop: 8,
|
|
45
|
-
marginRight: 16,
|
|
46
|
-
border: `1px solid ${theme.palette.error.main}`,
|
|
47
|
-
backgroundColor: theme.palette.common.white,
|
|
48
|
-
color: theme.palette.error.main,
|
|
49
|
-
borderRadius: 5,
|
|
50
|
-
fontSize: theme.typography.body2.fontSize,
|
|
51
|
-
textTransform: 'none',
|
|
52
|
-
padding: 0,
|
|
53
|
-
[responsiveMediaQuery('<md', {
|
|
54
|
-
webOnly: false
|
|
55
|
-
})]: {
|
|
56
|
-
marginRight: 0
|
|
57
|
-
}
|
|
28
|
+
marginTop: 8,
|
|
29
|
+
textTransform: 'none',
|
|
30
|
+
marginRight: 16,
|
|
31
|
+
[responsiveMediaQuery('<md', {
|
|
32
|
+
webOnly: false
|
|
33
|
+
})]: {
|
|
34
|
+
marginRight: 0
|
|
58
35
|
}
|
|
59
36
|
},
|
|
60
|
-
ripple: {
|
|
61
|
-
padding: '8px 16px'
|
|
62
|
-
},
|
|
63
37
|
actions: {
|
|
64
38
|
display: 'flex',
|
|
65
39
|
justifyContent: 'flex-end',
|
|
@@ -119,16 +93,15 @@ const ProfileForm = /*#__PURE__*/forwardRef((_, ref) => {
|
|
|
119
93
|
handleUpdate: handleUpdate
|
|
120
94
|
}), /*#__PURE__*/_jsxs("div", {
|
|
121
95
|
className: classes.actions,
|
|
122
|
-
children: [/*#__PURE__*/_jsx(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
96
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
97
|
+
variant: "outlined",
|
|
98
|
+
color: "error",
|
|
99
|
+
className: classes.button,
|
|
126
100
|
onClick: deleteCustomer,
|
|
127
101
|
children: i18n.text('account.profile.delete')
|
|
128
|
-
}), /*#__PURE__*/_jsx(
|
|
102
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
103
|
+
color: "primary",
|
|
129
104
|
className: classes.button,
|
|
130
|
-
rippleClassName: classes.ripple,
|
|
131
|
-
type: "primary",
|
|
132
105
|
onClick: saveForm,
|
|
133
106
|
children: i18n.text('account.profile.form.save')
|
|
134
107
|
})]
|
|
@@ -9,7 +9,8 @@ import { convertValidationErrors, useFormState } from '@shopgate/engage/core/hoo
|
|
|
9
9
|
import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
10
10
|
import { getShopSettings } from '@shopgate/engage/core/config';
|
|
11
11
|
import { getPreferredLocationAddress } from '@shopgate/engage/locations/selectors';
|
|
12
|
-
import { FormBuilder
|
|
12
|
+
import { FormBuilder } from '@shopgate/engage/components';
|
|
13
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
13
14
|
import { StylePresets } from '@shopgate/engage/components/Form';
|
|
14
15
|
import { LoadingProvider } from '@shopgate/pwa-common/providers';
|
|
15
16
|
import { useAddressBook } from '@shopgate/engage/checkout';
|
|
@@ -61,25 +62,16 @@ const useStyles = makeStyles()(theme => ({
|
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
button: {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[responsiveMediaQuery('<md', {
|
|
73
|
-
webOnly: false
|
|
74
|
-
})]: {
|
|
75
|
-
width: '100%',
|
|
76
|
-
marginRight: 0
|
|
77
|
-
}
|
|
65
|
+
marginTop: 8,
|
|
66
|
+
textTransform: 'none',
|
|
67
|
+
marginRight: 16,
|
|
68
|
+
[responsiveMediaQuery('<md', {
|
|
69
|
+
webOnly: false
|
|
70
|
+
})]: {
|
|
71
|
+
width: '100%',
|
|
72
|
+
marginRight: 0
|
|
78
73
|
}
|
|
79
74
|
},
|
|
80
|
-
ripple: {
|
|
81
|
-
padding: '8px 16px'
|
|
82
|
-
},
|
|
83
75
|
actions: {
|
|
84
76
|
display: 'flex',
|
|
85
77
|
justifyContent: 'flex-end',
|
|
@@ -191,10 +183,10 @@ const ProfileContact = ({
|
|
|
191
183
|
handleUpdate: handleUpdate
|
|
192
184
|
}), /*#__PURE__*/_jsx("div", {
|
|
193
185
|
className: classes.actions,
|
|
194
|
-
children: /*#__PURE__*/_jsx(
|
|
186
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
187
|
+
color: "primary",
|
|
188
|
+
size: "small",
|
|
195
189
|
className: classes.button,
|
|
196
|
-
rippleClassName: classes.ripple,
|
|
197
|
-
type: "primary",
|
|
198
190
|
onClick: formState.handleSubmit,
|
|
199
191
|
children: i18n.text('account.profile.form.save')
|
|
200
192
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontendSettingsPreviewBridge.d.ts","sourceRoot":"","sources":["../../../../admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FrontendSettingsPreviewBridge.d.ts","sourceRoot":"","sources":["../../../../admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.tsx"],"names":[],"mappings":"AAyBA;;;;GAIG;AACH,QAAA,MAAM,6BAA6B,YAgFlC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|
package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import "core-js/modules/es.array.includes.js";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { useDispatch } from 'react-redux';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
4
4
|
import { useIframeMessenger } from '@shopgate/engage/admin-preview/hooks';
|
|
5
5
|
import { ALLOWED_ADMIN_PREVIEW_ORIGINS } from '@shopgate/engage/admin-preview/constants';
|
|
6
6
|
import { receiveAppSettings } from '@shopgate/engage/settings/action-creators/appSettings';
|
|
7
|
+
import { getTypographyFontCssUrls } from '@shopgate/engage/settings/selectors/appSettings';
|
|
7
8
|
import { logger } from '@shopgate/engage/core/helpers';
|
|
8
|
-
// Imported via
|
|
9
|
-
// this component, and would therefore create a circular import.
|
|
9
|
+
// Imported via their module paths, since the "styles" barrel pulls in the ThemeProvider which
|
|
10
|
+
// renders this component, and would therefore create a circular import.
|
|
10
11
|
import useColorScheme from '@shopgate/engage/styles/theme/hooks/useColorScheme';
|
|
12
|
+
import { loadFontCss } from '@shopgate/engage/styles/helpers/loadFontCss';
|
|
13
|
+
import { getInitialFrontendSettingsStyling, hasInitialFrontendSettings } from "../../initialization/_internal/initialFrontendSettings";
|
|
11
14
|
import { getOrCreateStyleTag, removeStyleTag, serializeStyling } from "./helpers";
|
|
12
15
|
|
|
13
16
|
/**
|
|
@@ -16,20 +19,28 @@ import { getOrCreateStyleTag, removeStyleTag, serializeStyling } from "./helpers
|
|
|
16
19
|
* while in preview mode.
|
|
17
20
|
*/
|
|
18
21
|
const FrontendSettingsPreviewBridge = () => {
|
|
19
|
-
const [styling, setStyling] = useState(
|
|
22
|
+
const [styling, setStyling] = useState(getInitialFrontendSettingsStyling);
|
|
23
|
+
const [applied, setApplied] = useState(hasInitialFrontendSettings);
|
|
24
|
+
const announcedRef = useRef(false);
|
|
25
|
+
const fontCssSyncRef = useRef(Promise.resolve());
|
|
20
26
|
const dispatch = useDispatch();
|
|
21
27
|
const {
|
|
22
28
|
setMode,
|
|
23
29
|
modes
|
|
24
30
|
} = useColorScheme();
|
|
31
|
+
const fontCssUrls = useSelector(getTypographyFontCssUrls);
|
|
25
32
|
const {
|
|
26
33
|
sendToParent
|
|
27
34
|
} = useIframeMessenger(data => {
|
|
28
35
|
if (data.type === 'receiveFrontendSettings') {
|
|
29
|
-
|
|
36
|
+
// Dispatched before the local state, because the font css urls are derived from it. A message
|
|
37
|
+
// listener runs outside React's batching, so setting `applied` first would announce the
|
|
38
|
+
// preview against the previous urls.
|
|
30
39
|
if (data.payload?.appSettings) {
|
|
31
40
|
dispatch(receiveAppSettings(data.payload.appSettings));
|
|
32
41
|
}
|
|
42
|
+
setStyling(data.payload?.styling ?? null);
|
|
43
|
+
setApplied(true);
|
|
33
44
|
}
|
|
34
45
|
if (data.type === 'setColorScheme') {
|
|
35
46
|
const colorScheme = data.payload?.colorScheme;
|
|
@@ -49,6 +60,12 @@ const FrontendSettingsPreviewBridge = () => {
|
|
|
49
60
|
type: 'frontendSettingsPreviewReady'
|
|
50
61
|
});
|
|
51
62
|
}, [sendToParent]);
|
|
63
|
+
|
|
64
|
+
// App start already loaded the configured files. This keeps them in sync while the merchant
|
|
65
|
+
// edits, since loadFontCss adds, keeps and removes link tags to match the urls it is given.
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
fontCssSyncRef.current = loadFontCss(fontCssUrls);
|
|
68
|
+
}, [fontCssUrls]);
|
|
52
69
|
useEffect(() => {
|
|
53
70
|
if (!styling) {
|
|
54
71
|
removeStyleTag();
|
|
@@ -56,6 +73,23 @@ const FrontendSettingsPreviewBridge = () => {
|
|
|
56
73
|
}
|
|
57
74
|
getOrCreateStyleTag().textContent = serializeStyling(styling);
|
|
58
75
|
}, [styling]);
|
|
76
|
+
|
|
77
|
+
// Declared after the styling and font effects so both have run for the applied payload before the
|
|
78
|
+
// admin is told it can drop its overlay - effects run in declaration order, and React defers them
|
|
79
|
+
// until after the browser painted. The font sync is awaited on top: app start already waited for
|
|
80
|
+
// the configured files, but when it timed out the first payload can introduce one here, and
|
|
81
|
+
// announcing before it loaded would expose the fallback font repaint the overlay exists to hide.
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!applied || announcedRef.current) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
announcedRef.current = true;
|
|
87
|
+
fontCssSyncRef.current.then(() => {
|
|
88
|
+
sendToParent({
|
|
89
|
+
type: 'frontendSettingsPreviewApplied'
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}, [applied, sendToParent]);
|
|
59
93
|
useEffect(() => () => {
|
|
60
94
|
removeStyleTag();
|
|
61
95
|
}, []);
|
|
@@ -16,5 +16,12 @@ export type FrontendSettingsPreviewBridgeMessage = {
|
|
|
16
16
|
} | {
|
|
17
17
|
type: 'frontendSettingsPreviewReady';
|
|
18
18
|
payload?: never;
|
|
19
|
+
} | {
|
|
20
|
+
/**
|
|
21
|
+
* Outbound. Announces that the first settings payload has been applied and the app rendered
|
|
22
|
+
* with it, so the admin can drop the loading overlay it shows while the preview boots.
|
|
23
|
+
*/
|
|
24
|
+
type: 'frontendSettingsPreviewApplied';
|
|
25
|
+
payload?: never;
|
|
19
26
|
};
|
|
20
27
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../admin-preview/components/FrontendSettingsPreviewBridge/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAEjF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,CAAC;AAClD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAE1F,MAAM,MAAM,oCAAoC,GAC5C;IACA,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,uBAAuB,CAAC;QAClC,WAAW,CAAC,EAAE,kBAAkB,CAAC;KAClC,CAAC;CACH,GACC;IACA,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE;QACP,WAAW,EAAE,eAAe,CAAC;KAC9B,CAAC;CACH,GACC;IACA,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../admin-preview/components/FrontendSettingsPreviewBridge/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAEjF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,CAAC;AAClD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAE1F,MAAM,MAAM,oCAAoC,GAC5C;IACA,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,uBAAuB,CAAC;QAClC,WAAW,CAAC,EAAE,kBAAkB,CAAC;KAClC,CAAC;CACH,GACC;IACA,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE;QACP,WAAW,EAAE,eAAe,CAAC;KAC9B,CAAC;CACH,GACC;IACA,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,GACC;IACA;;;OAGG;IACH,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal to the admin-preview package - do not import this module from anywhere else.
|
|
3
|
+
*
|
|
4
|
+
* Hands the payload that `awaitInitialFrontendSettings` received over to the
|
|
5
|
+
* FrontendSettingsPreviewBridge, which mounts long after app start finished. Module state rather
|
|
6
|
+
* than a store slice, because the styling map never belongs in redux - it is applied to a style
|
|
7
|
+
* tag, and the bridge only needs it to avoid removing what app start already applied.
|
|
8
|
+
*/
|
|
9
|
+
import type { FrontendSettingsStyling } from '../../components/FrontendSettingsPreviewBridge/types';
|
|
10
|
+
/**
|
|
11
|
+
* Records the payload that app start received.
|
|
12
|
+
* @param initialStyling The styling map the payload carried, if any.
|
|
13
|
+
*/
|
|
14
|
+
export declare const setInitialFrontendSettings: (initialStyling: FrontendSettingsStyling | null) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Whether app start received a payload. A payload without a styling map still counts - it
|
|
17
|
+
* carried app settings, which is enough to consider the preview applied.
|
|
18
|
+
* @returns True when a payload arrived during app start.
|
|
19
|
+
*/
|
|
20
|
+
export declare const hasInitialFrontendSettings: () => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The styling map that app start applied, so the bridge can seed its state with it instead of
|
|
23
|
+
* starting at null - which would make its first effect remove the style tag again.
|
|
24
|
+
* @returns The styling map, or null when none arrived.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getInitialFrontendSettingsStyling: () => FrontendSettingsStyling | null;
|
|
27
|
+
/**
|
|
28
|
+
* Test only. Module state outlives a test file's individual cases, so specs need a way back to the
|
|
29
|
+
* initial state.
|
|
30
|
+
*/
|
|
31
|
+
export declare const resetInitialFrontendSettings: () => void;
|
|
32
|
+
//# sourceMappingURL=initialFrontendSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialFrontendSettings.d.ts","sourceRoot":"","sources":["../../../../admin-preview/initialization/_internal/initialFrontendSettings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAMpG;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,gBAAgB,uBAAuB,GAAG,IAAI,SAGxF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAO,OAAmB,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAO,uBAAuB,GAAG,IAAe,CAAC;AAE/F;;;GAGG;AACH,eAAO,MAAM,4BAA4B,YAGxC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal to the admin-preview package - do not import this module from anywhere else.
|
|
3
|
+
*
|
|
4
|
+
* Hands the payload that `awaitInitialFrontendSettings` received over to the
|
|
5
|
+
* FrontendSettingsPreviewBridge, which mounts long after app start finished. Module state rather
|
|
6
|
+
* than a store slice, because the styling map never belongs in redux - it is applied to a style
|
|
7
|
+
* tag, and the bridge only needs it to avoid removing what app start already applied.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
let received = false;
|
|
11
|
+
let styling = null;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Records the payload that app start received.
|
|
15
|
+
* @param initialStyling The styling map the payload carried, if any.
|
|
16
|
+
*/
|
|
17
|
+
export const setInitialFrontendSettings = initialStyling => {
|
|
18
|
+
received = true;
|
|
19
|
+
styling = initialStyling;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Whether app start received a payload. A payload without a styling map still counts - it
|
|
24
|
+
* carried app settings, which is enough to consider the preview applied.
|
|
25
|
+
* @returns True when a payload arrived during app start.
|
|
26
|
+
*/
|
|
27
|
+
export const hasInitialFrontendSettings = () => received;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The styling map that app start applied, so the bridge can seed its state with it instead of
|
|
31
|
+
* starting at null - which would make its first effect remove the style tag again.
|
|
32
|
+
* @returns The styling map, or null when none arrived.
|
|
33
|
+
*/
|
|
34
|
+
export const getInitialFrontendSettingsStyling = () => styling;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Test only. Module state outlives a test file's individual cases, so specs need a way back to the
|
|
38
|
+
* initial state.
|
|
39
|
+
*/
|
|
40
|
+
export const resetInitialFrontendSettings = () => {
|
|
41
|
+
received = false;
|
|
42
|
+
styling = null;
|
|
43
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface PreviewStore {
|
|
2
|
+
dispatch: (action: unknown) => void;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Waits for the first settings message from the admin and applies it before the app renders.
|
|
6
|
+
*
|
|
7
|
+
* Without this the app paints with the theme defaults first: the bridge that owns the message
|
|
8
|
+
* listener only mounts once React committed, so everything the admin sent before that is dropped
|
|
9
|
+
* and the styling arrives as a visible restyle.
|
|
10
|
+
*
|
|
11
|
+
* The handshake goes to every allowed origin rather than to a single guessed one. Nothing has been
|
|
12
|
+
* received at this point, so there is no known parent origin, and the referrer is not guaranteed to
|
|
13
|
+
* survive the admin's referrer policy. The browser drops the copies whose target does not match.
|
|
14
|
+
*
|
|
15
|
+
* Resolves when the payload arrived or when REQUEST_TIMEOUT elapsed, and never rejects - an admin
|
|
16
|
+
* that stays silent has to fall back to the unstyled app, never to an iframe that never renders.
|
|
17
|
+
* @param store Reference to the store.
|
|
18
|
+
* @returns A promise that resolves once the first payload settled.
|
|
19
|
+
*/
|
|
20
|
+
export declare const awaitInitialFrontendSettings: (store: PreviewStore) => Promise<void>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=awaitInitialFrontendSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awaitInitialFrontendSettings.d.ts","sourceRoot":"","sources":["../../../admin-preview/initialization/awaitInitialFrontendSettings.ts"],"names":[],"mappings":"AAmBA,UAAU,YAAY;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,GAAI,OAAO,YAAY,KAAG,OAAO,CAAC,IAAI,CAqE3E,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import "core-js/modules/es.array.includes.js";
|
|
2
|
+
import { withScope, captureMessage, Severity as SentrySeverity } from '@sentry/browser';
|
|
3
|
+
import { receiveAppSettings } from '@shopgate/engage/settings/action-creators/appSettings';
|
|
4
|
+
import { isFrontendSettingsAdminPreviewActive } from "../helpers";
|
|
5
|
+
import { ALLOWED_ADMIN_PREVIEW_ORIGINS } from "../constants";
|
|
6
|
+
import { getOrCreateStyleTag, serializeStyling } from "../components/FrontendSettingsPreviewBridge/helpers";
|
|
7
|
+
import { setInitialFrontendSettings } from "./_internal/initialFrontendSettings";
|
|
8
|
+
const REQUEST_TIMEOUT = 3000;
|
|
9
|
+
/**
|
|
10
|
+
* Waits for the first settings message from the admin and applies it before the app renders.
|
|
11
|
+
*
|
|
12
|
+
* Without this the app paints with the theme defaults first: the bridge that owns the message
|
|
13
|
+
* listener only mounts once React committed, so everything the admin sent before that is dropped
|
|
14
|
+
* and the styling arrives as a visible restyle.
|
|
15
|
+
*
|
|
16
|
+
* The handshake goes to every allowed origin rather than to a single guessed one. Nothing has been
|
|
17
|
+
* received at this point, so there is no known parent origin, and the referrer is not guaranteed to
|
|
18
|
+
* survive the admin's referrer policy. The browser drops the copies whose target does not match.
|
|
19
|
+
*
|
|
20
|
+
* Resolves when the payload arrived or when REQUEST_TIMEOUT elapsed, and never rejects - an admin
|
|
21
|
+
* that stays silent has to fall back to the unstyled app, never to an iframe that never renders.
|
|
22
|
+
* @param store Reference to the store.
|
|
23
|
+
* @returns A promise that resolves once the first payload settled.
|
|
24
|
+
*/
|
|
25
|
+
export const awaitInitialFrontendSettings = store => new Promise(resolve => {
|
|
26
|
+
if (!isFrontendSettingsAdminPreviewActive()) {
|
|
27
|
+
resolve();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let settled = false;
|
|
31
|
+
let timeout;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Resolves the promise once, whichever of payload / timeout comes first, and stops listening.
|
|
35
|
+
* The bridge attaches its own listener when it mounts and re-sends the handshake, so the admin
|
|
36
|
+
* resyncs from there.
|
|
37
|
+
*/
|
|
38
|
+
const settle = () => {
|
|
39
|
+
if (settled) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
settled = true;
|
|
43
|
+
clearTimeout(timeout);
|
|
44
|
+
window.removeEventListener('message', handleMessage);
|
|
45
|
+
resolve();
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Handles the first trusted message. A function declaration, so `settle` can detach it again
|
|
50
|
+
* without a forward reference.
|
|
51
|
+
* @param event The message event.
|
|
52
|
+
*/
|
|
53
|
+
function handleMessage(event) {
|
|
54
|
+
if (!ALLOWED_ADMIN_PREVIEW_ORIGINS.includes(event.origin)) return;
|
|
55
|
+
if (event.source !== window.parent) return;
|
|
56
|
+
const {
|
|
57
|
+
data
|
|
58
|
+
} = event;
|
|
59
|
+
if (data?.type !== 'receiveFrontendSettings') return;
|
|
60
|
+
const styling = data.payload?.styling ?? null;
|
|
61
|
+
if (styling) {
|
|
62
|
+
getOrCreateStyleTag().textContent = serializeStyling(styling);
|
|
63
|
+
}
|
|
64
|
+
if (data.payload?.appSettings) {
|
|
65
|
+
store.dispatch(receiveAppSettings(data.payload.appSettings));
|
|
66
|
+
}
|
|
67
|
+
setInitialFrontendSettings(styling);
|
|
68
|
+
settle();
|
|
69
|
+
}
|
|
70
|
+
window.addEventListener('message', handleMessage);
|
|
71
|
+
timeout = setTimeout(() => {
|
|
72
|
+
withScope(scope => {
|
|
73
|
+
scope.setLevel(SentrySeverity.Warning);
|
|
74
|
+
scope.setExtra('timeout', REQUEST_TIMEOUT);
|
|
75
|
+
captureMessage('Waiting for the initial frontend settings took too long');
|
|
76
|
+
});
|
|
77
|
+
settle();
|
|
78
|
+
}, REQUEST_TIMEOUT);
|
|
79
|
+
ALLOWED_ADMIN_PREVIEW_ORIGINS.forEach(origin => {
|
|
80
|
+
window.parent.postMessage({
|
|
81
|
+
type: 'frontendSettingsPreviewReady'
|
|
82
|
+
}, origin);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
4
|
-
import { Link, CheckedIcon,
|
|
4
|
+
import { Link, CheckedIcon, NotificationIcon, Typography } from '@shopgate/engage/components';
|
|
5
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
5
6
|
import { BACK_IN_STOCK_PATTERN } from '@shopgate/engage/back-in-stock/constants';
|
|
6
7
|
import { i18n } from '@shopgate/engage/core/helpers';
|
|
7
8
|
import connect from "./connector";
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
const useStyles = makeStyles()(theme => ({
|
|
10
11
|
button: {
|
|
11
|
-
color: theme.palette.warning.main
|
|
12
|
-
width: '100%'
|
|
12
|
+
color: theme.palette.warning.main
|
|
13
13
|
},
|
|
14
14
|
backInStockMessageContainer: {
|
|
15
15
|
display: 'flex',
|
|
@@ -114,10 +114,10 @@ const BackInStockButton = ({
|
|
|
114
114
|
}
|
|
115
115
|
if (showAsButton) {
|
|
116
116
|
return /*#__PURE__*/_jsx(Button, {
|
|
117
|
-
|
|
117
|
+
color: "secondary",
|
|
118
|
+
fullWidth: true,
|
|
118
119
|
tabIndex: 0,
|
|
119
120
|
onClick: handleClick,
|
|
120
|
-
className: classes.button,
|
|
121
121
|
children: /*#__PURE__*/_jsx("span", {
|
|
122
122
|
className: classes.buttonText,
|
|
123
123
|
children: i18n.text('back_in_stock.get_notified')
|