@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
package/account/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./constants";
|
|
1
|
+
export*from"./constants";export*from"./components";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{produce}from'immer';import{SUCCESS_LOGOUT}from'@shopgate/engage/core/constants';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR,FETCH_CUSTOMER,FETCH_CUSTOMER_SUCCESS,FETCH_CUSTOMER_ERROR}from"../constants/actions";var initialState={customer:{isFetching:false,data:null},contacts:{isFetching:false,items:[]}};/**
|
|
2
|
+
* The reducer for all checkout related state.
|
|
3
|
+
* @param {Object} state The application state.
|
|
4
|
+
* @param {Object} action The redux action.
|
|
5
|
+
* @returns {Object}
|
|
6
|
+
*/export default function checkoutReducer(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:initialState;var action=arguments.length>1?arguments[1]:undefined;/* eslint-disable no-param-reassign */var producer=produce(function(draft){switch(action.type){case FETCH_CUSTOMER_CONTACTS:{draft.contacts.isFetching=true;break;}case FETCH_CUSTOMER_CONTACTS_ERROR:{draft.contacts.isFetching=false;break;}case FETCH_CUSTOMER_CONTACTS_SUCCESS:{draft.contacts.isFetching=false;draft.contacts.items=action.contacts;break;}case FETCH_CUSTOMER:{draft.customer.isFetching=true;break;}case FETCH_CUSTOMER_ERROR:{draft.customer.isFetching=false;break;}case FETCH_CUSTOMER_SUCCESS:{draft.customer.isFetching=false;draft.customer.data=action.customer;break;}case SUCCESS_LOGOUT:{draft.customer=initialState.customer;draft.contacts=initialState.contacts;break;}default:break;}});/* eslint-enable no-param-reassign */return producer(state);}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Object} state State
|
|
3
|
+
* @returns {Object}
|
|
4
|
+
*/var getBase=function getBase(state){return state.account;};/**
|
|
5
|
+
* @param {Object} state State
|
|
6
|
+
* @returns {Array}
|
|
7
|
+
*/export var getContacts=function getContacts(state){return getBase(state).contacts.items;};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Object} state State
|
|
3
|
+
* @returns {Object}
|
|
4
|
+
*/var getBase=function getBase(state){return state.account;};/**
|
|
5
|
+
* @param {Object} state State
|
|
6
|
+
* @returns {Array}
|
|
7
|
+
*/export var getCustomer=function getCustomer(state){return getBase(state).customer.data;};
|
|
@@ -10,10 +10,10 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
10
10
|
* @param {boolean} mustShow if the modal must be shown
|
|
11
11
|
* @param {boolean} hasRepeats if the counters has repeats
|
|
12
12
|
* @return {(function(*, *): void)|*}
|
|
13
|
-
*/export function showModal(resetAction,increaseAction,mustShow,hasRepeats){return/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var state,platform,reviewLink,appRatingState,isMinDaysBetweenPopupsElapsed,firstModalConfirmed,userGivesFeedback;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
13
|
+
*/export function showModal(resetAction,increaseAction,mustShow,hasRepeats){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var state,platform,reviewLink,appRatingState,isMinDaysBetweenPopupsElapsed,firstModalConfirmed,userGivesFeedback;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:state=getState();platform=getPlatform(state);reviewLink=generateReviewLink(bundleId[platform],platform);// no review link for current platform found -> don't show modal
|
|
14
14
|
if(reviewLink){_context.next=5;break;}return _context.abrupt("return");case 5:if(!mustShow&&hasRepeats&&increaseAction){dispatch(increaseAction());}if(mustShow&&hasRepeats){_context.next=8;break;}return _context.abrupt("return");case 8:appRatingState=getAppRatingState(state);isMinDaysBetweenPopupsElapsed=Date.now()-appRatingState.lastPopupAt>=minDaysBetweenPopups*APP_RATING_TIMER_TIMESPAN;if(isMinDaysBetweenPopupsElapsed){_context.next=12;break;}return _context.abrupt("return");case 12:dispatch(resetAction());dispatch(setLastPopupTimestamp());_context.next=16;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.message'}));case 16:firstModalConfirmed=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision',eventLabel:firstModalConfirmed?'yes':'no'},state);// user touched yes and we
|
|
15
15
|
// redirect to store
|
|
16
16
|
if(!firstModalConfirmed){_context.next=21;break;}dispatch(redirectTo(reviewLink,true));return _context.abrupt("return");case 21:// user doesn't want to rate
|
|
17
17
|
dispatch(increaseRejectionCount());// we approve for rejection
|
|
18
|
-
if(!askForFeedback){_context.next=29;break;}_context.next=25;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.rejectionApprovalMessage'}));case 25:userGivesFeedback=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision_feedback',eventLabel:userGivesFeedback?'yes':'no'},state);// user wants to
|
|
19
|
-
if(userGivesFeedback){dispatch(redirectTo(feedbackLink));}return _context.abrupt("return");case 29:dispatch(redirectTo(feedbackLink));case 30:case"end":return _context.stop();}}
|
|
18
|
+
if(!askForFeedback){_context.next=29;break;}_context.next=25;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.rejectionApprovalMessage'}));case 25:userGivesFeedback=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision_feedback',eventLabel:userGivesFeedback?'yes':'no'},state);// user now wants to rate our app! yay :D
|
|
19
|
+
if(userGivesFeedback){dispatch(redirectTo(feedbackLink));}return _context.abrupt("return");case 29:dispatch(redirectTo(feedbackLink));case 30:case"end":return _context.stop();}},_callee);}));return function(_x,_x2){return _ref.apply(this,arguments);};}());}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{OS_ANDROID,OS_IOS}from'@shopgate/pwa-common/constants/Device';/**
|
|
2
2
|
* Generates a review app deep link based on the given provider
|
|
3
3
|
* @param {string} bundleId app bundle id
|
|
4
|
-
* @param {OS_ANDROID | OS_IOS} platform the name of the
|
|
4
|
+
* @param {OS_ANDROID | OS_IOS} platform the name of the platform
|
|
5
5
|
* @return {string | null}
|
|
6
6
|
*/export function generateReviewLink(bundleId,platform){if(!bundleId){return null;}switch(platform){case OS_IOS:{return"https://itunes.apple.com/app/id".concat(bundleId,"?action=write-review");}case OS_ANDROID:{return"https://market.android.com/details?id=".concat(bundleId);}default:{return null;}}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import appConfig from'@shopgate/pwa-common/helpers/config';import{appDidStart$}from'@shopgate/pwa-common/streams/app';import event from'@shopgate/pwa-core/classes/Event';import{increaseAppStartCount,resetAppStartCount}from"../action-creators/appStart";import{increaseOrdersPlacedCount,resetOrdersPlacedCount}from"../action-creators/ordersPlaced";import{resetTimerState,setTimerStartTime}from"../action-creators/timer";import{APP_RATING_TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";import{showModal}from"../actions/showModal";/**
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import appConfig from'@shopgate/pwa-common/helpers/config';import{appDidStart$}from'@shopgate/pwa-common/streams/app';import{checkoutSuccess$}from'@shopgate/engage/checkout/streams';import event from'@shopgate/pwa-core/classes/Event';import{hasWebBridge}from'@shopgate/engage/core';import{increaseAppStartCount,resetAppStartCount}from"../action-creators/appStart";import{increaseOrdersPlacedCount,resetOrdersPlacedCount}from"../action-creators/ordersPlaced";import{resetTimerState,setTimerStartTime}from"../action-creators/timer";import{APP_RATING_TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";import{showModal}from"../actions/showModal";/**
|
|
2
2
|
* App rating subscriptions
|
|
3
3
|
* @param {Function} subscribe The subscribe function
|
|
4
|
-
*/export default function appRating(subscribe){var _appConfig$appRating=appConfig.appRating,appStarts=_appConfig$appRating.appStarts,ordersPlaced=_appConfig$appRating.ordersPlaced,timeInterval=_appConfig$appRating.timeInterval,rejectionMaxCount=_appConfig$appRating.rejectionMaxCount,bundleId=_appConfig$appRating.bundleId;// even subscriber to handle app start ratings
|
|
4
|
+
*/export default function appRating(subscribe){if(!hasWebBridge){return;}var _appConfig$appRating=appConfig.appRating,appStarts=_appConfig$appRating.appStarts,ordersPlaced=_appConfig$appRating.ordersPlaced,timeInterval=_appConfig$appRating.timeInterval,rejectionMaxCount=_appConfig$appRating.rejectionMaxCount,bundleId=_appConfig$appRating.bundleId;// even subscriber to handle app start ratings
|
|
5
5
|
// and also time interval ratings
|
|
6
|
-
subscribe(appDidStart$,/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,state,mustShowModal,hasRepeats,resetAction,increaseAction;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
6
|
+
subscribe(appDidStart$,/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,state,mustShowModal,hasRepeats,resetAction,increaseAction;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;if(!(!bundleId||!bundleId.android||!bundleId.ios)){_context.next=3;break;}return _context.abrupt("return");case 3:// every time the app starts
|
|
7
7
|
// we increase the start count
|
|
8
8
|
dispatch(increaseAppStartCount());state=getAppRatingState(getState());// if the user has already rated the app
|
|
9
9
|
// we'll cancel the operations as we
|
|
@@ -12,12 +12,17 @@ if(!state.alreadyRated){_context.next=7;break;}return _context.abrupt("return");
|
|
|
12
12
|
if(state.timerStartTimestamp===null){dispatch(setTimerStartTime());}mustShowModal=false;hasRepeats=false;resetAction=null;increaseAction=null;if(timeInterval&&Number(timeInterval.value)>0&&Number(state.timerStartTimestamp)>0&&Date.now()-state.timerStartTimestamp>=timeInterval.value*APP_RATING_TIMER_TIMESPAN){mustShowModal=true;hasRepeats=timeInterval.repeats===null||state.timerRepeatsCount<=timeInterval.repeats;resetAction=resetTimerState;// since the time is elapsed
|
|
13
13
|
// we reset the starting time
|
|
14
14
|
increaseAction=setTimerStartTime;}else if(appStarts){mustShowModal=Number(appStarts.value)>0&&state.appStartCount>=appStarts.value;hasRepeats=appStarts.repeats===null||state.appStartResetCount<=appStarts.repeats;resetAction=resetAppStartCount;increaseAction=null;}// the actual show modal logic
|
|
15
|
-
dispatch(showModal(resetAction,increaseAction,mustShowModal,hasRepeats));case 16:case"end":return _context.stop();}}
|
|
16
|
-
|
|
15
|
+
dispatch(showModal(resetAction,increaseAction,mustShowModal,hasRepeats));case 16:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());/**
|
|
16
|
+
* Handle checkout success logic
|
|
17
|
+
* @param {Function} dispatch dispatch
|
|
18
|
+
* @param {Function} getState getState
|
|
19
|
+
*/var handleCheckoutSuccess=function handleCheckoutSuccess(dispatch,getState){if(!bundleId||!bundleId.android||!bundleId.ios){return;}var state=getAppRatingState(getState());// if the user has already rated the app
|
|
17
20
|
// we'll cancel the operations as we
|
|
18
21
|
// don't have to show the modal once more
|
|
19
22
|
if(state.alreadyRated){return;}// cancel the process if user has
|
|
20
23
|
// already rejected rating the app
|
|
21
24
|
// many times before
|
|
22
25
|
if(state.rejectionCount>=rejectionMaxCount){return;}if(!ordersPlaced){return;}// orders placed count starts from 0
|
|
23
|
-
var mustShowModal=state.ordersPlacedCount===ordersPlaced.value-1;var hasRepeats=ordersPlaced.repeats===null||state.ordersPlacedResetCount<=ordersPlaced.repeats;dispatch(showModal(resetOrdersPlacedCount,increaseOrdersPlacedCount,mustShowModal,hasRepeats));}
|
|
26
|
+
var mustShowModal=state.ordersPlacedCount===ordersPlaced.value-1;var hasRepeats=ordersPlaced.repeats===null||state.ordersPlacedResetCount<=ordersPlaced.repeats;dispatch(showModal(resetOrdersPlacedCount,increaseOrdersPlacedCount,mustShowModal,hasRepeats));};// subscriber to handle order placed ratings from native checkout
|
|
27
|
+
subscribe(checkoutSuccess$,function(_ref3){var dispatch=_ref3.dispatch,getState=_ref3.getState;handleCheckoutSuccess(dispatch,getState);});// event subscriber to handle order placed ratings from webcheckout
|
|
28
|
+
subscribe(appDidStart$,function(_ref4){var dispatch=_ref4.dispatch,getState=_ref4.getState;event.addCallback('checkoutSuccess',function(){handleCheckoutSuccess(dispatch,getState);});});}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PipelineRequest}from'@shopgate/engage/core';import{SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS,ADD_BACK_IN_STOCK_SUBSCRIPTION,ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR,ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS,REMOVE_BACK_IN_STOCK_SUBSCRIPTION,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS}from'@shopgate/engage/back-in-stock/constants';/**
|
|
1
|
+
import{PipelineRequest}from'@shopgate/engage/core/classes';import{SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS,ADD_BACK_IN_STOCK_SUBSCRIPTION,ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR,ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS,REMOVE_BACK_IN_STOCK_SUBSCRIPTION,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS}from'@shopgate/engage/back-in-stock/constants';/**
|
|
2
2
|
* Fetch Back in Stock Subscriptions
|
|
3
3
|
* @returns {Function}
|
|
4
4
|
*/export var fetchBackInStockSubscriptions=function fetchBackInStockSubscriptions(){return function(dispatch){dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS});var request=new PipelineRequest(SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS).setInput({limit:100,filters:{status:{$in:['active','triggered']}}}).setRetries(0).dispatch();request.then(function(_ref){var subscriptions=_ref.subscriptions;dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS,subscriptions:subscriptions});})["catch"](function(error){dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR,error:error});});return request;};};/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import React,{useCallback}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{themeConfig}from'@shopgate/engage';import{Link,CheckedIcon,Button,NotificationIcon}from'@shopgate/engage/components';import{BACK_IN_STOCK_PATTERN}from'@shopgate/engage/back-in-stock/constants';import{i18n}from'@shopgate/engage/core';import styles from"./style";import connect from"./connector";var colors=themeConfig.colors;/**
|
|
2
2
|
* This component renders a button to subscribe a product or a hint
|
|
3
3
|
* that the product is already subscribed
|
|
4
4
|
* @param {Object} props The component props
|
|
@@ -10,5 +10,5 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
|
|
|
10
10
|
* @param {Function} props.addBackInStockSubscription Add product to back in stock list
|
|
11
11
|
* @param {Function} props.grantPushPermissions Request / Set push permission
|
|
12
12
|
* @return {JSX.Element}
|
|
13
|
-
*/var BackInStockButton=function BackInStockButton(_ref){var productId=_ref.productId,_ref$isLinkToBackInSt=_ref.isLinkToBackInStockEnabled,isLinkToBackInStockEnabled=_ref$isLinkToBackInSt===void 0?false:_ref$isLinkToBackInSt,subscription=_ref.subscription,_ref$stopPropagation=_ref.stopPropagation,stopPropagation=_ref$stopPropagation===void 0?false:_ref$stopPropagation,addBackInStockSubscription=_ref.addBackInStockSubscription,grantPushPermissions=_ref.grantPushPermissions,alignRight=_ref.alignRight,showAsButton=_ref.showAsButton;var handleClick=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(event){var allowed;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
14
|
-
React.createElement("a",{role:"button",tabIndex:0,onClick:handleClick,className:classNames(styles.button,_defineProperty({},styles.rightAligned,alignRight))}
|
|
13
|
+
*/var BackInStockButton=function BackInStockButton(_ref){var productId=_ref.productId,_ref$isLinkToBackInSt=_ref.isLinkToBackInStockEnabled,isLinkToBackInStockEnabled=_ref$isLinkToBackInSt===void 0?false:_ref$isLinkToBackInSt,subscription=_ref.subscription,_ref$stopPropagation=_ref.stopPropagation,stopPropagation=_ref$stopPropagation===void 0?false:_ref$stopPropagation,addBackInStockSubscription=_ref.addBackInStockSubscription,grantPushPermissions=_ref.grantPushPermissions,alignRight=_ref.alignRight,showAsButton=_ref.showAsButton;var handleClick=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(event){var allowed;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(stopPropagation){event.stopPropagation();}_context.next=3;return grantPushPermissions({useRationaleModal:true,useSettingsModal:true,rationaleModal:{message:'back_in_stock.rationale.message',confirm:'back_in_stock.rationale.confirm',dismiss:'common.cancel'},meta:{context:'backInStock',usesSoftPushOptIn:false,permission:'push'}});case 3:allowed=_context.sent;if(allowed){addBackInStockSubscription({productId:productId});}case 5:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}(),[addBackInStockSubscription,grantPushPermissions,productId,stopPropagation]);if((subscription===null||subscription===void 0?void 0:subscription.status)==='active'){return React.createElement(Link,{href:BACK_IN_STOCK_PATTERN,disabled:!isLinkToBackInStockEnabled,className:classNames(styles.backInStockMessageContainer,_defineProperty({},styles.rightAligned,alignRight)),tag:"span"},React.createElement(CheckedIcon,{color:colors.success,className:alignRight?styles.icon:classNames(styles.iconCentered,styles.icon)}),React.createElement("span",{className:styles.backInStockMessage},i18n.text('back_in_stock.we_will_remind_you')));}if(showAsButton){return React.createElement(Button,{type:"primary",tabIndex:0,onClick:handleClick,className:styles.button},React.createElement("span",{className:styles.buttonText},i18n.text('back_in_stock.get_notified')));}return(// eslint-disable-next-line jsx-a11y/anchor-is-valid,jsx-a11y/click-events-have-key-events
|
|
14
|
+
React.createElement("a",{role:"button",tabIndex:0,onClick:handleClick,className:classNames(styles.button,_defineProperty({},styles.rightAligned,alignRight))},React.createElement(NotificationIcon,{color:colors.primary,className:styles.icon}),React.createElement("span",{className:styles.buttonText},i18n.text('back_in_stock.get_notified'))));};BackInStockButton.defaultProps={stopPropagation:false,isLinkToBackInStockEnabled:false,showAsButton:false,alignRight:false,subscription:null,productId:null};export default connect(BackInStockButton);
|
|
@@ -5,4 +5,4 @@ import React from'react';import PropTypes from'prop-types';import{BackInStockBut
|
|
|
5
5
|
* @param {Object} props.variant The variant for this entry
|
|
6
6
|
* @param {Object} props.subscription The subscription
|
|
7
7
|
* @return {JSX}
|
|
8
|
-
*/var CharacteristicsButton=function CharacteristicsButton(_ref){var _variant$stock,_variant$stock2;var isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,variant=_ref.variant;var productIsNotAVariant=!variant;var featureIsNotEnabled=!isBackInStockEnabled;var productIsNotAvailable=(variant===null||variant===void 0?void 0:(_variant$stock=variant.stock)===null||_variant$stock===void 0?void 0:_variant$stock.quantity)===0&&(variant===null||variant===void 0?void 0:(_variant$stock2=variant.stock)===null||_variant$stock2===void 0?void 0:_variant$stock2.ignoreQuantity)===false;if(productIsNotAVariant||featureIsNotEnabled||!productIsNotAvailable)return null;return
|
|
8
|
+
*/var CharacteristicsButton=function CharacteristicsButton(_ref){var _variant$stock,_variant$stock2;var isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,variant=_ref.variant;var productIsNotAVariant=!variant;var featureIsNotEnabled=!isBackInStockEnabled;var productIsNotAvailable=(variant===null||variant===void 0?void 0:(_variant$stock=variant.stock)===null||_variant$stock===void 0?void 0:_variant$stock.quantity)===0&&(variant===null||variant===void 0?void 0:(_variant$stock2=variant.stock)===null||_variant$stock2===void 0?void 0:_variant$stock2.ignoreQuantity)===false;if(productIsNotAVariant||featureIsNotEnabled||!productIsNotAvailable)return null;return React.createElement(BackInStockButton,{subscription:subscription,stopPropagation:true,productId:variant.id,alignRight:true});};CharacteristicsButton.defaultProps={variant:{},subscription:null};export default withCurrentProduct(connect(CharacteristicsButton));
|
|
@@ -7,4 +7,4 @@ import React,{Fragment}from'react';import PropTypes from'prop-types';import{Surr
|
|
|
7
7
|
* @param {Object} props.product The product
|
|
8
8
|
* @param {Object} props.subscription The subscription
|
|
9
9
|
* @return {JSX.Element}
|
|
10
|
-
*/var ProductInfoBackInStockButton=function ProductInfoBackInStockButton(_ref){var _product$stock,_product$stock2;var productId=_ref.productId,variantId=_ref.variantId,isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,product=_ref.product;var productIsAVariant=(product===null||product===void 0?void 0:product.type)!=='parent'&&(product===null||product===void 0?void 0:product.type)!==null;var productIsNotAvailable=(product===null||product===void 0?void 0:(_product$stock=product.stock)===null||_product$stock===void 0?void 0:_product$stock.quantity)===0&&(product===null||product===void 0?void 0:(_product$stock2=product.stock)===null||_product$stock2===void 0?void 0:_product$stock2.ignoreQuantity)===false;var showBackInStockButton=productIsAVariant&&productIsNotAvailable&&isBackInStockEnabled;return
|
|
10
|
+
*/var ProductInfoBackInStockButton=function ProductInfoBackInStockButton(_ref){var _product$stock,_product$stock2;var productId=_ref.productId,variantId=_ref.variantId,isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,product=_ref.product;var productIsAVariant=(product===null||product===void 0?void 0:product.type)!=='parent'&&(product===null||product===void 0?void 0:product.type)!==null;var productIsNotAvailable=(product===null||product===void 0?void 0:(_product$stock=product.stock)===null||_product$stock===void 0?void 0:_product$stock.quantity)===0&&(product===null||product===void 0?void 0:(_product$stock2=product.stock)===null||_product$stock2===void 0?void 0:_product$stock2.ignoreQuantity)===false;var showBackInStockButton=productIsAVariant&&productIsNotAvailable&&isBackInStockEnabled;return React.createElement(Fragment,null,React.createElement(SurroundPortals,{portalName:PRODUCT_BACK_IN_STOCK,portalProps:{showBackInStockButton:showBackInStockButton}},showBackInStockButton&&React.createElement(BackInStockButton,{showAsButton:true,subscription:subscription,isLinkToBackInStockEnabled:true,productId:variantId!==null&&variantId!==void 0?variantId:productId})));};ProductInfoBackInStockButton.defaultProps={subscription:null,variantId:null,product:null};export default withCurrentProduct(connect(ProductInfoBackInStockButton));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useCallback}from'react';import{css}from'glamor';import{LoadingIndicator,Accordion,Card}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{useBackInStockSubscriptions}from'@shopgate/engage/back-in-stock/hooks';import Subscription from"../Subscription";var styles={root:css({margin:'8px 8px 10px'}).toString(),divider:css({height:1,width:'calc(100% + 32px)',backgroundColor:'rgb(234, 234, 234)',marginLeft:-16,marginRight:-16,marginBottom:16}).toString(),emptyText:css({marginBottom:16}).toString()};/**
|
|
2
2
|
* The Back In Stock Subscriptions List.
|
|
3
3
|
* @returns {JSX}
|
|
4
|
-
*/var List=function List(){var _useBackInStockSubscr=useBackInStockSubscriptions(),isInitial=_useBackInStockSubscr.isInitial,groupedSubscriptions=_useBackInStockSubscr.groupedSubscriptions;var _renderLabel=useCallback(function(groupKey){return
|
|
4
|
+
*/var List=function List(){var _useBackInStockSubscr=useBackInStockSubscriptions(),isInitial=_useBackInStockSubscr.isInitial,groupedSubscriptions=_useBackInStockSubscr.groupedSubscriptions;var _renderLabel=useCallback(function(groupKey){return React.createElement("div",null,i18n.text("back_in_stock.list_states.".concat(groupKey)));},[]);return React.createElement("div",null,Object.entries(groupedSubscriptions).map(function(_ref){var _ref2=_slicedToArray(_ref,2),groupKey=_ref2[0],filteredSubscriptions=_ref2[1];return React.createElement(Card,{className:styles.root,key:groupKey},React.createElement(Accordion,{className:"",openWithChevron:true,renderLabel:function renderLabel(){return _renderLabel(groupKey);},chevronPosition:"left",startOpened:true},React.createElement("div",{className:styles.divider}),isInitial?React.createElement(LoadingIndicator,null):null,!isInitial&&filteredSubscriptions.length===0?React.createElement("div",{className:styles.emptyText},i18n.text('back_in_stock.empty_list_reminder')):null,!isInitial&&filteredSubscriptions.map(function(subscription,index){return React.createElement("div",{key:subscription.subscriptionCode},React.createElement(Subscription,{subscription:subscription,productId:subscription.productCode,key:subscription.subscriptionCode,group:groupKey}),index===filteredSubscriptions.length-1?null:React.createElement("div",{className:styles.divider}));})));}));};export default List;
|
|
@@ -3,5 +3,5 @@ import React from'react';import{css}from'glamor';import{Link,Ripple,PriceInfo,Cr
|
|
|
3
3
|
* @param {Object} props Props.
|
|
4
4
|
* @param {string} props.subscription The subscription which should be rendered
|
|
5
5
|
* @returns {JSX}
|
|
6
|
-
*/var Subscription=function Subscription(_ref){var _product$price,_product$price2,_product$price3,_product$price4,_product$characterist,_product$availability,_product$availability2;var subscription=_ref.subscription;var subscriptionCode=subscription.subscriptionCode,product=subscription.product,productCode=subscription.productCode;var _useBackInStockSubscr=useBackInStockSubscriptions(),removeBackInStockSubscription=_useBackInStockSubscr.removeBackInStockSubscription;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=((_product$price4=product.price)===null||_product$price4===void 0?void 0:_product$price4.discount)>0;var productLink=getProductRoute(product.id);return
|
|
7
|
-
,dangerouslySetInnerHTML:{__html:"".concat(product.name)}}))
|
|
6
|
+
*/var Subscription=function Subscription(_ref){var _product$price,_product$price2,_product$price3,_product$price4,_product$characterist,_product$availability,_product$availability2;var subscription=_ref.subscription;var subscriptionCode=subscription.subscriptionCode,product=subscription.product,productCode=subscription.productCode;var _useBackInStockSubscr=useBackInStockSubscriptions(),removeBackInStockSubscription=_useBackInStockSubscr.removeBackInStockSubscription;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=((_product$price4=product.price)===null||_product$price4===void 0?void 0:_product$price4.discount)>0;var productLink=getProductRoute(product.id);return React.createElement("div",{className:styles.root},React.createElement(Link,{className:styles.imageContainer,component:"div",href:productLink,"aria-hidden":true},React.createElement(ProductImage,{src:product.featuredImageBaseUrl,resolutions:gridResolutions})),React.createElement("div",{className:styles.infoContainer},React.createElement("div",{className:styles.infoContainerRow},React.createElement(Link,{href:productLink,tag:"span",className:styles.titleContainer},React.createElement("span",{className:styles.title// eslint-disable-next-line react/no-danger
|
|
7
|
+
,dangerouslySetInnerHTML:{__html:"".concat(product.name)}})),React.createElement("div",{className:styles.removeContainer},React.createElement("button",{onClick:function onClick(){return removeBackInStockSubscription({subscriptionCode:subscriptionCode});},type:"button","aria-label":i18n.text('favorites.remove')},React.createElement(Ripple,{className:styles.ripple},React.createElement(CrossIcon,null))))),React.createElement("div",{className:classNames(styles.baseContainerRow)},product===null||product===void 0?void 0:(_product$characterist=product.characteristics)===null||_product$characterist===void 0?void 0:_product$characterist.map(function(_ref3){var label=_ref3.label,value=_ref3.value;return React.createElement("div",{key:label+value,className:styles.characteristicText},label,': ',value);}),React.createElement(Availability,{text:product===null||product===void 0?void 0:(_product$availability=product.availability)===null||_product$availability===void 0?void 0:_product$availability.text,state:product===null||product===void 0?void 0:(_product$availability2=product.availability)===null||_product$availability2===void 0?void 0:_product$availability2.state,showWhenAvailable:false,className:styles.availabilityText}),(subscription===null||subscription===void 0?void 0:subscription.status)==='active'&&React.createElement(BackInStockButton,{subscription:subscription,productId:productCode})),React.createElement("div",{className:styles.priceContainerRow},hasStrikePrice?React.createElement(PriceStriked,{value:specialPrice,currency:currency}):null,React.createElement(Price,{currency:currency,discounted:hasStrikePrice,unitPrice:defaultPrice}),!!product.price.info&&React.createElement(PriceInfo,{text:product.price.info,className:styles.priceInfo}))));};export default Subscription;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from'react';import{BackInStockSubscriptionsProvider}from'@shopgate/engage/back-in-stock/providers';import List from"./components/List";/**
|
|
2
2
|
* The Back in Stock Subscriptions component.
|
|
3
3
|
* @returns {JSX}
|
|
4
|
-
*/var Subscriptions=function Subscriptions(){return
|
|
4
|
+
*/var Subscriptions=function Subscriptions(){return React.createElement(BackInStockSubscriptionsProvider,null,React.createElement(List,null));};export default Subscriptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from'react';var initialContext={};export default
|
|
1
|
+
import React from'react';var initialContext={};export default React.createContext(initialContext);
|
|
@@ -2,4 +2,4 @@ import React,{useMemo}from'react';import PropTypes from'prop-types';import Conte
|
|
|
2
2
|
* Back in Stock Provider
|
|
3
3
|
* @returns {JSX}
|
|
4
4
|
*/var BackInStockSubscriptionsProvider=function BackInStockSubscriptionsProvider(_ref){var subscriptions=_ref.subscriptions,children=_ref.children,addBackInStockSubscription=_ref.addBackInStockSubscription,isFetching=_ref.isFetching,isInitial=_ref.isInitial,removeBackInStockSubscription=_ref.removeBackInStockSubscription,requestsPossible=_ref.requestsPossible;var groupedSubscriptions=useMemo(function(){return subscriptions.reduce(function(acc,subscription){var status=subscription.status;var groupingStatus=status==='inactive'||status==='triggered'?'past':status;acc[groupingStatus].push(subscription);return acc;},{active:[],past:[]});},[subscriptions]);// Create memoized context value.
|
|
5
|
-
var value=useMemo(function(){return{subscriptions:subscriptions,groupedSubscriptions:groupedSubscriptions,addBackInStockSubscription:addBackInStockSubscription,removeBackInStockSubscription:removeBackInStockSubscription,isFetching:isFetching,isInitial:isInitial&&requestsPossible};},[addBackInStockSubscription,groupedSubscriptions,isFetching,isInitial,removeBackInStockSubscription,subscriptions,requestsPossible]);return
|
|
5
|
+
var value=useMemo(function(){return{subscriptions:subscriptions,groupedSubscriptions:groupedSubscriptions,addBackInStockSubscription:addBackInStockSubscription,removeBackInStockSubscription:removeBackInStockSubscription,isFetching:isFetching,isInitial:isInitial&&requestsPossible};},[addBackInStockSubscription,groupedSubscriptions,isFetching,isInitial,removeBackInStockSubscription,subscriptions,requestsPossible]);return React.createElement(Context.Provider,{value:value},children);};BackInStockSubscriptionsProvider.defaultProps={children:null,isFetching:false,isInitial:true,requestsPossible:false};export default connect(BackInStockSubscriptionsProvider);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||
|
|
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{createSelector}from'reselect';import{makeGetProductByCharacteristics}from'@shopgate/engage/product';import{appConfig}from'@shopgate/engage';import{hasNewServices,hasSGJavaScriptBridge,hasWebBridge}from'@shopgate/engage/core/helpers';import{getClientInformation}from'@shopgate/engage/core/selectors';import{PERMISSION_STATUS_GRANTED,PERMISSION_STATUS_NOT_SUPPORTED}from'@shopgate/engage/core/constants';/**
|
|
2
2
|
* @param {Object} state The application state.
|
|
3
3
|
* @returns {Object}
|
|
4
4
|
*/export var getBackInStockState=function getBackInStockState(state){return state.backInStock;};/**
|
|
@@ -28,8 +28,10 @@ match=subscriptionStatus===status;}return match;})||null;});};/**
|
|
|
28
28
|
*/export var makeGetSubscriptionByCharacteristics=function makeGetSubscriptionByCharacteristics(){var getProductByCharacteristics=makeGetProductByCharacteristics();return createSelector(getProductByCharacteristics,getBackInStockSubscriptions,function(product,subscriptions){if(!product){return null;}return subscriptions.find(function(_ref3){var productCode=_ref3.productCode;return productCode===product.id;})||null;});};/**
|
|
29
29
|
* Selector to determine if the back-in-stock feature is enabled
|
|
30
30
|
* @returns {boolean}
|
|
31
|
-
*/export var getIsBackInStockEnabled=createSelector(getClientInformation,getBackInStockPushPermissionStatus,function(clientInformation,pushPermissionStatus){//
|
|
32
|
-
|
|
31
|
+
*/export var getIsBackInStockEnabled=createSelector(getClientInformation,getBackInStockPushPermissionStatus,function(clientInformation,pushPermissionStatus){// Feature is not supported with the new services right now, since non ROPE inventory is
|
|
32
|
+
// not fully supported.
|
|
33
|
+
if(hasNewServices()||hasWebBridge()){return false;}// Perform app version checks when PWA runs outside the browser
|
|
34
|
+
if(hasSGJavaScriptBridge()){var _clientInformation$co2=clientInformation.codebaseVersion,codebaseVersion=_clientInformation$co2===void 0?'0.0.0':_clientInformation$co2;var _codebaseVersion$spli3=codebaseVersion.split('.'),_codebaseVersion$spli4=_slicedToArray(_codebaseVersion$spli3,1),major=_codebaseVersion$spli4[0];/**
|
|
33
35
|
* The feature can be enabled on react-native-engage based apps (>= 11.0.0) with proper
|
|
34
36
|
* support for push permissions checks
|
|
35
37
|
*/if(parseInt(major,10)<11||pushPermissionStatus===PERMISSION_STATUS_NOT_SUPPORTED){return false;}}return(appConfig===null||appConfig===void 0?void 0:appConfig.showBackInStock)||false;});/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{appDidStart$,main$,routeDidEnter$}from'@shopgate/engage/core';import{productWillEnter$}from'@shopgate/engage/product';import{ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,BACK_IN_STOCK_PATTERN}from'@shopgate/engage/back-in-stock/constants';export var backInStockRemindersDidEnter$=routeDidEnter$.filter(function(_ref){var action=_ref.action;return action.route.pattern===BACK_IN_STOCK_PATTERN;});export var addBackInStockReminderSuccess$=main$.filter(function(_ref2){var action=_ref2.action;return action.type===ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS;});export var removeBackInStockReminderSuccess$=main$.filter(function(_ref3){var action=_ref3.action;return action.type===REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS;});export var backInStockReminderNeedsFetch$=addBackInStockReminderSuccess$.merge(appDidStart$,removeBackInStockReminderSuccess$,backInStockRemindersDidEnter$,productWillEnter$);
|
|
1
|
+
import{appDidStart$,main$,routeDidEnter$}from'@shopgate/engage/core/streams';import{productWillEnter$}from'@shopgate/engage/product/streams';import{ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,BACK_IN_STOCK_PATTERN}from'@shopgate/engage/back-in-stock/constants';export var backInStockRemindersDidEnter$=routeDidEnter$.filter(function(_ref){var action=_ref.action;return action.route.pattern===BACK_IN_STOCK_PATTERN;});export var addBackInStockReminderSuccess$=main$.filter(function(_ref2){var action=_ref2.action;return action.type===ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS;});export var removeBackInStockReminderSuccess$=main$.filter(function(_ref3){var action=_ref3.action;return action.type===REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS;});export var backInStockReminderNeedsFetch$=addBackInStockReminderSuccess$.merge(appDidStart$,removeBackInStockReminderSuccess$,backInStockRemindersDidEnter$,productWillEnter$);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{appWillInit$}from'@shopgate/engage/core';import{PERMISSION_ID_PUSH}from'@shopgate/engage/core/constants';import{appInitialization}from'@shopgate/engage/core/collections';import{requestAppPermissionStatus}from'@shopgate/engage/core/actions';import
|
|
1
|
+
import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{appWillInit$}from'@shopgate/engage/core/streams';import{PERMISSION_ID_PUSH}from'@shopgate/engage/core/constants';import{appInitialization}from'@shopgate/engage/core/collections';import{requestAppPermissionStatus,showModal}from'@shopgate/engage/core/actions';import{fetchBackInStockSubscriptions}from'@shopgate/engage/back-in-stock/actions';import{addBackInStockReminderSuccess$,backInStockReminderNeedsFetch$}from'@shopgate/engage/back-in-stock/streams';import{getIsBackInStockEnabled,getAreBackInStockRequestsPossible}from'@shopgate/engage/back-in-stock/selectors';/**
|
|
2
2
|
* @param {Function} subscribe The subscribe function.
|
|
3
3
|
*/export default function backInStock(subscribe){subscribe(appWillInit$,function(){/**
|
|
4
4
|
* Back-in-stock requests are only possible when users granted push permissions. Otherwise
|
|
@@ -8,4 +8,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
|
|
|
8
8
|
* will retrieve the current status of the push permission before the React app starts.
|
|
9
9
|
*
|
|
10
10
|
* The back-in-stock reducer will store the status, so that selectors can work with it.
|
|
11
|
-
*/appInitialization.set('back-in-stock',/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,isEnabled;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)
|
|
11
|
+
*/appInitialization.set('back-in-stock',/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,isEnabled;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;isEnabled=getIsBackInStockEnabled(getState());if(!isEnabled){_context.next=5;break;}_context.next=5;return dispatch(requestAppPermissionStatus({permissionId:PERMISSION_ID_PUSH}));case 5:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());});subscribe(backInStockReminderNeedsFetch$,function(_ref3){var dispatch=_ref3.dispatch,getState=_ref3.getState;var requestsPossible=getAreBackInStockRequestsPossible(getState());if(requestsPossible){dispatch(fetchBackInStockSubscriptions());}});subscribe(addBackInStockReminderSuccess$,function(_ref4){var dispatch=_ref4.dispatch;dispatch(showModal({title:'back_in_stock.add_back_in_stock_success_modal.title',message:'back_in_stock.add_back_in_stock_success_modal.message',confirm:'modal.confirm',dismiss:null}));});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var FLAG_ORDERABLE='orderable';export var FLAG_COUPONS='coupons';export var FLAG_TAX_INCLUDED='taxIncluded';export var FLAG_MULTI_LINE_RESERVE='multiLineReserve';export var CART_MAX_ITEMS=99;export var CART_INPUT_AUTO_SCROLL_DELAY=500;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from'react';export var CartContext=createContext({currency:'EUR',config:{},isUserLoggedIn:false,isLoading:false,flags:{},display:'card',hasPromotionCoupons:false});
|
|
@@ -0,0 +1,15 @@
|
|
|
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 groupBy from'lodash/groupBy';import{hasNewServices}from'@shopgate/engage/core/helpers';import{ROPIS,BOPIS}from"../locations";/**
|
|
2
|
+
* @param {Array} cartItems The cart items to sort.
|
|
3
|
+
* @returns {Array}
|
|
4
|
+
*/export function sortCartItems(cartItems){var grouped=groupBy(cartItems,'type');var sorted=Object.keys(grouped).reduce(function(acc,key){return[].concat(acc,grouped[key].sort(function(a,b){return Math.sign(!!b.fulfillment-!!a.fulfillment);}));},[]);var ropeItem=sorted.filter(function(item){return item.fulfillment&&[ROPIS,BOPIS].includes(item.fulfillment.method);}).sort(function(a,b){if(a.fulfillment.location.code<b.fulfillment.location.code)return 1;if(a.fulfillment.location.code>b.fulfillment.location.code)return-1;return 0;});var directItem=sorted.filter(function(item){return!item.fulfillment||![ROPIS,BOPIS].includes(item.fulfillment.method);});var merged=[].concat(ropeItem,directItem);// Group splitted line items - try to keep the original order intact as much as possible
|
|
5
|
+
var groupedByBaseLineItemId=groupBy(merged,function(e){return e.baseLineItemId||e.id;});merged=merged.reduce(function(acc,_ref){var id=_ref.id;var group=groupedByBaseLineItemId===null||groupedByBaseLineItemId===void 0?void 0:groupedByBaseLineItemId[id];if(group){return[].concat(acc,group);}return acc;},[]);var enhanced=merged.map(function(item){if(!item.fulfillment||![ROPIS,BOPIS].includes(item.fulfillment.method)){return _extends({},item,{fulfillmentLocationId:null,fulfillmentMethod:null});}return _extends({},item,{fulfillmentLocationId:item.fulfillment.location.code,fulfillmentMethod:item.fulfillment.method});});return enhanced;}/**
|
|
6
|
+
* @param {Object} cartItem A cart item
|
|
7
|
+
* @returns {Object}
|
|
8
|
+
*/export var createCartItemPrices=function createCartItemPrices(){var cartItem=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};/**
|
|
9
|
+
* When PWA doesn't run with new services and uses a "shopgate.cart.getCart.v1" pipeline from one
|
|
10
|
+
* of the available cart extensions, we return a price array based on the response of those
|
|
11
|
+
* pipelines.
|
|
12
|
+
*/if(!hasNewServices()){var _cartItem$product3=cartItem.product,_cartItem$product4=_cartItem$product3===void 0?{}:_cartItem$product3,_cartItem$product2$pr2=_cartItem$product4.price,_price=_cartItem$product2$pr2===void 0?{}:_cartItem$product2$pr2;return{price:[],subtotal:typeof(_price===null||_price===void 0?void 0:_price.special)==='number'&&_price.special!==_price["default"]?[{price:_price["default"]},{price:_price.special}]:[{price:_price["default"]}]};}/**
|
|
13
|
+
* When running with the new services, the "shopgate.cart.getCart.v1" pipeline returns entities
|
|
14
|
+
* with different price properties. Those are handled here.
|
|
15
|
+
*/var _cartItem$product5=cartItem.product,product=_cartItem$product5===void 0?{}:_cartItem$product5,quantity=cartItem.quantity,price=cartItem.price,promoAmount=cartItem.promoAmount,extendedPrice=cartItem.extendedPrice,unitPromoAmount=cartItem.unitPromoAmount,unitDiscountAmount=cartItem.unitDiscountAmount;var _ref2=(product===null||product===void 0?void 0:product.price)||{},unit=_ref2.unit,unitSale=_ref2.unitSale,unitEffective=_ref2.unitEffective;var prices={price:[{price:unit}],subtotal:[]};if(unitSale&&unitSale!==unit){prices.price.push({price:unitSale});prices.subtotal.push({price:unit*quantity});}prices.subtotal.push({price:price});if(unitPromoAmount){prices.price.push({price:unitEffective+unitPromoAmount,isPromo:true});prices.subtotal.push({price:price+promoAmount,isPromo:true});}if(unitDiscountAmount){prices.price.push({price:unitEffective+unitPromoAmount+unitDiscountAmount,isCoupon:true});prices.subtotal.push({price:extendedPrice,isCoupon:true});}return prices;};
|
|
@@ -0,0 +1,34 @@
|
|
|
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{createSelector}from'reselect';import{hasProductVariants,isProductOrderable}from'@shopgate/pwa-common-commerce/product/selectors/product';import{makeIsProductActive,makeIsBaseProductActive}from'@shopgate/engage/product/selectors/product';import{CART_ITEM_TYPE_PRODUCT}from'@shopgate/pwa-common-commerce/cart/constants';import{DIRECT_SHIP}from"../locations";import{getLocationsStorage,makeIsRopeProductOrderable,makeIsLocationFulfillmentMethodEnabled,getPreferredLocation,getPreferredFulfillmentMethod}from"../locations/selectors";import{makeGetEnabledFulfillmentMethods,makeUseLocationFulfillmentMethods}from"../core";/**
|
|
2
|
+
* ########
|
|
3
|
+
* The following block of selectors was copied over from @shopgate/pwa-common-commerce/cart
|
|
4
|
+
* to prevent circular dependencies.
|
|
5
|
+
* ########
|
|
6
|
+
*/ /**
|
|
7
|
+
* Selects the cart data from the store.
|
|
8
|
+
* @param {Object} state The current state.
|
|
9
|
+
* @return {Object}
|
|
10
|
+
*/var getCart=function getCart(state){return state.cart.data;};/**
|
|
11
|
+
* Selects the cartItems from the current cart in the state.
|
|
12
|
+
* @param {Object} state The current state.
|
|
13
|
+
* @return {Array} The cartItems.
|
|
14
|
+
*/var cartItemsSelector=function cartItemsSelector(state){return state.cart.data.items;};/**
|
|
15
|
+
* Selects all items from the cart.
|
|
16
|
+
* @param {Object} state The current state.
|
|
17
|
+
* @return {Array} The cart items.
|
|
18
|
+
*/var getCartItems=createSelector(cartItemsSelector,function(cartItems){return cartItems;});/**
|
|
19
|
+
* Selects the products from the cart.
|
|
20
|
+
* @param {Object} state The current state.
|
|
21
|
+
* @return {Object[]} The cart products.
|
|
22
|
+
*/export var getCartProducts=createSelector(cartItemsSelector,function(cartItems){return cartItems.filter(function(item){return item.type===CART_ITEM_TYPE_PRODUCT;});});/**
|
|
23
|
+
* #####
|
|
24
|
+
* END of the copied block
|
|
25
|
+
* #####
|
|
26
|
+
*/ /**
|
|
27
|
+
* Creates a selector that determines if a cart button is supposed to be disabled.
|
|
28
|
+
* @returns {Function}
|
|
29
|
+
*/export function makeIsAddToCartButtonDisabled(){var isProductActive=makeIsProductActive();var isBaseProductActive=makeIsBaseProductActive();var isRopeProductOrderable=makeIsRopeProductOrderable(function(state,props){var _getPreferredLocation;return(_getPreferredLocation=getPreferredLocation(state,props))===null||_getPreferredLocation===void 0?void 0:_getPreferredLocation.code;},function(state,props){return props.variantId||props.productId||null;});var getEnabledMerchantFulfillmentMethods=makeGetEnabledFulfillmentMethods();var isLocationFulfillmentMethodEnabled=makeIsLocationFulfillmentMethodEnabled(function(state,props){var _getPreferredLocation2;return(_getPreferredLocation2=getPreferredLocation(state,props))===null||_getPreferredLocation2===void 0?void 0:_getPreferredLocation2.code;},function(state,props){return getPreferredFulfillmentMethod(state,props);});var useLocationFulfillmentMethods=makeUseLocationFulfillmentMethods();return createSelector(getEnabledMerchantFulfillmentMethods,getPreferredFulfillmentMethod,hasProductVariants,isProductActive,isBaseProductActive,isProductOrderable,isRopeProductOrderable,isLocationFulfillmentMethodEnabled,useLocationFulfillmentMethods,function(merchantFulfillmentMethods,userLocationFulfillmentMethod,productHasVariants,productActive,baseProductActive,productOrderable,ropeProductOrderable,locationFulfillmentMethodEnabled,locationFulfillmentMethodsUsed){if(!productActive||!baseProductActive){return true;}var isDirectShipSelected=!merchantFulfillmentMethods||!userLocationFulfillmentMethod||userLocationFulfillmentMethod===DIRECT_SHIP;if(isDirectShipSelected){return!productOrderable&&!productHasVariants;}if(locationFulfillmentMethodsUsed&&!locationFulfillmentMethodEnabled){return true;}return ropeProductOrderable===false&&!productHasVariants;});}export var hasLineItemPromotions=createSelector(getCartItems,function(cartItems){return cartItems.some(function(_ref){var _ref$appliedPromotion=_ref.appliedPromotions,appliedPromotions=_ref$appliedPromotion===void 0?[]:_ref$appliedPromotion;return appliedPromotions.length>0;});});export var getCoupons=createSelector(getCart,getCartItems,function(cart,cartItems){return((cart===null||cart===void 0?void 0:cart.coupons)||[]).filter(function(coupon){// Filter coupons which are assigned to line items
|
|
30
|
+
var code=coupon===null||coupon===void 0?void 0:coupon.code;var lineItemCoupon=cartItems.find(function(cartItem){var lineItemPromotions=(cartItem===null||cartItem===void 0?void 0:cartItem.appliedPromotions)||[];var match=lineItemPromotions.find(function(promotion){var _promotion$coupon;var lineItemCouponCode=promotion===null||promotion===void 0?void 0:(_promotion$coupon=promotion.coupon)===null||_promotion$coupon===void 0?void 0:_promotion$coupon.code;return lineItemCouponCode===code;});return!!match;});return!lineItemCoupon;});});export var getAppliedPromotions=createSelector(getCart,function(cart){return(cart===null||cart===void 0?void 0:cart.appliedPromotions)||[];});export var getAppliedPromotionsWithoutCoupons=createSelector(getAppliedPromotions,function(promotions){return promotions.filter(function(_ref2){var coupon=_ref2.coupon;return coupon===null;});});export var getPromotionCoupons=createSelector(getCoupons,getAppliedPromotions,function(coupons,promotions){return coupons.map(function(coupon){var _coupon$promotion;var code=coupon===null||coupon===void 0?void 0:(_coupon$promotion=coupon.promotion)===null||_coupon$promotion===void 0?void 0:_coupon$promotion.code;var promotion=promotions.find(function(promotionEntry){return promotionEntry.code===code;});return _extends({},coupon,{promotion:_extends({},(coupon===null||coupon===void 0?void 0:coupon.promotion)||{},{},promotion)});});});export var hasDirectShipItems=createSelector(getCartItems,function(cartItems){return cartItems.some(function(item){return!(item===null||item===void 0?void 0:item.fulfillment);});});export var isDirectShipOnly=createSelector(getCartItems,function(cartItems){return cartItems.every(function(item){return!(item===null||item===void 0?void 0:item.fulfillment);});});/**
|
|
31
|
+
* Returns the currently configured fulfillment slot.
|
|
32
|
+
* Takes the info from either the first cart item
|
|
33
|
+
* or from temp cart state.
|
|
34
|
+
*/export var getActiveFulfillmentSlot=createSelector(getCartItems,function(state){return getCart(state).activeFulfillmentSlot;},function(cartItems,fulfillmentSlot){var _cartItems$find,_cartItems$find$,_cartItems$find$$fulf;var firstSlotConfig=(_cartItems$find=cartItems.find(function(cartItem){return cartItem===null||cartItem===void 0?void 0:cartItem.fulfillment;}))===null||_cartItems$find===void 0?void 0:(_cartItems$find$=_cartItems$find[0])===null||_cartItems$find$===void 0?void 0:(_cartItems$find$$fulf=_cartItems$find$.fulfillment)===null||_cartItems$find$$fulf===void 0?void 0:_cartItems$find$$fulf.fulfillmentSlot;if(!firstSlotConfig){return fulfillmentSlot;}return firstSlotConfig;});export var getActiveFulfillmentSlotLocationCode=createSelector(getActiveFulfillmentSlot,getLocationsStorage,function(activeFulfillmentSlot,storage){var slotId=activeFulfillmentSlot===null||activeFulfillmentSlot===void 0?void 0:activeFulfillmentSlot.id;if(!slotId){return null;}var locationId=Object.keys(storage.fulfillmentSlotsByLocation).find(function(locationCode){return!!storage.fulfillmentSlotsByLocation[locationCode].find(function(_ref3){var id=_ref3.id;return id===slotId;});});return locationId||null;});export var checkActiveFulfillmentSlotBelongsToPreferredLocation=createSelector(getPreferredLocation,getActiveFulfillmentSlotLocationCode,function(location,activeFulfillmentSlotLocationCode){var locationCode=location===null||location===void 0?void 0:location.code;if(!locationCode){return false;}return locationCode===activeFulfillmentSlotLocationCode;});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{COUPON_TYPE_FIXED,COUPON_TYPE_PERCENTAGE}from'@shopgate/pwa-common-commerce/cart';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from'react';import{i18n}from'@shopgate/engage/core';import{header}from"./CartHeaderWide.style";/**
|
|
2
|
+
* @return {JSX}
|
|
3
|
+
*/var CartHeaderWide=function CartHeaderWide(){return React.createElement("div",{className:header},i18n.text('navigation.cart'));};export default CartHeaderWide;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var header=css({fontSize:'2.125rem',lineHeight:'2.25rem',padding:variables.gap.xbig});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as CartHeaderWide}from"./CartHeaderWide";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{useContext}from'react';import CartItemProductContext from"./CartItemProductProvider.context";import CartItemContext from"./CartItemProvider.context";/**
|
|
2
|
+
* Returns the value of the cart item product provider state.
|
|
3
|
+
* @returns {Object}
|
|
4
|
+
*/export var useCartItemProduct=function useCartItemProduct(){return useContext(CartItemProductContext);};/**
|
|
5
|
+
* Returns the value of the cart item provider state.
|
|
6
|
+
* @returns {Object}
|
|
7
|
+
*/export var useCartItem=function useCartItem(){return useContext(CartItemContext);};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{hot}from'react-hot-loader/root';import*as React from'react';import{SurroundPortals}from'@shopgate/engage/components';import{CART_ITEM_TYPE_PRODUCT,CART_ITEM_TYPE_COUPON,CART_ITEM}from'@shopgate/pwa-common-commerce/cart';import{ProductListEntryProvider}from'@shopgate/engage/product';import CartItemProduct from"./CartItemProduct";import CartItemCoupon from"./CartItemCoupon";import CartItemProductProvider from"./CartItemProductProvider";/**
|
|
2
|
+
* The cart item component.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @property {Object} props.item The cart item.
|
|
5
|
+
* @property {Function} props.onFocus A function to indicate when the item has been focussed.
|
|
6
|
+
* @return {JSX.Element}
|
|
7
|
+
*/function CartItem(_ref){var item=_ref.item,onFocus=_ref.onFocus,editable=_ref.editable,currencyOverride=_ref.currencyOverride;if(item.type!==CART_ITEM_TYPE_PRODUCT&&item.type!==CART_ITEM_TYPE_COUPON){return null;}var props={item:item};var isProduct=item.type===CART_ITEM_TYPE_PRODUCT;if(isProduct){var _item$product;return React.createElement(ProductListEntryProvider,{productId:item===null||item===void 0?void 0:(_item$product=item.product)===null||_item$product===void 0?void 0:_item$product.id},React.createElement(SurroundPortals,{portalName:CART_ITEM,portalProps:props},React.createElement(CartItemProductProvider,{cartItem:item,onFocus:onFocus,isEditable:editable,currencyOverride:currencyOverride},React.createElement(CartItemProduct,null))));}return React.createElement(SurroundPortals,{portalName:CART_ITEM,portalProps:props},React.createElement(CartItemCoupon,{id:item.id,key:item.id,coupon:item.coupon,messages:item.messages,editable:editable}));}CartItem.defaultProps={editable:true,currencyOverride:null};export default hot(React.memo(CartItem));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;export var messagesContainerCard=css({background:colors.light,padding:"0 0 ".concat(variables.gap.big,"px 0")}).toString();export var messagesCard=css({borderRadius:'5px 5px 0 0',padding:"".concat(variables.gap.small,"px ").concat(variables.gap.big*0.875,"px")}).toString();export var messagesContainerLine=css({background:colors.light,padding:"".concat(variables.gap.big,"px ").concat(variables.gap.big,"px 0")}).toString();export var messagesLine=css({borderRadius:4,padding:"".concat(variables.gap.big/2,"px ").concat(variables.gap.big,"px"),lineHeight:1.125}).toString();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{connect}from'react-redux';import deleteCouponsFromCart from'@shopgate/pwa-common-commerce/cart/actions/deleteCouponsFromCart';import{getCurrency}from'@shopgate/pwa-common-commerce/cart/selectors';/**
|
|
2
|
+
* @param {Object} state The current application state.
|
|
3
|
+
* @return {Object} The extended component props.
|
|
4
|
+
*/var mapStateToProps=function mapStateToProps(state){return{currency:getCurrency(state)};};/**
|
|
5
|
+
* @param {Function} dispatch The redux dispatch function.
|
|
6
|
+
* @return {Object} The extended component props.
|
|
7
|
+
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{deleteCoupon:function deleteCoupon(couponCode){return dispatch(deleteCouponsFromCart([couponCode]));}};};export default connect(mapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import*as React from'react';import PT from'prop-types';import Transition from'react-transition-group/Transition';import{getAbsoluteHeight}from'@shopgate/pwa-common/helpers/dom';import{CART_PATH}from'@shopgate/pwa-common-commerce/cart/constants';import{CART_ITEM_TYPE_COUPON}from'@shopgate/pwa-common-commerce/cart';import{getPageSettings}from'@shopgate/engage/core/config';import{MessageBar,CardList}from'@shopgate/engage/components';import{container,cartItemTransitionDuration as duration,getCartItemTransitionStyle as getTransitionStyle}from"./CartItemCoupon.style";import{messagesContainerCard,messagesCard,messagesContainerLine,messagesLine}from"./CartItem.style";import connect from"./CartItemCoupon.connector";import{CartItemCouponLayout}from"./CartItemCouponLayout";var messageStyles={card:{container:messagesContainerCard,message:messagesCard},line:{container:messagesContainerLine,message:messagesLine}};/**
|
|
2
|
+
* The Coupon component.
|
|
3
|
+
*/var CartItemCoupon=/*#__PURE__*/function(_React$Component){/**
|
|
4
|
+
* Constructor.
|
|
5
|
+
* @param {Object} props The component props.
|
|
6
|
+
*/function CartItemCoupon(props){var _this2;_classCallCheck(this,CartItemCoupon);_this2=_callSuper(this,CartItemCoupon,[props]);/**
|
|
7
|
+
* Sets this coupon to be invisible via its state.
|
|
8
|
+
*/_defineProperty(_this2,"transitionOut",function(){_this2.setState({visible:false});});/**
|
|
9
|
+
* Deletes the coupon from the cart.
|
|
10
|
+
*/_defineProperty(_this2,"deleteCoupon",function(){_this2.props.deleteCoupon(_this2.props.id);});_this2.state={visible:true};return _this2;}/**
|
|
11
|
+
* Expose props to the descendant components to use them for the portals.
|
|
12
|
+
* @return {Object}
|
|
13
|
+
*/_inherits(CartItemCoupon,_React$Component);return _createClass(CartItemCoupon,[{key:"getChildContext",value:function getChildContext(){return{cartItemId:this.props.id,type:CART_ITEM_TYPE_COUPON,editable:this.props.editable};}/**
|
|
14
|
+
* We need to set the element height explicitly so that we can animate it later.
|
|
15
|
+
*/},{key:"componentDidMount",value:function componentDidMount(){this.transitionElement.style.height="".concat(getAbsoluteHeight(this.cardElement),"px");}/**
|
|
16
|
+
* We need to set the element height explicitly so that we can animate it later.
|
|
17
|
+
*/},{key:"componentDidUpdate",value:function componentDidUpdate(){this.transitionElement.style.height="".concat(getAbsoluteHeight(this.cardElement),"px");}},{key:"render",value:/**
|
|
18
|
+
* Render Function.
|
|
19
|
+
* @returns {JSX}
|
|
20
|
+
*/function render(){var _this3=this;var _getPageSettings=getPageSettings(CART_PATH),_getPageSettings$cart=_getPageSettings.cartItemsDisplay,cartItemsDisplay=_getPageSettings$cart===void 0?'line':_getPageSettings$cart;return React.createElement(Transition,{"in":this.state.visible,timeout:duration,onExited:this.deleteCoupon},function(state){return React.createElement("div",{ref:function ref(element){if(element)_this3.transitionElement=element;},key:_this3.props.id,style:getTransitionStyle(state)},React.createElement("div",{className:container,ref:function ref(element){if(element)_this3.cardElement=element;}},React.createElement(CardList.Item,null,_this3.props.messages.length>0&&React.createElement(MessageBar,{messages:_this3.props.messages,classNames:messageStyles[cartItemsDisplay]}),React.createElement(CartItemCouponLayout,{handleDelete:_this3.transitionOut,coupon:_this3.props.coupon,currency:_this3.props.currency}))));});}}]);}(React.Component);_defineProperty(CartItemCoupon,"childContextTypes",{cartItemId:PT.string,type:PT.string,editable:PT.bool});_defineProperty(CartItemCoupon,"defaultProps",{deleteCoupon:function deleteCoupon(){}});CartItemCoupon.defaultProps={editable:true};export default connect(CartItemCoupon);
|
|
@@ -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{css}from'glamor';export var container=css({marginBottom:4});export var cartItemTransitionDuration=300;var defaultTransitionStyle={transition:"height ".concat(cartItemTransitionDuration,"ms cubic-bezier(0.25, 0.1, 0.25, 1)"),opacity:1};var transitionStyles={exited:{height:0,opacity:0},exiting:{height:0,opacity:0}};/**
|
|
2
|
+
* Creates an object with style attributes to enable a cart item transition.
|
|
3
|
+
* @param {string} state A state of the react-transition-group/Transition component.
|
|
4
|
+
* @return {Object}
|
|
5
|
+
*/export var getCartItemTransitionStyle=function getCartItemTransitionStyle(state){return _extends({},defaultTransitionStyle,{},transitionStyles[state]);};export default{cartItemTransitionDuration:cartItemTransitionDuration,getCartItemTransitionStyle:getCartItemTransitionStyle};
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{i18n}from'@shopgate/engage/core/helpers';import{Ellipsis}from'@shopgate/engage/components';/**
|
|
2
|
+
* The Coupon Code component.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/export var CartItemCouponCode=function CartItemCouponCode(_ref){var value=_ref.value;return React.createElement(Ellipsis,{rows:2},"".concat(i18n.text('cart.coupon_code'),": ").concat(value));};CartItemCouponCode.defaultProps={value:''};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{CrossIcon}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import styles from"./CartItemCouponDelete.style";/**
|
|
2
|
+
* The Coupon Delete component.
|
|
3
|
+
* @param {Object} props The component properties.
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/export var CartItemCouponDelete=function CartItemCouponDelete(_ref){var handleDelete=_ref.handleDelete;return React.createElement("button",{className:styles,onClick:handleDelete,"data-test-id":"deleteCoupon",type:"button","aria-label":i18n.text('cart.delete_coupon')},React.createElement(CrossIcon,null));};CartItemCouponDelete.defaultProps={handleDelete:function handleDelete(){}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';export default css({padding:0,fontSize:'1.5rem',marginTop:-2,marginRight:-5});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from'react';import PropTypes from'prop-types';import{i18n}from'@shopgate/engage/core';/**
|
|
2
|
+
* The Coupon Free Shipping component.
|
|
3
|
+
* @param {Object} props The component props.
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/export function CartItemCouponFreeShipping(_ref){var freeShipping=_ref.freeShipping;if(!freeShipping){return null;}return React.createElement("div",null,i18n.text('cart.free_shipping'));}CartItemCouponFreeShipping.defaultProps={freeShipping:false};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import{themeConfig}from'@shopgate/engage';import{useWidgetSettings}from'@shopgate/engage/core/hooks';import{Icon,CartCouponIcon}from'@shopgate/engage/components';/**
|
|
2
|
+
* Renders the cart item coupon icon.
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/export var CartItemCouponIcon=function CartItemCouponIcon(){var _useWidgetSettings=useWidgetSettings('@shopgate/engage/components/CartCouponIcon'),viewBox=_useWidgetSettings.viewBox,color=_useWidgetSettings.color;if(!themeConfig.icons.cartCoupon){return React.createElement(CartCouponIcon,null);}return React.createElement(Icon,_extends({},viewBox&&{viewBox:viewBox},{content:themeConfig.icons.cartCoupon,color:color}));};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import*as React from'react';import PT from'prop-types';import{SurroundPortals}from'@shopgate/engage/components';import{CART_ITEM_IMAGE,CART_ITEM_NAME,CART_ITEM_COUPON_CODE,CART_ITEM_PRICE}from'@shopgate/pwa-common-commerce/cart';import Grid from'@shopgate/pwa-common/components/Grid';import{CartItemCouponIcon}from"./CartItemCouponIcon";import{CartItemCouponPrice}from"./CartItemCouponPrice";import{CartItemCouponFreeShipping}from"./CartItemCouponFreeShipping";import{CartItemCouponTitle}from"./CartItemCouponTitle";import{CartItemCouponCode}from"./CartItemCouponCode";import{CartItemCouponDelete}from"./CartItemCouponDelete";import{item,icon,content,contentLast}from"./CartItemCouponLayout.style";/**
|
|
2
|
+
* The CouponLayout component.
|
|
3
|
+
* @param {Object} props The component properties.
|
|
4
|
+
* @param {Object} context The component context.
|
|
5
|
+
* @returns {JSX}
|
|
6
|
+
*/export function CartItemCouponLayout(props,context){var coupon=props.coupon,currency=props.currency,handleDelete=props.handleDelete;return React.createElement(Grid,{className:item},React.createElement(Grid.Item,{className:icon},React.createElement(SurroundPortals,{portalName:CART_ITEM_IMAGE,portalProps:context},React.createElement(CartItemCouponIcon,null))),React.createElement(Grid.Item,{className:content,grow:1},React.createElement(SurroundPortals,{portalName:CART_ITEM_NAME,portalProps:context},React.createElement(CartItemCouponTitle,{value:coupon.label})),React.createElement(SurroundPortals,{portalName:CART_ITEM_COUPON_CODE,portalProps:context},React.createElement(CartItemCouponCode,{value:coupon.code}))),React.createElement(Grid.Item,{className:"".concat(content," ").concat(contentLast),grow:1,shrink:0},context.editable&&React.createElement(CartItemCouponDelete,{handleDelete:handleDelete}),React.createElement(CartItemCouponFreeShipping,{freeShipping:!!coupon.freeShipping}),coupon.savedPrice&&coupon.savedPrice.value>0&&React.createElement(SurroundPortals,{portalName:CART_ITEM_PRICE,portalProps:context},React.createElement(CartItemCouponPrice,{currency:currency,savedPrice:coupon.savedPrice}))));}CartItemCouponLayout.defaultProps={handleDelete:function handleDelete(){}};CartItemCouponLayout.contextTypes={cartItemId:PT.string,type:PT.string,editable:PT.bool};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var item=css({fontSize:'0.875rem',padding:"".concat(variables.gap.small/2,"px ").concat(variables.gap.big,"px")}).toString();export var icon=css({fontSize:'3rem',flexShrink:0,margin:'5px 12px 0 12px'}).toString();export var content=css({display:'flex',flexDirection:'column',paddingLeft:variables.gap.big,paddingTop:variables.gap.small,paddingBottom:variables.gap.small,// took from https://stackoverflow.com/a/36247448
|
|
2
|
+
// in order to prevent the long coupon codes from
|
|
3
|
+
// breaking the ui, we need to reset the default
|
|
4
|
+
// flexbox settings (taken from CCP-2475)
|
|
5
|
+
minWidth:0}).toString();export var contentLast=css({alignItems:'flex-end'}).toString();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import*as React from'react';import{COUPON_TYPE_FIXED,COUPON_TYPE_PERCENTAGE}from'@shopgate/pwa-common-commerce/cart';import Price from'@shopgate/pwa-ui-shared/Price';import styles from"./CartItemCouponPrice.style";/**
|
|
2
|
+
* The Coupon Price component.
|
|
3
|
+
* @param {Object} props The component properties.
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/export var CartItemCouponPrice=React.memo(function(_ref){var currency=_ref.currency,savedPrice=_ref.savedPrice;if(savedPrice.type===COUPON_TYPE_FIXED){return React.createElement(Price,{className:styles,currency:currency,discounted:true,unitPrice:-savedPrice.value});}if(savedPrice.type===COUPON_TYPE_PERCENTAGE){return React.createElement("span",{className:styles},"-".concat(savedPrice.value,"%"));}return null;});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors;export default css({fontSize:'1rem',fontWeight:500,color:"var(--color-primary, ".concat(colors.primary,")")}).toString();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React,{useMemo}from'react';import PropTypes from'prop-types';import{i18n}from'@shopgate/engage/core';import styles from"./CartItemCouponTitle.style";/**
|
|
2
|
+
* The CouponTitle component.
|
|
3
|
+
* @param {Object} props The component properties.
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/export function CartItemCouponTitle(_ref){var value=_ref.value;var title=useMemo(function(){return value||i18n.text('cart.default_coupon_label');},[value]);return React.createElement("div",{className:styles},title);}CartItemCouponTitle.defaultProps={value:null};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';export default css({fontSize:'1rem',fontWeight:500,lineHeight:1.125,marginBottom:4});
|