@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.
- package/README.md +2 -2
- package/cjs/{App-a2783f8b.js → App-7ff737fa.js} +161 -444
- package/cjs/App-7ff737fa.js.map +1 -0
- package/cjs/{login-e711a19e.js → ChangePassword.container-a617190b.js} +304 -191
- package/cjs/ChangePassword.container-a617190b.js.map +1 -0
- package/cjs/ContensisDeliveryApi-9e32960d.js +265 -0
- package/cjs/ContensisDeliveryApi-9e32960d.js.map +1 -0
- package/cjs/CookieConstants-000427db.js +10 -0
- package/cjs/CookieConstants-000427db.js.map +1 -0
- package/cjs/{RouteLoader-3aa6456e.js → RouteLoader-049e81e5.js} +27 -38
- package/cjs/RouteLoader-049e81e5.js.map +1 -0
- package/cjs/{ToJs-a9a8522b.js → ToJs-149fc5e1.js} +50 -4
- package/cjs/ToJs-149fc5e1.js.map +1 -0
- package/cjs/_commonjsHelpers-b3309d7b.js +11 -0
- package/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/cjs/client.js +25 -30
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +158 -536
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +3555 -326
- package/cjs/forms.js.map +1 -1
- package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-7c363211.js} +1 -4
- package/cjs/{fromJSLeaveImmer-e74c673c.js.map → fromJSLeaveImmer-7c363211.js.map} +1 -1
- package/cjs/{reducers-73a03ef4.js → reducers-9afb5f89.js} +10 -31
- package/{esm/reducers-aa8cef1e.js.map → cjs/reducers-9afb5f89.js.map} +1 -1
- package/cjs/redux.js +17 -18
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +7 -7
- package/cjs/{sagas-8a20e424.js → sagas-e04b94c1.js} +225 -301
- package/cjs/sagas-e04b94c1.js.map +1 -0
- package/cjs/search.js +68 -94
- package/cjs/search.js.map +1 -1
- package/cjs/{selectors-656da4b7.js → selectors-46b689d0.js} +86 -9
- package/cjs/selectors-46b689d0.js.map +1 -0
- package/cjs/urls-6fcaf4c6.js.map +1 -1
- package/cjs/user.js +34 -169
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +47 -53
- package/cjs/util.js.map +1 -1
- package/cjs/{version-bf9ef45e.js → version-79a027cb.js} +55 -179
- package/cjs/version-79a027cb.js.map +1 -0
- package/cjs/version-afd4f77e.js +98 -0
- package/cjs/version-afd4f77e.js.map +1 -0
- package/esm/{App-17d1ac3c.js → App-ff944c78.js} +145 -427
- package/esm/App-ff944c78.js.map +1 -0
- package/esm/{login-551d243a.js → ChangePassword.container-ae0f9ce4.js} +286 -184
- package/esm/ChangePassword.container-ae0f9ce4.js.map +1 -0
- package/esm/ContensisDeliveryApi-c66b0cc3.js +259 -0
- package/esm/ContensisDeliveryApi-c66b0cc3.js.map +1 -0
- package/esm/CookieConstants-3d3b6531.js +6 -0
- package/esm/CookieConstants-3d3b6531.js.map +1 -0
- package/esm/{RouteLoader-5171c63f.js → RouteLoader-02eef6d9.js} +26 -37
- package/esm/RouteLoader-02eef6d9.js.map +1 -0
- package/esm/{ToJs-4e02a04d.js → ToJs-ae860aad.js} +50 -5
- package/esm/ToJs-ae860aad.js.map +1 -0
- package/esm/_commonjsHelpers-1789f0cf.js +8 -0
- package/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/esm/client.js +20 -25
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +151 -530
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +3557 -328
- package/esm/forms.js.map +1 -1
- package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-e2dacd63.js} +1 -4
- package/esm/{fromJSLeaveImmer-0114ffcf.js.map → fromJSLeaveImmer-e2dacd63.js.map} +1 -1
- package/esm/{reducers-aa8cef1e.js → reducers-3d5c37d1.js} +10 -31
- package/{cjs/reducers-73a03ef4.js.map → esm/reducers-3d5c37d1.js.map} +1 -1
- package/esm/redux.js +9 -9
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +4 -4
- package/esm/{sagas-e576b6f6.js → sagas-933a8fc8.js} +177 -254
- package/esm/sagas-933a8fc8.js.map +1 -0
- package/esm/search.js +69 -95
- package/esm/search.js.map +1 -1
- package/esm/{selectors-a5e5835b.js → selectors-01074974.js} +71 -9
- package/esm/selectors-01074974.js.map +1 -0
- package/esm/urls-eac9a747.js.map +1 -1
- package/esm/user.js +22 -161
- package/esm/user.js.map +1 -1
- package/esm/util.js +42 -53
- package/esm/util.js.map +1 -1
- package/esm/version-0fbd1b82.js +87 -0
- package/esm/version-0fbd1b82.js.map +1 -0
- package/esm/{version-72ca17f3.js → version-346a9787.js} +43 -162
- package/esm/version-346a9787.js.map +1 -0
- package/models/client/client.d.ts +1 -1
- package/models/config.d.ts +4 -4
- package/models/redux/appstate.d.ts +2 -1
- package/models/routing/redux/actions.d.ts +10 -6
- package/models/routing/redux/selectors.d.ts +5 -4
- package/models/routing/redux/types.d.ts +0 -1
- package/models/routing/routes.d.ts +20 -17
- package/models/routing/util/queries.d.ts +3 -2
- package/models/search/models/Queries.d.ts +9 -10
- package/models/search/models/Search.d.ts +26 -24
- package/models/search/models/SearchActions.d.ts +36 -36
- package/models/search/models/SearchState.d.ts +11 -11
- package/models/search/models/SearchUtil.d.ts +1 -1
- package/models/search/models/WithSearch.d.ts +1 -1
- package/models/search/redux/actions.d.ts +7 -7
- package/models/search/redux/selectors.d.ts +27 -27
- package/models/search/redux/types.d.ts +21 -21
- package/models/search/redux/util.d.ts +2 -2
- package/models/search/search/ContensisDeliveryApi.d.ts +1 -1
- package/models/search/search/expressions.d.ts +4 -4
- package/models/search/search/util.d.ts +2 -2
- package/models/search/transformations/state-to-queryparams.mapper.d.ts +1 -1
- package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +1 -1
- package/models/server/features/linkdepth-api/search.d.ts +3 -3
- package/models/server/internalServer.d.ts +7 -5
- package/models/server/util/bundles.d.ts +2 -2
- package/models/server/util/handleExceptions.d.ts +1 -1
- package/models/testImmer/redux/reducer.d.ts +1 -1
- package/models/user/components/Login.d.ts +2 -3
- package/models/user/containers/ChangePassword.container.d.ts +2 -2
- package/models/user/containers/ForgotPassword.container.d.ts +2 -2
- package/models/user/containers/Login.container.d.ts +2 -2
- package/models/user/containers/Registration.container.d.ts +2 -2
- package/models/user/hocs/withLogin.d.ts +5 -11
- package/models/user/hocs/withRegistration.d.ts +2 -8
- package/models/user/redux/actions.d.ts +2 -2
- package/models/user/redux/sagas/login.d.ts +9 -8
- package/models/user/redux/selectors.d.ts +4 -4
- package/models/user/util/CookieConstants.d.ts +8 -0
- package/models/user/util/CookieHelper.class.d.ts +15 -3
- package/models/user/util/LoginHelper.class.d.ts +27 -23
- package/models/util/CachedDeliveryApi.d.ts +25 -0
- package/models/util/ContensisDeliveryApi.d.ts +20 -38
- package/models/util/LruCache.d.ts +12 -0
- package/models/util/ToJs.d.ts +1 -1
- package/models/util/index.d.ts +1 -0
- package/models/util/json-mapper.d.ts +1 -1
- package/package.json +9 -10
- package/cjs/App-a2783f8b.js.map +0 -1
- package/cjs/RouteLoader-3aa6456e.js.map +0 -1
- package/cjs/ToJs-a9a8522b.js.map +0 -1
- package/cjs/actions-8dc9e8de.js +0 -87
- package/cjs/actions-8dc9e8de.js.map +0 -1
- package/cjs/login-e711a19e.js.map +0 -1
- package/cjs/sagas-8a20e424.js.map +0 -1
- package/cjs/selectors-656da4b7.js.map +0 -1
- package/cjs/version-bf9ef45e.js.map +0 -1
- package/cjs/version-eba6d09b.js +0 -20
- package/cjs/version-eba6d09b.js.map +0 -1
- package/esm/App-17d1ac3c.js.map +0 -1
- package/esm/RouteLoader-5171c63f.js.map +0 -1
- package/esm/ToJs-4e02a04d.js.map +0 -1
- package/esm/actions-180948dd.js +0 -72
- package/esm/actions-180948dd.js.map +0 -1
- package/esm/login-551d243a.js.map +0 -1
- package/esm/sagas-e576b6f6.js.map +0 -1
- package/esm/selectors-a5e5835b.js.map +0 -1
- package/esm/version-2485e2fb.js +0 -15
- package/esm/version-2485e2fb.js.map +0 -1
- package/esm/version-72ca17f3.js.map +0 -1
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { g as getImmutableOrJS, t as action } from './selectors-a5e5835b.js';
|
|
2
|
-
import { all } from '@redux-saga/core/effects';
|
|
3
1
|
import { compose, applyMiddleware, createStore as createStore$1, combineReducers } from 'redux';
|
|
4
2
|
import thunkMiddleware from 'redux-thunk';
|
|
5
3
|
import createSagaMiddleware, { END } from 'redux-saga';
|
|
6
4
|
import { createInjectorsEnhancer } from 'redux-injectors';
|
|
7
|
-
import { produce } from 'immer';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import { U as UserReducer } from './reducers-aa8cef1e.js';
|
|
5
|
+
import { produce, original } from 'immer';
|
|
6
|
+
import { C as SET_TARGET_PROJECT, D as SET_SURROGATE_KEYS, n as SET_SIBLINGS, d as SET_ROUTE, S as SET_NAVIGATION_PATH, U as UPDATE_LOADING_STATE, l as SET_ENTRY, m as SET_ANCESTORS, g as getImmutableOrJS } from './selectors-01074974.js';
|
|
7
|
+
import { U as UserReducer } from './reducers-3d5c37d1.js';
|
|
11
8
|
|
|
12
9
|
const ACTION_PREFIX = '@NAVIGATION/';
|
|
13
10
|
const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;
|
|
14
11
|
const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`;
|
|
15
12
|
const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`;
|
|
16
13
|
|
|
17
|
-
var navigation
|
|
14
|
+
var navigation = /*#__PURE__*/Object.freeze({
|
|
18
15
|
__proto__: null,
|
|
19
16
|
GET_NODE_TREE: GET_NODE_TREE,
|
|
20
17
|
SET_NODE_TREE: SET_NODE_TREE,
|
|
@@ -37,34 +34,19 @@ var NavigationReducer = produce((state, action) => {
|
|
|
37
34
|
state.isReady = true;
|
|
38
35
|
return;
|
|
39
36
|
}
|
|
40
|
-
|
|
41
37
|
case GET_NODE_TREE_ERROR:
|
|
42
38
|
{
|
|
43
39
|
state.error.isError = true;
|
|
44
40
|
state.error.message = action.error || 'Unknown error occurred';
|
|
45
41
|
return;
|
|
46
42
|
}
|
|
47
|
-
|
|
48
43
|
default:
|
|
49
44
|
return;
|
|
50
45
|
}
|
|
51
46
|
}, initialState$2);
|
|
52
47
|
|
|
53
|
-
const combineMerge = (target, source, options) => {
|
|
54
|
-
const destination = target.slice();
|
|
55
|
-
source.forEach((item, index) => {
|
|
56
|
-
if (typeof destination[index] === 'undefined') {
|
|
57
|
-
destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);
|
|
58
|
-
} else if (options.isMergeableObject(item)) {
|
|
59
|
-
destination[index] = merge(target[index], item, options);
|
|
60
|
-
} else if (target.indexOf(item) === -1) {
|
|
61
|
-
destination.push(item);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return destination;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
48
|
const initialState$1 = {
|
|
49
|
+
canonicalPath: null,
|
|
68
50
|
currentHostname: null,
|
|
69
51
|
currentPath: '/',
|
|
70
52
|
currentNode: {},
|
|
@@ -88,7 +70,6 @@ var RoutingReducer = produce((state, action) => {
|
|
|
88
70
|
state.currentNodeAncestors = action.ancestors;
|
|
89
71
|
return;
|
|
90
72
|
}
|
|
91
|
-
|
|
92
73
|
case SET_ENTRY:
|
|
93
74
|
{
|
|
94
75
|
const {
|
|
@@ -99,11 +80,11 @@ var RoutingReducer = produce((state, action) => {
|
|
|
99
80
|
isError = false,
|
|
100
81
|
isLoading = false,
|
|
101
82
|
notFound = false,
|
|
102
|
-
statusCode
|
|
83
|
+
statusCode,
|
|
84
|
+
currentPath
|
|
103
85
|
} = action;
|
|
104
86
|
let defaultStatus = 200;
|
|
105
87
|
if (notFound === true && isError === false) defaultStatus = 404;else if (isError === true) defaultStatus = statusCode || 500;
|
|
106
|
-
|
|
107
88
|
if (!entry) {
|
|
108
89
|
state.entryID = null;
|
|
109
90
|
state.entry = null;
|
|
@@ -113,6 +94,7 @@ var RoutingReducer = produce((state, action) => {
|
|
|
113
94
|
state.isLoading = isLoading;
|
|
114
95
|
state.notFound = notFound;
|
|
115
96
|
state.statusCode = statusCode || defaultStatus;
|
|
97
|
+
state.canonicalPath = currentPath;
|
|
116
98
|
} else {
|
|
117
99
|
state.entryID = action.id;
|
|
118
100
|
state.entry = entry;
|
|
@@ -121,7 +103,7 @@ var RoutingReducer = produce((state, action) => {
|
|
|
121
103
|
state.isLoading = isLoading;
|
|
122
104
|
state.notFound = notFound;
|
|
123
105
|
state.statusCode = statusCode || defaultStatus;
|
|
124
|
-
|
|
106
|
+
state.canonicalPath = entry.sys.uri || currentPath;
|
|
125
107
|
if (mappedEntry && Object.keys(mappedEntry).length > 0) {
|
|
126
108
|
state.mappedEntry = mappedEntry;
|
|
127
109
|
state.entry = {
|
|
@@ -129,96 +111,86 @@ var RoutingReducer = produce((state, action) => {
|
|
|
129
111
|
};
|
|
130
112
|
}
|
|
131
113
|
}
|
|
132
|
-
|
|
133
114
|
if (!node) {
|
|
134
115
|
state.currentNode = null;
|
|
135
116
|
} else {
|
|
136
117
|
// On Set Node, we reset all dependants.
|
|
137
|
-
state.currentNode = node;
|
|
138
|
-
|
|
118
|
+
state.currentNode = node;
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
139
120
|
const {
|
|
140
121
|
entry,
|
|
141
122
|
...nodeWithoutEntry
|
|
142
123
|
} = node; // We have the entry stored elsewhere, so lets not keep it twice.
|
|
143
|
-
|
|
144
124
|
state.currentNode = nodeWithoutEntry;
|
|
145
125
|
}
|
|
146
|
-
|
|
147
126
|
return;
|
|
148
127
|
}
|
|
149
|
-
|
|
150
128
|
case UPDATE_LOADING_STATE:
|
|
151
129
|
{
|
|
152
130
|
state.isLoading = action.isLoading;
|
|
153
131
|
return;
|
|
154
132
|
}
|
|
155
|
-
|
|
156
133
|
case SET_NAVIGATION_PATH:
|
|
157
134
|
{
|
|
158
135
|
let staticRoute = {};
|
|
159
|
-
|
|
160
136
|
if (action.staticRoute) {
|
|
161
|
-
staticRoute = {
|
|
137
|
+
staticRoute = {
|
|
138
|
+
...action.staticRoute
|
|
162
139
|
};
|
|
163
140
|
}
|
|
164
|
-
|
|
165
141
|
if (action.path) {
|
|
166
142
|
var _state$entry, _state$entry$sys;
|
|
167
|
-
|
|
168
143
|
// Don't run a path update on initial load as we allready should have it in redux
|
|
169
144
|
const entryUri = state === null || state === void 0 ? void 0 : (_state$entry = state.entry) === null || _state$entry === void 0 ? void 0 : (_state$entry$sys = _state$entry.sys) === null || _state$entry$sys === void 0 ? void 0 : _state$entry$sys.uri;
|
|
170
|
-
|
|
171
145
|
if (entryUri !== action.path) {
|
|
172
146
|
state.currentPath = action.path;
|
|
173
147
|
state.location = action.location;
|
|
174
|
-
state.staticRoute = {
|
|
175
|
-
|
|
148
|
+
state.staticRoute = {
|
|
149
|
+
...staticRoute,
|
|
150
|
+
route: {
|
|
151
|
+
...staticRoute.route,
|
|
176
152
|
component: null
|
|
177
153
|
}
|
|
178
154
|
};
|
|
179
155
|
state.isLoading = typeof window !== 'undefined';
|
|
180
156
|
} else {
|
|
181
157
|
state.location = action.location;
|
|
182
|
-
state.staticRoute = {
|
|
183
|
-
|
|
158
|
+
state.staticRoute = {
|
|
159
|
+
...staticRoute,
|
|
160
|
+
route: {
|
|
161
|
+
...staticRoute.route,
|
|
184
162
|
component: null
|
|
185
163
|
}
|
|
186
164
|
};
|
|
187
165
|
}
|
|
188
166
|
}
|
|
189
|
-
|
|
190
167
|
return;
|
|
191
168
|
}
|
|
192
|
-
|
|
193
169
|
case SET_ROUTE:
|
|
194
170
|
{
|
|
195
171
|
state.nextPath = action.path;
|
|
196
172
|
return;
|
|
197
173
|
}
|
|
198
|
-
|
|
199
174
|
case SET_SIBLINGS:
|
|
200
175
|
{
|
|
201
176
|
// Can be null in some cases like the homepage.
|
|
202
177
|
let currentNodeSiblingParent = null;
|
|
203
|
-
|
|
204
178
|
if (action.siblings && action.siblings.length > 0) {
|
|
205
179
|
currentNodeSiblingParent = action.siblings[0].parentId;
|
|
206
180
|
}
|
|
207
|
-
|
|
208
181
|
state.currentNodeSiblings = action.siblings;
|
|
209
182
|
state.currentNodeSiblingsParent = currentNodeSiblingParent;
|
|
210
183
|
return;
|
|
211
184
|
}
|
|
212
|
-
|
|
213
185
|
case SET_SURROGATE_KEYS:
|
|
214
186
|
{
|
|
215
|
-
|
|
216
|
-
state.surrogateKeys
|
|
217
|
-
|
|
218
|
-
|
|
187
|
+
const newKeys = (action.keys || '').split(' ');
|
|
188
|
+
const stateKeys = state.surrogateKeys ? original(state.surrogateKeys) : [];
|
|
189
|
+
const allKeys = [...stateKeys, ...newKeys];
|
|
190
|
+
const uniqueKeys = [...new Set(allKeys)];
|
|
191
|
+
state.surrogateKeys = uniqueKeys;
|
|
219
192
|
return;
|
|
220
193
|
}
|
|
221
|
-
|
|
222
194
|
case SET_TARGET_PROJECT:
|
|
223
195
|
{
|
|
224
196
|
state.currentProject = action.project;
|
|
@@ -226,7 +198,6 @@ var RoutingReducer = produce((state, action) => {
|
|
|
226
198
|
state.currentHostname = action.hostname;
|
|
227
199
|
return;
|
|
228
200
|
}
|
|
229
|
-
|
|
230
201
|
default:
|
|
231
202
|
return state;
|
|
232
203
|
}
|
|
@@ -254,14 +225,12 @@ var VersionReducer = produce((state, action) => {
|
|
|
254
225
|
state.contensisVersionStatus = action.status;
|
|
255
226
|
return;
|
|
256
227
|
}
|
|
257
|
-
|
|
258
228
|
case SET_VERSION:
|
|
259
229
|
{
|
|
260
230
|
state.commitRef = action.commitRef;
|
|
261
231
|
state.buildNo = action.buildNo;
|
|
262
232
|
return;
|
|
263
233
|
}
|
|
264
|
-
|
|
265
234
|
default:
|
|
266
235
|
return;
|
|
267
236
|
}
|
|
@@ -272,13 +241,11 @@ var VersionReducer = produce((state, action) => {
|
|
|
272
241
|
* provided history object. This will prevent these actions from reaching your
|
|
273
242
|
* reducer or any middleware that comes after this one.
|
|
274
243
|
*/
|
|
275
|
-
|
|
276
244
|
/* eslint-disable no-unused-vars */
|
|
277
245
|
const routerMiddleware = history => store => next => action => {
|
|
278
246
|
if (action.type !== 'CALL_HISTORY_METHOD') {
|
|
279
247
|
return next(action);
|
|
280
248
|
}
|
|
281
|
-
|
|
282
249
|
const {
|
|
283
250
|
payload: {
|
|
284
251
|
method,
|
|
@@ -289,15 +256,14 @@ const routerMiddleware = history => store => next => action => {
|
|
|
289
256
|
};
|
|
290
257
|
|
|
291
258
|
let reduxStore;
|
|
259
|
+
|
|
292
260
|
/* eslint-disable no-underscore-dangle */
|
|
293
261
|
|
|
294
262
|
var createStore = (async (featureReducers, initialState, history, stateType) => {
|
|
295
263
|
let reduxDevToolsMiddleware = f => f;
|
|
296
|
-
|
|
297
264
|
if (typeof window != 'undefined') {
|
|
298
265
|
reduxDevToolsMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f;
|
|
299
266
|
}
|
|
300
|
-
|
|
301
267
|
const sagaMiddleware = createSagaMiddleware();
|
|
302
268
|
const reducers = {
|
|
303
269
|
navigation: NavigationReducer,
|
|
@@ -305,35 +271,26 @@ var createStore = (async (featureReducers, initialState, history, stateType) =>
|
|
|
305
271
|
user: UserReducer,
|
|
306
272
|
version: VersionReducer,
|
|
307
273
|
...featureReducers
|
|
308
|
-
};
|
|
309
|
-
// stateType is 'immutable' with dynamic imports
|
|
274
|
+
};
|
|
310
275
|
|
|
276
|
+
// Reassign the combiner and fromJS functions when
|
|
277
|
+
// stateType is 'immutable' with dynamic imports
|
|
311
278
|
let combiner = combineReducers;
|
|
312
|
-
|
|
313
279
|
let fromJS = obj => obj;
|
|
314
|
-
|
|
315
280
|
globalThis.STATE_TYPE = stateType;
|
|
316
|
-
|
|
317
281
|
if (stateType === 'immutable') {
|
|
318
|
-
globalThis.immutable = await import(
|
|
319
|
-
/* webpackChunkName: "
|
|
320
|
-
'immutable');
|
|
321
|
-
fromJS = (await import(
|
|
322
|
-
/* webpackChunkName: "from-js" */
|
|
323
|
-
'./fromJSLeaveImmer-0114ffcf.js')).default;
|
|
324
|
-
combiner = (await import(
|
|
325
|
-
/* webpackChunkName: "redux-immutable" */
|
|
326
|
-
'redux-immutable')).combineReducers;
|
|
282
|
+
globalThis.immutable = await import( /* webpackChunkName: "immutable" */'immutable');
|
|
283
|
+
fromJS = (await import( /* webpackChunkName: "from-js" */'./fromJSLeaveImmer-e2dacd63.js')).default;
|
|
284
|
+
combiner = (await import( /* webpackChunkName: "redux-immutable" */'redux-immutable')).combineReducers;
|
|
327
285
|
}
|
|
328
|
-
|
|
329
286
|
const createReducer = (injectedReducers = {}) => {
|
|
330
|
-
const rootReducer = combiner({
|
|
287
|
+
const rootReducer = combiner({
|
|
288
|
+
...injectedReducers,
|
|
331
289
|
// other non-injected reducers go here
|
|
332
290
|
...reducers
|
|
333
291
|
});
|
|
334
292
|
return rootReducer;
|
|
335
293
|
};
|
|
336
|
-
|
|
337
294
|
const store = initialState => {
|
|
338
295
|
const runSaga = sagaMiddleware.run;
|
|
339
296
|
const middleware = compose(applyMiddleware(thunkMiddleware, sagaMiddleware, routerMiddleware(history)), createInjectorsEnhancer({
|
|
@@ -342,99 +299,23 @@ var createStore = (async (featureReducers, initialState, history, stateType) =>
|
|
|
342
299
|
}), reduxDevToolsMiddleware);
|
|
343
300
|
const store = createStore$1(createReducer(), initialState, middleware);
|
|
344
301
|
store.runSaga = runSaga;
|
|
345
|
-
|
|
346
302
|
store.close = () => store.dispatch(END);
|
|
347
|
-
|
|
348
303
|
return store;
|
|
349
304
|
};
|
|
350
|
-
|
|
351
305
|
reduxStore = store(fromJS(initialState));
|
|
352
306
|
return reduxStore;
|
|
353
307
|
});
|
|
354
308
|
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
const selectNavigationDepends = () => [];
|
|
359
|
-
|
|
360
|
-
var navigation = /*#__PURE__*/Object.freeze({
|
|
361
|
-
__proto__: null,
|
|
362
|
-
hasNavigationTree: hasNavigationTree,
|
|
363
|
-
selectNavigationRoot: selectNavigationRoot,
|
|
364
|
-
selectNavigationChildren: selectNavigationChildren,
|
|
365
|
-
selectNavigationDepends: selectNavigationDepends
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
const convertSagaArray = sagas => {
|
|
369
|
-
if (Array.isArray(sagas)) return function* rootSaga() {
|
|
370
|
-
yield all(sagas);
|
|
371
|
-
};
|
|
372
|
-
return sagas;
|
|
373
|
-
};
|
|
374
|
-
const injectReducer = ({
|
|
375
|
-
key,
|
|
376
|
-
reducer
|
|
377
|
-
}, store = reduxStore) => {
|
|
378
|
-
if (Reflect.has(store.injectedReducers, key) && store.injectedReducers[key] === reducer) return;
|
|
379
|
-
store.injectedReducers[key] = reducer;
|
|
380
|
-
store.replaceReducer(store.createReducer(store.injectedReducers));
|
|
381
|
-
};
|
|
382
|
-
const injectSaga = ({
|
|
383
|
-
key,
|
|
384
|
-
saga
|
|
385
|
-
}, store = reduxStore) => {
|
|
386
|
-
const rootSaga = convertSagaArray(saga);
|
|
387
|
-
let hasSaga = Reflect.has(store.injectedSagas, key);
|
|
388
|
-
|
|
389
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
390
|
-
const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas
|
|
391
|
-
|
|
392
|
-
if (hasSaga && oldDescriptor.saga !== rootSaga) {
|
|
393
|
-
oldDescriptor.task.cancel();
|
|
394
|
-
hasSaga = false;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);
|
|
399
|
-
|
|
400
|
-
if (!hasSaga) {
|
|
401
|
-
store.injectedSagas[key] = {
|
|
402
|
-
key,
|
|
403
|
-
saga: rootSaga,
|
|
404
|
-
task: store.runSaga(rootSaga)
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
const injectRedux = ({
|
|
409
|
-
key,
|
|
410
|
-
reducer,
|
|
411
|
-
saga
|
|
412
|
-
}, store = reduxStore) => {
|
|
413
|
-
console.info('injectRedux, key: ', key);
|
|
414
|
-
if (reducer) injectReducer({
|
|
415
|
-
key,
|
|
416
|
-
reducer
|
|
417
|
-
}, store);
|
|
418
|
-
if (saga) injectSaga({
|
|
419
|
-
key,
|
|
420
|
-
saga
|
|
421
|
-
}, store);
|
|
422
|
-
};
|
|
423
|
-
const useInjectRedux = injectRedux;
|
|
424
|
-
|
|
425
|
-
const setVersion = (commitRef, buildNo) => action(SET_VERSION, {
|
|
426
|
-
commitRef,
|
|
427
|
-
buildNo
|
|
428
|
-
});
|
|
429
|
-
const setVersionStatus = status => action(SET_VERSION_STATUS, {
|
|
430
|
-
status
|
|
431
|
-
});
|
|
309
|
+
const selectCommitRef = state => getImmutableOrJS(state, ['version', 'commitRef']);
|
|
310
|
+
const selectBuildNumber = state => getImmutableOrJS(state, ['version', 'buildNo']);
|
|
311
|
+
const selectVersionStatus = state => getImmutableOrJS(state, ['version', 'contensisVersionStatus']);
|
|
432
312
|
|
|
433
313
|
var version = /*#__PURE__*/Object.freeze({
|
|
434
314
|
__proto__: null,
|
|
435
|
-
|
|
436
|
-
|
|
315
|
+
selectCommitRef: selectCommitRef,
|
|
316
|
+
selectBuildNumber: selectBuildNumber,
|
|
317
|
+
selectVersionStatus: selectVersionStatus
|
|
437
318
|
});
|
|
438
319
|
|
|
439
|
-
export { GET_NODE_TREE as G, SET_NODE_TREE as S,
|
|
440
|
-
//# sourceMappingURL=version-
|
|
320
|
+
export { GET_NODE_TREE as G, SET_NODE_TREE as S, GET_NODE_TREE_ERROR as a, SET_VERSION_STATUS as b, createStore as c, SET_VERSION as d, version as e, selectCommitRef as f, selectBuildNumber as g, navigation as n, reduxStore as r, selectVersionStatus as s, version$1 as v };
|
|
321
|
+
//# sourceMappingURL=version-346a9787.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-346a9787.js","sources":["../src/redux/types/navigation.js","../src/redux/reducers/navigation.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/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 error: {\n isError: false,\n message: null,\n },\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.error.isError = true;\n state.error.message = action.error || 'Unknown error occurred';\n return;\n }\n default:\n return;\n }\n}, initialState);\n","import { Draft, original, produce } from 'immer';\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';\n\nconst initialState = {\n canonicalPath: null,\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 currentPath,\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 state.canonicalPath = currentPath;\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 state.canonicalPath = entry.sys.uri || currentPath;\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\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 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 const newKeys = (action.keys || '').split(' ');\n const stateKeys = state.surrogateKeys\n ? original(state.surrogateKeys)\n : [];\n const allKeys = [...stateKeys, ...newKeys];\n const uniqueKeys = [...new Set(allKeys)];\n state.surrogateKeys = uniqueKeys;\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: null as 'latest' | 'published' | null,\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 selectCommitRef = state => getIn(state, ['version', 'commitRef']);\n\nexport const selectBuildNumber = state => getIn(state, ['version', 'buildNo']);\n\nexport const selectVersionStatus = state =>\n getIn(state, ['version', 'contensisVersionStatus']);\n"],"names":["ACTION_PREFIX","GET_NODE_TREE","SET_NODE_TREE","GET_NODE_TREE_ERROR","initialState","root","error","isError","message","isReady","produce","state","action","type","nodes","canonicalPath","currentHostname","currentPath","currentNode","currentNodeAncestors","currentProject","entryID","entry","undefined","isLoading","location","mappedEntry","notFound","staticRoute","statusCode","SET_ANCESTORS","ancestors","SET_ENTRY","node","defaultStatus","id","sys","uri","Object","keys","length","nodeWithoutEntry","UPDATE_LOADING_STATE","SET_NAVIGATION_PATH","path","_state$entry","_state$entry$sys","entryUri","route","component","window","SET_ROUTE","nextPath","SET_SIBLINGS","currentNodeSiblingParent","siblings","parentId","currentNodeSiblings","currentNodeSiblingsParent","SET_SURROGATE_KEYS","newKeys","split","stateKeys","surrogateKeys","original","allKeys","uniqueKeys","Set","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","selectCommitRef","getIn","selectBuildNumber","selectVersionStatus"],"mappings":";;;;;;;;AAAA,MAAMA,aAAa,GAAG,cAAc,CAAA;AACvBC,MAAAA,aAAa,GAAI,CAAA,EAAED,aAAc,CAAe,cAAA,EAAA;AAChDE,MAAAA,aAAa,GAAI,CAAA,EAAEF,aAAc,CAAe,cAAA,EAAA;AAChDG,MAAAA,mBAAmB,GAAI,CAAA,EAAEH,aAAc,CAAqB,oBAAA;;;;;;;;;ACAzE,MAAMI,cAAY,GAAG;AACnBC,EAAAA,IAAI,EAAE,IAAI;AACVC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,KAAK;AACdC,IAAAA,OAAO,EAAE,IAAA;GACV;AACDC,EAAAA,OAAO,EAAE,KAAA;AACX,CAAC,CAAA;AAED,wBAAeC,OAAO,CAAC,CAACC,KAAiB,EAAEC,MAAM,KAAK;EACpD,QAAQA,MAAM,CAACC,IAAI;AACjB,IAAA,KAAKX,aAAa;AAAE,MAAA;AAClBS,QAAAA,KAAK,CAACN,IAAI,GAAGO,MAAM,CAACE,KAAK,CAAA;QACzBH,KAAK,CAACF,OAAO,GAAG,IAAI,CAAA;AACpB,QAAA,OAAA;AACF,OAAA;AACA,IAAA,KAAKN,mBAAmB;AAAE,MAAA;AACxBQ,QAAAA,KAAK,CAACL,KAAK,CAACC,OAAO,GAAG,IAAI,CAAA;QAC1BI,KAAK,CAACL,KAAK,CAACE,OAAO,GAAGI,MAAM,CAACN,KAAK,IAAI,wBAAwB,CAAA;AAC9D,QAAA,OAAA;AACF,OAAA;AACA,IAAA;AACE,MAAA,OAAA;AAAO,GAAA;AAEb,CAAC,EAAEF,cAAY,CAA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AAA;IACvBjC,KAAK,CAACyC,KAAK,GAAG,MAAMzC,KAAK,CAAC0C,QAAQ,CAACC,GAAG,CAAC,CAAA;AAEvC,IAAA,OAAO3C,KAAK,CAAA;GACb,CAAA;AAEDK,EAAAA,UAAU,GAAGL,KAAK,CAACwB,MAAM,CAACrG,YAAY,CAAC,CAAC,CAAA;AACxC,EAAA,OAAOkF,UAAU,CAAA;AACnB,CAAC;;ACzHYuC,MAAAA,eAAe,GAAGlH,KAAK,IAAImH,gBAAK,CAACnH,KAAK,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAEjEoH,MAAAA,iBAAiB,GAAGpH,KAAK,IAAImH,gBAAK,CAACnH,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAC;AAEjEqH,MAAAA,mBAAmB,GAAGrH,KAAK,IACtCmH,gBAAK,CAACnH,KAAK,EAAE,CAAC,SAAS,EAAE,wBAAwB,CAAC;;;;;;;;;;;"}
|
package/models/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppRoutes, WithEvents } from './routing/routes';
|
|
2
2
|
import handleResponse from './server/features/response-handler';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type StateType = 'immutable' | 'js';
|
|
4
|
+
export type AppConfig = {
|
|
5
5
|
stateType?: StateType;
|
|
6
6
|
routes: AppRoutes;
|
|
7
7
|
withReducers: {
|
|
@@ -10,11 +10,11 @@ export declare type AppConfig = {
|
|
|
10
10
|
withSagas: any[];
|
|
11
11
|
withEvents: WithEvents;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type ServerConfig = AppConfig & {
|
|
14
14
|
appRootPath?: string;
|
|
15
15
|
disableSsrRedux?: boolean;
|
|
16
16
|
handleResponses?: typeof handleResponse;
|
|
17
|
-
handleExceptions?: boolean;
|
|
17
|
+
handleExceptions?: boolean | string[];
|
|
18
18
|
reverseProxyPaths?: string[];
|
|
19
19
|
packagejson: any;
|
|
20
20
|
proxyDeliveryApi?: boolean;
|
|
@@ -3,13 +3,14 @@ import { Entry, Node } from 'contensis-delivery-api/lib/models';
|
|
|
3
3
|
import { Group, User } from 'contensis-management-api/lib/models';
|
|
4
4
|
import { MatchedRoute } from 'react-router-config';
|
|
5
5
|
import { StaticRoute } from "../routing/routes";
|
|
6
|
-
export
|
|
6
|
+
export type AppState = {
|
|
7
7
|
navigation: {
|
|
8
8
|
root: Node | null;
|
|
9
9
|
isError: boolean;
|
|
10
10
|
isReady: boolean;
|
|
11
11
|
};
|
|
12
12
|
routing: {
|
|
13
|
+
canonicalPath: string | null;
|
|
13
14
|
currentHostname: null;
|
|
14
15
|
currentPath: string;
|
|
15
16
|
currentNode: Node & {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
1
|
+
import { useLocation } from 'react-router-dom';
|
|
2
|
+
import { Entry } from 'contensis-delivery-api/lib/models';
|
|
3
|
+
import { MatchedRoute, RouteConfig } from 'react-router-config';
|
|
4
|
+
import { AppRoutes, WithEvents } from '../routes';
|
|
5
|
+
import { CookieHelper } from "../../user/util/CookieHelper.class";
|
|
6
|
+
export declare const setNavigationPath: (path: string, location: ReturnType<typeof useLocation>, staticRoute: MatchedRoute<any, RouteConfig> | undefined, withEvents: WithEvents, statePath: string, routes: AppRoutes, cookies: CookieHelper) => any;
|
|
7
|
+
export declare const setCurrentProject: (project: string, allowedGroups: any, hostname: string) => any;
|
|
8
|
+
export declare const setRoute: (path: string, state?: any) => any;
|
|
9
|
+
export declare const setRouteEntry: (entry: Entry) => any;
|
|
10
|
+
export declare const setSurrogateKeys: (keys: string, url: string) => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StateType } from "../../config";
|
|
2
2
|
import { AppState } from "../../redux/appstate";
|
|
3
|
-
export declare const selectRouteEntry: (state: AppState, returnType?: StateType
|
|
4
|
-
export declare const selectMappedEntry: (state: AppState, returnType?: StateType
|
|
3
|
+
export declare const selectRouteEntry: (state: AppState, returnType?: StateType) => any;
|
|
4
|
+
export declare const selectMappedEntry: (state: AppState, returnType?: StateType) => any;
|
|
5
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;
|
|
@@ -10,6 +10,7 @@ export declare const selectRouteEntryContentTypeId: (state: AppState) => any;
|
|
|
10
10
|
export declare const selectRouteEntryLanguage: (state: AppState) => any;
|
|
11
11
|
export declare const selectRouteEntrySlug: (state: AppState) => any;
|
|
12
12
|
export declare const selectRouteEntryID: (state: AppState) => any;
|
|
13
|
+
export declare const selectCanonicalPath: (state: AppState) => any;
|
|
13
14
|
export declare const selectCurrentPath: (state: AppState) => any;
|
|
14
15
|
export declare const selectCurrentLocation: (state: AppState) => any;
|
|
15
16
|
export declare const selectCurrentSearch: (state: AppState) => any;
|
|
@@ -19,9 +20,9 @@ export declare const selectCurrentProject: (state: AppState) => any;
|
|
|
19
20
|
export declare const selectIsNotFound: (state: AppState) => any;
|
|
20
21
|
export declare const selectCurrentAncestors: (state: AppState) => any;
|
|
21
22
|
export declare const selectCurrentSiblings: (state: AppState) => any;
|
|
22
|
-
export declare const selectCurrentNode: (state: AppState, returnType?: StateType
|
|
23
|
+
export declare const selectCurrentNode: (state: AppState, returnType?: StateType) => any;
|
|
23
24
|
export declare const selectCurrentChildren: (state: any) => any;
|
|
24
|
-
export declare const selectBreadcrumb: (state: AppState) => any;
|
|
25
|
+
export declare const selectBreadcrumb: (state: AppState) => any[];
|
|
25
26
|
export declare const selectRouteErrorMessage: (state: AppState) => any;
|
|
26
27
|
export declare const selectRouteIsError: (state: AppState) => any;
|
|
27
28
|
export declare const selectRouteLoading: (state: AppState) => any;
|
|
@@ -5,7 +5,6 @@ export declare const SET_ANCESTORS: string;
|
|
|
5
5
|
export declare const SET_SIBLINGS: string;
|
|
6
6
|
export declare const SET_ENTRY_ID: string;
|
|
7
7
|
export declare const SET_SURROGATE_KEYS: string;
|
|
8
|
-
export declare const SET_NAVIGATION_NOT_FOUND: string;
|
|
9
8
|
export declare const SET_NAVIGATION_PATH: string;
|
|
10
9
|
export declare const SET_TARGET_PROJECT: string;
|
|
11
10
|
export declare const SET_ROUTE: string;
|