@lookiero/checkout 0.1.1 → 0.2.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/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.d.ts +4 -4
- package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.js +3 -2
- package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +3 -2
- package/dist/domain/checkoutBooking/model/checkoutBooking.js +2 -1
- package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +4 -4
- package/dist/domain/checkoutBooking/model/checkoutBookingBooked.js +3 -2
- package/dist/domain/checkoutBooking/model/checkoutBookings.d.ts +3 -2
- package/dist/domain/uiSetting/command/updateUiSetting.d.ts +4 -4
- package/dist/domain/uiSetting/command/updateUiSetting.js +3 -2
- package/dist/domain/uiSetting/model/uiSetting.d.ts +3 -2
- package/dist/domain/uiSetting/model/uiSetting.js +2 -1
- package/dist/domain/uiSetting/model/uiSettingUpdated.d.ts +4 -4
- package/dist/domain/uiSetting/model/uiSettingUpdated.js +3 -2
- package/dist/domain/uiSetting/model/uiSettings.d.ts +3 -2
- package/dist/infrastructure/delivery/_mock/bootstrap.mock.js +2 -1
- package/dist/infrastructure/delivery/bootstrap.d.ts +2 -1
- package/dist/infrastructure/delivery/bootstrap.js +3 -2
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.d.ts +2 -2
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +2 -1
- package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +2 -2
- package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +2 -1
- package/dist/infrastructure/domain/react/useSetCheckoutIntroShown.d.ts +13 -0
- package/dist/infrastructure/domain/react/useSetCheckoutIntroShown.js +9 -0
- package/dist/infrastructure/domain/react/useUpdateUiSetting.d.ts +2 -2
- package/dist/infrastructure/domain/react/useUpdateUiSetting.js +2 -1
- package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.d.ts +3 -3
- package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.js +3 -2
- package/dist/infrastructure/persistence/asyncStorageStorage.d.ts +3 -2
- package/dist/infrastructure/persistence/asyncStorageStorage.js +3 -2
- package/dist/infrastructure/persistence/storage.d.ts +3 -2
- package/dist/infrastructure/persistence/uiSettingData.d.ts +2 -1
- package/dist/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.js +2 -1
- package/dist/infrastructure/projection/react/useViewCheckoutIntroShown.d.ts +2 -0
- package/dist/infrastructure/projection/react/useViewCheckoutIntroShown.js +6 -0
- package/dist/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.js +2 -1
- package/dist/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.js +2 -1
- package/dist/infrastructure/projection/react/useViewUiSettingByKey.d.ts +3 -3
- package/dist/infrastructure/projection/react/useViewUiSettingByKey.js +9 -5
- package/dist/infrastructure/projection/storageUiSettingByKeyView.d.ts +2 -2
- package/dist/infrastructure/projection/storageUiSettingByKeyView.js +2 -1
- package/dist/infrastructure/ui/Root.js +8 -10
- package/dist/infrastructure/ui/components/atoms/spinner/Spinner.js +9 -0
- package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +4 -4
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +13 -10
- package/dist/infrastructure/ui/routing/Routing.js +11 -14
- package/dist/infrastructure/ui/settings/UISettings.d.ts +4 -0
- package/dist/infrastructure/ui/settings/UISettings.js +5 -0
- package/dist/infrastructure/ui/views/intro/Intro.js +5 -7
- package/dist/infrastructure/ui/views/item/Item.js +6 -8
- package/dist/infrastructure/ui/views/summary/Summary.js +5 -7
- package/dist/projection/uiSetting/viewUiSettingByKey.d.ts +6 -6
- package/dist/projection/uiSetting/viewUiSettingByKey.js +4 -3
- package/package.json +6 -3
- package/.eslintignore +0 -7
- package/.eslintrc +0 -72
- package/.expo-shared/assets.json +0 -4
- package/.github/CODEOWNERS +0 -1
- package/.github/actions/version/action.yaml +0 -32
- package/.github/dependabot.yaml +0 -10
- package/.github/workflows/build.yaml +0 -71
- package/.github/workflows/publish.yaml +0 -52
- package/.husky/pre-commit +0 -4
- package/.husky/prepare-commit-msg +0 -26
- package/.husky/prepush +0 -12
- package/.lintstagedrc.json +0 -4
- package/.nvmrc +0 -1
- package/.prettierignore +0 -2
- package/.prettierrc.json +0 -6
- package/@types/aurora-next.d.ts +0 -1
- package/app.config.js +0 -4
- package/app.json +0 -31
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/babel.config.js +0 -6
- package/dist/infrastructure/projection/react/useViewIsCheckoutIntroVisible.d.ts +0 -3
- package/dist/infrastructure/projection/react/useViewIsCheckoutIntroVisible.js +0 -3
- package/dist/infrastructure/ui/components/atoms/spiner/Spinner.js +0 -11
- package/dist/infrastructure/ui/test/render.d.ts +0 -19
- package/dist/infrastructure/ui/test/render.js +0 -14
- package/jest.config.js +0 -9
- package/jest.setup.js +0 -3
- package/src/Expo.tsx +0 -59
- package/src/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -26
- package/src/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.ts +0 -27
- package/src/domain/checkoutBooking/model/checkoutBooking.test.ts +0 -30
- package/src/domain/checkoutBooking/model/checkoutBooking.ts +0 -31
- package/src/domain/checkoutBooking/model/checkoutBookingBooked.test.ts +0 -23
- package/src/domain/checkoutBooking/model/checkoutBookingBooked.ts +0 -23
- package/src/domain/checkoutBooking/model/checkoutBookings.ts +0 -6
- package/src/domain/uiSetting/command/updateUiSetting.test.ts +0 -19
- package/src/domain/uiSetting/command/updateUiSetting.ts +0 -23
- package/src/domain/uiSetting/model/uiSetting.test.ts +0 -26
- package/src/domain/uiSetting/model/uiSetting.ts +0 -22
- package/src/domain/uiSetting/model/uiSettingUpdated.test.ts +0 -17
- package/src/domain/uiSetting/model/uiSettingUpdated.ts +0 -19
- package/src/domain/uiSetting/model/uiSettings.ts +0 -6
- package/src/index.ts +0 -44
- package/src/infrastructure/delivery/_mock/bootstrap.mock.ts +0 -38
- package/src/infrastructure/delivery/_mock/checkout.mock.ts +0 -81
- package/src/infrastructure/delivery/bootstrap.ts +0 -42
- package/src/infrastructure/delivery/http/fetchHttpClient.test.ts +0 -51
- package/src/infrastructure/delivery/http/fetchHttpClient.ts +0 -41
- package/src/infrastructure/delivery/http/httpClient.ts +0 -18
- package/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.test.ts +0 -45
- package/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.ts +0 -32
- package/src/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -38
- package/src/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.ts +0 -44
- package/src/infrastructure/domain/react/useUpdateUiSetting.test.ts +0 -31
- package/src/infrastructure/domain/react/useUpdateUiSetting.ts +0 -43
- package/src/infrastructure/domain/uiSetting/model/storageUiSettings.test.ts +0 -50
- package/src/infrastructure/domain/uiSetting/model/storageUiSettings.ts +0 -50
- package/src/infrastructure/persistence/asyncStorageStorage.ts +0 -12
- package/src/infrastructure/persistence/storage.ts +0 -7
- package/src/infrastructure/persistence/uiSettingData.ts +0 -5
- package/src/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.test.ts +0 -65
- package/src/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.ts +0 -102
- package/src/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.test.ts +0 -99
- package/src/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.ts +0 -128
- package/src/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.test.ts +0 -32
- package/src/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.ts +0 -27
- package/src/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -51
- package/src/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.ts +0 -25
- package/src/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.test.ts +0 -28
- package/src/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.ts +0 -22
- package/src/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.test.ts +0 -44
- package/src/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.ts +0 -24
- package/src/infrastructure/projection/react/useViewIsCheckoutIntroVisible.ts +0 -5
- package/src/infrastructure/projection/react/useViewUiSettingByKey.test.ts +0 -30
- package/src/infrastructure/projection/react/useViewUiSettingByKey.ts +0 -18
- package/src/infrastructure/projection/storageUiSettingByKeyView.test.ts +0 -32
- package/src/infrastructure/projection/storageUiSettingByKeyView.ts +0 -35
- package/src/infrastructure/ui/Root.tsx +0 -53
- package/src/infrastructure/ui/components/atoms/spiner/Spinner.style.ts +0 -12
- package/src/infrastructure/ui/components/atoms/spiner/Spinner.tsx +0 -35
- package/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.test.tsx +0 -70
- package/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.tsx +0 -31
- package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +0 -100
- package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +0 -52
- package/src/infrastructure/ui/routing/Routing.tsx +0 -64
- package/src/infrastructure/ui/routing/router/Router.native.ts +0 -1
- package/src/infrastructure/ui/routing/router/Router.ts +0 -1
- package/src/infrastructure/ui/routing/routes.ts +0 -6
- package/src/infrastructure/ui/test/render.tsx +0 -47
- package/src/infrastructure/ui/views/intro/Intro.test.tsx +0 -15
- package/src/infrastructure/ui/views/intro/Intro.tsx +0 -27
- package/src/infrastructure/ui/views/item/Item.tsx +0 -31
- package/src/infrastructure/ui/views/summary/Summary.tsx +0 -27
- package/src/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -40
- package/src/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.ts +0 -85
- package/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.test.ts +0 -22
- package/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.ts +0 -149
- package/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.test.ts +0 -54
- package/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.ts +0 -46
- package/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.test.ts +0 -20
- package/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.ts +0 -51
- package/src/projection/uiSetting/viewUiSettingByKey.test.ts +0 -22
- package/src/projection/uiSetting/viewUiSettingByKey.ts +0 -47
- package/tsconfig.build.json +0 -16
- package/tsconfig.json +0 -19
- package/webpack.config.js +0 -17
- /package/dist/infrastructure/ui/components/atoms/{spiner → spinner}/Spinner.d.ts +0 -0
- /package/dist/infrastructure/ui/components/atoms/{spiner → spinner}/Spinner.style.d.ts +0 -0
- /package/dist/infrastructure/ui/components/atoms/{spiner → spinner}/Spinner.style.js +0 -0
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { generatePath, Navigate, Outlet, useMatch } from "react-router";
|
|
3
4
|
import { CheckoutItemStatus, } from "../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
5
|
+
import { useViewCheckoutIntroShown } from "../../projection/react/useViewCheckoutIntroShown";
|
|
4
6
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
5
|
-
import {
|
|
6
|
-
import { Spinner } from "../components/atoms/spiner/Spinner";
|
|
7
|
+
import { Spinner } from "../components/atoms/spinner/Spinner";
|
|
7
8
|
import { Routes } from "./routes";
|
|
8
|
-
const CheckoutMiddleware = ({ customerId, loader =
|
|
9
|
-
const [
|
|
9
|
+
const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner, null) }) => {
|
|
10
|
+
const [checkoutIntroShown, checkoutIntroShownStatus] = useViewCheckoutIntroShown();
|
|
10
11
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
11
12
|
const firstItemWithoutCustomerDecision = checkout?.items.find((item) => [CheckoutItemStatus.EXPIRED, CheckoutItemStatus.INITIAL].includes(item.status));
|
|
12
13
|
const isIntroRoute = useMatch(Routes.INTRO);
|
|
13
14
|
const isItemRoute = useMatch(Routes.ITEM);
|
|
14
15
|
const isSummaryRoute = useMatch(Routes.SUMMARY);
|
|
15
|
-
const
|
|
16
|
+
const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
|
|
17
|
+
const dependenciesLoaded = dependenciesLoadedStatuses.includes(checkoutIntroShownStatus) &&
|
|
18
|
+
dependenciesLoadedStatuses.includes(checkoutStatus);
|
|
16
19
|
if (!dependenciesLoaded) {
|
|
17
20
|
return loader;
|
|
18
21
|
}
|
|
19
|
-
if (
|
|
22
|
+
if (!checkoutIntroShown) {
|
|
20
23
|
if (!isIntroRoute) {
|
|
21
|
-
return
|
|
24
|
+
return React.createElement(Navigate, { replace: true, to: Routes.INTRO });
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
else {
|
|
25
28
|
if (firstItemWithoutCustomerDecision && !isItemRoute) {
|
|
26
|
-
return
|
|
29
|
+
return React.createElement(Navigate, { replace: true, to: generatePath(Routes.ITEM, { id: firstItemWithoutCustomerDecision.id }) });
|
|
27
30
|
}
|
|
28
31
|
if (firstItemWithoutCustomerDecision === undefined && !isSummaryRoute) {
|
|
29
|
-
return
|
|
32
|
+
return React.createElement(Navigate, { replace: true, to: Routes.SUMMARY });
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
|
-
return
|
|
35
|
+
return React.createElement(Outlet, null);
|
|
33
36
|
};
|
|
34
37
|
export { CheckoutMiddleware };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { lazy, Suspense } from "react";
|
|
1
|
+
import React, { lazy, Suspense } from "react";
|
|
2
2
|
import { Navigate, useRoutes } from "react-router-native";
|
|
3
|
-
import { Spinner } from "../components/atoms/
|
|
3
|
+
import { Spinner } from "../components/atoms/spinner/Spinner";
|
|
4
4
|
import { CheckoutAccessibilityMiddleware } from "./CheckoutAccessibilityMiddleware";
|
|
5
5
|
import { CheckoutMiddleware } from "./CheckoutMiddleware";
|
|
6
6
|
import { Routes } from "./routes";
|
|
@@ -11,29 +11,26 @@ const Routing = ({ customerId, onNotAccessible }) => {
|
|
|
11
11
|
const routes = useRoutes([
|
|
12
12
|
{
|
|
13
13
|
path: Routes.CHECKOUT,
|
|
14
|
-
element:
|
|
14
|
+
element: React.createElement(CheckoutAccessibilityMiddleware, { customerId: customerId, onNotAccessible: onNotAccessible }),
|
|
15
15
|
children: [
|
|
16
16
|
{
|
|
17
17
|
path: Routes.CHECKOUT,
|
|
18
|
-
element:
|
|
18
|
+
element: React.createElement(CheckoutMiddleware, { customerId: customerId }),
|
|
19
19
|
children: [
|
|
20
20
|
{
|
|
21
21
|
path: Routes.INTRO,
|
|
22
|
-
element: (
|
|
23
|
-
|
|
24
|
-
</Suspense>),
|
|
22
|
+
element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
|
|
23
|
+
React.createElement(Intro, null))),
|
|
25
24
|
},
|
|
26
25
|
{
|
|
27
26
|
path: Routes.ITEM,
|
|
28
|
-
element: (
|
|
29
|
-
|
|
30
|
-
</Suspense>),
|
|
27
|
+
element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
|
|
28
|
+
React.createElement(Item, null))),
|
|
31
29
|
},
|
|
32
30
|
{
|
|
33
31
|
path: Routes.SUMMARY,
|
|
34
|
-
element: (
|
|
35
|
-
|
|
36
|
-
</Suspense>),
|
|
32
|
+
element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
|
|
33
|
+
React.createElement(Summary, null))),
|
|
37
34
|
},
|
|
38
35
|
],
|
|
39
36
|
},
|
|
@@ -41,7 +38,7 @@ const Routing = ({ customerId, onNotAccessible }) => {
|
|
|
41
38
|
},
|
|
42
39
|
{
|
|
43
40
|
path: "*",
|
|
44
|
-
element:
|
|
41
|
+
element: React.createElement(Navigate, { replace: true, to: Routes.CHECKOUT }),
|
|
45
42
|
},
|
|
46
43
|
]);
|
|
47
44
|
return routes;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
|
-
import {
|
|
2
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import { StyleSheet, View } from "react-native";
|
|
4
5
|
const Intro = () => {
|
|
5
|
-
const introText =
|
|
6
|
-
return (
|
|
7
|
-
|
|
8
|
-
{introText}
|
|
9
|
-
</Text>
|
|
10
|
-
</View>);
|
|
6
|
+
const introText = useI18nMessage({ id: "intro" });
|
|
7
|
+
return (React.createElement(View, { style: styles.container },
|
|
8
|
+
React.createElement(Text, { heading: true, level: 3 }, introText)));
|
|
11
9
|
};
|
|
12
10
|
const styles = StyleSheet.create({
|
|
13
11
|
container: {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
|
-
import {
|
|
2
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import { StyleSheet, View } from "react-native";
|
|
4
5
|
import { useParams } from "react-router-native";
|
|
5
6
|
const Item = () => {
|
|
6
7
|
const { id } = useParams();
|
|
7
|
-
const itemText =
|
|
8
|
-
return (
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
</Text>
|
|
12
|
-
<Text level={2}>{id}</Text>
|
|
13
|
-
</View>);
|
|
8
|
+
const itemText = useI18nMessage({ id: "item" });
|
|
9
|
+
return (React.createElement(View, { style: styles.container },
|
|
10
|
+
React.createElement(Text, { heading: true, level: 3 }, itemText),
|
|
11
|
+
React.createElement(Text, { level: 2 }, id)));
|
|
14
12
|
};
|
|
15
13
|
const styles = StyleSheet.create({
|
|
16
14
|
container: {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
|
|
2
|
-
import {
|
|
2
|
+
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import { StyleSheet, View } from "react-native";
|
|
4
5
|
const Summary = () => {
|
|
5
|
-
const summaryText =
|
|
6
|
-
return (
|
|
7
|
-
|
|
8
|
-
{summaryText}
|
|
9
|
-
</Text>
|
|
10
|
-
</View>);
|
|
6
|
+
const summaryText = useI18nMessage({ id: "summary" });
|
|
7
|
+
return (React.createElement(View, { style: styles.container },
|
|
8
|
+
React.createElement(Text, { heading: true, level: 3 }, summaryText)));
|
|
11
9
|
};
|
|
12
10
|
const styles = StyleSheet.create({
|
|
13
11
|
container: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
|
|
2
|
-
|
|
2
|
+
interface UiSettingProjection {
|
|
3
3
|
readonly id: string;
|
|
4
4
|
readonly key: string;
|
|
5
5
|
readonly value: unknown;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
declare const VIEW_UI_SETTING_BY_KEY = "view_ui_setting_by_key";
|
|
8
8
|
interface ViewUiSettingByKeyPayload {
|
|
9
9
|
readonly key: string;
|
|
10
10
|
}
|
|
@@ -13,16 +13,16 @@ interface ViewUiSettingByKey extends Query<typeof VIEW_UI_SETTING_BY_KEY>, ViewU
|
|
|
13
13
|
interface ViewUiSettingByKeyFunction {
|
|
14
14
|
(payload: ViewUiSettingByKeyPayload): ViewUiSettingByKey;
|
|
15
15
|
}
|
|
16
|
+
declare const viewUiSettingByKey: ViewUiSettingByKeyFunction;
|
|
16
17
|
declare type ViewUiSettingByKeyResult = UiSettingProjection | undefined;
|
|
17
18
|
interface UiSettingByKeyViewArgs {
|
|
18
19
|
readonly key: string;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
interface UiSettingByKeyView {
|
|
21
22
|
(args: UiSettingByKeyViewArgs): Promise<ViewUiSettingByKeyResult>;
|
|
22
23
|
}
|
|
23
24
|
interface ViewUiSettingByKeyHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
24
25
|
readonly view: UiSettingByKeyView;
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
export
|
|
28
|
-
export {};
|
|
27
|
+
declare const viewUiSettingByKeyHandler: QueryHandlerFunction<ViewUiSettingByKey, ViewUiSettingByKeyResult, ViewUiSettingByKeyHandlerFunctionArgs>;
|
|
28
|
+
export { UiSettingProjection, VIEW_UI_SETTING_BY_KEY, UiSettingByKeyView, viewUiSettingByKey, viewUiSettingByKeyHandler, };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { query } from "@lookiero/messaging";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const VIEW_UI_SETTING_BY_KEY = "view_ui_setting_by_key";
|
|
3
|
+
const viewUiSettingByKey = (payload) => ({
|
|
4
4
|
...query({ name: VIEW_UI_SETTING_BY_KEY }),
|
|
5
5
|
...payload,
|
|
6
6
|
});
|
|
7
|
-
|
|
7
|
+
const viewUiSettingByKeyHandler = ({ view }) => async ({ key }) => view({ key });
|
|
8
|
+
export { VIEW_UI_SETTING_BY_KEY, viewUiSettingByKey, viewUiSettingByKeyHandler, };
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
6
9
|
"engines": {
|
|
7
10
|
"node": ">=14.19.3"
|
|
8
11
|
},
|
|
@@ -19,8 +22,8 @@
|
|
|
19
22
|
"publish": "npm publish"
|
|
20
23
|
},
|
|
21
24
|
"dependencies": {
|
|
22
|
-
"@lookiero/i18n": "^0.
|
|
23
|
-
"@lookiero/i18n-react": "^0.
|
|
25
|
+
"@lookiero/i18n": "^0.7.0",
|
|
26
|
+
"@lookiero/i18n-react": "^0.7.0",
|
|
24
27
|
"@lookiero/messaging": "^6.2.1",
|
|
25
28
|
"@lookiero/messaging-react": "^6.2.1",
|
|
26
29
|
"react-router-dom": "^6.3.0",
|
package/.eslintignore
DELETED
package/.eslintrc
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"plugins": ["@typescript-eslint"],
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts", "*.tsx"],
|
|
7
|
-
"extends": [
|
|
8
|
-
"plugin:prettier/recommended",
|
|
9
|
-
"plugin:@typescript-eslint/recommended",
|
|
10
|
-
"plugin:react/recommended",
|
|
11
|
-
"plugin:react-hooks/recommended",
|
|
12
|
-
"plugin:react/jsx-runtime"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"settings": {
|
|
17
|
-
"react": {
|
|
18
|
-
"version": "detect"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"rules": {
|
|
22
|
-
"no-console": "off",
|
|
23
|
-
"no-var": "error",
|
|
24
|
-
"@typescript-eslint/no-unused-vars": "error",
|
|
25
|
-
"@typescript-eslint/no-explicit-any": "error",
|
|
26
|
-
"@typescript-eslint/no-empty-interface": [
|
|
27
|
-
"error",
|
|
28
|
-
{
|
|
29
|
-
"allowSingleExtends": true
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"@typescript-eslint/naming-convention": [
|
|
33
|
-
"error",
|
|
34
|
-
{
|
|
35
|
-
"selector": "default",
|
|
36
|
-
"format": ["camelCase"]
|
|
37
|
-
},
|
|
38
|
-
// PascalCase for Classes, Interfaces, Types, ...
|
|
39
|
-
{
|
|
40
|
-
"selector": "typeLike",
|
|
41
|
-
"format": ["PascalCase"]
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"selector": "enumMember",
|
|
45
|
-
"format": ["UPPER_CASE"]
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"selector": "variable",
|
|
49
|
-
"format": ["camelCase", "UPPER_CASE", "PascalCase"]
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"selector": "parameter",
|
|
53
|
-
"format": ["camelCase", "PascalCase"]
|
|
54
|
-
},
|
|
55
|
-
// camelCase | snake_case | PascalCase for regular properties
|
|
56
|
-
{
|
|
57
|
-
"selector": "property",
|
|
58
|
-
"format": ["camelCase", "snake_case", "PascalCase"]
|
|
59
|
-
},
|
|
60
|
-
// properties with single or double leading-underscores will be camelCase (__html, _id, ...)
|
|
61
|
-
{
|
|
62
|
-
"selector": "property",
|
|
63
|
-
"format": ["camelCase"],
|
|
64
|
-
"prefix": ["__", "_"],
|
|
65
|
-
"filter": {
|
|
66
|
-
"regex": "^_+",
|
|
67
|
-
"match": true
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
}
|
package/.expo-shared/assets.json
DELETED
package/.github/CODEOWNERS
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
* @lookiero/squad-box
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: "Version Check"
|
|
2
|
-
|
|
3
|
-
inputs:
|
|
4
|
-
github-token:
|
|
5
|
-
required: true
|
|
6
|
-
|
|
7
|
-
outputs:
|
|
8
|
-
version:
|
|
9
|
-
description: "Defined version"
|
|
10
|
-
value: ${{ steps.set-version.outputs.version }}
|
|
11
|
-
is-publishable:
|
|
12
|
-
description: "Boolean determines when the new version is publishable or not"
|
|
13
|
-
value: ${{ steps.set-is-publishable.outputs.is-publishable }}
|
|
14
|
-
|
|
15
|
-
runs:
|
|
16
|
-
using: "composite"
|
|
17
|
-
steps:
|
|
18
|
-
- name: Check if checkout-front version has been updated
|
|
19
|
-
id: checkout-front-version-check
|
|
20
|
-
uses: EndBug/version-check@v1
|
|
21
|
-
with:
|
|
22
|
-
diff-search: true
|
|
23
|
-
file-name: package.json
|
|
24
|
-
token: ${{ inputs.github-token }}
|
|
25
|
-
|
|
26
|
-
- id: set-is-publishable
|
|
27
|
-
shell: bash
|
|
28
|
-
run: echo "::set-output name=is-publishable::${{ steps.checkout-front-version-check.outputs.changed == 'true' }}"
|
|
29
|
-
|
|
30
|
-
- id: set-version
|
|
31
|
-
shell: bash
|
|
32
|
-
run: echo "::set-output name=version::v${{ steps.checkout-front-version-check.outputs.version }}"
|
package/.github/dependabot.yaml
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
name: 🌀
|
|
2
|
-
|
|
3
|
-
on: [pull_request]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
lint:
|
|
7
|
-
name: 🛁 Linting
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
steps:
|
|
10
|
-
- name: 🛑 Cancel Previous Runs
|
|
11
|
-
uses: styfle/cancel-workflow-action@0.9.1
|
|
12
|
-
|
|
13
|
-
- name: ⬇️ Checkout repo
|
|
14
|
-
uses: actions/checkout@v3
|
|
15
|
-
|
|
16
|
-
- name: ⎔ Setup node 14.19.3
|
|
17
|
-
uses: actions/setup-node@v3
|
|
18
|
-
with:
|
|
19
|
-
node-version: 14.19.3
|
|
20
|
-
|
|
21
|
-
- name: 📥 Download deps
|
|
22
|
-
shell: bash
|
|
23
|
-
run: npm install -g npm && npm ci --legacy-peer-deps
|
|
24
|
-
env:
|
|
25
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
26
|
-
|
|
27
|
-
- name: ⬣ ESLint
|
|
28
|
-
run: node_modules/.bin/eslint --max-warnings 0 --ext ts,tsx .
|
|
29
|
-
env:
|
|
30
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
31
|
-
|
|
32
|
-
- name: ʦ Prettier
|
|
33
|
-
run: node_modules/.bin/prettier --check "**/*.+(json|css|ts|tsx|md)"
|
|
34
|
-
env:
|
|
35
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
36
|
-
|
|
37
|
-
jest:
|
|
38
|
-
name: ⚡ Jest
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
strategy:
|
|
41
|
-
matrix:
|
|
42
|
-
node-version: [14.19.3, 16.x, 18.x, latest]
|
|
43
|
-
steps:
|
|
44
|
-
- name: 🛑 Cancel Previous Runs
|
|
45
|
-
uses: styfle/cancel-workflow-action@0.9.1
|
|
46
|
-
|
|
47
|
-
- name: ⬇️ Checkout repo
|
|
48
|
-
uses: actions/checkout@v3
|
|
49
|
-
|
|
50
|
-
- name: ⎔ Setup node ${{ matrix.node-version }}
|
|
51
|
-
uses: actions/setup-node@v3
|
|
52
|
-
with:
|
|
53
|
-
node-version: ${{ matrix.node-version }}
|
|
54
|
-
|
|
55
|
-
- name: 📥 Download deps
|
|
56
|
-
shell: bash
|
|
57
|
-
run: npm install -g npm && npm ci --legacy-peer-deps
|
|
58
|
-
env:
|
|
59
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
60
|
-
|
|
61
|
-
- name: ⚙️ Build
|
|
62
|
-
run: npm run build
|
|
63
|
-
env:
|
|
64
|
-
node-version: ${{ matrix.node-version }}
|
|
65
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
66
|
-
|
|
67
|
-
- name: ⚡ Jest
|
|
68
|
-
run: npm run test
|
|
69
|
-
env:
|
|
70
|
-
node-version: ${{ matrix.node-version }}
|
|
71
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
name: 📰
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
name: 🚀 Publish
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: 🛑 Cancel Previous Runs
|
|
14
|
-
uses: styfle/cancel-workflow-action@0.9.1
|
|
15
|
-
|
|
16
|
-
- name: ⬇️ Checkout repo
|
|
17
|
-
uses: actions/checkout@v3
|
|
18
|
-
|
|
19
|
-
- name: ⎔ Setup node 14.19.3
|
|
20
|
-
uses: actions/setup-node@v3
|
|
21
|
-
with:
|
|
22
|
-
node-version: 14.19.3
|
|
23
|
-
|
|
24
|
-
- name: 📥 Download deps
|
|
25
|
-
shell: bash
|
|
26
|
-
run: npm install -g npm && npm ci --legacy-peer-deps
|
|
27
|
-
env:
|
|
28
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
29
|
-
|
|
30
|
-
- name: ⚙️ Build
|
|
31
|
-
run: npm run build
|
|
32
|
-
env:
|
|
33
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
34
|
-
|
|
35
|
-
- name: 📝 Check Version
|
|
36
|
-
id: check-version
|
|
37
|
-
uses: ./.github/actions/version
|
|
38
|
-
with:
|
|
39
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
-
|
|
41
|
-
- name: 🐙 Publish Github release
|
|
42
|
-
if: steps.check-version.outputs.is-publishable == 'true'
|
|
43
|
-
uses: ncipollo/release-action@v1
|
|
44
|
-
with:
|
|
45
|
-
tag: ${{ steps.check-version.outputs.version }}
|
|
46
|
-
name: ${{ steps.check-version.outputs.version }}
|
|
47
|
-
|
|
48
|
-
- name: 🎉 Publish packages in NPM
|
|
49
|
-
if: steps.check-version.outputs.is-publishable == 'true'
|
|
50
|
-
run: npm run publish
|
|
51
|
-
env:
|
|
52
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.husky/pre-commit
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
#
|
|
3
|
-
# Automatically add branch name and branch description to every commit message except merge commit.
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
COMMIT_EDITMSG=$1
|
|
7
|
-
|
|
8
|
-
addBranchName() {
|
|
9
|
-
NAME=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
10
|
-
DESCRIPTION=$(git config branch."$NAME".description)
|
|
11
|
-
if [ ! -z "$NAME" ] && [ "$NAME" != "HEAD" ] ; then
|
|
12
|
-
echo "[$NAME]: $(cat $COMMIT_EDITMSG)" > $COMMIT_EDITMSG
|
|
13
|
-
if [ -n "$DESCRIPTION" ]
|
|
14
|
-
then
|
|
15
|
-
echo "" >> $COMMIT_EDITMSG
|
|
16
|
-
echo $DESCRIPTION >> $COMMIT_EDITMSG
|
|
17
|
-
fi
|
|
18
|
-
fi
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
IS_AMEND=$(ps -ocommand= -p $PPID | grep -e '--amend');
|
|
22
|
-
MERGE=$(cat $COMMIT_EDITMSG|grep -i 'merge'|wc -l)
|
|
23
|
-
|
|
24
|
-
if ! [ -n "$IS_AMEND" ] && [ $MERGE -eq 0 ] ; then
|
|
25
|
-
addBranchName
|
|
26
|
-
fi
|
package/.husky/prepush
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
protected_branch='master'
|
|
4
|
-
current_branch=$(git rev-parse --abbrev-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
|
5
|
-
|
|
6
|
-
if [ $protected_branch = $current_branch ]
|
|
7
|
-
then
|
|
8
|
-
echo "Push master is not allowed"
|
|
9
|
-
exit 1 # push will not execute
|
|
10
|
-
else
|
|
11
|
-
exit 0 # push will execute
|
|
12
|
-
fi
|
package/.lintstagedrc.json
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v14.19.3
|
package/.prettierignore
DELETED
package/.prettierrc.json
DELETED
package/@types/aurora-next.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module "@lookiero/aurora-next";
|
package/app.config.js
DELETED
package/app.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"expo": {
|
|
3
|
-
"name": "checkout-front",
|
|
4
|
-
"slug": "checkout-front",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"orientation": "portrait",
|
|
7
|
-
"icon": "./assets/icon.png",
|
|
8
|
-
"userInterfaceStyle": "light",
|
|
9
|
-
"splash": {
|
|
10
|
-
"image": "./assets/splash.png",
|
|
11
|
-
"resizeMode": "contain",
|
|
12
|
-
"backgroundColor": "#ffffff"
|
|
13
|
-
},
|
|
14
|
-
"updates": {
|
|
15
|
-
"fallbackToCacheTimeout": 0
|
|
16
|
-
},
|
|
17
|
-
"assetBundlePatterns": ["**/*"],
|
|
18
|
-
"ios": {
|
|
19
|
-
"supportsTablet": true
|
|
20
|
-
},
|
|
21
|
-
"android": {
|
|
22
|
-
"adaptiveIcon": {
|
|
23
|
-
"foregroundImage": "./assets/adaptive-icon.png",
|
|
24
|
-
"backgroundColor": "#FFFFFF"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"web": {
|
|
28
|
-
"favicon": "./assets/favicon.png"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
package/assets/adaptive-icon.png
DELETED
|
Binary file
|
package/assets/favicon.png
DELETED
|
Binary file
|
package/assets/icon.png
DELETED
|
Binary file
|
package/assets/splash.png
DELETED
|
Binary file
|
package/babel.config.js
DELETED