@elliemae/pui-app-sdk 3.0.0-beta.11 → 3.0.0-beta.15
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/communication/http-client/retry-axios.js +1 -1
- package/dist/cjs/index.js +4 -6
- package/dist/cjs/utils/app-config/config.js +1 -1
- package/dist/cjs/utils/helpers.js +1 -1
- package/dist/cjs/utils/testing/render-with-router-redux.js +2 -2
- package/dist/cjs/utils/testing/render-with-router.js +9 -6
- package/dist/cjs/view/app-root/index.js +2 -2
- package/dist/cjs/view/{header/nav-region/user/index.js → app-router.js} +19 -9
- package/dist/cjs/view/fields/check-box/index.js +2 -2
- package/dist/cjs/view/fields/combo-box/index.js +2 -2
- package/dist/cjs/view/fields/date-input/index.js +2 -2
- package/dist/cjs/view/fields/date-picker/index.js +2 -2
- package/dist/cjs/view/fields/form-item-layout/index.js +2 -2
- package/dist/cjs/view/fields/input-mask/index.js +2 -2
- package/dist/cjs/view/fields/large-text-box/index.js +2 -2
- package/dist/cjs/view/fields/radio/index.js +2 -2
- package/dist/cjs/view/fields/radio-group/index.js +2 -2
- package/dist/cjs/view/fields/text-box/index.js +2 -2
- package/dist/cjs/view/form/submit-button/index.js +2 -2
- package/dist/cjs/view/login/index.js +1 -7
- package/dist/cjs/view/media-breakpoint/index.js +1 -7
- package/dist/cjs/view/micro-app/app-factory/index.js +1 -1
- package/dist/cjs/view/micro-app/resources/script.js +1 -1
- package/dist/cjs/view/modals/error/index.js +2 -2
- package/dist/cjs/view/modals/navigation-prompt/index.js +2 -2
- package/dist/cjs/view/modals/session-expiry/index.js +2 -2
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +1 -7
- package/dist/cjs/view/modals/wait-message/index.js +2 -2
- package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +1 -7
- package/dist/cjs/{route/page-view.js → view/page.js} +10 -3
- package/dist/cjs/view/render-with-delay/index.js +1 -1
- package/dist/cjs/{route/private-route/index.js → view/require-auth.js} +23 -36
- package/dist/cjs/view/window-size/index.js +1 -7
- package/dist/es/communication/http-client/retry-axios.js +1 -1
- package/dist/es/index.js +4 -6
- package/dist/es/utils/app-config/config.js +1 -1
- package/dist/es/utils/helpers.js +1 -1
- package/dist/es/utils/testing/render-with-router-redux.js +2 -2
- package/dist/es/utils/testing/render-with-router.js +9 -6
- package/dist/es/view/app-root/index.js +2 -2
- package/dist/es/view/app-router.js +19 -0
- package/dist/es/view/fields/check-box/index.js +1 -1
- package/dist/es/view/fields/combo-box/index.js +1 -1
- package/dist/es/view/fields/date-input/index.js +1 -1
- package/dist/es/view/fields/date-picker/index.js +1 -1
- package/dist/es/view/fields/form-item-layout/index.js +1 -1
- package/dist/es/view/fields/input-mask/index.js +2 -1
- package/dist/es/view/fields/large-text-box/index.js +1 -1
- package/dist/es/view/fields/radio/index.js +1 -1
- package/dist/es/view/fields/radio-group/index.js +1 -1
- package/dist/es/view/fields/text-box/index.js +1 -1
- package/dist/es/view/form/submit-button/index.js +1 -1
- package/dist/es/view/login/index.js +1 -2
- package/dist/es/view/media-breakpoint/index.js +1 -2
- package/dist/es/view/micro-app/app-factory/index.js +1 -1
- package/dist/es/view/micro-app/resources/script.js +1 -1
- package/dist/es/view/modals/error/index.js +1 -1
- package/dist/es/view/modals/navigation-prompt/index.js +1 -1
- package/dist/es/view/modals/session-expiry/index.js +1 -1
- package/dist/es/view/modals/wait-message/html-wait-message.js +1 -2
- package/dist/es/view/modals/wait-message/index.js +1 -1
- package/dist/es/view/modals/wait-message/wait-message-launcher.js +1 -2
- package/dist/es/{route/page-view.js → view/page.js} +7 -0
- package/dist/es/view/render-with-delay/index.js +1 -1
- package/dist/es/view/require-auth.js +33 -0
- package/dist/es/view/window-size/index.js +1 -2
- package/dist/types/data/react-redux.d.ts +2 -2
- package/dist/types/data/store.d.ts +2 -2
- package/dist/types/index.d.ts +2 -3
- package/dist/types/utils/app-config/config.d.ts +1 -1
- package/dist/types/utils/history.d.ts +2 -2
- package/dist/types/utils/micro-frontend/guest.d.ts +2 -2
- package/dist/types/utils/micro-frontend/host.d.ts +2 -2
- package/dist/types/utils/testing/render-with-redux.d.ts +3 -3
- package/dist/types/utils/testing/render-with-router-redux.d.ts +3 -3
- package/dist/types/utils/testing/render-with-router.d.ts +2 -2
- package/dist/types/view/app-router.d.ts +9 -0
- package/dist/types/view/page.d.ts +8 -0
- package/dist/types/view/require-auth.d.ts +8 -0
- package/package.json +24 -26
- package/dist/cjs/route/index.js +0 -55
- package/dist/cjs/view/header/center-region/index.js +0 -71
- package/dist/cjs/view/header/index.js +0 -50
- package/dist/cjs/view/header/logo-region/index.js +0 -39
- package/dist/cjs/view/header/logo-region/logo.svg +0 -2
- package/dist/cjs/view/header/nav-region/index.js +0 -53
- package/dist/cjs/view/header/nav-region/notification/index.js +0 -38
- package/dist/cjs/view/header/nav-region/notification/index.svg +0 -5
- package/dist/cjs/view/header/nav-region/user/index.svg +0 -4
- package/dist/es/route/index.js +0 -26
- package/dist/es/route/private-route/index.js +0 -46
- package/dist/es/view/header/center-region/index.js +0 -42
- package/dist/es/view/header/index.js +0 -21
- package/dist/es/view/header/logo-region/index.js +0 -10
- package/dist/es/view/header/logo-region/logo.svg +0 -2
- package/dist/es/view/header/nav-region/index.js +0 -24
- package/dist/es/view/header/nav-region/notification/index.js +0 -9
- package/dist/es/view/header/nav-region/notification/index.svg +0 -5
- package/dist/es/view/header/nav-region/user/index.js +0 -9
- package/dist/es/view/header/nav-region/user/index.svg +0 -4
- package/dist/types/route/index.d.ts +0 -8
- package/dist/types/route/page-view.d.ts +0 -1
- package/dist/types/route/private-route/index.d.ts +0 -8
- package/dist/types/view/header/center-region/index.d.ts +0 -9
- package/dist/types/view/header/index.d.ts +0 -7
- package/dist/types/view/header/index.stories.d.ts +0 -5
- package/dist/types/view/header/logo-region/index.d.ts +0 -2
- package/dist/types/view/header/nav-region/index.d.ts +0 -2
- package/dist/types/view/header/nav-region/notification/index.d.ts +0 -2
- package/dist/types/view/header/nav-region/user/index.d.ts +0 -2
|
@@ -39,6 +39,6 @@ const RenderWithDelay = (0, import_react.memo)(({ render }) => {
|
|
|
39
39
|
clearTimeout(timeoutId);
|
|
40
40
|
};
|
|
41
41
|
}, []);
|
|
42
|
-
return
|
|
42
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, show ? render() : "");
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(render_with_delay_exports);
|
|
@@ -25,51 +25,38 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
|
25
25
|
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
26
|
};
|
|
27
27
|
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var
|
|
29
|
-
__export(
|
|
30
|
-
|
|
28
|
+
var require_auth_exports = {};
|
|
29
|
+
__export(require_auth_exports, {
|
|
30
|
+
RequireAuth: () => RequireAuth
|
|
31
31
|
});
|
|
32
32
|
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = require("react");
|
|
34
33
|
var import_redux_injectors = require("redux-injectors");
|
|
35
|
-
var import_constants = __toESM(require("
|
|
36
|
-
var import_render_with_delay = require("
|
|
37
|
-
var import_reducer = require("
|
|
38
|
-
var import_auth = require("
|
|
39
|
-
var import_login = require("
|
|
40
|
-
var import_auth2 = require("
|
|
41
|
-
var import__ = require("../index.js");
|
|
34
|
+
var import_constants = __toESM(require("../utils/constants.js"));
|
|
35
|
+
var import_render_with_delay = require("./render-with-delay/index.js");
|
|
36
|
+
var import_reducer = require("../data/auth/reducer.js");
|
|
37
|
+
var import_auth = require("../sideeffect/auth/index.js");
|
|
38
|
+
var import_login = require("./login/index.js");
|
|
39
|
+
var import_auth2 = require("../utils/auth/index.js");
|
|
42
40
|
const key = "auth";
|
|
43
|
-
const
|
|
44
|
-
component: Component,
|
|
45
|
-
render,
|
|
41
|
+
const RequireAuth = ({
|
|
46
42
|
children,
|
|
47
43
|
clientId = import_constants.default.CLIENT_ID,
|
|
48
44
|
scope = "loc",
|
|
49
|
-
responseType = "code"
|
|
50
|
-
...rest
|
|
45
|
+
responseType = "code"
|
|
51
46
|
}) => {
|
|
52
47
|
(0, import_redux_injectors.useInjectReducer)({ key, reducer: import_reducer.authReducer });
|
|
53
48
|
(0, import_redux_injectors.useInjectSaga)({ key, saga: import_auth.authentication });
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
clientId,
|
|
66
|
-
scope,
|
|
67
|
-
responseType
|
|
68
|
-
});
|
|
69
|
-
return /* @__PURE__ */ React.createElement(import_render_with_delay.RenderWithDelay, {
|
|
70
|
-
render: getAuthComp
|
|
71
|
-
});
|
|
72
|
-
}
|
|
49
|
+
const userAuthorized = (0, import_auth2.isUserAuthorized)();
|
|
50
|
+
if (userAuthorized) {
|
|
51
|
+
return children;
|
|
52
|
+
}
|
|
53
|
+
const renderLogin = () => /* @__PURE__ */ React.createElement(import_login.Login, {
|
|
54
|
+
clientId,
|
|
55
|
+
scope,
|
|
56
|
+
responseType
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ React.createElement(import_render_with_delay.RenderWithDelay, {
|
|
59
|
+
render: renderLogin
|
|
73
60
|
});
|
|
74
61
|
};
|
|
75
|
-
module.exports = __toCommonJS(
|
|
62
|
+
module.exports = __toCommonJS(require_auth_exports);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,9 +15,6 @@ var __reExport = (target, module2, copyDefault, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return target;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
18
|
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
19
|
return (module2, temp) => {
|
|
25
20
|
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
@@ -29,7 +24,6 @@ var window_size_exports = {};
|
|
|
29
24
|
__export(window_size_exports, {
|
|
30
25
|
WindowSize: () => WindowSize
|
|
31
26
|
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
27
|
var import_react = require("react");
|
|
34
28
|
var import_pubsub_js = require("pubsub-js");
|
|
35
29
|
var import_constants = require("../../utils/constants.js");
|
|
@@ -47,6 +41,6 @@ const WindowSize = () => {
|
|
|
47
41
|
return () => {
|
|
48
42
|
};
|
|
49
43
|
}, []);
|
|
50
|
-
return
|
|
44
|
+
return null;
|
|
51
45
|
};
|
|
52
46
|
module.exports = __toCommonJS(window_size_exports);
|
|
@@ -64,7 +64,7 @@ const onError = (err) => {
|
|
|
64
64
|
return Promise.reject(err);
|
|
65
65
|
}
|
|
66
66
|
const onBackoffPromise = new Promise((resolve) => {
|
|
67
|
-
const delay = (
|
|
67
|
+
const delay = (2 ** config.currentRetryAttempt - 1) / 2 * 1e3;
|
|
68
68
|
err.config.retryConfig.currentRetryAttempt += 1;
|
|
69
69
|
setTimeout(resolve, delay);
|
|
70
70
|
});
|
package/dist/es/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isUserAuthorized, login, authorize } from "./utils/auth/index.js";
|
|
2
|
-
import { PrivateRoute } from "./route/private-route/index.js";
|
|
3
|
-
import { AppRoute } from "./route/index.js";
|
|
4
2
|
import {
|
|
5
3
|
getHTTPClient,
|
|
6
4
|
getAuthHTTPClient
|
|
7
5
|
} from "./communication/http-client/index.js";
|
|
8
6
|
import { onAuthorizationFailure } from "./communication/http-client/response-interceptor.js";
|
|
9
7
|
import { auth } from "./data/auth/actions.js";
|
|
8
|
+
import { RequireAuth } from "./view/require-auth.js";
|
|
9
|
+
import { Page } from "./view/page.js";
|
|
10
10
|
import { default as default2 } from "./utils/constants.js";
|
|
11
11
|
import { useAppDispatch, useAppSelector } from "./data/react-redux.js";
|
|
12
12
|
import { useInjectReducer, useInjectSaga } from "redux-injectors";
|
|
@@ -64,7 +64,6 @@ import { getApiActionCreator, getSelectField } from "./api/helpers.js";
|
|
|
64
64
|
import { getUser } from "./api/users/index.js";
|
|
65
65
|
import { useMediaBreakpoints } from "./view/useMediaBreakpoints/index.js";
|
|
66
66
|
import { withAppDecorator } from "./view/storybook/decorator.js";
|
|
67
|
-
import { Header } from "./view/header/index.js";
|
|
68
67
|
import { ErrorToast } from "./view/error-toast/index.js";
|
|
69
68
|
import { Form } from "./view/form/index.js";
|
|
70
69
|
import { ConnectForm } from "./view/fields/connect-form.js";
|
|
@@ -111,7 +110,6 @@ export {
|
|
|
111
110
|
Form,
|
|
112
111
|
FormItemLayout,
|
|
113
112
|
FormSubmitButton,
|
|
114
|
-
Header,
|
|
115
113
|
InputMask,
|
|
116
114
|
LargeTextBox,
|
|
117
115
|
MASK_PIPES,
|
|
@@ -120,12 +118,12 @@ export {
|
|
|
120
118
|
MicroApp,
|
|
121
119
|
MicroIFrameApp,
|
|
122
120
|
ACTIONS as NavigationPromptActions,
|
|
123
|
-
|
|
121
|
+
Page,
|
|
124
122
|
Radio,
|
|
125
123
|
RadioGroup,
|
|
126
124
|
RegisterService,
|
|
127
125
|
RenderWithStateAddOns,
|
|
128
|
-
|
|
126
|
+
RequireAuth,
|
|
129
127
|
SessionTimeout,
|
|
130
128
|
TextBox,
|
|
131
129
|
Themes,
|
|
@@ -4,7 +4,7 @@ const setAppConfig = (config) => {
|
|
|
4
4
|
gAppConfig = config;
|
|
5
5
|
};
|
|
6
6
|
const getAppConfigValue = (key = "", defaultValue = null) => _.clone(_.get(gAppConfig, key, defaultValue));
|
|
7
|
-
const setAppConfigValue = (key
|
|
7
|
+
const setAppConfigValue = (key, value) => _.set(gAppConfig, key, value);
|
|
8
8
|
const hasItem = (key = "") => _.has(gAppConfig, key);
|
|
9
9
|
export {
|
|
10
10
|
getAppConfigValue,
|
package/dist/es/utils/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const isProd = () => false;
|
|
2
2
|
const isCIBuild = () => process.env.CI === "true";
|
|
3
|
-
const PROTOCOL =
|
|
3
|
+
const PROTOCOL = /^(?:[a-z]+:)?/;
|
|
4
4
|
const convertRelativeToAbsoluteUrl = (url) => {
|
|
5
5
|
if (!PROTOCOL.test(url)) {
|
|
6
6
|
return new URL(url, document.location.origin).href;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
3
|
import { Provider } from "react-redux";
|
|
4
|
-
import { Router } from "react-router-dom";
|
|
5
4
|
import { createMemoryHistory } from "history";
|
|
6
5
|
import { createAppStore } from "../../data/store.js";
|
|
7
6
|
import { browserHistory } from "../history.js";
|
|
7
|
+
import { AppRouter } from "../../view/app-router.js";
|
|
8
8
|
const renderWithRouterRedux = (ui, {
|
|
9
9
|
route = "/",
|
|
10
10
|
history = createMemoryHistory({ initialEntries: [route] }),
|
|
@@ -13,7 +13,7 @@ const renderWithRouterRedux = (ui, {
|
|
|
13
13
|
} = {}) => ({
|
|
14
14
|
...render(/* @__PURE__ */ React.createElement(Provider, {
|
|
15
15
|
store
|
|
16
|
-
}, /* @__PURE__ */ React.createElement(
|
|
16
|
+
}, /* @__PURE__ */ React.createElement(AppRouter, {
|
|
17
17
|
history
|
|
18
18
|
}, ui))),
|
|
19
19
|
store
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
|
-
import { Router } from "react-router-dom";
|
|
4
3
|
import { createMemoryHistory } from "history";
|
|
4
|
+
import { AppRouter } from "../../view/app-router.js";
|
|
5
5
|
const renderWithRouter = (ui, {
|
|
6
6
|
route = "/",
|
|
7
7
|
history = createMemoryHistory({ initialEntries: [route] })
|
|
8
|
-
} = {}) =>
|
|
9
|
-
|
|
8
|
+
} = {}) => {
|
|
9
|
+
const renderResult = render(/* @__PURE__ */ React.createElement(AppRouter, {
|
|
10
10
|
history
|
|
11
|
-
}, ui))
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
}, ui));
|
|
12
|
+
return {
|
|
13
|
+
...renderResult,
|
|
14
|
+
history
|
|
15
|
+
};
|
|
16
|
+
};
|
|
14
17
|
export {
|
|
15
18
|
renderWithRouter
|
|
16
19
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Provider } from "react-redux";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { Router } from "react-router-dom";
|
|
5
4
|
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
6
5
|
import { useInjectSaga } from "redux-injectors";
|
|
6
|
+
import { AppRouter } from "../app-router.js";
|
|
7
7
|
import { isStandAloneGuest, isHost } from "../../utils/micro-frontend/index.js";
|
|
8
8
|
import { waitMessage } from "../../sideeffect/wait-message/index.js";
|
|
9
9
|
import { errorToast } from "../../sideeffect/error-toast/index.js";
|
|
@@ -32,7 +32,7 @@ const AppRoot = ({
|
|
|
32
32
|
errorTemplate
|
|
33
33
|
}, /* @__PURE__ */ React.createElement(Provider, {
|
|
34
34
|
store
|
|
35
|
-
}, /* @__PURE__ */ React.createElement(
|
|
35
|
+
}, /* @__PURE__ */ React.createElement(AppRouter, {
|
|
36
36
|
history
|
|
37
37
|
}, /* @__PURE__ */ React.createElement(ThemeProvider, {
|
|
38
38
|
theme
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useState, useLayoutEffect } from "react";
|
|
3
|
+
import { Router } from "react-router-dom";
|
|
4
|
+
const AppRouter = ({ history, ...props }) => {
|
|
5
|
+
const [state, setState] = useState({
|
|
6
|
+
action: history.action,
|
|
7
|
+
location: history.location
|
|
8
|
+
});
|
|
9
|
+
useLayoutEffect(() => history.listen(setState), [history]);
|
|
10
|
+
return /* @__PURE__ */ React.createElement(Router, {
|
|
11
|
+
...props,
|
|
12
|
+
location: state.location,
|
|
13
|
+
navigationType: state.action,
|
|
14
|
+
navigator: history
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
AppRouter
|
|
19
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import DSFormItemLayout from "@elliemae/ds-form/FormItem";
|
|
2
|
+
import { DSFormItemLayout } from "@elliemae/ds-form/FormItem";
|
|
3
3
|
import { get } from "react-hook-form";
|
|
4
4
|
import { ConnectForm } from "../connect-form.js";
|
|
5
5
|
const FormItemLayout = ({
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { useEffect } from "react";
|
|
3
2
|
import { useAppDispatch } from "../../data/react-redux.js";
|
|
4
3
|
import { login } from "../../utils/auth/index.js";
|
|
@@ -15,7 +14,7 @@ const Login = ({
|
|
|
15
14
|
}).catch(() => {
|
|
16
15
|
});
|
|
17
16
|
}, [dispatch, clientId, scope, responseType]);
|
|
18
|
-
return
|
|
17
|
+
return null;
|
|
19
18
|
};
|
|
20
19
|
export {
|
|
21
20
|
Login
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { useEffect, useContext } from "react";
|
|
3
2
|
import { ThemeContext } from "styled-components";
|
|
4
3
|
import { publish } from "pubsub-js";
|
|
@@ -18,7 +17,7 @@ const MediaBreakpoint = () => {
|
|
|
18
17
|
dispatch({ type: breakpoint.change, payload: currentBreakpoint });
|
|
19
18
|
publish(HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
|
|
20
19
|
}, [currentBreakpoint, dispatch]);
|
|
21
|
-
return
|
|
20
|
+
return null;
|
|
22
21
|
};
|
|
23
22
|
export {
|
|
24
23
|
MediaBreakpoint
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getAppManifest,
|
|
21
21
|
getFullFileNameofAssetsFromManifest
|
|
22
22
|
} from "../resources/manifest.js";
|
|
23
|
-
const cssType =
|
|
23
|
+
const cssType = /\.css$/;
|
|
24
24
|
const isCss = (fileName) => cssType.test(fileName);
|
|
25
25
|
const activeApps = {};
|
|
26
26
|
const initApplication = async ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { removeDoubleSlash } from "../../../utils/url.js";
|
|
2
2
|
const APP_SCRIPT_ID_PREFIX = "emui-script-";
|
|
3
|
-
const HEAD_SCRIPTS =
|
|
3
|
+
const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/;
|
|
4
4
|
const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
|
|
5
5
|
const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) => new Promise((resolve, reject) => {
|
|
6
6
|
const ele = documentEle.createElement("script");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { memo } from "react";
|
|
3
|
-
import DSModal,
|
|
3
|
+
import { DSModal, MODAL_TYPE } from "@elliemae/ds-modal";
|
|
4
4
|
import { useAppDispatch } from "../../../data/react-redux.js";
|
|
5
5
|
import { navigationPrompt } from "../../../data/navigation-prompt/actions.js";
|
|
6
6
|
const NavigationPrompt = memo(({ open, showHeader = false }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { memo, useEffect, useState } from "react";
|
|
3
|
-
import DSModal,
|
|
3
|
+
import { DSModal, MODAL_SUB_TYPE_V2, MODAL_TYPE_V2 } from "@elliemae/ds-modal";
|
|
4
4
|
import { useAppDispatch } from "../../../data/react-redux.js";
|
|
5
5
|
import { logout } from "../../../data/logout/actions.js";
|
|
6
6
|
import { resetUserIdleTime } from "../../../utils/session.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { memo, useEffect } from "react";
|
|
3
2
|
const HTMLWaitMessage = memo(({ close }) => {
|
|
4
3
|
useEffect(() => {
|
|
@@ -6,7 +5,7 @@ const HTMLWaitMessage = memo(({ close }) => {
|
|
|
6
5
|
if (htmlWaitMsgElement && close)
|
|
7
6
|
htmlWaitMsgElement.remove();
|
|
8
7
|
}, [close]);
|
|
9
|
-
return
|
|
8
|
+
return null;
|
|
10
9
|
});
|
|
11
10
|
export {
|
|
12
11
|
HTMLWaitMessage
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { memo, useEffect } from "react";
|
|
3
|
-
import DSLoadingIndicator from "@elliemae/ds-loading-indicator";
|
|
3
|
+
import { DSLoadingIndicator } from "@elliemae/ds-loading-indicator";
|
|
4
4
|
import { useAppSelector } from "../../../data/react-redux.js";
|
|
5
5
|
import { HTMLWaitMessage } from "./html-wait-message.js";
|
|
6
6
|
import {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { useEffect } from "react";
|
|
3
2
|
import { useAppDispatch } from "../../../data/react-redux.js";
|
|
4
3
|
import { waitMessage } from "../../../data/wait-message/actions.js";
|
|
@@ -10,7 +9,7 @@ const WaitMessageLauncher = () => {
|
|
|
10
9
|
dispatch(waitMessage.close());
|
|
11
10
|
};
|
|
12
11
|
}, [dispatch]);
|
|
13
|
-
return
|
|
12
|
+
return null;
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
15
|
WaitMessageLauncher
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Helmet } from "react-helmet";
|
|
1
3
|
import * as brum from "@elliemae/pui-user-monitoring";
|
|
2
4
|
import { pageViewEvent } from "../analytics/page-view-event.js";
|
|
3
5
|
const onPageView = (pageTitle) => {
|
|
@@ -10,6 +12,11 @@ const onPageView = (pageTitle) => {
|
|
|
10
12
|
}
|
|
11
13
|
pageViewEvent({ pageTitle });
|
|
12
14
|
};
|
|
15
|
+
const Page = ({ pageTitle = "ICE", children }) => {
|
|
16
|
+
onPageView(pageTitle);
|
|
17
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Helmet, null, /* @__PURE__ */ React.createElement("title", null, pageTitle)), children);
|
|
18
|
+
};
|
|
13
19
|
export {
|
|
20
|
+
Page,
|
|
14
21
|
onPageView
|
|
15
22
|
};
|
|
@@ -8,7 +8,7 @@ const RenderWithDelay = memo(({ render }) => {
|
|
|
8
8
|
clearTimeout(timeoutId);
|
|
9
9
|
};
|
|
10
10
|
}, []);
|
|
11
|
-
return
|
|
11
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, show ? render() : "");
|
|
12
12
|
});
|
|
13
13
|
export {
|
|
14
14
|
RenderWithDelay
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useInjectReducer, useInjectSaga } from "redux-injectors";
|
|
3
|
+
import enums from "../utils/constants.js";
|
|
4
|
+
import { RenderWithDelay } from "./render-with-delay/index.js";
|
|
5
|
+
import { authReducer } from "../data/auth/reducer.js";
|
|
6
|
+
import { authentication } from "../sideeffect/auth/index.js";
|
|
7
|
+
import { Login } from "./login/index.js";
|
|
8
|
+
import { isUserAuthorized } from "../utils/auth/index.js";
|
|
9
|
+
const key = "auth";
|
|
10
|
+
const RequireAuth = ({
|
|
11
|
+
children,
|
|
12
|
+
clientId = enums.CLIENT_ID,
|
|
13
|
+
scope = "loc",
|
|
14
|
+
responseType = "code"
|
|
15
|
+
}) => {
|
|
16
|
+
useInjectReducer({ key, reducer: authReducer });
|
|
17
|
+
useInjectSaga({ key, saga: authentication });
|
|
18
|
+
const userAuthorized = isUserAuthorized();
|
|
19
|
+
if (userAuthorized) {
|
|
20
|
+
return children;
|
|
21
|
+
}
|
|
22
|
+
const renderLogin = () => /* @__PURE__ */ React.createElement(Login, {
|
|
23
|
+
clientId,
|
|
24
|
+
scope,
|
|
25
|
+
responseType
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ React.createElement(RenderWithDelay, {
|
|
28
|
+
render: renderLogin
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
RequireAuth
|
|
33
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { useEffect } from "react";
|
|
3
2
|
import { publish } from "pubsub-js";
|
|
4
3
|
import { HOST_WINDOW_RESIZED } from "../../utils/constants.js";
|
|
@@ -16,7 +15,7 @@ const WindowSize = () => {
|
|
|
16
15
|
return () => {
|
|
17
16
|
};
|
|
18
17
|
}, []);
|
|
19
|
-
return
|
|
18
|
+
return null;
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
21
|
WindowSize
|
|
@@ -6,12 +6,12 @@ export declare const useAppDispatch: () => import("redux").Dispatch<{
|
|
|
6
6
|
} | import("redux").AnyAction | {
|
|
7
7
|
payload: import("./breakpoint/index.js").Breakpoints;
|
|
8
8
|
type: string;
|
|
9
|
-
}> & import("
|
|
9
|
+
}> & import("..").ThunkDispatch<import("redux").CombinedState<{
|
|
10
10
|
waitMessage: import("./wait-message/reducer.js").WaitMessageState;
|
|
11
11
|
error: import("./error/index.js").ErrorState;
|
|
12
12
|
breakpoint: import("./breakpoint/index.js").BreakpointState;
|
|
13
13
|
liveMessage: import("./live-message/index.js").LiveMessageState;
|
|
14
|
-
}>, null, import("redux").AnyAction> & import("
|
|
14
|
+
}>, null, import("redux").AnyAction> & import("..").ThunkDispatch<import("redux").CombinedState<{
|
|
15
15
|
waitMessage: import("./wait-message/reducer.js").WaitMessageState;
|
|
16
16
|
error: import("./error/index.js").ErrorState;
|
|
17
17
|
breakpoint: import("./breakpoint/index.js").BreakpointState;
|
|
@@ -33,12 +33,12 @@ export declare const createAppStore: (initialState: import("redux").CombinedStat
|
|
|
33
33
|
} | import("redux").AnyAction | {
|
|
34
34
|
payload: import("./breakpoint/index.js").Breakpoints;
|
|
35
35
|
type: string;
|
|
36
|
-
}, import("@reduxjs/toolkit").MiddlewareArray<import("redux-saga").SagaMiddleware<object> | import("
|
|
36
|
+
}, import("@reduxjs/toolkit").MiddlewareArray<import("redux-saga").SagaMiddleware<object> | import("..").ThunkMiddleware<import("redux").CombinedState<{
|
|
37
37
|
waitMessage: import("./wait-message/reducer.js").WaitMessageState;
|
|
38
38
|
error: import("./error/index.js").ErrorState;
|
|
39
39
|
breakpoint: import("./breakpoint/index.js").BreakpointState;
|
|
40
40
|
liveMessage: import("./live-message/index.js").LiveMessageState;
|
|
41
|
-
}>, import("redux").AnyAction, null> | import("
|
|
41
|
+
}>, import("redux").AnyAction, null> | import("..").ThunkMiddleware<import("redux").CombinedState<{
|
|
42
42
|
waitMessage: import("./wait-message/reducer.js").WaitMessageState;
|
|
43
43
|
error: import("./error/index.js").ErrorState;
|
|
44
44
|
breakpoint: import("./breakpoint/index.js").BreakpointState;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { isUserAuthorized, login, authorize } from './utils/auth/index.js';
|
|
2
|
-
export { PrivateRoute } from './route/private-route/index.js';
|
|
3
|
-
export { AppRoute as Route } from './route/index.js';
|
|
4
2
|
export { getHTTPClient, getAuthHTTPClient, } from './communication/http-client/index.js';
|
|
5
3
|
export { onAuthorizationFailure } from './communication/http-client/response-interceptor.js';
|
|
6
4
|
export { auth } from './data/auth/actions.js';
|
|
5
|
+
export { RequireAuth } from './view/require-auth.js';
|
|
6
|
+
export { Page } from './view/page.js';
|
|
7
7
|
export { default as globalConstants } from './utils/constants.js';
|
|
8
8
|
export { useAppDispatch, useAppSelector } from './data/react-redux.js';
|
|
9
9
|
export { useInjectReducer, useInjectSaga } from 'redux-injectors';
|
|
@@ -43,7 +43,6 @@ export { getApiActionCreator, getSelectField } from './api/helpers.js';
|
|
|
43
43
|
export { getUser as fetchUserSettings } from './api/users/index.js';
|
|
44
44
|
export { useMediaBreakpoints } from './view/useMediaBreakpoints/index.js';
|
|
45
45
|
export { withAppDecorator } from './view/storybook/decorator.js';
|
|
46
|
-
export { Header } from './view/header/index.js';
|
|
47
46
|
export { ErrorToast } from './view/error-toast/index.js';
|
|
48
47
|
export { Form } from './view/form/index.js';
|
|
49
48
|
export { ConnectForm } from './view/fields/connect-form.js';
|
|
@@ -21,6 +21,6 @@ export interface AppConfig {
|
|
|
21
21
|
}
|
|
22
22
|
export declare const setAppConfig: (config: AppConfig) => void;
|
|
23
23
|
export declare const getAppConfigValue: <Type>(key?: string, defaultValue?: unknown) => Type;
|
|
24
|
-
export declare const setAppConfigValue: <Type>(key: string
|
|
24
|
+
export declare const setAppConfigValue: <Type>(key: string, value: Type) => AppConfig;
|
|
25
25
|
export declare const hasItem: (key?: string) => boolean;
|
|
26
26
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const browserHistory: import("history").
|
|
2
|
-
export declare const memoryHistory: import("history").MemoryHistory
|
|
1
|
+
export declare const browserHistory: import("history").BrowserHistory;
|
|
2
|
+
export declare const memoryHistory: import("history").MemoryHistory;
|