@elliemae/pui-app-sdk 2.8.3 → 2.11.0
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/dist/cjs/analytics/base-data.js +22 -0
- package/dist/cjs/analytics/index.js +37 -0
- package/dist/cjs/analytics/user-session.js +31 -17
- package/dist/cjs/analytics/user-wait.js +13 -5
- package/dist/cjs/api/auth/index.js +16 -13
- package/dist/cjs/api/helpers.js +17 -3
- package/dist/cjs/api/users/index.js +4 -3
- package/dist/cjs/communication/http-client/index.js +21 -16
- package/dist/cjs/communication/http-client/response-interceptor.js +2 -3
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +6 -5
- package/dist/cjs/data/auth/actions.js +28 -22
- package/dist/cjs/data/breakpoint/index.js +3 -1
- package/dist/cjs/data/live-message/index.js +11 -8
- package/dist/cjs/data/reducers.js +2 -1
- package/dist/cjs/data/store.js +8 -4
- package/dist/cjs/data/wait-message/actions.js +9 -6
- package/dist/cjs/data/wait-message/reducer.js +17 -13
- package/dist/cjs/index.js +18 -1
- package/dist/cjs/route/index.js +9 -6
- package/dist/cjs/route/private-route/index.js +10 -9
- package/dist/cjs/sideeffect/auth/index.js +10 -6
- package/dist/cjs/utils/app-config/config.js +21 -4
- package/dist/cjs/utils/app-config/index.js +17 -13
- package/dist/cjs/utils/app-host-integration/react.js +10 -7
- package/dist/cjs/utils/auth/index.js +34 -33
- package/dist/cjs/utils/micro-frontend/guest.js +10 -7
- package/dist/cjs/utils/micro-frontend/host.js +12 -1
- package/dist/cjs/utils/micro-frontend/index.js +2 -4
- package/dist/cjs/utils/service-worker.js +2 -1
- package/dist/cjs/utils/session.js +13 -5
- package/dist/cjs/utils/storybook/theme.js +12 -9
- package/dist/cjs/utils/testing/index.js +18 -9
- package/dist/cjs/utils/testing/render-with-redux.js +14 -11
- package/dist/cjs/utils/testing/render-with-router-redux.js +20 -17
- package/dist/cjs/utils/testing/render-with-router.js +16 -13
- package/dist/cjs/utils/testing/render-with-state-addons.js +14 -7
- package/dist/cjs/utils/web-storage.js +6 -0
- package/dist/cjs/view/app-root/hosted-app.js +8 -5
- package/dist/cjs/view/app-root/index.js +23 -20
- package/dist/cjs/view/app-root/stand-alone-app.js +8 -5
- package/dist/cjs/view/app-root/style.js +6 -3
- package/dist/cjs/view/error-toast/index.stories.js +29 -22
- package/dist/cjs/view/fetch-host-app-data/index.js +2 -2
- package/dist/cjs/view/fetch-host-app-data/store.js +8 -2
- package/dist/cjs/view/fields/check-box/index.js +28 -20
- package/dist/cjs/view/fields/check-box/index.stories.js +24 -20
- package/dist/cjs/view/fields/check-box/set-value.stories.js +21 -17
- package/dist/cjs/view/fields/combo-box/index.js +28 -22
- package/dist/cjs/view/fields/connect-form.js +4 -3
- package/dist/cjs/view/fields/date-input/index.js +21 -15
- package/dist/cjs/view/fields/date-input/index.stories.js +1 -1
- package/dist/cjs/view/fields/date-picker/index.js +21 -15
- package/dist/cjs/view/fields/date-picker/index.stories.js +1 -1
- package/dist/cjs/view/fields/form-item-layout/index.js +20 -16
- package/dist/cjs/view/fields/input-mask/index.js +24 -16
- package/dist/cjs/view/fields/large-text-box/index.js +21 -15
- package/dist/cjs/view/fields/radio/index.js +26 -20
- package/dist/cjs/view/fields/radio/index.stories.js +21 -17
- package/dist/cjs/view/fields/radio/set-value.stories.js +19 -15
- package/dist/cjs/view/fields/radio-group/index.js +22 -16
- package/dist/cjs/view/fields/radio-group/index.stories.js +44 -37
- package/dist/cjs/view/fields/text-box/index.js +21 -15
- package/dist/cjs/view/fields/watch-value.js +5 -4
- package/dist/cjs/view/form/index.js +10 -9
- package/dist/cjs/view/form/index.stories.js +6 -3
- package/dist/cjs/view/form/submit-button/index.js +3 -2
- package/dist/cjs/view/form/usecases.stories.js +6 -3
- package/dist/cjs/view/guest-unload-handlers/index.js +2 -1
- package/dist/cjs/view/header/center-region/index.js +18 -8
- package/dist/cjs/view/header/index.js +11 -8
- package/dist/cjs/view/live-message/index.stories.js +2 -0
- package/dist/cjs/view/loadable/index.js +2 -1
- package/dist/cjs/view/login/index.js +6 -5
- package/dist/cjs/view/message-to-host-app/index.js +2 -1
- package/dist/cjs/view/micro-app/app-factory/index.js +39 -23
- package/dist/cjs/view/micro-app/resources/manifest.js +29 -16
- package/dist/cjs/view/micro-app/resources/script.js +29 -22
- package/dist/cjs/view/micro-app/resources/style.js +27 -20
- package/dist/cjs/view/micro-app/use-app-will-render.js +13 -10
- package/dist/cjs/view/micro-app/utils.js +6 -0
- package/dist/cjs/view/micro-iframe-app/app.js +7 -6
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +8 -7
- package/dist/cjs/view/micro-iframe-app/index.js +5 -4
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +5 -4
- package/dist/cjs/view/modals/error/index.js +9 -6
- package/dist/cjs/view/modals/navigation-prompt/index.js +7 -4
- package/dist/cjs/view/modals/session-expiry/customHooks.js +7 -3
- package/dist/cjs/view/modals/session-expiry/index.js +8 -5
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +4 -3
- package/dist/cjs/view/modals/wait-message/index.js +9 -8
- package/dist/cjs/view/modals/wait-message/index.stories.js +5 -4
- package/dist/cjs/view/render-with-delay/index.js +4 -3
- package/dist/cjs/view/useMediaBreakpoints/index.js +10 -0
- package/dist/es/analytics/base-data.js +10 -0
- package/dist/es/analytics/index.js +28 -0
- package/dist/es/analytics/user-session.js +30 -17
- package/dist/es/analytics/user-wait.js +12 -5
- package/dist/es/api/auth/index.js +16 -13
- package/dist/es/api/helpers.js +13 -3
- package/dist/es/api/users/index.js +4 -3
- package/dist/es/communication/http-client/index.js +20 -16
- package/dist/es/communication/http-client/response-interceptor.js +2 -3
- package/dist/es/communication/http-client/tests/index.test-disable.js +6 -5
- package/dist/es/data/auth/actions.js +28 -22
- package/dist/es/data/breakpoint/index.js +3 -1
- package/dist/es/data/live-message/index.js +11 -8
- package/dist/es/data/reducers.js +2 -1
- package/dist/es/data/store.js +8 -4
- package/dist/es/data/wait-message/actions.js +9 -6
- package/dist/es/data/wait-message/reducer.js +16 -12
- package/dist/es/index.js +3 -1
- package/dist/es/route/index.js +7 -6
- package/dist/es/route/private-route/index.js +10 -9
- package/dist/es/sideeffect/auth/index.js +10 -6
- package/dist/es/utils/app-config/config.js +18 -4
- package/dist/es/utils/app-config/index.js +17 -13
- package/dist/es/utils/app-host-integration/react.js +10 -7
- package/dist/es/utils/auth/index.js +34 -33
- package/dist/es/utils/micro-frontend/guest.js +9 -6
- package/dist/es/utils/micro-frontend/host.js +11 -1
- package/dist/es/utils/micro-frontend/index.js +2 -2
- package/dist/es/utils/service-worker.js +2 -1
- package/dist/es/utils/session.js +14 -5
- package/dist/es/utils/storybook/theme.js +12 -9
- package/dist/es/utils/testing/index.js +12 -9
- package/dist/es/utils/testing/render-with-redux.js +14 -11
- package/dist/es/utils/testing/render-with-router-redux.js +20 -17
- package/dist/es/utils/testing/render-with-router.js +16 -13
- package/dist/es/utils/testing/render-with-state-addons.js +11 -7
- package/dist/es/utils/web-storage.js +3 -0
- package/dist/es/view/app-root/hosted-app.js +8 -5
- package/dist/es/view/app-root/index.js +23 -20
- package/dist/es/view/app-root/stand-alone-app.js +8 -5
- package/dist/es/view/app-root/style.js +6 -3
- package/dist/es/view/error-toast/index.stories.js +29 -22
- package/dist/es/view/fetch-host-app-data/index.js +2 -2
- package/dist/es/view/fetch-host-app-data/store.js +6 -2
- package/dist/es/view/fields/check-box/index.js +26 -20
- package/dist/es/view/fields/check-box/index.stories.js +24 -20
- package/dist/es/view/fields/check-box/set-value.stories.js +21 -17
- package/dist/es/view/fields/combo-box/index.js +28 -22
- package/dist/es/view/fields/connect-form.js +4 -3
- package/dist/es/view/fields/date-input/index.js +21 -15
- package/dist/es/view/fields/date-input/index.stories.js +1 -1
- package/dist/es/view/fields/date-picker/index.js +21 -15
- package/dist/es/view/fields/date-picker/index.stories.js +1 -1
- package/dist/es/view/fields/form-item-layout/index.js +20 -16
- package/dist/es/view/fields/input-mask/index.js +22 -16
- package/dist/es/view/fields/large-text-box/index.js +21 -15
- package/dist/es/view/fields/radio/index.js +26 -20
- package/dist/es/view/fields/radio/index.stories.js +21 -17
- package/dist/es/view/fields/radio/set-value.stories.js +19 -15
- package/dist/es/view/fields/radio-group/index.js +22 -16
- package/dist/es/view/fields/radio-group/index.stories.js +44 -37
- package/dist/es/view/fields/text-box/index.js +21 -15
- package/dist/es/view/fields/watch-value.js +5 -4
- package/dist/es/view/form/index.js +10 -9
- package/dist/es/view/form/index.stories.js +6 -3
- package/dist/es/view/form/submit-button/index.js +3 -2
- package/dist/es/view/form/usecases.stories.js +6 -3
- package/dist/es/view/guest-unload-handlers/index.js +2 -1
- package/dist/es/view/header/center-region/index.js +16 -8
- package/dist/es/view/header/index.js +11 -8
- package/dist/es/view/loadable/index.js +2 -1
- package/dist/es/view/login/index.js +6 -5
- package/dist/es/view/message-to-host-app/index.js +2 -1
- package/dist/es/view/micro-app/app-factory/index.js +33 -23
- package/dist/es/view/micro-app/resources/manifest.js +25 -15
- package/dist/es/view/micro-app/resources/script.js +28 -21
- package/dist/es/view/micro-app/resources/style.js +27 -20
- package/dist/es/view/micro-app/use-app-will-render.js +12 -9
- package/dist/es/view/micro-app/utils.js +3 -0
- package/dist/es/view/micro-iframe-app/app.js +7 -6
- package/dist/es/view/micro-iframe-app/iframe/index.js +8 -7
- package/dist/es/view/micro-iframe-app/index.js +5 -4
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +5 -4
- package/dist/es/view/modals/error/index.js +7 -6
- package/dist/es/view/modals/navigation-prompt/index.js +5 -4
- package/dist/es/view/modals/session-expiry/customHooks.js +2 -1
- package/dist/es/view/modals/session-expiry/index.js +6 -5
- package/dist/es/view/modals/wait-message/html-wait-message.js +4 -3
- package/dist/es/view/modals/wait-message/index.js +9 -8
- package/dist/es/view/modals/wait-message/index.stories.js +5 -4
- package/dist/es/view/render-with-delay/index.js +4 -3
- package/dist/es/view/useMediaBreakpoints/index.js +5 -0
- package/dist/public/assets/index.ad459dcebaa616bff55e77d860405729.svg +1 -0
- package/dist/public/assets/index.dae17c8817fd9c5ab29e7c3a8925a1f4.svg +1 -0
- package/dist/public/assets/logo.0cbd33c5006f8ea6d106f8ab13f6e6dc.svg +1 -0
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js +3 -0
- package/dist/public/js/{emuiAppSdk.555dc403d2552c23928a.js.LICENSE.txt → emuiAppSdk.bdec42736fbd0fbcbe9a.js.LICENSE.txt} +0 -9
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js.map +1 -0
- package/dist/types/analytics/base-data.d.ts +8 -0
- package/dist/types/analytics/index.d.ts +5 -0
- package/dist/types/analytics/user-session.d.ts +1 -4
- package/dist/types/communication/http-client/index.d.ts +2 -2
- package/dist/types/communication/http-client/request-interceptor.d.ts +1 -1
- package/dist/types/communication/http-client/response-interceptor.d.ts +1 -1
- package/dist/types/communication/http-client/retry-axios.d.ts +5 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/utils/micro-frontend/host.d.ts +3 -2
- package/dist/types/utils/window.d.ts +3 -3
- package/dist/types/view/fields/date-input/index.d.ts +1 -2
- package/dist/types/view/fields/date-picker/index.d.ts +1 -2
- package/dist/types/view/visually-hidden/index.d.ts +1 -1
- package/package.json +17 -17
- package/dist/cjs/analytics/utils.js +0 -13
- package/dist/cjs/data/tests/store.test.js +0 -32
- package/dist/es/analytics/utils.js +0 -4
- package/dist/es/data/tests/store.test.js +0 -32
- package/dist/public/assets/index.0944904d91ed62aebf865bc6461471aa.svg +0 -4
- package/dist/public/assets/index.4c19242eb7de64399b205c842bf3185c.svg +0 -5
- package/dist/public/assets/logo.6799a57c45dd9c96b44e2bac6c4ee12c.svg +0 -2
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js +0 -3
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js.map +0 -1
- package/dist/types/analytics/utils.d.ts +0 -4
|
@@ -25,14 +25,15 @@ export const getIDPInfoFromUrl = () => {
|
|
|
25
25
|
redirectUri: currentUrl.href
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export const navigateToLoginPage =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
export const navigateToLoginPage = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
clientId,
|
|
31
|
+
redirectUri,
|
|
32
|
+
idpErrorCode,
|
|
33
|
+
scope,
|
|
34
|
+
// eslint-disable-next-line camelcase
|
|
35
|
+
responseType
|
|
36
|
+
} = _ref;
|
|
36
37
|
const idpHost = getAppConfigValue(IDP_ENDPOINT_CONFIG_KEY, '');
|
|
37
38
|
const idpUrl = new URL('/authorize', idpHost);
|
|
38
39
|
const idpOptions = {
|
|
@@ -47,27 +48,24 @@ export const navigateToLoginPage = ({
|
|
|
47
48
|
idpUrl.search = searchParams.toString();
|
|
48
49
|
window.location.replace(idpUrl.href);
|
|
49
50
|
};
|
|
50
|
-
export const endSession = async
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
export const endSession = async _ref2 => {
|
|
52
|
+
let {
|
|
53
|
+
clientId,
|
|
54
|
+
redirectUri,
|
|
55
|
+
responseType,
|
|
56
|
+
scope,
|
|
57
|
+
code = '1004'
|
|
58
|
+
} = _ref2;
|
|
59
|
+
|
|
57
60
|
try {
|
|
58
61
|
const authorization = getAuthorizationHeader();
|
|
59
|
-
const userId = sessionStorage.getItem('userId') || '';
|
|
60
|
-
const instanceId = sessionStorage.getItem('instanceId') || '';
|
|
61
62
|
sessionStorage.clear();
|
|
62
63
|
const token = authorization ? authorization.split(' ')[1] : '';
|
|
63
64
|
await revokeToken({
|
|
64
65
|
clientId,
|
|
65
66
|
token
|
|
66
67
|
});
|
|
67
|
-
logoutEvent(
|
|
68
|
-
userId,
|
|
69
|
-
instanceId
|
|
70
|
-
}); // redirect
|
|
68
|
+
logoutEvent(); // redirect
|
|
71
69
|
|
|
72
70
|
const idpHost = getAppConfigValue(IDP_ENDPOINT_CONFIG_KEY, '');
|
|
73
71
|
const logoutUrl = new URL('/authorize', idpHost);
|
|
@@ -87,13 +85,15 @@ export const endSession = async ({
|
|
|
87
85
|
});
|
|
88
86
|
}
|
|
89
87
|
};
|
|
90
|
-
export const authorize = async
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
export const authorize = async _ref3 => {
|
|
89
|
+
let {
|
|
90
|
+
idpCode,
|
|
91
|
+
redirectUri,
|
|
92
|
+
clientId,
|
|
93
|
+
scope,
|
|
94
|
+
responseType
|
|
95
|
+
} = _ref3;
|
|
96
|
+
|
|
97
97
|
try {
|
|
98
98
|
const {
|
|
99
99
|
tokenType,
|
|
@@ -151,11 +151,12 @@ export const authorize = async ({
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
-
export const login = async
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
export const login = async _ref4 => {
|
|
155
|
+
let {
|
|
156
|
+
clientId,
|
|
157
|
+
scope,
|
|
158
|
+
responseType
|
|
159
|
+
} = _ref4;
|
|
159
160
|
const {
|
|
160
161
|
idpCode,
|
|
161
162
|
idpErrorCode,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _merge from "lodash/merge";
|
|
2
3
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
4
|
import "core-js/modules/es.string.replace.js";
|
|
4
5
|
import ReactDOM from 'react-dom';
|
|
5
|
-
import _ from 'lodash';
|
|
6
6
|
import { push } from 'connected-react-router';
|
|
7
7
|
import ssfGuest from '@elliemae/em-ssf-guest';
|
|
8
8
|
import { getDefaultTheme } from '@elliemae/pui-theme';
|
|
@@ -27,6 +27,8 @@ const isCrossDomain = () => {
|
|
|
27
27
|
|
|
28
28
|
export class CMicroAppGuest {
|
|
29
29
|
constructor(params) {
|
|
30
|
+
var _window$emui;
|
|
31
|
+
|
|
30
32
|
_defineProperty(this, "logger", void 0);
|
|
31
33
|
|
|
32
34
|
_defineProperty(this, "appId", void 0);
|
|
@@ -44,7 +46,7 @@ export class CMicroAppGuest {
|
|
|
44
46
|
_defineProperty(this, "onGetRef", void 0);
|
|
45
47
|
|
|
46
48
|
this.containerId = 'app-container';
|
|
47
|
-
this.appId = getAppConfigValue('appId');
|
|
49
|
+
this.appId = ((_window$emui = window.emui) === null || _window$emui === void 0 ? void 0 : _window$emui.appId) || getAppConfigValue('appId');
|
|
48
50
|
this.props = {
|
|
49
51
|
host: null,
|
|
50
52
|
hostUrl: null,
|
|
@@ -126,7 +128,7 @@ export class CMicroAppGuest {
|
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
async init(options) {
|
|
129
|
-
this.props =
|
|
131
|
+
this.props = _merge(this.props, options);
|
|
130
132
|
|
|
131
133
|
if (!this.props.host) {
|
|
132
134
|
const host = await this.getSSFHost();
|
|
@@ -142,9 +144,10 @@ export class CMicroAppGuest {
|
|
|
142
144
|
/* eslint-enable camelcase, no-undef */
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
mount(
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
mount() {
|
|
148
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
149
|
+
containerId: 'app-container'
|
|
150
|
+
};
|
|
148
151
|
this.containerId = options === null || options === void 0 ? void 0 : options.containerId;
|
|
149
152
|
return Promise.resolve().then(() => {
|
|
150
153
|
if (this.onMount) this.onMount(options);
|
|
@@ -13,6 +13,7 @@ import { browserHistory } from "../history.js";
|
|
|
13
13
|
import { logger } from "./console-logger.js";
|
|
14
14
|
import { HOST_WINDOW_RESIZED, HOST_WINDOW_BREAKPOINT_CHANGED } from "../constants.js";
|
|
15
15
|
import { getCurrentBreakpoint, getViewportSize as getWindowViewportSize } from "../window.js";
|
|
16
|
+
import { sendBAEvent } from "../../analytics/index.js";
|
|
16
17
|
export class CMicroAppHost {
|
|
17
18
|
constructor(params) {
|
|
18
19
|
_defineProperty(this, "logger", void 0);
|
|
@@ -157,11 +158,20 @@ export class CMicroAppHost {
|
|
|
157
158
|
return subscribe(HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
setSystemVersion(
|
|
161
|
+
setSystemVersion() {
|
|
162
|
+
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'latest';
|
|
161
163
|
window.emui.version = version;
|
|
162
164
|
this.props.systemVersion = version;
|
|
163
165
|
}
|
|
164
166
|
|
|
167
|
+
sendBAEvent(event) {
|
|
168
|
+
// eslint-disable-next-line max-lines
|
|
169
|
+
sendBAEvent({
|
|
170
|
+
eventParams: event,
|
|
171
|
+
self: true
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
165
175
|
}
|
|
166
176
|
|
|
167
177
|
_defineProperty(CMicroAppHost, "instance", void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import _merge from "lodash/merge";
|
|
1
2
|
import "core-js/modules/es.string.replace.js";
|
|
2
|
-
import _ from 'lodash';
|
|
3
3
|
import { CMicroAppGuest } from "./guest.js";
|
|
4
4
|
import { CMicroAppHost } from "./host.js";
|
|
5
5
|
import { getAppConfigValue } from "../app-config/config.js";
|
|
@@ -34,7 +34,7 @@ export const getMicroFrontEndAppConfig = appInfo => {
|
|
|
34
34
|
if (microFEAppConfig.production) delete microFEAppConfig.production;
|
|
35
35
|
if (microFEAppConfig.development) delete microFEAppConfig.development;
|
|
36
36
|
|
|
37
|
-
const microFEConfig =
|
|
37
|
+
const microFEConfig = _merge(appInfo, {
|
|
38
38
|
mode: 'production',
|
|
39
39
|
hostUrl: './',
|
|
40
40
|
manifestPath: './{SYSTEM_VERSION}'
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "core-js/modules/es.string.replace.js";
|
|
2
2
|
import { logRecords } from "./log-records.js";
|
|
3
3
|
import { getLogger } from "./micro-frontend/index.js";
|
|
4
|
-
export const initServiceWorker = (
|
|
4
|
+
export const initServiceWorker = function () {
|
|
5
|
+
let swDest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
5
6
|
const logger = getLogger() || console;
|
|
6
7
|
|
|
7
8
|
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
package/dist/es/utils/session.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _throttle from "lodash/throttle";
|
|
2
2
|
import { getAppConfigValue } from "./app-config/config.js";
|
|
3
3
|
import { SESSION_TIMEOUT_INTERVAL } from "./constants.js";
|
|
4
4
|
const THROTTLING_TIME = 6000;
|
|
@@ -18,13 +18,20 @@ export const resetUserIdleTime = () => {
|
|
|
18
18
|
resetListeners.forEach(listener => listener());
|
|
19
19
|
}).catch(() => {});
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
const throttledResetUserIdleTime = _throttle(resetUserIdleTime, THROTTLING_TIME, {
|
|
22
23
|
leading: true
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
const isPastWarningTime =
|
|
26
|
+
const isPastWarningTime = function () {
|
|
27
|
+
let warnInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAppConfigValue('sessionTimeoutWarnInterval') || SESSION_TIMEOUT_INTERVAL.WARN;
|
|
28
|
+
return Date.now() - lastUserActivityTimeStamp > warnInterval;
|
|
29
|
+
};
|
|
26
30
|
|
|
27
|
-
const isPastSessionTimeoutTime =
|
|
31
|
+
const isPastSessionTimeoutTime = function () {
|
|
32
|
+
let sessionTimeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAppConfigValue('sessionTimeoutInterval') || SESSION_TIMEOUT_INTERVAL.EXPIRY;
|
|
33
|
+
return Date.now() - lastUserActivityTimeStamp > sessionTimeout;
|
|
34
|
+
};
|
|
28
35
|
|
|
29
36
|
const notifySessionExpiryWarning = () => {
|
|
30
37
|
sessionExpiryWarningNotified = true;
|
|
@@ -83,9 +90,11 @@ export const subscribeToResetSession = onResetListener => {
|
|
|
83
90
|
};
|
|
84
91
|
export const trackActivity = (element, cb) => {
|
|
85
92
|
if (!element) return () => {};
|
|
86
|
-
|
|
93
|
+
|
|
94
|
+
const thorttledCb = _throttle(cb, THROTTLING_TIME, {
|
|
87
95
|
leading: true
|
|
88
96
|
});
|
|
97
|
+
|
|
89
98
|
userInteractionEvents.forEach(r => element.addEventListener(r, thorttledCb));
|
|
90
99
|
return () => {
|
|
91
100
|
userInteractionEvents.forEach(r => element.removeEventListener(r, cb));
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { create } from '@storybook/theming/create';
|
|
2
|
-
export const createTheme =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
export const createTheme = _ref => {
|
|
3
|
+
let {
|
|
4
|
+
base = 'light',
|
|
5
|
+
brandTitle = 'Platform UI Components',
|
|
6
|
+
...rest
|
|
7
|
+
} = _ref;
|
|
8
|
+
return create({
|
|
9
|
+
base,
|
|
10
|
+
brandTitle: "".concat(brandTitle, " ").concat(process.env.STORYBOOK_VERSION || ''),
|
|
11
|
+
...rest
|
|
12
|
+
});
|
|
13
|
+
};
|
|
@@ -7,15 +7,18 @@ import { browserHistory } from "../history.js";
|
|
|
7
7
|
const defaultStore = createAppStore({}, browserHistory);
|
|
8
8
|
const defaultTheme = getDefaultTheme();
|
|
9
9
|
|
|
10
|
-
const AllTheProviders =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const AllTheProviders = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
store = defaultStore,
|
|
13
|
+
theme = defaultTheme,
|
|
14
|
+
children
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_jsx(AppRoot, {
|
|
17
|
+
store: store,
|
|
18
|
+
history: browserHistory,
|
|
19
|
+
theme: theme
|
|
20
|
+
}, void 0, children);
|
|
21
|
+
};
|
|
19
22
|
|
|
20
23
|
const customRender = (ui, options) => render(ui, {
|
|
21
24
|
wrapper: AllTheProviders,
|
|
@@ -3,14 +3,17 @@ import { render } from '@testing-library/react';
|
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
import { createAppStore } from "../../data/store.js";
|
|
5
5
|
import { browserHistory } from "../history.js";
|
|
6
|
-
export const renderWithRedux = (ui
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
export const renderWithRedux = function (ui) {
|
|
7
|
+
let {
|
|
8
|
+
initialState,
|
|
9
|
+
store = createAppStore(initialState, browserHistory)
|
|
10
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
11
|
+
return { ...render( /*#__PURE__*/_jsx(Provider, {
|
|
12
|
+
store: store
|
|
13
|
+
}, void 0, ui)),
|
|
14
|
+
// adding `store` to the returned utilities to allow us
|
|
15
|
+
// to reference it in our tests (just try to avoid using
|
|
16
|
+
// this to test implementation details).
|
|
17
|
+
store
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -5,20 +5,23 @@ import { Router } from 'react-router-dom';
|
|
|
5
5
|
import { createMemoryHistory } from 'history';
|
|
6
6
|
import { createAppStore } from "../../data/store.js";
|
|
7
7
|
import { browserHistory } from "../history.js";
|
|
8
|
-
export const renderWithRouterRedux = (ui
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
export const renderWithRouterRedux = function (ui) {
|
|
9
|
+
let {
|
|
10
|
+
route = '/',
|
|
11
|
+
history = createMemoryHistory({
|
|
12
|
+
initialEntries: [route]
|
|
13
|
+
}),
|
|
14
|
+
initialState,
|
|
15
|
+
store = createAppStore(initialState, browserHistory)
|
|
16
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
|
+
return { ...render( /*#__PURE__*/_jsx(Provider, {
|
|
18
|
+
store: store
|
|
19
|
+
}, void 0, /*#__PURE__*/_jsx(Router, {
|
|
20
|
+
history: history
|
|
21
|
+
}, void 0, ui))),
|
|
22
|
+
// adding `store` to the returned utilities to allow us
|
|
23
|
+
// to reference it in our tests (just try to avoid using
|
|
24
|
+
// this to test implementation details).
|
|
25
|
+
store
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -2,16 +2,19 @@ import _jsx from "@babel/runtime/helpers/jsx";
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { Router } from 'react-router-dom';
|
|
4
4
|
import { createMemoryHistory } from 'history';
|
|
5
|
-
export const renderWithRouter = (ui
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
export const renderWithRouter = function (ui) {
|
|
6
|
+
let {
|
|
7
|
+
route = '/',
|
|
8
|
+
history = createMemoryHistory({
|
|
9
|
+
initialEntries: [route]
|
|
10
|
+
})
|
|
11
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12
|
+
return { ...render( /*#__PURE__*/_jsx(Router, {
|
|
13
|
+
history: history
|
|
14
|
+
}, void 0, ui)),
|
|
15
|
+
// adding `history` to the returned utilities to allow us
|
|
16
|
+
// to reference it in our tests (just try to avoid using
|
|
17
|
+
// this to test implementation details).
|
|
18
|
+
history
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _jsx2 from "@babel/runtime/helpers/jsx";
|
|
2
2
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
|
+
import "core-js/modules/esnext.async-iterator.for-each.js";
|
|
4
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
5
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
|
3
6
|
|
|
4
7
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
5
8
|
import { useEffect, useState } from 'react';
|
|
@@ -7,13 +10,14 @@ import { ThemeProvider } from 'styled-components';
|
|
|
7
10
|
import { getDefaultTheme } from '@elliemae/pui-theme';
|
|
8
11
|
import { useInjectReducer, useInjectSaga } from 'redux-injectors';
|
|
9
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export const RenderWithStateAddOns =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export const RenderWithStateAddOns = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
Component,
|
|
16
|
+
reducer,
|
|
17
|
+
saga,
|
|
18
|
+
theme = getDefaultTheme(),
|
|
19
|
+
...rest
|
|
20
|
+
} = _ref;
|
|
17
21
|
const [ready, setReady] = useState(false);
|
|
18
22
|
|
|
19
23
|
if (Array.isArray(reducer)) {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import "core-js/modules/esnext.async-iterator.for-each.js";
|
|
2
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
3
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
|
1
4
|
import localforage from 'localforage';
|
|
2
5
|
const STORAGE = 'storage';
|
|
3
6
|
const GET_SESSION_STORAGE = 'getSessionStorage';
|
|
@@ -7,11 +7,14 @@ import { MediaBreakpoint } from "../media-breakpoint/index.js";
|
|
|
7
7
|
import { WindowSize } from "../window-size/index.js";
|
|
8
8
|
import { HTMLWaitMessage } from "../modals/wait-message/html-wait-message.js";
|
|
9
9
|
import GlobalStyle from "./style.js";
|
|
10
|
-
export const HostedApp =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})),
|
|
10
|
+
export const HostedApp = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
children
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/_jsx(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/_jsx(GlobalStyle, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/_jsx(MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/_jsx(WindowSize, {})), _HTMLWaitMessage || (_HTMLWaitMessage = /*#__PURE__*/_jsx(HTMLWaitMessage, {
|
|
15
|
+
close: true
|
|
16
|
+
})), children);
|
|
17
|
+
};
|
|
15
18
|
|
|
16
19
|
var _StyledDiv = /*#__PURE__*/_styled("div").withConfig({
|
|
17
20
|
componentId: "sc-njn2ro-0"
|
|
@@ -27,23 +27,26 @@ const AppToRender = props => {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export const AppRoot =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, void 0, /*#__PURE__*/_jsx2(
|
|
43
|
-
|
|
44
|
-
}, void 0, /*#__PURE__*/_jsx2(
|
|
45
|
-
|
|
46
|
-
}, void 0, /*#__PURE__*/_jsx2(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
export const AppRoot = _ref => {
|
|
31
|
+
let {
|
|
32
|
+
store,
|
|
33
|
+
history,
|
|
34
|
+
theme = getDefaultTheme(),
|
|
35
|
+
manageSession = false,
|
|
36
|
+
WaitMessage,
|
|
37
|
+
errorTemplate,
|
|
38
|
+
children
|
|
39
|
+
} = _ref;
|
|
40
|
+
return /*#__PURE__*/_jsx2(ErrorBoundary, {
|
|
41
|
+
errorTemplate: errorTemplate
|
|
42
|
+
}, void 0, /*#__PURE__*/_jsx2(Provider, {
|
|
43
|
+
store: store
|
|
44
|
+
}, void 0, /*#__PURE__*/_jsx2(Router, {
|
|
45
|
+
history: history
|
|
46
|
+
}, void 0, /*#__PURE__*/_jsx2(ThemeProvider, {
|
|
47
|
+
theme: theme
|
|
48
|
+
}, void 0, /*#__PURE__*/_jsx2(AppToRender, {
|
|
49
|
+
manageSession: manageSession,
|
|
50
|
+
WaitMessage: WaitMessage
|
|
51
|
+
}, void 0, children)))));
|
|
52
|
+
};
|
|
@@ -11,11 +11,14 @@ import { LiveMessage } from "../live-message/index.js";
|
|
|
11
11
|
import { ErrorToast } from "../error-toast/index.js";
|
|
12
12
|
import { WaitMessage as DefaultWaitMessage } from "../modals/wait-message/index.js";
|
|
13
13
|
import GlobalStyle from "./style.js";
|
|
14
|
-
export const StandAloneApp =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
export const StandAloneApp = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
manageSession,
|
|
17
|
+
WaitMessage,
|
|
18
|
+
children
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/_jsx(LiveAnnouncer, {}, void 0, /*#__PURE__*/_jsx(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/_jsx(GlobalStyle, {})), manageSession && (_SessionTimeout || (_SessionTimeout = /*#__PURE__*/_jsx(SessionTimeout, {}))), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/_jsx(MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/_jsx(WindowSize, {})), _LiveMessage || (_LiveMessage = /*#__PURE__*/_jsx(LiveMessage, {})), WaitMessage || _DefaultWaitMessage || (_DefaultWaitMessage = /*#__PURE__*/_jsx(DefaultWaitMessage, {})), _ErrorToast || (_ErrorToast = /*#__PURE__*/_jsx(ErrorToast, {})), children));
|
|
21
|
+
};
|
|
19
22
|
|
|
20
23
|
var _StyledDiv = /*#__PURE__*/_styled("div").withConfig({
|
|
21
24
|
componentId: "sc-1ho9g5n-0"
|
|
@@ -3,6 +3,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import { createGlobalStyle } from 'styled-components';
|
|
6
|
-
export default createGlobalStyle([":root{font-size:81.25%;", ";}html,body{height:100%;width:100%;line-height:", ";}body{font-family:", ";background-color:", ";}#app,#app-container,#root,main{height:100%;width:100%;min-height:100%;min-width:100%;}"],
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export default createGlobalStyle([":root{font-size:81.25%;", ";}html,body{height:100%;width:100%;line-height:", ";}body{font-family:", ";background-color:", ";}#app,#app-container,#root,main{height:100%;width:100%;min-height:100%;min-width:100%;}"], _ref => {
|
|
7
|
+
let {
|
|
8
|
+
theme
|
|
9
|
+
} = _ref;
|
|
10
|
+
return theme.media.small(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 100%;\n "])));
|
|
11
|
+
}, props => props.theme.lineHeights.m, props => props.theme.fonts.default, props => props.theme.colors.neutral['000']);
|
|
@@ -17,9 +17,10 @@ export default {
|
|
|
17
17
|
Component: ErrorToast
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const Renderer =
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const Renderer = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
Comp
|
|
23
|
+
} = _ref;
|
|
23
24
|
const [show, setShow] = useState(false);
|
|
24
25
|
useEffect(() => {
|
|
25
26
|
setShow(true);
|
|
@@ -43,17 +44,20 @@ export const BasicError = () => _Renderer || (_Renderer = /*#__PURE__*/_jsx(Rend
|
|
|
43
44
|
Comp: Basic
|
|
44
45
|
})); // Action wrappers for readability
|
|
45
46
|
|
|
46
|
-
const showToast =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
const showToast = _ref2 => {
|
|
48
|
+
let {
|
|
49
|
+
messageText = 'Toast Message',
|
|
50
|
+
type = ToastType.DEFAULT,
|
|
51
|
+
...props
|
|
52
|
+
} = _ref2;
|
|
53
|
+
return error.set({
|
|
54
|
+
type,
|
|
55
|
+
messageText,
|
|
56
|
+
messageTitle: type,
|
|
57
|
+
containerId: 'app-toast',
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
};
|
|
57
61
|
|
|
58
62
|
const successToast = props => showToast({ ...props,
|
|
59
63
|
type: ToastType.SUCCESS
|
|
@@ -71,14 +75,17 @@ const errorToast = props => showToast({ ...props,
|
|
|
71
75
|
type: ToastType.ERROR
|
|
72
76
|
});
|
|
73
77
|
|
|
74
|
-
const ToastButton =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
const ToastButton = _ref3 => {
|
|
79
|
+
let {
|
|
80
|
+
labelText,
|
|
81
|
+
onClick
|
|
82
|
+
} = _ref3;
|
|
83
|
+
return /*#__PURE__*/_jsx(DSButton, {
|
|
84
|
+
buttonType: "text",
|
|
85
|
+
labelText: labelText,
|
|
86
|
+
onClick: onClick
|
|
87
|
+
});
|
|
88
|
+
};
|
|
82
89
|
|
|
83
90
|
const ToastMultipleTypes = () => {
|
|
84
91
|
const dispatch = useAppDispatch();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _isEmpty from "lodash/isEmpty";
|
|
2
2
|
import { isHostAppDataExist, setHostAppData } from "./store.js";
|
|
3
3
|
import { sendMessageToHost, getHostAppData } from "../message-to-host-app/index.js";
|
|
4
4
|
import { bindEvent } from "../host-binding-events/index.js";
|
|
5
5
|
export const fetchHostAppData = (hostedAppUrl, guestAppId) => {
|
|
6
6
|
const isDataExist = isHostAppDataExist();
|
|
7
7
|
return new Promise(resolve => {
|
|
8
|
-
if (!
|
|
8
|
+
if (!_isEmpty(isDataExist)) {
|
|
9
9
|
resolve();
|
|
10
10
|
} else {
|
|
11
11
|
sendMessageToHost({
|