@elliemae/pui-app-sdk 2.8.3 → 2.11.0

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