@lookiero/checkout 8.14.0-beta.2 → 8.14.0-beta.3
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/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +10 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +17 -0
- package/dist/src/infrastructure/ui/Root.d.ts +2 -3
- package/dist/src/infrastructure/ui/Root.js +4 -2
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +21 -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 +6 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +6 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +5 -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 +19 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +3 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +18 -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 +13 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +0 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +0 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +0 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +1 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +5 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -4
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +6 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +11 -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 +11 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +11 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +49 -0
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +9 -0
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +9 -0
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +19 -0
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +21 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +9 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +21 -0
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +0 -7
- package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
- package/dist/src/infrastructure/ui/test/render.js +3 -1
- package/dist/src/infrastructure/ui/views/App.d.ts +0 -8
- package/dist/src/infrastructure/ui/views/App.js +10 -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 +10 -0
- package/dist/src/infrastructure/ui/views/item/Item.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +0 -2
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +4 -3
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +1 -5
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +11 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +40 -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 +15 -0
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +6 -5
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +0 -2
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -3
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/return/Return.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.js +43 -0
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +11 -10
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +6 -2
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +6 -2
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +13 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +9 -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 +10 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +17 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +13 -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 +8 -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 +10 -0
- package/dist/src/projection/shared/price.js +1 -0
- package/dist/src/projection/shared/size.d.ts +20 -0
- package/dist/src/projection/shared/size.js +3 -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/error/Error.d.ts +10 -0
- package/dist/src/shared/ui/components/atoms/error/Error.js +4 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +2 -2
- package/src/infrastructure/ui/Root.tsx +22 -21
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +1 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +1 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +0 -6
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +0 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +0 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +4 -6
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +2 -3
- package/src/infrastructure/ui/routing/Routing.tsx +5 -13
- package/src/infrastructure/ui/test/render.tsx +4 -1
- package/src/infrastructure/ui/views/App.tsx +23 -26
- package/src/infrastructure/ui/views/item/Item.tsx +2 -8
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +5 -10
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +6 -3
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +2 -8
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +3 -12
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -17
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +5 -8
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +6 -5
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +6 -3
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +2 -12
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +2 -12
- package/src/infrastructure/ui/views/return/Return.tsx +1 -8
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +6 -2
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +30 -31
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
+
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
description: {
|
|
6
|
+
color: colorTextMedium,
|
|
7
|
+
},
|
|
8
|
+
desktopInfo: {
|
|
9
|
+
borderTopLeftRadius: borderRadius5,
|
|
10
|
+
borderTopRightRadius: borderRadius5,
|
|
11
|
+
},
|
|
12
|
+
desktopLayoutSpacing: {
|
|
13
|
+
paddingVertical: space8,
|
|
14
|
+
},
|
|
15
|
+
headerWrapper: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
},
|
|
19
|
+
info: {
|
|
20
|
+
backgroundColor: colorBgBase,
|
|
21
|
+
paddingBottom: space4,
|
|
22
|
+
paddingHorizontal: space6,
|
|
23
|
+
paddingTop: space8,
|
|
24
|
+
},
|
|
25
|
+
layout: {
|
|
26
|
+
flex: 1,
|
|
27
|
+
justifyContent: "center",
|
|
28
|
+
},
|
|
29
|
+
safeAreaView: {
|
|
30
|
+
backgroundColor: colorBgPrimaryLight,
|
|
31
|
+
flex: 1,
|
|
32
|
+
},
|
|
33
|
+
scrollView: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
},
|
|
36
|
+
submit: {
|
|
37
|
+
backgroundColor: colorBgBase,
|
|
38
|
+
borderBottomLeftRadius: borderRadius5,
|
|
39
|
+
borderBottomRightRadius: borderRadius5,
|
|
40
|
+
padding: space6,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export { style };
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
4
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
4
|
import { Layout as UiLayout } from "@lookiero/sty-psp-ui";
|
|
6
5
|
import { CheckoutProjection } from "../../../../../../projection/checkout/checkout";
|
|
7
6
|
import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
8
|
-
interface ReturnQuestionsFormStyle {
|
|
9
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
10
|
-
}
|
|
11
7
|
interface ReturnQuestionsFormProps {
|
|
12
8
|
readonly checkout: CheckoutProjection;
|
|
13
9
|
readonly checkoutItem: CheckoutItemProjection;
|
|
14
10
|
readonly country: Country;
|
|
15
11
|
readonly layout: UiLayout;
|
|
16
12
|
readonly segment: Segment;
|
|
17
|
-
readonly style?: Partial<ReturnQuestionsFormStyle>;
|
|
18
13
|
}
|
|
19
14
|
declare const ReturnQuestionsForm: FC<ReturnQuestionsFormProps>;
|
|
20
15
|
export { ReturnQuestionsForm };
|
|
@@ -37,7 +37,7 @@ const returnQuestionItems = {
|
|
|
37
37
|
[ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
|
|
38
38
|
[ReturnQuestionType.OPTION]: RadioReturnQuestionItem,
|
|
39
39
|
};
|
|
40
|
-
const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout, segment,
|
|
40
|
+
const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout, segment, }) => {
|
|
41
41
|
const navigate = useNavigate();
|
|
42
42
|
const basePath = useBasePath();
|
|
43
43
|
const logger = useLogger();
|
|
@@ -94,20 +94,21 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
|
|
|
94
94
|
}
|
|
95
95
|
return (React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
96
96
|
React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
|
|
97
|
-
React.createElement(Layout, { header: header, scrollEnabled: false, style: {
|
|
97
|
+
React.createElement(Layout, { footer: null, header: header, scrollEnabled: false, style: {
|
|
98
98
|
safeAreaView: style.safeAreaView,
|
|
99
99
|
scrollView: style.scrollView,
|
|
100
100
|
header: style.header,
|
|
101
101
|
} },
|
|
102
102
|
React.createElement(ProductVariantPreview, { country: country, item: checkoutItem }),
|
|
103
103
|
React.createElement(ScrollView, { showsVerticalScrollIndicator: false, testID: "return-questions-form" },
|
|
104
|
-
React.createElement(
|
|
105
|
-
React.createElement(
|
|
106
|
-
React.createElement(
|
|
107
|
-
React.createElement(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
React.createElement(
|
|
104
|
+
React.createElement(View, { style: style.background },
|
|
105
|
+
React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [style.layout, screen.L ? style.desktopLayoutSpacing : undefined] },
|
|
106
|
+
React.createElement(Box, { size: { L: "2/3" } },
|
|
107
|
+
React.createElement(View, { style: [style.info, !screen.S && style.desktopInfo] },
|
|
108
|
+
React.createElement(Text, { level: 3, heading: true }, titleText),
|
|
109
|
+
React.createElement(Text, { level: 1, style: style.description, detail: true }, descriptionText)),
|
|
110
|
+
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
|
|
111
|
+
React.createElement(View, { style: [style.submit, !screen.S && style.submitDesktop] },
|
|
112
|
+
React.createElement(Button, { testID: "return-questions-button", onPress: handleOnSubmit }, submitButtonText)))))))));
|
|
112
113
|
};
|
|
113
114
|
export { ReturnQuestionsForm };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
declare const style: {
|
|
2
|
+
background: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
};
|
|
2
5
|
description: {
|
|
3
6
|
color: string;
|
|
4
7
|
};
|
|
@@ -27,7 +30,6 @@ declare const style: {
|
|
|
27
30
|
justifyContent: "center";
|
|
28
31
|
};
|
|
29
32
|
safeAreaView: {
|
|
30
|
-
backgroundColor: string;
|
|
31
33
|
flex: number;
|
|
32
34
|
};
|
|
33
35
|
scrollView: {
|
|
@@ -35,9 +37,11 @@ declare const style: {
|
|
|
35
37
|
};
|
|
36
38
|
submit: {
|
|
37
39
|
backgroundColor: string;
|
|
40
|
+
padding: number;
|
|
41
|
+
};
|
|
42
|
+
submitDesktop: {
|
|
38
43
|
borderBottomLeftRadius: number;
|
|
39
44
|
borderBottomRightRadius: number;
|
|
40
|
-
padding: number;
|
|
41
45
|
};
|
|
42
46
|
};
|
|
43
47
|
export { style };
|
|
@@ -3,6 +3,9 @@ import { theme } from "@lookiero/sty-psp-ui";
|
|
|
3
3
|
import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.style";
|
|
4
4
|
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
5
5
|
const style = StyleSheet.create({
|
|
6
|
+
background: {
|
|
7
|
+
backgroundColor: colorBgPrimaryLight,
|
|
8
|
+
},
|
|
6
9
|
description: {
|
|
7
10
|
color: colorTextMedium,
|
|
8
11
|
},
|
|
@@ -31,7 +34,6 @@ const style = StyleSheet.create({
|
|
|
31
34
|
justifyContent: "center",
|
|
32
35
|
},
|
|
33
36
|
safeAreaView: {
|
|
34
|
-
backgroundColor: colorBgPrimaryLight,
|
|
35
37
|
flex: 1,
|
|
36
38
|
},
|
|
37
39
|
scrollView: {
|
|
@@ -39,9 +41,11 @@ const style = StyleSheet.create({
|
|
|
39
41
|
},
|
|
40
42
|
submit: {
|
|
41
43
|
backgroundColor: colorBgBase,
|
|
44
|
+
padding: space6,
|
|
45
|
+
},
|
|
46
|
+
submitDesktop: {
|
|
42
47
|
borderBottomLeftRadius: borderRadius5,
|
|
43
48
|
borderBottomRightRadius: borderRadius5,
|
|
44
|
-
padding: space6,
|
|
45
49
|
},
|
|
46
50
|
});
|
|
47
51
|
export { style };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { LayoutRectangle } from "react-native";
|
|
3
|
+
import { PricingProjection } from "../../../../../../projection/pricing/pricing";
|
|
4
|
+
interface StickyPricingProps {
|
|
5
|
+
readonly pricing: PricingProjection;
|
|
6
|
+
readonly totalCheckoutItemsKept: number;
|
|
7
|
+
readonly collapsed: boolean;
|
|
8
|
+
readonly onPress: () => void;
|
|
9
|
+
readonly onSubmit: () => void;
|
|
10
|
+
readonly onLayout?: ({ width, height }: LayoutRectangle) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const StickyPricing: FC<StickyPricingProps>;
|
|
13
|
+
export { StickyPricing };
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
const StickyPricing = ({ pricing, totalCheckoutItemsKept, collapsed, onPress, onSubmit, onLayout, }) => (React.createElement(Sticky, { style: style.sticky, onLayout: onLayout },
|
|
7
|
+
React.createElement(Body, null,
|
|
8
|
+
React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: collapsed, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onPress: onPress, onSubmit: onSubmit }))));
|
|
9
|
+
export { StickyPricing };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
+
type IsCheckoutAccessibleByCustomerIdProjection = boolean;
|
|
3
|
+
declare const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
4
|
+
interface ViewIsCheckoutAccessibleByCustomerIdPayload {
|
|
5
|
+
readonly customerId: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
interface ViewIsCheckoutAccessibleByCustomerId extends Query<typeof VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID>, ViewIsCheckoutAccessibleByCustomerIdPayload {
|
|
8
|
+
}
|
|
9
|
+
interface ViewIsCheckoutAccessibleByCustomerIdFunction {
|
|
10
|
+
(payload: ViewIsCheckoutAccessibleByCustomerIdPayload): ViewIsCheckoutAccessibleByCustomerId;
|
|
11
|
+
}
|
|
12
|
+
declare const viewIsCheckoutAccessibleByCustomerId: ViewIsCheckoutAccessibleByCustomerIdFunction;
|
|
13
|
+
interface ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
14
|
+
}
|
|
15
|
+
declare const viewIsCheckoutAccessibleByCustomerIdHandler: QueryHandlerFunction<ViewIsCheckoutAccessibleByCustomerId, IsCheckoutAccessibleByCustomerIdProjection, ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs>;
|
|
16
|
+
export type { IsCheckoutAccessibleByCustomerIdProjection };
|
|
17
|
+
export { VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerId, viewIsCheckoutAccessibleByCustomerIdHandler, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { query } from "@lookiero/messaging";
|
|
2
|
+
import { viewFirstAvailableCheckoutByCustomerId } from "./viewFirstAvailableCheckoutByCustomerId";
|
|
3
|
+
import { viewIsCheckoutEnabledByCustomerId } from "./viewIsCheckoutEnabledByCustomerId";
|
|
4
|
+
const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
|
|
5
|
+
const viewIsCheckoutAccessibleByCustomerId = (payload) => ({
|
|
6
|
+
...query({ name: VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID }),
|
|
7
|
+
...payload,
|
|
8
|
+
});
|
|
9
|
+
const isNonEmptyCustomerId = (customerId) => Boolean(customerId);
|
|
10
|
+
const viewIsCheckoutAccessibleByCustomerIdHandler = ({ queryBus }) => async ({ customerId }) => isNonEmptyCustomerId(customerId) &&
|
|
11
|
+
Boolean(await queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId }))) &&
|
|
12
|
+
Boolean(await queryBus(viewIsCheckoutEnabledByCustomerId({ customerId })));
|
|
13
|
+
export { VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID, viewIsCheckoutAccessibleByCustomerId, viewIsCheckoutAccessibleByCustomerIdHandler, };
|
|
@@ -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,10 @@
|
|
|
1
|
+
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
2
|
+
interface PriceProjection {
|
|
3
|
+
readonly amount: number;
|
|
4
|
+
readonly currency: Currency;
|
|
5
|
+
readonly discountedPrice?: {
|
|
6
|
+
readonly amount: number;
|
|
7
|
+
readonly percentage: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export type { PriceProjection };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Country } from "./country";
|
|
2
|
+
interface SizeProjection {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly lookiero: string;
|
|
5
|
+
readonly uk: string;
|
|
6
|
+
readonly it: string;
|
|
7
|
+
readonly europe: string;
|
|
8
|
+
readonly unique: boolean;
|
|
9
|
+
readonly visualOrder?: number;
|
|
10
|
+
}
|
|
11
|
+
interface SizeFunctionArgs {
|
|
12
|
+
readonly size: SizeProjection;
|
|
13
|
+
readonly country: Country;
|
|
14
|
+
}
|
|
15
|
+
interface SizeFunction {
|
|
16
|
+
(args: SizeFunctionArgs): string;
|
|
17
|
+
}
|
|
18
|
+
declare const size: SizeFunction;
|
|
19
|
+
export type { SizeProjection };
|
|
20
|
+
export { size };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { StyleProp, TextStyle } from "react-native";
|
|
3
|
+
type ErrorStyle = StyleProp<TextStyle>;
|
|
4
|
+
interface ErrorProps {
|
|
5
|
+
readonly error?: string | null;
|
|
6
|
+
readonly style?: ErrorStyle;
|
|
7
|
+
}
|
|
8
|
+
declare const Error: FC<ErrorProps>;
|
|
9
|
+
export type { ErrorStyle };
|
|
10
|
+
export { Error };
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "8.14.0-beta.
|
|
1
|
+
export declare const VERSION = "8.14.0-beta.3";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "8.14.0-beta.
|
|
1
|
+
export const VERSION = "8.14.0-beta.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "8.14.0-beta.
|
|
3
|
+
"version": "8.14.0-beta.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@lookiero/sty-psp-i18n": "^0.2",
|
|
22
22
|
"@lookiero/sty-psp-locale": "^0.4",
|
|
23
23
|
"@lookiero/sty-psp-logging": "^0.3",
|
|
24
|
-
"@lookiero/sty-psp-notifications": "^0.5
|
|
24
|
+
"@lookiero/sty-psp-notifications": "^0.5",
|
|
25
25
|
"@lookiero/sty-psp-react-native": "^0.2",
|
|
26
26
|
"@lookiero/sty-psp-segment": "^0.1",
|
|
27
27
|
"@lookiero/sty-psp-storage": "^0.1",
|
|
@@ -6,12 +6,12 @@ import { I18n } from "@lookiero/i18n-react";
|
|
|
6
6
|
import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
|
|
7
7
|
import { Locale } from "@lookiero/sty-psp-locale";
|
|
8
8
|
import { SentryEnvironment, SentryLoggerFunctionArgs, sentryLogger, sentryLoggerHOC } from "@lookiero/sty-psp-logging";
|
|
9
|
-
import { Layout } from "@lookiero/sty-psp-ui";
|
|
9
|
+
import { EnvironmentStyle, EnvironmentStyleProvider, Layout } from "@lookiero/sty-psp-ui";
|
|
10
10
|
import { Customer } from "../../projection/customer/customer";
|
|
11
11
|
import { Order } from "../../projection/order/order";
|
|
12
12
|
import { Subscription } from "../../projection/subscription/subscription";
|
|
13
13
|
import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
|
|
14
|
-
import { Routing
|
|
14
|
+
import { Routing } from "./routing/Routing";
|
|
15
15
|
|
|
16
16
|
interface RootFunctionArgs {
|
|
17
17
|
readonly Messaging: MessagingRoot;
|
|
@@ -33,7 +33,7 @@ interface RootProps {
|
|
|
33
33
|
readonly order: Order | undefined;
|
|
34
34
|
readonly subscription: Subscription | undefined;
|
|
35
35
|
readonly layout: Layout;
|
|
36
|
-
readonly style?:
|
|
36
|
+
readonly style?: EnvironmentStyle;
|
|
37
37
|
readonly onNotAccessible: () => void;
|
|
38
38
|
readonly onCheckoutSubmitted?: () => void;
|
|
39
39
|
readonly useRedirect: () => Record<string, string>;
|
|
@@ -52,7 +52,7 @@ const root: RootFunction = ({ Messaging, I18n, getAuthToken, development, sentry
|
|
|
52
52
|
order,
|
|
53
53
|
subscription,
|
|
54
54
|
layout,
|
|
55
|
-
style
|
|
55
|
+
style,
|
|
56
56
|
onNotAccessible,
|
|
57
57
|
onCheckoutSubmitted,
|
|
58
58
|
useRedirect,
|
|
@@ -62,23 +62,24 @@ const root: RootFunction = ({ Messaging, I18n, getAuthToken, development, sentry
|
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
64
|
<Messaging includeReactQueryDevTools={Platform.OS === "web"}>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
65
|
+
<EnvironmentStyleProvider style={style}>
|
|
66
|
+
<Routing
|
|
67
|
+
I18n={I18n}
|
|
68
|
+
basePath={basePath}
|
|
69
|
+
customer={customer}
|
|
70
|
+
getAuthToken={getAuthToken}
|
|
71
|
+
kameleoon={kameleoon}
|
|
72
|
+
layout={layout}
|
|
73
|
+
locale={locale}
|
|
74
|
+
order={order}
|
|
75
|
+
subscription={subscription}
|
|
76
|
+
useRedirect={useRedirect}
|
|
77
|
+
useRoutes={useRoutes}
|
|
78
|
+
onCheckoutSubmitted={onCheckoutSubmitted}
|
|
79
|
+
onI18nError={development ? undefined : handleOnI18nError}
|
|
80
|
+
onNotAccessible={onNotAccessible}
|
|
81
|
+
/>
|
|
82
|
+
</EnvironmentStyleProvider>
|
|
82
83
|
</Messaging>
|
|
83
84
|
);
|
|
84
85
|
};
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
import React, { FC, memo } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
4
3
|
import { useReturnQuestionItem } from "./behaviors/useReturnQuestionItem";
|
|
5
4
|
|
|
6
|
-
interface ReturnQuestionStyle {
|
|
7
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
interface ReturnQuestionProps {
|
|
11
6
|
readonly returnQuestionParent: ReturnQuestionProjection;
|
|
12
7
|
readonly returnQuestion: ReturnQuestionProjection;
|
|
13
8
|
readonly portalHostName?: string;
|
|
14
|
-
readonly style?: Partial<ReturnQuestionStyle>;
|
|
15
9
|
}
|
|
16
10
|
|
|
17
|
-
const ReturnQuestion: FC<ReturnQuestionProps> = ({
|
|
18
|
-
returnQuestionParent,
|
|
19
|
-
returnQuestion,
|
|
20
|
-
portalHostName,
|
|
21
|
-
style: customStyle,
|
|
22
|
-
}) => {
|
|
11
|
+
const ReturnQuestion: FC<ReturnQuestionProps> = ({ returnQuestionParent, returnQuestion, portalHostName }) => {
|
|
23
12
|
const Item = useReturnQuestionItem({ type: returnQuestion.type });
|
|
24
13
|
|
|
25
14
|
return (
|
|
@@ -27,7 +16,6 @@ const ReturnQuestion: FC<ReturnQuestionProps> = ({
|
|
|
27
16
|
portalHostName={portalHostName}
|
|
28
17
|
returnQuestion={returnQuestion}
|
|
29
18
|
returnQuestionParent={returnQuestionParent}
|
|
30
|
-
style={customStyle}
|
|
31
19
|
testID={returnQuestion.id}
|
|
32
20
|
>
|
|
33
21
|
<>
|
|
@@ -37,7 +25,6 @@ const ReturnQuestion: FC<ReturnQuestionProps> = ({
|
|
|
37
25
|
portalHostName={portalHostName}
|
|
38
26
|
returnQuestion={childReturnQuestion}
|
|
39
27
|
returnQuestionParent={returnQuestion}
|
|
40
|
-
style={customStyle}
|
|
41
28
|
/>
|
|
42
29
|
))}
|
|
43
30
|
</>
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import React, { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
4
3
|
import ReturnQuestion from "./ReturnQuestion";
|
|
5
4
|
|
|
6
|
-
interface ReturnQuestionsStyle {
|
|
7
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
interface ReturnQuestionsProps {
|
|
11
6
|
readonly returnQuestions: ReturnQuestionProjection[];
|
|
12
7
|
readonly portalHostName?: string;
|
|
13
|
-
readonly style?: Partial<ReturnQuestionsStyle>;
|
|
14
8
|
}
|
|
15
9
|
|
|
16
|
-
const ReturnQuestions: FC<ReturnQuestionsProps> = ({ returnQuestions, portalHostName
|
|
10
|
+
const ReturnQuestions: FC<ReturnQuestionsProps> = ({ returnQuestions, portalHostName }) => (
|
|
17
11
|
<>
|
|
18
12
|
{returnQuestions.map((returnQuestion: ReturnQuestionProjection) => (
|
|
19
13
|
<ReturnQuestion
|
|
@@ -21,7 +15,6 @@ const ReturnQuestions: FC<ReturnQuestionsProps> = ({ returnQuestions, portalHost
|
|
|
21
15
|
portalHostName={portalHostName}
|
|
22
16
|
returnQuestion={returnQuestion}
|
|
23
17
|
returnQuestionParent={{} as ReturnQuestionProjection}
|
|
24
|
-
style={customStyle}
|
|
25
18
|
/>
|
|
26
19
|
))}
|
|
27
20
|
</>
|
package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { FC, ReactNode } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
3
|
|
|
5
|
-
interface ReturnQuestionItemStyle {
|
|
6
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
4
|
interface ReturnQuestionItemProps {
|
|
10
5
|
readonly returnQuestionParent: ReturnQuestionProjection;
|
|
11
6
|
readonly returnQuestion: ReturnQuestionProjection;
|
|
12
7
|
readonly children?: ReactNode;
|
|
13
8
|
readonly portalHostName?: string;
|
|
14
9
|
readonly testID?: string;
|
|
15
|
-
readonly style?: Partial<ReturnQuestionItemStyle>;
|
|
16
10
|
}
|
|
17
11
|
|
|
18
12
|
type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
|
|
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
|
2
2
|
import { TouchableHighlight, View } from "react-native";
|
|
3
3
|
import { ButtonIcon } from "@lookiero/aurora";
|
|
4
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
5
|
-
import { Modal } from "@lookiero/sty-psp-ui";
|
|
5
|
+
import { Modal, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
7
7
|
import {
|
|
8
8
|
useReturnQuestionFeedback,
|
|
@@ -20,8 +20,8 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
20
20
|
children,
|
|
21
21
|
portalHostName,
|
|
22
22
|
testID,
|
|
23
|
-
style: customStyle,
|
|
24
23
|
}: ReturnQuestionItemProps) => {
|
|
24
|
+
const { modal } = useEnvironmentStyle();
|
|
25
25
|
const { formatMessage } = useIntl();
|
|
26
26
|
const placeholderText = useMemo(
|
|
27
27
|
() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""),
|
|
@@ -91,7 +91,7 @@ const HostSelectReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
91
91
|
showCloseButton
|
|
92
92
|
onClose={handleOnModalClose}
|
|
93
93
|
>
|
|
94
|
-
<View style={[style.modal,
|
|
94
|
+
<View style={[style.modal, modal?.content]}>{children}</View>
|
|
95
95
|
</Modal>
|
|
96
96
|
</>
|
|
97
97
|
);
|
|
@@ -5,7 +5,6 @@ import { ReturnQuestionItem, ReturnQuestionItemProps } from "../../ReturnQuestio
|
|
|
5
5
|
const HostStackReturnQuestionItem: ReturnQuestionItem = ({
|
|
6
6
|
returnQuestion,
|
|
7
7
|
portalHostName,
|
|
8
|
-
style: customStyle,
|
|
9
8
|
}: ReturnQuestionItemProps) => (
|
|
10
9
|
<>
|
|
11
10
|
{returnQuestion.children?.map((childReturnQuestion) => (
|
|
@@ -14,7 +13,6 @@ const HostStackReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
14
13
|
portalHostName={portalHostName}
|
|
15
14
|
returnQuestion={childReturnQuestion}
|
|
16
15
|
returnQuestionParent={returnQuestion}
|
|
17
|
-
style={customStyle}
|
|
18
16
|
/>
|
|
19
17
|
))}
|
|
20
18
|
</>
|