@zengenti/contensis-react-base 3.0.0-beta.4 → 3.0.0-beta.43
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.
- package/README.md +4 -4
- package/cjs/{App-581b6653.js → App-2ff001f6.js} +139 -124
- package/cjs/App-2ff001f6.js.map +1 -0
- package/cjs/{RouteLoader-282c03ab.js → RouteLoader-2ed14766.js} +44 -30
- package/cjs/RouteLoader-2ed14766.js.map +1 -0
- package/cjs/ToJs-09204afd.js +129 -0
- package/cjs/ToJs-09204afd.js.map +1 -0
- package/cjs/{actions-12871aca.js → actions-6b9ef168.js} +9 -8
- package/cjs/actions-6b9ef168.js.map +1 -0
- package/cjs/client.js +43 -22
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +46 -49
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +275 -275
- package/cjs/forms.js.map +1 -1
- package/cjs/fromJSLeaveImmer-65d26804.js +28 -0
- package/cjs/fromJSLeaveImmer-65d26804.js.map +1 -0
- package/cjs/{login-81d7f9ef.js → login-d67b82aa.js} +113 -79
- package/cjs/login-d67b82aa.js.map +1 -0
- package/cjs/{reducers-fde41d6b.js → reducers-3a4f8971.js} +26 -25
- package/cjs/reducers-3a4f8971.js.map +1 -0
- package/cjs/redux.js +13 -14
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +9 -8
- package/cjs/routing.js.map +1 -1
- package/cjs/search.js +418 -256
- package/cjs/search.js.map +1 -1
- package/cjs/{selectors-ed26ed97.js → selectors-2c1b1183.js} +8 -4
- package/cjs/selectors-2c1b1183.js.map +1 -0
- package/cjs/user.js +32 -23
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +49 -46
- package/cjs/util.js.map +1 -1
- package/cjs/{version-f061e409.js → version-951bc80c.js} +58 -52
- package/cjs/version-951bc80c.js.map +1 -0
- package/cjs/{version-0c190929.js → version-dcfdafd9.js} +5 -5
- package/cjs/{version-0c190929.js.map → version-dcfdafd9.js.map} +1 -1
- package/esm/{App-122f28a3.js → App-7b3aee16.js} +120 -124
- package/esm/App-7b3aee16.js.map +1 -0
- package/esm/{RouteLoader-c2faac87.js → RouteLoader-d4b4d320.js} +37 -23
- package/esm/RouteLoader-d4b4d320.js.map +1 -0
- package/esm/ToJs-2627ce21.js +99 -0
- package/esm/ToJs-2627ce21.js.map +1 -0
- package/esm/{actions-3cc39599.js → actions-5437f43d.js} +8 -7
- package/esm/actions-5437f43d.js.map +1 -0
- package/esm/client.js +22 -20
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +28 -31
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +5 -5
- package/esm/forms.js.map +1 -1
- package/esm/fromJSLeaveImmer-e2f0f331.js +26 -0
- package/esm/fromJSLeaveImmer-e2f0f331.js.map +1 -0
- package/esm/{login-92db44d1.js → login-f6dfbe1b.js} +97 -60
- package/esm/login-f6dfbe1b.js.map +1 -0
- package/esm/{reducers-d6c0edb1.js → reducers-8e5d6232.js} +26 -25
- package/esm/reducers-8e5d6232.js.map +1 -0
- package/esm/redux.js +14 -13
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +9 -8
- package/esm/routing.js.map +1 -1
- package/esm/search.js +387 -244
- package/esm/search.js.map +1 -1
- package/esm/{selectors-82e71d8e.js → selectors-65f0f31c.js} +9 -6
- package/esm/selectors-65f0f31c.js.map +1 -0
- package/esm/user.js +31 -22
- package/esm/user.js.map +1 -1
- package/esm/util.js +18 -11
- package/esm/util.js.map +1 -1
- package/esm/version-696796d7.js +15 -0
- package/esm/{version-59c8f9be.js.map → version-696796d7.js.map} +1 -1
- package/esm/{version-cb9cd09d.js → version-b2ca1dab.js} +38 -31
- package/esm/version-b2ca1dab.js.map +1 -0
- package/models/redux/appstate.d.ts +5 -10
- package/models/redux/reducers/navigation.d.ts +1 -6
- package/models/redux/reducers/version.d.ts +1 -5
- package/models/redux/selectors/navigation.d.ts +2 -1
- package/models/routing/redux/actions.d.ts +1 -1
- package/models/routing/redux/reducers.d.ts +1 -21
- package/models/routing/redux/selectors.d.ts +1 -1
- package/models/routing/routes.d.ts +3 -2
- package/models/routing/util/expressions.d.ts +3 -2
- package/models/routing/util/queries.d.ts +1 -1
- package/models/search/containers/withListing.d.ts +1 -1
- package/models/search/containers/withSearch.d.ts +1 -1
- package/models/search/hooks/useListing.hook.d.ts +3 -0
- package/models/search/hooks/useMinilist.hook.d.ts +2 -9
- package/models/search/index.d.ts +1 -0
- package/models/search/models/Queries.d.ts +8 -5
- package/models/search/models/Search.d.ts +58 -26
- package/models/search/models/SearchActions.d.ts +4 -3
- package/models/search/models/SearchProps.d.ts +25 -2
- package/models/search/models/SearchState.d.ts +5 -1
- package/models/search/models/index.d.ts +2 -1
- package/models/search/redux/actions.d.ts +2 -1
- package/models/search/redux/reducers.d.ts +230 -314
- package/models/search/redux/sagas.d.ts +5 -5
- package/models/search/redux/selectors.d.ts +5 -10
- package/models/search/search/expressions.d.ts +2 -6
- package/models/search/transformations/entry-to-filteritem.mapper.d.ts +2 -1
- package/models/search/transformations/filter-to-filterexpression.mapper.d.ts +6 -0
- package/models/search/transformations/filters-to-filterexpressions.mapper.d.ts +3 -0
- package/models/search/transformations/index.d.ts +3 -0
- package/models/search/transformations/state-to-searchuri.d.ts +2 -13
- package/models/server/util/headers.d.ts +3 -2
- package/models/testImmer/redux/reducer.d.ts +1 -7
- package/models/user/components/Login.d.ts +1 -2
- package/models/user/components/LoginForm.d.ts +1 -2
- package/models/user/hocs/withLogin.d.ts +2 -2
- package/models/user/hooks/useChangePassword.d.ts +5 -5
- package/models/user/hooks/useForgotPassword.d.ts +6 -6
- package/models/user/hooks/useLogin.d.ts +9 -45
- package/models/user/hooks/useRegistration.d.ts +4 -4
- package/models/user/redux/reducers.d.ts +5 -32
- package/models/user/redux/sagas/login.d.ts +11 -8
- package/models/user/redux/selectors.d.ts +33 -71
- package/models/user/util/LoginHelper.class.d.ts +4 -3
- package/models/util/json-mapper.d.ts +9 -3
- package/models/util/merge.d.ts +1 -0
- package/package-lock.json +2006 -4796
- package/package.json +47 -48
- package/cjs/App-581b6653.js.map +0 -1
- package/cjs/RouteLoader-282c03ab.js.map +0 -1
- package/cjs/ToJs-87edc45d.js +0 -230
- package/cjs/ToJs-87edc45d.js.map +0 -1
- package/cjs/actions-12871aca.js.map +0 -1
- package/cjs/fromJSLeaveImmer-9b550c8e.js +0 -40
- package/cjs/fromJSLeaveImmer-9b550c8e.js.map +0 -1
- package/cjs/login-81d7f9ef.js.map +0 -1
- package/cjs/reducers-fde41d6b.js.map +0 -1
- package/cjs/selectors-ed26ed97.js.map +0 -1
- package/cjs/version-f061e409.js.map +0 -1
- package/esm/App-122f28a3.js.map +0 -1
- package/esm/RouteLoader-c2faac87.js.map +0 -1
- package/esm/ToJs-52fee252.js +0 -199
- package/esm/ToJs-52fee252.js.map +0 -1
- package/esm/actions-3cc39599.js.map +0 -1
- package/esm/fromJSLeaveImmer-e44d1a91.js +0 -38
- package/esm/fromJSLeaveImmer-e44d1a91.js.map +0 -1
- package/esm/login-92db44d1.js.map +0 -1
- package/esm/reducers-d6c0edb1.js.map +0 -1
- package/esm/selectors-82e71d8e.js.map +0 -1
- package/esm/version-59c8f9be.js +0 -15
- package/esm/version-cb9cd09d.js.map +0 -1
- package/models/search/transformations/filters-to-filterexpression.d.ts +0 -1
- package/models/search/transformations/filters-to-filterexpression.mapper.d.ts +0 -2
- package/models/server/features/caching/cacheHashing.d.ts +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getImmutableOrJS, r as action } from './selectors-65f0f31c.js';
|
|
2
|
+
import { all } from '@redux-saga/core/effects';
|
|
3
|
+
import { compose, applyMiddleware, createStore as createStore$1, combineReducers } from 'redux';
|
|
2
4
|
import thunkMiddleware from 'redux-thunk';
|
|
3
5
|
import createSagaMiddleware, { END } from 'redux-saga';
|
|
4
6
|
import { createInjectorsEnhancer } from 'redux-injectors';
|
|
5
7
|
import { produce } from 'immer';
|
|
6
|
-
import
|
|
7
|
-
import { U as
|
|
8
|
-
import {
|
|
9
|
-
import { g as getImmutableOrJS, p as action } from './selectors-82e71d8e.js';
|
|
8
|
+
import merge from 'deepmerge';
|
|
9
|
+
import { h as SET_TARGET_PROJECT, i as SET_SURROGATE_KEYS, e as SET_SIBLINGS, b as SET_ROUTE, S as SET_NAVIGATION_PATH, U as UPDATE_LOADING_STATE, c as SET_ENTRY, d as SET_ANCESTORS } from './actions-5437f43d.js';
|
|
10
|
+
import { U as UserReducer } from './reducers-8e5d6232.js';
|
|
10
11
|
|
|
11
12
|
const ACTION_PREFIX = '@NAVIGATION/';
|
|
12
13
|
const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;
|
|
13
14
|
const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`;
|
|
14
15
|
const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`;
|
|
15
16
|
|
|
16
|
-
var navigation = /*#__PURE__*/Object.freeze({
|
|
17
|
+
var navigation$1 = /*#__PURE__*/Object.freeze({
|
|
17
18
|
__proto__: null,
|
|
18
19
|
GET_NODE_TREE: GET_NODE_TREE,
|
|
19
20
|
SET_NODE_TREE: SET_NODE_TREE,
|
|
20
21
|
GET_NODE_TREE_ERROR: GET_NODE_TREE_ERROR
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
const initialState = {
|
|
24
|
+
const initialState$2 = {
|
|
24
25
|
root: null,
|
|
25
|
-
treeDepends: [],
|
|
26
26
|
isError: false,
|
|
27
27
|
isReady: false
|
|
28
28
|
};
|
|
@@ -44,25 +44,35 @@ var NavigationReducer = produce((state, action) => {
|
|
|
44
44
|
default:
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
}, initialState);
|
|
47
|
+
}, initialState$2);
|
|
48
|
+
|
|
49
|
+
const combineMerge = (target, source, options) => {
|
|
50
|
+
const destination = target.slice();
|
|
51
|
+
source.forEach((item, index) => {
|
|
52
|
+
if (typeof destination[index] === 'undefined') {
|
|
53
|
+
destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);
|
|
54
|
+
} else if (options.isMergeableObject(item)) {
|
|
55
|
+
destination[index] = merge(target[index], item, options);
|
|
56
|
+
} else if (target.indexOf(item) === -1) {
|
|
57
|
+
destination.push(item);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return destination;
|
|
61
|
+
};
|
|
48
62
|
|
|
49
63
|
const initialState$1 = {
|
|
50
64
|
currentHostname: null,
|
|
51
|
-
contentTypeId: null,
|
|
52
65
|
currentPath: '/',
|
|
53
66
|
currentNode: {},
|
|
54
67
|
currentNodeAncestors: [],
|
|
55
68
|
currentProject: 'unknown',
|
|
56
69
|
entryID: null,
|
|
57
70
|
entry: null,
|
|
58
|
-
currentTreeId: null,
|
|
59
|
-
entryDepends: [],
|
|
60
71
|
error: undefined,
|
|
61
72
|
isError: false,
|
|
62
73
|
isLoading: false,
|
|
63
74
|
location: {},
|
|
64
75
|
mappedEntry: null,
|
|
65
|
-
nodeDepends: [],
|
|
66
76
|
notFound: false,
|
|
67
77
|
staticRoute: null,
|
|
68
78
|
statusCode: 200
|
|
@@ -117,7 +127,6 @@ var RoutingReducer = produce((state, action) => {
|
|
|
117
127
|
}
|
|
118
128
|
|
|
119
129
|
if (!node) {
|
|
120
|
-
state.nodeDepends = null;
|
|
121
130
|
state.currentNode = null;
|
|
122
131
|
} else {
|
|
123
132
|
// On Set Node, we reset all dependants.
|
|
@@ -187,16 +196,11 @@ var RoutingReducer = produce((state, action) => {
|
|
|
187
196
|
{
|
|
188
197
|
// Can be null in some cases like the homepage.
|
|
189
198
|
let currentNodeSiblingParent = null;
|
|
190
|
-
let siblingIDs = [];
|
|
191
199
|
|
|
192
200
|
if (action.siblings && action.siblings.length > 0) {
|
|
193
201
|
currentNodeSiblingParent = action.siblings[0].parentId;
|
|
194
|
-
siblingIDs = action.siblings.map(node => node.id);
|
|
195
202
|
}
|
|
196
203
|
|
|
197
|
-
const currentNodeDepends = state.nodeDepends;
|
|
198
|
-
const allNodeDepends = [...new Set([...new Set(siblingIDs), currentNodeDepends])];
|
|
199
|
-
state.nodeDepends = allNodeDepends;
|
|
200
204
|
state.currentNodeSiblings = action.siblings;
|
|
201
205
|
state.currentNodeSiblingsParent = currentNodeSiblingParent;
|
|
202
206
|
return;
|
|
@@ -204,15 +208,16 @@ var RoutingReducer = produce((state, action) => {
|
|
|
204
208
|
|
|
205
209
|
case SET_SURROGATE_KEYS:
|
|
206
210
|
{
|
|
207
|
-
|
|
211
|
+
// console.info(`SET_SURROGATE_KEYS: '${action.url}' keys: ${action.keys}`);
|
|
212
|
+
state.surrogateKeys = merge(state.surrogateKeys, (action.keys || '').split(' '), {
|
|
213
|
+
arrayMerge: combineMerge
|
|
214
|
+
});
|
|
208
215
|
return;
|
|
209
216
|
}
|
|
210
217
|
|
|
211
218
|
case SET_TARGET_PROJECT:
|
|
212
219
|
{
|
|
213
220
|
state.currentProject = action.project;
|
|
214
|
-
state.currentTreeId = ''; // getTreeID(action.project))
|
|
215
|
-
|
|
216
221
|
state.allowedGroups = action.allowedGroups;
|
|
217
222
|
state.currentHostname = action.hostname;
|
|
218
223
|
return;
|
|
@@ -227,13 +232,13 @@ const VERSION_PREFIX = '@VERSION/';
|
|
|
227
232
|
const SET_VERSION = `${VERSION_PREFIX}SET_VERSION`;
|
|
228
233
|
const SET_VERSION_STATUS = `${VERSION_PREFIX}SET_VERSION_STATUS`;
|
|
229
234
|
|
|
230
|
-
var version = /*#__PURE__*/Object.freeze({
|
|
235
|
+
var version$1 = /*#__PURE__*/Object.freeze({
|
|
231
236
|
__proto__: null,
|
|
232
237
|
SET_VERSION: SET_VERSION,
|
|
233
238
|
SET_VERSION_STATUS: SET_VERSION_STATUS
|
|
234
239
|
});
|
|
235
240
|
|
|
236
|
-
const initialState
|
|
241
|
+
const initialState = {
|
|
237
242
|
commitRef: null,
|
|
238
243
|
buildNo: null,
|
|
239
244
|
contensisVersionStatus: 'published'
|
|
@@ -256,7 +261,7 @@ var VersionReducer = produce((state, action) => {
|
|
|
256
261
|
default:
|
|
257
262
|
return;
|
|
258
263
|
}
|
|
259
|
-
}, initialState
|
|
264
|
+
}, initialState);
|
|
260
265
|
|
|
261
266
|
/**
|
|
262
267
|
* This middleware captures 'CALL_HISTORY_METHOD' actions to redirect to the
|
|
@@ -311,7 +316,7 @@ var createStore = (async (featureReducers, initialState, history, stateType) =>
|
|
|
311
316
|
'immutable');
|
|
312
317
|
fromJS = (await import(
|
|
313
318
|
/* webpackChunkName: "from-js" */
|
|
314
|
-
'./fromJSLeaveImmer-
|
|
319
|
+
'./fromJSLeaveImmer-e2f0f331.js')).default;
|
|
315
320
|
combiner = (await import(
|
|
316
321
|
/* webpackChunkName: "redux-immutable" */
|
|
317
322
|
'redux-immutable')).combineReducers;
|
|
@@ -345,12 +350,14 @@ var createStore = (async (featureReducers, initialState, history, stateType) =>
|
|
|
345
350
|
|
|
346
351
|
const hasNavigationTree = state => getImmutableOrJS(state, ['navigation', 'isReady']);
|
|
347
352
|
const selectNavigationRoot = state => getImmutableOrJS(state, ['navigation', 'root']);
|
|
348
|
-
const
|
|
353
|
+
const selectNavigationChildren = state => getImmutableOrJS(state, ['navigation', 'root', 'children']);
|
|
354
|
+
const selectNavigationDepends = () => [];
|
|
349
355
|
|
|
350
|
-
var navigation
|
|
356
|
+
var navigation = /*#__PURE__*/Object.freeze({
|
|
351
357
|
__proto__: null,
|
|
352
358
|
hasNavigationTree: hasNavigationTree,
|
|
353
359
|
selectNavigationRoot: selectNavigationRoot,
|
|
360
|
+
selectNavigationChildren: selectNavigationChildren,
|
|
354
361
|
selectNavigationDepends: selectNavigationDepends
|
|
355
362
|
});
|
|
356
363
|
|
|
@@ -419,11 +426,11 @@ const setVersionStatus = status => action(SET_VERSION_STATUS, {
|
|
|
419
426
|
status
|
|
420
427
|
});
|
|
421
428
|
|
|
422
|
-
var version
|
|
429
|
+
var version = /*#__PURE__*/Object.freeze({
|
|
423
430
|
__proto__: null,
|
|
424
431
|
setVersion: setVersion,
|
|
425
432
|
setVersionStatus: setVersionStatus
|
|
426
433
|
});
|
|
427
434
|
|
|
428
|
-
export { GET_NODE_TREE as G, SET_NODE_TREE as S, setVersion as a, GET_NODE_TREE_ERROR as b, createStore as c, version
|
|
429
|
-
//# sourceMappingURL=version-
|
|
435
|
+
export { GET_NODE_TREE as G, SET_NODE_TREE as S, setVersion as a, GET_NODE_TREE_ERROR as b, createStore as c, version as d, navigation as e, convertSagaArray as f, injectReducer as g, hasNavigationTree as h, injectRedux as i, injectSaga as j, navigation$1 as n, reduxStore as r, setVersionStatus as s, useInjectRedux as u, version$1 as v };
|
|
436
|
+
//# sourceMappingURL=version-b2ca1dab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-b2ca1dab.js","sources":["../src/redux/types/navigation.js","../src/redux/reducers/navigation.ts","../src/util/merge.ts","../src/routing/redux/reducers.ts","../src/redux/types/version.js","../src/redux/reducers/version.ts","../src/redux/store/routerMiddleware.js","../src/redux/store/store.ts","../src/redux/selectors/navigation.js","../src/redux/store/injectors.js","../src/redux/actions/version.js"],"sourcesContent":["const ACTION_PREFIX = '@NAVIGATION/';\nexport const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;\nexport const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`;\nexport const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { SET_NODE_TREE, GET_NODE_TREE_ERROR } from '~/redux/types/navigation';\n\nconst initialState = {\n root: null,\n isError: false,\n isReady: false,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_NODE_TREE: {\n state.root = action.nodes;\n state.isReady = true;\n return;\n }\n case GET_NODE_TREE_ERROR: {\n state.isError = true;\n return;\n }\n default:\n return;\n }\n}, initialState);\n","import merge from 'deepmerge';\n\nexport const combineMerge = (target: any, source: any, options: any) => {\n const destination = target.slice();\n\n source.forEach((item: any, index: any) => {\n if (typeof destination[index] === 'undefined') {\n destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);\n } else if (options.isMergeableObject(item)) {\n destination[index] = merge(target[index], item, options);\n } else if (target.indexOf(item) === -1) {\n destination.push(item);\n }\n });\n return destination;\n};\n","import { Draft, produce } from 'immer';\nimport merge from 'deepmerge';\n\nimport {\n SET_ENTRY,\n SET_NAVIGATION_PATH,\n SET_ANCESTORS,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SIBLINGS,\n SET_SURROGATE_KEYS,\n UPDATE_LOADING_STATE,\n} from './types';\nimport { combineMerge } from '~/util/merge';\n\nconst initialState = {\n currentHostname: null,\n currentPath: '/',\n currentNode: {},\n currentNodeAncestors: [],\n currentProject: 'unknown',\n entryID: null,\n entry: null,\n error: undefined,\n isError: false,\n isLoading: false,\n location: {},\n mappedEntry: null,\n notFound: false,\n staticRoute: null,\n statusCode: 200,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_ANCESTORS: {\n state.currentNodeAncestors = action.ancestors;\n return;\n }\n case SET_ENTRY: {\n const {\n entry,\n error,\n mappedEntry,\n node = {},\n isError = false,\n isLoading = false,\n notFound = false,\n statusCode,\n } = action;\n\n let defaultStatus = 200;\n if (notFound === true && isError === false) defaultStatus = 404;\n else if (isError === true) defaultStatus = statusCode || 500;\n\n if (!entry) {\n state.entryID = null;\n state.entry = null;\n state.error = error;\n state.mappedEntry = null;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n } else {\n state.entryID = action.id;\n state.entry = entry;\n state.error = error;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n\n if (mappedEntry && Object.keys(mappedEntry).length > 0) {\n state.mappedEntry = mappedEntry;\n state.entry = { sys: entry.sys };\n }\n }\n\n if (!node) {\n state.currentNode = null;\n } else {\n // On Set Node, we reset all dependants.\n state.currentNode = node;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { entry, ...nodeWithoutEntry } = node; // We have the entry stored elsewhere, so lets not keep it twice.\n state.currentNode = nodeWithoutEntry;\n }\n return;\n }\n case UPDATE_LOADING_STATE: {\n state.isLoading = action.isLoading;\n return;\n }\n case SET_NAVIGATION_PATH: {\n let staticRoute = {} as any;\n if (action.staticRoute) {\n staticRoute = { ...action.staticRoute };\n }\n if (action.path) {\n // Don't run a path update on initial load as we allready should have it in redux\n const entryUri = state?.entry?.sys?.uri;\n if (entryUri !== action.path) {\n state.currentPath = action.path;\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n\n state.isLoading = typeof window !== 'undefined';\n } else {\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n }\n }\n return;\n }\n case SET_ROUTE: {\n state.nextPath = action.path;\n return;\n }\n case SET_SIBLINGS: {\n // Can be null in some cases like the homepage.\n let currentNodeSiblingParent = null;\n if (action.siblings && action.siblings.length > 0) {\n currentNodeSiblingParent = action.siblings[0].parentId;\n }\n\n state.currentNodeSiblings = action.siblings;\n state.currentNodeSiblingsParent = currentNodeSiblingParent;\n return;\n }\n case SET_SURROGATE_KEYS: {\n // console.info(`SET_SURROGATE_KEYS: '${action.url}' keys: ${action.keys}`);\n state.surrogateKeys = merge(\n state.surrogateKeys,\n (action.keys || '').split(' '),\n { arrayMerge: combineMerge }\n );\n return;\n }\n case SET_TARGET_PROJECT: {\n state.currentProject = action.project;\n state.allowedGroups = action.allowedGroups;\n state.currentHostname = action.hostname;\n return;\n }\n default:\n return state;\n }\n}, initialState);\n","const VERSION_PREFIX = '@VERSION/';\nexport const SET_VERSION = `${VERSION_PREFIX}SET_VERSION`;\nexport const SET_VERSION_STATUS = `${VERSION_PREFIX}SET_VERSION_STATUS`;\n","import { Draft, produce } from 'immer';\nimport { SET_VERSION, SET_VERSION_STATUS } from '~/redux/types/version';\n\nconst initialState = {\n commitRef: null,\n buildNo: null,\n contensisVersionStatus: 'published',\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_VERSION_STATUS: {\n state.contensisVersionStatus = action.status;\n return;\n }\n case SET_VERSION: {\n state.commitRef = action.commitRef;\n state.buildNo = action.buildNo;\n return;\n }\n default:\n return;\n }\n}, initialState);\n","/**\n * This middleware captures 'CALL_HISTORY_METHOD' actions to redirect to the\n * provided history object. This will prevent these actions from reaching your\n * reducer or any middleware that comes after this one.\n */\n/* eslint-disable no-unused-vars */\nconst routerMiddleware = history => store => next => action => {\n if (action.type !== 'CALL_HISTORY_METHOD') {\n return next(action);\n }\n\n const {\n payload: { method, args },\n } = action;\n history[method](...args);\n};\n\nexport default routerMiddleware;\n","import {\n applyMiddleware,\n combineReducers,\n compose,\n createStore,\n Action,\n Store,\n StoreEnhancer,\n} from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport createSagaMiddleware, { END } from 'redux-saga';\nimport { createInjectorsEnhancer } from 'redux-injectors';\n\n// Core reducers\nimport NavigationReducer from '../reducers/navigation';\nimport RoutingReducer from '~/routing/redux/reducers';\nimport UserReducer from '~/user/redux/reducers';\nimport VersionReducer from '../reducers/version';\nimport routerMiddleware from './routerMiddleware';\nimport { AppState } from '../appstate';\nimport { History, MemoryHistory } from 'history';\nimport { StateType } from '~/config';\n\nexport let reduxStore;\n\n/* eslint-disable no-underscore-dangle */\ndeclare let window: Window &\n typeof globalThis & {\n __REDUX_DEVTOOLS_EXTENSION__: any;\n };\n\nexport default async (\n featureReducers: any,\n initialState: AppState,\n history: History | MemoryHistory,\n stateType: StateType\n) => {\n let reduxDevToolsMiddleware = f => f;\n\n if (typeof window != 'undefined') {\n reduxDevToolsMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__()\n : f => f;\n }\n\n const sagaMiddleware = createSagaMiddleware();\n\n const reducers = {\n navigation: NavigationReducer,\n routing: RoutingReducer,\n user: UserReducer,\n version: VersionReducer,\n ...featureReducers,\n };\n\n // Reassign the combiner and fromJS functions when\n // stateType is 'immutable' with dynamic imports\n let combiner = combineReducers;\n let fromJS: any = (obj: any) => obj;\n globalThis.STATE_TYPE = stateType;\n\n if (stateType === 'immutable') {\n globalThis.immutable = await import(\n /* webpackChunkName: \"immutable\" */ 'immutable'\n );\n\n fromJS = (\n await import(/* webpackChunkName: \"from-js\" */ '~/util/fromJSLeaveImmer')\n ).default;\n\n combiner = (\n await import(/* webpackChunkName: \"redux-immutable\" */ 'redux-immutable')\n ).combineReducers;\n }\n\n const createReducer = (injectedReducers = {}) => {\n const rootReducer = combiner<AppState>({\n ...injectedReducers,\n // other non-injected reducers go here\n ...reducers,\n });\n\n return rootReducer;\n };\n\n const store = (initialState: AppState) => {\n const runSaga = sagaMiddleware.run;\n\n const middleware: StoreEnhancer<\n {\n dispatch: unknown;\n },\n unknown\n > = compose(\n applyMiddleware(\n thunkMiddleware,\n sagaMiddleware,\n routerMiddleware(history)\n ),\n createInjectorsEnhancer({\n createReducer,\n runSaga,\n }),\n reduxDevToolsMiddleware\n );\n\n const store: Store<AppState, Action<any>> & {\n runSaga?: typeof runSaga;\n close?: () => void;\n } = createStore<AppState, Action<any>, unknown, unknown>(\n createReducer(),\n initialState,\n middleware\n );\n\n store.runSaga = runSaga;\n store.close = () => store.dispatch(END);\n\n return store;\n };\n\n reduxStore = store(fromJS(initialState));\n return reduxStore;\n};\n","import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const hasNavigationTree = state =>\n getIn(state, ['navigation', 'isReady']);\n\nexport const selectNavigationRoot = state =>\n getIn(state, ['navigation', 'root']);\n\nexport const selectNavigationChildren = state =>\n getIn(state, ['navigation', 'root', 'children']);\n\nexport const selectNavigationDepends = () => [];\n","import { all } from 'redux-saga/effects';\nimport { reduxStore as DefaultStore } from './store';\n\nexport const convertSagaArray = sagas => {\n if (Array.isArray(sagas))\n return function* rootSaga() {\n yield all(sagas);\n };\n return sagas;\n};\n\nexport const injectReducer = ({ key, reducer }, store = DefaultStore) => {\n if (\n Reflect.has(store.injectedReducers, key) &&\n store.injectedReducers[key] === reducer\n )\n return;\n store.injectedReducers[key] = reducer;\n\n store.replaceReducer(store.createReducer(store.injectedReducers));\n};\n\nexport const injectSaga = ({ key, saga }, store = DefaultStore) => {\n const rootSaga = convertSagaArray(saga);\n let hasSaga = Reflect.has(store.injectedSagas, key);\n\n if (process.env.NODE_ENV !== 'production') {\n const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas\n\n if (hasSaga && oldDescriptor.saga !== rootSaga) {\n oldDescriptor.task.cancel();\n hasSaga = false;\n }\n }\n console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);\n\n if (!hasSaga) {\n store.injectedSagas[key] = {\n key,\n saga: rootSaga,\n task: store.runSaga(rootSaga),\n };\n }\n};\n\nexport const injectRedux = ({ key, reducer, saga }, store = DefaultStore) => {\n console.info('injectRedux, key: ', key);\n if (reducer) injectReducer({ key, reducer }, store);\n if (saga) injectSaga({ key, saga }, store);\n};\n\nexport const useInjectRedux = injectRedux;\n","import { action } from '../util';\nimport { SET_VERSION, SET_VERSION_STATUS } from '../types/version';\n\nexport const setVersion = (commitRef, buildNo) =>\n action(SET_VERSION, { commitRef, buildNo });\n\nexport const setVersionStatus = status =>\n action(SET_VERSION_STATUS, { status });\n"],"names":["ACTION_PREFIX","GET_NODE_TREE","SET_NODE_TREE","GET_NODE_TREE_ERROR","initialState","root","isError","isReady","produce","state","action","type","nodes","combineMerge","target","source","options","destination","slice","forEach","item","index","cloneUnlessOtherwiseSpecified","isMergeableObject","merge","indexOf","push","currentHostname","currentPath","currentNode","currentNodeAncestors","currentProject","entryID","entry","error","undefined","isLoading","location","mappedEntry","notFound","staticRoute","statusCode","SET_ANCESTORS","ancestors","SET_ENTRY","node","defaultStatus","id","Object","keys","length","sys","nodeWithoutEntry","UPDATE_LOADING_STATE","SET_NAVIGATION_PATH","path","entryUri","uri","route","component","window","SET_ROUTE","nextPath","SET_SIBLINGS","currentNodeSiblingParent","siblings","parentId","currentNodeSiblings","currentNodeSiblingsParent","SET_SURROGATE_KEYS","surrogateKeys","split","arrayMerge","SET_TARGET_PROJECT","project","allowedGroups","hostname","VERSION_PREFIX","SET_VERSION","SET_VERSION_STATUS","commitRef","buildNo","contensisVersionStatus","status","routerMiddleware","history","store","next","payload","method","args","reduxStore","featureReducers","stateType","reduxDevToolsMiddleware","f","__REDUX_DEVTOOLS_EXTENSION__","sagaMiddleware","createSagaMiddleware","reducers","navigation","NavigationReducer","routing","RoutingReducer","user","UserReducer","version","VersionReducer","combiner","combineReducers","fromJS","obj","globalThis","STATE_TYPE","immutable","default","createReducer","injectedReducers","rootReducer","runSaga","run","middleware","compose","applyMiddleware","thunkMiddleware","createInjectorsEnhancer","createStore","close","dispatch","END","hasNavigationTree","getIn","selectNavigationRoot","selectNavigationChildren","selectNavigationDepends","convertSagaArray","sagas","Array","isArray","rootSaga","all","injectReducer","key","reducer","DefaultStore","Reflect","has","replaceReducer","injectSaga","saga","hasSaga","injectedSagas","process","env","NODE_ENV","oldDescriptor","task","cancel","console","info","injectRedux","useInjectRedux","setVersion","setVersionStatus"],"mappings":";;;;;;;;;;;AAAA,MAAMA,aAAa,GAAG,cAAtB;MACaC,aAAa,GAAI,GAAED,aAAc;MACjCE,aAAa,GAAI,GAAEF,aAAc;MACjCG,mBAAmB,GAAI,GAAEH,aAAc;;;;;;;;;ACApD,MAAMI,cAAY,GAAG;AACnBC,EAAAA,IAAI,EAAE,IADa;AAEnBC,EAAAA,OAAO,EAAE,KAFU;AAGnBC,EAAAA,OAAO,EAAE;AAHU,CAArB;AAMA,wBAAeC,OAAO,CAAC,CAACC,KAAD,EAAoBC,MAApB,KAA+B;AACpD,UAAQA,MAAM,CAACC,IAAf;AACE,SAAKT,aAAL;AAAoB;AA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AA,SAAF;AAAaC,EAAAA;AAAb,CAAd;MAEKkF,gBAAgB,GAAGhF,MAAM,IACpCzE,MAAM,CAACqE,kBAAD,EAAqB;AAAEI,EAAAA;AAAF,CAArB;;;;;;;;;;"}
|
|
@@ -6,13 +6,11 @@ import { StaticRoute } from "../routing/routes";
|
|
|
6
6
|
export declare type AppState = {
|
|
7
7
|
navigation: {
|
|
8
8
|
root: Node | null;
|
|
9
|
-
treeDepends: string[];
|
|
10
9
|
isError: boolean;
|
|
11
10
|
isReady: boolean;
|
|
12
11
|
};
|
|
13
12
|
routing: {
|
|
14
13
|
currentHostname: null;
|
|
15
|
-
contentTypeId: null;
|
|
16
14
|
currentPath: string;
|
|
17
15
|
currentNode: Node & {
|
|
18
16
|
children: Node[];
|
|
@@ -22,7 +20,6 @@ export declare type AppState = {
|
|
|
22
20
|
currentProject: string;
|
|
23
21
|
entryID: string | null;
|
|
24
22
|
entry: Entry | null;
|
|
25
|
-
entryDepends: string[];
|
|
26
23
|
error?: Error | any;
|
|
27
24
|
isError: boolean;
|
|
28
25
|
isLoading: boolean;
|
|
@@ -33,16 +30,12 @@ export declare type AppState = {
|
|
|
33
30
|
key?: string;
|
|
34
31
|
};
|
|
35
32
|
mappedEntry: Record<string, any> | null;
|
|
36
|
-
nodeDepends: string[];
|
|
37
33
|
notFound: boolean;
|
|
38
34
|
staticRoute: MatchedRoute<Record<string, any>, StaticRoute>;
|
|
39
35
|
statusCode: number;
|
|
40
36
|
};
|
|
41
37
|
user: {
|
|
42
38
|
authenticationState: {
|
|
43
|
-
authenticated: boolean;
|
|
44
|
-
authenticationError: boolean;
|
|
45
|
-
authenticationErrorMessage: string | null;
|
|
46
39
|
clientCredentials: {
|
|
47
40
|
bearerToken: string;
|
|
48
41
|
bearerTokenExpiryDate: Date;
|
|
@@ -50,15 +43,17 @@ export declare type AppState = {
|
|
|
50
43
|
refreshTokenExpiryDate: Date;
|
|
51
44
|
contensisClassicToken: string;
|
|
52
45
|
} | null;
|
|
53
|
-
error: boolean;
|
|
54
46
|
errorMessage: string | null;
|
|
55
|
-
|
|
47
|
+
isAuthenticated: boolean;
|
|
48
|
+
isAuthenticationError: boolean;
|
|
49
|
+
isError: boolean;
|
|
50
|
+
isLoading: boolean;
|
|
56
51
|
};
|
|
57
52
|
groups: Group[];
|
|
58
53
|
isZengentiStaff?: boolean;
|
|
59
54
|
registration?: {
|
|
60
55
|
error: Error | null;
|
|
61
|
-
|
|
56
|
+
isLoading: boolean;
|
|
62
57
|
success: boolean;
|
|
63
58
|
};
|
|
64
59
|
passwordResetRequest?: {
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
readonly root: null;
|
|
3
|
-
readonly treeDepends: readonly never[];
|
|
4
|
-
readonly isError: boolean;
|
|
5
|
-
readonly isReady: boolean;
|
|
6
|
-
}>(base?: Base | undefined, action: any) => Base;
|
|
1
|
+
declare const _default: (state?: any, action: any) => any;
|
|
7
2
|
export default _default;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
readonly commitRef: null;
|
|
3
|
-
readonly buildNo: null;
|
|
4
|
-
readonly contensisVersionStatus: string;
|
|
5
|
-
}>(base?: Base | undefined, action: any) => Base;
|
|
1
|
+
declare const _default: (state?: any, action: any) => any;
|
|
6
2
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export function hasNavigationTree(state: any): any;
|
|
2
2
|
export function selectNavigationRoot(state: any): any;
|
|
3
|
-
export function
|
|
3
|
+
export function selectNavigationChildren(state: any): any;
|
|
4
|
+
export function selectNavigationDepends(): never[];
|
|
@@ -3,4 +3,4 @@ export declare const setNavigationPath: (path: any, location: any, staticRoute:
|
|
|
3
3
|
export declare const setCurrentProject: (project: any, allowedGroups: any, hostname: any) => any;
|
|
4
4
|
export declare const setRoute: (path: any, state: any) => any;
|
|
5
5
|
export declare const setRouteEntry: (entry: any) => any;
|
|
6
|
-
export declare const setSurrogateKeys: (keys: any) => any;
|
|
6
|
+
export declare const setSurrogateKeys: (keys: any, url: any) => any;
|
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
readonly currentHostname: null;
|
|
3
|
-
readonly contentTypeId: null;
|
|
4
|
-
readonly currentPath: string;
|
|
5
|
-
readonly currentNode: {};
|
|
6
|
-
readonly currentNodeAncestors: readonly never[];
|
|
7
|
-
readonly currentProject: string;
|
|
8
|
-
readonly entryID: null;
|
|
9
|
-
readonly entry: null;
|
|
10
|
-
readonly currentTreeId: null;
|
|
11
|
-
readonly entryDepends: readonly never[];
|
|
12
|
-
readonly error: undefined;
|
|
13
|
-
readonly isError: boolean;
|
|
14
|
-
readonly isLoading: boolean;
|
|
15
|
-
readonly location: {};
|
|
16
|
-
readonly mappedEntry: null;
|
|
17
|
-
readonly nodeDepends: readonly never[];
|
|
18
|
-
readonly notFound: boolean;
|
|
19
|
-
readonly staticRoute: null;
|
|
20
|
-
readonly statusCode: number;
|
|
21
|
-
}>(base?: Base | undefined, action: any) => any;
|
|
1
|
+
declare const _default: (state?: any, action: any) => any;
|
|
22
2
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { StateType } from "../../config";
|
|
|
2
2
|
import { AppState } from "../../redux/appstate";
|
|
3
3
|
export declare const selectRouteEntry: (state: AppState, returnType?: StateType | undefined) => any;
|
|
4
4
|
export declare const selectMappedEntry: (state: AppState, returnType?: StateType | undefined) => any;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const selectSurrogateKeys: (state: AppState) => any;
|
|
6
6
|
export declare const selectCurrentHostname: (state: AppState) => any;
|
|
7
7
|
export declare const selectCurrentTreeID: (state: AppState) => any;
|
|
8
8
|
export declare const selectRouteEntryEntryId: (state: AppState) => any;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
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
|
+
import { AppState } from "../redux/appstate";
|
|
4
5
|
declare type RouteComponent<Props> = React.ComponentType<Props>;
|
|
5
|
-
declare type RouteNode = Node & {
|
|
6
|
+
export declare type RouteNode = Node & {
|
|
6
7
|
ancestors: Node[];
|
|
7
8
|
children: Node[];
|
|
8
9
|
};
|
|
@@ -26,7 +27,7 @@ export declare type RouteLoaderProps = {
|
|
|
26
27
|
loadingComponent?: React.ComponentType;
|
|
27
28
|
notFoundComponent?: React.ComponentType;
|
|
28
29
|
};
|
|
29
|
-
export declare type EntryMapper = (<MappedProps>(node: RouteNode, state?:
|
|
30
|
+
export declare type EntryMapper = (<MappedProps>(node: RouteNode, state?: AppState) => MappedProps | unknown) | (<MappedProps>(node: RouteNode, state?: AppState) => Promise<MappedProps | unknown>);
|
|
30
31
|
export declare type ReduxInjector = () => Promise<{
|
|
31
32
|
key: string;
|
|
32
33
|
reducer: any;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import { IExpression } from 'contensis-core-api';
|
|
2
|
+
export declare const fieldExpression: (field: string, value: string | string[], operator?: string, weight?: null) => any[];
|
|
3
|
+
export declare const defaultExpressions: (versionStatus: 'published' | 'latest') => IExpression[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Query } from "../../util/ContensisDeliveryApi";
|
|
2
|
-
export declare const routeEntryByFieldsQuery: (id: string, language?: string, fields?: string[], versionStatus?:
|
|
2
|
+
export declare const routeEntryByFieldsQuery: (id: string, language?: string, fields?: string[], versionStatus?: 'published' | 'latest') => Query;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Mappers } from '../models/Search';
|
|
3
|
-
declare const withListing: (mappers: Mappers) => <Props extends Record<
|
|
3
|
+
declare const withListing: (mappers: Mappers) => <Props extends Record<string, any>>(ListingComponent: React.FC<Props>) => import("react-redux").ConnectedComponent<any, import("react-redux").Omit<unknown, never>>;
|
|
4
4
|
export default withListing;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Mappers } from '../models/Search';
|
|
3
|
-
declare const withSearch: (mappers: Mappers) => <Props extends Record<
|
|
3
|
+
declare const withSearch: (mappers: Mappers) => <Props extends Record<string, any>>(SearchComponent: React.ComponentType<Props>) => import("react-redux").ConnectedComponent<any, import("react-redux").Omit<unknown, never>>;
|
|
4
4
|
export default withSearch;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { UseMinilistProps } from '../models/SearchProps';
|
|
2
|
-
declare const useMinilist: ({ id, config, excludeIds, mapper, mappers, params, defaultLang, debug, }?: UseMinilistProps) =>
|
|
3
|
-
filters: import("../models/SearchState").Filters;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
pagingInfo: import("../models/SearchState").Paging;
|
|
6
|
-
results: any[];
|
|
7
|
-
searchTerm: string;
|
|
8
|
-
title: string;
|
|
9
|
-
};
|
|
1
|
+
import { MinilistProps, UseMinilistProps } from '../models/SearchProps';
|
|
2
|
+
declare const useMinilist: <SearchResults extends Record<string, any>>({ id, config, excludeIds, mapper, mappers, params, defaultLang, debug, }?: UseMinilistProps) => MinilistProps<SearchResults>;
|
|
10
3
|
export default useMinilist;
|
package/models/search/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './models';
|
|
|
7
7
|
export { default as withSearch } from './containers/withSearch';
|
|
8
8
|
export { default as withListing } from './containers/withListing';
|
|
9
9
|
export { doSearch, setRouteFilters, searchSagas as sagas } from './redux/sagas';
|
|
10
|
+
export { default as useListing } from './hooks/useListing.hook';
|
|
10
11
|
export { default as useMinilist } from './hooks/useMinilist.hook';
|
|
11
12
|
export * as actions from './redux/actions';
|
|
12
13
|
export * as queries from './redux/queries';
|
|
@@ -3,6 +3,13 @@ import { VersionStatus } from 'contensis-core-api/lib/models';
|
|
|
3
3
|
import { Operators } from 'contensis-delivery-api/lib/entries/query';
|
|
4
4
|
import { CustomWhereClause, FeaturedResults, WeightedSearchField } from './Search';
|
|
5
5
|
export declare type FieldOperators = Exclude<keyof Operators, 'and' | 'or' | 'not'>;
|
|
6
|
+
export declare type LogicOperators = 'and' | 'or' | 'not';
|
|
7
|
+
export declare type FilterExpression = {
|
|
8
|
+
key: string;
|
|
9
|
+
values: string[];
|
|
10
|
+
fieldOperator: FieldOperators;
|
|
11
|
+
logicOperator: LogicOperators;
|
|
12
|
+
};
|
|
6
13
|
export declare type SearchQueryOptions = {
|
|
7
14
|
assetTypes: string[];
|
|
8
15
|
contentTypeIds: string[];
|
|
@@ -11,11 +18,7 @@ export declare type SearchQueryOptions = {
|
|
|
11
18
|
excludeIds: string[];
|
|
12
19
|
featuredResults: FeaturedResults;
|
|
13
20
|
fields: string[];
|
|
14
|
-
filters:
|
|
15
|
-
key: string;
|
|
16
|
-
value: string;
|
|
17
|
-
operator: FieldOperators;
|
|
18
|
-
}[];
|
|
21
|
+
filters: FilterExpression[];
|
|
19
22
|
includeInSearchFields: string[];
|
|
20
23
|
languages: string[];
|
|
21
24
|
pageSize: number;
|
|
@@ -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 */
|
|
@@ -26,21 +32,16 @@ export declare type Listing = {
|
|
|
26
32
|
/** Query params object to drive the search for this facet */
|
|
27
33
|
queryParams: QueryParams;
|
|
28
34
|
/** Display title */
|
|
29
|
-
title
|
|
35
|
+
title?: string;
|
|
30
36
|
};
|
|
31
|
-
export declare type
|
|
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?:
|
|
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 */
|
|
@@ -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]:
|
|
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]:
|
|
168
|
+
[key: string]: SearchFacet;
|
|
164
169
|
} | {
|
|
165
170
|
[key: string]: Listing;
|
|
166
171
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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: QueryParams) => {
|
|
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;
|