@lookiero/checkout 3.1.2 → 3.3.0-beta.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 (116) hide show
  1. package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +13 -0
  2. package/dist/domain/checkout/command/markCheckoutAsPaid.js +4 -0
  3. package/dist/domain/checkout/model/checkoutPaid.d.ts +13 -0
  4. package/dist/domain/checkout/model/checkoutPaid.js +4 -0
  5. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +6 -0
  6. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +13 -0
  7. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +5 -0
  8. package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +13 -0
  9. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +13 -0
  10. package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +16 -0
  11. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +13 -0
  12. package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +14 -0
  13. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +10 -0
  14. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +11 -0
  15. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +12 -0
  16. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +9 -0
  17. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +10 -0
  18. package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +12 -0
  19. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +12 -0
  20. package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +9 -0
  21. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +6 -0
  22. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +7 -0
  23. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +6 -0
  24. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +9 -0
  25. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +13 -0
  26. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +19 -0
  27. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +6 -0
  28. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.js +7 -0
  29. package/dist/infrastructure/ui/hooks/useToast.d.ts +11 -0
  30. package/dist/infrastructure/ui/hooks/useToast.js +49 -0
  31. package/dist/infrastructure/ui/i18n/translationEndpoint.d.ts +1 -1
  32. package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +4 -0
  33. package/dist/infrastructure/ui/routing/Routing.js +10 -1
  34. package/dist/infrastructure/ui/routing/routes.d.ts +1 -0
  35. package/dist/infrastructure/ui/routing/routes.js +1 -0
  36. package/dist/infrastructure/ui/views/App.style.d.ts +4 -0
  37. package/dist/infrastructure/ui/views/App.style.js +16 -0
  38. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +7 -0
  39. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +25 -0
  40. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +16 -0
  41. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +19 -0
  42. package/dist/infrastructure/ui/views/header/Header.d.ts +15 -0
  43. package/dist/infrastructure/ui/views/header/Header.js +90 -0
  44. package/dist/infrastructure/ui/views/header/Header.style.d.ts +35 -0
  45. package/dist/infrastructure/ui/views/header/Header.style.js +38 -0
  46. package/dist/infrastructure/ui/views/header/components/Logo.d.ts +7 -0
  47. package/dist/infrastructure/ui/views/header/components/Logo.js +11 -0
  48. package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +7 -0
  49. package/dist/infrastructure/ui/views/header/components/Logo.style.js +8 -0
  50. package/dist/infrastructure/ui/views/intro/Intro.d.ts +6 -0
  51. package/dist/infrastructure/ui/views/intro/Intro.js +52 -0
  52. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +55 -0
  53. package/dist/infrastructure/ui/views/intro/Intro.style.js +58 -0
  54. package/dist/infrastructure/ui/views/item/Item.style.d.ts +15 -0
  55. package/dist/infrastructure/ui/views/item/Item.style.js +18 -0
  56. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +26 -0
  57. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +44 -0
  58. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +45 -0
  59. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +53 -0
  60. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +7 -0
  61. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +25 -0
  62. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +16 -0
  63. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +19 -0
  64. package/dist/infrastructure/ui/views/navigation/Navigation.d.ts +21 -0
  65. package/dist/infrastructure/ui/views/navigation/Navigation.js +45 -0
  66. package/dist/infrastructure/ui/views/navigation/Navigation.style.d.ts +5 -0
  67. package/dist/infrastructure/ui/views/navigation/Navigation.style.js +30 -0
  68. package/dist/infrastructure/ui/views/navigation/components/header/Header.d.ts +46 -0
  69. package/dist/infrastructure/ui/views/navigation/components/header/Header.js +120 -0
  70. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.d.ts +31 -0
  71. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.js +34 -0
  72. package/dist/infrastructure/ui/views/navigation/components/header/Logo.d.ts +7 -0
  73. package/dist/infrastructure/ui/views/navigation/components/header/Logo.js +11 -0
  74. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.d.ts +7 -0
  75. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.js +8 -0
  76. package/dist/infrastructure/ui/views/summary/Summary.d.ts +2 -1
  77. package/dist/infrastructure/ui/views/summary/Summary.js +21 -31
  78. package/dist/infrastructure/ui/views/summaryTabs/SummaryTabs.d.ts +8 -0
  79. package/dist/infrastructure/ui/views/summaryTabs/SummaryTabs.js +52 -0
  80. package/dist/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +13 -0
  81. package/dist/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +24 -0
  82. package/dist/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +15 -0
  83. package/dist/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +18 -0
  84. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +10 -0
  85. package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +1 -0
  86. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +25 -0
  87. package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +8 -0
  88. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +25 -0
  89. package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +8 -0
  90. package/dist/shared/logging/location.d.ts +3 -0
  91. package/dist/shared/logging/location.js +5 -0
  92. package/dist/shared/logging/matchRoutes.d.ts +3 -0
  93. package/dist/shared/logging/matchRoutes.js +7 -0
  94. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +29 -0
  95. package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +134 -0
  96. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +22 -0
  97. package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +15 -0
  98. package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +27 -0
  99. package/dist/shared/logging/reactRouterV6Instrumentation.native.js +115 -0
  100. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +17 -0
  101. package/dist/shared/notifications/domain/notification/command/createNotification.js +7 -0
  102. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +1 -0
  103. package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +9 -0
  104. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +21 -0
  105. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +22 -0
  106. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +12 -0
  107. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +24 -0
  108. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +9 -0
  109. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +20 -0
  110. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +36 -0
  111. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +31 -0
  112. package/dist/shared/tracking/infrastructure/usePageView.d.ts +13 -0
  113. package/dist/shared/tracking/infrastructure/usePageView.js +27 -0
  114. package/dist/shared/ui/components/atoms/error/Error.style.d.ts +6 -0
  115. package/dist/shared/ui/components/atoms/error/Error.style.js +9 -0
  116. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ import { useI18nMessage } from "@lookiero/i18n-react";
2
+ import React from "react";
3
+ import { useCallback, useEffect } from "react";
4
+ import { Toast, ToastVariant } from "../../../../ui/components/molecules/toast/Toast";
5
+ import { NotificationLevel } from "../../../domain/notification/model/notification";
6
+ const toastVariantForNotificationLevel = {
7
+ [NotificationLevel.INFO]: ToastVariant.INFO,
8
+ [NotificationLevel.ERROR]: ToastVariant.ERROR,
9
+ [NotificationLevel.SUCCESS]: ToastVariant.SUCCESS,
10
+ };
11
+ const NotificationItem = ({ notification, onRemove, autoHideTimeout, testID = "notification-item", style: customStyle, }) => {
12
+ const title = useI18nMessage({ id: notification.titleI18nKey }) || undefined;
13
+ const body = useI18nMessage({ id: notification.bodyI18nKey || "" });
14
+ const handleOnClose = useCallback(() => onRemove(notification.id), [notification.id, onRemove]);
15
+ useEffect(() => {
16
+ if (!autoHideTimeout) {
17
+ return;
18
+ }
19
+ const hideTimeout = setTimeout(handleOnClose, autoHideTimeout);
20
+ return () => clearTimeout(hideTimeout);
21
+ }, [autoHideTimeout, handleOnClose]);
22
+ return (React.createElement(Toast, { body: body, style: customStyle, testID: testID, title: title, variant: toastVariantForNotificationLevel[notification.level], onClose: handleOnClose }));
23
+ };
24
+ export { NotificationItem };
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { NotificationProjection } from "../../../projection/notification/notification";
3
+ interface NotificationsProps {
4
+ readonly notifications?: NotificationProjection[];
5
+ readonly onRemove: (notificationId: string) => void;
6
+ readonly autoHideTimeout?: number;
7
+ }
8
+ declare const Notifications: FC<NotificationsProps>;
9
+ export { Notifications };
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
4
+ import { Column } from "../../../../ui/components/layouts/column/Column";
5
+ import { Row } from "../../../../ui/components/layouts/row/Row";
6
+ import { Stack } from "../../../../ui/components/layouts/stack/Stack";
7
+ import { useScreenSize } from "../../../../ui/hooks/useScreenSize";
8
+ import { NotificationItem } from "./NotificationItem";
9
+ import { style } from "./Notifications.style";
10
+ const NOTIFICATIONS_AUTOHIDE_TIMEOUT = 10000;
11
+ const Notifications = ({ notifications = [], onRemove, autoHideTimeout = NOTIFICATIONS_AUTOHIDE_TIMEOUT, }) => {
12
+ const { top: safeAreaInsetTop } = useSafeAreaInsets();
13
+ const screenSize = useScreenSize();
14
+ const isSmallDevice = screenSize === "S";
15
+ return (React.createElement(View, { pointerEvents: "box-none", style: style.notifications, testID: "notifications" },
16
+ React.createElement(Row, { style: [style.row, isSmallDevice && style.rowSmall, { paddingTop: safeAreaInsetTop }] },
17
+ React.createElement(Column, null,
18
+ React.createElement(Stack, null, notifications.map((notification) => (React.createElement(NotificationItem, { key: notification.id, autoHideTimeout: autoHideTimeout, notification: notification, style: { toast: style.toast }, testID: notification.id, onRemove: onRemove }))))))));
19
+ };
20
+ export { Notifications };
@@ -0,0 +1,36 @@
1
+ import { StyleSheet } from "react-native";
2
+ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
3
+ notifications: {
4
+ flexDirection: "column";
5
+ top: number;
6
+ width: string;
7
+ zIndex: number;
8
+ left: number;
9
+ } | {
10
+ flexDirection: "column";
11
+ top: number;
12
+ width: string;
13
+ zIndex: number;
14
+ position: "fixed";
15
+ left: number;
16
+ } | {
17
+ flexDirection: "column";
18
+ top: number;
19
+ width: string;
20
+ zIndex: number;
21
+ position: "absolute";
22
+ left: number;
23
+ };
24
+ row: {
25
+ flex: number;
26
+ justifyContent: "center";
27
+ };
28
+ rowSmall: {
29
+ paddingLeft: number;
30
+ paddingRight: number;
31
+ };
32
+ toast: {
33
+ marginTop: number;
34
+ };
35
+ }>;
36
+ export { style };
@@ -0,0 +1,31 @@
1
+ import { Platform, StyleSheet } from "react-native";
2
+ import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
+ const { spaceM } = theme();
4
+ const style = StyleSheet.create({
5
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
+ // @ts-ignore
7
+ notifications: {
8
+ left: 0,
9
+ ...Platform.select({
10
+ web: { position: "fixed" },
11
+ ios: { position: "absolute" },
12
+ android: { position: "absolute" },
13
+ }),
14
+ flexDirection: "column",
15
+ top: 0,
16
+ width: "100%",
17
+ zIndex: 20,
18
+ },
19
+ row: {
20
+ flex: 1,
21
+ justifyContent: "center",
22
+ },
23
+ rowSmall: {
24
+ paddingLeft: spaceM,
25
+ paddingRight: spaceM,
26
+ },
27
+ toast: {
28
+ marginTop: spaceM,
29
+ },
30
+ });
31
+ export { style };
@@ -0,0 +1,13 @@
1
+ import { TrackingPage } from "../../../infrastructure/tracking/tracking";
2
+ import { Country } from "../../../projection/shared/country";
3
+ interface UsePageViewFunctionArgs {
4
+ readonly page: TrackingPage;
5
+ readonly country: Country;
6
+ readonly checkoutId?: string;
7
+ readonly checkoutItemId?: string;
8
+ }
9
+ interface UsePageViewFunction {
10
+ (agrs: UsePageViewFunctionArgs): void;
11
+ }
12
+ declare const usePageView: UsePageViewFunction;
13
+ export { usePageView };
@@ -0,0 +1,27 @@
1
+ import { useLayoutEffect } from "react";
2
+ import { PROJECT } from "../../../infrastructure/tracking/tracking";
3
+ import { TrackingEvent, TrackingEventCategory } from "../tracking";
4
+ import { useEmitUserEvent } from "./useEmitUserEvent";
5
+ const usePageView = ({ page, country, checkoutId, checkoutItemId }) => {
6
+ const emitUserEvent = useEmitUserEvent();
7
+ useLayoutEffect(() => {
8
+ if (!checkoutId) {
9
+ return;
10
+ }
11
+ const baseTrackingEvent = {
12
+ event: TrackingEvent.PAGEVIEW,
13
+ eventCategory: TrackingEventCategory.NAVIGATION,
14
+ section: `${PROJECT}_${page}`,
15
+ store: country,
16
+ checkoutId,
17
+ };
18
+ const pageViewTrackingEvent = checkoutItemId
19
+ ? {
20
+ ...baseTrackingEvent,
21
+ checkoutItemId,
22
+ }
23
+ : baseTrackingEvent;
24
+ emitUserEvent(pageViewTrackingEvent);
25
+ }, [checkoutId, checkoutItemId, country, emitUserEvent, page]);
26
+ };
27
+ export { usePageView };
@@ -0,0 +1,6 @@
1
+ declare const style: {
2
+ error: {
3
+ color: string;
4
+ };
5
+ };
6
+ export { style };
@@ -0,0 +1,9 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
+ const { colorPrimary } = theme();
4
+ const style = StyleSheet.create({
5
+ error: {
6
+ color: colorPrimary,
7
+ },
8
+ });
9
+ export { style };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "3.1.2",
3
+ "version": "3.3.0-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [