@vonq/hapi-elements-types 1.5.0 → 1.7.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 (210) hide show
  1. package/{src/_window → _window}/api.types.ts +9 -7
  2. package/_window/auth.types.ts +13 -0
  3. package/_window/config.types.ts +5 -0
  4. package/{src/_window → _window}/events.types.ts +15 -14
  5. package/_window/instances.types.ts +27 -0
  6. package/{src/_window → _window}/qa.types.ts +7 -5
  7. package/{src/_window → _window}/routing.types.ts +6 -4
  8. package/{src/_window → _window}/sdk.types.ts +29 -27
  9. package/{src/_window → _window}/service.types.ts +9 -7
  10. package/{src/_window → _window}/state.types.ts +55 -53
  11. package/_window/ui.types.ts +15 -0
  12. package/{src/_window → _window}/utils.types.ts +7 -5
  13. package/{src/_window → _window}/validation.types.ts +7 -5
  14. package/_window/window.ts +140 -0
  15. package/alert/index.ts +6 -0
  16. package/{src/alert → alert}/service.types.ts +2 -2
  17. package/alert/state.types.ts +9 -0
  18. package/{src/ats → ats}/api.types.ts +2 -2
  19. package/ats/index.ts +6 -0
  20. package/{src/ats → ats}/service.types.ts +2 -2
  21. package/{src/ats → ats}/state.types.ts +1 -1
  22. package/basket/index.ts +7 -0
  23. package/{src/basket → basket}/service.types.ts +2 -2
  24. package/{src/basket → basket}/state.types.ts +1 -1
  25. package/{src/basket → basket}/utils.types.ts +2 -2
  26. package/{src/campaign → campaign}/api.types.ts +2 -2
  27. package/campaign/index.ts +10 -0
  28. package/campaign/qa.types.ts +12 -0
  29. package/{src/campaign → campaign}/service.types.ts +2 -2
  30. package/{src/campaign → campaign}/state.types.ts +1 -1
  31. package/{src/campaign → campaign}/utils.types.ts +2 -2
  32. package/{enums.ts → common/enums.ts} +2 -1
  33. package/{src/common → common}/events/types.ts +6 -6
  34. package/common/index.ts +7 -0
  35. package/common/logger/types.ts +18 -0
  36. package/{src/common → common}/qa.types.ts +2 -2
  37. package/{src/common → common}/types.ts +5 -6
  38. package/common/validator/types.ts +4 -0
  39. package/{src/contract → contract}/api.types.ts +2 -2
  40. package/contract/index.ts +9 -0
  41. package/{src/contract → contract}/qa.types.ts +2 -2
  42. package/{src/contract → contract}/service.types.ts +2 -2
  43. package/{src/contract → contract}/state.types.ts +1 -1
  44. package/{src/contract → contract}/utils.types.ts +2 -2
  45. package/{src/common/logger-datadog → debugging}/index.ts +1 -1
  46. package/{src/debugging → debugging}/state.types.ts +1 -1
  47. package/index.ts +18 -0
  48. package/language/index.ts +5 -0
  49. package/{src/language → language}/qa.types.ts +2 -2
  50. package/{src/language → language}/state.types.ts +1 -1
  51. package/modal/index.ts +6 -0
  52. package/{src/modal → modal}/service.types.ts +2 -2
  53. package/{src/modal → modal}/state.types.ts +1 -1
  54. package/orderJourney/index.ts +8 -0
  55. package/{src/orderJourney → orderJourney}/qa.types.ts +2 -2
  56. package/{src/orderJourney → orderJourney}/state.types.ts +1 -1
  57. package/{src/orderJourney → orderJourney}/utils.types.ts +2 -2
  58. package/package.json +16 -5
  59. package/{src/product → product}/api.types.ts +2 -2
  60. package/product/index.ts +10 -0
  61. package/{src/product → product}/qa.types.ts +2 -2
  62. package/{src/product → product}/service.types.ts +2 -2
  63. package/{src/product → product}/state.types.ts +1 -1
  64. package/{src/product → product}/utils.types.ts +2 -2
  65. package/routing/index.ts +3 -0
  66. package/theming/index.ts +6 -0
  67. package/{src/theming → theming}/qa.types.ts +2 -2
  68. package/{src/theming → theming}/state.types.ts +1 -1
  69. package/{src/theming → theming}/types.ts +38 -1
  70. package/tsconfig.json +7 -12
  71. package/{src/ui → ui}/service.types.ts +2 -2
  72. package/{src/wallet → wallet}/api.types.ts +2 -2
  73. package/wallet/index.ts +7 -0
  74. package/{src/wallet → wallet}/service.types.ts +2 -2
  75. package/{src/wallet → wallet}/state.types.ts +1 -1
  76. package/src/_window/auth.types.ts +0 -11
  77. package/src/_window/config.types.ts +0 -30
  78. package/src/_window/instances.types.ts +0 -18
  79. package/src/_window/ui.types.ts +0 -13
  80. package/src/_window/window.ts +0 -56
  81. package/src/alert/functions.types.ts +0 -13
  82. package/src/alert/index.ts +0 -9
  83. package/src/alert/state.initial.ts +0 -16
  84. package/src/alert/state.types.ts +0 -27
  85. package/src/alert/state.validations.ts +0 -11
  86. package/src/ats/functions.types.ts +0 -7
  87. package/src/ats/index.ts +0 -9
  88. package/src/ats/state.initial.ts +0 -5
  89. package/src/ats/state.validations.ts +0 -6
  90. package/src/basket/consts.ts +0 -1
  91. package/src/basket/functions.types.ts +0 -40
  92. package/src/basket/index.ts +0 -12
  93. package/src/basket/state.initial.ts +0 -11
  94. package/src/basket/state.validations.ts +0 -12
  95. package/src/basket/utils.ts +0 -79
  96. package/src/campaign/consts.ts +0 -1
  97. package/src/campaign/functions.types.ts +0 -90
  98. package/src/campaign/index.ts +0 -15
  99. package/src/campaign/qa.types.ts +0 -12
  100. package/src/campaign/state.initial.ts +0 -84
  101. package/src/campaign/state.validations.ts +0 -16
  102. package/src/campaign/utils.ts +0 -53
  103. package/src/common/LocalStorage.ts +0 -123
  104. package/src/common/browser.ts +0 -2
  105. package/src/common/color.ts +0 -9
  106. package/src/common/immutable.ts +0 -28
  107. package/src/common/index.ts +0 -22
  108. package/src/common/instances/Instance.ts +0 -13
  109. package/src/common/instances/consts.ts +0 -1
  110. package/src/common/instances/index.ts +0 -4
  111. package/src/common/json.ts +0 -25
  112. package/src/common/logger/Logger.ts +0 -70
  113. package/src/common/logger/index.ts +0 -5
  114. package/src/common/logger/types.ts +0 -7
  115. package/src/common/logger-datadog/LoggerDatadog.ts +0 -42
  116. package/src/common/misc.ts +0 -114
  117. package/src/common/promise.ts +0 -161
  118. package/src/common/proxy.ts +0 -77
  119. package/src/common/regExTest.ts +0 -12
  120. package/src/common/tree.ts +0 -148
  121. package/src/common/utm.ts +0 -19
  122. package/src/common/validators.ts +0 -21
  123. package/src/common/webComponents.ts +0 -26
  124. package/src/config/functions.types.ts +0 -23
  125. package/src/config/index.ts +0 -5
  126. package/src/config/state.initial.ts +0 -11
  127. package/src/config/state.types.ts +0 -15
  128. package/src/consts.ts +0 -980
  129. package/src/contract/consts.ts +0 -1
  130. package/src/contract/functions.types.ts +0 -112
  131. package/src/contract/index.ts +0 -14
  132. package/src/contract/state.initial.ts +0 -39
  133. package/src/contract/state.validations.ts +0 -21
  134. package/src/contract/utils.ts +0 -36
  135. package/src/debugging/functions.types.ts +0 -34
  136. package/src/debugging/index.ts +0 -6
  137. package/src/debugging/state.initial.ts +0 -10
  138. package/src/debugging/state.validations.ts +0 -10
  139. package/src/index.ts +0 -22
  140. package/src/language/consts.ts +0 -6
  141. package/src/language/en.ts +0 -530
  142. package/src/language/functions.types.ts +0 -29
  143. package/src/language/index.ts +0 -11
  144. package/src/language/state.initial.ts +0 -13
  145. package/src/language/state.validations.ts +0 -10
  146. package/src/language/utils.ts +0 -17
  147. package/src/modal/consts.ts +0 -6
  148. package/src/modal/functions.types.ts +0 -22
  149. package/src/modal/index.ts +0 -11
  150. package/src/modal/state.initial.ts +0 -9
  151. package/src/modal/state.validations.ts +0 -6
  152. package/src/modal/store.types.ts +0 -5
  153. package/src/orderJourney/consts.ts +0 -289
  154. package/src/orderJourney/functions.types.ts +0 -140
  155. package/src/orderJourney/index.ts +0 -13
  156. package/src/orderJourney/state.initial.ts +0 -401
  157. package/src/orderJourney/state.validations.ts +0 -78
  158. package/src/orderJourney/utils.ts +0 -7
  159. package/src/product/consts.ts +0 -1
  160. package/src/product/functions.types.ts +0 -156
  161. package/src/product/index.ts +0 -14
  162. package/src/product/state.initial.ts +0 -28
  163. package/src/product/state.validations.ts +0 -25
  164. package/src/routing/functions.types.ts +0 -48
  165. package/src/routing/index.ts +0 -5
  166. package/src/routing/state.initial.ts +0 -10
  167. package/src/theming/consts.ts +0 -7727
  168. package/src/theming/functions.types.ts +0 -13
  169. package/src/theming/index.ts +0 -11
  170. package/src/theming/state.initial.ts +0 -16
  171. package/src/theming/state.validations.ts +0 -8
  172. package/src/theming/utils.ts +0 -581
  173. package/src/types.ts +0 -229
  174. package/src/utils.ts +0 -3
  175. package/src/wallet/consts.ts +0 -3
  176. package/src/wallet/functions.types.ts +0 -58
  177. package/src/wallet/index.ts +0 -11
  178. package/src/wallet/state.initial.ts +0 -18
  179. package/src/wallet/state.validations.ts +0 -18
  180. /package/{src/_window → _window}/index.ts +0 -0
  181. /package/{src/alert → alert}/enums.ts +0 -0
  182. /package/{src/alert → alert}/types.ts +0 -0
  183. /package/{src/ats → ats}/types.ts +0 -0
  184. /package/{src/basket → basket}/types.ts +0 -0
  185. /package/{src/basket → basket}/validations.types.ts +0 -0
  186. /package/{src/campaign → campaign}/enums.ts +0 -0
  187. /package/{src/campaign → campaign}/types.ts +0 -0
  188. /package/{src/campaign → campaign}/validations.types.ts +0 -0
  189. /package/{src/common → common}/events/EventCommand/enums.ts +0 -0
  190. /package/{src/common → common}/events/EventCommand/index.ts +0 -0
  191. /package/{src/common → common}/events/EventCommand/types.ts +0 -0
  192. /package/{src/common → common}/events/index.ts +0 -0
  193. /package/{src/common → common}/logger/enums.ts +0 -0
  194. /package/{src/common → common}/validations.types.ts +0 -0
  195. /package/{src/contract → contract}/types.ts +0 -0
  196. /package/{src/contract → contract}/validations.types.ts +0 -0
  197. /package/{src/language → language}/validations.types.ts +0 -0
  198. /package/{src/modal → modal}/enums.ts +0 -0
  199. /package/{src/modal → modal}/types.ts +0 -0
  200. /package/{src/orderJourney → orderJourney}/enums.ts +0 -0
  201. /package/{src/orderJourney → orderJourney}/types.ts +0 -0
  202. /package/{src/orderJourney → orderJourney}/validations.types.ts +0 -0
  203. /package/{src/product → product}/enums.ts +0 -0
  204. /package/{src/product → product}/types.ts +0 -0
  205. /package/{src/product → product}/validations.types.ts +0 -0
  206. /package/{src/routing → routing}/state.types.ts +0 -0
  207. /package/{src/theming → theming}/validations.types.ts +0 -0
  208. /package/{src/ui → ui}/index.ts +0 -0
  209. /package/{src/wallet → wallet}/types.ts +0 -0
  210. /package/{src/wallet → wallet}/validations.types.ts +0 -0
@@ -4,10 +4,10 @@ import { Product } from "../product/types"
4
4
  import { Contract } from "../contract/types"
5
5
  import { IObservableValue } from "mobx"
6
6
  import { AnyNonFunction } from "../common/types"
7
- import { ModuleWithConstructorArgs } from "../types"
8
7
  import { WindowHapiService } from "../_window/service.types"
8
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
9
 
10
- export type WindowHapiServiceModal = ModuleWithConstructorArgs<
10
+ export type WindowHapiServiceModal = WindowHapiModuleWithConstructorArgs<
11
11
  {
12
12
  openModal: (
13
13
  key: ModalKeys,
@@ -1,6 +1,6 @@
1
1
  import { Modals } from "./types"
2
2
 
3
- export type ModalStoreState = {
3
+ export type ModalState = {
4
4
  /**
5
5
  * An object of modals that are seperated into different layers
6
6
  */
@@ -0,0 +1,8 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./enums"
4
+ export * from "./qa.types"
5
+ export * from "./state.types"
6
+ export * from "./types"
7
+ export * from "./utils.types"
8
+ export * from "./validations.types"
@@ -1,8 +1,8 @@
1
1
  import { OrderJourneyPaymentMethod, OrderJourneyStepKey } from "./enums"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiQA } from "../_window/qa.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiQAOrderJourney = ModuleWithConstructorArgs<
5
+ export type WindowHapiQAOrderJourney = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  setEnabledSteps: (steps: OrderJourneyStepKey[]) => OrderJourneyStepKey[]
8
8
  setEnabledPaymentMethods: (
@@ -3,7 +3,7 @@ import { OrderJourneyStep, OrderJourneyContractStep } from "./types"
3
3
  import { MessageDescriptor } from "react-intl"
4
4
  import { NestedValidatorKeys, UseValidatorResult } from "../common/types"
5
5
 
6
- export type OrderJourneyStoreState = {
6
+ export type OrderJourneyState = {
7
7
  stepsEnabled: OrderJourneyStepKey[]
8
8
  steps: OrderJourneyStep[]
9
9
  stepPreviousIndex: number
@@ -1,8 +1,8 @@
1
1
  import { OrderJourneyPaymentMethod, OrderJourneyStepKey } from "./enums"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiUtils } from "../_window/utils.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiUtilsOrderJourney = ModuleWithConstructorArgs<
5
+ export type WindowHapiUtilsOrderJourney = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  stepKeys: typeof OrderJourneyStepKey
8
8
  paymentMethodKeys: typeof OrderJourneyPaymentMethod
package/package.json CHANGED
@@ -1,24 +1,35 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.5.0",
4
+ "version": "1.7.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
8
8
  "type": "module",
9
9
  "scripts": {
10
10
  "version:minor": "npm version minor",
11
+ "build:types": "tsc -d --declarationMap --emitDeclarationOnly",
11
12
  "publish:types": "npm publish --access public",
12
13
  "generate:index": "cti create ./src"
13
14
  },
14
- "main": "src/index.ts",
15
- "devDependencies": {
15
+ "main": "index.ts",
16
+ "types": "index.d.ts",
17
+ "dependencies": {
18
+ "@datadog/browser-logs": "^4.34.2",
19
+ "axios": "^1.3.4",
16
20
  "color": "^4.2.3",
17
- "create-ts-index": "^1.14.0",
21
+ "is-promise": "^4.0.0",
22
+ "lodash": "^4.17.21",
18
23
  "mobx": "^6.8.0",
19
24
  "react": "^18.2.0",
20
- "typescript": "^4.9.5",
25
+ "react-intl": "^6.2.10",
26
+ "react-toastify": "^9.1.1",
27
+ "theming": "^3.3.0",
21
28
  "validator": "^13.9.0",
22
29
  "zod": "^3.20.6"
30
+ },
31
+ "devDependencies": {
32
+ "create-ts-index": "^1.14.0",
33
+ "typescript": "^4.9.5"
23
34
  }
24
35
  }
@@ -11,11 +11,11 @@ import {
11
11
  } from "./types"
12
12
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
13
13
  import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
14
- import { ModuleWithConstructorArgs } from "../types"
15
14
  import {
16
15
  WindowHapiAPIATSConfigs,
17
16
  WindowHapiAPIATSRequests,
18
17
  } from "../ats/api.types"
18
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
19
19
 
20
20
  export type WindowHapiAPIProductConfigs = {
21
21
  getProduct: AxiosRequestConfig
@@ -53,7 +53,7 @@ export type WindowHapiAPIProductRequests = {
53
53
  ) => Promise<PaginatedAPIResponseV1<ProductJobTitle>>
54
54
  getLocations: (searchParam: string) => Promise<ProductLocation[]>
55
55
  }
56
- export type WindowHapiAPIProduct = ModuleWithConstructorArgs<
56
+ export type WindowHapiAPIProduct = WindowHapiModuleWithConstructorArgs<
57
57
  WindowHapiAPIModule<
58
58
  WindowHapiAPIProductRequests,
59
59
  WindowHapiAPIProductConfigs
@@ -0,0 +1,10 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./api.types"
4
+ export * from "./enums"
5
+ export * from "./qa.types"
6
+ export * from "./service.types"
7
+ export * from "./state.types"
8
+ export * from "./types"
9
+ export * from "./utils.types"
10
+ export * from "./validations.types"
@@ -1,7 +1,7 @@
1
- import { ModuleWithConstructorArgs } from "../types"
2
1
  import { WindowHapiQA } from "../_window/qa.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
3
 
4
- export type WindowHapiQAProduct = ModuleWithConstructorArgs<
4
+ export type WindowHapiQAProduct = WindowHapiModuleWithConstructorArgs<
5
5
  {
6
6
  useMockFilters: () => Promise<void>
7
7
  getRandomChannelIdThatSupportsContracts: () => Promise<number>
@@ -13,7 +13,7 @@ import {
13
13
  ProductSupportingContractsPartial,
14
14
  } from "./types"
15
15
  import { PaginatedAPIResponseV1, PaginationResponseV1 } from "../common/types"
16
- import { ModuleWithConstructorArgs } from "../types"
16
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
17
17
 
18
18
  export type ProductServiceGetFilteredProductsHandler = (
19
19
  meta?: PaginationResponseV1 | null,
@@ -51,7 +51,7 @@ export type ProductServiceGetIndustriesHandler = () => Promise<
51
51
  ProductIndustry[]
52
52
  >
53
53
 
54
- export type WindowHapiServiceProduct = ModuleWithConstructorArgs<
54
+ export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
55
55
  {
56
56
  getProductWithContractsSupportById: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductWithContractsSupportByIdHandler>
57
57
  getProductsWithContractsSupport: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductsWithContractsSupportHandler>
@@ -8,7 +8,7 @@ import {
8
8
  } from "./types"
9
9
  import { PaginationResponseV1 } from "../common/types"
10
10
 
11
- export type ProductStoreState = {
11
+ export type ProductState = {
12
12
  /* Products */
13
13
  /**
14
14
  * Array of Products to be listed on Products Landing and Products List widgets. As user applies filters and sorting, this value gets overwritten
@@ -1,13 +1,13 @@
1
1
  import { ProductFilterQueryParams, ProductUserProvidedFilters } from "./types"
2
2
  import { PaginationResponseV1 } from "../common/types"
3
- import { ModuleWithConstructorArgs } from "../types"
4
3
  import {
5
4
  OrderJourneyPaymentMethod,
6
5
  OrderJourneyStepKey,
7
6
  } from "../orderJourney/enums"
8
7
  import { WindowHapiUtils } from "../_window/utils.types"
8
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
9
 
10
- export type WindowHapiUtilsProduct = ModuleWithConstructorArgs<
10
+ export type WindowHapiUtilsProduct = WindowHapiModuleWithConstructorArgs<
11
11
  {
12
12
  getUserProvidedFilters: () => ProductUserProvidedFilters
13
13
  getProductsQueryParams: (
@@ -0,0 +1,3 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./state.types"
@@ -0,0 +1,6 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./qa.types"
4
+ export * from "./state.types"
5
+ export * from "./types"
6
+ export * from "./validations.types"
@@ -1,8 +1,8 @@
1
1
  import { HapiFontOptions, HapiTheme } from "./types"
2
- import { ModuleWithConstructorArgs } from "../types"
3
2
  import { WindowHapiQA } from "../_window/qa.types"
3
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
- export type WindowHapiQATheming = ModuleWithConstructorArgs<
5
+ export type WindowHapiQATheming = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
7
  setTheme: (updatedTheme: Partial<HapiTheme>) => HapiTheme
8
8
  setFontOptions: (fontOptions: HapiFontOptions) => HapiFontOptions
@@ -1,6 +1,6 @@
1
1
  import { HapiFontOptions, HapiTheme } from "./types"
2
2
 
3
- export type ThemeStoreState = {
3
+ export type ThemingState = {
4
4
  theme: Partial<HapiTheme>
5
5
  fontOptions: HapiFontOptions
6
6
  }
@@ -1,4 +1,41 @@
1
- import { Theming } from "theming"
1
+ import * as React from "react"
2
+
3
+ type DefaultTheme = object | null
4
+
5
+ type WithThemeFactory<Theme> = <
6
+ InnerProps extends { theme: NonNullable<Theme> },
7
+ InnerComponent extends React.ComponentType<InnerProps>,
8
+ OuterProps extends InnerProps & { theme?: NonNullable<Theme> },
9
+ >(
10
+ comp: InnerComponent,
11
+ ) => React.ComponentType<OuterProps>
12
+
13
+ interface ThemeProviderProps<Theme> {
14
+ theme: NonNullable<Theme> | ((outerTheme: Theme) => NonNullable<Theme>)
15
+ children: React.ReactNode
16
+ }
17
+
18
+ type ThemeProviderFactory<Theme> = React.ComponentType<
19
+ ThemeProviderProps<Theme>
20
+ >
21
+
22
+ type UseThemeFactory<Theme> = <CustomTheme = Theme>() => CustomTheme
23
+
24
+ interface Theming<Theme> {
25
+ context: React.Context<Theme>
26
+ withTheme: WithThemeFactory<Theme>
27
+ ThemeProvider: ThemeProviderFactory<Theme>
28
+ useTheme: UseThemeFactory<Theme>
29
+ }
30
+
31
+ declare function createTheming<Theme>(
32
+ context: React.Context<Theme>,
33
+ ): Theming<Theme>
34
+
35
+ declare const withTheme: WithThemeFactory<DefaultTheme>
36
+ declare const ThemeProvider: ThemeProviderFactory<DefaultTheme>
37
+ declare const ThemeContext: React.Context<DefaultTheme>
38
+ declare const useTheme: UseThemeFactory<DefaultTheme>
2
39
 
3
40
  export type ThemeGlobalStyles = {
4
41
  borderRadius: string
package/tsconfig.json CHANGED
@@ -18,24 +18,19 @@
18
18
  "jsx": "preserve",
19
19
  "incremental": false,
20
20
  "experimentalDecorators": true,
21
- "baseUrl": "./src",
22
- "forceConsistentCasingInFileNames": true,
23
- "paths": {
24
- "axios": ["../../node_modules/axios"],
25
- "zod": ["../../node_modules/zod"],
26
- "theming": ["../../node_modules/theming"],
27
- "react-intl": ["../../node_modules/react-intl"],
28
- "react": ["../../node_modules/react"],
29
- "lodash": ["../../node_modules/lodash"]
30
- }
21
+ "baseUrl": "./",
22
+ "outFile": "index.d.ts",
23
+ "forceConsistentCasingInFileNames": true
31
24
  },
32
25
  "include": [
33
- "./src/**/*",
26
+ "**/*",
34
27
  ],
35
28
  "exclude": [
36
29
  "node_modules",
37
30
  "../ats/**/*",
38
31
  "../common/**/*",
39
- "./dist/**/*"
32
+ "../src/**/*",
33
+ "./index.d.ts",
34
+ "./index.d.ts.map"
40
35
  ]
41
36
  }
@@ -1,7 +1,7 @@
1
- import { ModuleWithConstructorArgs } from "../types"
2
1
  import { WindowHapiService } from "../_window/service.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
3
 
4
- export type WindowHapiServiceUI = ModuleWithConstructorArgs<
4
+ export type WindowHapiServiceUI = WindowHapiModuleWithConstructorArgs<
5
5
  {
6
6
  setStyleAttribute: (
7
7
  selector: string,
@@ -6,7 +6,7 @@ import {
6
6
  WalletPaymentIntentRequest,
7
7
  } from "./types"
8
8
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
9
- import { ModuleWithConstructorArgs } from "../types"
9
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
10
10
 
11
11
  export type WindowHapiAPIWalletConfigs = {
12
12
  getWallet: RawAxiosRequestConfig
@@ -24,7 +24,7 @@ export type WindowHapiAPIWalletRequests = {
24
24
  paymentParams: WalletPaymentIntentRequest,
25
25
  ) => Promise<any>
26
26
  }
27
- export type WindowHapiAPIWallet = ModuleWithConstructorArgs<
27
+ export type WindowHapiAPIWallet = WindowHapiModuleWithConstructorArgs<
28
28
  WindowHapiAPIModule<
29
29
  WindowHapiAPIWalletRequests,
30
30
  WindowHapiAPIWalletConfigs
@@ -0,0 +1,7 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./api.types"
4
+ export * from "./service.types"
5
+ export * from "./state.types"
6
+ export * from "./types"
7
+ export * from "./validations.types"
@@ -3,7 +3,7 @@ import {
3
3
  HapiServiceFunctionWithLifecycleHooks,
4
4
  WindowHapiService,
5
5
  } from "../_window/service.types"
6
- import { ModuleWithConstructorArgs } from "../types"
6
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
7
7
 
8
8
  export type WalletServiceGetATSSettingsHandler =
9
9
  () => Promise<WalletATSSettings>
@@ -12,7 +12,7 @@ export type WalletServiceGetWalletHandler = (
12
12
  ) => Promise<Wallet>
13
13
  export type WalletServiceCreateWalletHandler = () => Promise<Wallet>
14
14
 
15
- export type WindowHapiServiceWallet = ModuleWithConstructorArgs<
15
+ export type WindowHapiServiceWallet = WindowHapiModuleWithConstructorArgs<
16
16
  {
17
17
  getATSSettings: HapiServiceFunctionWithLifecycleHooks<WalletServiceGetATSSettingsHandler>
18
18
  getWallet: HapiServiceFunctionWithLifecycleHooks<WalletServiceGetWalletHandler>
@@ -5,7 +5,7 @@ import {
5
5
  WalletPaymentIntentRequest,
6
6
  } from "./types"
7
7
 
8
- export type WalletStoreState = {
8
+ export type WalletState = {
9
9
  /**
10
10
  * User's Wallet that can hold credits to be used on Creating/Ordering a Campaign
11
11
  */
@@ -1,11 +0,0 @@
1
- import { ModuleWithConstructorArgs } from "../types"
2
- import { WindowHapi } from "./window"
3
-
4
- export type WindowHapiAuth = ModuleWithConstructorArgs<
5
- {
6
- partnerId: string | undefined
7
- clientId: string | undefined
8
- clientToken: string | undefined
9
- },
10
- { readonly core: WindowHapi }
11
- >
@@ -1,30 +0,0 @@
1
- import { HapiWebComponent, RecursivePartial } from "../common/types"
2
-
3
- export type DebugPanelPosition =
4
- | "bottom-left"
5
- | "bottom-right"
6
- | "top-left"
7
- | "top-right"
8
- export type WindowHapiConfig = {
9
- apiHost: string
10
- initialState: RecursivePartial<any>
11
- partnerId: string
12
- clientId: string
13
- clientToken: string
14
- loadingSpinnerDefaultFillColor: string
15
- appOrigin: string
16
- enableLogs: boolean
17
- webComponents: HapiWebComponent[]
18
- isInvalidToken: boolean
19
- useJWTAuthHeaders: boolean
20
- addModal: boolean
21
- addAlertBar: boolean
22
- addDebugPanel: boolean
23
- debugPanelPosition: DebugPanelPosition
24
- datadogClientToken: string
25
- env: string
26
- appVersion: string
27
- testMode: boolean
28
- debugMode: boolean
29
- htmlTemplates: Record<string, string>
30
- }
@@ -1,18 +0,0 @@
1
- import HapiInstance from "../common/instances/Instance"
2
- import { ModuleWithConstructorArgs } from "../types"
3
- import { WindowHapi } from "./window"
4
-
5
- export type WindowHapiInstances = ModuleWithConstructorArgs<
6
- {
7
- instances: HapiInstance[]
8
- getFrameWindowByName: (name: string) => Window | undefined
9
- hasInstance: (instanceName: string) => boolean
10
- getInstanceByName: (instanceName: string) => HapiInstance | undefined
11
- addInstanceByName: (instanceName: string, window: Window) => void
12
- addInstance: (instance: HapiInstance) => void
13
- removeInstance: (instanceName: string) => void
14
- onAfterAddInstance: (instance: HapiInstance) => void
15
- onAfterRemoveInstance: (instance: HapiInstance) => void
16
- },
17
- { readonly core: WindowHapi }
18
- >
@@ -1,13 +0,0 @@
1
- import { ModuleWithConstructorArgs } from "../types"
2
- import { WindowHapi } from "./window"
3
-
4
- export type WindowHapiUI = ModuleWithConstructorArgs<
5
- {
6
- addUIElementToBody: (
7
- elementName: "he-ui-modals" | "he-ui-alertbar",
8
- ) => void
9
- toggleModal: () => void
10
- toggleAlertbar: () => void
11
- },
12
- { readonly core: WindowHapi }
13
- >
@@ -1,56 +0,0 @@
1
- import { Logger } from "../common/logger/Logger"
2
- import { WindowHapiUtils } from "./utils.types"
3
- import { WindowHapiValidations } from "./validation.types"
4
- import { WindowHapiState } from "./state.types"
5
- import { WindowHapiInstances } from "./instances.types"
6
- import { WindowHapiRouting } from "./routing.types"
7
- import { WindowHapiAuth } from "./auth.types"
8
- import { WindowHapiEvents } from "./events.types"
9
- import { WindowHapiUI } from "./ui.types"
10
- import { WindowHapiAPI } from "./api.types"
11
- import { WindowHapiSDK } from "./sdk.types"
12
- import { WindowHapiService } from "./service.types"
13
- import HapiInstance from "../common/instances/Instance"
14
- import { WindowHapiQA } from "./qa.types"
15
- import { ModuleWithConstructorArgs } from "../types"
16
-
17
- export type WindowHapi = {
18
- logger: Logger
19
- utils: ModuleWithConstructorArgs<
20
- WindowHapiUtils,
21
- { readonly core: WindowHapi }
22
- >
23
- validation: ModuleWithConstructorArgs<
24
- WindowHapiValidations,
25
- { readonly core: WindowHapi }
26
- >
27
- state: ModuleWithConstructorArgs<
28
- WindowHapiState,
29
- { readonly core: WindowHapi }
30
- >
31
- instances: ModuleWithConstructorArgs<
32
- WindowHapiInstances,
33
- { readonly core: WindowHapi }
34
- >
35
- routing: ModuleWithConstructorArgs<
36
- WindowHapiRouting,
37
- { readonly core: WindowHapi }
38
- >
39
- auth: ModuleWithConstructorArgs<
40
- WindowHapiAuth,
41
- { readonly core: WindowHapi }
42
- >
43
- events: ModuleWithConstructorArgs<
44
- WindowHapiEvents,
45
- { readonly core: WindowHapi }
46
- >
47
- ui: ModuleWithConstructorArgs<WindowHapiUI, { readonly core: WindowHapi }>
48
- api: ModuleWithConstructorArgs<WindowHapiAPI, { readonly core: WindowHapi }>
49
- sdk: ModuleWithConstructorArgs<WindowHapiSDK, { readonly core: WindowHapi }>
50
- service: ModuleWithConstructorArgs<
51
- WindowHapiService,
52
- { readonly core: WindowHapi }
53
- >
54
- instance: HapiInstance
55
- qa: ModuleWithConstructorArgs<WindowHapiQA, { readonly core: WindowHapi }>
56
- }
@@ -1,13 +0,0 @@
1
- import { AlertKey } from "./enums"
2
- import { Alert, AlertOptions, AlertProps } from "./types"
3
-
4
- export type AlertStoreShowHandler = (
5
- key: AlertKey,
6
- props: AlertProps | undefined,
7
- options: AlertOptions,
8
- ) => void
9
- export type AlertStoreSetAlertsHandler = (alerts: Alert[]) => void
10
- export type AlertStoreFunctions = {
11
- showAlert: AlertStoreShowHandler
12
- setAlerts: AlertStoreSetAlertsHandler
13
- }
@@ -1,9 +0,0 @@
1
- // created from 'create-ts-index'
2
-
3
- export * from './enums';
4
- export * from './functions.types';
5
- export * from './service.types';
6
- export * from './state.initial';
7
- export * from './state.types';
8
- export * from './state.validations';
9
- export * from './types';
@@ -1,16 +0,0 @@
1
- import { AlertStoreState } from "./state.types"
2
- import { AlertType } from "./enums"
3
-
4
- export const initialAlertStoreState: AlertStoreState = {
5
- alerts: [],
6
- errorOptions: null,
7
- infoOptions: null,
8
- warningOptions: null,
9
- successOptions: null,
10
- defaultOptions: {
11
- shouldShowDismiss: true,
12
- position: "top-center",
13
- autoClose: 5000,
14
- type: AlertType.info,
15
- },
16
- }
@@ -1,27 +0,0 @@
1
- import { Alert, AlertOptions } from "./types"
2
- export type AlertStoreState = {
3
- /**
4
- * List of alert objects to be shown
5
- */
6
- alerts: Alert[]
7
- /**
8
- * Default options object for Toast (Snack) notifications. Contains options like duration, show/hide close button, position.
9
- */
10
- defaultOptions: AlertOptions
11
- /**
12
- * Extends default options and sets the type to "success". **This value is a computed getter meaning that it cannot be set from outside**
13
- */
14
- successOptions: AlertOptions | null
15
- /**
16
- * Extends default options and sets the type to "info". **This value is a computed getter meaning that it cannot be set from outside**
17
- */
18
- infoOptions: AlertOptions | null
19
- /**
20
- * Extends default options and sets the type to "warning". **This value is a computed getter meaning that it cannot be set from outside**
21
- */
22
- warningOptions: AlertOptions | null
23
- /**
24
- * Extends default options and sets the type to "error". **This value is a computed getter meaning that it cannot be set from outside**
25
- */
26
- errorOptions: AlertOptions | null
27
- }
@@ -1,11 +0,0 @@
1
- import { AlertStoreState } from "./state.types"
2
- import { StateValidations } from "../_window/state.types"
3
-
4
- export const alertStoreStateValidations: StateValidations<AlertStoreState> = {
5
- alerts: undefined,
6
- errorOptions: "throwHasNoSetterError",
7
- infoOptions: "throwHasNoSetterError",
8
- warningOptions: "throwHasNoSetterError",
9
- successOptions: "throwHasNoSetterError",
10
- defaultOptions: undefined,
11
- }
@@ -1,7 +0,0 @@
1
- import { ATSSettings } from "./types"
2
-
3
- export type ATSStoreSetUserSettingsHandler = (settings: ATSSettings) => void
4
-
5
- export type ATSStoreFunctions = {
6
- setUserSettings: ATSStoreSetUserSettingsHandler
7
- }
package/src/ats/index.ts DELETED
@@ -1,9 +0,0 @@
1
- // created from 'create-ts-index'
2
-
3
- export * from './api.types';
4
- export * from './functions.types';
5
- export * from './service.types';
6
- export * from './state.initial';
7
- export * from './state.types';
8
- export * from './state.validations';
9
- export * from './types';
@@ -1,5 +0,0 @@
1
- import { ATSStoreState } from "./state.types"
2
-
3
- export const initialATSStoreState: ATSStoreState = {
4
- userSettings: null,
5
- }
@@ -1,6 +0,0 @@
1
- import { ATSStoreState } from "./state.types"
2
- import { StateValidations } from "../_window/state.types"
3
-
4
- export const atsStoreStateValidations: StateValidations<ATSStoreState> = {
5
- userSettings: "common.genericObject",
6
- }
@@ -1 +0,0 @@
1
- export const CAMPAIGN_BASKET_PRODUCTS_LOCALSTORAGE_KEY = "basketProducts"