@shopgate/engage 7.27.3-alpha.17 → 7.27.3-alpha.18

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.
Files changed (1218) hide show
  1. package/a11y/action-creators/index.js +9 -0
  2. package/a11y/components/FocusTrap/index.js +1 -0
  3. package/a11y/components/LiveMessage/index.js +1 -1
  4. package/a11y/components/LiveMessenger/helpers.js +1 -1
  5. package/a11y/components/LiveMessenger/index.js +2 -2
  6. package/a11y/components/ModalStateTracker/index.js +14 -0
  7. package/a11y/components/Navigation/index.js +1 -1
  8. package/a11y/components/Section/index.js +3 -3
  9. package/a11y/components/VisuallyHidden/index.js +1 -1
  10. package/a11y/components/index.js +1 -1
  11. package/a11y/constants/index.js +1 -0
  12. package/a11y/helpers/index.js +1 -0
  13. package/a11y/hooks/index.js +37 -0
  14. package/a11y/index.js +1 -4
  15. package/a11y/reducers/index.js +6 -0
  16. package/a11y/selectors/index.js +8 -0
  17. package/a11y/styles.js +2 -0
  18. package/account/actions/addContacts.js +4 -0
  19. package/account/actions/deleteContact.js +5 -0
  20. package/account/actions/deleteCustomer.js +4 -0
  21. package/account/actions/fetchContacts.js +4 -0
  22. package/account/actions/fetchCustomer.js +4 -0
  23. package/account/actions/updateContact.js +4 -0
  24. package/account/actions/updateCustomer.js +4 -0
  25. package/account/components/Account/Account.connector.js +5 -0
  26. package/account/components/Account/Account.js +4 -0
  27. package/account/components/Account/Account.style.js +1 -0
  28. package/account/components/Account/index.js +1 -0
  29. package/account/components/Profile/Profile.config.js +11 -0
  30. package/account/components/Profile/Profile.constraints.js +1 -0
  31. package/account/components/Profile/Profile.js +1 -0
  32. package/account/components/Profile/Profile.provider.js +22 -0
  33. package/account/components/Profile/ProfileAddressBook.js +6 -0
  34. package/account/components/Profile/ProfileAddressCard.js +3 -0
  35. package/account/components/Profile/ProfileForm.js +3 -0
  36. package/account/components/Profile/ProfileHeader.js +3 -0
  37. package/account/components/Profile/index.js +1 -0
  38. package/account/components/ProfileContact/ProfileContact.config.js +11 -0
  39. package/account/components/ProfileContact/ProfileContact.constraints.js +5 -0
  40. package/account/components/ProfileContact/ProfileContact.js +13 -0
  41. package/account/components/ProfileContact/index.js +1 -0
  42. package/account/components/index.js +1 -0
  43. package/account/constants/actions.js +1 -0
  44. package/account/constants/index.js +1 -1
  45. package/account/constants/pipelines.js +1 -0
  46. package/account/helper/form.js +61 -0
  47. package/account/index.js +1 -1
  48. package/account/reducers/index.js +6 -0
  49. package/account/selectors/contacts.js +7 -0
  50. package/account/selectors/customer.js +7 -0
  51. package/app-rating/actions/showModal.js +3 -3
  52. package/app-rating/helpers/index.js +1 -1
  53. package/app-rating/subscriptions/index.js +11 -6
  54. package/back-in-stock/actions/index.js +1 -1
  55. package/back-in-stock/components/BackInStockButton/index.js +3 -3
  56. package/back-in-stock/components/CharacteristicsButton/index.js +1 -1
  57. package/back-in-stock/components/ProductInfoBackInStockButton/index.js +1 -1
  58. package/back-in-stock/components/Subscriptions/components/List/index.js +2 -2
  59. package/back-in-stock/components/Subscriptions/components/Subscription/index.js +2 -2
  60. package/back-in-stock/components/Subscriptions/index.js +1 -1
  61. package/back-in-stock/providers/BackInStockSubscriptionsProvider.context.js +1 -1
  62. package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +1 -1
  63. package/back-in-stock/selectors/index.js +5 -3
  64. package/back-in-stock/streams/index.js +1 -1
  65. package/back-in-stock/subscriptions/index.js +2 -2
  66. package/cart/cart.constants.js +1 -0
  67. package/cart/cart.context.js +1 -0
  68. package/cart/cart.helpers.js +15 -0
  69. package/cart/cart.hooks.js +4 -0
  70. package/cart/cart.selectors.js +34 -0
  71. package/cart/cart.types.js +1 -0
  72. package/cart/components/CartHeaderWide/CartHeaderWide.js +3 -0
  73. package/cart/components/CartHeaderWide/CartHeaderWide.style.js +1 -0
  74. package/cart/components/CartHeaderWide/index.js +1 -0
  75. package/cart/components/CartItem/CartItem.hooks.js +7 -0
  76. package/cart/components/CartItem/CartItem.js +7 -0
  77. package/cart/components/CartItem/CartItem.style.js +1 -0
  78. package/cart/components/CartItem/CartItemCoupon.connector.js +7 -0
  79. package/cart/components/CartItem/CartItemCoupon.js +20 -0
  80. package/cart/components/CartItem/CartItemCoupon.style.js +5 -0
  81. package/cart/components/CartItem/CartItemCoupon.types.js +0 -0
  82. package/cart/components/CartItem/CartItemCouponCode.js +5 -0
  83. package/cart/components/CartItem/CartItemCouponDelete.js +5 -0
  84. package/cart/components/CartItem/CartItemCouponDelete.style.js +1 -0
  85. package/cart/components/CartItem/CartItemCouponFreeShipping.js +5 -0
  86. package/cart/components/CartItem/CartItemCouponIcon.js +4 -0
  87. package/cart/components/CartItem/CartItemCouponLayout.js +6 -0
  88. package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -0
  89. package/cart/components/CartItem/CartItemCouponPrice.js +5 -0
  90. package/cart/components/CartItem/CartItemCouponPrice.style.js +1 -0
  91. package/cart/components/CartItem/CartItemCouponTitle.js +5 -0
  92. package/cart/components/CartItem/CartItemCouponTitle.style.js +1 -0
  93. package/cart/components/CartItem/CartItemProduct.js +5 -0
  94. package/cart/components/CartItem/CartItemProduct.style.js +1 -0
  95. package/cart/components/CartItem/CartItemProductLayout.js +6 -0
  96. package/cart/components/CartItem/CartItemProductLayout.style.js +1 -0
  97. package/cart/components/CartItem/CartItemProductLayoutWide.js +4 -0
  98. package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -0
  99. package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.js +4 -0
  100. package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.style.js +1 -0
  101. package/cart/components/CartItem/CartItemProductLayoutWideOrderDetails.js +3 -0
  102. package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.js +4 -0
  103. package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.style.js +1 -0
  104. package/cart/components/CartItem/CartItemProductOrderDetails.js +3 -0
  105. package/cart/components/CartItem/CartItemProductOrderDetails.style.js +1 -0
  106. package/cart/components/CartItem/CartItemProductPriceCaption.js +4 -0
  107. package/cart/components/CartItem/CartItemProductPriceCaption.style.js +1 -0
  108. package/cart/components/CartItem/CartItemProductPriceList.js +5 -0
  109. package/cart/components/CartItem/CartItemProductPriceListPromotion.js +10 -0
  110. package/cart/components/CartItem/CartItemProductProvider.connector.js +9 -0
  111. package/cart/components/CartItem/CartItemProductProvider.context.js +1 -0
  112. package/cart/components/CartItem/CartItemProductProvider.js +12 -0
  113. package/cart/components/CartItem/CartItemProductProvider.types.js +1 -0
  114. package/cart/components/CartItem/CartItemProductProviderLegacy.js +22 -0
  115. package/cart/components/CartItem/CartItemProductTitle.js +7 -0
  116. package/cart/components/CartItem/CartItemProductTitle.style.js +1 -0
  117. package/cart/components/CartItem/CartItemProvider.connector.js +3 -0
  118. package/cart/components/CartItem/CartItemProvider.context.js +1 -0
  119. package/cart/components/CartItem/CartItemProvider.js +5 -0
  120. package/cart/components/CartItem/CartItemQuantityPicker.js +38 -0
  121. package/cart/components/CartItem/CartItemQuantityPicker.style.js +1 -0
  122. package/cart/components/CartItem/CartItemSubstitution.connector.js +5 -0
  123. package/cart/components/CartItem/CartItemSubstitution.js +5 -0
  124. package/cart/components/CartItem/CartItemSubstitution.style.js +1 -0
  125. package/cart/components/CartItem/index.js +1 -0
  126. package/cart/components/CartItems/CartItem.connector.js +4 -0
  127. package/cart/components/CartItems/CartItemCard.js +5 -0
  128. package/cart/components/CartItems/CartItemCard.style.js +1 -0
  129. package/cart/components/CartItems/CartItemCardReservation.js +5 -0
  130. package/cart/components/CartItems/CartItemCardReservationAccordion.js +4 -0
  131. package/cart/components/CartItems/CartItemCardReservationLabel.js +5 -0
  132. package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.js +3 -0
  133. package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.style.js +1 -0
  134. package/cart/components/CartItems/CartItemGroup.js +5 -0
  135. package/cart/components/CartItems/CartItemGroup.style.js +1 -0
  136. package/cart/components/CartItems/CartItemGroupReservation.js +5 -0
  137. package/cart/components/CartItems/CartItemGroupReservationLabel.js +5 -0
  138. package/cart/components/CartItems/CartItemGroupShipping.js +4 -0
  139. package/cart/components/CartItems/CartItems.js +5 -0
  140. package/cart/components/CartItems/CartItems.style.js +1 -0
  141. package/cart/components/CartItems/CartItemsHeaderWide.connector.js +3 -0
  142. package/cart/components/CartItems/CartItemsHeaderWide.js +3 -0
  143. package/cart/components/CartItems/CartItemsHeaderWide.style.js +1 -0
  144. package/cart/components/CartItems/CartItemsSubscription.connector.js +5 -0
  145. package/cart/components/CartItems/CartItemsSubstitution.js +5 -0
  146. package/cart/components/CartItems/index.js +1 -0
  147. package/cart/components/CartSummaryWide/CartSummaryWide.connector.js +4 -0
  148. package/cart/components/CartSummaryWide/CartSummaryWide.js +4 -0
  149. package/cart/components/CartSummaryWide/CartSummaryWide.style.js +1 -0
  150. package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.connector.js +5 -0
  151. package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.js +4 -0
  152. package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -0
  153. package/cart/components/CartSummaryWide/CartSummaryWideFooter.js +3 -0
  154. package/cart/components/CartSummaryWide/index.js +1 -0
  155. package/cart/components/PaymentBar/PaymentBar.js +5 -0
  156. package/cart/components/PaymentBar/PaymentBarAppliedPromotions.connector.js +5 -0
  157. package/cart/components/PaymentBar/PaymentBarAppliedPromotions.js +3 -0
  158. package/cart/components/PaymentBar/PaymentBarCheckoutButton.connector.js +5 -0
  159. package/cart/components/PaymentBar/PaymentBarCheckoutButton.js +5 -0
  160. package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -0
  161. package/cart/components/PaymentBar/PaymentBarContent.js +4 -0
  162. package/cart/components/PaymentBar/PaymentBarContent.style.js +1 -0
  163. package/cart/components/PaymentBar/PaymentBarDiscounts.connector.js +5 -0
  164. package/cart/components/PaymentBar/PaymentBarDiscounts.js +4 -0
  165. package/cart/components/PaymentBar/PaymentBarGrandTotal.connector.js +5 -0
  166. package/cart/components/PaymentBar/PaymentBarGrandTotal.js +4 -0
  167. package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +4 -0
  168. package/cart/components/PaymentBar/PaymentBarPromotionCoupons.connector.js +8 -0
  169. package/cart/components/PaymentBar/PaymentBarPromotionCoupons.js +3 -0
  170. package/cart/components/PaymentBar/PaymentBarPromotionalText.js +4 -0
  171. package/cart/components/PaymentBar/PaymentBarReserveButton.connector.js +1 -0
  172. package/cart/components/PaymentBar/PaymentBarReserveButton.js +7 -0
  173. package/cart/components/PaymentBar/PaymentBarShippingCost.connector.js +5 -0
  174. package/cart/components/PaymentBar/PaymentBarShippingCost.js +3 -0
  175. package/cart/components/PaymentBar/PaymentBarSubTotal.connector.js +5 -0
  176. package/cart/components/PaymentBar/PaymentBarSubTotal.js +3 -0
  177. package/cart/components/PaymentBar/PaymentBarTax.connector.js +5 -0
  178. package/cart/components/PaymentBar/PaymentBarTax.js +4 -0
  179. package/cart/components/PaymentBar/index.js +1 -0
  180. package/cart/components/Substitution/connector.js +5 -0
  181. package/cart/components/Substitution/index.js +9 -0
  182. package/cart/components/Substitution/style.js +1 -0
  183. package/cart/components/SupplementalContent/SupplementalContent.connector.js +4 -0
  184. package/cart/components/SupplementalContent/SupplementalContent.js +5 -0
  185. package/cart/components/SupplementalContent/SupplementalContent.styles.js +1 -0
  186. package/cart/components/SupplementalContent/index.js +1 -0
  187. package/cart/index.js +10 -5
  188. package/cart/streams/index.js +1 -0
  189. package/category/actions/index.js +1 -0
  190. package/category/components/CategoryImage/connector.js +5 -0
  191. package/category/components/CategoryImage/index.js +5 -0
  192. package/category/components/CategoryList/index.js +2 -2
  193. package/category/components/CategoryList/style.js +1 -1
  194. package/category/components/index.js +1 -0
  195. package/category/constants/index.js +1 -0
  196. package/category/helpers/index.js +1 -0
  197. package/category/index.js +1 -7
  198. package/category/selectors/index.js +2 -0
  199. package/category/streams/index.js +1 -0
  200. package/checkout/action-creators/addCheckoutCampaign.js +5 -0
  201. package/checkout/action-creators/clearCheckoutCampaign.js +5 -0
  202. package/checkout/action-creators/clearCheckoutOrder.js +4 -0
  203. package/checkout/action-creators/index.js +1 -0
  204. package/checkout/action-creators/validationErrorsCheckout.js +5 -0
  205. package/checkout/actions/errorCheckout.js +17 -0
  206. package/checkout/actions/fetchCheckoutOrder.js +4 -0
  207. package/checkout/actions/fetchPaymentMethods.js +4 -0
  208. package/checkout/actions/index.js +1 -0
  209. package/checkout/actions/initializeCheckout.js +4 -0
  210. package/checkout/actions/prepareCheckout.js +8 -0
  211. package/checkout/actions/submitCheckoutOrder.js +5 -0
  212. package/checkout/actions/updateCheckoutOrder.js +5 -0
  213. package/checkout/components/AddressBook/AddressBook.js +5 -0
  214. package/checkout/components/AddressBook/AddressList.js +9 -0
  215. package/checkout/components/AddressBook/index.js +1 -0
  216. package/checkout/components/AddressBookContact/AddressBookContact.js +5 -0
  217. package/checkout/components/AddressBookContact/index.js +1 -0
  218. package/checkout/components/Checkout/Checkout.js +4 -0
  219. package/checkout/components/Checkout/CheckoutActions.js +4 -0
  220. package/checkout/components/Checkout/CheckoutAddress.js +6 -0
  221. package/checkout/components/Checkout/CheckoutHeader.js +4 -0
  222. package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +8 -0
  223. package/checkout/components/Checkout/CheckoutPickupContactForm.js +4 -0
  224. package/checkout/components/Checkout/CheckoutSection.js +4 -0
  225. package/checkout/components/Checkout/CheckoutSectionInfo.js +4 -0
  226. package/checkout/components/Checkout/CheckoutSectionMessages.js +4 -0
  227. package/checkout/components/Checkout/CheckoutSummary.js +4 -0
  228. package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.connector.js +3 -0
  229. package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +7 -0
  230. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +4 -0
  231. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderContact.js +4 -0
  232. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderSummary.js +4 -0
  233. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickUpContact.js +4 -0
  234. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickupNotes.js +4 -0
  235. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationSection.js +4 -0
  236. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationShippedTo.js +4 -0
  237. package/checkout/components/CheckoutConfirmation/index.js +1 -0
  238. package/checkout/components/GuestCheckout/GuestCheckout.js +4 -0
  239. package/checkout/components/GuestCheckout/GuestCheckoutOptIn.config.js +4 -0
  240. package/checkout/components/GuestCheckout/GuestCheckoutOptIn.js +3 -0
  241. package/checkout/components/GuestCheckout/GuestCheckoutPickup.js +4 -0
  242. package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +4 -0
  243. package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.js +4 -0
  244. package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +5 -0
  245. package/checkout/components/PaymentMethodButton/index.js +1 -0
  246. package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.js +4 -0
  247. package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.style.js +1 -0
  248. package/checkout/components/ResponsiveBackButton/index.js +1 -0
  249. package/checkout/components/ShippingMethods/ShippingMethod.js +5 -0
  250. package/checkout/components/ShippingMethods/ShippingMethods.js +23 -0
  251. package/checkout/components/ShippingMethods/connector.js +7 -0
  252. package/checkout/components/ShippingMethods/index.js +1 -0
  253. package/checkout/components/SupplementalContent/SupplementalContent.connector.js +4 -0
  254. package/checkout/components/SupplementalContent/SupplementalContent.js +5 -0
  255. package/checkout/components/SupplementalContent/SupplementalContent.styles.js +1 -0
  256. package/checkout/components/SupplementalContent/index.js +1 -0
  257. package/checkout/components/index.js +1 -0
  258. package/checkout/constants/actionTypes.js +1 -0
  259. package/checkout/constants/errorCodes.js +1 -0
  260. package/checkout/constants/index.js +1 -0
  261. package/checkout/constants/routes.js +1 -0
  262. package/checkout/helpers/index.js +34 -0
  263. package/checkout/hooks/common.js +7 -0
  264. package/checkout/index.js +6 -5
  265. package/checkout/paymentMethods/context.js +1 -0
  266. package/checkout/paymentMethods/index.js +28 -0
  267. package/checkout/paymentMethods/paypal/PaypalButton.js +5 -0
  268. package/checkout/paymentMethods/paypal/PaypalButtonApp.js +4 -0
  269. package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +8 -0
  270. package/checkout/paymentMethods/paypal/PaypalPayButton.js +12 -0
  271. package/checkout/paymentMethods/paypal/PaypalProvider.js +6 -0
  272. package/checkout/paymentMethods/paypal/index.js +1 -0
  273. package/checkout/paymentMethods/paypal/paypal_logo.png +0 -0
  274. package/checkout/paymentMethods/paypal/sdk.js +9 -0
  275. package/checkout/paymentMethods/stripe/StripeButton.connector.js +6 -0
  276. package/checkout/paymentMethods/stripe/StripeButton.js +5 -0
  277. package/checkout/paymentMethods/stripe/StripeCreditCard.js +10 -0
  278. package/checkout/paymentMethods/stripe/StripePayButton.js +6 -0
  279. package/checkout/paymentMethods/stripe/StripeProvider.connector.js +6 -0
  280. package/checkout/paymentMethods/stripe/StripeProvider.context.js +1 -0
  281. package/checkout/paymentMethods/stripe/StripeProvider.js +33 -0
  282. package/checkout/paymentMethods/stripe/applepay.svg +84 -0
  283. package/checkout/paymentMethods/stripe/googlepay.png +0 -0
  284. package/checkout/paymentMethods/stripe/index.js +1 -0
  285. package/checkout/paymentMethods/stripe/sdk.js +9 -0
  286. package/checkout/providers/AddressBookProvider.context.js +1 -0
  287. package/checkout/providers/AddressBookProvider.js +11 -0
  288. package/checkout/providers/CheckoutProvider.connector.js +7 -0
  289. package/checkout/providers/CheckoutProvider.constraints.js +1 -0
  290. package/checkout/providers/CheckoutProvider.context.js +1 -0
  291. package/checkout/providers/CheckoutProvider.js +28 -0
  292. package/checkout/reducers/index.js +6 -0
  293. package/checkout/selectors/campaign.js +5 -0
  294. package/checkout/selectors/guestCheckout.js +5 -0
  295. package/checkout/selectors/order.js +59 -0
  296. package/checkout/selectors/payment.js +17 -0
  297. package/checkout/selectors/route.js +4 -0
  298. package/checkout/streams/index.js +1 -0
  299. package/checkout/subscriptions/index.js +3 -0
  300. package/components/BrandingColorBanner/BrandingColorBanner.js +5 -0
  301. package/components/BrandingColorBanner/index.js +1 -0
  302. package/components/ChipLayout/index.js +7 -7
  303. package/components/ChipLayout/spec.js +1 -1
  304. package/components/ChipLayout/style.js +2 -2
  305. package/components/ConditionalWrapper/ConditionalWrapper.js +10 -0
  306. package/components/ConditionalWrapper/index.js +1 -5
  307. package/components/ConnectedReactPortal/index.js +13 -0
  308. package/components/Footer/Footer.js +4 -23
  309. package/components/Footer/Footer.style.js +1 -7
  310. package/components/Footer/constants.js +1 -0
  311. package/components/Footer/helpers.js +75 -0
  312. package/components/Form/Builder/Builder.constants.js +1 -1
  313. package/components/Form/Builder/Builder.js +53 -37
  314. package/components/Form/Builder/ElementCheckbox.js +2 -2
  315. package/components/Form/Builder/ElementMultiSelect.js +6 -0
  316. package/components/Form/Builder/ElementPhoneNumber.js +20 -0
  317. package/components/Form/Builder/ElementRadio.js +2 -2
  318. package/components/Form/Builder/ElementSelect.js +3 -3
  319. package/components/Form/Builder/ElementText.js +4 -4
  320. package/components/Form/Builder/FormHelper.js +5 -0
  321. package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
  322. package/components/Form/Builder/classes/ActionListener.js +72 -15
  323. package/components/Form/Builder/helpers/buildCountryList.js +3 -3
  324. package/components/Form/Builder/helpers/buildFormDefaults.js +1 -1
  325. package/components/Form/Builder/helpers/buildProvinceList.js +1 -1
  326. package/components/Form/Builder/helpers/common.js +6 -0
  327. package/components/Form/Builder/stylePresets.js +1 -0
  328. package/components/Form/Form.js +11 -8
  329. package/components/Form/index.js +1 -1
  330. package/components/IntersectionVisibility/index.js +13 -6
  331. package/components/Logo/connector.js +4 -0
  332. package/components/Logo/index.js +2 -2
  333. package/components/Logo/spec.js +1 -1
  334. package/components/Logo/style.js +1 -1
  335. package/components/Menu/components/Item/index.js +8 -0
  336. package/components/Menu/components/Item/style.js +4 -0
  337. package/components/Menu/components/Position/index.js +16 -0
  338. package/components/Menu/components/Position/style.js +1 -0
  339. package/components/Menu/index.js +12 -0
  340. package/components/Menu/style.js +1 -0
  341. package/components/MessageBar/MessageBar.js +9 -0
  342. package/components/MessageBar/MessageBar.style.js +11 -0
  343. package/components/MessageBar/index.js +1 -7
  344. package/components/NavigationHandler/connector.js +1 -1
  345. package/components/NavigationHandler/index.js +6 -6
  346. package/components/NavigationHandler/spec.js +1 -1
  347. package/components/Picker/components/Button/index.js +1 -1
  348. package/components/Picker/components/List/index.js +2 -2
  349. package/components/Picker/components/Modal/index.js +7 -7
  350. package/components/Picker/index.js +19 -10
  351. package/components/Picker/spec.js +2 -2
  352. package/components/PickerUtilize/components/Button/index.js +1 -1
  353. package/components/PickerUtilize/index.js +8 -6
  354. package/components/PickerUtilize/spec.js +2 -1
  355. package/components/QuantityInput/QuantityInput.js +5 -4
  356. package/components/QuantityLabel/QuantityLabel.js +4 -0
  357. package/components/QuantityLabel/index.js +1 -0
  358. package/components/Radio/Radio.js +5 -0
  359. package/components/Radio/index.js +1 -0
  360. package/components/RadioCard/RadioCard.js +9 -0
  361. package/components/RadioCard/index.js +1 -0
  362. package/components/RadioGroup/RadioGroup.context.js +1 -0
  363. package/components/RadioGroup/RadioGroup.js +4 -0
  364. package/components/RadioGroup/index.js +1 -0
  365. package/components/RadioGroup/useRadioGroup.js +4 -0
  366. package/components/RangeSlider/components/Handle/index.js +2 -2
  367. package/components/RangeSlider/components/Handle/style.js +1 -1
  368. package/components/RangeSlider/helper.js +3 -3
  369. package/components/RangeSlider/index.js +35 -23
  370. package/components/RangeSlider/spec.js +4 -4
  371. package/components/ResponsiveContainer/ResponsiveContainer.js +6 -0
  372. package/components/ResponsiveContainer/breakpoints.js +14 -0
  373. package/components/ResponsiveContainer/condition.js +6 -0
  374. package/components/ResponsiveContainer/hooks.js +20 -0
  375. package/components/ResponsiveContainer/index.js +1 -0
  376. package/components/ResponsiveContainer/listener.js +10 -0
  377. package/components/ResponsiveContainer/mediaQuery.js +8 -0
  378. package/components/ScrollHeader/index.js +22 -5
  379. package/components/ScrollHeader/style.js +1 -1
  380. package/components/SheetDrawer/index.js +4 -3
  381. package/components/SheetList/components/Item/index.js +5 -5
  382. package/components/SheetList/components/Item/spec.js +2 -2
  383. package/components/SheetList/components/Item/style.js +1 -1
  384. package/components/SheetList/index.js +4 -4
  385. package/components/SheetList/spec.js +1 -1
  386. package/components/SheetList/style.js +1 -1
  387. package/components/SideNavigation/SideNavigation.hooks.js +4 -0
  388. package/components/SideNavigation/SideNavigation.js +4 -0
  389. package/components/SideNavigation/SideNavigationCategories.connector.js +8 -0
  390. package/components/SideNavigation/SideNavigationCategories.js +4 -0
  391. package/components/SideNavigation/SideNavigationCategories.style.js +1 -0
  392. package/components/SideNavigation/SideNavigationCategoriesItem.connector.js +8 -0
  393. package/components/SideNavigation/SideNavigationCategoriesItem.js +5 -0
  394. package/components/SideNavigation/SideNavigationCategoriesItem.style.js +2 -0
  395. package/components/SideNavigation/SideNavigationCategoriesItemChildren.js +5 -0
  396. package/components/SideNavigation/SideNavigationContent.js +3 -0
  397. package/components/SideNavigation/SideNavigationContent.style.js +4 -0
  398. package/components/SideNavigation/SideNavigationItem.js +4 -0
  399. package/components/SideNavigation/SideNavigationItem.style.js +4 -0
  400. package/components/SideNavigation/SideNavigationLinks.js +4 -0
  401. package/components/SideNavigation/SideNavigationLinksLegal.connector.js +4 -0
  402. package/components/SideNavigation/SideNavigationLinksLegal.js +5 -0
  403. package/components/SideNavigation/SideNavigationLinksQuicklinks.connector.js +4 -0
  404. package/components/SideNavigation/SideNavigationLinksQuicklinks.js +5 -0
  405. package/components/SideNavigation/SideNavigationNestedItem.js +4 -0
  406. package/components/SideNavigation/SideNavigationProvider.connector.js +8 -0
  407. package/components/SideNavigation/SideNavigationProvider.context.js +1 -0
  408. package/components/SideNavigation/SideNavigationProvider.js +4 -0
  409. package/components/SideNavigation/index.js +1 -0
  410. package/components/SideNavigation/selectors.js +17 -0
  411. package/components/SnackBarContainer/index.js +1 -1
  412. package/components/Switch/index.js +1 -1
  413. package/components/Tabs/TabContext.js +7 -0
  414. package/components/Tabs/components/Tab.js +11 -0
  415. package/components/Tabs/components/Tab.style.js +1 -0
  416. package/components/Tabs/components/TabIndicator.js +5 -0
  417. package/components/Tabs/components/TabIndicator.style.js +1 -0
  418. package/components/Tabs/components/TabPanel.js +5 -0
  419. package/components/Tabs/components/Tabs.js +11 -0
  420. package/components/Tabs/components/Tabs.style.js +2 -0
  421. package/components/Tabs/debounce.js +11 -0
  422. package/components/Tabs/index.js +1 -0
  423. package/components/Tabs/ownerDocument.js +4 -0
  424. package/components/Tabs/ownerWindow.js +4 -0
  425. package/components/Tabs/useEventCallback.js +6 -0
  426. package/components/TextLink/TextLink.js +5 -0
  427. package/components/TextLink/TextLink.style.js +1 -0
  428. package/components/TimeBoundary/index.js +10 -8
  429. package/components/TimeBoundary/spec.js +3 -3
  430. package/components/Toggle/index.js +5 -0
  431. package/components/Toggle/style.js +1 -0
  432. package/components/VideoPlayer/index.js +9 -6
  433. package/components/View/components/Above/index.js +1 -1
  434. package/components/View/components/Below/index.js +1 -1
  435. package/components/View/components/Content/index.js +13 -13
  436. package/components/View/components/Content/style.js +1 -1
  437. package/components/View/context.js +1 -1
  438. package/components/View/index.js +5 -5
  439. package/components/View/provider.js +24 -7
  440. package/components/View/style.js +1 -6
  441. package/components/index.js +4 -4
  442. package/core/action-creators/appPermissions.js +1 -1
  443. package/core/action-creators/index.js +1 -1
  444. package/core/action-creators/merchantSettings.js +5 -0
  445. package/core/action-creators/optIns.js +37 -0
  446. package/core/action-creators/shopSettings.js +9 -0
  447. package/core/actions/getGeolocation.js +2 -2
  448. package/core/actions/grantAppTrackingTransparencyPermission.js +3 -1
  449. package/core/actions/grantGeolocationPermissions.js +6 -2
  450. package/core/actions/grantPermissions.js +16 -4
  451. package/core/actions/grantPushPermissions.js +4 -3
  452. package/core/actions/index.js +2 -2
  453. package/core/actions/requestAppPermission.js +7 -2
  454. package/core/actions/requestAppPermissionStatus.js +7 -2
  455. package/core/actions/updateStatusBarBackground.js +3 -3
  456. package/core/classes/GeolocationRequest.js +8 -4
  457. package/core/classes/GeolocationRequestApp.js +16 -0
  458. package/core/classes/GeolocationRequestBrowser.js +8 -0
  459. package/core/collections/AppInitialization.js +4 -6
  460. package/core/config/ThemeConfigResolver.js +3 -3
  461. package/core/config/config.action-creators.js +12 -0
  462. package/core/config/config.actions.js +3 -0
  463. package/core/config/config.constants.js +1 -0
  464. package/core/config/config.reducers.js +6 -0
  465. package/core/config/config.selectors.js +39 -0
  466. package/core/config/config.streams.js +1 -0
  467. package/core/config/config.subscriptions.js +4 -0
  468. package/core/config/config.types.js +0 -0
  469. package/core/config/index.js +1 -0
  470. package/core/constants/appFeatures.js +1 -1
  471. package/core/constants/deviceTypes.js +1 -0
  472. package/core/constants/geolocationRequest.js +1 -1
  473. package/core/constants/index.js +3 -3
  474. package/core/constants/merchantSettings.js +1 -0
  475. package/core/constants/optIns.js +1 -0
  476. package/core/constants/pipelines.js +1 -0
  477. package/core/constants/shopSettings.js +2 -0
  478. package/core/contexts/AppContext.js +1 -1
  479. package/core/contexts/ThemeResourcesContext.d.ts +60 -0
  480. package/core/contexts/ThemeResourcesContext.js +3 -0
  481. package/core/contexts/index.js +1 -0
  482. package/core/events/index.js +1 -0
  483. package/core/helpers/androidNavigationBar.js +12 -0
  484. package/core/helpers/appFeatures.js +21 -9
  485. package/core/helpers/appPermissions.js +58 -0
  486. package/core/helpers/baseUrl.js +1 -1
  487. package/core/helpers/bridge.js +4 -0
  488. package/core/helpers/deviceType.js +5 -0
  489. package/core/helpers/environment.js +4 -0
  490. package/core/helpers/errorBehavior.js +32 -0
  491. package/core/helpers/featureFlag.js +11 -0
  492. package/core/helpers/getFullImageSource.js +21 -2
  493. package/core/helpers/googleMaps.js +8 -0
  494. package/core/helpers/i18n.js +10 -5
  495. package/core/helpers/index.js +3 -3
  496. package/core/helpers/isIOSTheme.js +4 -0
  497. package/core/helpers/isTouchDevice.js +4 -0
  498. package/core/helpers/nl2br.js +1 -0
  499. package/core/helpers/scrollContainer.js +4 -0
  500. package/core/helpers/string.js +9 -0
  501. package/core/helpers/svgToDataUrl.js +9 -0
  502. package/core/helpers/updateLegacyNavigationBar.js +5 -2
  503. package/core/hocs/index.js +1 -0
  504. package/core/hocs/withApp.js +1 -1
  505. package/core/hocs/withCurrentProduct.js +3 -3
  506. package/core/hocs/withForwardedRef.js +1 -1
  507. package/core/hocs/withNavigation.js +1 -1
  508. package/core/hocs/withRoute.js +1 -1
  509. package/core/hocs/withTheme.js +42 -3
  510. package/core/hocs/withThemeResources.js +16 -0
  511. package/core/hocs/withWidgetSettings.js +1 -1
  512. package/core/hocs/withWidgetStyles.js +1 -1
  513. package/core/hooks/events/index.js +1 -0
  514. package/core/hooks/events/useLongPress.d.ts +68 -0
  515. package/core/hooks/events/useLongPress.js +13 -0
  516. package/core/hooks/events/useScrollDirectionChange.d.ts +74 -0
  517. package/core/hooks/events/useScrollDirectionChange.js +18 -0
  518. package/core/hooks/html/useLoadImage.js +1 -1
  519. package/core/hooks/index.js +1 -0
  520. package/core/hooks/layout/index.js +1 -0
  521. package/core/hooks/layout/useElementSize.d.ts +46 -0
  522. package/core/hooks/layout/useElementSize.js +18 -0
  523. package/core/hooks/useAsyncMemo.js +12 -0
  524. package/core/hooks/useFormState.js +27 -0
  525. package/core/hooks/usePrevious.js +2 -0
  526. package/core/hooks/useScrollTo.js +5 -0
  527. package/core/hooks/useTheme.js +38 -2
  528. package/core/hooks/useThemeResources.js +21 -0
  529. package/core/hooks/useWidgetStyles.js +1 -1
  530. package/core/index.js +5 -11
  531. package/core/initialization/index.js +19 -4
  532. package/core/providers/AppProvider.js +9 -9
  533. package/core/providers/ThemeResourcesProvider.js +15 -0
  534. package/core/providers/index.js +1 -0
  535. package/core/reducers/index.js +1 -1
  536. package/core/reducers/merchantSettings.js +6 -0
  537. package/core/reducers/shopSettings.js +6 -0
  538. package/core/selectors/index.js +1 -1
  539. package/core/selectors/merchantSettings.js +10 -0
  540. package/core/selectors/shopSettings.js +25 -0
  541. package/core/streams/app.js +1 -1
  542. package/core/streams/index.js +1 -1
  543. package/core/streams/optIns.js +13 -0
  544. package/core/subscriptions/app.js +4 -3
  545. package/core/validation/index.js +1 -0
  546. package/core/validation/validation.hooks.js +4 -0
  547. package/core/validation/validation.js +12 -0
  548. package/development/action-creators/index.js +1 -0
  549. package/development/action-creators/settings.js +9 -0
  550. package/development/action-creators/storage.js +6 -0
  551. package/development/components/DevelopmentTools/DevelopmentTools.js +6 -0
  552. package/development/components/DevelopmentTools/Shortcuts.js +4 -0
  553. package/development/components/DevelopmentTools/hooks.js +8 -0
  554. package/development/components/DevelopmentTools/index.js +1 -0
  555. package/development/components/SimulatedInsets/SimulatedInsetBottom.js +7 -0
  556. package/development/components/SimulatedInsets/SimulatedInsetTop.js +12 -0
  557. package/development/components/SimulatedInsets/SimulatedInsets.js +6 -0
  558. package/development/components/SimulatedInsets/index.js +1 -0
  559. package/development/components/index.js +1 -0
  560. package/development/constants/actionTypes.js +1 -0
  561. package/development/constants/index.js +1 -0
  562. package/development/reducers/index.js +1 -0
  563. package/development/reducers/settings.js +10 -0
  564. package/development/reducers/storage.js +9 -0
  565. package/development/selectors/index.js +1 -0
  566. package/development/selectors/settings.js +21 -0
  567. package/development/selectors/storage.js +16 -0
  568. package/development/streams/index.js +1 -0
  569. package/development/streams/insets.js +4 -0
  570. package/development/subscriptions/index.js +6 -0
  571. package/favorites/components/CommentDialog/CommentDialog.js +12 -0
  572. package/favorites/components/CommentDialog/index.js +1 -0
  573. package/favorites/components/FavoriteButtonWide/FavoriteButtonWide.js +8 -0
  574. package/favorites/components/FavoriteButtonWide/index.js +1 -0
  575. package/favorites/components/Item/Item.js +13 -9
  576. package/favorites/components/Item/ItemCharacteristics.js +2 -2
  577. package/favorites/components/Item/ItemNotes.js +7 -0
  578. package/favorites/components/Item/ItemQuantity.js +7 -0
  579. package/favorites/components/ItemFulfillmentMethod/ItemFulfillmentMethod.js +4 -0
  580. package/favorites/components/ItemFulfillmentMethod/index.js +1 -0
  581. package/favorites/components/List/List.js +19 -15
  582. package/favorites/components/List/ListAccordionHeader.js +8 -0
  583. package/favorites/components/List/ListAccordionLabel.js +5 -0
  584. package/favorites/components/List/ListContent.js +8 -0
  585. package/favorites/components/List/ListItemWrapper.js +6 -0
  586. package/favorites/components/List/styles.js +1 -0
  587. package/favorites/components/ListChooser/ListChooser.js +2 -2
  588. package/favorites/components/ListChooser/ListChooserItem.js +4 -5
  589. package/favorites/components/Lists/Lists.js +17 -13
  590. package/favorites/components/Lists/ListsModal.js +3 -4
  591. package/favorites/components/RemoveButton/RemoveButton.js +2 -2
  592. package/favorites/constants/Portals.js +1 -2
  593. package/favorites/constants/index.js +1 -0
  594. package/favorites/index.js +2 -2
  595. package/filter/actions/index.js +1 -0
  596. package/filter/components/FilterItem/index.js +2 -2
  597. package/filter/components/FilterItem/spec.js +1 -1
  598. package/filter/components/FilterPageContent/components/ApplyButton/index.js +7 -0
  599. package/filter/components/FilterPageContent/components/ApplyButton/spec.js +1 -0
  600. package/filter/components/FilterPageContent/components/ApplyButton/style.js +1 -0
  601. package/filter/components/FilterPageContent/components/ResetButton/index.js +7 -0
  602. package/filter/components/FilterPageContent/components/ResetButton/spec.js +1 -0
  603. package/filter/components/FilterPageContent/components/ResetButton/style.js +1 -0
  604. package/filter/components/FilterPageContent/components/Selector/components/Selected/index.js +7 -0
  605. package/filter/components/FilterPageContent/components/Selector/components/Selected/spec.js +1 -0
  606. package/filter/components/FilterPageContent/components/Selector/components/Selected/style.js +1 -0
  607. package/filter/components/FilterPageContent/components/Selector/components/Toggle/index.js +7 -0
  608. package/filter/components/FilterPageContent/components/Selector/components/Toggle/spec.js +1 -0
  609. package/filter/components/FilterPageContent/components/Selector/components/Toggle/style.js +1 -0
  610. package/filter/components/FilterPageContent/components/Selector/components/ValueButton/index.js +7 -0
  611. package/filter/components/FilterPageContent/components/Selector/components/ValueButton/spec.js +1 -0
  612. package/filter/components/FilterPageContent/components/Selector/components/ValueButton/style.js +1 -0
  613. package/filter/components/FilterPageContent/components/Selector/index.js +19 -0
  614. package/filter/components/FilterPageContent/components/Selector/spec.js +1 -0
  615. package/filter/components/FilterPageContent/components/Selector/style.js +1 -0
  616. package/filter/components/FilterPageContent/index.js +6 -0
  617. package/filter/components/FilterPageContentWithProvider/index.js +16 -0
  618. package/filter/components/PriceSlider/components/Label/index.js +3 -3
  619. package/filter/components/PriceSlider/components/Label/spec.js +1 -1
  620. package/filter/components/PriceSlider/index.js +8 -8
  621. package/filter/components/PriceSlider/spec.js +1 -1
  622. package/filter/components/PriceSlider/style.js +1 -1
  623. package/filter/components/index.js +1 -0
  624. package/filter/constants/index.js +1 -0
  625. package/filter/constants/sort.js +11 -0
  626. package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +2 -2
  627. package/filter/helpers/buildInitialFilters.js +2 -2
  628. package/filter/helpers/buildUpdatedFilters.js +2 -2
  629. package/filter/helpers/index.js +1 -0
  630. package/filter/helpers/translateFilterLabel.js +3 -3
  631. package/filter/hocs/index.js +1 -0
  632. package/filter/hocs/withSort.js +16 -0
  633. package/filter/hooks/filterPage.js +5 -0
  634. package/filter/hooks/index.js +4 -0
  635. package/filter/index.js +2 -7
  636. package/filter/providers/FilterPageProvider.context.js +54 -0
  637. package/filter/providers/FilterPageProvider.js +98 -0
  638. package/filter/providers/SortProvider.connector.js +3 -0
  639. package/filter/providers/SortProvider.context.js +1 -0
  640. package/filter/providers/SortProvider.helpers.js +8 -0
  641. package/filter/providers/SortProvider.js +6 -0
  642. package/filter/providers/index.js +1 -0
  643. package/filter/selectors/index.js +17 -0
  644. package/filter/streams/index.js +1 -0
  645. package/i18n/countries.helpers.js +6 -0
  646. package/i18n/countries.hooks.js +6 -0
  647. package/i18n/index.js +1 -0
  648. package/i18n/locale/cs-cz/countries.json +255 -0
  649. package/i18n/locale/de-de/countries.json +255 -0
  650. package/i18n/locale/el-gr/countries.json +255 -0
  651. package/i18n/locale/en-us/countries.json +255 -0
  652. package/i18n/locale/es-es/countries.json +255 -0
  653. package/i18n/locale/fi-fi/countries.json +255 -0
  654. package/i18n/locale/fr-fr/countries.json +255 -0
  655. package/i18n/locale/hu-hu/countries.json +255 -0
  656. package/i18n/locale/it-it/countries.json +255 -0
  657. package/i18n/locale/nl-nl/countries.json +255 -0
  658. package/i18n/locale/pl-pl/countries.json +255 -0
  659. package/i18n/locale/pt-pt/countries.json +255 -0
  660. package/i18n/locale/ro-ro/countries.json +255 -0
  661. package/i18n/locale/sv-se/countries.json +255 -0
  662. package/locations/action-creators/errorInventories.js +7 -0
  663. package/locations/action-creators/errorLocations.js +6 -0
  664. package/locations/action-creators/errorProductInventories.js +7 -0
  665. package/locations/action-creators/errorProductLocations.js +6 -0
  666. package/locations/action-creators/index.js +1 -0
  667. package/locations/action-creators/provideProductAlternativeLocation.js +5 -0
  668. package/locations/action-creators/receiveInventories.js +5 -0
  669. package/locations/action-creators/receiveLocations.js +6 -0
  670. package/locations/action-creators/receiveProductInventories.js +7 -0
  671. package/locations/action-creators/receiveProductLocations.js +7 -0
  672. package/locations/action-creators/requestInventories.js +6 -0
  673. package/locations/action-creators/requestLocations.js +5 -0
  674. package/locations/action-creators/requestProductInventories.js +6 -0
  675. package/locations/action-creators/requestProductLocations.js +5 -0
  676. package/locations/action-creators/selectGlobalLocation.js +5 -0
  677. package/locations/action-creators/selectLocation.js +6 -0
  678. package/locations/action-creators/setStoreFinderSearchRadius.js +5 -0
  679. package/locations/action-creators/setUserGeolocation.js +5 -0
  680. package/locations/action-creators/setUserSearchCountryCode.js +7 -0
  681. package/locations/action-creators/setUserSearchGeolocation.js +8 -0
  682. package/locations/action-creators/setUserSearchPostalCode.js +7 -0
  683. package/locations/action-creators/storeFormInput.js +5 -0
  684. package/locations/action-creators/storeFulfillmentMethod.js +5 -0
  685. package/locations/action-creators/submitReservationError.js +5 -0
  686. package/locations/action-creators/submitReservationRequest.js +5 -0
  687. package/locations/action-creators/submitReservationSuccess.js +5 -0
  688. package/locations/actions/fetchDefaultLocation.js +4 -0
  689. package/locations/actions/fetchFulfillmentSlots.js +6 -0
  690. package/locations/actions/fetchInventories.js +6 -0
  691. package/locations/actions/fetchLocations.js +19 -0
  692. package/locations/actions/fetchProductInventories.js +7 -0
  693. package/locations/actions/fetchProductLocations.js +12 -0
  694. package/locations/actions/index.js +5 -0
  695. package/locations/actions/sendDefaultLocationCode.js +6 -0
  696. package/locations/actions/setUserGeolocation.js +1 -0
  697. package/locations/actions/setUserSearchGeolocation.js +1 -0
  698. package/locations/actions/submitReservation.js +5 -0
  699. package/locations/assets/leaflet.css +765 -0
  700. package/locations/components/Cart/CartChangeFulfillmentMethod.connector.js +4 -0
  701. package/locations/components/Cart/CartChangeFulfillmentMethod.js +8 -0
  702. package/locations/components/Cart/CartChangeFulfillmentMethod.types.js +0 -0
  703. package/locations/components/Cart/CartContextMenuChangeFulfillment.js +6 -0
  704. package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +5 -0
  705. package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.style.js +1 -0
  706. package/locations/components/Cart/CartContextMenuItemChangeFulfillment.connector.js +4 -0
  707. package/locations/components/Cart/CartContextMenuItemChangeFulfillment.js +6 -0
  708. package/locations/components/Cart/CartContextMenuItemChangeLocation.js +7 -0
  709. package/locations/components/Cart/CartItemProductChangeLocation.connector.js +5 -0
  710. package/locations/components/Cart/CartItemProductChangeLocation.js +11 -0
  711. package/locations/components/Cart/CartItemProductChangeLocation.types.js +0 -0
  712. package/locations/components/Cart/index.js +1 -0
  713. package/locations/components/ChangeLocationButton/ChangeLocationButton.js +4 -0
  714. package/locations/components/ChangeLocationButton/ChangeLocationButton.style.js +2 -0
  715. package/locations/components/ChangeLocationButton/index.js +1 -0
  716. package/locations/components/FulfillmentPath/FulfillmentPath.js +4 -0
  717. package/locations/components/FulfillmentPath/FulfillmentPath.style.js +2 -0
  718. package/locations/components/FulfillmentPath/FulfillmentPathItem.js +6 -0
  719. package/locations/components/FulfillmentPath/index.js +1 -0
  720. package/locations/components/FulfillmentPathSelector/FulfillmentPathSelector.js +14 -0
  721. package/locations/components/FulfillmentPathSelector/FulfillmentPathSelector.style.js +1 -0
  722. package/locations/components/FulfillmentPathSelector/index.js +1 -0
  723. package/locations/components/FulfillmentSelector/FulfillmentSelector.connector.js +9 -0
  724. package/locations/components/FulfillmentSelector/FulfillmentSelector.context.js +1 -0
  725. package/locations/components/FulfillmentSelector/FulfillmentSelector.hooks.js +3 -0
  726. package/locations/components/FulfillmentSelector/FulfillmentSelector.js +20 -0
  727. package/locations/components/FulfillmentSelector/FulfillmentSelector.style.js +1 -0
  728. package/locations/components/FulfillmentSelector/FulfillmentSelector.types.js +1 -0
  729. package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +10 -0
  730. package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +8 -0
  731. package/locations/components/FulfillmentSelector/FulfillmentSelectorBOPIS.js +4 -0
  732. package/locations/components/FulfillmentSelector/FulfillmentSelectorDirectShip.js +5 -0
  733. package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.js +4 -0
  734. package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.style.js +1 -0
  735. package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.js +4 -0
  736. package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.style.js +1 -0
  737. package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.js +8 -0
  738. package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.style.js +1 -0
  739. package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.js +4 -0
  740. package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.style.js +1 -0
  741. package/locations/components/FulfillmentSelector/FulfillmentSelectorLocationMethodNotAvailable.js +3 -0
  742. package/locations/components/FulfillmentSelector/FulfillmentSelectorROPIS.js +4 -0
  743. package/locations/components/FulfillmentSelector/index.js +1 -0
  744. package/locations/components/FulfillmentSheet/FulfillmentSheet.js +6 -0
  745. package/locations/components/FulfillmentSheet/FulfillmentSheet.style.js +1 -0
  746. package/locations/components/FulfillmentSheet/FulfillmentSheetContent.js +6 -0
  747. package/locations/components/FulfillmentSheet/index.js +1 -0
  748. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +28 -0
  749. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.connector.js +8 -0
  750. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.context.js +1 -0
  751. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.js +9 -0
  752. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.connector.js +4 -0
  753. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.js +4 -0
  754. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +3 -0
  755. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.style.js +1 -0
  756. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.js +3 -0
  757. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.style.js +1 -0
  758. package/locations/components/FulfillmentSlotSwitcher/index.js +1 -0
  759. package/locations/components/FulfillmentSlotSwitcher/time.js +5 -0
  760. package/locations/components/GlobalLocationSelector/GlobalLocationSelector.js +16 -0
  761. package/locations/components/GlobalLocationSelector/index.js +1 -0
  762. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.connector.js +8 -0
  763. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.js +3 -0
  764. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +3 -0
  765. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.style.js +1 -0
  766. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.js +3 -0
  767. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.style.js +1 -0
  768. package/locations/components/GlobalLocationSwitcher/index.js +1 -0
  769. package/locations/components/ReservationResponses/ReservationError.js +4 -0
  770. package/locations/components/ReservationResponses/ReservationResponse.style.js +1 -0
  771. package/locations/components/ReservationResponses/ReservationSuccess.js +4 -0
  772. package/locations/components/ReservationResponses/index.js +1 -0
  773. package/locations/components/ReserveForm/ReserveForm.constraints.js +1 -0
  774. package/locations/components/ReserveForm/ReserveForm.js +10 -0
  775. package/locations/components/ReserveForm/ReserveForm.style.js +1 -0
  776. package/locations/components/ReserveForm/ReserveFormPhone.connector.js +3 -0
  777. package/locations/components/ReserveForm/ReserveFormPhone.js +5 -0
  778. package/locations/components/ReserveForm/ReserveFormPhone.types.js +0 -0
  779. package/locations/components/ReserveForm/index.js +1 -0
  780. package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -0
  781. package/locations/components/StockInfo/StockInfo.js +8 -0
  782. package/locations/components/StockInfo/StockInfoInventory.js +9 -0
  783. package/locations/components/StockInfo/index.js +1 -0
  784. package/locations/components/StockInfoLists/index.js +9 -0
  785. package/locations/components/StoreDetails/components/FindMoreStores.js +4 -0
  786. package/locations/components/StoreDetails/components/GetDirectionsButton.js +7 -0
  787. package/locations/components/StoreDetails/components/StoreDetails.js +5 -0
  788. package/locations/components/StoreDetails/components/StoreFinderMap.js +20 -0
  789. package/locations/components/StoreDetails/components/StoreFinderMap.style.js +1 -0
  790. package/locations/components/StoreDetails/components/StoreLocationMap.js +4 -0
  791. package/locations/components/StoreDetails/components/StoresNearby.js +4 -0
  792. package/locations/components/StoreDetails/components/StoresNearbyListItem.js +9 -0
  793. package/locations/components/StoreDetails/index.js +4 -0
  794. package/locations/components/StoreFinder/Store.context.js +1 -0
  795. package/locations/components/StoreFinder/StoreFinder.js +3 -0
  796. package/locations/components/StoreFinder/StoreFinder.style.js +1 -0
  797. package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.connector.js +4 -0
  798. package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.js +4 -0
  799. package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.style.js +1 -0
  800. package/locations/components/StoreFinder/StoreFinderLocation.js +3 -0
  801. package/locations/components/StoreFinder/StoreFinderLocation.style.js +1 -0
  802. package/locations/components/StoreFinder/StoreFinderLocationDetails.js +3 -0
  803. package/locations/components/StoreFinder/StoreFinderLocationDetails.style.js +1 -0
  804. package/locations/components/StoreFinder/StoreFinderLocationHeader.js +3 -0
  805. package/locations/components/StoreFinder/StoreFinderLocationHeader.style.js +1 -0
  806. package/locations/components/StoreFinder/StoreFinderLocationHeaderPhoneNumber.js +4 -0
  807. package/locations/components/StoreFinder/StoreFinderLocations.js +5 -0
  808. package/locations/components/StoreFinder/StoreFinderLocations.style.js +1 -0
  809. package/locations/components/StoreFinder/StoreFinderSearch.js +3 -0
  810. package/locations/components/StoreFinder/StoreFinderSearch.style.js +1 -0
  811. package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +5 -0
  812. package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +8 -0
  813. package/locations/components/StoreFinder/index.js +1 -0
  814. package/locations/components/StoreList/Store.context.js +1 -0
  815. package/locations/components/StoreList/Store.style.js +1 -0
  816. package/locations/components/StoreList/StoreAddress.js +7 -0
  817. package/locations/components/StoreList/StoreAddressShort.js +7 -0
  818. package/locations/components/StoreList/StoreCard.js +4 -0
  819. package/locations/components/StoreList/StoreDetails.js +4 -0
  820. package/locations/components/StoreList/StoreDetailsLine.js +8 -0
  821. package/locations/components/StoreList/StoreDistance.js +7 -0
  822. package/locations/components/StoreList/StoreHeader.js +4 -0
  823. package/locations/components/StoreList/StoreHoursToday.js +7 -0
  824. package/locations/components/StoreList/StoreList.js +4 -0
  825. package/locations/components/StoreList/StoreListLocations.js +4 -0
  826. package/locations/components/StoreList/StoreListProduct.js +4 -0
  827. package/locations/components/StoreList/StoreListProduct.style.js +1 -0
  828. package/locations/components/StoreList/StoreListProductInfo.js +4 -0
  829. package/locations/components/StoreList/StoreListProductName.js +4 -0
  830. package/locations/components/StoreList/StoreListSearch.connector.js +7 -0
  831. package/locations/components/StoreList/StoreListSearch.js +23 -0
  832. package/locations/components/StoreList/StoreListSearch.style.js +1 -0
  833. package/locations/components/StoreList/StoreListSearchRadius.connector.js +7 -0
  834. package/locations/components/StoreList/StoreListSearchRadius.js +4 -0
  835. package/locations/components/StoreList/StoreListSearchRadius.style.js +1 -0
  836. package/locations/components/StoreList/StoreOpeningHours.js +7 -0
  837. package/locations/components/StoreList/StoreOpeningHoursLine.js +7 -0
  838. package/locations/components/StoreList/StorePhoneNumber.js +6 -0
  839. package/locations/components/StoreList/StoreSelectLocationButton.js +4 -0
  840. package/locations/components/StoreList/index.js +1 -0
  841. package/locations/components/index.js +1 -0
  842. package/locations/constants/ActionTypes.js +10 -0
  843. package/locations/constants/Pipelines.js +1 -0
  844. package/locations/constants/Portals.js +2 -0
  845. package/locations/constants/Stages.js +1 -0
  846. package/locations/constants/index.js +7 -0
  847. package/locations/constants/routes.js +1 -0
  848. package/locations/helpers/createOrder.js +28 -0
  849. package/locations/helpers/formatDistance.js +9 -0
  850. package/locations/helpers/getAvailabilitySettings.js +12 -0
  851. package/locations/helpers/index.js +1 -0
  852. package/locations/helpers/productInventory.js +7 -0
  853. package/locations/helpers/showInventoryInLists.js +7 -0
  854. package/locations/index.js +9 -0
  855. package/locations/locations.context.js +1 -0
  856. package/locations/locations.hooks.js +4 -0
  857. package/locations/locations.streams.js +1 -0
  858. package/locations/locations.types.js +1 -0
  859. package/locations/providers/FulfillmentProvider.connector.js +10 -0
  860. package/locations/providers/FulfillmentProvider.js +49 -0
  861. package/locations/providers/FulfillmentProvider.types.js +1 -0
  862. package/locations/providers/StoreDetailsContext.js +1 -0
  863. package/locations/providers/StoreDetailsProvider.js +4 -0
  864. package/locations/providers/StoreFinder.connector.js +3 -0
  865. package/locations/providers/StoreFinderProvider.js +7 -0
  866. package/locations/providers/index.js +1 -0
  867. package/locations/reducers/index.js +1 -0
  868. package/locations/reducers/storage.js +24 -0
  869. package/locations/reducers/storeFinderSearch.js +6 -0
  870. package/locations/reducers/user.js +5 -0
  871. package/locations/reducers/userFormInput.js +8 -0
  872. package/locations/reducers/userSearch.js +6 -0
  873. package/locations/selectors/index.js +145 -0
  874. package/locations/subscriptions.js +27 -0
  875. package/login/action-creators/index.js +1 -0
  876. package/login/action-creators/resetPassword.js +14 -0
  877. package/login/actions/index.js +1 -0
  878. package/login/actions/resetPassword.js +5 -0
  879. package/login/components/ForgotPassword/ForgotPassword.connector.js +5 -0
  880. package/login/components/ForgotPassword/ForgotPassword.js +5 -0
  881. package/login/components/ForgotPassword/ForgotPassword.style.js +1 -0
  882. package/login/components/ForgotPassword/index.js +1 -0
  883. package/login/constants/actions.js +1 -0
  884. package/login/constants/index.js +1 -0
  885. package/login/constants/pipelines.js +1 -0
  886. package/login/constants/routes.js +1 -0
  887. package/login/index.js +1 -0
  888. package/orders/action-creators/index.js +1 -0
  889. package/orders/action-creators/orderDetails.js +22 -0
  890. package/orders/action-creators/orders.js +21 -0
  891. package/orders/actions/cancelOrder.js +8 -0
  892. package/orders/actions/fetchOrderDetails.js +10 -0
  893. package/orders/actions/fetchOrderHistory.js +7 -0
  894. package/orders/actions/index.js +1 -0
  895. package/orders/components/OrderDetails/OrderDetails.js +4 -0
  896. package/orders/components/OrderDetails/OrderDetailsAuthenticate.js +3 -0
  897. package/orders/components/OrderDetails/OrderDetailsAuthenticate.style.js +1 -0
  898. package/orders/components/OrderDetails/OrderDetailsAuthenticateForm.config.js +8 -0
  899. package/orders/components/OrderDetails/OrderDetailsContent.js +3 -0
  900. package/orders/components/OrderDetails/OrderDetailsContent.style.js +1 -0
  901. package/orders/components/OrderDetails/OrderDetailsOrder.js +4 -0
  902. package/orders/components/OrderDetails/OrderDetailsOrder.style.js +1 -0
  903. package/orders/components/OrderDetails/OrderDetailsOrderHeader.js +4 -0
  904. package/orders/components/OrderDetails/OrderDetailsOrderHeader.style.js +1 -0
  905. package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.connector.js +3 -0
  906. package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.js +4 -0
  907. package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.style.js +1 -0
  908. package/orders/components/OrderDetails/index.js +1 -0
  909. package/orders/components/OrderHistory/OrderHistory.js +4 -0
  910. package/orders/components/OrderHistory/OrderHistory.style.js +1 -0
  911. package/orders/components/OrderHistory/OrderHistoryList.js +9 -0
  912. package/orders/components/OrderHistory/OrderHistoryList.style.js +1 -0
  913. package/orders/components/OrderHistory/OrderHistoryLoader.js +4 -0
  914. package/orders/components/OrderHistory/OrderHistoryTable.js +9 -0
  915. package/orders/components/OrderHistory/OrderHistoryTable.style.js +1 -0
  916. package/orders/components/OrderHistory/index.js +1 -0
  917. package/orders/components/index.js +1 -0
  918. package/orders/constants/actionTypes.js +1 -0
  919. package/orders/constants/index.js +1 -0
  920. package/orders/constants/pipelines.js +1 -0
  921. package/orders/constants/routes.js +1 -0
  922. package/orders/constants/status.js +12 -0
  923. package/orders/helpers/index.js +1 -0
  924. package/orders/helpers/orderDetails.js +5 -0
  925. package/orders/helpers/orderStatus.js +15 -0
  926. package/orders/hooks/index.js +7 -0
  927. package/orders/index.js +1 -1
  928. package/orders/providers/OrderDetailsPrivateProvider.connector.js +11 -0
  929. package/orders/providers/OrderDetailsPrivateProvider.js +5 -0
  930. package/orders/providers/OrderDetailsProvider.connector.js +11 -0
  931. package/orders/providers/OrderDetailsProvider.constraints.js +1 -0
  932. package/orders/providers/OrderDetailsProvider.context.js +1 -0
  933. package/orders/providers/OrderDetailsProvider.js +11 -0
  934. package/orders/providers/OrderHistoryProvider.connector.js +9 -0
  935. package/orders/providers/OrderHistoryProvider.context.js +1 -0
  936. package/orders/providers/OrderHistoryProvider.js +4 -0
  937. package/orders/reducers/index.js +1 -0
  938. package/orders/reducers/orders.js +7 -0
  939. package/orders/reducers/ordersById.js +7 -0
  940. package/orders/reducers/ordersByNumber.js +7 -0
  941. package/orders/selectors/index.js +27 -0
  942. package/orders/subscriptions/index.js +4 -0
  943. package/package.json +26 -18
  944. package/page/actions/index.js +1 -0
  945. package/page/components/NotFound.js +3 -0
  946. package/page/components/index.js +1 -0
  947. package/page/index.js +2 -4
  948. package/page/selectors/index.js +7 -0
  949. package/product/collections/index.js +1 -0
  950. package/product/components/Availability/Availability.connector.js +5 -0
  951. package/product/components/Availability/Availability.js +6 -0
  952. package/product/components/Availability/Availability.style.js +1 -0
  953. package/product/components/Availability/index.js +1 -0
  954. package/product/components/Characteristics/Characteristic/components/Sheet/index.js +16 -4
  955. package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +8 -3
  956. package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -1
  957. package/product/components/Characteristics/Characteristic/index.js +15 -6
  958. package/product/components/Characteristics/Characteristic/style.js +1 -1
  959. package/product/components/Characteristics/Swatch/index.js +8 -6
  960. package/product/components/Characteristics/index.js +10 -3
  961. package/product/components/Characteristics/transition.js +1 -1
  962. package/product/components/Description/index.js +5 -6
  963. package/product/components/Description/style.js +1 -1
  964. package/product/components/EffectivityDates/helpers.js +5 -5
  965. package/product/components/EffectivityDates/index.js +2 -2
  966. package/product/components/EffectivityDates/style.js +1 -1
  967. package/product/components/Header/PriceStriked/index.js +2 -5
  968. package/product/components/Header/PriceStriked/style.js +1 -1
  969. package/product/components/Header/Shipping/components/Label/index.js +3 -3
  970. package/product/components/Header/Shipping/components/Label/style.js +1 -1
  971. package/product/components/Header/Shipping/index.js +1 -1
  972. package/product/components/Header/Shipping/spec.js +1 -1
  973. package/product/components/Header/Tiers/components/Tier/index.js +2 -2
  974. package/product/components/Header/Tiers/components/Tier/spec.js +1 -1
  975. package/product/components/Header/Tiers/index.js +1 -1
  976. package/product/components/Header/Tiers/spec.js +1 -1
  977. package/product/components/Header/index.js +1 -0
  978. package/product/components/MapPriceHint/index.js +1 -1
  979. package/product/components/Media/FeaturedMedia.js +2 -2
  980. package/product/components/Media/MediaImage.js +3 -3
  981. package/product/components/Media/MediaPlaceholder.js +1 -1
  982. package/product/components/MediaSlider/components/MediaImage/index.js +1 -1
  983. package/product/components/MediaSlider/components/MediaVideo/index.js +1 -1
  984. package/product/components/MediaSlider/index.js +4 -4
  985. package/product/components/Options/components/Content/index.js +8 -8
  986. package/product/components/Options/components/Content/spec.js +2 -2
  987. package/product/components/Options/components/Option/index.js +2 -2
  988. package/product/components/Options/components/TextOption/components/OptionInfo/index.js +3 -3
  989. package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -1
  990. package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -1
  991. package/product/components/Options/components/TextOption/index.js +19 -7
  992. package/product/components/Options/components/TextOption/style.js +1 -1
  993. package/product/components/Options/index.js +2 -2
  994. package/product/components/OrderQuantityHint/index.js +3 -2
  995. package/product/components/OrderQuantityHint/style.js +1 -1
  996. package/product/components/PriceDifference/index.js +1 -1
  997. package/product/components/PriceDifference/style.js +1 -1
  998. package/product/components/PriceInfo/PriceInfo.connector.js +4 -0
  999. package/product/components/PriceInfo/PriceInfo.js +4 -0
  1000. package/product/components/PriceInfo/index.js +1 -0
  1001. package/product/components/ProductBadges/index.js +2 -2
  1002. package/product/components/ProductCard/index.js +12 -3
  1003. package/product/components/ProductCard/style.js +1 -1
  1004. package/product/components/ProductCharacteristics/context.js +1 -1
  1005. package/product/components/ProductCharacteristics/helpers/index.js +1 -1
  1006. package/product/components/ProductCharacteristics/index.js +30 -16
  1007. package/product/components/ProductDiscountBadge/index.js +2 -2
  1008. package/product/components/ProductDiscountBadge/spec.js +2 -2
  1009. package/product/components/ProductDiscountBadge/style.js +1 -1
  1010. package/product/components/ProductGridPrice/index.js +3 -3
  1011. package/product/components/ProductGridPrice/style.js +1 -1
  1012. package/product/components/ProductImage/ProductImagePlaceholder.js +5 -0
  1013. package/product/components/ProductImage/connector.js +5 -0
  1014. package/product/components/ProductImage/index.js +17 -13
  1015. package/product/components/ProductImage/spec.js +1 -1
  1016. package/product/components/ProductList/components/Item/index.js +2 -2
  1017. package/product/components/ProductList/components/Iterator/index.js +1 -1
  1018. package/product/components/ProductList/components/Layout/index.js +1 -1
  1019. package/product/components/ProductList/index.js +2 -2
  1020. package/product/components/ProductName/ProductName.js +4 -0
  1021. package/product/components/ProductName/ProductNameContent.js +4 -0
  1022. package/product/components/ProductName/index.js +1 -0
  1023. package/product/components/ProductProperties/Content.js +4 -4
  1024. package/product/components/ProductProperties/Group.js +1 -1
  1025. package/product/components/ProductProperties/GroupedProperties.js +2 -2
  1026. package/product/components/ProductProperties/Lists.js +1 -1
  1027. package/product/components/ProductProperties/ListsHTML.js +5 -0
  1028. package/product/components/ProductProperties/ProductProperties.js +2 -2
  1029. package/product/components/ProductProperties/Row.js +1 -1
  1030. package/product/components/ProductProperties/RowHTML.js +5 -0
  1031. package/product/components/ProductProperties/Rows.js +2 -2
  1032. package/product/components/ProductProperties/Wrapper.js +1 -1
  1033. package/product/components/ProductProperties/helpers/getGroupsFromProperties.js +7 -2
  1034. package/product/components/ProductProperties/style.js +1 -1
  1035. package/product/components/ProductSlider/index.js +3 -2
  1036. package/product/components/ProductSlider/spec.js +1 -1
  1037. package/product/components/ProductVariants/VariantAvailability.connector.js +5 -0
  1038. package/product/components/ProductVariants/VariantAvailability.js +5 -0
  1039. package/product/components/ProductVariants/index.js +1 -0
  1040. package/product/components/QuantityPicker/hooks.js +5 -0
  1041. package/product/components/QuantityPicker/index.js +4 -3
  1042. package/product/components/Rating/index.js +3 -3
  1043. package/product/components/Rating/spec.js +2 -2
  1044. package/product/components/RelationsSlider/RelationsSheet.js +2 -2
  1045. package/product/components/RelationsSlider/RelationsSlider.js +1 -1
  1046. package/product/components/RelationsSlider/RelationsSliderContent.js +1 -1
  1047. package/product/components/RelationsSlider/style.js +1 -1
  1048. package/product/components/Swatch/Swatch.js +1 -1
  1049. package/product/components/Swatch/SwatchContent.js +1 -1
  1050. package/product/components/Swatch/VariantSwatch.js +1 -1
  1051. package/product/components/Swatch/style.js +1 -1
  1052. package/product/components/Swatches/Swatches.js +1 -1
  1053. package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +4 -0
  1054. package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -6
  1055. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +11 -13
  1056. package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +5 -2
  1057. package/product/components/UnitQuantityPicker/index.js +1 -1
  1058. package/product/components/UnitQuantityPicker/styles.js +1 -0
  1059. package/product/components/context.js +1 -1
  1060. package/product/components/index.js +1 -0
  1061. package/product/constants/index.js +2 -1
  1062. package/product/contexts/index.js +1 -0
  1063. package/product/helpers/index.js +2 -2
  1064. package/product/helpers/redirects.js +2 -2
  1065. package/product/hocs/index.js +1 -0
  1066. package/product/hocs/withMapPricing.js +4 -4
  1067. package/product/hocs/withPriceCalculation.js +2 -2
  1068. package/product/hocs/withProduct.js +6 -0
  1069. package/product/hocs/withProductListEntry.js +1 -1
  1070. package/product/hocs/withProductListEntryProduct.js +12 -0
  1071. package/product/hocs/withProductListType.js +1 -1
  1072. package/product/hooks/index.js +1 -0
  1073. package/product/hooks/useLoadProductImage.js +1 -1
  1074. package/product/index.js +4 -11
  1075. package/product/product.types.js +0 -0
  1076. package/product/{components/ProductProvider → providers/Product}/index.js +1 -1
  1077. package/product/providers/ProductListEntry/context.js +1 -1
  1078. package/product/providers/ProductListEntry/index.js +1 -1
  1079. package/product/providers/ProductListType/context.js +2 -1
  1080. package/product/providers/ProductListType/index.js +2 -1
  1081. package/product/providers/index.js +1 -0
  1082. package/product/selectors/product.js +75 -6
  1083. package/product/selectors/variants.js +4 -1
  1084. package/product/streams/index.js +1 -0
  1085. package/push-opt-in/action-creators/pushOptIn.js +2 -1
  1086. package/push-opt-in/actions/pushOptInModal.js +3 -3
  1087. package/push-opt-in/components/PushOptInModal/index.js +3 -6
  1088. package/push-opt-in/components/PushOptInModal/push-opt-in.svg +58 -58
  1089. package/push-opt-in/reducers/optInModal.js +2 -2
  1090. package/push-opt-in/reducers/optInTrigger.js +2 -2
  1091. package/push-opt-in/selectors/optInModal.js +5 -2
  1092. package/push-opt-in/selectors/optInTrigger.js +4 -2
  1093. package/push-opt-in/subscriptions/index.js +1 -1
  1094. package/push-opt-in/subscriptions/optInTracking.js +4 -0
  1095. package/push-opt-in/subscriptions/optInTrigger.js +6 -6
  1096. package/registration/action-creators/index.js +18 -0
  1097. package/registration/actions/index.js +1 -0
  1098. package/registration/actions/submitRegistration.js +4 -0
  1099. package/registration/components/GuestRegistration/GuestRegistration.js +4 -0
  1100. package/registration/components/GuestRegistration/GuestRegistrationContent.js +4 -0
  1101. package/registration/components/GuestRegistration/GuestRegistrationFormPickup.config.js +8 -0
  1102. package/registration/components/GuestRegistration/GuestRegistrationFormPickup.js +4 -0
  1103. package/registration/components/Registration/Registration.js +4 -0
  1104. package/registration/components/Registration/RegistrationContent.js +4 -0
  1105. package/registration/components/Registration/RegistrationContent.style.js +2 -0
  1106. package/registration/components/Registration/RegistrationFormActions.js +5 -0
  1107. package/registration/components/Registration/RegistrationFormBase.config.js +4 -0
  1108. package/registration/components/Registration/RegistrationFormBase.js +4 -0
  1109. package/registration/components/Registration/RegistrationFormBilling.config.js +5 -0
  1110. package/registration/components/Registration/RegistrationFormBilling.js +5 -0
  1111. package/registration/components/Registration/RegistrationFormExtra.config.js +5 -0
  1112. package/registration/components/Registration/RegistrationFormExtra.js +5 -0
  1113. package/registration/components/Registration/RegistrationFormShipping.config.js +5 -0
  1114. package/registration/components/Registration/RegistrationFormShipping.js +5 -0
  1115. package/registration/components/Registration/RegistrationFormToggle.js +4 -0
  1116. package/registration/components/index.js +1 -0
  1117. package/registration/constants/actionTypes.js +1 -0
  1118. package/registration/constants/index.js +1 -0
  1119. package/registration/constants/pipelines.js +1 -0
  1120. package/registration/hooks/index.js +5 -0
  1121. package/registration/index.js +2 -0
  1122. package/registration/providers/GuestRegistrationProvider.actions.js +4 -0
  1123. package/registration/providers/GuestRegistrationProvider.connector.js +7 -0
  1124. package/registration/providers/GuestRegistrationProvider.constraints.js +18 -0
  1125. package/registration/providers/GuestRegistrationProvider.context.js +1 -0
  1126. package/registration/providers/GuestRegistrationProvider.js +22 -0
  1127. package/registration/providers/RegistrationProvider.actions.js +8 -0
  1128. package/registration/providers/RegistrationProvider.connector.js +6 -0
  1129. package/registration/providers/RegistrationProvider.constraints.js +27 -0
  1130. package/registration/providers/RegistrationProvider.context.js +1 -0
  1131. package/registration/providers/RegistrationProvider.js +17 -0
  1132. package/registration/streams/index.js +4 -0
  1133. package/registration/subscriptions/index.js +5 -0
  1134. package/reviews/actions/index.js +1 -0
  1135. package/reviews/components/Reviews/components/AllReviewsLink/index.js +1 -1
  1136. package/reviews/components/Reviews/components/Header/components/AverageRating/index.js +8 -6
  1137. package/reviews/components/Reviews/components/Header/components/NoReviews/index.js +3 -3
  1138. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +3 -3
  1139. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/style.js +1 -1
  1140. package/reviews/components/Reviews/components/Header/components/WriteReviewLink/index.js +3 -3
  1141. package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +2 -2
  1142. package/reviews/components/Reviews/components/Header/index.js +6 -4
  1143. package/reviews/components/Reviews/components/Header/spec.js +2 -2
  1144. package/reviews/components/Reviews/components/List/components/Info/components/Author/index.js +1 -1
  1145. package/reviews/components/Reviews/components/List/components/Info/components/ReviewDate/index.js +1 -1
  1146. package/reviews/components/Reviews/components/List/components/Info/index.js +2 -2
  1147. package/reviews/components/Reviews/components/List/components/Info/style.js +1 -1
  1148. package/reviews/components/Reviews/components/List/components/Rating/index.js +1 -1
  1149. package/reviews/components/Reviews/components/List/components/Review/index.js +1 -1
  1150. package/reviews/components/Reviews/components/List/components/Text/index.js +1 -1
  1151. package/reviews/components/Reviews/components/List/components/Title/index.js +1 -1
  1152. package/reviews/components/Reviews/components/List/index.js +3 -3
  1153. package/reviews/components/Reviews/components/List/spec.js +1 -1
  1154. package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
  1155. package/reviews/components/Reviews/components/RatingCount/spec.js +1 -1
  1156. package/reviews/components/Reviews/components/RatingCount/style.js +1 -1
  1157. package/reviews/components/Reviews/components/ReviewsInfo/index.js +3 -4
  1158. package/reviews/components/Reviews/connector.js +2 -6
  1159. package/reviews/components/Reviews/index.js +1 -1
  1160. package/reviews/components/Reviews/mock.js +2 -6
  1161. package/reviews/components/Reviews/spec.js +4 -3
  1162. package/reviews/components/index.js +1 -0
  1163. package/reviews/constants/index.js +1 -0
  1164. package/reviews/index.js +3 -6
  1165. package/reviews/selectors/index.js +1 -0
  1166. package/reviews/streams/index.js +1 -0
  1167. package/scanner/action-creators/index.js +1 -0
  1168. package/scanner/actions/index.js +1 -0
  1169. package/scanner/classes/index.js +1 -0
  1170. package/scanner/constants/index.js +1 -0
  1171. package/scanner/helpers/index.js +1 -0
  1172. package/scanner/index.js +1 -6
  1173. package/scanner/streams/index.js +1 -0
  1174. package/search/actions/index.js +1 -0
  1175. package/search/constants/index.js +1 -0
  1176. package/search/helpers/index.js +1 -0
  1177. package/search/index.js +1 -6
  1178. package/search/selectors/index.js +1 -0
  1179. package/search/streams/index.js +1 -0
  1180. package/styles/helpers/cssCustomProperties.js +16 -0
  1181. package/styles/helpers/index.js +1 -0
  1182. package/styles/helpers/initCSSCustomProperties.js +10 -0
  1183. package/styles/helpers/loadCustomStyles.js +6 -0
  1184. package/styles/helpers/setPageBackgroundColor.js +5 -0
  1185. package/styles/helpers/setPageContentWidth.js +5 -0
  1186. package/styles/helpers/setViewportHeight.js +3 -0
  1187. package/styles/helpers/toggleBodyScroll.js +5 -0
  1188. package/styles/helpers/updatePageInsets.js +15 -0
  1189. package/styles/index.js +1 -0
  1190. package/styles/reset/form.js +8 -0
  1191. package/styles/reset/index.js +1 -0
  1192. package/styles/reset/media.js +1 -0
  1193. package/styles/reset/root.js +3 -0
  1194. package/styles/reset/table.js +1 -0
  1195. package/styles/reset/typography.js +1 -0
  1196. package/tracking/action-creators/cookieConsent.js +2 -2
  1197. package/tracking/actions/cookieConsent.js +17 -5
  1198. package/tracking/components/CookieConsentModal/connector.js +3 -5
  1199. package/tracking/components/CookieConsentModal/index.js +3 -6
  1200. package/tracking/components/CookieConsentModal/tracking-opt-in.svg +14 -14
  1201. package/tracking/components/PrivacySettings/connector.js +3 -5
  1202. package/tracking/components/PrivacySettings/index.js +2 -2
  1203. package/tracking/helpers/index.js +1 -0
  1204. package/tracking/selectors/cookieConsent.js +10 -5
  1205. package/tracking/streams/cookieConsent.js +10 -3
  1206. package/tracking/subscriptions/analytics.js +5 -4
  1207. package/tracking/subscriptions/cookieConsent.js +6 -10
  1208. package/types.js +0 -0
  1209. package/user/index.js +2 -2
  1210. package/user/selectors/data.js +10 -0
  1211. package/components/MessageBar/spec.js +0 -1
  1212. package/components/MessageBar/style.js +0 -2
  1213. package/favorites/constants/constants.js +0 -1
  1214. package/product/components/Characteristics/Characteristic/components/VariantAvailability/connector.js +0 -9
  1215. package/product/components/Characteristics/Characteristic/components/VariantAvailability/index.js +0 -5
  1216. package/product/components/QuantityPicker/helpers.js +0 -5
  1217. /package/product/components/{Characteristics/Characteristic/components/VariantAvailability/style.js → ProductVariants/VariantAvailability.style.js} +0 -0
  1218. /package/product/{components/ProductProvider → providers/Product}/connector.js +0 -0
@@ -0,0 +1,9 @@
1
+ import{A11Y_INCREASE_MODAL_COUNT,A11Y_DECREASE_MODAL_COUNT}from"../constants";/**
2
+ * Increases the modal count inside the A11Y state. Used to determine if parts of the app needs to
3
+ * be hidden for screen readers to improve accessibility.
4
+ * @returns {Object} The Redux action object
5
+ */export var increaseModalCount=function increaseModalCount(){return{type:A11Y_INCREASE_MODAL_COUNT};};/**
6
+ * Decreases the modal count inside the A11Y state. Used to determine if parts of the app needs to
7
+ * be hidden for screen readers to improve accessibility.
8
+ * @returns {Object} The Redux action object
9
+ */export var decreaseModalCount=function decreaseModalCount(){return{type:A11Y_DECREASE_MODAL_COUNT};};
@@ -0,0 +1 @@
1
+ import{FocusTrap}from'focus-trap-react';export default FocusTrap;
@@ -4,4 +4,4 @@ import React from'react';import PropTypes from'prop-types';import{I18n}from"../.
4
4
  * @param {Object} params Optional params for the message.
5
5
  * @param {string} 'aria-live' The aria-live type.
6
6
  * @returns {JSX}
7
- */var LiveMessage=function LiveMessage(_ref){var message=_ref.message,params=_ref.params,ariaLive=_ref['aria-live'];return/*#__PURE__*/React.createElement("div",{className:styles,role:"log","aria-live":ariaLive},/*#__PURE__*/React.createElement(I18n.Text,{string:message,params:params}));};LiveMessage.defaultProps={'aria-live':'polite',params:null};export default LiveMessage;
7
+ */var LiveMessage=function LiveMessage(_ref){var message=_ref.message,params=_ref.params,ariaLive=_ref['aria-live'];return React.createElement("div",{className:styles,role:"log","aria-live":ariaLive},React.createElement(I18n.Text,{string:message,params:params}));};LiveMessage.defaultProps={'aria-live':'polite',params:null};export default LiveMessage;
@@ -7,5 +7,5 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
7
7
  * @param {string} options.id Id of the LiveMessenger component which sets the message.
8
8
  * @param {boolean} options.force If set to TRUE the LiveMessenger component will read the text,
9
9
  * even if the same was broadcasted before.
10
- */export function broadcastLiveMessage(message){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var defaults={type:LIVE_MESSAGE_TYPE_POLITE,params:null,id:null};if(!message){return;}var params=_extends({},defaults,options);UIEvents.emit(EVENT_LIVE_MESSAGE,message,params);setTimeout(function(){// Clear the live area after a short time, so that the screen reader can't focus the element.
10
+ */export function broadcastLiveMessage(message){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var defaults={type:LIVE_MESSAGE_TYPE_POLITE,params:null,id:null};if(!message){return;}var params=_extends({},defaults,{},options);UIEvents.emit(EVENT_LIVE_MESSAGE,message,params);setTimeout(function(){// Clear the live area after a short time, so that the screen reader can't focus the element.
11
11
  UIEvents.emit(EVENT_LIVE_MESSAGE,'',params);},100);}
@@ -1,4 +1,4 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useLayoutEffect,useCallback}from'react';import PropTypes from'prop-types';import{UIEvents}from'@shopgate/engage/core';import LiveMessage from"../LiveMessage";import{EVENT_LIVE_MESSAGE,LIVE_MESSAGE_TYPE_ASSERTIVE,LIVE_MESSAGE_TYPE_POLITE}from"./constants";/**
1
+ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useLayoutEffect,useCallback}from'react';import PropTypes from'prop-types';import{UIEvents}from'@shopgate/engage/core';import LiveMessage from"../LiveMessage";import{EVENT_LIVE_MESSAGE,LIVE_MESSAGE_TYPE_ASSERTIVE,LIVE_MESSAGE_TYPE_POLITE}from"./constants";/**
2
2
  * The LiveMessenger component can be used to broadcast `aria-live` messages to assistive
3
3
  * technology. It can be placed somewhere within the DOM, and receives its updates via
4
4
  * EVENT_LIVE_MESSAGE event.
@@ -6,4 +6,4 @@ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimi
6
6
  * @returns {JSX}
7
7
  */var LiveMessenger=function LiveMessenger(_ref){var id=_ref.id;var _useState=useState({message:'',params:null}),_useState2=_slicedToArray(_useState,2),assertive=_useState2[0],setAssertive=_useState2[1];var _useState3=useState({message:'',params:null}),_useState4=_slicedToArray(_useState3,2),polite=_useState4[0],setPolite=_useState4[1];var handleMessage=useCallback(function(message,options){var _options$type=options.type,type=_options$type===void 0?LIVE_MESSAGE_TYPE_POLITE:_options$type,_options$id=options.id,instanceId=_options$id===void 0?null:_options$id,_options$params=options.params,params=_options$params===void 0?null:_options$params;if(id!==instanceId){return;}if(type===LIVE_MESSAGE_TYPE_ASSERTIVE){setAssertive({message:message,params:params});}else if(type===LIVE_MESSAGE_TYPE_POLITE){setPolite({message:message,params:params});}// eslint-disable-next-line react-hooks/exhaustive-deps
8
8
  },[]);useLayoutEffect(function(){UIEvents.addListener(EVENT_LIVE_MESSAGE,handleMessage);return function(){UIEvents.removeListener(EVENT_LIVE_MESSAGE,handleMessage);};// eslint-disable-next-line react-hooks/exhaustive-deps
9
- },[]);return/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement(LiveMessage,{"aria-live":"assertive",message:assertive.message,params:assertive.params}),/*#__PURE__*/React.createElement(LiveMessage,{"aria-live":"polite",message:polite.message,params:polite.params}));};LiveMessenger.defaultProps={id:null};export default LiveMessenger;
9
+ },[]);return React.createElement("div",null,React.createElement(LiveMessage,{"aria-live":"assertive",message:assertive.message,params:assertive.params}),React.createElement(LiveMessage,{"aria-live":"polite",message:polite.message,params:polite.params}));};LiveMessenger.defaultProps={id:null};export default LiveMessenger;
@@ -0,0 +1,14 @@
1
+ import PropTypes from'prop-types';import{useTrackModalState}from'@shopgate/engage/a11y/hooks';/**
2
+ * Helper component to be used inside modal-like class components to track their visibility and
3
+ * apply a11y optimizations to the app.
4
+ *
5
+ * Wrap the children of your modal-like component with this component to track its visibility
6
+ *
7
+ * For functional components, please use the `useTrackModalState` hook instead.
8
+ * @param {Object} props The component props.
9
+ * @param {boolean} [props.isVisible] Optional visibility flag to be set by the parent component
10
+ * when it uses a visibility prop or state to toggle its visibility. Can be omitted if the
11
+ * component mounts/unmounts based on visibility.
12
+ * @param {ReactNode} props.children The component children.
13
+ * @returns {JSX.Element}
14
+ */var ModalStateTracker=function ModalStateTracker(_ref){var children=_ref.children,isVisible=_ref.isVisible;useTrackModalState(isVisible);return children;};ModalStateTracker.propTypes={children:PropTypes.node.isRequired,isVisible:PropTypes.bool};ModalStateTracker.defaultProps={isVisible:undefined};export default ModalStateTracker;
@@ -4,4 +4,4 @@ import React from'react';import PropTypes from'prop-types';import{Link,I18n}from
4
4
  * @param {Array} props.entries Navigation entries.
5
5
  * @param {Object} context The component context.
6
6
  * @returns {JSX}
7
- */var Navigation=function Navigation(_ref,context){var title=_ref.title,entries=_ref.entries;var _context$i18n=context.i18n(),__=_context$i18n.__;if(!entries||!entries.length){return null;}return/*#__PURE__*/React.createElement("nav",{"aria-label":title?__(title):null},/*#__PURE__*/React.createElement("ul",{className:styles},entries.map(function(_ref2){var entryTitle=_ref2.title,link=_ref2.link;return/*#__PURE__*/React.createElement("li",{key:link},/*#__PURE__*/React.createElement(Link,{href:link},/*#__PURE__*/React.createElement(I18n.Text,{string:entryTitle})));})));};Navigation.defaultProps={title:null,entries:[]};Navigation.contextTypes={i18n:PropTypes.func};export default Navigation;
7
+ */var Navigation=function Navigation(_ref,context){var title=_ref.title,entries=_ref.entries;var _context$i18n=context.i18n(),__=_context$i18n.__;if(!entries||!entries.length){return null;}return React.createElement("nav",{"aria-label":title?__(title):null},React.createElement("ul",{className:styles},entries.map(function(_ref2){var entryTitle=_ref2.title,link=_ref2.link;return React.createElement("li",{key:link},React.createElement(Link,{href:link},React.createElement(I18n.Text,{string:entryTitle})));})));};Navigation.defaultProps={title:null,entries:[]};Navigation.contextTypes={i18n:PropTypes.func};export default Navigation;
@@ -1,4 +1,4 @@
1
- var _excluded=["title","titleParams","children"];function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useMemo,useLayoutEffect}from'react';import PropTypes from'prop-types';import kebabCase from'lodash/kebabCase';import{I18n}from'@shopgate/engage/components';/**
1
+ var _excluded=["title","titleParams","children"];function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React,{useRef,useState,useMemo,useLayoutEffect}from'react';import PropTypes from'prop-types';import kebabCase from'lodash/kebabCase';import{I18n}from'@shopgate/engage/components';import VisuallyHidden from"../VisuallyHidden";/**
2
2
  * Checks the section ref has suitable child nodes.
3
3
  * @param {Object} ref A React ref.
4
4
  * @param {string} headlineId The ID of the section headline.
@@ -13,5 +13,5 @@ var childNodes=[].filter.call(ref.current.childNodes,function(el){return el.getA
13
13
  * @param {Object} [props.titleParams={}] Additional parameters for the title placeholder.
14
14
  * @param {Object} [props.className=null] A class name for the section.
15
15
  * @param {NodeList} [props.children=null] Component children.
16
- * @returns {JSX}
17
- */function Section(props){var title=props.title,titleParams=props.titleParams,children=props.children,rest=_objectWithoutProperties(props,_excluded);var contentRef=useRef(null);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hasContent=_useState2[0],setHasContent=_useState2[1];var id=useMemo(function(){return kebabCase(title);},[title]);var observer=useMemo(function(){return new MutationObserver(function(){setHasContent(hasChildNodes(contentRef,id));});},[contentRef,id]);useLayoutEffect(function(){setHasContent(hasChildNodes(contentRef,id));observer.observe(contentRef.current,{childList:true});return function(){observer.disconnect();};},[contentRef,id,observer]);if(!hasContent){return/*#__PURE__*/React.createElement("section",_extends({},rest,{ref:contentRef}),children);}return/*#__PURE__*/React.createElement("section",_extends({},rest,{ref:contentRef,"aria-labelledby":id}),/*#__PURE__*/React.createElement("h2",{id:id,hidden:true},/*#__PURE__*/React.createElement(I18n.Text,{string:title,params:titleParams})),children);}Section.defaultProps={children:null,className:'',titleParams:{}};export default Section;
16
+ * @returns {JSX.Element}
17
+ */function Section(props){var title=props.title,titleParams=props.titleParams,children=props.children,rest=_objectWithoutProperties(props,_excluded);var contentRef=useRef(null);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hasContent=_useState2[0],setHasContent=_useState2[1];var id=useMemo(function(){return kebabCase(title);},[title]);var observer=useMemo(function(){return new MutationObserver(function(){setHasContent(hasChildNodes(contentRef,id));});},[contentRef,id]);useLayoutEffect(function(){setHasContent(hasChildNodes(contentRef,id));observer.observe(contentRef.current,{childList:true});return function(){observer.disconnect();};},[contentRef,id,observer]);if(!hasContent){return React.createElement("section",_extends({},rest,{ref:contentRef}),children);}return React.createElement("section",_extends({},rest,{ref:contentRef,"aria-labelledby":id}),React.createElement(VisuallyHidden,null,React.createElement("h2",{id:id},React.createElement(I18n.Text,{string:title,params:titleParams}))),children);}Section.defaultProps={children:null,className:'',titleParams:{}};export default Section;
@@ -5,4 +5,4 @@ import React from'react';import PropTypes from'prop-types';import{css}from'glamo
5
5
  * @param {Object} [props.tag='span'] The tag to be used for the component
6
6
  * @param {Object} props.children Component children
7
7
  * @returns {JSX.Element}
8
- */var VisuallyHidden=function VisuallyHidden(_ref){var _ref$tag=_ref.tag,tag=_ref$tag===void 0?'span':_ref$tag,children=_ref.children;return/*#__PURE__*/React.createElement(tag,{className:styles.root},children);};VisuallyHidden.defaultProps={tag:'span'};export default VisuallyHidden;
8
+ */var VisuallyHidden=function VisuallyHidden(_ref){var _ref$tag=_ref.tag,tag=_ref$tag===void 0?'span':_ref$tag,children=_ref.children;return React.createElement(tag,{className:styles.root},children);};VisuallyHidden.defaultProps={tag:'span'};export default VisuallyHidden;
@@ -1 +1 @@
1
- export{default as LiveMessage}from"./LiveMessage";export{default as LiveMessenger}from"./LiveMessenger";export{default as Navigation}from"./Navigation";export{default as Section}from"./Section";export{default as VisuallyHidden}from"./VisuallyHidden";
1
+ export{default as LiveMessage}from"./LiveMessage";export{default as LiveMessenger}from"./LiveMessenger";export{default as Navigation}from"./Navigation";export{default as ModalStateTracker}from"./ModalStateTracker";export{default as Section}from"./Section";export{default as VisuallyHidden}from"./VisuallyHidden";export{default as FocusTrap}from"./FocusTrap";
@@ -0,0 +1 @@
1
+ export*from"../components/LiveMessenger/constants";export var A11Y_INCREASE_MODAL_COUNT='A11Y_INCREASE_MODAL_COUNT';export var A11Y_DECREASE_MODAL_COUNT='A11Y_DECREASE_MODAL_COUNT';
@@ -0,0 +1 @@
1
+ export*from"../components/LiveMessenger/helpers";
@@ -0,0 +1,37 @@
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{useEffect,useState,useRef}from'react';import{useDispatch}from'react-redux';import{increaseModalCount,decreaseModalCount}from"../action-creators";/**
2
+ * The useReduceMotion hook
3
+ * to determine whether the user selected reduced motion in the phone settings
4
+ * @returns {boolean} whether the user prefers reduced motions in the settings
5
+ */export var useReduceMotion=function useReduceMotion(){var _useState=useState(window.matchMedia('(prefers-reduced-motion: reduce)').matches),_useState2=_slicedToArray(_useState,2),matches=_useState2[0],setMatch=_useState2[1];useEffect(function(){var mq=window.matchMedia('(prefers-reduced-motion: reduce)');// eslint-disable-next-line require-jsdoc
6
+ var handleChange=function handleChange(){setMatch(mq.matches);};handleChange();mq.addEventListener('change',handleChange);return function(){mq.removeEventListener('change',handleChange);};},[]);return matches;};/**
7
+ * Tracks when a modal-like component is considered "visible", and dispatches Redux
8
+ * actions accordingly. This is useful for global tracking of visible overlays,
9
+ * modals, drawers, or any component with a similar behavior.
10
+ *
11
+ * Dispatches `increaseModalCount()` when the component becomes visible
12
+ * Dispatches `decreaseModalCount()` when the component becomes hidden
13
+ * Dispatches `decreaseModalCount()` on unmount if the component was still visible
14
+ *
15
+ * Call this hook inside any modal like component that:
16
+ * - Mounts/unmounts based on visibility (like a modal or tooltip)
17
+ * - OR uses a visibility prop (e.g. `isVisible`)
18
+ *
19
+ * @param {boolean} isVisible Optional visibility flag.
20
+ * If omitted, visibility is assumed `true` while mounted.
21
+ *
22
+ * @example
23
+ * // Component that uses isVisible prop
24
+ * function MyModal({ isVisible }) {
25
+ * useTrackModalState(isVisible);
26
+ * return <div className="my_modal">...</div>;
27
+ * }
28
+ *
29
+ * @example
30
+ * // Component that appears/disappears via mounting
31
+ * function MyModal() {
32
+ * useTrackModalState(); // defaults to `true`
33
+ * return <div className="tooltip">Hello!</div>;
34
+ * }
35
+ */export function useTrackModalState(){var isVisible=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var dispatch=useDispatch();var wasVisible=useRef(false);// React to changes in visibility
36
+ useEffect(function(){if(isVisible&&!wasVisible.current){dispatch(increaseModalCount());wasVisible.current=true;}else if(!isVisible&&wasVisible.current){dispatch(decreaseModalCount());wasVisible.current=false;}},[isVisible,dispatch]);// On unmount, dispatch hide if it was still visible
37
+ useEffect(function(){return function(){if(wasVisible.current){dispatch(decreaseModalCount());wasVisible.current=false;}};},[dispatch]);}
package/a11y/index.js CHANGED
@@ -1,4 +1 @@
1
- /** @module a11y */ // Components
2
- export*from"./components";// Helpers
3
- export*from"./components/LiveMessenger/helpers";// Constants
4
- export*from"./components/LiveMessenger/constants";
1
+ /** @module a11y */export{LiveMessage,LiveMessenger,Navigation,Section,VisuallyHidden}from"./components";export*from"./constants";export*from"./helpers";
@@ -0,0 +1,6 @@
1
+ import{produce}from'immer';import{isDev,logger}from'@shopgate/engage/core/helpers';import{A11Y_INCREASE_MODAL_COUNT,A11Y_DECREASE_MODAL_COUNT}from"../constants";var defaultState={modalCount:0};/**
2
+ * Stores a11y state
3
+ * @param {Object} [state={}] The current state.
4
+ * @param {Object} action The action object.
5
+ * @returns {Object} The new state.
6
+ */export default function a11y(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;/* eslint-disable no-param-reassign */var producer=produce(function(draft){switch(action.type){case A11Y_INCREASE_MODAL_COUNT:{draft.modalCount+=1;break;}case A11Y_DECREASE_MODAL_COUNT:{draft.modalCount-=1;if(draft.modalCount<0){if(isDev){logger.warn('Modal count is negative, resetting to 0');}draft.modalCount=0;}break;}default:break;}});/* eslint-enable no-param-reassign */return producer(state);}
@@ -0,0 +1,8 @@
1
+ import{createSelector}from'reselect';/**
2
+ * Retrieves the a11y state from the store.
3
+ * @param {Object} state The current application state.
4
+ * @return {Object} The a11y state.
5
+ */var getState=function getState(state){return state.a11y;};/**
6
+ * Creates a selector that returns the number of currently open modals.
7
+ * @type {(state: any) => number}
8
+ */export var getModalCount=createSelector(getState,function(a11y){return a11y.modalCount;});
package/a11y/styles.js ADDED
@@ -0,0 +1,2 @@
1
+ import{css}from'glamor';// global class for screen readers only, visually hidden
2
+ css.global('.sr-only',{border:'0',clip:'rect(0 0 0 0)',height:'1px',margin:'-1px',overflow:'hidden',padding:'0',position:'absolute',width:'1px',whiteSpace:'nowrap',top:0,left:0});
@@ -0,0 +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{PipelineRequest}from'@shopgate/engage/core/classes';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
+ * Starts entering the checkout process for the customer.
3
+ * @returns {Function}
4
+ */export var addCustomerContacts=function addCustomerContacts(_ref){var contacts=_ref.contacts;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:ADD_CUSTOMER_CONTACT,contacts:contacts});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.addContacts').setTrusted().setInput({contacts:contacts}).dispatch();case 4:response=_context.sent;dispatch({type:ADD_CUSTOMER_CONTACT_SUCCESS,contacts:contacts});_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:ADD_CUSTOMER_CONTACT_ERROR,contacts:contacts,error:_context.t0});throw _context.t0;case 12:return _context.abrupt("return",response);case 13:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
@@ -0,0 +1,5 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{PipelineRequest}from'@shopgate/engage/core/classes';import{DELETE_CUSTOMER_CONTACT,DELETE_CUSTOMER_CONTACT_SUCCESS,DELETE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
+ * Starts entering the checkout process for the customer.
3
+ * @param {Object} contactId Contact
4
+ * @returns {Function}
5
+ */export var deleteCustomerContact=function deleteCustomerContact(contactId){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER_CONTACT});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteContact').setInput({contactId:contactId}).setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_CONTACT_ERROR,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -0,0 +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{PipelineRequest}from'@shopgate/engage/core/classes';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
2
+ * Starts entering the checkout process for the customer.
3
+ * @returns {Function}
4
+ */export var deleteCustomer=function deleteCustomer(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteCustomer').setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_SUCCESS});dispatch(successLogout(false));_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 12:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -0,0 +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{PipelineRequest}from'@shopgate/engage/core/classes';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
2
+ * Starts entering the checkout process for the customer.
3
+ * @returns {Function}
4
+ */export var fetchCustomerContacts=function fetchCustomerContacts(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,contacts;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER_CONTACTS});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getContacts').setTrusted().dispatch();case 4:_ref3=_context.sent;contacts=_ref3.contacts;dispatch({type:FETCH_CUSTOMER_CONTACTS_SUCCESS,contacts:contacts});return _context.abrupt("return",contacts);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_CONTACTS_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -0,0 +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{PipelineRequest}from'@shopgate/engage/core/classes';import{EINVALIDCALL}from'@shopgate/engage/core/constants';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants";/**
2
+ * Starts entering the checkout process for the customer.
3
+ * @returns {Function}
4
+ */export var fetchCustomerData=function fetchCustomerData(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,customer;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getCustomer').setTrusted().setErrorBlacklist([EINVALIDCALL]).dispatch();case 4:_ref3=_context.sent;customer=_ref3.customer;dispatch({type:FETCH_CUSTOMER_SUCCESS,customer:customer});return _context.abrupt("return",customer);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -0,0 +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{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
+ * Starts entering the checkout process for the customer.
3
+ * @returns {Function}
4
+ */export var updateCustomerContact=function updateCustomerContact(_ref){var contactId=_ref.contactId,contact=_ref.contact;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER_CONTACT,contactId:contactId,contact:contact});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateContact').setTrusted().setInput({contactId:contactId,contact:contact}).dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_CONTACT_ERROR,contactId:contactId,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
@@ -0,0 +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{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
2
+ * @param {Object} customer Customer
3
+ * @returns {Function}
4
+ */export var updateCustomerData=function updateCustomerData(customer){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER,customer:customer});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateCustomer').setInput({customer:customer}).setTrusted().dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_SUCCESS,customer:customer});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_ERROR,customer:customer,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -0,0 +1,5 @@
1
+ import{connect}from'react-redux';import{historyReplace}from'@shopgate/engage/core';/**
2
+ * Connects the dispatch function to a callable function in the props.
3
+ * @param {Function} dispatch The redux dispatch function.
4
+ * @return {Object} The extended component props.
5
+ */var mapDispatchToProps={historyReplace:historyReplace};export default connect(null,mapDispatchToProps);
@@ -0,0 +1,4 @@
1
+ import React from'react';import PropTypes from'prop-types';import{hot}from'react-hot-loader/root';import I18n from'@shopgate/pwa-common/components/I18n';import appConfig from'@shopgate/pwa-common/helpers/config';import{i18n,useRoute}from'@shopgate/engage/core';import OrderHistory from"../../../orders/components/OrderHistory";import OrderHistoryProvider from"../../../orders/providers/OrderHistoryProvider";import{Tabs,Tab,TabPanel}from"../../../components/Tabs";import{tabs,title,tabPanel}from"./Account.style";import{ResponsiveContainer}from"../../../components";import Lists from"../../../favorites/components/Lists";import connect from"./Account.connector";import{TabContext}from"../../../components/Tabs/TabContext";import Profile from"../Profile";/**
2
+ * The Tabs components
3
+ * @returns {JSX}
4
+ */var Account=function Account(_ref){var historyReplace=_ref.historyReplace;var _useRoute=useRoute(),_useRoute$params$tab=_useRoute.params.tab,tab=_useRoute$params$tab===void 0?'profile':_useRoute$params$tab;return React.createElement(React.Fragment,null,React.createElement(TabContext,{value:tab},React.createElement("div",{className:tabs},React.createElement(ResponsiveContainer,{webOnly:true,breakpoint:">xs"},React.createElement("div",{className:title},React.createElement(I18n.Text,{string:"titles.your_account"}))),React.createElement(Tabs,{indicatorColor:"primary",textColor:"primary",onChange:function onChange(event,newValue){return historyReplace({pathname:"/account/".concat(newValue)});},"aria-label":"disabled tabs example"},React.createElement(Tab,{value:"profile",label:i18n.text('titles.profile')}),React.createElement(Tab,{value:"orders",label:i18n.text('titles.order_history')}),appConfig.hasFavorites?React.createElement(Tab,{value:"wish-list",label:i18n.text('titles.favorites')}):null)),React.createElement(TabPanel,{className:tabPanel,value:"profile"},React.createElement(Profile,null)),React.createElement(TabPanel,{className:tabPanel,value:"orders"},React.createElement(OrderHistoryProvider,null,React.createElement(OrderHistory,null))),appConfig.hasFavorites?React.createElement(TabPanel,{className:tabPanel,value:"wish-list"},React.createElement(Lists,null)):null));};export default hot(connect(Account));
@@ -0,0 +1 @@
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from'@shopgate/engage/styles';var variables=themeConfig.variables;export var title=css({fontSize:'1.5rem',padding:variables.gap.big}).toString();export var tabs=css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({width:'100%',top:0},responsiveMediaQuery('>xs',{webOnly:true}),{top:64}),responsiveMediaQuery('<=xs',{webOnly:true}),{top:56}),"position",'sticky'),"background",'rgb(255, 255, 255)'),"boxShadow",'2px 1px 6px rgba(0, 0, 0, 0.118), 2px 1px 4px rgba(0, 0, 0, 0.118)'),"zIndex",100)).toString();export var tabPanel=css({padding:variables.gap.small}).toString();
@@ -0,0 +1 @@
1
+ export{default as Account}from"./Account";
@@ -0,0 +1,11 @@
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{i18n}from'@shopgate/engage/core/helpers';import{generateCustomerAttributesFields}from'@shopgate/engage/account/helper/form';/**
2
+ * Generates form configuration.
3
+ * @param {Object} additionalOptions Options for the customer attributes creation helper
4
+ * @param {Array} additionalOptions.customerAttributes Customer attributes.
5
+ * @param {Array} additionalOptions.supportedCountries A list of supported countries.
6
+ * @param {Array} additionalOptions.countrySortOrder Sort order for supported countries.
7
+ * @param {Object} additionalOptions.userLocation User location for better phone picker defaults.
8
+ * @param {boolean} [additionalOptions.allowPleaseChoose] Allows please choose option for required
9
+ * attributes.
10
+ * @returns {Object}
11
+ */var generateFormConfig=function generateFormConfig(additionalOptions){return{fields:_extends({firstName:{type:'text',label:"".concat(i18n.text('account.profile.form.firstName')," *"),required:true},middleName:{type:'text',label:"".concat(i18n.text('account.profile.form.middleName'))},lastName:{type:'text',label:"".concat(i18n.text('account.profile.form.lastName')," *"),required:true},emailAddress:{type:'email',label:"".concat(i18n.text('account.profile.form.emailAddress')," *"),required:true,disabled:true},marketingOptIn:{type:'checkbox',label:i18n.text('account.profile.form.marketing_opt_in_label')}},generateCustomerAttributesFields(additionalOptions,false))};};export default generateFormConfig;
@@ -0,0 +1 @@
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{generateFormConstraints}from'@shopgate/engage/account/helper/form';export default(function(customerAttributes){return _extends({firstName:{presence:{message:'validation.required',allowEmpty:false}},lastName:{presence:{message:'validation.required',allowEmpty:false}},emailAddress:{presence:{message:'validation.required',allowEmpty:false},email:{message:'validation.email'}}},generateFormConstraints(customerAttributes));});
@@ -0,0 +1 @@
1
+ import React,{useRef}from'react';import{css}from'glamor';import Provider from"./Profile.provider";import AddressBook from"./ProfileAddressBook";import Header from"./ProfileHeader";import Form from"./ProfileForm";var styles={root:css({padding:8}).toString()};/** @returns {JSX} */var Profile=function Profile(){var formContainerRef=useRef(null);return React.createElement(Provider,{formContainerRef:formContainerRef},React.createElement("div",{className:styles.root},React.createElement(Header,null),React.createElement(Form,{ref:formContainerRef}),React.createElement(AddressBook,null)));};export default Profile;
@@ -0,0 +1,22 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}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,{createContext,useMemo,useEffect,useContext,useCallback,useState}from'react';import PropTypes from'prop-types';import{connect}from'react-redux';import{getShopSettings}from'@shopgate/engage/core/config';import{getPreferredLocationAddress}from'@shopgate/engage/locations/selectors';import{useRoute,i18n,historyPush,EVALIDATION}from'@shopgate/engage/core';import{getMerchantCustomerAttributes}from'@shopgate/engage/core/selectors/merchantSettings';import{useFormState as useForm,convertValidationErrors}from'@shopgate/engage/core/hooks/useFormState';import showModal from'@shopgate/pwa-common/actions/modal/showModal';import{LoadingProvider,ToastProvider}from'@shopgate/pwa-common/providers';import UIEvents from'@shopgate/pwa-core/emitters/ui';import{CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN,useAddressBook}from'@shopgate/engage/checkout';import{PROFILE_ADDRESS_PATH}from"../../constants/routes";import{fetchCustomerContacts}from"../../actions/fetchContacts";import{fetchCustomerData}from"../../actions/fetchCustomer";import{updateCustomerData}from"../../actions/updateCustomer";import{deleteCustomerContact}from"../../actions/deleteContact";import{deleteCustomer as deleteCustomerAction}from"../../actions/deleteCustomer";import{getContacts}from"../../selectors/contacts";import{getCustomer}from"../../selectors/customer";import{extractAttributes,extractDefaultValues,convertPipelineValidationErrors}from"../../helper/form";import createConstraints from"./Profile.constraints";var ProfileContext=createContext();/**
2
+ * @returns {Array}
3
+ */export var useProfileContext=function useProfileContext(){return useContext(ProfileContext);};/**
4
+ * @param {Object} state State.
5
+ * @returns {Object}
6
+ */var mapStateToProps=function mapStateToProps(state){return{contacts:getContacts(state),customer:getCustomer(state),merchantCustomerAttributes:getMerchantCustomerAttributes(state),shopSettings:getShopSettings(state),userLocation:getPreferredLocationAddress(state)};};/**
7
+ * @param {Function} dispatch Dispatch.
8
+ * @returns {Object}
9
+ */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{fetchContacts:function fetchContacts(){return dispatch(fetchCustomerContacts());},deleteContact:function deleteContact(customerId){return dispatch(deleteCustomerContact(customerId));},deleteCustomer:function deleteCustomer(){return dispatch(deleteCustomerAction());},fetchCustomer:function fetchCustomer(){return dispatch(fetchCustomerData());},updateCustomer:function updateCustomer(customer){return dispatch(updateCustomerData(customer));},showDialog:function showDialog(props){return dispatch(showModal(props));},push:function push(props){return dispatch(historyPush(props));}};};/**
10
+ * @returns {JSX}
11
+ */var ProfileProvider=function ProfileProvider(_ref){var fetchContacts=_ref.fetchContacts,deleteContact=_ref.deleteContact,fetchCustomer=_ref.fetchCustomer,updateCustomer=_ref.updateCustomer,deleteCustomer=_ref.deleteCustomer,push=_ref.push,showDialog=_ref.showDialog,contacts=_ref.contacts,customer=_ref.customer,merchantCustomerAttributes=_ref.merchantCustomerAttributes,children=_ref.children,shopSettings=_ref.shopSettings,userLocation=_ref.userLocation,formContainerRef=_ref.formContainerRef;// Route
12
+ var _useRoute=useRoute(),pathname=_useRoute.pathname;var _useAddressBook=useAddressBook(),isCheckout=_useAddressBook.isCheckout,type=_useAddressBook.type,deleteContactFromOrder=_useAddressBook.deleteContactFromOrder;var _useState=useState(null),_useState2=_slicedToArray(_useState,2),requestErrors=_useState2[0],setRequestErrors=_useState2[1];// Default state.
13
+ var defaultState=useMemo(function(){return customer?_extends({},customer,{marketingOptIn:customer.settings.marketingOptIn||false},extractDefaultValues(customer.attributes)):null;},[customer]);// Saving the form.
14
+ var saveForm=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var attributes,validationErrors,code,errors,converted,_converted$validation;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);attributes=extractAttributes(merchantCustomerAttributes,values);_context.prev=2;_context.next=5;return updateCustomer(_extends({firstName:values.firstName},values.middleName?{middleName:values.middleName}:{},{lastName:values.lastName,emailAddress:values.emailAddress,settings:{marketingOptIn:values.marketingOptIn},attributes:attributes}));case 5:_context.next=7;return fetchCustomer();case 7:UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.success',message:'account.profile.form.success'});_context.next=15;break;case 10:_context.prev=10;_context.t0=_context["catch"](2);code=_context.t0.code,errors=_context.t0.errors;if(code===EVALIDATION){converted=convertPipelineValidationErrors(errors,attributes);if((converted===null||converted===void 0?void 0:converted.validation)&&Object.keys(converted.validation).length>0){validationErrors=converted===null||converted===void 0?void 0:(_converted$validation=converted.validation)===null||_converted$validation===void 0?void 0:_converted$validation.attributes;}}UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.error',message:'account.profile.form.error'});case 15:setRequestErrors(validationErrors||null);LoadingProvider.unsetLoading(pathname);case 17:case"end":return _context.stop();}},_callee,null,[[2,10]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[fetchCustomer,merchantCustomerAttributes,pathname,updateCustomer]);// Hold profile form state.
15
+ var constraints=useMemo(function(){return createConstraints(merchantCustomerAttributes);},[merchantCustomerAttributes]);var formState=useForm(defaultState,saveForm,constraints,formContainerRef,120);var validationErrors=useMemo(function(){return convertValidationErrors(formState.validationErrors||requestErrors||{});},[formState.validationErrors,requestErrors]);useEffect(function(){formState.scrollToError();// eslint-disable-next-line react-hooks/exhaustive-deps
16
+ },[formState.scrollToError,requestErrors]);/**
17
+ * Executes callback with confirmation beforehand.
18
+ * @param {string} message String
19
+ */var confirmation=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(message){var confirmed;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return showDialog({title:i18n.text('account.profile.confirm.title'),message:i18n.text(message),confirm:i18n.text('account.profile.confirm.confirm')});case 2:confirmed=_context2.sent;return _context2.abrupt("return",!!confirmed);case 4:case"end":return _context2.stop();}},_callee2);}));return function confirmation(_x2){return _ref3.apply(this,arguments);};}();// Deletes a contact.
20
+ /* eslint-disable react-hooks/exhaustive-deps */var deleteContactWrapper=useCallback(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(contactId){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return confirmation('account.profile.confirm.messageContact');case 2:if(_context3.sent){_context3.next=4;break;}return _context3.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context3.prev=5;_context3.next=8;return deleteContact(contactId);case 8:_context3.next=10;return fetchContacts();case 10:if(!deleteContactFromOrder){_context3.next=13;break;}_context3.next=13;return deleteContactFromOrder(contactId);case 13:_context3.next=17;break;case 15:_context3.prev=15;_context3.t0=_context3["catch"](5);case 17:LoadingProvider.unsetLoading(pathname);case 18:case"end":return _context3.stop();}},_callee3,null,[[5,15]]);}));return function(_x3){return _ref4.apply(this,arguments);};}(),[deleteContact,fetchContacts,pathname]);var deleteCustomerWrapper=useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return confirmation('account.profile.confirm.messageCustomer');case 2:if(_context4.sent){_context4.next=4;break;}return _context4.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context4.prev=5;_context4.next=8;return deleteCustomer();case 8:_context4.next=12;break;case 10:_context4.prev=10;_context4.t0=_context4["catch"](5);case 12:LoadingProvider.unsetLoading(pathname);case 13:case"end":return _context4.stop();}},_callee4,null,[[5,10]]);})),[deleteContact,fetchContacts,pathname]);/* eslint-enable react-hooks/exhaustive-deps */var editContact=useCallback(function(contact){var editPathname=isCheckout?"".concat(CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN).replace(':type',type):PROFILE_ADDRESS_PATH;push({pathname:editPathname,state:{contact:contact}});},[isCheckout,push,type]);// Store context value.
21
+ var contextValue=useMemo(function(){return{contacts:contacts,validationErrors:validationErrors,merchantCustomerAttributes:merchantCustomerAttributes,customer:defaultState,isCheckout:isCheckout,supportedCountries:shopSettings.supportedCountries,countrySortOrder:shopSettings.countrySortOrder,userLocation:userLocation,formState:formState,saveForm:formState.handleSubmit,editContact:editContact,deleteContact:deleteContactWrapper,deleteCustomer:deleteCustomerWrapper};},[userLocation,shopSettings.supportedCountries,shopSettings.countrySortOrder,contacts,merchantCustomerAttributes,isCheckout,defaultState,deleteContactWrapper,deleteCustomerWrapper,editContact,formState,validationErrors]);// Fetch all required data for the profile page.
22
+ useEffect(function(){fetchContacts();fetchCustomer();},[fetchContacts,fetchCustomer]);if(!customer){return null;}return React.createElement(ProfileContext.Provider,{value:contextValue},children);};ProfileProvider.defaultProps={customer:null,formContainerRef:null};export default connect(mapStateToProps,mapDispatchToProps)(ProfileProvider);
@@ -0,0 +1,6 @@
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React from'react';import{connect}from'react-redux';import PropTypes from'prop-types';import{css}from'glamor';import{i18n,historyPush}from'@shopgate/engage/core';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{RippleButton}from'@shopgate/engage/components';import AddressCard from"./ProfileAddressCard";import{useProfileContext}from"./Profile.provider";import{PROFILE_ADDRESS_PATH}from"../../constants/routes";/**
2
+ * @param {Object} dispatch Dispatch
3
+ * @returns {Object}
4
+ */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{push:function push(props){return dispatch(historyPush(props));}};};var styles={title:css({color:'var(--color-text-high-emphasis)',lineHeight:2.5,fontSize:17,fontWeight:'600'}).toString(),container:css({display:'flex',flexDirection:'row',flexWrap:'wrap',margin:-4}).toString(),button:css({'&&':_defineProperty({marginTop:8,marginRight:16,backgroundColor:'var(--color-primary)',borderRadius:5,fontSize:14,textTransform:'none',padding:0},responsiveMediaQuery('<md',{webOnly:false}),{width:'100%',marginRight:0})}).toString(),ripple:css({padding:'8px 16px'}).toString(),actions:css(_defineProperty({display:'flex',justifyContent:'flex-end',flexDirection:'row'},responsiveMediaQuery('<md',{webOnly:false}),{flex:1})).toString()};/**
5
+ * @returns {JSX}
6
+ */var ProfileAddressBook=function ProfileAddressBook(_ref){var push=_ref.push;var _useProfileContext=useProfileContext(),contacts=_useProfileContext.contacts,_deleteContact=_useProfileContext.deleteContact,_editContact=_useProfileContext.editContact;return React.createElement("div",null,React.createElement("span",{className:styles.title},i18n.text('account.profile.address_book.title')),React.createElement("div",{className:styles.container},contacts&&contacts.map(function(contact){return React.createElement(AddressCard,{key:contact.id,contact:contact,deleteContact:function deleteContact(){return _deleteContact(contact.id);},editContact:function editContact(){return _editContact(contact);}});})),React.createElement("div",{className:styles.actions},React.createElement(RippleButton,{className:styles.button,rippleClassName:styles.ripple,type:"primary",onClick:function onClick(){return push({pathname:PROFILE_ADDRESS_PATH});}},i18n.text('account.profile.address_book.add'))));};export default connect(null,mapDispatchToProps)(ProfileAddressBook);
@@ -0,0 +1,3 @@
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React from'react';import{css}from'glamor';import PropTypes from'prop-types';import classNames from'classnames';import{i18n}from'@shopgate/engage/core';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{useAddressBook,ADDRESS_TYPE_BILLING,ADDRESS_TYPE_SHIPPING}from'@shopgate/engage/checkout';import{RippleButton,Card,ContextMenu}from'@shopgate/engage/components';import iso3166 from"../../../components/Form/Builder/helpers/iso-3166-2";var styles={root:css(_defineProperty({padding:16,display:'flex',flexDirection:'column',width:'calc(50% - 16px)'},responsiveMediaQuery('<md',{webOnly:false}),{width:'100%'})).toString(),contextMenu:css({marginRight:-8,marginBottom:4}).toString(),header:css({display:'flex',flexDirection:'row'}).toString(),body:css(_defineProperty({display:'flex',flexDirection:'row',justifyContent:'space-between',height:'100%'},responsiveMediaQuery('<md',{webOnly:false}),{flexDirection:'column'})).toString(),column:css({display:'flex',flexDirection:'column'}).toString(),selectButtonColumn:css(_defineProperty({justifyContent:'flex-end',paddingLeft:8},responsiveMediaQuery('<md',{webOnly:false}),{paddingLeft:0})).toString(),name:css({color:'var(--color-text-high-emphasis)',flex:1,fontSize:16,fontWeight:'600'}).toString(),others:css({color:'var(--color-text-medium-emphasis)',fontSize:16}),defaultLabel:css({color:'var(--color-text-low-emphasis)',fontSize:15}).toString(),selectedLabel:css({color:'var(--color-text-high-emphasis)',fontSize:15,fontWeight:500,paddingTop:8}).toString(),button:css({'&&:disabled':{padding:'8px 0'},'&&':{marginTop:8,borderRadius:5,fontSize:14,padding:0,textTransform:'none'}}).toString(),ripple:css({padding:'8px 16px'}).toString()};/**
2
+ * @returns {JSX}
3
+ */var ProfileAddressCard=function ProfileAddressCard(_ref){var _iso3166$contact$coun,_iso3166$contact$coun2;var contact=_ref.contact,deleteContact=_ref.deleteContact,editContact=_ref.editContact,selectContact=_ref.selectContact,selected=_ref.selected;var _useAddressBook=useAddressBook(),isCheckout=_useAddressBook.isCheckout,type=_useAddressBook.type;return React.createElement(Card,{className:styles.root},React.createElement("div",{className:styles.header},React.createElement("span",{className:styles.name},contact.middleName?"".concat(contact.firstName," ").concat(contact.middleName," ").concat(contact.lastName):"".concat(contact.firstName," ").concat(contact.lastName)),React.createElement(ContextMenu,{classes:{container:styles.contextMenu}},React.createElement(ContextMenu.Item,{onClick:editContact},i18n.text('account.profile.address_book.context.edit')),React.createElement(ContextMenu.Item,{onClick:deleteContact},i18n.text('account.profile.address_book.context.remove')))),React.createElement("div",{className:styles.body},React.createElement("div",{className:styles.column},!isCheckout&&contact.emailAddress?React.createElement("span",{className:styles.others},contact.emailAddress):null,contact.postalCode||contact.region||contact.city||contact.country?React.createElement("span",{className:styles.others},i18n.text('checkout.billing.address',{postalCode:contact.postalCode||'',region:(iso3166===null||iso3166===void 0?void 0:(_iso3166$contact$coun=iso3166[contact.country])===null||_iso3166$contact$coun===void 0?void 0:(_iso3166$contact$coun2=_iso3166$contact$coun.divisions)===null||_iso3166$contact$coun2===void 0?void 0:_iso3166$contact$coun2[contact.region])||contact.region||'',city:contact.city||'',country:contact.country||''})):null,contact.address1?React.createElement("span",{className:styles.others},contact.address1):null,contact.address2?React.createElement("span",{className:styles.others},contact.address2):null,contact.address3?React.createElement("span",{className:styles.others},contact.address3):null,contact.address4?React.createElement("span",{className:styles.others},contact.address4):null,!isCheckout&&contact.mobile?React.createElement("span",{className:styles.others},contact.mobile):null,(!isCheckout||type===ADDRESS_TYPE_BILLING)&&contact.isDefaultBilling?React.createElement("span",{className:styles.defaultLabel},i18n.text('account.profile.address_book.default_billing')):null,(!isCheckout||type===ADDRESS_TYPE_SHIPPING)&&contact.isDefaultShipping?React.createElement("span",{className:styles.defaultLabel},i18n.text('account.profile.address_book.default_shipping')):null),React.createElement("div",{className:classNames(styles.column,styles.selectButtonColumn)},isCheckout?React.createElement(RippleButton,{className:styles.button,rippleClassName:styles.ripple,type:"secondary",disabled:selected,onClick:selectContact},i18n.text("account.profile.address_book.".concat(selected?'selected':'select'))):null)));};ProfileAddressCard.defaultProps={selectContact:null,selected:false};export default ProfileAddressCard;
@@ -0,0 +1,3 @@
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;}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,{useMemo,useCallback,forwardRef}from'react';import{css}from'glamor';import{i18n}from'@shopgate/engage/core';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{FormBuilder,RippleButton}from'@shopgate/engage/components';import{StylePresets}from'@shopgate/engage/components/Form';import{useProfileContext}from"./Profile.provider";import generateFormConfig from"./Profile.config";var styles={root:css({display:'flex',flexDirection:'column',marginBottom:16}).toString(),form:css(_extends({},StylePresets.OUTLINED_FORM_FIELDS,{},StylePresets.TWO_COLUMN_LAYOUT,{' .container-checkbox':_defineProperty({},responsiveMediaQuery('>=md',{webOnly:false}),{marginRight:'50%'})})).toString(),button:css({'&&':_defineProperty({marginTop:8,marginRight:16,backgroundColor:'var(--color-primary)',borderRadius:5,fontSize:14,textTransform:'none',padding:0},responsiveMediaQuery('<md',{webOnly:false}),{marginRight:0})}).toString(),buttonDelete:css({'&&':_defineProperty({marginTop:8,marginRight:16,border:'1px solid var(--color-state-alert)',backgroundColor:'#fff',color:'var(--color-state-alert)',borderRadius:5,fontSize:14,textTransform:'none',padding:0},responsiveMediaQuery('<md',{webOnly:false}),{marginRight:0})}).toString(),ripple:css({padding:'8px 16px'}).toString(),actions:css(_defineProperty({display:'flex',justifyContent:'flex-end',flexDirection:'row'},responsiveMediaQuery('<md',{webOnly:false}),{marginTop:8,flexDirection:'column-reverse'})).toString()};/**
2
+ * @returns {JSX}
3
+ */var ProfileForm=forwardRef(function(_,ref){var _useProfileContext=useProfileContext(),formState=_useProfileContext.formState,customer=_useProfileContext.customer,saveForm=_useProfileContext.saveForm,deleteCustomer=_useProfileContext.deleteCustomer,validationErrors=_useProfileContext.validationErrors,merchantCustomerAttributes=_useProfileContext.merchantCustomerAttributes,supportedCountries=_useProfileContext.supportedCountries,countrySortOrder=_useProfileContext.countrySortOrder,userLocation=_useProfileContext.userLocation;var formConfig=useMemo(function(){return generateFormConfig({customerAttributes:merchantCustomerAttributes,supportedCountries:supportedCountries,countrySortOrder:countrySortOrder,userLocation:userLocation});},[countrySortOrder,merchantCustomerAttributes,supportedCountries,userLocation]);/* eslint-disable react-hooks/exhaustive-deps */var handleUpdate=useCallback(function(values){formState.setValues(values);},[formState.setValues]);/* eslint-enable react-hooks/exhaustive-deps */if(!customer){return null;}return React.createElement("div",{className:styles.root,ref:ref},React.createElement(FormBuilder,{name:"ProfileForm",className:styles.form,config:formConfig,defaults:customer,validationErrors:validationErrors,handleUpdate:handleUpdate}),React.createElement("div",{className:styles.actions},React.createElement(RippleButton,{className:styles.buttonDelete,rippleClassName:styles.ripple,type:"primary",onClick:deleteCustomer},i18n.text('account.profile.delete')),React.createElement(RippleButton,{className:styles.button,rippleClassName:styles.ripple,type:"primary",onClick:saveForm},i18n.text('account.profile.form.save'))));});export default ProfileForm;
@@ -0,0 +1,3 @@
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React from'react';import{css}from'glamor';import{i18n}from'@shopgate/engage/core';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{useProfileContext}from"./Profile.provider";var styles={root:css(_defineProperty({marginTop:8},responsiveMediaQuery('<md'),{marginTop:16,marginBottom:16})),title:css({color:'var(--color-text-high-emphasis)',fontSize:17,fontWeight:'600'}).toString()};/**
2
+ * @returns {JSX}
3
+ */var ProfileHeader=function ProfileHeader(){var _ref=useProfileContext().customer||{},internalCustomerNumber=_ref.internalCustomerNumber;return React.createElement("div",{className:styles.root},React.createElement("span",{className:styles.title},i18n.text('account.profile.customer.number',{customerNumber:internalCustomerNumber})));};export default ProfileHeader;
@@ -0,0 +1 @@
1
+ export{default}from"./Profile";
@@ -0,0 +1,11 @@
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{i18n}from'@shopgate/engage/core/helpers';import{ADDRESS_TYPE_SHIPPING,ADDRESS_TYPE_BILLING}from'@shopgate/engage/checkout';/**
2
+ * Generates form configuration.
3
+ * @param {Object} options Options for the helper
4
+ * @param {Array} options.supportedCountries A list of supported countries.
5
+ * @param {Array} options.countrySortOrder Sort order for supported countries.
6
+ * @param {Object} options.userLocation User location for better phone picker defaults.
7
+ * @param {boolean} options.isCheckout Whether the form is shown within the checkout process
8
+ * @param {string} options.type An address type
9
+ * @param {number} options.numberOfAddressLines The number of address lines
10
+ * @returns {Object}
11
+ */export var generateFormConfig=function generateFormConfig(_ref){var supportedCountries=_ref.supportedCountries,countrySortOrder=_ref.countrySortOrder,userLocation=_ref.userLocation,isCheckout=_ref.isCheckout,type=_ref.type,numberOfAddressLines=_ref.numberOfAddressLines;return{fields:_extends({firstName:{type:'text',label:"".concat(i18n.text('account.profile.form.firstName')," *"),required:true}},!isCheckout?{middleName:{type:'text',label:"".concat(i18n.text('account.profile.form.middleName'))}}:{},{lastName:{type:'text',label:"".concat(i18n.text('account.profile.form.lastName')," *"),required:true}},!isCheckout?{emailAddress:{type:'email',label:"".concat(i18n.text('account.profile.form.emailAddress')," *"),required:true},mobile:{type:'phone_picker',label:"".concat(i18n.text('checkout.pickup_contact.form.mobile')," *"),required:true,config:{supportedCountries:supportedCountries,countrySortOrder:countrySortOrder,userLocation:userLocation}}}:{},{address1:{type:'text',label:"".concat(i18n.text('account.profile.form.address1')," *"),required:true}},numberOfAddressLines>=2?{address2:{type:'text',label:i18n.text('account.profile.form.address2')}}:{},{},numberOfAddressLines>=3?{address3:{type:'text',label:i18n.text('account.profile.form.address3')}}:{},{},numberOfAddressLines>=4?{address4:{type:'text',label:i18n.text('account.profile.form.address4')}}:{},{postalCode:{type:'text',label:"".concat(i18n.text('account.profile.form.postalCode')," *"),required:true},city:{type:'text',label:"".concat(i18n.text('account.profile.form.city')," *"),required:true},country:{type:'country',label:"".concat(i18n.text('account.profile.form.country')," *"),required:true,countries:supportedCountries},region:{type:'province',label:"".concat(i18n.text('account.profile.form.region')," *"),required:true}},!isCheckout||type===ADDRESS_TYPE_BILLING?{isDefaultBilling:{type:'checkbox',label:i18n.text(!isCheckout?'account.profile.form.default_billing':'account.profile.form.save_default_billing')}}:{},{},!isCheckout||type===ADDRESS_TYPE_SHIPPING?{isDefaultShipping:{type:'checkbox',label:i18n.text(!isCheckout?'account.profile.form.default_shipping':'account.profile.form.save_default_shipping')}}:{})};};export default generateFormConfig;
@@ -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);}/**
2
+ * Generates form constraints.
3
+ * @param {boolean} isCheckout Whether the form is shown within the checkout process
4
+ * @returns {Object}
5
+ */export var generateConstraints=function generateConstraints(){var isCheckout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;return _extends({firstName:{presence:{message:'validation.required',allowEmpty:false}},lastName:{presence:{message:'validation.required',allowEmpty:false}}},!isCheckout?{emailAddress:{presence:{message:'validation.required',allowEmpty:false},email:{message:'validation.email'}},mobile:{presence:{message:'validation.required',allowEmpty:false},format:{pattern:'^[+0-9]+',message:'validation.mobileNumber'}}}:{},{address1:{presence:{message:'validation.required',allowEmpty:false}},city:{presence:{message:'validation.required',allowEmpty:false}},country:{presence:{message:'validation.required',allowEmpty:false}},postalCode:{presence:{message:'validation.required',allowEmpty:false}}});};export default generateConstraints;
@@ -0,0 +1,13 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _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 _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,{useMemo,useCallback,useRef}from'react';import{connect}from'react-redux';import PropTypes from'prop-types';import{css}from'glamor';import{i18n,useRoute,historyPop,getNumberOfAddressLines}from'@shopgate/engage/core';import{convertValidationErrors,useFormState}from'@shopgate/engage/core/hooks/useFormState';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{getShopSettings}from'@shopgate/engage/core/config';import{getPreferredLocationAddress}from'@shopgate/engage/locations/selectors';import{FormBuilder,RippleButton}from'@shopgate/engage/components';import{StylePresets}from'@shopgate/engage/components/Form';import{LoadingProvider}from'@shopgate/pwa-common/providers';import{useAddressBook}from'@shopgate/engage/checkout';import{generateFormConfig}from"./ProfileContact.config";import{generateConstraints}from"./ProfileContact.constraints";import{addCustomerContacts}from"../../actions/addContacts";import{getCustomer}from"../../selectors/customer";import{updateCustomerContact}from"../../actions/updateContact";/**
2
+ * @param {Object} state State
3
+ * @returns {Object}
4
+ */var mapStateToProps=function mapStateToProps(state){return{shopSettings:getShopSettings(state),userLocation:getPreferredLocationAddress(state),customer:getCustomer(state),numberOfAddressLines:getNumberOfAddressLines(state)};};/**
5
+ * @param {Object} dispatch Dispatch
6
+ * @returns {Object}
7
+ */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{pop:function pop(props){return dispatch(historyPop(props));},addContact:function addContact(contact){return dispatch(addCustomerContacts({contacts:[contact]}));},updateContact:function updateContact(contactId,contact){return dispatch(updateCustomerContact({contactId:contactId,contact:contact}));}};};var styles={root:css({margin:16}),form:css(_extends({},StylePresets.OUTLINED_FORM_FIELDS,{},StylePresets.TWO_COLUMN_LAYOUT,{' .profileAddressFormRegion':_defineProperty({},responsiveMediaQuery('>=md',{webOnly:false}),{marginRight:'50%'})})).toString(),button:css({'&&':_defineProperty({marginTop:8,marginRight:16,backgroundColor:'var(--color-primary)',borderRadius:5,fontSize:14,textTransform:'none',padding:0},responsiveMediaQuery('<md',{webOnly:false}),{width:'100%',marginRight:0})}).toString(),ripple:css({padding:'8px 16px'}).toString(),actions:css(_defineProperty({display:'flex',justifyContent:'flex-end',flexDirection:'row'},responsiveMediaQuery('<md',{webOnly:false}),{flex:1})).toString()};/**
8
+ * @param {Object} props Props.
9
+ * @returns {JSX}
10
+ */var ProfileContact=function ProfileContact(_ref){var shopSettings=_ref.shopSettings,userLocation=_ref.userLocation,addContact=_ref.addContact,updateContact=_ref.updateContact,pop=_ref.pop,customer=_ref.customer,numberOfAddressLines=_ref.numberOfAddressLines;var _useAddressBook=useAddressBook(),updateOrderWithContact=_useAddressBook.updateOrderWithContact,type=_useAddressBook.type,isCheckout=_useAddressBook.isCheckout;var formContainerRef=useRef(null);var _useRoute=useRoute(),pathname=_useRoute.pathname,_useRoute$state$conta=_useRoute.state.contact,contact=_useRoute$state$conta===void 0?{}:_useRoute$state$conta;var addressLines=useMemo(function(){/**
11
+ * Determine the number of address fields with a value. Customers are supposed to edit their
12
+ * old addresses after the numberOfAddressLines shop setting was changed.
13
+ */var addressLinesInContact=Object.keys(contact).reduce(function(acc,key){if(key.startsWith('address')&&contact[key]){return parseInt(key.charAt(key.length-1),10);}return acc;},0);return Math.max(numberOfAddressLines,addressLinesInContact);},[contact,numberOfAddressLines]);var formConfig=useMemo(function(){return generateFormConfig({supportedCountries:shopSettings===null||shopSettings===void 0?void 0:shopSettings.supportedCountries,countrySortOrder:shopSettings===null||shopSettings===void 0?void 0:shopSettings.countrySortOrder,userLocation:userLocation,isCheckout:isCheckout,type:type,numberOfAddressLines:addressLines});},[addressLines,isCheckout,shopSettings,type,userLocation]);var constraints=useMemo(function(){return generateConstraints(isCheckout);},[isCheckout]);var handleSubmit=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var contactId,finalValues,fieldsUpdated,_ref3,_ref3$contactIds;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);contactId=contact.id;finalValues=_extends({},values,{},isCheckout&&!(contact===null||contact===void 0?void 0:contact.emailAddress)?{emailAddress:customer===null||customer===void 0?void 0:customer.emailAddress}:{});fieldsUpdated=Object.keys(values).filter(function(key){return!['isDefaultBilling','isDefaultShipping'].includes(key);}).some(function(key){return values[key]!==contact[key];});_context.prev=4;if(!(contact===null||contact===void 0?void 0:contact.id)){_context.next=10;break;}_context.next=8;return updateContact(contact.id,finalValues);case 8:_context.next=15;break;case 10:_context.next=12;return addContact(finalValues);case 12:_ref3=_context.sent;_ref3$contactIds=_slicedToArray(_ref3.contactIds,1);contactId=_ref3$contactIds[0];case 15:if(!(updateOrderWithContact&&fieldsUpdated)){_context.next=19;break;}_context.next=18;return updateOrderWithContact(contactId);case 18:return _context.abrupt("return");case 19:pop();_context.next=24;break;case 22:_context.prev=22;_context.t0=_context["catch"](4);case 24:LoadingProvider.unsetLoading(pathname);case 25:case"end":return _context.stop();}},_callee,null,[[4,22]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[addContact,contact,customer,isCheckout,pathname,pop,updateContact,updateOrderWithContact]);var formState=useFormState(contact,handleSubmit,constraints,formContainerRef);var validationErrors=useMemo(function(){return convertValidationErrors(formState.validationErrors||{});},[formState.validationErrors]);/* eslint-disable react-hooks/exhaustive-deps */var handleUpdate=useCallback(function(values){formState.setValues(values);},[formState.setValues]);/* eslint-enable react-hooks/exhaustive-deps */return React.createElement("div",{className:styles.root,ref:formContainerRef},React.createElement(FormBuilder,{name:"ProfileAddressForm",className:styles.form,config:formConfig,defaults:contact,validationErrors:validationErrors,handleUpdate:handleUpdate}),React.createElement("div",{className:styles.actions},React.createElement(RippleButton,{className:styles.button,rippleClassName:styles.ripple,type:"primary",onClick:formState.handleSubmit},i18n.text('account.profile.form.save'))));};ProfileContact.defaultProps={customer:null,numberOfAddressLines:null};export default connect(mapStateToProps,mapDispatchToProps)(ProfileContact);
@@ -0,0 +1 @@
1
+ export{default}from"./ProfileContact";
@@ -0,0 +1 @@
1
+ export{Account}from"./Account";
@@ -0,0 +1 @@
1
+ export var REQUEST_ORDER_HISTORY='REQUEST_ORDER_HISTORY';export var RECEIVE_ORDER_HISTORY='RECEIVE_ORDER_HISTORY';export var ERROR_ORDER_HISTORY='ERROR_ORDER_HISTORY';export var FETCH_CUSTOMER_CONTACTS='FETCH_CUSTOMER_CONTACTS';export var FETCH_CUSTOMER_CONTACTS_SUCCESS='FETCH_CUSTOMER_CONTACTS_SUCCESS';export var FETCH_CUSTOMER_CONTACTS_ERROR='FETCH_CUSTOMER_CONTACTS_ERROR';export var FETCH_CUSTOMER='FETCH_CUSTOMER_CONTACTS';export var FETCH_CUSTOMER_SUCCESS='FETCH_CUSTOMER_SUCCESS';export var FETCH_CUSTOMER_ERROR='FETCH_CUSTOMER_ERROR';export var UPDATE_CUSTOMER='UPDATE_CUSTOMER_CONTACTS';export var UPDATE_CUSTOMER_SUCCESS='UPDATE_CUSTOMER_SUCCESS';export var UPDATE_CUSTOMER_ERROR='UPDATE_CUSTOMER_ERROR';export var UPDATE_CUSTOMER_CONTACT='UPDATE_CUSTOMER_CONTACT';export var UPDATE_CUSTOMER_CONTACT_SUCCESS='UPDATE_CUSTOMER_CONTACT_SUCCESS';export var UPDATE_CUSTOMER_CONTACT_ERROR='UPDATE_CUSTOMER_CONTACT_ERROR';export var ADD_CUSTOMER_CONTACT='ADD_CUSTOMER_CONTACT';export var ADD_CUSTOMER_CONTACT_SUCCESS='ADD_CUSTOMER_CONTACT_SUCCESS';export var ADD_CUSTOMER_CONTACT_ERROR='ADD_CUSTOMER_CONTACT_ERROR';export var DELETE_CUSTOMER_CONTACT='DELETE_CUSTOMER_CONTACT';export var DELETE_CUSTOMER_CONTACT_SUCCESS='DELETE_CUSTOMER_CONTACT_SUCCESS';export var DELETE_CUSTOMER_CONTACT_ERROR='DELETE_CUSTOMER_CONTACT_ERROR';export var DELETE_CUSTOMER='DELETE_CUSTOMER';export var DELETE_CUSTOMER_SUCCESS='DELETE_CUSTOMER_SUCCESS';export var DELETE_CUSTOMER_ERROR='DELETE_CUSTOMER_ERROR';
@@ -1 +1 @@
1
- export{ACCOUNT_PATH,ACCOUNT_PATTERN,ORDERS_PATH,WISH_LIST_PATH,PROFILE_ADDRESS_PATH,PROFILE_PATH}from"./routes";
1
+ export{ACCOUNT_PATH,ACCOUNT_PATTERN,ORDERS_PATH,WISH_LIST_PATH,PROFILE_ADDRESS_PATH,PROFILE_PATH}from"./routes";export*from"./actions";export*from"./pipelines";
@@ -0,0 +1 @@
1
+ export var SHOPGATE_GET_ORDER_HISTORY='shopgate.order.getOrderHistory';
@@ -0,0 +1,61 @@
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 _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 _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 sortBy from'lodash/sortBy';import setWith from'lodash/setWith';import{i18n}from'@shopgate/engage/core';/**
2
+ * @param {Object} attribute Customer attribute.
3
+ * @returns {string}
4
+ */var mapCustomerAttributeType=function mapCustomerAttributeType(attribute){if(attribute.values&&attribute.values.length){if(attribute.type==='collectionOfValues'){return'multiselect';}return'select';}switch(attribute.type){case'number':return'number';case'boolean':return'checkbox';case'date':return'date';case'callingNumber':return'phone_picker';default:return'text';}};/**
5
+ * Generates customer attributes form field config
6
+ * @param {Object} options Options for the helper
7
+ * @param {Array} options.customerAttributes Customer attributes.
8
+ * @param {Array} options.supportedCountries A list of supported countries.
9
+ * @param {Array} options.countrySortOrder Sort order for supported countries.
10
+ * @param {Object} options.userLocation User location for better phone picker defaults.
11
+ * @param {boolean} options.allowPleaseChoose Allows please choose option for required attributes.
12
+ * @returns {Object}
13
+ */export var generateCustomerAttributesFields=function generateCustomerAttributesFields(_ref){var customerAttributes=_ref.customerAttributes,supportedCountries=_ref.supportedCountries,countrySortOrder=_ref.countrySortOrder,userLocation=_ref.userLocation,_ref$allowPleaseChoos=_ref.allowPleaseChoose,allowPleaseChoose=_ref$allowPleaseChoos===void 0?true:_ref$allowPleaseChoos;return _extends({},Object.assign.apply(Object,[{}].concat(sortBy(customerAttributes,['sequenceId']).map(function(attribute){return _defineProperty({},"attribute_".concat(attribute.code),_extends({type:mapCustomerAttributeType(attribute),label:"".concat(attribute.name," ").concat(attribute.isRequired?'*':'')},attribute.values?{options:_extends({},!attribute.isRequired?{'':''}:{},{},attribute.isRequired&&attribute.type!=='collectionOfValues'&&allowPleaseChoose?{'':i18n.text('common.please_choose')}:{},{},Object.assign.apply(Object,[{}].concat(sortBy(attribute.values,['sequenceId']).map(function(option){return _defineProperty({},option.code,option.name);}))))}:{},{},attribute.type==='callingNumber'?{config:{supportedCountries:supportedCountries,countrySortOrder:countrySortOrder,userLocation:userLocation}}:null));}))));};/**
14
+ * Generates form constraints for attributes.
15
+ * @param {Object} customerAttributes Customer attributes.
16
+ * @returns {Object}
17
+ */export var generateFormConstraints=function generateFormConstraints(customerAttributes){return _extends({},Object.assign.apply(Object,[{}].concat(customerAttributes.map(function(attribute){var constraint={};if(attribute.isRequired||attribute.type==='date'){constraint["attribute_".concat(attribute.code)]={};}if(attribute.isRequired){constraint["attribute_".concat(attribute.code)].presence={message:'validation.required',allowEmpty:false};}if(attribute.type==='date'){constraint["attribute_".concat(attribute.code)].datetime={dateOnly:true,message:'validation.date'};}return constraint;}))));};/**
18
+ * Maps the type of an attribute value.
19
+ * @param {Object|string|string[]|number} value Attribute value.
20
+ * @param {*} attribute The attribute configuration.
21
+ * @returns {Object|string|number}
22
+ */var mapAttributeType=function mapAttributeType(value,attribute){var _attribute$values;// Multi select
23
+ if(attribute.type==='collectionOfValues'){return(value||[]).map(function(v){return{code:v};});}// Single select.
24
+ if((_attribute$values=attribute.values)===null||_attribute$values===void 0?void 0:_attribute$values.length){return{code:value.toString()};}// Number type.
25
+ if(attribute.type==='number'){return value.length?parseFloat(value.replace(',','.')||0):null;}// Text types (date is just a formatted text)
26
+ if(attribute.type==='text'||attribute.type==='date'){return value!==null?value.toString():'';}return value;};/**
27
+ * Extracts attributes from form data as expected by the API.
28
+ * @param {Object} customerAttributes Customer attributes.
29
+ * @param {Object} formData Form data.
30
+ * @returns {Object}
31
+ */export var extractAttributes=function extractAttributes(customerAttributes,formData){return customerAttributes.map(function(attribute){return{code:attribute.code,value:mapAttributeType(formData["attribute_".concat(attribute.code)],attribute)};})// Removes wrong numbers (sometimes generated by the form builder when emptying the field)
32
+ .filter(function(attribute){return!Number.isNaN(attribute.value);})// Removes all attributes that are empty / no longer set.
33
+ .filter(function(attribute){var _attribute$value,_attribute$value2,_attribute$value2$cod,_attribute$value3,_attribute$value3$,_attribute$value3$$co;return(// Any number.
34
+ typeof attribute.value==='number'||// Non-empty strings.
35
+ typeof attribute.value==='string'&&attribute.value.length||// Booleans are always allowed.
36
+ attribute.value===true||attribute.value===false||// Object containing the code.
37
+ !Array.isArray((_attribute$value=attribute.value)===null||_attribute$value===void 0?void 0:_attribute$value.code)&&((_attribute$value2=attribute.value)===null||_attribute$value2===void 0?void 0:(_attribute$value2$cod=_attribute$value2.code)===null||_attribute$value2$cod===void 0?void 0:_attribute$value2$cod.length)||(// Array containing at least one code.
38
+ (_attribute$value3=attribute.value)===null||_attribute$value3===void 0?void 0:(_attribute$value3$=_attribute$value3[0])===null||_attribute$value3$===void 0?void 0:(_attribute$value3$$co=_attribute$value3$.code)===null||_attribute$value3$$co===void 0?void 0:_attribute$value3$$co.length));});};/**
39
+ * Extracts the default values for the form
40
+ * @param {Object} customerAttributes Customer attributes.
41
+ * @returns {Object}
42
+ */export var extractDefaultValues=function extractDefaultValues(customerAttributes){return Object.assign.apply(Object,[{}].concat(customerAttributes.map(function(attribute){var value=attribute.value;if(value){if(Array.isArray(value)&&value[0]&&_typeof(value[0])==='object'){// Multi select L:95
43
+ value=value.reduce(function(acc,val){return[].concat(acc,[val.code]);},[]);}else if(_typeof(value)==='object'){// Single select L:100
44
+ value=value.code;}else if(value!==true&&value!==false){value=value.toString();}}return _defineProperty({},"attribute_".concat(attribute.code),value);})));};/**
45
+ * Converts pipeline validation errors
46
+ * @param {Array} errors The errors
47
+ * @param {Array} attributes Attributes that where sent with the register request. Used to retrieve
48
+ * extra form field for attribute validation errors.
49
+ * @returns {Object|null}
50
+ */export var convertPipelineValidationErrors=function convertPipelineValidationErrors(errors){var attributes=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!Array.isArray(errors)||errors.length===0){return null;}var converted=errors.reduce(function(result,error){var _error$path=error.path,path=_error$path===void 0?[]:_error$path,code=error.code,_error$subentityPath=error.subentityPath,subentityPath=_error$subentityPath===void 0?[]:_error$subentityPath,displayMessage=error.displayMessage;var message=error.message;if(path.length===0&&subentityPath.length===0){result.general.push(error);return result;}var validationPath;if(path.length>0){message=i18n.text('validation.checkField');validationPath=path.slice(2).join('.');}else if(subentityPath.length>0&&subentityPath.includes('attributes')){/**
51
+ * Validation errors for customer attributes needs special handling. They are sent
52
+ * as an array to the server, which only includes the fields where an actual value was set.
53
+ * The subentityPath of attribute validation errors will only contain an array index which
54
+ * needs to be mapped to tha actual field id.
55
+ *
56
+ * So here in the first step, we search for the subentity path entry that comes after the
57
+ * "attributes" entry and convert it back to an integer which can be used to determine
58
+ * and entry within the attribute data that was used for the request.
59
+ */var attributeIndex=parseInt(subentityPath[subentityPath.indexOf('attributes')+1],10);message=i18n.text('validation.checkField');// Retrieve the attribute code to mock a validation path that can be used to find the correct
60
+ // form field.
61
+ validationPath="attributes.attribute_".concat(attributes[attributeIndex].code);}else if(subentityPath.length>0){var field=subentityPath[subentityPath.length-1];if(code===409&&field==='emailAddress'){message=i18n.text('validation.emailConflict');}else{message=i18n.text('validation.checkField');}validationPath=subentityPath.join('.');}if(validationPath){setWith(result.validation,validationPath,displayMessage||message,Object);}return result;},{validation:{},general:[]});return converted;};