@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
@@ -12,46 +12,53 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
12
12
  import { jsx as _jsx2 } from "react/jsx-runtime";
13
13
  const radioName = 'gender';
14
14
 
15
- const Gender = ({
16
- feedbackMessage,
17
- ...rest
18
- }) => /*#__PURE__*/_jsxs(RadioGroup, {
19
- name: radioName,
20
- labelProps: {
21
- labelText: 'Gender',
22
- required: true,
23
- feedbackMessage
24
- },
25
- orientation: "horizontal",
26
- ...rest,
27
- children: [_DSRadio || (_DSRadio = /*#__PURE__*/_jsx(DSRadio, {
15
+ const Gender = _ref => {
16
+ let {
17
+ feedbackMessage,
18
+ ...rest
19
+ } = _ref;
20
+ return /*#__PURE__*/_jsxs(RadioGroup, {
28
21
  name: radioName,
29
- value: "male",
30
- labelText: "Male"
31
- })), _DSRadio2 || (_DSRadio2 = /*#__PURE__*/_jsx(DSRadio, {
32
- name: radioName,
33
- value: "female",
34
- labelText: "Female"
35
- }))]
36
- });
22
+ labelProps: {
23
+ labelText: 'Gender',
24
+ required: true,
25
+ feedbackMessage
26
+ },
27
+ orientation: "horizontal",
28
+ ...rest,
29
+ children: [_DSRadio || (_DSRadio = /*#__PURE__*/_jsx(DSRadio, {
30
+ name: radioName,
31
+ value: "male",
32
+ labelText: "Male"
33
+ })), _DSRadio2 || (_DSRadio2 = /*#__PURE__*/_jsx(DSRadio, {
34
+ name: radioName,
35
+ value: "female",
36
+ labelText: "Female"
37
+ }))]
38
+ });
39
+ };
37
40
 
38
- const Template = ({
39
- props
40
- }) => /*#__PURE__*/_jsx(Form, {}, void 0, /*#__PURE__*/_jsx(ConnectForm, {}, void 0, ({
41
- formState: {
42
- errors
43
- }
44
- }) => {
45
- const errField = get(errors, radioName);
46
- const feedbackMessage = errField === null || errField === void 0 ? void 0 : errField.message;
47
- return /*#__PURE__*/_jsx2(Gender, {
48
- feedbackMessage: feedbackMessage,
41
+ const Template = _ref2 => {
42
+ let {
43
+ props
44
+ } = _ref2;
45
+ return /*#__PURE__*/_jsx(Form, {}, void 0, /*#__PURE__*/_jsx(ConnectForm, {}, void 0, _ref3 => {
46
+ let {
47
+ formState: {
48
+ errors
49
+ }
50
+ } = _ref3;
51
+ const errField = get(errors, radioName);
52
+ const feedbackMessage = errField === null || errField === void 0 ? void 0 : errField.message;
53
+ return /*#__PURE__*/_jsx2(Gender, {
54
+ feedbackMessage: feedbackMessage,
55
+ ...props
56
+ });
57
+ }), /*#__PURE__*/_jsx2(WatchValue, {
58
+ name: radioName,
49
59
  ...props
50
- });
51
- }), /*#__PURE__*/_jsx2(WatchValue, {
52
- name: radioName,
53
- ...props
54
- }));
60
+ }));
61
+ };
55
62
 
56
63
  export default {
57
64
  title: 'Components/Form/Controls/RadioGroup',
@@ -2,18 +2,24 @@ import _jsx2 from "@babel/runtime/helpers/jsx";
2
2
  import DSTextBox from '@elliemae/ds-basic/form/TextBox';
3
3
  import { Controller } from 'react-hook-form';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
- export const TextBox = ({
6
- name,
7
- defaultValue = '',
8
- rules = {},
9
- ...rest
10
- }) => /*#__PURE__*/_jsx2(Controller, {
11
- name: name,
12
- defaultValue: defaultValue,
13
- rules: rules,
14
- render: ({
15
- field
16
- }) => /*#__PURE__*/_jsx(DSTextBox, { ...rest,
17
- ...field
18
- })
19
- });
5
+ export const TextBox = _ref => {
6
+ let {
7
+ name,
8
+ defaultValue = '',
9
+ rules = {},
10
+ ...rest
11
+ } = _ref;
12
+ return /*#__PURE__*/_jsx2(Controller, {
13
+ name: name,
14
+ defaultValue: defaultValue,
15
+ rules: rules,
16
+ render: _ref2 => {
17
+ let {
18
+ field
19
+ } = _ref2;
20
+ return /*#__PURE__*/_jsx(DSTextBox, { ...rest,
21
+ ...field
22
+ });
23
+ }
24
+ });
25
+ };
@@ -5,10 +5,11 @@ import _styled from "styled-components";
5
5
  var _h;
6
6
 
7
7
  import { useFormContext } from 'react-hook-form';
8
- export const WatchValue = ({
9
- name,
10
- labelText
11
- }) => {
8
+ export const WatchValue = _ref => {
9
+ let {
10
+ name,
11
+ labelText
12
+ } = _ref;
12
13
  const {
13
14
  watch
14
15
  } = useFormContext();
@@ -2,15 +2,16 @@ import _styled from "styled-components";
2
2
  import { useForm, FormProvider } from 'react-hook-form'; // eslint-disable-next-line @typescript-eslint/ban-types
3
3
 
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
- export const Form = ({
6
- /* eslint-disable indent */
7
- classname,
8
- reactHookFormProps = {
9
- mode: 'onBlur'
10
- },
11
- children,
12
- onSubmit
13
- }) => {
5
+ export const Form = _ref => {
6
+ let {
7
+ /* eslint-disable indent */
8
+ classname,
9
+ reactHookFormProps = {
10
+ mode: 'onBlur'
11
+ },
12
+ children,
13
+ onSubmit
14
+ } = _ref;
14
15
  const methods = useForm(reactHookFormProps);
15
16
  const formProps = {};
16
17
  if (onSubmit) formProps.onSubmit = methods.handleSubmit(onSubmit);
@@ -23,9 +23,12 @@ export default {
23
23
  };
24
24
  const StyledButton = /*#__PURE__*/styled(FormSubmitButton).withConfig({
25
25
  componentId: "sc-1mzmcta-0"
26
- })(["margin-top:", ";"], ({
27
- theme
28
- }) => theme.space.xs);
26
+ })(["margin-top:", ";"], _ref => {
27
+ let {
28
+ theme
29
+ } = _ref;
30
+ return theme.space.xs;
31
+ });
29
32
 
30
33
  const WatchDashBoard = () => {
31
34
  const {
@@ -1,8 +1,9 @@
1
1
  import { useFormContext } from 'react-hook-form';
2
2
  import DSButton from '@elliemae/ds-basic/Button';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
- export const FormSubmitButton = ({ ...rest
5
- }) => {
4
+ export const FormSubmitButton = _ref => {
5
+ let { ...rest
6
+ } = _ref;
6
7
  const {
7
8
  formState,
8
9
  formProps: {
@@ -21,9 +21,12 @@ export default {
21
21
  };
22
22
  const StyledButton = /*#__PURE__*/styled(FormSubmitButton).withConfig({
23
23
  componentId: "sc-1wwguuk-0"
24
- })(["margin-top:", ";"], ({
25
- theme
26
- }) => theme.space.xs);
24
+ })(["margin-top:", ";"], _ref => {
25
+ let {
26
+ theme
27
+ } = _ref;
28
+ return theme.space.xs;
29
+ });
27
30
 
28
31
  const Template = args => /*#__PURE__*/_jsxs(Form, { ...args,
29
32
  children: [_FirstName || (_FirstName = /*#__PURE__*/_jsx(FirstName, {})), _DOB || (_DOB = /*#__PURE__*/_jsx(DOB, {})), _State || (_State = /*#__PURE__*/_jsx(State, {})), _MaritalStatus || (_MaritalStatus = /*#__PURE__*/_jsx(MaritalStatus, {})), /*#__PURE__*/_jsx2(StyledButton, { ...btnProps
@@ -6,7 +6,8 @@ export const onGuestUnloadStart = () => new Promise(resolve => {
6
6
  }
7
7
  });
8
8
  });
9
- export const notifyGuestUnloadComplete = (guestAppConfirmation, guestAppId, unloadType = 'close_loan') => {
9
+ export const notifyGuestUnloadComplete = function (guestAppConfirmation, guestAppId) {
10
+ let unloadType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'close_loan';
10
11
  sendMessageToHost({
11
12
  guestAppId,
12
13
  message: {
@@ -1,5 +1,7 @@
1
1
  import _jsx from "@babel/runtime/helpers/jsx";
2
2
  import "core-js/modules/es.string.replace.js";
3
+ import "core-js/modules/esnext.async-iterator.map.js";
4
+ import "core-js/modules/esnext.iterator.map.js";
3
5
  import { NavLink } from 'react-router-dom';
4
6
  import styled from 'styled-components';
5
7
  const NavList = /*#__PURE__*/styled.ul.withConfig({
@@ -15,11 +17,17 @@ const StyledNavLink = /*#__PURE__*/styled(NavLink).attrs({
15
17
  componentId: "sc-ztmnvf-2"
16
18
  })(["display:flex;align-items:center;color:", ";text-decoration:none;text-transform:uppercase;height:100%;padding:0 ", " 0 ", ";&.", "{background-color:#48acff;}"], props => props.theme.colors.neutral['000'], props => props.theme.space.xs, props => props.theme.space.xs, activeClassName);
17
19
  const publicPath = (process.env.ASSET_PATH || '/').replace(/\/?$/, '');
18
- export const CenterRegion = ({
19
- links = []
20
- }) => /*#__PURE__*/_jsx(NavList, {}, void 0, links.map(({
21
- name = '',
22
- path = ''
23
- }) => /*#__PURE__*/_jsx(NavListItem, {}, path, /*#__PURE__*/_jsx(StyledNavLink, {
24
- to: "".concat(publicPath).concat(path.replace(/^\/?/, '/'))
25
- }, void 0, name))));
20
+ export const CenterRegion = _ref => {
21
+ let {
22
+ links = []
23
+ } = _ref;
24
+ return /*#__PURE__*/_jsx(NavList, {}, void 0, links.map(_ref2 => {
25
+ let {
26
+ name = '',
27
+ path = ''
28
+ } = _ref2;
29
+ return /*#__PURE__*/_jsx(NavListItem, {}, path, /*#__PURE__*/_jsx(StyledNavLink, {
30
+ to: "".concat(publicPath).concat(path.replace(/^\/?/, '/'))
31
+ }, void 0, name));
32
+ }));
33
+ };
@@ -10,11 +10,14 @@ import { NavRegion } from "./nav-region/index.js";
10
10
  const HeaderContainer = /*#__PURE__*/styled.header.withConfig({
11
11
  componentId: "sc-cvwjlr-0"
12
12
  })(["display:flex;height:56px;background-color:#2080cd;padding:0px ", " 0px ", ";"], props => props.theme.space.xs, props => props.theme.space.xxs);
13
- export const Header = ({
14
- links = [],
15
- show = false
16
- }) => isStandAloneGuest() || isHost() || show ? /*#__PURE__*/_jsx(HeaderContainer, {
17
- role: "banner"
18
- }, void 0, _LogoRegion || (_LogoRegion = /*#__PURE__*/_jsx(LogoRegion, {})), /*#__PURE__*/_jsx(CenterRegion, {
19
- links: links
20
- }), _NavRegion || (_NavRegion = /*#__PURE__*/_jsx(NavRegion, {}))) : null;
13
+ export const Header = _ref => {
14
+ let {
15
+ links = [],
16
+ show = false
17
+ } = _ref;
18
+ return isStandAloneGuest() || isHost() || show ? /*#__PURE__*/_jsx(HeaderContainer, {
19
+ role: "banner"
20
+ }, void 0, _LogoRegion || (_LogoRegion = /*#__PURE__*/_jsx(LogoRegion, {})), /*#__PURE__*/_jsx(CenterRegion, {
21
+ links: links
22
+ }), _NavRegion || (_NavRegion = /*#__PURE__*/_jsx(NavRegion, {}))) : null;
23
+ };
@@ -6,7 +6,8 @@ import { lazy, Suspense } from 'react';
6
6
  import { WaitMessageLauncher } from "../modals/wait-message/wait-message-launcher.js"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
7
 
8
8
  import { jsx as _jsx2 } from "react/jsx-runtime";
9
- export const loadable = (importFunc, fallback = _WaitMessageLauncher || (_WaitMessageLauncher = /*#__PURE__*/_jsx(WaitMessageLauncher, {}))) => {
9
+ export const loadable = function (importFunc) {
10
+ let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _WaitMessageLauncher || (_WaitMessageLauncher = /*#__PURE__*/_jsx(WaitMessageLauncher, {}));
10
11
  const LazyComponent = /*#__PURE__*/lazy(importFunc); // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
12
 
12
13
  return props => /*#__PURE__*/_jsx(Suspense, {
@@ -4,11 +4,12 @@ import { login } from "../../utils/auth/index.js";
4
4
  import { LOGIN_SUCCESS } from "../../data/auth/actions.js";
5
5
  import { Fragment as _Fragment } from "react/jsx-runtime";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
- export const Login = ({
8
- clientId,
9
- scope,
10
- responseType
11
- }) => {
7
+ export const Login = _ref => {
8
+ let {
9
+ clientId,
10
+ scope,
11
+ responseType
12
+ } = _ref;
12
13
  const dispatch = useAppDispatch();
13
14
  useEffect(() => {
14
15
  login({
@@ -9,6 +9,7 @@ export const getHostAppData = (action, resolve) => event => {
9
9
 
10
10
  resolve();
11
11
  };
12
- export const sendMessageToHost = (message, hostedAppUrl = document.referrer) => {
12
+ export const sendMessageToHost = function (message) {
13
+ let hostedAppUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.referrer;
13
14
  window.parent.postMessage(message, hostedAppUrl);
14
15
  };
@@ -1,4 +1,9 @@
1
1
  import "core-js/modules/web.dom-collections.iterator.js";
2
+ import "core-js/modules/esnext.async-iterator.for-each.js";
3
+ import "core-js/modules/esnext.iterator.constructor.js";
4
+ import "core-js/modules/esnext.iterator.for-each.js";
5
+ import "core-js/modules/esnext.async-iterator.map.js";
6
+ import "core-js/modules/esnext.iterator.map.js";
2
7
 
3
8
  /* eslint-disable max-lines */
4
9
  import { persistentStorage } from "../../../utils/web-storage.js";
@@ -16,15 +21,16 @@ const isCss = fileName => cssType.test(fileName);
16
21
 
17
22
  const activeApps = {};
18
23
 
19
- const initApplication = async ({
20
- id,
21
- name,
22
- hostUrl,
23
- history,
24
- theme,
25
- manifestPath,
26
- homeRoute
27
- }) => {
24
+ const initApplication = async _ref => {
25
+ let {
26
+ id,
27
+ name,
28
+ hostUrl,
29
+ history,
30
+ theme,
31
+ manifestPath,
32
+ homeRoute
33
+ } = _ref;
28
34
  const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
29
35
 
30
36
  const {
@@ -45,10 +51,11 @@ const initApplication = async ({
45
51
  });
46
52
  };
47
53
 
48
- export const mountApp = async ({
49
- id,
50
- name
51
- }) => {
54
+ export const mountApp = async _ref2 => {
55
+ let {
56
+ id,
57
+ name
58
+ } = _ref2;
52
59
  const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
53
60
 
54
61
  const {
@@ -61,10 +68,11 @@ export const mountApp = async ({
61
68
  hostViewportSize: getViewportSize()
62
69
  });
63
70
  };
64
- export const unmountApp = async ({
65
- id,
66
- name
67
- }) => {
71
+ export const unmountApp = async _ref3 => {
72
+ let {
73
+ id,
74
+ name
75
+ } = _ref3;
68
76
  const app = (window.emui || {})[id];
69
77
  if (!app) return null; // eslint-disable-next-line @typescript-eslint/unbound-method
70
78
 
@@ -107,7 +115,8 @@ Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(
107
115
  throw new Error(logRecord.msg);
108
116
  });
109
117
 
110
- const removeAssetsFromDOM = (id, documentEle = document) => {
118
+ const removeAssetsFromDOM = function (id) {
119
+ let documentEle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
111
120
  const host = CMicroAppHost.getInstance();
112
121
  if (host) delete host.activeGuests[id];
113
122
  const {
@@ -144,11 +153,12 @@ export const loadApp = async appConfig => {
144
153
  await waitAndInitApplication(appConfig, requests);
145
154
  getLogger().info(logRecords.APP_LOADING_COMPLETE(appConfig.id));
146
155
  };
147
- export const unloadApp = ({
148
- id,
149
- hostUrl,
150
- documentEle
151
- }) => {
156
+ export const unloadApp = _ref4 => {
157
+ let {
158
+ id,
159
+ hostUrl,
160
+ documentEle
161
+ } = _ref4;
152
162
  getLogger().info(logRecords.APP_UNLOADING(id));
153
163
  const app = (window.emui || {})[id];
154
164
  if (!app) return;
@@ -2,6 +2,9 @@ import "core-js/modules/es.string.replace.js";
2
2
  import "core-js/modules/web.dom-collections.iterator.js";
3
3
  import "core-js/modules/web.url.js";
4
4
  import "core-js/modules/web.url-search-params.js";
5
+ import "core-js/modules/esnext.async-iterator.reduce.js";
6
+ import "core-js/modules/esnext.iterator.constructor.js";
7
+ import "core-js/modules/esnext.iterator.reduce.js";
5
8
  import { getHTTPClient } from "../../../communication/http-client/index.js";
6
9
  import { removeDoubleSlash } from "../../../utils/url.js";
7
10
  import { getLogger } from "../../../utils/micro-frontend/index.js";
@@ -9,25 +12,32 @@ import { logRecords } from "../../../utils/log-records.js";
9
12
 
10
13
  const getUnVersionedManifestPath = path => path.replace(/\/\d+\.\d+\//, '/latest/');
11
14
 
12
- export const getAppManifest = async ({
13
- hostUrl,
14
- manifestPath
15
- }) => {
15
+ export const getAppManifest = async _ref => {
16
+ let {
17
+ hostUrl,
18
+ manifestPath
19
+ } = _ref;
16
20
  const url = new URL("".concat(manifestPath.replace(/\/?$/, '/'), "manifest.json"), hostUrl);
17
21
  const response = await getHTTPClient().get(removeDoubleSlash(url.href));
18
- if (response.headers['content-type'].includes('application/json')) return response.data;
22
+ const {
23
+ headers
24
+ } = response;
25
+ if (headers['content-type'] && headers['content-type'].includes('application/json')) return response.data;
19
26
  return getAppManifest({
20
27
  hostUrl,
21
28
  manifestPath: getUnVersionedManifestPath(manifestPath)
22
29
  });
23
30
  };
24
- export const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
25
- const fullFileName = manifest[assetName];
26
- if (fullFileName) assets.push(fullFileName); // eslint-disable-next-line no-console
27
- else {
28
- const logRecord = logRecords.ASSET_NOT_FOUND_IN_MANIFEST(assetName);
29
- getLogger().error(logRecord);
30
- throw new Error(logRecord.msg);
31
- }
32
- return assets;
33
- }, []);
31
+ export const getFullFileNameofAssetsFromManifest = function (manifest) {
32
+ let assetNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
33
+ return assetNames.reduce((assets, assetName) => {
34
+ const fullFileName = manifest[assetName];
35
+ if (fullFileName) assets.push(fullFileName); // eslint-disable-next-line no-console
36
+ else {
37
+ const logRecord = logRecords.ASSET_NOT_FOUND_IN_MANIFEST(assetName);
38
+ getLogger().error(logRecord);
39
+ throw new Error(logRecord.msg);
40
+ }
41
+ return assets;
42
+ }, []);
43
+ };
@@ -7,29 +7,36 @@ const HEAD_SCRIPTS = new RegExp('/(?:emuiDiagnostics|global|global-prod|emuiUser
7
7
 
8
8
  const isHeadScript = scriptSrc => HEAD_SCRIPTS.test(scriptSrc);
9
9
 
10
- export const addScriptToDOM = ({
11
- name,
12
- hostUrl,
13
- documentEle
14
- }, fileName, index) => new Promise((resolve, reject) => {
15
- const ele = documentEle.createElement('script');
16
- if (!ele) reject(new Error('Unable to insert Application scripts.'));
17
- ele.id = "".concat(APP_SCRIPT_ID_PREFIX).concat(name, "-").concat(index);
18
- const url = new URL(fileName, hostUrl);
19
- ele.src = removeDoubleSlash(url.href);
20
- ele.onload = resolve.bind(null, ele.id);
21
- ele.onerror = reject.bind(null, ele.id);
22
- ele.async = false; // execute the scripts in the same order as they are inserted
10
+ export const addScriptToDOM = (_ref, fileName, index) => {
11
+ let {
12
+ name,
13
+ hostUrl,
14
+ documentEle
15
+ } = _ref;
16
+ return new Promise((resolve, reject) => {
17
+ const ele = documentEle.createElement('script');
18
+ if (!ele) reject(new Error('Unable to insert Application scripts.'));
19
+ ele.id = "".concat(APP_SCRIPT_ID_PREFIX).concat(name, "-").concat(index);
20
+ const url = new URL(fileName, hostUrl);
21
+ ele.src = removeDoubleSlash(url.href);
22
+ ele.onload = resolve.bind(null, ele.id);
23
+ ele.onerror = reject.bind(null, ele.id);
24
+ ele.async = false; // execute the scripts in the same order as they are inserted
23
25
 
24
- if (isHeadScript(ele.src)) documentEle.head.appendChild(ele);else documentEle.body.appendChild(ele);
25
- });
26
- export const removeScriptFromDOM = (elementId = '', documentEle = document) => new Promise(resolve => {
27
- const ele = documentEle.getElementById(elementId); // eslint-disable-next-line no-console
26
+ if (isHeadScript(ele.src)) documentEle.head.appendChild(ele);else documentEle.body.appendChild(ele);
27
+ });
28
+ };
29
+ export const removeScriptFromDOM = function () {
30
+ let elementId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
31
+ let documentEle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
32
+ return new Promise(resolve => {
33
+ const ele = documentEle.getElementById(elementId); // eslint-disable-next-line no-console
28
34
 
29
- if (!ele) console.warn(new Error("script with id ".concat(elementId, " not found")));
30
- ele.remove();
31
- resolve();
32
- });
35
+ if (!ele) console.warn(new Error("script with id ".concat(elementId, " not found")));
36
+ ele.remove();
37
+ resolve();
38
+ });
39
+ };
33
40
  export const removeDynamicImportedScripts = (hostUrl, documentEle) => {
34
41
  const hostPattern = new RegExp(hostUrl, 'i');
35
42
  const scriptElements = documentEle.getElementsByTagName('script');
@@ -3,27 +3,34 @@ import "core-js/modules/web.url.js";
3
3
  import "core-js/modules/web.url-search-params.js";
4
4
  import { removeDoubleSlash } from "../../../utils/url.js";
5
5
  export const APP_STYLE_ID_PREFIX = 'emui-style-';
6
- export const addStylesToDOM = ({
7
- name,
8
- hostUrl,
9
- documentEle
10
- }, fileName, index) => new Promise((resolve, reject) => {
11
- const ele = documentEle.createElement('link');
12
- if (!ele) reject(new Error('Unable to insert Application styles.'));
13
- ele.id = "".concat(APP_STYLE_ID_PREFIX).concat(name, "-").concat(index);
14
- ele.rel = 'stylesheet';
15
- const url = new URL(fileName, hostUrl);
16
- ele.href = removeDoubleSlash(url.href);
17
- ele.onload = resolve.bind(null, ele.id);
18
- documentEle.head.appendChild(ele);
19
- });
20
- export const removeStyleFromDOM = (elementId = '', documentEle = document) => new Promise(resolve => {
21
- const ele = documentEle.getElementById(elementId); // eslint-disable-next-line no-console
6
+ export const addStylesToDOM = (_ref, fileName, index) => {
7
+ let {
8
+ name,
9
+ hostUrl,
10
+ documentEle
11
+ } = _ref;
12
+ return new Promise((resolve, reject) => {
13
+ const ele = documentEle.createElement('link');
14
+ if (!ele) reject(new Error('Unable to insert Application styles.'));
15
+ ele.id = "".concat(APP_STYLE_ID_PREFIX).concat(name, "-").concat(index);
16
+ ele.rel = 'stylesheet';
17
+ const url = new URL(fileName, hostUrl);
18
+ ele.href = removeDoubleSlash(url.href);
19
+ ele.onload = resolve.bind(null, ele.id);
20
+ documentEle.head.appendChild(ele);
21
+ });
22
+ };
23
+ export const removeStyleFromDOM = function () {
24
+ let elementId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
25
+ let documentEle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
26
+ return new Promise(resolve => {
27
+ const ele = documentEle.getElementById(elementId); // eslint-disable-next-line no-console
22
28
 
23
- if (!ele) console.warn(new Error("style with id ".concat(elementId, " not found")));
24
- ele.remove();
25
- resolve();
26
- });
29
+ if (!ele) console.warn(new Error("style with id ".concat(elementId, " not found")));
30
+ ele.remove();
31
+ resolve();
32
+ });
33
+ };
27
34
  export const removeDynamicImportedStyles = (hostUrl, documentEle) => {
28
35
  const hostPattern = new RegExp(hostUrl, 'i');
29
36
  const prefetchElements = documentEle.querySelectorAll('[rel="stylesheet"]');
@@ -1,17 +1,18 @@
1
+ import _merge from "lodash/merge";
1
2
  import { useRef, useLayoutEffect, useCallback } from 'react';
2
- import { merge } from 'lodash';
3
3
  import { useDispatch } from 'react-redux';
4
4
  import { waitMessage } from "../../data/wait-message/actions.js";
5
5
  import { loadApp, unloadApp, mountApp, unmountApp } from "./app-factory/index.js";
6
6
  import { getLogger, getMicroFrontEndAppConfig } from "../../utils/micro-frontend/index.js";
7
7
  import { logRecords } from "../../utils/log-records.js";
8
- export const useAppWillRender = ({
9
- id,
10
- documentEle,
11
- history,
12
- theme,
13
- onUnloadComplete
14
- }) => {
8
+ export const useAppWillRender = _ref => {
9
+ let {
10
+ id,
11
+ documentEle,
12
+ history,
13
+ theme,
14
+ onUnloadComplete
15
+ } = _ref;
15
16
  // ToDo: Since ecc app is using older version of react-redux we need this undefined check. once ECC upgrades to react-redux v6 or later, this check can be removed
16
17
  // eslint-disable-next-line react-hooks/rules-of-hooks
17
18
  const dispatch = useDispatch ? useDispatch() : null;
@@ -44,12 +45,14 @@ export const useAppWillRender = ({
44
45
  }, [dispatch, unload]);
45
46
  useLayoutEffect(() => {
46
47
  if (!documentEle) return () => {};
47
- const appConfig = merge(getConfig(), {
48
+
49
+ const appConfig = _merge(getConfig(), {
48
50
  documentEle,
49
51
  history,
50
52
  theme
51
53
  }); // eslint-disable-next-line @typescript-eslint/no-floating-promises
52
54
 
55
+
53
56
  load(appConfig);
54
57
  return () => {
55
58
  ref.current = unload(appConfig);