@lookiero/checkout 9.8.5 → 9.9.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/pact.config.d.ts +21 -0
- package/dist/pact.config.js +16 -0
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/ExpoRoot.js +6 -4
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +55 -0
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +116 -0
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +56 -0
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +13 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +19 -0
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +56 -0
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +57 -0
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +55 -0
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +120 -0
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +55 -0
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +55 -0
- package/dist/src/infrastructure/ui/Root.d.ts +0 -2
- package/dist/src/infrastructure/ui/Root.js +2 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +22 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +5 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +6 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +20 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +43 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +14 -0
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +1 -0
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +1 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +21 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +12 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +12 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +64 -0
- package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +3 -2
- package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +17 -26
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
- package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +22 -55
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +10 -0
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +17 -0
- package/dist/src/infrastructure/ui/i18n/i18n.d.ts +1 -0
- package/dist/src/infrastructure/ui/i18n/i18n.js +1 -0
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +20 -0
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +27 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +10 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +27 -0
- package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
- package/dist/src/infrastructure/ui/views/App.style.js +8 -0
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +5 -2
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +3 -0
- package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +3 -0
- package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +2 -2
- package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +11 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +12 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +64 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +16 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.js +44 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +14 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +28 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +11 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +26 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +21 -0
- package/dist/src/projection/customer/customer.d.ts +2 -0
- package/dist/src/projection/shared/country.d.ts +14 -0
- package/dist/src/projection/shared/country.js +15 -0
- package/dist/src/projection/shared/customer.d.ts +9 -0
- package/dist/src/projection/shared/customer.js +1 -0
- package/dist/src/projection/shared/locale.d.ts +12 -0
- package/dist/src/projection/shared/locale.js +13 -0
- package/dist/src/projection/shared/order.d.ts +6 -0
- package/dist/src/projection/shared/order.js +1 -0
- package/dist/src/projection/shared/price.d.ts +11 -0
- package/dist/src/projection/shared/price.js +1 -0
- package/dist/src/projection/shared/size.d.ts +21 -0
- package/dist/src/projection/shared/size.js +4 -0
- package/dist/src/projection/shared/subscription.d.ts +2 -0
- package/dist/src/projection/shared/subscription.js +1 -0
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +15 -0
- package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +11 -0
- package/dist/src/shared/ui/components/atoms/error/Error.js +6 -0
- package/dist/src/shared/ui/components/atoms/field/Field.d.ts +14 -0
- package/dist/src/shared/ui/components/atoms/field/Field.js +29 -0
- package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +16 -0
- package/dist/src/shared/ui/components/atoms/field/Field.style.js +19 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +24 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.js +28 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +29 -0
- package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +37 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/index.ts +1 -1
- package/package.json +3 -3
- package/src/ExpoRoot.tsx +6 -4
- package/src/infrastructure/ui/Root.tsx +17 -30
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +1 -0
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +0 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +1 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +0 -1
- package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +18 -60
- package/src/infrastructure/ui/hooks/useSubmitCheckout.test.ts +0 -58
- package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +33 -77
- package/src/infrastructure/ui/i18n/i18n.ts +1 -0
- package/src/infrastructure/ui/views/checkout/Checkout.style.ts +3 -0
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +12 -3
- package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +2 -2
- package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
- package/src/projection/customer/customer.ts +2 -0
- package/dist/src/infrastructure/ui/hooks/useQueryBus.d.ts +0 -9
- package/dist/src/infrastructure/ui/hooks/useQueryBus.js +0 -10
- package/src/infrastructure/ui/hooks/useQueryBus.test.tsx +0 -23
- package/src/infrastructure/ui/hooks/useQueryBus.tsx +0 -27
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
description: {
|
|
3
|
+
color: string;
|
|
4
|
+
};
|
|
5
|
+
desktopInfo: {
|
|
6
|
+
borderTopLeftRadius: number;
|
|
7
|
+
borderTopRightRadius: number;
|
|
8
|
+
};
|
|
9
|
+
desktopLayoutSpacing: {
|
|
10
|
+
paddingVertical: number;
|
|
11
|
+
};
|
|
12
|
+
headerWrapper: {
|
|
13
|
+
display: "flex";
|
|
14
|
+
flexDirection: "column";
|
|
15
|
+
};
|
|
16
|
+
info: {
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
paddingBottom: number;
|
|
19
|
+
paddingHorizontal: number;
|
|
20
|
+
paddingTop: number;
|
|
21
|
+
};
|
|
22
|
+
layout: {
|
|
23
|
+
flex: number;
|
|
24
|
+
justifyContent: "center";
|
|
25
|
+
};
|
|
26
|
+
safeAreaView: {
|
|
27
|
+
backgroundColor: string;
|
|
28
|
+
flex: number;
|
|
29
|
+
};
|
|
30
|
+
scrollView: {
|
|
31
|
+
flex: number;
|
|
32
|
+
};
|
|
33
|
+
submit: {
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
borderBottomLeftRadius: number;
|
|
36
|
+
borderBottomRightRadius: number;
|
|
37
|
+
padding: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export { style };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
|
|
4
|
+
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
5
|
+
const style = StyleSheet.create({
|
|
6
|
+
description: {
|
|
7
|
+
color: colorTextMedium,
|
|
8
|
+
},
|
|
9
|
+
desktopInfo: {
|
|
10
|
+
borderTopLeftRadius: borderRadius5,
|
|
11
|
+
borderTopRightRadius: borderRadius5,
|
|
12
|
+
},
|
|
13
|
+
desktopLayoutSpacing: {
|
|
14
|
+
paddingVertical: space8,
|
|
15
|
+
},
|
|
16
|
+
headerWrapper: {
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
},
|
|
20
|
+
info: {
|
|
21
|
+
backgroundColor: colorBgBase,
|
|
22
|
+
paddingBottom: space4,
|
|
23
|
+
paddingHorizontal: space6,
|
|
24
|
+
paddingTop: space8,
|
|
25
|
+
},
|
|
26
|
+
layout: {
|
|
27
|
+
flex: 1,
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
},
|
|
30
|
+
safeAreaView: {
|
|
31
|
+
backgroundColor: colorBgPrimaryLight,
|
|
32
|
+
flex: 1,
|
|
33
|
+
},
|
|
34
|
+
scrollView: {
|
|
35
|
+
flex: 1,
|
|
36
|
+
},
|
|
37
|
+
submit: {
|
|
38
|
+
backgroundColor: colorBgBase,
|
|
39
|
+
borderBottomLeftRadius: borderRadius5,
|
|
40
|
+
borderBottomRightRadius: borderRadius5,
|
|
41
|
+
padding: space6,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
export { style };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { LayoutRectangle } from "react-native";
|
|
3
|
+
import { PricingProjection } from "../../../../../../projection/pricing/pricing";
|
|
4
|
+
|
|
5
|
+
interface StickyPricingProps {
|
|
6
|
+
readonly pricing: PricingProjection;
|
|
7
|
+
readonly totalCheckoutItemsKept: number;
|
|
8
|
+
readonly collapsed: boolean;
|
|
9
|
+
readonly onPress: () => void;
|
|
10
|
+
readonly onSubmit: () => void;
|
|
11
|
+
readonly onLayout?: ({ width, height }: LayoutRectangle) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const StickyPricing: FC<StickyPricingProps>;
|
|
14
|
+
export { StickyPricing };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Sticky } from "@lookiero/sty-psp-ui";
|
|
3
|
+
import { Body } from "../../../../components/layouts/body/Body";
|
|
4
|
+
import { Pricing } from "../pricing/Pricing";
|
|
5
|
+
import { style } from "./StickyPricing.style";
|
|
6
|
+
|
|
7
|
+
const StickyPricing = ({ pricing, totalCheckoutItemsKept, collapsed, onPress, onSubmit, onLayout }) =>
|
|
8
|
+
React.createElement(
|
|
9
|
+
Sticky,
|
|
10
|
+
{ style: style.sticky, onLayout: onLayout },
|
|
11
|
+
React.createElement(
|
|
12
|
+
Body,
|
|
13
|
+
null,
|
|
14
|
+
React.createElement(Pricing, {
|
|
15
|
+
balanceDiscount: pricing.balanceDiscount,
|
|
16
|
+
collapsed: collapsed,
|
|
17
|
+
discount: pricing.discount,
|
|
18
|
+
discountPercentage: pricing.discountPercentage,
|
|
19
|
+
pendingToPay: pricing.pendingToPay,
|
|
20
|
+
service: pricing.service,
|
|
21
|
+
subtotal: pricing.subtotal,
|
|
22
|
+
totalCheckoutItemsKept: totalCheckoutItemsKept,
|
|
23
|
+
onPress: onPress,
|
|
24
|
+
onSubmit: onSubmit,
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
export { StickyPricing };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
+
|
|
3
|
+
type IsCheckoutAccessibleByCustomerIdProjection = boolean;
|
|
4
|
+
declare const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
5
|
+
interface ViewIsCheckoutAccessibleByCustomerIdPayload {
|
|
6
|
+
readonly customerId: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
interface ViewIsCheckoutAccessibleByCustomerId
|
|
9
|
+
extends Query<typeof VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID>,
|
|
10
|
+
ViewIsCheckoutAccessibleByCustomerIdPayload {}
|
|
11
|
+
interface ViewIsCheckoutAccessibleByCustomerIdFunction {
|
|
12
|
+
(payload: ViewIsCheckoutAccessibleByCustomerIdPayload): ViewIsCheckoutAccessibleByCustomerId;
|
|
13
|
+
}
|
|
14
|
+
declare const viewIsCheckoutAccessibleByCustomerId: ViewIsCheckoutAccessibleByCustomerIdFunction;
|
|
15
|
+
interface ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {}
|
|
16
|
+
declare const viewIsCheckoutAccessibleByCustomerIdHandler: QueryHandlerFunction<
|
|
17
|
+
ViewIsCheckoutAccessibleByCustomerId,
|
|
18
|
+
IsCheckoutAccessibleByCustomerIdProjection,
|
|
19
|
+
ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs
|
|
20
|
+
>;
|
|
21
|
+
export type { IsCheckoutAccessibleByCustomerIdProjection };
|
|
22
|
+
export {
|
|
23
|
+
VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID,
|
|
24
|
+
viewIsCheckoutAccessibleByCustomerId,
|
|
25
|
+
viewIsCheckoutAccessibleByCustomerIdHandler,
|
|
26
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { query } from "@lookiero/messaging";
|
|
2
|
+
import { viewFirstAvailableCheckoutByCustomerId } from "./viewFirstAvailableCheckoutByCustomerId";
|
|
3
|
+
import { viewIsCheckoutEnabledByCustomerId } from "./viewIsCheckoutEnabledByCustomerId";
|
|
4
|
+
|
|
5
|
+
const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
6
|
+
const viewIsCheckoutAccessibleByCustomerId = (payload) => ({
|
|
7
|
+
...query({ name: VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID }),
|
|
8
|
+
...payload,
|
|
9
|
+
});
|
|
10
|
+
const isNonEmptyCustomerId = (customerId) => Boolean(customerId);
|
|
11
|
+
const viewIsCheckoutAccessibleByCustomerIdHandler =
|
|
12
|
+
({ queryBus }) =>
|
|
13
|
+
async ({ customerId }) =>
|
|
14
|
+
isNonEmptyCustomerId(customerId) &&
|
|
15
|
+
Boolean(await queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId }))) &&
|
|
16
|
+
Boolean(await queryBus(viewIsCheckoutEnabledByCustomerId({ customerId })));
|
|
17
|
+
export {
|
|
18
|
+
VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID,
|
|
19
|
+
viewIsCheckoutAccessibleByCustomerId,
|
|
20
|
+
viewIsCheckoutAccessibleByCustomerIdHandler,
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var Country;
|
|
2
|
+
(function (Country) {
|
|
3
|
+
Country["ES"] = "ES";
|
|
4
|
+
Country["FR"] = "FR";
|
|
5
|
+
Country["GB"] = "GB";
|
|
6
|
+
Country["BE"] = "BE";
|
|
7
|
+
Country["LU"] = "LU";
|
|
8
|
+
Country["IT"] = "IT";
|
|
9
|
+
Country["PT"] = "PT";
|
|
10
|
+
Country["DE"] = "DE";
|
|
11
|
+
Country["AT"] = "AT";
|
|
12
|
+
Country["NL"] = "NL";
|
|
13
|
+
Country["SE"] = "SE";
|
|
14
|
+
})(Country || (Country = {}));
|
|
15
|
+
export { Country };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var Locale;
|
|
2
|
+
(function (Locale) {
|
|
3
|
+
Locale["ES"] = "es";
|
|
4
|
+
Locale["FR"] = "fr";
|
|
5
|
+
Locale["EN"] = "en";
|
|
6
|
+
Locale["IT"] = "it";
|
|
7
|
+
Locale["PT"] = "pt";
|
|
8
|
+
Locale["DE"] = "de";
|
|
9
|
+
Locale["AT"] = "at";
|
|
10
|
+
Locale["NL"] = "nl";
|
|
11
|
+
Locale["SE"] = "sv";
|
|
12
|
+
})(Locale || (Locale = {}));
|
|
13
|
+
export { Locale };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
2
|
+
|
|
3
|
+
interface PriceProjection {
|
|
4
|
+
readonly amount: number;
|
|
5
|
+
readonly currency: Currency;
|
|
6
|
+
readonly discountedPrice?: {
|
|
7
|
+
readonly amount: number;
|
|
8
|
+
readonly percentage: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export type { PriceProjection };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Country } from "./country";
|
|
2
|
+
|
|
3
|
+
interface SizeProjection {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly lookiero: string;
|
|
6
|
+
readonly uk: string;
|
|
7
|
+
readonly it: string;
|
|
8
|
+
readonly europe: string;
|
|
9
|
+
readonly unique: boolean;
|
|
10
|
+
readonly visualOrder?: number;
|
|
11
|
+
}
|
|
12
|
+
interface SizeFunctionArgs {
|
|
13
|
+
readonly size: SizeProjection;
|
|
14
|
+
readonly country: Country;
|
|
15
|
+
}
|
|
16
|
+
interface SizeFunction {
|
|
17
|
+
(args: SizeFunctionArgs): string;
|
|
18
|
+
}
|
|
19
|
+
declare const size: SizeFunction;
|
|
20
|
+
export type { SizeProjection };
|
|
21
|
+
export { size };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
declare enum AspectRatioViewResizeDirection {
|
|
4
|
+
VERTICAL = "VERTICAL",
|
|
5
|
+
HORIZONTAL = "HORIZONTAL"
|
|
6
|
+
}
|
|
7
|
+
interface AspectRatioViewProps {
|
|
8
|
+
readonly aspectRatio?: number;
|
|
9
|
+
readonly resizeDirection?: AspectRatioViewResizeDirection;
|
|
10
|
+
readonly multiplier?: number;
|
|
11
|
+
readonly children: ReactNode;
|
|
12
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
declare const AspectRatioView: FC<AspectRatioViewProps>;
|
|
15
|
+
export { AspectRatioView, AspectRatioViewResizeDirection };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
var AspectRatioViewResizeDirection;
|
|
4
|
+
(function (AspectRatioViewResizeDirection) {
|
|
5
|
+
AspectRatioViewResizeDirection["VERTICAL"] = "VERTICAL";
|
|
6
|
+
AspectRatioViewResizeDirection["HORIZONTAL"] = "HORIZONTAL";
|
|
7
|
+
})(AspectRatioViewResizeDirection || (AspectRatioViewResizeDirection = {}));
|
|
8
|
+
const AspectRatioView = ({ aspectRatio = 1, resizeDirection = AspectRatioViewResizeDirection.HORIZONTAL, multiplier = 1, style: customStyle = {}, children, }) => {
|
|
9
|
+
const [{ width, height }, setDimension] = useState({});
|
|
10
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout } }) => setDimension(resizeDirection === AspectRatioViewResizeDirection.HORIZONTAL
|
|
11
|
+
? { width: layout.width * multiplier, height: layout.width * aspectRatio }
|
|
12
|
+
: { width: layout.height * aspectRatio, height: layout.height }), [aspectRatio, multiplier, resizeDirection]);
|
|
13
|
+
return (React.createElement(View, { onLayout: handleOnLayout },
|
|
14
|
+
React.createElement(View, { style: [{ width, height }, customStyle] }, children)));
|
|
15
|
+
};
|
|
16
|
+
export { AspectRatioView, AspectRatioViewResizeDirection };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { StyleProp, TextStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
type ErrorStyle = StyleProp<TextStyle>;
|
|
5
|
+
interface ErrorProps {
|
|
6
|
+
readonly error?: string | null;
|
|
7
|
+
readonly style?: ErrorStyle;
|
|
8
|
+
}
|
|
9
|
+
declare const Error: FC<ErrorProps>;
|
|
10
|
+
export type { ErrorStyle };
|
|
11
|
+
export { Error };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
type FieldStyle = {
|
|
4
|
+
readonly field: StyleProp<ViewStyle>;
|
|
5
|
+
readonly fieldText: StyleProp<TextStyle>;
|
|
6
|
+
};
|
|
7
|
+
interface FieldProps {
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly isFocused?: boolean;
|
|
10
|
+
readonly style?: FieldStyle;
|
|
11
|
+
}
|
|
12
|
+
declare const Field: FC<FieldProps>;
|
|
13
|
+
export type { FieldStyle };
|
|
14
|
+
export { Field };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
4
|
+
import { Text } from "@lookiero/aurora";
|
|
5
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
6
|
+
import { style } from "./Field.style";
|
|
7
|
+
const SCALE = 0.75;
|
|
8
|
+
const { space1, space4 } = theme();
|
|
9
|
+
const Field = ({ label, isFocused = false, style: customStyle }) => {
|
|
10
|
+
const [width, setWidth] = useState(0);
|
|
11
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout } }) => setWidth(layout.width), []);
|
|
12
|
+
const scale = useSharedValue(isFocused ? SCALE : 1);
|
|
13
|
+
scale.value = isFocused ? SCALE : 1;
|
|
14
|
+
const translateY = useSharedValue(isFocused ? -14 : space4);
|
|
15
|
+
translateY.value = isFocused ? -14 : space4;
|
|
16
|
+
const translateX = useSharedValue(isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0);
|
|
17
|
+
translateX.value = isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0;
|
|
18
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
19
|
+
transform: [
|
|
20
|
+
{ scale: withTiming(scale.value) },
|
|
21
|
+
{ translateY: withTiming(translateY.value) },
|
|
22
|
+
{ translateX: withTiming(translateX.value) },
|
|
23
|
+
],
|
|
24
|
+
}), [scale.value, translateX.value, translateY.value]);
|
|
25
|
+
return (React.createElement(Animated.View, { pointerEvents: "none", style: [customStyle?.field, animatedStyle], onLayout: handleOnLayout },
|
|
26
|
+
React.createElement(Text, { level: 1, numberOfLines: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
|
|
27
|
+
React.createElement(View, { style: [style.fieldBackground, { opacity: isFocused ? 1 : 0 }] })));
|
|
28
|
+
};
|
|
29
|
+
export { Field };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
fieldBackground: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
height: "100%";
|
|
5
|
+
position: "absolute";
|
|
6
|
+
width: "100%";
|
|
7
|
+
zIndex: number;
|
|
8
|
+
};
|
|
9
|
+
fieldText: {
|
|
10
|
+
flexWrap: "nowrap";
|
|
11
|
+
overflow: "hidden";
|
|
12
|
+
paddingHorizontal: number;
|
|
13
|
+
zIndex: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export { style };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
const { colorBgBase, space1 } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
fieldBackground: {
|
|
6
|
+
backgroundColor: colorBgBase,
|
|
7
|
+
height: "100%",
|
|
8
|
+
position: "absolute",
|
|
9
|
+
width: "100%",
|
|
10
|
+
zIndex: 0,
|
|
11
|
+
},
|
|
12
|
+
fieldText: {
|
|
13
|
+
flexWrap: "nowrap",
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
paddingHorizontal: space1,
|
|
16
|
+
zIndex: 1,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export { style };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import { IconName, InputProperties } from "@lookiero/aurora";
|
|
4
|
+
import { ErrorStyle } from "@lookiero/sty-psp-ui";
|
|
5
|
+
import { FieldStyle } from "../../atoms/field/Field";
|
|
6
|
+
type IconStyle = StyleProp<TextStyle>;
|
|
7
|
+
type InputFieldStyle = FieldStyle & {
|
|
8
|
+
readonly inputField: StyleProp<ViewStyle>;
|
|
9
|
+
readonly error: ErrorStyle;
|
|
10
|
+
readonly icon: IconStyle;
|
|
11
|
+
};
|
|
12
|
+
interface InputFieldBaseProps {
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly multiline?: boolean;
|
|
15
|
+
readonly error?: string | null;
|
|
16
|
+
readonly style?: Partial<InputFieldStyle>;
|
|
17
|
+
readonly onChange?: (value: string) => void;
|
|
18
|
+
readonly icon?: IconName;
|
|
19
|
+
}
|
|
20
|
+
interface InputFieldProps extends Omit<InputProperties, keyof InputFieldBaseProps>, InputFieldBaseProps {
|
|
21
|
+
}
|
|
22
|
+
declare const InputField: FC<InputFieldProps>;
|
|
23
|
+
export type { InputFieldStyle };
|
|
24
|
+
export { InputField };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { COLOR, Icon, Input } from "@lookiero/aurora";
|
|
4
|
+
import { Error, theme } from "@lookiero/sty-psp-ui";
|
|
5
|
+
import { Field } from "../../atoms/field/Field";
|
|
6
|
+
import { style } from "./InputField.style";
|
|
7
|
+
const { colorBgBase, colorBorderInput, colorBorderInputError, colorBorderInputFocus, colorText, colorTextError, colorTextMedium, iconSize, space6, } = theme();
|
|
8
|
+
const inputPaddingRightWithIcon = iconSize + space6;
|
|
9
|
+
const InputField = ({ label, placeholder, value, multiline = false, error, style: customStyle, onChange = () => void 0, icon, testID = "input", ...inputRestProps }) => {
|
|
10
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
11
|
+
const handleOnChange = useCallback((text) => onChange(text), [onChange]);
|
|
12
|
+
const handleOnBlur = useCallback(() => setIsFocused(false), []);
|
|
13
|
+
const handleOnFocus = useCallback(() => setIsFocused(true), []);
|
|
14
|
+
const borderColor = error ? colorBorderInputError : isFocused ? colorBorderInputFocus : colorBorderInput;
|
|
15
|
+
const color = error ? colorTextError : isFocused ? colorText : colorTextMedium;
|
|
16
|
+
return (React.createElement(View, { style: [style.inputField, { borderColor }, customStyle?.inputField], testID: "input-field" },
|
|
17
|
+
React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
|
|
18
|
+
field: [style.field, customStyle?.field],
|
|
19
|
+
fieldText: [{ color }, customStyle?.fieldText],
|
|
20
|
+
} }),
|
|
21
|
+
React.createElement(Input, { autoCapitalize: "sentences", multiline: multiline, multilineMaxHeight: 242, placeholder: placeholder, placeholderTextColor: isFocused ? colorTextMedium : colorBgBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, style.input, { color }], testID: testID, value: value, onBlur: handleOnBlur,
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
onChange: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
|
|
25
|
+
!!icon && React.createElement(Icon, { color: COLOR.GRAYSCALE_L, name: icon, style: [style.icon, customStyle?.icon], testID: "icon" }),
|
|
26
|
+
!!error && React.createElement(Error, { error: error, style: [style.error, customStyle?.error] })));
|
|
27
|
+
};
|
|
28
|
+
export { InputField };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
3
|
+
error: {
|
|
4
|
+
marginLeft: number;
|
|
5
|
+
marginTop: number;
|
|
6
|
+
};
|
|
7
|
+
field: {
|
|
8
|
+
left: number;
|
|
9
|
+
maxWidth: "100%";
|
|
10
|
+
position: "absolute";
|
|
11
|
+
zIndex: number;
|
|
12
|
+
};
|
|
13
|
+
icon: {
|
|
14
|
+
height: number;
|
|
15
|
+
position: "absolute";
|
|
16
|
+
right: number;
|
|
17
|
+
top: number;
|
|
18
|
+
width: number;
|
|
19
|
+
zIndex: number;
|
|
20
|
+
};
|
|
21
|
+
input: {
|
|
22
|
+
textOverflow?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
inputField: {
|
|
25
|
+
borderRadius: number;
|
|
26
|
+
borderWidth: number;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export { style };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StyleSheet, Platform } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
const { space1, space4, space6, borderRadius2, borderWidth1 } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
error: {
|
|
6
|
+
marginLeft: space6,
|
|
7
|
+
marginTop: space1,
|
|
8
|
+
},
|
|
9
|
+
field: {
|
|
10
|
+
left: space4,
|
|
11
|
+
maxWidth: "100%",
|
|
12
|
+
position: "absolute",
|
|
13
|
+
zIndex: 4,
|
|
14
|
+
},
|
|
15
|
+
icon: {
|
|
16
|
+
height: 16,
|
|
17
|
+
position: "absolute",
|
|
18
|
+
right: space4,
|
|
19
|
+
top: space4,
|
|
20
|
+
width: 16,
|
|
21
|
+
zIndex: 4,
|
|
22
|
+
},
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
input: {
|
|
26
|
+
...Platform.select({
|
|
27
|
+
web: {
|
|
28
|
+
textOverflow: "ellipsis",
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
inputField: {
|
|
33
|
+
borderRadius: borderRadius2,
|
|
34
|
+
borderWidth: borderWidth1,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export { style };
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "9.
|
|
1
|
+
export declare const VERSION = "9.9.0-beta.1";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "9.
|
|
1
|
+
export const VERSION = "9.9.0-beta.1";
|
package/index.ts
CHANGED
|
@@ -51,7 +51,7 @@ const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken, translations, sent
|
|
|
51
51
|
queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId: customerId as string }));
|
|
52
52
|
|
|
53
53
|
return {
|
|
54
|
-
root: root({ Messaging, I18n,
|
|
54
|
+
root: root({ Messaging, I18n, getAuthToken, sentry, kameleoon }),
|
|
55
55
|
firstAvailableCheckoutByCustomerId,
|
|
56
56
|
};
|
|
57
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0-beta.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@cypress/webpack-preprocessor": "^6.0.2",
|
|
47
47
|
"@lookiero/eslint-config-sty-psp": "*",
|
|
48
48
|
"@lookiero/event": "^0.3",
|
|
49
|
-
"@lookiero/payments-front": "
|
|
49
|
+
"@lookiero/payments-front": "7.0.0-LK-37736-2025.2.12.160011",
|
|
50
50
|
"@lookiero/sty-psp-jest-config": "*",
|
|
51
51
|
"@lookiero/sty-psp-prettier-config": "*",
|
|
52
52
|
"@lookiero/sty-psp-scripts": "*",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@lookiero/event": "^0.3",
|
|
77
77
|
"@lookiero/i18n": ">=0.9",
|
|
78
78
|
"@lookiero/i18n-react": ">=0.9",
|
|
79
|
-
"@lookiero/payments-front": "
|
|
79
|
+
"@lookiero/payments-front": "7.0.0-LK-37736-2025.2.12.160011",
|
|
80
80
|
"apollo-boost": "0.4.4",
|
|
81
81
|
"expo": ">=51",
|
|
82
82
|
"expo-font": ">=12",
|