@shopgate/engage 7.12.7-beta.1 → 7.20.0-beta.10
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 +2 -2
- package/account/actions/deleteContact.js +2 -2
- package/account/actions/deleteCustomer.js +2 -2
- package/account/actions/fetchContacts.js +2 -2
- package/account/actions/fetchCustomer.js +2 -2
- package/account/actions/updateContact.js +2 -2
- package/account/actions/updateCustomer.js +2 -2
- package/account/components/Account/Account.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/account/reducers/index.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.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 +9 -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 +4 -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 +3 -2
- package/cart/streams/index.js +1 -0
- 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/CheckoutPickupContactForm.config.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/GuestCheckout/GuestCheckoutPickupNotes.config.js +1 -1
- package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +1 -1
- package/checkout/components/ShippingMethods/ShippingMethods.js +4 -4
- package/checkout/components/index.js +1 -1
- package/checkout/constants/index.js +1 -1
- package/checkout/index.js +3 -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 +3 -2
- 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/ConditionalWrapper/ConditionalWrapper.js +7 -2
- 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 +5 -4
- 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/ResponsiveContainer/ResponsiveContainer.js +2 -6
- package/components/ResponsiveContainer/breakpoints.js +2 -1
- package/components/ResponsiveContainer/hooks.js +20 -0
- package/components/ScrollHeader/index.js +2 -2
- package/components/ScrollHeader/style.js +1 -1
- 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 +15 -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 +7 -7
- package/favorites/components/List/List.js +18 -7
- package/favorites/components/List/ListAccordionLabel.js +4 -0
- package/favorites/components/List/ListContent.js +8 -0
- package/favorites/components/List/ListItemWrapper.js +6 -0
- package/favorites/components/List/styles.js +1 -0
- package/favorites/components/Lists/Lists.js +5 -5
- package/favorites/components/Lists/ListsModal.js +3 -2
- package/favorites/constants/index.js +1 -0
- package/filter/actions/index.js +1 -0
- package/filter/components/PriceSlider/index.js +9 -9
- package/filter/components/PriceSlider/style.js +1 -3
- package/filter/components/index.js +1 -0
- package/filter/constants/index.js +1 -1
- package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +9 -0
- package/filter/helpers/buildInitialFilters.js +1 -1
- 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 +2 -7
- package/filter/providers/SortProvider.helpers.js +1 -1
- package/filter/selectors/index.js +1 -1
- package/filter/streams/index.js +1 -0
- package/i18n/locale/cs-cz/countries.json +255 -0
- package/i18n/locale/de-de/countries.json +26 -28
- package/i18n/locale/el-gr/countries.json +255 -0
- package/i18n/locale/en-us/countries.json +12 -14
- package/i18n/locale/es-es/countries.json +65 -67
- package/i18n/locale/fi-fi/countries.json +255 -0
- package/i18n/locale/fr-fr/countries.json +85 -87
- package/i18n/locale/hu-hu/countries.json +255 -0
- package/i18n/locale/it-it/countries.json +11 -13
- package/i18n/locale/nl-nl/countries.json +42 -44
- package/i18n/locale/pl-pl/countries.json +255 -0
- package/i18n/locale/pt-pt/countries.json +128 -130
- package/i18n/locale/ro-ro/countries.json +255 -0
- package/i18n/locale/sv-se/countries.json +255 -0
- package/locations/action-creators/receiveInventories.js +3 -5
- package/locations/actions/fetchFulfillmentSlots.js +1 -1
- package/locations/actions/fetchProductLocations.js +2 -2
- package/locations/actions/setUserGeolocation.js +1 -1
- package/locations/actions/setUserSearchGeolocation.js +1 -1
- 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 +5 -3
- 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/index.js +1 -1
- 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 +7 -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/ProductSlider/index.js +4 -0
- package/product/components/ProductSlider/spec.js +1 -0
- package/product/components/ProductSlider/style.js +1 -0
- package/product/components/QuantityPicker/hooks.js +5 -0
- package/product/components/QuantityPicker/index.js +2 -2
- 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/UnitQuantityPicker/CartUnitQuantityPicker.js +2 -2
- package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -2
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +6 -3
- package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +7 -0
- package/product/components/UnitQuantityPicker/index.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/hooks/index.js +1 -0
- package/product/index.js +4 -11
- package/product/providers/Product/connector.js +5 -0
- package/product/providers/Product/index.js +4 -0
- package/product/providers/index.js +1 -0
- package/product/selectors/product.js +24 -3
- 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 +9 -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 +12 -0
- package/registration/components/index.js +1 -0
- package/registration/index.js +1 -1
- 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/Header/components/ReviewsExcerpt/style.js +1 -2
- 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/RatingCount/style.js +1 -2
- 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/loadCustomStyles.js +2 -2
- package/styles/helpers/setPageBackgroundColor.js +2 -1
- package/styles/helpers/setPageContentWidth.js +2 -1
- package/styles/index.js +1 -1
- package/tracking/action-creators/cookieConsent.js +24 -0
- package/tracking/action-creators/index.js +1 -4
- package/tracking/actions/cookieConsent.js +21 -0
- package/tracking/actions/index.js +1 -0
- package/tracking/components/CookieConsentModal/connector.js +6 -0
- package/tracking/components/CookieConsentModal/index.js +9 -0
- package/tracking/components/CookieConsentModal/style.js +1 -0
- package/tracking/components/CookieConsentModal/tracking-opt-in.svg +18 -0
- package/tracking/components/PrivacySettings/connector.js +6 -0
- package/tracking/components/PrivacySettings/index.js +4 -0
- package/tracking/components/PrivacySettings/style.js +1 -0
- package/tracking/components/index.js +1 -1
- package/tracking/constants/index.js +1 -1
- package/tracking/reducers/cookieConsentModal.js +6 -0
- package/tracking/reducers/cookieSettings.js +6 -0
- package/tracking/reducers/index.js +1 -0
- package/tracking/selectors/cookieConsent.js +35 -0
- package/tracking/selectors/index.js +1 -4
- package/tracking/streams/cookieConsent.js +46 -0
- package/tracking/streams/index.js +1 -1
- package/tracking/subscriptions/analytics.js +11 -0
- package/tracking/subscriptions/cookieConsent.js +13 -0
- package/tracking/subscriptions/index.js +1 -4
- package/components/MessageBar/MessageBar.types.js +0 -0
- package/components/MessageBar/style.js +0 -1
- package/i18n/locale/ru-ru/countries.json +0 -251
- package/product/components/Availability/Availability.types.js +0 -1
- package/product/components/QuantityPicker/helpers.js +0 -5
- package/tracking/components/CookieConsent/CookieConsent.connector.js +0 -4
- package/tracking/components/CookieConsent/CookieConsent.js +0 -4
- package/tracking/components/CookieConsent/CookieConsentButtons.js +0 -3
- package/tracking/components/CookieConsent/CookieConsentCheckboxes.js +0 -3
- package/tracking/components/CookieConsent/CookieConsentContent.js +0 -4
- package/tracking/components/CookieConsent/CookieConsentMessage.js +0 -4
- package/tracking/components/CookieConsent/index.js +0 -1
- package/tracking/helpers/index.js +0 -7
- package/tracking/hooks/index.js +0 -4
- package/tracking/index.js +0 -1
- package/tracking/providers/CookieConsentProvider.connector.js +0 -4
- package/tracking/providers/CookieConsentProvider.js +0 -8
- /package/{tracking/providers/CookieConsentProvider.context.js → back-in-stock/providers/BackInStockSubscriptionsProvider.context.js} +0 -0
- /package/page/{NotFound.js → components/NotFound.js} +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
{
|
|
2
|
+
"AF": "Afghanistan",
|
|
3
|
+
"AX": "Åland",
|
|
4
|
+
"AL": "Albanien",
|
|
5
|
+
"DZ": "Algeriet",
|
|
6
|
+
"VI": "Amerikanska Jungfruöarna",
|
|
7
|
+
"AS": "Amerikanska Samoa",
|
|
8
|
+
"AD": "Andorra",
|
|
9
|
+
"AO": "Angola",
|
|
10
|
+
"AI": "Anguilla",
|
|
11
|
+
"AQ": "Antarktis",
|
|
12
|
+
"AG": "Antigua och Barbuda",
|
|
13
|
+
"AR": "Argentina",
|
|
14
|
+
"AM": "Armenien",
|
|
15
|
+
"AW": "Aruba",
|
|
16
|
+
"AC": "Ascension",
|
|
17
|
+
"AU": "Australien",
|
|
18
|
+
"AZ": "Azerbajdzjan",
|
|
19
|
+
"BS": "Bahamas",
|
|
20
|
+
"BH": "Bahrain",
|
|
21
|
+
"BD": "Bangladesh",
|
|
22
|
+
"BB": "Barbados",
|
|
23
|
+
"BY": "Belarus",
|
|
24
|
+
"BE": "Belgien",
|
|
25
|
+
"BZ": "Belize",
|
|
26
|
+
"BJ": "Benin",
|
|
27
|
+
"BM": "Bermuda",
|
|
28
|
+
"BT": "Bhutan",
|
|
29
|
+
"BO": "Bolivia",
|
|
30
|
+
"BA": "Bosnien och Hercegovina",
|
|
31
|
+
"BW": "Botswana",
|
|
32
|
+
"BR": "Brasilien",
|
|
33
|
+
"VG": "Brittiska Jungfruöarna",
|
|
34
|
+
"IO": "Brittiska territoriet i Indiska oceanen",
|
|
35
|
+
"BN": "Brunei",
|
|
36
|
+
"BG": "Bulgarien",
|
|
37
|
+
"BF": "Burkina Faso",
|
|
38
|
+
"BI": "Burundi",
|
|
39
|
+
"KY": "Caymanöarna",
|
|
40
|
+
"CF": "Centralafrikanska republiken",
|
|
41
|
+
"EA": "Ceuta och Melilla",
|
|
42
|
+
"CL": "Chile",
|
|
43
|
+
"CO": "Colombia",
|
|
44
|
+
"CK": "Cooköarna",
|
|
45
|
+
"CR": "Costa Rica",
|
|
46
|
+
"CW": "Curaçao",
|
|
47
|
+
"CY": "Cypern",
|
|
48
|
+
"DK": "Danmark",
|
|
49
|
+
"DG": "Diego Garcia",
|
|
50
|
+
"DJ": "Djibouti",
|
|
51
|
+
"DM": "Dominica",
|
|
52
|
+
"DO": "Dominikanska republiken",
|
|
53
|
+
"EC": "Ecuador",
|
|
54
|
+
"EG": "Egypten",
|
|
55
|
+
"GQ": "Ekvatorialguinea",
|
|
56
|
+
"SV": "El Salvador",
|
|
57
|
+
"CI": "Elfenbenskusten",
|
|
58
|
+
"ER": "Eritrea",
|
|
59
|
+
"EE": "Estland",
|
|
60
|
+
"SZ": "Eswatini",
|
|
61
|
+
"ET": "Etiopien",
|
|
62
|
+
"FK": "Falklandsöarna",
|
|
63
|
+
"FO": "Färöarna",
|
|
64
|
+
"FJ": "Fiji",
|
|
65
|
+
"PH": "Filippinerna",
|
|
66
|
+
"FI": "Finland",
|
|
67
|
+
"AE": "Förenade Arabemiraten",
|
|
68
|
+
"FR": "Frankrike",
|
|
69
|
+
"GF": "Franska Guyana",
|
|
70
|
+
"PF": "Franska Polynesien",
|
|
71
|
+
"TF": "Franska sydterritorierna",
|
|
72
|
+
"GA": "Gabon",
|
|
73
|
+
"GM": "Gambia",
|
|
74
|
+
"GE": "Georgien",
|
|
75
|
+
"GH": "Ghana",
|
|
76
|
+
"GI": "Gibraltar",
|
|
77
|
+
"GR": "Grekland",
|
|
78
|
+
"GD": "Grenada",
|
|
79
|
+
"GL": "Grönland",
|
|
80
|
+
"GP": "Guadeloupe",
|
|
81
|
+
"GU": "Guam",
|
|
82
|
+
"GT": "Guatemala",
|
|
83
|
+
"GG": "Guernsey",
|
|
84
|
+
"GN": "Guinea",
|
|
85
|
+
"GW": "Guinea-Bissau",
|
|
86
|
+
"GY": "Guyana",
|
|
87
|
+
"HT": "Haiti",
|
|
88
|
+
"HN": "Honduras",
|
|
89
|
+
"HK": "Hongkong",
|
|
90
|
+
"IN": "Indien",
|
|
91
|
+
"ID": "Indonesien",
|
|
92
|
+
"IQ": "Irak",
|
|
93
|
+
"IR": "Iran",
|
|
94
|
+
"IE": "Irland",
|
|
95
|
+
"IS": "Island",
|
|
96
|
+
"IM": "Isle of Man",
|
|
97
|
+
"IL": "Israel",
|
|
98
|
+
"IT": "Italien",
|
|
99
|
+
"JM": "Jamaica",
|
|
100
|
+
"JP": "Japan",
|
|
101
|
+
"YE": "Jemen",
|
|
102
|
+
"JE": "Jersey",
|
|
103
|
+
"JO": "Jordanien",
|
|
104
|
+
"CX": "Julön",
|
|
105
|
+
"KH": "Kambodja",
|
|
106
|
+
"CM": "Kamerun",
|
|
107
|
+
"CA": "Kanada",
|
|
108
|
+
"IC": "Kanarieöarna",
|
|
109
|
+
"CV": "Kap Verde",
|
|
110
|
+
"BQ": "Karibiska Nederländerna",
|
|
111
|
+
"KZ": "Kazakstan",
|
|
112
|
+
"KE": "Kenya",
|
|
113
|
+
"CN": "Kina",
|
|
114
|
+
"KG": "Kirgizistan",
|
|
115
|
+
"KI": "Kiribati",
|
|
116
|
+
"CC": "Kokosöarna (Keelingöarna)",
|
|
117
|
+
"KM": "Komorerna",
|
|
118
|
+
"CG": "Kongo-Brazzaville",
|
|
119
|
+
"CD": "Kongo-Kinshasa",
|
|
120
|
+
"XK": "Kosovo",
|
|
121
|
+
"HR": "Kroatien",
|
|
122
|
+
"CU": "Kuba",
|
|
123
|
+
"KW": "Kuwait",
|
|
124
|
+
"LA": "Laos",
|
|
125
|
+
"LS": "Lesotho",
|
|
126
|
+
"LV": "Lettland",
|
|
127
|
+
"LB": "Libanon",
|
|
128
|
+
"LR": "Liberia",
|
|
129
|
+
"LY": "Libyen",
|
|
130
|
+
"LI": "Liechtenstein",
|
|
131
|
+
"LT": "Litauen",
|
|
132
|
+
"LU": "Luxemburg",
|
|
133
|
+
"MO": "Macao",
|
|
134
|
+
"MG": "Madagaskar",
|
|
135
|
+
"MW": "Malawi",
|
|
136
|
+
"MY": "Malaysia",
|
|
137
|
+
"MV": "Maldiverna",
|
|
138
|
+
"ML": "Mali",
|
|
139
|
+
"MT": "Malta",
|
|
140
|
+
"MA": "Marocko",
|
|
141
|
+
"MH": "Marshallöarna",
|
|
142
|
+
"MQ": "Martinique",
|
|
143
|
+
"MR": "Mauretanien",
|
|
144
|
+
"MU": "Mauritius",
|
|
145
|
+
"YT": "Mayotte",
|
|
146
|
+
"MX": "Mexiko",
|
|
147
|
+
"FM": "Mikronesiens federerade stater",
|
|
148
|
+
"MZ": "Moçambique",
|
|
149
|
+
"MD": "Moldavien",
|
|
150
|
+
"MC": "Monaco",
|
|
151
|
+
"MN": "Mongoliet",
|
|
152
|
+
"ME": "Montenegro",
|
|
153
|
+
"MS": "Montserrat",
|
|
154
|
+
"MM": "Myanmar (Burma)",
|
|
155
|
+
"NA": "Namibia",
|
|
156
|
+
"NR": "Nauru",
|
|
157
|
+
"NL": "Nederländerna",
|
|
158
|
+
"NP": "Nepal",
|
|
159
|
+
"NI": "Nicaragua",
|
|
160
|
+
"NE": "Niger",
|
|
161
|
+
"NG": "Nigeria",
|
|
162
|
+
"NU": "Niue",
|
|
163
|
+
"KP": "Nordkorea",
|
|
164
|
+
"MK": "Nordmakedonien",
|
|
165
|
+
"MP": "Nordmarianerna",
|
|
166
|
+
"NF": "Norfolkön",
|
|
167
|
+
"NO": "Norge",
|
|
168
|
+
"NC": "Nya Kaledonien",
|
|
169
|
+
"NZ": "Nya Zeeland",
|
|
170
|
+
"OM": "Oman",
|
|
171
|
+
"AT": "Österrike",
|
|
172
|
+
"TL": "Östtimor",
|
|
173
|
+
"PK": "Pakistan",
|
|
174
|
+
"PW": "Palau",
|
|
175
|
+
"PS": "Palestinska territorierna",
|
|
176
|
+
"PA": "Panama",
|
|
177
|
+
"PG": "Papua Nya Guinea",
|
|
178
|
+
"PY": "Paraguay",
|
|
179
|
+
"PE": "Peru",
|
|
180
|
+
"PN": "Pitcairnöarna",
|
|
181
|
+
"PL": "Polen",
|
|
182
|
+
"PT": "Portugal",
|
|
183
|
+
"PR": "Puerto Rico",
|
|
184
|
+
"QA": "Qatar",
|
|
185
|
+
"RE": "Réunion",
|
|
186
|
+
"RO": "Rumänien",
|
|
187
|
+
"RW": "Rwanda",
|
|
188
|
+
"RU": "Ryssland",
|
|
189
|
+
"KN": "Saint Kitts och Nevis",
|
|
190
|
+
"LC": "Saint Lucia",
|
|
191
|
+
"VC": "Saint Vincent och Grenadinerna",
|
|
192
|
+
"BL": "Saint-Barthélemy",
|
|
193
|
+
"MF": "Saint-Martin",
|
|
194
|
+
"PM": "Saint-Pierre och Miquelon",
|
|
195
|
+
"SB": "Salomonöarna",
|
|
196
|
+
"WS": "Samoa",
|
|
197
|
+
"SM": "San Marino",
|
|
198
|
+
"SH": "Sankta Helena",
|
|
199
|
+
"ST": "São Tomé och Príncipe",
|
|
200
|
+
"SA": "Saudiarabien",
|
|
201
|
+
"CH": "Schweiz",
|
|
202
|
+
"SN": "Senegal",
|
|
203
|
+
"RS": "Serbien",
|
|
204
|
+
"SC": "Seychellerna",
|
|
205
|
+
"SL": "Sierra Leone",
|
|
206
|
+
"SG": "Singapore",
|
|
207
|
+
"SX": "Sint Maarten",
|
|
208
|
+
"SK": "Slovakien",
|
|
209
|
+
"SI": "Slovenien",
|
|
210
|
+
"SO": "Somalia",
|
|
211
|
+
"ES": "Spanien",
|
|
212
|
+
"LK": "Sri Lanka",
|
|
213
|
+
"GB": "Storbritannien",
|
|
214
|
+
"SD": "Sudan",
|
|
215
|
+
"SR": "Surinam",
|
|
216
|
+
"SJ": "Svalbard och Jan Mayen",
|
|
217
|
+
"SE": "Sverige",
|
|
218
|
+
"ZA": "Sydafrika",
|
|
219
|
+
"GS": "Sydgeorgien och Sydsandwichöarna",
|
|
220
|
+
"KR": "Sydkorea",
|
|
221
|
+
"SS": "Sydsudan",
|
|
222
|
+
"SY": "Syrien",
|
|
223
|
+
"TJ": "Tadzjikistan",
|
|
224
|
+
"TW": "Taiwan",
|
|
225
|
+
"TZ": "Tanzania",
|
|
226
|
+
"TD": "Tchad",
|
|
227
|
+
"TH": "Thailand",
|
|
228
|
+
"CZ": "Tjeckien",
|
|
229
|
+
"TG": "Togo",
|
|
230
|
+
"TK": "Tokelau",
|
|
231
|
+
"TO": "Tonga",
|
|
232
|
+
"TT": "Trinidad och Tobago",
|
|
233
|
+
"TA": "Tristan da Cunha",
|
|
234
|
+
"TN": "Tunisien",
|
|
235
|
+
"TR": "Turkiet",
|
|
236
|
+
"TM": "Turkmenistan",
|
|
237
|
+
"TC": "Turks- och Caicosöarna",
|
|
238
|
+
"TV": "Tuvalu",
|
|
239
|
+
"DE": "Tyskland",
|
|
240
|
+
"UG": "Uganda",
|
|
241
|
+
"UA": "Ukraina",
|
|
242
|
+
"HU": "Ungern",
|
|
243
|
+
"UY": "Uruguay",
|
|
244
|
+
"US": "USA",
|
|
245
|
+
"UM": "USA:s yttre öar",
|
|
246
|
+
"UZ": "Uzbekistan",
|
|
247
|
+
"VU": "Vanuatu",
|
|
248
|
+
"EH": "Västsahara",
|
|
249
|
+
"VA": "Vatikanstaten",
|
|
250
|
+
"VE": "Venezuela",
|
|
251
|
+
"VN": "Vietnam",
|
|
252
|
+
"WF": "Wallis och Futuna",
|
|
253
|
+
"ZM": "Zambia",
|
|
254
|
+
"ZW": "Zimbabwe"
|
|
255
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import{RECEIVE_INVENTORIES}from"../constants";/**
|
|
2
|
-
* Creates the dispatched
|
|
3
|
-
* @param {Array}
|
|
4
|
-
* @
|
|
5
|
-
* @param {Array} inventories List of product invetories.
|
|
6
|
-
* @return {Object} The RECEIVE_PRODUCT_LOCATIONS action.
|
|
2
|
+
* Creates the dispatched RECEIVE_INVENTORIES action object.
|
|
3
|
+
* @param {Array} productInventories List of product inventories.
|
|
4
|
+
* @return {Object} The RECEIVE_INVENTORIES action.
|
|
7
5
|
*/var receiveInventories=function receiveInventories(productInventories){return{type:RECEIVE_INVENTORIES,productInventories:productInventories};};export default receiveInventories;
|
|
@@ -3,4 +3,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
3
3
|
* @param {Object} params Function params
|
|
4
4
|
* @param {string} params.locationCode A location code
|
|
5
5
|
* @returns {Function} A redux thunk.
|
|
6
|
-
*/function fetchFulfillmentSlots(_ref){var locationCode=_ref.locationCode;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var request,
|
|
6
|
+
*/function fetchFulfillmentSlots(_ref){var locationCode=_ref.locationCode;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var request,_ref4,fulfillmentSlots;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:request=new PipelineRequest('shopgate.storefront.getFulfillmentSlots').setInput({locationCode:locationCode}).dispatch();_context.prev=1;_context.next=4;return request;case 4:_ref4=_context.sent;fulfillmentSlots=_ref4.fulfillmentSlots;dispatch({type:FETCH_FULFILLMENT_SLOTS_SUCCESS,locationCode:locationCode,fulfillmentSlots:fulfillmentSlots});_context.next=12;break;case 9:_context.prev=9;_context.t0=_context["catch"](1);dispatch({type:FETCH_FULFILLMENT_SLOTS_ERROR,locationCode:locationCode});case 12:return _context.abrupt("return",request);case 13:case"end":return _context.stop();}},_callee,null,[[1,9]]);}));return function(_x){return _ref2.apply(this,arguments);};}());}/** @mixes {MutableFunction} */export default mutable(fetchFulfillmentSlots);
|
|
@@ -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 _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 PipelineRequest from'@shopgate/pwa-core/classes/PipelineRequest';import{mutable}from'@shopgate/pwa-common/helpers/redux';import{requestProductLocations,receiveProductLocations,errorProductLocations}from"../action-creators";import{SHOPGATE_STOREFRONT_GET_PRODUCT_LOCATIONS}from"../constants";/**
|
|
1
|
+
var _excluded=["postalCode","geolocation"];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 _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 PipelineRequest from'@shopgate/pwa-core/classes/PipelineRequest';import{mutable}from'@shopgate/pwa-common/helpers/redux';import{requestProductLocations,receiveProductLocations,errorProductLocations}from"../action-creators";import{SHOPGATE_STOREFRONT_GET_PRODUCT_LOCATIONS}from"../constants";/**
|
|
2
2
|
* Returns a list of locations and item availability for a given product
|
|
3
3
|
* @param {string} productCode The product ID to fetch locations for.
|
|
4
4
|
* @param {Object} [params={}] Optional params for the location request.
|
|
@@ -9,4 +9,4 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
|
|
|
9
9
|
* @param {string} params.geolocation.latitude Latitude to search by coordinates. Works only in
|
|
10
10
|
* combination with longitude.
|
|
11
11
|
* @returns {Function} A redux thunk.
|
|
12
|
-
*/function fetchProductLocations(productCode){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return function(dispatch){var postalCode=params.postalCode,geolocation=params.geolocation,restParams=_objectWithoutProperties(params,
|
|
12
|
+
*/function fetchProductLocations(productCode){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return function(dispatch){var postalCode=params.postalCode,geolocation=params.geolocation,restParams=_objectWithoutProperties(params,_excluded);var filters=_extends({productCode:productCode},restParams);if(geolocation){filters.longitude=params.geolocation.longitude;filters.latitude=params.geolocation.latitude;}if(postalCode){filters.postalCode=params.postalCode;}dispatch(requestProductLocations(productCode,filters));var request=new PipelineRequest(SHOPGATE_STOREFRONT_GET_PRODUCT_LOCATIONS).setInput(filters).dispatch();request.then(function(result){dispatch(receiveProductLocations(productCode,filters,result.locations));})["catch"](function(error){dispatch(errorProductLocations(productCode,error.code));});return request;};}/** @mixes {MutableFunction} */export default mutable(fetchProductLocations);
|
|
@@ -1 +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{getGeolocation,shouldFetchData}from'@shopgate/engage/core';import{setUserGeolocation}from"../action-creators";import{getUserGeolocation}from"../selectors";export default(function(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$silent=_ref.silent,silent=_ref$silent===void 0?false:_ref$silent,_ref$useFallback=_ref.useFallback,useFallback=_ref$useFallback===void 0?false:_ref$useFallback;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var geolocation;return _regeneratorRuntime.wrap(function _callee$(_context){while(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{getGeolocation,shouldFetchData}from'@shopgate/engage/core';import{setUserGeolocation}from"../action-creators";import{getUserGeolocation}from"../selectors";export default(function(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$silent=_ref.silent,silent=_ref$silent===void 0?false:_ref$silent,_ref$useFallback=_ref.useFallback,useFallback=_ref$useFallback===void 0?false:_ref$useFallback;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var geolocation;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:geolocation=getUserGeolocation(getState());if(shouldFetchData(geolocation)){_context.next=3;break;}return _context.abrupt("return",Promise.resolve(geolocation));case 3:_context.prev=3;_context.next=6;return dispatch(getGeolocation({useSettingsModal:!silent,requestPermissions:!useFallback}));case 6:geolocation=_context.sent;dispatch(setUserGeolocation(geolocation,silent));return _context.abrupt("return",geolocation);case 11:_context.prev=11;_context.t0=_context["catch"](3);return _context.abrupt("return",null);case 14:case"end":return _context.stop();}},_callee,null,[[3,11]]);}));return function(_x,_x2){return _ref2.apply(this,arguments);};}());});
|
|
@@ -1 +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{getGeolocation}from'@shopgate/engage/core';import setUserSearchGeolocation from"../action-creators/setUserSearchGeolocation";export default(function(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$silent=_ref.silent,silent=_ref$silent===void 0?false:_ref$silent,_ref$useFallback=_ref.useFallback,useFallback=_ref$useFallback===void 0?false:_ref$useFallback,_ref$productId=_ref.productId,productId=_ref$productId===void 0?null:_ref$productId,_ref$isStoreFinder=_ref.isStoreFinder,isStoreFinder=_ref$isStoreFinder===void 0?false:_ref$isStoreFinder;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var geolocation;return _regeneratorRuntime.wrap(function _callee$(_context){while(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{getGeolocation}from'@shopgate/engage/core';import setUserSearchGeolocation from"../action-creators/setUserSearchGeolocation";export default(function(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$silent=_ref.silent,silent=_ref$silent===void 0?false:_ref$silent,_ref$useFallback=_ref.useFallback,useFallback=_ref$useFallback===void 0?false:_ref$useFallback,_ref$productId=_ref.productId,productId=_ref$productId===void 0?null:_ref$productId,_ref$isStoreFinder=_ref.isStoreFinder,isStoreFinder=_ref$isStoreFinder===void 0?false:_ref$isStoreFinder;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var geolocation;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return dispatch(getGeolocation({useSettingsModal:!silent,requestPermissions:!useFallback}));case 3:geolocation=_context.sent;dispatch(setUserSearchGeolocation(geolocation,productId,isStoreFinder,silent));return _context.abrupt("return",geolocation);case 8:_context.prev=8;_context.t0=_context["catch"](0);return _context.abrupt("return",null);case 11:case"end":return _context.stop();}},_callee,null,[[0,8]]);}));return function(_x){return _ref2.apply(this,arguments);};}());});
|
|
@@ -2,4 +2,4 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
|
|
|
2
2
|
* The CartContextMenuChangeFulfillmentContent component renders a context menu which enables
|
|
3
3
|
* switching the active fulfillment method for a cart item.
|
|
4
4
|
* @returns {JSX}
|
|
5
|
-
*/var CartContextMenuChangeFulfillmentContent=function CartContextMenuChangeFulfillmentContent(){var
|
|
5
|
+
*/var CartContextMenuChangeFulfillmentContent=function CartContextMenuChangeFulfillmentContent(){var labelMapping=_defineProperty(_defineProperty(_defineProperty({},DIRECT_SHIP,'cart.change_fulfillment.direct_ship'),ROPIS,'cart.change_fulfillment.ropis'),BOPIS,'cart.change_fulfillment.bopis');var _useFulfillmentState=useFulfillmentState(),fulfillmentMethods=_useFulfillmentState.fulfillmentMethods,enabledFulfillmentMethods=_useFulfillmentState.enabledFulfillmentMethods,cartItem=_useFulfillmentState.meta.cartItem,changeFulfillment=_useFulfillmentState.changeFulfillment;var activeFulfillmentMethod=useMemo(function(){var _cartItem$fulfillment;return((_cartItem$fulfillment=cartItem.fulfillment)===null||_cartItem$fulfillment===void 0?void 0:_cartItem$fulfillment.method)||DIRECT_SHIP;},[cartItem.fulfillment]);var handleChangeFulfillment=useCallback(function(method){changeFulfillment(method,cartItem);},[cartItem,changeFulfillment]);var selectableFulfillmentMethods=useMemo(function(){if(!enabledFulfillmentMethods||!fulfillmentMethods){return[];}return fulfillmentMethods.filter(function(method){return enabledFulfillmentMethods.includes(method)&&method!==activeFulfillmentMethod;});},[activeFulfillmentMethod,enabledFulfillmentMethods,fulfillmentMethods]);var disabled=selectableFulfillmentMethods.length===0;return React.createElement(ContextMenu,{classes:contextMenuClasses,disabled:disabled},selectableFulfillmentMethods.map(function(method){return React.createElement(ContextMenu.Item,{key:method,onClick:function onClick(){return handleChangeFulfillment(method);}},React.createElement(I18n.Text,{string:labelMapping[method]}));}));};export default CartContextMenuChangeFulfillmentContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
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;}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 React,{useState,useCallback}from'react';import{Availability}from'@shopgate/engage/product';import{RadioGroup}from"../../../components";import{useFulfillmentState}from"../../locations.hooks";import{IN_STORE_PICKUP_BOPIS_LABEL,IN_STORE_PICKUP_ROPIS_LABEL,DIRECT_SHIP_LABEL,DIRECT_SHIP,ROPIS,BOPIS}from"../../constants";import{container,radioGroup}from"./FulfillmentPath.style";import{FulfillmentPathItem}from"./FulfillmentPathItem";/**
|
|
2
2
|
* Renders the fulfillment path selector stage.
|
|
3
3
|
* @returns {JSX}
|
|
4
|
-
*/export function FulfillmentPath(){var
|
|
4
|
+
*/export function FulfillmentPath(){var labelMapping=_defineProperty(_defineProperty(_defineProperty({},DIRECT_SHIP,DIRECT_SHIP_LABEL),ROPIS,IN_STORE_PICKUP_ROPIS_LABEL),BOPIS,IN_STORE_PICKUP_BOPIS_LABEL);var _useFulfillmentState=useFulfillmentState(),product=_useFulfillmentState.product,enabledFulfillmentMethods=_useFulfillmentState.enabledFulfillmentMethods,_useFulfillmentState$=_useFulfillmentState.meta,_useFulfillmentState$2=_useFulfillmentState$===void 0?{}:_useFulfillmentState$,_useFulfillmentState$3=_useFulfillmentState$2.cartItem,cartItem=_useFulfillmentState$3===void 0?undefined:_useFulfillmentState$3,changeFulfillment=_useFulfillmentState.changeFulfillment;var _ref=cartItem||{},_ref$fulfillment=_ref.fulfillment,fulfillment=_ref$fulfillment===void 0?{}:_ref$fulfillment,_ref$product=_ref.product,_ref$product2=_ref$product===void 0?{}:_ref$product,_ref$product2$fulfill=_ref$product2.fulfillmentMethods,cartItemFulfillmentMethods=_ref$product2$fulfill===void 0?[]:_ref$product2$fulfill;var _ref2=fulfillment||{},_ref2$method=_ref2.method,activeCartItemFulfillmentMethod=_ref2$method===void 0?DIRECT_SHIP:_ref2$method;var _useState=useState(labelMapping[activeCartItemFulfillmentMethod]),_useState2=_slicedToArray(_useState,2),selection=_useState2[0],setSelection=_useState2[1];var handleChange=useCallback(function(elementName){var method=Object.keys(labelMapping).find(function(key){return labelMapping[key]===elementName;});setSelection(method);changeFulfillment(method,cartItem);},[cartItem,changeFulfillment,labelMapping]);return React.createElement("div",{className:container},React.createElement(RadioGroup,{name:"cartItem.fulfillment_selector",value:selection,onChange:handleChange,className:radioGroup,isControlled:true,direction:"column"},enabledFulfillmentMethods.includes(DIRECT_SHIP)&&React.createElement(FulfillmentPathItem,{name:DIRECT_SHIP_LABEL,attributes:{disabled:!cartItemFulfillmentMethods.includes(DIRECT_SHIP)}},React.createElement(Availability,{productId:product.id,fulfillmentSelection:DIRECT_SHIP})),enabledFulfillmentMethods.includes(BOPIS)&&React.createElement(FulfillmentPathItem,{name:IN_STORE_PICKUP_BOPIS_LABEL,attributes:{disabled:!cartItemFulfillmentMethods.includes(BOPIS)}}),enabledFulfillmentMethods.includes(ROPIS)&&React.createElement(FulfillmentPathItem,{name:IN_STORE_PICKUP_ROPIS_LABEL,attributes:{disabled:!cartItemFulfillmentMethods.includes(ROPIS)}})));}
|
|
@@ -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);}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*as React from'react';import{i18n}from"../../../core";import{RadioGroupItem}from"../../../components";import{radioItem,itemLabel}from"./FulfillmentPath.style";/**
|
|
1
|
+
var _excluded=["name","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 _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*as React from'react';import{i18n}from"../../../core";import{RadioGroupItem}from"../../../components";import{radioItem,itemLabel}from"./FulfillmentPath.style";/**
|
|
2
2
|
* Renders a RadioItem element to be used by the FulfillmentPathSelector component.
|
|
3
3
|
* This component is meant to be rendered as child of a RadioGroup.
|
|
4
4
|
* @param {Object} props All props required by the RadioGroupItem component to work.
|
|
5
5
|
* @returns {JSX}
|
|
6
|
-
*/export var FulfillmentPathItem=function FulfillmentPathItem(_ref){var name=_ref.name,children=_ref.children,rest=_objectWithoutProperties(_ref,
|
|
6
|
+
*/export var FulfillmentPathItem=function FulfillmentPathItem(_ref){var name=_ref.name,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);return React.createElement(RadioGroupItem,_extends({},rest,{name:name,className:radioItem,label:React.createElement("div",{className:itemLabel},React.createElement("span",null,i18n.text(name)),children)}));};FulfillmentPathItem.defaultProps={children:null};
|
|
@@ -6,5 +6,5 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _defineProp
|
|
|
6
6
|
* @returns {JSX}
|
|
7
7
|
*/export function FulfillmentSelectorAddToCart(){var _useFulfillmentSelect=useFulfillmentSelectorState(),preferredLocation=_useFulfillmentSelect.preferredLocation,inventory=_useFulfillmentSelect.inventory,selectedLocation=_useFulfillmentSelect.selectedLocation,conditioner=_useFulfillmentSelect.conditioner,fulfillmentPaths=_useFulfillmentSelect.fulfillmentPaths,selection=_useFulfillmentSelect.selection,isDirectShipEnabled=_useFulfillmentSelect.isDirectShipEnabled,isROPISEnabled=_useFulfillmentSelect.isROPISEnabled,isBOPISEnabled=_useFulfillmentSelect.isBOPISEnabled;var usedLocation=selectedLocation||preferredLocation;// Add to cart effect to validate inventory
|
|
8
8
|
useEffect(function(){// Add most late conditioner
|
|
9
|
-
conditioner.addConditioner('fulfillment-inventory',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var
|
|
10
|
-
FulfillmentSheet.open({stage:STAGE_RESERVE_FORM});return _context.abrupt("return",false);case 22:return _context.abrupt("return",isProductAvailable(usedLocation,inventory));case 23:case"end":return _context.stop();}}
|
|
9
|
+
conditioner.addConditioner('fulfillment-inventory',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var mapping,selectedPath;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(isDirectShipEnabled&&selection===DIRECT_SHIP)){_context.next=2;break;}return _context.abrupt("return",true);case 2:mapping=_defineProperty(_defineProperty(_defineProperty({},DIRECT_SHIP,isDirectShipEnabled),ROPIS,isROPISEnabled),BOPIS,isBOPISEnabled);if(!(!selection||!mapping[selection]||!usedLocation)){_context.next=5;break;}return _context.abrupt("return",false);case 5:if(isProductAvailable(usedLocation,inventory)){_context.next=7;break;}return _context.abrupt("return",false);case 7:if(!(fulfillmentPaths.length>1)){_context.next=19;break;}_context.next=10;return promisifiedFulfillmentPathSelector();case 10:selectedPath=_context.sent;if(!(selectedPath==='')){_context.next=13;break;}return _context.abrupt("return",false);case 13:if(!(selectedPath===MULTI_LINE_RESERVE)){_context.next=15;break;}return _context.abrupt("return",true);case 15:if(!(selectedPath===QUICK_RESERVE)){_context.next=18;break;}FulfillmentSheet.open({stage:STAGE_RESERVE_FORM,fulfillmentPath:selectedPath});return _context.abrupt("return",false);case 18:return _context.abrupt("return",false);case 19:if(fulfillmentPaths.includes(MULTI_LINE_RESERVE)){_context.next=22;break;}// Open reservation form. Stop adding to a cart
|
|
10
|
+
FulfillmentSheet.open({stage:STAGE_RESERVE_FORM});return _context.abrupt("return",false);case 22:return _context.abrupt("return",isProductAvailable(usedLocation,inventory));case 23:case"end":return _context.stop();}},_callee);})),100);return function(){return conditioner.removeConditioner('fulfillment-inventory');};},[conditioner,fulfillmentPaths,selection,usedLocation,isDirectShipEnabled,isROPISEnabled,isBOPISEnabled,inventory]);return null;}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React,{useEffect,memo}from'react';import{connect}from'react-redux';import PropTypes from'prop-types';import{withWidgetSettings}from'@shopgate/engage/core';import{Grid,ResponsiveContainer,SurroundPortals}from'@shopgate/engage/components';import{MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION}from"../../../core/constants";import{provideProductAlternativeLocation}from"../../action-creators";import{StockInfo}from"../StockInfo";import{locationName,alternativeLocation as gridClassName}from"./FulfillmentSelectorLocation.style";import{itemColumn,itemSpacer}from"./FulfillmentSelectorItem.style";import{useFulfillmentSelectorState}from"./FulfillmentSelector.hooks";import{PRODUCT_FULFILLMENT_SELECTOR_ALTERNATIVE_LOCATION}from"../../constants/Portals";import{getProductAlternativeLocations}from"../../selectors";import{SORT_CLOSEST_LOCATION_WITH_INVENTORY}from"../../constants";/**
|
|
2
2
|
* The FulfillmentSelectorLocation component
|
|
3
3
|
* @returns {JSX}
|
|
4
|
-
*/function FulfillmentSelectorAlternativeLocation(_ref){var productId=_ref.productId,show=_ref.show,alternativeLocations=_ref.alternativeLocations,provideAlternativeLocation=_ref.provideAlternativeLocation,widgetSettings=_ref.widgetSettings;var _useFulfillmentSelect=useFulfillmentSelectorState(),_useFulfillmentSelect2=_useFulfillmentSelect.merchantSettings,merchantSettings=_useFulfillmentSelect2===void 0?{}:_useFulfillmentSelect2,selectedLocation=_useFulfillmentSelect.selectedLocation;var _ref2=widgetSettings||{},_ref2$alternativeLoca=_ref2.alternativeLocationOnPDP
|
|
4
|
+
*/function FulfillmentSelectorAlternativeLocation(_ref){var productId=_ref.productId,show=_ref.show,alternativeLocations=_ref.alternativeLocations,provideAlternativeLocation=_ref.provideAlternativeLocation,widgetSettings=_ref.widgetSettings;var _useFulfillmentSelect=useFulfillmentSelectorState(),_useFulfillmentSelect2=_useFulfillmentSelect.merchantSettings,merchantSettings=_useFulfillmentSelect2===void 0?{}:_useFulfillmentSelect2,selectedLocation=_useFulfillmentSelect.selectedLocation;var _ref2=widgetSettings||{},_ref2$alternativeLoca=_ref2.alternativeLocationOnPDP,_ref2$alternativeLoca2=_ref2$alternativeLoca===void 0?{}:_ref2$alternativeLoca,_ref2$alternativeLoca3=_ref2$alternativeLoca2.radius,radius=_ref2$alternativeLoca3===void 0?50:_ref2$alternativeLoca3;var showAlternative=merchantSettings[MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION]||false;useEffect(function(){if(show&&showAlternative&&productId&&!alternativeLocations){provideAlternativeLocation(productId,{sort:SORT_CLOSEST_LOCATION_WITH_INVENTORY,radius:radius});}},[productId,provideAlternativeLocation,alternativeLocations,radius,show,showAlternative]);if(!show||!showAlternative||!productId){return null;}if(!alternativeLocations||!alternativeLocations.length){return null;}var alternativeLocation=alternativeLocations.find(function(l){return l.code!==(selectedLocation===null||selectedLocation===void 0?void 0:selectedLocation.code);});return React.createElement(SurroundPortals,{portalName:PRODUCT_FULFILLMENT_SELECTOR_ALTERNATIVE_LOCATION,portalProps:{productId:productId,location:alternativeLocation}},alternativeLocation&&React.createElement(Grid,{component:"div",className:gridClassName},React.createElement(ResponsiveContainer,{appAlways:true,breakpoint:"xs"},React.createElement(Grid.Item,{className:itemColumn,grow:1,shrink:0,component:"div"},React.createElement("div",{className:locationName},alternativeLocation.name)),React.createElement(Grid.Item,{className:itemColumn,grow:1,shrink:0,component:"div"},React.createElement(StockInfo,{productId:productId,location:alternativeLocation}))),React.createElement(ResponsiveContainer,{webOnly:true,breakpoint:">xs"},React.createElement("div",{className:locationName},alternativeLocation.name,React.createElement("span",{className:itemSpacer},React.createElement(StockInfo,{productId:productId,location:alternativeLocation}))))));}FulfillmentSelectorAlternativeLocation.defaultProps={alternativeLocations:null,productId:null,widgetSettings:null};/**
|
|
5
5
|
* @param {Object} state The current application state.
|
|
6
6
|
* @param {Object} props The component props.
|
|
7
7
|
* @return {Object}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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*as React from'react';import{FulfillmentProvider,openSheet}from"../../providers";import{FulfillmentSheetContent}from"./FulfillmentSheetContent";/**
|
|
1
|
+
var _excluded=["allowClose"];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*as React from'react';import{FulfillmentProvider,openSheet}from"../../providers";import{FulfillmentSheetContent}from"./FulfillmentSheetContent";/**
|
|
2
2
|
* Renders the fulfillment sheet.
|
|
3
3
|
* @param {Object} props The component props.
|
|
4
4
|
* @returns {JSX}
|
|
5
|
-
*/export var FulfillmentSheet=function FulfillmentSheet(_ref){var _ref$allowClose=_ref.allowClose,allowClose=_ref$allowClose===void 0?true:_ref$allowClose,props=_objectWithoutProperties(_ref,
|
|
5
|
+
*/export var FulfillmentSheet=function FulfillmentSheet(_ref){var _ref$allowClose=_ref.allowClose,allowClose=_ref$allowClose===void 0?true:_ref$allowClose,props=_objectWithoutProperties(_ref,_excluded);return React.createElement(FulfillmentProvider,props,React.createElement(FulfillmentSheetContent,{allowClose:allowClose}));};FulfillmentSheet.open=openSheet;
|
|
@@ -25,4 +25,4 @@ if(groupedSlots[selectedDate]){return;}setSelectedDate(Object.keys(groupedSlots)
|
|
|
25
25
|
var _useState3=useState(null),_useState4=_slicedToArray(_useState3,2),selectedSlot=_useState4[0],setSelectedSlot=_useState4[1];var _useState5=useState(null),_useState6=_slicedToArray(_useState5,2),slotGroups=_useState6[0],setSlotGroups=_useState6[1];useEffect(function(){if(!groupedSlots||!groupedSlots[selectedDate]){setSlotGroups(null);return;}var slotGroupsNew=Object.keys(RANGES).map(function(rangeName){var _RANGES$rangeName=_slicedToArray(RANGES[rangeName],2),start=_RANGES$rangeName[0],end=_RANGES$rangeName[1];return{name:rangeName,slots:groupedSlots[selectedDate].filter(function(slot){var _slot$from$split$map=slot.from.split(':').map(function(x){return parseInt(x,10);}),_slot$from$split$map2=_slicedToArray(_slot$from$split$map,1),startHour=_slot$from$split$map2[0];return startHour>=start&&startHour<=end;})};}).filter(function(group){return group.slots.length>0;});setSlotGroups(slotGroupsNew);},[selectedDate,groupedSlots]);useEffect(function(){var _groupedSlots$selecte,_groupedSlots$selecte2;if(!selectedDate||!groupedSlots||!groupedSlots[selectedDate]){setSelectedSlot(null);return;}// Only switch if not found.
|
|
26
26
|
if(groupedSlots[selectedDate].find(function(slot){return slot.id===selectedSlot;})){return;}// Select first active slot.
|
|
27
27
|
setSelectedSlot(((_groupedSlots$selecte=groupedSlots[selectedDate])===null||_groupedSlots$selecte===void 0?void 0:(_groupedSlots$selecte2=_groupedSlots$selecte.find(function(slot){return slot.status==='active';}))===null||_groupedSlots$selecte2===void 0?void 0:_groupedSlots$selecte2.id)||null);/* eslint-disable react-hooks/exhaustive-deps */},[selectedDate]);/* eslint-enable react-hooks/exhaustive-deps */ // When opening the selected values are set to active selected content.
|
|
28
|
-
useEffect(function(){if(!isOpen||!fulfillmentSlot||!fulfillmentSlot.date){return;}setSelectedDate(fulfillmentSlot.date);setSelectedSlot(fulfillmentSlot.id);},[fulfillmentSlot,isOpen]);var handleChange=useCallback(function(){onChange(fulfillmentSlots.find(function(slot){return slot.id===selectedSlot;}));},[fulfillmentSlots,onChange,selectedSlot]);return React.createElement(SheetDrawer,{isOpen:isOpen,title:i18n.text('locations.your_current_timeslot.dialog.title'),onDidClose:onClose,allowClose:allowClose},React.createElement("div",{className:styles.root},React.createElement("span",{className:styles.title},i18n.text('locations.your_current_timeslot.dialog.date')),React.createElement("div",{className:styles.row},Object.keys(groupedSlots).map(function(date){return React.createElement("button",{type:"button",key:date,className:classnames(styles.button,styles.buttonDate,_defineProperty({},styles.buttonActive,selectedDate===date)),onClick:function onClick(){return setSelectedDate(date);}},React.createElement("span",{className:styles.buttonLabel},moment(date,'YYYY-MM-DD').format('dddd'),' ',getMonthDay(date)));})),slotGroups&&slotGroups.map(function(group){return React.createElement(Fragment,{key:group.name},React.createElement("span",{className:styles.subtitle},i18n.text("locations.your_current_timeslot.dialog.".concat(group.name))),React.createElement("div",{className:styles.row},group.slots.map(function(slot){
|
|
28
|
+
useEffect(function(){if(!isOpen||!fulfillmentSlot||!fulfillmentSlot.date){return;}setSelectedDate(fulfillmentSlot.date);setSelectedSlot(fulfillmentSlot.id);},[fulfillmentSlot,isOpen]);var handleChange=useCallback(function(){onChange(fulfillmentSlots.find(function(slot){return slot.id===selectedSlot;}));},[fulfillmentSlots,onChange,selectedSlot]);return React.createElement(SheetDrawer,{isOpen:isOpen,title:i18n.text('locations.your_current_timeslot.dialog.title'),onDidClose:onClose,allowClose:allowClose},React.createElement("div",{className:styles.root},React.createElement("span",{className:styles.title},i18n.text('locations.your_current_timeslot.dialog.date')),React.createElement("div",{className:styles.row},Object.keys(groupedSlots).map(function(date){return React.createElement("button",{type:"button",key:date,className:classnames(styles.button,styles.buttonDate,_defineProperty({},styles.buttonActive,selectedDate===date)),onClick:function onClick(){return setSelectedDate(date);}},React.createElement("span",{className:styles.buttonLabel},moment(date,'YYYY-MM-DD').format('dddd'),' ',getMonthDay(date)));})),slotGroups&&slotGroups.map(function(group){return React.createElement(Fragment,{key:group.name},React.createElement("span",{className:styles.subtitle},i18n.text("locations.your_current_timeslot.dialog.".concat(group.name))),React.createElement("div",{className:styles.row},group.slots.map(function(slot){return React.createElement("button",{type:"button",key:"".concat(slot.from,"-").concat(slot.to),onClick:function onClick(){return setSelectedSlot(slot.id);},className:classnames(styles.button,_defineProperty(_defineProperty({},styles.buttonDisabled,slot.status!=='active'),styles.buttonActive,slot.id===selectedSlot))},React.createElement("span",{className:styles.buttonLabelSlot},getRange(slot.from,slot.to)),slot.status!=='active'?React.createElement("div",{className:styles.buttonStrikethrough}):null);})));}),React.createElement("div",{className:styles.buttonScheduleContainer},React.createElement(Button,{className:styles.buttonSchedule,type:"secondary",onClick:handleChange,disabled:!selectedDate||!selectedSlot},i18n.text('locations.your_current_timeslot.dialog.schedule')))));};FulfillmentSlotSheet.defaultProps={isOpen:false,locationCode:null,fulfillmentSlots:[],fulfillmentSlot:null,allowClose:true};export default connect(makeMapStateToProps,mapDispatchToProps)(FulfillmentSlotSheet);
|
|
@@ -7,4 +7,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
7
7
|
* @returns {JSX}
|
|
8
8
|
*/function ReserveFormUnwrapped(){var _useContext=useContext(FulfillmentContext),sendReservation=_useContext.sendReservation,userInput=_useContext.userInput;var _useState=useState(determinePickupPerson(userInput)),_useState2=_slicedToArray(_useState,2),picker=_useState2[0],setPicker=_useState2[1];var defaultState={firstName:'',lastName:'',cellPhone:'',email:'',firstName2:'',lastName2:'',cellPhone2:'',email2:''};var validationConstraints=useMemo(function(){return _extends({},constraints,{},picker===PICKUP_PERSON_OTHER&&{firstName2:constraints.firstName,lastName2:constraints.lastName,cellPhone2:constraints.cellPhone,email2:constraints.email});},[picker]);var initialState=userInput?_extends({},defaultState,{},userInput):defaultState;/**
|
|
9
9
|
* @param {Object} values The form values.
|
|
10
|
-
*/var complete=useCallback(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
10
|
+
*/var complete=useCallback(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:response=values;if(picker===PICKUP_PERSON_ME){response.firstName2=response.firstName;response.lastName2=response.lastName;response.cellPhone2=response.cellPhone;response.email2=response.email;}else{response.firstName2=response.firstName2||response.firstName;response.lastName2=response.lastName2||response.lastName;response.cellPhone2=response.cellPhone2||response.cellPhone;response.email2=response.email2||response.email;}_context.next=4;return sendReservation(response);case 4:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}(),[picker,sendReservation]);var _useFormState=useFormState(initialState,complete,validationConstraints),values=_useFormState.values,handleChange=_useFormState.handleChange,handleSubmit=_useFormState.handleSubmit,changed=_useFormState.changed,valid=_useFormState.valid,_useFormState$validat=_useFormState.validationErrors,validationErrors=_useFormState$validat===void 0?{}:_useFormState$validat,isSubmitting=_useFormState.isSubmitting;var someoneElseRef=useRef(null);useLayoutEffect(function(){if(someoneElseRef.current&&picker===PICKUP_PERSON_OTHER){someoneElseRef.current.scrollIntoView({behavior:'smooth'});}},[picker,someoneElseRef]);return React.createElement(Fragment,null,React.createElement("div",{className:progressBar},React.createElement(ProgressBar,{isVisible:isSubmitting})),React.createElement("form",{onSubmit:handleSubmit,className:form},React.createElement("fieldset",{className:fieldset},React.createElement(TextField,{name:"firstName",value:values.firstName,onChange:handleChange,label:i18n.text('locations.firstName'),className:formField,errorText:i18n.text(validationErrors.firstName)}),React.createElement(TextField,{name:"lastName",value:values.lastName,onChange:handleChange,label:i18n.text('locations.lastName'),className:formField,errorText:i18n.text(validationErrors.lastName)}),React.createElement(ReserveFormPhone,{name:"cellPhone",value:values.cellPhone,onChange:handleChange,label:i18n.text('locations.cellPhone'),errorText:i18n.text(validationErrors.cellPhone)}),React.createElement(TextField,{name:"email",value:values.email,onChange:handleChange,label:i18n.text('locations.emailAddress'),className:formField,errorText:i18n.text(validationErrors.email)})),React.createElement("p",{className:formHeading},i18n.text('locations.who_will_pickup')),React.createElement("div",{className:pickerSwitch},React.createElement(RadioGroup,{name:"picker",direction:"row",value:picker,onChange:setPicker},React.createElement(RadioGroupItem,{label:i18n.text('locations.me'),name:PICKUP_PERSON_ME,className:pickerItem}),React.createElement(RadioGroupItem,{label:i18n.text('locations.someone_else'),name:PICKUP_PERSON_OTHER,className:pickerItem}))),picker===PICKUP_PERSON_OTHER&&React.createElement("fieldset",{className:fieldset,ref:someoneElseRef},React.createElement(TextField,{name:"firstName2",value:values.firstName2,onChange:handleChange,label:i18n.text('locations.firstName'),className:formField,errorText:i18n.text(validationErrors.firstName2)}),React.createElement(TextField,{name:"lastName2",value:values.lastName2,onChange:handleChange,label:i18n.text('locations.lastName'),className:formField,errorText:i18n.text(validationErrors.lastName2)}),React.createElement(ReserveFormPhone,{name:"cellPhone2",value:values.cellPhone2,onChange:handleChange,label:i18n.text('locations.cellPhone'),errorText:i18n.text(validationErrors.cellPhone2)}),React.createElement(TextField,{name:"email2",value:values.email2,onChange:handleChange,label:i18n.text('locations.emailAddress'),className:formField,errorText:i18n.text(validationErrors.email2)})),React.createElement(RippleButton,{type:"secondary",disabled:changed||valid===false||isSubmitting,className:button},i18n.text('locations.place_reservation'))));}export var ReserveForm=hot(ReserveFormUnwrapped);
|
|
@@ -2,4 +2,4 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
|
|
|
2
2
|
* Renders the reserve form phone input maybe with country selection.
|
|
3
3
|
* @param {Object} props The component props.
|
|
4
4
|
* @returns {JSX.Element}
|
|
5
|
-
*/var ReserveFormPhoneUnwrapped=React.memo(function(props){var
|
|
5
|
+
*/var ReserveFormPhoneUnwrapped=React.memo(function(props){var name=props.name,value=props.value,onChange=props.onChange,label=props.label,errorText=props.errorText,userLocation=props.userLocation;var _React$useContext=React.useContext(FulfillmentContext),shopSettings=_React$useContext.shopSettings,userInput=_React$useContext.userInput;var initialValue=React.useMemo(function(){return userInput&&userInput[name]?userInput[name]:'';},[name,userInput]);var supportedCountries=React.useMemo(function(){return shopSettings?shopSettings.supportedCountries:[];},[shopSettings]);var countries=React.useMemo(function(){if(!supportedCountries){return builtInCountries;}var sortedCountries=[].concat(builtInCountries);var sanitizedSupportedCountries=supportedCountries.map(function(country){var pieces=country.split('_');return pieces[0];});sanitizedSupportedCountries.forEach(function(country){sortedCountries.splice(sortedCountries.indexOf(country),1);});return[].concat(sanitizedSupportedCountries,sortedCountries);},[supportedCountries]);var countriesNames=useCountriesNames(supportedCountries,locales);var labels=React.useMemo(function(){var output={};if(!countries){return output;}countries.forEach(function(key){var pieces=key.split('_');output[pieces[0]]=countriesNames[key];});return output;},[countries,countriesNames]);var defaultCountry=React.useMemo(function(){if(!initialValue&&!value&&userLocation){return userLocation.country;}var phoneNumber=parsePhoneNumber(value||'');if(phoneNumber&&phoneNumber.country){return phoneNumber.country;}if(userLocation){return userLocation.country;}return i18n.getLang().split('-')[1];},[initialValue,userLocation,value]);var handleChange=React.useCallback(function(phoneValue){onChange(phoneValue,{target:{name:name}});},[name,onChange]);var phoneClasses=classnames(_defineProperty(_defineProperty({},phoneField,true),phoneFieldError,!!errorText));if(!countries||countries.length===0){return React.createElement(TextField,{name:name,value:value,onChange:onChange,label:label,className:formField,errorText:errorText});}return React.createElement("div",{className:phoneClasses},React.createElement(PhoneInput,{defaultCountry:defaultCountry,addInternationalOption:false,flags:flags,name:name,value:value||'',onChange:handleChange,placeholder:label,countries:countries,labels:labels}),!!errorText&&React.createElement("div",{className:phoneFieldErrorText},errorText));});export var ReserveFormPhone=connect(ReserveFormPhoneUnwrapped);
|
|
@@ -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{themeColors}from'@shopgate/pwa-common/helpers/config';import{AVAILABILITY_TYPE_AVAILABLE,AVAILABILITY_TYPE_LIMITED_AVAILABILITY,AVAILABILITY_TYPE_NOT_AVAILABLE,AVAILABILITY_TYPE_CUSTOM_AVAILABILITY,AVAILABILITY_TYPE_COMING_SOON}from'@shopgate/engage/product/constants';export default _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},AVAILABILITY_TYPE_AVAILABLE,{visibleInventoryFrom:11,visibleInventoryTo:null,includeInventoryBlind:false,includeNoRecordStores:false,availabilityText:'locations.stock_info.availableInventory',availabilityTextColor:"var(--color-state-ok, ".concat(themeColors.success,")")}),AVAILABILITY_TYPE_COMING_SOON,{comingSoon:true,visibleInventoryFrom:0,visibleInventoryTo:Number.MAX_VALUE,includeInventoryBlind:true,includeNoRecordStores:true,availabilityText:"locations.stock_info.".concat(AVAILABILITY_TYPE_COMING_SOON),availabilityTextColor:"var(--color-state-warning, ".concat(themeColors.warning,")")}),AVAILABILITY_TYPE_LIMITED_AVAILABILITY,{visibleInventoryFrom:1,visibleInventoryTo:10,includeInventoryBlind:false,includeNoRecordStores:false,availabilityText:"locations.stock_info.".concat(AVAILABILITY_TYPE_LIMITED_AVAILABILITY),availabilityTextColor:"var(--color-state-warning, ".concat(themeColors.warning,")")}),AVAILABILITY_TYPE_NOT_AVAILABLE,{visibleInventoryFrom:0,visibleInventoryTo:0,includeInventoryBlind:false,includeNoRecordStores:false,availabilityText:"locations.stock_info.".concat(AVAILABILITY_TYPE_NOT_AVAILABLE),availabilityTextColor:"var(--color-state-alert, ".concat(themeColors.error,")"),allowOrderingToStore:true}),AVAILABILITY_TYPE_CUSTOM_AVAILABILITY,{visibleInventoryFrom:0,visibleInventoryTo:0,includeInventoryBlind:false,includeNoRecordStores:true,availabilityText:"locations.stock_info.".concat(AVAILABILITY_TYPE_CUSTOM_AVAILABILITY),availabilityTextColor:"var(--color-state-alert, ".concat(themeColors.error,")"),allowOrderingToStore:true}),"maxNumberOfVisibleInventory",100),"aboveMaxExtension",'+');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
zIndex:10,maxHeight:200})
|
|
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{responsiveMediaQuery}from'@shopgate/engage/styles';import{themeColors}from'@shopgate/pwa-common/helpers/config';export var container=css(_defineProperty(_defineProperty({height:'100%',width:'100%'},responsiveMediaQuery('>sm',{appAlways:true}),{borderRadius:3,overflow:'hidden'}),responsiveMediaQuery('<=sm',{appAlways:true}),{// position: 'fixed',
|
|
2
|
+
zIndex:10,maxHeight:200}));export var marker=css({' svg':{height:40,width:40,fontSize:'1.5rem',color:"var(--color-text-medium-emphasis, ".concat(themeColors.shade9,")")}}).toString();export var markerSelected=css({' svg':{height:40,width:40,fontSize:'1.5rem',color:"var(--color-primary, ".concat(themeColors.primary,")")}}).toString();var pulseAnimation=css.keyframes({'0%':{boxShadow:'0 0 0 0px rgba(0, 0, 0, 0.2)'},'100%':{boxShadow:'0 0 0 10px rgba(0, 0, 0, 0)'}});export var userPosition=css({' div':{background:'var(--color-secondary)',border:'3px solid #fff',borderRadius:25,height:20,width:20,animation:"".concat(pulseAnimation," 2s infinite")}}).toString();
|
|
@@ -3,11 +3,13 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
3
3
|
* @param {Function} storeSearch .
|
|
4
4
|
* @param {Object} search .
|
|
5
5
|
* @returns {JSX}
|
|
6
|
-
*/function StoreListSearch(_ref){var postalCode=_ref.postalCode,countryCode=_ref.countryCode,setPostalCode=_ref.setPostalCode,setCountryCode=_ref.setCountryCode,setGeolocation=_ref.setGeolocation,isStoreFinder=_ref.isStoreFinder;var _useContext=useContext(isStoreFinder?StoreFinderContext:FulfillmentContext),isLoading=_useContext.isLoading,setIsLoading=_useContext.setIsLoading,locations=_useContext.locations,_useContext$shopSetti=_useContext.shopSettings
|
|
6
|
+
*/function StoreListSearch(_ref){var postalCode=_ref.postalCode,countryCode=_ref.countryCode,setPostalCode=_ref.setPostalCode,setCountryCode=_ref.setCountryCode,setGeolocation=_ref.setGeolocation,isStoreFinder=_ref.isStoreFinder;var _useContext=useContext(isStoreFinder?StoreFinderContext:FulfillmentContext),isLoading=_useContext.isLoading,setIsLoading=_useContext.setIsLoading,locations=_useContext.locations,_useContext$shopSetti=_useContext.shopSettings,_useContext$shopSetti2=_useContext$shopSetti===void 0?{}:_useContext$shopSetti,supportedCountries=_useContext$shopSetti2.supportedCountries,product=_useContext.product;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),message=_useState2[0],setMessage=_useState2[1];var _useState3=useState(postalCode||''),_useState4=_slicedToArray(_useState3,2),inputPostalCode=_useState4[0],setInputPostalCode=_useState4[1];var isMounted=useRef(false);var productId=(product===null||product===void 0?void 0:product.id)||null;var inputEl=useRef(null);useEffect(function(){isMounted.current=true;return function cleanup(){isMounted.current=false;};});useLayoutEffect(function(){if(!isLoading&&(!locations||locations.length===0)){// Set a message when a location search resulted in zero locations.
|
|
7
7
|
setMessage('locations.error_no_store_found');}else{setMessage('');}},[isLoading,locations,message]);/**
|
|
8
8
|
* Triggers an update when the value of the country selector changed.
|
|
9
9
|
* @param {SyntheticEvent} event A React event object.
|
|
10
|
-
*/var handleCountrySelectChange=useCallback(function(event){setCountryCode(event.target.value,productId,isStoreFinder);},[isStoreFinder,productId,setCountryCode])
|
|
10
|
+
*/var handleCountrySelectChange=useCallback(function(event){setCountryCode(event.target.value,productId,isStoreFinder);},[isStoreFinder,productId,setCountryCode]);useEffect(function(){if(!Array.isArray(supportedCountries)||!supportedCountries.length){return;}// Check if current countryCode is included in supportedCountries. Update the code to a valid
|
|
11
|
+
// one if nothing was found.
|
|
12
|
+
if(!supportedCountries.includes(countryCode)){handleCountrySelectChange({target:{value:supportedCountries[0]}});}},[countryCode,handleCountrySelectChange,supportedCountries]);/**
|
|
11
13
|
* Blurs the postal code input to trigger an update.
|
|
12
14
|
* @param {SyntheticEvent} event A React event object.
|
|
13
15
|
*/var handlePostalCodeSubmitKeyDown=useCallback(function(event){if(event.keyCode===13){inputEl.current.blur();}},[]);/**
|
|
@@ -15,7 +17,7 @@ setMessage('locations.error_no_store_found');}else{setMessage('');}},[isLoading,
|
|
|
15
17
|
*/var handlePostalCodeBlur=useCallback(function(){setPostalCode(inputPostalCode,productId,isStoreFinder);},[inputPostalCode,isStoreFinder,productId,setPostalCode]);/**
|
|
16
18
|
* Triggers an update when the locate me button was pressed. Also clears the local state for the
|
|
17
19
|
* postal code input.
|
|
18
|
-
*/var handleLocateMeButton=useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
20
|
+
*/var handleLocateMeButton=useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:setInputPostalCode('');setIsLoading(true);_context.next=4;return setGeolocation({productId:productId,isStoreFinder:isStoreFinder});case 4:setIsLoading(false);case 5:case"end":return _context.stop();}},_callee);})),[isStoreFinder,productId,setGeolocation,setIsLoading]);/**
|
|
19
21
|
* Updates the local state for the postal code input.
|
|
20
22
|
* @param {SyntheticEvent} event A React event object
|
|
21
23
|
*/var handlePostalCodeChange=function handlePostalCodeChange(event){setInputPostalCode(event.target.value);};var countries=useCountriesNames(supportedCountries);var hasSupportedCountries=supportedCountries&&supportedCountries.length>1;return React.createElement(SurroundPortals,{portalName:FULFILLMENT_SHEET_SEARCH,portalProps:{product:product}},React.createElement("div",{className:container},hasSupportedCountries&&React.createElement("div",{className:countriesCell},React.createElement("div",{className:selectContainer},React.createElement("select",{name:"countryCode",value:countryCode,onChange:handleCountrySelectChange,className:select},Object.keys(countries).map(function(key){return React.createElement("option",{className:"option",value:key,key:key},countries[key]);})))),React.createElement("div",{className:inputCell},React.createElement("div",{className:inputContainer},React.createElement("span",{className:inputIcon,"aria-hidden":true},React.createElement(MagnifierIcon,null)),React.createElement("input",{ref:inputEl,name:"postalCode",className:input,value:inputPostalCode,onChange:handlePostalCodeChange,onBlur:handlePostalCodeBlur,onKeyDown:handlePostalCodeSubmitKeyDown,disabled:isLoading,type:"search",autoComplete:"off",autoCorrect:"off",placeholder:i18n.text('locations.search_placeholder')}),React.createElement("button",{onClick:handleLocateMeButton,type:"button",className:inputIcon,"aria-label":i18n.text('locations.stores_near.location')},React.createElement(LocatorIcon,null)))),React.createElement("div",{className:radiusCell},isStoreFinder&&React.createElement(StoreListSearchRadius,null))),message&&React.createElement(MessageBar,{messages:[{type:'error',message:message,icon:InfoIcon}],classNames:{icon:iconClass}}));}StoreListSearch.defaultProps={postalCode:null,isStoreFinder:false};export default connect(memo(StoreListSearch));
|
|
@@ -1 +1 @@
|
|
|
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{main$}from'@shopgate/pwa-common/streams';import{Observable}from'rxjs/Observable';import{cartReceived$}from'@shopgate/pwa-common-commerce/cart/streams';import{makeGetRoutePattern,getCurrentState,getCurrentRoute}from'@shopgate/pwa-common/selectors/router';import{routeWillEnter$}from'@shopgate/pwa-common/streams/router';import{ITEM_PATTERN}from'@shopgate/pwa-common-commerce/product/constants';import{getProductDataById}from'@shopgate/pwa-common-commerce/product/selectors/product';import{SEARCH_PATTERN}from'@shopgate/pwa-common-commerce/search/constants';import{CATEGORY_PATTERN}from'@shopgate/pwa-common-commerce/category/constants';import{FAVORITES_PATH}from'@shopgate/pwa-common-commerce/favorites/constants';import{SUBMIT_RESERVATION_SUCCESS,RECEIVE_PRODUCT_LOCATIONS,RECEIVE_LOCATIONS,SET_USER_SEARCH_COUNTRY_CODE,SET_USER_SEARCH_POSTAL_CODE,SET_USER_SEARCH_GEOLOCATION,SET_STORE_FINDER_SEARCH_RADIUS,SELECT_GLOBAL_LOCATION,STORE_FINDER_PATTERN,PROVIDE_PRODUCT_ALTERNATIVE_LOCATION,SELECT_LOCATION}from"./constants";import{RECEIVE_ORDER_DETAILS}from"../orders/constants";import{WISH_LIST_PATH}from"../account";export var submitReservationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUBMIT_RESERVATION_SUCCESS;});export var receiveProductLocations$=main$.filter(function(_ref2){var action=_ref2.action;return action.type===RECEIVE_PRODUCT_LOCATIONS;});export var receiveOrderDetails$=main$.filter(function(_ref3){var action=_ref3.action;return action.type===RECEIVE_ORDER_DETAILS;});export var cartReceivedWithROPE$=cartReceived$.filter(function(_ref4){var _ref4$action$cart=_ref4.action.cart
|
|
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{main$}from'@shopgate/pwa-common/streams';import{Observable}from'rxjs/Observable';import{cartReceived$}from'@shopgate/pwa-common-commerce/cart/streams';import{makeGetRoutePattern,getCurrentState,getCurrentRoute}from'@shopgate/pwa-common/selectors/router';import{routeWillEnter$}from'@shopgate/pwa-common/streams/router';import{ITEM_PATTERN}from'@shopgate/pwa-common-commerce/product/constants';import{getProductDataById}from'@shopgate/pwa-common-commerce/product/selectors/product';import{SEARCH_PATTERN}from'@shopgate/pwa-common-commerce/search/constants';import{CATEGORY_PATTERN}from'@shopgate/pwa-common-commerce/category/constants';import{FAVORITES_PATH}from'@shopgate/pwa-common-commerce/favorites/constants';import{SUBMIT_RESERVATION_SUCCESS,RECEIVE_PRODUCT_LOCATIONS,RECEIVE_LOCATIONS,SET_USER_SEARCH_COUNTRY_CODE,SET_USER_SEARCH_POSTAL_CODE,SET_USER_SEARCH_GEOLOCATION,SET_STORE_FINDER_SEARCH_RADIUS,SELECT_GLOBAL_LOCATION,STORE_FINDER_PATTERN,PROVIDE_PRODUCT_ALTERNATIVE_LOCATION,SELECT_LOCATION}from"./constants";import{RECEIVE_ORDER_DETAILS}from"../orders/constants";import{WISH_LIST_PATH}from"../account/constants";export var submitReservationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUBMIT_RESERVATION_SUCCESS;});export var receiveProductLocations$=main$.filter(function(_ref2){var action=_ref2.action;return action.type===RECEIVE_PRODUCT_LOCATIONS;});export var receiveOrderDetails$=main$.filter(function(_ref3){var action=_ref3.action;return action.type===RECEIVE_ORDER_DETAILS;});export var cartReceivedWithROPE$=cartReceived$.filter(function(_ref4){var _ref4$action$cart=_ref4.action.cart,_ref4$action$cart2=_ref4$action$cart===void 0?{}:_ref4$action$cart,_ref4$action$cart2$ca=_ref4$action$cart2.cartItems,cartItems=_ref4$action$cart2$ca===void 0?[]:_ref4$action$cart2$ca;return cartItems.some(function(item){var _item$fulfillment,_item$fulfillment$loc;return item===null||item===void 0?void 0:(_item$fulfillment=item.fulfillment)===null||_item$fulfillment===void 0?void 0:(_item$fulfillment$loc=_item$fulfillment.location)===null||_item$fulfillment$loc===void 0?void 0:_item$fulfillment$loc.code;});});export var userSearchChanged$=main$.filter(function(_ref5){var action=_ref5.action;return action.type===SET_USER_SEARCH_COUNTRY_CODE||action.type===SET_USER_SEARCH_POSTAL_CODE||action.type===SET_USER_SEARCH_GEOLOCATION||action.type===SET_STORE_FINDER_SEARCH_RADIUS;});export var fulfillmentLocationsReceivedFromProduct$=receiveProductLocations$.switchMap(function(data){var locations=data.action.locations;var locationCodes=locations.map(function(_ref6){var code=_ref6.code;return code;});return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceivedFromCart$=cartReceivedWithROPE$.switchMap(function(data){var _data$action$cart=data.action.cart,_data$action$cart2=_data$action$cart===void 0?{}:_data$action$cart,_data$action$cart2$ca=_data$action$cart2.cartItems,cartItems=_data$action$cart2$ca===void 0?[]:_data$action$cart2$ca;var locationCodes=cartItems.map(function(item){var _item$fulfillment2,_item$fulfillment2$lo;return item===null||item===void 0?void 0:(_item$fulfillment2=item.fulfillment)===null||_item$fulfillment2===void 0?void 0:(_item$fulfillment2$lo=_item$fulfillment2.location)===null||_item$fulfillment2$lo===void 0?void 0:_item$fulfillment2$lo.code;}).filter(Boolean);locationCodes=Array.from(new Set(locationCodes));return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceivedFromOrder$=receiveOrderDetails$.filter(function(_ref7){var _ref7$action$order=_ref7.action.order,_ref7$action$order2=_ref7$action$order===void 0?{}:_ref7$action$order,_ref7$action$order2$l=_ref7$action$order2.lineItems,lineItems=_ref7$action$order2$l===void 0?[]:_ref7$action$order2$l;return lineItems.some(function(item){return item.fulfillmentLocationCode;});}).switchMap(function(data){var _data$action$order=data.action.order,_data$action$order2=_data$action$order===void 0?{}:_data$action$order,_data$action$order2$l=_data$action$order2.lineItems,lineItems=_data$action$order2$l===void 0?[]:_data$action$order2$l;var locationCodes=lineItems.map(function(item){return item===null||item===void 0?void 0:item.fulfillmentLocationCode;}).filter(Boolean);locationCodes=Array.from(new Set(locationCodes));return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceived$=fulfillmentLocationsReceivedFromCart$.merge(fulfillmentLocationsReceivedFromOrder$).merge(fulfillmentLocationsReceivedFromProduct$);export var preferredLocationDidUpdateGlobal$=main$.filter(function(_ref8){var action=_ref8.action;return action.type===SELECT_GLOBAL_LOCATION;});export var preferredLocationDidUpdateGlobalOnWishlist$=preferredLocationDidUpdateGlobal$.filter(function(_ref9){var getState=_ref9.getState;var _getCurrentRoute=getCurrentRoute(getState()),pattern=_getCurrentRoute.pattern;return pattern===FAVORITES_PATH||pattern===WISH_LIST_PATH;});export var preferredLocationDidUpdateGlobalOnSearch$=preferredLocationDidUpdateGlobal$.filter(function(_ref10){var getState=_ref10.getState;var _getCurrentRoute2=getCurrentRoute(getState()),pattern=_getCurrentRoute2.pattern;return pattern===SEARCH_PATTERN;});export var preferredLocationDidUpdateGlobalNotOnSearch$=preferredLocationDidUpdateGlobal$.filter(function(_ref11){var getState=_ref11.getState;var _getCurrentRoute3=getCurrentRoute(getState()),pattern=_getCurrentRoute3.pattern;return pattern!==SEARCH_PATTERN;});export var preferredLocationDidUpdateGlobalOnCategory$=preferredLocationDidUpdateGlobal$.filter(function(_ref12){var getState=_ref12.getState;var _getCurrentRoute4=getCurrentRoute(getState()),pattern=_getCurrentRoute4.pattern;return pattern===CATEGORY_PATTERN;});export var preferredLocationDidUpdateGlobalNotOnCategory$=preferredLocationDidUpdateGlobal$.filter(function(_ref13){var getState=_ref13.getState;var _getCurrentRoute5=getCurrentRoute(getState()),pattern=_getCurrentRoute5.pattern;return pattern!==CATEGORY_PATTERN;});export var preferredLocationDidUpdate$=main$.filter(function(_ref14){var action=_ref14.action;return action.type===SELECT_LOCATION;});export var storeFinderWillEnter$=routeWillEnter$.filter(function(_ref15){var action=_ref15.action;return action.route.pattern===STORE_FINDER_PATTERN;});export var receiveLocations$=main$.filter(function(_ref16){var action=_ref16.action;return action.type===RECEIVE_LOCATIONS;});export var provideAlternativeLocation$=main$.filter(function(_ref17){var action=_ref17.action;return action.type===PROVIDE_PRODUCT_ALTERNATIVE_LOCATION;});export var preferredLocationDidUpdateOnPDP$=preferredLocationDidUpdateGlobal$.filter(function(_ref18){var getState=_ref18.getState;var getRoutePattern=makeGetRoutePattern();var routePattern=getRoutePattern(getState());return routePattern===ITEM_PATTERN;}).switchMap(function(_ref19){var dispatch=_ref19.dispatch,getState=_ref19.getState,action=_ref19.action;var state=getState();var _getCurrentState=getCurrentState(state),productId=_getCurrentState.productId;var productData=getProductDataById(state,{productId:productId});return Observable.of({action:_extends({},action,{productData:productData}),dispatch:dispatch,getState:getState});});
|