@zengenti/contensis-react-base 3.0.2-beta.4 → 3.0.2-beta.40

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 (155) hide show
  1. package/README.md +2 -2
  2. package/cjs/{App-a2783f8b.js → App-7ff737fa.js} +161 -444
  3. package/cjs/App-7ff737fa.js.map +1 -0
  4. package/cjs/{login-e711a19e.js → ChangePassword.container-a617190b.js} +304 -191
  5. package/cjs/ChangePassword.container-a617190b.js.map +1 -0
  6. package/cjs/ContensisDeliveryApi-9e32960d.js +265 -0
  7. package/cjs/ContensisDeliveryApi-9e32960d.js.map +1 -0
  8. package/cjs/CookieConstants-000427db.js +10 -0
  9. package/cjs/CookieConstants-000427db.js.map +1 -0
  10. package/cjs/{RouteLoader-3aa6456e.js → RouteLoader-049e81e5.js} +27 -38
  11. package/cjs/RouteLoader-049e81e5.js.map +1 -0
  12. package/cjs/{ToJs-a9a8522b.js → ToJs-149fc5e1.js} +50 -4
  13. package/cjs/ToJs-149fc5e1.js.map +1 -0
  14. package/cjs/_commonjsHelpers-b3309d7b.js +11 -0
  15. package/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
  16. package/cjs/client.js +25 -30
  17. package/cjs/client.js.map +1 -1
  18. package/cjs/contensis-react-base.js +158 -536
  19. package/cjs/contensis-react-base.js.map +1 -1
  20. package/cjs/forms.js +3555 -326
  21. package/cjs/forms.js.map +1 -1
  22. package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-7c363211.js} +1 -4
  23. package/cjs/{fromJSLeaveImmer-e74c673c.js.map → fromJSLeaveImmer-7c363211.js.map} +1 -1
  24. package/cjs/{reducers-73a03ef4.js → reducers-9afb5f89.js} +10 -31
  25. package/{esm/reducers-aa8cef1e.js.map → cjs/reducers-9afb5f89.js.map} +1 -1
  26. package/cjs/redux.js +17 -18
  27. package/cjs/redux.js.map +1 -1
  28. package/cjs/routing.js +7 -7
  29. package/cjs/{sagas-8a20e424.js → sagas-e04b94c1.js} +225 -301
  30. package/cjs/sagas-e04b94c1.js.map +1 -0
  31. package/cjs/search.js +68 -94
  32. package/cjs/search.js.map +1 -1
  33. package/cjs/{selectors-656da4b7.js → selectors-46b689d0.js} +86 -9
  34. package/cjs/selectors-46b689d0.js.map +1 -0
  35. package/cjs/urls-6fcaf4c6.js.map +1 -1
  36. package/cjs/user.js +34 -169
  37. package/cjs/user.js.map +1 -1
  38. package/cjs/util.js +47 -53
  39. package/cjs/util.js.map +1 -1
  40. package/cjs/{version-bf9ef45e.js → version-79a027cb.js} +55 -179
  41. package/cjs/version-79a027cb.js.map +1 -0
  42. package/cjs/version-afd4f77e.js +98 -0
  43. package/cjs/version-afd4f77e.js.map +1 -0
  44. package/esm/{App-17d1ac3c.js → App-ff944c78.js} +145 -427
  45. package/esm/App-ff944c78.js.map +1 -0
  46. package/esm/{login-551d243a.js → ChangePassword.container-ae0f9ce4.js} +286 -184
  47. package/esm/ChangePassword.container-ae0f9ce4.js.map +1 -0
  48. package/esm/ContensisDeliveryApi-c66b0cc3.js +259 -0
  49. package/esm/ContensisDeliveryApi-c66b0cc3.js.map +1 -0
  50. package/esm/CookieConstants-3d3b6531.js +6 -0
  51. package/esm/CookieConstants-3d3b6531.js.map +1 -0
  52. package/esm/{RouteLoader-5171c63f.js → RouteLoader-02eef6d9.js} +26 -37
  53. package/esm/RouteLoader-02eef6d9.js.map +1 -0
  54. package/esm/{ToJs-4e02a04d.js → ToJs-ae860aad.js} +50 -5
  55. package/esm/ToJs-ae860aad.js.map +1 -0
  56. package/esm/_commonjsHelpers-1789f0cf.js +8 -0
  57. package/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
  58. package/esm/client.js +20 -25
  59. package/esm/client.js.map +1 -1
  60. package/esm/contensis-react-base.js +151 -530
  61. package/esm/contensis-react-base.js.map +1 -1
  62. package/esm/forms.js +3557 -328
  63. package/esm/forms.js.map +1 -1
  64. package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-e2dacd63.js} +1 -4
  65. package/esm/{fromJSLeaveImmer-0114ffcf.js.map → fromJSLeaveImmer-e2dacd63.js.map} +1 -1
  66. package/esm/{reducers-aa8cef1e.js → reducers-3d5c37d1.js} +10 -31
  67. package/{cjs/reducers-73a03ef4.js.map → esm/reducers-3d5c37d1.js.map} +1 -1
  68. package/esm/redux.js +9 -9
  69. package/esm/redux.js.map +1 -1
  70. package/esm/routing.js +4 -4
  71. package/esm/{sagas-e576b6f6.js → sagas-933a8fc8.js} +177 -254
  72. package/esm/sagas-933a8fc8.js.map +1 -0
  73. package/esm/search.js +69 -95
  74. package/esm/search.js.map +1 -1
  75. package/esm/{selectors-a5e5835b.js → selectors-01074974.js} +71 -9
  76. package/esm/selectors-01074974.js.map +1 -0
  77. package/esm/urls-eac9a747.js.map +1 -1
  78. package/esm/user.js +22 -161
  79. package/esm/user.js.map +1 -1
  80. package/esm/util.js +42 -53
  81. package/esm/util.js.map +1 -1
  82. package/esm/version-0fbd1b82.js +87 -0
  83. package/esm/version-0fbd1b82.js.map +1 -0
  84. package/esm/{version-72ca17f3.js → version-346a9787.js} +43 -162
  85. package/esm/version-346a9787.js.map +1 -0
  86. package/models/client/client.d.ts +1 -1
  87. package/models/config.d.ts +4 -4
  88. package/models/redux/appstate.d.ts +2 -1
  89. package/models/routing/redux/actions.d.ts +10 -6
  90. package/models/routing/redux/selectors.d.ts +5 -4
  91. package/models/routing/redux/types.d.ts +0 -1
  92. package/models/routing/routes.d.ts +20 -17
  93. package/models/routing/util/queries.d.ts +3 -2
  94. package/models/search/models/Queries.d.ts +9 -10
  95. package/models/search/models/Search.d.ts +26 -24
  96. package/models/search/models/SearchActions.d.ts +36 -36
  97. package/models/search/models/SearchState.d.ts +11 -11
  98. package/models/search/models/SearchUtil.d.ts +1 -1
  99. package/models/search/models/WithSearch.d.ts +1 -1
  100. package/models/search/redux/actions.d.ts +7 -7
  101. package/models/search/redux/selectors.d.ts +27 -27
  102. package/models/search/redux/types.d.ts +21 -21
  103. package/models/search/redux/util.d.ts +2 -2
  104. package/models/search/search/ContensisDeliveryApi.d.ts +1 -1
  105. package/models/search/search/expressions.d.ts +4 -4
  106. package/models/search/search/util.d.ts +2 -2
  107. package/models/search/transformations/state-to-queryparams.mapper.d.ts +1 -1
  108. package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +1 -1
  109. package/models/server/features/linkdepth-api/search.d.ts +3 -3
  110. package/models/server/internalServer.d.ts +7 -5
  111. package/models/server/util/bundles.d.ts +2 -2
  112. package/models/server/util/handleExceptions.d.ts +1 -1
  113. package/models/testImmer/redux/reducer.d.ts +1 -1
  114. package/models/user/components/Login.d.ts +2 -3
  115. package/models/user/containers/ChangePassword.container.d.ts +2 -2
  116. package/models/user/containers/ForgotPassword.container.d.ts +2 -2
  117. package/models/user/containers/Login.container.d.ts +2 -2
  118. package/models/user/containers/Registration.container.d.ts +2 -2
  119. package/models/user/hocs/withLogin.d.ts +5 -11
  120. package/models/user/hocs/withRegistration.d.ts +2 -8
  121. package/models/user/redux/actions.d.ts +2 -2
  122. package/models/user/redux/sagas/login.d.ts +9 -8
  123. package/models/user/redux/selectors.d.ts +4 -4
  124. package/models/user/util/CookieConstants.d.ts +8 -0
  125. package/models/user/util/CookieHelper.class.d.ts +15 -3
  126. package/models/user/util/LoginHelper.class.d.ts +27 -23
  127. package/models/util/CachedDeliveryApi.d.ts +25 -0
  128. package/models/util/ContensisDeliveryApi.d.ts +20 -38
  129. package/models/util/LruCache.d.ts +12 -0
  130. package/models/util/ToJs.d.ts +1 -1
  131. package/models/util/index.d.ts +1 -0
  132. package/models/util/json-mapper.d.ts +1 -1
  133. package/package.json +9 -10
  134. package/cjs/App-a2783f8b.js.map +0 -1
  135. package/cjs/RouteLoader-3aa6456e.js.map +0 -1
  136. package/cjs/ToJs-a9a8522b.js.map +0 -1
  137. package/cjs/actions-8dc9e8de.js +0 -87
  138. package/cjs/actions-8dc9e8de.js.map +0 -1
  139. package/cjs/login-e711a19e.js.map +0 -1
  140. package/cjs/sagas-8a20e424.js.map +0 -1
  141. package/cjs/selectors-656da4b7.js.map +0 -1
  142. package/cjs/version-bf9ef45e.js.map +0 -1
  143. package/cjs/version-eba6d09b.js +0 -20
  144. package/cjs/version-eba6d09b.js.map +0 -1
  145. package/esm/App-17d1ac3c.js.map +0 -1
  146. package/esm/RouteLoader-5171c63f.js.map +0 -1
  147. package/esm/ToJs-4e02a04d.js.map +0 -1
  148. package/esm/actions-180948dd.js +0 -72
  149. package/esm/actions-180948dd.js.map +0 -1
  150. package/esm/login-551d243a.js.map +0 -1
  151. package/esm/sagas-e576b6f6.js.map +0 -1
  152. package/esm/selectors-a5e5835b.js.map +0 -1
  153. package/esm/version-2485e2fb.js +0 -15
  154. package/esm/version-2485e2fb.js.map +0 -1
  155. package/esm/version-72ca17f3.js.map +0 -1
@@ -2,20 +2,21 @@ import { MatchedRoute, RouteConfig } from 'react-router-config';
2
2
  import { Entry, Node } from 'contensis-delivery-api/lib/models';
3
3
  import React from 'react';
4
4
  import { AppState } from "../redux/appstate";
5
- declare type RouteComponent<Props> = React.ComponentType<Props>;
6
- export declare type RouteNode = Node & {
5
+ import { CookieHelper } from "../user/util/CookieHelper.class";
6
+ type RouteComponent<Props> = React.ComponentType<Props>;
7
+ export type RouteNode = Node & {
7
8
  ancestors: Node[];
8
9
  children: Node[];
9
10
  };
10
- export declare type AppRoutes = {
11
+ export type AppRoutes = {
11
12
  ContentTypeMappings: ContentTypeMapping[];
12
13
  StaticRoutes: StaticRoute[];
13
14
  };
14
- export declare type AppRootProps = {
15
+ export type AppRootProps = {
15
16
  routes: AppRoutes;
16
17
  withEvents: WithEvents;
17
18
  };
18
- export declare type RouteComponentProps<P = any> = {
19
+ export type RouteComponentProps<P = any> = {
19
20
  [key: string]: any;
20
21
  projectId?: string;
21
22
  contentTypeId?: string;
@@ -23,23 +24,23 @@ export declare type RouteComponentProps<P = any> = {
23
24
  mappedEntry?: P;
24
25
  isLoggedIn?: boolean;
25
26
  };
26
- export declare type RouteLoaderProps = {
27
+ export type RouteLoaderProps = {
27
28
  loadingComponent?: React.ComponentType;
28
29
  notFoundComponent?: React.ComponentType;
29
30
  trailingSlashRedirectCode?: 301 | 302;
30
31
  };
31
- export declare type EntryMapper = (<MappedProps>(node: RouteNode, state?: AppState) => MappedProps | unknown) | (<MappedProps>(node: RouteNode, state?: AppState) => Promise<MappedProps | unknown>);
32
- export declare type ReduxInjector = () => Promise<{
32
+ export type EntryMapper = (<MappedProps>(node: RouteNode, state?: AppState) => MappedProps | unknown) | (<MappedProps>(node: RouteNode, state?: AppState) => Promise<MappedProps | unknown>);
33
+ export type ReduxInjector = () => Promise<{
33
34
  key: string;
34
35
  reducer: any;
35
36
  saga: any;
36
37
  }>;
37
- declare type UserGroupRequisite = {
38
+ type UserGroupRequisite = {
38
39
  id?: string;
39
40
  name?: string;
40
41
  };
41
- export declare type RequireLogin = boolean | UserGroupRequisite[];
42
- export declare type ContentTypeMapping = {
42
+ export type RequireLogin = boolean | UserGroupRequisite[];
43
+ export type ContentTypeMapping = {
43
44
  contentTypeID: string;
44
45
  component: RouteComponent<RouteComponentProps>;
45
46
  entryMapper?: EntryMapper;
@@ -59,7 +60,7 @@ export declare type ContentTypeMapping = {
59
60
  };
60
61
  requireLogin?: RequireLogin;
61
62
  };
62
- export declare type StaticRoute = Omit<RouteConfig, 'component'> & {
63
+ export type StaticRoute = Omit<RouteConfig, 'component'> & {
63
64
  component: RouteComponent<RouteComponentProps>;
64
65
  fetchNode?: boolean | {
65
66
  /**
@@ -79,7 +80,8 @@ export declare type StaticRoute = Omit<RouteConfig, 'component'> & {
79
80
  ssr?: boolean;
80
81
  ssrOnly?: boolean;
81
82
  };
82
- export declare type OnRouteLoadArgs = {
83
+ export type OnRouteLoadArgs = {
84
+ cookies: CookieHelper;
83
85
  location: {
84
86
  pathname: string;
85
87
  search: string;
@@ -90,7 +92,8 @@ export declare type OnRouteLoadArgs = {
90
92
  staticRoute: MatchedRoute<any, StaticRoute>;
91
93
  statePath: string;
92
94
  };
93
- export declare type OnRouteLoadedArgs = {
95
+ export type OnRouteLoadedArgs = {
96
+ cookies: CookieHelper;
94
97
  entry: Entry | any;
95
98
  location: {
96
99
  pathname: string;
@@ -101,7 +104,7 @@ export declare type OnRouteLoadedArgs = {
101
104
  path: string;
102
105
  staticRoute: MatchedRoute<any, StaticRoute>;
103
106
  };
104
- export declare type RouteLoadOptions = {
107
+ export type RouteLoadOptions = {
105
108
  customNavigation?: boolean | {
106
109
  ancestors: boolean | number;
107
110
  children: boolean | number;
@@ -114,10 +117,10 @@ export declare type RouteLoadOptions = {
114
117
  preventScrollTop?: boolean;
115
118
  refetchNode?: true;
116
119
  };
117
- export declare type RouteLoadedOptions = {
120
+ export type RouteLoadedOptions = {
118
121
  requireLogin?: RequireLogin;
119
122
  };
120
- export declare type WithEvents = {
123
+ export type WithEvents = {
121
124
  onRouteLoad: (args: OnRouteLoadArgs) => Generator<void | RouteLoadOptions>;
122
125
  onRouteLoaded: (args: OnRouteLoadedArgs) => Generator<void | RouteLoadedOptions>;
123
126
  };
@@ -1,2 +1,3 @@
1
- import { Query } from "../../util/ContensisDeliveryApi";
2
- export declare const routeEntryByFieldsQuery: (id: string, language?: string, fields?: string[], versionStatus?: 'published' | 'latest') => Query;
1
+ import { VersionStatus } from 'contensis-core-api';
2
+ import { Query } from 'contensis-delivery-api';
3
+ export declare const routeEntryByFieldsQuery: (id: string, language?: string, fields?: string[], versionStatus?: VersionStatus) => Query;
@@ -1,16 +1,14 @@
1
- import { Query } from 'contensis-core-api';
2
- import { VersionStatus } from 'contensis-core-api/lib/models';
3
- import { Operators } from 'contensis-delivery-api/lib/entries/query';
1
+ import { Operators, Query, VersionStatus } from 'contensis-core-api';
4
2
  import { CustomWhereClause, FeaturedResults, WeightedSearchField } from './Search';
5
- export declare type FieldOperators = Exclude<keyof Operators, 'and' | 'or' | 'not'>;
6
- export declare type LogicOperators = 'and' | 'or' | 'not';
7
- export declare type FilterExpression = {
3
+ export type FieldOperators = Exclude<keyof Operators, 'and' | 'or' | 'not'>;
4
+ export type LogicOperators = 'and' | 'or' | 'not';
5
+ export type FilterExpression = {
8
6
  key: string;
9
7
  values: string[];
10
8
  fieldOperator: FieldOperators;
11
9
  logicOperator: LogicOperators;
12
10
  };
13
- export declare type SearchQueryOptions = {
11
+ export type SearchQueryOptions = {
14
12
  assetTypes: string[];
15
13
  contentTypeIds: string[];
16
14
  customWhere: any;
@@ -24,13 +22,14 @@ export declare type SearchQueryOptions = {
24
22
  languages: string[];
25
23
  pageSize: number;
26
24
  pageIndex: number;
25
+ omitDefaultSearchFields: string[];
27
26
  orderBy: string[];
28
27
  searchTerm: string;
29
28
  versionStatus: VersionStatus;
30
29
  webpageTemplates: string[];
31
30
  weightedSearchFields: WeightedSearchField[];
32
31
  };
33
- export declare type QueryParams = SearchQueryOptions & {
32
+ export type QueryParams = SearchQueryOptions & {
34
33
  env: string;
35
34
  internalPageIndex: number;
36
35
  internalPaging: boolean;
@@ -43,5 +42,5 @@ export declare type QueryParams = SearchQueryOptions & {
43
42
  [key: string]: string;
44
43
  };
45
44
  };
46
- export declare type SearchQuery = ({ contentTypeIds, customWhere, dynamicOrderBy, excludeIds, featuredResults, fields, filters, fuzzySearch, languages, pageSize, pageIndex, orderBy, searchTerm, versionStatus, webpageTemplates, weightedSearchFields, }: SearchQueryOptions, isFeatured?: boolean) => Query;
47
- export declare type FilterQuery = (contentTypeIds: string[], versionStatus: VersionStatus, customWhere?: CustomWhereClause) => Query;
45
+ export type SearchQuery = ({ contentTypeIds, customWhere, dynamicOrderBy, excludeIds, featuredResults, fields, filters, fuzzySearch, languages, pageSize, pageIndex, omitDefaultSearchFields, orderBy, searchTerm, versionStatus, webpageTemplates, weightedSearchFields, }: SearchQueryOptions, isFeatured?: boolean) => Query;
46
+ export type FilterQuery = (contentTypeIds: string[], versionStatus: VersionStatus, customWhere?: CustomWhereClause) => Query;
@@ -3,7 +3,7 @@ import MappingTemplate from 'jsonpath-mapper/dist/models/Template';
3
3
  import { Context } from './Enums';
4
4
  import { FieldOperators, LogicOperators } from './Queries';
5
5
  import { AppState } from './SearchState';
6
- export declare type Tab = {
6
+ export type Tab = {
7
7
  /** The facet to render as default */
8
8
  defaultFacet?: string;
9
9
  /** The zero-based incrementing id assigned to the tab */
@@ -13,11 +13,11 @@ export declare type Tab = {
13
13
  /** The facet to render the total results count as default */
14
14
  totalCount?: string;
15
15
  };
16
- export declare type CustomApi = {
16
+ export type CustomApi = {
17
17
  /** The uri of the REST API implementing a simple GET request */
18
18
  uri: string;
19
19
  };
20
- export declare type Listing = {
20
+ export type Listing = {
21
21
  /** Display title */
22
22
  title?: string;
23
23
  /** Experimental: use a custom API to retrieve search results */
@@ -34,7 +34,7 @@ export declare type Listing = {
34
34
  /** Display title */
35
35
  title?: string;
36
36
  };
37
- export declare type SearchFacet = {
37
+ export type SearchFacet = {
38
38
  /** The first facet to be shown if no facet is supplied via a route parameter [default false] */
39
39
  isDefault?: boolean;
40
40
  /** Set to true to temporarily disable the facet [default false] */
@@ -42,10 +42,10 @@ export declare type SearchFacet = {
42
42
  /** The id of the tab the facet applies to. Use 0 for default or the id assigned to the tab */
43
43
  tabId?: number;
44
44
  } & Listing;
45
- export declare type SearchFilters = {
45
+ export type SearchFilters = {
46
46
  [key: string]: SearchFilter;
47
47
  };
48
- export declare type SearchFilter = {
48
+ export type SearchFilter = {
49
49
  /** The content type id we will dynamically load entries from and load into state under the items[] */
50
50
  contentTypeId?: string | string[];
51
51
  /** An array of CustomWhereClause to include in the search query when dynamically loading entries via the contentTypeId key */
@@ -71,7 +71,7 @@ export declare type SearchFilter = {
71
71
  /** The title to render next to the filter */
72
72
  title: string;
73
73
  };
74
- export declare type FilterItem = {
74
+ export type FilterItem = {
75
75
  /** Whether the filter is in a selected state */
76
76
  isSelected?: boolean;
77
77
  /** This will usually be the entry id or the taxonomy key */
@@ -81,7 +81,7 @@ export declare type FilterItem = {
81
81
  /** The title to render next to the filter item */
82
82
  title: string;
83
83
  };
84
- export declare type FeaturedResults = {
84
+ export type FeaturedResults = {
85
85
  /** If the featured results are flagged with a certain field value, specify the fieldId containing the flagged value */
86
86
  fieldId?: string | string[];
87
87
  /** If the featured results are flagged with a certain field value, specify the value in the flagged fieldId */
@@ -91,7 +91,7 @@ export declare type FeaturedResults = {
91
91
  /** The number of featured results to retrieve */
92
92
  count?: number;
93
93
  };
94
- export declare type SearchQueryParams = {
94
+ export type SearchQueryParams = {
95
95
  /** An array of assetTypes to search over (sys.dataFormat == 'asset'); Prefix an entry with a "!" to exclude that asset type from the search */
96
96
  assetTypes?: string[];
97
97
  /** An array of contentTypeIds to search over (sys.dataFormat == 'entry'); Prefix an entry with a "!" to exclude that content type from the search */
@@ -112,6 +112,8 @@ export declare type SearchQueryParams = {
112
112
  linkDepth?: number;
113
113
  /** Alters the pagination style to retain previously loaded pages of results after loading next pages */
114
114
  loadMorePaging?: boolean;
115
+ /** A list of fields to omit from the default search fields that are added to weightedSearchFields */
116
+ omitDefaultSearchFields?: string[];
115
117
  /** An array of orderBy expressions to add to the search query */
116
118
  orderBy?: string[];
117
119
  /** The number of items returned per page in the search */
@@ -123,7 +125,7 @@ export declare type SearchQueryParams = {
123
125
  /** An array of WeightedSearchField to include in the search query */
124
126
  weightedSearchFields?: WeightedSearchField[];
125
127
  };
126
- export declare type WhereClause = {
128
+ export type WhereClause = {
127
129
  /** The field we wish to query */
128
130
  field: string;
129
131
  /** The value we want to evaluate with the chosen operator */
@@ -132,14 +134,14 @@ export declare type WhereClause = {
132
134
  /**
133
135
  * N.B. This shares syntax with adding where operators to a search query when using the Delivery API via HTTP, and should be used sparingly for exceptional cases where the standard query falls short
134
136
  */
135
- export declare type CustomWhereClause = (WhereClause | {
137
+ export type CustomWhereClause = (WhereClause | {
136
138
  not: WhereClause;
137
139
  } | {
138
140
  and: WhereClause[];
139
141
  } | {
140
142
  or: WhereClause[];
141
143
  })[];
142
- export declare type WeightedSearchField = {
144
+ export type WeightedSearchField = {
143
145
  /** The id of the field to query against */
144
146
  fieldId: string;
145
147
  /** The weighting applied to the field */
@@ -150,7 +152,7 @@ export declare type WeightedSearchField = {
150
152
  *
151
153
  * You need to provide a search configuration to the reducer so the initialState for your search can be set, this tells the package what you need your search to do, and where to get its data from.
152
154
  */
153
- export declare type SearchConfig = {
155
+ export type SearchConfig = {
154
156
  /** An object with a key for each facet that is required for the search */
155
157
  facets: {
156
158
  [key: string]: SearchFacet;
@@ -166,7 +168,7 @@ export declare type SearchConfig = {
166
168
  /** An Array of Tabs */
167
169
  tabs: Tab[];
168
170
  };
169
- export declare type ConfigTypes = {
171
+ export type ConfigTypes = {
170
172
  [key: string]: SearchFacet;
171
173
  } | {
172
174
  [key: string]: Listing;
@@ -174,15 +176,15 @@ export declare type ConfigTypes = {
174
176
  /**
175
177
  * Type your mapper for mapping API responses (entries) into usable props for your components to render
176
178
  */
177
- export declare type SearchResultsMapper<Target = any, Source = Entry> = (entries: Source[], facet?: string, context?: Context, state?: AppState) => Target[];
179
+ export type SearchResultsMapper<Target = any, Source = Entry> = (entries: Source[], facet?: string, context?: Context, state?: AppState) => Target[];
178
180
  /**
179
181
  * Type your custom filter item mapping function with this to ensure correctly typed FilterItems are returned to work with search functions
180
182
  */
181
- export declare type FilterItemsMapper<T = Entry> = (entries: T[]) => FilterItem[];
183
+ export type FilterItemsMapper<T = Entry> = (entries: T[]) => FilterItem[];
182
184
  /**
183
185
  * The uri object type we need to return from the Navigate mapper after any search action has been called
184
186
  */
185
- export declare type NavigateUri = {
187
+ export type NavigateUri = {
186
188
  path: string;
187
189
  search: string;
188
190
  hash: string;
@@ -190,11 +192,11 @@ export declare type NavigateUri = {
190
192
  /**
191
193
  * Type your jsonpath-mapper mapping template with this to map your next search uri to your custom uri structure after calling any search action
192
194
  */
193
- export declare type SearchUriMapping = MappingTemplate<SearchStateParams>;
195
+ export type SearchUriMapping = MappingTemplate<SearchStateParams>;
194
196
  /**
195
197
  * 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
196
198
  */
197
- export declare type SearchStateParams = {
199
+ export type SearchStateParams = {
198
200
  state: AppState;
199
201
  facet?: string;
200
202
  orderBy?: string;
@@ -203,15 +205,15 @@ export declare type SearchStateParams = {
203
205
  term?: string;
204
206
  };
205
207
  /** 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 */
206
- export declare type NavigateMapper = ({ state, facet, orderBy, pageIndex, pageSize, term, }: SearchStateParams) => NavigateUri;
208
+ export type NavigateMapper = ({ state, facet, orderBy, pageIndex, pageSize, term, }: SearchStateParams) => NavigateUri;
207
209
  /** 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 */
208
- export declare type ResultsInfoMapper<T = any> = (state: AppState) => T;
210
+ export type ResultsInfoMapper<T = any> = (state: AppState) => T;
209
211
  /** 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 */
210
- export declare type CustomApiParamsMapper = (queryParams: SearchQueryParams) => {
212
+ export type CustomApiParamsMapper = (queryParams: SearchQueryParams) => {
211
213
  [key: string]: string;
212
214
  };
213
215
  /** Type your Mappers object with this type to provide a accurate, type-safe "mapper" argument to your search implementation */
214
- export declare type Mappers = {
216
+ export type Mappers = {
215
217
  customApi?: CustomApiParamsMapper;
216
218
  results: SearchResultsMapper;
217
219
  filterItems?: FilterItemsMapper;
@@ -219,4 +221,4 @@ export declare type Mappers = {
219
221
  resultsInfo?: ResultsInfoMapper;
220
222
  };
221
223
  /** SearchTransformations is just an alias for Mappers object / argument */
222
- export declare type SearchTransformations = Mappers;
224
+ export type SearchTransformations = Mappers;
@@ -5,17 +5,17 @@ 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';
8
- declare type Action = {
8
+ type Action = {
9
9
  type: string;
10
10
  };
11
- export declare type WithMappers<T> = T & {
11
+ export type WithMappers<T> = T & {
12
12
  mappers: Mappers;
13
13
  };
14
- export declare type DebugFlags = boolean | {
14
+ export type DebugFlags = boolean | {
15
15
  executeSearch?: boolean;
16
16
  preloadOtherFacets?: boolean;
17
17
  };
18
- export declare type TriggerSearchParams = {
18
+ export type TriggerSearchParams = {
19
19
  config?: SearchFacet | Listing;
20
20
  context: Context | string;
21
21
  debug?: DebugFlags;
@@ -28,9 +28,9 @@ export declare type TriggerSearchParams = {
28
28
  [key: string]: string;
29
29
  };
30
30
  };
31
- export declare type TriggerSearchAction = Action & TriggerSearchParams;
32
- export declare type TriggerSearchActionCreator = (p: TriggerSearchParams) => TriggerSearchAction;
33
- declare type InitListingParams = {
31
+ export type TriggerSearchAction = Action & TriggerSearchParams;
32
+ export type TriggerSearchActionCreator = (p: TriggerSearchParams) => TriggerSearchAction;
33
+ type InitListingParams = {
34
34
  context: Context;
35
35
  debug?: DebugFlags;
36
36
  defaultLang?: string;
@@ -43,12 +43,12 @@ declare type InitListingParams = {
43
43
  };
44
44
  preload?: boolean;
45
45
  };
46
- export declare type InitListingAction = Action & InitListingParams & {
46
+ export type InitListingAction = Action & InitListingParams & {
47
47
  ssr?: boolean;
48
48
  };
49
- export declare type SetRouteFiltersOptions = Partial<InitListingAction>;
50
- export declare type InitListingActionCreator = (p: InitListingParams) => InitListingAction;
51
- export declare type LoadFiltersSearchResults = Action & {
49
+ export type SetRouteFiltersOptions = Partial<InitListingAction>;
50
+ export type InitListingActionCreator = (p: InitListingParams) => InitListingAction;
51
+ export type LoadFiltersSearchResults = Action & {
52
52
  error: any;
53
53
  facetKey: string;
54
54
  filterKey: string;
@@ -57,7 +57,7 @@ export declare type LoadFiltersSearchResults = Action & {
57
57
  context: Context;
58
58
  mapper: Mappers['filterItems'];
59
59
  };
60
- export declare type SearchResults = {
60
+ export type SearchResults = {
61
61
  action: ExecuteSearchAction;
62
62
  featuredResult?: TimedSearchResponse;
63
63
  pageIndex: number;
@@ -65,7 +65,7 @@ export declare type SearchResults = {
65
65
  result: TimedSearchResponse;
66
66
  state: AppState;
67
67
  };
68
- export declare type LoadFiltersCompleteAction = Action & {
68
+ export type LoadFiltersCompleteAction = Action & {
69
69
  error: any;
70
70
  facetKey: string;
71
71
  filterKey: string;
@@ -74,14 +74,14 @@ export declare type LoadFiltersCompleteAction = Action & {
74
74
  context: Context;
75
75
  mapper: Mappers['filterItems'];
76
76
  };
77
- export declare type EnsureSearchAction = InitListingAction & {
77
+ export type EnsureSearchAction = InitListingAction & {
78
78
  ogState: AppState;
79
79
  };
80
- export declare type ExecuteSearchAction = EnsureSearchAction & {
80
+ export type ExecuteSearchAction = EnsureSearchAction & {
81
81
  preload: boolean;
82
82
  queryParams: QueryParams;
83
83
  };
84
- export declare type SetSearchEntriesParams = {
84
+ export type SetSearchEntriesParams = {
85
85
  type: string;
86
86
  context: Context;
87
87
  defaultLang: string;
@@ -95,41 +95,41 @@ export declare type SetSearchEntriesParams = {
95
95
  [key: string]: string;
96
96
  };
97
97
  };
98
- export declare type SetSearchEntriesAction = Action & SetSearchEntriesParams;
99
- export declare type ApplySearchFilterAction = Action & {
98
+ export type SetSearchEntriesAction = Action & SetSearchEntriesParams;
99
+ export type ApplySearchFilterAction = Action & {
100
100
  filter: string;
101
101
  key: string;
102
102
  isUnknownItem: boolean;
103
- scrollYPos?: number;
103
+ scrollToElement?: string;
104
104
  };
105
- export declare type ApplySearchFilterActionCreator = (filter: string, key: string) => ApplySearchFilterAction;
106
- export declare type ClearFiltersAction = Action;
107
- export declare type ClearFiltersActionCreator = (filterKey?: string) => ClearFiltersAction;
108
- export declare type UpdateCurrentFacetAction = Action & {
105
+ export type ApplySearchFilterActionCreator = (filter: string, key: string) => ApplySearchFilterAction;
106
+ export type ClearFiltersAction = Action;
107
+ export type ClearFiltersActionCreator = (filterKey?: string) => ClearFiltersAction;
108
+ export type UpdateCurrentFacetAction = Action & {
109
109
  facet: string;
110
110
  };
111
- export declare type UpdateCurrentFacetActionCreator = (facet: string) => UpdateCurrentFacetAction;
112
- export declare type UpdateCurrentTabAction = Action & {
111
+ export type UpdateCurrentFacetActionCreator = (facet: string) => UpdateCurrentFacetAction;
112
+ export type UpdateCurrentTabAction = Action & {
113
113
  id: number;
114
114
  };
115
- export declare type UpdateCurrentTabActionCreator = (id: number) => UpdateCurrentFacetAction;
116
- export declare type UpdateSearchTermAction = Action & {
115
+ export type UpdateCurrentTabActionCreator = (id: number) => UpdateCurrentFacetAction;
116
+ export type UpdateSearchTermAction = Action & {
117
117
  term: string;
118
118
  };
119
- export declare type UpdateSearchTermActionCreator = (term: string) => UpdateSearchTermAction;
120
- export declare type UpdateSortOrderAction = Action & {
119
+ export type UpdateSearchTermActionCreator = (term: string) => UpdateSearchTermAction;
120
+ export type UpdateSortOrderAction = Action & {
121
121
  orderBy: string;
122
122
  facet: string;
123
123
  };
124
- export declare type UpdateSortOrderActionCreator = (orderBy: string, facet: string) => UpdateSortOrderAction;
125
- export declare type UpdatePageIndexAction = Action & {
124
+ export type UpdateSortOrderActionCreator = (orderBy: string, facet: string) => UpdateSortOrderAction;
125
+ export type UpdatePageIndexAction = Action & {
126
126
  pageIndex: number;
127
- scrollYPos?: number;
127
+ scrollToElement?: string;
128
128
  };
129
- export declare type UpdatePageIndexActionCreator = (pageIndex: number) => UpdatePageIndexAction;
130
- export declare type UpdatePageSizeAction = Action & {
129
+ export type UpdatePageIndexActionCreator = (pageIndex: number) => UpdatePageIndexAction;
130
+ export type UpdatePageSizeAction = Action & {
131
131
  pageSize: number;
132
- scrollYPos?: number;
132
+ scrollToElement?: string;
133
133
  };
134
- export declare type UpdatePageSizeActionCreator = (pageSize: number) => UpdatePageSizeAction;
134
+ export type UpdatePageSizeActionCreator = (pageSize: number) => UpdatePageSizeAction;
135
135
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Context } from './Enums';
2
2
  import { CustomWhereClause } from './Search';
3
- export declare type AppState = Record<'search', SearchState> & Record<string, any>;
4
- export declare type SearchState = {
3
+ export type AppState = Record<'search', SearchState> & Record<string, any>;
4
+ export type SearchState = {
5
5
  context: keyof typeof Context;
6
6
  currentFacet: string;
7
7
  currentListing: string;
@@ -12,10 +12,10 @@ export declare type SearchState = {
12
12
  tabs: Tab[];
13
13
  config: Record<string, boolean>;
14
14
  };
15
- export declare type Facets = {
15
+ export type Facets = {
16
16
  [key: string]: Facet;
17
17
  };
18
- export declare type Facet = {
18
+ export type Facet = {
19
19
  entries: {
20
20
  isLoading: boolean;
21
21
  isError: boolean;
@@ -53,10 +53,10 @@ export declare type Facet = {
53
53
  tabId: number;
54
54
  title: string;
55
55
  };
56
- export declare type Filters = {
56
+ export type Filters = {
57
57
  [key: string]: Filter;
58
58
  };
59
- export declare type Filter = {
59
+ export type Filter = {
60
60
  contentTypeId?: string;
61
61
  customWhere?: CustomWhereClause;
62
62
  defaultValue?: string;
@@ -70,7 +70,7 @@ export declare type Filter = {
70
70
  renderable?: boolean;
71
71
  title?: string;
72
72
  };
73
- export declare type FilterItem = {
73
+ export type FilterItem = {
74
74
  contentTypeId?: string;
75
75
  title?: string;
76
76
  type?: string;
@@ -78,10 +78,10 @@ export declare type FilterItem = {
78
78
  path?: string;
79
79
  isSelected: boolean;
80
80
  };
81
- export declare type SelectedFilters = {
81
+ export type SelectedFilters = {
82
82
  [k: string]: string[];
83
83
  };
84
- export declare type Paging = {
84
+ export type Paging = {
85
85
  isLoading: boolean;
86
86
  pageCount: number;
87
87
  pageIndex: number;
@@ -90,14 +90,14 @@ export declare type Paging = {
90
90
  prevPageIndex: number;
91
91
  totalCount: number;
92
92
  };
93
- export declare type Tab = {
93
+ export type Tab = {
94
94
  currentFacet: string;
95
95
  defaultFacet: string;
96
96
  id: number;
97
97
  label: string;
98
98
  totalCount: number;
99
99
  };
100
- export declare type TabAndFacets = Tab & {
100
+ export type TabAndFacets = Tab & {
101
101
  facets: {
102
102
  [key: string]: Facet;
103
103
  };
@@ -1,6 +1,6 @@
1
1
  import { Entry } from 'contensis-delivery-api/lib/models';
2
2
  import { PagedList } from 'contensis-core-api';
3
- export declare type TimedSearchResponse = {
3
+ export type TimedSearchResponse = {
4
4
  duration: number;
5
5
  payload: PagedList<Entry> | any[];
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import { Facet, Filter, Paging, Tab } from './SearchState';
2
- export declare type WithSearch<T> = {
2
+ export type WithSearch<T> = {
3
3
  className: string;
4
4
  /** Dispatch action to clear all selected filters */
5
5
  clearFilters: Function;
@@ -11,15 +11,15 @@ 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, scrollYPos?: number | undefined) => {
14
+ export declare const updatePageIndex: (pageIndex: number, scrollToElement?: string) => {
15
15
  type: string;
16
16
  pageIndex: number;
17
- scrollYPos: number | undefined;
17
+ scrollToElement: string | undefined;
18
18
  };
19
- export declare const updatePageSize: (pageSize: number, scrollYPos?: number | undefined) => {
19
+ export declare const updatePageSize: (pageSize: number, scrollToElement?: string) => {
20
20
  type: string;
21
21
  pageSize: number;
22
- scrollYPos: number | undefined;
22
+ scrollToElement: string | undefined;
23
23
  };
24
24
  export declare const updateCurrentFacet: (facet: string) => {
25
25
  type: string;
@@ -33,14 +33,14 @@ export declare const updateSearchTerm: (term: string) => {
33
33
  type: string;
34
34
  term: string;
35
35
  };
36
- export declare const updateSelectedFilters: (filter: string, key: string, isUnknownItem?: boolean, scrollYPos?: number | undefined) => {
36
+ export declare const updateSelectedFilters: (filter: string, key: string, isUnknownItem?: boolean, scrollToElement?: string) => {
37
37
  type: string;
38
38
  filter: string;
39
39
  key: string;
40
40
  isUnknownItem: boolean;
41
- scrollYPos: number | undefined;
41
+ scrollToElement: string | undefined;
42
42
  };
43
- export declare const updateSortOrder: (orderBy: string, facet?: string | undefined) => {
43
+ export declare const updateSortOrder: (orderBy: string, facet?: string) => {
44
44
  type: string;
45
45
  orderBy: string;
46
46
  facet: string | undefined;