@vonq/hapi-elements-types 1.8.0 → 1.10.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 (48) hide show
  1. package/_window/api.types.ts +28 -0
  2. package/_window/auth.types.ts +1 -0
  3. package/_window/events.types.ts +15 -14
  4. package/_window/instances.types.ts +2 -0
  5. package/_window/sdk.types.ts +3 -1
  6. package/_window/service.types.ts +4 -0
  7. package/_window/state.types.ts +15 -8
  8. package/_window/utils.types.ts +5 -4
  9. package/_window/window.ts +5 -0
  10. package/alert/enums.ts +1 -0
  11. package/alert/types.ts +3 -0
  12. package/ats/api.types.ts +12 -1
  13. package/ats/service.types.ts +8 -1
  14. package/ats/state.types.ts +2 -1
  15. package/ats/types.ts +22 -0
  16. package/basket/service.types.ts +10 -4
  17. package/basket/state.types.ts +0 -24
  18. package/basket/utils.types.ts +38 -0
  19. package/campaign/service.types.ts +1 -0
  20. package/campaign/state.types.ts +0 -30
  21. package/campaign/types.ts +14 -8
  22. package/campaign/utils.types.ts +1 -3
  23. package/campaign/validations.types.ts +16 -7
  24. package/common/enums.ts +2 -0
  25. package/common/events/EventCommand/enums.ts +6 -4
  26. package/common/events/EventCommand/types.ts +2 -0
  27. package/common/events/types.ts +4 -1
  28. package/common/qa.types.ts +2 -0
  29. package/common/validations.types.ts +2 -0
  30. package/contract/state.types.ts +0 -45
  31. package/contract/types.ts +3 -1
  32. package/contract/utils.types.ts +2 -1
  33. package/debugging/state.types.ts +1 -12
  34. package/modal/enums.ts +4 -0
  35. package/modal/types.ts +24 -0
  36. package/orderJourney/enums.ts +2 -2
  37. package/orderJourney/service.types.ts +16 -0
  38. package/orderJourney/state.types.ts +11 -6
  39. package/orderJourney/types.ts +45 -12
  40. package/orderJourney/utils.types.ts +10 -0
  41. package/orderJourney/validations.types.ts +23 -2
  42. package/package.json +1 -1
  43. package/product/state.types.ts +2 -57
  44. package/product/types.ts +13 -8
  45. package/product/validations.types.ts +2 -1
  46. package/theming/types.ts +6 -0
  47. package/ui/service.types.ts +6 -4
  48. package/wallet/state.types.ts +0 -36
@@ -1,25 +1,42 @@
1
1
  import {
2
2
  ZodArray,
3
3
  ZodBoolean,
4
+ ZodNativeEnum,
4
5
  ZodObject,
5
6
  ZodOptional,
6
7
  ZodRecord,
7
8
  ZodString,
8
9
  ZodTypeAny,
10
+ ZodUnion,
9
11
  } from "zod"
10
12
  import { OrderJourneyPaymentMethod, OrderJourneyStepKey } from "./enums"
11
13
  import { ZodIntlDescriptor } from "../common/validations.types"
12
14
 
13
15
  export type ZodOrderJourneyStep = ZodObject<{
14
16
  key: ZodString
15
- titleIntlDescriptor: ZodIntlDescriptor
16
- descriptionIntlDescriptor: ZodIntlDescriptor
17
+ titleIntlDescriptor: ZodOptional<ZodIntlDescriptor>
18
+ descriptionIntlDescriptor: ZodOptional<ZodIntlDescriptor>
17
19
  isSubmitted: ZodOptional<ZodBoolean>
18
20
  blurredFields: ZodOptional<ZodRecord<ZodString, ZodTypeAny>>
19
21
  errorMessagesIntlDescriptors: ZodOptional<ZodRecord<ZodString, ZodTypeAny>>
20
22
  }>
21
23
 
22
24
  export type ZodOrderJourneySteps = ZodArray<ZodOrderJourneyStep>
25
+ export type ZodOrderJourneyUTMCodeMap = ZodObject<{
26
+ mapToName: ZodBoolean
27
+ value: ZodString
28
+ key: ZodString
29
+ }>
30
+ export type ZodOrderJourneyUTMCodeMaps = ZodArray<ZodOrderJourneyUTMCodeMap>
31
+ export type ZodOrderJourneyUTMCodesStepData = ZodObject<{
32
+ settings: ZodOrderJourneyUTMCodeMaps
33
+ productUTMs: ZodRecord<ZodString, ZodOrderJourneyUTMCodeMaps>
34
+ }>
35
+ export type ZodOrderJourneyOrderReviewStepData = ZodObject<{
36
+ accordionsOpen: ZodArray<
37
+ ZodUnion<[ZodNativeEnum<typeof OrderJourneyStepKey>, ZodString]>
38
+ >
39
+ }>
23
40
  export type WindowHapiValidationsOrderJourney = {
24
41
  supportedStepKeys: OrderJourneyStepKey[]
25
42
  stepKeysRegex: RegExp
@@ -31,4 +48,8 @@ export type WindowHapiValidationsOrderJourney = {
31
48
  paymentMethods: ZodArray<ZodString>
32
49
  supportedPaymentMethods: OrderJourneyPaymentMethod[]
33
50
  paymentMethodsRegex: RegExp
51
+ utmMap: ZodOrderJourneyUTMCodeMap
52
+ utmMaps: ZodOrderJourneyUTMCodeMaps
53
+ utmCodesStepData: ZodOrderJourneyUTMCodesStepData
54
+ orderReviewStepData: ZodOrderJourneyOrderReviewStepData
34
55
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.8.0",
4
+ "version": "1.10.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
@@ -10,84 +10,29 @@ import { PaginationResponseV1 } from "../common/types"
10
10
 
11
11
  export type ProductState = {
12
12
  /* Products */
13
- /**
14
- * Array of Products to be listed on Products Landing and Products List widgets. As user applies filters and sorting, this value gets overwritten
15
- */
16
13
  recommendedProducts: Product[]
17
- /**
18
- * Indicates if recommended products are loading
19
- */
20
14
  recommendedProductsAreLoading: boolean
21
- /**
22
- * Array of Products to be listed on Contracts Add Channel Selector Dropdown
23
- */
24
15
  productsWithContractsSupport: ProductSupportingContractsPartial[]
25
- /**
26
- * Indicates whether the Products with Contracts support is loading (mainly used for showing a loading spinner on the Select element when the user is searching for a Product when creating a contract)
27
- */
28
16
  productsWithContractsSupportAreLoading: boolean
29
- /**
30
- * Array of Products to be listed on Products Landing and Products List widgets. As user applies filters and sorting, this value gets overwritten
31
- */
32
17
  products: Product[]
33
- /**
34
- Offset and limit style pagination meta
35
- */
36
18
  productsPaginationMeta: PaginationResponseV1 | null
37
- /**
38
- * Indicates if products are loading
39
- */
40
19
  productsAreLoading: boolean
41
- /**
42
- * The value of Product name in the Input HTML Element that is used to fetch new Product results from the API
43
- */
44
20
  productNameInput: string
45
- /**
46
- * The selected Product region IDs that is used to fetch new Product results from the API
47
- */
48
21
  jobRegionsIdsSelected: number[]
49
22
  /* Locations */
50
- /**
51
- * Array of Locations that are lazily loaded with the input given in `jobRegionsIdsSelected`
52
- */
53
23
  jobRegions: ProductLocation[]
54
24
  /* Job Titles */
55
- /**
56
- * Array of Job Titles that are lazily loaded with the input given in `jobTitlesIdsSelected`
57
- */
58
25
  jobTitles: ProductJobTitle[]
59
- /**
60
- * The selected Job Title IDs that are used to fetch new Product results from the API
61
- */
62
26
  jobTitlesIdsSelected: number[]
63
27
  /* Job Functions */
64
- /**
65
- * Array of Job Functions that are lazily loaded with the input given in `jobTitlesIdsSelected`
66
- */
67
28
  jobFunctions: ProductJobFunction[]
68
- /**
69
- * Shows a loading spinner and disables the Select HTML Element while locations are loading
70
- */
71
29
  jobFunctionsAreLoading: boolean
72
- /**
73
- * The value of Job Function in the Input HTML Element that lazy loads `jobFunctions`
74
- */
75
30
  jobFunctionsInput: string
76
- /**
77
- * The selected Job Function IDs that are used to fetch new Product results from the API
78
- */
79
31
  jobFunctionsIdsSelected: number[]
80
32
  /* Industries */
81
- /**
82
- * The selected Job Industry ID that is used to fetch new Product results from the API
83
- */
84
33
  jobIndustriesIdsSelected: number[]
85
- /**
86
- * Array of Industries that are lazily loaded with the input given in `jobIndustriesIdsSelected`
87
- */
88
34
  jobIndustries: ProductIndustry[]
89
- /**
90
- * Shows a loading spinner and disables the Select HTML Element while locations are loading
91
- */
92
35
  jobIndustriesAreLoading: boolean
36
+ /* Search Text */
37
+ searchTextInput: string
93
38
  }
package/product/types.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  export type ProductRange = "hours" | "days" | "weeks" | "months"
9
9
 
10
10
  export type ProductIndustry = {
11
- id: number
11
+ id: number | string
12
12
  name: string
13
13
  }
14
14
 
@@ -64,14 +64,16 @@ export type Product = {
64
64
  } & ProductLogos &
65
65
  ProductType
66
66
 
67
+ export type ProductBoardType =
68
+ | "aggregator"
69
+ | "job board"
70
+ | "service"
71
+ | "social media"
72
+ | "publication"
73
+ | "community"
74
+
67
75
  export type ProductType = {
68
- type:
69
- | "aggregator"
70
- | "job board"
71
- | "service"
72
- | "social media"
73
- | "publication"
74
- | "community"
76
+ type: ProductBoardType
75
77
  }
76
78
 
77
79
  export type ProductLogos = {
@@ -100,6 +102,8 @@ export type ProductLocationPlaceType =
100
102
  | "continent"
101
103
  | "country"
102
104
  | "region"
105
+ | "place"
106
+ | "district"
103
107
 
104
108
  export type ProductLocation = {
105
109
  bounding_box: any[]
@@ -116,6 +120,7 @@ export type ProductFilterQueryParams = {
116
120
  jobIndustriesIdsSelected: number[]
117
121
  filterProductRecommendations: ProductFilterRecommendations
118
122
  filterMyContractSupportedOnly: boolean
123
+ searchTextInput: string
119
124
  }
120
125
 
121
126
  export type ProductSearchFilters = {
@@ -7,6 +7,7 @@ import {
7
7
  ZodObject,
8
8
  ZodOptional,
9
9
  ZodString,
10
+ ZodUnion,
10
11
  } from "zod"
11
12
  import { ProductPriceCurrency } from "./enums"
12
13
  import { ZodPaginationResponseV1 } from "../common/validations.types"
@@ -30,7 +31,7 @@ export type ZodProductDuration = ZodObject<{
30
31
  }>
31
32
 
32
33
  export type ZodProductIndustry = ZodObject<{
33
- id: ZodNumber
34
+ id: ZodUnion<[ZodNumber, ZodString]>
34
35
  name: ZodString
35
36
  }>
36
37
  export type ZodProductIndustries = ZodArray<ZodProductIndustry>
package/theming/types.ts CHANGED
@@ -39,6 +39,7 @@ declare const useTheme: UseThemeFactory<DefaultTheme>
39
39
 
40
40
  export type ThemeGlobalStyles = {
41
41
  borderRadius: string
42
+ borderColor: string
42
43
 
43
44
  primaryBackgroundColor: string
44
45
  primaryTextColor: string
@@ -67,6 +68,9 @@ export type ThemeGlobalStyles = {
67
68
 
68
69
  accentBackgroundColor: string
69
70
  accentTextColor: string
71
+
72
+ scrollBarTrackColor: string
73
+ scrollBarThumbColor: string
70
74
  }
71
75
 
72
76
  export type HapiThemingThemeProvider = Theming<HapiTheme>["ThemeProvider"]
@@ -80,6 +84,7 @@ export type HapiThemeRule =
80
84
  | "loadingSpinner"
81
85
  | "userJourneyBar"
82
86
  | "card"
87
+ | "productCard"
83
88
  | "tabHeaders"
84
89
  | "tabHeader"
85
90
  | "tabPanels"
@@ -98,6 +103,7 @@ export type HapiThemeRule =
98
103
  | "buttonFaded"
99
104
  | "buttonAccent"
100
105
  | "badgeBase"
106
+ | "formFieldLabel"
101
107
  | "formFieldBase"
102
108
  | "inputSelectBase"
103
109
  | "input"
@@ -3,6 +3,8 @@ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
3
 
4
4
  export type WindowHapiServiceUI = WindowHapiModuleWithConstructorArgs<
5
5
  {
6
+ onIframeLoaded: (callback: (iframeName: string) => void) => void
7
+ onIframeUnloaded: (callback: (iframeName: string) => void) => void
6
8
  setStyleAttribute: (
7
9
  selector: string,
8
10
  attributeName: string,
@@ -11,12 +13,12 @@ export type WindowHapiServiceUI = WindowHapiModuleWithConstructorArgs<
11
13
  setStyle: (selector: string, style: any) => Promise<void>
12
14
  addClass: (selector: string, className: string) => Promise<void>
13
15
  removeClass: (selector: string, className: string) => Promise<void>
14
- appendChild: (
15
- containerSelector: string,
16
+ appendChildToSlot: (
17
+ slotId: string,
16
18
  element: HTMLElement,
17
19
  ) => Promise<void>
18
- removeChild: (
19
- containerSelector: string,
20
+ removeChildFromSlot: (
21
+ slotId: string,
20
22
  elementSelector: string,
21
23
  ) => Promise<void>
22
24
  hideElement: (elementSelector: string) => Promise<void>
@@ -6,53 +6,17 @@ import {
6
6
  } from "./types"
7
7
 
8
8
  export type WalletState = {
9
- /**
10
- * User's Wallet that can hold credits to be used on Creating/Ordering a Campaign
11
- */
12
9
  wallet: Wallet | null
13
- /**
14
- * User's balance in dollars converted from cents through `wallet.balance`. **This value is a computed getter meaning that it cannot be set from outside**
15
- */
16
10
  balanceInUSD: number | null
17
- /**
18
- * Indicates whether or not user has enough credits/balance to Order a Campaign
19
- */
20
11
  balanceIsEnoughToOrderCampaign: boolean
21
- /**
22
- * Shows a loading spinner while wallet is loading
23
- */
24
12
  walletIsLoading: boolean
25
- /**
26
- * The request body to be sent to HAPI Backend Service to create a payment intent. **This value is a computed getter meaning that it cannot be set from outside**
27
- */
28
13
  paymentIntentRequestBody: WalletPaymentIntentRequest | null
29
14
  paymentIntentClientSecret: string | null
30
- /**
31
- * Shows a loading spinner while PaymentIntent is creating
32
- */
33
15
  topUpIsLoading: boolean
34
- /**
35
- * A custom amount to specify for the top up of balance
36
- */
37
16
  topUpAmount: number
38
- /**
39
- * A minimum amount enforced by an ATS for the top up of balance
40
- */
41
17
  topUpMinAmount: number
42
- /**
43
- * A minimum amount's currency enforced by an ATS for the top up of balance
44
- */
45
18
  topUpMinAmountCurrency: ProductPriceCurrency
46
- /**
47
- * Indicates if user has agreed to terms of service
48
- */
49
19
  topUpTermsOfServiceIsAgreed: boolean
50
- /**
51
- * Step of the popup. **Should not be edited from outside**
52
- */
53
20
  topUpCurrentStepIndex: number
54
- /**
55
- * An array of payment method types that Stripe accepts https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_types to specify which types of payment methods the end user can use
56
- */
57
21
  topUpPaymentMethodTypes: WalletPaymentIntentPaymentMethod[]
58
22
  }