@elliemae/pui-app-sdk 3.0.0-beta.10 → 3.0.0-beta.14

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.
Files changed (218) hide show
  1. package/dist/cjs/analytics/appdynamics.js +13 -7
  2. package/dist/cjs/analytics/index.js +13 -12
  3. package/dist/cjs/analytics/page-view-event.js +11 -10
  4. package/dist/cjs/analytics/user-session-event.js +12 -11
  5. package/dist/cjs/analytics/user-wait-event.js +11 -10
  6. package/dist/cjs/analytics/web-analytics.js +19 -2
  7. package/dist/cjs/api/auth/index.js +11 -10
  8. package/dist/cjs/api/helpers.js +12 -11
  9. package/dist/cjs/api/users/index.js +11 -10
  10. package/dist/cjs/communication/http-client/index.js +18 -12
  11. package/dist/cjs/communication/http-client/request-interceptor.js +11 -10
  12. package/dist/cjs/communication/http-client/response-interceptor.js +13 -7
  13. package/dist/cjs/communication/http-client/retry-axios.js +14 -8
  14. package/dist/cjs/communication/http-client/retry.js +11 -10
  15. package/dist/cjs/communication/http-client/tests/index.test-disable.js +7 -7
  16. package/dist/cjs/data/auth/actions.js +19 -2
  17. package/dist/cjs/data/auth/reducer.js +14 -8
  18. package/dist/cjs/data/breakpoint/index.js +13 -7
  19. package/dist/cjs/data/error/index.js +11 -10
  20. package/dist/cjs/data/index.js +13 -12
  21. package/dist/cjs/data/live-message/index.js +11 -10
  22. package/dist/cjs/data/logout/actions.js +19 -2
  23. package/dist/cjs/data/navigation-prompt/actions.js +19 -2
  24. package/dist/cjs/data/react-redux.js +11 -10
  25. package/dist/cjs/data/reducers.js +15 -14
  26. package/dist/cjs/data/saga.js +19 -2
  27. package/dist/cjs/data/store.js +16 -22
  28. package/dist/cjs/data/wait-message/actions.js +19 -2
  29. package/dist/cjs/data/wait-message/reducer.js +14 -8
  30. package/dist/cjs/index.js +87 -83
  31. package/dist/cjs/micro-frontend.js +14 -13
  32. package/dist/cjs/sideeffect/auth/index.js +15 -14
  33. package/dist/cjs/sideeffect/error-toast/index.js +15 -14
  34. package/dist/cjs/sideeffect/wait-message/index.js +15 -14
  35. package/dist/cjs/typings/styled.d.js +1 -19
  36. package/dist/cjs/utils/app-config/config.js +14 -8
  37. package/dist/cjs/utils/app-config/index.js +17 -11
  38. package/dist/cjs/utils/app-host-integration/react.js +11 -10
  39. package/dist/cjs/utils/auth/helper.js +13 -7
  40. package/dist/cjs/utils/auth/index.js +19 -18
  41. package/dist/cjs/utils/await.js +18 -1
  42. package/dist/cjs/utils/constants.js +19 -2
  43. package/dist/cjs/utils/font-size.js +19 -2
  44. package/dist/cjs/utils/guest-with-service.js +19 -2
  45. package/dist/cjs/utils/helpers.js +20 -3
  46. package/dist/cjs/utils/history.js +11 -10
  47. package/dist/cjs/utils/log-records.js +19 -2
  48. package/dist/cjs/utils/micro-frontend/console-logger.js +12 -11
  49. package/dist/cjs/utils/micro-frontend/guest.js +25 -19
  50. package/dist/cjs/utils/micro-frontend/host.js +30 -29
  51. package/dist/cjs/utils/micro-frontend/index.js +17 -11
  52. package/dist/cjs/utils/micro-frontend/types.js +18 -1
  53. package/dist/cjs/utils/redact-pii.js +19 -2
  54. package/dist/cjs/utils/service-worker.js +12 -11
  55. package/dist/cjs/utils/session.js +15 -14
  56. package/dist/cjs/utils/storybook/manager.js +12 -11
  57. package/dist/cjs/utils/storybook/preview.js +17 -16
  58. package/dist/cjs/utils/storybook/theme.js +11 -10
  59. package/dist/cjs/utils/testing/index.js +19 -13
  60. package/dist/cjs/utils/testing/render-with-redux.js +17 -11
  61. package/dist/cjs/utils/testing/render-with-router-redux.js +20 -14
  62. package/dist/cjs/utils/testing/render-with-router.js +24 -15
  63. package/dist/cjs/utils/testing/render-with-state-addons.js +17 -11
  64. package/dist/cjs/utils/types.js +18 -1
  65. package/dist/cjs/utils/url.js +19 -2
  66. package/dist/cjs/utils/web-storage.js +13 -7
  67. package/dist/cjs/utils/window.js +11 -10
  68. package/dist/cjs/view/app-root/hosted-app.js +18 -12
  69. package/dist/cjs/view/app-root/index.js +25 -19
  70. package/dist/cjs/view/app-root/stand-alone-app.js +22 -16
  71. package/dist/cjs/view/app-root/style.js +11 -10
  72. package/dist/cjs/view/app-router.js +48 -0
  73. package/dist/cjs/view/error-boundary/default-error-template.js +13 -7
  74. package/dist/cjs/view/error-boundary/index.js +16 -10
  75. package/dist/cjs/view/error-toast/index.js +17 -11
  76. package/dist/cjs/view/fetch-host-app-data/index.js +16 -10
  77. package/dist/cjs/view/fetch-host-app-data/store.js +11 -10
  78. package/dist/cjs/view/fields/check-box/index.js +16 -10
  79. package/dist/cjs/view/fields/combo-box/index.js +16 -10
  80. package/dist/cjs/view/fields/connect-form.js +11 -10
  81. package/dist/cjs/view/fields/date-input/index.js +16 -10
  82. package/dist/cjs/view/fields/date-picker/index.js +16 -10
  83. package/dist/cjs/view/fields/form-item-layout/index.js +17 -11
  84. package/dist/cjs/view/fields/input-mask/index.js +16 -10
  85. package/dist/cjs/view/fields/large-text-box/index.js +16 -10
  86. package/dist/cjs/view/fields/radio/index.js +16 -10
  87. package/dist/cjs/view/fields/radio-group/index.js +16 -10
  88. package/dist/cjs/view/fields/text-box/index.js +16 -10
  89. package/dist/cjs/view/fields/watch-value.js +15 -9
  90. package/dist/cjs/view/form/index.js +15 -9
  91. package/dist/cjs/view/form/personal-info-section.js +18 -12
  92. package/dist/cjs/view/form/submit-button/index.js +16 -10
  93. package/dist/cjs/view/guest-unload-handlers/index.js +11 -10
  94. package/dist/cjs/view/host-binding-events/index.js +19 -2
  95. package/dist/cjs/view/live-message/index.js +15 -9
  96. package/dist/cjs/view/loadable/index.js +15 -9
  97. package/dist/cjs/view/login/index.js +15 -15
  98. package/dist/cjs/view/media-breakpoint/index.js +18 -18
  99. package/dist/cjs/view/message-to-host-app/index.js +11 -10
  100. package/dist/cjs/view/micro-app/app-factory/index.js +20 -19
  101. package/dist/cjs/view/micro-app/const.js +19 -2
  102. package/dist/cjs/view/micro-app/index.js +17 -11
  103. package/dist/cjs/view/micro-app/resources/manifest.js +14 -13
  104. package/dist/cjs/view/micro-app/resources/script.js +12 -11
  105. package/dist/cjs/view/micro-app/resources/style.js +11 -10
  106. package/dist/cjs/view/micro-app/types.js +18 -1
  107. package/dist/cjs/view/micro-app/use-app-will-render.js +17 -16
  108. package/dist/cjs/view/micro-app/utils.js +11 -10
  109. package/dist/cjs/view/micro-iframe-app/app.js +18 -12
  110. package/dist/cjs/view/micro-iframe-app/iframe/const.js +19 -2
  111. package/dist/cjs/view/micro-iframe-app/iframe/index.js +16 -10
  112. package/dist/cjs/view/micro-iframe-app/index.js +16 -10
  113. package/dist/cjs/view/micro-iframe-app/types.js +18 -1
  114. package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +16 -15
  115. package/dist/cjs/view/modals/error/index.js +16 -10
  116. package/dist/cjs/view/modals/navigation-prompt/index.js +18 -12
  117. package/dist/cjs/view/modals/session-expiry/customHooks.js +14 -13
  118. package/dist/cjs/view/modals/session-expiry/index.js +24 -15
  119. package/dist/cjs/view/modals/wait-message/html-wait-message.js +12 -12
  120. package/dist/cjs/view/modals/wait-message/index.js +19 -13
  121. package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +14 -14
  122. package/dist/cjs/view/page.js +51 -0
  123. package/dist/cjs/view/render-with-delay/index.js +15 -9
  124. package/dist/cjs/view/render-with-host-data/index.js +16 -10
  125. package/dist/cjs/view/require-auth.js +62 -0
  126. package/dist/cjs/view/session-timeout/index.js +23 -13
  127. package/dist/cjs/view/storybook/decorator.js +15 -9
  128. package/dist/cjs/view/use-previous.js +11 -10
  129. package/dist/cjs/view/useMediaBreakpoints/index.js +11 -10
  130. package/dist/cjs/view/visually-hidden/index.js +15 -9
  131. package/dist/cjs/view/window-size/index.js +14 -14
  132. package/dist/es/communication/http-client/retry-axios.js +1 -1
  133. package/dist/es/data/store.js +3 -12
  134. package/dist/es/index.js +4 -6
  135. package/dist/es/utils/app-config/config.js +1 -1
  136. package/dist/es/utils/helpers.js +1 -1
  137. package/dist/es/utils/micro-frontend/guest.js +1 -1
  138. package/dist/es/utils/micro-frontend/host.js +5 -4
  139. package/dist/es/utils/session.js +2 -2
  140. package/dist/es/utils/testing/render-with-router-redux.js +2 -2
  141. package/dist/es/utils/testing/render-with-router.js +9 -6
  142. package/dist/es/view/app-root/index.js +2 -2
  143. package/dist/es/view/app-router.js +19 -0
  144. package/dist/es/view/fields/check-box/index.js +1 -1
  145. package/dist/es/view/fields/combo-box/index.js +1 -1
  146. package/dist/es/view/fields/date-input/index.js +1 -1
  147. package/dist/es/view/fields/date-picker/index.js +1 -1
  148. package/dist/es/view/fields/form-item-layout/index.js +1 -1
  149. package/dist/es/view/fields/input-mask/index.js +2 -1
  150. package/dist/es/view/fields/large-text-box/index.js +1 -1
  151. package/dist/es/view/fields/radio/index.js +1 -1
  152. package/dist/es/view/fields/radio-group/index.js +1 -1
  153. package/dist/es/view/fields/text-box/index.js +1 -1
  154. package/dist/es/view/form/submit-button/index.js +1 -1
  155. package/dist/es/view/login/index.js +1 -2
  156. package/dist/es/view/media-breakpoint/index.js +1 -2
  157. package/dist/es/view/micro-app/app-factory/index.js +1 -1
  158. package/dist/es/view/micro-app/resources/script.js +1 -1
  159. package/dist/es/view/micro-iframe-app/use-frame-loaded.js +2 -2
  160. package/dist/es/view/modals/error/index.js +1 -1
  161. package/dist/es/view/modals/navigation-prompt/index.js +1 -1
  162. package/dist/es/view/modals/session-expiry/index.js +6 -3
  163. package/dist/es/view/modals/wait-message/html-wait-message.js +1 -2
  164. package/dist/es/view/modals/wait-message/index.js +1 -1
  165. package/dist/es/view/modals/wait-message/wait-message-launcher.js +1 -2
  166. package/dist/es/{route/page-view.js → view/page.js} +7 -0
  167. package/dist/es/view/render-with-delay/index.js +1 -1
  168. package/dist/es/view/require-auth.js +33 -0
  169. package/dist/es/view/session-timeout/index.js +5 -1
  170. package/dist/es/view/window-size/index.js +1 -2
  171. package/dist/types/data/react-redux.d.ts +9 -9
  172. package/dist/types/data/store.d.ts +2 -2
  173. package/dist/types/index.d.ts +2 -3
  174. package/dist/types/utils/app-config/config.d.ts +1 -1
  175. package/dist/types/utils/history.d.ts +2 -2
  176. package/dist/types/utils/micro-frontend/guest.d.ts +2 -2
  177. package/dist/types/utils/micro-frontend/host.d.ts +2 -2
  178. package/dist/types/utils/session.d.ts +5 -2
  179. package/dist/types/utils/testing/render-with-redux.d.ts +3 -3
  180. package/dist/types/utils/testing/render-with-router-redux.d.ts +3 -3
  181. package/dist/types/utils/testing/render-with-router.d.ts +2 -2
  182. package/dist/types/view/app-router.d.ts +9 -0
  183. package/dist/types/view/page.d.ts +8 -0
  184. package/dist/types/view/require-auth.d.ts +8 -0
  185. package/package.json +28 -30
  186. package/dist/cjs/route/index.js +0 -49
  187. package/dist/cjs/route/page-view.js +0 -38
  188. package/dist/cjs/route/private-route/index.js +0 -69
  189. package/dist/cjs/view/header/center-region/index.js +0 -65
  190. package/dist/cjs/view/header/index.js +0 -44
  191. package/dist/cjs/view/header/logo-region/index.js +0 -33
  192. package/dist/cjs/view/header/logo-region/logo.svg +0 -2
  193. package/dist/cjs/view/header/nav-region/index.js +0 -47
  194. package/dist/cjs/view/header/nav-region/notification/index.js +0 -32
  195. package/dist/cjs/view/header/nav-region/notification/index.svg +0 -5
  196. package/dist/cjs/view/header/nav-region/user/index.js +0 -32
  197. package/dist/cjs/view/header/nav-region/user/index.svg +0 -4
  198. package/dist/es/route/index.js +0 -26
  199. package/dist/es/route/private-route/index.js +0 -46
  200. package/dist/es/view/header/center-region/index.js +0 -42
  201. package/dist/es/view/header/index.js +0 -21
  202. package/dist/es/view/header/logo-region/index.js +0 -10
  203. package/dist/es/view/header/logo-region/logo.svg +0 -2
  204. package/dist/es/view/header/nav-region/index.js +0 -24
  205. package/dist/es/view/header/nav-region/notification/index.js +0 -9
  206. package/dist/es/view/header/nav-region/notification/index.svg +0 -5
  207. package/dist/es/view/header/nav-region/user/index.js +0 -9
  208. package/dist/es/view/header/nav-region/user/index.svg +0 -4
  209. package/dist/types/route/index.d.ts +0 -8
  210. package/dist/types/route/page-view.d.ts +0 -1
  211. package/dist/types/route/private-route/index.d.ts +0 -8
  212. package/dist/types/view/header/center-region/index.d.ts +0 -9
  213. package/dist/types/view/header/index.d.ts +0 -7
  214. package/dist/types/view/header/index.stories.d.ts +0 -5
  215. package/dist/types/view/header/logo-region/index.d.ts +0 -2
  216. package/dist/types/view/header/nav-region/index.d.ts +0 -2
  217. package/dist/types/view/header/nav-region/notification/index.d.ts +0 -2
  218. package/dist/types/view/header/nav-region/user/index.d.ts +0 -2
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
- PrivateRoute,
121
+ Page,
124
122
  Radio,
125
123
  RadioGroup,
126
124
  RegisterService,
127
125
  RenderWithStateAddOns,
128
- AppRoute as Route,
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 = "", value) => _.set(gAppConfig, key, value);
7
+ const setAppConfigValue = (key, value) => _.set(gAppConfig, key, value);
8
8
  const hasItem = (key = "") => _.has(gAppConfig, key);
9
9
  export {
10
10
  getAppConfigValue,
@@ -1,6 +1,6 @@
1
1
  const isProd = () => false;
2
2
  const isCIBuild = () => process.env.CI === "true";
3
- const PROTOCOL = new RegExp("^(?:[a-z]+:)?//", "i");
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;
@@ -82,7 +82,7 @@ class CMicroAppGuest {
82
82
  if (!isCrossDomain()) {
83
83
  host = window.parent?.emui?.MicroAppHost || null;
84
84
  } else if (ssfGuest && this.props.hostName) {
85
- ssfGuest.connect();
85
+ await ssfGuest.connect();
86
86
  const timeout = new Promise((resolve) => {
87
87
  setTimeout(resolve, 100, null);
88
88
  });
@@ -14,6 +14,7 @@ import {
14
14
  HOST_WINDOW_BREAKPOINT_CHANGED
15
15
  } from "../constants.js";
16
16
  import {
17
+ getWindow,
17
18
  getCurrentBreakpoint,
18
19
  getViewportSize as getWindowViewportSize
19
20
  } from "../window.js";
@@ -64,10 +65,10 @@ class CMicroAppHost {
64
65
  return this.logger;
65
66
  }
66
67
  getItem(key) {
67
- return window.parent.sessionStorage.getItem(key);
68
+ return getWindow().sessionStorage.getItem(key);
68
69
  }
69
70
  setItem(key, value) {
70
- window.parent.sessionStorage.setItem(key, value);
71
+ getWindow().sessionStorage.setItem(key, value);
71
72
  }
72
73
  getGuests() {
73
74
  return this.activeGuests;
@@ -104,10 +105,10 @@ class CMicroAppHost {
104
105
  store.dispatch(error.set({ description: message }));
105
106
  }
106
107
  getAuthToken() {
107
- return window.parent.sessionStorage.getItem("Authorization");
108
+ return getWindow().sessionStorage.getItem("Authorization");
108
109
  }
109
110
  renewAuthToken() {
110
- return window.parent.sessionStorage.getItem("Authorization");
111
+ return getWindow().sessionStorage.getItem("Authorization");
111
112
  }
112
113
  logout() {
113
114
  const store = getStore();
@@ -10,12 +10,12 @@ const userInteractionEvents = ["click", "scroll", "keypress", "touchstart"];
10
10
  let sessionExpiryWarningNotified = false;
11
11
  let timerHandle;
12
12
  let sessionExpiryWarningNotifiedAt;
13
- const resetUserIdleTime = () => {
13
+ const resetUserIdleTime = (resetWarningModal = false) => {
14
14
  sessionExpiryWarningNotified = false;
15
15
  sessionExpiryWarningNotifiedAt = null;
16
16
  lastUserActivityTimeStamp = Date.now();
17
17
  Promise.resolve().then(() => {
18
- resetListeners.forEach((listener) => listener());
18
+ resetListeners.forEach((listener) => listener(resetWarningModal));
19
19
  }).catch(() => {
20
20
  });
21
21
  };
@@ -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(Router, {
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
- ...render(/* @__PURE__ */ React.createElement(Router, {
8
+ } = {}) => {
9
+ const renderResult = render(/* @__PURE__ */ React.createElement(AppRouter, {
10
10
  history
11
- }, ui)),
12
- history
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(Router, {
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 DSCheckbox, { CHECKBOX_VARIANT } from "@elliemae/ds-form/Checkbox";
2
+ import { DSCheckbox, CHECKBOX_VARIANT } from "@elliemae/ds-form/Checkbox";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import DSComboBox from "@elliemae/ds-form/ComboBox";
2
+ import { DSComboBox } from "@elliemae/ds-form/ComboBox";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import DSDateInput from "@elliemae/ds-form/DateInput";
2
+ import { DSDateInput } from "@elliemae/ds-form/DateInput";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import DSDatePicker from "@elliemae/ds-date-picker";
2
+ import { DSDatePicker } from "@elliemae/ds-date-picker";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -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,5 +1,6 @@
1
1
  import * as React from "react";
2
- import DSInputMask, {
2
+ import {
3
+ DSInputMask,
3
4
  MASK_TYPES,
4
5
  MASK_PIPES
5
6
  } from "@elliemae/ds-form/InputMask";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import DSLargeInputText from "@elliemae/ds-form/LargeInputText";
2
+ import { DSLargeInputText } from "@elliemae/ds-form/LargeInputText";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import DSRadio from "@elliemae/ds-form/Radio";
2
+ import { DSRadio } from "@elliemae/ds-form/Radio";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import DSRadioGroup from "@elliemae/ds-form/RadioGroup";
2
+ import { DSRadioGroup } from "@elliemae/ds-form/RadioGroup";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import DSTextBox from "@elliemae/ds-form/TextBox";
2
+ import { DSTextBox } from "@elliemae/ds-form/TextBox";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useFormContext } from "react-hook-form";
3
- import DSButton from "@elliemae/ds-button";
3
+ import { DSButton } from "@elliemae/ds-button";
4
4
  const FormSubmitButton = ({
5
5
  ...rest
6
6
  }) => {
@@ -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 /* @__PURE__ */ React.createElement(React.Fragment, null);
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 /* @__PURE__ */ React.createElement(React.Fragment, null);
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 = new RegExp(/\.css$/);
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 = new RegExp("/(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js", "i");
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");
@@ -6,8 +6,8 @@ const addBaseTag = (id, documentEle) => {
6
6
  const { hostUrl, manifestPath } = getMicroFrontEndAppConfig({
7
7
  id
8
8
  });
9
- if (!manifestPath)
10
- return;
9
+ if (!hostUrl || !manifestPath)
10
+ throw new Error("hostUrl or manifestPath is not defined");
11
11
  const base = documentEle.createElement("base");
12
12
  base.href = new URL(manifestPath, hostUrl).href;
13
13
  documentEle.getElementsByTagName("head")[0].appendChild(base);
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useState } from "react";
3
- import DSModal, { MODAL_TYPE } from "@elliemae/ds-modal";
3
+ import { DSModal, MODAL_TYPE } from "@elliemae/ds-modal";
4
4
  const Error = ({
5
5
  open,
6
6
  name,
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { memo } from "react";
3
- import DSModal, { MODAL_TYPE } from "@elliemae/ds-modal";
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
- import { memo, useState } from "react";
3
- import DSModal, { MODAL_SUB_TYPE_V2, MODAL_TYPE_V2 } from "@elliemae/ds-modal";
2
+ import { memo, useEffect, useState } from "react";
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";
@@ -9,9 +9,12 @@ const SessionExpiry = memo(({ open, warningNotifiedAt = 0, showHeader = false })
9
9
  const [isOpen, setIsOpen] = useState(open);
10
10
  const timeLeft = useTrackSessionExpiry(warningNotifiedAt);
11
11
  const dispatch = useAppDispatch();
12
+ useEffect(() => {
13
+ setIsOpen(open);
14
+ }, [open]);
12
15
  const resetSession = () => {
13
16
  setIsOpen(false);
14
- resetUserIdleTime();
17
+ resetUserIdleTime(true);
15
18
  dispatch(logout.cancel());
16
19
  };
17
20
  const logoutSession = () => {
@@ -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 /* @__PURE__ */ React.createElement(React.Fragment, null);
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 /* @__PURE__ */ React.createElement(React.Fragment, null);
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 show ? /* @__PURE__ */ React.createElement(React.Fragment, null, render()) : /* @__PURE__ */ React.createElement(React.Fragment, null);
11
+ return show ? /* @__PURE__ */ React.createElement(React.Fragment, null, render()) : null;
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
+ };
@@ -22,7 +22,11 @@ const SessionTimeout = () => {
22
22
  setwarningNotifiedAt(sessionExpiryWarningNotifiedAt);
23
23
  setSessionExpiryWarning(true);
24
24
  });
25
- const resetCb = subscribeToResetSession(setSessionExpiryWarning.bind(null, false));
25
+ const resetCb = subscribeToResetSession((resetWarningModal) => {
26
+ if (resetWarningModal === true) {
27
+ setSessionExpiryWarning(false);
28
+ }
29
+ });
26
30
  const sessionExpiredCb = subscribeToSessionExpiry(() => {
27
31
  dispatch(logout.confirm());
28
32
  setSessionExpiryWarning(false);
@@ -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 /* @__PURE__ */ React.createElement(React.Fragment, null);
18
+ return null;
20
19
  };
21
20
  export {
22
21
  WindowSize
@@ -1,20 +1,20 @@
1
1
  import { TypedUseSelectorHook } from 'react-redux';
2
2
  import { RootState } from './store.js';
3
- export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<import("redux").CombinedState<{
3
+ export declare const useAppDispatch: () => import("redux").Dispatch<{
4
+ payload: import("./wait-message/reducer.js").WaitMessageState;
5
+ type: string;
6
+ } | import("redux").AnyAction | {
7
+ payload: import("./breakpoint/index.js").Breakpoints;
8
+ type: string;
9
+ }> & import("..").ThunkDispatch<import("redux").CombinedState<{
4
10
  waitMessage: import("./wait-message/reducer.js").WaitMessageState;
5
11
  error: import("./error/index.js").ErrorState;
6
12
  breakpoint: import("./breakpoint/index.js").BreakpointState;
7
13
  liveMessage: import("./live-message/index.js").LiveMessageState;
8
- }>, null, import("redux").AnyAction> & import("redux-thunk").ThunkDispatch<import("redux").CombinedState<{
14
+ }>, null, import("redux").AnyAction> & import("..").ThunkDispatch<import("redux").CombinedState<{
9
15
  waitMessage: import("./wait-message/reducer.js").WaitMessageState;
10
16
  error: import("./error/index.js").ErrorState;
11
17
  breakpoint: import("./breakpoint/index.js").BreakpointState;
12
18
  liveMessage: import("./live-message/index.js").LiveMessageState;
13
- }>, undefined, import("redux").AnyAction> & import("redux").Dispatch<{
14
- payload: import("./wait-message/reducer.js").WaitMessageState;
15
- type: string;
16
- } | import("redux").AnyAction | {
17
- payload: import("./breakpoint/index.js").Breakpoints;
18
- type: string;
19
- }>;
19
+ }>, undefined, import("redux").AnyAction>;
20
20
  export declare const useAppSelector: TypedUseSelectorHook<RootState>;
@@ -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("redux-thunk").ThunkMiddleware<import("redux").CombinedState<{
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("redux-thunk").ThunkMiddleware<import("redux").CombinedState<{
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;
@@ -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 | undefined, value: Type) => AppConfig;
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").History<unknown>;
2
- export declare const memoryHistory: import("history").MemoryHistory<unknown>;
1
+ export declare const browserHistory: import("history").BrowserHistory;
2
+ export declare const memoryHistory: import("history").MemoryHistory;
@@ -1,5 +1,5 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
- import { History, Path } from 'history';
2
+ import { History, To } from 'history';
3
3
  import type { IMicroAppGuest, IMicroAppHost, InitOptions, MountOptions } from '@elliemae/pui-micro-frontend-base';
4
4
  import { MicroFrontEndLogger } from './console-logger.js';
5
5
  import { JSONValue } from '../types.js';
@@ -42,6 +42,6 @@ export declare class CMicroAppGuest implements IMicroAppGuest {
42
42
  mount(this: CMicroAppGuest, options?: MountOptions): Promise<void>;
43
43
  unmount(this: CMicroAppGuest, options: MountOptions): Promise<JSONValue>;
44
44
  getRef<T>(this: CMicroAppGuest): T | null;
45
- navigate(this: CMicroAppGuest, url: Path, state?: any): void;
45
+ navigate(this: CMicroAppGuest, url: To, state?: any): void;
46
46
  }
47
47
  export {};