@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,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
+
var reactCookie = require('react-cookie');
|
|
4
5
|
var reactRedux = require('react-redux');
|
|
5
6
|
var reactHotLoader = require('react-hot-loader');
|
|
6
7
|
var reactRouterDom = require('react-router-dom');
|
|
7
8
|
var reactRouterConfig = require('react-router-config');
|
|
8
9
|
var reselect = require('reselect');
|
|
9
|
-
var selectors = require('./selectors-
|
|
10
|
-
var
|
|
11
|
-
var ToJs = require('./ToJs-a9a8522b.js');
|
|
10
|
+
var selectors = require('./selectors-46b689d0.js');
|
|
11
|
+
var ToJs = require('./ToJs-149fc5e1.js');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
14
|
|
|
@@ -42,27 +42,21 @@ const Status = ({
|
|
|
42
42
|
|
|
43
43
|
const replaceDoubleSlashRecursive = path => {
|
|
44
44
|
const nextPath = path.replace(/\/\//, '/');
|
|
45
|
-
|
|
46
45
|
if (nextPath.match(/\/\//)) {
|
|
47
46
|
return replaceDoubleSlashRecursive(nextPath);
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
return nextPath;
|
|
51
49
|
};
|
|
52
|
-
|
|
53
50
|
const getTrimmedPath = path => {
|
|
54
51
|
if (path !== '/') {
|
|
55
52
|
const nextPath = replaceDoubleSlashRecursive(path);
|
|
56
53
|
const lastChar = nextPath[nextPath.length - 1];
|
|
57
|
-
|
|
58
54
|
if (lastChar === '/') {
|
|
59
55
|
return nextPath.substring(0, nextPath.length - 1);
|
|
60
56
|
}
|
|
61
57
|
}
|
|
62
|
-
|
|
63
58
|
return path;
|
|
64
59
|
};
|
|
65
|
-
|
|
66
60
|
const RouteLoader = ({
|
|
67
61
|
contentTypeId,
|
|
68
62
|
entry,
|
|
@@ -83,28 +77,25 @@ const RouteLoader = ({
|
|
|
83
77
|
withEvents,
|
|
84
78
|
trailingSlashRedirectCode = 302
|
|
85
79
|
}) => {
|
|
86
|
-
const location = reactRouterDom.useLocation();
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
const location = reactRouterDom.useLocation();
|
|
81
|
+
const cookies = new ToJs.CookieHelper(...reactCookie.useCookies());
|
|
82
|
+
// Always ensure paths are trimmed of trailing slashes so urls are always unique
|
|
83
|
+
const trimmedPath = getTrimmedPath(location.pathname);
|
|
89
84
|
|
|
85
|
+
// Match any Static Routes a developer has defined
|
|
90
86
|
const matchedStaticRoute = () => reactRouterConfig.matchRoutes(routes.StaticRoutes, location.pathname);
|
|
91
|
-
|
|
92
87
|
const isStaticRoute = () => matchedStaticRoute().length > 0;
|
|
93
|
-
|
|
94
|
-
const staticRoute = isStaticRoute() && matchedStaticRoute()[0];
|
|
88
|
+
const staticRoute = isStaticRoute() ? matchedStaticRoute()[0] : undefined;
|
|
95
89
|
const routeRequiresLogin = staticRoute && staticRoute.route.requireLogin;
|
|
96
90
|
const setPath = React.useCallback(() => {
|
|
97
91
|
// Use serverPath to control the path we send to siteview node api to resolve a route
|
|
98
92
|
let serverPath = '';
|
|
99
|
-
|
|
100
93
|
if (staticRoute && staticRoute.match && staticRoute.match.isExact) {
|
|
101
94
|
var _route$path, _route$fetchNode;
|
|
102
|
-
|
|
103
95
|
const {
|
|
104
96
|
match,
|
|
105
97
|
route
|
|
106
98
|
} = staticRoute;
|
|
107
|
-
|
|
108
99
|
if ((_route$path = route.path) !== null && _route$path !== void 0 && _route$path.includes('*')) {
|
|
109
100
|
// Send the whole url to api if we have matched route containing wildcard
|
|
110
101
|
serverPath = match.url;
|
|
@@ -121,30 +112,32 @@ const RouteLoader = ({
|
|
|
121
112
|
}).replace(/\/$/, '');
|
|
122
113
|
} else {
|
|
123
114
|
var _route$path2;
|
|
124
|
-
|
|
125
115
|
// Send all non-parameterised url parts to api
|
|
126
116
|
serverPath = (_route$path2 = route.path) === null || _route$path2 === void 0 ? void 0 : _route$path2.split('/').filter(p => !p.startsWith(':')).join('/');
|
|
127
117
|
}
|
|
128
118
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}, [setNavigationPath,
|
|
132
|
-
|
|
119
|
+
setNavigationPath(serverPath || trimmedPath, location, staticRoute, withEvents, statePath, routes, cookies);
|
|
120
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
121
|
+
}, [setNavigationPath,
|
|
122
|
+
// staticRoute,
|
|
123
|
+
withEvents, location, routes,
|
|
124
|
+
// statePath,
|
|
133
125
|
trimmedPath]);
|
|
134
126
|
if (typeof window == 'undefined') setPath();
|
|
135
127
|
React.useEffect(() => {
|
|
136
128
|
setPath();
|
|
137
|
-
}, [location, setPath]);
|
|
129
|
+
}, [location, setPath]);
|
|
138
130
|
|
|
131
|
+
// Need to redirect when url endswith a /
|
|
139
132
|
if (location.pathname.length > trimmedPath.length) {
|
|
140
133
|
return /*#__PURE__*/React__default["default"].createElement(Status, {
|
|
141
134
|
code: trailingSlashRedirectCode
|
|
142
135
|
}, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.Redirect, {
|
|
143
136
|
to: `${trimmedPath}${location.search}${location.hash}`
|
|
144
137
|
}));
|
|
145
|
-
}
|
|
146
|
-
|
|
138
|
+
}
|
|
147
139
|
|
|
140
|
+
// Render any Static Routes a developer has defined
|
|
148
141
|
if (isStaticRoute() && !(!isLoggedIn && routeRequiresLogin)) {
|
|
149
142
|
if (ToJs.matchUserGroup(userGroups, routeRequiresLogin)) return reactRouterConfig.renderRoutes(routes.StaticRoutes, {
|
|
150
143
|
projectId,
|
|
@@ -153,19 +146,18 @@ const RouteLoader = ({
|
|
|
153
146
|
mappedEntry,
|
|
154
147
|
isLoggedIn
|
|
155
148
|
});
|
|
156
|
-
}
|
|
157
|
-
// is not a static route and is in a loading state
|
|
158
|
-
|
|
149
|
+
}
|
|
159
150
|
|
|
151
|
+
// Render a supplied Loading component if the route
|
|
152
|
+
// is not a static route and is in a loading state
|
|
160
153
|
if (isLoading && !isNotFound && loadingComponent) {
|
|
161
154
|
const LoadingComponent = loadingComponent;
|
|
162
155
|
return /*#__PURE__*/React__default["default"].createElement(LoadingComponent, null);
|
|
163
|
-
}
|
|
164
|
-
|
|
156
|
+
}
|
|
165
157
|
|
|
158
|
+
// Match any defined Content Type Mappings
|
|
166
159
|
if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) {
|
|
167
160
|
const MatchedComponent = routes.ContentTypeMappings.find(item => item.contentTypeID === contentTypeId);
|
|
168
|
-
|
|
169
161
|
if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) {
|
|
170
162
|
if (ToJs.matchUserGroup(userGroups, MatchedComponent.requireLogin)) return /*#__PURE__*/React__default["default"].createElement(MatchedComponent.component, {
|
|
171
163
|
projectId: projectId,
|
|
@@ -176,10 +168,9 @@ const RouteLoader = ({
|
|
|
176
168
|
});
|
|
177
169
|
}
|
|
178
170
|
}
|
|
179
|
-
|
|
180
171
|
const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound;
|
|
181
|
-
|
|
182
172
|
if (isNotFound || isError) {
|
|
173
|
+
console.info(`RouteLoader rendering NotFound component: statusCode ${statusCode}, isNotFound ${isNotFound}, isError ${isError}`);
|
|
183
174
|
return /*#__PURE__*/React__default["default"].createElement(Status, {
|
|
184
175
|
code: statusCode
|
|
185
176
|
}, /*#__PURE__*/React__default["default"].createElement(NotFoundComponent, {
|
|
@@ -187,10 +178,8 @@ const RouteLoader = ({
|
|
|
187
178
|
statusText: statusText
|
|
188
179
|
}));
|
|
189
180
|
}
|
|
190
|
-
|
|
191
181
|
return null;
|
|
192
182
|
};
|
|
193
|
-
|
|
194
183
|
const mapStateToPropsMemoized = reselect.createSelector(selectors.selectRouteEntryContentTypeId, selectors.selectRouteEntry, selectors.selectRouteIsError, selectors.selectIsNotFound, selectors.selectRouteLoading, ToJs.selectUserIsAuthenticated, selectors.selectMappedEntry, selectors.selectCurrentProject, selectors.selectCurrentPath, selectors.selectRouteStatusCode, selectors.selectRouteErrorMessage, ToJs.selectUserGroups, (contentTypeId, entry, isError, isNotFound, isLoading, isLoggedIn, mappedEntry, projectId, statePath, statusCode, statusText, userGroups) => ({
|
|
195
184
|
contentTypeId,
|
|
196
185
|
entry,
|
|
@@ -206,9 +195,9 @@ const mapStateToPropsMemoized = reselect.createSelector(selectors.selectRouteEnt
|
|
|
206
195
|
userGroups
|
|
207
196
|
}));
|
|
208
197
|
const mapDispatchToProps = {
|
|
209
|
-
setNavigationPath:
|
|
198
|
+
setNavigationPath: selectors.setNavigationPath
|
|
210
199
|
};
|
|
211
200
|
var RouteLoader$1 = reactHotLoader.hot(module)(reactRedux.connect(mapStateToPropsMemoized, mapDispatchToProps)(ToJs.toJS(RouteLoader)));
|
|
212
201
|
|
|
213
202
|
exports.RouteLoader = RouteLoader$1;
|
|
214
|
-
//# sourceMappingURL=RouteLoader-
|
|
203
|
+
//# sourceMappingURL=RouteLoader-049e81e5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteLoader-049e81e5.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","select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,4BAAkB,EAClBC,0BAAgB,EAChBC,4BAAkB,EAClBC,8BAAyB,EACzBC,2BAAiB,EACjBC,8BAAoB,EACpBC,2BAAiB,EACjBC,+BAAqB,EACrBC,iCAAuB,EACvBC,qBAAgB,EAChB,CACE1F,aAAa,EACbC,KAAK,EACLC,OAAO,EACPG,UAAU,EACVF,SAAS,EACTC,UAAU,EACVG,WAAW,EACXE,SAAS,EACTG,SAAS,EACTtC,UAAU,EACVC,UAAU,EACVsC,UAAU,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,qBAAAA,2BAAAA;AACF,CAAC,CAAA;AAED,oBAAeiF,kBAAG,CAACC,MAAM,CAAC,CACxBC,kBAAO,CAACjB,uBAAuB,EAAEc,kBAAkB,CAAC,CAACI,SAAI,CAAChG,WAAW,CAAQ,CAAC,CAC/E;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var selectors$1 = require('./selectors-
|
|
3
|
+
var selectors$1 = require('./selectors-46b689d0.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
|
|
6
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -11,12 +11,12 @@ const selectUserIsLoading = state => selectors$1.getImmutableOrJS(state, ['user'
|
|
|
11
11
|
const selectUserIsAuthenticated = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'isAuthenticated']);
|
|
12
12
|
const selectUserIsAuthenticationError = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'isAuthenticationError']);
|
|
13
13
|
const selectUserIsError = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'isError']);
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* DEPRECATED 12/2021 - use selectUserErrorMessage instead
|
|
16
17
|
* @param state AppState
|
|
17
18
|
* @returns string
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
20
|
const selectUserAuthenticationErrorMessage = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'errorMessage']);
|
|
21
21
|
const selectUserErrorMessage = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'errorMessage']);
|
|
22
22
|
const selectClientCredentials = (state, returnType) => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'clientCredentials'], {}, returnType);
|
|
@@ -79,7 +79,6 @@ const matchUserGroup = (userGroups = [], requiredGroups = []) => {
|
|
|
79
79
|
if (requiredGroup.id === userGroup.id) {
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
82
|
if (requiredGroup.name === userGroup.name) {
|
|
84
83
|
return true;
|
|
85
84
|
}
|
|
@@ -88,6 +87,52 @@ const matchUserGroup = (userGroups = [], requiredGroups = []) => {
|
|
|
88
87
|
return groupMatch;
|
|
89
88
|
};
|
|
90
89
|
|
|
90
|
+
const COOKIE_VALID_DAYS = 1; // 0 = Session cookie
|
|
91
|
+
|
|
92
|
+
// CookieHelper is a class that takes in and lets us pass around the methods provided
|
|
93
|
+
// by `useCookie` react hook in backend code that is connected to the universal-cookies
|
|
94
|
+
// instance created in SSR middleware (and provides browser cookies)
|
|
95
|
+
class CookieHelper {
|
|
96
|
+
get raw() {
|
|
97
|
+
return this.cookies;
|
|
98
|
+
}
|
|
99
|
+
constructor(cookies, setCookie, removeCookie) {
|
|
100
|
+
this.cookies = void 0;
|
|
101
|
+
this.setCookie = void 0;
|
|
102
|
+
this.removeCookie = void 0;
|
|
103
|
+
this.cookies = cookies;
|
|
104
|
+
this.setCookie = setCookie;
|
|
105
|
+
this.removeCookie = removeCookie;
|
|
106
|
+
}
|
|
107
|
+
GetCookie(name) {
|
|
108
|
+
const cookie = this.cookies[name];
|
|
109
|
+
if (typeof cookie === 'undefined') {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return cookie;
|
|
113
|
+
}
|
|
114
|
+
SetCookie(name, value, maxAgeDays = COOKIE_VALID_DAYS) {
|
|
115
|
+
// update local cookies object as this is provided as a clone of `req.universalCookies`
|
|
116
|
+
this.cookies[name] = value;
|
|
117
|
+
|
|
118
|
+
// call the passed setCookie method so we can update the `universal-cookie` instance
|
|
119
|
+
// with the change listener attached so the cookies can be set in SSR response
|
|
120
|
+
if (maxAgeDays === 0) this.setCookie(name, value);else this.setCookie(name, value, {
|
|
121
|
+
expires: addDays(new Date(), maxAgeDays)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
DeleteCookie(name) {
|
|
125
|
+
// update local cookies object as this is provided as a clone of `req.universalCookies`
|
|
126
|
+
delete this.cookies[name];
|
|
127
|
+
this.removeCookie(name);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const addDays = (date = new Date(), days) => {
|
|
131
|
+
const result = new Date(date);
|
|
132
|
+
result.setDate(result.getDate() + days);
|
|
133
|
+
return result;
|
|
134
|
+
};
|
|
135
|
+
|
|
91
136
|
/* eslint-disable react/display-name */
|
|
92
137
|
const toJS = WrappedComponent => wrappedComponentProps => {
|
|
93
138
|
const KEY = 0;
|
|
@@ -101,6 +146,7 @@ const toJS = WrappedComponent => wrappedComponentProps => {
|
|
|
101
146
|
return /*#__PURE__*/React__default["default"].createElement(WrappedComponent, propsJS);
|
|
102
147
|
};
|
|
103
148
|
|
|
149
|
+
exports.CookieHelper = CookieHelper;
|
|
104
150
|
exports.matchUserGroup = matchUserGroup;
|
|
105
151
|
exports.selectChangePasswordError = selectChangePasswordError;
|
|
106
152
|
exports.selectChangePasswordSending = selectChangePasswordSending;
|
|
@@ -126,4 +172,4 @@ exports.selectUserRegistrationIsLoading = selectUserRegistrationIsLoading;
|
|
|
126
172
|
exports.selectUserRegistrationIsSuccess = selectUserRegistrationIsSuccess;
|
|
127
173
|
exports.selectors = selectors;
|
|
128
174
|
exports.toJS = toJS;
|
|
129
|
-
//# sourceMappingURL=ToJs-
|
|
175
|
+
//# sourceMappingURL=ToJs-149fc5e1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToJs-149fc5e1.js","sources":["../src/user/redux/selectors.ts","../src/user/util/matchGroups.ts","../src/user/util/CookieHelper.class.ts","../src/util/ToJs.tsx"],"sourcesContent":["import { StateType } from '~/config';\nimport { AppState } from '~/redux/appstate';\nimport { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const selectUserIsLoading = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isLoading']);\n\nexport const selectUserIsAuthenticated = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isAuthenticated']);\n\nexport const selectUserIsAuthenticationError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isAuthenticationError']);\n\nexport const selectUserIsError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isError']);\n\n/**\n * DEPRECATED 12/2021 - use selectUserErrorMessage instead\n * @param state AppState\n * @returns string\n */\nexport const selectUserAuthenticationErrorMessage = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'errorMessage']);\n\nexport const selectUserErrorMessage = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'errorMessage']);\n\nexport const selectClientCredentials = (\n state: AppState,\n returnType?: StateType\n) =>\n getIn(\n state,\n ['user', 'authenticationState', 'clientCredentials'],\n {},\n returnType\n );\n\nexport const selectUser = (state: AppState, returnType?: StateType) =>\n getIn(state, 'user', {}, returnType);\n\nexport const selectUserIsZengentiStaff = (state: AppState) =>\n getIn(state, ['user', 'isZengentiStaff']);\n\nexport const selectUserGuid = (state: AppState) => getIn(state, ['user', 'id']);\n\nexport const selectUsername = (state: AppState) =>\n getIn(state, ['user', 'username']);\n\nexport const selectUserEmail = (state: AppState) =>\n getIn(state, ['user', 'email']);\n\nexport const selectUserGroups = (state: AppState, returnType?: StateType) =>\n getIn(state, ['user', 'groups'], [], returnType);\n\nexport const selectUserSecurityToken = (state: AppState) =>\n getIn(state, [\n 'user',\n 'authenticationState',\n 'clientCredentials',\n 'contensisClassicToken',\n ]);\n\nexport const selectUserRegistration = (\n state: AppState,\n returnType?: StateType\n) => getIn(state, ['user', 'registration'], {}, returnType);\n\nexport const selectUserRegistrationError = (state: AppState) =>\n getIn(state, ['user', 'registration', 'error'], false);\n\nexport const selectUserRegistrationIsLoading = (state: AppState) =>\n getIn(state, ['user', 'registration', 'isLoading'], false);\n\nexport const selectUserRegistrationIsSuccess = (state: AppState) =>\n getIn(state, ['user', 'registration', 'success'], false);\n\nexport const selectPasswordResetRequestSending = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'isSending']);\n\nexport const selectPasswordResetRequestSent = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'sent']);\n\nexport const selectPasswordResetRequestError = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'error']);\n\nexport const selectResetPasswordSending = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'isSending']);\n\nexport const selectResetPasswordSent = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'sent']);\n\nexport const selectResetPasswordError = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'error']);\n\nexport const selectChangePasswordSending = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'isSending']);\n\nexport const selectChangePasswordSent = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'sent']);\n\nexport const selectChangePasswordError = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'error']);\n","import { Group } from 'contensis-management-api/lib/models';\nimport { RequireLogin } from '~/routing/routes';\n\nexport const matchUserGroup = (\n userGroups: Group[] = [],\n requiredGroups: RequireLogin = []\n) => {\n if (\n !Array.isArray(requiredGroups) ||\n (Array.isArray(requiredGroups) && requiredGroups.length === 0)\n )\n return true;\n\n const groupMatch = requiredGroups.some(requiredGroup => {\n return userGroups.some(userGroup => {\n if (requiredGroup.id === userGroup.id) {\n return true;\n }\n if (requiredGroup.name === userGroup.name) {\n return true;\n }\n });\n });\n return groupMatch;\n};\n","import { useCookies } from 'react-cookie';\n\nconst COOKIE_VALID_DAYS = 1; // 0 = Session cookie\n\ntype CookieHook = ReturnType<typeof useCookies>;\ntype Cookies = { [k: string]: string };\ntype SetCookie = CookieHook[1];\ntype RemoveCookie = CookieHook[2];\n\n// CookieHelper is a class that takes in and lets us pass around the methods provided\n// by `useCookie` react hook in backend code that is connected to the universal-cookies\n// instance created in SSR middleware (and provides browser cookies)\nexport class CookieHelper {\n private cookies: Cookies;\n private setCookie: SetCookie;\n private removeCookie: RemoveCookie;\n\n get raw() {\n return this.cookies;\n }\n\n constructor(\n cookies: { [k: string]: string },\n setCookie: CookieHelper['setCookie'],\n removeCookie: CookieHelper['removeCookie']\n ) {\n this.cookies = cookies;\n this.setCookie = setCookie;\n this.removeCookie = removeCookie;\n }\n\n GetCookie(name: string) {\n const cookie = this.cookies[name];\n if (typeof cookie === 'undefined') {\n return null;\n }\n return cookie;\n }\n\n SetCookie(name: string, value: string, maxAgeDays = COOKIE_VALID_DAYS) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n this.cookies[name] = value;\n\n // call the passed setCookie method so we can update the `universal-cookie` instance\n // with the change listener attached so the cookies can be set in SSR response\n if (maxAgeDays === 0) this.setCookie(name, value);\n else\n this.setCookie(name, value, {\n expires: addDays(new Date(), maxAgeDays),\n });\n }\n\n DeleteCookie(name: string) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n delete this.cookies[name];\n\n this.removeCookie(name);\n }\n}\nconst addDays = (date = new Date(), days: number) => {\n const result = new Date(date);\n result.setDate(result.getDate() + days);\n return result;\n};\n\nexport const mapCookieHeader = cookies =>\n typeof cookies === 'object'\n ? Object.entries(cookies)\n .map(([name, value]) => `${name}=${value}`)\n .join('; ')\n : cookies;\n","/* eslint-disable react/display-name */\n/* eslint-disable @typescript-eslint/naming-convention */\nimport React from 'react';\n\nexport const toJS =\n <Props extends { [key: string]: any }>(\n WrappedComponent: React.ComponentType<Props>\n ) =>\n (wrappedComponentProps: Props) => {\n const KEY = 0;\n const VALUE = 1;\n\n const propsJS = Object.entries(wrappedComponentProps).reduce<Props>(\n (newProps: any, wrappedComponentProp) => {\n const propKey = wrappedComponentProp[KEY];\n const propValue = wrappedComponentProp[VALUE];\n newProps[propKey] =\n propValue && typeof propValue === 'object' && 'toJS' in propValue\n ? propValue.toJS()\n : propValue;\n return newProps as Props;\n },\n {} as Props\n );\n\n return <WrappedComponent {...propsJS} />;\n };\n"],"names":["selectUserIsLoading","state","getIn","selectUserIsAuthenticated","selectUserIsAuthenticationError","selectUserIsError","selectUserAuthenticationErrorMessage","selectUserErrorMessage","selectClientCredentials","returnType","selectUser","selectUserIsZengentiStaff","selectUserGuid","selectUsername","selectUserEmail","selectUserGroups","selectUserSecurityToken","selectUserRegistration","selectUserRegistrationError","selectUserRegistrationIsLoading","selectUserRegistrationIsSuccess","selectPasswordResetRequestSending","selectPasswordResetRequestSent","selectPasswordResetRequestError","selectResetPasswordSending","selectResetPasswordSent","selectResetPasswordError","selectChangePasswordSending","selectChangePasswordSent","selectChangePasswordError","matchUserGroup","userGroups","requiredGroups","Array","isArray","length","groupMatch","some","requiredGroup","userGroup","id","name","COOKIE_VALID_DAYS","CookieHelper","raw","cookies","constructor","setCookie","removeCookie","GetCookie","cookie","SetCookie","value","maxAgeDays","expires","addDays","Date","DeleteCookie","date","days","result","setDate","getDate","toJS","WrappedComponent","wrappedComponentProps","KEY","VALUE","propsJS","Object","entries","reduce","newProps","wrappedComponentProp","propKey","propValue","React","createElement"],"mappings":";;;;;;;;;MAIaA,mBAAmB,GAAIC,KAAe,IACjDC,4BAAK,CAACD,KAAK,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,WAAW,CAAC,EAAC;MAE/CE,yBAAyB,GAAIF,KAAe,IACvD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B,EAAKI,OAAO,CAAI,CAAA;AAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
|
+
|
|
5
|
+
function getDefaultExportFromCjs (x) {
|
|
6
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
exports.commonjsGlobal = commonjsGlobal;
|
|
10
|
+
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
11
|
+
//# sourceMappingURL=_commonjsHelpers-b3309d7b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers-b3309d7b.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/cjs/client.js
CHANGED
|
@@ -11,28 +11,27 @@ var reactRouterDom = require('react-router-dom');
|
|
|
11
11
|
var component = require('@loadable/component');
|
|
12
12
|
var queryString = require('query-string');
|
|
13
13
|
var reactCookie = require('react-cookie');
|
|
14
|
-
var version
|
|
15
|
-
var version = require('./version-
|
|
16
|
-
var App = require('./App-
|
|
17
|
-
var
|
|
18
|
-
require('./
|
|
19
|
-
require('jsonpath-mapper');
|
|
20
|
-
require('@redux-saga/core/effects');
|
|
14
|
+
var version = require('./version-79a027cb.js');
|
|
15
|
+
var version$1 = require('./version-afd4f77e.js');
|
|
16
|
+
var App = require('./App-7ff737fa.js');
|
|
17
|
+
var selectors = require('./selectors-46b689d0.js');
|
|
18
|
+
var ContensisDeliveryApi = require('./ContensisDeliveryApi-9e32960d.js');
|
|
21
19
|
require('redux');
|
|
22
20
|
require('redux-thunk');
|
|
23
21
|
require('redux-saga');
|
|
24
22
|
require('redux-injectors');
|
|
25
23
|
require('immer');
|
|
26
|
-
require('
|
|
27
|
-
require('
|
|
24
|
+
require('./reducers-9afb5f89.js');
|
|
25
|
+
require('@redux-saga/core/effects');
|
|
28
26
|
require('history');
|
|
29
27
|
require('loglevel');
|
|
30
|
-
require('contensis-delivery-api');
|
|
31
|
-
require('./login-e711a19e.js');
|
|
32
|
-
require('./ToJs-a9a8522b.js');
|
|
33
28
|
require('await-to-js');
|
|
34
|
-
require('js
|
|
35
|
-
require('./
|
|
29
|
+
require('./ChangePassword.container-a617190b.js');
|
|
30
|
+
require('./ToJs-149fc5e1.js');
|
|
31
|
+
require('jsonpath-mapper');
|
|
32
|
+
require('./CookieConstants-000427db.js');
|
|
33
|
+
require('contensis-delivery-api');
|
|
34
|
+
require('./RouteLoader-049e81e5.js');
|
|
36
35
|
require('react-router-config');
|
|
37
36
|
require('reselect');
|
|
38
37
|
|
|
@@ -40,6 +39,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
40
39
|
|
|
41
40
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
41
|
|
|
42
|
+
// Fix TS2769 error No overload matches this call
|
|
43
|
+
const Container = reactHotLoader.AppContainer; // as typeof AppContainer;
|
|
44
|
+
|
|
43
45
|
class ClientApp {
|
|
44
46
|
constructor(ReactApp, config) {
|
|
45
47
|
const documentRoot = document.getElementById('root');
|
|
@@ -50,9 +52,8 @@ class ClientApp {
|
|
|
50
52
|
withSagas,
|
|
51
53
|
withEvents
|
|
52
54
|
} = config;
|
|
53
|
-
|
|
54
55
|
const GetClientJSX = store => {
|
|
55
|
-
const ClientJsx = /*#__PURE__*/React__default["default"].createElement(
|
|
56
|
+
const ClientJsx = /*#__PURE__*/React__default["default"].createElement(Container, null, /*#__PURE__*/React__default["default"].createElement(reactCookie.CookiesProvider, null, /*#__PURE__*/React__default["default"].createElement(reactRedux.Provider, {
|
|
56
57
|
store: store
|
|
57
58
|
}, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.Router, {
|
|
58
59
|
history: App.browserHistory
|
|
@@ -62,12 +63,11 @@ class ClientApp {
|
|
|
62
63
|
})))));
|
|
63
64
|
return ClientJsx;
|
|
64
65
|
};
|
|
65
|
-
|
|
66
66
|
const isProduction = !(process.env.NODE_ENV !== 'production');
|
|
67
|
+
|
|
67
68
|
/**
|
|
68
69
|
* Webpack HMR Setup.
|
|
69
70
|
*/
|
|
70
|
-
|
|
71
71
|
const HMRRenderer = Component => {
|
|
72
72
|
if (isProduction) component.loadableReady(() => {
|
|
73
73
|
reactDom.hydrate(Component, documentRoot);
|
|
@@ -75,7 +75,6 @@ class ClientApp {
|
|
|
75
75
|
namespace: 'modern'
|
|
76
76
|
});else reactDom.render(Component, documentRoot);
|
|
77
77
|
};
|
|
78
|
-
|
|
79
78
|
const hmr = store => {
|
|
80
79
|
// webpack Hot Module Replacement API
|
|
81
80
|
if (module.hot) {
|
|
@@ -85,22 +84,19 @@ class ClientApp {
|
|
|
85
84
|
});
|
|
86
85
|
}
|
|
87
86
|
};
|
|
88
|
-
|
|
89
87
|
const qs = queryString.parse(window.location.search);
|
|
90
|
-
const versionStatus =
|
|
91
|
-
|
|
88
|
+
const versionStatus = ContensisDeliveryApi.deliveryApi.getClientSideVersionStatus();
|
|
92
89
|
if (window.isDynamic || window.REDUX_DATA || process.env.NODE_ENV !== 'production') {
|
|
93
90
|
version.createStore(withReducers, window.REDUX_DATA, App.browserHistory, stateType).then(store => {
|
|
94
91
|
const state = store.getState();
|
|
95
|
-
const ssrVersionStatus = version
|
|
96
|
-
if (!ssrVersionStatus) store.dispatch(version.setVersionStatus(versionStatus));
|
|
97
|
-
/* eslint-disable no-console */
|
|
92
|
+
const ssrVersionStatus = version.selectVersionStatus(state);
|
|
93
|
+
if (!ssrVersionStatus) store.dispatch(version$1.setVersionStatus(versionStatus));
|
|
98
94
|
|
|
95
|
+
/* eslint-disable no-console */
|
|
99
96
|
console.log('Hydrating from inline Redux');
|
|
100
97
|
/* eslint-enable no-console */
|
|
101
|
-
|
|
102
98
|
store.runSaga(App.rootSaga(withSagas));
|
|
103
|
-
store.dispatch(
|
|
99
|
+
store.dispatch(selectors.setCurrentProject(App.pickProject(window.location.hostname, qs), [], window.location.hostname));
|
|
104
100
|
delete window.REDUX_DATA;
|
|
105
101
|
HMRRenderer(GetClientJSX(store));
|
|
106
102
|
hmr(store);
|
|
@@ -109,16 +105,15 @@ class ClientApp {
|
|
|
109
105
|
fetch(`${window.location.pathname}?redux=true`).then(response => response.json()).then(data => {
|
|
110
106
|
const ssRedux = JSON.parse(data);
|
|
111
107
|
version.createStore(withReducers, ssRedux, App.browserHistory, stateType).then(store => {
|
|
112
|
-
store.dispatch(version.setVersionStatus(versionStatus));
|
|
108
|
+
store.dispatch(version$1.setVersionStatus(versionStatus));
|
|
113
109
|
store.runSaga(App.rootSaga(withSagas));
|
|
114
|
-
store.dispatch(
|
|
110
|
+
store.dispatch(selectors.setCurrentProject(App.pickProject(window.location.hostname, qs), [], window.location.hostname));
|
|
115
111
|
HMRRenderer(GetClientJSX(store));
|
|
116
112
|
hmr(store);
|
|
117
113
|
});
|
|
118
114
|
});
|
|
119
115
|
}
|
|
120
116
|
}
|
|
121
|
-
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
exports.ReactApp = App.AppRoot;
|
package/cjs/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../src/client/client.tsx"],"sourcesContent":["import 'isomorphic-fetch';\nimport React from 'react';\nimport { render, hydrate } from 'react-dom';\nimport { AppContainer } from 'react-hot-loader';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { Router } from 'react-router-dom';\nimport { loadableReady } from '@loadable/component';\nimport { parse } from 'query-string';\nimport { CookiesProvider } from 'react-cookie';\n\nimport { selectVersionStatus } from '~/redux/selectors/version';\nimport { setVersionStatus } from '~/redux/actions/version';\nimport rootSaga from '~/redux/sagas';\nimport { browserHistory as history } from '~/redux/store/history';\nimport createStore from '~/redux/store/store';\n\nimport { setCurrentProject } from '~/routing/redux/actions';\n\nimport { deliveryApi } from '~/util/ContensisDeliveryApi';\nimport pickProject from '~/util/pickProject';\n\nimport { AppConfig } from '~/config';\n\ndeclare let window: typeof globalThis & {\n isDynamic;\n REDUX_DATA;\n};\n\ntype ReactAppProps = { routes: any; withEvents: any };\n\nclass ClientApp {\n constructor(ReactApp: React.ComponentType<ReactAppProps>, config: AppConfig) {\n const documentRoot = document.getElementById('root');\n\n const {\n stateType = 'immutable',\n routes,\n withReducers,\n withSagas,\n withEvents,\n } = config;\n\n const GetClientJSX = store => {\n const ClientJsx = (\n <
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../src/client/client.tsx"],"sourcesContent":["import 'isomorphic-fetch';\nimport React from 'react';\nimport { render, hydrate } from 'react-dom';\nimport { AppContainer } from 'react-hot-loader';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { Router } from 'react-router-dom';\nimport { loadableReady } from '@loadable/component';\nimport { parse } from 'query-string';\nimport { CookiesProvider } from 'react-cookie';\n\nimport { selectVersionStatus } from '~/redux/selectors/version';\nimport { setVersionStatus } from '~/redux/actions/version';\nimport rootSaga from '~/redux/sagas';\nimport { browserHistory as history } from '~/redux/store/history';\nimport createStore from '~/redux/store/store';\n\nimport { setCurrentProject } from '~/routing/redux/actions';\n\nimport { deliveryApi } from '~/util/ContensisDeliveryApi';\nimport pickProject from '~/util/pickProject';\n\nimport { AppConfig } from '~/config';\n\ndeclare let window: typeof globalThis & {\n isDynamic;\n REDUX_DATA;\n};\n\ntype ReactAppProps = { routes: any; withEvents: any };\n\n// Fix TS2769 error No overload matches this call\nconst Container = AppContainer as any; // as typeof AppContainer;\n\nclass ClientApp {\n constructor(ReactApp: React.ComponentType<ReactAppProps>, config: AppConfig) {\n const documentRoot = document.getElementById('root');\n\n const {\n stateType = 'immutable',\n routes,\n withReducers,\n withSagas,\n withEvents,\n } = config;\n\n const GetClientJSX = store => {\n const ClientJsx = (\n <Container>\n <CookiesProvider>\n <ReduxProvider store={store}>\n <Router history={history}>\n <ReactApp routes={routes} withEvents={withEvents} />\n </Router>\n </ReduxProvider>\n </CookiesProvider>\n </Container>\n );\n return ClientJsx;\n };\n\n const isProduction = !(process.env.NODE_ENV !== 'production');\n\n /**\n * Webpack HMR Setup.\n */\n const HMRRenderer = Component => {\n if (isProduction)\n loadableReady(\n () => {\n hydrate(Component, documentRoot);\n },\n { namespace: 'modern' }\n );\n else render(Component, documentRoot);\n };\n\n const hmr = store => {\n // webpack Hot Module Replacement API\n if (module.hot) {\n module.hot.accept(ReactApp as unknown as string, () => {\n // if you are using harmony modules ({modules:false})\n HMRRenderer(GetClientJSX(store));\n });\n }\n };\n\n const qs = parse(window.location.search);\n const versionStatus = deliveryApi.getClientSideVersionStatus();\n\n if (\n window.isDynamic ||\n window.REDUX_DATA ||\n process.env.NODE_ENV !== 'production'\n ) {\n createStore(withReducers, window.REDUX_DATA, history, stateType).then(\n store => {\n const state = store.getState();\n const ssrVersionStatus = selectVersionStatus(state);\n if (!ssrVersionStatus)\n store.dispatch(setVersionStatus(versionStatus));\n\n /* eslint-disable no-console */\n console.log('Hydrating from inline Redux');\n /* eslint-enable no-console */\n store.runSaga(rootSaga(withSagas));\n store.dispatch(\n setCurrentProject(\n pickProject(window.location.hostname, qs),\n [],\n window.location.hostname\n )\n );\n\n delete window.REDUX_DATA;\n HMRRenderer(GetClientJSX(store));\n\n hmr(store);\n }\n );\n } else {\n fetch(`${window.location.pathname}?redux=true`)\n .then(response => response.json())\n .then(data => {\n const ssRedux = JSON.parse(data);\n createStore(withReducers, ssRedux, history, stateType).then(store => {\n store.dispatch(setVersionStatus(versionStatus));\n\n store.runSaga(rootSaga(withSagas));\n store.dispatch(\n setCurrentProject(\n pickProject(window.location.hostname, qs),\n [],\n window.location.hostname\n )\n );\n\n HMRRenderer(GetClientJSX(store));\n\n hmr(store);\n });\n });\n }\n }\n}\n\nexport default ClientApp;\n"],"names":["Container","AppContainer","ClientApp","constructor","ReactApp","config","documentRoot","document","getElementById","stateType","routes","withReducers","withSagas","withEvents","GetClientJSX","store","ClientJsx","React","createElement","CookiesProvider","ReduxProvider","Router","history","isProduction","process","env","NODE_ENV","HMRRenderer","Component","loadableReady","hydrate","namespace","render","hmr","module","hot","accept","qs","parse","window","location","search","versionStatus","deliveryApi","getClientSideVersionStatus","isDynamic","REDUX_DATA","createStore","then","state","getState","ssrVersionStatus","selectVersionStatus","dispatch","setVersionStatus","console","log","runSaga","rootSaga","setCurrentProject","pickProject","hostname","fetch","pathname","response","json","data","ssRedux","JSON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA,MAAMA,SAAS,GAAGC,2BAAmB,CAAC;;AAEtC,MAAMC,SAAS,CAAC;AACdC,EAAAA,WAAWA,CAACC,QAA4C,EAAEC,MAAiB,EAAE;AAC3E,IAAA,MAAMC,YAAY,GAAGC,QAAQ,CAACC,cAAc,CAAC,MAAM,CAAC,CAAA;IAEpD,MAAM;AACJC,MAAAA,SAAS,GAAG,WAAW;MACvBC,MAAM;MACNC,YAAY;MACZC,SAAS;AACTC,MAAAA,UAAAA;AACF,KAAC,GAAGR,MAAM,CAAA;IAEV,MAAMS,YAAY,GAAGC,KAAK,IAAI;AAC5B,MAAA,MAAMC,SAAS,gBACbC,yBAAA,CAAAC,aAAA,CAAClB,SAAS,EACRiB,IAAAA,eAAAA,yBAAA,CAAAC,aAAA,CAACC,2BAAe,EAAA,IAAA,eACdF,yBAAA,CAAAC,aAAA,CAACE,mBAAa,EAAA;AAACL,QAAAA,KAAK,EAAEA,KAAAA;AAAM,OAAA,eAC1BE,yBAAA,CAAAC,aAAA,CAACG,qBAAM,EAAA;AAACC,QAAAA,OAAO,EAAEA,kBAAAA;AAAQ,OAAA,eACvBL,yBAAA,CAAAC,aAAA,CAACd,QAAQ,EAAA;AAACM,QAAAA,MAAM,EAAEA,MAAO;AAACG,QAAAA,UAAU,EAAEA,UAAAA;OA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