@lookiero/checkout 1.1.1-beta.1 → 1.1.2

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 (116) hide show
  1. package/README.md +2 -0
  2. package/dist/infrastructure/projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem.d.ts +1 -1
  3. package/dist/infrastructure/projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId.d.ts +1 -1
  4. package/dist/infrastructure/projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId.js +2 -1
  5. package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +3 -0
  6. package/dist/infrastructure/ui/views/checkout/Checkout.js +1 -1
  7. package/dist/infrastructure/ui/views/item/Item.d.ts +0 -1
  8. package/dist/infrastructure/ui/views/item/Item.js +51 -130
  9. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +1 -1
  10. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +1 -4
  11. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +7 -7
  12. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
  13. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +2 -2
  14. package/dist/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +18 -0
  15. package/dist/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +48 -0
  16. package/dist/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.style.d.ts +8 -0
  17. package/dist/infrastructure/ui/views/item/{Item.style.js → views/itemWithCustomerDecission/ItemWithCustomerDecission.style.js} +1 -8
  18. package/dist/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +19 -0
  19. package/dist/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +68 -0
  20. package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.d.ts +16 -0
  21. package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +28 -0
  22. package/dist/infrastructure/ui/views/item/{Item.style.d.ts → views/productVariant/ProductVariant.style.d.ts} +0 -5
  23. package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.js +13 -0
  24. package/dist/infrastructure/ui/views/navigation/Navigation.js +4 -4
  25. package/dist/infrastructure/ui/views/navigation/components/header/Header.d.ts +2 -2
  26. package/dist/infrastructure/ui/views/navigation/components/header/Header.js +2 -2
  27. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +1 -1
  28. package/dist/shared/tracking/infrastructure/useTrackPressMenu.d.ts +1 -1
  29. package/dist/shared/tracking/infrastructure/useTrackPressMenu.js +2 -2
  30. package/dist/shared/tracking/tracking.d.ts +1 -1
  31. package/dist/shared/ui/components/atoms/input/Input.js +1 -1
  32. package/dist/shared/ui/components/atoms/input/Input.style.d.ts +0 -1
  33. package/dist/shared/ui/components/atoms/input/Input.style.js +0 -5
  34. package/dist/shared/ui/components/atoms/spinner/Spinner.js +1 -1
  35. package/dist/shared/ui/components/molecules/selectField/SelectField.js +1 -1
  36. package/package.json +2 -2
  37. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +0 -13
  38. package/dist/domain/checkout/command/markCheckoutAsPaid.js +0 -4
  39. package/dist/domain/checkout/model/checkoutPaid.d.ts +0 -13
  40. package/dist/domain/checkout/model/checkoutPaid.js +0 -4
  41. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  42. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  43. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +0 -5
  44. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +0 -13
  45. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +0 -13
  46. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +0 -16
  47. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +0 -13
  48. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +0 -14
  49. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  50. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  51. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +0 -12
  52. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +0 -9
  53. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +0 -10
  54. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +0 -12
  55. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +0 -12
  56. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +0 -9
  57. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  58. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  59. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  60. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  61. package/dist/infrastructure/ui/views/App.style.d.ts +0 -4
  62. package/dist/infrastructure/ui/views/App.style.js +0 -16
  63. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  64. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  65. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  66. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  67. package/dist/infrastructure/ui/views/header/Header.d.ts +0 -15
  68. package/dist/infrastructure/ui/views/header/Header.js +0 -90
  69. package/dist/infrastructure/ui/views/header/Header.style.d.ts +0 -35
  70. package/dist/infrastructure/ui/views/header/Header.style.js +0 -38
  71. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +0 -7
  72. package/dist/infrastructure/ui/views/header/components/Logo.js +0 -11
  73. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +0 -7
  74. package/dist/infrastructure/ui/views/header/components/Logo.style.js +0 -8
  75. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  76. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  77. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -55
  78. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -58
  79. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  80. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  81. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  82. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  83. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +0 -10
  84. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +0 -1
  85. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +0 -25
  86. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +0 -8
  87. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +0 -25
  88. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +0 -8
  89. package/dist/shared/logging/location.d.ts +0 -3
  90. package/dist/shared/logging/location.js +0 -5
  91. package/dist/shared/logging/matchRoutes.d.ts +0 -3
  92. package/dist/shared/logging/matchRoutes.js +0 -7
  93. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +0 -29
  94. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +0 -134
  95. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +0 -22
  96. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +0 -15
  97. package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +0 -27
  98. package/dist/shared/logging/reactRouterV6Instrumentation.native.js +0 -115
  99. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  100. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  101. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +0 -1
  102. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +0 -9
  103. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  104. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  105. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  106. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  107. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  108. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  109. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  110. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
  111. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  112. package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
  113. /package/dist/infrastructure/ui/views/{item → shared}/components/productVariant/ProductVariant.d.ts +0 -0
  114. /package/dist/infrastructure/ui/views/{item → shared}/components/productVariant/ProductVariant.js +0 -0
  115. /package/dist/infrastructure/ui/views/{item → shared}/components/productVariant/ProductVariant.style.d.ts +0 -0
  116. /package/dist/infrastructure/ui/views/{item → shared}/components/productVariant/ProductVariant.style.js +0 -0
@@ -0,0 +1,28 @@
1
+ import React, { useCallback, useEffect } from "react";
2
+ import { View } from "react-native";
3
+ import { useTrackImageView } from "../../../../../../shared/tracking/infrastructure/useTrackImageView";
4
+ import { TrackingPage } from "../../../../../tracking/tracking";
5
+ import { ProductVariantDescription } from "../../components/productVariantDescription/ProductVariantDescription";
6
+ import { ProductVariantSlider } from "../../components/productVariantSlider/ProductVariantSlider";
7
+ import { style } from "./ProductVariant.style";
8
+ const ProductVariant = ({ country, checkoutId, checkoutItem, currentProductVariant, style: customStyle, children, }) => {
9
+ const trackImageView = useTrackImageView({
10
+ page: TrackingPage.ITEM,
11
+ country,
12
+ checkoutId,
13
+ checkoutItemId: checkoutItem.id,
14
+ productVariantId: checkoutItem.productVariant.id,
15
+ });
16
+ useEffect(() => trackImageView({
17
+ perspective: checkoutItem.productVariant.media[0]?.perspective,
18
+ }), [checkoutItem.productVariant.media, trackImageView]);
19
+ const handleOnChangedProductVariantSlider = useCallback((active) => trackImageView({ perspective: checkoutItem.productVariant.media[active]?.perspective }), [checkoutItem.productVariant.media, trackImageView]);
20
+ const { price } = checkoutItem;
21
+ const { media, brand, name, color } = checkoutItem.productVariant;
22
+ return (React.createElement(View, { style: [style.content, customStyle?.content], testID: "product-variant" },
23
+ React.createElement(View, { style: style.sliderContainer },
24
+ React.createElement(ProductVariantSlider, { producVariantMedia: media, onChanged: handleOnChangedProductVariantSlider })),
25
+ React.createElement(ProductVariantDescription, { brand: brand, color: color, country: country, name: name, price: price, size: currentProductVariant.size }),
26
+ children));
27
+ };
28
+ export { ProductVariant };
@@ -2,11 +2,6 @@ declare const style: {
2
2
  content: {
3
3
  paddingHorizontal: number;
4
4
  };
5
- feedbackContainer: {
6
- borderTopColor: string;
7
- borderTopWidth: number;
8
- marginVertical: number;
9
- };
10
5
  sliderContainer: {
11
6
  marginBottom: number;
12
7
  minHeight: number;
@@ -0,0 +1,13 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../theme/theme";
3
+ const { spaceXL } = theme();
4
+ const style = StyleSheet.create({
5
+ content: {
6
+ paddingHorizontal: spaceXL,
7
+ },
8
+ sliderContainer: {
9
+ marginBottom: spaceXL,
10
+ minHeight: 500,
11
+ },
12
+ });
13
+ export { style };
@@ -10,22 +10,22 @@ import { Header } from "./components/header/Header";
10
10
  const Navigation = ({ customerId, country, menu, tabBar: TabBar, children }) => {
11
11
  const [menuVisible, setMenuVisible] = useState(false);
12
12
  const trackPressMenu = useTrackPressMenu();
13
- const handleOnOpenMenu = useCallback(({ page, checkoutId, open }) => {
13
+ const handleOnOpenMenu = useCallback(({ page, checkoutId, collapse }) => {
14
14
  setMenuVisible(true);
15
15
  trackPressMenu({
16
16
  page,
17
17
  country,
18
18
  checkoutId,
19
- open,
19
+ collapse,
20
20
  });
21
21
  }, [country, trackPressMenu]);
22
- const handleOnCloseMenu = useCallback(({ page, checkoutId, open }) => {
22
+ const handleOnCloseMenu = useCallback(({ page, checkoutId, collapse }) => {
23
23
  setMenuVisible(false);
24
24
  trackPressMenu({
25
25
  page,
26
26
  country,
27
27
  checkoutId,
28
- open,
28
+ collapse,
29
29
  });
30
30
  }, [country, trackPressMenu]);
31
31
  const trackPressBack = useTrackPressBack();
@@ -5,7 +5,7 @@ import { Menu } from "../../Navigation";
5
5
  interface OnOpenMenuFunctionArgs {
6
6
  readonly page: TrackingPage;
7
7
  readonly checkoutId: string | undefined;
8
- readonly open: boolean;
8
+ readonly collapse: boolean;
9
9
  }
10
10
  interface OnOpenMenuFunction {
11
11
  (args: OnOpenMenuFunctionArgs): void;
@@ -13,7 +13,7 @@ interface OnOpenMenuFunction {
13
13
  interface OnCloseMenuFunctionArgs {
14
14
  readonly page: TrackingPage;
15
15
  readonly checkoutId: string | undefined;
16
- readonly open: boolean;
16
+ readonly collapse: boolean;
17
17
  }
18
18
  interface OnCloseMenuFunction {
19
19
  (args: OnCloseMenuFunctionArgs): void;
@@ -96,8 +96,8 @@ const Header = ({ customerId, menu: Menu, menuVisible, onOpenMenu, onCloseMenu,
96
96
  summaryRouteMatch,
97
97
  ]);
98
98
  const { top: safeAreaInsetTop } = useSafeAreaInsets();
99
- const handleOnOpenMenu = useCallback(() => onOpenMenu({ page: trackingPage(), checkoutId: checkout?.id, open: true }), [checkout?.id, onOpenMenu, trackingPage]);
100
- const handleOnCloseMenu = useCallback(() => onCloseMenu({ page: trackingPage(), checkoutId: checkout?.id, open: false }), [checkout?.id, onCloseMenu, trackingPage]);
99
+ const handleOnOpenMenu = useCallback(() => onOpenMenu({ page: trackingPage(), checkoutId: checkout?.id, collapse: false }), [checkout?.id, onOpenMenu, trackingPage]);
100
+ const handleOnCloseMenu = useCallback(() => onCloseMenu({ page: trackingPage(), checkoutId: checkout?.id, collapse: true }), [checkout?.id, onCloseMenu, trackingPage]);
101
101
  const handleOnBack = useCallback(() => onBack?.({ page: trackingPage(), checkoutId: checkout?.id }), [checkout?.id, onBack, trackingPage]);
102
102
  const handleOnNext = useCallback(({ from, to }) => onNext?.({ page: trackingPage(), checkoutId: checkout?.id, from, to }), [checkout?.id, onNext, trackingPage]);
103
103
  const handleOnPrevious = useCallback(({ from, to }) => onPrevious?.({ page: trackingPage(), checkoutId: checkout?.id, from, to }), [checkout?.id, onPrevious, trackingPage]);
@@ -5,7 +5,7 @@ import { View } from "react-native";
5
5
  import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
6
6
  import { Tabs } from "../../../../components/layouts/tabs/Tabs";
7
7
  import { I18nMessages } from "../../../../i18n/i18n";
8
- import { ProductVariant } from "../../../item/components/productVariant/ProductVariant";
8
+ import { ProductVariant } from "../../../shared/components/productVariant/ProductVariant";
9
9
  import { style } from "./CheckoutItemsTabs.style";
10
10
  const CheckoutItem = ({ checkoutItemStatus, checkoutItemProductVariant, checkoutItemPrice, country, discarded = false, testID, style: customStyle, onPress, }) => (React.createElement(View, { style: style.checkoutItem, testID: testID },
11
11
  React.createElement(ProductVariant, { brand: checkoutItemProductVariant.brand, color: checkoutItemProductVariant.color, country: country, discarded: discarded, media: checkoutItemProductVariant.media, name: checkoutItemProductVariant.name, price: checkoutItemPrice, size: checkoutItemProductVariant.size, status: checkoutItemStatus, style: customStyle, onPress: onPress })));
@@ -4,7 +4,7 @@ interface PressMenuFunctionArgs {
4
4
  readonly page: TrackingPage;
5
5
  readonly country: Country;
6
6
  readonly checkoutId: string | undefined;
7
- readonly open: boolean;
7
+ readonly collapse: boolean;
8
8
  }
9
9
  interface PressMenuFunction {
10
10
  (args: PressMenuFunctionArgs): void;
@@ -4,7 +4,7 @@ import { TrackingEvent, TrackingEventCategory } from "../tracking";
4
4
  import { useEmitUserEvent } from "./useEmitUserEvent";
5
5
  const useTrackPressMenu = () => {
6
6
  const emitUserEvent = useEmitUserEvent();
7
- const pressMenu = useCallback(({ page, country, checkoutId, open }) => {
7
+ const pressMenu = useCallback(({ page, country, checkoutId, collapse }) => {
8
8
  if (!checkoutId) {
9
9
  return;
10
10
  }
@@ -14,7 +14,7 @@ const useTrackPressMenu = () => {
14
14
  section: `${PROJECT}_${page}`,
15
15
  store: country,
16
16
  checkoutId,
17
- open,
17
+ collapse,
18
18
  };
19
19
  emitUserEvent(pressMenuTrackingEvent);
20
20
  }, [emitUserEvent]);
@@ -69,7 +69,7 @@ interface ChangeFeedbackTrackingEvent extends BaseTrackingEvent {
69
69
  readonly feedback: string | undefined;
70
70
  }
71
71
  interface PressMenuTrackingEvent extends BaseTrackingEvent {
72
- readonly open: boolean;
72
+ readonly collapse: boolean;
73
73
  }
74
74
  type PressBackTrackingEvent = BaseTrackingEvent;
75
75
  interface PressNextTrackingEvent extends BaseTrackingEvent {
@@ -32,6 +32,6 @@ const Input = ({ minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, style: customSt
32
32
  }, [maxHeight, minHeight, multiline]);
33
33
  useLayoutEffect(handleOnContentSizeChangeWeb, [handleOnContentSizeChangeWeb, value]);
34
34
  const textInputRef = useRef(null);
35
- return (React.createElement(TextInput, { ...restOfProps, ref: textInputRef, multiline: multiline, numberOfLines: !!multiline ? undefined : 1, placeholderTextColor: placeholderTextColor, style: [style.input, customStyle, !multiline && style.singleLine, { height }], testID: "input", textAlignVertical: "top", value: value, onChange: onChange, onContentSizeChange: handleOnContentSizeChange }));
35
+ return (React.createElement(TextInput, { ...restOfProps, ref: textInputRef, multiline: multiline, numberOfLines: !!multiline ? undefined : 1, placeholderTextColor: placeholderTextColor, style: [style.input, customStyle, { height }], testID: "input", textAlignVertical: "top", value: value, onChange: onChange, onContentSizeChange: handleOnContentSizeChange }));
36
36
  };
37
37
  export { Input };
@@ -16,6 +16,5 @@ declare const style: {
16
16
  paddingHorizontal: number;
17
17
  paddingTop: number;
18
18
  };
19
- singleLine: {};
20
19
  };
21
20
  export { style, borderSize, paddingVertical };
@@ -23,10 +23,5 @@ const style = StyleSheet.create({
23
23
  },
24
24
  }),
25
25
  },
26
- singleLine: {
27
- // flexWrap: "nowrap",
28
- // flex: 1,
29
- // flexShrink: 1,
30
- },
31
26
  });
32
27
  export { style, borderSize, paddingVertical };
@@ -3,5 +3,5 @@ import React from "react";
3
3
  import { View } from "react-native";
4
4
  import { style } from "./Spinner.style";
5
5
  const Spinner = () => (React.createElement(View, { style: style.container },
6
- React.createElement(AuroraSpinner, null)));
6
+ React.createElement(AuroraSpinner, { testID: "spinner" })));
7
7
  export { Spinner };
@@ -19,7 +19,7 @@ const SelectField = ({ title, placeholder, value, options, style: customStyle, o
19
19
  React.createElement(TouchableHighlight, { style: customStyle?.selectField, underlayColor: colorGrayscaleS, onPress: handleOnPressSelectField, ...touchableRestProps },
20
20
  React.createElement(View, { pointerEvents: "none" },
21
21
  React.createElement(InputField, { editable: false, icon: "arrow-down", label: placeholder, style: customStyle?.inputField, value: selectedValue?.label }))),
22
- React.createElement(Modal, { visible: modalVisible, scroll: true, showCloseButton: true, onClose: handleOnModalClose },
22
+ React.createElement(Modal, { testID: "select-field-modal", visible: modalVisible, scroll: true, showCloseButton: true, onClose: handleOnModalClose },
23
23
  React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
24
24
  title && (React.createElement(Text, { level: 2, style: style.modalTitle }, title)),
25
25
  options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, disabled: value === optionValue, style: [style.option, customStyle?.option], underlayColor: colorGrayscaleS, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "1.1.1-beta.1",
3
+ "version": "1.1.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -32,7 +32,7 @@
32
32
  "@lookiero/i18n-react": "^0.8.3",
33
33
  "@lookiero/messaging": "^8.1.1",
34
34
  "@lookiero/messaging-react": "^8.1.1",
35
- "@react-spring/native": "^9.5.5",
35
+ "@react-spring/native": "9.6.1",
36
36
  "@sentry/react-native": "^4.13.0",
37
37
  "inline-style-prefixer": "6.0.1",
38
38
  "lodash": "^4.17.21",
@@ -1,13 +0,0 @@
1
- import { Command } from "@lookiero/messaging";
2
- declare const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
- interface MarkCheckoutAsPaidPayload {
4
- readonly aggregateId: string;
5
- }
6
- interface MarkCheckoutAsPaid extends Command<typeof MARK_CHECKOUT_AS_PAID>, MarkCheckoutAsPaidPayload {
7
- }
8
- interface MarkCheckoutAsPaidFunction {
9
- (payload: MarkCheckoutAsPaidPayload): MarkCheckoutAsPaid;
10
- }
11
- declare const markCheckoutAsPaid: MarkCheckoutAsPaidFunction;
12
- export type { MarkCheckoutAsPaid };
13
- export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -1,4 +0,0 @@
1
- import { command } from "@lookiero/messaging";
2
- const MARK_CHECKOUT_AS_PAID = "mark_checkout_as_paid";
3
- const markCheckoutAsPaid = ({ aggregateId }) => command({ aggregateId, name: MARK_CHECKOUT_AS_PAID });
4
- export { MARK_CHECKOUT_AS_PAID, markCheckoutAsPaid };
@@ -1,13 +0,0 @@
1
- import { DomainEvent } from "@lookiero/messaging";
2
- declare const CHECKOUT_PAID = "checkout_paid";
3
- interface CheckoutPaidPayload {
4
- readonly aggregateId: string;
5
- }
6
- interface CheckoutPaid extends DomainEvent<typeof CHECKOUT_PAID>, CheckoutPaidPayload {
7
- }
8
- interface CheckoutPaidFunction {
9
- (payload: CheckoutPaidPayload): CheckoutPaid;
10
- }
11
- declare const checkoutPaid: CheckoutPaidFunction;
12
- export type { CheckoutPaid };
13
- export { CHECKOUT_PAID, checkoutPaid };
@@ -1,4 +0,0 @@
1
- import { domainEvent } from "@lookiero/messaging";
2
- const CHECKOUT_PAID = "checkout_paid";
3
- const checkoutPaid = ({ aggregateId }) => domainEvent({ aggregateId, name: CHECKOUT_PAID });
4
- export { CHECKOUT_PAID, checkoutPaid };
@@ -1,6 +0,0 @@
1
- import { ProcessManagerFunction } from "@lookiero/messaging";
2
- import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
3
- interface CreateNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
4
- }
5
- declare const createNotificationWhenCheckoutBookingExpired: CreateNotificationWhenCheckoutBookingExpiredFunction;
6
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,13 +0,0 @@
1
- import { v4 as uuid } from "uuid";
2
- import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
3
- import { createNotification } from "../../../shared/notifications/domain/notification/command/createNotification";
4
- import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
5
- const createNotificationWhenCheckoutBookingExpired = ({ commandBus }) => async () => {
6
- await commandBus(createNotification({
7
- aggregateId: uuid(),
8
- level: NotificationLevel.ERROR,
9
- titleI18nKey: undefined,
10
- bodyI18nKey: I18nMessages.CHECKOUT_TOAST_BOOKING_EXPIRED,
11
- }));
12
- };
13
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,5 +0,0 @@
1
- import { HttpCheckoutsSaveFunction } from "./httpCheckouts";
2
- interface HttpCheckoutsMarkAsPaidFunction extends HttpCheckoutsSaveFunction {
3
- }
4
- declare const httpCheckoutsMarkAsPaid: HttpCheckoutsMarkAsPaidFunction;
5
- export { httpCheckoutsMarkAsPaid };
@@ -1,13 +0,0 @@
1
- import { CHECKOUT_PAID } from "../../../../domain/checkout/model/checkoutPaid";
2
- const isCheckoutPaid = (event) => event.name === CHECKOUT_PAID;
3
- const httpCheckoutsMarkAsPaid = ({ httpPost }) => async ({ aggregateId, domainEvents }) => {
4
- const checkoutPaid = domainEvents.find(isCheckoutPaid);
5
- if (!checkoutPaid) {
6
- return;
7
- }
8
- await httpPost({
9
- endpoint: "/mark-checkout-as-paid",
10
- body: { checkoutId: aggregateId },
11
- });
12
- };
13
- export { httpCheckoutsMarkAsPaid };
@@ -1,13 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface MarkAsPaidFunction {
3
- (): Promise<void>;
4
- }
5
- type UseMarkCheckoutAsPaid = [markAsPaid: MarkAsPaidFunction, status: CommandStatus];
6
- interface UseMarkCheckoutAsPaidFunctionArgs {
7
- readonly checkoutId?: string;
8
- }
9
- interface UseMarkCheckoutAsPaidFunction {
10
- (args: UseMarkCheckoutAsPaidFunctionArgs): UseMarkCheckoutAsPaid;
11
- }
12
- declare const useMarkCheckoutAsPaid: UseMarkCheckoutAsPaidFunction;
13
- export { useMarkCheckoutAsPaid };
@@ -1,16 +0,0 @@
1
- import { useCommand } from "@lookiero/messaging-react";
2
- import { useCallback } from "react";
3
- import invariant from "tiny-invariant";
4
- import { markCheckoutAsPaid } from "../../../../domain/checkout/command/markCheckoutAsPaid";
5
- import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
- const useMarkCheckoutAsPaid = ({ checkoutId }) => {
7
- const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
- const markAsPaid = useCallback(() => {
9
- invariant(checkoutId, "CheckoutId must be defined in order to mark the checkout as paid");
10
- return commandBus(markCheckoutAsPaid({
11
- aggregateId: checkoutId,
12
- }));
13
- }, [checkoutId, commandBus]);
14
- return [markAsPaid, status];
15
- };
16
- export { useMarkCheckoutAsPaid };
@@ -1,13 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface BookFunction {
3
- (): Promise<void>;
4
- }
5
- type UseBookCheckouBookingForCheckoutItem = [book: BookFunction, status: CommandStatus];
6
- interface UseBookCheckouBookingForCheckoutItemFunctionArgs {
7
- readonly checkoutItemId: string;
8
- }
9
- interface UseBookCheckouBookingForCheckoutItemFunction {
10
- (args: UseBookCheckouBookingForCheckoutItemFunctionArgs): UseBookCheckouBookingForCheckoutItem;
11
- }
12
- declare const useBookCheckouBookingForCheckoutItem: UseBookCheckouBookingForCheckoutItemFunction;
13
- export { useBookCheckouBookingForCheckoutItem };
@@ -1,14 +0,0 @@
1
- import { useCommand } from "@lookiero/messaging-react";
2
- import { useCallback } from "react";
3
- import { v4 as uuid } from "uuid";
4
- import { bookCheckoutBookingForCheckoutItem } from "../../../../domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem";
5
- import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
- const useBookCheckouBookingForCheckoutItem = ({ checkoutItemId }) => {
7
- const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
8
- const book = useCallback(() => commandBus(bookCheckoutBookingForCheckoutItem({
9
- aggregateId: uuid(),
10
- checkoutItemId,
11
- })), [checkoutItemId, commandBus]);
12
- return [book, status];
13
- };
14
- export { useBookCheckouBookingForCheckoutItem };
@@ -1,10 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface IncrementIntroShownCountFunction {
3
- (): Promise<void>;
4
- }
5
- type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
6
- interface UseIncrementIntroShownCountFunction {
7
- (): UseIncrementIntroShownCount;
8
- }
9
- declare const useIncrementIntroShownCount: UseIncrementIntroShownCountFunction;
10
- export { useIncrementIntroShownCount };
@@ -1,11 +0,0 @@
1
- import { useCallback } from "react";
2
- import { useViewIntroShownCount } from "../../../projection/uiSetting/react/useViewIntroShownCount";
3
- import { UISettings } from "../../../ui/settings/UISettings";
4
- import { useUpdateUiSetting } from "./useUpdateUiSetting";
5
- const useIncrementIntroShownCount = () => {
6
- const [update, status] = useUpdateUiSetting();
7
- const [introShownCount] = useViewIntroShownCount();
8
- const incrementIntroShownCount = useCallback(() => update({ key: UISettings.INTRO_SHOWN_COUNT, value: introShownCount + 1 }), [introShownCount, update]);
9
- return [incrementIntroShownCount, status];
10
- };
11
- export { useIncrementIntroShownCount };
@@ -1,12 +0,0 @@
1
- import { BookedSizeChangeProductsVariantsForCheckoutItemView } from "../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
2
- import { HttpPostFunction } from "../../delivery/http/httpClient";
3
- interface HttpBookedSizeChangeProductsVariantsForCheckoutItemView extends BookedSizeChangeProductsVariantsForCheckoutItemView {
4
- }
5
- interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs {
6
- readonly httpPost: HttpPostFunction;
7
- }
8
- interface HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction {
9
- (args: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunctionArgs): HttpBookedSizeChangeProductsVariantsForCheckoutItemView;
10
- }
11
- declare const httpBookedSizeChangeProductsVariantsForCheckoutItemView: HttpBookedSizeChangeProductsVariantsForCheckoutItemViewFunction;
12
- export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
@@ -1,9 +0,0 @@
1
- const httpBookedSizeChangeProductsVariantsForCheckoutItemView = ({ httpPost }) => async ({ checkoutItemId, signal }) => {
2
- const response = await httpPost({
3
- endpoint: "/view-booked-size-change-product-variants-for-checkout-item",
4
- body: { checkoutItemId },
5
- signal,
6
- });
7
- return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
- };
9
- export { httpBookedSizeChangeProductsVariantsForCheckoutItemView };
@@ -1,10 +0,0 @@
1
- import { UseQueryFunctionResult } from "@lookiero/messaging-react";
2
- import { BookedSizeChangeProductsVariantsProjection } from "../../../../projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants";
3
- interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs {
4
- readonly checkoutItemId: string;
5
- }
6
- interface UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction {
7
- (args: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunctionArgs): UseQueryFunctionResult<BookedSizeChangeProductsVariantsProjection>;
8
- }
9
- declare const useViewBookedSizeChangeProductsVariantsForCheckoutItem: UseViewBookedSizeChangeProductsVariantsForCheckoutItemFunction;
10
- export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
@@ -1,12 +0,0 @@
1
- import { useQuery } from "@lookiero/messaging-react";
2
- import { CHECKOUT_BOOKING_BOOKED, } from "../../../../domain/checkoutBooking/model/checkoutBookingBooked";
3
- import { viewBookedSizeChangeProductsVariantsForCheckoutItem } from "../../../../projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem";
4
- import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
5
- const isCheckoutBookingBooked = (event) => event.name === CHECKOUT_BOOKING_BOOKED;
6
- const useViewBookedSizeChangeProductsVariantsForCheckoutItem = ({ checkoutItemId }) => useQuery({
7
- query: viewBookedSizeChangeProductsVariantsForCheckoutItem({ checkoutItemId }),
8
- contextId: MESSAGING_CONTEXT_ID,
9
- invalidation: isCheckoutBookingBooked,
10
- options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
11
- });
12
- export { useViewBookedSizeChangeProductsVariantsForCheckoutItem };
@@ -1,12 +0,0 @@
1
- import { CheckoutFeedbackByCheckoutIdView } from "../../../projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId";
2
- import { HttpPostFunction } from "../../delivery/http/httpClient";
3
- interface HttpCheckoutFeebackByCheckoutIdView extends CheckoutFeedbackByCheckoutIdView {
4
- }
5
- interface HttpCheckoutFeebackByCheckoutIdViewFunctionArgs {
6
- readonly httpPost: HttpPostFunction;
7
- }
8
- interface HttpCheckoutFeebackByCheckoutIdViewFunction {
9
- (args: HttpCheckoutFeebackByCheckoutIdViewFunctionArgs): HttpCheckoutFeebackByCheckoutIdView;
10
- }
11
- declare const httpCheckoutFeebackByCheckoutIdView: HttpCheckoutFeebackByCheckoutIdViewFunction;
12
- export { httpCheckoutFeebackByCheckoutIdView };
@@ -1,9 +0,0 @@
1
- const httpCheckoutFeebackByCheckoutIdView = ({ httpPost }) => async ({ checkoutId, signal }) => {
2
- const response = await httpPost({
3
- endpoint: "/view-checkout-feedback-by-checkout-id",
4
- body: { checkoutId },
5
- signal,
6
- });
7
- return !response.ok || response.status === 404 ? null : (await response.json()).result;
8
- };
9
- export { httpCheckoutFeebackByCheckoutIdView };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseShouldIntroBeShownFunction {
3
- (): [boolean, QueryStatus];
4
- }
5
- declare const useShouldIntroBeShown: UseShouldIntroBeShownFunction;
6
- export { useShouldIntroBeShown };
@@ -1,7 +0,0 @@
1
- import { useViewIntroShownCount } from "./useViewIntroShownCount";
2
- const MAX_INTRO_SHOWN_COUNT = 2;
3
- const useShouldIntroBeShown = () => {
4
- const [introShownCount, introShownCountStatus] = useViewIntroShownCount();
5
- return [introShownCount < MAX_INTRO_SHOWN_COUNT, introShownCountStatus];
6
- };
7
- export { useShouldIntroBeShown };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseViewIntroShownCountFunction {
3
- (): [number, QueryStatus];
4
- }
5
- declare const useViewIntroShownCount: UseViewIntroShownCountFunction;
6
- export { useViewIntroShownCount };
@@ -1,9 +0,0 @@
1
- import { UISettings } from "../../../ui/settings/UISettings";
2
- import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
3
- const useViewIntroShownCount = () => {
4
- const [introShownCount, introShownCountStatus] = useViewUiSettingByKey({
5
- key: UISettings.INTRO_SHOWN_COUNT,
6
- });
7
- return [introShownCount?.value || 0, introShownCountStatus];
8
- };
9
- export { useViewIntroShownCount };
@@ -1,4 +0,0 @@
1
- declare const style: {
2
- header: {};
3
- };
4
- export { style };
@@ -1,16 +0,0 @@
1
- import { Platform, StyleSheet } from "react-native";
2
- const style = StyleSheet.create({
3
- header: {
4
- ...Platform.select({
5
- web: {
6
- position: "fixed",
7
- zIndex: 1,
8
- },
9
- native: {
10
- position: "absolute",
11
- zIndex: 1,
12
- },
13
- }),
14
- },
15
- });
16
- export { style };
@@ -1,7 +0,0 @@
1
- import { FC } from "react";
2
- interface CheckoutSuccessModalProps {
3
- readonly visible: boolean;
4
- readonly onDismiss: () => void;
5
- }
6
- declare const CheckoutSuccessModal: FC<CheckoutSuccessModalProps>;
7
- export { CheckoutSuccessModal };
@@ -1,25 +0,0 @@
1
- import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
3
- import { useI18nMessage } from "@lookiero/i18n-react";
4
- import React from "react";
5
- import { View } from "react-native";
6
- import { Modal } from "../../../../../../shared/ui/components/layouts/modal/Modal";
7
- import { I18nMessages } from "../../../../i18n/i18n";
8
- import { style } from "./CheckoutSuccessModal.style";
9
- const CheckoutSuccessModal = ({ visible, onDismiss }) => {
10
- const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_TITLE });
11
- const descriptionText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_DESCRIPTION });
12
- const buttonText = useI18nMessage({ id: I18nMessages.CHECKOUT_SUCCESS_MODAL_BUTTON });
13
- return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
14
- React.createElement(View, { style: style.modal },
15
- React.createElement(Text, { level: 1, style: style.modalTitle, body: true }, titleText),
16
- React.createElement(Text, { level: 3, style: style.modalDescription, body: true }, descriptionText),
17
- React.createElement(Button
18
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
- // @ts-ignore
20
- , {
21
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
22
- // @ts-ignore
23
- style: style.button, onPress: onDismiss }, buttonText))));
24
- };
25
- export { CheckoutSuccessModal };
@@ -1,16 +0,0 @@
1
- declare const style: {
2
- button: {
3
- flex: number;
4
- };
5
- modal: {
6
- padding: number;
7
- };
8
- modalDescription: {
9
- marginVertical: number;
10
- textAlign: "center";
11
- };
12
- modalTitle: {
13
- textAlign: "center";
14
- };
15
- };
16
- export { style };
@@ -1,19 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../theme/theme";
3
- const { spaceXL } = theme();
4
- const style = StyleSheet.create({
5
- button: {
6
- flex: 0,
7
- },
8
- modal: {
9
- padding: spaceXL,
10
- },
11
- modalDescription: {
12
- marginVertical: spaceXL,
13
- textAlign: "center",
14
- },
15
- modalTitle: {
16
- textAlign: "center",
17
- },
18
- });
19
- export { style };