@zengenti/contensis-react-base 3.0.0-beta.2 → 3.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/cjs/{App-581b6653.js → App-7ecf6d63.js} +43 -27
- package/cjs/App-7ecf6d63.js.map +1 -0
- package/cjs/{RouteLoader-282c03ab.js → RouteLoader-fb056e9e.js} +44 -30
- package/cjs/RouteLoader-fb056e9e.js.map +1 -0
- package/cjs/ToJs-5da8a85e.js +124 -0
- package/cjs/ToJs-5da8a85e.js.map +1 -0
- package/cjs/{actions-12871aca.js → actions-43f4daa4.js} +6 -6
- package/cjs/{actions-12871aca.js.map → actions-43f4daa4.js.map} +1 -1
- package/cjs/client.js +43 -22
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +42 -46
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +275 -275
- package/cjs/forms.js.map +1 -1
- package/cjs/fromJSLeaveImmer-65d26804.js +28 -0
- package/cjs/fromJSLeaveImmer-65d26804.js.map +1 -0
- package/cjs/{login-81d7f9ef.js → login-5e3972d3.js} +28 -31
- package/cjs/login-5e3972d3.js.map +1 -0
- package/cjs/{reducers-fde41d6b.js → reducers-60dafd94.js} +2 -2
- package/cjs/reducers-60dafd94.js.map +1 -0
- package/cjs/redux.js +13 -14
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +9 -8
- package/cjs/routing.js.map +1 -1
- package/cjs/search.js +172 -147
- package/cjs/search.js.map +1 -1
- package/cjs/{selectors-ed26ed97.js → selectors-2c1b1183.js} +8 -4
- package/cjs/selectors-2c1b1183.js.map +1 -0
- package/cjs/user.js +16 -16
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +36 -40
- package/cjs/util.js.map +1 -1
- package/cjs/{version-f061e409.js → version-6f8f4530.js} +54 -45
- package/cjs/version-6f8f4530.js.map +1 -0
- package/cjs/{version-0c190929.js → version-dcfdafd9.js} +5 -5
- package/cjs/{version-0c190929.js.map → version-dcfdafd9.js.map} +1 -1
- package/esm/{App-122f28a3.js → App-3642ea1a.js} +24 -27
- package/esm/App-3642ea1a.js.map +1 -0
- package/esm/{RouteLoader-c2faac87.js → RouteLoader-c8565e6e.js} +37 -23
- package/esm/RouteLoader-c8565e6e.js.map +1 -0
- package/esm/ToJs-1f2e6395.js +93 -0
- package/esm/ToJs-1f2e6395.js.map +1 -0
- package/esm/{actions-3cc39599.js → actions-1e19267f.js} +5 -5
- package/esm/{actions-3cc39599.js.map → actions-1e19267f.js.map} +1 -1
- package/esm/client.js +22 -20
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +24 -28
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +5 -5
- package/esm/forms.js.map +1 -1
- package/esm/fromJSLeaveImmer-e2f0f331.js +26 -0
- package/esm/fromJSLeaveImmer-e2f0f331.js.map +1 -0
- package/esm/{login-92db44d1.js → login-1b08ac1a.js} +12 -12
- package/esm/login-1b08ac1a.js.map +1 -0
- package/esm/{reducers-d6c0edb1.js → reducers-6f6801ed.js} +2 -2
- package/esm/reducers-6f6801ed.js.map +1 -0
- package/esm/redux.js +14 -13
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +9 -8
- package/esm/routing.js.map +1 -1
- package/esm/search.js +142 -135
- package/esm/search.js.map +1 -1
- package/esm/{selectors-82e71d8e.js → selectors-65f0f31c.js} +9 -6
- package/esm/selectors-65f0f31c.js.map +1 -0
- package/esm/user.js +15 -15
- package/esm/user.js.map +1 -1
- package/esm/util.js +5 -5
- package/esm/util.js.map +1 -1
- package/esm/version-696796d7.js +15 -0
- package/esm/{version-59c8f9be.js.map → version-696796d7.js.map} +1 -1
- package/esm/{version-cb9cd09d.js → version-eca1e4ca.js} +34 -24
- package/esm/version-eca1e4ca.js.map +1 -0
- package/models/redux/appstate.d.ts +0 -1
- package/models/redux/reducers/navigation.d.ts +1 -6
- package/models/redux/reducers/version.d.ts +1 -5
- package/models/routing/redux/reducers.d.ts +1 -21
- package/models/routing/redux/selectors.d.ts +1 -1
- package/models/search/hooks/useMinilist.hook.d.ts +2 -15
- package/models/search/models/Queries.d.ts +8 -5
- package/models/search/models/Search.d.ts +9 -8
- package/models/search/models/SearchProps.d.ts +16 -2
- package/models/search/models/SearchState.d.ts +3 -0
- package/models/search/models/index.d.ts +2 -2
- package/models/search/redux/reducers.d.ts +226 -314
- package/models/search/redux/selectors.d.ts +4 -10
- package/models/search/search/expressions.d.ts +2 -6
- package/models/search/transformations/filter-to-filterexpression.mapper.d.ts +6 -0
- package/models/search/transformations/filters-to-filterexpressions.mapper.d.ts +3 -0
- package/models/testImmer/redux/reducer.d.ts +1 -7
- package/models/user/hocs/withLogin.d.ts +2 -2
- package/models/user/hooks/useChangePassword.d.ts +5 -5
- package/models/user/hooks/useForgotPassword.d.ts +6 -6
- package/models/user/hooks/useLogin.d.ts +7 -45
- package/models/user/hooks/useRegistration.d.ts +4 -4
- package/models/user/redux/reducers.d.ts +1 -27
- package/models/user/redux/selectors.d.ts +28 -71
- package/models/util/merge.d.ts +1 -0
- package/package-lock.json +1893 -4633
- package/package.json +46 -47
- package/cjs/App-581b6653.js.map +0 -1
- package/cjs/RouteLoader-282c03ab.js.map +0 -1
- package/cjs/ToJs-87edc45d.js +0 -230
- package/cjs/ToJs-87edc45d.js.map +0 -1
- package/cjs/fromJSLeaveImmer-9b550c8e.js +0 -40
- package/cjs/fromJSLeaveImmer-9b550c8e.js.map +0 -1
- package/cjs/login-81d7f9ef.js.map +0 -1
- package/cjs/reducers-fde41d6b.js.map +0 -1
- package/cjs/selectors-ed26ed97.js.map +0 -1
- package/cjs/version-f061e409.js.map +0 -1
- package/esm/App-122f28a3.js.map +0 -1
- package/esm/RouteLoader-c2faac87.js.map +0 -1
- package/esm/ToJs-52fee252.js +0 -199
- package/esm/ToJs-52fee252.js.map +0 -1
- package/esm/fromJSLeaveImmer-e44d1a91.js +0 -38
- package/esm/fromJSLeaveImmer-e44d1a91.js.map +0 -1
- package/esm/login-92db44d1.js.map +0 -1
- package/esm/reducers-d6c0edb1.js.map +0 -1
- package/esm/selectors-82e71d8e.js.map +0 -1
- package/esm/version-59c8f9be.js +0 -15
- package/esm/version-cb9cd09d.js.map +0 -1
- package/models/search/transformations/filters-to-filterexpression.d.ts +0 -1
- package/models/search/transformations/filters-to-filterexpression.mapper.d.ts +0 -2
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var selectors$1 = require('./selectors-2c1b1183.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
|
|
10
|
+
const selectUserIsLoading = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'loading']);
|
|
11
|
+
const selectUserIsAuthenticated = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'authenticated']);
|
|
12
|
+
const selectUserAuthenticationError = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'authenticationError']);
|
|
13
|
+
const selectUserAuthenticationErrorMessage = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'authenticationErrorMessage']);
|
|
14
|
+
const selectUserError = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'error']);
|
|
15
|
+
const selectUserErrorMessage = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'errorMessage']);
|
|
16
|
+
const selectClientCredentials = (state, returnType) => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'clientCredentials'], {}, returnType);
|
|
17
|
+
const selectUser = (state, returnType) => selectors$1.getImmutableOrJS(state, 'user', {}, returnType);
|
|
18
|
+
const selectUserIsZengentiStaff = state => selectors$1.getImmutableOrJS(state, ['user', 'isZengentiStaff']);
|
|
19
|
+
const selectUserGuid = state => selectors$1.getImmutableOrJS(state, ['user', 'id']);
|
|
20
|
+
const selectUsername = state => selectors$1.getImmutableOrJS(state, ['user', 'username']);
|
|
21
|
+
const selectUserEmail = state => selectors$1.getImmutableOrJS(state, ['user', 'email']);
|
|
22
|
+
const selectUserGroups = (state, returnType) => selectors$1.getImmutableOrJS(state, ['user', 'groups'], [], returnType);
|
|
23
|
+
const selectUserSecurityToken = state => selectors$1.getImmutableOrJS(state, ['user', 'authenticationState', 'clientCredentials', 'contensisClassicToken']);
|
|
24
|
+
const selectUserRegistration = (state, returnType) => selectors$1.getImmutableOrJS(state, ['user', 'registration'], {}, returnType);
|
|
25
|
+
const selectUserRegistrationError = state => selectors$1.getImmutableOrJS(state, ['user', 'registration', 'error'], false);
|
|
26
|
+
const selectUserRegistrationIsLoading = state => selectors$1.getImmutableOrJS(state, ['user', 'registration', 'loading'], false);
|
|
27
|
+
const selectUserRegistrationIsSuccess = state => selectors$1.getImmutableOrJS(state, ['user', 'registration', 'success'], false);
|
|
28
|
+
const selectPasswordResetRequestSending = state => selectors$1.getImmutableOrJS(state, ['user', 'passwordResetRequest', 'isSending']);
|
|
29
|
+
const selectPasswordResetRequestSent = state => selectors$1.getImmutableOrJS(state, ['user', 'passwordResetRequest', 'sent']);
|
|
30
|
+
const selectPasswordResetRequestError = state => selectors$1.getImmutableOrJS(state, ['user', 'passwordResetRequest', 'error']);
|
|
31
|
+
const selectResetPasswordSending = state => selectors$1.getImmutableOrJS(state, ['user', 'resetPassword', 'isSending']);
|
|
32
|
+
const selectResetPasswordSent = state => selectors$1.getImmutableOrJS(state, ['user', 'resetPassword', 'sent']);
|
|
33
|
+
const selectResetPasswordError = state => selectors$1.getImmutableOrJS(state, ['user', 'resetPassword', 'error']);
|
|
34
|
+
const selectChangePasswordSending = state => selectors$1.getImmutableOrJS(state, ['user', 'changePassword', 'isSending']);
|
|
35
|
+
const selectChangePasswordSent = state => selectors$1.getImmutableOrJS(state, ['user', 'changePassword', 'sent']);
|
|
36
|
+
const selectChangePasswordError = state => selectors$1.getImmutableOrJS(state, ['user', 'changePassword', 'error']);
|
|
37
|
+
|
|
38
|
+
var selectors = /*#__PURE__*/Object.freeze({
|
|
39
|
+
__proto__: null,
|
|
40
|
+
selectUserIsLoading: selectUserIsLoading,
|
|
41
|
+
selectUserIsAuthenticated: selectUserIsAuthenticated,
|
|
42
|
+
selectUserAuthenticationError: selectUserAuthenticationError,
|
|
43
|
+
selectUserAuthenticationErrorMessage: selectUserAuthenticationErrorMessage,
|
|
44
|
+
selectUserError: selectUserError,
|
|
45
|
+
selectUserErrorMessage: selectUserErrorMessage,
|
|
46
|
+
selectClientCredentials: selectClientCredentials,
|
|
47
|
+
selectUser: selectUser,
|
|
48
|
+
selectUserIsZengentiStaff: selectUserIsZengentiStaff,
|
|
49
|
+
selectUserGuid: selectUserGuid,
|
|
50
|
+
selectUsername: selectUsername,
|
|
51
|
+
selectUserEmail: selectUserEmail,
|
|
52
|
+
selectUserGroups: selectUserGroups,
|
|
53
|
+
selectUserSecurityToken: selectUserSecurityToken,
|
|
54
|
+
selectUserRegistration: selectUserRegistration,
|
|
55
|
+
selectUserRegistrationError: selectUserRegistrationError,
|
|
56
|
+
selectUserRegistrationIsLoading: selectUserRegistrationIsLoading,
|
|
57
|
+
selectUserRegistrationIsSuccess: selectUserRegistrationIsSuccess,
|
|
58
|
+
selectPasswordResetRequestSending: selectPasswordResetRequestSending,
|
|
59
|
+
selectPasswordResetRequestSent: selectPasswordResetRequestSent,
|
|
60
|
+
selectPasswordResetRequestError: selectPasswordResetRequestError,
|
|
61
|
+
selectResetPasswordSending: selectResetPasswordSending,
|
|
62
|
+
selectResetPasswordSent: selectResetPasswordSent,
|
|
63
|
+
selectResetPasswordError: selectResetPasswordError,
|
|
64
|
+
selectChangePasswordSending: selectChangePasswordSending,
|
|
65
|
+
selectChangePasswordSent: selectChangePasswordSent,
|
|
66
|
+
selectChangePasswordError: selectChangePasswordError
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const matchUserGroup = (userGroups = [], requiredGroups = []) => {
|
|
70
|
+
if (!Array.isArray(requiredGroups) || Array.isArray(requiredGroups) && requiredGroups.length === 0) return true;
|
|
71
|
+
const groupMatch = requiredGroups.some(requiredGroup => {
|
|
72
|
+
return userGroups.some(userGroup => {
|
|
73
|
+
if (requiredGroup.id === userGroup.id) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (requiredGroup.name === userGroup.name) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
return groupMatch;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/* eslint-disable react/display-name */
|
|
86
|
+
const toJS = WrappedComponent => wrappedComponentProps => {
|
|
87
|
+
const KEY = 0;
|
|
88
|
+
const VALUE = 1;
|
|
89
|
+
const propsJS = Object.entries(wrappedComponentProps).reduce((newProps, wrappedComponentProp) => {
|
|
90
|
+
const propKey = wrappedComponentProp[KEY];
|
|
91
|
+
const propValue = wrappedComponentProp[VALUE];
|
|
92
|
+
newProps[propKey] = propValue && typeof propValue === 'object' && 'toJS' in propValue ? propValue.toJS() : propValue;
|
|
93
|
+
return newProps;
|
|
94
|
+
}, {});
|
|
95
|
+
return /*#__PURE__*/React__default["default"].createElement(WrappedComponent, propsJS);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.matchUserGroup = matchUserGroup;
|
|
99
|
+
exports.selectChangePasswordError = selectChangePasswordError;
|
|
100
|
+
exports.selectChangePasswordSending = selectChangePasswordSending;
|
|
101
|
+
exports.selectChangePasswordSent = selectChangePasswordSent;
|
|
102
|
+
exports.selectClientCredentials = selectClientCredentials;
|
|
103
|
+
exports.selectPasswordResetRequestError = selectPasswordResetRequestError;
|
|
104
|
+
exports.selectPasswordResetRequestSending = selectPasswordResetRequestSending;
|
|
105
|
+
exports.selectPasswordResetRequestSent = selectPasswordResetRequestSent;
|
|
106
|
+
exports.selectResetPasswordError = selectResetPasswordError;
|
|
107
|
+
exports.selectResetPasswordSending = selectResetPasswordSending;
|
|
108
|
+
exports.selectResetPasswordSent = selectResetPasswordSent;
|
|
109
|
+
exports.selectUser = selectUser;
|
|
110
|
+
exports.selectUserAuthenticationError = selectUserAuthenticationError;
|
|
111
|
+
exports.selectUserAuthenticationErrorMessage = selectUserAuthenticationErrorMessage;
|
|
112
|
+
exports.selectUserError = selectUserError;
|
|
113
|
+
exports.selectUserErrorMessage = selectUserErrorMessage;
|
|
114
|
+
exports.selectUserGroups = selectUserGroups;
|
|
115
|
+
exports.selectUserGuid = selectUserGuid;
|
|
116
|
+
exports.selectUserIsAuthenticated = selectUserIsAuthenticated;
|
|
117
|
+
exports.selectUserIsLoading = selectUserIsLoading;
|
|
118
|
+
exports.selectUserRegistration = selectUserRegistration;
|
|
119
|
+
exports.selectUserRegistrationError = selectUserRegistrationError;
|
|
120
|
+
exports.selectUserRegistrationIsLoading = selectUserRegistrationIsLoading;
|
|
121
|
+
exports.selectUserRegistrationIsSuccess = selectUserRegistrationIsSuccess;
|
|
122
|
+
exports.selectors = selectors;
|
|
123
|
+
exports.toJS = toJS;
|
|
124
|
+
//# sourceMappingURL=ToJs-5da8a85e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToJs-5da8a85e.js","sources":["../src/user/redux/selectors.ts","../src/user/util/matchGroups.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', 'loading']);\n\nexport const selectUserIsAuthenticated = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'authenticated']);\n\nexport const selectUserAuthenticationError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'authenticationError']);\n\nexport const selectUserAuthenticationErrorMessage = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'authenticationErrorMessage']);\n\nexport const selectUserError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'error']);\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', 'loading'], 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","/* 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 ): React.ComponentType<Props> =>\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","selectUserAuthenticationError","selectUserAuthenticationErrorMessage","selectUserError","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","toJS","WrappedComponent","wrappedComponentProps","KEY","VALUE","propsJS","Object","entries","reduce","newProps","wrappedComponentProp","propKey","propValue","React"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var selectors = require('./selectors-
|
|
3
|
+
var selectors = require('./selectors-2c1b1183.js');
|
|
4
4
|
|
|
5
5
|
const ROUTING_PREFIX = '@ROUTING/';
|
|
6
6
|
const GET_ENTRY = `${ROUTING_PREFIX}_GET_ENTRY`;
|
|
@@ -16,7 +16,7 @@ const SET_TARGET_PROJECT = `${ROUTING_PREFIX}_SET_TARGET_PROJECT`;
|
|
|
16
16
|
const SET_ROUTE = `${ROUTING_PREFIX}_SET_ROUTE`;
|
|
17
17
|
const UPDATE_LOADING_STATE = `${ROUTING_PREFIX}_UPDATE_LOADING_STATE`;
|
|
18
18
|
|
|
19
|
-
var routing = /*#__PURE__*/Object.freeze({
|
|
19
|
+
var routing$1 = /*#__PURE__*/Object.freeze({
|
|
20
20
|
__proto__: null,
|
|
21
21
|
GET_ENTRY: GET_ENTRY,
|
|
22
22
|
SET_ENTRY: SET_ENTRY,
|
|
@@ -59,7 +59,7 @@ const setSurrogateKeys = keys => selectors.action(SET_SURROGATE_KEYS, {
|
|
|
59
59
|
keys
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
var routing
|
|
62
|
+
var routing = /*#__PURE__*/Object.freeze({
|
|
63
63
|
__proto__: null,
|
|
64
64
|
setNotFound: setNotFound,
|
|
65
65
|
setNavigationPath: setNavigationPath,
|
|
@@ -77,10 +77,10 @@ exports.SET_SIBLINGS = SET_SIBLINGS;
|
|
|
77
77
|
exports.SET_SURROGATE_KEYS = SET_SURROGATE_KEYS;
|
|
78
78
|
exports.SET_TARGET_PROJECT = SET_TARGET_PROJECT;
|
|
79
79
|
exports.UPDATE_LOADING_STATE = UPDATE_LOADING_STATE;
|
|
80
|
-
exports.routing = routing;
|
|
81
|
-
exports.routing$1 = routing
|
|
80
|
+
exports.routing = routing$1;
|
|
81
|
+
exports.routing$1 = routing;
|
|
82
82
|
exports.setCurrentProject = setCurrentProject;
|
|
83
83
|
exports.setNavigationPath = setNavigationPath;
|
|
84
84
|
exports.setRoute = setRoute;
|
|
85
85
|
exports.setSurrogateKeys = setSurrogateKeys;
|
|
86
|
-
//# sourceMappingURL=actions-
|
|
86
|
+
//# sourceMappingURL=actions-43f4daa4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-
|
|
1
|
+
{"version":3,"file":"actions-43f4daa4.js","sources":["../src/routing/redux/types.ts","../src/routing/redux/actions.ts"],"sourcesContent":["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_NOT_FOUND = `${ROUTING_PREFIX}_SET_NOT_FOUND`;\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 { action } from '~/redux/util';\nimport {\n SET_ENTRY,\n SET_NAVIGATION_NOT_FOUND,\n SET_NAVIGATION_PATH,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SURROGATE_KEYS,\n} from './types';\n\nexport const setNotFound = notFound =>\n action(SET_NAVIGATION_NOT_FOUND, { notFound });\nexport const setNavigationPath = (\n path,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes\n) =>\n action(SET_NAVIGATION_PATH, {\n path,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes,\n });\nexport const setCurrentProject = (project, allowedGroups, hostname) =>\n action(SET_TARGET_PROJECT, { project, allowedGroups, hostname });\nexport const setRoute = (path, state) => action(SET_ROUTE, { path, state });\nexport const setRouteEntry = entry => action(SET_ENTRY, { entry });\nexport const setSurrogateKeys = keys => action(SET_SURROGATE_KEYS, { keys });\n"],"names":["ROUTING_PREFIX","GET_ENTRY","SET_ENTRY","SET_NODE","SET_ANCESTORS","SET_SIBLINGS","SET_ENTRY_ID","SET_SURROGATE_KEYS","SET_NAVIGATION_NOT_FOUND","SET_NAVIGATION_PATH","SET_TARGET_PROJECT","SET_ROUTE","UPDATE_LOADING_STATE","setNotFound","notFound","action","setNavigationPath","path","location","staticRoute","withEvents","statePath","routes","setCurrentProject","project","allowedGroups","hostname","setRoute","state","setRouteEntry","entry","setSurrogateKeys","keys"],"mappings":";;;;AAAA,MAAMA,cAAc,GAAG,WAAvB;AACO,MAAMC,SAAS,GAAI,GAAED,cAAe,YAApC;MACME,SAAS,GAAI,GAAEF,cAAe;AACpC,MAAMG,QAAQ,GAAI,GAAEH,cAAe,WAAnC;MACMI,aAAa,GAAI,GAAEJ,cAAe;MAClCK,YAAY,GAAI,GAAEL,cAAe;AACvC,MAAMM,YAAY,GAAI,GAAEN,cAAe,eAAvC;MACMO,kBAAkB,GAAI,GAAEP,cAAe;AAE7C,MAAMQ,wBAAwB,GAAI,GAAER,cAAe,gBAAnD;MACMS,mBAAmB,GAAI,GAAET,cAAe;MAExCU,kBAAkB,GAAI,GAAEV,cAAe;MAEvCW,SAAS,GAAI,GAAEX,cAAe;MAE9BY,oBAAoB,GAAI,GAAEZ,cAAe;;;;;;;;;;;;;;;;;;ACN/C,MAAMa,WAAW,GAAGC,QAAQ,IACjCC,gBAAM,CAACP,wBAAD,EAA2B;AAAEM,EAAAA;AAAF,CAA3B,CADD;MAEME,iBAAiB,GAAG,CAC/BC,IAD+B,EAE/BC,QAF+B,EAG/BC,WAH+B,EAI/BC,UAJ+B,EAK/BC,SAL+B,EAM/BC,MAN+B,KAQ/BP,gBAAM,CAACN,mBAAD,EAAsB;AAC1BQ,EAAAA,IAD0B;AAE1BC,EAAAA,QAF0B;AAG1BC,EAAAA,WAH0B;AAI1BC,EAAAA,UAJ0B;AAK1BC,EAAAA,SAL0B;AAM1BC,EAAAA;AAN0B,CAAtB;MAQKC,iBAAiB,GAAG,CAACC,OAAD,EAAUC,aAAV,EAAyBC,QAAzB,KAC/BX,gBAAM,CAACL,kBAAD,EAAqB;AAAEc,EAAAA,OAAF;AAAWC,EAAAA,aAAX;AAA0BC,EAAAA;AAA1B,CAArB;MACKC,QAAQ,GAAG,CAACV,IAAD,EAAOW,KAAP,KAAiBb,gBAAM,CAACJ,SAAD,EAAY;AAAEM,EAAAA,IAAF;AAAQW,EAAAA;AAAR,CAAZ;AACxC,MAAMC,aAAa,GAAGC,KAAK,IAAIf,gBAAM,CAACb,SAAD,EAAY;AAAE4B,EAAAA;AAAF,CAAZ,CAArC;MACMC,gBAAgB,GAAGC,IAAI,IAAIjB,gBAAM,CAACR,kBAAD,EAAqB;AAAEyB,EAAAA;AAAF,CAArB;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/cjs/client.js
CHANGED
|
@@ -4,38 +4,59 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('isomorphic-fetch');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var reactDom = require('react-dom');
|
|
8
|
+
var reactHotLoader = require('react-hot-loader');
|
|
8
9
|
var reactRedux = require('react-redux');
|
|
9
|
-
require('react-router-
|
|
10
|
+
var reactRouterDom = require('react-router-dom');
|
|
11
|
+
var component = require('@loadable/component');
|
|
12
|
+
var queryString = require('query-string');
|
|
13
|
+
var version = require('./version-6f8f4530.js');
|
|
14
|
+
var App = require('./App-7ecf6d63.js');
|
|
15
|
+
var actions = require('./actions-43f4daa4.js');
|
|
16
|
+
require('./selectors-2c1b1183.js');
|
|
10
17
|
require('jsonpath-mapper');
|
|
18
|
+
require('@redux-saga/core/effects');
|
|
11
19
|
require('redux');
|
|
12
20
|
require('redux-thunk');
|
|
13
21
|
require('redux-saga');
|
|
14
22
|
require('redux-injectors');
|
|
15
23
|
require('immer');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
require('./reducers-fde41d6b.js');
|
|
24
|
+
require('deepmerge');
|
|
25
|
+
require('./reducers-60dafd94.js');
|
|
19
26
|
require('history');
|
|
20
|
-
var App = require('./App-581b6653.js');
|
|
21
|
-
require('@redux-saga/core/effects');
|
|
22
27
|
require('contensis-delivery-api');
|
|
23
|
-
require('./
|
|
24
|
-
require('./version-0c190929.js');
|
|
25
|
-
var queryString = require('query-string');
|
|
28
|
+
require('./version-dcfdafd9.js');
|
|
26
29
|
require('loglevel');
|
|
27
|
-
require('./
|
|
28
|
-
require('./
|
|
30
|
+
require('./login-5e3972d3.js');
|
|
31
|
+
require('./ToJs-5da8a85e.js');
|
|
29
32
|
require('await-to-js');
|
|
30
33
|
require('js-cookie');
|
|
31
|
-
|
|
32
|
-
require('
|
|
33
|
-
|
|
34
|
-
var component = require('@loadable/component');
|
|
34
|
+
require('./RouteLoader-fb056e9e.js');
|
|
35
|
+
require('react-router-config');
|
|
36
|
+
require('reselect');
|
|
35
37
|
|
|
36
38
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
37
39
|
|
|
40
|
+
function _interopNamespace(e) {
|
|
41
|
+
if (e && e.__esModule) return e;
|
|
42
|
+
var n = Object.create(null);
|
|
43
|
+
if (e) {
|
|
44
|
+
Object.keys(e).forEach(function (k) {
|
|
45
|
+
if (k !== 'default') {
|
|
46
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
47
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return e[k]; }
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
n["default"] = e;
|
|
55
|
+
return Object.freeze(n);
|
|
56
|
+
}
|
|
57
|
+
|
|
38
58
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
59
|
+
var queryString__namespace = /*#__PURE__*/_interopNamespace(queryString);
|
|
39
60
|
|
|
40
61
|
class ClientApp {
|
|
41
62
|
constructor(ReactApp, config) {
|
|
@@ -49,11 +70,11 @@ class ClientApp {
|
|
|
49
70
|
} = config;
|
|
50
71
|
|
|
51
72
|
const GetClientJSX = store => {
|
|
52
|
-
const ClientJsx = /*#__PURE__*/React__default[
|
|
73
|
+
const ClientJsx = /*#__PURE__*/React__default["default"].createElement(reactHotLoader.AppContainer, null, /*#__PURE__*/React__default["default"].createElement(reactRedux.Provider, {
|
|
53
74
|
store: store
|
|
54
|
-
}, /*#__PURE__*/React__default[
|
|
75
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.Router, {
|
|
55
76
|
history: App.browserHistory
|
|
56
|
-
}, /*#__PURE__*/React__default[
|
|
77
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactApp, {
|
|
57
78
|
routes: routes,
|
|
58
79
|
withEvents: withEvents
|
|
59
80
|
}))));
|
|
@@ -83,7 +104,7 @@ class ClientApp {
|
|
|
83
104
|
}
|
|
84
105
|
};
|
|
85
106
|
|
|
86
|
-
const qs =
|
|
107
|
+
const qs = queryString__namespace.parse(window.location.search);
|
|
87
108
|
const versionStatusFromHostname = App.deliveryApi.getClientSideVersionStatus();
|
|
88
109
|
|
|
89
110
|
if (window.isDynamic || window.REDUX_DATA || process.env.NODE_ENV !== 'production') {
|
|
@@ -111,7 +132,7 @@ class ClientApp {
|
|
|
111
132
|
version.createStore(withReducers, ssRedux, App.browserHistory, stateType).then(store => {
|
|
112
133
|
// store.dispatch(setVersionStatus(versionStatusFromHostname));
|
|
113
134
|
store.runSaga(App.rootSaga(withSagas));
|
|
114
|
-
store.dispatch(actions.setCurrentProject(App.pickProject(window.location.hostname,
|
|
135
|
+
store.dispatch(actions.setCurrentProject(App.pickProject(window.location.hostname, queryString__namespace.parse(window.location.search)), [], window.location.hostname)); // if (typeof window != 'undefined') {
|
|
115
136
|
// store.dispatch(checkUserLoggedIn());
|
|
116
137
|
// }
|
|
117
138
|
|
|
@@ -125,5 +146,5 @@ class ClientApp {
|
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
exports.ReactApp = App.AppRoot;
|
|
128
|
-
exports
|
|
149
|
+
exports["default"] = ClientApp;
|
|
129
150
|
//# sourceMappingURL=client.js.map
|
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 * as queryString from 'query-string';\n\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 <AppContainer>\n <ReduxProvider store={store}>\n <Router history={history}>\n <ReactApp routes={routes} withEvents={withEvents} />\n </Router>\n </ReduxProvider>\n </AppContainer>\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 = queryString.parse(window.location.search);\n const versionStatusFromHostname = 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 store.dispatch(\n setVersionStatus(qs.versionStatus || versionStatusFromHostname)\n );\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 /* eslint-disable no-console */\n // console.log('Got Data Back');\n // console.log(data);\n /* eslint-enable no-console */\n const ssRedux = JSON.parse(data);\n createStore(withReducers, ssRedux, history, stateType).then(store => {\n // store.dispatch(setVersionStatus(versionStatusFromHostname));\n\n store.runSaga(rootSaga(withSagas));\n store.dispatch(\n setCurrentProject(\n pickProject(\n window.location.hostname,\n queryString.parse(window.location.search)\n ),\n [],\n window.location.hostname\n )\n );\n // if (typeof window != 'undefined') {\n // store.dispatch(checkUserLoggedIn());\n // }\n HMRRenderer(GetClientJSX(store));\n\n hmr(store);\n });\n });\n }\n }\n}\n\nexport default ClientApp;\n"],"names":["ClientApp","constructor","ReactApp","config","documentRoot","document","getElementById","stateType","routes","withReducers","withSagas","withEvents","GetClientJSX","store","ClientJsx","React","AppContainer","ReduxProvider","Router","history","isProduction","process","env","NODE_ENV","HMRRenderer","Component","loadableReady","hydrate","namespace","render","hmr","module","hot","accept","qs","queryString","window","location","search","versionStatusFromHostname","deliveryApi","getClientSideVersionStatus","isDynamic","REDUX_DATA","createStore","then","dispatch","setVersionStatus","versionStatus","console","log","runSaga","rootSaga","setCurrentProject","pickProject","hostname","fetch","pathname","response","json","data","ssRedux","JSON"
|
|
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 * as queryString from 'query-string';\n\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 <AppContainer>\n <ReduxProvider store={store}>\n <Router history={history}>\n <ReactApp routes={routes} withEvents={withEvents} />\n </Router>\n </ReduxProvider>\n </AppContainer>\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 = queryString.parse(window.location.search);\n const versionStatusFromHostname = 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 store.dispatch(\n setVersionStatus(qs.versionStatus || versionStatusFromHostname)\n );\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 /* eslint-disable no-console */\n // console.log('Got Data Back');\n // console.log(data);\n /* eslint-enable no-console */\n const ssRedux = JSON.parse(data);\n createStore(withReducers, ssRedux, history, stateType).then(store => {\n // store.dispatch(setVersionStatus(versionStatusFromHostname));\n\n store.runSaga(rootSaga(withSagas));\n store.dispatch(\n setCurrentProject(\n pickProject(\n window.location.hostname,\n queryString.parse(window.location.search)\n ),\n [],\n window.location.hostname\n )\n );\n // if (typeof window != 'undefined') {\n // store.dispatch(checkUserLoggedIn());\n // }\n HMRRenderer(GetClientJSX(store));\n\n hmr(store);\n });\n });\n }\n }\n}\n\nexport default ClientApp;\n"],"names":["ClientApp","constructor","ReactApp","config","documentRoot","document","getElementById","stateType","routes","withReducers","withSagas","withEvents","GetClientJSX","store","ClientJsx","React","AppContainer","ReduxProvider","Router","history","isProduction","process","env","NODE_ENV","HMRRenderer","Component","loadableReady","hydrate","namespace","render","hmr","module","hot","accept","qs","queryString","parse","window","location","search","versionStatusFromHostname","deliveryApi","getClientSideVersionStatus","isDynamic","REDUX_DATA","createStore","then","dispatch","setVersionStatus","versionStatus","console","log","runSaga","rootSaga","setCurrentProject","pickProject","hostname","fetch","pathname","response","json","data","ssRedux","JSON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,SAAN,CAAgB;AACdC,EAAAA,WAAW,CAACC,QAAD,EAA+CC,MAA/C,EAAkE;AAC3E,UAAMC,YAAY,GAAGC,QAAQ,CAACC,cAAT,CAAwB,MAAxB,CAArB;AAEA,UAAM;AACJC,MAAAA,SAAS,GAAG,WADR;AAEJC,MAAAA,MAFI;AAGJC,MAAAA,YAHI;AAIJC,MAAAA,SAJI;AAKJC,MAAAA;AALI,QAMFR,MANJ;;AAQA,UAAMS,YAAY,GAAGC,KAAK,IAAI;AAC5B,YAAMC,SAAS,gBACbC,wCAACC,2BAAD,qBACED,wCAACE,mBAAD;AAAe,QAAA,KAAK,EAAEJ;AAAtB,sBACEE,wCAACG,qBAAD;AAAQ,QAAA,OAAO,EAAEC;AAAjB,sBACEJ,wCAAC,QAAD;AAAU,QAAA,MAAM,EAAEP,MAAlB;AAA0B,QAAA,UAAU,EAAEG;AAAtC,QADF,CADF,CADF,CADF;AASA,aAAOG,SAAP;AACD,KAXD;;AAaA,UAAMM,YAAY,GAAG,EAAEC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA3B,CAArB;AAEA;AACJ;AACA;;AACI,UAAMC,WAAW,GAAGC,SAAS,IAAI;AAC/B,UAAIL,YAAJ,EACEM,uBAAa,CACX,MAAM;AACJC,QAAAA,gBAAO,CAACF,SAAD,EAAYrB,YAAZ,CAAP;AACD,OAHU,EAIX;AAAEwB,QAAAA,SAAS,EAAE;AAAb,OAJW,CAAb,CADF,KAOKC,eAAM,CAACJ,SAAD,EAAYrB,YAAZ,CAAN;AACN,KATD;;AAWA,UAAM0B,GAAG,GAAGjB,KAAK,IAAI;AACnB;AACA,UAAIkB,MAAM,CAACC,GAAX,EAAgB;AACdD,QAAAA,MAAM,CAACC,GAAP,CAAWC,MAAX,CAAkB/B,QAAlB,EAAiD,MAAM;AACrD;AACAsB,UAAAA,WAAW,CAACZ,YAAY,CAACC,KAAD,CAAb,CAAX;AACD,SAHD;AAID;AACF,KARD;;AAUA,UAAMqB,EAAE,GAAGC,sBAAW,CAACC,KAAZ,CAAkBC,MAAM,CAACC,QAAP,CAAgBC,MAAlC,CAAX;AACA,UAAMC,yBAAyB,GAAGC,eAAW,CAACC,0BAAZ,EAAlC;;AAEA,QACEL,MAAM,CAACM,SAAP,IACAN,MAAM,CAACO,UADP,IAEAvB,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAH3B,EAIE;AACAsB,MAAAA,mBAAW,CAACpC,YAAD,EAAe4B,MAAM,CAACO,UAAtB,EAAkCzB,kBAAlC,EAA2CZ,SAA3C,CAAX,CAAiEuC,IAAjE,CACEjC,KAAK,IAAI;AACPA,QAAAA,KAAK,CAACkC,QAAN,CACEC,wBAAgB,CAACd,EAAE,CAACe,aAAH,IAAoBT,yBAArB,CADlB;AAIA;;AACAU,QAAAA,OAAO,CAACC,GAAR,CAAY,6BAAZ;AACA;;AACAtC,QAAAA,KAAK,CAACuC,OAAN,CAAcC,YAAQ,CAAC3C,SAAD,CAAtB;AACAG,QAAAA,KAAK,CAACkC,QAAN,CACEO,yBAAiB,CACfC,eAAW,CAAClB,MAAM,CAACC,QAAP,CAAgBkB,QAAjB,EAA2BtB,EAA3B,CADI,EAEf,EAFe,EAGfG,MAAM,CAACC,QAAP,CAAgBkB,QAHD,CADnB;AAQA,eAAOnB,MAAM,CAACO,UAAd;AACApB,QAAAA,WAAW,CAACZ,YAAY,CAACC,KAAD,CAAb,CAAX;AAEAiB,QAAAA,GAAG,CAACjB,KAAD,CAAH;AACD,OAtBH;AAwBD,KA7BD,MA6BO;AACL4C,MAAAA,KAAK,CAAE,GAAEpB,MAAM,CAACC,QAAP,CAAgBoB,QAAS,aAA7B,CAAL,CACGZ,IADH,CACQa,QAAQ,IAAIA,QAAQ,CAACC,IAAT,EADpB,EAEGd,IAFH,CAEQe,IAAI,IAAI;AACZ;AACA;AACA;;AACA;AACA,cAAMC,OAAO,GAAGC,IAAI,CAAC3B,KAAL,CAAWyB,IAAX,CAAhB;AACAhB,QAAAA,mBAAW,CAACpC,YAAD,EAAeqD,OAAf,EAAwB3C,kBAAxB,EAAiCZ,SAAjC,CAAX,CAAuDuC,IAAvD,CAA4DjC,KAAK,IAAI;AACnE;AAEAA,UAAAA,KAAK,CAACuC,OAAN,CAAcC,YAAQ,CAAC3C,SAAD,CAAtB;AACAG,UAAAA,KAAK,CAACkC,QAAN,CACEO,yBAAiB,CACfC,eAAW,CACTlB,MAAM,CAACC,QAAP,CAAgBkB,QADP,EAETrB,sBAAW,CAACC,KAAZ,CAAkBC,MAAM,CAACC,QAAP,CAAgBC,MAAlC,CAFS,CADI,EAKf,EALe,EAMfF,MAAM,CAACC,QAAP,CAAgBkB,QAND,CADnB,EAJmE;AAenE;AACA;;AACAhC,UAAAA,WAAW,CAACZ,YAAY,CAACC,KAAD,CAAb,CAAX;AAEAiB,UAAAA,GAAG,CAACjB,KAAD,CAAH;AACD,SApBD;AAqBD,OA7BH;AA8BD;AACF;;AAnHa;;;;;"}
|
|
@@ -19,28 +19,30 @@ var serialize = require('serialize-javascript');
|
|
|
19
19
|
var minifyCssString = require('minify-css-string');
|
|
20
20
|
var mapJson = require('jsonpath-mapper');
|
|
21
21
|
var server = require('@loadable/server');
|
|
22
|
+
var version = require('./version-6f8f4530.js');
|
|
23
|
+
var App = require('./App-7ecf6d63.js');
|
|
24
|
+
var actions = require('./actions-43f4daa4.js');
|
|
25
|
+
var selectors = require('./selectors-2c1b1183.js');
|
|
26
|
+
require('@redux-saga/core/effects');
|
|
22
27
|
require('redux');
|
|
23
28
|
require('redux-thunk');
|
|
24
29
|
require('redux-saga');
|
|
25
30
|
require('redux-injectors');
|
|
26
31
|
require('immer');
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
require('./reducers-fde41d6b.js');
|
|
32
|
+
require('deepmerge');
|
|
33
|
+
require('./reducers-60dafd94.js');
|
|
30
34
|
require('history');
|
|
31
|
-
var App = require('./App-581b6653.js');
|
|
32
|
-
require('@redux-saga/core/effects');
|
|
33
35
|
require('contensis-delivery-api');
|
|
34
|
-
|
|
35
|
-
require('./version-0c190929.js');
|
|
36
|
-
require('query-string');
|
|
36
|
+
require('./version-dcfdafd9.js');
|
|
37
37
|
require('loglevel');
|
|
38
|
-
require('./
|
|
39
|
-
require('./
|
|
38
|
+
require('./login-5e3972d3.js');
|
|
39
|
+
require('./ToJs-5da8a85e.js');
|
|
40
40
|
require('await-to-js');
|
|
41
41
|
require('js-cookie');
|
|
42
42
|
require('react-hot-loader');
|
|
43
|
-
require('
|
|
43
|
+
require('query-string');
|
|
44
|
+
require('./RouteLoader-fb056e9e.js');
|
|
45
|
+
require('reselect');
|
|
44
46
|
|
|
45
47
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
46
48
|
|
|
@@ -53,7 +55,7 @@ var serialize__default = /*#__PURE__*/_interopDefaultLegacy(serialize);
|
|
|
53
55
|
var minifyCssString__default = /*#__PURE__*/_interopDefaultLegacy(minifyCssString);
|
|
54
56
|
var mapJson__default = /*#__PURE__*/_interopDefaultLegacy(mapJson);
|
|
55
57
|
|
|
56
|
-
const servers = SERVERS;
|
|
58
|
+
const servers$1 = SERVERS;
|
|
57
59
|
/* global SERVERS */
|
|
58
60
|
|
|
59
61
|
const projects = PROJECTS;
|
|
@@ -63,7 +65,7 @@ const DisplayStartupConfiguration = config => {
|
|
|
63
65
|
/* eslint-disable no-console */
|
|
64
66
|
console.log();
|
|
65
67
|
console.log(`Configured servers:
|
|
66
|
-
`, JSON.stringify(servers, null, 2));
|
|
68
|
+
`, JSON.stringify(servers$1, null, 2));
|
|
67
69
|
console.log();
|
|
68
70
|
console.log(`Configured projects:
|
|
69
71
|
`, JSON.stringify(projects, null, 2));
|
|
@@ -73,15 +75,15 @@ const DisplayStartupConfiguration = config => {
|
|
|
73
75
|
/* eslint-enable no-console */
|
|
74
76
|
};
|
|
75
77
|
|
|
76
|
-
const servers
|
|
78
|
+
const servers = SERVERS;
|
|
77
79
|
/* global SERVERS */
|
|
78
80
|
|
|
79
|
-
const apiProxy = httpProxy__default[
|
|
81
|
+
const apiProxy = httpProxy__default["default"].createProxyServer();
|
|
80
82
|
|
|
81
83
|
const reverseProxies = (app, reverseProxyPaths = []) => {
|
|
82
84
|
deliveryApiProxy(apiProxy, app);
|
|
83
85
|
app.all(reverseProxyPaths, (req, res) => {
|
|
84
|
-
const target = req.hostname.indexOf('preview-') || req.hostname.indexOf('preview.') || req.hostname === 'localhost' ? servers
|
|
86
|
+
const target = req.hostname.indexOf('preview-') || req.hostname.indexOf('preview.') || req.hostname === 'localhost' ? servers.previewIis || servers.iis : servers.iis;
|
|
85
87
|
apiProxy.web(req, res, {
|
|
86
88
|
target,
|
|
87
89
|
changeOrigin: true
|
|
@@ -98,8 +100,8 @@ const deliveryApiProxy = (apiProxy, app) => {
|
|
|
98
100
|
// This is just here to stop cors requests on localhost. In Production this is mapped using varnish.
|
|
99
101
|
app.all(['/api/delivery/*', '/api/image/*'], (req, res) => {
|
|
100
102
|
/* eslint-disable no-console */
|
|
101
|
-
const target = servers
|
|
102
|
-
console.log(`Proxying api request to ${servers
|
|
103
|
+
const target = servers.cms;
|
|
104
|
+
console.log(`Proxying api request to ${servers.alias}`);
|
|
103
105
|
apiProxy.web(req, res, {
|
|
104
106
|
target,
|
|
105
107
|
changeOrigin: true
|
|
@@ -132,15 +134,15 @@ const bundleManipulationMiddleware = ({
|
|
|
132
134
|
maxage,
|
|
133
135
|
staticRoutePath
|
|
134
136
|
}) => (req, res, next) => {
|
|
135
|
-
const filename = path__default[
|
|
137
|
+
const filename = path__default["default"].basename(req.path);
|
|
136
138
|
const modernBundle = filename.endsWith('.mjs');
|
|
137
139
|
const legacyBundle = filename.endsWith('.js');
|
|
138
140
|
|
|
139
141
|
if ((legacyBundle || modernBundle) && filename.startsWith('runtime.')) {
|
|
140
|
-
const jsRuntimeLocation = path__default[
|
|
142
|
+
const jsRuntimeLocation = path__default["default"].resolve(appRootPath, `dist/static/${modernBundle ? 'modern/js' : 'legacy/js'}/${filename}`);
|
|
141
143
|
|
|
142
144
|
try {
|
|
143
|
-
const jsRuntimeBundle = fs__default[
|
|
145
|
+
const jsRuntimeBundle = fs__default["default"].readFileSync(jsRuntimeLocation, 'utf8');
|
|
144
146
|
const modifiedBundle = replaceStaticPath(jsRuntimeBundle, staticRoutePath);
|
|
145
147
|
if (maxage) res.set('Cache-Control', `public, max-age=${maxage}`);
|
|
146
148
|
res.type('.js').send(modifiedBundle);
|
|
@@ -170,7 +172,7 @@ const resolveStartupMiddleware = ({
|
|
|
170
172
|
}) => (req, res, next) => {
|
|
171
173
|
if (startupScriptFilename !== 'startup.js' && req.path === `/${startupScriptFilename}`) {
|
|
172
174
|
const startupFilePath = `dist/${staticFolderPath}/startup.js`;
|
|
173
|
-
const startupFileLocation = path__default[
|
|
175
|
+
const startupFileLocation = path__default["default"].resolve(appRootPath, startupFilePath);
|
|
174
176
|
if (maxage) res.set('Cache-Control', `public, max-age=${maxage}`);
|
|
175
177
|
|
|
176
178
|
try {
|
|
@@ -206,7 +208,7 @@ const staticAssets = (app, {
|
|
|
206
208
|
startupScriptFilename: scripts.startup || startupScriptFilename,
|
|
207
209
|
staticFolderPath
|
|
208
210
|
}), // eslint-disable-next-line import/no-named-as-default-member
|
|
209
|
-
express__default[
|
|
211
|
+
express__default["default"].static(`dist/${staticFolderPath}`, {
|
|
210
212
|
// these maxage values are different in config but the same in runtime,
|
|
211
213
|
// this one is somehow converted and should end up being the same as CacheDuration.static
|
|
212
214
|
maxAge: CacheDuration.expressStatic
|
|
@@ -230,7 +232,7 @@ const handleResponse = (request, response, content, send = 'send') => {
|
|
|
230
232
|
response[send](content);
|
|
231
233
|
};
|
|
232
234
|
|
|
233
|
-
const readFileSync = path => fs__default[
|
|
235
|
+
const readFileSync = path => fs__default["default"].readFileSync(path, 'utf8');
|
|
234
236
|
|
|
235
237
|
const loadableBundleData = ({
|
|
236
238
|
stats,
|
|
@@ -263,12 +265,12 @@ const loadableChunkExtractors = () => {
|
|
|
263
265
|
const modern = new server.ChunkExtractor({
|
|
264
266
|
entrypoints: ['app'],
|
|
265
267
|
namespace: 'modern',
|
|
266
|
-
statsFile: path__default[
|
|
268
|
+
statsFile: path__default["default"].resolve('dist/modern/loadable-stats.json')
|
|
267
269
|
});
|
|
268
270
|
const legacy = new server.ChunkExtractor({
|
|
269
271
|
entrypoints: ['app'],
|
|
270
272
|
namespace: 'legacy',
|
|
271
|
-
statsFile: path__default[
|
|
273
|
+
statsFile: path__default["default"].resolve('dist/legacy/loadable-stats.json')
|
|
272
274
|
});
|
|
273
275
|
const commonLoadableExtractor = {
|
|
274
276
|
addChunk(chunk) {
|
|
@@ -317,7 +319,7 @@ const addStandardHeaders = (state, response, packagejson, groups) => {
|
|
|
317
319
|
if (state) {
|
|
318
320
|
try {
|
|
319
321
|
console.info('About to add headers');
|
|
320
|
-
const routingSurrogateKeys = selectors.
|
|
322
|
+
const routingSurrogateKeys = selectors.selectSurrogateKeys(state);
|
|
321
323
|
const surrogateKeyHeader = ` ${packagejson.name}-app ${routingSurrogateKeys}`;
|
|
322
324
|
response.header('surrogate-key', surrogateKeyHeader);
|
|
323
325
|
addVarnishAuthenticationHeaders(state, response, groups);
|
|
@@ -371,7 +373,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
371
373
|
const attributes = stringifyAttributes(scripts.attributes);
|
|
372
374
|
scripts.startup = scripts.startup || startupScriptFilename;
|
|
373
375
|
const responseHandler = typeof handleResponses === 'function' ? handleResponses : handleResponse;
|
|
374
|
-
const versionInfo = JSON.parse(fs__default[
|
|
376
|
+
const versionInfo = JSON.parse(fs__default["default"].readFileSync(`dist/${staticFolderPath}/version.json`, 'utf8'));
|
|
375
377
|
app.get('/*', async (request, response) => {
|
|
376
378
|
const {
|
|
377
379
|
url
|
|
@@ -389,7 +391,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
389
391
|
const normaliseQs = q => q && q.toLowerCase() === 'true' ? true : false; // Determine functional params from QueryString and set access methods
|
|
390
392
|
|
|
391
393
|
|
|
392
|
-
const accessMethod = mapJson__default[
|
|
394
|
+
const accessMethod = mapJson__default["default"](request.query, {
|
|
393
395
|
DYNAMIC: ({
|
|
394
396
|
dynamic
|
|
395
397
|
}) => normaliseQs(dynamic) || onlyDynamic,
|
|
@@ -419,14 +421,14 @@ const webApp = (app, ReactApp, config) => {
|
|
|
419
421
|
const groups = allowedGroups && allowedGroups[project];
|
|
420
422
|
store.dispatch(actions.setCurrentProject(project, groups, request.hostname));
|
|
421
423
|
const loadableExtractor = loadableChunkExtractors();
|
|
422
|
-
const jsx = /*#__PURE__*/React__default[
|
|
424
|
+
const jsx = /*#__PURE__*/React__default["default"].createElement(server.ChunkExtractorManager, {
|
|
423
425
|
extractor: loadableExtractor === null || loadableExtractor === void 0 ? void 0 : loadableExtractor.commonLoadableExtractor
|
|
424
|
-
}, /*#__PURE__*/React__default[
|
|
426
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactRedux.Provider, {
|
|
425
427
|
store: store
|
|
426
|
-
}, /*#__PURE__*/React__default[
|
|
428
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.StaticRouter, {
|
|
427
429
|
context: context,
|
|
428
430
|
location: url
|
|
429
|
-
}, /*#__PURE__*/React__default[
|
|
431
|
+
}, /*#__PURE__*/React__default["default"].createElement(ReactApp, {
|
|
430
432
|
routes: routes,
|
|
431
433
|
withEvents: withEvents
|
|
432
434
|
}))));
|
|
@@ -459,7 +461,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
459
461
|
reactHelmet.Helmet.rewind();
|
|
460
462
|
const htmlAttributes = helmet.htmlAttributes.toString();
|
|
461
463
|
let title = helmet.title.toString();
|
|
462
|
-
const metadata = helmet.meta.toString();
|
|
464
|
+
const metadata = helmet.meta.toString().concat(helmet.link.toString());
|
|
463
465
|
|
|
464
466
|
if (context.url) {
|
|
465
467
|
return response.redirect(302, context.url);
|
|
@@ -470,14 +472,11 @@ const webApp = (app, ReactApp, config) => {
|
|
|
470
472
|
// code-split bundles for any page components as well as core app bundles
|
|
471
473
|
|
|
472
474
|
const bundleTags = getBundleTags(loadableExtractor, scripts);
|
|
473
|
-
let serialisedReduxData =
|
|
475
|
+
let serialisedReduxData = serialize__default["default"](reduxState);
|
|
474
476
|
|
|
475
477
|
if (context.statusCode !== 404) {
|
|
476
478
|
// For a request that returns a redux state object as a response
|
|
477
479
|
if (accessMethod.REDUX) {
|
|
478
|
-
serialisedReduxData = serialize__default['default'](reduxState, {
|
|
479
|
-
ignoreFunction: true
|
|
480
|
-
});
|
|
481
480
|
addStandardHeaders(reduxState, response, packagejson, {
|
|
482
481
|
allowedGroups,
|
|
483
482
|
globalGroups
|
|
@@ -487,9 +486,6 @@ const webApp = (app, ReactApp, config) => {
|
|
|
487
486
|
}
|
|
488
487
|
|
|
489
488
|
if (!disableSsrRedux) {
|
|
490
|
-
serialisedReduxData = serialize__default['default'](reduxState, {
|
|
491
|
-
ignoreFunction: true
|
|
492
|
-
});
|
|
493
489
|
serialisedReduxData = `<script ${attributes}>window.REDUX_DATA = ${serialisedReduxData}</script>`;
|
|
494
490
|
}
|
|
495
491
|
}
|
|
@@ -503,17 +499,17 @@ const webApp = (app, ReactApp, config) => {
|
|
|
503
499
|
if (context.statusCode === 404) title = '<title>404 page not found</title>'; // Static page served as a fragment
|
|
504
500
|
|
|
505
501
|
if (accessMethod.FRAGMENT && accessMethod.STATIC) {
|
|
506
|
-
responseHTML = minifyCssString__default[
|
|
502
|
+
responseHTML = minifyCssString__default["default"](styleTags) + html;
|
|
507
503
|
} // Page fragment served with client scripts and redux data that hydrate the app client side
|
|
508
504
|
|
|
509
505
|
|
|
510
506
|
if (accessMethod.FRAGMENT && !accessMethod.STATIC) {
|
|
511
|
-
responseHTML = templateHTMLFragment.replace('{{TITLE}}', title).replace('{{SEO_CRITICAL_METADATA}}', metadata).replace('{{CRITICAL_CSS}}', minifyCssString__default[
|
|
507
|
+
responseHTML = templateHTMLFragment.replace('{{TITLE}}', title).replace('{{SEO_CRITICAL_METADATA}}', metadata).replace('{{CRITICAL_CSS}}', minifyCssString__default["default"](styleTags)).replace('{{APP}}', html).replace('{{LOADABLE_CHUNKS}}', bundleTags).replace('{{REDUX_DATA}}', serialisedReduxData);
|
|
512
508
|
} // Full HTML page served statically
|
|
513
509
|
|
|
514
510
|
|
|
515
511
|
if (!accessMethod.FRAGMENT && accessMethod.STATIC) {
|
|
516
|
-
responseHTML = templateHTMLStatic.replace('{{TITLE}}', title).replace('{{SEO_CRITICAL_METADATA}}', metadata).replace('{{CRITICAL_CSS}}', minifyCssString__default[
|
|
512
|
+
responseHTML = templateHTMLStatic.replace('{{TITLE}}', title).replace('{{SEO_CRITICAL_METADATA}}', metadata).replace('{{CRITICAL_CSS}}', minifyCssString__default["default"](styleTags)).replace('{{APP}}', html).replace('{{LOADABLE_CHUNKS}}', '');
|
|
517
513
|
} // Full HTML page served with client scripts and redux data that hydrate the app client side
|
|
518
514
|
|
|
519
515
|
|
|
@@ -553,7 +549,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
553
549
|
});
|
|
554
550
|
};
|
|
555
551
|
|
|
556
|
-
const app = express__default[
|
|
552
|
+
const app = express__default["default"]();
|
|
557
553
|
|
|
558
554
|
const start = (ReactApp, config, ServerFeatures) => {
|
|
559
555
|
global.PACKAGE_JSON = config.packagejson;
|
|
@@ -593,5 +589,5 @@ var internalServer = {
|
|
|
593
589
|
};
|
|
594
590
|
|
|
595
591
|
exports.ReactApp = App.AppRoot;
|
|
596
|
-
exports
|
|
592
|
+
exports["default"] = internalServer;
|
|
597
593
|
//# sourceMappingURL=contensis-react-base.js.map
|