@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.
Files changed (165) hide show
  1. package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.d.ts +4 -4
  2. package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.js +3 -2
  3. package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +3 -2
  4. package/dist/domain/checkoutBooking/model/checkoutBooking.js +2 -1
  5. package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +4 -4
  6. package/dist/domain/checkoutBooking/model/checkoutBookingBooked.js +3 -2
  7. package/dist/domain/checkoutBooking/model/checkoutBookings.d.ts +3 -2
  8. package/dist/domain/uiSetting/command/updateUiSetting.d.ts +4 -4
  9. package/dist/domain/uiSetting/command/updateUiSetting.js +3 -2
  10. package/dist/domain/uiSetting/model/uiSetting.d.ts +3 -2
  11. package/dist/domain/uiSetting/model/uiSetting.js +2 -1
  12. package/dist/domain/uiSetting/model/uiSettingUpdated.d.ts +4 -4
  13. package/dist/domain/uiSetting/model/uiSettingUpdated.js +3 -2
  14. package/dist/domain/uiSetting/model/uiSettings.d.ts +3 -2
  15. package/dist/infrastructure/delivery/_mock/bootstrap.mock.js +2 -1
  16. package/dist/infrastructure/delivery/bootstrap.d.ts +2 -1
  17. package/dist/infrastructure/delivery/bootstrap.js +3 -2
  18. package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.d.ts +2 -2
  19. package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +2 -1
  20. package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +2 -2
  21. package/dist/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +2 -1
  22. package/dist/infrastructure/domain/react/useSetCheckoutIntroShown.d.ts +13 -0
  23. package/dist/infrastructure/domain/react/useSetCheckoutIntroShown.js +9 -0
  24. package/dist/infrastructure/domain/react/useUpdateUiSetting.d.ts +2 -2
  25. package/dist/infrastructure/domain/react/useUpdateUiSetting.js +2 -1
  26. package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.d.ts +3 -3
  27. package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.js +3 -2
  28. package/dist/infrastructure/persistence/asyncStorageStorage.d.ts +3 -2
  29. package/dist/infrastructure/persistence/asyncStorageStorage.js +3 -2
  30. package/dist/infrastructure/persistence/storage.d.ts +3 -2
  31. package/dist/infrastructure/persistence/uiSettingData.d.ts +2 -1
  32. package/dist/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.js +2 -1
  33. package/dist/infrastructure/projection/react/useViewCheckoutIntroShown.d.ts +2 -0
  34. package/dist/infrastructure/projection/react/useViewCheckoutIntroShown.js +6 -0
  35. package/dist/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.js +2 -1
  36. package/dist/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.js +2 -1
  37. package/dist/infrastructure/projection/react/useViewUiSettingByKey.d.ts +3 -3
  38. package/dist/infrastructure/projection/react/useViewUiSettingByKey.js +9 -5
  39. package/dist/infrastructure/projection/storageUiSettingByKeyView.d.ts +2 -2
  40. package/dist/infrastructure/projection/storageUiSettingByKeyView.js +2 -1
  41. package/dist/infrastructure/ui/Root.js +8 -10
  42. package/dist/infrastructure/ui/components/atoms/spinner/Spinner.js +9 -0
  43. package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +4 -4
  44. package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +13 -10
  45. package/dist/infrastructure/ui/routing/Routing.js +11 -14
  46. package/dist/infrastructure/ui/settings/UISettings.d.ts +4 -0
  47. package/dist/infrastructure/ui/settings/UISettings.js +5 -0
  48. package/dist/infrastructure/ui/views/intro/Intro.js +5 -7
  49. package/dist/infrastructure/ui/views/item/Item.js +6 -8
  50. package/dist/infrastructure/ui/views/summary/Summary.js +5 -7
  51. package/dist/projection/uiSetting/viewUiSettingByKey.d.ts +6 -6
  52. package/dist/projection/uiSetting/viewUiSettingByKey.js +4 -3
  53. package/package.json +6 -3
  54. package/.eslintignore +0 -7
  55. package/.eslintrc +0 -72
  56. package/.expo-shared/assets.json +0 -4
  57. package/.github/CODEOWNERS +0 -1
  58. package/.github/actions/version/action.yaml +0 -32
  59. package/.github/dependabot.yaml +0 -10
  60. package/.github/workflows/build.yaml +0 -71
  61. package/.github/workflows/publish.yaml +0 -52
  62. package/.husky/pre-commit +0 -4
  63. package/.husky/prepare-commit-msg +0 -26
  64. package/.husky/prepush +0 -12
  65. package/.lintstagedrc.json +0 -4
  66. package/.nvmrc +0 -1
  67. package/.prettierignore +0 -2
  68. package/.prettierrc.json +0 -6
  69. package/@types/aurora-next.d.ts +0 -1
  70. package/app.config.js +0 -4
  71. package/app.json +0 -31
  72. package/assets/adaptive-icon.png +0 -0
  73. package/assets/favicon.png +0 -0
  74. package/assets/icon.png +0 -0
  75. package/assets/splash.png +0 -0
  76. package/babel.config.js +0 -6
  77. package/dist/infrastructure/projection/react/useViewIsCheckoutIntroVisible.d.ts +0 -3
  78. package/dist/infrastructure/projection/react/useViewIsCheckoutIntroVisible.js +0 -3
  79. package/dist/infrastructure/ui/components/atoms/spiner/Spinner.js +0 -11
  80. package/dist/infrastructure/ui/test/render.d.ts +0 -19
  81. package/dist/infrastructure/ui/test/render.js +0 -14
  82. package/jest.config.js +0 -9
  83. package/jest.setup.js +0 -3
  84. package/src/Expo.tsx +0 -59
  85. package/src/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -26
  86. package/src/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.ts +0 -27
  87. package/src/domain/checkoutBooking/model/checkoutBooking.test.ts +0 -30
  88. package/src/domain/checkoutBooking/model/checkoutBooking.ts +0 -31
  89. package/src/domain/checkoutBooking/model/checkoutBookingBooked.test.ts +0 -23
  90. package/src/domain/checkoutBooking/model/checkoutBookingBooked.ts +0 -23
  91. package/src/domain/checkoutBooking/model/checkoutBookings.ts +0 -6
  92. package/src/domain/uiSetting/command/updateUiSetting.test.ts +0 -19
  93. package/src/domain/uiSetting/command/updateUiSetting.ts +0 -23
  94. package/src/domain/uiSetting/model/uiSetting.test.ts +0 -26
  95. package/src/domain/uiSetting/model/uiSetting.ts +0 -22
  96. package/src/domain/uiSetting/model/uiSettingUpdated.test.ts +0 -17
  97. package/src/domain/uiSetting/model/uiSettingUpdated.ts +0 -19
  98. package/src/domain/uiSetting/model/uiSettings.ts +0 -6
  99. package/src/index.ts +0 -44
  100. package/src/infrastructure/delivery/_mock/bootstrap.mock.ts +0 -38
  101. package/src/infrastructure/delivery/_mock/checkout.mock.ts +0 -81
  102. package/src/infrastructure/delivery/bootstrap.ts +0 -42
  103. package/src/infrastructure/delivery/http/fetchHttpClient.test.ts +0 -51
  104. package/src/infrastructure/delivery/http/fetchHttpClient.ts +0 -41
  105. package/src/infrastructure/delivery/http/httpClient.ts +0 -18
  106. package/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.test.ts +0 -45
  107. package/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.ts +0 -32
  108. package/src/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -38
  109. package/src/infrastructure/domain/react/useBookSizeReplaceableProductVariantsForCheckoutItem.ts +0 -44
  110. package/src/infrastructure/domain/react/useUpdateUiSetting.test.ts +0 -31
  111. package/src/infrastructure/domain/react/useUpdateUiSetting.ts +0 -43
  112. package/src/infrastructure/domain/uiSetting/model/storageUiSettings.test.ts +0 -50
  113. package/src/infrastructure/domain/uiSetting/model/storageUiSettings.ts +0 -50
  114. package/src/infrastructure/persistence/asyncStorageStorage.ts +0 -12
  115. package/src/infrastructure/persistence/storage.ts +0 -7
  116. package/src/infrastructure/persistence/uiSettingData.ts +0 -5
  117. package/src/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.test.ts +0 -65
  118. package/src/infrastructure/projection/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.ts +0 -102
  119. package/src/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.test.ts +0 -99
  120. package/src/infrastructure/projection/httpFirstAvailableCheckoutByCustomerIdView.ts +0 -128
  121. package/src/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.test.ts +0 -32
  122. package/src/infrastructure/projection/httpIsCheckoutEnabledByCustomerIdView.ts +0 -27
  123. package/src/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -51
  124. package/src/infrastructure/projection/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.ts +0 -25
  125. package/src/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.test.ts +0 -28
  126. package/src/infrastructure/projection/react/useViewFirstAvailableCheckoutByCustomerId.ts +0 -22
  127. package/src/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.test.ts +0 -44
  128. package/src/infrastructure/projection/react/useViewIsCheckoutAccessibleByCustomerId.ts +0 -24
  129. package/src/infrastructure/projection/react/useViewIsCheckoutIntroVisible.ts +0 -5
  130. package/src/infrastructure/projection/react/useViewUiSettingByKey.test.ts +0 -30
  131. package/src/infrastructure/projection/react/useViewUiSettingByKey.ts +0 -18
  132. package/src/infrastructure/projection/storageUiSettingByKeyView.test.ts +0 -32
  133. package/src/infrastructure/projection/storageUiSettingByKeyView.ts +0 -35
  134. package/src/infrastructure/ui/Root.tsx +0 -53
  135. package/src/infrastructure/ui/components/atoms/spiner/Spinner.style.ts +0 -12
  136. package/src/infrastructure/ui/components/atoms/spiner/Spinner.tsx +0 -35
  137. package/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.test.tsx +0 -70
  138. package/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.tsx +0 -31
  139. package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +0 -100
  140. package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +0 -52
  141. package/src/infrastructure/ui/routing/Routing.tsx +0 -64
  142. package/src/infrastructure/ui/routing/router/Router.native.ts +0 -1
  143. package/src/infrastructure/ui/routing/router/Router.ts +0 -1
  144. package/src/infrastructure/ui/routing/routes.ts +0 -6
  145. package/src/infrastructure/ui/test/render.tsx +0 -47
  146. package/src/infrastructure/ui/views/intro/Intro.test.tsx +0 -15
  147. package/src/infrastructure/ui/views/intro/Intro.tsx +0 -27
  148. package/src/infrastructure/ui/views/item/Item.tsx +0 -31
  149. package/src/infrastructure/ui/views/summary/Summary.tsx +0 -27
  150. package/src/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.test.ts +0 -40
  151. package/src/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.ts +0 -85
  152. package/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.test.ts +0 -22
  153. package/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.ts +0 -149
  154. package/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.test.ts +0 -54
  155. package/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.ts +0 -46
  156. package/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.test.ts +0 -20
  157. package/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.ts +0 -51
  158. package/src/projection/uiSetting/viewUiSettingByKey.test.ts +0 -22
  159. package/src/projection/uiSetting/viewUiSettingByKey.ts +0 -47
  160. package/tsconfig.build.json +0 -16
  161. package/tsconfig.json +0 -19
  162. package/webpack.config.js +0 -17
  163. /package/dist/infrastructure/ui/components/atoms/{spiner → spinner}/Spinner.d.ts +0 -0
  164. /package/dist/infrastructure/ui/components/atoms/{spiner → spinner}/Spinner.style.d.ts +0 -0
  165. /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 { useViewIsCheckoutIntroVisible } from "../../projection/react/useViewIsCheckoutIntroVisible";
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 = <Spinner /> }) => {
9
- const [isIntroVisible, isIntroVisibleStatus] = useViewIsCheckoutIntroVisible();
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 dependenciesLoaded = isIntroVisibleStatus === QueryStatus.SUCCESS && checkoutStatus === QueryStatus.SUCCESS;
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 (isIntroVisible) {
22
+ if (!checkoutIntroShown) {
20
23
  if (!isIntroRoute) {
21
- return <Navigate replace to={Routes.INTRO}/>;
24
+ return React.createElement(Navigate, { replace: true, to: Routes.INTRO });
22
25
  }
23
26
  }
24
27
  else {
25
28
  if (firstItemWithoutCustomerDecision && !isItemRoute) {
26
- return <Navigate replace to={generatePath(Routes.ITEM, { id: firstItemWithoutCustomerDecision.id })}/>;
29
+ return React.createElement(Navigate, { replace: true, to: generatePath(Routes.ITEM, { id: firstItemWithoutCustomerDecision.id }) });
27
30
  }
28
31
  if (firstItemWithoutCustomerDecision === undefined && !isSummaryRoute) {
29
- return <Navigate replace to={Routes.SUMMARY}/>;
32
+ return React.createElement(Navigate, { replace: true, to: Routes.SUMMARY });
30
33
  }
31
34
  }
32
- return <Outlet />;
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/spiner/Spinner";
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: <CheckoutAccessibilityMiddleware customerId={customerId} onNotAccessible={onNotAccessible}/>,
14
+ element: React.createElement(CheckoutAccessibilityMiddleware, { customerId: customerId, onNotAccessible: onNotAccessible }),
15
15
  children: [
16
16
  {
17
17
  path: Routes.CHECKOUT,
18
- element: <CheckoutMiddleware customerId={customerId}/>,
18
+ element: React.createElement(CheckoutMiddleware, { customerId: customerId }),
19
19
  children: [
20
20
  {
21
21
  path: Routes.INTRO,
22
- element: (<Suspense fallback={<Spinner />}>
23
- <Intro />
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: (<Suspense fallback={<Spinner />}>
29
- <Item />
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: (<Suspense fallback={<Spinner />}>
35
- <Summary />
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: <Navigate replace to={Routes.CHECKOUT}/>,
41
+ element: React.createElement(Navigate, { replace: true, to: Routes.CHECKOUT }),
45
42
  },
46
43
  ]);
47
44
  return routes;
@@ -0,0 +1,4 @@
1
+ declare enum UISettings {
2
+ CHECKOUT_INTRO_SHOWN = "CHECKOUT_INTRO_SHOWN"
3
+ }
4
+ export { UISettings };
@@ -0,0 +1,5 @@
1
+ var UISettings;
2
+ (function (UISettings) {
3
+ UISettings["CHECKOUT_INTRO_SHOWN"] = "CHECKOUT_INTRO_SHOWN";
4
+ })(UISettings || (UISettings = {}));
5
+ export { UISettings };
@@ -1,13 +1,11 @@
1
1
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
- import { ReactIntl } from "@lookiero/i18n-react";
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 = ReactIntl.useI18nMessage({ id: "intro" });
6
- return (<View style={styles.container}>
7
- <Text heading={true} level={3}>
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 { ReactIntl } from "@lookiero/i18n-react";
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 = ReactIntl.useI18nMessage({ id: "item" });
8
- return (<View style={styles.container}>
9
- <Text heading={true} level={3}>
10
- {itemText}
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 { ReactIntl } from "@lookiero/i18n-react";
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 = ReactIntl.useI18nMessage({ id: "summary" });
6
- return (<View style={styles.container}>
7
- <Text heading={true} level={3}>
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
- export interface UiSettingProjection {
2
+ interface UiSettingProjection {
3
3
  readonly id: string;
4
4
  readonly key: string;
5
5
  readonly value: unknown;
6
6
  }
7
- export declare const VIEW_UI_SETTING_BY_KEY = "view_ui_setting_by_key";
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
- export interface UiSettingByKeyView {
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
- export declare const viewUiSettingByKey: ViewUiSettingByKeyFunction;
27
- export declare const viewUiSettingByKeyHandler: QueryHandlerFunction<ViewUiSettingByKey, ViewUiSettingByKeyResult, ViewUiSettingByKeyHandlerFunctionArgs>;
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
- export const VIEW_UI_SETTING_BY_KEY = "view_ui_setting_by_key";
3
- export const viewUiSettingByKey = (payload) => ({
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
- export const viewUiSettingByKeyHandler = ({ view }) => async ({ key }) => view({ key });
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.1.1",
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.6.1",
23
- "@lookiero/i18n-react": "^0.6.1",
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
@@ -1,7 +0,0 @@
1
- node_modules
2
- coverage
3
- dist
4
- *.ignored/
5
- *.ignored.*
6
- .hooks/*
7
- .vscode/*
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
- }
@@ -1,4 +0,0 @@
1
- {
2
- "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
3
- "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
4
- }
@@ -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 }}"
@@ -1,10 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: npm
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- open-pull-requests-limit: 5
8
- assignees:
9
- - benatespina
10
- - mktoast
@@ -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,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npx lint-staged
@@ -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
@@ -1,4 +0,0 @@
1
- {
2
- "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
3
- "except": ["coverage"]
4
- }
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v14.19.3
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- dist
2
- .expo
package/.prettierrc.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "semi": true,
3
- "trailingComma": "all",
4
- "printWidth": 120,
5
- "tabWidth": 2
6
- }
@@ -1 +0,0 @@
1
- declare module "@lookiero/aurora-next";
package/app.config.js DELETED
@@ -1,4 +0,0 @@
1
- export default ({ config }) => ({
2
- ...config,
3
- entryPoint: "./src/Expo.tsx",
4
- });
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
- }
Binary file
Binary file
package/assets/icon.png DELETED
Binary file
package/assets/splash.png DELETED
Binary file
package/babel.config.js DELETED
@@ -1,6 +0,0 @@
1
- module.exports = function(api) {
2
- api.cache(true);
3
- return {
4
- presets: ['babel-preset-expo'],
5
- };
6
- };
@@ -1,3 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- declare const useViewIsCheckoutIntroVisible: () => (boolean | QueryStatus)[];
3
- export { useViewIsCheckoutIntroVisible };
@@ -1,3 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- const useViewIsCheckoutIntroVisible = () => [false, QueryStatus.SUCCESS];
3
- export { useViewIsCheckoutIntroVisible };