@shopgate/engage 7.27.3-alpha.17 → 7.27.3-alpha.19
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/action-creators/index.js +9 -0
- package/a11y/components/FocusTrap/index.js +1 -0
- package/a11y/components/LiveMessage/index.js +1 -1
- package/a11y/components/LiveMessenger/helpers.js +1 -1
- package/a11y/components/LiveMessenger/index.js +2 -2
- package/a11y/components/ModalStateTracker/index.js +14 -0
- package/a11y/components/Navigation/index.js +1 -1
- package/a11y/components/Section/index.js +3 -3
- package/a11y/components/VisuallyHidden/index.js +1 -1
- package/a11y/components/index.js +1 -1
- package/a11y/constants/index.js +1 -0
- package/a11y/helpers/index.js +1 -0
- package/a11y/hooks/index.js +37 -0
- package/a11y/index.js +1 -4
- package/a11y/reducers/index.js +6 -0
- package/a11y/selectors/index.js +8 -0
- package/a11y/styles.js +2 -0
- package/account/actions/addContacts.js +4 -0
- package/account/actions/deleteContact.js +5 -0
- package/account/actions/deleteCustomer.js +4 -0
- package/account/actions/fetchContacts.js +4 -0
- package/account/actions/fetchCustomer.js +4 -0
- package/account/actions/updateContact.js +4 -0
- package/account/actions/updateCustomer.js +4 -0
- package/account/components/Account/Account.connector.js +5 -0
- package/account/components/Account/Account.js +4 -0
- package/account/components/Account/Account.style.js +1 -0
- package/account/components/Account/index.js +1 -0
- package/account/components/Profile/Profile.config.js +11 -0
- package/account/components/Profile/Profile.constraints.js +1 -0
- package/account/components/Profile/Profile.js +1 -0
- package/account/components/Profile/Profile.provider.js +22 -0
- package/account/components/Profile/ProfileAddressBook.js +6 -0
- package/account/components/Profile/ProfileAddressCard.js +3 -0
- package/account/components/Profile/ProfileForm.js +3 -0
- package/account/components/Profile/ProfileHeader.js +3 -0
- package/account/components/Profile/index.js +1 -0
- package/account/components/ProfileContact/ProfileContact.config.js +11 -0
- package/account/components/ProfileContact/ProfileContact.constraints.js +5 -0
- package/account/components/ProfileContact/ProfileContact.js +13 -0
- package/account/components/ProfileContact/index.js +1 -0
- package/account/components/index.js +1 -0
- package/account/constants/actions.js +1 -0
- package/account/constants/index.js +1 -1
- package/account/constants/pipelines.js +1 -0
- package/account/helper/form.js +61 -0
- package/account/index.js +1 -1
- package/account/reducers/index.js +6 -0
- package/account/selectors/contacts.js +7 -0
- package/account/selectors/customer.js +7 -0
- package/app-rating/actions/showModal.js +3 -3
- package/app-rating/helpers/index.js +1 -1
- package/app-rating/subscriptions/index.js +11 -6
- package/back-in-stock/actions/index.js +1 -1
- package/back-in-stock/components/BackInStockButton/index.js +3 -3
- package/back-in-stock/components/CharacteristicsButton/index.js +1 -1
- package/back-in-stock/components/ProductInfoBackInStockButton/index.js +1 -1
- package/back-in-stock/components/Subscriptions/components/List/index.js +2 -2
- package/back-in-stock/components/Subscriptions/components/Subscription/index.js +2 -2
- package/back-in-stock/components/Subscriptions/index.js +1 -1
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.context.js +1 -1
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +1 -1
- package/back-in-stock/selectors/index.js +5 -3
- package/back-in-stock/streams/index.js +1 -1
- package/back-in-stock/subscriptions/index.js +2 -2
- package/cart/cart.constants.js +1 -0
- package/cart/cart.context.js +1 -0
- package/cart/cart.helpers.js +15 -0
- package/cart/cart.hooks.js +4 -0
- package/cart/cart.selectors.js +34 -0
- package/cart/cart.types.js +1 -0
- package/cart/components/CartHeaderWide/CartHeaderWide.js +3 -0
- package/cart/components/CartHeaderWide/CartHeaderWide.style.js +1 -0
- package/cart/components/CartHeaderWide/index.js +1 -0
- package/cart/components/CartItem/CartItem.hooks.js +7 -0
- package/cart/components/CartItem/CartItem.js +7 -0
- package/cart/components/CartItem/CartItem.style.js +1 -0
- package/cart/components/CartItem/CartItemCoupon.connector.js +7 -0
- package/cart/components/CartItem/CartItemCoupon.js +20 -0
- package/cart/components/CartItem/CartItemCoupon.style.js +5 -0
- package/cart/components/CartItem/CartItemCoupon.types.js +0 -0
- package/cart/components/CartItem/CartItemCouponCode.js +5 -0
- package/cart/components/CartItem/CartItemCouponDelete.js +5 -0
- package/cart/components/CartItem/CartItemCouponDelete.style.js +1 -0
- package/cart/components/CartItem/CartItemCouponFreeShipping.js +5 -0
- package/cart/components/CartItem/CartItemCouponIcon.js +4 -0
- package/cart/components/CartItem/CartItemCouponLayout.js +6 -0
- package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -0
- package/cart/components/CartItem/CartItemCouponPrice.js +5 -0
- package/cart/components/CartItem/CartItemCouponPrice.style.js +1 -0
- package/cart/components/CartItem/CartItemCouponTitle.js +5 -0
- package/cart/components/CartItem/CartItemCouponTitle.style.js +1 -0
- package/cart/components/CartItem/CartItemProduct.js +5 -0
- package/cart/components/CartItem/CartItemProduct.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayout.js +6 -0
- package/cart/components/CartItem/CartItemProductLayout.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWide.js +4 -0
- package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.js +4 -0
- package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWideOrderDetails.js +3 -0
- package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.js +4 -0
- package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.style.js +1 -0
- package/cart/components/CartItem/CartItemProductOrderDetails.js +3 -0
- package/cart/components/CartItem/CartItemProductOrderDetails.style.js +1 -0
- package/cart/components/CartItem/CartItemProductPriceCaption.js +4 -0
- package/cart/components/CartItem/CartItemProductPriceCaption.style.js +1 -0
- package/cart/components/CartItem/CartItemProductPriceList.js +5 -0
- package/cart/components/CartItem/CartItemProductPriceListPromotion.js +10 -0
- package/cart/components/CartItem/CartItemProductProvider.connector.js +9 -0
- package/cart/components/CartItem/CartItemProductProvider.context.js +1 -0
- package/cart/components/CartItem/CartItemProductProvider.js +12 -0
- package/cart/components/CartItem/CartItemProductProvider.types.js +1 -0
- package/cart/components/CartItem/CartItemProductProviderLegacy.js +22 -0
- package/cart/components/CartItem/CartItemProductTitle.js +7 -0
- package/cart/components/CartItem/CartItemProductTitle.style.js +1 -0
- package/cart/components/CartItem/CartItemProvider.connector.js +3 -0
- package/cart/components/CartItem/CartItemProvider.context.js +1 -0
- package/cart/components/CartItem/CartItemProvider.js +5 -0
- package/cart/components/CartItem/CartItemQuantityPicker.js +38 -0
- package/cart/components/CartItem/CartItemQuantityPicker.style.js +1 -0
- package/cart/components/CartItem/CartItemSubstitution.connector.js +5 -0
- package/cart/components/CartItem/CartItemSubstitution.js +5 -0
- package/cart/components/CartItem/CartItemSubstitution.style.js +1 -0
- package/cart/components/CartItem/index.js +1 -0
- package/cart/components/CartItems/CartItem.connector.js +4 -0
- package/cart/components/CartItems/CartItemCard.js +5 -0
- package/cart/components/CartItems/CartItemCard.style.js +1 -0
- package/cart/components/CartItems/CartItemCardReservation.js +5 -0
- package/cart/components/CartItems/CartItemCardReservationAccordion.js +4 -0
- package/cart/components/CartItems/CartItemCardReservationLabel.js +5 -0
- package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.js +3 -0
- package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.style.js +1 -0
- package/cart/components/CartItems/CartItemGroup.js +5 -0
- package/cart/components/CartItems/CartItemGroup.style.js +1 -0
- package/cart/components/CartItems/CartItemGroupReservation.js +5 -0
- package/cart/components/CartItems/CartItemGroupReservationLabel.js +5 -0
- package/cart/components/CartItems/CartItemGroupShipping.js +4 -0
- package/cart/components/CartItems/CartItems.js +5 -0
- package/cart/components/CartItems/CartItems.style.js +1 -0
- package/cart/components/CartItems/CartItemsHeaderWide.connector.js +3 -0
- package/cart/components/CartItems/CartItemsHeaderWide.js +3 -0
- package/cart/components/CartItems/CartItemsHeaderWide.style.js +1 -0
- package/cart/components/CartItems/CartItemsSubscription.connector.js +5 -0
- package/cart/components/CartItems/CartItemsSubstitution.js +5 -0
- package/cart/components/CartItems/index.js +1 -0
- package/cart/components/CartSummaryWide/CartSummaryWide.connector.js +4 -0
- package/cart/components/CartSummaryWide/CartSummaryWide.js +4 -0
- package/cart/components/CartSummaryWide/CartSummaryWide.style.js +1 -0
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.connector.js +5 -0
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.js +4 -0
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -0
- package/cart/components/CartSummaryWide/CartSummaryWideFooter.js +3 -0
- package/cart/components/CartSummaryWide/index.js +1 -0
- package/cart/components/PaymentBar/PaymentBar.js +5 -0
- package/cart/components/PaymentBar/PaymentBarAppliedPromotions.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarAppliedPromotions.js +3 -0
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.js +5 -0
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -0
- package/cart/components/PaymentBar/PaymentBarContent.js +4 -0
- package/cart/components/PaymentBar/PaymentBarContent.style.js +1 -0
- package/cart/components/PaymentBar/PaymentBarDiscounts.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarDiscounts.js +4 -0
- package/cart/components/PaymentBar/PaymentBarGrandTotal.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarGrandTotal.js +4 -0
- package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +4 -0
- package/cart/components/PaymentBar/PaymentBarPromotionCoupons.connector.js +8 -0
- package/cart/components/PaymentBar/PaymentBarPromotionCoupons.js +3 -0
- package/cart/components/PaymentBar/PaymentBarPromotionalText.js +4 -0
- package/cart/components/PaymentBar/PaymentBarReserveButton.connector.js +1 -0
- package/cart/components/PaymentBar/PaymentBarReserveButton.js +7 -0
- package/cart/components/PaymentBar/PaymentBarShippingCost.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarShippingCost.js +3 -0
- package/cart/components/PaymentBar/PaymentBarSubTotal.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarSubTotal.js +3 -0
- package/cart/components/PaymentBar/PaymentBarTax.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarTax.js +4 -0
- package/cart/components/PaymentBar/index.js +1 -0
- package/cart/components/Substitution/connector.js +5 -0
- package/cart/components/Substitution/index.js +9 -0
- package/cart/components/Substitution/style.js +1 -0
- package/cart/components/SupplementalContent/SupplementalContent.connector.js +4 -0
- package/cart/components/SupplementalContent/SupplementalContent.js +5 -0
- package/cart/components/SupplementalContent/SupplementalContent.styles.js +1 -0
- package/cart/components/SupplementalContent/index.js +1 -0
- package/cart/index.js +10 -5
- package/cart/streams/index.js +1 -0
- package/category/actions/index.js +1 -0
- package/category/components/CategoryImage/connector.js +5 -0
- package/category/components/CategoryImage/index.js +5 -0
- package/category/components/CategoryList/index.js +2 -2
- package/category/components/CategoryList/style.js +1 -1
- package/category/components/index.js +1 -0
- package/category/constants/index.js +1 -0
- package/category/helpers/index.js +1 -0
- package/category/index.js +1 -7
- package/category/selectors/index.js +2 -0
- package/category/streams/index.js +1 -0
- package/checkout/action-creators/addCheckoutCampaign.js +5 -0
- package/checkout/action-creators/clearCheckoutCampaign.js +5 -0
- package/checkout/action-creators/clearCheckoutOrder.js +4 -0
- package/checkout/action-creators/index.js +1 -0
- package/checkout/action-creators/validationErrorsCheckout.js +5 -0
- package/checkout/actions/errorCheckout.js +17 -0
- package/checkout/actions/fetchCheckoutOrder.js +4 -0
- package/checkout/actions/fetchPaymentMethods.js +4 -0
- package/checkout/actions/index.js +1 -0
- package/checkout/actions/initializeCheckout.js +4 -0
- package/checkout/actions/prepareCheckout.js +8 -0
- package/checkout/actions/submitCheckoutOrder.js +5 -0
- package/checkout/actions/updateCheckoutOrder.js +5 -0
- package/checkout/components/AddressBook/AddressBook.js +5 -0
- package/checkout/components/AddressBook/AddressList.js +9 -0
- package/checkout/components/AddressBook/index.js +1 -0
- package/checkout/components/AddressBookContact/AddressBookContact.js +5 -0
- package/checkout/components/AddressBookContact/index.js +1 -0
- package/checkout/components/Checkout/Checkout.js +4 -0
- package/checkout/components/Checkout/CheckoutActions.js +4 -0
- package/checkout/components/Checkout/CheckoutAddress.js +6 -0
- package/checkout/components/Checkout/CheckoutHeader.js +4 -0
- package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +8 -0
- package/checkout/components/Checkout/CheckoutPickupContactForm.js +4 -0
- package/checkout/components/Checkout/CheckoutSection.js +4 -0
- package/checkout/components/Checkout/CheckoutSectionInfo.js +4 -0
- package/checkout/components/Checkout/CheckoutSectionMessages.js +4 -0
- package/checkout/components/Checkout/CheckoutSummary.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.connector.js +3 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +7 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderContact.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderSummary.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickUpContact.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickupNotes.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationSection.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationShippedTo.js +4 -0
- package/checkout/components/CheckoutConfirmation/index.js +1 -0
- package/checkout/components/GuestCheckout/GuestCheckout.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutOptIn.config.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutOptIn.js +3 -0
- package/checkout/components/GuestCheckout/GuestCheckoutPickup.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.js +4 -0
- package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +5 -0
- package/checkout/components/PaymentMethodButton/index.js +1 -0
- package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.js +4 -0
- package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.style.js +1 -0
- package/checkout/components/ResponsiveBackButton/index.js +1 -0
- package/checkout/components/ShippingMethods/ShippingMethod.js +5 -0
- package/checkout/components/ShippingMethods/ShippingMethods.js +23 -0
- package/checkout/components/ShippingMethods/connector.js +7 -0
- package/checkout/components/ShippingMethods/index.js +1 -0
- package/checkout/components/SupplementalContent/SupplementalContent.connector.js +4 -0
- package/checkout/components/SupplementalContent/SupplementalContent.js +5 -0
- package/checkout/components/SupplementalContent/SupplementalContent.styles.js +1 -0
- package/checkout/components/SupplementalContent/index.js +1 -0
- package/checkout/components/index.js +1 -0
- package/checkout/constants/actionTypes.js +1 -0
- package/checkout/constants/errorCodes.js +1 -0
- package/checkout/constants/index.js +1 -0
- package/checkout/constants/routes.js +1 -0
- package/checkout/helpers/index.js +34 -0
- package/checkout/hooks/common.js +7 -0
- package/checkout/index.js +6 -5
- package/checkout/paymentMethods/context.js +1 -0
- package/checkout/paymentMethods/index.js +28 -0
- package/checkout/paymentMethods/paypal/PaypalButton.js +5 -0
- package/checkout/paymentMethods/paypal/PaypalButtonApp.js +4 -0
- package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +8 -0
- package/checkout/paymentMethods/paypal/PaypalPayButton.js +12 -0
- package/checkout/paymentMethods/paypal/PaypalProvider.js +6 -0
- package/checkout/paymentMethods/paypal/index.js +1 -0
- package/checkout/paymentMethods/paypal/paypal_logo.png +0 -0
- package/checkout/paymentMethods/paypal/sdk.js +9 -0
- package/checkout/paymentMethods/stripe/StripeButton.connector.js +6 -0
- package/checkout/paymentMethods/stripe/StripeButton.js +5 -0
- package/checkout/paymentMethods/stripe/StripeCreditCard.js +10 -0
- package/checkout/paymentMethods/stripe/StripePayButton.js +6 -0
- package/checkout/paymentMethods/stripe/StripeProvider.connector.js +6 -0
- package/checkout/paymentMethods/stripe/StripeProvider.context.js +1 -0
- package/checkout/paymentMethods/stripe/StripeProvider.js +33 -0
- package/checkout/paymentMethods/stripe/applepay.svg +84 -0
- package/checkout/paymentMethods/stripe/googlepay.png +0 -0
- package/checkout/paymentMethods/stripe/index.js +1 -0
- package/checkout/paymentMethods/stripe/sdk.js +9 -0
- package/checkout/providers/AddressBookProvider.context.js +1 -0
- package/checkout/providers/AddressBookProvider.js +11 -0
- package/checkout/providers/CheckoutProvider.connector.js +7 -0
- package/checkout/providers/CheckoutProvider.constraints.js +1 -0
- package/checkout/providers/CheckoutProvider.context.js +1 -0
- package/checkout/providers/CheckoutProvider.js +28 -0
- package/checkout/reducers/index.js +6 -0
- package/checkout/selectors/campaign.js +5 -0
- package/checkout/selectors/guestCheckout.js +5 -0
- package/checkout/selectors/order.js +59 -0
- package/checkout/selectors/payment.js +17 -0
- package/checkout/selectors/route.js +4 -0
- package/checkout/streams/index.js +1 -0
- package/checkout/subscriptions/index.js +3 -0
- package/components/BrandingColorBanner/BrandingColorBanner.js +5 -0
- package/components/BrandingColorBanner/index.js +1 -0
- package/components/ChipLayout/index.js +7 -7
- package/components/ChipLayout/spec.js +1 -1
- package/components/ChipLayout/style.js +2 -2
- package/components/ConditionalWrapper/ConditionalWrapper.js +10 -0
- package/components/ConditionalWrapper/index.js +1 -5
- package/components/ConnectedReactPortal/index.js +13 -0
- package/components/Footer/Footer.js +4 -23
- package/components/Footer/Footer.style.js +1 -7
- package/components/Footer/constants.js +1 -0
- package/components/Footer/helpers.js +75 -0
- package/components/Form/Builder/Builder.constants.js +1 -1
- package/components/Form/Builder/Builder.js +53 -37
- package/components/Form/Builder/ElementCheckbox.js +2 -2
- package/components/Form/Builder/ElementMultiSelect.js +6 -0
- package/components/Form/Builder/ElementPhoneNumber.js +20 -0
- package/components/Form/Builder/ElementRadio.js +2 -2
- package/components/Form/Builder/ElementSelect.js +3 -3
- package/components/Form/Builder/ElementText.js +4 -4
- package/components/Form/Builder/FormHelper.js +5 -0
- package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
- package/components/Form/Builder/classes/ActionListener.js +72 -15
- package/components/Form/Builder/helpers/buildCountryList.js +3 -3
- package/components/Form/Builder/helpers/buildFormDefaults.js +1 -1
- package/components/Form/Builder/helpers/buildProvinceList.js +1 -1
- package/components/Form/Builder/helpers/common.js +6 -0
- package/components/Form/Builder/stylePresets.js +1 -0
- package/components/Form/Form.js +11 -8
- package/components/Form/index.js +1 -1
- package/components/IntersectionVisibility/index.js +13 -6
- package/components/Logo/connector.js +4 -0
- package/components/Logo/index.js +2 -2
- package/components/Logo/spec.js +1 -1
- package/components/Logo/style.js +1 -1
- package/components/Menu/components/Item/index.js +8 -0
- package/components/Menu/components/Item/style.js +4 -0
- package/components/Menu/components/Position/index.js +16 -0
- package/components/Menu/components/Position/style.js +1 -0
- package/components/Menu/index.js +12 -0
- package/components/Menu/style.js +1 -0
- package/components/MessageBar/MessageBar.js +9 -0
- package/components/MessageBar/MessageBar.style.js +11 -0
- package/components/MessageBar/index.js +1 -7
- package/components/NavigationHandler/connector.js +1 -1
- package/components/NavigationHandler/index.js +6 -6
- 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 +19 -10
- package/components/Picker/spec.js +2 -2
- package/components/PickerUtilize/components/Button/index.js +1 -1
- package/components/PickerUtilize/index.js +8 -6
- package/components/PickerUtilize/spec.js +2 -1
- package/components/QuantityInput/QuantityInput.js +5 -4
- package/components/QuantityLabel/QuantityLabel.js +4 -0
- package/components/QuantityLabel/index.js +1 -0
- package/components/Radio/Radio.js +5 -0
- package/components/Radio/index.js +1 -0
- package/components/RadioCard/RadioCard.js +9 -0
- package/components/RadioCard/index.js +1 -0
- package/components/RadioGroup/RadioGroup.context.js +1 -0
- package/components/RadioGroup/RadioGroup.js +4 -0
- package/components/RadioGroup/index.js +1 -0
- package/components/RadioGroup/useRadioGroup.js +4 -0
- package/components/RangeSlider/components/Handle/index.js +2 -2
- package/components/RangeSlider/components/Handle/style.js +1 -1
- package/components/RangeSlider/helper.js +3 -3
- package/components/RangeSlider/index.js +35 -23
- package/components/RangeSlider/spec.js +4 -4
- package/components/ResponsiveContainer/ResponsiveContainer.js +6 -0
- package/components/ResponsiveContainer/breakpoints.js +14 -0
- package/components/ResponsiveContainer/condition.js +6 -0
- package/components/ResponsiveContainer/hooks.js +20 -0
- package/components/ResponsiveContainer/index.js +1 -0
- package/components/ResponsiveContainer/listener.js +10 -0
- package/components/ResponsiveContainer/mediaQuery.js +8 -0
- package/components/ScrollHeader/index.js +22 -5
- package/components/ScrollHeader/style.js +1 -1
- package/components/SheetDrawer/index.js +4 -3
- package/components/SheetList/components/Item/index.js +5 -5
- package/components/SheetList/components/Item/spec.js +2 -2
- package/components/SheetList/components/Item/style.js +1 -1
- package/components/SheetList/index.js +4 -4
- package/components/SheetList/spec.js +1 -1
- package/components/SheetList/style.js +1 -1
- package/components/SideNavigation/SideNavigation.hooks.js +4 -0
- package/components/SideNavigation/SideNavigation.js +4 -0
- package/components/SideNavigation/SideNavigationCategories.connector.js +8 -0
- package/components/SideNavigation/SideNavigationCategories.js +4 -0
- package/components/SideNavigation/SideNavigationCategories.style.js +1 -0
- package/components/SideNavigation/SideNavigationCategoriesItem.connector.js +8 -0
- package/components/SideNavigation/SideNavigationCategoriesItem.js +5 -0
- package/components/SideNavigation/SideNavigationCategoriesItem.style.js +2 -0
- package/components/SideNavigation/SideNavigationCategoriesItemChildren.js +5 -0
- package/components/SideNavigation/SideNavigationContent.js +3 -0
- package/components/SideNavigation/SideNavigationContent.style.js +4 -0
- package/components/SideNavigation/SideNavigationItem.js +4 -0
- package/components/SideNavigation/SideNavigationItem.style.js +4 -0
- package/components/SideNavigation/SideNavigationLinks.js +4 -0
- package/components/SideNavigation/SideNavigationLinksLegal.connector.js +4 -0
- package/components/SideNavigation/SideNavigationLinksLegal.js +5 -0
- package/components/SideNavigation/SideNavigationLinksQuicklinks.connector.js +4 -0
- package/components/SideNavigation/SideNavigationLinksQuicklinks.js +5 -0
- package/components/SideNavigation/SideNavigationNestedItem.js +4 -0
- package/components/SideNavigation/SideNavigationProvider.connector.js +8 -0
- package/components/SideNavigation/SideNavigationProvider.context.js +1 -0
- package/components/SideNavigation/SideNavigationProvider.js +4 -0
- package/components/SideNavigation/index.js +1 -0
- package/components/SideNavigation/selectors.js +17 -0
- package/components/SnackBarContainer/index.js +1 -1
- package/components/Switch/index.js +1 -1
- package/components/Tabs/TabContext.js +7 -0
- package/components/Tabs/components/Tab.js +11 -0
- package/components/Tabs/components/Tab.style.js +1 -0
- package/components/Tabs/components/TabIndicator.js +5 -0
- package/components/Tabs/components/TabIndicator.style.js +1 -0
- package/components/Tabs/components/TabPanel.js +5 -0
- package/components/Tabs/components/Tabs.js +11 -0
- package/components/Tabs/components/Tabs.style.js +2 -0
- package/components/Tabs/debounce.js +11 -0
- package/components/Tabs/index.js +1 -0
- package/components/Tabs/ownerDocument.js +4 -0
- package/components/Tabs/ownerWindow.js +4 -0
- package/components/Tabs/useEventCallback.js +6 -0
- package/components/TextLink/TextLink.js +5 -0
- package/components/TextLink/TextLink.style.js +1 -0
- package/components/TimeBoundary/index.js +10 -8
- package/components/TimeBoundary/spec.js +3 -3
- package/components/Toggle/index.js +5 -0
- package/components/Toggle/style.js +1 -0
- 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 +13 -13
- package/components/View/components/Content/style.js +1 -1
- package/components/View/context.js +1 -1
- package/components/View/index.js +5 -5
- package/components/View/provider.js +24 -7
- package/components/View/style.js +1 -6
- package/components/index.js +4 -4
- package/core/action-creators/appPermissions.js +1 -1
- package/core/action-creators/index.js +1 -1
- package/core/action-creators/merchantSettings.js +5 -0
- package/core/action-creators/optIns.js +37 -0
- package/core/action-creators/shopSettings.js +9 -0
- package/core/actions/getGeolocation.js +2 -2
- package/core/actions/grantAppTrackingTransparencyPermission.js +3 -1
- package/core/actions/grantGeolocationPermissions.js +6 -2
- package/core/actions/grantPermissions.js +16 -4
- package/core/actions/grantPushPermissions.js +4 -3
- package/core/actions/index.js +2 -2
- package/core/actions/requestAppPermission.js +7 -2
- package/core/actions/requestAppPermissionStatus.js +7 -2
- package/core/actions/updateStatusBarBackground.js +3 -3
- package/core/classes/GeolocationRequest.js +8 -4
- package/core/classes/GeolocationRequestApp.js +16 -0
- package/core/classes/GeolocationRequestBrowser.js +8 -0
- package/core/collections/AppInitialization.js +4 -6
- package/core/config/ThemeConfigResolver.js +3 -3
- package/core/config/config.action-creators.js +12 -0
- package/core/config/config.actions.js +3 -0
- package/core/config/config.constants.js +1 -0
- package/core/config/config.reducers.js +6 -0
- package/core/config/config.selectors.js +39 -0
- package/core/config/config.streams.js +1 -0
- package/core/config/config.subscriptions.js +4 -0
- package/core/config/config.types.js +0 -0
- package/core/config/index.js +1 -0
- package/core/constants/appFeatures.js +1 -1
- package/core/constants/deviceTypes.js +1 -0
- package/core/constants/geolocationRequest.js +1 -1
- package/core/constants/index.js +9 -3
- package/core/constants/merchantSettings.js +1 -0
- package/core/constants/optIns.js +1 -0
- package/core/constants/pipelines.js +1 -0
- package/core/constants/shopSettings.js +2 -0
- package/core/contexts/AppContext.js +1 -1
- package/core/contexts/ThemeResourcesContext.d.ts +69 -0
- package/core/contexts/ThemeResourcesContext.js +3 -0
- package/core/contexts/index.js +1 -0
- package/core/events/index.js +1 -0
- package/core/helpers/androidNavigationBar.js +12 -0
- package/core/helpers/appFeatures.js +21 -9
- package/core/helpers/appPermissions.js +58 -0
- package/core/helpers/baseUrl.js +1 -1
- package/core/helpers/bridge.js +4 -0
- package/core/helpers/deviceType.js +5 -0
- package/core/helpers/environment.js +4 -0
- package/core/helpers/errorBehavior.js +32 -0
- package/core/helpers/featureFlag.js +11 -0
- package/core/helpers/getFullImageSource.js +21 -2
- package/core/helpers/googleMaps.js +8 -0
- package/core/helpers/i18n.js +10 -5
- package/core/helpers/index.js +3 -3
- package/core/helpers/isIOSTheme.js +4 -0
- package/core/helpers/isTouchDevice.js +4 -0
- package/core/helpers/nl2br.js +1 -0
- package/core/helpers/scrollContainer.js +4 -0
- package/core/helpers/string.js +9 -0
- package/core/helpers/svgToDataUrl.js +9 -0
- package/core/helpers/updateLegacyNavigationBar.js +5 -2
- package/core/hocs/index.js +1 -0
- package/core/hocs/withApp.js +1 -1
- package/core/hocs/withCurrentProduct.js +3 -3
- package/core/hocs/withForwardedRef.js +1 -1
- package/core/hocs/withNavigation.js +1 -1
- package/core/hocs/withRoute.js +1 -1
- package/core/hocs/withTheme.js +42 -3
- package/core/hocs/withThemeResources.js +19 -0
- package/core/hocs/withWidgetSettings.js +1 -1
- package/core/hocs/withWidgetStyles.js +1 -1
- package/core/hooks/events/index.js +1 -0
- package/core/hooks/events/useLongPress.d.ts +68 -0
- package/core/hooks/events/useLongPress.js +13 -0
- package/core/hooks/events/usePressHandler.js +38 -0
- package/core/hooks/events/useScrollDirectionChange.d.ts +74 -0
- package/core/hooks/events/useScrollDirectionChange.js +18 -0
- package/core/hooks/html/useLoadImage.js +1 -1
- package/core/hooks/index.js +1 -0
- package/core/hooks/layout/index.js +1 -0
- package/core/hooks/layout/useElementSize.d.ts +46 -0
- package/core/hooks/layout/useElementSize.js +18 -0
- package/core/hooks/useAsyncMemo.js +12 -0
- package/core/hooks/useFormState.js +27 -0
- package/core/hooks/usePrevious.js +2 -0
- package/core/hooks/useScrollTo.js +5 -0
- package/core/hooks/useTheme.js +38 -2
- package/core/hooks/useThemeResources.js +22 -0
- package/core/hooks/useWidgetStyles.js +1 -1
- package/core/index.js +5 -11
- package/core/initialization/index.js +19 -4
- package/core/providers/AppProvider.js +9 -9
- package/core/providers/ThemeResourcesProvider.js +19 -0
- package/core/providers/index.js +1 -0
- package/core/reducers/index.js +1 -1
- package/core/reducers/merchantSettings.js +6 -0
- package/core/reducers/shopSettings.js +6 -0
- package/core/selectors/index.js +1 -1
- package/core/selectors/merchantSettings.js +10 -0
- package/core/selectors/shopSettings.js +25 -0
- package/core/streams/app.js +1 -1
- package/core/streams/index.js +1 -1
- package/core/streams/optIns.js +13 -0
- package/core/subscriptions/app.js +4 -3
- package/core/validation/index.js +1 -0
- package/core/validation/validation.hooks.js +4 -0
- package/core/validation/validation.js +12 -0
- package/development/action-creators/index.js +1 -0
- package/development/action-creators/settings.js +9 -0
- package/development/action-creators/storage.js +6 -0
- package/development/components/DevelopmentTools/DevelopmentTools.js +6 -0
- package/development/components/DevelopmentTools/Shortcuts.js +4 -0
- package/development/components/DevelopmentTools/hooks.js +8 -0
- package/development/components/DevelopmentTools/index.js +1 -0
- package/development/components/SimulatedInsets/SimulatedInsetBottom.js +7 -0
- package/development/components/SimulatedInsets/SimulatedInsetTop.js +12 -0
- package/development/components/SimulatedInsets/SimulatedInsets.js +6 -0
- package/development/components/SimulatedInsets/index.js +1 -0
- package/development/components/index.js +1 -0
- package/development/constants/actionTypes.js +1 -0
- package/development/constants/index.js +1 -0
- package/development/reducers/index.js +1 -0
- package/development/reducers/settings.js +10 -0
- package/development/reducers/storage.js +9 -0
- package/development/selectors/index.js +1 -0
- package/development/selectors/settings.js +21 -0
- package/development/selectors/storage.js +16 -0
- package/development/streams/index.js +1 -0
- package/development/streams/insets.js +4 -0
- package/development/subscriptions/index.js +6 -0
- package/favorites/components/CommentDialog/CommentDialog.js +12 -0
- package/favorites/components/CommentDialog/index.js +1 -0
- package/favorites/components/FavoriteButtonWide/FavoriteButtonWide.js +8 -0
- package/favorites/components/FavoriteButtonWide/index.js +1 -0
- package/favorites/components/Item/Item.js +13 -9
- package/favorites/components/Item/ItemCharacteristics.js +2 -2
- package/favorites/components/Item/ItemNotes.js +7 -0
- package/favorites/components/Item/ItemQuantity.js +7 -0
- package/favorites/components/ItemFulfillmentMethod/ItemFulfillmentMethod.js +4 -0
- package/favorites/components/ItemFulfillmentMethod/index.js +1 -0
- package/favorites/components/List/List.js +19 -15
- package/favorites/components/List/ListAccordionHeader.js +8 -0
- package/favorites/components/List/ListAccordionLabel.js +5 -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/ListChooser/ListChooser.js +2 -2
- package/favorites/components/ListChooser/ListChooserItem.js +4 -5
- package/favorites/components/Lists/Lists.js +17 -13
- package/favorites/components/Lists/ListsModal.js +3 -4
- package/favorites/components/RemoveButton/RemoveButton.js +2 -2
- package/favorites/constants/Portals.js +1 -2
- package/favorites/constants/index.js +1 -0
- package/favorites/index.js +2 -2
- package/filter/actions/index.js +1 -0
- package/filter/components/FilterItem/index.js +2 -2
- package/filter/components/FilterItem/spec.js +1 -1
- package/filter/components/FilterPageContent/components/ApplyButton/index.js +7 -0
- package/filter/components/FilterPageContent/components/ApplyButton/spec.js +1 -0
- package/filter/components/FilterPageContent/components/ApplyButton/style.js +1 -0
- package/filter/components/FilterPageContent/components/ResetButton/index.js +7 -0
- package/filter/components/FilterPageContent/components/ResetButton/spec.js +1 -0
- package/filter/components/FilterPageContent/components/ResetButton/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Selected/index.js +7 -0
- package/filter/components/FilterPageContent/components/Selector/components/Selected/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Selected/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/index.js +7 -0
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/ValueButton/index.js +7 -0
- package/filter/components/FilterPageContent/components/Selector/components/ValueButton/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/ValueButton/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/index.js +19 -0
- package/filter/components/FilterPageContent/components/Selector/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/style.js +1 -0
- package/filter/components/FilterPageContent/index.js +6 -0
- package/filter/components/FilterPageContentWithProvider/index.js +16 -0
- package/filter/components/PriceSlider/components/Label/index.js +3 -3
- package/filter/components/PriceSlider/components/Label/spec.js +1 -1
- package/filter/components/PriceSlider/index.js +8 -8
- package/filter/components/PriceSlider/spec.js +1 -1
- package/filter/components/PriceSlider/style.js +1 -1
- package/filter/components/index.js +1 -0
- package/filter/constants/index.js +1 -0
- package/filter/constants/sort.js +11 -0
- package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +2 -2
- package/filter/helpers/buildInitialFilters.js +2 -2
- package/filter/helpers/buildUpdatedFilters.js +2 -2
- package/filter/helpers/index.js +1 -0
- package/filter/helpers/translateFilterLabel.js +3 -3
- package/filter/hocs/index.js +1 -0
- package/filter/hocs/withSort.js +16 -0
- package/filter/hooks/filterPage.js +5 -0
- package/filter/hooks/index.js +4 -0
- package/filter/index.js +2 -7
- package/filter/providers/FilterPageProvider.context.js +54 -0
- package/filter/providers/FilterPageProvider.js +98 -0
- package/filter/providers/SortProvider.connector.js +3 -0
- package/filter/providers/SortProvider.context.js +1 -0
- package/filter/providers/SortProvider.helpers.js +8 -0
- package/filter/providers/SortProvider.js +6 -0
- package/filter/providers/index.js +1 -0
- package/filter/selectors/index.js +17 -0
- package/filter/streams/index.js +1 -0
- package/i18n/countries.helpers.js +6 -0
- package/i18n/countries.hooks.js +6 -0
- package/i18n/index.js +1 -0
- package/i18n/locale/cs-cz/countries.json +255 -0
- package/i18n/locale/de-de/countries.json +255 -0
- package/i18n/locale/el-gr/countries.json +255 -0
- package/i18n/locale/en-us/countries.json +255 -0
- package/i18n/locale/es-es/countries.json +255 -0
- package/i18n/locale/fi-fi/countries.json +255 -0
- package/i18n/locale/fr-fr/countries.json +255 -0
- package/i18n/locale/hu-hu/countries.json +255 -0
- package/i18n/locale/it-it/countries.json +255 -0
- package/i18n/locale/nl-nl/countries.json +255 -0
- package/i18n/locale/pl-pl/countries.json +255 -0
- package/i18n/locale/pt-pt/countries.json +255 -0
- package/i18n/locale/ro-ro/countries.json +255 -0
- package/i18n/locale/sv-se/countries.json +255 -0
- package/locations/action-creators/errorInventories.js +7 -0
- package/locations/action-creators/errorLocations.js +6 -0
- package/locations/action-creators/errorProductInventories.js +7 -0
- package/locations/action-creators/errorProductLocations.js +6 -0
- package/locations/action-creators/index.js +1 -0
- package/locations/action-creators/provideProductAlternativeLocation.js +5 -0
- package/locations/action-creators/receiveInventories.js +5 -0
- package/locations/action-creators/receiveLocations.js +6 -0
- package/locations/action-creators/receiveProductInventories.js +7 -0
- package/locations/action-creators/receiveProductLocations.js +7 -0
- package/locations/action-creators/requestInventories.js +6 -0
- package/locations/action-creators/requestLocations.js +5 -0
- package/locations/action-creators/requestProductInventories.js +6 -0
- package/locations/action-creators/requestProductLocations.js +5 -0
- package/locations/action-creators/selectGlobalLocation.js +5 -0
- package/locations/action-creators/selectLocation.js +6 -0
- package/locations/action-creators/setStoreFinderSearchRadius.js +5 -0
- package/locations/action-creators/setUserGeolocation.js +5 -0
- package/locations/action-creators/setUserSearchCountryCode.js +7 -0
- package/locations/action-creators/setUserSearchGeolocation.js +8 -0
- package/locations/action-creators/setUserSearchPostalCode.js +7 -0
- package/locations/action-creators/storeFormInput.js +5 -0
- package/locations/action-creators/storeFulfillmentMethod.js +5 -0
- package/locations/action-creators/submitReservationError.js +5 -0
- package/locations/action-creators/submitReservationRequest.js +5 -0
- package/locations/action-creators/submitReservationSuccess.js +5 -0
- package/locations/actions/fetchDefaultLocation.js +4 -0
- package/locations/actions/fetchFulfillmentSlots.js +6 -0
- package/locations/actions/fetchInventories.js +6 -0
- package/locations/actions/fetchLocations.js +19 -0
- package/locations/actions/fetchProductInventories.js +7 -0
- package/locations/actions/fetchProductLocations.js +12 -0
- package/locations/actions/index.js +5 -0
- package/locations/actions/sendDefaultLocationCode.js +6 -0
- package/locations/actions/setUserGeolocation.js +1 -0
- package/locations/actions/setUserSearchGeolocation.js +1 -0
- package/locations/actions/submitReservation.js +5 -0
- package/locations/assets/leaflet.css +765 -0
- package/locations/components/Cart/CartChangeFulfillmentMethod.connector.js +4 -0
- package/locations/components/Cart/CartChangeFulfillmentMethod.js +8 -0
- package/locations/components/Cart/CartChangeFulfillmentMethod.types.js +0 -0
- package/locations/components/Cart/CartContextMenuChangeFulfillment.js +6 -0
- package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +5 -0
- package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.style.js +1 -0
- package/locations/components/Cart/CartContextMenuItemChangeFulfillment.connector.js +4 -0
- package/locations/components/Cart/CartContextMenuItemChangeFulfillment.js +6 -0
- package/locations/components/Cart/CartContextMenuItemChangeLocation.js +7 -0
- package/locations/components/Cart/CartItemProductChangeLocation.connector.js +5 -0
- package/locations/components/Cart/CartItemProductChangeLocation.js +11 -0
- package/locations/components/Cart/CartItemProductChangeLocation.types.js +0 -0
- package/locations/components/Cart/index.js +1 -0
- package/locations/components/ChangeLocationButton/ChangeLocationButton.js +4 -0
- package/locations/components/ChangeLocationButton/ChangeLocationButton.style.js +2 -0
- package/locations/components/ChangeLocationButton/index.js +1 -0
- package/locations/components/FulfillmentPath/FulfillmentPath.js +4 -0
- package/locations/components/FulfillmentPath/FulfillmentPath.style.js +2 -0
- package/locations/components/FulfillmentPath/FulfillmentPathItem.js +6 -0
- package/locations/components/FulfillmentPath/index.js +1 -0
- package/locations/components/FulfillmentPathSelector/FulfillmentPathSelector.js +14 -0
- package/locations/components/FulfillmentPathSelector/FulfillmentPathSelector.style.js +1 -0
- package/locations/components/FulfillmentPathSelector/index.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.connector.js +9 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.context.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.hooks.js +3 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.js +20 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.types.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +10 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +8 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorBOPIS.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorDirectShip.js +5 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.js +8 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocationMethodNotAvailable.js +3 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorROPIS.js +4 -0
- package/locations/components/FulfillmentSelector/index.js +1 -0
- package/locations/components/FulfillmentSheet/FulfillmentSheet.js +6 -0
- package/locations/components/FulfillmentSheet/FulfillmentSheet.style.js +1 -0
- package/locations/components/FulfillmentSheet/FulfillmentSheetContent.js +6 -0
- package/locations/components/FulfillmentSheet/index.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +28 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.connector.js +8 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.context.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.js +9 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.connector.js +4 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.js +4 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +3 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.style.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.js +3 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.style.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/index.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/time.js +5 -0
- package/locations/components/GlobalLocationSelector/GlobalLocationSelector.js +16 -0
- package/locations/components/GlobalLocationSelector/index.js +1 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.connector.js +8 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.js +3 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +3 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.style.js +1 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.js +3 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.style.js +1 -0
- package/locations/components/GlobalLocationSwitcher/index.js +1 -0
- package/locations/components/ReservationResponses/ReservationError.js +4 -0
- package/locations/components/ReservationResponses/ReservationResponse.style.js +1 -0
- package/locations/components/ReservationResponses/ReservationSuccess.js +4 -0
- package/locations/components/ReservationResponses/index.js +1 -0
- package/locations/components/ReserveForm/ReserveForm.constraints.js +1 -0
- package/locations/components/ReserveForm/ReserveForm.js +10 -0
- package/locations/components/ReserveForm/ReserveForm.style.js +1 -0
- package/locations/components/ReserveForm/ReserveFormPhone.connector.js +3 -0
- package/locations/components/ReserveForm/ReserveFormPhone.js +5 -0
- package/locations/components/ReserveForm/ReserveFormPhone.types.js +0 -0
- package/locations/components/ReserveForm/index.js +1 -0
- package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -0
- package/locations/components/StockInfo/StockInfo.js +8 -0
- package/locations/components/StockInfo/StockInfoInventory.js +9 -0
- package/locations/components/StockInfo/index.js +1 -0
- package/locations/components/StockInfoLists/index.js +9 -0
- package/locations/components/StoreDetails/components/FindMoreStores.js +4 -0
- package/locations/components/StoreDetails/components/GetDirectionsButton.js +7 -0
- package/locations/components/StoreDetails/components/StoreDetails.js +5 -0
- package/locations/components/StoreDetails/components/StoreFinderMap.js +20 -0
- package/locations/components/StoreDetails/components/StoreFinderMap.style.js +1 -0
- package/locations/components/StoreDetails/components/StoreLocationMap.js +4 -0
- package/locations/components/StoreDetails/components/StoresNearby.js +4 -0
- package/locations/components/StoreDetails/components/StoresNearbyListItem.js +9 -0
- package/locations/components/StoreDetails/index.js +4 -0
- package/locations/components/StoreFinder/Store.context.js +1 -0
- package/locations/components/StoreFinder/StoreFinder.js +3 -0
- package/locations/components/StoreFinder/StoreFinder.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.connector.js +4 -0
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.js +4 -0
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocation.js +3 -0
- package/locations/components/StoreFinder/StoreFinderLocation.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocationDetails.js +3 -0
- package/locations/components/StoreFinder/StoreFinderLocationDetails.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocationHeader.js +3 -0
- package/locations/components/StoreFinder/StoreFinderLocationHeader.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocationHeaderPhoneNumber.js +4 -0
- package/locations/components/StoreFinder/StoreFinderLocations.js +5 -0
- package/locations/components/StoreFinder/StoreFinderLocations.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderSearch.js +3 -0
- package/locations/components/StoreFinder/StoreFinderSearch.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +5 -0
- package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +8 -0
- package/locations/components/StoreFinder/index.js +1 -0
- package/locations/components/StoreList/Store.context.js +1 -0
- package/locations/components/StoreList/Store.style.js +1 -0
- package/locations/components/StoreList/StoreAddress.js +7 -0
- package/locations/components/StoreList/StoreAddressShort.js +7 -0
- package/locations/components/StoreList/StoreCard.js +4 -0
- package/locations/components/StoreList/StoreDetails.js +4 -0
- package/locations/components/StoreList/StoreDetailsLine.js +8 -0
- package/locations/components/StoreList/StoreDistance.js +7 -0
- package/locations/components/StoreList/StoreHeader.js +4 -0
- package/locations/components/StoreList/StoreHoursToday.js +7 -0
- package/locations/components/StoreList/StoreList.js +4 -0
- package/locations/components/StoreList/StoreListLocations.js +4 -0
- package/locations/components/StoreList/StoreListProduct.js +4 -0
- package/locations/components/StoreList/StoreListProduct.style.js +1 -0
- package/locations/components/StoreList/StoreListProductInfo.js +4 -0
- package/locations/components/StoreList/StoreListProductName.js +4 -0
- package/locations/components/StoreList/StoreListSearch.connector.js +7 -0
- package/locations/components/StoreList/StoreListSearch.js +23 -0
- package/locations/components/StoreList/StoreListSearch.style.js +1 -0
- package/locations/components/StoreList/StoreListSearchRadius.connector.js +7 -0
- package/locations/components/StoreList/StoreListSearchRadius.js +4 -0
- package/locations/components/StoreList/StoreListSearchRadius.style.js +1 -0
- package/locations/components/StoreList/StoreOpeningHours.js +7 -0
- package/locations/components/StoreList/StoreOpeningHoursLine.js +7 -0
- package/locations/components/StoreList/StorePhoneNumber.js +6 -0
- package/locations/components/StoreList/StoreSelectLocationButton.js +4 -0
- package/locations/components/StoreList/index.js +1 -0
- package/locations/components/index.js +1 -0
- package/locations/constants/ActionTypes.js +10 -0
- package/locations/constants/Pipelines.js +1 -0
- package/locations/constants/Portals.js +2 -0
- package/locations/constants/Stages.js +1 -0
- package/locations/constants/index.js +7 -0
- package/locations/constants/routes.js +1 -0
- package/locations/helpers/createOrder.js +28 -0
- package/locations/helpers/formatDistance.js +9 -0
- package/locations/helpers/getAvailabilitySettings.js +12 -0
- package/locations/helpers/index.js +1 -0
- package/locations/helpers/productInventory.js +7 -0
- package/locations/helpers/showInventoryInLists.js +7 -0
- package/locations/index.js +9 -0
- package/locations/locations.context.js +1 -0
- package/locations/locations.hooks.js +4 -0
- package/locations/locations.streams.js +1 -0
- package/locations/locations.types.js +1 -0
- package/locations/providers/FulfillmentProvider.connector.js +10 -0
- package/locations/providers/FulfillmentProvider.js +49 -0
- package/locations/providers/FulfillmentProvider.types.js +1 -0
- package/locations/providers/StoreDetailsContext.js +1 -0
- package/locations/providers/StoreDetailsProvider.js +4 -0
- package/locations/providers/StoreFinder.connector.js +3 -0
- package/locations/providers/StoreFinderProvider.js +7 -0
- package/locations/providers/index.js +1 -0
- package/locations/reducers/index.js +1 -0
- package/locations/reducers/storage.js +24 -0
- package/locations/reducers/storeFinderSearch.js +6 -0
- package/locations/reducers/user.js +5 -0
- package/locations/reducers/userFormInput.js +8 -0
- package/locations/reducers/userSearch.js +6 -0
- package/locations/selectors/index.js +145 -0
- package/locations/subscriptions.js +27 -0
- package/login/action-creators/index.js +1 -0
- package/login/action-creators/resetPassword.js +14 -0
- package/login/actions/index.js +1 -0
- package/login/actions/resetPassword.js +5 -0
- package/login/components/ForgotPassword/ForgotPassword.connector.js +5 -0
- package/login/components/ForgotPassword/ForgotPassword.js +5 -0
- package/login/components/ForgotPassword/ForgotPassword.style.js +1 -0
- package/login/components/ForgotPassword/index.js +1 -0
- package/login/constants/actions.js +1 -0
- package/login/constants/index.js +1 -0
- package/login/constants/pipelines.js +1 -0
- package/login/constants/routes.js +1 -0
- package/login/index.js +1 -0
- package/orders/action-creators/index.js +1 -0
- package/orders/action-creators/orderDetails.js +22 -0
- package/orders/action-creators/orders.js +21 -0
- package/orders/actions/cancelOrder.js +8 -0
- package/orders/actions/fetchOrderDetails.js +10 -0
- package/orders/actions/fetchOrderHistory.js +7 -0
- package/orders/actions/index.js +1 -0
- package/orders/components/OrderDetails/OrderDetails.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsAuthenticate.js +3 -0
- package/orders/components/OrderDetails/OrderDetailsAuthenticate.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsAuthenticateForm.config.js +8 -0
- package/orders/components/OrderDetails/OrderDetailsContent.js +3 -0
- package/orders/components/OrderDetails/OrderDetailsContent.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsOrder.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsOrder.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsOrderHeader.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsOrderHeader.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.connector.js +3 -0
- package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.style.js +1 -0
- package/orders/components/OrderDetails/index.js +1 -0
- package/orders/components/OrderHistory/OrderHistory.js +4 -0
- package/orders/components/OrderHistory/OrderHistory.style.js +1 -0
- package/orders/components/OrderHistory/OrderHistoryList.js +9 -0
- package/orders/components/OrderHistory/OrderHistoryList.style.js +1 -0
- package/orders/components/OrderHistory/OrderHistoryLoader.js +4 -0
- package/orders/components/OrderHistory/OrderHistoryTable.js +9 -0
- package/orders/components/OrderHistory/OrderHistoryTable.style.js +1 -0
- package/orders/components/OrderHistory/index.js +1 -0
- package/orders/components/index.js +1 -0
- package/orders/constants/actionTypes.js +1 -0
- package/orders/constants/index.js +1 -0
- package/orders/constants/pipelines.js +1 -0
- package/orders/constants/routes.js +1 -0
- package/orders/constants/status.js +12 -0
- package/orders/helpers/index.js +1 -0
- package/orders/helpers/orderDetails.js +5 -0
- package/orders/helpers/orderStatus.js +15 -0
- package/orders/hooks/index.js +7 -0
- package/orders/index.js +1 -1
- package/orders/providers/OrderDetailsPrivateProvider.connector.js +11 -0
- package/orders/providers/OrderDetailsPrivateProvider.js +5 -0
- package/orders/providers/OrderDetailsProvider.connector.js +11 -0
- package/orders/providers/OrderDetailsProvider.constraints.js +1 -0
- package/orders/providers/OrderDetailsProvider.context.js +1 -0
- package/orders/providers/OrderDetailsProvider.js +11 -0
- package/orders/providers/OrderHistoryProvider.connector.js +9 -0
- package/orders/providers/OrderHistoryProvider.context.js +1 -0
- package/orders/providers/OrderHistoryProvider.js +4 -0
- package/orders/reducers/index.js +1 -0
- package/orders/reducers/orders.js +7 -0
- package/orders/reducers/ordersById.js +7 -0
- package/orders/reducers/ordersByNumber.js +7 -0
- package/orders/selectors/index.js +27 -0
- package/orders/subscriptions/index.js +4 -0
- package/package.json +28 -18
- package/page/action-creators/index.js +22 -0
- package/page/actions/index.js +1 -0
- package/page/components/NotFound.js +3 -0
- package/page/components/Widgets/Overlay.js +51 -0
- package/page/components/Widgets/Tooltip.js +22 -0
- package/page/components/Widgets/Widget.js +15 -0
- package/page/components/Widgets/WidgetContext.d.ts +42 -0
- package/page/components/Widgets/WidgetContext.js +9 -0
- package/page/components/Widgets/WidgetProvider.js +8 -0
- package/page/components/Widgets/Widgets.js +11 -0
- package/page/components/Widgets/WidgetsPreviewContext.js +9 -0
- package/page/components/Widgets/WidgetsPreviewProvider.js +8 -0
- package/page/components/Widgets/constants.js +4 -0
- package/page/components/Widgets/events.js +23 -0
- package/page/components/Widgets/helpers.js +23 -0
- package/page/components/Widgets/hooks.js +69 -0
- package/page/components/Widgets/index.js +1 -0
- package/page/components/Widgets/types.d.ts +127 -0
- package/page/components/index.js +1 -0
- package/page/constants/actionTypes.js +1 -0
- package/page/constants/index.js +5 -1
- package/page/hooks/index.d.ts +60 -0
- package/page/hooks/index.js +25 -0
- package/page/index.js +1 -4
- package/page/reducers/index.js +6 -0
- package/page/selectors/index.js +53 -0
- package/page/subscriptions/index.js +4 -0
- package/page/widgets/HTML/HTML.js +5 -0
- package/page/widgets/HTML/hooks.js +12 -0
- package/page/widgets/HTML/index.js +1 -0
- package/page/widgets/Placeholder/Placeholder.js +5 -0
- package/page/widgets/Placeholder/hooks.js +12 -0
- package/page/widgets/Placeholder/index.js +1 -0
- package/page/widgets/ProductList/ProductList.js +5 -0
- package/page/widgets/ProductList/hooks.js +25 -0
- package/page/widgets/ProductList/index.js +1 -0
- package/page/widgets/ProductSlider/ProductSlider.js +4 -0
- package/page/widgets/ProductSlider/hooks.js +27 -0
- package/page/widgets/ProductSlider/index.js +1 -0
- package/page/widgets/index.js +1 -0
- package/page/widgets/widgets.json +14 -0
- package/product/collections/index.js +1 -0
- package/product/components/Availability/Availability.connector.js +5 -0
- package/product/components/Availability/Availability.js +6 -0
- package/product/components/Availability/Availability.style.js +1 -0
- package/product/components/Availability/index.js +1 -0
- package/product/components/Characteristics/Characteristic/components/Sheet/index.js +16 -4
- package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +8 -3
- package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -1
- package/product/components/Characteristics/Characteristic/index.js +15 -6
- package/product/components/Characteristics/Characteristic/style.js +1 -1
- package/product/components/Characteristics/Swatch/index.js +8 -6
- package/product/components/Characteristics/index.js +10 -3
- package/product/components/Characteristics/transition.js +1 -1
- package/product/components/Description/index.js +5 -6
- package/product/components/Description/style.js +1 -1
- package/product/components/EffectivityDates/helpers.js +5 -5
- package/product/components/EffectivityDates/index.js +2 -2
- package/product/components/EffectivityDates/style.js +1 -1
- package/product/components/Header/PriceStriked/index.js +2 -5
- package/product/components/Header/PriceStriked/style.js +1 -1
- package/product/components/Header/Shipping/components/Label/index.js +3 -3
- package/product/components/Header/Shipping/components/Label/style.js +1 -1
- package/product/components/Header/Shipping/index.js +1 -1
- package/product/components/Header/Shipping/spec.js +1 -1
- package/product/components/Header/Tiers/components/Tier/index.js +2 -2
- package/product/components/Header/Tiers/components/Tier/spec.js +1 -1
- package/product/components/Header/Tiers/index.js +1 -1
- package/product/components/Header/Tiers/spec.js +1 -1
- package/product/components/Header/index.js +1 -0
- package/product/components/MapPriceHint/index.js +1 -1
- package/product/components/Media/FeaturedMedia.js +2 -2
- package/product/components/Media/MediaImage.js +3 -3
- package/product/components/Media/MediaPlaceholder.js +1 -1
- package/product/components/MediaSlider/components/MediaImage/index.js +1 -1
- package/product/components/MediaSlider/components/MediaVideo/index.js +1 -1
- package/product/components/MediaSlider/index.js +4 -4
- package/product/components/Options/components/Content/index.js +8 -8
- package/product/components/Options/components/Content/spec.js +2 -2
- package/product/components/Options/components/Option/index.js +2 -2
- package/product/components/Options/components/TextOption/components/OptionInfo/index.js +3 -3
- package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -1
- package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -1
- package/product/components/Options/components/TextOption/index.js +19 -7
- package/product/components/Options/components/TextOption/style.js +1 -1
- package/product/components/Options/index.js +2 -2
- 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/PriceDifference/style.js +1 -1
- package/product/components/PriceInfo/PriceInfo.connector.js +4 -0
- package/product/components/PriceInfo/PriceInfo.js +4 -0
- package/product/components/PriceInfo/index.js +1 -0
- package/product/components/ProductBadges/index.js +2 -2
- package/product/components/ProductCard/index.js +12 -3
- package/product/components/ProductCard/style.js +1 -1
- package/product/components/ProductCharacteristics/context.js +1 -1
- package/product/components/ProductCharacteristics/helpers/index.js +1 -1
- package/product/components/ProductCharacteristics/index.js +30 -16
- package/product/components/ProductDiscountBadge/index.js +2 -2
- package/product/components/ProductDiscountBadge/spec.js +2 -2
- package/product/components/ProductDiscountBadge/style.js +1 -1
- package/product/components/ProductGrid/components/Item/components/ItemDetails/index.js +8 -0
- package/product/components/ProductGrid/components/Item/components/ItemDetails/spec.js +1 -0
- package/product/components/ProductGrid/components/Item/components/ItemDiscount/index.js +5 -0
- package/product/components/ProductGrid/components/Item/components/ItemFavoritesButton/index.js +5 -0
- package/product/components/ProductGrid/components/Item/components/ItemFavoritesButton/spec.js +1 -0
- package/product/components/ProductGrid/components/Item/components/ItemImage/index.js +5 -0
- package/product/components/ProductGrid/components/Item/components/ItemImage/spec.js +1 -0
- package/product/components/ProductGrid/components/Item/components/ItemName/index.js +5 -0
- package/product/components/ProductGrid/components/Item/components/ItemName/spec.js +1 -0
- package/product/components/ProductGrid/components/Item/components/ItemPrice/index.js +5 -0
- package/product/components/ProductGrid/components/Item/components/ItemPrice/spec.js +1 -0
- package/product/components/ProductGrid/components/Item/index.js +7 -0
- package/product/components/ProductGrid/components/Iterator/index.js +5 -0
- package/product/components/ProductGrid/components/Layout/index.js +5 -0
- package/product/components/ProductGrid/index.js +22 -0
- package/product/components/ProductGrid/spec.js +1 -0
- package/product/components/ProductGridPrice/index.js +4 -4
- package/product/components/ProductGridPrice/style.js +1 -1
- package/product/components/ProductImage/ProductImagePlaceholder.js +5 -0
- package/product/components/ProductImage/connector.js +5 -0
- package/product/components/ProductImage/index.js +17 -13
- package/product/components/ProductImage/spec.js +1 -1
- package/product/components/ProductList/components/Item/index.js +2 -2
- package/product/components/ProductList/components/Iterator/index.js +1 -1
- package/product/components/ProductList/components/Layout/index.js +1 -1
- package/product/components/ProductList/index.js +2 -2
- package/product/components/ProductName/ProductName.js +4 -0
- package/product/components/ProductName/ProductNameContent.js +4 -0
- package/product/components/ProductName/index.js +1 -0
- package/product/components/ProductProperties/Content.js +4 -4
- package/product/components/ProductProperties/Group.js +1 -1
- package/product/components/ProductProperties/GroupedProperties.js +2 -2
- package/product/components/ProductProperties/Lists.js +1 -1
- package/product/components/ProductProperties/ListsHTML.js +5 -0
- package/product/components/ProductProperties/ProductProperties.js +2 -2
- package/product/components/ProductProperties/Row.js +1 -1
- package/product/components/ProductProperties/RowHTML.js +5 -0
- package/product/components/ProductProperties/Rows.js +2 -2
- package/product/components/ProductProperties/Wrapper.js +1 -1
- package/product/components/ProductProperties/helpers/getGroupsFromProperties.js +7 -2
- package/product/components/ProductProperties/style.js +1 -1
- package/product/components/ProductSlider/index.js +4 -3
- package/product/components/ProductSlider/spec.js +1 -1
- package/product/components/ProductVariants/VariantAvailability.connector.js +5 -0
- package/product/components/ProductVariants/VariantAvailability.js +5 -0
- package/product/components/ProductVariants/index.js +1 -0
- package/product/components/QuantityPicker/hooks.js +5 -0
- package/product/components/QuantityPicker/index.js +4 -3
- package/product/components/Rating/index.js +3 -3
- package/product/components/Rating/spec.js +2 -2
- package/product/components/RelationsSlider/RelationsSheet.js +2 -2
- package/product/components/RelationsSlider/RelationsSlider.js +1 -1
- package/product/components/RelationsSlider/RelationsSliderContent.js +1 -1
- package/product/components/RelationsSlider/style.js +1 -1
- package/product/components/Swatch/Swatch.js +1 -1
- package/product/components/Swatch/SwatchContent.js +1 -1
- package/product/components/Swatch/VariantSwatch.js +1 -1
- package/product/components/Swatch/style.js +1 -1
- package/product/components/Swatches/Swatches.js +1 -1
- package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +4 -0
- package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -6
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +11 -13
- package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +5 -2
- package/product/components/UnitQuantityPicker/index.js +1 -1
- package/product/components/UnitQuantityPicker/styles.js +1 -0
- package/product/components/context.js +1 -1
- package/product/components/index.js +1 -0
- package/product/constants/index.js +2 -1
- package/product/contexts/index.js +1 -0
- package/product/helpers/index.js +2 -2
- package/product/helpers/redirects.js +2 -2
- package/product/hocs/index.js +1 -0
- package/product/hocs/withMapPricing.js +4 -4
- package/product/hocs/withPriceCalculation.js +2 -2
- package/product/hocs/withProduct.js +6 -0
- package/product/hocs/withProductListEntry.js +1 -1
- package/product/hocs/withProductListEntryProduct.js +12 -0
- package/product/hocs/withProductListType.js +1 -1
- package/product/hooks/index.js +1 -0
- package/product/hooks/useLoadProductImage.js +1 -1
- package/product/index.js +4 -11
- package/product/product.types.js +0 -0
- package/product/{components/ProductProvider → providers/Product}/index.js +1 -1
- package/product/providers/ProductListEntry/context.js +1 -1
- package/product/providers/ProductListEntry/index.js +1 -1
- package/product/providers/ProductListType/context.js +2 -1
- package/product/providers/ProductListType/index.js +2 -1
- package/product/providers/index.js +1 -0
- package/product/selectors/product.js +75 -6
- package/product/selectors/variants.js +4 -1
- package/product/streams/index.js +1 -0
- package/push-opt-in/action-creators/pushOptIn.js +2 -1
- package/push-opt-in/actions/pushOptInModal.js +3 -3
- package/push-opt-in/components/PushOptInModal/index.js +3 -6
- package/push-opt-in/components/PushOptInModal/push-opt-in.svg +58 -58
- package/push-opt-in/reducers/optInModal.js +2 -2
- package/push-opt-in/reducers/optInTrigger.js +2 -2
- package/push-opt-in/selectors/optInModal.js +5 -2
- package/push-opt-in/selectors/optInTrigger.js +4 -2
- package/push-opt-in/subscriptions/index.js +1 -1
- package/push-opt-in/subscriptions/optInTracking.js +4 -0
- package/push-opt-in/subscriptions/optInTrigger.js +6 -6
- package/registration/action-creators/index.js +18 -0
- package/registration/actions/index.js +1 -0
- package/registration/actions/submitRegistration.js +4 -0
- package/registration/components/GuestRegistration/GuestRegistration.js +4 -0
- package/registration/components/GuestRegistration/GuestRegistrationContent.js +4 -0
- package/registration/components/GuestRegistration/GuestRegistrationFormPickup.config.js +8 -0
- package/registration/components/GuestRegistration/GuestRegistrationFormPickup.js +4 -0
- package/registration/components/Registration/Registration.js +4 -0
- package/registration/components/Registration/RegistrationContent.js +4 -0
- package/registration/components/Registration/RegistrationContent.style.js +2 -0
- package/registration/components/Registration/RegistrationFormActions.js +5 -0
- package/registration/components/Registration/RegistrationFormBase.config.js +4 -0
- package/registration/components/Registration/RegistrationFormBase.js +4 -0
- package/registration/components/Registration/RegistrationFormBilling.config.js +5 -0
- package/registration/components/Registration/RegistrationFormBilling.js +5 -0
- package/registration/components/Registration/RegistrationFormExtra.config.js +5 -0
- package/registration/components/Registration/RegistrationFormExtra.js +5 -0
- package/registration/components/Registration/RegistrationFormShipping.config.js +5 -0
- package/registration/components/Registration/RegistrationFormShipping.js +5 -0
- package/registration/components/Registration/RegistrationFormToggle.js +4 -0
- package/registration/components/index.js +1 -0
- package/registration/constants/actionTypes.js +1 -0
- package/registration/constants/index.js +1 -0
- package/registration/constants/pipelines.js +1 -0
- package/registration/hooks/index.js +5 -0
- package/registration/index.js +2 -0
- package/registration/providers/GuestRegistrationProvider.actions.js +4 -0
- package/registration/providers/GuestRegistrationProvider.connector.js +7 -0
- package/registration/providers/GuestRegistrationProvider.constraints.js +18 -0
- package/registration/providers/GuestRegistrationProvider.context.js +1 -0
- package/registration/providers/GuestRegistrationProvider.js +22 -0
- package/registration/providers/RegistrationProvider.actions.js +8 -0
- package/registration/providers/RegistrationProvider.connector.js +6 -0
- package/registration/providers/RegistrationProvider.constraints.js +27 -0
- package/registration/providers/RegistrationProvider.context.js +1 -0
- package/registration/providers/RegistrationProvider.js +17 -0
- package/registration/streams/index.js +4 -0
- package/registration/subscriptions/index.js +5 -0
- package/reviews/actions/index.js +1 -0
- package/reviews/components/Reviews/components/AllReviewsLink/index.js +1 -1
- package/reviews/components/Reviews/components/Header/components/AverageRating/index.js +8 -6
- package/reviews/components/Reviews/components/Header/components/NoReviews/index.js +3 -3
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +3 -3
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/style.js +1 -1
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/index.js +3 -3
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +2 -2
- package/reviews/components/Reviews/components/Header/index.js +6 -4
- package/reviews/components/Reviews/components/Header/spec.js +2 -2
- package/reviews/components/Reviews/components/List/components/Info/components/Author/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Info/components/ReviewDate/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Info/index.js +2 -2
- package/reviews/components/Reviews/components/List/components/Info/style.js +1 -1
- package/reviews/components/Reviews/components/List/components/Rating/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Review/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Text/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Title/index.js +1 -1
- package/reviews/components/Reviews/components/List/index.js +3 -3
- package/reviews/components/Reviews/components/List/spec.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/spec.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/style.js +1 -1
- package/reviews/components/Reviews/components/ReviewsInfo/index.js +3 -4
- package/reviews/components/Reviews/connector.js +2 -6
- package/reviews/components/Reviews/index.js +1 -1
- package/reviews/components/Reviews/mock.js +2 -6
- package/reviews/components/Reviews/spec.js +4 -3
- package/reviews/components/index.js +1 -0
- package/reviews/constants/index.js +1 -0
- package/reviews/index.js +3 -6
- 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/color.js +23 -0
- package/styles/helpers/cssCustomProperties.js +16 -0
- package/styles/helpers/index.js +1 -0
- package/styles/helpers/initCSSCustomProperties.js +10 -0
- package/styles/helpers/loadCustomStyles.js +6 -0
- package/styles/helpers/setPageBackgroundColor.js +5 -0
- package/styles/helpers/setPageContentWidth.js +5 -0
- package/styles/helpers/setViewportHeight.js +3 -0
- package/styles/helpers/toggleBodyScroll.js +5 -0
- package/styles/helpers/updatePageInsets.js +15 -0
- package/styles/index.d.ts +17 -0
- package/styles/index.js +1 -0
- package/styles/reset/form.js +8 -0
- package/styles/reset/index.js +1 -0
- package/styles/reset/media.js +1 -0
- package/styles/reset/root.js +3 -0
- package/styles/reset/table.js +1 -0
- package/styles/reset/typography.js +1 -0
- package/styles/theme/createTheme/createBreakpoints.d.ts +114 -0
- package/styles/theme/createTheme/createBreakpoints.js +41 -0
- package/styles/theme/createTheme/createSpacing.d.ts +23 -0
- package/styles/theme/createTheme/createSpacing.js +14 -0
- package/styles/theme/createTheme/index.d.ts +19 -0
- package/styles/theme/createTheme/index.js +5 -0
- package/styles/theme/createTheme/transitions.d.ts +100 -0
- package/styles/theme/createTheme/transitions.js +26 -0
- package/styles/theme/createTheme/zIndex.d.ts +12 -0
- package/styles/theme/createTheme/zIndex.js +3 -0
- package/styles/theme/hooks/index.d.ts +4 -0
- package/styles/theme/hooks/index.js +1 -0
- package/styles/theme/hooks/useActiveBreakpoint.d.ts +18 -0
- package/styles/theme/hooks/useActiveBreakpoint.js +4 -0
- package/styles/theme/hooks/useMediaQuery.d.ts +33 -0
- package/styles/theme/hooks/useMediaQuery.js +20 -0
- package/styles/theme/hooks/useResponsiveValue.d.ts +27 -0
- package/styles/theme/hooks/useResponsiveValue.js +4 -0
- package/styles/theme/hooks/useTheme.d.ts +8 -0
- package/styles/theme/hooks/useTheme.js +4 -0
- package/styles/theme/index.d.ts +8 -0
- package/styles/theme/index.js +1 -0
- package/styles/theme/providers/ActiveBreakpointProvider.d.ts +21 -0
- package/styles/theme/providers/ActiveBreakpointProvider.js +13 -0
- package/styles/theme/providers/ThemeProvider.d.ts +18 -0
- package/styles/theme/providers/ThemeProvider.js +7 -0
- package/styles/tss/index.js +3 -0
- package/tracking/action-creators/cookieConsent.js +2 -2
- package/tracking/actions/cookieConsent.js +17 -5
- package/tracking/components/CookieConsentModal/connector.js +3 -5
- package/tracking/components/CookieConsentModal/index.js +3 -6
- package/tracking/components/CookieConsentModal/tracking-opt-in.svg +14 -14
- package/tracking/components/PrivacySettings/connector.js +3 -5
- package/tracking/components/PrivacySettings/index.js +2 -2
- package/tracking/helpers/index.js +1 -0
- package/tracking/selectors/cookieConsent.js +11 -6
- package/tracking/streams/cookieConsent.js +10 -3
- package/tracking/subscriptions/analytics.js +5 -4
- package/tracking/subscriptions/cookieConsent.js +6 -10
- package/types.js +0 -0
- package/user/index.js +2 -2
- package/user/selectors/data.js +10 -0
- package/components/MessageBar/spec.js +0 -1
- package/components/MessageBar/style.js +0 -2
- package/favorites/constants/constants.js +0 -1
- package/product/components/Characteristics/Characteristic/components/VariantAvailability/connector.js +0 -9
- package/product/components/Characteristics/Characteristic/components/VariantAvailability/index.js +0 -5
- package/product/components/QuantityPicker/helpers.js +0 -5
- /package/product/components/{Characteristics/Characteristic/components/VariantAvailability/style.js → ProductVariants/VariantAvailability.style.js} +0 -0
- /package/product/{components/ProductProvider → providers/Product}/connector.js +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{hot}from'react-hot-loader/root';import*as React from'react';import StoreListProduct from"./StoreListProduct";import StoreListSearch from"./StoreListSearch";import StoreListLocations from"./StoreListLocations";/**
|
|
2
|
+
* Renders the store list.
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var StoreList=function StoreList(){return React.createElement(React.Fragment,null,React.createElement(StoreListProduct,null),React.createElement(StoreListSearch,null),React.createElement(StoreListLocations,null));};export default hot(StoreList);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{useContext}from'react';import{CardList,SurroundPortals}from'@shopgate/engage/components';import PlaceholderLabel from'@shopgate/pwa-ui-shared/PlaceholderLabel';import{FulfillmentContext}from"../../locations.context";import{StoreContext}from"./Store.context";import{StoreCard}from"./StoreCard";import{stores,storeCard,storeCardPlaceholder}from"./Store.style";import{FULFILLMENT_SHEET_STORE_LIST}from"../../constants/Portals";/**
|
|
2
|
+
* Renders the locations.
|
|
3
|
+
* @returns {JSX.Element}
|
|
4
|
+
*/function StoreListLocations(){var _useContext=useContext(FulfillmentContext),locations=_useContext.locations,isLoading=_useContext.isLoading;if(!isLoading&&(!locations||locations.length===0)){return null;}var showPlaceholder=isLoading&&(!locations||locations.length===0);return React.createElement(SurroundPortals,{portalName:FULFILLMENT_SHEET_STORE_LIST,portalProps:{locations:locations}},React.createElement(CardList,{className:stores},React.createElement(PlaceholderLabel,{className:storeCardPlaceholder,ready:!showPlaceholder},locations.map(function(location){return React.createElement(CardList.Item,{className:storeCard,key:location.code},React.createElement(StoreContext.Provider,{value:location},React.createElement(StoreCard,null)));}))));}export default StoreListLocations;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{useContext}from'react';import{ProductImage}from"../../../product";import{FulfillmentContext}from"../../locations.context";import StoreListProductName from"./StoreListProductName";import StoreListProductInfo from"./StoreListProductInfo";import*as styles from"./StoreListProduct.style";import{SurroundPortals}from"../../../components";import{FULFILLMENT_SHEET_PRODUCT}from"../../constants/Portals";/**
|
|
2
|
+
* Renders the product information of the store list.
|
|
3
|
+
* @returns {JSX.Element}
|
|
4
|
+
*/function StoreListProduct(){var _useContext=useContext(FulfillmentContext),product=_useContext.product;if(!product){return null;}/* eslint-disable jsx-a11y/aria-role */return React.createElement(SurroundPortals,{portalName:FULFILLMENT_SHEET_PRODUCT,portalProps:{product:product}},React.createElement("div",{className:styles.productContainer,role:"text"},React.createElement("div",{className:styles.productContainerInner},React.createElement("div",{className:styles.productImage},React.createElement(ProductImage,{src:product.featuredImageBaseUrl})),React.createElement("div",{className:styles.productContent},React.createElement(StoreListProductName,null),React.createElement(StoreListProductInfo,null)))));/* eslint-enable jsx-a11y/aria-role */}export default StoreListProduct;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeVariables,themeColors}from'@shopgate/pwa-common/helpers/config';export var productContainer=css({padding:"".concat(themeVariables.gap.bigger,"px ").concat(themeVariables.gap.bigger,"px ").concat(themeVariables.gap.small,"px"),boxShadow:"inset 0 1px 0 ".concat(themeColors.shade7)}).toString();export var productContainerInner=css({display:'flex',flexFlow:'row nowrap'}).toString();export var productImage=css({flex:'0 0 auto',width:'2.5rem',height:'2.5rem',background:themeColors.placeholder,marginRight:themeVariables.gap.bigger}).toString();export var productContent=css({flexGrow:1,display:'block'}).toString();export var productName=css({fontSize:'1.25rem',fontWeight:600,marginBottom:themeVariables.gap.small}).toString();export var productInfo=css({alignItems:'flex-end',color:'var(--color-text-high-emphasis)'}).toString();export var productInfoLeft=css({fontSize:'0.875rem',color:themeColors.shade11}).toString();export var priceInfo=css({color:"var(--color-primary, ".concat(themeColors.primary,")"),flexGrow:0,textAlign:'right',wordBreak:'break-word',' > ul ':{flexDirection:'column-reverse'}}).toString();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{useContext}from'react';import{Grid,ProductProperties}from'@shopgate/engage/components';import{ProductGridPrice}from"../../../product";import{FulfillmentContext}from"../../locations.context";import{productInfo,productInfoLeft,priceInfo}from"./StoreListProduct.style";/**
|
|
2
|
+
* Renders the product information of the store list.
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/function StoreListProductInfo(){var _useContext=useContext(FulfillmentContext),product=_useContext.product;if(!product){return null;}var characteristics=product.characteristics;return React.createElement(Grid,{className:productInfo},React.createElement(Grid.Item,{grow:1,className:productInfoLeft},characteristics&&React.createElement(ProductProperties,{properties:characteristics})),React.createElement(Grid.Item,{shrink:0,className:priceInfo},React.createElement(ProductGridPrice,{product:product})));}export default StoreListProductInfo;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{useContext}from'react';import{Ellipsis}from"../../../components";import{FulfillmentContext}from"../../locations.context";import{productName}from"./StoreListProduct.style";/**
|
|
2
|
+
* Renders the product's name.
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/function StoreListProductName(){var _useContext=useContext(FulfillmentContext),baseProduct=_useContext.baseProduct;if(!baseProduct){return null;}return React.createElement("div",{className:productName},React.createElement(Ellipsis,null,React.createElement("span",{dangerouslySetInnerHTML:{__html:baseProduct.name}})));}export default StoreListProductName;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{getUserSearchPostalCode,getUserSearchCountryCode}from"../../selectors";import{setUserSearchPostalCode,setUserSearchCountryCode}from"../../action-creators";import{setUserSearchGeolocation}from"../../actions";/**
|
|
2
|
+
* @returns {Function}
|
|
3
|
+
*/function makeMapStateToProps(){/**
|
|
4
|
+
* @param {Object} state The application state.
|
|
5
|
+
* @param {Object} props The component props.
|
|
6
|
+
* @returns {Object}
|
|
7
|
+
*/return function(state){return{postalCode:getUserSearchPostalCode(state),countryCode:getUserSearchCountryCode(state)};};}var mapDispatchToProps={setPostalCode:setUserSearchPostalCode,setCountryCode:setUserSearchCountryCode,setGeolocation:setUserSearchGeolocation};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{memo,useCallback,useContext,useEffect,useLayoutEffect,useRef,useState}from'react';import PropTypes from'prop-types';import{i18n}from'@shopgate/engage/core';import{InfoIcon,LocatorIcon,MagnifierIcon,MessageBar,SurroundPortals}from'@shopgate/engage/components';import{useCountriesNames}from'@shopgate/engage/i18n';import StoreListSearchRadius from"./StoreListSearchRadius";import{FulfillmentContext,StoreFinderContext}from"../../locations.context";import connect from"./StoreListSearch.connector";import{container,countriesCell,inputCell,radiusCell,inputIcon,iconClass,input,inputContainer,select,selectContainer}from"./StoreListSearch.style";import{FULFILLMENT_SHEET_SEARCH}from"../../constants/Portals";/**
|
|
2
|
+
* @param {Function} getProductLocations getProductLocations.
|
|
3
|
+
* @param {Function} storeSearch .
|
|
4
|
+
* @param {Object} search .
|
|
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,_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
|
+
setMessage('locations.error_no_store_found');}else{setMessage('');}},[isLoading,locations,message]);/**
|
|
8
|
+
* Triggers an update when the value of the country selector changed.
|
|
9
|
+
* @param {SyntheticEvent} event A React event object.
|
|
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]);/**
|
|
13
|
+
* Blurs the postal code input to trigger an update.
|
|
14
|
+
* @param {SyntheticEvent} event A React event object.
|
|
15
|
+
*/var handlePostalCodeSubmitKeyDown=useCallback(function(event){if(event.keyCode===13){inputEl.current.blur();}},[]);/**
|
|
16
|
+
* Triggers an update when the input blurs.
|
|
17
|
+
*/var handlePostalCodeBlur=useCallback(function(){setPostalCode(inputPostalCode,productId,isStoreFinder);},[inputPostalCode,isStoreFinder,productId,setPostalCode]);/**
|
|
18
|
+
* Triggers an update when the locate me button was pressed. Also clears the local state for the
|
|
19
|
+
* postal code input.
|
|
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]);/**
|
|
21
|
+
* Updates the local state for the postal code input.
|
|
22
|
+
* @param {SyntheticEvent} event A React event object
|
|
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'),"aria-label":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));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeColors,themeVariables}from'@shopgate/pwa-common/helpers/config';export var container=css({padding:'0 12px 8px 12px',background:themeColors.light,display:'grid',gridTemplateColumns:'auto 1fr',gridTemplateRows:'auto',gridTemplateAreas:"\n \"countries input\"\n \"radius radius\"\n "});export var countriesCell=css({gridArea:'countries',maxWidth:160,paddingRight:themeVariables.gap.small});export var inputCell=css({gridArea:'input'});export var radiusCell=css({gridArea:'radius',':not(:empty)':{height:38,marginTop:themeVariables.gap.small}});export var selectContainer=css({position:'relative',display:'flex',alignItems:'stretch',height:'100%','&:after':{zIndex:2,content:'""',position:'absolute',display:'block',top:'50%',right:themeVariables.gap.small*1.5,transform:'translate3d(0, -25%, 0)',width:5,height:5,border:'5px solid transparent',borderTopColor:themeColors.shade6}});export var select=css({appearance:'none',border:"1px solid ".concat(themeColors.shade7),padding:"0 ".concat(themeVariables.gap.bigger+themeVariables.gap.small*1.5,"px 0 ").concat(themeVariables.gap.big*0.75,"px"),color:themeColors.shade11,fontSize:'1rem',borderRadius:4,width:'100%',outline:0});export var inputContainer=css({background:themeColors.light,border:"1px solid ".concat(themeColors.shade7),borderRadius:4,display:'flex',alignItems:'center',width:'100%'});export var input=css({margin:'3px 0',width:'100%',lineHeight:'28px',outline:'none',verticalAlign:'middle',WebkitAppearance:'none'});export var inputIcon=css({padding:0,margin:'0 8px',color:themeColors.shade9,fontSize:'1.23rem',flexShrink:0,outline:0});export var iconClass=css({fontSize:'1.25rem !important'}).toString();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{makeGetDefaultUnitSystem}from'@shopgate/engage/core/config/config.selectors';import{getStoreFinderSearchRadius}from"../../selectors";import{setStoreFinderSearchRadius}from"../../action-creators";/**
|
|
2
|
+
* @returns {Function}
|
|
3
|
+
*/function makeMapStateToProps(){var getDefaultUnitSystem=makeGetDefaultUnitSystem();/**
|
|
4
|
+
* @param {Object} state The application state.
|
|
5
|
+
* @param {Object} props The component props.
|
|
6
|
+
* @returns {Object}
|
|
7
|
+
*/return function(state){return{radius:getStoreFinderSearchRadius(state),unitSystem:getDefaultUnitSystem(state)};};}var mapDispatchToProps={setRadius:setStoreFinderSearchRadius};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useCallback,useMemo}from'react';import PropTypes from'prop-types';import{i18n}from'@shopgate/engage/core';import{option}from"./StoreListSearchRadius.style";import{selectContainer,select}from"./StoreListSearch.style";import connector from"./StoreListSearchRadius.connector";/**
|
|
2
|
+
* @param {Object} props The component props
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var StoreListSearchRadius=function StoreListSearchRadius(_ref){var radius=_ref.radius,unitSystem=_ref.unitSystem,setRadius=_ref.setRadius;var _useState=useState(radius),_useState2=_slicedToArray(_useState,2),searchRadius=_useState2[0],setSearchRadius=_useState2[1];var handleRadiusChange=useCallback(function(event){var value=parseInt(event.target.value,10)||null;setSearchRadius(value);setRadius(value);},[setRadius]);var options=useMemo(function(){var values;var placeholder;if(unitSystem==='metric'){values=[5,10,25,50,100];placeholder='locations.radius_km';}else{values=[10,25,50,100];placeholder='locations.radius_mi';}var result=values.map(function(value){return{value:value,label:i18n.text(placeholder,{radius:value})};});return[{value:'',label:i18n.text('locations.radius')}].concat(result);},[unitSystem]);return React.createElement("div",{className:selectContainer},React.createElement("select",{name:"store_list_search_radius",value:searchRadius||'',className:select,onChange:handleRadiusChange},options.map(function(_ref2){var value=_ref2.value,label=_ref2.label;return React.createElement("option",{className:option,value:value,key:label},label);})));};StoreListSearchRadius.defaultProps={radius:null,unitSystem:null};export default connector(StoreListSearchRadius);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';export var select=css({});export var option=css({});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _isEmpty from"lodash/isEmpty";import _every from"lodash/every";import React from'react';import PropTypes from'prop-types';import{getWeekDaysOrder}from'@shopgate/engage/core';import{I18n,TimeIcon}from'@shopgate/engage/components';import{StoreDetailsLine}from"./StoreDetailsLine";import{StoreOpeningHoursLine}from"./StoreOpeningHoursLine";import{openingHours,detailsSecondary}from"./Store.style";/**
|
|
2
|
+
* Renders the store's opening hours.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @param {Object} props.hours The store's opening hours.
|
|
5
|
+
* @param {boolean} props.pure Whether to render the opening hours without any wrapper components
|
|
6
|
+
* @returns {JSX.Element}
|
|
7
|
+
*/export function StoreOpeningHours(_ref){var hours=_ref.hours,pure=_ref.pure;if(!hours||_every(hours,_isEmpty)){return null;}var storeHours=React.createElement("div",{className:openingHours},React.createElement("table",null,React.createElement("tbody",null,getWeekDaysOrder().map(function(weekDay){return React.createElement(StoreOpeningHoursLine,{hours:hours[weekDay],day:weekDay,key:weekDay});}))));if(pure){return storeHours;}return React.createElement(StoreDetailsLine,{icon:TimeIcon},React.createElement(I18n.Text,{string:"locations.hours_details",className:detailsSecondary}),storeHours);}StoreOpeningHours.defaultProps={hours:null,pure:false};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{i18n}from"../../../core";import{openingHoursRow,openingHoursDay}from"./Store.style";/**
|
|
2
|
+
* Renders a single opening hours line.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @param {string} props.day The day.
|
|
5
|
+
* @param {string} props.hours The hours line.
|
|
6
|
+
* @returns {JSX.Element}
|
|
7
|
+
*/export function StoreOpeningHoursLine(_ref){var day=_ref.day,hours=_ref.hours;if(!hours||hours===''){return null;}return React.createElement("tr",{className:openingHoursRow,"aria-label":"".concat(i18n.text("locations.".concat(day)),": ").concat(hours),tabIndex:0,role:"row"},React.createElement("td",{className:openingHoursDay,"aria-hidden":true},i18n.text("locations.".concat(day))),React.createElement("td",{"aria-hidden":true},hours));}StoreOpeningHoursLine.defaultProps={hours:null};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{I18n,PhoneIcon}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{StoreDetailsLine}from"./StoreDetailsLine";import{detailsPrimary,detailsSecondary}from"./Store.style";/**
|
|
2
|
+
* Renders the store's phone number.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @param {string} props.phone The store's phone number.
|
|
5
|
+
* @returns {JSX.Element}
|
|
6
|
+
*/export function StorePhoneNumber(_ref){var phone=_ref.phone;if(!phone){return null;}return React.createElement("a",{href:"tel:".concat(phone),"aria-label":"".concat(i18n.text('locations.phone'),": ").concat(phone),tabIndex:0},React.createElement(StoreDetailsLine,{icon:PhoneIcon,linked:true},React.createElement("div",{className:detailsPrimary,"aria-hidden":true},phone),React.createElement(I18n.Text,{string:"locations.phone",className:detailsSecondary,"aria-hidden":true})));}StorePhoneNumber.defaultProps={phone:null};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{useContext,useCallback}from'react';import{RippleButton}from'@shopgate/engage/components';import PropTypes from'prop-types';import{isProductAvailable}from"../../helpers";import{StoreContext}from"./Store.context";import{i18n,useWidgetSettings}from"../../../core";import{FulfillmentContext}from"../../locations.context";import{selectLocationButton,selectLocationButtonWrapper}from"./Store.style";import connect from"./StoreListSearch.connector";/**
|
|
2
|
+
* The StoreSelectLocationButton component.
|
|
3
|
+
* @returns {JSX.Element}
|
|
4
|
+
*/var StoreSelectLocationButton=function StoreSelectLocationButton(_ref){var setPostalCode=_ref.setPostalCode;var store=useContext(StoreContext);var _ref2=useWidgetSettings('@shopgate/engage/locations')||{},_ref2$setUserSearchZi=_ref2.setUserSearchZipLocationFromSelection,setUserSearchZipLocationFromSelection=_ref2$setUserSearchZi===void 0?true:_ref2$setUserSearchZi;var _useContext=useContext(FulfillmentContext),selectLocation=_useContext.selectLocation,noInventory=_useContext.noInventory,isLoading=_useContext.isLoading,product=_useContext.product;var isAvailable=isProductAvailable(store,store===null||store===void 0?void 0:store.inventory);var handleClick=useCallback(function(e){e.stopPropagation();if(noInventory||isAvailable){if(setUserSearchZipLocationFromSelection){setPostalCode(store.address.postalCode,product===null||product===void 0?void 0:product.id);}selectLocation(store);}},[isAvailable,noInventory,product,selectLocation,setPostalCode,setUserSearchZipLocationFromSelection,store]);return React.createElement("div",{className:selectLocationButtonWrapper},React.createElement(RippleButton,{onClick:handleClick,className:selectLocationButton.toString(),disabled:isLoading||(store===null||store===void 0?void 0:store.isComingSoon)||!noInventory&&!isAvailable},i18n.text((store===null||store===void 0?void 0:store.isComingSoon)?'location.comingSoon':'locations.select_location')));};var connectedStoreSelectLocationButton=connect(StoreSelectLocationButton);export{connectedStoreSelectLocationButton as StoreSelectLocationButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as StoreList}from"./StoreList";export{StoreAddress}from"./StoreAddress";export{StoreOpeningHours}from"./StoreOpeningHours";export{StorePhoneNumber}from"./StorePhoneNumber";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{FulfillmentSelector}from"./FulfillmentSelector";export{FulfillmentSheet}from"./FulfillmentSheet";export{FulfillmentPathSelector}from"./FulfillmentPathSelector";export{StoreList,StoreOpeningHours,StorePhoneNumber,StoreAddress}from"./StoreList";export{CartItemProductChangeLocation,CartChangeFulfillmentMethod,CartContextMenuItemChangeLocation,CartContextMenuItemChangeFulfillment,CartContextMenuChangeFulfillment}from"./Cart";export{GlobalLocationSelector}from"./GlobalLocationSelector";export{GlobalLocationSwitcher}from"./GlobalLocationSwitcher";export{FulfillmentSlotSwitcher}from"./FulfillmentSlotSwitcher";export{StoreFinder}from"./StoreFinder";export{StockInfo}from"./StockInfo";export{default as StockInfoLists}from"./StockInfoLists";export{default as StoreDetails}from"./StoreDetails";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// USER
|
|
2
|
+
export var SELECT_LOCATION='SELECT_LOCATION';export var SELECT_GLOBAL_LOCATION='SELECT_GLOBAL_LOCATION';export var STORE_FORM_INPUT='STORE_FORM_INPUT';export var STORE_FULFILLMENT_METHOD='STORE_FULFILLMENT_METHOD';export var SET_USER_SEARCH_COUNTRY_CODE='SET_USER_SEARCH_COUNTRY_CODE';export var SET_USER_SEARCH_POSTAL_CODE='SET_USER_SEARCH_POSTAL_CODE';export var SET_USER_SEARCH_GEOLOCATION='SET_USER_SEARCH_GEOLOCATION';export var SET_USER_GEOLOCATION='SET_USER_GEOLOCATION';export var SET_STORE_FINDER_SEARCH_RADIUS='SET_STORE_FINDER_SEARCH_RADIUS';export var SET_LOCATIONS_PENDING='SET_LOCATIONS_PENDING';// LOCATIONS
|
|
3
|
+
export var REQUEST_LOCATIONS='REQUEST_LOCATIONS';export var RECEIVE_LOCATIONS='RECEIVE_LOCATIONS';export var ERROR_LOCATIONS='ERROR_LOCATIONS';export var PROVIDE_PRODUCT_ALTERNATIVE_LOCATION='PROVIDE_PRODUCT_ALTERNATIVE_LOCATION';// PRODUCT LOCATIONS
|
|
4
|
+
export var REQUEST_PRODUCT_LOCATIONS='REQUEST_PRODUCT_LOCATIONS';export var RECEIVE_PRODUCT_LOCATIONS='RECEIVE_PRODUCT_LOCATIONS';export var ERROR_PRODUCT_LOCATIONS='ERROR_PRODUCT_LOCATIONS';// Does not belong here.
|
|
5
|
+
// TODO: Put into a 'fulfillment' domain in engage package.
|
|
6
|
+
// PRODUCT INVENTORIES
|
|
7
|
+
export var REQUEST_PRODUCT_INVENTORIES='REQUEST_PRODUCT_INVENTORIES';export var RECEIVE_PRODUCT_INVENTORIES='RECEIVE_PRODUCT_INVENTORIES';export var ERROR_PRODUCT_INVENTORIES='ERROR_PRODUCT_INVENTORIES';// PRODUCTS INVENTORIES
|
|
8
|
+
export var REQUEST_INVENTORIES='REQUEST_INVENTORIES';export var RECEIVE_INVENTORIES='RECEIVE_INVENTORIES';export var ERROR_INVENTORIES='ERROR_INVENTORIES';// SUBMIT RESERVATION
|
|
9
|
+
export var SUBMIT_RESERVATION_REQUEST='SUBMIT_RESERVATION_REQUEST';export var SUBMIT_RESERVATION_SUCCESS='SUBMIT_RESERVATION_SUCCESS';export var SUBMIT_RESERVATION_ERROR='SUBMIT_RESERVATION_ERROR';// FULFILLMENT SLOTS
|
|
10
|
+
export var FETCH_FULFILLMENT_SLOTS_SUCCESS='FETCH_FULFILLMENT_SLOTS_SUCCESS';export var FETCH_FULFILLMENT_SLOTS_ERROR='FETCH_FULFILLMENT_SLOTS_ERROR';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var SHOPGATE_STOREFRONT_GET_LOCATIONS='shopgate.storefront.getLocations';export var SHOPGATE_STOREFRONT_GET_PRODUCT_LOCATIONS='shopgate.storefront.getProductLocations';export var SHOPGATE_STOREFRONT_GET_PRODUCT_INVENTORIES='shopgate.storefront.getProductInventories';export var SHOPGATE_STOREFRONT_GET_INVENTORIES='shopgate.storefront.getInventories';export var SHOPGATE_STOREFRONT_CREATE_ORDER='shopgate.storefront.createOrders';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{PRODUCT}from'@shopgate/pwa-common-commerce/product/constants/Portals';import{PRODUCT_ITEM}from'@shopgate/pwa-common-commerce/category/constants/Portals';// CONTENTS
|
|
2
|
+
var FULFILLMENT_SELECTOR='fulfillment-selector';var LOCATION_STOCK_INFO='location-stock-info';var SEARCH='search';var STORE_LIST='store_list';var ALTERNATIVE='alternative';var CHANGE='change';var LOCATION='location';var STORE_DETAILS='store-details';/* PRODUCT DETAILS */export var PRODUCT_FULFILLMENT_SELECTOR="".concat(PRODUCT,".").concat(FULFILLMENT_SELECTOR);export var PRODUCT_FULFILLMENT_SELECTOR_LOCATION="".concat(PRODUCT,".").concat(FULFILLMENT_SELECTOR,".").concat(LOCATION);export var PRODUCT_FULFILLMENT_CHANGE_LOCATION="".concat(PRODUCT,".").concat(FULFILLMENT_SELECTOR,".").concat(CHANGE,".").concat(LOCATION);export var PRODUCT_FULFILLMENT_SELECTOR_ALTERNATIVE_LOCATION="".concat(PRODUCT,".").concat(FULFILLMENT_SELECTOR,".").concat(ALTERNATIVE,".").concat(LOCATION);export var PRODUCT_LOCATION_STOCK_INFO="".concat(PRODUCT,".").concat(LOCATION_STOCK_INFO);/* PRODUCT LISTS */export var PRODUCT_LOCATION_STOCK_INFO_LIST="".concat(PRODUCT_ITEM,".").concat(LOCATION_STOCK_INFO);/* FULFILLMENT SHEET */export var FULFILLMENT_SHEET='fulfillment-sheet';export var FULFILLMENT_SHEET_PRODUCT="".concat(FULFILLMENT_SHEET,".").concat(PRODUCT);export var FULFILLMENT_SHEET_SEARCH="".concat(FULFILLMENT_SHEET,".").concat(SEARCH);export var FULFILLMENT_SHEET_STORE_LIST="".concat(FULFILLMENT_SHEET,".").concat(STORE_LIST);/* STORE DETAILS */export var STORE_DETAILS_LOCATION_MAP="".concat(STORE_DETAILS,".location-map");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var STAGE_SELECT_STORE='select-store';export var STAGE_RESERVE_FORM='reserve-form';export var STAGE_RESPONSE_SUCCESS='response-success';export var STAGE_RESPONSE_ERROR='response-error';export var STAGE_FULFILLMENT_METHOD='fulfillment-method';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// ACTION TYPES
|
|
2
|
+
export{REQUEST_LOCATIONS,RECEIVE_LOCATIONS,ERROR_LOCATIONS,REQUEST_PRODUCT_INVENTORIES,RECEIVE_PRODUCT_INVENTORIES,ERROR_PRODUCT_INVENTORIES,REQUEST_INVENTORIES,RECEIVE_INVENTORIES,ERROR_INVENTORIES,SELECT_LOCATION,SELECT_GLOBAL_LOCATION,STORE_FORM_INPUT,STORE_FULFILLMENT_METHOD,SET_USER_SEARCH_COUNTRY_CODE,SET_USER_SEARCH_POSTAL_CODE,SET_USER_SEARCH_GEOLOCATION,SET_USER_GEOLOCATION,SET_STORE_FINDER_SEARCH_RADIUS,REQUEST_PRODUCT_LOCATIONS,RECEIVE_PRODUCT_LOCATIONS,ERROR_PRODUCT_LOCATIONS,SUBMIT_RESERVATION_REQUEST,SUBMIT_RESERVATION_SUCCESS,SUBMIT_RESERVATION_ERROR,FETCH_FULFILLMENT_SLOTS_ERROR,FETCH_FULFILLMENT_SLOTS_SUCCESS,PROVIDE_PRODUCT_ALTERNATIVE_LOCATION}from"./ActionTypes";// PIPELINES
|
|
3
|
+
export{SHOPGATE_STOREFRONT_GET_PRODUCT_LOCATIONS,SHOPGATE_STOREFRONT_CREATE_ORDER,SHOPGATE_STOREFRONT_GET_LOCATIONS,SHOPGATE_STOREFRONT_GET_PRODUCT_INVENTORIES,SHOPGATE_STOREFRONT_GET_INVENTORIES}from"./Pipelines";// PORTALS
|
|
4
|
+
export{PRODUCT_FULFILLMENT_SELECTOR,PRODUCT_LOCATION_STOCK_INFO}from"./Portals";export var DIRECT_SHIP='directShip';export var DIRECT_SHIP_LABEL='locations.fulfillment.direct_ship';export var IN_STORE_PICKUP_BOPIS='inStorePickupBOPIS';export var IN_STORE_PICKUP_BOPIS_LABEL='locations.fulfillment.bopis';export var IN_STORE_PICKUP_ROPIS='inStorePickupROPIS';export var IN_STORE_PICKUP_ROPIS_LABEL='locations.fulfillment.ropis';export var ROPIS='ROPIS';export var BOPIS='BOPIS';export var QUICK_RESERVE='quickReserve';export var MULTI_LINE_RESERVE='multiLineReserve';export var SORT_CLOSEST_LOCATION='closestLocation';export var SORT_CLOSEST_LOCATION_WITH_INVENTORY='closestLocationWithInventory';export var DEFAULT_ROPE_FULFILLMENT_METHOD='defaultRopeFulfillmentMethod';export var USER_SEARCH_GEOLOCATION_LIFETIME=3e5;// 5 minutes for geolocation expire
|
|
5
|
+
export var NEARBY_LOCATIONS_LIMIT=8;// 25 miles in km
|
|
6
|
+
export var NEARBY_LOCATIONS_RADIUS=25*1.60934;// 10 miles in km
|
|
7
|
+
export var MAP_RADIUS_KM=10*1.60934;export{STAGE_SELECT_STORE,STAGE_RESERVE_FORM,STAGE_RESPONSE_SUCCESS,STAGE_RESPONSE_ERROR,STAGE_FULFILLMENT_METHOD}from"./Stages";export{STORE_FINDER_PATTERN,STORE_DETAILS_PATTERN,STORE_DETAILS_PATH}from"./routes";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var STORE_FINDER_PATTERN='/storefinder';export var STORE_DETAILS_PATH='/store-details';export var STORE_DETAILS_PATTERN='/store-details/:code';
|
|
@@ -0,0 +1,28 @@
|
|
|
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 snakeCase from'lodash/snakeCase';import{makeGetMerchantSettings,i18n,getPlatform,getUserAgent}from'@shopgate/engage/core';import appConfig from'@shopgate/pwa-common/helpers/config';import{getCurrency,getCartItems,getSubTotal,getGrandTotal}from'@shopgate/pwa-common-commerce/cart/selectors';import{getProductDataById}from'@shopgate/engage/product/selectors/product';import{getPreferredLocation,getExternalCustomerNumberForOrder}from"../selectors";import{ROPIS}from"../constants";/**
|
|
2
|
+
* Creates the address sequence.
|
|
3
|
+
* @param {Object} formValues The reserve form values.
|
|
4
|
+
* @param {Function} getState The redux getState function.
|
|
5
|
+
* @returns {Array}
|
|
6
|
+
*/function createAddressSequence(formValues,getState){var _makeGetMerchantSetti=makeGetMerchantSettings()(getState()),_makeGetMerchantSetti2=_makeGetMerchantSetti.country,country=_makeGetMerchantSetti2===void 0?appConfig.marketId:_makeGetMerchantSetti2;return[{type:'billing',firstName:formValues.firstName,lastName:formValues.lastName,phone:formValues.cellPhone,emailAddress:formValues.email,country:country},{type:'pickup',firstName:formValues.firstName2,lastName:formValues.lastName2,phone:formValues.cellPhone2,emailAddress:formValues.email2,country:country}];}/**
|
|
7
|
+
* Retrieves the featured image for a product. If the product doesn't have a featured image
|
|
8
|
+
* and is a child product, the featured image of the base product is retrieved.
|
|
9
|
+
* @param {Object} product The current product.
|
|
10
|
+
* @param {Function} getState The redux getState function.
|
|
11
|
+
* @returns {string}
|
|
12
|
+
*/function getProductImage(product,getState){var image=product.featuredImageBaseUrl||product.featuredImageUrl;if(!image&&product.baseProductId){var baseProduct=getProductDataById(getState(),{productId:product.id});if(baseProduct){image=product.featuredImageBaseUrl||baseProduct.featuredImageUrl;}}return image;}/**
|
|
13
|
+
* Creates a single order line item (from quick reserve).
|
|
14
|
+
* @param {Object} product The current product.
|
|
15
|
+
* @param {Function} getState The redux getState function.
|
|
16
|
+
* @returns {Array}
|
|
17
|
+
*/function createSingleProductItems(product,getState){var location=getPreferredLocation(getState());return[{code:product.id,quantity:1,fulfillmentMethod:ROPIS,fulfillmentLocationCode:location.code,price:product.price.unitPrice,shipToAddressSequenceIndex:1,currencyCode:product.price.currency,product:_extends({code:product.id,name:product.name,image:getProductImage(product,getState),price:product.price.unitPrice,currencyCode:product.price.currency},product.characteristics&&{options:product.characteristics.map(function(characteristic){return{code:String(characteristic.id),name:characteristic.label,value:{code:snakeCase(characteristic.value),name:characteristic.value}};})})}];}/**
|
|
18
|
+
* Creates the order line items.
|
|
19
|
+
* @param {Function} getState The redux getState function.
|
|
20
|
+
* @returns {Object[]}
|
|
21
|
+
*/function createCartLineItems(getState){var items=getCartItems(getState());var currencyCode=getCurrency(getState());return items.map(function(item){return{code:item.id,quantity:item.quantity,fulfillmentMethod:item.fulfillment.method,fulfillmentLocationCode:item.fulfillment.location.code,price:item.product.price["default"],shipToAddressSequenceIndex:1,currencyCode:currencyCode,product:_extends({code:item.product.id,name:item.product.name,image:item.product.featuredImageBaseUrl||item.product.featuredImageUrl,price:item.product.price.unit,currencyCode:currencyCode},item.product.properties&&{options:item.product.properties.map(function(prop){return{code:snakeCase(prop.label),name:prop.label,value:{code:snakeCase(prop.value),name:prop.value}};})})};});}/**
|
|
22
|
+
* Creates a fulfillment order out of the reserve form values and the current product or the cart.
|
|
23
|
+
* @param {Object} formValues The reserve form values.
|
|
24
|
+
* @param {Object} product The current product.
|
|
25
|
+
* @param {Function} getState The redux getState function.
|
|
26
|
+
* @returns {Object}
|
|
27
|
+
*/function createOrder(formValues,product,getState){var state=getState();var userAgent=getUserAgent();var platform='engage';var os=getPlatform(state);var externalCustomerNumber=getExternalCustomerNumberForOrder(state);// If no individual product was submitted, we handle the cart.
|
|
28
|
+
if(product===null){var grandTotal=getGrandTotal(state);return{localeCode:i18n.getLang().toLowerCase(),currencyCode:getCurrency(state),addressSequences:createAddressSequence(formValues,getState),primaryBillToAddressSequenceIndex:0,primaryShipToAddressSequenceIndex:1,lineItems:createCartLineItems(getState),subTotal:getSubTotal(state)||grandTotal,total:grandTotal,externalCustomerNumber:externalCustomerNumber,userAgent:userAgent,platform:platform,os:os};}return{localeCode:i18n.getLang().toLowerCase(),currencyCode:product.price.currency,addressSequences:createAddressSequence(formValues,getState),primaryBillToAddressSequenceIndex:0,primaryShipToAddressSequenceIndex:1,lineItems:createSingleProductItems(product,getState),subTotal:product.price.unitPrice,total:product.price.unitPrice,externalCustomerNumber:externalCustomerNumber,userAgent:userAgent,platform:platform,os:os};}export default createOrder;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{i18n}from'@shopgate/engage/core';/**
|
|
2
|
+
* Formats a numeric distance value.
|
|
3
|
+
* @param {number} distance The original distance
|
|
4
|
+
* @param {boolean} [imperial=false] Whether the original distance is imperial or metric
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/var formatDistance=function formatDistance(distance){var imperial=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var distanceAltered=distance;var precision=0;var unit;if(imperial===true){unit='mi';// 0.094 mi === 500 ft
|
|
7
|
+
if(distance<=0.094){unit='ft';distanceAltered=distance*5280;}else if(distance<100){precision=1;}}else{unit='km';if(distance<1){unit='m';distanceAltered=distance*1000;}else if(distance>=1&&distance<100){precision=1;}}// Round small distances down to next 10
|
|
8
|
+
if(['m','ft'].includes(unit)){distanceAltered=Math.floor(distanceAltered/10)*10;}// Remove trailing zeros
|
|
9
|
+
if(distanceAltered%1===0){precision=0;}return i18n.text('formats.distance.pattern',{distance:i18n.number(distanceAltered,precision),unit:i18n.text("formats.distance.units.".concat(unit))});};export default formatDistance;
|
|
@@ -0,0 +1,12 @@
|
|
|
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{availabilityTypes,AVAILABILITY_TYPE_NOT_AVAILABLE,AVAILABILITY_TYPE_AVAILABLE,AVAILABILITY_TYPE_COMING_SOON}from"../../product/constants";/**
|
|
2
|
+
* Takes the location stock info settings and finds the matching settings for the given inventory.
|
|
3
|
+
* @param {Object} settings The settings find a match in.
|
|
4
|
+
* @param {Object|null} location The location object.
|
|
5
|
+
* @param {Object|null} productInventory The product inventory.
|
|
6
|
+
* @returns {Object}
|
|
7
|
+
*/export default(function(settings,location,productInventory){if(location===null||location===void 0?void 0:location.isComingSoon){return settings[AVAILABILITY_TYPE_COMING_SOON];}if(!productInventory){return{};}var _productInventory$isA=productInventory.isAvailable,isAvailable=_productInventory$isA===void 0?false:_productInventory$isA,_productInventory$vis=productInventory.visible,visible=_productInventory$vis===void 0?0:_productInventory$vis;if(isAvailable===false){return settings[AVAILABILITY_TYPE_NOT_AVAILABLE];}if(visible===null){return _extends({},settings[AVAILABILITY_TYPE_AVAILABLE],{availabilityText:'locations.stock_info.available'});}// Filter by inventory blind and visible inventory (must match both).
|
|
8
|
+
var matchingTypes=availabilityTypes.filter(function(type){return!settings[type].comingSoon;}).filter(function(type){return(// When inventory blind is set in the current availability setting, then this should also
|
|
9
|
+
// account for the inventory blind from the given store. Ignore inventory blind otherwise.
|
|
10
|
+
!settings[type].includeInventoryBlind||settings[type].includeInventoryBlind&&!!visible);}).filter(function(type){return(// Don't filter, when inventoryBlind filter is already active
|
|
11
|
+
settings[type].includeInventoryBlind||// Also, inventory must be truthy or 0, or otherwise there is nothing to search for.
|
|
12
|
+
visible>=settings[type].visibleInventoryFrom&&(settings[type].visibleInventoryTo===null||visible<=settings[type].visibleInventoryTo));});if(matchingTypes.length>0){return settings[matchingTypes[0]];}return{};});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as createOrder}from"./createOrder";export{default as getAvailabilitySettings}from"./getAvailabilitySettings";export{isProductAvailable}from"./productInventory";export*from"./showInventoryInLists";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if product inventory is orderable.
|
|
3
|
+
* @param {Object} location The location to check.
|
|
4
|
+
* @param {Object} inventory The location inventory to check.
|
|
5
|
+
* @returns {boolean}
|
|
6
|
+
*/export function isProductAvailable(){var location=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var inventory=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _ref=location||{},isComingSoon=_ref.isComingSoon;var _ref2=inventory||{},_ref2$isAvailable=_ref2.isAvailable,isAvailable=_ref2$isAvailable===void 0?false:_ref2$isAvailable,_ref2$visible=_ref2.visible,visible=_ref2$visible===void 0?0:_ref2$visible;if(isComingSoon){return false;}if(isAvailable===false){return false;}if(visible===null){// Blind mode
|
|
7
|
+
return true;}return visible>0;}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{setABFeatureFlag,isFeatureEnabled}from'@shopgate/engage/core';import appConfig from'@shopgate/pwa-common/helpers/config';import{getProductListShowInventory}from"../../core/selectors";var STORE_KEY='showInventoryInLists.v1';var enabled=null;/**
|
|
2
|
+
* @param {Object} state state
|
|
3
|
+
* @returns {boolean}
|
|
4
|
+
*/export function showInventoryInLists(state){var config=getProductListShowInventory(state);if(!config){return false;}if(enabled===null){var _appConfig$featureFla;// activate feature for x percent of user
|
|
5
|
+
var percentage=(appConfig===null||appConfig===void 0?void 0:(_appConfig$featureFla=appConfig.featureFlagPercentages)===null||_appConfig$featureFla===void 0?void 0:_appConfig$featureFla.showInventoryInLists)||100;enabled=isFeatureEnabled(STORE_KEY,percentage);}return enabled;}/**
|
|
6
|
+
* @param {Object} state state
|
|
7
|
+
*/export function setShowInventoryInLists(state){var config=getProductListShowInventory(state);if(!config){return;}setABFeatureFlag(STORE_KEY);}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// ACTIONS
|
|
2
|
+
export{fetchProductLocations}from"./actions";// COMPONENTS
|
|
3
|
+
export{FulfillmentSelector,FulfillmentSheet,FulfillmentPathSelector,StoreList,StoreAddress,StoreOpeningHours,StorePhoneNumber,CartItemProductChangeLocation,CartChangeFulfillmentMethod,CartContextMenuItemChangeLocation,CartContextMenuItemChangeFulfillment,CartContextMenuChangeFulfillment,GlobalLocationSelector,GlobalLocationSwitcher,FulfillmentSlotSwitcher,StoreFinder,StockInfoLists}from"./components";// CONSTANTS
|
|
4
|
+
export{PRODUCT_FULFILLMENT_SELECTOR,PRODUCT_LOCATION_STOCK_INFO,DIRECT_SHIP,DIRECT_SHIP_LABEL,IN_STORE_PICKUP_BOPIS_LABEL,IN_STORE_PICKUP_ROPIS_LABEL,ROPIS,BOPIS,DEFAULT_ROPE_FULFILLMENT_METHOD,QUICK_RESERVE,MULTI_LINE_RESERVE,STAGE_SELECT_STORE,STAGE_RESERVE_FORM,STAGE_RESPONSE_SUCCESS,STAGE_RESPONSE_ERROR,STAGE_FULFILLMENT_METHOD,STORE_FINDER_PATTERN}from"./constants";// SELECTORS
|
|
5
|
+
export*from"./selectors";// STREAMS
|
|
6
|
+
export{submitReservationSuccess$,preferredLocationDidUpdate$,preferredLocationDidUpdateGlobal$,preferredLocationDidUpdateGlobalNotOnCategory$,preferredLocationDidUpdateGlobalOnCategory$,preferredLocationDidUpdateGlobalNotOnSearch$,preferredLocationDidUpdateGlobalOnSearch$}from"./locations.streams";// HOOKS
|
|
7
|
+
export{useFulfillmentState}from"./locations.hooks";// TYPES
|
|
8
|
+
// CONTEXT
|
|
9
|
+
export{FulfillmentContext}from"./locations.context";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from'react';import{STAGE_SELECT_STORE}from"./constants";export var FulfillmentContext=createContext({selectLocation:function selectLocation(){return Promise.resolve();},selectStoreFinderLocation:function selectStoreFinderLocation(){},changeFulfillment:function changeFulfillment(){},sendReservation:function sendReservation(){return Promise.resolve();},isStage:function isStage(){return false;},handleOpen:function handleOpen(){},handleClose:function handleClose(){},setIsLoading:function setIsLoading(){},location:null,storeFinderLocation:null,locations:[],orderNumbers:[],baseProduct:null,product:null,userInput:null,stage:STAGE_SELECT_STORE,title:null,fulfillmentPath:null,fulfillmentMethods:null,enabledFulfillmentMethods:null,shopSettings:null,isOpen:false,errors:null,noLocationSelection:false,isStoreFinder:false,isLoading:false});export var StoreFinderContext=createContext({});
|
|
@@ -0,0 +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,STORE_DETAILS_PATTERN}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});});export var storeDetailPageWillEnter$=routeWillEnter$.filter(function(_ref20){var action=_ref20.action;return action.route.pattern===STORE_DETAILS_PATTERN;});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DIRECT_SHIP,ROPIS,BOPIS,STAGE_SELECT_STORE,STAGE_RESERVE_FORM,STAGE_RESPONSE_SUCCESS,STAGE_RESPONSE_ERROR,QUICK_RESERVE,MULTI_LINE_RESERVE}from"./constants";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{connect}from'react-redux';import _showModal from'@shopgate/pwa-common/actions/modal/showModal';import{getBaseProduct,getProduct}from'@shopgate/pwa-common-commerce/product/selectors/product';import _addProductsToCart from'@shopgate/pwa-common-commerce/cart/actions/addProductsToCart';import _updateProductsInCart from'@shopgate/pwa-common-commerce/cart/actions/updateProductsInCart';import{getCartProducts,getActiveFulfillmentSlot,getActiveFulfillmentSlotLocationCode}from'@shopgate/engage/cart/cart.selectors';import{makeGetFulfillmentPaths,makeGetEnabledFulfillmentMethods,getShopSettings}from'@shopgate/engage/core/config';import{getRestrictMultiLocationOrders,getFulfillmentSchedulingEnabled}from'@shopgate/engage/core';import{selectLocation as _selectLocation,storeFormInput as _storeFormInput}from"../action-creators";import{getFilteredLocations,makeGetLocationInventory,makeGetLocationsForProduct,getPreferredLocation,getUserFormInput,getProductFulfillmentMethods,getIsFetching}from"../selectors";import{submitReservation as _submitReservation}from"../actions";/**
|
|
2
|
+
* @returns {Function}
|
|
3
|
+
*/function makeMapStateToProps(){/* eslint-disable require-jsdoc */var getProductCode=function getProductCode(_,props){return props.variantId||props.productId||null;};/* eslint-enable require-jsdoc */var getInventory=makeGetLocationInventory(function(state,props){var _getPreferredLocation;return((_getPreferredLocation=getPreferredLocation(state,props))===null||_getPreferredLocation===void 0?void 0:_getPreferredLocation.code)||null;},getProductCode);var getProductLocations=makeGetLocationsForProduct(getProductCode);var getFulfillmentPaths=makeGetFulfillmentPaths();var getEnabledFulfillmentMethods=makeGetEnabledFulfillmentMethods();/**
|
|
4
|
+
* @param {Object} state The application state.
|
|
5
|
+
* @param {Object} props The component props.
|
|
6
|
+
* @returns {Object}
|
|
7
|
+
*/return function(state,props){return{locations:props.noProduct?getFilteredLocations(state,props):getProductLocations(state,props),baseProduct:getBaseProduct(state,props),product:getProduct(state,props),location:getPreferredLocation(state,props),inventory:getInventory(state,props),userInput:getUserFormInput(state),fulfillmentPaths:getFulfillmentPaths(state),fulfillmentMethods:getProductFulfillmentMethods(state,props),enabledFulfillmentMethods:getEnabledFulfillmentMethods(state,props),shopSettings:getShopSettings(state),isFetching:getIsFetching(state),restrictMultiLocationOrders:getRestrictMultiLocationOrders(state),cartProducts:getCartProducts(state),fulfillmentSchedulingEnabled:getFulfillmentSchedulingEnabled(state),activeFulfillmentSlot:getActiveFulfillmentSlot(state),activeFulfillmentSlotLocationCode:getActiveFulfillmentSlotLocationCode(state)};};}/**
|
|
8
|
+
* @param {Function} dispatch The dispatch function.
|
|
9
|
+
* @returns {Object}
|
|
10
|
+
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{selectLocation:function selectLocation(){return dispatch(_selectLocation.apply(void 0,arguments));},submitReservation:function submitReservation(){return dispatch(_submitReservation.apply(void 0,arguments));},storeFormInput:function storeFormInput(){return dispatch(_storeFormInput.apply(void 0,arguments));},addProductsToCart:function addProductsToCart(){return dispatch(_addProductsToCart.apply(void 0,arguments));},updateProductsInCart:function updateProductsInCart(){return dispatch(_updateProductsInCart.apply(void 0,arguments));},showModal:function showModal(){return dispatch(_showModal.apply(void 0,arguments));}};};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";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 asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useMemo,useRef,useEffect,useCallback}from'react';import{logger,i18n,UIEvents}from"../../core";import{withCurrentProduct}from"../../core/hocs/withCurrentProduct";import{FulfillmentContext}from"../locations.context";import{FulfillmentPathSelector}from"../components/FulfillmentPathSelector";import{STAGE_SELECT_STORE,STAGE_RESERVE_FORM,STAGE_RESPONSE_SUCCESS,STAGE_RESPONSE_ERROR,STAGE_FULFILLMENT_METHOD,QUICK_RESERVE,MULTI_LINE_RESERVE,DIRECT_SHIP,ROPIS,BOPIS}from"../constants";import connect from"./FulfillmentProvider.connector";export var EVENT_SET_OPEN='FulfillmentProvider.setOpen';var callback;/**
|
|
2
|
+
* Provides the fulfillment context.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/function FulfillmentProvider(props){var children=props.children,locations=props.locations,propsBaseProduct=props.baseProduct,propsProduct=props.product,productLocation=props.location,inventory=props.inventory,userInput=props.userInput,defaultFulfillmentMethod=props.fulfillmentMethod,defaultFulfillmentPath=props.fulfillmentPath,fulfillmentPaths=props.fulfillmentPaths,fulfillmentMethods=props.fulfillmentMethods,enabledFulfillmentMethods=props.enabledFulfillmentMethods,shopSettings=props.shopSettings,selectLocation=props.selectLocation,submitReservation=props.submitReservation,storeFormInput=props.storeFormInput,updateProductsInCart=props.updateProductsInCart,isFetching=props.isFetching,_props$noInventory=props.noInventory,noInventory=_props$noInventory===void 0?false:_props$noInventory,_props$open=props.open,open=_props$open===void 0?false:_props$open,_props$noLocationSele=props.noLocationSelection,noLocationSelection=_props$noLocationSele===void 0?false:_props$noLocationSele,_props$isStoreFinder=props.isStoreFinder,isStoreFinder=_props$isStoreFinder===void 0?false:_props$isStoreFinder,_props$isCart=props.isCart,isCart=_props$isCart===void 0?false:_props$isCart,defaultIsInitialized=props.isInitialized,updatePreferredLocation=props.updatePreferredLocation,_props$restrictMultiL=props.restrictMultiLocationOrders,restrictMultiLocationOrders=_props$restrictMultiL===void 0?false:_props$restrictMultiL,_props$cartProducts=props.cartProducts,cartProducts=_props$cartProducts===void 0?[]:_props$cartProducts,showModal=props.showModal,_props$fulfillmentSch=props.fulfillmentSchedulingEnabled,fulfillmentSchedulingEnabled=_props$fulfillmentSch===void 0?null:_props$fulfillmentSch,_props$activeFulfillm=props.activeFulfillmentSlot,activeFulfillmentSlot=_props$activeFulfillm===void 0?null:_props$activeFulfillm,_props$activeFulfillm2=props.activeFulfillmentSlotLocationCode,activeFulfillmentSlotLocationCode=_props$activeFulfillm2===void 0?null:_props$activeFulfillm2;var _useState=useState(defaultFulfillmentPath||null),_useState2=_slicedToArray(_useState,2),fulfillmentPath=_useState2[0],setFulfillmentPath=_useState2[1];var _useState3=useState(props.changeOnly),_useState4=_slicedToArray(_useState3,2),changeOnly=_useState4[0],setChangeOnly=_useState4[1];var _useState5=useState(open),_useState6=_slicedToArray(_useState5,2),isOpen=_useState6[0],setIsOpen=_useState6[1];var _useState7=useState(props.stage||null),_useState8=_slicedToArray(_useState7,2),stage=_useState8[0],setStage=_useState8[1];var _useState9=useState(null),_useState10=_slicedToArray(_useState9,2),fulfillmentMethod=_useState10[0],setFulfillmentMethod=_useState10[1];var _useState11=useState(null),_useState12=_slicedToArray(_useState11,2),orderNumbers=_useState12[0],setOrderNumbers=_useState12[1];var _useState13=useState(null),_useState14=_slicedToArray(_useState13,2),errors=_useState14[0],setErrors=_useState14[1];var _useState15=useState(propsProduct),_useState16=_slicedToArray(_useState15,2),product=_useState16[0],setProduct=_useState16[1];var _useState17=useState(false),_useState18=_slicedToArray(_useState17,2),isChangeFulfillment=_useState18[0],setIsChangeFulfillment=_useState18[1];var _useState19=useState(null),_useState20=_slicedToArray(_useState19,2),cartItem=_useState20[0],setCartItem=_useState20[1];var _useState21=useState(productLocation),_useState22=_slicedToArray(_useState21,2),storeFinderLocation=_useState22[0],setStoreFinderLocation=_useState22[1];var _useState23=useState(!isFetching),_useState24=_slicedToArray(_useState23,2),isLoading=_useState24[0],setIsLoading=_useState24[1];var isInitialized=useRef(defaultIsInitialized);useEffect(function(){if(defaultFulfillmentMethod){setFulfillmentMethod(defaultFulfillmentMethod);}},[defaultFulfillmentMethod]);var title=useMemo(function(){if(props.title!==null){return i18n.text(props.title);}switch(stage){default:case STAGE_SELECT_STORE:return i18n.text('locations.headline');case STAGE_RESERVE_FORM:return i18n.text('locations.place_reservation');case STAGE_RESPONSE_SUCCESS:return i18n.text('locations.success_heading');case STAGE_RESPONSE_ERROR:return i18n.text('locations.error_heading');case STAGE_FULFILLMENT_METHOD:return i18n.text('locations.change_fulfillment_method');}},[props.title,stage]);/** Effects for updating a state based on new props */useEffect(function(){return setIsOpen(open);},[open]);useEffect(function(){return setProduct(propsProduct);},[propsProduct]);useEffect(function(){if(updatePreferredLocation&&productLocation&&!isInitialized.current){isInitialized.current=true;selectLocation(productLocation);}},[productLocation,selectLocation,updatePreferredLocation]);useEffect(function(){setIsLoading(isFetching);},[isFetching]);/**
|
|
6
|
+
* Checks whether the given stage is currently set.
|
|
7
|
+
* @param {string} inputStage The stage to check for.
|
|
8
|
+
* @returns {boolean}
|
|
9
|
+
*/function isStage(inputStage){return inputStage===stage;}/**
|
|
10
|
+
* Handles opening of the sheet.
|
|
11
|
+
* @param {Object} params The sheet open parameters.
|
|
12
|
+
*/function handleOpen(params){setIsOpen(true);setStage(function(prevState){return params.stage||prevState;});setChangeOnly(function(prevState){return params.changeOnly||prevState;});setFulfillmentPath(function(prevState){return params.fulfillmentPath||prevState;});callback=params.callback||null;}/**
|
|
13
|
+
* Is called when the sheet closed.
|
|
14
|
+
* @param {Object} [location=null] The selected location.
|
|
15
|
+
* @param {string} [productId=null] The product ID.
|
|
16
|
+
*/function handleClose(){var location=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var productId=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var orderSuccess=true;if(isStage(STAGE_RESPONSE_ERROR)){orderSuccess=errors===null;}if(isStage(STAGE_RESERVE_FORM)){orderSuccess=null;}if(props.onClose){props.onClose(location,productId,orderSuccess);}else if(callback){callback(location,productId,orderSuccess);callback=null;}setIsOpen(false);setStage(null);setOrderNumbers(null);setErrors(null);setIsChangeFulfillment(false);setFulfillmentMethod(null);}useEffect(function(){UIEvents.addListener(EVENT_SET_OPEN,handleOpen);return function(){UIEvents.removeListener(EVENT_SET_OPEN,handleOpen);};},[]);/**
|
|
17
|
+
* Handles the sending of the reservation.
|
|
18
|
+
* @param {Object} values The form values.
|
|
19
|
+
*/function sendReservation(_x){return _sendReservation.apply(this,arguments);}/**
|
|
20
|
+
* @param {Object} location The selected location.
|
|
21
|
+
* @returns {boolean}
|
|
22
|
+
*/function _sendReservation(){_sendReservation=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(values){var response;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return submitReservation(values,product);case 3:response=_context2.sent;if(response.errors&&response.errors.length>0){setStage(STAGE_RESPONSE_ERROR);setOrderNumbers(null);setErrors(response.errors);}setStage(STAGE_RESPONSE_SUCCESS);setOrderNumbers(response.orderNumbers);setErrors(null);_context2.next=16;break;case 10:_context2.prev=10;_context2.t0=_context2["catch"](0);logger.error(_context2.t0);setStage(STAGE_RESPONSE_ERROR);setOrderNumbers(null);setErrors([_context2.t0.message]);case 16:// Store the user's form in the user data.
|
|
23
|
+
storeFormInput(values);case 17:case"end":return _context2.stop();}},_callee2,null,[[0,10]]);}));return _sendReservation.apply(this,arguments);}var confirmSelection=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(location){var code,name,ropeCartProducts,cartHasDifferentCodes,confirmed,updateData;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:code=location.code,name=location.name;ropeCartProducts=cartProducts.filter(function(cartProduct){var _cartProduct$fulfillm;return[ROPIS,BOPIS].includes(cartProduct===null||cartProduct===void 0?void 0:(_cartProduct$fulfillm=cartProduct.fulfillment)===null||_cartProduct$fulfillm===void 0?void 0:_cartProduct$fulfillm.method);});if(!(!restrictMultiLocationOrders||ropeCartProducts.length===0)){_context.next=4;break;}return _context.abrupt("return",true);case 4:if(!(isCart&&ropeCartProducts.length===1)){_context.next=6;break;}return _context.abrupt("return",true);case 6:cartHasDifferentCodes=!!ropeCartProducts.map(function(_ref2){var _fulfillment$location;var fulfillment=_ref2.fulfillment;return fulfillment===null||fulfillment===void 0?void 0:(_fulfillment$location=fulfillment.location)===null||_fulfillment$location===void 0?void 0:_fulfillment$location.code;}).filter(Boolean).filter(function(cartProductCode){return cartProductCode!==code;}).length;if(!(ropeCartProducts.length>=1&&!cartHasDifferentCodes)){_context.next=9;break;}return _context.abrupt("return",true);case 9:_context.next=11;return showModal({title:'locations.multi_location_modal.title',message:'locations.multi_location_modal.message',confirm:'locations.multi_location_modal.change_store',dismiss:'common.cancel'});case 11:confirmed=_context.sent;if(!(confirmed&&ropeCartProducts.length)){_context.next=18;break;}updateData=ropeCartProducts.map(function(_ref3){var cartItemId=_ref3.id,fulfillment=_ref3.fulfillment;return{cartItemId:cartItemId,fulfillment:{method:fulfillment===null||fulfillment===void 0?void 0:fulfillment.method,location:{code:code,name:name||''}}};});setIsLoading(true);_context.next=17;return updateProductsInCart(updateData);case 17:setIsLoading(false);case 18:return _context.abrupt("return",confirmed);case 19:case"end":return _context.stop();}},_callee);}));return function confirmSelection(_x2){return _ref.apply(this,arguments);};}();/**
|
|
24
|
+
* Handles multiline reservation.
|
|
25
|
+
* @param {Object} location The selected location.
|
|
26
|
+
*/function handleMultilineReservation(location){if(product===null||location.code===null){return;}var fulfillment=_extends({method:fulfillmentMethod,location:{code:location.code,name:location.name||''}},fulfillmentSchedulingEnabled&&activeFulfillmentSlotLocationCode===location.code&&(activeFulfillmentSlot===null||activeFulfillmentSlot===void 0?void 0:activeFulfillmentSlot.id)?{slotId:activeFulfillmentSlot.id}:null);if(isChangeFulfillment&&cartItem){updateProductsInCart([{quantity:cartItem.quantity,cartItemId:cartItem.id,fulfillment:fulfillment}]);}handleClose(location,product.id);}/**
|
|
27
|
+
* Handles quick reservation.
|
|
28
|
+
*/function handleQuickReservation(){setStage(STAGE_RESERVE_FORM);}/**
|
|
29
|
+
* Handles the selection of a store location from the sheet.
|
|
30
|
+
* @param {Object} location The selected location.
|
|
31
|
+
*/function handleSelectLocation(_x3){return _handleSelectLocation.apply(this,arguments);}/**
|
|
32
|
+
* @param {string} method The selected fulfillment method.
|
|
33
|
+
* @param {Object} item The cart item to change.
|
|
34
|
+
*/function _handleSelectLocation(){_handleSelectLocation=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(location){var selectionConfirmed,handleReservationMethod;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!isLoading){_context3.next=2;break;}return _context3.abrupt("return");case 2:if(!updatePreferredLocation){_context3.next=7;break;}_context3.next=5;return confirmSelection(location);case 5:selectionConfirmed=_context3.sent;if(selectionConfirmed){selectLocation({code:location.code,name:location.name});}case 7:if(!changeOnly){_context3.next=10;break;}if(selectionConfirmed){handleClose(location,product&&product.id);}return _context3.abrupt("return");case 10:/**
|
|
35
|
+
* Select the reservation method strategy.
|
|
36
|
+
* @param {string} method The reservation method.
|
|
37
|
+
* @param {Object} storeLocation A store location
|
|
38
|
+
*/handleReservationMethod=function handleReservationMethod(method,storeLocation){if(!method){return;}if(method===QUICK_RESERVE){handleQuickReservation();}if(method===MULTI_LINE_RESERVE){handleMultilineReservation(storeLocation);}};// No fulfillment path selected yet.
|
|
39
|
+
if(!(fulfillmentPath===null)){_context3.next=14;break;}if(fulfillmentPaths.length>1){FulfillmentPathSelector.open(function(method){if(!method){return;}handleReservationMethod(method,location);});}else if(fulfillmentPaths.length===1){handleReservationMethod(fulfillmentPaths[0],location);}return _context3.abrupt("return");case 14:if(!(fulfillmentPath===MULTI_LINE_RESERVE&&fulfillmentPaths.includes(MULTI_LINE_RESERVE))){_context3.next=17;break;}handleMultilineReservation(location);return _context3.abrupt("return");case 17:if(fulfillmentPath===QUICK_RESERVE){handleQuickReservation();}case 18:case"end":return _context3.stop();}},_callee3);}));return _handleSelectLocation.apply(this,arguments);}function handleChangeFulfillmentMethod(method,item){logger.assert(item.product.id===product.id,'Change fulfillment method is called with unexpected product id');setIsChangeFulfillment(true);setCartItem(item);if([ROPIS,BOPIS].includes(method)&&(item.fulfillment===null||item.fulfillment.method===DIRECT_SHIP)){/**
|
|
40
|
+
* When the fulfillment method of the current cart item was DIRECT_SHIP before, and is
|
|
41
|
+
* switched to a ROPE method, the customer needs to pick a store for the item.
|
|
42
|
+
*/setFulfillmentPath(MULTI_LINE_RESERVE);setStage(STAGE_SELECT_STORE);setFulfillmentMethod(method);setIsOpen(true);return;}if([DIRECT_SHIP,ROPIS,BOPIS].includes(method)){updateProductsInCart([{quantity:item.quantity,cartItemId:item.id,fulfillment:{method:method}}]);handleClose(null,item.product.id);}}var handleSelectStoreFinderLocation=useCallback(function(location){setStoreFinderLocation(location);},[]);var context={stage:stage,title:title,fulfillmentPath:fulfillmentPath,changeOnly:changeOnly,isStage:isStage,isOpen:isOpen,handleOpen:handleOpen,handleClose:handleClose,locations:locations,inventory:inventory,baseProduct:propsBaseProduct,product:product,location:productLocation,storeFinderLocation:storeFinderLocation,userInput:userInput,fulfillmentPaths:fulfillmentPaths,fulfillmentMethods:fulfillmentMethods,enabledFulfillmentMethods:enabledFulfillmentMethods,shopSettings:shopSettings,selectLocation:handleSelectLocation,selectStoreFinderLocation:handleSelectStoreFinderLocation,changeFulfillment:handleChangeFulfillmentMethod,sendReservation:sendReservation,orderNumbers:orderNumbers,errors:errors,noInventory:noInventory,noLocationSelection:noLocationSelection,isStoreFinder:isStoreFinder,isFetching:isFetching,isLoading:isLoading,setIsLoading:setIsLoading,meta:props.meta||undefined};return React.createElement(FulfillmentContext.Provider,{value:context},children);}FulfillmentProvider.defaultProps={open:false,changeOnly:false,updatePreferredLocation:true,fulfillmentMethods:null,title:null};var FulfillmentProviderWrapped=withCurrentProduct(connect(FulfillmentProvider));/**
|
|
43
|
+
* Opens the sheet that is wrapped inside the provider.
|
|
44
|
+
* @param {Object} params The opening parameters.
|
|
45
|
+
* @property {Function} [params.callback] A callback function that's when the sheet closes.
|
|
46
|
+
* @property {string} [params.stage] A specific stage to show.
|
|
47
|
+
* @property {string} [params.fulfillmentPath] The fulfillment path that was chosen.
|
|
48
|
+
* @property {boolean} [params.changeOnly=false] Whether only the location will be changed.
|
|
49
|
+
*/export function openSheet(params){UIEvents.emit(EVENT_SET_OPEN,params);}export default FulfillmentProviderWrapped;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as React from'react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from'react';export var StoreDetailsContext=createContext({});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{useMemo,useCallback}from'react';import{useSelector}from'react-redux';import PropTypes from'prop-types';import{useRoute}from'@shopgate/engage/core/hooks';import{getPreferredLocation,makeGetLocation,makeGetNearbyLocationsByLocationCode}from"../selectors";import connect from"./StoreFinder.connector";import{StoreDetailsContext}from"./StoreDetailsContext";/**
|
|
2
|
+
* @param {Object} props The component props
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var StoreDetailsProvider=function StoreDetailsProvider(_ref){var children=_ref.children,selectGlobalLocation=_ref.selectGlobalLocation,selectLocation=_ref.selectLocation;var _useRoute=useRoute(),locationCode=_useRoute.params.code;var getLocation=useMemo(function(){return makeGetLocation(function(){return locationCode;});},[locationCode]);var routeLocation=useSelector(getLocation);var preferredLocation=useSelector(getPreferredLocation);var isRouteLocationPreferred=useMemo(function(){return preferredLocation&&routeLocation&&preferredLocation.code===routeLocation.code;},[preferredLocation,routeLocation]);var getNearbyLocations=useMemo(function(){return makeGetNearbyLocationsByLocationCode(locationCode);},[locationCode]);var nearbyLocations=useSelector(getNearbyLocations);var selectLocationCb=useCallback(function(location){selectLocation(location,true);selectGlobalLocation(location);},[selectLocation,selectGlobalLocation]);var value=useMemo(function(){return{preferredLocation:preferredLocation,routeLocation:routeLocation,nearbyLocations:nearbyLocations,isRouteLocationPreferred:isRouteLocationPreferred,selectLocation:selectLocationCb};},[isRouteLocationPreferred,nearbyLocations,preferredLocation,routeLocation,selectLocationCb]);return React.createElement(StoreDetailsContext.Provider,{value:value},children);};StoreDetailsProvider.defaultProps={children:null};export default connect(StoreDetailsProvider);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{getShopSettings}from'@shopgate/engage/core/config';import{getIsFetching,getStoreFinderSearch,getUserSearch,makeGetLocationsForStoreFinder}from"../selectors";import{selectGlobalLocation,selectLocation}from"../action-creators";/**
|
|
2
|
+
* @returns {Function}
|
|
3
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getLocationsForStoreFinder=makeGetLocationsForStoreFinder();return function(state,props){return{locations:getLocationsForStoreFinder(state,props),isFetching:getIsFetching(state),shopSettings:getShopSettings(state),userSearch:getUserSearch(state),storeFinderSearch:getStoreFinderSearch(state,props)};};};var mapDispatchToProps={selectLocation:selectLocation,selectGlobalLocation:selectGlobalLocation};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React,{useMemo,useCallback}from'react';import PropTypes from'prop-types';import{useSelector}from'react-redux';import{LoadingProvider}from'@shopgate/pwa-common/providers';import{getPreferredLocation}from"../selectors";import{STORE_FINDER_PATTERN}from"../constants";import{StoreFinderContext}from"../locations.context";import connect from"./StoreFinder.connector";import{useNavigation}from"../../core";/**
|
|
2
|
+
* @param {Object} props The component props
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var StoreFinderProvider=function StoreFinderProvider(_ref){var children=_ref.children,locations=_ref.locations,isFetching=_ref.isFetching,shopSettings=_ref.shopSettings,userSearch=_ref.userSearch,storeFinderSearch=_ref.storeFinderSearch,selectGlobalLocation=_ref.selectGlobalLocation,selectLocation=_ref.selectLocation;var _useNavigation=useNavigation(),pop=_useNavigation.pop;var selectedLocation=useSelector(getPreferredLocation);var selectLocationCb=useCallback(function(location){selectLocation(location,true);selectGlobalLocation(location);// Back navigation
|
|
5
|
+
pop();},[selectLocation,selectGlobalLocation,pop]);/**
|
|
6
|
+
* @param {bool} loading
|
|
7
|
+
*/var setIsLoading=useCallback(function(loading){if(loading){LoadingProvider.setLoading(STORE_FINDER_PATTERN);return;}LoadingProvider.unsetLoading(STORE_FINDER_PATTERN);},[]);var value=useMemo(function(){return{locations:locations,selectedLocation:selectedLocation,selectLocation:selectLocationCb,isFetching:isFetching,shopSettings:shopSettings,userSearch:userSearch,storeFinderSearch:storeFinderSearch,setIsLoading:setIsLoading};},[isFetching,locations,selectLocationCb,selectedLocation,shopSettings,storeFinderSearch,userSearch,setIsLoading]);return React.createElement(StoreFinderContext.Provider,{value:value},children);};StoreFinderProvider.defaultProps={children:null,locations:[],isFetching:false,shopSettings:null,userSearch:null,storeFinderSearch:null};export default connect(StoreFinderProvider);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as FulfillmentProvider,openSheet}from"./FulfillmentProvider";export{default as StoreFinderProvider}from"./StoreFinderProvider";export{default as StoreDetailsProvider}from"./StoreDetailsProvider";export{StoreDetailsContext}from"./StoreDetailsContext";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{combineReducers}from'redux';import userFormInput from"./userFormInput";import userSearch from"./userSearch";import storeFinderSearch from"./storeFinderSearch";import storage from"./storage";import user from"./user";export default combineReducers({userFormInput:userFormInput,userSearch:userSearch,user:user,storeFinderSearch:storeFinderSearch,storage:storage});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var _excluded=["productInventory"],_excluded2=["locationCode"],_excluded3=["locationCode","productCode"];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{produce}from'immer';import{generateSortedHash}from'@shopgate/pwa-common/helpers/redux/generateSortedHash';import{ERROR_LOCATIONS,REQUEST_LOCATIONS,RECEIVE_LOCATIONS,REQUEST_PRODUCT_LOCATIONS,RECEIVE_PRODUCT_LOCATIONS,RECEIVE_INVENTORIES,ERROR_PRODUCT_LOCATIONS,STORE_FULFILLMENT_METHOD,SELECT_LOCATION,FETCH_FULFILLMENT_SLOTS_SUCCESS,RECEIVE_PRODUCT_INVENTORIES}from"../constants";var initialState={// If general usage of state has been finished.
|
|
2
|
+
// Currently used to identify if any change is currently pending
|
|
3
|
+
// before the store switcher is being displayed.
|
|
4
|
+
pending:true,// If any data is being fetched right now.
|
|
5
|
+
isFetching:false,// The users preferred fulfillment location.
|
|
6
|
+
preferredLocation:{code:null},// The users preferred fulfillment method.
|
|
7
|
+
preferredFulfillmentMethod:{type:null},// All location information stored by code.
|
|
8
|
+
locationsByCode:{},// Inventory for a specific location and product.
|
|
9
|
+
inventoriesByCodePair:{},// List of locations that based on a given filter.
|
|
10
|
+
locationsByFilter:{},// Available FO slots mapped by location.
|
|
11
|
+
fulfillmentSlotsByLocation:{}};/* eslint-disable no-param-reassign */ /**
|
|
12
|
+
* Stores a list of locations and updates the store.
|
|
13
|
+
* @param {Object} draft Draft
|
|
14
|
+
* @param {Array} locations Locations
|
|
15
|
+
*/var storeLocationData=function storeLocationData(draft,locations){locations.forEach(function(location){// Remove some situational data to avoid confusion.
|
|
16
|
+
// The location storage should only contain the raw location info.
|
|
17
|
+
var productInventory=location.productInventory,filteredData=_objectWithoutProperties(location,_excluded);draft.locationsByCode[location.code]=filteredData;// Enhance with primary address for easier lookup.
|
|
18
|
+
draft.locationsByCode[location.code].address=location.addresses.find(function(a){return a.isPrimary;})||location.addresses[0];});};export default(function(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:initialState;var action=arguments.length>1?arguments[1]:undefined;var producer=produce(function(draft){var _action$location;switch(action.type){case REQUEST_LOCATIONS:case REQUEST_PRODUCT_LOCATIONS:draft.isFetching=true;break;case ERROR_LOCATIONS:case ERROR_PRODUCT_LOCATIONS:draft.isFetching=false;break;case FETCH_FULFILLMENT_SLOTS_SUCCESS:{draft.fulfillmentSlotsByLocation=draft.fulfillmentSlotsByLocation||{};draft.fulfillmentSlotsByLocation[action.locationCode]=action.fulfillmentSlots;break;}case RECEIVE_LOCATIONS:{// Store all missing locations.
|
|
19
|
+
storeLocationData(draft,action.locations);// Store filtered result set.
|
|
20
|
+
var locationCodes=action.locations.map(function(l){return l.code;});var filter=generateSortedHash(_extends({},action.filters));draft.locationsByFilter[filter]=locationCodes;draft.initialized=true;draft.isFetching=false;draft.pending=false;break;}case RECEIVE_PRODUCT_INVENTORIES:{action.inventories.forEach(function(inventory){var locationCode=inventory.locationCode,rest=_objectWithoutProperties(inventory,_excluded2);var key=generateSortedHash({productCode:action.productCode,locationCode:locationCode});draft.inventoriesByCodePair[key]=rest;});break;}case RECEIVE_INVENTORIES:{action.productInventories.forEach(function(inventory){var locationCode=inventory.locationCode,productCode=inventory.productCode,rest=_objectWithoutProperties(inventory,_excluded3);var key=generateSortedHash({productCode:productCode,locationCode:locationCode});draft.inventoriesByCodePair[key]=rest;});break;}case RECEIVE_PRODUCT_LOCATIONS:{// Store all missing locations.
|
|
21
|
+
storeLocationData(draft,action.locations);// For each location we store a new inventory entry.
|
|
22
|
+
action.locations.forEach(function(location){var key=generateSortedHash({productCode:action.productCode,locationCode:location.code});// Keep bin/binLocation for location if present
|
|
23
|
+
draft.inventoriesByCodePair[key]=_extends({},draft.inventoriesByCodePair[key],{},location.productInventory);});// Store filtered result set.
|
|
24
|
+
var _filter=generateSortedHash(_extends({productCode:action.productCode},action.filters));var _locationCodes=action.locations.map(function(l){return l.code;});draft.locationsByFilter[_filter]=_locationCodes;draft.pending=false;draft.isFetching=false;break;}case STORE_FULFILLMENT_METHOD:draft.preferredFulfillmentMethod.type=action.method;break;case SELECT_LOCATION:draft.preferredLocation.code=((_action$location=action.location)===null||_action$location===void 0?void 0:_action$location.code)||null;break;default:break;}});return producer(state);});/* eslint-enable no-param-reassign */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{produce}from'immer';import{SET_STORE_FINDER_SEARCH_RADIUS}from"../constants";export var defaultState={radius:null};/**
|
|
2
|
+
* Stores store finder related data
|
|
3
|
+
* @param {Object} [state={}] The current state.
|
|
4
|
+
* @param {Object} action The action object.
|
|
5
|
+
* @returns {Object} The new state.
|
|
6
|
+
*/var storeFinderSearch=function storeFinderSearch(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;/* eslint-disable no-param-reassign */var producer=produce(function(draft){switch(action.type){case SET_STORE_FINDER_SEARCH_RADIUS:{draft.radius=action.radius;break;}default:break;}return undefined;});/* eslint-enable no-param-reassign */return producer(state);};export default storeFinderSearch;
|
|
@@ -0,0 +1,5 @@
|
|
|
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{SET_USER_GEOLOCATION,USER_SEARCH_GEOLOCATION_LIFETIME}from"../constants";export var defaultState={geolocation:null};/**
|
|
2
|
+
* @param {Object} state The current state.
|
|
3
|
+
* @param {Object} action The action Object
|
|
4
|
+
* @returns {Object} The new state.
|
|
5
|
+
*/export default function user(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case SET_USER_GEOLOCATION:return _extends({},state,{geolocation:_extends({},action.geolocation,{expires:Date.now()+USER_SEARCH_GEOLOCATION_LIFETIME})});default:return state;}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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*as Redux from'redux';import{STORE_FORM_INPUT}from"../constants";/**
|
|
2
|
+
* TODO: Move to a different state / has nothing to do with locations.
|
|
3
|
+
*
|
|
4
|
+
* Stores the user's reserve form input
|
|
5
|
+
* @param {Object} state The current state.
|
|
6
|
+
* @param {Object} action The action object.
|
|
7
|
+
* @return {Object} The new state.
|
|
8
|
+
*/export default function formInput(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case STORE_FORM_INPUT:return _extends({},state,{},action.input);default:return state;}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import appConfig from'@shopgate/pwa-common/helpers/config';import{SET_USER_SEARCH_COUNTRY_CODE,SET_USER_SEARCH_POSTAL_CODE,SET_USER_SEARCH_GEOLOCATION,USER_SEARCH_GEOLOCATION_LIFETIME}from"../constants";export var defaultState={geolocation:null,postalCode:null,countryCode:appConfig.marketId};/**
|
|
2
|
+
* Stores the user's search input.
|
|
3
|
+
* @param {Object} state The current state.
|
|
4
|
+
* @param {Object} action The action Object
|
|
5
|
+
* @returns {Object} The new state.
|
|
6
|
+
*/export default function search(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case SET_USER_SEARCH_COUNTRY_CODE:return _extends({},state,{countryCode:action.countryCode});case SET_USER_SEARCH_POSTAL_CODE:return _extends({},state,{geolocation:null,postalCode:action.postalCode});case SET_USER_SEARCH_GEOLOCATION:return _extends({},state,{geolocation:_extends({},action.geolocation,{expires:Date.now()+USER_SEARCH_GEOLOCATION_LIFETIME}),postalCode:null});default:return state;}}
|