@elliemae/pui-app-sdk 3.15.0 → 4.0.0-alpha.10

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 (182) hide show
  1. package/dist/cjs/analytics/appdynamics.js +4 -1
  2. package/dist/cjs/api/auth/index.js +8 -2
  3. package/dist/cjs/api/helpers.js +7 -1
  4. package/dist/cjs/api/users/index.js +3 -1
  5. package/dist/cjs/app.config.json +42 -25
  6. package/dist/cjs/communication/http-client/index.js +4 -1
  7. package/dist/cjs/communication/http-client/response-interceptor.js +4 -1
  8. package/dist/cjs/communication/http-client/retry-axios.js +4 -1
  9. package/dist/cjs/data/auth/reducer.js +14 -8
  10. package/dist/cjs/data/breakpoint/index.js +4 -1
  11. package/dist/cjs/data/index.js +1 -0
  12. package/dist/cjs/data/store.js +10 -2
  13. package/dist/cjs/data/wait-message/reducer.js +4 -1
  14. package/dist/cjs/index.js +5 -1
  15. package/dist/cjs/sideeffect/error-toast/index.js +3 -1
  16. package/dist/cjs/sideeffect/wait-message/index.js +6 -2
  17. package/dist/cjs/utils/app-config/config.js +6 -2
  18. package/dist/cjs/utils/app-config/index.js +12 -4
  19. package/dist/cjs/utils/auth/helper.js +4 -1
  20. package/dist/cjs/utils/auth/index.js +3 -1
  21. package/dist/cjs/utils/micro-frontend/guest.js +8 -7
  22. package/dist/cjs/utils/micro-frontend/host.js +9 -3
  23. package/dist/cjs/utils/micro-frontend/index.js +27 -10
  24. package/dist/cjs/utils/micro-frontend/ssfguest-adapter.js +9 -2
  25. package/dist/cjs/utils/redact-pii.js +8 -2
  26. package/dist/cjs/utils/session.js +14 -4
  27. package/dist/cjs/utils/storybook/cjs/webpack.js +1 -4
  28. package/dist/cjs/utils/storybook/preview.js +1 -1
  29. package/dist/cjs/utils/testing/index.js +5 -7
  30. package/dist/cjs/utils/testing/render-with-redux.js +5 -7
  31. package/dist/cjs/utils/testing/render-with-router-redux.js +10 -9
  32. package/dist/cjs/utils/testing/render-with-router.js +5 -7
  33. package/dist/cjs/utils/testing/render-with-state-addons.js +7 -9
  34. package/dist/cjs/utils/web-storage.js +4 -1
  35. package/dist/cjs/utils/window.js +10 -2
  36. package/dist/cjs/view/app-root/hosted-app.js +13 -3
  37. package/dist/cjs/view/app-root/index.js +24 -19
  38. package/dist/cjs/view/app-root/stand-alone-app.js +17 -3
  39. package/dist/cjs/view/app-router.js +2 -5
  40. package/dist/cjs/view/breakpoint/use-breakpoint.js +9 -5
  41. package/dist/cjs/view/breakpoint/use-media-query-list.js +3 -1
  42. package/dist/cjs/view/error-boundary/default-error-template.js +14 -5
  43. package/dist/cjs/view/error-boundary/index.js +6 -2
  44. package/dist/cjs/view/error-toast/index.js +2 -5
  45. package/dist/cjs/view/fetch-host-app-data/index.js +4 -1
  46. package/dist/cjs/view/fields/autocomplete/index.js +9 -9
  47. package/dist/cjs/view/fields/check-box/index.js +3 -6
  48. package/dist/cjs/view/fields/combo-box/index.js +3 -6
  49. package/dist/cjs/view/fields/combo-box-v3/index.js +3 -6
  50. package/dist/cjs/view/fields/date-input/index.js +3 -6
  51. package/dist/cjs/view/fields/date-picker/index.js +7 -4
  52. package/dist/cjs/view/fields/date-range-picker/index.js +10 -9
  53. package/dist/cjs/view/fields/date-time-picker/index.js +3 -6
  54. package/dist/cjs/view/fields/form-item-layout/index.js +15 -16
  55. package/dist/cjs/view/fields/form-layout-block-item/index.js +16 -17
  56. package/dist/cjs/view/fields/input-mask/index.js +3 -6
  57. package/dist/cjs/view/fields/input-text/index.js +3 -6
  58. package/dist/cjs/view/fields/large-text-box/index.js +3 -6
  59. package/dist/cjs/view/fields/radio/index.js +3 -6
  60. package/dist/cjs/view/fields/radio-group/index.js +3 -6
  61. package/dist/cjs/view/fields/text-box/index.js +3 -6
  62. package/dist/cjs/view/fields/toggle/index.js +3 -6
  63. package/dist/cjs/view/fields/watch-value.js +25 -3
  64. package/dist/cjs/view/form/index.js +13 -8
  65. package/dist/cjs/view/form/personal-info-section.js +54 -47
  66. package/dist/cjs/view/form/submit-button/index.js +2 -5
  67. package/dist/cjs/view/live-message/index.js +2 -5
  68. package/dist/cjs/view/loadable/index.js +8 -10
  69. package/dist/cjs/view/login/index.js +4 -5
  70. package/dist/cjs/view/micro-app/app-factory/index.js +9 -3
  71. package/dist/cjs/view/micro-app/index.js +6 -3
  72. package/dist/cjs/view/micro-app/resources/manifest.js +10 -3
  73. package/dist/cjs/view/micro-app/resources/script.js +24 -15
  74. package/dist/cjs/view/micro-app/resources/style.js +20 -11
  75. package/dist/cjs/view/micro-app/use-app-will-render.js +37 -28
  76. package/dist/cjs/view/micro-iframe-app/app.js +24 -19
  77. package/dist/cjs/view/micro-iframe-app/iframe/index.js +22 -15
  78. package/dist/cjs/view/micro-iframe-app/index.js +2 -5
  79. package/dist/cjs/view/modals/error/index.js +21 -12
  80. package/dist/cjs/view/modals/navigation-prompt/index.js +46 -27
  81. package/dist/cjs/view/modals/session-expiry/customHooks.js +6 -2
  82. package/dist/cjs/view/modals/session-expiry/index.js +57 -35
  83. package/dist/cjs/view/modals/wait-message/index.js +26 -27
  84. package/dist/cjs/view/page.js +15 -3
  85. package/dist/cjs/view/render-with-delay/index.js +4 -5
  86. package/dist/cjs/view/render-with-host-data/index.js +2 -5
  87. package/dist/cjs/view/require-auth.js +22 -10
  88. package/dist/cjs/view/session-timeout/index.js +15 -14
  89. package/dist/cjs/view/storybook/decorator.js +5 -7
  90. package/dist/cjs/view/visually-hidden/index.js +11 -6
  91. package/dist/esm/api/auth/index.js +8 -2
  92. package/dist/esm/api/helpers.js +7 -1
  93. package/dist/esm/api/users/index.js +3 -1
  94. package/dist/esm/app.config.json +42 -25
  95. package/dist/esm/data/auth/reducer.js +10 -7
  96. package/dist/esm/data/index.js +6 -1
  97. package/dist/esm/data/store.js +6 -1
  98. package/dist/esm/index.js +6 -1
  99. package/dist/esm/sideeffect/error-toast/index.js +3 -1
  100. package/dist/esm/sideeffect/wait-message/index.js +6 -2
  101. package/dist/esm/utils/app-config/config.js +2 -1
  102. package/dist/esm/utils/app-config/index.js +8 -3
  103. package/dist/esm/utils/auth/index.js +3 -1
  104. package/dist/esm/utils/micro-frontend/guest.js +4 -6
  105. package/dist/esm/utils/micro-frontend/host.js +9 -3
  106. package/dist/esm/utils/micro-frontend/index.js +23 -9
  107. package/dist/esm/utils/micro-frontend/ssfguest-adapter.js +5 -1
  108. package/dist/esm/utils/redact-pii.js +8 -2
  109. package/dist/esm/utils/session.js +14 -4
  110. package/dist/esm/utils/storybook/preview.js +1 -1
  111. package/dist/esm/utils/testing/index.js +5 -4
  112. package/dist/esm/utils/testing/render-with-redux.js +5 -4
  113. package/dist/esm/utils/testing/render-with-router-redux.js +10 -6
  114. package/dist/esm/utils/testing/render-with-router.js +5 -4
  115. package/dist/esm/utils/testing/render-with-state-addons.js +7 -6
  116. package/dist/esm/utils/window.js +10 -2
  117. package/dist/esm/view/app-root/hosted-app.js +9 -2
  118. package/dist/esm/view/app-root/index.js +24 -16
  119. package/dist/esm/view/app-root/stand-alone-app.js +13 -2
  120. package/dist/esm/view/app-router.js +2 -2
  121. package/dist/esm/view/breakpoint/use-breakpoint.js +9 -5
  122. package/dist/esm/view/breakpoint/use-media-query-list.js +3 -1
  123. package/dist/esm/view/error-boundary/default-error-template.js +14 -2
  124. package/dist/esm/view/error-boundary/index.js +2 -1
  125. package/dist/esm/view/error-toast/index.js +2 -2
  126. package/dist/esm/view/fields/autocomplete/index.js +9 -6
  127. package/dist/esm/view/fields/check-box/index.js +3 -3
  128. package/dist/esm/view/fields/combo-box/index.js +3 -3
  129. package/dist/esm/view/fields/combo-box-v3/index.js +3 -3
  130. package/dist/esm/view/fields/date-input/index.js +3 -3
  131. package/dist/esm/view/fields/date-picker/index.js +3 -3
  132. package/dist/esm/view/fields/date-range-picker/index.js +10 -6
  133. package/dist/esm/view/fields/date-time-picker/index.js +3 -3
  134. package/dist/esm/view/fields/form-item-layout/index.js +15 -13
  135. package/dist/esm/view/fields/form-layout-block-item/index.js +16 -14
  136. package/dist/esm/view/fields/input-mask/index.js +3 -3
  137. package/dist/esm/view/fields/input-text/index.js +3 -3
  138. package/dist/esm/view/fields/large-text-box/index.js +3 -3
  139. package/dist/esm/view/fields/radio/index.js +3 -3
  140. package/dist/esm/view/fields/radio-group/index.js +3 -3
  141. package/dist/esm/view/fields/text-box/index.js +3 -3
  142. package/dist/esm/view/fields/toggle/index.js +3 -3
  143. package/dist/esm/view/fields/watch-value.js +21 -2
  144. package/dist/esm/view/form/index.js +9 -7
  145. package/dist/esm/view/form/personal-info-section.js +50 -46
  146. package/dist/esm/view/form/submit-button/index.js +2 -2
  147. package/dist/esm/view/live-message/index.js +2 -2
  148. package/dist/esm/view/loadable/index.js +8 -7
  149. package/dist/esm/view/login/index.js +4 -2
  150. package/dist/esm/view/micro-app/app-factory/index.js +9 -3
  151. package/dist/esm/view/micro-app/index.js +2 -2
  152. package/dist/esm/view/micro-app/resources/manifest.js +10 -3
  153. package/dist/esm/view/micro-app/resources/script.js +24 -15
  154. package/dist/esm/view/micro-app/resources/style.js +20 -11
  155. package/dist/esm/view/micro-app/use-app-will-render.js +37 -28
  156. package/dist/esm/view/micro-iframe-app/app.js +20 -18
  157. package/dist/esm/view/micro-iframe-app/iframe/index.js +18 -14
  158. package/dist/esm/view/micro-iframe-app/index.js +2 -2
  159. package/dist/esm/view/modals/error/index.js +21 -9
  160. package/dist/esm/view/modals/navigation-prompt/index.js +46 -24
  161. package/dist/esm/view/modals/session-expiry/customHooks.js +6 -2
  162. package/dist/esm/view/modals/session-expiry/index.js +57 -32
  163. package/dist/esm/view/modals/wait-message/index.js +26 -24
  164. package/dist/esm/view/page.js +11 -2
  165. package/dist/esm/view/render-with-delay/index.js +4 -2
  166. package/dist/esm/view/render-with-host-data/index.js +2 -2
  167. package/dist/esm/view/require-auth.js +19 -10
  168. package/dist/esm/view/session-timeout/index.js +15 -11
  169. package/dist/esm/view/storybook/decorator.js +5 -4
  170. package/dist/esm/view/visually-hidden/index.js +7 -5
  171. package/dist/types/lib/data/index.d.ts +1 -1
  172. package/dist/types/lib/index.d.ts +2 -2
  173. package/dist/types/lib/utils/app-config/config.d.ts +5 -7
  174. package/dist/types/lib/utils/app-config/index.d.ts +1 -1
  175. package/dist/types/lib/utils/micro-frontend/host.d.ts +1 -1
  176. package/dist/types/lib/utils/window.d.ts +3 -0
  177. package/dist/types/lib/view/error-boundary/default-error-template.d.ts +1 -1
  178. package/dist/types/lib/view/error-boundary/index.d.ts +2 -1
  179. package/dist/types/lib/view/fields/form-item-layout/index.d.ts +1 -1
  180. package/dist/types/lib/view/micro-app/resources/script.d.ts +1 -1
  181. package/dist/types/lib/view/micro-app/resources/style.d.ts +2 -2
  182. package/package.json +45 -42
@@ -3,6 +3,7 @@ import { getHTTPClient } from "../../communication/http-client/index.js";
3
3
  import { setAppConfig } from "./config.js";
4
4
  import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
5
5
  import { updateBAEventParameters } from "../../analytics/web-analytics.js";
6
+ import { getAssetPath } from "../window.js";
6
7
  const parseAppConfig = (data) => {
7
8
  const { activeEnv } = data;
8
9
  const activeEnvConfig = data.env[activeEnv] || {};
@@ -13,12 +14,16 @@ const parseAppConfig = (data) => {
13
14
  setAppDynamicsUserData({ envName: activeEnv });
14
15
  updateBAEventParameters({ envName: activeEnv });
15
16
  };
16
- const loadAppConfig = (hostUrl = "./") => new Promise((resolve, reject) => {
17
- getHTTPClient({ baseURL: hostUrl }).get("app.config.json").then(({ data }) => {
17
+ const loadAppConfig = (assetPath = "") => new Promise((resolve, reject) => {
18
+ getHTTPClient().get(`${assetPath || getAssetPath()}app.config.json`).then(({ data }) => {
18
19
  parseAppConfig(data);
19
20
  resolve();
20
21
  }).catch((err) => {
21
- reject(new Error(`Unable to load application configurtion file. ${err.Message}`));
22
+ reject(
23
+ new Error(
24
+ `Unable to load application configurtion file. ${err.Message}`
25
+ )
26
+ );
22
27
  });
23
28
  });
24
29
  export {
@@ -35,7 +35,9 @@ const navigateToLoginPage = ({
35
35
  response_type: responseType,
36
36
  scope
37
37
  };
38
- const searchParams = new URLSearchParams(idpErrorCode ? Object.assign(idpOptions, { error_code: idpErrorCode }) : idpOptions);
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
  };
@@ -1,4 +1,3 @@
1
- import ReactDOM from "react-dom";
2
1
  import _ from "lodash";
3
2
  import { getDefaultTheme } from "@elliemae/pui-theme";
4
3
  import { getWindow } from "../window.js";
@@ -100,7 +99,7 @@ class CMicroAppGuest {
100
99
  this.props.host = host;
101
100
  }
102
101
  __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
103
- return loadAppConfig(__webpack_public_path__).then(() => {
102
+ return loadAppConfig().then(() => {
104
103
  const instanceId = this.getSessionStorageItem("instanceId") || "";
105
104
  const userId = this.getSessionStorageItem("userId") || "";
106
105
  updateBAEventParameters({ appId: this.appId, instanceId, userId });
@@ -117,11 +116,10 @@ class CMicroAppGuest {
117
116
  });
118
117
  }
119
118
  unmount(options) {
120
- const appEle = document.getElementById(this.containerId);
121
- if (appEle)
122
- ReactDOM.unmountComponentAtNode(appEle);
123
119
  removeStorageEvents();
124
- return Promise.resolve().then(() => this.onUnmount ? this.onUnmount(options) : null);
120
+ return Promise.resolve().then(
121
+ () => this.onUnmount ? this.onUnmount(options) : null
122
+ );
125
123
  }
126
124
  getRef() {
127
125
  return this.onGetRef ? this.onGetRef() : null;
@@ -41,7 +41,7 @@ class CMicroAppHost {
41
41
  this.getObject = this.getObject.bind(this);
42
42
  this.renewSessionTimer = this.renewSessionTimer.bind(this);
43
43
  this.setSystemVersion = this.setSystemVersion.bind(this);
44
- loadAppConfig(__webpack_public_path__).then(() => {
44
+ loadAppConfig().then(() => {
45
45
  if (this.onInit)
46
46
  this.onInit(this.props);
47
47
  }).catch(() => {
@@ -129,10 +129,16 @@ class CMicroAppHost {
129
129
  return getWindowViewportSize();
130
130
  }
131
131
  onResizeEvent(eventHandler) {
132
- return subscribe(HOST_WINDOW_RESIZED, (msg, data) => eventHandler(data));
132
+ return subscribe(
133
+ HOST_WINDOW_RESIZED,
134
+ (msg, data) => eventHandler(data)
135
+ );
133
136
  }
134
137
  onBreakpointChangeEvent(eventHandler) {
135
- return subscribe(HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
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(/{SYSTEM_VERSION}/, majorMinorVersion && majorMinorVersion[0] || "latest");
20
+ return path.replace(
21
+ /{SYSTEM_VERSION}/,
22
+ majorMinorVersion && majorMinorVersion[0] || "latest"
23
+ );
21
24
  };
22
25
  const getMicroFrontEndAppConfig = (appInfo) => {
23
- const microFEAppConfig = getAppConfigValue(`microFrontendApps.${appInfo.id}`);
26
+ const microFEAppConfig = getAppConfigValue(
27
+ `microFrontendApps.${appInfo.id}`
28
+ );
24
29
  if (!microFEAppConfig)
25
- throw new Error(`unable to locate application configuraiton for ${appInfo.id} under microFrontendApps section of app.config.json`);
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(appInfo, {
33
- mode: "production",
34
- hostUrl: "./",
35
- manifestPath: "./{SYSTEM_VERSION}"
36
- }, microFEAppConfig, envConfig);
37
- microFEConfig.hostUrl = convertRelativeToAbsoluteUrl(microFEConfig.hostUrl.replace(/\/?$/, "/"));
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(objectId, eventName || "", callback);
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(`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`, "gi"),
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((redactedString, piiPattern) => redactedString.replace(piiPattern, "****"), value);
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(resetUserIdleTime, THROTTLING_TIME, { leading: true });
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((listener) => listener(sessionExpiryWarningNotifiedAt));
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((r) => element.addEventListener(r, thorttledCb));
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((r) => element.removeEventListener(r, thorttledCb));
93
+ userInteractionEvents.forEach(
94
+ (r) => element.removeEventListener(r, thorttledCb)
95
+ );
86
96
  };
87
97
  };
88
98
  export {
@@ -41,7 +41,7 @@ const getParameters = (storyBookTheme) => ({
41
41
  const decorators = [appDecorator];
42
42
  const loaders = [
43
43
  async () => {
44
- await loadAppConfig(__webpack_public_path__ || "./");
44
+ await loadAppConfig("/");
45
45
  }
46
46
  ];
47
47
  export {
@@ -1,4 +1,4 @@
1
- import * as React from "react";
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__ */ React.createElement(AppRoot, {
13
+ }) => /* @__PURE__ */ jsx(AppRoot, {
14
14
  store,
15
15
  history: browserHistory,
16
- theme
17
- }, children);
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 * as React from "react";
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__ */ React.createElement(Provider, {
11
- store
12
- }, ui)),
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 * as React from "react";
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(/* @__PURE__ */ React.createElement(Provider, {
15
- store
16
- }, /* @__PURE__ */ React.createElement(AppRouter, {
17
- history
18
- }, ui))),
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 * as React from "react";
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__ */ React.createElement(AppRouter, {
10
- history
11
- }, ui));
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 * as React from "react";
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__ */ React.createElement(ThemeProvider, {
31
- theme
32
- }, /* @__PURE__ */ React.createElement(Component, {
33
- ...rest
34
- })) : null;
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
@@ -8,8 +8,14 @@ const getWindow = () => {
8
8
  }
9
9
  };
10
10
  const getViewportSize = () => ({
11
- width: Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),
12
- height: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
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 = () => {
@@ -21,7 +27,9 @@ const getCurrentBreakpoint = () => {
21
27
  return "medium";
22
28
  return "large";
23
29
  };
30
+ const getAssetPath = () => window?.emui?._ASSET_PATH || "latest/";
24
31
  export {
32
+ getAssetPath,
25
33
  getCurrentBreakpoint,
26
34
  getViewportSize,
27
35
  getWindow
@@ -1,4 +1,4 @@
1
- import * as React from "react";
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__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children);
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,5 @@
1
- import * as React from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { StrictMode } from "react";
2
3
  import { Provider } from "react-redux";
3
4
  import { ThemeProvider } from "styled-components";
4
5
  import { getDefaultTheme } from "@elliemae/pui-theme";
@@ -9,9 +10,9 @@ import { StandAloneApp } from "./stand-alone-app.js";
9
10
  import { HostedApp } from "./hosted-app.js";
10
11
  const AppToRender = (props) => {
11
12
  const isParent = isStandAloneGuest() || isHost();
12
- return isParent ? /* @__PURE__ */ React.createElement(StandAloneApp, {
13
+ return isParent ? /* @__PURE__ */ jsx(StandAloneApp, {
13
14
  ...props
14
- }) : /* @__PURE__ */ React.createElement(HostedApp, {
15
+ }) : /* @__PURE__ */ jsx(HostedApp, {
15
16
  ...props
16
17
  });
17
18
  };
@@ -24,19 +25,26 @@ const AppRoot = ({
24
25
  WaitMessage,
25
26
  errorTemplate,
26
27
  children
27
- }) => /* @__PURE__ */ React.createElement(ErrorBoundary, {
28
- errorTemplate
29
- }, /* @__PURE__ */ React.createElement(Provider, {
30
- store
31
- }, /* @__PURE__ */ React.createElement(AppRouter, {
32
- history,
33
- basename
34
- }, /* @__PURE__ */ React.createElement(ThemeProvider, {
35
- theme
36
- }, /* @__PURE__ */ React.createElement(AppToRender, {
37
- manageSession,
38
- WaitMessage
39
- }, children)))));
28
+ }) => /* @__PURE__ */ jsx(StrictMode, {
29
+ children: /* @__PURE__ */ jsx(ErrorBoundary, {
30
+ errorTemplate,
31
+ children: /* @__PURE__ */ jsx(Provider, {
32
+ store,
33
+ children: /* @__PURE__ */ jsx(AppRouter, {
34
+ history,
35
+ basename,
36
+ children: /* @__PURE__ */ jsx(ThemeProvider, {
37
+ theme,
38
+ children: /* @__PURE__ */ jsx(AppToRender, {
39
+ manageSession,
40
+ WaitMessage,
41
+ children
42
+ })
43
+ })
44
+ })
45
+ })
46
+ })
47
+ });
40
48
  export {
41
49
  AppRoot
42
50
  };
@@ -1,4 +1,4 @@
1
- import * as React from "react";
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__ */ React.createElement(LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), manageSession && /* @__PURE__ */ React.createElement(SessionTimeout, null), /* @__PURE__ */ React.createElement(LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children));
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 * as React from "react";
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__ */ React.createElement(Router, {
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
- `(max-width: ${theme.breakpoints.small})`,
12
- `(max-width: ${theme.breakpoints.medium})`,
13
- `(max-width: ${theme.breakpoints.large})`
14
- ], ["small", "medium", "large"], "large");
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((mql) => mql.removeEventListener("change", handler));
12
+ return () => mediaQueryLists.forEach(
13
+ (mql) => mql.removeEventListener("change", handler)
14
+ );
13
15
  }, [getValue, mediaQueryLists]);
14
16
  return value;
15
17
  };
@@ -1,5 +1,17 @@
1
- import * as React from "react";
2
- const DefaultErrorTemplate = (props) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "We are unable to process your request"), /* @__PURE__ */ React.createElement("section", null, "Please close your browser and login again"));
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ const DefaultErrorTemplate = ({
3
+ error = new Error("We are unable to process your request"),
4
+ errorInfo = { componentStack: "Please close your browser and login again" }
5
+ }) => /* @__PURE__ */ jsxs("div", {
6
+ children: [
7
+ /* @__PURE__ */ jsx("h2", {
8
+ children: error?.message
9
+ }),
10
+ /* @__PURE__ */ jsx("section", {
11
+ children: errorInfo?.componentStack
12
+ })
13
+ ]
14
+ });
3
15
  export {
4
16
  DefaultErrorTemplate
5
17
  };
@@ -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__ */ React.createElement(ErrorTemplate, {
29
+ return errorInfo ? /* @__PURE__ */ jsx(ErrorTemplate, {
29
30
  error,
30
31
  errorInfo
31
32
  }) : children;
@@ -1,4 +1,4 @@
1
- import * as React from "react";
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__ */ React.createElement(DSToast, {
24
+ return /* @__PURE__ */ jsx(DSToast, {
25
25
  ...props
26
26
  });
27
27
  });
@@ -1,23 +1,26 @@
1
- import * as React from "react";
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((option) => option.type === "section" || option.label.toLowerCase().includes(newFilter?.toLowerCase()));
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__ */ React.createElement(Controller, {
14
+ }) => /* @__PURE__ */ jsx(Controller, {
13
15
  name,
14
- render: ({ field: { onChange, value, ...props } }) => /* @__PURE__ */ React.createElement(DSAutocomplete, {
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
- }, children)
21
+ onSelect: onChange,
22
+ children
23
+ })
21
24
  });
22
25
  export {
23
26
  Autocomplete
@@ -1,12 +1,12 @@
1
- import * as React from "react";
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__ */ React.createElement(Controller, {
6
+ const CheckBox = ({ name, rules = {}, ...rest }) => /* @__PURE__ */ jsx(Controller, {
7
7
  name,
8
8
  rules,
9
- render: ({ field: { value = false, ...restProps } }) => /* @__PURE__ */ React.createElement(DSControlledCheckbox, {
9
+ render: ({ field: { value = false, ...restProps } }) => /* @__PURE__ */ jsx(DSControlledCheckbox, {
10
10
  ...rest,
11
11
  ...restProps,
12
12
  checked: value