@lookiero/checkout 9.14.0 → 10.0.0-beta.1

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 (288) hide show
  1. package/dist/fake-dependencies/@lookiero/payments-front/index.d.ts +8 -6
  2. package/dist/fake-dependencies/@lookiero/payments-front/index.js +7 -4
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.js +1 -2
  5. package/dist/pact.config.d.ts +21 -0
  6. package/dist/pact.config.js +16 -0
  7. package/dist/public/public/assets/adaptive-icon.png +0 -0
  8. package/dist/public/public/assets/favicon.png +0 -0
  9. package/dist/public/public/assets/icon.png +0 -0
  10. package/dist/public/public/assets/splash.png +0 -0
  11. package/dist/public/public/images/not-found.png +0 -0
  12. package/dist/src/Expo.js +0 -2
  13. package/dist/src/ExpoRoot.js +19 -15
  14. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +1 -1
  15. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +2 -0
  16. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +1 -0
  17. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +55 -0
  18. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +1 -0
  19. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +116 -0
  20. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +1 -0
  21. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +56 -0
  22. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +1 -0
  23. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +51 -0
  24. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +1 -0
  25. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +51 -0
  26. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +1 -0
  27. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +51 -0
  28. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +13 -0
  29. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +19 -0
  30. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +1 -0
  31. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +56 -0
  32. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +1 -0
  33. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +57 -0
  34. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +1 -0
  35. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +55 -0
  36. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +1 -0
  37. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +120 -0
  38. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +1 -0
  39. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +55 -0
  40. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.d.ts +1 -1
  41. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +2 -1
  42. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +1 -0
  43. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +55 -0
  44. package/dist/src/infrastructure/tracking/tracking.d.ts +2 -2
  45. package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +10 -17
  46. package/dist/src/infrastructure/tracking/useTrackCheckout.js +27 -12
  47. package/dist/src/infrastructure/ui/Root.d.ts +6 -6
  48. package/dist/src/infrastructure/ui/Root.js +2 -3
  49. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +1 -2
  50. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.js +2 -3
  51. package/dist/src/infrastructure/ui/components/atoms/price/Price.js +0 -3
  52. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +22 -0
  53. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
  54. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +7 -0
  55. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +5 -0
  56. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +7 -0
  57. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +6 -0
  58. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
  59. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +20 -0
  60. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +4 -0
  61. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +43 -0
  62. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
  63. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +14 -0
  64. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +3 -7
  65. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +2 -18
  66. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +2 -14
  67. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +1 -2
  68. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +1 -2
  69. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +3 -4
  70. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +1 -0
  71. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +1 -0
  72. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +3 -3
  73. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -3
  74. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
  75. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -3
  76. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -3
  77. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
  78. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -5
  79. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +6 -6
  80. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +3 -4
  81. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +1 -0
  82. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +1 -0
  83. package/dist/src/infrastructure/ui/components/templates/footer/Footer.d.ts +3 -0
  84. package/dist/src/infrastructure/ui/components/templates/footer/Footer.js +13 -0
  85. package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +2 -2
  86. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +7 -0
  87. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +21 -0
  88. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
  89. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +12 -0
  90. package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js +2 -2
  91. package/dist/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +4 -4
  92. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.d.ts +26 -0
  93. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +135 -0
  94. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +12 -0
  95. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +64 -0
  96. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +3 -2
  97. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +17 -26
  98. package/dist/src/infrastructure/ui/hooks/useStaticInfo.d.ts +2 -0
  99. package/dist/src/infrastructure/ui/hooks/useStaticInfo.js +2 -2
  100. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
  101. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +22 -55
  102. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +10 -0
  103. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +17 -0
  104. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -2
  105. package/dist/src/infrastructure/ui/i18n/i18n.js +2 -2
  106. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +20 -0
  107. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +27 -0
  108. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +10 -0
  109. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +27 -0
  110. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +3 -14
  111. package/dist/src/infrastructure/ui/routing/Routing.d.ts +5 -5
  112. package/dist/src/infrastructure/ui/routing/Routing.js +8 -18
  113. package/dist/src/infrastructure/ui/routing/routes.d.ts +0 -1
  114. package/dist/src/infrastructure/ui/routing/routes.js +0 -1
  115. package/dist/src/infrastructure/ui/test/render.js +3 -7
  116. package/dist/src/infrastructure/ui/views/App.js +5 -7
  117. package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
  118. package/dist/src/infrastructure/ui/views/App.style.js +8 -0
  119. package/dist/src/infrastructure/ui/views/checkout/Checkout.d.ts +7 -2
  120. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +24 -15
  121. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +3 -0
  122. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +3 -0
  123. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +16 -16
  124. package/dist/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js +2 -2
  125. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
  126. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -2
  127. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
  128. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +11 -0
  129. package/dist/src/infrastructure/ui/views/item/Item.js +1 -3
  130. package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +3 -3
  131. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +5 -11
  132. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -4
  133. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -3
  134. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +0 -1
  135. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +1 -2
  136. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  137. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +12 -0
  138. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +64 -0
  139. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
  140. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +16 -0
  141. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -4
  142. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
  143. package/dist/src/infrastructure/ui/views/return/Return.style.js +44 -0
  144. package/dist/src/infrastructure/ui/views/return/components/price/Price.js +0 -3
  145. package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +3 -3
  146. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +6 -6
  147. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -1
  148. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +1 -2
  149. package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
  150. package/dist/src/infrastructure/ui/views/summary/Summary.js +5 -6
  151. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -3
  152. package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +6 -8
  153. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +14 -0
  154. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +28 -0
  155. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
  156. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +11 -0
  157. package/dist/src/infrastructure/ui/views/summaryTabs/SummaryTabs.js +1 -3
  158. package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +5 -5
  159. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +26 -0
  160. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +21 -0
  161. package/dist/src/projection/customer/customer.d.ts +2 -0
  162. package/dist/src/projection/order/order.d.ts +1 -1
  163. package/dist/src/projection/shared/country.d.ts +14 -0
  164. package/dist/src/projection/shared/country.js +15 -0
  165. package/dist/src/projection/shared/customer.d.ts +9 -0
  166. package/dist/src/projection/shared/customer.js +1 -0
  167. package/dist/src/projection/shared/locale.d.ts +12 -0
  168. package/dist/src/projection/shared/locale.js +13 -0
  169. package/dist/src/projection/shared/order.d.ts +6 -0
  170. package/dist/src/projection/shared/order.js +1 -0
  171. package/dist/src/projection/shared/price.d.ts +11 -0
  172. package/dist/src/projection/shared/price.js +1 -0
  173. package/dist/src/projection/shared/size.d.ts +21 -0
  174. package/dist/src/projection/shared/size.js +4 -0
  175. package/dist/src/projection/shared/subscription.d.ts +2 -0
  176. package/dist/src/projection/shared/subscription.js +1 -0
  177. package/dist/src/projection/subscription/subscription.d.ts +1 -1
  178. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +15 -0
  179. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
  180. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +11 -0
  181. package/dist/src/shared/ui/components/atoms/error/Error.js +6 -0
  182. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +14 -0
  183. package/dist/src/shared/ui/components/atoms/field/Field.js +29 -0
  184. package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +16 -0
  185. package/dist/src/shared/ui/components/atoms/field/Field.style.js +19 -0
  186. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +24 -0
  187. package/dist/src/shared/ui/components/molecules/inputField/InputField.js +28 -0
  188. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +29 -0
  189. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +37 -0
  190. package/dist/src/version.d.ts +1 -1
  191. package/dist/src/version.js +1 -1
  192. package/fake-dependencies/@lookiero/payments-front/index.tsx +32 -9
  193. package/index.ts +11 -5
  194. package/jest.config.js +2 -2
  195. package/package.json +9 -9
  196. package/src/Expo.tsx +0 -3
  197. package/src/ExpoRoot.tsx +44 -38
  198. package/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.ts +4 -1
  199. package/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.ts +3 -2
  200. package/src/infrastructure/tracking/tracking.ts +2 -2
  201. package/src/infrastructure/tracking/useTrackCheckout.ts +66 -56
  202. package/src/infrastructure/ui/Root.tsx +9 -9
  203. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.ts +2 -3
  204. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx +2 -3
  205. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/__snapshots__/FiveItemsDiscountBanner.test.tsx.snap +1 -1
  206. package/src/infrastructure/ui/components/atoms/price/Price.tsx +0 -3
  207. package/src/infrastructure/ui/components/atoms/price/__snapshots__/Price.test.tsx.snap +3 -3
  208. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.ts +4 -25
  209. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +7 -13
  210. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +1 -2
  211. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +1 -2
  212. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +1 -0
  213. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +2 -4
  214. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +3 -3
  215. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +2 -3
  216. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -5
  217. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -3
  218. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +2 -3
  219. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +1 -2
  220. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +5 -6
  221. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +7 -7
  222. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +1 -0
  223. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +2 -4
  224. package/src/infrastructure/ui/components/templates/footer/Footer.test.tsx +15 -0
  225. package/src/infrastructure/ui/components/templates/footer/Footer.tsx +19 -0
  226. package/src/infrastructure/ui/components/templates/footer/__snapshots__/Footer.test.tsx.snap +1127 -0
  227. package/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.tsx +2 -2
  228. package/src/infrastructure/ui/components/templates/header/checkoutHeader/__snapshots__/CheckoutHeader.test.tsx.snap +1 -1
  229. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.tsx +2 -2
  230. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/__snapshots__/ItemDetailHeader.test.tsx.snap +1 -1
  231. package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.tsx +5 -4
  232. package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +1 -1
  233. package/src/infrastructure/ui/hooks/{useSubmitCheckout.test.ts → useCheckoutFlow.test.ts} +1 -1
  234. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +212 -0
  235. package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +18 -60
  236. package/src/infrastructure/ui/hooks/useStaticInfo.tsx +4 -2
  237. package/src/infrastructure/ui/i18n/i18n.ts +2 -3
  238. package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +3 -3
  239. package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +3 -17
  240. package/src/infrastructure/ui/routing/Routing.tsx +25 -39
  241. package/src/infrastructure/ui/routing/routes.ts +0 -1
  242. package/src/infrastructure/ui/test/render.tsx +4 -10
  243. package/src/infrastructure/ui/views/App.tsx +5 -14
  244. package/src/infrastructure/ui/views/checkout/Checkout.style.ts +3 -0
  245. package/src/infrastructure/ui/views/checkout/Checkout.tsx +55 -18
  246. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +116 -121
  247. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.tsx +2 -2
  248. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/__snapshots__/DeliveryBanner.test.tsx.snap +1 -1
  249. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
  250. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +2 -2
  251. package/src/infrastructure/ui/views/item/Item.tsx +1 -2
  252. package/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.tsx +3 -3
  253. package/src/infrastructure/ui/views/item/components/banner/__snapshots__/CustomerDecissionBanner.test.tsx.snap +3 -3
  254. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +5 -11
  255. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +88 -160
  256. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +4 -4
  257. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +128 -244
  258. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.ts +1 -2
  259. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.tsx +3 -3
  260. package/src/infrastructure/ui/views/item/components/productVariantDescription/__snapshots__/ProductVariantDescription.test.tsx.snap +8 -10
  261. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +30 -30
  262. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -2
  263. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +1 -1
  264. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -4
  265. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +41 -75
  266. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +102 -105
  267. package/src/infrastructure/ui/views/return/components/price/Price.tsx +0 -3
  268. package/src/infrastructure/ui/views/return/components/price/__snapshots__/Price.test.tsx.snap +3 -3
  269. package/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.tsx +3 -3
  270. package/src/infrastructure/ui/views/return/components/productVariantPreview/__snapshots__/ProductVariantPreview.test.tsx.snap +1 -1
  271. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +1 -2
  272. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +6 -6
  273. package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.tsx +4 -4
  274. package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +30 -30
  275. package/src/infrastructure/ui/views/summary/Summary.tsx +5 -6
  276. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -3
  277. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +82 -154
  278. package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +6 -8
  279. package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.tsx +1 -2
  280. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +5 -5
  281. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +62 -62
  282. package/src/projection/customer/customer.ts +2 -0
  283. package/src/projection/order/order.ts +1 -1
  284. package/src/projection/subscription/subscription.ts +1 -1
  285. package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +0 -169
  286. package/src/infrastructure/ui/routing/useBasePath.test.tsx +0 -19
  287. package/src/infrastructure/ui/routing/useBasePath.tsx +0 -24
  288. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +0 -125
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "9.14.0",
3
+ "version": "10.0.0-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -24,10 +24,10 @@
24
24
  "@lookiero/sty-psp-ab-testing": "^0.3",
25
25
  "@lookiero/sty-psp-expo-config": "^0.2",
26
26
  "@lookiero/sty-psp-http": "^2.0",
27
- "@lookiero/sty-psp-i18n": "^0.4",
27
+ "@lookiero/sty-psp-i18n": "^0.2",
28
28
  "@lookiero/sty-psp-locale": "^0.4",
29
29
  "@lookiero/sty-psp-logging": "^0.5",
30
- "@lookiero/sty-psp-notifications": "^0.8",
30
+ "@lookiero/sty-psp-notifications": "^0.6",
31
31
  "@lookiero/sty-psp-react-native": "^0.3",
32
32
  "@lookiero/sty-psp-segment": "^0.1",
33
33
  "@lookiero/sty-psp-storage": "^0.2",
@@ -36,6 +36,7 @@
36
36
  "@lookiero/sty-psp-ui-settings": "^0.2",
37
37
  "@lookiero/sty-psp-units": "^0.1",
38
38
  "@lookiero/sty-psp-uuid": "^0.2",
39
+ "@react-native-async-storage/async-storage": "1.23.1",
39
40
  "react-native-keyboard-aware-scroll-view": "^0.9.5",
40
41
  "react-native-svg": "15.2.0",
41
42
  "tiny-invariant": "^1.3.1"
@@ -45,12 +46,11 @@
45
46
  "@cypress/webpack-preprocessor": "^6.0.2",
46
47
  "@lookiero/eslint-config-sty-psp": "*",
47
48
  "@lookiero/event": "^0.3",
48
- "@lookiero/payments-front": "6.0.3",
49
+ "@lookiero/payments-front": "7.0.0-ideal-integration-2025.3.14.100051",
49
50
  "@lookiero/sty-psp-jest-config": "*",
50
51
  "@lookiero/sty-psp-prettier-config": "*",
51
52
  "@lookiero/sty-psp-scripts": "*",
52
53
  "@lookiero/sty-psp-typescript": "*",
53
- "@react-native-async-storage/async-storage": "1.23.1",
54
54
  "@remix-run/router": ">=1.10",
55
55
  "@testing-library/react-native": ">=12",
56
56
  "@types/jest-when": ">=3",
@@ -61,6 +61,7 @@
61
61
  "expo-crypto": "~13.0.2",
62
62
  "jest-mock-extended": ">=3",
63
63
  "jest-when": ">=3",
64
+ "react-intl": "^6.5.1",
64
65
  "react-native-gesture-handler": "~2.16.1",
65
66
  "react-native-get-random-values": "~1.11.0",
66
67
  "react-native-reanimated": "~3.10.1",
@@ -73,15 +74,14 @@
73
74
  "@lookiero/aurora-fonts": ">=2",
74
75
  "@lookiero/aurora-iconfont": ">=3",
75
76
  "@lookiero/event": "^0.3",
76
- "@lookiero/i18n": ">=2",
77
- "@lookiero/i18n-react": ">=2",
78
- "@lookiero/payments-front": "6.0.3",
77
+ "@lookiero/i18n": ">=0.9",
78
+ "@lookiero/i18n-react": ">=0.9",
79
+ "@lookiero/payments-front": "7.0.0-ideal-integration-2025.3.14.100051",
79
80
  "apollo-boost": "0.4.4",
80
81
  "expo": ">=51",
81
82
  "expo-font": ">=12",
82
83
  "react": ">=18",
83
84
  "react-native": ">=0.74",
84
- "react-native-gesture-handler": "~2.16.1",
85
85
  "react-native-get-random-values": ">=1.11",
86
86
  "react-native-reanimated": "~3.10.1",
87
87
  "react-native-safe-area-context": ">=4.10",
package/src/Expo.tsx CHANGED
@@ -1,8 +1,5 @@
1
1
  import { registerRootComponent } from "expo";
2
- import { enableLegacyWebImplementation } from "react-native-gesture-handler";
3
2
  import "react-native-get-random-values";
4
3
  import { ExpoRoot } from "./ExpoRoot";
5
4
 
6
- enableLegacyWebImplementation(true);
7
-
8
5
  registerRootComponent(ExpoRoot);
package/src/ExpoRoot.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ import { PortalProvider } from "@gorhom/portal";
1
2
  import { useFonts } from "expo-font";
2
3
  import "expo/build/Expo.fx";
3
4
  import React, { FC, useCallback, useState } from "react";
@@ -17,25 +18,26 @@ import { KameleoonEnvironment } from "./infrastructure/ab-testing/kameleoonEnvir
17
18
  import { bootstrap as checkoutBootstrap } from "./infrastructure/delivery/bootstrap";
18
19
  import { bootstrap as checkoutMockBootstrap } from "./infrastructure/delivery/bootstrap.mock";
19
20
  import { root } from "./infrastructure/ui/Root";
20
- import { DOMAIN } from "./infrastructure/ui/i18n/i18n";
21
21
  import { Router } from "./infrastructure/ui/routing/router/Router";
22
22
  import { Customer } from "./projection/customer/customer";
23
- import { Order } from "./projection/order/order";
24
- import { Subscription } from "./projection/subscription/subscription";
23
+ import { OrderProjection } from "./projection/order/order";
24
+ import { SubscriptionProjection } from "./projection/subscription/subscription";
25
25
  import { VERSION } from "./version";
26
26
 
27
- const locale: Locale = Locale.en_GB;
28
- const subscription: Subscription = "b";
29
- const order: Order = {
27
+ const locale: Locale = Locale.es_ES;
28
+ const subscription: SubscriptionProjection = "b";
29
+ const order: OrderProjection = {
30
30
  isFirstOrder: false,
31
31
  orderNumber: 3687582,
32
32
  coupon: "MYLOOKIERO",
33
33
  };
34
34
 
35
35
  const customer: Customer = {
36
- customerId: "a4355713-469b-4684-bf90-3215702dfb1c",
37
- country: Country.ES,
36
+ customerId: "9cfb056e-6008-44b1-9075-320479bf92ac",
37
+ country: Country.NL,
38
38
  segment: Segment.WOMEN,
39
+ email: "email@example.com",
40
+ name: "Adèle Léonce Émilie",
39
41
  };
40
42
 
41
43
  const sentryConfig: SentryEnvironment = {
@@ -52,7 +54,7 @@ const apiUrl =
52
54
  ? "/local-to-dev"
53
55
  : "/checkout/api";
54
56
  const authToken =
55
- "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2ODkxMDAsImV4cCI6MTc0NjI3ODQwMiwiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjUtMDQtMDMiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiYTQzNTU3MTMtNDY5Yi00Njg0LWJmOTAtMzIxNTcwMmRmYjFjIiwiaWF0IjoxNzQzNjg2NDAyfQ.pmqFo-4s0USFpzCnijRt78bWuBdu2Q7f4L9UtOkfAwo";
57
+ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDk0NjYsImV4cCI6MTc0MjQ3MDI5OSwiZGlzcGxheU5hbWUiOiJNaWtlbCIsImNvdW50cnlfY29kZSI6IkVTIiwiYWNjZXNzVmlhIjoiZW1haWwiLCJzdWJzY3JpcHRpb25TdGFydGluZ0RhdGUiOiIyMDI0LTExLTExIiwiaW1wZXJzb25hdGVkIjpmYWxzZSwidXVpZCI6ImQzYzIzNTRiLTk4MTEtNDZkNC1iMmJhLTVmYmEwMTJlZDk0ZCIsImlhdCI6MTc0MDA1MTA5OX0.AkuUZTsn9mgplQwatg0dPKyv1Hsc6r267UMahxMH19g";
56
58
  const getAuthToken = () => Promise.resolve(authToken);
57
59
 
58
60
  const externalTranslationsUrl =
@@ -65,7 +67,7 @@ const translations: EndpointFunction[] = [
65
67
  (locale) =>
66
68
  translationExternalEndpoint({
67
69
  translationsUrl: externalTranslationsUrl,
68
- projects: [["checkout"]],
70
+ projects: [["user-area-front"], ["inventory-catalog", "feature;feature_value;Color"], ["checkout"]],
69
71
  })(locale),
70
72
  ];
71
73
 
@@ -93,6 +95,7 @@ setPaymentsBridge({
93
95
  useFeatureFlags: () => ({}),
94
96
  locale: () => Promise.resolve("es-ES"),
95
97
  scrollView: ScrollView,
98
+ hostUrl: "",
96
99
  });
97
100
 
98
101
  const kameleoonConfig: KameleoonEnvironment = {
@@ -106,7 +109,7 @@ const { Component: Messaging, queryBus } =
106
109
  : checkoutBootstrap({ apiUrl: () => apiUrl, getAuthToken });
107
110
  const I18n = i18n({
108
111
  fetchTranslation: fetchTranslations({ translations }),
109
- domain: DOMAIN,
112
+ contextId: "CheckoutI18n",
110
113
  });
111
114
  const Root = root({
112
115
  Messaging,
@@ -130,35 +133,38 @@ const ExpoRoot: FC = () => {
130
133
  const onNotAccessible = useCallback(() => setIsAccessible(false), []);
131
134
 
132
135
  return fontsLoaded ? (
133
- <PaymentsQueryProvider>
134
- <EventProvider>
135
- <Aurora>
136
- {isAccessible === false && <Text heading={true}>Checkout is not accessible!</Text>}
136
+ <PortalProvider>
137
+ <PaymentsQueryProvider>
138
+ <EventProvider>
139
+ <Aurora>
140
+ {isAccessible === false && <Text heading={true}>Checkout is not accessible!</Text>}
137
141
 
138
- <Router>
139
- <Routes>
140
- <Route
141
- path="/checkout/*"
142
- element={
143
- <Root
144
- basePath="/checkout"
145
- customer={customer}
146
- layout={DummyLayout}
147
- locale={locale}
148
- order={order}
149
- subscription={subscription}
150
- useRedirect={useRedirect}
151
- onNotAccessible={onNotAccessible}
152
- />
153
- }
154
- />
142
+ <Router>
143
+ <Routes>
144
+ <Route
145
+ path="/checkout/*"
146
+ element={
147
+ <Root
148
+ basePath="/checkout"
149
+ customer={customer}
150
+ layout={DummyLayout}
151
+ locale={locale}
152
+ order={order}
153
+ subscription={subscription}
154
+ useRedirect={useRedirect}
155
+ onCheckoutFlowSuccess={() => console.log("Checkout flow success!")}
156
+ onNotAccessible={onNotAccessible}
157
+ />
158
+ }
159
+ />
155
160
 
156
- <Route element={<Navigate to="/checkout" replace />} path="*" />
157
- </Routes>
158
- </Router>
159
- </Aurora>
160
- </EventProvider>
161
- </PaymentsQueryProvider>
161
+ <Route element={<Navigate to="/checkout" replace />} path="*" />
162
+ </Routes>
163
+ </Router>
164
+ </Aurora>
165
+ </EventProvider>
166
+ </PaymentsQueryProvider>
167
+ </PortalProvider>
162
168
  ) : null;
163
169
  };
164
170
 
@@ -1,4 +1,5 @@
1
1
  import { useCallback } from "react";
2
+ import invariant from "tiny-invariant";
2
3
  import { CommandStatus, useCommand } from "@lookiero/messaging-react";
3
4
  import { Logger } from "@lookiero/sty-psp-logging";
4
5
  import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
@@ -13,7 +14,7 @@ interface BlockCheckoutBookingFunction {
13
14
  type UseBlockCheckoutBooking = [blockCheckoutBooking: BlockCheckoutBookingFunction, status: CommandStatus];
14
15
 
15
16
  interface UseBlockCheckoutBookingFunctionArgs {
16
- readonly checkoutBookingId: string;
17
+ readonly checkoutBookingId: string | undefined;
17
18
  readonly logger: Logger;
18
19
  }
19
20
 
@@ -26,6 +27,8 @@ const useBlockCheckoutBooking: UseBlockCheckoutBookingFunction = ({ checkoutBook
26
27
  const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
27
28
 
28
29
  const blockCheckoutBooking = useCallback(async () => {
30
+ invariant(checkoutBookingId, "checkoutBookingId is required");
31
+
29
32
  try {
30
33
  await commandBus(
31
34
  blockCheckoutBookingCommand({
@@ -23,7 +23,7 @@ const DEFAULT_QUERY_OPTIONS: QueryOptions = {
23
23
  };
24
24
 
25
25
  interface UseViewPricingByCheckoutIdFunctionArgs {
26
- readonly checkoutId: string;
26
+ readonly checkoutId: string | undefined;
27
27
  readonly queryOptions?: QueryOptions;
28
28
  }
29
29
 
@@ -36,7 +36,7 @@ const useViewPricingByCheckoutId: UseViewPricingByCheckoutIdFunction = ({
36
36
  queryOptions = DEFAULT_QUERY_OPTIONS,
37
37
  }) =>
38
38
  useQuery({
39
- query: viewPricingByCheckoutId({ checkoutId }),
39
+ query: viewPricingByCheckoutId({ checkoutId: checkoutId as string }),
40
40
  contextId: MESSAGING_CONTEXT_ID,
41
41
  invalidation: shouldInvalidate,
42
42
  options: {
@@ -44,6 +44,7 @@ const useViewPricingByCheckoutId: UseViewPricingByCheckoutIdFunction = ({
44
44
  staleTime: Infinity,
45
45
  retry: false,
46
46
  refetchOnWindowFocus: false,
47
+ enabled: Boolean(checkoutId),
47
48
  },
48
49
  });
49
50
 
@@ -2,7 +2,7 @@ import { BaseTrackingEvent, TrackingEventCategory } from "@lookiero/sty-psp-trac
2
2
  import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
3
3
  import { Currency } from "../../domain/checkoutItem/model/currency";
4
4
  import { MediaPerspective } from "../../projection/checkoutItem/checkoutItem";
5
- import { Subscription } from "../../projection/subscription/subscription";
5
+ import { SubscriptionProjection } from "../../projection/subscription/subscription";
6
6
 
7
7
  const PROJECT = "checkout";
8
8
 
@@ -121,7 +121,7 @@ interface CheckoutTrackingEvent
121
121
  readonly actionField: {
122
122
  readonly items: number;
123
123
  readonly currencyCode: Currency;
124
- readonly subscription: Subscription;
124
+ readonly subscription: SubscriptionProjection;
125
125
  readonly coupon: string | null;
126
126
  readonly orderId: number;
127
127
  readonly value: number;
@@ -1,84 +1,94 @@
1
1
  import { useCallback } from "react";
2
+ import invariant from "tiny-invariant";
2
3
  import { Country } from "@lookiero/sty-psp-locale";
3
4
  import { Segment } from "@lookiero/sty-psp-segment";
4
5
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
6
+ import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
5
7
  import { Currency } from "../../domain/checkoutItem/model/currency";
6
- import { Subscription } from "../../projection/subscription/subscription";
8
+ import { CheckoutProjection } from "../../projection/checkout/checkout";
9
+ import { OrderProjection } from "../../projection/order/order";
10
+ import { PricingProjection } from "../../projection/pricing/pricing";
11
+ import { SubscriptionProjection } from "../../projection/subscription/subscription";
7
12
  import { PROJECT, TrackingPage } from "./tracking";
8
13
  import { CheckoutTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
9
14
 
10
- interface TrackCheckoutFunctionArgs {
11
- readonly userId: string;
12
- readonly totalReplacedFor: number;
13
- readonly isFirstOrder: boolean;
14
- readonly totalCheckoutItemsKept: number;
15
- readonly currencyCode: Currency;
16
- readonly subscription: Subscription;
17
- readonly coupon: string | null;
18
- readonly orderNumber: number;
19
- readonly pendingToPay: number;
20
- }
21
15
  interface TrackCheckoutFunction {
22
- (args: TrackCheckoutFunctionArgs): void;
16
+ (): void;
23
17
  }
24
18
 
25
19
  interface UseTrackCheckoutFunctionArgs {
26
- readonly page: TrackingPage;
20
+ readonly order: OrderProjection;
21
+ readonly checkout: CheckoutProjection | undefined;
22
+ readonly pricing: PricingProjection | undefined;
23
+ readonly subscription: SubscriptionProjection;
24
+ readonly userId: string;
27
25
  readonly country: Country;
28
- readonly checkoutId: string | undefined;
29
26
  readonly segment: Segment;
30
27
  }
28
+
31
29
  interface UseTrackCheckoutFunction {
32
30
  (args: UseTrackCheckoutFunctionArgs): TrackCheckoutFunction;
33
31
  }
34
32
 
35
- const useTrackCheckout: UseTrackCheckoutFunction = ({ page, country, checkoutId, segment }) => {
33
+ const useTrackCheckout: UseTrackCheckoutFunction = ({
34
+ order,
35
+ checkout,
36
+ pricing,
37
+ subscription,
38
+ segment,
39
+ country,
40
+ userId,
41
+ }) => {
36
42
  const emitUserEvent = useEmitUserEvent<CheckoutTrackingEvent>();
43
+ const { coupon, isFirstOrder, orderNumber } = order;
37
44
 
38
- const trackCheckout: TrackCheckoutFunction = useCallback(
39
- ({
40
- coupon,
41
- currencyCode,
42
- isFirstOrder,
43
- orderNumber,
44
- pendingToPay,
45
- subscription,
46
- totalCheckoutItemsKept,
47
- totalReplacedFor,
48
- userId,
49
- }) => {
50
- if (!checkoutId) {
51
- return;
52
- }
45
+ const trackCheckout: TrackCheckoutFunction = useCallback(() => {
46
+ invariant(checkout, "Checkout must be defined to track checkout");
47
+
48
+ const checkoutItemsKept = checkout.items.filter(
49
+ (checkoutItem) =>
50
+ checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED,
51
+ );
52
+ const totalReplacedFor = checkoutItemsKept?.filter(({ replacedFor }) => Boolean(replacedFor)).length || 0;
53
53
 
54
- const checkoutTrackingEvent: CheckoutTrackingEvent = {
55
- event: TrackingEventName.CHECKOUT,
56
- eventCategory: TrackingEventCategory.ECOMMERCE,
57
- section: `${PROJECT}_${page}`,
58
- store: country,
59
- segment,
60
- checkoutId,
61
- userId,
62
- sizeChanges: totalReplacedFor,
63
- isFirstOrder,
64
- ecommerce: {
65
- checkout: {
66
- actionField: {
67
- items: totalCheckoutItemsKept,
68
- currencyCode,
69
- subscription,
70
- coupon,
71
- orderId: orderNumber,
72
- value: pendingToPay,
73
- },
54
+ const checkoutTrackingEvent: CheckoutTrackingEvent = {
55
+ event: TrackingEventName.CHECKOUT,
56
+ eventCategory: TrackingEventCategory.ECOMMERCE,
57
+ section: `${PROJECT}_${TrackingPage.CHECKOUT}`,
58
+ store: country,
59
+ segment,
60
+ checkoutId: checkout.id,
61
+ userId,
62
+ sizeChanges: totalReplacedFor,
63
+ isFirstOrder,
64
+ ecommerce: {
65
+ checkout: {
66
+ actionField: {
67
+ items: checkoutItemsKept.length || 0,
68
+ currencyCode: pricing?.pendingToPay.currency as Currency,
69
+ subscription,
70
+ coupon,
71
+ orderId: orderNumber,
72
+ value: (pricing?.pendingToPay.amount as number) / 100,
74
73
  },
75
74
  },
76
- };
75
+ },
76
+ };
77
77
 
78
- emitUserEvent(checkoutTrackingEvent);
79
- },
80
- [checkoutId, country, emitUserEvent, page, segment],
81
- );
78
+ emitUserEvent(checkoutTrackingEvent);
79
+ }, [
80
+ checkout,
81
+ country,
82
+ coupon,
83
+ emitUserEvent,
84
+ isFirstOrder,
85
+ orderNumber,
86
+ pricing?.pendingToPay.amount,
87
+ pricing?.pendingToPay.currency,
88
+ segment,
89
+ subscription,
90
+ userId,
91
+ ]);
82
92
 
83
93
  return trackCheckout;
84
94
  };
@@ -9,8 +9,8 @@ import { Locale } from "@lookiero/sty-psp-locale";
9
9
  import { SentryEnvironment, SentryLoggerFunctionArgs, sentryLogger, sentryLoggerHOC } from "@lookiero/sty-psp-logging";
10
10
  import { Layout } from "@lookiero/sty-psp-ui";
11
11
  import { Customer } from "../../projection/customer/customer";
12
- import { Order } from "../../projection/order/order";
13
- import { Subscription } from "../../projection/subscription/subscription";
12
+ import { OrderProjection } from "../../projection/order/order";
13
+ import { SubscriptionProjection } from "../../projection/subscription/subscription";
14
14
  import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
15
15
  import { QueryBusProvider } from "./hooks/useQueryBus";
16
16
  import { Routing } from "./routing/Routing";
@@ -31,13 +31,13 @@ interface RootFunction {
31
31
 
32
32
  interface RootProps {
33
33
  readonly basePath: string;
34
- readonly locale?: Locale;
34
+ readonly locale: Locale;
35
35
  readonly customer: Customer;
36
- readonly order: Order | undefined;
37
- readonly subscription: Subscription | undefined;
36
+ readonly order: OrderProjection;
37
+ readonly subscription: SubscriptionProjection;
38
38
  readonly layout: Layout;
39
39
  readonly onNotAccessible: () => void;
40
- readonly onCheckoutSubmitted?: () => void;
40
+ readonly onCheckoutFlowSuccess: () => void;
41
41
  readonly useRedirect: () => Record<string, string>;
42
42
  readonly useRoutes?: typeof reactRouterUseRoutes;
43
43
  }
@@ -57,13 +57,13 @@ const root: RootFunction = ({
57
57
  // eslint-disable-next-line react/display-name, react/prop-types
58
58
  const Root = ({
59
59
  basePath,
60
- locale = Locale.en_GB,
60
+ locale,
61
61
  customer,
62
62
  order,
63
63
  subscription,
64
64
  layout,
65
65
  onNotAccessible,
66
- onCheckoutSubmitted,
66
+ onCheckoutFlowSuccess,
67
67
  useRedirect,
68
68
  useRoutes = reactRouterUseRoutes,
69
69
  }: RootProps) => {
@@ -84,7 +84,7 @@ const root: RootFunction = ({
84
84
  subscription={subscription}
85
85
  useRedirect={useRedirect}
86
86
  useRoutes={useRoutes}
87
- onCheckoutSubmitted={onCheckoutSubmitted}
87
+ onCheckoutFlowSuccess={onCheckoutFlowSuccess}
88
88
  onI18nError={development ? undefined : handleOnI18nError}
89
89
  onNotAccessible={onNotAccessible}
90
90
  />
@@ -1,11 +1,10 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { theme } from "@lookiero/sty-psp-ui";
3
2
 
4
- const { fontMap } = theme();
3
+ // TODO: get the font family from Aurora
5
4
 
6
5
  const style = StyleSheet.create({
7
6
  textBold: {
8
- fontFamily: fontMap.Action,
7
+ fontFamily: "AreaNormal-Extrabold",
9
8
  },
10
9
  });
11
10
 
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from "react";
2
2
  import { ALIGN, DISPLAY, InfoBox, INFOBOX_TYPE, Text } from "@lookiero/aurora";
3
3
  import { useI18nMessage } from "@lookiero/i18n-react";
4
- import { DOMAIN, I18nMessages } from "../../../i18n/i18n";
4
+ import { I18nMessages } from "../../../i18n/i18n";
5
5
  import { style } from "./FiveItemsDiscountBanner.style";
6
6
 
7
7
  interface FiveItemsDiscountBannerProps {
@@ -9,11 +9,10 @@ interface FiveItemsDiscountBannerProps {
9
9
  }
10
10
  const FiveItemsDiscountBanner: FC<FiveItemsDiscountBannerProps> = ({ fiveItemsDiscount }) => {
11
11
  const bannerText = useI18nMessage({
12
- domain: DOMAIN,
13
12
  id: I18nMessages.BANNER_DISCOUNT_TEXT,
14
13
  values: {
15
14
  discount: fiveItemsDiscount.toString(),
16
- b: (chunks: string[]) => (
15
+ b: (chunks) => (
17
16
  <Text as="span" display={DISPLAY.INLINE} level={2} style={style.textBold}>
18
17
  {chunks}
19
18
  </Text>
@@ -100,7 +100,7 @@ exports[`FiveItemsDiscountBanner component matches the snapshot 1`] = `
100
100
  "paddingBottom": 0,
101
101
  "paddingLeft": 0,
102
102
  "paddingRight": 0,
103
- "paddingTop": 4,
103
+ "paddingTop": 5,
104
104
  },
105
105
  ]
106
106
  }
@@ -3,7 +3,6 @@ import { View } from "react-native";
3
3
  import { Text } from "@lookiero/aurora";
4
4
  import { useI18nNumber } from "@lookiero/i18n-react";
5
5
  import { PriceProjection } from "../../../../../projection/price/price";
6
- import { DOMAIN } from "../../../i18n/i18n";
7
6
  import { style } from "./Price.style";
8
7
 
9
8
  type PriceVariant = "default" | "detail" | "subtotal" | "total";
@@ -30,13 +29,11 @@ interface PriceProps {
30
29
  const Price: FC<PriceProps> = ({ price, variant = "default", withPercentage = false }) => {
31
30
  const isDiscounted = price.discountedPrice && price.discountedPrice.percentage > 0;
32
31
  const productPrice = useI18nNumber({
33
- domain: DOMAIN,
34
32
  value: price.amount / 100,
35
33
  style: "currency",
36
34
  currency: price.currency,
37
35
  });
38
36
  const productDiscountedPrice = useI18nNumber({
39
- domain: DOMAIN,
40
37
  value: (price.discountedPrice?.amount || 0) / 100,
41
38
  style: "currency",
42
39
  currency: price.currency,
@@ -51,7 +51,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
51
51
  "paddingBottom": 0,
52
52
  "paddingLeft": 0,
53
53
  "paddingRight": 0,
54
- "paddingTop": 0,
54
+ "paddingTop": 4,
55
55
  },
56
56
  ]
57
57
  }
@@ -81,7 +81,7 @@ exports[`Price atom matches the snapshot for a discounted price: discounted pric
81
81
  "paddingBottom": 0,
82
82
  "paddingLeft": 0,
83
83
  "paddingRight": 0,
84
- "paddingTop": 0,
84
+ "paddingTop": 4,
85
85
  "textDecorationLine": "line-through",
86
86
  },
87
87
  ]
@@ -146,7 +146,7 @@ exports[`Price atom matches the snapshot for a non-discounted price: non-discoun
146
146
  "paddingBottom": 0,
147
147
  "paddingLeft": 0,
148
148
  "paddingRight": 0,
149
- "paddingTop": 0,
149
+ "paddingTop": 4,
150
150
  },
151
151
  ]
152
152
  }
@@ -1,37 +1,16 @@
1
- import { StyleSheet } from "react-native";
1
+ import { StyleSheet, ViewStyle } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
3
 
4
- const {
5
- colorBorderActionSecondary,
6
- colorBgActionPrimaryActive,
7
- colorTextActionPrimary,
8
- borderWidth2,
9
- borderRadiusFull,
10
- space6,
11
- space16,
12
- } = theme();
13
-
14
- const HEIGHT = space16;
4
+ const { colorBorderActionSecondary, borderWidth2, borderStyle } = theme();
15
5
 
16
6
  const style = StyleSheet.create({
17
7
  button: {
18
- alignContent: "center",
19
8
  borderColor: colorBorderActionSecondary,
20
- borderRadius: borderRadiusFull,
9
+ borderStyle: borderStyle,
21
10
  borderWidth: borderWidth2,
22
11
  flex: 1,
23
- height: HEIGHT,
24
- justifyContent: "center",
25
12
  marginHorizontal: 12,
26
- paddingLeft: space6,
27
- paddingRight: space6,
28
- },
29
- buttonActive: {
30
- backgroundColor: colorBgActionPrimaryActive,
31
- },
32
- textActive: {
33
- color: colorTextActionPrimary,
34
- },
13
+ } as ViewStyle,
35
14
  });
36
15
 
37
16
  export { style };