@lookiero/checkout 8.14.0-beta.3 → 8.14.0

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 (254) hide show
  1. package/.eslintrc.js +1 -1
  2. package/cypress/integration/checkout.spec.ts +259 -0
  3. package/cypress/support/e2e.ts +3 -0
  4. package/cypress/support/index.d.ts +8 -0
  5. package/cypress/support/interceptBlockCheckoutBooking.ts +4 -0
  6. package/cypress/support/interceptGiveCheckoutFeedback.ts +4 -0
  7. package/cypress/support/interceptKeepCheckoutItem.ts +4 -0
  8. package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +9 -0
  9. package/cypress/support/interceptListReturnQuestionsByCheckoutItemId.ts +9 -0
  10. package/cypress/support/interceptPayment.ts +23 -0
  11. package/cypress/support/interceptReplaceCheckoutItem.ts +4 -0
  12. package/cypress/support/interceptReturnCheckoutItem.ts +4 -0
  13. package/cypress/support/interceptSubmitCheckout.ts +4 -0
  14. package/cypress/support/interceptViewBookedProductsVariantsForCheckoutItem.ts +9 -0
  15. package/cypress/support/interceptViewCheckoutById.ts +6 -0
  16. package/cypress/support/interceptViewFirstAvailableCheckoutByCustomerId.ts +9 -0
  17. package/cypress/support/interceptViewFiveItemsDiscountByCustomerId.ts +6 -0
  18. package/cypress/support/interceptViewIsSizeChangeEnabledByCheckoutId.ts +6 -0
  19. package/cypress/support/interceptViewPaymentFlowPayloadByCheckoutId.ts +9 -0
  20. package/cypress/support/interceptViewPricingByCheckoutId.ts +6 -0
  21. package/cypress/tsconfig.json +8 -0
  22. package/cypress.config.ts +50 -0
  23. package/dist/src/ExpoRoot.js +2 -2
  24. package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
  25. package/dist/src/infrastructure/ui/Root.d.ts +1 -2
  26. package/dist/src/infrastructure/ui/Root.js +2 -4
  27. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -1
  28. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +2 -1
  29. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +3 -3
  30. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +4 -3
  31. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +2 -1
  32. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +1 -0
  33. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +2 -1
  34. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +8 -6
  35. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +2 -1
  36. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -1
  37. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +2 -1
  38. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
  39. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
  40. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
  41. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +2 -1
  42. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -0
  43. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +2 -1
  44. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +5 -3
  45. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +6 -5
  46. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +2 -1
  47. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
  48. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +2 -1
  49. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +2 -1
  50. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +2 -1
  51. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +2 -1
  52. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +2 -1
  53. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -1
  54. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +18 -9
  55. package/dist/src/infrastructure/ui/test/render.js +1 -3
  56. package/dist/src/infrastructure/ui/views/App.js +7 -12
  57. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -3
  58. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
  59. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
  60. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
  61. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +9 -2
  62. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +5 -6
  63. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
  64. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
  65. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -3
  66. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +4 -3
  67. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -2
  68. package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +9 -0
  69. package/dist/src/projection/returnQuestion/returnQuestion.constants.js +10 -0
  70. package/dist/src/projection/returnQuestion/returnQuestion.d.ts +23 -16
  71. package/dist/src/projection/returnQuestion/returnQuestion.js +1 -11
  72. package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +12 -0
  73. package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +1 -0
  74. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +5 -0
  75. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +10 -0
  76. package/dist/src/version.d.ts +1 -1
  77. package/dist/src/version.js +1 -1
  78. package/jest.setup.js +0 -20
  79. package/package.json +8 -7
  80. package/src/ExpoRoot.tsx +2 -2
  81. package/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.test.ts +1 -1
  82. package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
  83. package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +4 -9
  84. package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +72 -117
  85. package/src/infrastructure/ui/Root.tsx +17 -21
  86. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +10 -12
  87. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +10 -8
  88. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +10 -9
  89. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +2 -1
  90. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +7 -9
  91. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
  92. package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +4 -3
  93. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +7 -13
  94. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +4 -2
  95. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +8 -14
  96. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +13 -7
  97. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +7 -5
  98. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
  99. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +10 -14
  100. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +9 -8
  101. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +5 -3
  102. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +43 -36
  103. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +10 -7
  104. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +13 -12
  105. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +8 -14
  106. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +6 -4
  107. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +6 -4
  108. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +23 -25
  109. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +5 -3
  110. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +9 -29
  111. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +7 -5
  112. package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +5 -4
  113. package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +32 -18
  114. package/src/infrastructure/ui/test/render.tsx +1 -4
  115. package/src/infrastructure/ui/views/App.tsx +16 -23
  116. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
  117. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +2 -3
  118. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +10 -6
  119. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +0 -1
  120. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -4
  121. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
  122. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +21 -10
  123. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +15 -5
  124. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +2 -4
  125. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +10 -6
  126. package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +2 -2
  127. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +10 -4
  128. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -2
  129. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +2 -2
  130. package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +4 -12
  131. package/src/projection/returnQuestion/returnQuestion.constants.ts +10 -0
  132. package/src/projection/returnQuestion/returnQuestion.metadata.ts +17 -0
  133. package/src/projection/returnQuestion/returnQuestion.ts +42 -20
  134. package/src/projection/returnQuestion/returnQuestion.typeguard.ts +24 -0
  135. package/dist/pact.config.d.ts +0 -13
  136. package/dist/pact.config.js +0 -9
  137. package/dist/public/public/assets/adaptive-icon.png +0 -0
  138. package/dist/public/public/assets/favicon.png +0 -0
  139. package/dist/public/public/assets/icon.png +0 -0
  140. package/dist/public/public/assets/splash.png +0 -0
  141. package/dist/public/public/images/not-found.png +0 -0
  142. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -3
  143. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +0 -27
  144. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
  145. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -48
  146. package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +0 -19
  147. package/dist/src/infrastructure/projection/checkout/checkout.mock.js +0 -21
  148. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
  149. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -109
  150. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
  151. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -49
  152. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
  153. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -44
  154. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
  155. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -44
  156. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
  157. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -44
  158. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -10
  159. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -17
  160. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -3
  161. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +0 -6
  162. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
  163. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -49
  164. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -15
  165. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +0 -43
  166. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
  167. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -50
  168. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
  169. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
  170. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
  171. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -48
  172. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
  173. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -109
  174. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +0 -6
  175. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +0 -183
  176. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
  177. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -48
  178. package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +0 -9
  179. package/dist/src/infrastructure/projection/pricing/pricing.mock.js +0 -42
  180. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
  181. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -48
  182. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -3
  183. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +0 -400
  184. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -21
  185. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
  186. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -6
  187. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -4
  188. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -6
  189. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -5
  190. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
  191. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -19
  192. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -3
  193. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -18
  194. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
  195. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -13
  196. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -6
  197. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -11
  198. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
  199. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -11
  200. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -11
  201. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -49
  202. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -9
  203. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -9
  204. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -19
  205. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -21
  206. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -9
  207. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -21
  208. package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
  209. package/dist/src/infrastructure/ui/views/App.style.js +0 -7
  210. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
  211. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -10
  212. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -11
  213. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -40
  214. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
  215. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -15
  216. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
  217. package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -43
  218. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -13
  219. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -9
  220. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
  221. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -10
  222. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -17
  223. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -13
  224. package/dist/src/projection/shared/country.d.ts +0 -14
  225. package/dist/src/projection/shared/country.js +0 -15
  226. package/dist/src/projection/shared/customer.d.ts +0 -8
  227. package/dist/src/projection/shared/customer.js +0 -1
  228. package/dist/src/projection/shared/locale.d.ts +0 -12
  229. package/dist/src/projection/shared/locale.js +0 -13
  230. package/dist/src/projection/shared/order.d.ts +0 -6
  231. package/dist/src/projection/shared/order.js +0 -1
  232. package/dist/src/projection/shared/price.d.ts +0 -10
  233. package/dist/src/projection/shared/price.js +0 -1
  234. package/dist/src/projection/shared/size.d.ts +0 -20
  235. package/dist/src/projection/shared/size.js +0 -3
  236. package/dist/src/projection/shared/subscription.d.ts +0 -2
  237. package/dist/src/projection/shared/subscription.js +0 -1
  238. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -10
  239. package/dist/src/shared/ui/components/atoms/error/Error.js +0 -4
  240. package/pact.config.ts +0 -31
  241. package/pact.publish.js +0 -32
  242. package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +0 -62
  243. package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +0 -128
  244. package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +0 -63
  245. package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +0 -57
  246. package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +0 -57
  247. package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +0 -57
  248. package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +0 -63
  249. package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +0 -64
  250. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +0 -62
  251. package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +0 -136
  252. package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +0 -62
  253. package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +0 -62
  254. package/src/infrastructure/ui/views/App.style.ts +0 -9
@@ -1,14 +1,16 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React from "react";
2
3
  import { Text, View } from "@lookiero/aurora";
3
- import { useI18nMessage } from "@lookiero/i18n-react";
4
+ import { useIntl } from "@lookiero/i18n-react";
5
+ import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
4
6
  import { I18nMessages } from "../../../../../i18n/i18n";
5
7
  import { style } from "./HostDefaultReturnQuestionItem.style";
6
- const HostDefaultReturnQuestionItem = ({ returnQuestion, children }) => {
7
- const titleText = useI18nMessage({ id: returnQuestion.name });
8
- const isAllOptions = returnQuestion.name === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
8
+ const HostDefaultReturnQuestionItem = ({ returnQuestion, children, }) => {
9
+ const { formatMessage } = useIntl();
10
+ const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
9
11
  return (React.createElement(React.Fragment, null,
10
- titleText && titleText !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
11
- React.createElement(Text, { level: 3, action: true }, titleText))) : null,
12
+ returnQuestionWithTranslationKey(returnQuestion) && returnQuestion.translationKey !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
13
+ React.createElement(Text, { level: 3, action: true }, formatMessage({ id: returnQuestion.translationKey })))) : null,
12
14
  children));
13
15
  };
14
16
  export { HostDefaultReturnQuestionItem };
@@ -1,4 +1,5 @@
1
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
3
  import { style } from "./HostRadioGroupReturnQuestionItem.style";
3
- declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem;
4
+ declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
4
5
  export { HostRadioGroupReturnQuestionItem, style };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useMemo } from "react";
2
3
  import { View } from "react-native";
3
4
  import { Text } from "@lookiero/aurora";
@@ -5,7 +6,7 @@ import { useIntl } from "@lookiero/i18n-react";
5
6
  import { style } from "./HostRadioGroupReturnQuestionItem.style";
6
7
  const HostRadioGroupReturnQuestionItem = ({ returnQuestion, children, testID, }) => {
7
8
  const { formatMessage } = useIntl();
8
- const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
9
+ const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
9
10
  return (React.createElement(React.Fragment, null,
10
11
  React.createElement(View, { style: style.wrapper, testID: testID },
11
12
  React.createElement(Text, { level: 3, style: style.title, action: true }, placeholderText),
@@ -1,3 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
- declare const HostSelectReturnQuestionItem: ReturnQuestionItem;
3
+ declare const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
3
4
  export { HostSelectReturnQuestionItem };
@@ -1,16 +1,16 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback, useEffect, useMemo, useState } from "react";
2
3
  import { TouchableHighlight, View } from "react-native";
3
4
  import { ButtonIcon } from "@lookiero/aurora";
4
5
  import { useIntl } from "@lookiero/i18n-react";
5
- import { Modal, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
6
+ import { Modal } from "@lookiero/sty-psp-ui";
6
7
  import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
7
8
  import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
8
9
  import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
9
10
  import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
10
11
  const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, testID, }) => {
11
- const { modal } = useEnvironmentStyle();
12
12
  const { formatMessage } = useIntl();
13
- const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
13
+ const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
14
14
  const [modalVisible, setModalVisible] = useState(false);
15
15
  const handleOnPress = useCallback(() => setModalVisible(true), []);
16
16
  const handleOnModalClose = useCallback(() => setModalVisible(false), []);
@@ -36,6 +36,6 @@ const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName
36
36
  React.createElement(View, { pointerEvents: "none" },
37
37
  React.createElement(InputField, { editable: false, icon: "arrow_down", label: placeholderText, value: inputValue }))),
38
38
  React.createElement(Modal, { portalHostName: portalHostName, style: deepestReturnQuestionWithFeedback && { header: style.header }, visible: modalVisible, header: deepestReturnQuestionWithFeedback && (React.createElement(ButtonIcon, { name: "arrow_left", style: style.backButton, testID: "modal-back-button", onPress: handleOnBackButtonPress })), scroll: true, showCloseButton: true, onClose: handleOnModalClose },
39
- React.createElement(View, { style: [style.modal, modal?.content] }, children))));
39
+ React.createElement(View, { style: style.modalContent }, children))));
40
40
  };
41
41
  export { HostSelectReturnQuestionItem };
@@ -9,7 +9,7 @@ declare const style: {
9
9
  header: {
10
10
  justifyContent: "space-between";
11
11
  };
12
- modal: {
12
+ modalContent: {
13
13
  paddingBottom: number;
14
14
  paddingHorizontal: number;
15
15
  };
@@ -12,7 +12,7 @@ const style = StyleSheet.create({
12
12
  header: {
13
13
  justifyContent: "space-between",
14
14
  },
15
- modal: {
15
+ modalContent: {
16
16
  paddingBottom: space6,
17
17
  paddingHorizontal: space6,
18
18
  },
@@ -1,3 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../../ReturnQuestionItem";
2
- declare const HostStackReturnQuestionItem: ReturnQuestionItem;
3
+ declare const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_STACK>;
3
4
  export { HostStackReturnQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React from "react";
2
3
  import ReturnQuestion from "../../../ReturnQuestion";
3
4
  const HostStackReturnQuestionItem = ({ returnQuestion, portalHostName, }) => (React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion })))));
@@ -1,3 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../../ReturnQuestionItem";
2
- declare const HostStackReturnQuestionItem: ReturnQuestionItem;
3
+ declare const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_STACK>;
3
4
  export { HostStackReturnQuestionItem };
@@ -1,8 +1,10 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import { animated, useSpring } from "@react-spring/native";
2
3
  import React, { useCallback, useMemo, useState } from "react";
3
4
  import { View } from "react-native";
4
5
  import { COLOR, Text } from "@lookiero/aurora";
5
6
  import { useIntl } from "@lookiero/i18n-react";
7
+ import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
6
8
  import ReturnQuestion from "../../../ReturnQuestion";
7
9
  import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
8
10
  import { style } from "./HostStackReturnQuestionItem.style";
@@ -12,15 +14,15 @@ const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName,
12
14
  const feedbackReturnQuestion = feedback
13
15
  ? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
14
16
  : undefined;
15
- const titleText = useMemo(() => (returnQuestion.name ? formatMessage({ id: returnQuestion.name }) : undefined), [formatMessage, returnQuestion.name]);
16
- const feedbackText = useMemo(() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.name }) : undefined), [feedbackReturnQuestion, formatMessage]);
17
+ const titleText = useMemo(() => (returnQuestion.translationKey ? formatMessage({ id: returnQuestion.translationKey }) : undefined), [formatMessage, returnQuestion.translationKey]);
18
+ const feedbackText = useMemo(() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.translationKey }) : undefined), [feedbackReturnQuestion, formatMessage]);
17
19
  const [stackHeight, setStackHeight] = useState();
18
20
  const handleOnLayout = useCallback(({ nativeEvent: { layout: { height }, }, }) => setStackHeight(height), []);
19
21
  const stackSyle = useSpring({ height: stackHeight });
20
22
  return (React.createElement(animated.View, { style: stackSyle },
21
23
  React.createElement(View, { onLayout: handleOnLayout },
22
24
  titleText && (React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText)),
23
- feedbackReturnQuestion ? (React.createElement(React.Fragment, null,
25
+ feedbackReturnQuestion && returnQuestionHasChildren(feedbackReturnQuestion) ? (React.createElement(React.Fragment, null,
24
26
  React.createElement(Text, { color: COLOR.TEXT_MEDIUM, level: 3 }, feedbackText),
25
27
  feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: feedbackReturnQuestion }))))) : (children))));
26
28
  };
@@ -2,16 +2,17 @@ import React from "react";
2
2
  import { View } from "react-native";
3
3
  import { COLOR, Text } from "@lookiero/aurora";
4
4
  import { useIntl } from "@lookiero/i18n-react";
5
- import { Modal, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
5
+ import { Modal } from "@lookiero/sty-psp-ui";
6
+ import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
6
7
  import ReturnQuestion from "../../ReturnQuestion";
7
8
  import { style } from "./ModalOptionReturnQuestionItems.style";
8
9
  const ModalOptionReturnQuestionItems = ({ portalHostName, returnQuestion, visible, onClose, }) => {
9
- const { modal } = useEnvironmentStyle();
10
10
  const { formatMessage } = useIntl();
11
- const title = formatMessage({ id: returnQuestion.name });
11
+ const title = formatMessage({ id: returnQuestion.translationKey });
12
12
  return (React.createElement(Modal, { portalHostName: portalHostName, visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
13
- React.createElement(View, { style: [style.modalContent, modal?.content] },
13
+ React.createElement(View, { style: style.modalContent },
14
14
  React.createElement(Text, { color: COLOR.TEXT_MEDIUM, level: 2, style: style.optionText }, title),
15
- React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: "", returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion })))))));
15
+ React.createElement(React.Fragment, null, returnQuestionHasChildren(returnQuestion) &&
16
+ returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: "", returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion })))))));
16
17
  };
17
18
  export { ModalOptionReturnQuestionItems };
@@ -1,3 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
- declare const OptionReturnQuestionItem: ReturnQuestionItem;
3
+ declare const OptionReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION>;
3
4
  export { OptionReturnQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback } from "react";
2
3
  import { TouchableHighlight } from "react-native";
3
4
  import { Text } from "@lookiero/aurora";
@@ -6,7 +7,7 @@ import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useR
6
7
  import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
7
8
  const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
8
9
  const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
9
- const optionText = useI18nMessage({ id: returnQuestion.name });
10
+ const optionText = useI18nMessage({ id: returnQuestion.translationKey });
10
11
  const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParent.id]);
11
12
  return (React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: style.container, testID: testID, underlayColor: containerUnderlayColor, onPress: handleOnPress },
12
13
  React.createElement(Text, { level: 3, style: style.text }, optionText)));
@@ -1,3 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
- declare const RadioReturnQuestionItem: ReturnQuestionItem;
3
+ declare const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION>;
3
4
  export { RadioReturnQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback, useEffect, useState } from "react";
2
3
  import { View, Option, OPTION_VARIANT, SIZE } from "@lookiero/aurora";
3
4
  import { useIntl } from "@lookiero/i18n-react";
@@ -12,7 +13,7 @@ const RadioReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID,
12
13
  const feedback = useReturnQuestionFeedback();
13
14
  const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
14
15
  const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
15
- const optionText = intl.formatMessage({ id: returnQuestion.name });
16
+ const optionText = intl.formatMessage({ id: returnQuestion.translationKey });
16
17
  const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
17
18
  const handleOnModalClose = useCallback(() => {
18
19
  // Uncomment if we want to clear current selection (and update callback's dependencies)
@@ -1,3 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
- declare const ReturnQuestionFeedbackItem: ReturnQuestionItem;
3
+ declare const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT>;
3
4
  export { ReturnQuestionFeedbackItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback } from "react";
2
3
  import { View } from "react-native";
3
4
  import { Text } from "@lookiero/aurora";
@@ -7,7 +8,7 @@ import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeed
7
8
  import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
8
9
  import { style } from "./ReturnQuestionFeedbackItem.style";
9
10
  const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
10
- const titleText = useI18nMessage({ id: returnQuestion.name });
11
+ const titleText = useI18nMessage({ id: returnQuestion.translationKey });
11
12
  const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
12
13
  const returnQuestionFeedback = useReturnQuestionFeedback();
13
14
  const intl = useIntl();
@@ -1,3 +1,4 @@
1
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
1
2
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
- declare const TextareaReturnQuestionItem: ReturnQuestionItem;
3
+ declare const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA>;
3
4
  export { TextareaReturnQuestionItem };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/prop-types */
1
2
  import React, { useCallback, useMemo } from "react";
2
3
  import { View } from "@lookiero/aurora";
3
4
  import { useIntl } from "@lookiero/i18n-react";
@@ -6,7 +7,7 @@ import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useR
6
7
  import { style } from "./TextareaReturnQuestionItem.style";
7
8
  const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
8
9
  const { formatMessage } = useIntl();
9
- const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
10
+ const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
10
11
  const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
11
12
  const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: value }), [onChange, returnQuestionParent.id]);
12
13
  return (React.createElement(View, { style: style.wrapper },
@@ -1,3 +1,4 @@
1
+ import { returnQuestionHasChildren, returnQuestionWithTranslationKey, } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
1
2
  const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
2
3
  const isUuid = (value) => {
3
4
  return typeof value === "string" && REGEX.test(value);
@@ -7,11 +8,14 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
7
8
  if (returnQuestionId) {
8
9
  const returnQuestionFeedback = feedback[returnQuestionId];
9
10
  if (isUuid(returnQuestionFeedback)) {
10
- const feebackReturnQuestionChild = returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
11
+ const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
12
+ returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
11
13
  if (feebackReturnQuestionChild) {
12
14
  return [
13
15
  ...acc,
14
- translate(feebackReturnQuestionChild?.name),
16
+ ...(returnQuestionWithTranslationKey(feebackReturnQuestionChild)
17
+ ? [translate(feebackReturnQuestionChild.translationKey)]
18
+ : []),
15
19
  ...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
16
20
  ];
17
21
  }
@@ -19,17 +23,20 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
19
23
  }
20
24
  return [...acc, returnQuestionFeedback];
21
25
  }
22
- return (returnQuestion.children?.reduce((acc, childReturnQuestion) => [
23
- ...acc,
24
- ...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
25
- ], []) || []);
26
+ return ((returnQuestionHasChildren(returnQuestion) &&
27
+ returnQuestion.children?.reduce((acc, childReturnQuestion) => [
28
+ ...acc,
29
+ ...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
30
+ ], [])) ||
31
+ []);
26
32
  };
27
33
  const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQuestion, deepestReturnQuestion, }) => {
28
34
  const returnQuestionId = Object.keys(feedback).find((id) => id === returnQuestion.id);
29
35
  if (returnQuestionId) {
30
36
  const returnQuestionFeedback = feedback[returnQuestionId];
31
37
  if (isUuid(returnQuestionFeedback)) {
32
- const feebackReturnQuestionChild = returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
38
+ const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
39
+ returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
33
40
  if (feebackReturnQuestionChild) {
34
41
  return deepestReturnQuestionWithFeedbackForReturnQuestion({
35
42
  feedback,
@@ -41,7 +48,8 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQu
41
48
  }
42
49
  return [returnQuestion, false];
43
50
  }
44
- const feebackReturnQuestionChild = returnQuestion.children?.find((childReturnQuestion) => Object.keys(feedback).find((id) => id === childReturnQuestion.id));
51
+ const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
52
+ returnQuestion.children?.find((childReturnQuestion) => Object.keys(feedback).find((id) => id === childReturnQuestion.id));
45
53
  if (feebackReturnQuestionChild) {
46
54
  return deepestReturnQuestionWithFeedbackForReturnQuestion({
47
55
  feedback,
@@ -49,6 +57,7 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQu
49
57
  deepestReturnQuestion: feebackReturnQuestionChild,
50
58
  });
51
59
  }
52
- return [deepestReturnQuestion, !returnQuestion.children || returnQuestion.children.length === 0];
60
+ const hasChildren = Boolean(returnQuestionHasChildren(returnQuestion) && returnQuestion.children && returnQuestion.children.length > 0);
61
+ return [deepestReturnQuestion, !hasChildren];
53
62
  };
54
63
  export { feedbackForReturnQuestion, deepestReturnQuestionWithFeedbackForReturnQuestion };
@@ -4,7 +4,6 @@ import React, { Fragment } from "react";
4
4
  import { IntlProvider } from "react-intl";
5
5
  import { Aurora } from "@lookiero/aurora";
6
6
  import { LoggerProvider } from "@lookiero/sty-psp-logging";
7
- import { EnvironmentStyleProvider } from "@lookiero/sty-psp-ui";
8
7
  import { BasePathProvider } from "../routing/useBasePath";
9
8
  const renderWrapper = ({ locale, messages = {}, wrapper: Wrapper = Fragment, logger = mock() }) =>
10
9
  // eslint-disable-next-line react/display-name, react/prop-types
@@ -12,7 +11,6 @@ const renderWrapper = ({ locale, messages = {}, wrapper: Wrapper = Fragment, log
12
11
  React.createElement(IntlProvider, { locale: locale, messages: messages, onError: () => void 0 },
13
12
  React.createElement(LoggerProvider, { logger: logger },
14
13
  React.createElement(BasePathProvider, { basePath: "" },
15
- React.createElement(EnvironmentStyleProvider, null,
16
- React.createElement(Wrapper, null, children)))))));
14
+ React.createElement(Wrapper, null, children))))));
17
15
  const renderWithProviders = (ui, { locale, messages, wrapper } = { locale: "en" }) => render(ui, { wrapper: renderWrapper({ locale, messages, wrapper }) });
18
16
  export { renderWithProviders as render };
@@ -1,20 +1,15 @@
1
1
  import { PortalProvider } from "@gorhom/portal";
2
2
  import React from "react";
3
- import { StatusBar, View } from "react-native";
3
+ import { StatusBar } from "react-native";
4
4
  import { SafeAreaProvider } from "react-native-safe-area-context";
5
5
  import { PortalProvider as AuroraPortalProvider } from "@lookiero/aurora";
6
6
  import { Notifications } from "@lookiero/sty-psp-notifications";
7
- import { theme, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
7
+ import { theme } from "@lookiero/sty-psp-ui";
8
8
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
9
- import { style } from "./App.style";
10
9
  const { colorBgBase } = theme();
11
- const App = ({ children }) => {
12
- const { container } = useEnvironmentStyle();
13
- return (React.createElement(View, { style: [style.container, container] },
14
- React.createElement(SafeAreaProvider, null,
15
- React.createElement(PortalProvider, null,
16
- React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
17
- React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
18
- React.createElement(AuroraPortalProvider, null, children)))));
19
- };
10
+ const App = ({ children }) => (React.createElement(SafeAreaProvider, null,
11
+ React.createElement(PortalProvider, null,
12
+ React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
13
+ React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
14
+ React.createElement(AuroraPortalProvider, null, children))));
20
15
  export { App };
@@ -2,17 +2,16 @@ import React from "react";
2
2
  import { View } from "react-native";
3
3
  import { ALIGN, Button, BUTTON_VARIANT, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { Modal, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
5
+ import { Modal } from "@lookiero/sty-psp-ui";
6
6
  import { I18nMessages } from "../../../../i18n/i18n";
7
7
  import { style } from "./GetOutOfCheckoutModal.style";
8
8
  const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
9
- const { modal } = useEnvironmentStyle();
10
9
  const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
11
10
  const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
12
11
  const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
13
12
  const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
14
13
  return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
15
- React.createElement(View, { style: [style.modal, modal?.content] },
14
+ React.createElement(View, { style: style.modalContent },
16
15
  React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
17
16
  React.createElement(Text, { level: 3, style: style.description }, descriptionText),
18
17
  React.createElement(Button, { style: style.button, onPress: onDismiss },
@@ -12,7 +12,7 @@ declare const style: {
12
12
  marginVertical: number;
13
13
  width: "100%";
14
14
  };
15
- modal: {
15
+ modalContent: {
16
16
  paddingHorizontal: number;
17
17
  };
18
18
  title: {
@@ -15,7 +15,7 @@ const style = StyleSheet.create({
15
15
  marginVertical: space8,
16
16
  width: "100%",
17
17
  },
18
- modal: {
18
+ modalContent: {
19
19
  paddingHorizontal: space6,
20
20
  },
21
21
  title: {
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { View } from "react-native";
3
3
  import { ButtonIcon, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { ReturnQuestionType, } from "../../../../../../projection/returnQuestion/returnQuestion";
5
+ import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
6
6
  import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
7
7
  import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
8
8
  import { HostDefaultReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem";
@@ -1,4 +1,10 @@
1
1
  import { FC } from "react";
2
+ import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
+ interface SelectModalStyle {
4
+ readonly modalContent: StyleProp<ViewStyle>;
5
+ readonly option: StyleProp<ViewStyle>;
6
+ readonly optionText: StyleProp<TextStyle>;
7
+ }
2
8
  interface Option {
3
9
  readonly label: string;
4
10
  readonly value: string;
@@ -7,10 +13,11 @@ interface SelectModalProps {
7
13
  readonly title?: string;
8
14
  readonly value: string | undefined;
9
15
  readonly options: Option[];
10
- readonly modalVisible: boolean;
11
- readonly testID?: string;
16
+ readonly style?: Partial<SelectModalStyle>;
12
17
  readonly onChange?: (value: string) => void;
13
18
  readonly onClose?: () => void;
19
+ readonly modalVisible: boolean;
20
+ readonly testID?: string;
14
21
  }
15
22
  declare const SelectModal: FC<SelectModalProps>;
16
23
  export type { Option };
@@ -1,19 +1,18 @@
1
1
  import React, { useCallback } from "react";
2
2
  import { TouchableHighlight, View } from "react-native";
3
3
  import { COLOR, Text } from "@lookiero/aurora";
4
- import { Modal, theme, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
4
+ import { Modal, theme } from "@lookiero/sty-psp-ui";
5
5
  import { style } from "./SelectModal.style";
6
6
  const { colorBgPrimaryLight } = theme();
7
- const SelectModal = ({ modalVisible, options, testID, title, value, onChange = () => void 0, onClose = () => void 0, }) => {
8
- const { modal } = useEnvironmentStyle();
7
+ const SelectModal = ({ modalVisible, onChange = () => void 0, onClose = () => void 0, options, style: customStyle, testID, title, value, }) => {
9
8
  const handleOnPressOption = useCallback((value) => {
10
9
  onChange(value);
11
10
  onClose();
12
11
  }, [onClose, onChange]);
13
12
  return (React.createElement(Modal, { testID: testID, visible: modalVisible, scroll: true, showCloseButton: true, onClose: onClose },
14
- React.createElement(View, { style: [style.modal, modal?.content] },
13
+ React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
15
14
  title && (React.createElement(Text, { level: 3, style: style.modalTitle, heading: true }, title)),
16
- options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, accessibilityLabel: optionValue, disabled: value === optionValue, style: style.option, testID: optionValue, underlayColor: colorBgPrimaryLight, accessible: true, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
17
- React.createElement(Text, { color: value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT, level: 3, style: style.optionText }, label)))))));
15
+ options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, accessibilityLabel: optionValue, disabled: value === optionValue, style: [style.option, customStyle?.option], testID: optionValue, underlayColor: colorBgPrimaryLight, accessible: true, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
16
+ React.createElement(Text, { color: value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT, level: 3, style: [style.optionText, customStyle?.optionText] }, label)))))));
18
17
  };
19
18
  export { SelectModal };
@@ -1,5 +1,5 @@
1
1
  declare const style: {
2
- modal: {
2
+ modalContent: {
3
3
  paddingBottom: number;
4
4
  paddingHorizontal: number;
5
5
  };
@@ -2,7 +2,7 @@ import { StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
3
  const { borderWidth1, colorBorderInteractive, space1, space5, space6 } = theme();
4
4
  const style = StyleSheet.create({
5
- modal: {
5
+ modalContent: {
6
6
  paddingBottom: space6,
7
7
  paddingHorizontal: space6,
8
8
  },
@@ -2,16 +2,15 @@ import React from "react";
2
2
  import { View } from "react-native";
3
3
  import { Button, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { Modal, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
5
+ import { Modal } from "@lookiero/sty-psp-ui";
6
6
  import { I18nMessages } from "../../../../i18n/i18n";
7
7
  import { style } from "./SizeWithoutStockModal.style";
8
8
  const SizeWithoutStockModal = ({ visible, onDismiss }) => {
9
- const { modal } = useEnvironmentStyle();
10
9
  const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
11
10
  const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
12
11
  const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
13
12
  return (React.createElement(Modal, { visible: visible, showCloseButton: true, onClose: onDismiss },
14
- React.createElement(View, { style: [style.modalContent, modal?.content] },
13
+ React.createElement(View, { style: style.modalContent },
15
14
  React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
16
15
  React.createElement(Text, { level: 3, style: style.description }, descriptionText),
17
16
  React.createElement(Button, { onPress: onDismiss }, buttonText))));
@@ -1,12 +1,13 @@
1
1
  import { PortalHost } from "@gorhom/portal";
2
2
  import React, { useCallback, useMemo } from "react";
3
- import { ScrollView } from "react-native";
3
+ import { Platform } from "react-native";
4
+ import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
4
5
  import { generatePath, useNavigate } from "react-router-native";
5
6
  import { Box, Button, Layout as AuroraLayout, Spinner, Text, View, useDevice } from "@lookiero/aurora";
6
7
  import { useI18nMessage } from "@lookiero/i18n-react";
7
8
  import { CommandStatus } from "@lookiero/messaging-react";
8
9
  import { useLogger } from "@lookiero/sty-psp-logging";
9
- import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
10
+ import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
10
11
  import { useReturnCheckoutItem } from "../../../../../domain/checkoutItem/react/useReturnCheckoutItem";
11
12
  import { useListReturnQuestionsByCheckoutItemId } from "../../../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
12
13
  import { TrackingPage } from "../../../../../tracking/tracking";
@@ -100,7 +101,7 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
100
101
  header: style.header,
101
102
  } },
102
103
  React.createElement(ProductVariantPreview, { country: country, item: checkoutItem }),
103
- React.createElement(ScrollView, { showsVerticalScrollIndicator: false, testID: "return-questions-form" },
104
+ React.createElement(KeyboardAwareScrollView, { extraScrollHeight: Platform.OS === "android" ? 10 : 120, keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, testID: "return-questions-form" },
104
105
  React.createElement(View, { style: style.background },
105
106
  React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [style.layout, screen.L ? style.desktopLayoutSpacing : undefined] },
106
107
  React.createElement(Box, { size: { L: "2/3" } },
@@ -26,8 +26,8 @@ const CollapsiblePricing = ({ pricing, totalCheckoutItemsKept, collapsible = tru
26
26
  totalCheckoutItemsKeptText),
27
27
  React.createElement(Price, { price: pendingToPay, variant: "detail" })),
28
28
  React.createElement(View, { style: style.collapsedContent },
29
- React.createElement(Button, { testID: "confirm-checkout-collpased-button", small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
29
+ React.createElement(Button, { testID: "submit-checkout-collpased-button", small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
30
30
  React.createElement(Pricing, { pricing: pricing, totalCheckoutItemsKept: totalCheckoutItemsKept }),
31
- React.createElement(Button, { testID: "confirm-checkout-button", onPress: onSubmit }, submitButtonText)))));
31
+ React.createElement(Button, { testID: "submit-checkout-button", onPress: onSubmit }, submitButtonText)))));
32
32
  };
33
33
  export { CollapsiblePricing };
@@ -0,0 +1,9 @@
1
+ declare enum ReturnQuestionType {
2
+ HOST_DEFAULT = "HOST_DEFAULT",
3
+ HOST_TEXTAREA = "HOST_TEXTAREA",
4
+ HOST_SELECT = "HOST_SELECT",
5
+ HOST_STACK = "HOST_STACK",
6
+ TEXTAREA = "TEXTAREA",
7
+ OPTION = "OPTION"
8
+ }
9
+ export { ReturnQuestionType };
@@ -0,0 +1,10 @@
1
+ var ReturnQuestionType;
2
+ (function (ReturnQuestionType) {
3
+ ReturnQuestionType["HOST_DEFAULT"] = "HOST_DEFAULT";
4
+ ReturnQuestionType["HOST_TEXTAREA"] = "HOST_TEXTAREA";
5
+ ReturnQuestionType["HOST_SELECT"] = "HOST_SELECT";
6
+ ReturnQuestionType["HOST_STACK"] = "HOST_STACK";
7
+ ReturnQuestionType["TEXTAREA"] = "TEXTAREA";
8
+ ReturnQuestionType["OPTION"] = "OPTION";
9
+ })(ReturnQuestionType || (ReturnQuestionType = {}));
10
+ export { ReturnQuestionType };