@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
@@ -17,9 +17,11 @@ var _index2 = require("../../utils/micro-frontend/index.js");
17
17
 
18
18
  var _logRecords = require("../../utils/log-records.js");
19
19
 
20
- function* login({
21
- payload
22
- }) {
20
+ function* login(_ref) {
21
+ let {
22
+ payload
23
+ } = _ref;
24
+
23
25
  try {
24
26
  yield (0, _effects.call)(_index.authorize, payload);
25
27
  yield (0, _effects.put)({
@@ -32,9 +34,11 @@ function* login({
32
34
  }
33
35
  }
34
36
 
35
- function* logout({
36
- payload
37
- }) {
37
+ function* logout(_ref2) {
38
+ let {
39
+ payload
40
+ } = _ref2;
41
+
38
42
  try {
39
43
  yield (0, _effects.call)(_index.endSession, payload);
40
44
  } catch (err) {
@@ -7,7 +7,13 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.setAppConfigValue = exports.setAppConfig = exports.hasItem = exports.getAppConfigValue = void 0;
9
9
 
10
- var _lodash = _interopRequireDefault(require("lodash"));
10
+ var _has2 = _interopRequireDefault(require("lodash/has"));
11
+
12
+ var _set2 = _interopRequireDefault(require("lodash/set"));
13
+
14
+ var _get2 = _interopRequireDefault(require("lodash/get"));
15
+
16
+ var _clone2 = _interopRequireDefault(require("lodash/clone"));
11
17
 
12
18
  // eslint-disable-next-line no-undef
13
19
  let gAppConfig = APP_CONFIG;
@@ -18,14 +24,25 @@ const setAppConfig = config => {
18
24
 
19
25
  exports.setAppConfig = setAppConfig;
20
26
 
21
- const getAppConfigValue = (key = '', defaultValue = null) => _lodash.default.clone(_lodash.default.get(gAppConfig, key, defaultValue));
27
+ const getAppConfigValue = function () {
28
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
29
+ let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
30
+ return (0, _clone2.default)((0, _get2.default)(gAppConfig, key, defaultValue));
31
+ };
22
32
 
23
33
  exports.getAppConfigValue = getAppConfigValue;
24
34
 
25
- const setAppConfigValue = (key = '', value) => _lodash.default.set(gAppConfig, key, value);
35
+ const setAppConfigValue = function () {
36
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
37
+ let value = arguments.length > 1 ? arguments[1] : undefined;
38
+ return (0, _set2.default)(gAppConfig, key, value);
39
+ };
26
40
 
27
41
  exports.setAppConfigValue = setAppConfigValue;
28
42
 
29
- const hasItem = (key = '') => _lodash.default.has(gAppConfig, key);
43
+ const hasItem = function () {
44
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
45
+ return (0, _has2.default)(gAppConfig, key);
46
+ };
30
47
 
31
48
  exports.hasItem = hasItem;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.loadAppConfig = void 0;
9
9
 
10
- var _lodash = _interopRequireDefault(require("lodash"));
10
+ var _merge2 = _interopRequireDefault(require("lodash/merge"));
11
11
 
12
12
  var _index = require("../../communication/http-client/index.js");
13
13
 
@@ -21,20 +21,24 @@ const parseAppConfig = data => {
21
21
  // @ts-ignore
22
22
 
23
23
  if (data.env) delete data.env;
24
- (0, _config.setAppConfig)(_lodash.default.merge(data, activeEnvConfig));
24
+ (0, _config.setAppConfig)((0, _merge2.default)(data, activeEnvConfig));
25
25
  };
26
26
 
27
- const loadAppConfig = (hostUrl = './') => new Promise((resolve, reject) => {
28
- (0, _index.getHTTPClient)({
29
- baseURL: hostUrl
30
- }).get('app.config.json').then(({
31
- data
32
- }) => {
33
- parseAppConfig(data);
34
- resolve();
35
- }).catch(err => {
36
- reject(new Error("Unable to load application configurtion file. ".concat(err.Message)));
27
+ const loadAppConfig = function () {
28
+ let hostUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : './';
29
+ return new Promise((resolve, reject) => {
30
+ (0, _index.getHTTPClient)({
31
+ baseURL: hostUrl
32
+ }).get('app.config.json').then(_ref => {
33
+ let {
34
+ data
35
+ } = _ref;
36
+ parseAppConfig(data);
37
+ resolve();
38
+ }).catch(err => {
39
+ reject(new Error("Unable to load application configurtion file. ".concat(err.Message)));
40
+ });
37
41
  });
38
- });
42
+ };
39
43
 
40
44
  exports.loadAppConfig = loadAppConfig;
@@ -7,12 +7,15 @@ exports.enableReactAppForHostIntegration = void 0;
7
7
 
8
8
  var _guest = require("../micro-frontend/guest.js");
9
9
 
10
- const enableReactAppForHostIntegration = ({
11
- onInit,
12
- onMount
13
- }) => _guest.CMicroAppGuest.getInstance({
14
- onInit,
15
- onMount
16
- });
10
+ const enableReactAppForHostIntegration = _ref => {
11
+ let {
12
+ onInit,
13
+ onMount
14
+ } = _ref;
15
+ return _guest.CMicroAppGuest.getInstance({
16
+ onInit,
17
+ onMount
18
+ });
19
+ };
17
20
 
18
21
  exports.enableReactAppForHostIntegration = enableReactAppForHostIntegration;
@@ -50,14 +50,15 @@ const getIDPInfoFromUrl = () => {
50
50
 
51
51
  exports.getIDPInfoFromUrl = getIDPInfoFromUrl;
52
52
 
53
- const navigateToLoginPage = ({
54
- clientId,
55
- redirectUri,
56
- idpErrorCode,
57
- scope,
58
- // eslint-disable-next-line camelcase
59
- responseType
60
- }) => {
53
+ const navigateToLoginPage = _ref => {
54
+ let {
55
+ clientId,
56
+ redirectUri,
57
+ idpErrorCode,
58
+ scope,
59
+ // eslint-disable-next-line camelcase
60
+ responseType
61
+ } = _ref;
61
62
  const idpHost = (0, _config.getAppConfigValue)(IDP_ENDPOINT_CONFIG_KEY, '');
62
63
  const idpUrl = new URL('/authorize', idpHost);
63
64
  const idpOptions = {
@@ -75,27 +76,24 @@ const navigateToLoginPage = ({
75
76
 
76
77
  exports.navigateToLoginPage = navigateToLoginPage;
77
78
 
78
- const endSession = async ({
79
- clientId,
80
- redirectUri,
81
- responseType,
82
- scope,
83
- code = '1004'
84
- }) => {
79
+ const endSession = async _ref2 => {
80
+ let {
81
+ clientId,
82
+ redirectUri,
83
+ responseType,
84
+ scope,
85
+ code = '1004'
86
+ } = _ref2;
87
+
85
88
  try {
86
89
  const authorization = (0, _helper.getAuthorizationHeader)();
87
- const userId = sessionStorage.getItem('userId') || '';
88
- const instanceId = sessionStorage.getItem('instanceId') || '';
89
90
  sessionStorage.clear();
90
91
  const token = authorization ? authorization.split(' ')[1] : '';
91
92
  await (0, _index.revokeToken)({
92
93
  clientId,
93
94
  token
94
95
  });
95
- (0, _userSession.logoutEvent)({
96
- userId,
97
- instanceId
98
- }); // redirect
96
+ (0, _userSession.logoutEvent)(); // redirect
99
97
 
100
98
  const idpHost = (0, _config.getAppConfigValue)(IDP_ENDPOINT_CONFIG_KEY, '');
101
99
  const logoutUrl = new URL('/authorize', idpHost);
@@ -118,13 +116,15 @@ const endSession = async ({
118
116
 
119
117
  exports.endSession = endSession;
120
118
 
121
- const authorize = async ({
122
- idpCode,
123
- redirectUri,
124
- clientId,
125
- scope,
126
- responseType
127
- }) => {
119
+ const authorize = async _ref3 => {
120
+ let {
121
+ idpCode,
122
+ redirectUri,
123
+ clientId,
124
+ scope,
125
+ responseType
126
+ } = _ref3;
127
+
128
128
  try {
129
129
  const {
130
130
  tokenType,
@@ -186,11 +186,12 @@ const authorize = async ({
186
186
 
187
187
  exports.authorize = authorize;
188
188
 
189
- const login = async ({
190
- clientId,
191
- scope,
192
- responseType
193
- }) => {
189
+ const login = async _ref4 => {
190
+ let {
191
+ clientId,
192
+ scope,
193
+ responseType
194
+ } = _ref4;
194
195
  const {
195
196
  idpCode,
196
197
  idpErrorCode,
@@ -13,9 +13,9 @@ require("core-js/modules/es.string.replace.js");
13
13
 
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
 
16
- var _reactDom = _interopRequireDefault(require("react-dom"));
16
+ var _merge2 = _interopRequireDefault(require("lodash/merge"));
17
17
 
18
- var _lodash = _interopRequireDefault(require("lodash"));
18
+ var _reactDom = _interopRequireDefault(require("react-dom"));
19
19
 
20
20
  var _connectedReactRouter = require("connected-react-router");
21
21
 
@@ -50,6 +50,8 @@ const isCrossDomain = () => {
50
50
 
51
51
  class CMicroAppGuest {
52
52
  constructor(params) {
53
+ var _window$emui;
54
+
53
55
  (0, _defineProperty2.default)(this, "logger", void 0);
54
56
  (0, _defineProperty2.default)(this, "appId", void 0);
55
57
  (0, _defineProperty2.default)(this, "props", void 0);
@@ -59,7 +61,7 @@ class CMicroAppGuest {
59
61
  (0, _defineProperty2.default)(this, "onUnmount", void 0);
60
62
  (0, _defineProperty2.default)(this, "onGetRef", void 0);
61
63
  this.containerId = 'app-container';
62
- this.appId = (0, _config.getAppConfigValue)('appId');
64
+ this.appId = ((_window$emui = window.emui) === null || _window$emui === void 0 ? void 0 : _window$emui.appId) || (0, _config.getAppConfigValue)('appId');
63
65
  this.props = {
64
66
  host: null,
65
67
  hostUrl: null,
@@ -142,7 +144,7 @@ class CMicroAppGuest {
142
144
  }
143
145
 
144
146
  async init(options) {
145
- this.props = _lodash.default.merge(this.props, options);
147
+ this.props = (0, _merge2.default)(this.props, options);
146
148
 
147
149
  if (!this.props.host) {
148
150
  const host = await this.getSSFHost();
@@ -158,9 +160,10 @@ class CMicroAppGuest {
158
160
  /* eslint-enable camelcase, no-undef */
159
161
  }
160
162
 
161
- mount(options = {
162
- containerId: 'app-container'
163
- }) {
163
+ mount() {
164
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
165
+ containerId: 'app-container'
166
+ };
164
167
  this.containerId = options === null || options === void 0 ? void 0 : options.containerId;
165
168
  return Promise.resolve().then(() => {
166
169
  if (this.onMount) this.onMount(options);
@@ -37,6 +37,8 @@ var _constants = require("../constants.js");
37
37
 
38
38
  var _window = require("../window.js");
39
39
 
40
+ var _index3 = require("../../analytics/index.js");
41
+
40
42
  class CMicroAppHost {
41
43
  constructor(params) {
42
44
  (0, _defineProperty2.default)(this, "logger", void 0);
@@ -175,11 +177,20 @@ class CMicroAppHost {
175
177
  return (0, _pubsubJs.subscribe)(_constants.HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
176
178
  }
177
179
 
178
- setSystemVersion(version = 'latest') {
180
+ setSystemVersion() {
181
+ let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'latest';
179
182
  window.emui.version = version;
180
183
  this.props.systemVersion = version;
181
184
  }
182
185
 
186
+ sendBAEvent(event) {
187
+ // eslint-disable-next-line max-lines
188
+ (0, _index3.sendBAEvent)({
189
+ eventParams: event,
190
+ self: true
191
+ });
192
+ }
193
+
183
194
  }
184
195
 
185
196
  exports.CMicroAppHost = CMicroAppHost;
@@ -9,7 +9,7 @@ exports.isStandAloneGuest = exports.isHost = exports.isGuest = exports.getMicroF
9
9
 
10
10
  require("core-js/modules/es.string.replace.js");
11
11
 
12
- var _lodash = _interopRequireDefault(require("lodash"));
12
+ var _merge2 = _interopRequireDefault(require("lodash/merge"));
13
13
 
14
14
  var _guest = require("./guest.js");
15
15
 
@@ -60,13 +60,11 @@ const getMicroFrontEndAppConfig = appInfo => {
60
60
 
61
61
  if (microFEAppConfig.production) delete microFEAppConfig.production;
62
62
  if (microFEAppConfig.development) delete microFEAppConfig.development;
63
-
64
- const microFEConfig = _lodash.default.merge(appInfo, {
63
+ const microFEConfig = (0, _merge2.default)(appInfo, {
65
64
  mode: 'production',
66
65
  hostUrl: './',
67
66
  manifestPath: './{SYSTEM_VERSION}'
68
67
  }, microFEAppConfig, envConfig);
69
-
70
68
  microFEConfig.hostUrl = (0, _helpers.convertRelativeToAbsoluteUrl)(microFEConfig.hostUrl.replace(/\/?$/, '/'));
71
69
  microFEConfig.manifestPath = getVersionedPath(microFEConfig.manifestPath);
72
70
  return microFEConfig;
@@ -11,7 +11,8 @@ var _logRecords = require("./log-records.js");
11
11
 
12
12
  var _index = require("./micro-frontend/index.js");
13
13
 
14
- const initServiceWorker = (swDest = '') => {
14
+ const initServiceWorker = function () {
15
+ let swDest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
15
16
  const logger = (0, _index.getLogger)() || console;
16
17
 
17
18
  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.trackActivity = exports.subscribeToSessionExpiryWarning = exports.subscribeToSessionExpiry = exports.subscribeToResetSession = exports.stopSessionMonitoring = exports.resetUserIdleTime = exports.initSessionMonitoring = void 0;
7
9
 
8
- var _lodash = require("lodash");
10
+ var _throttle2 = _interopRequireDefault(require("lodash/throttle"));
9
11
 
10
12
  var _config = require("./app-config/config.js");
11
13
 
@@ -31,13 +33,19 @@ const resetUserIdleTime = () => {
31
33
  };
32
34
 
33
35
  exports.resetUserIdleTime = resetUserIdleTime;
34
- const throttledResetUserIdleTime = (0, _lodash.throttle)(resetUserIdleTime, THROTTLING_TIME, {
36
+ const throttledResetUserIdleTime = (0, _throttle2.default)(resetUserIdleTime, THROTTLING_TIME, {
35
37
  leading: true
36
38
  });
37
39
 
38
- const isPastWarningTime = (warnInterval = (0, _config.getAppConfigValue)('sessionTimeoutWarnInterval') || _constants.SESSION_TIMEOUT_INTERVAL.WARN) => Date.now() - lastUserActivityTimeStamp > warnInterval;
40
+ const isPastWarningTime = function () {
41
+ let warnInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _config.getAppConfigValue)('sessionTimeoutWarnInterval') || _constants.SESSION_TIMEOUT_INTERVAL.WARN;
42
+ return Date.now() - lastUserActivityTimeStamp > warnInterval;
43
+ };
39
44
 
40
- const isPastSessionTimeoutTime = (sessionTimeout = (0, _config.getAppConfigValue)('sessionTimeoutInterval') || _constants.SESSION_TIMEOUT_INTERVAL.EXPIRY) => Date.now() - lastUserActivityTimeStamp > sessionTimeout;
45
+ const isPastSessionTimeoutTime = function () {
46
+ let sessionTimeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _config.getAppConfigValue)('sessionTimeoutInterval') || _constants.SESSION_TIMEOUT_INTERVAL.EXPIRY;
47
+ return Date.now() - lastUserActivityTimeStamp > sessionTimeout;
48
+ };
41
49
 
42
50
  const notifySessionExpiryWarning = () => {
43
51
  sessionExpiryWarningNotified = true;
@@ -110,7 +118,7 @@ exports.subscribeToResetSession = subscribeToResetSession;
110
118
 
111
119
  const trackActivity = (element, cb) => {
112
120
  if (!element) return () => {};
113
- const thorttledCb = (0, _lodash.throttle)(cb, THROTTLING_TIME, {
121
+ const thorttledCb = (0, _throttle2.default)(cb, THROTTLING_TIME, {
114
122
  leading: true
115
123
  });
116
124
  userInteractionEvents.forEach(r => element.addEventListener(r, thorttledCb));
@@ -7,14 +7,17 @@ exports.createTheme = void 0;
7
7
 
8
8
  var _create = require("@storybook/theming/create");
9
9
 
10
- const createTheme = ({
11
- base = 'light',
12
- brandTitle = 'Platform UI Components',
13
- ...rest
14
- }) => (0, _create.create)({
15
- base,
16
- brandTitle: "".concat(brandTitle, " ").concat(process.env.STORYBOOK_VERSION || ''),
17
- ...rest
18
- });
10
+ const createTheme = _ref => {
11
+ let {
12
+ base = 'light',
13
+ brandTitle = 'Platform UI Components',
14
+ ...rest
15
+ } = _ref;
16
+ return (0, _create.create)({
17
+ base,
18
+ brandTitle: "".concat(brandTitle, " ").concat(process.env.STORYBOOK_VERSION || ''),
19
+ ...rest
20
+ });
21
+ };
19
22
 
20
23
  exports.createTheme = createTheme;
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/esnext.async-iterator.for-each.js");
4
+
5
+ require("core-js/modules/esnext.iterator.constructor.js");
6
+
7
+ require("core-js/modules/esnext.iterator.for-each.js");
8
+
3
9
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
10
 
5
11
  Object.defineProperty(exports, "__esModule", {
@@ -37,15 +43,18 @@ var _history = require("../history.js");
37
43
  const defaultStore = (0, _store.createAppStore)({}, _history.browserHistory);
38
44
  const defaultTheme = (0, _puiTheme.getDefaultTheme)();
39
45
 
40
- const AllTheProviders = ({
41
- store = defaultStore,
42
- theme = defaultTheme,
43
- children
44
- }) => /*#__PURE__*/(0, _jsx2.default)(_index.AppRoot, {
45
- store: store,
46
- history: _history.browserHistory,
47
- theme: theme
48
- }, void 0, children);
46
+ const AllTheProviders = _ref => {
47
+ let {
48
+ store = defaultStore,
49
+ theme = defaultTheme,
50
+ children
51
+ } = _ref;
52
+ return /*#__PURE__*/(0, _jsx2.default)(_index.AppRoot, {
53
+ store: store,
54
+ history: _history.browserHistory,
55
+ theme: theme
56
+ }, void 0, children);
57
+ };
49
58
 
50
59
  const customRender = (ui, options) => (0, _react.render)(ui, {
51
60
  wrapper: AllTheProviders,
@@ -17,16 +17,19 @@ var _store = require("../../data/store.js");
17
17
 
18
18
  var _history = require("../history.js");
19
19
 
20
- const renderWithRedux = (ui, {
21
- initialState,
22
- store = (0, _store.createAppStore)(initialState, _history.browserHistory)
23
- } = {}) => ({ ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
24
- store: store
25
- }, void 0, ui)),
26
- // adding `store` to the returned utilities to allow us
27
- // to reference it in our tests (just try to avoid using
28
- // this to test implementation details).
29
- store
30
- });
20
+ const renderWithRedux = function (ui) {
21
+ let {
22
+ initialState,
23
+ store = (0, _store.createAppStore)(initialState, _history.browserHistory)
24
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25
+ return { ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
26
+ store: store
27
+ }, void 0, ui)),
28
+ // adding `store` to the returned utilities to allow us
29
+ // to reference it in our tests (just try to avoid using
30
+ // this to test implementation details).
31
+ store
32
+ };
33
+ };
31
34
 
32
35
  exports.renderWithRedux = renderWithRedux;
@@ -21,22 +21,25 @@ var _store = require("../../data/store.js");
21
21
 
22
22
  var _history2 = require("../history.js");
23
23
 
24
- const renderWithRouterRedux = (ui, {
25
- route = '/',
26
- history = (0, _history.createMemoryHistory)({
27
- initialEntries: [route]
28
- }),
29
- initialState,
30
- store = (0, _store.createAppStore)(initialState, _history2.browserHistory)
31
- } = {}) => ({ ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
32
- store: store
33
- }, void 0, /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
34
- history: history
35
- }, void 0, ui))),
36
- // adding `store` to the returned utilities to allow us
37
- // to reference it in our tests (just try to avoid using
38
- // this to test implementation details).
39
- store
40
- });
24
+ const renderWithRouterRedux = function (ui) {
25
+ let {
26
+ route = '/',
27
+ history = (0, _history.createMemoryHistory)({
28
+ initialEntries: [route]
29
+ }),
30
+ initialState,
31
+ store = (0, _store.createAppStore)(initialState, _history2.browserHistory)
32
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
33
+ return { ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
34
+ store: store
35
+ }, void 0, /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
36
+ history: history
37
+ }, void 0, ui))),
38
+ // adding `store` to the returned utilities to allow us
39
+ // to reference it in our tests (just try to avoid using
40
+ // this to test implementation details).
41
+ store
42
+ };
43
+ };
41
44
 
42
45
  exports.renderWithRouterRedux = renderWithRouterRedux;
@@ -15,18 +15,21 @@ var _reactRouterDom = require("react-router-dom");
15
15
 
16
16
  var _history = require("history");
17
17
 
18
- const renderWithRouter = (ui, {
19
- route = '/',
20
- history = (0, _history.createMemoryHistory)({
21
- initialEntries: [route]
22
- })
23
- } = {}) => ({ ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
24
- history: history
25
- }, void 0, ui)),
26
- // adding `history` to the returned utilities to allow us
27
- // to reference it in our tests (just try to avoid using
28
- // this to test implementation details).
29
- history
30
- });
18
+ const renderWithRouter = function (ui) {
19
+ let {
20
+ route = '/',
21
+ history = (0, _history.createMemoryHistory)({
22
+ initialEntries: [route]
23
+ })
24
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25
+ return { ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
26
+ history: history
27
+ }, void 0, ui)),
28
+ // adding `history` to the returned utilities to allow us
29
+ // to reference it in our tests (just try to avoid using
30
+ // this to test implementation details).
31
+ history
32
+ };
33
+ };
31
34
 
32
35
  exports.renderWithRouter = renderWithRouter;
@@ -11,6 +11,12 @@ var _jsx3 = _interopRequireDefault(require("@babel/runtime/helpers/jsx"));
11
11
 
12
12
  require("core-js/modules/web.dom-collections.iterator.js");
13
13
 
14
+ require("core-js/modules/esnext.async-iterator.for-each.js");
15
+
16
+ require("core-js/modules/esnext.iterator.constructor.js");
17
+
18
+ require("core-js/modules/esnext.iterator.for-each.js");
19
+
14
20
  var _react = require("react");
15
21
 
16
22
  var _styledComponents = require("styled-components");
@@ -22,13 +28,14 @@ var _reduxInjectors = require("redux-injectors");
22
28
  var _jsxRuntime = require("react/jsx-runtime");
23
29
 
24
30
  /* eslint-disable react-hooks/rules-of-hooks */
25
- const RenderWithStateAddOns = ({
26
- Component,
27
- reducer,
28
- saga,
29
- theme = (0, _puiTheme.getDefaultTheme)(),
30
- ...rest
31
- }) => {
31
+ const RenderWithStateAddOns = _ref => {
32
+ let {
33
+ Component,
34
+ reducer,
35
+ saga,
36
+ theme = (0, _puiTheme.getDefaultTheme)(),
37
+ ...rest
38
+ } = _ref;
32
39
  const [ready, setReady] = (0, _react.useState)(false);
33
40
 
34
41
  if (Array.isArray(reducer)) {
@@ -7,6 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.removeStorageEvents = exports.persistentStorage = exports.listenStorageEvents = void 0;
9
9
 
10
+ require("core-js/modules/esnext.async-iterator.for-each.js");
11
+
12
+ require("core-js/modules/esnext.iterator.constructor.js");
13
+
14
+ require("core-js/modules/esnext.iterator.for-each.js");
15
+
10
16
  var _localforage = _interopRequireDefault(require("localforage"));
11
17
 
12
18
  const STORAGE = 'storage';