@shopgate/engage 7.12.3 → 7.20.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/components/Section/index.js +2 -2
- package/a11y/components/VisuallyHidden/index.js +8 -0
- package/a11y/components/index.js +1 -0
- package/a11y/constants/index.js +1 -0
- package/a11y/helpers/index.js +1 -0
- package/a11y/index.js +1 -4
- package/account/actions/addContacts.js +1 -1
- package/account/actions/deleteContact.js +1 -1
- package/account/actions/deleteCustomer.js +1 -1
- package/account/actions/fetchContacts.js +1 -1
- package/account/actions/fetchCustomer.js +1 -1
- package/account/actions/updateContact.js +1 -1
- package/account/actions/updateCustomer.js +1 -1
- package/account/components/Account/Account.style.js +1 -1
- package/account/components/Profile/Profile.provider.js +3 -3
- package/account/components/ProfileContact/ProfileContact.js +1 -1
- package/app-rating/action-creators/appStart.js +3 -3
- package/app-rating/action-creators/ordersPlaced.js +3 -3
- package/app-rating/action-creators/popup.js +4 -4
- package/app-rating/action-creators/timer.js +3 -3
- package/app-rating/actions/showModal.js +6 -6
- package/app-rating/constants/index.js +2 -2
- package/app-rating/reducers/index.js +2 -2
- package/app-rating/subscriptions/index.js +4 -4
- package/back-in-stock/actions/index.js +14 -0
- package/back-in-stock/components/BackInStockButton/connector.js +1 -0
- package/back-in-stock/components/BackInStockButton/index.js +14 -0
- package/back-in-stock/components/BackInStockButton/style.js +1 -0
- package/back-in-stock/components/CharacteristicsButton/connector.js +3 -0
- package/back-in-stock/components/CharacteristicsButton/index.js +8 -0
- package/back-in-stock/components/ProductInfoBackInStockButton/connector.js +3 -0
- package/back-in-stock/components/ProductInfoBackInStockButton/index.js +10 -0
- package/back-in-stock/components/Subscriptions/components/List/index.js +4 -0
- package/back-in-stock/components/Subscriptions/components/Subscription/index.js +7 -0
- package/back-in-stock/components/Subscriptions/index.js +4 -0
- package/back-in-stock/components/index.js +1 -0
- package/back-in-stock/constants/Actions.js +1 -0
- package/back-in-stock/constants/Common.js +1 -0
- package/back-in-stock/constants/Pipelines.js +1 -0
- package/back-in-stock/constants/Portals.js +9 -0
- package/back-in-stock/constants/index.js +1 -0
- package/back-in-stock/hooks/index.js +4 -0
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.connector.js +7 -0
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.context.js +1 -0
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +5 -0
- package/back-in-stock/providers/index.js +1 -0
- package/back-in-stock/reducers/index.js +5 -0
- package/back-in-stock/selectors/index.js +43 -0
- package/back-in-stock/streams/index.js +1 -0
- package/back-in-stock/subscriptions/index.js +11 -0
- package/cart/cart.helpers.js +2 -2
- package/cart/components/CartItem/CartItemCoupon.js +10 -6
- package/cart/components/CartItem/CartItemCouponCode.js +2 -2
- package/cart/components/CartItem/CartItemCouponDelete.js +1 -1
- package/cart/components/CartItem/CartItemCouponFreeShipping.js +1 -1
- package/cart/components/CartItem/CartItemCouponIcon.js +2 -2
- package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -1
- package/cart/components/CartItem/CartItemCouponTitle.js +2 -2
- package/cart/components/CartItem/CartItemProductLayout.js +3 -2
- package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -1
- package/cart/components/CartItem/CartItemProductTitle.js +2 -2
- package/cart/components/CartItem/CartItemQuantityPicker.js +26 -14
- package/cart/components/CartItem/CartItemSubstitution.js +1 -1
- package/cart/components/CartItems/CartItemCardReservation.js +1 -1
- package/cart/components/CartItems/CartItemGroupReservation.js +1 -1
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -1
- package/cart/components/PaymentBar/PaymentBar.js +1 -1
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -1
- package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +1 -1
- package/cart/index.js +1 -1
- package/category/actions/index.js +1 -0
- package/category/components/CategoryList/index.js +7 -0
- package/category/components/CategoryList/style.js +1 -0
- package/category/components/index.js +1 -1
- package/category/constants/index.js +1 -0
- package/category/helpers/index.js +1 -0
- package/category/index.js +1 -6
- package/category/selectors/index.js +2 -0
- package/category/streams/index.js +1 -1
- package/checkout/actions/errorCheckout.js +1 -1
- package/checkout/actions/fetchCheckoutOrder.js +1 -1
- package/checkout/actions/fetchPaymentMethods.js +1 -1
- package/checkout/actions/initializeCheckout.js +1 -1
- package/checkout/actions/prepareCheckout.js +2 -2
- package/checkout/actions/submitCheckoutOrder.js +1 -1
- package/checkout/actions/updateCheckoutOrder.js +1 -1
- package/checkout/components/Checkout/CheckoutSectionMessages.js +1 -1
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +1 -1
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +1 -1
- package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +1 -1
- package/checkout/components/ShippingMethods/ShippingMethods.js +4 -4
- package/checkout/paymentMethods/index.js +2 -2
- package/checkout/paymentMethods/paypal/PaypalButtonApp.js +1 -1
- package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +1 -1
- package/checkout/paymentMethods/paypal/PaypalPayButton.js +1 -1
- package/checkout/paymentMethods/paypal/PaypalProvider.js +1 -1
- package/checkout/paymentMethods/stripe/StripeButton.js +2 -2
- package/checkout/paymentMethods/stripe/StripeCreditCard.js +3 -3
- package/checkout/paymentMethods/stripe/StripeProvider.js +8 -8
- package/checkout/paymentMethods/stripe/sdk.js +1 -1
- package/checkout/providers/AddressBookProvider.js +1 -1
- package/checkout/providers/CheckoutProvider.js +8 -8
- package/components/ChipLayout/index.js +38 -0
- package/components/ChipLayout/spec.js +5 -0
- package/components/ChipLayout/style.js +5 -0
- package/components/Footer/Footer.js +7 -7
- package/components/Form/Builder/Builder.js +50 -29
- package/components/Form/Builder/ElementCheckbox.js +1 -1
- package/components/Form/Builder/ElementMultiSelect.js +1 -1
- package/components/Form/Builder/ElementPhoneNumber.js +3 -3
- package/components/Form/Builder/ElementRadio.js +1 -1
- package/components/Form/Builder/ElementSelect.js +1 -1
- package/components/Form/Builder/ElementText.js +3 -3
- package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
- package/components/Form/Builder/classes/ActionListener.js +73 -16
- package/components/Form/Builder/helpers/buildFormElements.js +2 -2
- package/components/Form/Form.js +8 -5
- package/components/IntersectionVisibility/index.js +14 -7
- package/components/Logo/connector.js +4 -0
- package/components/Logo/index.js +4 -0
- package/components/Logo/spec.js +1 -0
- package/components/Logo/style.js +1 -0
- package/components/Menu/components/Position/index.js +5 -5
- package/components/Menu/index.js +9 -9
- package/components/MessageBar/MessageBar.js +1 -1
- package/components/MessageBar/index.js +1 -1
- package/components/NavigationHandler/index.js +4 -4
- package/components/NavigationHandler/spec.js +1 -1
- package/components/Picker/components/Button/index.js +1 -1
- package/components/Picker/components/List/index.js +2 -2
- package/components/Picker/components/Modal/index.js +7 -7
- package/components/Picker/index.js +18 -9
- package/components/PickerUtilize/components/Button/index.js +5 -0
- package/components/PickerUtilize/components/Button/style.js +1 -0
- package/components/PickerUtilize/index.js +17 -0
- package/components/PickerUtilize/spec.js +1 -0
- package/components/PickerUtilize/style.js +1 -0
- package/components/QuantityInput/QuantityInput.js +2 -2
- package/components/Radio/Radio.js +1 -1
- package/components/RadioCard/RadioCard.js +1 -1
- package/components/RangeSlider/components/Handle/index.js +1 -1
- package/components/RangeSlider/index.js +36 -24
- package/components/SheetList/components/Item/index.js +5 -5
- package/components/SheetList/index.js +4 -4
- package/components/SideNavigation/SideNavigationCategories.connector.js +2 -2
- package/components/SnackBarContainer/index.js +5 -0
- package/components/Switch/index.js +12 -0
- package/components/Switch/style.js +1 -0
- package/components/Tabs/components/TabIndicator.js +2 -2
- package/components/Tabs/components/Tabs.js +1 -1
- package/components/TimeBoundary/index.js +8 -6
- package/components/VideoPlayer/index.js +9 -6
- package/components/View/components/Above/index.js +1 -1
- package/components/View/components/Below/index.js +1 -1
- package/components/View/components/Content/index.js +18 -11
- package/components/View/index.js +1 -1
- package/components/View/provider.js +22 -5
- package/components/index.js +2 -2
- package/core/action-creators/app.js +5 -0
- package/core/action-creators/appPermissions.js +9 -0
- package/core/action-creators/index.js +1 -1
- package/core/actions/getGeolocation.js +2 -2
- package/core/actions/grantAppTrackingTransparencyPermission.js +6 -0
- package/core/actions/grantCameraPermissions.js +1 -1
- package/core/actions/grantGeolocationPermissions.js +1 -1
- package/core/actions/grantPermissions.js +13 -6
- package/core/actions/grantPushPermissions.js +22 -0
- package/core/actions/index.js +7 -0
- package/core/actions/requestAppPermission.js +12 -0
- package/core/actions/requestAppPermissionStatus.js +12 -0
- package/core/classes/GeolocationRequest.js +2 -3
- package/core/classes/GeolocationRequestApp.js +6 -6
- package/core/classes/GeolocationRequestBrowser.js +2 -2
- package/core/classes/index.js +1 -0
- package/core/collections/AppInitialization.js +49 -0
- package/core/collections/index.js +1 -0
- package/core/commands/analyticsSetConsent.js +11 -0
- package/core/commands/index.js +1 -0
- package/core/config/ThemeConfigResolver.js +2 -2
- package/core/config/config.action-creators.js +1 -1
- package/core/config/config.actions.js +1 -1
- package/core/config/config.reducers.js +1 -1
- package/core/config/config.subscriptions.js +2 -2
- package/core/config/index.js +1 -1
- package/core/constants/actionTypes.js +1 -0
- package/core/constants/appFeatures.js +1 -0
- package/core/constants/index.js +6 -1
- package/core/contexts/index.js +1 -0
- package/core/helpers/appFeatures.js +14 -0
- package/core/helpers/appPermissions.js +43 -6
- package/core/helpers/baseUrl.js +14 -0
- package/core/helpers/environment.js +4 -0
- package/core/helpers/getFullImageSource.js +1 -1
- package/core/helpers/i18n.js +5 -3
- package/core/helpers/index.js +7 -0
- package/core/hocs/index.js +1 -0
- package/core/hocs/withCurrentProduct.js +6 -6
- package/core/hocs/withTheme.js +2 -2
- package/core/hooks/index.js +1 -0
- package/core/hooks/useAsyncMemo.js +1 -1
- package/core/hooks/useFormState.js +1 -1
- package/core/hooks/useScrollTo.js +1 -1
- package/core/hooks/useTheme.js +2 -2
- package/core/index.js +5 -52
- package/core/initialization/index.js +4 -2
- package/core/providers/AppProvider.js +10 -8
- package/core/providers/index.js +1 -0
- package/core/reducers/app.js +6 -0
- package/core/reducers/index.js +1 -1
- package/core/reducers/merchantSettings.js +1 -1
- package/core/reducers/shopSettings.js +1 -1
- package/core/selectors/app.js +9 -0
- package/core/selectors/index.js +6 -1
- package/core/streams/app.js +8 -0
- package/core/streams/appPermissions.js +19 -0
- package/core/streams/index.js +4 -0
- package/core/subscriptions/app.js +7 -0
- package/favorites/components/Item/Item.js +5 -5
- package/favorites/components/List/List.js +1 -1
- package/favorites/components/Lists/Lists.js +4 -4
- package/filter/components/PriceSlider/index.js +9 -9
- package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +9 -0
- package/filter/helpers/buildUpdatedFilters.js +1 -1
- package/filter/helpers/index.js +1 -0
- package/filter/helpers/translateFilterLabel.js +6 -0
- package/filter/index.js +1 -1
- package/filter/providers/SortProvider.helpers.js +1 -1
- package/locations/actions/fetchFulfillmentSlots.js +5 -3
- package/locations/actions/fetchInventories.js +5 -4
- package/locations/actions/fetchLocations.js +18 -3
- package/locations/actions/fetchProductInventories.js +4 -2
- package/locations/actions/fetchProductLocations.js +9 -2
- package/locations/actions/index.js +1 -1
- package/locations/actions/setUserGeolocation.js +1 -1
- package/locations/actions/setUserSearchGeolocation.js +1 -1
- package/locations/actions/submitReservation.js +2 -2
- package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +1 -1
- package/locations/components/FulfillmentPath/FulfillmentPath.js +1 -1
- package/locations/components/FulfillmentPath/FulfillmentPathItem.js +2 -2
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +2 -2
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +1 -1
- package/locations/components/FulfillmentSheet/FulfillmentSheet.js +2 -2
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +1 -1
- package/locations/components/ReserveForm/ReserveForm.js +1 -1
- package/locations/components/ReserveForm/ReserveFormPhone.js +1 -1
- package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -1
- package/locations/components/StoreFinder/StoreFinderMap.style.js +2 -2
- package/locations/components/StoreList/StoreListSearch.js +2 -2
- package/locations/locations.streams.js +1 -1
- package/locations/providers/FulfillmentProvider.js +4 -4
- package/locations/providers/StoreFinderProvider.js +1 -1
- package/locations/reducers/storage.js +3 -3
- package/locations/selectors/index.js +2 -2
- package/locations/subscriptions.js +13 -13
- package/login/components/ForgotPassword/ForgotPassword.js +1 -1
- package/orders/actions/cancelOrder.js +1 -1
- package/orders/actions/fetchOrderDetails.js +1 -1
- package/orders/constants/status.js +2 -2
- package/orders/providers/OrderDetailsPrivateProvider.js +1 -1
- package/orders/providers/OrderDetailsProvider.js +3 -3
- package/package.json +8 -8
- package/page/actions/index.js +1 -0
- package/page/components/index.js +1 -0
- package/page/constants/index.js +1 -0
- package/page/index.js +2 -4
- package/page/selectors/index.js +1 -0
- package/product/collections/index.js +1 -0
- package/product/components/Availability/Availability.connector.js +4 -5
- package/product/components/Availability/Availability.js +3 -3
- package/product/components/Characteristics/Characteristic/components/Sheet/index.js +20 -0
- package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +10 -0
- package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -0
- package/product/components/Characteristics/Characteristic/index.js +18 -0
- package/product/components/Characteristics/Characteristic/style.js +1 -0
- package/product/components/Characteristics/Swatch/index.js +12 -0
- package/product/components/Characteristics/Swatch/style.js +1 -0
- package/product/components/Characteristics/index.js +12 -0
- package/product/components/Characteristics/transition.js +1 -0
- package/product/components/Description/index.js +2 -2
- package/product/components/EffectivityDates/helpers.js +3 -3
- package/product/components/EffectivityDates/index.js +1 -1
- package/product/components/Header/PriceStriked/connector.js +9 -0
- package/product/components/Header/PriceStriked/index.js +5 -0
- package/product/components/Header/PriceStriked/style.js +1 -0
- package/product/components/Header/Shipping/components/Label/index.js +6 -0
- package/product/components/Header/Shipping/components/Label/style.js +1 -0
- package/product/components/Header/Shipping/connector.js +9 -0
- package/product/components/Header/Shipping/index.js +5 -0
- package/product/components/Header/Shipping/mock.js +1 -0
- package/product/components/Header/Shipping/spec.js +5 -0
- package/product/components/Header/Shipping/style.js +1 -0
- package/product/components/Header/Tiers/components/Tier/index.js +6 -0
- package/product/components/Header/Tiers/components/Tier/spec.js +1 -0
- package/product/components/Header/Tiers/connector.js +10 -0
- package/product/components/Header/Tiers/index.js +5 -0
- package/product/components/Header/Tiers/spec.js +1 -0
- package/product/components/Header/Tiers/style.js +1 -0
- package/product/components/Header/index.js +1 -0
- package/product/components/MapPriceHint/index.js +1 -1
- package/product/components/Media/FeaturedMedia.js +1 -1
- package/product/components/MediaSlider/index.js +1 -1
- package/product/components/Options/components/Content/connector.js +10 -0
- package/product/components/Options/components/Content/index.js +16 -0
- package/product/components/Options/components/Content/spec.js +2 -0
- package/product/components/Options/components/Option/index.js +4 -0
- package/product/components/Options/components/TextOption/components/OptionInfo/index.js +9 -0
- package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -0
- package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -0
- package/product/components/Options/components/TextOption/index.js +22 -0
- package/product/components/Options/components/TextOption/style.js +1 -0
- package/product/components/Options/index.js +5 -0
- package/product/components/OrderQuantityHint/index.js +3 -2
- package/product/components/OrderQuantityHint/style.js +1 -1
- package/product/components/PriceDifference/index.js +1 -1
- package/product/components/ProductCard/index.js +2 -2
- package/product/components/ProductCharacteristics/helpers/index.js +1 -1
- package/product/components/ProductCharacteristics/index.js +28 -12
- package/product/components/ProductDiscountBadge/spec.js +1 -1
- package/product/components/ProductGridPrice/index.js +2 -2
- package/product/components/ProductImage/index.js +15 -12
- package/product/components/ProductList/components/Item/index.js +5 -0
- package/product/components/ProductList/components/Item/style.js +2 -0
- package/product/components/ProductList/components/Iterator/index.js +5 -0
- package/product/components/ProductList/components/Iterator/style.js +1 -0
- package/product/components/ProductList/components/Layout/index.js +5 -0
- package/product/components/ProductList/components/Layout/style.js +1 -0
- package/product/components/ProductList/index.js +5 -0
- package/product/components/ProductProperties/Content.js +1 -1
- package/product/components/ProductProperties/GroupedProperties.js +1 -1
- package/product/components/ProductProperties/ListsHTML.js +1 -1
- package/product/components/ProductProperties/ProductProperties.js +1 -1
- package/product/components/ProductProperties/RowHTML.js +1 -1
- package/product/components/ProductProperties/Wrapper.js +1 -1
- package/product/components/ProductProperties/style.js +1 -1
- package/product/components/ProductProvider/connector.js +5 -0
- package/product/components/ProductProvider/index.js +4 -0
- package/product/components/ProductSlider/index.js +4 -0
- package/product/components/ProductSlider/spec.js +1 -0
- package/product/components/ProductSlider/style.js +1 -0
- package/product/components/Rating/connector.js +9 -0
- package/product/components/Rating/index.js +7 -0
- package/product/components/Rating/mock.js +5 -0
- package/product/components/Rating/spec.js +5 -0
- package/product/components/Rating/style.js +1 -0
- package/product/components/Swatch/SwatchContent.js +1 -1
- package/product/components/index.js +1 -0
- package/product/constants/index.js +1 -1
- package/product/contexts/index.js +1 -0
- package/product/helpers/index.js +2 -2
- package/product/helpers/redirects.js +1 -1
- package/product/hocs/index.js +1 -0
- package/product/hocs/withProductListEntryProduct.js +12 -0
- package/product/hooks/index.js +1 -0
- package/product/index.js +4 -11
- package/product/providers/index.js +1 -0
- package/product/selectors/product.js +13 -2
- package/product/selectors/variants.js +2 -2
- package/product/streams/index.js +1 -0
- package/push-opt-in/action-creators/index.js +1 -0
- package/push-opt-in/action-creators/optInTrigger.js +23 -0
- package/push-opt-in/action-creators/pushOptIn.js +7 -0
- package/push-opt-in/actions/index.js +1 -0
- package/push-opt-in/actions/pushOptInModal.js +8 -0
- package/push-opt-in/components/PushOptInModal/connector.js +9 -0
- package/push-opt-in/components/PushOptInModal/index.js +10 -0
- package/push-opt-in/components/PushOptInModal/push-opt-in.svg +62 -0
- package/push-opt-in/components/PushOptInModal/style.js +1 -0
- package/push-opt-in/components/index.js +1 -0
- package/push-opt-in/constants/index.js +1 -0
- package/push-opt-in/constants/optInModal.js +1 -0
- package/push-opt-in/constants/optInTrigger.js +1 -0
- package/push-opt-in/reducers/index.js +1 -0
- package/push-opt-in/reducers/optInModal.js +6 -0
- package/push-opt-in/reducers/optInTrigger.js +6 -0
- package/push-opt-in/selectors/index.js +1 -0
- package/push-opt-in/selectors/optInModal.js +8 -0
- package/push-opt-in/selectors/optInTrigger.js +5 -0
- package/push-opt-in/subscriptions/index.js +1 -0
- package/push-opt-in/subscriptions/optInTrigger.js +14 -0
- package/registration/providers/GuestRegistrationProvider.actions.js +2 -2
- package/registration/providers/GuestRegistrationProvider.js +3 -3
- package/registration/providers/RegistrationProvider.actions.js +3 -3
- package/registration/providers/RegistrationProvider.js +2 -2
- package/registration/subscriptions/index.js +1 -1
- package/reviews/actions/index.js +1 -0
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +1 -1
- package/reviews/components/Reviews/components/List/index.js +3 -3
- package/reviews/components/Reviews/components/List/spec.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
- package/reviews/components/Reviews/components/ReviewsInfo/index.js +1 -2
- package/reviews/components/Reviews/spec.js +1 -1
- package/reviews/components/index.js +1 -0
- package/reviews/constants/index.js +1 -0
- package/reviews/index.js +3 -7
- package/reviews/selectors/index.js +1 -0
- package/reviews/streams/index.js +1 -0
- package/scanner/action-creators/index.js +1 -0
- package/scanner/actions/index.js +1 -0
- package/scanner/classes/index.js +1 -0
- package/scanner/constants/index.js +1 -0
- package/scanner/helpers/index.js +1 -0
- package/scanner/index.js +1 -6
- package/scanner/streams/index.js +1 -0
- package/search/actions/index.js +1 -0
- package/search/constants/index.js +1 -0
- package/search/helpers/index.js +1 -0
- package/search/index.js +1 -6
- package/search/selectors/index.js +1 -0
- package/search/streams/index.js +1 -0
- package/styles/helpers/index.js +1 -0
- package/styles/helpers/initCSSCustomProperties.js +3 -3
- package/styles/helpers/setPageContentWidth.js +2 -1
- package/styles/index.js +1 -1
- package/tracking/components/CookieConsent/CookieConsentContent.js +1 -1
- package/tracking/constants/index.js +2 -1
- package/components/MessageBar/MessageBar.types.js +0 -0
- package/components/MessageBar/style.js +0 -1
- package/product/components/Availability/Availability.types.js +0 -1
- /package/page/{NotFound.js → components/NotFound.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useMemo,useLayoutEffect}from'react';import PropTypes from'prop-types';import kebabCase from'lodash/kebabCase';import{I18n}from'@shopgate/engage/components';/**
|
|
1
|
+
var _excluded=["title","titleParams","children"];function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useMemo,useLayoutEffect}from'react';import PropTypes from'prop-types';import kebabCase from'lodash/kebabCase';import{I18n}from'@shopgate/engage/components';/**
|
|
2
2
|
* Checks the section ref has suitable child nodes.
|
|
3
3
|
* @param {Object} ref A React ref.
|
|
4
4
|
* @param {string} headlineId The ID of the section headline.
|
|
@@ -14,4 +14,4 @@ var childNodes=[].filter.call(ref.current.childNodes,function(el){return el.getA
|
|
|
14
14
|
* @param {Object} [props.className=null] A class name for the section.
|
|
15
15
|
* @param {NodeList} [props.children=null] Component children.
|
|
16
16
|
* @returns {JSX}
|
|
17
|
-
*/function Section(props){var title=props.title,titleParams=props.titleParams,children=props.children,
|
|
17
|
+
*/function Section(props){var title=props.title,titleParams=props.titleParams,children=props.children,rest=_objectWithoutProperties(props,_excluded);var contentRef=useRef(null);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hasContent=_useState2[0],setHasContent=_useState2[1];var id=useMemo(function(){return kebabCase(title);},[title]);var observer=useMemo(function(){return new MutationObserver(function(){setHasContent(hasChildNodes(contentRef,id));});},[contentRef,id]);useLayoutEffect(function(){setHasContent(hasChildNodes(contentRef,id));observer.observe(contentRef.current,{childList:true});return function(){observer.disconnect();};},[contentRef,id,observer]);if(!hasContent){return React.createElement("section",_extends({},rest,{ref:contentRef}),children);}return React.createElement("section",_extends({},rest,{ref:contentRef,"aria-labelledby":id}),React.createElement("h2",{id:id,hidden:true},React.createElement(I18n.Text,{string:title,params:titleParams})),children);}Section.defaultProps={children:null,className:'',titleParams:{}};export default Section;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{css}from'glamor';var styles={root:css({position:'absolute !important',height:'1px',width:'1px',overflow:'hidden',clip:'rect(1px, 1px, 1px, 1px)',whiteSpace:'nowrap'})};/**
|
|
2
|
+
* This component surrounds its children with a wrapper that takes care that they are not visible
|
|
3
|
+
* on the screen, but still accessible by a screen reader.
|
|
4
|
+
* @param {Object} props The component props
|
|
5
|
+
* @param {Object} [props.tag='span'] The tag to be used for the component
|
|
6
|
+
* @param {Object} props.children Component children
|
|
7
|
+
* @returns {JSX.Element}
|
|
8
|
+
*/var VisuallyHidden=function VisuallyHidden(_ref){var _ref$tag=_ref.tag,tag=_ref$tag===void 0?'span':_ref$tag,children=_ref.children;return React.createElement(tag,{className:styles.root},children);};VisuallyHidden.defaultProps={tag:'span'};export default VisuallyHidden;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as LiveMessage}from"./LiveMessage";export{default as LiveMessenger}from"./LiveMessenger";export{default as Navigation}from"./Navigation";export{default as Section}from"./Section";export{default as VisuallyHidden}from"./VisuallyHidden";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../components/LiveMessenger/constants";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../components/LiveMessenger/helpers";
|
package/a11y/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
/** @module a11y */
|
|
2
|
-
export{default as LiveMessage}from"./components/LiveMessage";export{default as LiveMessenger}from"./components/LiveMessenger";export{default as Navigation}from"./components/Navigation";export{default as Section}from"./components/Section";// Helpers
|
|
3
|
-
export*from"./components/LiveMessenger/helpers";// Constants
|
|
4
|
-
export*from"./components/LiveMessenger/constants";
|
|
1
|
+
/** @module a11y */export*from"./components";export*from"./constants";export*from"./helpers";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
|
-
*/export var addCustomerContacts=function addCustomerContacts(_ref){var contacts=_ref.contacts;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
4
|
+
*/export var addCustomerContacts=function addCustomerContacts(_ref){var contacts=_ref.contacts;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:ADD_CUSTOMER_CONTACT,contacts:contacts});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.addContacts').setTrusted().setInput({contacts:contacts}).dispatch();case 4:response=_context.sent;dispatch({type:ADD_CUSTOMER_CONTACT_SUCCESS,contacts:contacts});_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:ADD_CUSTOMER_CONTACT_ERROR,contacts:contacts,error:_context.t0});throw _context.t0;case 12:return _context.abrupt("return",response);case 13:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
|
|
@@ -2,4 +2,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @param {Object} contactId Contact
|
|
4
4
|
* @returns {Function}
|
|
5
|
-
*/export var deleteCustomerContact=function deleteCustomerContact(contactId){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
5
|
+
*/export var deleteCustomerContact=function deleteCustomerContact(contactId){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER_CONTACT});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteContact').setInput({contactId:contactId}).setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_CONTACT_ERROR,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
|
-
*/export var deleteCustomer=function deleteCustomer(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
4
|
+
*/export var deleteCustomer=function deleteCustomer(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteCustomer').setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_SUCCESS});dispatch(successLogout(false));_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 12:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
|
-
*/export var fetchCustomerContacts=function fetchCustomerContacts(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var
|
|
4
|
+
*/export var fetchCustomerContacts=function fetchCustomerContacts(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,contacts;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER_CONTACTS});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getContacts').setTrusted().dispatch();case 4:_ref3=_context.sent;contacts=_ref3.contacts;dispatch({type:FETCH_CUSTOMER_CONTACTS_SUCCESS,contacts:contacts});return _context.abrupt("return",contacts);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_CONTACTS_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
|
-
*/export var fetchCustomerData=function fetchCustomerData(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var
|
|
4
|
+
*/export var fetchCustomerData=function fetchCustomerData(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,customer;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getCustomer').setTrusted().dispatch();case 4:_ref3=_context.sent;customer=_ref3.customer;dispatch({type:FETCH_CUSTOMER_SUCCESS,customer:customer});return _context.abrupt("return",customer);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
|
|
2
2
|
* Starts entering the checkout process for the customer.
|
|
3
3
|
* @returns {Function}
|
|
4
|
-
*/export var updateCustomerContact=function updateCustomerContact(_ref){var contactId=_ref.contactId,contact=_ref.contact;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
4
|
+
*/export var updateCustomerContact=function updateCustomerContact(_ref){var contactId=_ref.contactId,contact=_ref.contact;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER_CONTACT,contactId:contactId,contact:contact});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateContact').setTrusted().setInput({contactId:contactId,contact:contact}).dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_CONTACT_ERROR,contactId:contactId,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
|
|
2
2
|
* @param {Object} customer Customer
|
|
3
3
|
* @returns {Function}
|
|
4
|
-
*/export var updateCustomerData=function updateCustomerData(customer){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
4
|
+
*/export var updateCustomerData=function updateCustomerData(customer){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER,customer:customer});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateCustomer').setInput({customer:customer}).setTrusted().dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_SUCCESS,customer:customer});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_ERROR,customer:customer,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from'@shopgate/engage/styles';var variables=themeConfig.variables;export var title=css({fontSize:'1.5rem',padding:variables.gap.big}).toString();export var tabs=css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({width:'100%',top:0},responsiveMediaQuery('>xs',{webOnly:true}),{top:64}),responsiveMediaQuery('<=xs',{webOnly:true}),{top:56}),"position",'sticky'),"background",'rgb(255, 255, 255)'),"boxShadow",'2px 1px 6px rgba(0, 0, 0, 0.118), 2px 1px 4px rgba(0, 0, 0, 0.118)'),"zIndex",100)).toString();export var tabPanel=css({padding:variables.gap.small}).toString();
|
|
@@ -11,12 +11,12 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
11
11
|
*/var ProfileProvider=function ProfileProvider(_ref){var fetchContacts=_ref.fetchContacts,deleteContact=_ref.deleteContact,fetchCustomer=_ref.fetchCustomer,updateCustomer=_ref.updateCustomer,deleteCustomer=_ref.deleteCustomer,push=_ref.push,showDialog=_ref.showDialog,contacts=_ref.contacts,customer=_ref.customer,merchantCustomerAttributes=_ref.merchantCustomerAttributes,children=_ref.children,shopSettings=_ref.shopSettings,userLocation=_ref.userLocation,formContainerRef=_ref.formContainerRef;// Route
|
|
12
12
|
var _useRoute=useRoute(),pathname=_useRoute.pathname;var _useAddressBook=useAddressBook(),isCheckout=_useAddressBook.isCheckout,type=_useAddressBook.type,deleteContactFromOrder=_useAddressBook.deleteContactFromOrder;var _useState=useState(null),_useState2=_slicedToArray(_useState,2),requestErrors=_useState2[0],setRequestErrors=_useState2[1];// Default state.
|
|
13
13
|
var defaultState=useMemo(function(){return customer?_extends({},customer,{marketingOptIn:customer.settings.marketingOptIn||false},extractDefaultValues(customer.attributes)):null;},[customer]);// Saving the form.
|
|
14
|
-
var saveForm=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var attributes,validationErrors,code,errors,converted,_converted$validation;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
14
|
+
var saveForm=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var attributes,validationErrors,code,errors,converted,_converted$validation;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);attributes=extractAttributes(merchantCustomerAttributes,values);_context.prev=2;_context.next=5;return updateCustomer(_extends({firstName:values.firstName},values.middleName?{middleName:values.middleName}:{},{lastName:values.lastName,emailAddress:values.emailAddress,settings:{marketingOptIn:values.marketingOptIn},attributes:attributes}));case 5:_context.next=7;return fetchCustomer();case 7:UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.success',message:'account.profile.form.success'});_context.next=15;break;case 10:_context.prev=10;_context.t0=_context["catch"](2);code=_context.t0.code,errors=_context.t0.errors;if(code===EVALIDATION){converted=convertPipelineValidationErrors(errors,attributes);if((converted===null||converted===void 0?void 0:converted.validation)&&Object.keys(converted.validation).length>0){validationErrors=converted===null||converted===void 0?void 0:(_converted$validation=converted.validation)===null||_converted$validation===void 0?void 0:_converted$validation.attributes;}}UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.error',message:'account.profile.form.error'});case 15:setRequestErrors(validationErrors||null);LoadingProvider.unsetLoading(pathname);case 17:case"end":return _context.stop();}},_callee,null,[[2,10]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[fetchCustomer,merchantCustomerAttributes,pathname,updateCustomer]);// Hold profile form state.
|
|
15
15
|
var constraints=useMemo(function(){return createConstraints(merchantCustomerAttributes);},[merchantCustomerAttributes]);var formState=useForm(defaultState,saveForm,constraints,formContainerRef,120);var validationErrors=useMemo(function(){return convertValidationErrors(formState.validationErrors||requestErrors||{});},[formState.validationErrors,requestErrors]);useEffect(function(){formState.scrollToError();// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
16
|
},[formState.scrollToError,requestErrors]);/**
|
|
17
17
|
* Executes callback with confirmation beforehand.
|
|
18
18
|
* @param {string} message String
|
|
19
|
-
*/var confirmation=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(message){var confirmed;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)
|
|
20
|
-
/* eslint-disable react-hooks/exhaustive-deps */var deleteContactWrapper=useCallback(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(contactId){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)
|
|
19
|
+
*/var confirmation=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(message){var confirmed;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return showDialog({title:i18n.text('account.profile.confirm.title'),message:i18n.text(message),confirm:i18n.text('account.profile.confirm.confirm')});case 2:confirmed=_context2.sent;return _context2.abrupt("return",!!confirmed);case 4:case"end":return _context2.stop();}},_callee2);}));return function confirmation(_x2){return _ref3.apply(this,arguments);};}();// Deletes a contact.
|
|
20
|
+
/* eslint-disable react-hooks/exhaustive-deps */var deleteContactWrapper=useCallback(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(contactId){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return confirmation('account.profile.confirm.messageContact');case 2:if(_context3.sent){_context3.next=4;break;}return _context3.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context3.prev=5;_context3.next=8;return deleteContact(contactId);case 8:_context3.next=10;return fetchContacts();case 10:if(!deleteContactFromOrder){_context3.next=13;break;}_context3.next=13;return deleteContactFromOrder(contactId);case 13:_context3.next=17;break;case 15:_context3.prev=15;_context3.t0=_context3["catch"](5);case 17:LoadingProvider.unsetLoading(pathname);case 18:case"end":return _context3.stop();}},_callee3,null,[[5,15]]);}));return function(_x3){return _ref4.apply(this,arguments);};}(),[deleteContact,fetchContacts,pathname]);var deleteCustomerWrapper=useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return confirmation('account.profile.confirm.messageCustomer');case 2:if(_context4.sent){_context4.next=4;break;}return _context4.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context4.prev=5;_context4.next=8;return deleteCustomer();case 8:_context4.next=12;break;case 10:_context4.prev=10;_context4.t0=_context4["catch"](5);case 12:LoadingProvider.unsetLoading(pathname);case 13:case"end":return _context4.stop();}},_callee4,null,[[5,10]]);})),[deleteContact,fetchContacts,pathname]);/* eslint-enable react-hooks/exhaustive-deps */var editContact=useCallback(function(contact){var editPathname=isCheckout?"".concat(CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN).replace(':type',type):PROFILE_ADDRESS_PATH;push({pathname:editPathname,state:{contact:contact}});},[isCheckout,push,type]);// Store context value.
|
|
21
21
|
var contextValue=useMemo(function(){return{contacts:contacts,validationErrors:validationErrors,merchantCustomerAttributes:merchantCustomerAttributes,customer:defaultState,isCheckout:isCheckout,supportedCountries:shopSettings.supportedCountries,countrySortOrder:shopSettings.countrySortOrder,userLocation:userLocation,formState:formState,saveForm:formState.handleSubmit,editContact:editContact,deleteContact:deleteContactWrapper,deleteCustomer:deleteCustomerWrapper};},[userLocation,shopSettings.supportedCountries,shopSettings.countrySortOrder,contacts,merchantCustomerAttributes,isCheckout,defaultState,deleteContactWrapper,deleteCustomerWrapper,editContact,formState,validationErrors]);// Fetch all required data for the profile page.
|
|
22
22
|
useEffect(function(){fetchContacts();fetchCustomer();},[fetchContacts,fetchCustomer]);if(!customer){return null;}return React.createElement(ProfileContext.Provider,{value:contextValue},children);};ProfileProvider.defaultProps={customer:null,formContainerRef:null};export default connect(mapStateToProps,mapDispatchToProps)(ProfileProvider);
|
|
@@ -10,4 +10,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToAr
|
|
|
10
10
|
*/var ProfileContact=function ProfileContact(_ref){var shopSettings=_ref.shopSettings,userLocation=_ref.userLocation,addContact=_ref.addContact,updateContact=_ref.updateContact,pop=_ref.pop,customer=_ref.customer,numberOfAddressLines=_ref.numberOfAddressLines;var _useAddressBook=useAddressBook(),updateOrderWithContact=_useAddressBook.updateOrderWithContact,type=_useAddressBook.type,isCheckout=_useAddressBook.isCheckout;var formContainerRef=useRef(null);var _useRoute=useRoute(),pathname=_useRoute.pathname,_useRoute$state$conta=_useRoute.state.contact,contact=_useRoute$state$conta===void 0?{}:_useRoute$state$conta;var addressLines=useMemo(function(){/**
|
|
11
11
|
* Determine the number of address fields with a value. Customers are supposed to edit their
|
|
12
12
|
* old addresses after the numberOfAddressLines shop setting was changed.
|
|
13
|
-
*/var addressLinesInContact=Object.keys(contact).reduce(function(acc,key){if(key.startsWith('address')&&contact[key]){return parseInt(key.charAt(key.length-1),10);}return acc;},0);return Math.max(numberOfAddressLines,addressLinesInContact);},[contact,numberOfAddressLines]);var formConfig=useMemo(function(){return generateFormConfig({supportedCountries:shopSettings===null||shopSettings===void 0?void 0:shopSettings.supportedCountries,countrySortOrder:shopSettings===null||shopSettings===void 0?void 0:shopSettings.countrySortOrder,userLocation:userLocation,isCheckout:isCheckout,type:type,numberOfAddressLines:addressLines});},[addressLines,isCheckout,shopSettings,type,userLocation]);var constraints=useMemo(function(){return generateConstraints(isCheckout);},[isCheckout]);var handleSubmit=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var contactId,finalValues,fieldsUpdated,_ref3,_ref3$contactIds;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
13
|
+
*/var addressLinesInContact=Object.keys(contact).reduce(function(acc,key){if(key.startsWith('address')&&contact[key]){return parseInt(key.charAt(key.length-1),10);}return acc;},0);return Math.max(numberOfAddressLines,addressLinesInContact);},[contact,numberOfAddressLines]);var formConfig=useMemo(function(){return generateFormConfig({supportedCountries:shopSettings===null||shopSettings===void 0?void 0:shopSettings.supportedCountries,countrySortOrder:shopSettings===null||shopSettings===void 0?void 0:shopSettings.countrySortOrder,userLocation:userLocation,isCheckout:isCheckout,type:type,numberOfAddressLines:addressLines});},[addressLines,isCheckout,shopSettings,type,userLocation]);var constraints=useMemo(function(){return generateConstraints(isCheckout);},[isCheckout]);var handleSubmit=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var contactId,finalValues,fieldsUpdated,_ref3,_ref3$contactIds;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);contactId=contact.id;finalValues=_extends({},values,{},isCheckout&&!(contact===null||contact===void 0?void 0:contact.emailAddress)?{emailAddress:customer===null||customer===void 0?void 0:customer.emailAddress}:{});fieldsUpdated=Object.keys(values).filter(function(key){return!['isDefaultBilling','isDefaultShipping'].includes(key);}).some(function(key){return values[key]!==contact[key];});_context.prev=4;if(!(contact===null||contact===void 0?void 0:contact.id)){_context.next=10;break;}_context.next=8;return updateContact(contact.id,finalValues);case 8:_context.next=15;break;case 10:_context.next=12;return addContact(finalValues);case 12:_ref3=_context.sent;_ref3$contactIds=_slicedToArray(_ref3.contactIds,1);contactId=_ref3$contactIds[0];case 15:if(!(updateOrderWithContact&&fieldsUpdated)){_context.next=19;break;}_context.next=18;return updateOrderWithContact(contactId);case 18:return _context.abrupt("return");case 19:pop();_context.next=24;break;case 22:_context.prev=22;_context.t0=_context["catch"](4);case 24:LoadingProvider.unsetLoading(pathname);case 25:case"end":return _context.stop();}},_callee,null,[[4,22]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[addContact,contact,customer,isCheckout,pathname,pop,updateContact,updateOrderWithContact]);var formState=useFormState(contact,handleSubmit,constraints,formContainerRef);var validationErrors=useMemo(function(){return convertValidationErrors(formState.validationErrors||{});},[formState.validationErrors]);/* eslint-disable react-hooks/exhaustive-deps */var handleUpdate=useCallback(function(values){formState.setValues(values);},[formState.setValues]);/* eslint-enable react-hooks/exhaustive-deps */return React.createElement("div",{className:styles.root,ref:formContainerRef},React.createElement(FormBuilder,{name:"ProfileAddressForm",className:styles.form,config:formConfig,defaults:contact,validationErrors:validationErrors,handleUpdate:handleUpdate}),React.createElement("div",{className:styles.actions},React.createElement(RippleButton,{className:styles.button,rippleClassName:styles.ripple,type:"primary",onClick:formState.handleSubmit},i18n.text('account.profile.form.save'))));};ProfileContact.defaultProps={customer:null,numberOfAddressLines:null};export default connect(mapStateToProps,mapDispatchToProps)(ProfileContact);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{APP_RATING_RESET_APP_START_COUNT,APP_RATING_INCREASE_APP_START_COUNT}from"../constants";/**
|
|
2
2
|
* Increment the app start count
|
|
3
3
|
* @return {Object} The dispatched action object.
|
|
4
|
-
*/export var increaseAppStartCount=function increaseAppStartCount(){return{type:
|
|
4
|
+
*/export var increaseAppStartCount=function increaseAppStartCount(){return{type:APP_RATING_INCREASE_APP_START_COUNT};};/**
|
|
5
5
|
* Reset the app start count, and increment reset counts
|
|
6
6
|
* @return {Object} The dispatched action object.
|
|
7
|
-
*/export var resetAppStartCount=function resetAppStartCount(){return{type:
|
|
7
|
+
*/export var resetAppStartCount=function resetAppStartCount(){return{type:APP_RATING_RESET_APP_START_COUNT};};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{APP_RATING_RESET_ORDERS_PLACED_COUNT,APP_RATING_INCREASE_ORDERS_PLACED_COUNT}from"../constants";/**
|
|
2
2
|
* Increment the orders placed count
|
|
3
3
|
* @return {Object} The dispatched action object.
|
|
4
|
-
*/export var increaseOrdersPlacedCount=function increaseOrdersPlacedCount(){return{type:
|
|
4
|
+
*/export var increaseOrdersPlacedCount=function increaseOrdersPlacedCount(){return{type:APP_RATING_INCREASE_ORDERS_PLACED_COUNT};};/**
|
|
5
5
|
* Reset the orders placed count, and increment reset counts
|
|
6
6
|
* @return {Object} The dispatched action object.
|
|
7
|
-
*/export var resetOrdersPlacedCount=function resetOrdersPlacedCount(){return{type:
|
|
7
|
+
*/export var resetOrdersPlacedCount=function resetOrdersPlacedCount(){return{type:APP_RATING_RESET_ORDERS_PLACED_COUNT};};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{APP_RATING_INCREASE_REJECTION_COUNT,APP_RATING_SET_ALREADY_RATED,APP_RATING_SET_LAST_POPUP_TIMESTAMP}from"../constants";/**
|
|
2
2
|
* Sets the last popup timestamp
|
|
3
3
|
* @return {Object} The dispatched action object.
|
|
4
|
-
*/export var setLastPopupTimestamp=function setLastPopupTimestamp(){return{type:
|
|
4
|
+
*/export var setLastPopupTimestamp=function setLastPopupTimestamp(){return{type:APP_RATING_SET_LAST_POPUP_TIMESTAMP};};/**
|
|
5
5
|
* Sets the last popup timestamp
|
|
6
6
|
* @return {Object} The dispatched action object.
|
|
7
|
-
*/export var increaseRejectionCount=function increaseRejectionCount(){return{type:
|
|
7
|
+
*/export var increaseRejectionCount=function increaseRejectionCount(){return{type:APP_RATING_INCREASE_REJECTION_COUNT};};/**
|
|
8
8
|
* Sets the last popup timestamp
|
|
9
9
|
* @param {boolean} to the value to set the rated status
|
|
10
10
|
* @return {Object} The dispatched action object.
|
|
11
|
-
*/export var setAlreadyRated=function setAlreadyRated(to){return{type:
|
|
11
|
+
*/export var setAlreadyRated=function setAlreadyRated(to){return{type:APP_RATING_SET_ALREADY_RATED,to:to};};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{APP_RATING_SET_TIMER_START_TIME,APP_RATING_INCREASE_TIMER_REPEATS}from"../constants";/**
|
|
2
2
|
* Reset the orders placed count, and increment reset counts
|
|
3
3
|
* @return {Object} The dispatched action object.
|
|
4
|
-
*/export var resetTimerState=function resetTimerState(){return{type:
|
|
4
|
+
*/export var resetTimerState=function resetTimerState(){return{type:APP_RATING_INCREASE_TIMER_REPEATS};};/**
|
|
5
5
|
* Sets the timer start time
|
|
6
6
|
* @return {Object} The dispatched action object.
|
|
7
|
-
*/export var setTimerStartTime=function setTimerStartTime(){return{type:
|
|
7
|
+
*/export var setTimerStartTime=function setTimerStartTime(){return{type:APP_RATING_SET_TIMER_START_TIME};};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import showModalAction from'@shopgate/pwa-common/actions/modal/showModal';import{getPlatform}from'@shopgate/pwa-common/selectors/client';import{historyPush}from'@shopgate/pwa-common/actions/router';import appConfig from'@shopgate/pwa-common/helpers/config';import{track}from'@shopgate/pwa-tracking/helpers';import{increaseRejectionCount,setAlreadyRated,setLastPopupTimestamp}from"../action-creators/popup";import{generateReviewLink}from"../helpers";import{
|
|
2
|
-
* to handle the
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import showModalAction from'@shopgate/pwa-common/actions/modal/showModal';import{getPlatform}from'@shopgate/pwa-common/selectors/client';import{historyPush}from'@shopgate/pwa-common/actions/router';import appConfig from'@shopgate/pwa-common/helpers/config';import{track}from'@shopgate/pwa-tracking/helpers';import{increaseRejectionCount,setAlreadyRated,setLastPopupTimestamp}from"../action-creators/popup";import{generateReviewLink}from"../helpers";import{APP_RATING_TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";var _appConfig$appRating=appConfig.appRating,bundleId=_appConfig$appRating.bundleId,minDaysBetweenPopups=_appConfig$appRating.minDaysBetweenPopups,askForFeedback=_appConfig$appRating.askForFeedback,feedbackLink=_appConfig$appRating.feedbackLink;/**
|
|
2
|
+
* to handle the modal confirmation
|
|
3
3
|
* @param {string} url the url to redirect to
|
|
4
4
|
* @param {boolean | null} setRated the url to redirect to
|
|
5
5
|
* @return {(function(*, *): void)|*}
|
|
6
|
-
*/function redirectTo(url){var setRated=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return function(dispatch){if(!url){return;}if(setRated){dispatch(setAlreadyRated(setRated));}dispatch(historyPush(_extends({pathname:url},setRated&&{target:'_blank'})));};}/**
|
|
6
|
+
*/function redirectTo(url){var setRated=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return function(dispatch){if(!url){return;}if(setRated){dispatch(setAlreadyRated(setRated));}dispatch(historyPush(_extends({pathname:url},setRated&&{state:{target:'_blank'}})));};}/**
|
|
7
7
|
* shows the actual modal
|
|
8
8
|
* @param {Function} resetAction the reset action function
|
|
9
9
|
* @param {Function} increaseAction the function to increase the appropriate counter
|
|
10
10
|
* @param {boolean} mustShow if the modal must be shown
|
|
11
11
|
* @param {boolean} hasRepeats if the counters has repeats
|
|
12
12
|
* @return {(function(*, *): void)|*}
|
|
13
|
-
*/export function showModal(resetAction,increaseAction,mustShow,hasRepeats){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var state,platform,reviewLink,appRatingState,isMinDaysBetweenPopupsElapsed,firstModalConfirmed,userGivesFeedback;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
14
|
-
if(reviewLink){_context.next=5;break;}return _context.abrupt("return");case 5:if(!mustShow&&hasRepeats&&increaseAction){dispatch(increaseAction());}if(mustShow&&hasRepeats){_context.next=8;break;}return _context.abrupt("return");case 8:appRatingState=getAppRatingState(state);isMinDaysBetweenPopupsElapsed=Date.now()-appRatingState.lastPopupAt>=minDaysBetweenPopups*
|
|
13
|
+
*/export function showModal(resetAction,increaseAction,mustShow,hasRepeats){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var state,platform,reviewLink,appRatingState,isMinDaysBetweenPopupsElapsed,firstModalConfirmed,userGivesFeedback;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:state=getState();platform=getPlatform(state);reviewLink=generateReviewLink(bundleId[platform],platform);// no review link for current platform found -> don't show modal
|
|
14
|
+
if(reviewLink){_context.next=5;break;}return _context.abrupt("return");case 5:if(!mustShow&&hasRepeats&&increaseAction){dispatch(increaseAction());}if(mustShow&&hasRepeats){_context.next=8;break;}return _context.abrupt("return");case 8:appRatingState=getAppRatingState(state);isMinDaysBetweenPopupsElapsed=Date.now()-appRatingState.lastPopupAt>=minDaysBetweenPopups*APP_RATING_TIMER_TIMESPAN;if(isMinDaysBetweenPopupsElapsed){_context.next=12;break;}return _context.abrupt("return");case 12:dispatch(resetAction());dispatch(setLastPopupTimestamp());_context.next=16;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.message'}));case 16:firstModalConfirmed=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision',eventLabel:firstModalConfirmed?'yes':'no'},state);// user touched yes and we
|
|
15
15
|
// redirect to store
|
|
16
16
|
if(!firstModalConfirmed){_context.next=21;break;}dispatch(redirectTo(reviewLink,true));return _context.abrupt("return");case 21:// user doesn't want to rate
|
|
17
17
|
dispatch(increaseRejectionCount());// we approve for rejection
|
|
18
18
|
if(!askForFeedback){_context.next=29;break;}_context.next=25;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.rejectionApprovalMessage'}));case 25:userGivesFeedback=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision_feedback',eventLabel:userGivesFeedback?'yes':'no'},state);// user now wants to rate our app! yay :D
|
|
19
|
-
if(userGivesFeedback){dispatch(redirectTo(feedbackLink));}return _context.abrupt("return");case 29:dispatch(redirectTo(feedbackLink));case 30:case"end":return _context.stop();}}
|
|
19
|
+
if(userGivesFeedback){dispatch(redirectTo(feedbackLink));}return _context.abrupt("return");case 29:dispatch(redirectTo(feedbackLink));case 30:case"end":return _context.stop();}},_callee);}));return function(_x,_x2){return _ref.apply(this,arguments);};}());}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var
|
|
2
|
-
export var
|
|
1
|
+
export var APP_RATING_INCREASE_APP_START_COUNT='APP_RATING_INCREASE_APP_START_COUNT';export var APP_RATING_RESET_APP_START_COUNT='APP_RATING_RESET_APP_START_COUNT';export var APP_RATING_RESET_APP_START_STATE='APP_RATING_RESET_APP_START_STATE';export var APP_RATING_INCREASE_ORDERS_PLACED_COUNT='APP_RATING_INCREASE_ORDERS_PLACED_COUNT';export var APP_RATING_RESET_ORDERS_PLACED_COUNT='APP_RATING_RESET_ORDERS_PLACED_COUNT';export var APP_RATING_RESET_ORDERS_PLACED_STATE='APP_RATING_RESET_ORDERS_PLACED_STATE';export var APP_RATING_INCREASE_TIMER_REPEATS='APP_RATING_INCREASE_TIMER_REPEATS';export var APP_RATING_SET_TIMER_START_TIME='APP_RATING_SET_TIMER_START_TIME';export var APP_RATING_SET_LAST_POPUP_TIMESTAMP='APP_RATING_SET_LAST_POPUP_TIMESTAMP';export var APP_RATING_INCREASE_REJECTION_COUNT='APP_RATING_INCREASE_REJECTION_COUNT';export var APP_RATING_SET_ALREADY_RATED='APP_RATING_SET_ALREADY_RATED';// currently the timespan is set to a day
|
|
2
|
+
export var APP_RATING_TIMER_TIMESPAN=1000*60*60*24;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{APP_RATING_INCREASE_APP_START_COUNT,APP_RATING_RESET_APP_START_STATE,APP_RATING_RESET_APP_START_COUNT,APP_RATING_INCREASE_ORDERS_PLACED_COUNT,APP_RATING_RESET_ORDERS_PLACED_COUNT,APP_RATING_RESET_ORDERS_PLACED_STATE,APP_RATING_INCREASE_TIMER_REPEATS,APP_RATING_SET_TIMER_START_TIME,APP_RATING_SET_LAST_POPUP_TIMESTAMP,APP_RATING_INCREASE_REJECTION_COUNT,APP_RATING_SET_ALREADY_RATED}from"../constants";var defaultState={appStartCount:0,appStartResetCount:0,ordersPlacedCount:0,ordersPlacedResetCount:0,timerRepeatsCount:0,timerStartTimestamp:null,lastPopupAt:null,rejectionCount:0,alreadyRated:false};/**
|
|
2
2
|
* Stores all the app rating states.
|
|
3
3
|
* @param {Object} [state] The current state.
|
|
4
4
|
* @param {Object} action The action object.
|
|
5
5
|
* @return {Object} The new state.
|
|
6
|
-
*/export default(function(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case
|
|
6
|
+
*/export default(function(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case APP_RATING_INCREASE_APP_START_COUNT:{return _extends({},state,{appStartCount:state.appStartCount+1});}case APP_RATING_RESET_APP_START_COUNT:{return _extends({},state,{appStartCount:0,appStartResetCount:state.appStartResetCount+1});}case APP_RATING_RESET_APP_START_STATE:{return _extends({},state,{appStartCount:0,appStartResetCount:0});}case APP_RATING_INCREASE_ORDERS_PLACED_COUNT:{return _extends({},state,{ordersPlacedCount:state.ordersPlacedCount+1});}case APP_RATING_RESET_ORDERS_PLACED_COUNT:{return _extends({},state,{ordersPlacedCount:0,ordersPlacedResetCount:state.ordersPlacedResetCount+1});}case APP_RATING_RESET_ORDERS_PLACED_STATE:{return _extends({},state,{ordersPlacedCount:0,ordersPlacedResetCount:0});}case APP_RATING_INCREASE_TIMER_REPEATS:{return _extends({},state,{timerRepeatsCount:state.timerRepeatsCount+1});}case APP_RATING_SET_TIMER_START_TIME:{return _extends({},state,{timerStartTimestamp:Date.now()});}case APP_RATING_SET_LAST_POPUP_TIMESTAMP:{return _extends({},state,{lastPopupAt:Date.now()});}case APP_RATING_INCREASE_REJECTION_COUNT:{return _extends({},state,{rejectionCount:state.rejectionCount+1});}case APP_RATING_SET_ALREADY_RATED:{return _extends({},state,{alreadyRated:action.to});}default:return state;}});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import appConfig from'@shopgate/pwa-common/helpers/config';import{appDidStart$}from'@shopgate/pwa-common/streams/app';import{checkoutSuccess$}from'@shopgate/engage/checkout/streams';import event from'@shopgate/pwa-core/classes/Event';import{hasWebBridge}from'@shopgate/engage/core';import{increaseAppStartCount,resetAppStartCount}from"../action-creators/appStart";import{increaseOrdersPlacedCount,resetOrdersPlacedCount}from"../action-creators/ordersPlaced";import{resetTimerState,setTimerStartTime}from"../action-creators/timer";import{
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import appConfig from'@shopgate/pwa-common/helpers/config';import{appDidStart$}from'@shopgate/pwa-common/streams/app';import{checkoutSuccess$}from'@shopgate/engage/checkout/streams';import event from'@shopgate/pwa-core/classes/Event';import{hasWebBridge}from'@shopgate/engage/core';import{increaseAppStartCount,resetAppStartCount}from"../action-creators/appStart";import{increaseOrdersPlacedCount,resetOrdersPlacedCount}from"../action-creators/ordersPlaced";import{resetTimerState,setTimerStartTime}from"../action-creators/timer";import{APP_RATING_TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";import{showModal}from"../actions/showModal";/**
|
|
2
2
|
* App rating subscriptions
|
|
3
3
|
* @param {Function} subscribe The subscribe function
|
|
4
4
|
*/export default function appRating(subscribe){if(!hasWebBridge){return;}var _appConfig$appRating=appConfig.appRating,appStarts=_appConfig$appRating.appStarts,ordersPlaced=_appConfig$appRating.ordersPlaced,timeInterval=_appConfig$appRating.timeInterval,rejectionMaxCount=_appConfig$appRating.rejectionMaxCount,bundleId=_appConfig$appRating.bundleId;// even subscriber to handle app start ratings
|
|
5
5
|
// and also time interval ratings
|
|
6
|
-
subscribe(appDidStart$,/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,state,mustShowModal,hasRepeats,resetAction,increaseAction;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
6
|
+
subscribe(appDidStart$,/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,state,mustShowModal,hasRepeats,resetAction,increaseAction;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;if(!(!bundleId||!bundleId.android||!bundleId.ios)){_context.next=3;break;}return _context.abrupt("return");case 3:// every time the app starts
|
|
7
7
|
// we increase the start count
|
|
8
8
|
dispatch(increaseAppStartCount());state=getAppRatingState(getState());// if the user has already rated the app
|
|
9
9
|
// we'll cancel the operations as we
|
|
10
10
|
// don't have to show the modal once more
|
|
11
11
|
if(!state.alreadyRated){_context.next=7;break;}return _context.abrupt("return");case 7:if(!(state.rejectionCount>=rejectionMaxCount)){_context.next=9;break;}return _context.abrupt("return");case 9:// initiate the first start time
|
|
12
|
-
if(state.timerStartTimestamp===null){dispatch(setTimerStartTime());}mustShowModal=false;hasRepeats=false;resetAction=null;increaseAction=null;if(Number(timeInterval.value)>0&&Number(state.timerStartTimestamp)>0&&Date.now()-state.timerStartTimestamp>=timeInterval.value*
|
|
12
|
+
if(state.timerStartTimestamp===null){dispatch(setTimerStartTime());}mustShowModal=false;hasRepeats=false;resetAction=null;increaseAction=null;if(timeInterval&&Number(timeInterval.value)>0&&Number(state.timerStartTimestamp)>0&&Date.now()-state.timerStartTimestamp>=timeInterval.value*APP_RATING_TIMER_TIMESPAN){mustShowModal=true;hasRepeats=timeInterval.repeats===null||state.timerRepeatsCount<=timeInterval.repeats;resetAction=resetTimerState;// since the time is elapsed
|
|
13
13
|
// we reset the starting time
|
|
14
14
|
increaseAction=setTimerStartTime;}else if(appStarts){mustShowModal=Number(appStarts.value)>0&&state.appStartCount>=appStarts.value;hasRepeats=appStarts.repeats===null||state.appStartResetCount<=appStarts.repeats;resetAction=resetAppStartCount;increaseAction=null;}// the actual show modal logic
|
|
15
|
-
dispatch(showModal(resetAction,increaseAction,mustShowModal,hasRepeats));case 16:case"end":return _context.stop();}}
|
|
15
|
+
dispatch(showModal(resetAction,increaseAction,mustShowModal,hasRepeats));case 16:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());/**
|
|
16
16
|
* Handle checkout success logic
|
|
17
17
|
* @param {Function} dispatch dispatch
|
|
18
18
|
* @param {Function} getState getState
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{PipelineRequest}from'@shopgate/engage/core/classes';import{SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS,ADD_BACK_IN_STOCK_SUBSCRIPTION,ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR,ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS,REMOVE_BACK_IN_STOCK_SUBSCRIPTION,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS}from'@shopgate/engage/back-in-stock/constants';/**
|
|
2
|
+
* Fetch Back in Stock Subscriptions
|
|
3
|
+
* @returns {Function}
|
|
4
|
+
*/export var fetchBackInStockSubscriptions=function fetchBackInStockSubscriptions(){return function(dispatch){dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS});var request=new PipelineRequest(SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS).setInput({limit:100,filters:{status:{$in:['active','triggered']}}}).setRetries(0).dispatch();request.then(function(_ref){var subscriptions=_ref.subscriptions;dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS,subscriptions:subscriptions});})["catch"](function(error){dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR,error:error});});return request;};};/**
|
|
5
|
+
* Add a Back in Stock Subscription
|
|
6
|
+
* @param {Object} props Props.
|
|
7
|
+
* @param {string} props.productId The product for which the subscription should be added
|
|
8
|
+
* @returns {Function}
|
|
9
|
+
*/export var addBackInStockSubscription=function addBackInStockSubscription(_ref2){var productId=_ref2.productId;return function(dispatch){dispatch({type:ADD_BACK_IN_STOCK_SUBSCRIPTION});var request=new PipelineRequest(SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION).setInput({productCode:productId}).setRetries(0).dispatch();request.then(function(_ref3){var subscriptions=_ref3.subscriptions;dispatch({type:ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,subscriptions:subscriptions});})["catch"](function(error){dispatch({type:ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR,error:error});});return request;};};/**
|
|
10
|
+
* Remove a Back in Stock Subscription
|
|
11
|
+
* @param {Object} props Props.
|
|
12
|
+
* @param {string} props.subscriptionCode The subscription which should be deleted
|
|
13
|
+
* @returns {Function}
|
|
14
|
+
*/export var removeBackInStockSubscription=function removeBackInStockSubscription(_ref4){var subscriptionCode=_ref4.subscriptionCode;return function(dispatch){dispatch({type:REMOVE_BACK_IN_STOCK_SUBSCRIPTION});var request=new PipelineRequest(SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION).setInput({subscriptionCode:subscriptionCode}).setRetries(0).dispatch();request.then(function(_ref5){var subscriptions=_ref5.subscriptions;dispatch({type:REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,subscriptions:subscriptions});})["catch"](function(error){dispatch({type:REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR,error:error});});return request;};};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{addBackInStockSubscription}from'@shopgate/engage/back-in-stock/actions';import grantPushPermissions from'@shopgate/engage/core/actions/grantPushPermissions';var mapDispatchToProps={addBackInStockSubscription:addBackInStockSubscription,grantPushPermissions:grantPushPermissions};export default connect(null,mapDispatchToProps);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import React,{useCallback}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{themeConfig}from'@shopgate/engage';import{Link,CheckedIcon,Button,NotificationIcon}from'@shopgate/engage/components';import{BACK_IN_STOCK_PATTERN}from'@shopgate/engage/back-in-stock/constants';import{i18n}from'@shopgate/engage/core';import styles from"./style";import connect from"./connector";var colors=themeConfig.colors;/**
|
|
2
|
+
* This component renders a button to subscribe a product or a hint
|
|
3
|
+
* that the product is already subscribed
|
|
4
|
+
* @param {Object} props The component props
|
|
5
|
+
* @param {boolean} props.isLinkToBackInStockEnabled Whether the link to the back in
|
|
6
|
+
* stock page is active
|
|
7
|
+
* @param {boolean} props.stopPropagation Stop event propagation
|
|
8
|
+
* @param {string} props.productId The product id
|
|
9
|
+
* @param {Object} props.subscription The subscription
|
|
10
|
+
* @param {Function} props.addBackInStockSubscription Add product to back in stock list
|
|
11
|
+
* @param {Function} props.grantPushPermissions Request / Set push permission
|
|
12
|
+
* @return {JSX.Element}
|
|
13
|
+
*/var BackInStockButton=function BackInStockButton(_ref){var productId=_ref.productId,_ref$isLinkToBackInSt=_ref.isLinkToBackInStockEnabled,isLinkToBackInStockEnabled=_ref$isLinkToBackInSt===void 0?false:_ref$isLinkToBackInSt,subscription=_ref.subscription,_ref$stopPropagation=_ref.stopPropagation,stopPropagation=_ref$stopPropagation===void 0?false:_ref$stopPropagation,addBackInStockSubscription=_ref.addBackInStockSubscription,grantPushPermissions=_ref.grantPushPermissions,alignRight=_ref.alignRight,showAsButton=_ref.showAsButton;var handleClick=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(event){var allowed;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(stopPropagation){event.stopPropagation();}_context.next=3;return grantPushPermissions({useRationaleModal:true,useSettingsModal:true,rationaleModal:{message:'back_in_stock.rationale.message',confirm:'back_in_stock.rationale.confirm',dismiss:'common.cancel'}});case 3:allowed=_context.sent;if(allowed){addBackInStockSubscription({productId:productId});}case 5:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}(),[addBackInStockSubscription,grantPushPermissions,productId,stopPropagation]);if((subscription===null||subscription===void 0?void 0:subscription.status)==='active'){return React.createElement(Link,{href:BACK_IN_STOCK_PATTERN,disabled:!isLinkToBackInStockEnabled,className:classNames(styles.backInStockMessageContainer,_defineProperty({},styles.rightAligned,alignRight)),tag:"span"},React.createElement(CheckedIcon,{color:colors.success,className:alignRight?styles.icon:classNames(styles.iconCentered,styles.icon)}),React.createElement("span",{className:styles.backInStockMessage},i18n.text('back_in_stock.we_will_remind_you')));}if(showAsButton){return React.createElement(Button,{type:"primary",tabIndex:0,onClick:handleClick,className:styles.button},React.createElement("span",{className:styles.buttonText},i18n.text('back_in_stock.get_notified')));}return(// eslint-disable-next-line jsx-a11y/anchor-is-valid,jsx-a11y/click-events-have-key-events
|
|
14
|
+
React.createElement("a",{role:"button",tabIndex:0,onClick:handleClick,className:classNames(styles.button,_defineProperty({},styles.rightAligned,alignRight))},React.createElement(NotificationIcon,{color:colors.primary,className:styles.icon}),React.createElement("span",{className:styles.buttonText},i18n.text('back_in_stock.get_notified'))));};BackInStockButton.defaultProps={stopPropagation:false,isLinkToBackInStockEnabled:false,showAsButton:false,alignRight:false,subscription:null,productId:null};export default connect(BackInStockButton);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/engage';export default{button:css({lineHeight:'16.5px',color:themeConfig.colors.warning,width:'100%'}).toString(),buttonContent:css({display:'flex',alignItems:'center'}).toString(),backInStockMessageContainer:css({lineHeight:'16.5px',display:'flex',alignItems:'center',width:'auto'}).toString(),rightAligned:css({display:'inline-block',textAlign:'right'}).toString(),backInStockMessage:css({verticalAlign:'middle',fontSize:'0.875rem'}).toString(),buttonText:css({fontSize:'0.875rem'}).toString(),icon:css({marginRight:4,marginTop:-1,verticalAlign:'middle',flexShrink:0,alignSelf:'flex-start',display:'inline-flex'}).toString(),iconCentered:css({alignSelf:'center',marginLeft:'-2px',marginRight:'8px'}).toString()};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{getIsBackInStockEnabled,makeGetSubscriptionByCharacteristics}from'@shopgate/engage/back-in-stock/selectors';import{makeGetProductByCharacteristics}from'@shopgate/engage/product';/**
|
|
2
|
+
* @return {Object} The extended component props.
|
|
3
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getProductByCharacteristics=makeGetProductByCharacteristics({strict:true});var getSubscriptionByCharacteristics=makeGetSubscriptionByCharacteristics();return function(state,props){var variant=getProductByCharacteristics(state,props)||{};return{variant:variant,subscription:getSubscriptionByCharacteristics(state,props),isBackInStockEnabled:getIsBackInStockEnabled(state,props)};};};export default connect(makeMapStateToProps);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{BackInStockButton}from'@shopgate/engage/back-in-stock/components';import{withCurrentProduct}from'@shopgate/engage/core';import connect from"./connector";/**
|
|
2
|
+
* The CharacteristicsButton component.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @param {boolean} props.isBackInStockEnabled Whether the back in stock feature is enabled
|
|
5
|
+
* @param {Object} props.variant The variant for this entry
|
|
6
|
+
* @param {Object} props.subscription The subscription
|
|
7
|
+
* @return {JSX}
|
|
8
|
+
*/var CharacteristicsButton=function CharacteristicsButton(_ref){var _variant$stock,_variant$stock2;var isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,variant=_ref.variant;var productIsNotAVariant=!variant;var featureIsNotEnabled=!isBackInStockEnabled;var productIsNotAvailable=(variant===null||variant===void 0?void 0:(_variant$stock=variant.stock)===null||_variant$stock===void 0?void 0:_variant$stock.quantity)===0&&(variant===null||variant===void 0?void 0:(_variant$stock2=variant.stock)===null||_variant$stock2===void 0?void 0:_variant$stock2.ignoreQuantity)===false;if(productIsNotAVariant||featureIsNotEnabled||!productIsNotAvailable)return null;return React.createElement(BackInStockButton,{subscription:subscription,stopPropagation:true,productId:variant.id,alignRight:true});};CharacteristicsButton.defaultProps={variant:{},subscription:null};export default withCurrentProduct(connect(CharacteristicsButton));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{getIsBackInStockEnabled,makeGetSubscriptionByProduct}from'@shopgate/engage/back-in-stock/selectors';import{getProduct}from'@shopgate/engage/product';/**
|
|
2
|
+
* @return {Object} The extended component props.
|
|
3
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getSubscriptionByProduct=makeGetSubscriptionByProduct({status:'active'});return function(state,props){return{subscription:getSubscriptionByProduct(state,props),isBackInStockEnabled:getIsBackInStockEnabled(state,props),product:getProduct(state,props)};};};export default connect(makeMapStateToProps);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React,{Fragment}from'react';import PropTypes from'prop-types';import{SurroundPortals}from'@shopgate/engage/components';import{PRODUCT_BACK_IN_STOCK}from'@shopgate/engage/back-in-stock/constants';import{BackInStockButton}from'@shopgate/engage/back-in-stock/components';import{withCurrentProduct}from'@shopgate/engage/core';import connect from"./connector";/**
|
|
2
|
+
* The ProductInfoBackInStockButton component.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @param {boolean} props.isBackInStockEnabled Whether the back in stock feature is enabled
|
|
5
|
+
* @param {string} props.productId The product id
|
|
6
|
+
* @param {string} props.variantId The variant id
|
|
7
|
+
* @param {Object} props.product The product
|
|
8
|
+
* @param {Object} props.subscription The subscription
|
|
9
|
+
* @return {JSX.Element}
|
|
10
|
+
*/var ProductInfoBackInStockButton=function ProductInfoBackInStockButton(_ref){var _product$stock,_product$stock2;var productId=_ref.productId,variantId=_ref.variantId,isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,product=_ref.product;var productIsAVariant=(product===null||product===void 0?void 0:product.type)!=='parent'&&(product===null||product===void 0?void 0:product.type)!==null;var productIsNotAvailable=(product===null||product===void 0?void 0:(_product$stock=product.stock)===null||_product$stock===void 0?void 0:_product$stock.quantity)===0&&(product===null||product===void 0?void 0:(_product$stock2=product.stock)===null||_product$stock2===void 0?void 0:_product$stock2.ignoreQuantity)===false;var showBackInStockButton=productIsAVariant&&productIsNotAvailable&&isBackInStockEnabled;return React.createElement(Fragment,null,React.createElement(SurroundPortals,{portalName:PRODUCT_BACK_IN_STOCK,portalProps:{showBackInStockButton:showBackInStockButton}},showBackInStockButton&&React.createElement(BackInStockButton,{showAsButton:true,subscription:subscription,isLinkToBackInStockEnabled:true,productId:variantId!==null&&variantId!==void 0?variantId:productId})));};ProductInfoBackInStockButton.defaultProps={subscription:null,variantId:null,product:null};export default withCurrentProduct(connect(ProductInfoBackInStockButton));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useCallback}from'react';import{css}from'glamor';import{LoadingIndicator,Accordion,Card}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{useBackInStockSubscriptions}from'@shopgate/engage/back-in-stock/hooks';import Subscription from"../Subscription";var styles={root:css({margin:'8px 8px 10px'}).toString(),divider:css({height:1,width:'calc(100% + 32px)',backgroundColor:'rgb(234, 234, 234)',marginLeft:-16,marginRight:-16,marginBottom:16}).toString(),emptyText:css({marginBottom:16}).toString()};/**
|
|
2
|
+
* The Back In Stock Subscriptions List.
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var List=function List(){var _useBackInStockSubscr=useBackInStockSubscriptions(),isInitial=_useBackInStockSubscr.isInitial,groupedSubscriptions=_useBackInStockSubscr.groupedSubscriptions;var _renderLabel=useCallback(function(groupKey){return React.createElement("div",null,i18n.text("back_in_stock.list_states.".concat(groupKey)));},[]);return React.createElement("div",null,Object.entries(groupedSubscriptions).map(function(_ref){var _ref2=_slicedToArray(_ref,2),groupKey=_ref2[0],filteredSubscriptions=_ref2[1];return React.createElement(Card,{className:styles.root,key:groupKey},React.createElement(Accordion,{className:"",openWithChevron:true,renderLabel:function renderLabel(){return _renderLabel(groupKey);},chevronPosition:"left",startOpened:true},React.createElement("div",{className:styles.divider}),isInitial?React.createElement(LoadingIndicator,null):null,!isInitial&&filteredSubscriptions.length===0?React.createElement("div",{className:styles.emptyText},i18n.text('back_in_stock.empty_list_reminder')):null,!isInitial&&filteredSubscriptions.map(function(subscription,index){return React.createElement("div",{key:subscription.subscriptionCode},React.createElement(Subscription,{subscription:subscription,productId:subscription.productCode,key:subscription.subscriptionCode,group:groupKey}),index===filteredSubscriptions.length-1?null:React.createElement("div",{className:styles.divider}));})));}));};export default List;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from'react';import{css}from'glamor';import{Link,Ripple,PriceInfo,CrossIcon,PriceStriked,Price,Availability}from'@shopgate/engage/components';import{getProductRoute,ProductImage}from'@shopgate/engage/product';import PropTypes from'prop-types';import classNames from'classnames';import{themeConfig}from'@shopgate/engage';import{BackInStockButton}from'@shopgate/engage/back-in-stock/components';import{getThemeSettings,i18n}from'@shopgate/engage/core';import{useBackInStockSubscriptions}from'@shopgate/engage/back-in-stock/hooks';var variables=themeConfig.variables;var styles={root:css({display:'flex',position:'relative',marginBottom:16}).toString(),imageContainer:css({flex:0.4,maxWidth:170,minWidth:70,paddingRight:'8px'}).toString(),infoContainer:css({flex:1}).toString(),infoContainerRow:css({display:'flex',justifyContent:'space-between'}).toString(),baseContainerRow:css({flexDirection:'column',display:'flex',marginTop:'8px'}).toString(),priceContainerRow:css({flexDirection:'column',display:'flex',alignItems:'end',marginTop:'8px'}).toString(),priceContainer:css({minWidth:100}).toString(),priceInfo:css({wordBreak:'break-word',fontSize:'0.875rem',lineHeight:'0.875rem',color:'var(--color-text-low-emphasis)',padding:"".concat(variables.gap.xsmall,"px 0"),textAlign:'right'}).toString(),titleContainer:css({}).toString(),title:css({fontSize:17,fontWeight:600,flexWrap:'wrap',overflowWrap:'anywhere'}).toString(),removeContainer:css({minWidth:'30px'}).toString(),availabilityText:css({fontSize:'0.875rem',marginBottom:'4px'}).toString(),characteristicText:css({fontSize:'0.875rem'}).toString(),ripple:css({minWidth:'17px'}).toString()};/**
|
|
2
|
+
* Renders on single Back in Stock subscription
|
|
3
|
+
* @param {Object} props Props.
|
|
4
|
+
* @param {string} props.subscription The subscription which should be rendered
|
|
5
|
+
* @returns {JSX}
|
|
6
|
+
*/var Subscription=function Subscription(_ref){var _product$price,_product$price2,_product$price3,_product$price4,_product$characterist,_product$availability,_product$availability2;var subscription=_ref.subscription;var subscriptionCode=subscription.subscriptionCode,product=subscription.product,productCode=subscription.productCode;var _useBackInStockSubscr=useBackInStockSubscriptions(),removeBackInStockSubscription=_useBackInStockSubscr.removeBackInStockSubscription;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=((_product$price4=product.price)===null||_product$price4===void 0?void 0:_product$price4.discount)>0;var productLink=getProductRoute(product.id);return React.createElement("div",{className:styles.root},React.createElement(Link,{className:styles.imageContainer,component:"div",href:productLink,"aria-hidden":true},React.createElement(ProductImage,{src:product.featuredImageBaseUrl,resolutions:gridResolutions})),React.createElement("div",{className:styles.infoContainer},React.createElement("div",{className:styles.infoContainerRow},React.createElement(Link,{href:productLink,tag:"span",className:styles.titleContainer},React.createElement("span",{className:styles.title// eslint-disable-next-line react/no-danger
|
|
7
|
+
,dangerouslySetInnerHTML:{__html:"".concat(product.name)}})),React.createElement("div",{className:styles.removeContainer},React.createElement("button",{onClick:function onClick(){return removeBackInStockSubscription({subscriptionCode:subscriptionCode});},type:"button","aria-label":i18n.text('favorites.remove')},React.createElement(Ripple,{className:styles.ripple},React.createElement(CrossIcon,null))))),React.createElement("div",{className:classNames(styles.baseContainerRow)},product===null||product===void 0?void 0:(_product$characterist=product.characteristics)===null||_product$characterist===void 0?void 0:_product$characterist.map(function(_ref3){var label=_ref3.label,value=_ref3.value;return React.createElement("div",{key:label+value,className:styles.characteristicText},label,': ',value);}),React.createElement(Availability,{text:product===null||product===void 0?void 0:(_product$availability=product.availability)===null||_product$availability===void 0?void 0:_product$availability.text,state:product===null||product===void 0?void 0:(_product$availability2=product.availability)===null||_product$availability2===void 0?void 0:_product$availability2.state,showWhenAvailable:false,className:styles.availabilityText}),(subscription===null||subscription===void 0?void 0:subscription.status)==='active'&&React.createElement(BackInStockButton,{subscription:subscription,productId:productCode})),React.createElement("div",{className:styles.priceContainerRow},hasStrikePrice?React.createElement(PriceStriked,{value:specialPrice,currency:currency}):null,React.createElement(Price,{currency:currency,discounted:hasStrikePrice,unitPrice:defaultPrice}),!!product.price.info&&React.createElement(PriceInfo,{text:product.price.info,className:styles.priceInfo}))));};export default Subscription;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from'react';import{BackInStockSubscriptionsProvider}from'@shopgate/engage/back-in-stock/providers';import List from"./components/List";/**
|
|
2
|
+
* The Back in Stock Subscriptions component.
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var Subscriptions=function Subscriptions(){return React.createElement(BackInStockSubscriptionsProvider,null,React.createElement(List,null));};export default Subscriptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as BackInStockButton}from"./BackInStockButton";export{default as BackInStockReminders}from"./Subscriptions";export{default as ProductInfoBackInStockButton}from"./ProductInfoBackInStockButton";export{default as CharacteristicsButton}from"./CharacteristicsButton";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var FETCH_BACK_IN_STOCK_SUBSCRIPTIONS='FETCH_BACK_IN_STOCK_SUBSCRIPTIONS';export var FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS='FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS';export var FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR='FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR';export var ADD_BACK_IN_STOCK_SUBSCRIPTION='ADD_BACK_IN_STOCK_SUBSCRIPTION';export var ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS='ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS';export var ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR='ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR';export var REMOVE_BACK_IN_STOCK_SUBSCRIPTION='REMOVE_BACK_IN_STOCK_SUBSCRIPTION';export var REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS='REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS';export var REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR='REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var BACK_IN_STOCK_PATTERN='/back-in-stock';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS='shopgate.user.getBackInStockSubscriptions';export var SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION='shopgate.user.addBackInStockSubscription';export var SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION='shopgate.user.removeBackInStockSubscription';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-present, Shopgate, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache 2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/ // FEATURES
|
|
7
|
+
var NAV_MENU='nav-menu';var PRODUCT='product';// CONTENTS
|
|
8
|
+
var BACK_IN_STOCK='back-in-stock';// POSITIONS
|
|
9
|
+
var BEFORE='before';var AFTER='after';export var NAV_MENU_BACK_IN_STOCK_BEFORE="".concat(NAV_MENU,".").concat(BACK_IN_STOCK,".").concat(BEFORE);export var NAV_MENU_BACK_IN_STOCK="".concat(NAV_MENU,".").concat(BACK_IN_STOCK);export var NAV_MENU_BACK_IN_STOCK_AFTER="".concat(NAV_MENU,".").concat(BACK_IN_STOCK,".").concat(AFTER);export var PRODUCT_BACK_IN_STOCK_BEFORE="".concat(PRODUCT,".").concat(BACK_IN_STOCK,".").concat(BEFORE);export var PRODUCT_BACK_IN_STOCK="".concat(PRODUCT,".").concat(BACK_IN_STOCK);export var PRODUCT_BACK_IN_STOCK_AFTER="".concat(PRODUCT,".").concat(BACK_IN_STOCK,".").concat(AFTER);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./Actions";export*from"./Common";export*from"./Pipelines";export*from"./Portals";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from'react';import{BackInStockSubscriptionsProviderContext}from'@shopgate/engage/back-in-stock/providers';/**
|
|
2
|
+
* Gives access to the values which the context BackInStockSubscriptionsProvider provide
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/export var useBackInStockSubscriptions=function useBackInStockSubscriptions(){return React.useContext(BackInStockSubscriptionsProviderContext);};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{getBackInStockSubscriptions,getBackInStockSubscriptionsFetching,getBackInStockSubscriptionsInitial,getAreBackInStockRequestsPossible}from'@shopgate/engage/back-in-stock/selectors';import{addBackInStockSubscription,removeBackInStockSubscription}from'@shopgate/engage/back-in-stock/actions';/**
|
|
2
|
+
* @return {Function} The extended component props.
|
|
3
|
+
*/function makeMapStateToProps(){/**
|
|
4
|
+
* @param {Object} state The application state.
|
|
5
|
+
* @param {Object} props The component props
|
|
6
|
+
* @returns {Object}
|
|
7
|
+
*/return function(state,props){return{subscriptions:getBackInStockSubscriptions(state,props),isFetching:getBackInStockSubscriptionsFetching(state,props),isInitial:getBackInStockSubscriptionsInitial(state,props),requestsPossible:getAreBackInStockRequestsPossible(state,props)};};}var mapDispatchToProps={addBackInStockSubscription:addBackInStockSubscription,removeBackInStockSubscription:removeBackInStockSubscription};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from'react';var initialContext={};export default React.createContext(initialContext);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React,{useMemo}from'react';import PropTypes from'prop-types';import Context from"./BackInStockSubscriptionsProvider.context";import connect from"./BackInStockSubscriptionsProvider.connector";/**
|
|
2
|
+
* Back in Stock Provider
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var BackInStockSubscriptionsProvider=function BackInStockSubscriptionsProvider(_ref){var subscriptions=_ref.subscriptions,children=_ref.children,addBackInStockSubscription=_ref.addBackInStockSubscription,isFetching=_ref.isFetching,isInitial=_ref.isInitial,removeBackInStockSubscription=_ref.removeBackInStockSubscription,requestsPossible=_ref.requestsPossible;var groupedSubscriptions=useMemo(function(){return subscriptions.reduce(function(acc,subscription){var status=subscription.status;var groupingStatus=status==='inactive'||status==='triggered'?'past':status;acc[groupingStatus].push(subscription);return acc;},{active:[],past:[]});},[subscriptions]);// Create memoized context value.
|
|
5
|
+
var value=useMemo(function(){return{subscriptions:subscriptions,groupedSubscriptions:groupedSubscriptions,addBackInStockSubscription:addBackInStockSubscription,removeBackInStockSubscription:removeBackInStockSubscription,isFetching:isFetching,isInitial:isInitial&&requestsPossible};},[addBackInStockSubscription,groupedSubscriptions,isFetching,isInitial,removeBackInStockSubscription,subscriptions,requestsPossible]);return React.createElement(Context.Provider,{value:value},children);};BackInStockSubscriptionsProvider.defaultProps={children:null,isFetching:false,isInitial:true,requestsPossible:false};export default connect(BackInStockSubscriptionsProvider);
|