@zengenti/contensis-react-base 3.1.0 → 4.0.0-beta.2
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/cjs/{App-7ff737fa.js → App-b56aca04.js} +139 -94
- package/cjs/{App-7ff737fa.js.map → App-b56aca04.js.map} +1 -1
- package/cjs/{ChangePassword.container-a617190b.js → ChangePassword.container-ae35785e.js} +120 -62
- package/{esm/ChangePassword.container-ae0f9ce4.js.map → cjs/ChangePassword.container-ae35785e.js.map} +1 -1
- package/cjs/{ContensisDeliveryApi-9e32960d.js → ContensisDeliveryApi-4fcf049d.js} +71 -17
- package/{esm/ContensisDeliveryApi-c66b0cc3.js.map → cjs/ContensisDeliveryApi-4fcf049d.js.map} +1 -1
- package/cjs/CookieConstants-000427db.js.map +1 -1
- package/cjs/RouteLoader-c06dccd5.js +321 -0
- package/cjs/RouteLoader-c06dccd5.js.map +1 -0
- package/cjs/{ToJs-149fc5e1.js → ToJs-a8d8f3f0.js} +14 -6
- package/cjs/{ToJs-149fc5e1.js.map → ToJs-a8d8f3f0.js.map} +1 -1
- package/cjs/client.js +52 -22
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +277 -140
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +717 -228
- package/cjs/forms.js.map +1 -1
- package/cjs/{fromJSLeaveImmer-7c363211.js → fromJSLeaveImmer-e74c673c.js} +4 -1
- package/cjs/{fromJSLeaveImmer-7c363211.js.map → fromJSLeaveImmer-e74c673c.js.map} +1 -1
- package/cjs/{reducers-9afb5f89.js → reducers-73a03ef4.js} +31 -10
- package/cjs/{reducers-9afb5f89.js.map → reducers-73a03ef4.js.map} +1 -1
- package/cjs/redux.js +4 -5
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +6 -5
- package/cjs/routing.js.map +1 -1
- package/cjs/{sagas-e04b94c1.js → sagas-570f23ba.js} +286 -187
- package/cjs/{sagas-e04b94c1.js.map → sagas-570f23ba.js.map} +1 -1
- package/cjs/search.js +82 -56
- package/cjs/search.js.map +1 -1
- package/cjs/{selectors-46b689d0.js → selectors-14caa813.js} +6 -1
- package/cjs/selectors-14caa813.js.map +1 -0
- package/cjs/urls-6fcaf4c6.js.map +1 -1
- package/cjs/user.js +9 -4
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +55 -35
- package/cjs/util.js.map +1 -1
- package/cjs/{version-79a027cb.js → version-34d91f68.js} +60 -26
- package/cjs/version-34d91f68.js.map +1 -0
- package/cjs/{version-afd4f77e.js → version-a410c88e.js} +6 -3
- package/cjs/{version-afd4f77e.js.map → version-a410c88e.js.map} +1 -1
- package/esm/{App-ff944c78.js → App-83107d7e.js} +137 -92
- package/esm/{App-ff944c78.js.map → App-83107d7e.js.map} +1 -1
- package/esm/{ChangePassword.container-ae0f9ce4.js → ChangePassword.container-76fd5e9b.js} +120 -62
- package/{cjs/ChangePassword.container-a617190b.js.map → esm/ChangePassword.container-76fd5e9b.js.map} +1 -1
- package/esm/{ContensisDeliveryApi-c66b0cc3.js → ContensisDeliveryApi-fe57a037.js} +71 -17
- package/{cjs/ContensisDeliveryApi-9e32960d.js.map → esm/ContensisDeliveryApi-fe57a037.js.map} +1 -1
- package/esm/CookieConstants-3d3b6531.js.map +1 -1
- package/esm/RouteLoader-29fd689a.js +310 -0
- package/esm/RouteLoader-29fd689a.js.map +1 -0
- package/esm/{ToJs-ae860aad.js → ToJs-df57f31d.js} +14 -6
- package/esm/{ToJs-ae860aad.js.map → ToJs-df57f31d.js.map} +1 -1
- package/esm/client.js +52 -23
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +272 -137
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +717 -228
- package/esm/forms.js.map +1 -1
- package/esm/{fromJSLeaveImmer-e2dacd63.js → fromJSLeaveImmer-0114ffcf.js} +4 -1
- package/esm/{fromJSLeaveImmer-e2dacd63.js.map → fromJSLeaveImmer-0114ffcf.js.map} +1 -1
- package/esm/{reducers-3d5c37d1.js → reducers-aa8cef1e.js} +31 -10
- package/esm/{reducers-3d5c37d1.js.map → reducers-aa8cef1e.js.map} +1 -1
- package/esm/redux.js +7 -8
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +3 -5
- package/esm/routing.js.map +1 -1
- package/esm/{sagas-933a8fc8.js → sagas-07e82e18.js} +239 -139
- package/esm/{sagas-933a8fc8.js.map → sagas-07e82e18.js.map} +1 -1
- package/esm/search.js +83 -57
- package/esm/search.js.map +1 -1
- package/esm/{selectors-01074974.js → selectors-691caf02.js} +6 -1
- package/esm/selectors-691caf02.js.map +1 -0
- package/esm/urls-eac9a747.js.map +1 -1
- package/esm/user.js +11 -6
- package/esm/user.js.map +1 -1
- package/esm/util.js +55 -35
- package/esm/util.js.map +1 -1
- package/esm/{version-346a9787.js → version-3d9911e2.js} +60 -26
- package/esm/version-3d9911e2.js.map +1 -0
- package/esm/{version-0fbd1b82.js → version-9f29becb.js} +6 -3
- package/esm/{version-0fbd1b82.js.map → version-9f29becb.js.map} +1 -1
- package/models/app/App.d.ts +3 -3
- package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +5 -3
- package/models/redux/appstate.d.ts +2 -3
- package/models/redux/store/history.d.ts +2 -2
- package/models/routing/components/Loading.d.ts +2 -2
- package/models/routing/components/NotFound.d.ts +2 -2
- package/models/routing/components/Redirect.d.ts +5 -0
- package/models/routing/components/StaticRouteLoader.d.ts +6 -0
- package/models/routing/components/Status.d.ts +1 -1
- package/models/routing/httpContext.d.ts +7 -0
- package/models/routing/index.d.ts +3 -0
- package/models/routing/redux/actions.d.ts +2 -3
- package/models/routing/routes.d.ts +11 -5
- package/models/user/components/Login.d.ts +2 -1
- package/models/user/components/LoginForm.d.ts +2 -1
- package/models/user/components/LogoutForm.d.ts +2 -1
- package/models/user/containers/ChangePassword.container.d.ts +1 -1
- package/models/user/containers/ForgotPassword.container.d.ts +1 -1
- package/models/user/containers/Login.container.d.ts +1 -1
- package/models/user/containers/Registration.container.d.ts +1 -1
- package/models/user/hocs/withLogin.d.ts +2 -1
- package/models/user/hocs/withRegistration.d.ts +1 -1
- package/models/util/ContensisDeliveryApi.d.ts +0 -1
- package/models/util/ToJs.d.ts +1 -1
- package/models/util/mergeStaticRoutes.d.ts +1 -0
- package/package.json +7 -10
- package/cjs/RouteLoader-049e81e5.js +0 -203
- package/cjs/RouteLoader-049e81e5.js.map +0 -1
- package/cjs/selectors-46b689d0.js.map +0 -1
- package/cjs/version-79a027cb.js.map +0 -1
- package/esm/RouteLoader-02eef6d9.js +0 -197
- package/esm/RouteLoader-02eef6d9.js.map +0 -1
- package/esm/selectors-01074974.js.map +0 -1
- package/esm/version-346a9787.js.map +0 -1
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect } from 'react';
|
|
2
|
-
import { useCookies } from 'react-cookie';
|
|
3
|
-
import { connect } from 'react-redux';
|
|
4
|
-
import { hot } from 'react-hot-loader';
|
|
5
|
-
import { Route, useLocation, Redirect } from 'react-router-dom';
|
|
6
|
-
import { matchRoutes, renderRoutes } from 'react-router-config';
|
|
7
|
-
import { createSelector } from 'reselect';
|
|
8
|
-
import { r as selectRouteEntryContentTypeId, a as selectRouteEntry, t as selectRouteIsError, u as selectIsNotFound, v as selectRouteLoading, k as selectMappedEntry, b as selectCurrentProject, w as selectCurrentPath, x as selectRouteStatusCode, y as selectRouteErrorMessage, z as setNavigationPath } from './selectors-01074974.js';
|
|
9
|
-
import { a as selectUserIsAuthenticated, b as selectUserGroups, t as toJS, C as CookieHelper, m as matchUserGroup } from './ToJs-ae860aad.js';
|
|
10
|
-
|
|
11
|
-
const NotFound = ({
|
|
12
|
-
statusCode,
|
|
13
|
-
statusText
|
|
14
|
-
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement("h1", null, statusCode || '404', " Page Not Found"), statusText && /*#__PURE__*/React.createElement("h2", {
|
|
15
|
-
style: {
|
|
16
|
-
background: '#eee',
|
|
17
|
-
color: '#666',
|
|
18
|
-
fontSize: '100%',
|
|
19
|
-
padding: '10px'
|
|
20
|
-
}
|
|
21
|
-
}, statusText)));
|
|
22
|
-
|
|
23
|
-
const Status = ({
|
|
24
|
-
code,
|
|
25
|
-
children
|
|
26
|
-
}) => {
|
|
27
|
-
return /*#__PURE__*/React.createElement(Route, {
|
|
28
|
-
render: ({
|
|
29
|
-
staticContext
|
|
30
|
-
}) => {
|
|
31
|
-
if (staticContext) staticContext.statusCode = code;
|
|
32
|
-
return children;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const replaceDoubleSlashRecursive = path => {
|
|
38
|
-
const nextPath = path.replace(/\/\//, '/');
|
|
39
|
-
if (nextPath.match(/\/\//)) {
|
|
40
|
-
return replaceDoubleSlashRecursive(nextPath);
|
|
41
|
-
}
|
|
42
|
-
return nextPath;
|
|
43
|
-
};
|
|
44
|
-
const getTrimmedPath = path => {
|
|
45
|
-
if (path !== '/') {
|
|
46
|
-
const nextPath = replaceDoubleSlashRecursive(path);
|
|
47
|
-
const lastChar = nextPath[nextPath.length - 1];
|
|
48
|
-
if (lastChar === '/') {
|
|
49
|
-
return nextPath.substring(0, nextPath.length - 1);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return path;
|
|
53
|
-
};
|
|
54
|
-
const RouteLoader = ({
|
|
55
|
-
contentTypeId,
|
|
56
|
-
entry,
|
|
57
|
-
isError,
|
|
58
|
-
isLoading,
|
|
59
|
-
isLoggedIn,
|
|
60
|
-
isNotFound,
|
|
61
|
-
loadingComponent,
|
|
62
|
-
mappedEntry,
|
|
63
|
-
notFoundComponent,
|
|
64
|
-
projectId,
|
|
65
|
-
routes,
|
|
66
|
-
setNavigationPath,
|
|
67
|
-
statePath,
|
|
68
|
-
statusCode,
|
|
69
|
-
statusText,
|
|
70
|
-
userGroups,
|
|
71
|
-
withEvents,
|
|
72
|
-
trailingSlashRedirectCode = 302
|
|
73
|
-
}) => {
|
|
74
|
-
const location = useLocation();
|
|
75
|
-
const cookies = new CookieHelper(...useCookies());
|
|
76
|
-
// Always ensure paths are trimmed of trailing slashes so urls are always unique
|
|
77
|
-
const trimmedPath = getTrimmedPath(location.pathname);
|
|
78
|
-
|
|
79
|
-
// Match any Static Routes a developer has defined
|
|
80
|
-
const matchedStaticRoute = () => matchRoutes(routes.StaticRoutes, location.pathname);
|
|
81
|
-
const isStaticRoute = () => matchedStaticRoute().length > 0;
|
|
82
|
-
const staticRoute = isStaticRoute() ? matchedStaticRoute()[0] : undefined;
|
|
83
|
-
const routeRequiresLogin = staticRoute && staticRoute.route.requireLogin;
|
|
84
|
-
const setPath = useCallback(() => {
|
|
85
|
-
// Use serverPath to control the path we send to siteview node api to resolve a route
|
|
86
|
-
let serverPath = '';
|
|
87
|
-
if (staticRoute && staticRoute.match && staticRoute.match.isExact) {
|
|
88
|
-
var _route$path, _route$fetchNode;
|
|
89
|
-
const {
|
|
90
|
-
match,
|
|
91
|
-
route
|
|
92
|
-
} = staticRoute;
|
|
93
|
-
if ((_route$path = route.path) !== null && _route$path !== void 0 && _route$path.includes('*')) {
|
|
94
|
-
// Send the whole url to api if we have matched route containing wildcard
|
|
95
|
-
serverPath = match.url;
|
|
96
|
-
} else if (typeof route.fetchNodeLevel === 'number') {
|
|
97
|
-
// Send all url parts to a specified level to api
|
|
98
|
-
serverPath = match.url.split('/').splice(0, route.fetchNodeLevel + 1).join('/');
|
|
99
|
-
} else if ((_route$fetchNode = route.fetchNode) !== null && _route$fetchNode !== void 0 && _route$fetchNode.params) {
|
|
100
|
-
const fetchNodeParams = route.fetchNode.params;
|
|
101
|
-
const routeParams = match.params;
|
|
102
|
-
const regexExp = new RegExp(Object.keys(routeParams).map(p => `:${p}`).join('|'), 'g');
|
|
103
|
-
serverPath = match.path.replace(/\?/g, '').replace(regexExp, matched => {
|
|
104
|
-
const param = matched.replace(':', '');
|
|
105
|
-
if (fetchNodeParams.includes(param)) return routeParams[param];else return '';
|
|
106
|
-
}).replace(/\/$/, '');
|
|
107
|
-
} else {
|
|
108
|
-
var _route$path2;
|
|
109
|
-
// Send all non-parameterised url parts to api
|
|
110
|
-
serverPath = (_route$path2 = route.path) === null || _route$path2 === void 0 ? void 0 : _route$path2.split('/').filter(p => !p.startsWith(':')).join('/');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
setNavigationPath(serverPath || trimmedPath, location, staticRoute, withEvents, statePath, routes, cookies);
|
|
114
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
115
|
-
}, [setNavigationPath,
|
|
116
|
-
// staticRoute,
|
|
117
|
-
withEvents, location, routes,
|
|
118
|
-
// statePath,
|
|
119
|
-
trimmedPath]);
|
|
120
|
-
if (typeof window == 'undefined') setPath();
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
setPath();
|
|
123
|
-
}, [location, setPath]);
|
|
124
|
-
|
|
125
|
-
// Need to redirect when url endswith a /
|
|
126
|
-
if (location.pathname.length > trimmedPath.length) {
|
|
127
|
-
return /*#__PURE__*/React.createElement(Status, {
|
|
128
|
-
code: trailingSlashRedirectCode
|
|
129
|
-
}, /*#__PURE__*/React.createElement(Redirect, {
|
|
130
|
-
to: `${trimmedPath}${location.search}${location.hash}`
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Render any Static Routes a developer has defined
|
|
135
|
-
if (isStaticRoute() && !(!isLoggedIn && routeRequiresLogin)) {
|
|
136
|
-
if (matchUserGroup(userGroups, routeRequiresLogin)) return renderRoutes(routes.StaticRoutes, {
|
|
137
|
-
projectId,
|
|
138
|
-
contentTypeId,
|
|
139
|
-
entry,
|
|
140
|
-
mappedEntry,
|
|
141
|
-
isLoggedIn
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Render a supplied Loading component if the route
|
|
146
|
-
// is not a static route and is in a loading state
|
|
147
|
-
if (isLoading && !isNotFound && loadingComponent) {
|
|
148
|
-
const LoadingComponent = loadingComponent;
|
|
149
|
-
return /*#__PURE__*/React.createElement(LoadingComponent, null);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Match any defined Content Type Mappings
|
|
153
|
-
if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) {
|
|
154
|
-
const MatchedComponent = routes.ContentTypeMappings.find(item => item.contentTypeID === contentTypeId);
|
|
155
|
-
if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) {
|
|
156
|
-
if (matchUserGroup(userGroups, MatchedComponent.requireLogin)) return /*#__PURE__*/React.createElement(MatchedComponent.component, {
|
|
157
|
-
projectId: projectId,
|
|
158
|
-
contentTypeId: contentTypeId,
|
|
159
|
-
entry: entry,
|
|
160
|
-
mappedEntry: mappedEntry,
|
|
161
|
-
isLoggedIn: isLoggedIn
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound;
|
|
166
|
-
if (isNotFound || isError) {
|
|
167
|
-
console.info(`RouteLoader rendering NotFound component: statusCode ${statusCode}, isNotFound ${isNotFound}, isError ${isError}`);
|
|
168
|
-
return /*#__PURE__*/React.createElement(Status, {
|
|
169
|
-
code: statusCode
|
|
170
|
-
}, /*#__PURE__*/React.createElement(NotFoundComponent, {
|
|
171
|
-
statusCode: statusCode,
|
|
172
|
-
statusText: statusText
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
return null;
|
|
176
|
-
};
|
|
177
|
-
const mapStateToPropsMemoized = createSelector(selectRouteEntryContentTypeId, selectRouteEntry, selectRouteIsError, selectIsNotFound, selectRouteLoading, selectUserIsAuthenticated, selectMappedEntry, selectCurrentProject, selectCurrentPath, selectRouteStatusCode, selectRouteErrorMessage, selectUserGroups, (contentTypeId, entry, isError, isNotFound, isLoading, isLoggedIn, mappedEntry, projectId, statePath, statusCode, statusText, userGroups) => ({
|
|
178
|
-
contentTypeId,
|
|
179
|
-
entry,
|
|
180
|
-
isError,
|
|
181
|
-
isNotFound,
|
|
182
|
-
isLoading,
|
|
183
|
-
isLoggedIn,
|
|
184
|
-
mappedEntry,
|
|
185
|
-
projectId,
|
|
186
|
-
statePath,
|
|
187
|
-
statusCode,
|
|
188
|
-
statusText,
|
|
189
|
-
userGroups
|
|
190
|
-
}));
|
|
191
|
-
const mapDispatchToProps = {
|
|
192
|
-
setNavigationPath
|
|
193
|
-
};
|
|
194
|
-
var RouteLoader$1 = hot(module)(connect(mapStateToPropsMemoized, mapDispatchToProps)(toJS(RouteLoader)));
|
|
195
|
-
|
|
196
|
-
export { RouteLoader$1 as R };
|
|
197
|
-
//# sourceMappingURL=RouteLoader-02eef6d9.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RouteLoader-02eef6d9.js","sources":["../src/routing/components/NotFound.tsx","../src/routing/components/Status.tsx","../src/routing/components/RouteLoader.tsx"],"sourcesContent":["import React from 'react';\n\nconst NotFound = ({\n statusCode,\n statusText,\n}: {\n statusCode: number;\n statusText: string;\n}) => (\n <>\n <header>\n <h1>{statusCode || '404'} Page Not Found</h1>\n {statusText && (\n <h2\n style={{\n background: '#eee',\n color: '#666',\n fontSize: '100%',\n padding: '10px',\n }}\n >\n {statusText}\n </h2>\n )}\n </header>\n </>\n);\n\nexport default NotFound;\n","import React, { PropsWithChildren } from 'react';\nimport { Route } from 'react-router-dom';\n\nexport const Status = ({\n code,\n children,\n}: PropsWithChildren<{ code: number }>) => {\n return (\n <Route\n render={({ staticContext }) => {\n if (staticContext) staticContext.statusCode = code;\n return children;\n }}\n />\n );\n};\n","import React, { useEffect, useCallback } from 'react';\nimport { useCookies } from 'react-cookie';\nimport { connect } from 'react-redux';\nimport { hot } from 'react-hot-loader';\nimport { Redirect, useLocation } from 'react-router-dom';\nimport { renderRoutes, matchRoutes, RouteConfig } from 'react-router-config';\nimport { createSelector } from 'reselect';\n\nimport NotFound from './NotFound';\nimport { Status } from './Status';\n\nimport {\n selectCurrentPath,\n selectCurrentProject,\n selectIsNotFound,\n selectMappedEntry,\n selectRouteEntry,\n selectRouteEntryContentTypeId,\n selectRouteErrorMessage,\n selectRouteIsError,\n selectRouteLoading,\n selectRouteStatusCode,\n} from '../redux/selectors';\nimport { setNavigationPath } from '../redux/actions';\n\nimport {\n selectUserGroups,\n selectUserIsAuthenticated,\n} from '~/user/redux/selectors';\nimport { matchUserGroup } from '~/user/util/matchGroups';\nimport { toJS } from '~/util/ToJs';\nimport { CookieHelper } from '~/user/util/CookieHelper.class';\n\nimport { Entry } from 'contensis-delivery-api/lib/models';\nimport { AppRootProps, RouteComponentProps, RouteLoaderProps } from '../routes';\n\nconst replaceDoubleSlashRecursive = (path: string) => {\n const nextPath = path.replace(/\\/\\//, '/');\n\n if (nextPath.match(/\\/\\//)) {\n return replaceDoubleSlashRecursive(nextPath);\n }\n\n return nextPath;\n};\n\nconst getTrimmedPath = path => {\n if (path !== '/') {\n const nextPath = replaceDoubleSlashRecursive(path);\n const lastChar = nextPath[nextPath.length - 1];\n if (lastChar === '/') {\n return nextPath.substring(0, nextPath.length - 1);\n }\n }\n return path;\n};\n\ninterface IReduxProps {\n contentTypeId: string | null;\n entry: Entry | null;\n isError: boolean;\n isNotFound: boolean;\n isLoading: boolean;\n isLoggedIn: boolean;\n mappedEntry: any;\n projectId: string;\n setNavigationPath: typeof setNavigationPath;\n statePath: string;\n statusCode: any;\n statusText: string;\n userGroups: any;\n}\n\nconst RouteLoader = ({\n contentTypeId,\n entry,\n isError,\n isLoading,\n isLoggedIn,\n isNotFound,\n loadingComponent,\n mappedEntry,\n notFoundComponent,\n projectId,\n routes,\n setNavigationPath,\n statePath,\n statusCode,\n statusText,\n userGroups,\n withEvents,\n trailingSlashRedirectCode = 302,\n}: AppRootProps & RouteLoaderProps & IReduxProps) => {\n const location = useLocation();\n const cookies = new CookieHelper(...useCookies());\n // Always ensure paths are trimmed of trailing slashes so urls are always unique\n const trimmedPath = getTrimmedPath(location.pathname);\n\n // Match any Static Routes a developer has defined\n const matchedStaticRoute = () =>\n matchRoutes(routes.StaticRoutes as RouteConfig[], location.pathname);\n const isStaticRoute = () => matchedStaticRoute().length > 0;\n\n const staticRoute = isStaticRoute() ? matchedStaticRoute()[0] : undefined;\n const routeRequiresLogin = staticRoute && staticRoute.route.requireLogin;\n\n const setPath = useCallback(() => {\n // Use serverPath to control the path we send to siteview node api to resolve a route\n let serverPath = '';\n if (staticRoute && staticRoute.match && staticRoute.match.isExact) {\n const { match, route } = staticRoute;\n\n if (route.path?.includes('*')) {\n // Send the whole url to api if we have matched route containing wildcard\n serverPath = match.url;\n } else if (typeof route.fetchNodeLevel === 'number') {\n // Send all url parts to a specified level to api\n serverPath = match.url\n .split('/')\n .splice(0, route.fetchNodeLevel + 1)\n .join('/');\n } else if (route.fetchNode?.params) {\n const fetchNodeParams: string[] = route.fetchNode.params;\n const routeParams: { [key: string]: string } = match.params;\n\n const regexExp = new RegExp(\n Object.keys(routeParams)\n .map(p => `:${p}`)\n .join('|'),\n 'g'\n );\n\n serverPath = match.path\n .replace(/\\?/g, '')\n .replace(regexExp, matched => {\n const param = matched.replace(':', '');\n if (fetchNodeParams.includes(param)) return routeParams[param];\n else return '';\n })\n .replace(/\\/$/, '');\n } else {\n // Send all non-parameterised url parts to api\n serverPath = (route.path as string)\n ?.split('/')\n .filter(p => !p.startsWith(':'))\n .join('/');\n }\n }\n\n setNavigationPath(\n serverPath || trimmedPath,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes,\n cookies\n );\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n setNavigationPath,\n // staticRoute,\n withEvents,\n location,\n routes,\n // statePath,\n trimmedPath,\n ]);\n\n if (typeof window == 'undefined') setPath();\n\n useEffect(() => {\n setPath();\n }, [location, setPath]);\n\n // Need to redirect when url endswith a /\n if (location.pathname.length > trimmedPath.length) {\n return (\n <Status code={trailingSlashRedirectCode}>\n <Redirect to={`${trimmedPath}${location.search}${location.hash}`} />\n </Status>\n );\n }\n\n // Render any Static Routes a developer has defined\n if (isStaticRoute() && !(!isLoggedIn && routeRequiresLogin)) {\n if (matchUserGroup(userGroups, routeRequiresLogin))\n return renderRoutes(\n routes.StaticRoutes as RouteConfig[],\n {\n projectId,\n contentTypeId,\n entry,\n mappedEntry,\n isLoggedIn,\n } as RouteComponentProps\n );\n }\n\n // Render a supplied Loading component if the route\n // is not a static route and is in a loading state\n if (isLoading && !isNotFound && loadingComponent) {\n const LoadingComponent = loadingComponent;\n return <LoadingComponent />;\n }\n\n // Match any defined Content Type Mappings\n if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) {\n const MatchedComponent = routes.ContentTypeMappings.find(\n item => item.contentTypeID === contentTypeId\n );\n\n if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) {\n if (matchUserGroup(userGroups, MatchedComponent.requireLogin))\n return (\n <MatchedComponent.component\n projectId={projectId}\n contentTypeId={contentTypeId}\n entry={entry}\n mappedEntry={mappedEntry}\n isLoggedIn={isLoggedIn}\n />\n );\n }\n }\n\n const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound;\n if (isNotFound || isError) {\n console.info(\n `RouteLoader rendering NotFound component: statusCode ${statusCode}, isNotFound ${isNotFound}, isError ${isError}`\n );\n\n return (\n <Status code={statusCode}>\n <NotFoundComponent statusCode={statusCode} statusText={statusText} />\n </Status>\n );\n }\n\n return null;\n};\nconst mapStateToPropsMemoized = createSelector(\n selectRouteEntryContentTypeId,\n selectRouteEntry,\n selectRouteIsError,\n selectIsNotFound,\n selectRouteLoading,\n selectUserIsAuthenticated,\n selectMappedEntry,\n selectCurrentProject,\n selectCurrentPath,\n selectRouteStatusCode,\n selectRouteErrorMessage,\n selectUserGroups,\n (\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups\n ) => ({\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups,\n })\n);\n\nconst mapDispatchToProps = {\n setNavigationPath,\n};\n\nexport default hot(module)(\n connect(mapStateToPropsMemoized, mapDispatchToProps)(toJS(RouteLoader as any))\n) as unknown as (props: AppRootProps & RouteLoaderProps) => JSX.Element;\n"],"names":["NotFound","statusCode","statusText","React","createElement","Fragment","style","background","color","fontSize","padding","Status","code","children","Route","render","staticContext","replaceDoubleSlashRecursive","path","nextPath","replace","match","getTrimmedPath","lastChar","length","substring","RouteLoader","contentTypeId","entry","isError","isLoading","isLoggedIn","isNotFound","loadingComponent","mappedEntry","notFoundComponent","projectId","routes","setNavigationPath","statePath","userGroups","withEvents","trailingSlashRedirectCode","location","useLocation","cookies","CookieHelper","useCookies","trimmedPath","pathname","matchedStaticRoute","matchRoutes","StaticRoutes","isStaticRoute","staticRoute","undefined","routeRequiresLogin","route","requireLogin","setPath","useCallback","serverPath","isExact","_route$path","_route$fetchNode","includes","url","fetchNodeLevel","split","splice","join","fetchNode","params","fetchNodeParams","routeParams","regexExp","RegExp","Object","keys","map","p","matched","param","_route$path2","filter","startsWith","window","useEffect","Redirect","to","search","hash","matchUserGroup","renderRoutes","LoadingComponent","MatchedComponent","ContentTypeMappings","find","item","contentTypeID","component","NotFoundComponent","console","info","mapStateToPropsMemoized","createSelector","selectRouteEntryContentTypeId","selectRouteEntry","selectRouteIsError","selectIsNotFound","selectRouteLoading","selectUserIsAuthenticated","selectMappedEntry","selectCurrentProject","selectCurrentPath","selectRouteStatusCode","selectRouteErrorMessage","selectUserGroups","mapDispatchToProps","hot","module","connect","toJS"],"mappings":";;;;;;;;;;AAEA,MAAMA,QAAQ,GAAGA,CAAC;EAChBC,UAAU;AACVC,EAAAA,UAAAA;AAIF,CAAC,kBACCC,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EACEF,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CACED,QAAAA,EA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U,MACN;EACJb,aAAa;EACbC,KAAK;EACLC,OAAO;EACPG,UAAU;EACVF,SAAS;EACTC,UAAU;EACVG,WAAW;EACXE,SAAS;EACTG,SAAS;EACTtC,UAAU;EACVC,UAAU;AACVsC,EAAAA,UAAAA;AACF,CAAC,CAAC,CACH,CAAA;AAED,MAAM8E,kBAAkB,GAAG;AACzBhF,EAAAA,iBAAAA;AACF,CAAC,CAAA;AAED,oBAAeiF,GAAG,CAACC,MAAM,CAAC,CACxBC,OAAO,CAACjB,uBAAuB,EAAEc,kBAAkB,CAAC,CAACI,IAAI,CAAChG,WAAW,CAAQ,CAAC,CAC/E;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors-01074974.js","sources":["../src/redux/util.ts","../src/routing/redux/types.ts","../src/routing/redux/actions.ts","../src/util/navigation.js","../src/routing/redux/selectors.ts"],"sourcesContent":["import { jpath } from '~/util/json-mapper';\n\nexport const action = (type: string, payload: any = {}) => ({\n type,\n ...payload,\n});\n\nexport const getJS = <S extends Record<string, unknown>, T extends keyof S>(\n state: S,\n stateKey: T\n) => {\n if (\n 'get' in state &&\n typeof state.get === 'function' &&\n 'toJS' in state &&\n typeof state.toJS === 'function'\n ) {\n return state.get(stateKey) as S[T];\n }\n return state[stateKey];\n};\n\nexport const getImmutableOrJS = <\n S extends Record<string, unknown>,\n T extends keyof S | any\n>(\n state: S,\n stateKey: T | T[],\n fallbackValue?: any,\n returnType: 'immutable' | 'js' = globalThis.STATE_TYPE\n) => {\n // Find a fromJS function from global that is dynamically loaded in createStore\n // or replace with a stub function for non-immutable gets\n const fromJS =\n returnType === 'immutable'\n ? globalThis.immutable?.fromJSOrdered || globalThis.immutable?.fromJS\n : v => v;\n\n if (\n state &&\n 'get' in state &&\n typeof state.get === 'function' &&\n 'getIn' in state &&\n typeof state.getIn === 'function' &&\n 'toJS' in state &&\n typeof state.toJS === 'function'\n ) {\n if (Array.isArray(stateKey))\n return fromJS(state.getIn(stateKey, fallbackValue));\n return fromJS(state.get(stateKey, fallbackValue)) as S[T | any];\n }\n\n if (Array.isArray(stateKey) && state && typeof state === 'object') {\n const result = jpath(stateKey.join('.'), state);\n if (typeof result === 'undefined') return fallbackValue;\n return result;\n }\n\n const result =\n state && typeof state === 'object' ? state[stateKey as string] : undefined;\n if (typeof result === 'undefined') return fallbackValue;\n return result;\n};\n","const ROUTING_PREFIX = '@ROUTING/';\nexport const GET_ENTRY = `${ROUTING_PREFIX}_GET_ENTRY`;\nexport const SET_ENTRY = `${ROUTING_PREFIX}_SET_ENTRY`;\nexport const SET_NODE = `${ROUTING_PREFIX}_SET_NODE`;\nexport const SET_ANCESTORS = `${ROUTING_PREFIX}_SET_ANCESTORS`;\nexport const SET_SIBLINGS = `${ROUTING_PREFIX}_SET_SIBLINGS`;\nexport const SET_ENTRY_ID = `${ROUTING_PREFIX}_SET_ENTRY_ID`;\nexport const SET_SURROGATE_KEYS = `${ROUTING_PREFIX}_SET_SURROGATE_KEYS`;\n\nexport const SET_NAVIGATION_PATH = `${ROUTING_PREFIX}_SET_NAVIGATION_PATH`;\n\nexport const SET_TARGET_PROJECT = `${ROUTING_PREFIX}_SET_TARGET_PROJECT`;\n\nexport const SET_ROUTE = `${ROUTING_PREFIX}_SET_ROUTE`;\n\nexport const UPDATE_LOADING_STATE = `${ROUTING_PREFIX}_UPDATE_LOADING_STATE`;\n","import { useLocation } from 'react-router-dom';\nimport { action } from '~/redux/util';\nimport {\n SET_ENTRY,\n SET_NAVIGATION_PATH,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SURROGATE_KEYS,\n} from './types';\n\nimport { Entry } from 'contensis-delivery-api/lib/models';\nimport { MatchedRoute, RouteConfig } from 'react-router-config';\nimport { AppRoutes, WithEvents } from '../routes';\nimport { CookieHelper } from '~/user/util/CookieHelper.class';\n\nexport const setNavigationPath = (\n path: string,\n location: ReturnType<typeof useLocation>,\n staticRoute: MatchedRoute<any, RouteConfig> | undefined,\n withEvents: WithEvents,\n statePath: string,\n routes: AppRoutes,\n cookies: CookieHelper\n) =>\n action(SET_NAVIGATION_PATH, {\n path,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes,\n cookies,\n });\n\nexport const setCurrentProject = (\n project: string,\n allowedGroups: any,\n hostname: string\n) => action(SET_TARGET_PROJECT, { project, allowedGroups, hostname });\n\nexport const setRoute = (path: string, state?: any) =>\n action(SET_ROUTE, { path, state });\n\nexport const setRouteEntry = (entry: Entry) => action(SET_ENTRY, { entry });\n\nexport const setSurrogateKeys = (keys: string, url: string) =>\n action(SET_SURROGATE_KEYS, { keys, url });\n","import queryString from 'query-string';\n\nexport function queryParams(search) {\n return queryString.parse(\n typeof window != 'undefined' ? window.location.search : search\n );\n}\nexport const routeParams = staticRoute =>\n staticRoute && staticRoute.match ? staticRoute.match.params : {};\n\nexport const buildUrl = (route, params) => {\n const qs = queryString.stringify(params);\n const path = qs ? `${route}?${qs}` : route;\n return path;\n};\n\nexport const clientHostname = () =>\n `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;\n","import { Entry } from 'contensis-delivery-api/lib/models';\nimport { StateType } from '~/config';\nimport { AppState } from '~/redux/appstate';\nimport { getImmutableOrJS as getIn } from '~/redux/util';\nimport { queryParams } from '~/util/navigation';\n\nexport const selectRouteEntry = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'entry'], {} as Entry, returnType);\n\nexport const selectMappedEntry = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'mappedEntry'], null, returnType);\n\nexport const selectSurrogateKeys = (state: AppState) => {\n const keys = getIn(state, ['routing', 'surrogateKeys'], [], 'js');\n return keys;\n};\nexport const selectCurrentHostname = (state: AppState) =>\n getIn(state, ['routing', 'currentHostname']);\n\nexport const selectCurrentTreeID = (state: AppState) =>\n getIn(state, ['routing', 'currentHostname']);\n\nexport const selectRouteEntryEntryId = (state: AppState) =>\n getIn(state, ['routing', 'entry', 'sys', 'id'], null);\n\nexport const selectRouteEntryContentTypeId = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'contentTypeId'], null);\n};\n\nexport const selectRouteEntryLanguage = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'language'], null);\n};\n\nexport const selectRouteEntrySlug = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'slug'], null);\n};\n\nexport const selectRouteEntryID = (state: AppState) =>\n getIn(state, ['routing', 'entryID']);\n\nexport const selectCanonicalPath = (state: AppState) => {\n return getIn(state, ['routing', 'canonicalPath']);\n};\n\nexport const selectCurrentPath = (state: AppState) =>\n getIn(state, ['routing', 'currentPath']);\n\nexport const selectCurrentLocation = (state: AppState) =>\n getIn(state, ['routing', 'location']);\nexport const selectCurrentSearch = (state: AppState) =>\n getIn(state, ['routing', 'location', 'search']);\nexport const selectCurrentHash = (state: AppState) =>\n getIn(state, ['routing', 'location', 'hash']);\nexport const selectQueryStringAsObject = (state: AppState) =>\n queryParams(selectCurrentSearch(state));\nexport const selectCurrentProject = (state: AppState) =>\n getIn(state, ['routing', 'currentProject']);\nexport const selectIsNotFound = (state: AppState) =>\n getIn(state, ['routing', 'notFound']);\nexport const selectCurrentAncestors = (state: AppState) =>\n getIn(state, ['routing', 'currentNodeAncestors'], []);\nexport const selectCurrentSiblings = (state: AppState) =>\n getIn(state, ['routing', 'currentNodeSiblings'], []);\nexport const selectCurrentNode = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'currentNode'], null, returnType);\nexport const selectCurrentChildren = state =>\n getIn(state, ['routing', 'currentNode', 'children'], []);\n\nexport const selectBreadcrumb = (state: AppState) => {\n return [...selectCurrentAncestors(state), selectCurrentNode(state)];\n};\nexport const selectRouteErrorMessage = (state: AppState) => {\n const error = getIn(state, ['routing', 'error']);\n return getIn(error, ['data', 'message'], getIn(error, 'statusText'));\n};\nexport const selectRouteIsError = (state: AppState) =>\n getIn(state, ['routing', 'isError']);\nexport const selectRouteLoading = (state: AppState) =>\n getIn(state, ['routing', 'isLoading']);\nexport const selectRouteStatusCode = (state: AppState) =>\n getIn(state, ['routing', 'statusCode']);\nexport const selectStaticRoute = (state: AppState) =>\n getIn(state, ['routing', 'staticRoute']);\n"],"names":["action","type","payload","getJS","state","stateKey","get","toJS","getImmutableOrJS","fallbackValue","returnType","globalThis","STATE_TYPE","_globalThis$immutable","_globalThis$immutable2","fromJS","immutable","fromJSOrdered","v","getIn","Array","isArray","result","jpath","join","undefined","ROUTING_PREFIX","GET_ENTRY","SET_ENTRY","SET_NODE","SET_ANCESTORS","SET_SIBLINGS","SET_ENTRY_ID","SET_SURROGATE_KEYS","SET_NAVIGATION_PATH","SET_TARGET_PROJECT","SET_ROUTE","UPDATE_LOADING_STATE","setNavigationPath","path","location","staticRoute","withEvents","statePath","routes","cookies","setCurrentProject","project","allowedGroups","hostname","setRoute","setRouteEntry","entry","setSurrogateKeys","keys","url","queryParams","search","queryString","parse","window","selectRouteEntry","selectMappedEntry","selectSurrogateKeys","selectCurrentHostname","selectCurrentTreeID","selectRouteEntryEntryId","selectRouteEntryContentTypeId","selectRouteEntryLanguage","selectRouteEntrySlug","selectRouteEntryID","selectCanonicalPath","selectCurrentPath","selectCurrentLocation","selectCurrentSearch","selectCurrentHash","selectQueryStringAsObject","selectCurrentProject","selectIsNotFound","selectCurrentAncestors","selectCurrentSiblings","selectCurrentNode","selectCurrentChildren","selectBreadcrumb","selectRouteErrorMessage","error","selectRouteIsError","selectRouteLoading","selectRouteStatusCode","selectStaticRoute"],"mappings":";;;AAEO,MAAMA,MAAM,GAAGA,CAACC,IAAY,EAAEC,OAAY,GAAG,EAAE,MAAM;EAC1DD,IAAI;EACJ,GAAGC,OAAAA;AACL,CAAC,EAAC;MAEWC,KAAK,GAAGA,CACnBC,KAAQ,EACRC,QAAW,KACR;EACH,IACE,KAAK,IAAID,KAAK,IACd,OAAOA,KAAK,CAACE,GAAG,KAAK,UAAU,IAC/B,MAAM,IAAIF,KAAK,IACf,OAAOA,KAAK,C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IACnDe,gBAAK,CAACf,KAAK,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,EAAC;AAClC,MAAMqF,iBAAiB,GAAIrF,KAAe,IAC/Ce,gBAAK,CAACf,KAAK,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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,KA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