@zengenti/contensis-react-base 3.0.0-beta.9 → 3.0.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 (166) hide show
  1. package/README.md +128 -1
  2. package/cjs/{App-5d20127f.js → App-e82ee728.js} +228 -182
  3. package/cjs/App-e82ee728.js.map +1 -0
  4. package/cjs/{RouteLoader-df3de0cb.js → RouteLoader-3aa6456e.js} +47 -28
  5. package/cjs/RouteLoader-3aa6456e.js.map +1 -0
  6. package/cjs/{ToJs-697ace9f.js → ToJs-a9a8522b.js} +39 -34
  7. package/cjs/ToJs-a9a8522b.js.map +1 -0
  8. package/cjs/{actions-a24bf46e.js → actions-8dc9e8de.js} +5 -4
  9. package/cjs/actions-8dc9e8de.js.map +1 -0
  10. package/cjs/client.js +22 -44
  11. package/cjs/client.js.map +1 -1
  12. package/cjs/contensis-react-base.js +3956 -136
  13. package/cjs/contensis-react-base.js.map +1 -1
  14. package/cjs/forms.js +547 -580
  15. package/cjs/forms.js.map +1 -1
  16. package/cjs/{fromJSLeaveImmer-65d26804.js → fromJSLeaveImmer-e74c673c.js} +2 -2
  17. package/cjs/fromJSLeaveImmer-e74c673c.js.map +1 -0
  18. package/cjs/{login-bc55ee33.js → login-6b9de6a1.js} +92 -55
  19. package/cjs/login-6b9de6a1.js.map +1 -0
  20. package/cjs/{reducers-fde41d6b.js → reducers-3a4f8971.js} +26 -25
  21. package/cjs/reducers-3a4f8971.js.map +1 -0
  22. package/cjs/redux.js +6 -5
  23. package/cjs/redux.js.map +1 -1
  24. package/cjs/routing.js +5 -4
  25. package/cjs/routing.js.map +1 -1
  26. package/cjs/sagas-594b5ecd.js +2090 -0
  27. package/cjs/sagas-594b5ecd.js.map +1 -0
  28. package/cjs/search.js +296 -1915
  29. package/cjs/search.js.map +1 -1
  30. package/cjs/{selectors-0ec95076.js → selectors-656da4b7.js} +8 -3
  31. package/cjs/selectors-656da4b7.js.map +1 -0
  32. package/cjs/setCachingHeaders-ee619bdf.js +12 -0
  33. package/cjs/setCachingHeaders-ee619bdf.js.map +1 -0
  34. package/cjs/user.js +21 -12
  35. package/cjs/user.js.map +1 -1
  36. package/cjs/util.js +17 -17
  37. package/cjs/util.js.map +1 -1
  38. package/cjs/{version-bf00e6d7.js → version-78dfc3bd.js} +35 -23
  39. package/cjs/version-78dfc3bd.js.map +1 -0
  40. package/cjs/{version-be0c7b7a.js → version-eba6d09b.js} +2 -2
  41. package/{esm/version-ad2ec52c.js.map → cjs/version-eba6d09b.js.map} +1 -1
  42. package/esm/{App-4224ba21.js → App-986d0bc6.js} +228 -183
  43. package/esm/App-986d0bc6.js.map +1 -0
  44. package/esm/{RouteLoader-027215f2.js → RouteLoader-5171c63f.js} +47 -28
  45. package/esm/RouteLoader-5171c63f.js.map +1 -0
  46. package/esm/{ToJs-46761960.js → ToJs-4e02a04d.js} +38 -32
  47. package/esm/ToJs-4e02a04d.js.map +1 -0
  48. package/esm/{actions-b949ef5c.js → actions-180948dd.js} +5 -4
  49. package/esm/actions-180948dd.js.map +1 -0
  50. package/esm/client.js +24 -27
  51. package/esm/client.js.map +1 -1
  52. package/esm/contensis-react-base.js +3954 -135
  53. package/esm/contensis-react-base.js.map +1 -1
  54. package/esm/forms.js +547 -583
  55. package/esm/forms.js.map +1 -1
  56. package/esm/{fromJSLeaveImmer-e2f0f331.js → fromJSLeaveImmer-0114ffcf.js} +2 -2
  57. package/esm/fromJSLeaveImmer-0114ffcf.js.map +1 -0
  58. package/esm/{login-6eab4c94.js → login-508cac0f.js} +92 -55
  59. package/esm/login-508cac0f.js.map +1 -0
  60. package/esm/{reducers-d6c0edb1.js → reducers-8e5d6232.js} +26 -25
  61. package/esm/reducers-8e5d6232.js.map +1 -0
  62. package/esm/redux.js +8 -7
  63. package/esm/redux.js.map +1 -1
  64. package/esm/routing.js +5 -4
  65. package/esm/routing.js.map +1 -1
  66. package/esm/sagas-1f2b2aa0.js +2000 -0
  67. package/esm/sagas-1f2b2aa0.js.map +1 -0
  68. package/esm/search.js +252 -1856
  69. package/esm/search.js.map +1 -1
  70. package/esm/{selectors-8fca7fb2.js → selectors-a5e5835b.js} +9 -6
  71. package/esm/selectors-a5e5835b.js.map +1 -0
  72. package/esm/setCachingHeaders-d49060e1.js +10 -0
  73. package/esm/setCachingHeaders-d49060e1.js.map +1 -0
  74. package/esm/user.js +23 -14
  75. package/esm/user.js.map +1 -1
  76. package/esm/util.js +17 -17
  77. package/esm/util.js.map +1 -1
  78. package/esm/{version-ad2ec52c.js → version-2485e2fb.js} +2 -2
  79. package/{cjs/version-be0c7b7a.js.map → esm/version-2485e2fb.js.map} +1 -1
  80. package/esm/{version-3b4fe08d.js → version-e3a5ec66.js} +34 -23
  81. package/esm/version-e3a5ec66.js.map +1 -0
  82. package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +1 -1
  83. package/models/forms/index.d.ts +3 -1
  84. package/models/index.d.ts +1 -0
  85. package/models/redux/appstate.d.ts +5 -10
  86. package/models/redux/sagas/navigation.d.ts +1 -1
  87. package/models/redux/selectors/navigation.d.ts +2 -1
  88. package/models/routing/components/RouteLoader.d.ts +2 -19
  89. package/models/routing/redux/actions.d.ts +1 -1
  90. package/models/routing/redux/selectors.d.ts +1 -1
  91. package/models/routing/routes.d.ts +22 -4
  92. package/models/routing/util/expressions.d.ts +3 -2
  93. package/models/routing/util/queries.d.ts +1 -1
  94. package/models/search/containers/withListing.d.ts +1 -1
  95. package/models/search/containers/withSearch.d.ts +1 -1
  96. package/models/search/hooks/useFacets.hook.d.ts +3 -0
  97. package/models/search/hooks/useListing.hook.d.ts +3 -0
  98. package/models/search/hooks/useMinilist.hook.d.ts +2 -9
  99. package/models/search/index.d.ts +6 -2
  100. package/models/search/models/Queries.d.ts +8 -5
  101. package/models/search/models/Search.d.ts +60 -28
  102. package/models/search/models/SearchActions.d.ts +9 -5
  103. package/models/search/models/SearchProps.d.ts +52 -7
  104. package/models/search/models/SearchState.d.ts +5 -1
  105. package/models/search/models/index.d.ts +3 -1
  106. package/models/search/redux/actions.d.ts +5 -2
  107. package/models/search/redux/reducers.d.ts +230 -314
  108. package/models/search/redux/sagas.d.ts +11 -7
  109. package/models/search/redux/selectors.d.ts +21 -24
  110. package/models/search/redux/util.d.ts +1 -0
  111. package/models/search/search/ContensisDeliveryApi.d.ts +1 -0
  112. package/models/search/search/expressions.d.ts +5 -8
  113. package/models/search/{redux → search}/queries.d.ts +0 -0
  114. package/models/search/search/util.d.ts +14 -0
  115. package/models/search/transformations/entry-to-filteritem.mapper.d.ts +2 -1
  116. package/models/search/transformations/filter-to-filterexpression.mapper.d.ts +6 -0
  117. package/models/search/transformations/filters-to-filterexpressions.mapper.d.ts +3 -0
  118. package/models/search/transformations/index.d.ts +3 -0
  119. package/models/search/transformations/queryParams-to-customapi.mapper.d.ts +3 -0
  120. package/models/search/transformations/state-to-searchuri.d.ts +2 -13
  121. package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +24 -0
  122. package/models/server/features/linkdepth-api/QueryLevelResults.d.ts +50 -0
  123. package/models/server/features/linkdepth-api/api.d.ts +12 -0
  124. package/models/server/features/linkdepth-api/events-api.config.d.ts +37 -0
  125. package/models/server/features/linkdepth-api/search.d.ts +31 -0
  126. package/models/server/features/linkdepth-api/util.d.ts +11 -0
  127. package/models/server/middleware/bundleManipulation.d.ts +2 -1
  128. package/models/server/util/bundles.d.ts +17 -21
  129. package/models/server/util/getVersionInfo.d.ts +1 -0
  130. package/models/server/util/headers.d.ts +3 -2
  131. package/models/user/components/Login.d.ts +1 -2
  132. package/models/user/components/LoginForm.d.ts +1 -2
  133. package/models/user/hocs/withLogin.d.ts +4 -2
  134. package/models/user/hocs/withRegistration.d.ts +2 -0
  135. package/models/user/hooks/useLogin.d.ts +5 -3
  136. package/models/user/redux/reducers.d.ts +4 -5
  137. package/models/user/redux/sagas/login.d.ts +11 -8
  138. package/models/user/redux/selectors.d.ts +12 -6
  139. package/models/user/util/LoginHelper.class.d.ts +4 -3
  140. package/models/util/ContensisDeliveryApi.d.ts +4 -4
  141. package/models/util/json-mapper.d.ts +9 -3
  142. package/models/util/merge.d.ts +1 -0
  143. package/package.json +61 -56
  144. package/CHANGELOG.md +0 -293
  145. package/cjs/App-5d20127f.js.map +0 -1
  146. package/cjs/RouteLoader-df3de0cb.js.map +0 -1
  147. package/cjs/ToJs-697ace9f.js.map +0 -1
  148. package/cjs/actions-a24bf46e.js.map +0 -1
  149. package/cjs/fromJSLeaveImmer-65d26804.js.map +0 -1
  150. package/cjs/login-bc55ee33.js.map +0 -1
  151. package/cjs/reducers-fde41d6b.js.map +0 -1
  152. package/cjs/selectors-0ec95076.js.map +0 -1
  153. package/cjs/version-bf00e6d7.js.map +0 -1
  154. package/esm/App-4224ba21.js.map +0 -1
  155. package/esm/RouteLoader-027215f2.js.map +0 -1
  156. package/esm/ToJs-46761960.js.map +0 -1
  157. package/esm/actions-b949ef5c.js.map +0 -1
  158. package/esm/fromJSLeaveImmer-e2f0f331.js.map +0 -1
  159. package/esm/login-6eab4c94.js.map +0 -1
  160. package/esm/reducers-d6c0edb1.js.map +0 -1
  161. package/esm/selectors-8fca7fb2.js.map +0 -1
  162. package/esm/version-3b4fe08d.js.map +0 -1
  163. package/models/search/transformations/filters-to-filterexpression.d.ts +0 -1
  164. package/models/search/transformations/filters-to-filterexpression.mapper.d.ts +0 -2
  165. package/models/server/features/caching/cacheHashing.d.ts +0 -1
  166. package/package-lock.json +0 -14093
@@ -1,4 +1,7 @@
1
+ import { Entry } from 'contensis-delivery-api/lib/models';
2
+ import MappingTemplate from 'jsonpath-mapper/dist/models/Template';
1
3
  import { Context } from './Enums';
4
+ import { FieldOperators, LogicOperators } from './Queries';
2
5
  import { AppState } from './SearchState';
3
6
  export declare type Tab = {
4
7
  /** The facet to render as default */
@@ -15,8 +18,11 @@ export declare type CustomApi = {
15
18
  uri: string;
16
19
  };
17
20
  export declare type Listing = {
21
+ /** Display title */
22
+ title?: string;
18
23
  /** Experimental: use a custom API to retrieve search results */
19
24
  customApi?: CustomApi;
25
+ } | {
20
26
  /** Experimental: override the rootUrl of the Delivery API client */
21
27
  env?: string;
22
28
  /** An object with a key for each filter that is required in this facet */
@@ -24,23 +30,18 @@ export declare type Listing = {
24
30
  /** Use this to target the search to a project other than the default configured */
25
31
  projectId?: string;
26
32
  /** Query params object to drive the search for this facet */
27
- queryParams: QueryParams;
33
+ queryParams: SearchQueryParams;
28
34
  /** Display title */
29
- title: string;
35
+ title?: string;
30
36
  };
31
- export declare type Facet = {
32
- /** Display title */
33
- title: string;
34
- /** Experimental: use a custom API to retrieve search results */
35
- customApi?: CustomApi;
36
- } | ({
37
+ export declare type SearchFacet = {
37
38
  /** The first facet to be shown if no facet is supplied via a route parameter [default false] */
38
39
  isDefault?: boolean;
39
40
  /** Set to true to temporarily disable the facet [default false] */
40
41
  isDisabled?: boolean;
41
42
  /** The id of the tab the facet applies to. Use 0 for default or the id assigned to the tab */
42
43
  tabId?: number;
43
- } & Listing);
44
+ } & Listing;
44
45
  export declare type SearchFilters = {
45
46
  [key: string]: SearchFilter;
46
47
  };
@@ -49,10 +50,14 @@ export declare type SearchFilter = {
49
50
  contentTypeId?: string | string[];
50
51
  /** An array of CustomWhereClause to include in the search query when dynamically loading entries via the contentTypeId key */
51
52
  customWhere?: CustomWhereClause;
53
+ /** Use this to set a specific value to render for the initial / unselected option in this filter */
54
+ defaultValue?: string;
52
55
  /** The content type field we will apply the filter key to, to filter the list of returned results. */
53
56
  fieldId: string | string[];
54
57
  /** The Delivery API search operator we will use to filter the list of returned results. */
55
- fieldOperator?: string;
58
+ fieldOperator?: FieldOperators;
59
+ /** The Delivery API locgical operator we will use to filter the list of returned results when multiple filter items are selected. */
60
+ logicOperator?: LogicOperators;
56
61
  /** The taxonomy path we will dynamically load into state under the items[] */
57
62
  path?: string;
58
63
  /** Setting to true will sync selected filters under matching filter keys in other facets */
@@ -86,7 +91,7 @@ export declare type FeaturedResults = {
86
91
  /** The number of featured results to retrieve */
87
92
  count?: number;
88
93
  };
89
- export declare type QueryParams = {
94
+ export declare type SearchQueryParams = {
90
95
  /** An array of assetTypes to search over (sys.dataFormat == 'asset'); Prefix an entry with a "!" to exclude that asset type from the search */
91
96
  assetTypes?: string[];
92
97
  /** An array of contentTypeIds to search over (sys.dataFormat == 'entry'); Prefix an entry with a "!" to exclude that content type from the search */
@@ -146,7 +151,7 @@ export declare type WeightedSearchField = {
146
151
  export declare type SearchConfig = {
147
152
  /** An object with a key for each facet that is required for the search */
148
153
  facets: {
149
- [key: string]: Facet;
154
+ [key: string]: SearchFacet;
150
155
  };
151
156
  /** An object with a key for each independent listing that is required for the site */
152
157
  listings?: {
@@ -160,28 +165,55 @@ export declare type SearchConfig = {
160
165
  tabs: Tab[];
161
166
  };
162
167
  export declare type ConfigTypes = {
163
- [key: string]: Facet;
168
+ [key: string]: SearchFacet;
164
169
  } | {
165
170
  [key: string]: Listing;
166
171
  };
167
- export declare type Mappers = {
168
- customApi?: (queryParams: QueryParams) => {
169
- [key: string]: string;
170
- };
171
- results: (entries: any[], facet?: string, context?: Context, state?: AppState) => any[];
172
- filterItems?: (entries: any[]) => any[];
173
- navigate?: ({ state, facet, orderBy, pageIndex, term, }: {
174
- state: AppState;
175
- facet?: string;
176
- orderBy?: string;
177
- pageIndex: number;
178
- term?: string;
179
- }) => NavigateUri;
180
- resultsInfo?: (state: AppState) => any;
181
- };
172
+ /**
173
+ * Type your mapper for mapping API responses (entries) into usable props for your components to render
174
+ */
175
+ export declare type SearchResultsMapper<Target = any, Source = Entry> = (entries: Source[], facet?: string, context?: Context, state?: AppState) => Target[];
176
+ /**
177
+ * Type your custom filter item mapping function with this to ensure correctly typed FilterItems are returned to work with search functions
178
+ */
179
+ export declare type FilterItemsMapper<T = Entry> = (entries: T[]) => FilterItem[];
180
+ /**
181
+ * The uri object type we need to return from the Navigate mapper after any search action has been called
182
+ */
182
183
  export declare type NavigateUri = {
183
184
  path: string;
184
185
  search: string;
185
186
  hash: string;
186
187
  };
188
+ /**
189
+ * Type your jsonpath-mapper mapping template with this to map your next search uri to your custom uri structure after calling any search action
190
+ */
191
+ export declare type SearchUriMapping = MappingTemplate<SearchStateParams>;
192
+ /**
193
+ * Type the argument passed to the Navigate mapper, this provides the relevant keys and data available to manipulate and return the next uri after any search action has been called
194
+ */
195
+ export declare type SearchStateParams = {
196
+ state: AppState;
197
+ facet?: string;
198
+ orderBy?: string;
199
+ pageIndex: number;
200
+ term?: string;
201
+ };
202
+ /** Type your Navigate mapper with this, the Navigate mapper is called after any search action has been called and is required to return the next uri to be parsed by your project's route configuration and provide the right uri parameters to drive the next search query and resulting state */
203
+ export declare type NavigateMapper = ({ state, facet, orderBy, pageIndex, term, }: SearchStateParams) => NavigateUri;
204
+ /** Type your Results Info mapper with this, remember "resultsInfo" prop is a custom object you define yourself - you can provide any keys you wish, conveying detailed messaging or UX tweaks to cover all kinds of scenarios based on data in the search state at that time */
205
+ export declare type ResultsInfoMapper<T = any> = (state: AppState) => T;
206
+ /** Experimental**: If you are trying to use the custom API feature you can add specific keys to the resultant querystring that for the custom API GET request */
207
+ export declare type CustomApiParamsMapper = (queryParams: SearchQueryParams) => {
208
+ [key: string]: string;
209
+ };
210
+ /** Type your Mappers object with this type to provide a accurate, type-safe "mapper" argument to your search implementation */
211
+ export declare type Mappers = {
212
+ customApi?: CustomApiParamsMapper;
213
+ results: SearchResultsMapper;
214
+ filterItems?: FilterItemsMapper;
215
+ navigate?: NavigateMapper;
216
+ resultsInfo?: ResultsInfoMapper;
217
+ };
218
+ /** SearchTransformations is just an alias for Mappers object / argument */
187
219
  export declare type SearchTransformations = Mappers;
@@ -1,7 +1,7 @@
1
1
  import { PagedList } from 'contensis-core-api';
2
2
  import { Entry, TaxonomyNode } from 'contensis-delivery-api/lib/models';
3
3
  import { Context } from '../models/Enums';
4
- import { Facet, Listing, Mappers } from '../models/Search';
4
+ import { SearchFacet, Listing, Mappers } from '../models/Search';
5
5
  import { AppState } from './SearchState';
6
6
  import { QueryParams } from './Queries';
7
7
  import { TimedSearchResponse } from './SearchUtil';
@@ -16,8 +16,8 @@ export declare type DebugFlags = boolean | {
16
16
  preloadOtherFacets?: boolean;
17
17
  };
18
18
  export declare type TriggerSearchParams = {
19
- config?: Facet | Listing;
20
- context: Context;
19
+ config?: SearchFacet | Listing;
20
+ context: Context | string;
21
21
  debug?: DebugFlags;
22
22
  defaultLang?: string;
23
23
  excludeIds?: string[];
@@ -46,6 +46,7 @@ declare type InitListingParams = {
46
46
  export declare type InitListingAction = Action & InitListingParams & {
47
47
  ssr?: boolean;
48
48
  };
49
+ export declare type SetRouteFiltersOptions = Partial<InitListingAction>;
49
50
  export declare type InitListingActionCreator = (p: InitListingParams) => InitListingAction;
50
51
  export declare type LoadFiltersSearchResults = Action & {
51
52
  error: any;
@@ -86,7 +87,7 @@ export declare type SetSearchEntriesParams = {
86
87
  defaultLang: string;
87
88
  facet: string;
88
89
  mappers: Mappers;
89
- nextFacet: Facet;
90
+ nextFacet: SearchFacet;
90
91
  preload: boolean;
91
92
  ogState: AppState;
92
93
  debug: DebugFlags;
@@ -98,10 +99,12 @@ export declare type SetSearchEntriesAction = Action & SetSearchEntriesParams;
98
99
  export declare type ApplySearchFilterAction = Action & {
99
100
  filter: string;
100
101
  key: string;
102
+ isUnknownItem: boolean;
103
+ scrollYPos?: number;
101
104
  };
102
105
  export declare type ApplySearchFilterActionCreator = (filter: string, key: string) => ApplySearchFilterAction;
103
106
  export declare type ClearFiltersAction = Action;
104
- export declare type ClearFiltersActionCreator = () => ClearFiltersAction;
107
+ export declare type ClearFiltersActionCreator = (filterKey?: string) => ClearFiltersAction;
105
108
  export declare type UpdateCurrentFacetAction = Action & {
106
109
  facet: string;
107
110
  };
@@ -121,6 +124,7 @@ export declare type UpdateSortOrderAction = Action & {
121
124
  export declare type UpdateSortOrderActionCreator = (orderBy: string, facet: string) => UpdateSortOrderAction;
122
125
  export declare type UpdatePageIndexAction = Action & {
123
126
  pageIndex: number;
127
+ scrollYPos?: number;
124
128
  };
125
129
  export declare type UpdatePageIndexActionCreator = (pageIndex: number) => UpdatePageIndexAction;
126
130
  export {};
@@ -1,7 +1,20 @@
1
1
  import { clearFilters, updateCurrentFacet, updateCurrentTab, updatePageIndex, updateSearchTerm, updateSelectedFilters, updateSortOrder } from '../redux/actions';
2
- import { Facet, Mappers } from '../models/Search';
2
+ import { SearchFacet, Mappers } from '../models/Search';
3
3
  import { DebugFlags } from '../models/SearchActions';
4
- import { Facet as StateFacet, Facets, Filters, Paging } from '../models/SearchState';
4
+ import { Facet as StateFacet, Facets, Filters, Paging, SelectedFilters, TabAndFacets } from '../models/SearchState';
5
+ export interface MinilistProps<SearchResults = any> {
6
+ filters: Filters;
7
+ isLoading: boolean;
8
+ paging: Paging;
9
+ results: SearchResults[];
10
+ resultsInfo: any;
11
+ searchTerm: string;
12
+ sortOrder: string[];
13
+ title: string;
14
+ updatePageIndex: typeof updatePageIndex;
15
+ updateSelectedFilters: typeof updateSelectedFilters;
16
+ updateSortOrder: typeof updateSortOrder;
17
+ }
5
18
  export interface ListingProps<SearchResults = any> {
6
19
  clearFilters: typeof clearFilters;
7
20
  currentListing: string;
@@ -9,12 +22,15 @@ export interface ListingProps<SearchResults = any> {
9
22
  featured: SearchResults[];
10
23
  filters: Filters;
11
24
  isLoading: boolean;
12
- paging: Paging;
25
+ listing: StateFacet;
13
26
  pageIsLoading: boolean;
27
+ paging: Paging;
14
28
  results: SearchResults[];
15
29
  resultsInfo: any;
16
30
  searchTerm: string;
31
+ selectedFilters: SelectedFilters;
17
32
  sortOrder: string[];
33
+ title: string;
18
34
  updateCurrentFacet: typeof updateCurrentFacet;
19
35
  updatePageIndex: typeof updatePageIndex;
20
36
  updateSearchTerm: typeof updateSearchTerm;
@@ -27,17 +43,26 @@ export interface SearchProps<SearchResults = any> {
27
43
  currentPageIndex: number;
28
44
  currentTabIndex: number;
29
45
  facet: StateFacet;
46
+ facetTitles: {
47
+ isSelected: boolean;
48
+ key: string;
49
+ title: string;
50
+ totalCount: number;
51
+ }[];
30
52
  facets: Facets;
31
- featuredResults: SearchResults[];
53
+ featured: SearchResults[];
32
54
  filters: Filters;
33
55
  isLoading: boolean;
34
- paging: Paging;
35
56
  pageIsLoading: boolean;
57
+ paging: Paging;
36
58
  results: SearchResults[];
37
59
  resultsInfo: any;
38
60
  searchTerm: string;
61
+ searchTotalCount: number;
62
+ selectedFilters: SelectedFilters;
39
63
  sortOrder: string[];
40
- tabsAndFacets: any;
64
+ tabsAndFacets: TabAndFacets;
65
+ totalCount: number;
41
66
  updateCurrentFacet: typeof updateCurrentFacet;
42
67
  updateCurrentTab: typeof updateCurrentTab;
43
68
  updatePageIndex: typeof updatePageIndex;
@@ -45,9 +70,29 @@ export interface SearchProps<SearchResults = any> {
45
70
  updateSelectedFilters: typeof updateSelectedFilters;
46
71
  updateSortOrder: typeof updateSortOrder;
47
72
  }
73
+ export interface UseFacetsProps {
74
+ debug?: DebugFlags;
75
+ defaultLang?: string;
76
+ mappers?: Mappers;
77
+ /** Reserved for future use */
78
+ id?: string;
79
+ params?: {
80
+ [key: string]: string;
81
+ };
82
+ }
83
+ export interface UseListingProps {
84
+ debug?: DebugFlags;
85
+ defaultLang?: string;
86
+ mappers?: Mappers;
87
+ /** Reserved for future use */
88
+ id?: string;
89
+ params?: {
90
+ [key: string]: string;
91
+ };
92
+ }
48
93
  export interface UseMinilistProps {
49
94
  id: string;
50
- config?: Facet;
95
+ config?: SearchFacet;
51
96
  debug?: DebugFlags;
52
97
  defaultLang?: string;
53
98
  excludeIds?: string[];
@@ -1,6 +1,6 @@
1
1
  import { Context } from './Enums';
2
2
  import { CustomWhereClause } from './Search';
3
- export declare type AppState = Record<'search', SearchState>;
3
+ export declare type AppState = Record<'search', SearchState> & Record<string, any>;
4
4
  export declare type SearchState = {
5
5
  context: keyof typeof Context;
6
6
  currentFacet: string;
@@ -58,6 +58,7 @@ export declare type Filters = {
58
58
  export declare type Filter = {
59
59
  contentTypeId?: string;
60
60
  customWhere?: CustomWhereClause;
61
+ defaultValue?: string;
61
62
  fieldId?: string;
62
63
  isGrouped?: boolean;
63
64
  isSingleSelect?: boolean;
@@ -76,6 +77,9 @@ export declare type FilterItem = {
76
77
  path?: string;
77
78
  isSelected: boolean;
78
79
  };
80
+ export declare type SelectedFilters = {
81
+ [k: string]: string[];
82
+ };
79
83
  export declare type Paging = {
80
84
  isLoading: boolean;
81
85
  pageCount: number;
@@ -1,3 +1,5 @@
1
- export type { CustomApi, CustomWhereClause, Facet as SearchFacet, FeaturedResults, FilterItem, Listing, NavigateUri, QueryParams, SearchConfig, SearchFilter, SearchFilters, SearchTransformations, Tab, WeightedSearchField, } from './Search';
1
+ export * from './Queries';
2
+ export * from './Search';
3
+ export type { SetRouteFiltersOptions } from './SearchActions';
2
4
  export * from './SearchProps';
3
5
  export type { Facet, Filter, Filters, SearchState } from './SearchState';
@@ -11,9 +11,10 @@ export declare const navigate: (path: string, state?: any) => {
11
11
  state: any;
12
12
  };
13
13
  export declare const clearFilters: ClearFiltersActionCreator;
14
- export declare const updatePageIndex: (pageIndex: number) => {
14
+ export declare const updatePageIndex: (pageIndex: number, scrollYPos?: number | undefined) => {
15
15
  type: string;
16
16
  pageIndex: number;
17
+ scrollYPos: number | undefined;
17
18
  };
18
19
  export declare const updateCurrentFacet: (facet: string) => {
19
20
  type: string;
@@ -27,10 +28,12 @@ export declare const updateSearchTerm: (term: string) => {
27
28
  type: string;
28
29
  term: string;
29
30
  };
30
- export declare const updateSelectedFilters: (filter: string, key: string) => {
31
+ export declare const updateSelectedFilters: (filter: string, key: string, isUnknownItem?: boolean, scrollYPos?: number | undefined) => {
31
32
  type: string;
32
33
  filter: string;
33
34
  key: string;
35
+ isUnknownItem: boolean;
36
+ scrollYPos: number | undefined;
34
37
  };
35
38
  export declare const updateSortOrder: (orderBy: string, facet?: string | undefined) => {
36
39
  type: string;