@elliemae/pui-app-sdk 3.15.0 → 3.16.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/appdynamics.js +4 -1
- package/dist/cjs/api/auth/index.js +8 -2
- package/dist/cjs/api/helpers.js +7 -1
- package/dist/cjs/api/users/index.js +3 -1
- package/dist/cjs/communication/http-client/index.js +4 -1
- package/dist/cjs/communication/http-client/response-interceptor.js +4 -1
- package/dist/cjs/communication/http-client/retry-axios.js +4 -1
- package/dist/cjs/data/auth/reducer.js +14 -8
- package/dist/cjs/data/breakpoint/index.js +4 -1
- package/dist/cjs/data/store.js +10 -2
- package/dist/cjs/data/wait-message/reducer.js +4 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/sideeffect/error-toast/index.js +3 -1
- package/dist/cjs/sideeffect/wait-message/index.js +6 -2
- package/dist/cjs/utils/app-config/config.js +4 -1
- package/dist/cjs/utils/app-config/index.js +9 -2
- package/dist/cjs/utils/auth/helper.js +4 -1
- package/dist/cjs/utils/auth/index.js +3 -1
- package/dist/cjs/utils/micro-frontend/guest.js +7 -2
- package/dist/cjs/utils/micro-frontend/host.js +8 -2
- package/dist/cjs/utils/micro-frontend/index.js +27 -10
- package/dist/cjs/utils/micro-frontend/ssfguest-adapter.js +9 -2
- package/dist/cjs/utils/redact-pii.js +8 -2
- package/dist/cjs/utils/session.js +14 -4
- package/dist/cjs/utils/testing/index.js +5 -7
- package/dist/cjs/utils/testing/render-with-redux.js +5 -7
- package/dist/cjs/utils/testing/render-with-router-redux.js +10 -9
- package/dist/cjs/utils/testing/render-with-router.js +5 -7
- package/dist/cjs/utils/testing/render-with-state-addons.js +7 -9
- package/dist/cjs/utils/web-storage.js +4 -1
- package/dist/cjs/utils/window.js +8 -2
- package/dist/cjs/view/app-root/hosted-app.js +13 -3
- package/dist/cjs/view/app-root/index.js +21 -19
- package/dist/cjs/view/app-root/stand-alone-app.js +17 -3
- package/dist/cjs/view/app-router.js +2 -5
- package/dist/cjs/view/breakpoint/use-breakpoint.js +9 -5
- package/dist/cjs/view/breakpoint/use-media-query-list.js +3 -1
- package/dist/cjs/view/error-boundary/default-error-template.js +11 -5
- package/dist/cjs/view/error-boundary/index.js +6 -2
- package/dist/cjs/view/error-toast/index.js +2 -5
- package/dist/cjs/view/fetch-host-app-data/index.js +4 -1
- package/dist/cjs/view/fields/autocomplete/index.js +9 -9
- package/dist/cjs/view/fields/check-box/index.js +3 -6
- package/dist/cjs/view/fields/combo-box/index.js +3 -6
- package/dist/cjs/view/fields/combo-box-v3/index.js +3 -6
- package/dist/cjs/view/fields/date-input/index.js +3 -6
- package/dist/cjs/view/fields/date-picker/index.js +7 -4
- package/dist/cjs/view/fields/date-range-picker/index.js +10 -9
- package/dist/cjs/view/fields/date-time-picker/index.js +3 -6
- package/dist/cjs/view/fields/form-item-layout/index.js +15 -16
- package/dist/cjs/view/fields/form-layout-block-item/index.js +16 -17
- package/dist/cjs/view/fields/input-mask/index.js +3 -6
- package/dist/cjs/view/fields/input-text/index.js +3 -6
- package/dist/cjs/view/fields/large-text-box/index.js +3 -6
- package/dist/cjs/view/fields/radio/index.js +3 -6
- package/dist/cjs/view/fields/radio-group/index.js +3 -6
- package/dist/cjs/view/fields/text-box/index.js +3 -6
- package/dist/cjs/view/fields/toggle/index.js +3 -6
- package/dist/cjs/view/fields/watch-value.js +25 -3
- package/dist/cjs/view/form/index.js +13 -8
- package/dist/cjs/view/form/personal-info-section.js +54 -47
- package/dist/cjs/view/form/submit-button/index.js +2 -5
- package/dist/cjs/view/live-message/index.js +2 -5
- package/dist/cjs/view/loadable/index.js +8 -10
- package/dist/cjs/view/login/index.js +4 -5
- package/dist/cjs/view/micro-app/app-factory/index.js +9 -3
- package/dist/cjs/view/micro-app/index.js +6 -3
- package/dist/cjs/view/micro-app/resources/manifest.js +10 -3
- package/dist/cjs/view/micro-app/use-app-will-render.js +37 -28
- package/dist/cjs/view/micro-iframe-app/app.js +23 -18
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +22 -15
- package/dist/cjs/view/micro-iframe-app/index.js +2 -5
- package/dist/cjs/view/modals/error/index.js +21 -12
- package/dist/cjs/view/modals/navigation-prompt/index.js +46 -27
- package/dist/cjs/view/modals/session-expiry/customHooks.js +6 -2
- package/dist/cjs/view/modals/session-expiry/index.js +57 -35
- package/dist/cjs/view/modals/wait-message/index.js +26 -27
- package/dist/cjs/view/page.js +15 -3
- package/dist/cjs/view/render-with-delay/index.js +4 -5
- package/dist/cjs/view/render-with-host-data/index.js +2 -5
- package/dist/cjs/view/require-auth.js +12 -6
- package/dist/cjs/view/session-timeout/index.js +15 -14
- package/dist/cjs/view/storybook/decorator.js +5 -7
- package/dist/cjs/view/visually-hidden/index.js +11 -6
- package/dist/esm/api/auth/index.js +8 -2
- package/dist/esm/api/helpers.js +7 -1
- package/dist/esm/api/users/index.js +3 -1
- package/dist/esm/data/auth/reducer.js +10 -7
- package/dist/esm/data/store.js +6 -1
- package/dist/esm/sideeffect/error-toast/index.js +3 -1
- package/dist/esm/sideeffect/wait-message/index.js +6 -2
- package/dist/esm/utils/app-config/index.js +5 -1
- package/dist/esm/utils/auth/index.js +3 -1
- package/dist/esm/utils/micro-frontend/guest.js +3 -1
- package/dist/esm/utils/micro-frontend/host.js +8 -2
- package/dist/esm/utils/micro-frontend/index.js +23 -9
- package/dist/esm/utils/micro-frontend/ssfguest-adapter.js +5 -1
- package/dist/esm/utils/redact-pii.js +8 -2
- package/dist/esm/utils/session.js +14 -4
- package/dist/esm/utils/testing/index.js +5 -4
- package/dist/esm/utils/testing/render-with-redux.js +5 -4
- package/dist/esm/utils/testing/render-with-router-redux.js +10 -6
- package/dist/esm/utils/testing/render-with-router.js +5 -4
- package/dist/esm/utils/testing/render-with-state-addons.js +7 -6
- package/dist/esm/utils/window.js +8 -2
- package/dist/esm/view/app-root/hosted-app.js +9 -2
- package/dist/esm/view/app-root/index.js +21 -16
- package/dist/esm/view/app-root/stand-alone-app.js +13 -2
- package/dist/esm/view/app-router.js +2 -2
- package/dist/esm/view/breakpoint/use-breakpoint.js +9 -5
- package/dist/esm/view/breakpoint/use-media-query-list.js +3 -1
- package/dist/esm/view/error-boundary/default-error-template.js +11 -2
- package/dist/esm/view/error-boundary/index.js +2 -1
- package/dist/esm/view/error-toast/index.js +2 -2
- package/dist/esm/view/fields/autocomplete/index.js +9 -6
- package/dist/esm/view/fields/check-box/index.js +3 -3
- package/dist/esm/view/fields/combo-box/index.js +3 -3
- package/dist/esm/view/fields/combo-box-v3/index.js +3 -3
- package/dist/esm/view/fields/date-input/index.js +3 -3
- package/dist/esm/view/fields/date-picker/index.js +3 -3
- package/dist/esm/view/fields/date-range-picker/index.js +10 -6
- package/dist/esm/view/fields/date-time-picker/index.js +3 -3
- package/dist/esm/view/fields/form-item-layout/index.js +15 -13
- package/dist/esm/view/fields/form-layout-block-item/index.js +16 -14
- package/dist/esm/view/fields/input-mask/index.js +3 -3
- package/dist/esm/view/fields/input-text/index.js +3 -3
- package/dist/esm/view/fields/large-text-box/index.js +3 -3
- package/dist/esm/view/fields/radio/index.js +3 -3
- package/dist/esm/view/fields/radio-group/index.js +3 -3
- package/dist/esm/view/fields/text-box/index.js +3 -3
- package/dist/esm/view/fields/toggle/index.js +3 -3
- package/dist/esm/view/fields/watch-value.js +21 -2
- package/dist/esm/view/form/index.js +9 -7
- package/dist/esm/view/form/personal-info-section.js +50 -46
- package/dist/esm/view/form/submit-button/index.js +2 -2
- package/dist/esm/view/live-message/index.js +2 -2
- package/dist/esm/view/loadable/index.js +8 -7
- package/dist/esm/view/login/index.js +4 -2
- package/dist/esm/view/micro-app/app-factory/index.js +9 -3
- package/dist/esm/view/micro-app/index.js +2 -2
- package/dist/esm/view/micro-app/resources/manifest.js +10 -3
- package/dist/esm/view/micro-app/use-app-will-render.js +37 -28
- package/dist/esm/view/micro-iframe-app/app.js +19 -17
- package/dist/esm/view/micro-iframe-app/iframe/index.js +18 -14
- package/dist/esm/view/micro-iframe-app/index.js +2 -2
- package/dist/esm/view/modals/error/index.js +21 -9
- package/dist/esm/view/modals/navigation-prompt/index.js +46 -24
- package/dist/esm/view/modals/session-expiry/customHooks.js +6 -2
- package/dist/esm/view/modals/session-expiry/index.js +57 -32
- package/dist/esm/view/modals/wait-message/index.js +26 -24
- package/dist/esm/view/page.js +11 -2
- package/dist/esm/view/render-with-delay/index.js +4 -2
- package/dist/esm/view/render-with-host-data/index.js +2 -2
- package/dist/esm/view/require-auth.js +8 -5
- package/dist/esm/view/session-timeout/index.js +15 -11
- package/dist/esm/view/storybook/decorator.js +5 -4
- package/dist/esm/view/visually-hidden/index.js +7 -5
- package/package.json +33 -33
|
@@ -3,13 +3,16 @@ import { LOGIN_SUCCESS } from "./actions.js";
|
|
|
3
3
|
const initialState = {
|
|
4
4
|
authenticated: false
|
|
5
5
|
};
|
|
6
|
-
const authReducer = produce(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
6
|
+
const authReducer = produce(
|
|
7
|
+
(draft, action) => {
|
|
8
|
+
switch (action.type) {
|
|
9
|
+
case LOGIN_SUCCESS:
|
|
10
|
+
draft.authenticated = true;
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
initialState
|
|
15
|
+
);
|
|
13
16
|
export {
|
|
14
17
|
authReducer,
|
|
15
18
|
initialState
|
package/dist/esm/data/store.js
CHANGED
|
@@ -31,7 +31,12 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
|
31
31
|
};
|
|
32
32
|
const createAppStore = (initialState = {}, history, middlewareConfig) => {
|
|
33
33
|
const sagaMiddleware = createSagaMiddleware({});
|
|
34
|
-
const store = createStore(
|
|
34
|
+
const store = createStore(
|
|
35
|
+
initialState,
|
|
36
|
+
sagaMiddleware,
|
|
37
|
+
history,
|
|
38
|
+
middlewareConfig
|
|
39
|
+
);
|
|
35
40
|
setStore(store);
|
|
36
41
|
return store;
|
|
37
42
|
};
|
|
@@ -5,7 +5,9 @@ import { getLogger } from "../../utils/micro-frontend/index.js";
|
|
|
5
5
|
import { logRecords } from "../../utils/log-records.js";
|
|
6
6
|
function* openErrorToast(action) {
|
|
7
7
|
try {
|
|
8
|
-
const microApp = yield call(
|
|
8
|
+
const microApp = yield call(
|
|
9
|
+
CMicroAppGuest.getInstance.bind(CMicroAppGuest)
|
|
10
|
+
);
|
|
9
11
|
const host = yield call(microApp.getHost.bind(microApp));
|
|
10
12
|
const message = action?.payload?.description || action?.payload?.messageText;
|
|
11
13
|
if (host && message)
|
|
@@ -5,7 +5,9 @@ import { getLogger } from "../../utils/micro-frontend/index.js";
|
|
|
5
5
|
import { logRecords } from "../../utils/log-records.js";
|
|
6
6
|
function* openWaitMessage() {
|
|
7
7
|
try {
|
|
8
|
-
const microApp = yield call(
|
|
8
|
+
const microApp = yield call(
|
|
9
|
+
CMicroAppGuest.getInstance.bind(CMicroAppGuest)
|
|
10
|
+
);
|
|
9
11
|
const host = yield call(microApp.getHost.bind(microApp));
|
|
10
12
|
if (host)
|
|
11
13
|
yield call(host.openWaitMessage.bind(host));
|
|
@@ -18,7 +20,9 @@ function* openWaitMessage() {
|
|
|
18
20
|
}
|
|
19
21
|
function* closeWaitMessage() {
|
|
20
22
|
try {
|
|
21
|
-
const microApp = yield call(
|
|
23
|
+
const microApp = yield call(
|
|
24
|
+
CMicroAppGuest.getInstance.bind(CMicroAppGuest)
|
|
25
|
+
);
|
|
22
26
|
const host = yield call(microApp.getHost.bind(microApp));
|
|
23
27
|
if (host)
|
|
24
28
|
yield call(host.closeWaitMessage.bind(host));
|
|
@@ -18,7 +18,11 @@ const loadAppConfig = (hostUrl = "./") => new Promise((resolve, reject) => {
|
|
|
18
18
|
parseAppConfig(data);
|
|
19
19
|
resolve();
|
|
20
20
|
}).catch((err) => {
|
|
21
|
-
reject(
|
|
21
|
+
reject(
|
|
22
|
+
new Error(
|
|
23
|
+
`Unable to load application configurtion file. ${err.Message}`
|
|
24
|
+
)
|
|
25
|
+
);
|
|
22
26
|
});
|
|
23
27
|
});
|
|
24
28
|
export {
|
|
@@ -35,7 +35,9 @@ const navigateToLoginPage = ({
|
|
|
35
35
|
response_type: responseType,
|
|
36
36
|
scope
|
|
37
37
|
};
|
|
38
|
-
const searchParams = new URLSearchParams(
|
|
38
|
+
const searchParams = new URLSearchParams(
|
|
39
|
+
idpErrorCode ? Object.assign(idpOptions, { error_code: idpErrorCode }) : idpOptions
|
|
40
|
+
);
|
|
39
41
|
idpUrl.search = searchParams.toString();
|
|
40
42
|
window.location.replace(idpUrl.href);
|
|
41
43
|
};
|
|
@@ -121,7 +121,9 @@ class CMicroAppGuest {
|
|
|
121
121
|
if (appEle)
|
|
122
122
|
ReactDOM.unmountComponentAtNode(appEle);
|
|
123
123
|
removeStorageEvents();
|
|
124
|
-
return Promise.resolve().then(
|
|
124
|
+
return Promise.resolve().then(
|
|
125
|
+
() => this.onUnmount ? this.onUnmount(options) : null
|
|
126
|
+
);
|
|
125
127
|
}
|
|
126
128
|
getRef() {
|
|
127
129
|
return this.onGetRef ? this.onGetRef() : null;
|
|
@@ -129,10 +129,16 @@ class CMicroAppHost {
|
|
|
129
129
|
return getWindowViewportSize();
|
|
130
130
|
}
|
|
131
131
|
onResizeEvent(eventHandler) {
|
|
132
|
-
return subscribe(
|
|
132
|
+
return subscribe(
|
|
133
|
+
HOST_WINDOW_RESIZED,
|
|
134
|
+
(msg, data) => eventHandler(data)
|
|
135
|
+
);
|
|
133
136
|
}
|
|
134
137
|
onBreakpointChangeEvent(eventHandler) {
|
|
135
|
-
return subscribe(
|
|
138
|
+
return subscribe(
|
|
139
|
+
HOST_WINDOW_BREAKPOINT_CHANGED,
|
|
140
|
+
(msg, data) => eventHandler(data)
|
|
141
|
+
);
|
|
136
142
|
}
|
|
137
143
|
setSystemVersion(version = "latest") {
|
|
138
144
|
window.emui.version = version;
|
|
@@ -17,24 +17,38 @@ const isProduction = (mode) => {
|
|
|
17
17
|
const getVersionedPath = (path) => {
|
|
18
18
|
const { systemVersion } = CMicroAppHost.getInstance().getProps();
|
|
19
19
|
const majorMinorVersion = systemVersion.match(/^(?:\d+\.\d+)*/g);
|
|
20
|
-
return path.replace(
|
|
20
|
+
return path.replace(
|
|
21
|
+
/{SYSTEM_VERSION}/,
|
|
22
|
+
majorMinorVersion && majorMinorVersion[0] || "latest"
|
|
23
|
+
);
|
|
21
24
|
};
|
|
22
25
|
const getMicroFrontEndAppConfig = (appInfo) => {
|
|
23
|
-
const microFEAppConfig = getAppConfigValue(
|
|
26
|
+
const microFEAppConfig = getAppConfigValue(
|
|
27
|
+
`microFrontendApps.${appInfo.id}`
|
|
28
|
+
);
|
|
24
29
|
if (!microFEAppConfig)
|
|
25
|
-
throw new Error(
|
|
30
|
+
throw new Error(
|
|
31
|
+
`unable to locate application configuraiton for ${appInfo.id} under microFrontendApps section of app.config.json`
|
|
32
|
+
);
|
|
26
33
|
const { mode = "production" } = microFEAppConfig;
|
|
27
34
|
const envConfig = isProduction(mode) ? microFEAppConfig.production : microFEAppConfig.development;
|
|
28
35
|
if (microFEAppConfig.production)
|
|
29
36
|
delete microFEAppConfig.production;
|
|
30
37
|
if (microFEAppConfig.development)
|
|
31
38
|
delete microFEAppConfig.development;
|
|
32
|
-
const microFEConfig = _.merge(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
const microFEConfig = _.merge(
|
|
40
|
+
appInfo,
|
|
41
|
+
{
|
|
42
|
+
mode: "production",
|
|
43
|
+
hostUrl: "./",
|
|
44
|
+
manifestPath: "./{SYSTEM_VERSION}"
|
|
45
|
+
},
|
|
46
|
+
microFEAppConfig,
|
|
47
|
+
envConfig
|
|
48
|
+
);
|
|
49
|
+
microFEConfig.hostUrl = convertRelativeToAbsoluteUrl(
|
|
50
|
+
microFEConfig.hostUrl.replace(/\/?$/, "/")
|
|
51
|
+
);
|
|
38
52
|
microFEConfig.manifestPath = getVersionedPath(microFEConfig.manifestPath);
|
|
39
53
|
return microFEConfig;
|
|
40
54
|
};
|
|
@@ -14,7 +14,11 @@ class SSFGuestAdapter {
|
|
|
14
14
|
func(message, eventData);
|
|
15
15
|
};
|
|
16
16
|
const [objectId, eventName] = message.split(".");
|
|
17
|
-
return ssfGuest.subscribe(
|
|
17
|
+
return ssfGuest.subscribe(
|
|
18
|
+
objectId,
|
|
19
|
+
eventName || "",
|
|
20
|
+
callback
|
|
21
|
+
);
|
|
18
22
|
}
|
|
19
23
|
unsubscribe(token, objectId, eventName) {
|
|
20
24
|
return ssfGuest.unsubscribe(objectId, eventName, token);
|
|
@@ -3,7 +3,10 @@ const poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
|
|
|
3
3
|
const roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
|
|
4
4
|
const piiPatterns = {
|
|
5
5
|
creditCardNumber: /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g,
|
|
6
|
-
streetAddress: new RegExp(
|
|
6
|
+
streetAddress: new RegExp(
|
|
7
|
+
`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`,
|
|
8
|
+
"gi"
|
|
9
|
+
),
|
|
7
10
|
zipcode: /\b\d{5}\b(-\d{4})?\b/g,
|
|
8
11
|
phoneNumber: /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g,
|
|
9
12
|
ipAddress: /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi,
|
|
@@ -15,7 +18,10 @@ const piiPatterns = {
|
|
|
15
18
|
const replacer = (key, value) => {
|
|
16
19
|
if (!key || typeof value !== "string" || key === "correlationId")
|
|
17
20
|
return value;
|
|
18
|
-
return Object.values(piiPatterns).reduce(
|
|
21
|
+
return Object.values(piiPatterns).reduce(
|
|
22
|
+
(redactedString, piiPattern) => redactedString.replace(piiPattern, "****"),
|
|
23
|
+
value
|
|
24
|
+
);
|
|
19
25
|
};
|
|
20
26
|
const redactPii = (data) => {
|
|
21
27
|
try {
|
|
@@ -19,14 +19,20 @@ const resetUserIdleTime = (resetWarningModal = false) => {
|
|
|
19
19
|
}).catch(() => {
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
const throttledResetUserIdleTime = throttle(
|
|
22
|
+
const throttledResetUserIdleTime = throttle(
|
|
23
|
+
resetUserIdleTime,
|
|
24
|
+
THROTTLING_TIME,
|
|
25
|
+
{ leading: true }
|
|
26
|
+
);
|
|
23
27
|
const isPastWarningTime = (warnInterval = getAppConfigValue("sessionTimeoutWarnInterval") || SESSION_TIMEOUT_INTERVAL.WARN) => Date.now() - lastUserActivityTimeStamp > warnInterval;
|
|
24
28
|
const isPastSessionTimeoutTime = (sessionTimeout = getAppConfigValue("sessionTimeoutInterval") || SESSION_TIMEOUT_INTERVAL.EXPIRY) => Date.now() - lastUserActivityTimeStamp > sessionTimeout;
|
|
25
29
|
const notifySessionExpiryWarning = () => {
|
|
26
30
|
sessionExpiryWarningNotified = true;
|
|
27
31
|
sessionExpiryWarningNotifiedAt = Date.now();
|
|
28
32
|
Promise.resolve().then(() => {
|
|
29
|
-
warnListeners.forEach(
|
|
33
|
+
warnListeners.forEach(
|
|
34
|
+
(listener) => listener(sessionExpiryWarningNotifiedAt)
|
|
35
|
+
);
|
|
30
36
|
}).catch(() => {
|
|
31
37
|
});
|
|
32
38
|
};
|
|
@@ -79,10 +85,14 @@ const trackActivity = (element, cb) => {
|
|
|
79
85
|
return () => {
|
|
80
86
|
};
|
|
81
87
|
const thorttledCb = throttle(cb, THROTTLING_TIME, { leading: true });
|
|
82
|
-
userInteractionEvents.forEach(
|
|
88
|
+
userInteractionEvents.forEach(
|
|
89
|
+
(r) => element.addEventListener(r, thorttledCb)
|
|
90
|
+
);
|
|
83
91
|
return () => {
|
|
84
92
|
userInteractionEvents.forEach((r) => element.removeEventListener(r, cb));
|
|
85
|
-
userInteractionEvents.forEach(
|
|
93
|
+
userInteractionEvents.forEach(
|
|
94
|
+
(r) => element.removeEventListener(r, thorttledCb)
|
|
95
|
+
);
|
|
86
96
|
};
|
|
87
97
|
};
|
|
88
98
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
3
|
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
4
4
|
import { createAppStore } from "../../data/store.js";
|
|
@@ -10,11 +10,12 @@ const AllTheProviders = ({
|
|
|
10
10
|
store = defaultStore,
|
|
11
11
|
theme = defaultTheme,
|
|
12
12
|
children
|
|
13
|
-
}) => /* @__PURE__ */
|
|
13
|
+
}) => /* @__PURE__ */ jsx(AppRoot, {
|
|
14
14
|
store,
|
|
15
15
|
history: browserHistory,
|
|
16
|
-
theme
|
|
17
|
-
|
|
16
|
+
theme,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
18
19
|
const customRender = (ui, options) => render(ui, { wrapper: AllTheProviders, ...options });
|
|
19
20
|
export * from "@testing-library/react";
|
|
20
21
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
3
|
import { Provider } from "react-redux";
|
|
4
4
|
import { createAppStore } from "../../data/store.js";
|
|
@@ -7,9 +7,10 @@ const renderWithRedux = (ui, {
|
|
|
7
7
|
initialState,
|
|
8
8
|
store = createAppStore(initialState, browserHistory)
|
|
9
9
|
} = {}) => ({
|
|
10
|
-
...render(/* @__PURE__ */
|
|
11
|
-
store
|
|
12
|
-
|
|
10
|
+
...render(/* @__PURE__ */ jsx(Provider, {
|
|
11
|
+
store,
|
|
12
|
+
children: ui
|
|
13
|
+
})),
|
|
13
14
|
store
|
|
14
15
|
});
|
|
15
16
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
3
|
import { Provider } from "react-redux";
|
|
4
4
|
import { createMemoryHistory } from "history";
|
|
@@ -11,11 +11,15 @@ const renderWithRouterRedux = (ui, {
|
|
|
11
11
|
initialState,
|
|
12
12
|
store = createAppStore(initialState, browserHistory)
|
|
13
13
|
} = {}) => ({
|
|
14
|
-
...render(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
...render(
|
|
15
|
+
/* @__PURE__ */ jsx(Provider, {
|
|
16
|
+
store,
|
|
17
|
+
children: /* @__PURE__ */ jsx(AppRouter, {
|
|
18
|
+
history,
|
|
19
|
+
children: ui
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
),
|
|
19
23
|
store
|
|
20
24
|
});
|
|
21
25
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
3
|
import { createMemoryHistory } from "history";
|
|
4
4
|
import { AppRouter } from "../../view/app-router.js";
|
|
@@ -6,9 +6,10 @@ const renderWithRouter = (ui, {
|
|
|
6
6
|
route = "/",
|
|
7
7
|
history = createMemoryHistory({ initialEntries: [route] })
|
|
8
8
|
} = {}) => {
|
|
9
|
-
const renderResult = render(/* @__PURE__ */
|
|
10
|
-
history
|
|
11
|
-
|
|
9
|
+
const renderResult = render(/* @__PURE__ */ jsx(AppRouter, {
|
|
10
|
+
history,
|
|
11
|
+
children: ui
|
|
12
|
+
}));
|
|
12
13
|
return {
|
|
13
14
|
...renderResult,
|
|
14
15
|
history
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
4
|
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
@@ -27,11 +27,12 @@ const RenderWithStateAddOns = ({
|
|
|
27
27
|
useEffect(() => {
|
|
28
28
|
setReady(true);
|
|
29
29
|
}, []);
|
|
30
|
-
return ready ? /* @__PURE__ */
|
|
31
|
-
theme
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
return ready ? /* @__PURE__ */ jsx(ThemeProvider, {
|
|
31
|
+
theme,
|
|
32
|
+
children: /* @__PURE__ */ jsx(Component, {
|
|
33
|
+
...rest
|
|
34
|
+
})
|
|
35
|
+
}) : null;
|
|
35
36
|
};
|
|
36
37
|
export {
|
|
37
38
|
RenderWithStateAddOns
|
package/dist/esm/utils/window.js
CHANGED
|
@@ -8,8 +8,14 @@ const getWindow = () => {
|
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
const getViewportSize = () => ({
|
|
11
|
-
width: Math.max(
|
|
12
|
-
|
|
11
|
+
width: Math.max(
|
|
12
|
+
document.documentElement.clientWidth || 0,
|
|
13
|
+
window.innerWidth || 0
|
|
14
|
+
),
|
|
15
|
+
height: Math.max(
|
|
16
|
+
document.documentElement.clientHeight || 0,
|
|
17
|
+
window.innerHeight || 0
|
|
18
|
+
)
|
|
13
19
|
});
|
|
14
20
|
const convertBreakpointToNumber = (breakpoint) => Number(breakpoint.replace("px", ""));
|
|
15
21
|
const getCurrentBreakpoint = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { ErrorToast } from "../error-toast/index.js";
|
|
4
4
|
import { WaitMessage as DefaultWaitMessage } from "../modals/wait-message/index.js";
|
|
@@ -13,7 +13,14 @@ const HostedApp = ({ WaitMessage, children }) => {
|
|
|
13
13
|
useBreakpoint();
|
|
14
14
|
useHTMLWaitMessage(true);
|
|
15
15
|
useWindowSizeChange();
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ jsxs(Div, {
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx(GlobalStyle, {}),
|
|
19
|
+
WaitMessage || /* @__PURE__ */ jsx(DefaultWaitMessage, {}),
|
|
20
|
+
/* @__PURE__ */ jsx(ErrorToast, {}),
|
|
21
|
+
children
|
|
22
|
+
]
|
|
23
|
+
});
|
|
17
24
|
};
|
|
18
25
|
export {
|
|
19
26
|
HostedApp
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Provider } from "react-redux";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
4
|
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
@@ -9,9 +9,9 @@ import { StandAloneApp } from "./stand-alone-app.js";
|
|
|
9
9
|
import { HostedApp } from "./hosted-app.js";
|
|
10
10
|
const AppToRender = (props) => {
|
|
11
11
|
const isParent = isStandAloneGuest() || isHost();
|
|
12
|
-
return isParent ? /* @__PURE__ */
|
|
12
|
+
return isParent ? /* @__PURE__ */ jsx(StandAloneApp, {
|
|
13
13
|
...props
|
|
14
|
-
}) : /* @__PURE__ */
|
|
14
|
+
}) : /* @__PURE__ */ jsx(HostedApp, {
|
|
15
15
|
...props
|
|
16
16
|
});
|
|
17
17
|
};
|
|
@@ -24,19 +24,24 @@ const AppRoot = ({
|
|
|
24
24
|
WaitMessage,
|
|
25
25
|
errorTemplate,
|
|
26
26
|
children
|
|
27
|
-
}) => /* @__PURE__ */
|
|
28
|
-
errorTemplate
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
}) => /* @__PURE__ */ jsx(ErrorBoundary, {
|
|
28
|
+
errorTemplate,
|
|
29
|
+
children: /* @__PURE__ */ jsx(Provider, {
|
|
30
|
+
store,
|
|
31
|
+
children: /* @__PURE__ */ jsx(AppRouter, {
|
|
32
|
+
history,
|
|
33
|
+
basename,
|
|
34
|
+
children: /* @__PURE__ */ jsx(ThemeProvider, {
|
|
35
|
+
theme,
|
|
36
|
+
children: /* @__PURE__ */ jsx(AppToRender, {
|
|
37
|
+
manageSession,
|
|
38
|
+
WaitMessage,
|
|
39
|
+
children
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
});
|
|
40
45
|
export {
|
|
41
46
|
AppRoot
|
|
42
47
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { LiveAnnouncer } from "react-aria-live";
|
|
4
4
|
import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
|
|
@@ -18,7 +18,18 @@ const StandAloneApp = ({
|
|
|
18
18
|
}) => {
|
|
19
19
|
useBreakpoint();
|
|
20
20
|
useWindowSizeChange();
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ jsx(LiveAnnouncer, {
|
|
22
|
+
children: /* @__PURE__ */ jsxs(Div, {
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx(GlobalStyle, {}),
|
|
25
|
+
manageSession && /* @__PURE__ */ jsx(SessionTimeout, {}),
|
|
26
|
+
/* @__PURE__ */ jsx(LiveMessage, {}),
|
|
27
|
+
WaitMessage || /* @__PURE__ */ jsx(DefaultWaitMessage, {}),
|
|
28
|
+
/* @__PURE__ */ jsx(ErrorToast, {}),
|
|
29
|
+
children
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
});
|
|
22
33
|
};
|
|
23
34
|
export {
|
|
24
35
|
StandAloneApp
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useLayoutEffect } from "react";
|
|
3
3
|
import { Router } from "react-router-dom";
|
|
4
4
|
const AppRouter = ({ history, basename, ...props }) => {
|
|
@@ -21,7 +21,7 @@ const AppRouter = ({ history, basename, ...props }) => {
|
|
|
21
21
|
unlisten();
|
|
22
22
|
};
|
|
23
23
|
}, [history]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsx(Router, {
|
|
25
25
|
...props,
|
|
26
26
|
basename,
|
|
27
27
|
location: state.location,
|
|
@@ -7,11 +7,15 @@ import { useMediaQueryList } from "./use-media-query-list.js";
|
|
|
7
7
|
import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants.js";
|
|
8
8
|
const useBreakpoint = () => {
|
|
9
9
|
const theme = useContext(ThemeContext);
|
|
10
|
-
const currentBreakpoint = useMediaQueryList(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const currentBreakpoint = useMediaQueryList(
|
|
11
|
+
[
|
|
12
|
+
`(max-width: ${theme.breakpoints.small})`,
|
|
13
|
+
`(max-width: ${theme.breakpoints.medium})`,
|
|
14
|
+
`(max-width: ${theme.breakpoints.large})`
|
|
15
|
+
],
|
|
16
|
+
["small", "medium", "large"],
|
|
17
|
+
"large"
|
|
18
|
+
);
|
|
15
19
|
const dispatch = useAppDispatch();
|
|
16
20
|
useEffect(() => {
|
|
17
21
|
dispatch({ type: breakpoint.change, payload: currentBreakpoint });
|
|
@@ -9,7 +9,9 @@ const useMediaQueryList = (queries, values, defaultValue) => {
|
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
const handler = () => setValue(getValue);
|
|
11
11
|
mediaQueryLists.forEach((mql) => mql.addEventListener("change", handler));
|
|
12
|
-
return () => mediaQueryLists.forEach(
|
|
12
|
+
return () => mediaQueryLists.forEach(
|
|
13
|
+
(mql) => mql.removeEventListener("change", handler)
|
|
14
|
+
);
|
|
13
15
|
}, [getValue, mediaQueryLists]);
|
|
14
16
|
return value;
|
|
15
17
|
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
const DefaultErrorTemplate = (props) => /* @__PURE__ */
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const DefaultErrorTemplate = (props) => /* @__PURE__ */ jsxs("div", {
|
|
3
|
+
children: [
|
|
4
|
+
/* @__PURE__ */ jsx("h2", {
|
|
5
|
+
children: "We are unable to process your request"
|
|
6
|
+
}),
|
|
7
|
+
/* @__PURE__ */ jsx("section", {
|
|
8
|
+
children: "Please close your browser and login again"
|
|
9
|
+
})
|
|
10
|
+
]
|
|
11
|
+
});
|
|
3
12
|
export {
|
|
4
13
|
DefaultErrorTemplate
|
|
5
14
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import {
|
|
3
4
|
DefaultErrorTemplate
|
|
@@ -25,7 +26,7 @@ class ErrorBoundary extends React.Component {
|
|
|
25
26
|
const { children, errorTemplate } = this.props;
|
|
26
27
|
const ErrorTemplate = errorTemplate || DefaultErrorTemplate;
|
|
27
28
|
const { error, errorInfo } = this.state;
|
|
28
|
-
return errorInfo ? /* @__PURE__ */
|
|
29
|
+
return errorInfo ? /* @__PURE__ */ jsx(ErrorTemplate, {
|
|
29
30
|
error,
|
|
30
31
|
errorInfo
|
|
31
32
|
}) : children;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, memo } from "react";
|
|
3
3
|
import { ToastPosition, ToastType, DSToast, toast } from "@elliemae/ds-toast";
|
|
4
4
|
import { useAppSelector, useAppDispatch } from "../../data/react-redux.js";
|
|
@@ -21,7 +21,7 @@ const ErrorToast = memo((props) => {
|
|
|
21
21
|
dispatch(error.clear());
|
|
22
22
|
}
|
|
23
23
|
}, [storeError, props, dispatch]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsx(DSToast, {
|
|
25
25
|
...props
|
|
26
26
|
});
|
|
27
27
|
});
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DSAutocomplete } from "@elliemae/ds-controlled-form";
|
|
3
3
|
import { Controller } from "react-hook-form";
|
|
4
4
|
const filterOptions = (allOptions, newFilter) => {
|
|
5
|
-
const filtered = allOptions.filter(
|
|
5
|
+
const filtered = allOptions.filter(
|
|
6
|
+
(option) => option.type === "section" || option.label.toLowerCase().includes(newFilter?.toLowerCase())
|
|
7
|
+
);
|
|
6
8
|
return filtered.length === 1 && filtered[0].type === "section" ? [] : filtered;
|
|
7
9
|
};
|
|
8
10
|
const Autocomplete = ({
|
|
9
11
|
name,
|
|
10
12
|
children,
|
|
11
13
|
...rest
|
|
12
|
-
}) => /* @__PURE__ */
|
|
14
|
+
}) => /* @__PURE__ */ jsx(Controller, {
|
|
13
15
|
name,
|
|
14
|
-
render: ({ field: { onChange, value, ...props } }) => /* @__PURE__ */
|
|
16
|
+
render: ({ field: { onChange, value, ...props } }) => /* @__PURE__ */ jsx(DSAutocomplete, {
|
|
15
17
|
...rest,
|
|
16
18
|
...props,
|
|
17
19
|
options: filterOptions(rest.options, value),
|
|
18
20
|
filter: value ?? "",
|
|
19
|
-
onSelect: onChange
|
|
20
|
-
|
|
21
|
+
onSelect: onChange,
|
|
22
|
+
children
|
|
23
|
+
})
|
|
21
24
|
});
|
|
22
25
|
export {
|
|
23
26
|
Autocomplete
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DSControlledCheckbox } from "@elliemae/ds-controlled-form";
|
|
3
3
|
import {
|
|
4
4
|
Controller
|
|
5
5
|
} from "react-hook-form";
|
|
6
|
-
const CheckBox = ({ name, rules = {}, ...rest }) => /* @__PURE__ */
|
|
6
|
+
const CheckBox = ({ name, rules = {}, ...rest }) => /* @__PURE__ */ jsx(Controller, {
|
|
7
7
|
name,
|
|
8
8
|
rules,
|
|
9
|
-
render: ({ field: { value = false, ...restProps } }) => /* @__PURE__ */
|
|
9
|
+
render: ({ field: { value = false, ...restProps } }) => /* @__PURE__ */ jsx(DSControlledCheckbox, {
|
|
10
10
|
...rest,
|
|
11
11
|
...restProps,
|
|
12
12
|
checked: value
|