@lookiero/checkout 0.8.7 → 0.8.9-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.
- package/dist/domain/checkout/command/markCheckoutAsPaid.d.ts +13 -0
- package/dist/domain/checkout/command/markCheckoutAsPaid.js +4 -0
- package/dist/domain/checkout/model/checkoutPaid.d.ts +13 -0
- package/dist/domain/checkout/model/checkoutPaid.js +4 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.d.ts +5 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsMarkAsPaid.js +13 -0
- package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.d.ts +13 -0
- package/dist/infrastructure/domain/checkout/react/useMarkCheckoutAsPaid.js +16 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +13 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +14 -0
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +10 -0
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +11 -0
- package/dist/infrastructure/projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem.js +1 -1
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +12 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +9 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +10 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +12 -0
- package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.js +9 -1
- package/dist/infrastructure/projection/checkout/react/useViewFiveItemsDiscountByCustomerId.js +1 -1
- package/dist/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +7 -1
- package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackByCheckoutIdView.js +9 -0
- package/dist/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.js +1 -1
- package/dist/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
- package/dist/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +6 -1
- package/dist/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.js +1 -1
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +7 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +9 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.js +1 -1
- package/dist/infrastructure/ui/views/App.style.d.ts +4 -0
- package/dist/infrastructure/ui/views/App.style.js +16 -0
- package/dist/infrastructure/ui/views/header/Header.d.ts +15 -0
- package/dist/infrastructure/ui/views/header/Header.js +90 -0
- package/dist/infrastructure/ui/views/header/Header.style.d.ts +35 -0
- package/dist/infrastructure/ui/views/header/Header.style.js +38 -0
- package/dist/infrastructure/ui/views/header/components/Logo.d.ts +7 -0
- package/dist/infrastructure/ui/views/header/components/Logo.js +11 -0
- package/dist/infrastructure/ui/views/header/components/Logo.style.d.ts +7 -0
- package/dist/infrastructure/ui/views/header/components/Logo.style.js +8 -0
- package/dist/infrastructure/ui/views/intro/Intro.d.ts +6 -0
- package/dist/infrastructure/ui/views/intro/Intro.js +52 -0
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +55 -0
- package/dist/infrastructure/ui/views/intro/Intro.style.js +58 -0
- package/dist/infrastructure/ui/views/item/Item.js +8 -22
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +10 -0
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +1 -0
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +25 -0
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +8 -0
- package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.d.ts +25 -0
- package/dist/projection/checkoutFeedback/viewCheckoutFeedbackByCheckoutId.js +8 -0
- package/dist/shared/logging/location.d.ts +3 -0
- package/dist/shared/logging/location.js +5 -0
- package/dist/shared/logging/matchRoutes.d.ts +3 -0
- package/dist/shared/logging/matchRoutes.js +7 -0
- package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.d.ts +29 -0
- package/dist/shared/logging/reactRouterV6Instrumentation/reactRouterV6Instrumentation.native.js +134 -0
- package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.d.ts +22 -0
- package/dist/shared/logging/reactRouterV6Instrumentation/transactionContext.js +15 -0
- package/dist/shared/logging/reactRouterV6Instrumentation.native.d.ts +27 -0
- package/dist/shared/logging/reactRouterV6Instrumentation.native.js +115 -0
- package/dist/shared/notifications/domain/notification/command/removeNotification.tes.d.ts +1 -0
- package/dist/shared/notifications/domain/notification/command/removeNotification.tes.js +9 -0
- package/dist/shared/notifications/projection/notification/react/useListNotifications.js +1 -1
- package/dist/shared/ui/components/layouts/modal/Modal.js +3 -2
- package/dist/shared/ui/components/layouts/modal/Modal.style.d.ts +1 -0
- package/dist/shared/ui/components/layouts/modal/Modal.style.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
import { RoutingInstrumentation } from "@sentry/react-native";
|
|
3
|
+
import { logger } from "@sentry/utils";
|
|
4
|
+
import React from "react";
|
|
5
|
+
class ReactRouterV6Instrumentation extends RoutingInstrumentation {
|
|
6
|
+
static instrumentationName = "react-router-v6";
|
|
7
|
+
useEffect;
|
|
8
|
+
useLocation;
|
|
9
|
+
useNavigationType;
|
|
10
|
+
matchRoutes;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
prevRoute;
|
|
13
|
+
recentRouteKeys = [];
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
latestTransaction;
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
shouldUpdateLatestTransaction = false;
|
|
18
|
+
constructor(useEffect, useLocation, useNavigationType, matchRoutes) {
|
|
19
|
+
super();
|
|
20
|
+
this.useEffect = useEffect;
|
|
21
|
+
this.useLocation = useLocation;
|
|
22
|
+
this.useNavigationType = useNavigationType;
|
|
23
|
+
this.matchRoutes = matchRoutes;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extends by calling _handleInitialState at the end.
|
|
27
|
+
*/
|
|
28
|
+
registerRoutingInstrumentation(listener, beforeNavigate, onConfirmRoute) {
|
|
29
|
+
super.registerRoutingInstrumentation(listener, beforeNavigate, onConfirmRoute);
|
|
30
|
+
// Need to handle the initial state as the router patch will only attach transactions on subsequent route changes.
|
|
31
|
+
this.handleInitialState();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Starts an idle transaction for the initial state which won't get called by the router listener.
|
|
35
|
+
*/
|
|
36
|
+
handleInitialState() {
|
|
37
|
+
this.latestTransaction = this.onRouteWillChange(INITIAL_TRANSACTION_CONTEXT);
|
|
38
|
+
// We set this to true so when registerAppContainer is called, the transaction gets updated with the actual route data
|
|
39
|
+
this.shouldUpdateLatestTransaction = true;
|
|
40
|
+
}
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
getTransactionContext(route, previousRoute) {
|
|
43
|
+
return {
|
|
44
|
+
name: route.name,
|
|
45
|
+
op: "navigation",
|
|
46
|
+
tags: {
|
|
47
|
+
["routing.instrumentation"]: ReactRouterV6Instrumentation.instrumentationName,
|
|
48
|
+
["routing.route.name"]: route.name,
|
|
49
|
+
},
|
|
50
|
+
data: {
|
|
51
|
+
route: {
|
|
52
|
+
name: route.name,
|
|
53
|
+
key: route.key,
|
|
54
|
+
params: route.params ?? {},
|
|
55
|
+
hasBeenSeen: this.recentRouteKeys.includes(route.key),
|
|
56
|
+
},
|
|
57
|
+
previousRoute: previousRoute
|
|
58
|
+
? {
|
|
59
|
+
name: previousRoute.name,
|
|
60
|
+
key: previousRoute.key,
|
|
61
|
+
params: previousRoute.params ?? {},
|
|
62
|
+
}
|
|
63
|
+
: null,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
wrapUseRoutes = (origUseRoutes) => {
|
|
68
|
+
if (!this.useEffect ||
|
|
69
|
+
!this.useLocation ||
|
|
70
|
+
!this.useNavigationType ||
|
|
71
|
+
!this.matchRoutes
|
|
72
|
+
// !this._customStartTransaction
|
|
73
|
+
) {
|
|
74
|
+
__DEBUG_BUILD__ &&
|
|
75
|
+
logger.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.");
|
|
76
|
+
return origUseRoutes;
|
|
77
|
+
}
|
|
78
|
+
let isMountRenderPass = true;
|
|
79
|
+
// eslint-disable-next-line react/display-name
|
|
80
|
+
return (routes, locationArg) => {
|
|
81
|
+
const SentryRoutes = () => {
|
|
82
|
+
const Routes = origUseRoutes(routes, locationArg);
|
|
83
|
+
const location = this.useLocation();
|
|
84
|
+
const navigationType = this.useNavigationType();
|
|
85
|
+
// A value with stable identity to either pick `locationArg` if available or `location` if not
|
|
86
|
+
const stableLocationParam = typeof locationArg === "string" || (locationArg && locationArg.pathname)
|
|
87
|
+
? locationArg
|
|
88
|
+
: location;
|
|
89
|
+
this.useEffect(() => {
|
|
90
|
+
const normalizedLocation = typeof stableLocationParam === "string" ? { pathname: stableLocationParam } : stableLocationParam;
|
|
91
|
+
if (isMountRenderPass) {
|
|
92
|
+
console.log("updatePageloadTransaction", normalizedLocation, routes);
|
|
93
|
+
// updatePageloadTransaction(normalizedLocation, routes);
|
|
94
|
+
isMountRenderPass = false;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
console.log("normalizedLocation", normalizedLocation, routes, navigationType);
|
|
98
|
+
// handleNavigation(normalizedLocation, routes, navigationType);
|
|
99
|
+
}
|
|
100
|
+
}, [navigationType, stableLocationParam]);
|
|
101
|
+
return Routes;
|
|
102
|
+
};
|
|
103
|
+
return React.createElement(SentryRoutes, null);
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const INITIAL_TRANSACTION_CONTEXT = {
|
|
108
|
+
name: "App Launch",
|
|
109
|
+
op: "navigation",
|
|
110
|
+
tags: {
|
|
111
|
+
["routing.instrumentation"]: ReactRouterV6Instrumentation.instrumentationName,
|
|
112
|
+
},
|
|
113
|
+
data: {},
|
|
114
|
+
};
|
|
115
|
+
export { ReactRouterV6Instrumentation };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { removeNotification as sut, REMOVE_NOTIFICATION } from "./removeNotification";
|
|
2
|
+
describe("removeNotification", () => {
|
|
3
|
+
it("returns a RemoveNotification command", () => {
|
|
4
|
+
const aggregateId = "67ac1d5c-6d24-4b19-bc01-8f61c266670c";
|
|
5
|
+
const command = sut({ aggregateId });
|
|
6
|
+
expect(command.aggregateId).toBe(aggregateId);
|
|
7
|
+
expect(command.name).toBe(REMOVE_NOTIFICATION);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -9,6 +9,6 @@ const useListNotifications = ({ contextId }) => useQuery({
|
|
|
9
9
|
query: listNotifications(),
|
|
10
10
|
contextId,
|
|
11
11
|
invalidation: shouldInvalidate,
|
|
12
|
-
options: { staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
|
|
12
|
+
options: { refetchOnMount: "always", staleTime: Infinity, retry: false, refetchOnWindowFocus: false },
|
|
13
13
|
});
|
|
14
14
|
export { useListNotifications };
|
|
@@ -2,7 +2,8 @@ import { Portal } from "@gorhom/portal";
|
|
|
2
2
|
import { useBack } from "@lookiero/aurora-next/build/hooks/useBack/useBack";
|
|
3
3
|
import { animated, useTransition } from "@react-spring/native";
|
|
4
4
|
import React, { useCallback, useMemo, useState } from "react";
|
|
5
|
-
import { Dimensions, Platform,
|
|
5
|
+
import { Dimensions, Platform, TouchableWithoutFeedback, View, } from "react-native";
|
|
6
|
+
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
6
7
|
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
|
|
7
8
|
import { theme } from "../../../../../infrastructure/ui/theme/theme";
|
|
8
9
|
import { useScreenSize } from "../../../hooks/useScreenSize";
|
|
@@ -55,7 +56,7 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
|
|
|
55
56
|
: { modalOpacity: 0, overlayOpacity: 0, modalTranslateY: 0, modalScale: TRANSITION_MODAL_SCALE },
|
|
56
57
|
unique: true,
|
|
57
58
|
});
|
|
58
|
-
const ModalContentView = useMemo(() => (scroll ?
|
|
59
|
+
const ModalContentView = useMemo(() => (scroll ? KeyboardAwareScrollView : View), [scroll]);
|
|
59
60
|
return (React.createElement(Portal, { hostName: portalHostName }, transitions(({ modalOpacity, overlayOpacity, modalTranslateY, modalScale }, item) => item && (React.createElement(View, { pointerEvents: visible ? "auto" : "none", style: style.container, testID: "modal" },
|
|
60
61
|
React.createElement(TouchableWithoutFeedback, { onPress: visible ? onClose : undefined },
|
|
61
62
|
React.createElement(animated.View, { style: [style.overlay, { opacity: overlayOpacity }, customStyle?.overlay] })),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9-beta.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@react-spring/native": "^9.5.5",
|
|
36
36
|
"@sentry/react-native": "^4.13.0",
|
|
37
37
|
"inline-style-prefixer": "6.0.1",
|
|
38
|
+
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
38
39
|
"react-native-safe-area-context": "^4.4.1",
|
|
39
40
|
"react-native-svg": "^12.1.1",
|
|
40
41
|
"tiny-invariant": "^1.3.1",
|