@elliemae/pui-app-sdk 2.17.2 → 3.0.0-beta.4

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 (345) hide show
  1. package/dist/cjs/analytics/appdynamics.js +34 -30
  2. package/dist/cjs/analytics/index.js +32 -26
  3. package/dist/cjs/analytics/page-view-event.js +34 -34
  4. package/dist/cjs/analytics/user-session-event.js +34 -27
  5. package/dist/cjs/analytics/user-wait-event.js +31 -17
  6. package/dist/cjs/analytics/web-analytics.js +16 -19
  7. package/dist/cjs/api/auth/index.js +41 -39
  8. package/dist/cjs/api/helpers.js +33 -99
  9. package/dist/cjs/api/users/index.js +28 -16
  10. package/dist/cjs/communication/http-client/index.js +44 -48
  11. package/dist/cjs/communication/http-client/request-interceptor.js +28 -12
  12. package/dist/cjs/communication/http-client/response-interceptor.js +41 -38
  13. package/dist/cjs/communication/http-client/retry-axios.js +68 -122
  14. package/dist/cjs/communication/http-client/retry.js +42 -36
  15. package/dist/cjs/communication/http-client/tests/index.test-disable.js +48 -56
  16. package/dist/cjs/data/auth/actions.js +17 -26
  17. package/dist/cjs/data/auth/reducer.js +30 -18
  18. package/dist/cjs/data/breakpoint/index.js +38 -32
  19. package/dist/cjs/data/error/index.js +33 -18
  20. package/dist/cjs/data/live-message/index.js +34 -25
  21. package/dist/cjs/data/logout/actions.js +12 -9
  22. package/dist/cjs/data/navigation-prompt/actions.js +12 -9
  23. package/dist/cjs/data/react-redux.js +29 -13
  24. package/dist/cjs/data/reducers.js +35 -23
  25. package/dist/cjs/data/saga.js +12 -9
  26. package/dist/cjs/data/store.js +52 -60
  27. package/dist/cjs/data/wait-message/actions.js +14 -13
  28. package/dist/cjs/data/wait-message/reducer.js +32 -24
  29. package/dist/cjs/index.js +189 -809
  30. package/dist/cjs/route/index.js +37 -32
  31. package/dist/cjs/route/page-view.js +30 -22
  32. package/dist/cjs/route/private-route/index.js +52 -60
  33. package/dist/cjs/sideeffect/auth/index.js +42 -30
  34. package/dist/cjs/sideeffect/error-toast/index.js +39 -26
  35. package/dist/cjs/sideeffect/wait-message/index.js +45 -29
  36. package/dist/cjs/typings/custom.d.js +0 -1
  37. package/dist/cjs/typings/elliemae.d.js +0 -1
  38. package/dist/cjs/typings/styled.d.js +19 -3
  39. package/dist/cjs/utils/app-config/config.js +33 -33
  40. package/dist/cjs/utils/app-config/index.js +42 -44
  41. package/dist/cjs/utils/app-host-integration/react.js +27 -14
  42. package/dist/cjs/utils/auth/helper.js +30 -18
  43. package/dist/cjs/utils/auth/index.js +76 -116
  44. package/dist/cjs/utils/await.js +3 -0
  45. package/dist/cjs/utils/constants.js +22 -21
  46. package/dist/cjs/utils/font-size.js +13 -14
  47. package/dist/cjs/utils/guest-with-service.js +11 -12
  48. package/dist/cjs/utils/helpers.js +15 -19
  49. package/dist/cjs/utils/history.js +29 -12
  50. package/dist/cjs/utils/log-records.js +38 -35
  51. package/dist/cjs/utils/micro-frontend/console-logger.js +39 -23
  52. package/dist/cjs/utils/micro-frontend/guest.js +80 -128
  53. package/dist/cjs/utils/micro-frontend/host.js +84 -124
  54. package/dist/cjs/utils/micro-frontend/index.js +60 -61
  55. package/dist/cjs/utils/micro-frontend/types.js +3 -5
  56. package/dist/cjs/utils/redact-pii.js +15 -17
  57. package/dist/cjs/utils/service-worker.js +36 -21
  58. package/dist/cjs/utils/session.js +64 -70
  59. package/dist/cjs/utils/storybook/main.js +32 -25
  60. package/dist/cjs/utils/storybook/manager.js +31 -16
  61. package/dist/cjs/utils/storybook/middleware.js +3 -7
  62. package/dist/cjs/utils/storybook/preview.js +57 -48
  63. package/dist/cjs/utils/storybook/theme.js +30 -14
  64. package/dist/cjs/utils/storybook/vite.js +6 -0
  65. package/dist/cjs/utils/storybook/webpack.js +21 -0
  66. package/dist/cjs/utils/testing/index.js +38 -50
  67. package/dist/cjs/utils/testing/render-with-redux.js +34 -27
  68. package/dist/cjs/utils/testing/render-with-router-redux.js +40 -37
  69. package/dist/cjs/utils/testing/render-with-router.js +34 -28
  70. package/dist/cjs/utils/testing/render-with-state-addons.js +40 -36
  71. package/dist/cjs/utils/types.js +3 -0
  72. package/dist/cjs/utils/url.js +12 -13
  73. package/dist/cjs/utils/web-storage.js +40 -30
  74. package/dist/cjs/utils/window.js +36 -28
  75. package/dist/cjs/view/app-root/hosted-app.js +35 -32
  76. package/dist/cjs/view/app-root/index.js +57 -62
  77. package/dist/cjs/view/app-root/stand-alone-app.js +38 -37
  78. package/dist/cjs/view/app-root/style.js +50 -12
  79. package/dist/cjs/view/error-boundary/default-error-template.js +10 -15
  80. package/dist/cjs/view/error-boundary/index.js +41 -43
  81. package/dist/cjs/view/error-toast/index.js +42 -32
  82. package/dist/cjs/view/fetch-host-app-data/index.js +34 -26
  83. package/dist/cjs/view/fetch-host-app-data/store.js +31 -24
  84. package/dist/cjs/view/fields/check-box/index.js +34 -39
  85. package/dist/cjs/view/fields/combo-box/index.js +37 -31
  86. package/dist/cjs/view/fields/connect-form.js +30 -15
  87. package/dist/cjs/view/fields/date-input/index.js +34 -26
  88. package/dist/cjs/view/fields/date-picker/index.js +34 -26
  89. package/dist/cjs/view/fields/form-item-layout/index.js +36 -30
  90. package/dist/cjs/view/fields/input-mask/index.js +35 -41
  91. package/dist/cjs/view/fields/large-text-box/index.js +34 -26
  92. package/dist/cjs/view/fields/radio/index.js +34 -30
  93. package/dist/cjs/view/fields/radio-group/index.js +32 -27
  94. package/dist/cjs/view/fields/text-box/index.js +34 -26
  95. package/dist/cjs/view/fields/watch-value.js +41 -35
  96. package/dist/cjs/view/form/index.js +41 -34
  97. package/dist/cjs/view/form/personal-info-section.js +56 -80
  98. package/dist/cjs/view/form/submit-button/index.js +34 -23
  99. package/dist/cjs/view/guest-unload-handlers/index.js +33 -22
  100. package/dist/cjs/view/header/center-region/index.js +61 -38
  101. package/dist/cjs/view/header/index.js +41 -35
  102. package/dist/cjs/view/header/logo-region/index.js +31 -23
  103. package/dist/cjs/view/header/nav-region/index.js +44 -30
  104. package/dist/cjs/view/header/nav-region/notification/index.js +28 -18
  105. package/dist/cjs/view/header/nav-region/user/index.js +28 -18
  106. package/dist/cjs/view/host-binding-events/index.js +10 -11
  107. package/dist/cjs/view/intro.stories.mdx +1 -1
  108. package/dist/cjs/view/live-message/index.js +33 -34
  109. package/dist/cjs/view/loadable/index.js +33 -27
  110. package/dist/cjs/view/login/index.js +36 -30
  111. package/dist/cjs/view/media-breakpoint/index.js +43 -34
  112. package/dist/cjs/view/message-to-host-app/index.js +31 -20
  113. package/dist/cjs/view/micro-app/app-factory/index.js +98 -134
  114. package/dist/cjs/view/micro-app/const.js +10 -7
  115. package/dist/cjs/view/micro-app/index.js +37 -27
  116. package/dist/cjs/view/micro-app/resources/manifest.js +41 -34
  117. package/dist/cjs/view/micro-app/resources/script.js +56 -53
  118. package/dist/cjs/view/micro-app/resources/style.js +44 -38
  119. package/dist/cjs/view/micro-app/types.js +3 -5
  120. package/dist/cjs/view/micro-app/use-app-will-render.js +58 -50
  121. package/dist/cjs/view/micro-app/utils.js +32 -21
  122. package/dist/cjs/view/micro-iframe-app/app.js +37 -39
  123. package/dist/cjs/view/micro-iframe-app/iframe/const.js +10 -7
  124. package/dist/cjs/view/micro-iframe-app/iframe/index.js +51 -47
  125. package/dist/cjs/view/micro-iframe-app/index.js +36 -24
  126. package/dist/cjs/view/micro-iframe-app/types.js +3 -5
  127. package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +40 -36
  128. package/dist/cjs/view/modals/error/index.js +35 -28
  129. package/dist/cjs/view/modals/navigation-prompt/index.js +38 -37
  130. package/dist/cjs/view/modals/session-expiry/customHooks.js +40 -35
  131. package/dist/cjs/view/modals/session-expiry/index.js +45 -50
  132. package/dist/cjs/view/modals/wait-message/html-wait-message.js +32 -18
  133. package/dist/cjs/view/modals/wait-message/index.js +50 -53
  134. package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +33 -21
  135. package/dist/cjs/view/render-with-delay/index.js +30 -19
  136. package/dist/cjs/view/render-with-host-data/index.js +35 -30
  137. package/dist/cjs/view/session-timeout/index.js +44 -35
  138. package/dist/cjs/view/storybook/decorator.js +32 -21
  139. package/dist/cjs/view/use-previous.js +29 -13
  140. package/dist/cjs/view/useMediaBreakpoints/index.js +34 -19
  141. package/dist/cjs/view/visually-hidden/index.js +41 -21
  142. package/dist/cjs/view/window-size/index.js +34 -22
  143. package/dist/es/analytics/appdynamics.js +14 -15
  144. package/dist/es/analytics/index.js +11 -17
  145. package/dist/es/analytics/page-view-event.js +12 -26
  146. package/dist/es/analytics/user-session-event.js +13 -15
  147. package/dist/es/analytics/user-wait-event.js +10 -6
  148. package/dist/es/analytics/web-analytics.js +12 -10
  149. package/dist/es/api/auth/index.js +22 -27
  150. package/dist/es/api/helpers.js +8 -81
  151. package/dist/es/api/users/index.js +7 -8
  152. package/dist/es/communication/http-client/index.js +24 -30
  153. package/dist/es/communication/http-client/request-interceptor.js +6 -3
  154. package/dist/es/communication/http-client/response-interceptor.js +20 -21
  155. package/dist/es/communication/http-client/retry-axios.js +45 -105
  156. package/dist/es/communication/http-client/retry.js +22 -25
  157. package/dist/es/communication/http-client/tests/index.test-disable.js +28 -47
  158. package/dist/es/data/auth/actions.js +13 -19
  159. package/dist/es/data/auth/reducer.js +9 -7
  160. package/dist/es/data/breakpoint/index.js +19 -21
  161. package/dist/es/data/error/index.js +11 -9
  162. package/dist/es/data/live-message/index.js +12 -16
  163. package/dist/es/data/logout/actions.js +9 -5
  164. package/dist/es/data/navigation-prompt/actions.js +9 -5
  165. package/dist/es/data/react-redux.js +7 -3
  166. package/dist/es/data/reducers.js +10 -7
  167. package/dist/es/data/saga.js +8 -5
  168. package/dist/es/data/store.js +26 -44
  169. package/dist/es/data/wait-message/actions.js +11 -9
  170. package/dist/es/data/wait-message/reducer.js +10 -10
  171. package/dist/es/index.js +183 -84
  172. package/dist/es/route/index.js +16 -19
  173. package/dist/es/route/page-view.js +9 -9
  174. package/dist/es/route/private-route/index.js +30 -38
  175. package/dist/es/sideeffect/auth/index.js +27 -14
  176. package/dist/es/sideeffect/error-toast/index.js +15 -14
  177. package/dist/es/sideeffect/wait-message/index.js +18 -14
  178. package/dist/es/typings/styled.d.js +1 -1
  179. package/dist/es/utils/app-config/config.js +11 -9
  180. package/dist/es/utils/app-config/index.js +21 -31
  181. package/dist/es/utils/app-host-integration/react.js +8 -6
  182. package/dist/es/utils/auth/helper.js +8 -4
  183. package/dist/es/utils/auth/index.js +59 -83
  184. package/dist/es/utils/constants.js +18 -13
  185. package/dist/es/utils/font-size.js +7 -3
  186. package/dist/es/utils/guest-with-service.js +6 -7
  187. package/dist/es/utils/helpers.js +10 -6
  188. package/dist/es/utils/history.js +7 -3
  189. package/dist/es/utils/log-records.js +34 -31
  190. package/dist/es/utils/micro-frontend/console-logger.js +17 -13
  191. package/dist/es/utils/micro-frontend/guest.js +52 -108
  192. package/dist/es/utils/micro-frontend/host.js +53 -89
  193. package/dist/es/utils/micro-frontend/index.js +39 -37
  194. package/dist/es/utils/micro-frontend/types.js +0 -1
  195. package/dist/es/utils/redact-pii.js +10 -11
  196. package/dist/es/utils/service-worker.js +14 -11
  197. package/dist/es/utils/session.js +47 -48
  198. package/dist/es/utils/storybook/manager.js +8 -5
  199. package/dist/es/utils/storybook/preview.js +30 -26
  200. package/dist/es/utils/storybook/theme.js +9 -6
  201. package/dist/es/utils/testing/index.js +14 -21
  202. package/dist/es/utils/testing/render-with-redux.js +13 -13
  203. package/dist/es/utils/testing/render-with-router-redux.js +19 -21
  204. package/dist/es/utils/testing/render-with-router.js +14 -16
  205. package/dist/es/utils/testing/render-with-state-addons.js +18 -18
  206. package/dist/es/utils/url.js +7 -3
  207. package/dist/es/utils/web-storage.js +21 -17
  208. package/dist/es/utils/window.js +18 -18
  209. package/dist/es/view/app-root/hosted-app.js +13 -17
  210. package/dist/es/view/app-root/index.js +34 -39
  211. package/dist/es/view/app-root/stand-alone-app.js +17 -19
  212. package/dist/es/view/app-root/style.js +30 -5
  213. package/dist/es/view/error-boundary/default-error-template.js +4 -5
  214. package/dist/es/view/error-boundary/index.js +20 -27
  215. package/dist/es/view/error-toast/index.js +21 -16
  216. package/dist/es/view/fetch-host-app-data/index.js +13 -13
  217. package/dist/es/view/fetch-host-app-data/store.js +10 -7
  218. package/dist/es/view/fields/check-box/index.js +16 -18
  219. package/dist/es/view/fields/combo-box/index.js +19 -19
  220. package/dist/es/view/fields/connect-form.js +8 -6
  221. package/dist/es/view/fields/date-input/index.js +16 -14
  222. package/dist/es/view/fields/date-picker/index.js +16 -14
  223. package/dist/es/view/fields/form-item-layout/index.js +15 -16
  224. package/dist/es/view/fields/input-mask/index.js +20 -14
  225. package/dist/es/view/fields/large-text-box/index.js +16 -14
  226. package/dist/es/view/fields/radio/index.js +16 -18
  227. package/dist/es/view/fields/radio-group/index.js +14 -15
  228. package/dist/es/view/fields/text-box/index.js +16 -14
  229. package/dist/es/view/fields/watch-value.js +19 -24
  230. package/dist/es/view/form/index.js +22 -22
  231. package/dist/es/view/form/personal-info-section.js +31 -52
  232. package/dist/es/view/form/submit-button/index.js +12 -10
  233. package/dist/es/view/guest-unload-handlers/index.js +11 -10
  234. package/dist/es/view/header/center-region/index.js +40 -23
  235. package/dist/es/view/header/index.js +19 -19
  236. package/dist/es/view/header/logo-region/index.js +9 -10
  237. package/dist/es/view/header/nav-region/index.js +22 -15
  238. package/dist/es/view/header/nav-region/notification/index.js +6 -7
  239. package/dist/es/view/header/nav-region/user/index.js +6 -7
  240. package/dist/es/view/host-binding-events/index.js +7 -3
  241. package/dist/es/view/intro.stories.mdx +1 -1
  242. package/dist/es/view/live-message/index.js +13 -23
  243. package/dist/es/view/loadable/index.js +12 -15
  244. package/dist/es/view/login/index.js +14 -18
  245. package/dist/es/view/media-breakpoint/index.js +19 -17
  246. package/dist/es/view/message-to-host-app/index.js +11 -10
  247. package/dist/es/view/micro-app/app-factory/index.js +67 -86
  248. package/dist/es/view/micro-app/const.js +4 -1
  249. package/dist/es/view/micro-app/index.js +13 -11
  250. package/dist/es/view/micro-app/resources/manifest.js +19 -19
  251. package/dist/es/view/micro-app/resources/script.js +36 -36
  252. package/dist/es/view/micro-app/resources/style.js +23 -22
  253. package/dist/es/view/micro-app/types.js +0 -1
  254. package/dist/es/view/micro-app/use-app-will-render.js +32 -28
  255. package/dist/es/view/micro-app/utils.js +12 -14
  256. package/dist/es/view/micro-iframe-app/app.js +15 -22
  257. package/dist/es/view/micro-iframe-app/iframe/const.js +4 -1
  258. package/dist/es/view/micro-iframe-app/iframe/index.js +27 -32
  259. package/dist/es/view/micro-iframe-app/index.js +11 -12
  260. package/dist/es/view/micro-iframe-app/types.js +0 -1
  261. package/dist/es/view/micro-iframe-app/use-frame-loaded.js +16 -21
  262. package/dist/es/view/modals/error/index.js +12 -10
  263. package/dist/es/view/modals/navigation-prompt/index.js +12 -16
  264. package/dist/es/view/modals/session-expiry/customHooks.js +13 -15
  265. package/dist/es/view/modals/session-expiry/index.js +16 -24
  266. package/dist/es/view/modals/wait-message/html-wait-message.js +10 -10
  267. package/dist/es/view/modals/wait-message/index.js +31 -39
  268. package/dist/es/view/modals/wait-message/wait-message-launcher.js +9 -8
  269. package/dist/es/view/render-with-delay/index.js +7 -10
  270. package/dist/es/view/render-with-host-data/index.js +11 -15
  271. package/dist/es/view/session-timeout/index.js +21 -12
  272. package/dist/es/view/storybook/decorator.js +9 -7
  273. package/dist/es/view/use-previous.js +6 -3
  274. package/dist/es/view/useMediaBreakpoints/index.js +11 -9
  275. package/dist/es/view/visually-hidden/index.js +19 -10
  276. package/dist/es/view/window-size/index.js +12 -11
  277. package/dist/types/data/store.d.ts +1 -1
  278. package/dist/types/utils/storybook/main.d.cts +49 -0
  279. package/dist/types/utils/storybook/{middleware.d.ts → middleware.d.cts} +0 -0
  280. package/dist/types/utils/storybook/preview.d.ts +2 -2
  281. package/dist/types/utils/storybook/vite.d.cts +4 -0
  282. package/dist/types/utils/storybook/webpack.d.cts +16 -0
  283. package/dist/types/utils/testing/render-with-redux.d.ts +1 -1
  284. package/dist/types/utils/testing/render-with-router-redux.d.ts +1 -1
  285. package/dist/types/utils/window.d.ts +1 -1
  286. package/dist/types/view/visually-hidden/index.d.ts +1 -3
  287. package/package.json +8 -6
  288. package/dist/cjs/api/users/index.endpoint.js +0 -14
  289. package/dist/cjs/communication/http-client/tests/hello.endpoint.js +0 -14
  290. package/dist/cjs/communication/http-client/tests/private.endpoint.js +0 -14
  291. package/dist/cjs/view/error-toast/index.stories.js +0 -128
  292. package/dist/cjs/view/fields/check-box/index.stories.js +0 -64
  293. package/dist/cjs/view/fields/check-box/set-value.stories.js +0 -83
  294. package/dist/cjs/view/fields/combo-box/index.stories.js +0 -65
  295. package/dist/cjs/view/fields/date-input/index.stories.js +0 -53
  296. package/dist/cjs/view/fields/date-input/index1.stories.js +0 -53
  297. package/dist/cjs/view/fields/date-picker/index.stories.js +0 -53
  298. package/dist/cjs/view/fields/form-item-layout/index.stories.js +0 -43
  299. package/dist/cjs/view/fields/input-mask/index.stories.js +0 -52
  300. package/dist/cjs/view/fields/large-text-box/index.stories.js +0 -47
  301. package/dist/cjs/view/fields/radio/index.stories.js +0 -60
  302. package/dist/cjs/view/fields/radio/set-value.stories.js +0 -81
  303. package/dist/cjs/view/fields/radio-group/index.stories.js +0 -85
  304. package/dist/cjs/view/fields/text-box/index.stories.js +0 -48
  305. package/dist/cjs/view/form/index.stories.js +0 -71
  306. package/dist/cjs/view/form/usecases.stories.js +0 -59
  307. package/dist/cjs/view/header/index.stories.js +0 -24
  308. package/dist/cjs/view/live-message/index.stories.js +0 -53
  309. package/dist/cjs/view/media-breakpoint/index.stories.js +0 -24
  310. package/dist/cjs/view/modals/error/index.stories.js +0 -36
  311. package/dist/cjs/view/modals/navigation-prompt/index.stories.js +0 -32
  312. package/dist/cjs/view/modals/session-expiry/index.stories.js +0 -30
  313. package/dist/cjs/view/modals/wait-message/index.stories.js +0 -47
  314. package/dist/cjs/view/session-timeout/index.stories.js +0 -28
  315. package/dist/es/api/users/index.endpoint.js +0 -14
  316. package/dist/es/communication/http-client/tests/hello.endpoint.js +0 -14
  317. package/dist/es/communication/http-client/tests/private.endpoint.js +0 -14
  318. package/dist/es/utils/storybook/main.js +0 -38
  319. package/dist/es/utils/storybook/middleware.js +0 -9
  320. package/dist/es/view/error-toast/index.stories.js +0 -108
  321. package/dist/es/view/fields/check-box/index.stories.js +0 -47
  322. package/dist/es/view/fields/check-box/set-value.stories.js +0 -65
  323. package/dist/es/view/fields/combo-box/index.stories.js +0 -48
  324. package/dist/es/view/fields/date-input/index.stories.js +0 -35
  325. package/dist/es/view/fields/date-input/index1.stories.js +0 -35
  326. package/dist/es/view/fields/date-picker/index.stories.js +0 -35
  327. package/dist/es/view/fields/form-item-layout/index.stories.js +0 -27
  328. package/dist/es/view/fields/input-mask/index.stories.js +0 -35
  329. package/dist/es/view/fields/large-text-box/index.stories.js +0 -30
  330. package/dist/es/view/fields/radio/index.stories.js +0 -43
  331. package/dist/es/view/fields/radio/set-value.stories.js +0 -63
  332. package/dist/es/view/fields/radio-group/index.stories.js +0 -68
  333. package/dist/es/view/fields/text-box/index.stories.js +0 -31
  334. package/dist/es/view/form/index.stories.js +0 -56
  335. package/dist/es/view/form/usecases.stories.js +0 -43
  336. package/dist/es/view/header/index.stories.js +0 -14
  337. package/dist/es/view/live-message/index.stories.js +0 -32
  338. package/dist/es/view/media-breakpoint/index.stories.js +0 -10
  339. package/dist/es/view/modals/error/index.stories.js +0 -21
  340. package/dist/es/view/modals/navigation-prompt/index.stories.js +0 -18
  341. package/dist/es/view/modals/session-expiry/index.stories.js +0 -18
  342. package/dist/es/view/modals/wait-message/index.stories.js +0 -33
  343. package/dist/es/view/session-timeout/index.stories.js +0 -13
  344. package/dist/types/utils/storybook/main.d.ts +0 -30
  345. package/dist/types/view/fields/date-input/index1.stories.d.ts +0 -24
@@ -1,10 +1,9 @@
1
- import _jsx from "@babel/runtime/helpers/jsx";
2
-
3
- var _LogoContainer;
4
-
5
- import styled from 'styled-components';
6
- import { ReactComponent as LogoImg } from "./logo.svg";
7
- const LogoContainer = /*#__PURE__*/styled.div.withConfig({
8
- componentId: "sc-a4sia6-0"
9
- })(["align-self:center;"]);
10
- export const LogoRegion = () => _LogoContainer || (_LogoContainer = /*#__PURE__*/_jsx(LogoContainer, {}, void 0, /*#__PURE__*/_jsx(LogoImg, {})));
1
+ import styled from "styled-components";
2
+ import LogoImg from "./logo.svg";
3
+ const LogoContainer = styled.div`
4
+ align-self: center;
5
+ `;
6
+ const LogoRegion = () => /* @__PURE__ */ React.createElement(LogoContainer, null, /* @__PURE__ */ React.createElement(LogoImg, null));
7
+ export {
8
+ LogoRegion
9
+ };
@@ -1,16 +1,23 @@
1
- import _jsx from "@babel/runtime/helpers/jsx";
2
-
3
- var _NavContainer;
4
-
5
- import styled from 'styled-components';
6
- import { Notification } from "./notification/index.js";
7
- import { User } from "./user/index.js";
8
- const NavContainer = /*#__PURE__*/styled.nav.withConfig({
9
- componentId: "sc-1selspv-0"
10
- })(["display:flex;margin:0;height:100%;align-self:flex-end;"]);
11
- const NavList = /*#__PURE__*/styled.ul.withConfig({
12
- componentId: "sc-1selspv-1"
13
- })(["margin:0;display:flex;align-items:center;> li{margin-left:", ";}"], props => props.theme.space.xs);
14
- export const NavRegion = () => _NavContainer || (_NavContainer = /*#__PURE__*/_jsx(NavContainer, {
1
+ import styled from "styled-components";
2
+ import { Notification } from "./notification";
3
+ import { User } from "./user";
4
+ const NavContainer = styled.nav`
5
+ display: flex;
6
+ margin: 0;
7
+ height: 100%;
8
+ align-self: flex-end;
9
+ `;
10
+ const NavList = styled.ul`
11
+ margin: 0;
12
+ display: flex;
13
+ align-items: center;
14
+ > li {
15
+ margin-left: ${(props) => props.theme.space.xs};
16
+ }
17
+ `;
18
+ const NavRegion = () => /* @__PURE__ */ React.createElement(NavContainer, {
15
19
  role: "navigation"
16
- }, void 0, /*#__PURE__*/_jsx(NavList, {}, void 0, /*#__PURE__*/_jsx(Notification, {}), /*#__PURE__*/_jsx(User, {}))));
20
+ }, /* @__PURE__ */ React.createElement(NavList, null, /* @__PURE__ */ React.createElement(Notification, null), /* @__PURE__ */ React.createElement(User, null)));
21
+ export {
22
+ NavRegion
23
+ };
@@ -1,9 +1,8 @@
1
- import _jsx from "@babel/runtime/helpers/jsx";
2
-
3
- var _a;
4
-
5
- import { ReactComponent as NotificationIcon } from "./index.svg";
6
- export const Notification = () => /*#__PURE__*/_jsx("li", {}, void 0, _a || (_a = /*#__PURE__*/_jsx("a", {
1
+ import NotificationIcon from "./index.svg";
2
+ const Notification = () => /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("a", {
7
3
  href: "#",
8
4
  "aria-label": "Notifications"
9
- }, void 0, /*#__PURE__*/_jsx(NotificationIcon, {}))));
5
+ }, /* @__PURE__ */ React.createElement(NotificationIcon, null)));
6
+ export {
7
+ Notification
8
+ };
@@ -1,9 +1,8 @@
1
- import _jsx from "@babel/runtime/helpers/jsx";
2
-
3
- var _a;
4
-
5
- import { ReactComponent as UserIcon } from "./index.svg";
6
- export const User = () => /*#__PURE__*/_jsx("li", {}, void 0, _a || (_a = /*#__PURE__*/_jsx("a", {
1
+ import UserIcon from "./index.svg";
2
+ const User = () => /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("a", {
7
3
  href: "#",
8
4
  "aria-label": "profile"
9
- }, void 0, /*#__PURE__*/_jsx(UserIcon, {}))));
5
+ }, /* @__PURE__ */ React.createElement(UserIcon, null)));
6
+ export {
7
+ User
8
+ };
@@ -1,14 +1,18 @@
1
- export const bindEvent = (element, eventName, eventHandler) => {
1
+ const bindEvent = (element, eventName, eventHandler) => {
2
2
  if (element.addEventListener) {
3
3
  element.addEventListener(eventName, eventHandler, false);
4
4
  } else if (element.attachEvent) {
5
5
  element.attachEvent(`on${eventName}`, eventHandler);
6
6
  }
7
7
  };
8
- export const removeEvent = (element, eventName, eventHandler) => {
8
+ const removeEvent = (element, eventName, eventHandler) => {
9
9
  if (element.removeEventListener) {
10
10
  element.removeEventListener(eventName, eventHandler);
11
11
  } else if (element.detachEvent) {
12
12
  element.detachEvent(`on${eventName}`, eventHandler);
13
13
  }
14
- };
14
+ };
15
+ export {
16
+ bindEvent,
17
+ removeEvent
18
+ };
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/addon-docs';
2
2
 
3
3
  <Meta title="Intro" />
4
4
 
@@ -1,25 +1,15 @@
1
- import _jsx from "@babel/runtime/helpers/jsx";
2
- import { LiveMessage as AriaLiveMessage } from 'react-aria-live';
3
- import { useAppSelector } from "../../data/react-redux.js";
4
- export const LiveMessage = () => {
5
- const message = useAppSelector(state => {
6
- var _state$liveMessage;
7
-
8
- return (_state$liveMessage = state.liveMessage) === null || _state$liveMessage === void 0 ? void 0 : _state$liveMessage.message;
9
- });
10
- const id = useAppSelector(state => {
11
- var _state$liveMessage2;
12
-
13
- return (_state$liveMessage2 = state.liveMessage) === null || _state$liveMessage2 === void 0 ? void 0 : _state$liveMessage2.id;
14
- });
15
- const ariaLive = useAppSelector(state => {
16
- var _state$liveMessage3;
17
-
18
- return (_state$liveMessage3 = state.liveMessage) === null || _state$liveMessage3 === void 0 ? void 0 : _state$liveMessage3.ariaLive;
19
- });
20
- return /*#__PURE__*/_jsx(AriaLiveMessage, {
21
- message: message,
1
+ import { LiveMessage as AriaLiveMessage } from "react-aria-live";
2
+ import { useAppSelector } from "../../data/react-redux";
3
+ const LiveMessage = () => {
4
+ const message = useAppSelector((state) => state.liveMessage?.message);
5
+ const id = useAppSelector((state) => state.liveMessage?.id);
6
+ const ariaLive = useAppSelector((state) => state.liveMessage?.ariaLive);
7
+ return /* @__PURE__ */ React.createElement(AriaLiveMessage, {
8
+ message,
22
9
  "aria-live": ariaLive,
23
- id: id
10
+ id
24
11
  });
25
- };
12
+ };
13
+ export {
14
+ LiveMessage
15
+ };
@@ -1,16 +1,13 @@
1
- import _jsx from "@babel/runtime/helpers/jsx";
2
-
3
- var _WaitMessageLauncher;
4
-
5
- import { lazy, Suspense } from 'react';
6
- import { WaitMessageLauncher } from "../modals/wait-message/wait-message-launcher.js"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
-
8
- import { jsx as _jsx2 } from "react/jsx-runtime";
9
- export const loadable = (importFunc, fallback = _WaitMessageLauncher || (_WaitMessageLauncher = /*#__PURE__*/_jsx(WaitMessageLauncher, {}))) => {
10
- const LazyComponent = /*#__PURE__*/lazy(importFunc); // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
-
12
- return props => /*#__PURE__*/_jsx(Suspense, {
13
- fallback: fallback
14
- }, void 0, /*#__PURE__*/_jsx2(LazyComponent, { ...props
1
+ import { lazy, Suspense } from "react";
2
+ import { WaitMessageLauncher } from "../modals/wait-message/wait-message-launcher";
3
+ const loadable = (importFunc, fallback = /* @__PURE__ */ React.createElement(WaitMessageLauncher, null)) => {
4
+ const LazyComponent = lazy(importFunc);
5
+ return (props) => /* @__PURE__ */ React.createElement(Suspense, {
6
+ fallback
7
+ }, /* @__PURE__ */ React.createElement(LazyComponent, {
8
+ ...props
15
9
  }));
16
- };
10
+ };
11
+ export {
12
+ loadable
13
+ };
@@ -1,25 +1,21 @@
1
- import { useEffect } from 'react';
2
- import { useAppDispatch } from "../../data/react-redux.js";
3
- import { login } from "../../utils/auth/index.js";
4
- import { LOGIN_SUCCESS } from "../../data/auth/actions.js";
5
- import { Fragment as _Fragment } from "react/jsx-runtime";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- export const Login = ({
1
+ import { useEffect } from "react";
2
+ import { useAppDispatch } from "../../data/react-redux";
3
+ import { login } from "../../utils/auth";
4
+ import { LOGIN_SUCCESS } from "../../data/auth/actions";
5
+ const Login = ({
8
6
  clientId,
9
7
  scope,
10
8
  responseType
11
9
  }) => {
12
10
  const dispatch = useAppDispatch();
13
11
  useEffect(() => {
14
- login({
15
- clientId,
16
- scope,
17
- responseType
18
- }).then(() => {
19
- dispatch({
20
- type: LOGIN_SUCCESS
21
- });
22
- }).catch(() => {});
12
+ login({ clientId, scope, responseType }).then(() => {
13
+ dispatch({ type: LOGIN_SUCCESS });
14
+ }).catch(() => {
15
+ });
23
16
  }, [dispatch, clientId, scope, responseType]);
24
- return /*#__PURE__*/_jsx(_Fragment, {});
25
- };
17
+ return /* @__PURE__ */ React.createElement(React.Fragment, null);
18
+ };
19
+ export {
20
+ Login
21
+ };
@@ -1,22 +1,24 @@
1
- import { useEffect, useContext } from 'react';
2
- import { ThemeContext } from 'styled-components';
3
- import { publish } from 'pubsub-js';
4
- import { useAppDispatch } from "../../data/react-redux.js";
5
- import { breakpoint } from "../../data/breakpoint/index.js";
6
- import { useMediaBreakpoints } from "../useMediaBreakpoints/index.js";
7
- import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants.js";
8
- import { Fragment as _Fragment } from "react/jsx-runtime";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- export const MediaBreakpoint = () => {
1
+ import { useEffect, useContext } from "react";
2
+ import { ThemeContext } from "styled-components";
3
+ import { publish } from "pubsub-js";
4
+ import { useAppDispatch } from "../../data/react-redux";
5
+ import { breakpoint } from "../../data/breakpoint";
6
+ import { useMediaBreakpoints } from "../useMediaBreakpoints";
7
+ import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants";
8
+ const MediaBreakpoint = () => {
11
9
  const theme = useContext(ThemeContext);
12
- const currentBreakpoint = useMediaBreakpoints([`(max-width: ${theme.breakpoints.small})`, `(max-width: ${theme.breakpoints.medium})`, `(max-width: ${theme.breakpoints.large})`], ['small', 'medium', 'large'], 'large');
10
+ const currentBreakpoint = useMediaBreakpoints([
11
+ `(max-width: ${theme.breakpoints.small})`,
12
+ `(max-width: ${theme.breakpoints.medium})`,
13
+ `(max-width: ${theme.breakpoints.large})`
14
+ ], ["small", "medium", "large"], "large");
13
15
  const dispatch = useAppDispatch();
14
16
  useEffect(() => {
15
- dispatch({
16
- type: breakpoint.change,
17
- payload: currentBreakpoint
18
- });
17
+ dispatch({ type: breakpoint.change, payload: currentBreakpoint });
19
18
  publish(HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
20
19
  }, [currentBreakpoint, dispatch]);
21
- return /*#__PURE__*/_jsx(_Fragment, {});
22
- };
20
+ return /* @__PURE__ */ React.createElement(React.Fragment, null);
21
+ };
22
+ export {
23
+ MediaBreakpoint
24
+ };
@@ -1,14 +1,15 @@
1
- import { removeEvent } from "../host-binding-events/index.js";
2
- export const getHostAppData = (action, resolve) => event => {
3
- if (event.data.id === 'host-app-data') {
4
- action(event.data); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
- // @ts-ignore
6
-
7
- removeEvent(window, 'message', getHostAppData());
1
+ import { removeEvent } from "../host-binding-events";
2
+ const getHostAppData = (action, resolve) => (event) => {
3
+ if (event.data.id === "host-app-data") {
4
+ action(event.data);
5
+ removeEvent(window, "message", getHostAppData());
8
6
  }
9
-
10
7
  resolve();
11
8
  };
12
- export const sendMessageToHost = (message, hostedAppUrl = document.referrer) => {
9
+ const sendMessageToHost = (message, hostedAppUrl = document.referrer) => {
13
10
  window.parent.postMessage(message, hostedAppUrl);
14
- };
11
+ };
12
+ export {
13
+ getHostAppData,
14
+ sendMessageToHost
15
+ };
@@ -1,19 +1,25 @@
1
- /* eslint-disable max-lines */
2
- import { persistentStorage } from "../../../utils/web-storage.js";
3
- import { CMicroAppHost } from "../../../utils/micro-frontend/host.js";
4
- import { getLogger } from "../../../utils/micro-frontend/index.js";
5
- import { logRecords } from "../../../utils/log-records.js";
6
- import { APP_CONTAINER_ID_PREFIX } from "../const.js";
7
- import { getCurrentBreakpoint, getViewportSize } from "../../../utils/window.js";
8
- import { addStylesToDOM, removeDynamicImportedStyles } from "../resources/style.js";
9
- import { addScriptToDOM, removeDynamicImportedScripts, removePrefetchLinks } from "../resources/script.js";
10
- import { getAppManifest, getFullFileNameofAssetsFromManifest } from "../resources/manifest.js";
1
+ import { persistentStorage } from "../../../utils/web-storage";
2
+ import { CMicroAppHost } from "../../../utils/micro-frontend/host";
3
+ import { getLogger } from "../../../utils/micro-frontend";
4
+ import { logRecords } from "../../../utils/log-records";
5
+ import { APP_CONTAINER_ID_PREFIX } from "../const";
6
+ import { getCurrentBreakpoint, getViewportSize } from "../../../utils/window";
7
+ import {
8
+ addStylesToDOM,
9
+ removeDynamicImportedStyles
10
+ } from "../resources/style";
11
+ import {
12
+ addScriptToDOM,
13
+ removeDynamicImportedScripts,
14
+ removePrefetchLinks
15
+ } from "../resources/script";
16
+ import {
17
+ getAppManifest,
18
+ getFullFileNameofAssetsFromManifest
19
+ } from "../resources/manifest";
11
20
  const cssType = new RegExp(/\.css$/);
12
-
13
- const isCss = fileName => cssType.test(fileName);
14
-
21
+ const isCss = (fileName) => cssType.test(fileName);
15
22
  const activeApps = {};
16
-
17
23
  const initApplication = async ({
18
24
  id,
19
25
  name,
@@ -23,12 +29,10 @@ const initApplication = async ({
23
29
  manifestPath,
24
30
  homeRoute
25
31
  }) => {
26
- const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
27
-
28
- const {
29
- init
30
- } = app;
31
- if (!init || typeof init !== 'function') throw new Error(`Application ${name} with id ${id} doesn't expose init method.`);
32
+ const app = (window.emui || {})[id] || {};
33
+ const { init } = app;
34
+ if (!init || typeof init !== "function")
35
+ throw new Error(`Application ${name} with id ${id} doesn't expose init method.`);
32
36
  const prevState = await persistentStorage.get(`state-${id}`);
33
37
  return init({
34
38
  host: CMicroAppHost.getInstance(),
@@ -42,118 +46,95 @@ const initApplication = async ({
42
46
  hostViewportSize: getViewportSize()
43
47
  });
44
48
  };
45
-
46
- export const mountApp = async ({
47
- id,
48
- name
49
- }) => {
50
- const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
51
-
52
- const {
53
- mount
54
- } = app;
55
- if (!mount || typeof mount !== 'function') throw new Error(`Application ${name} with id ${id} doesn't expose mount method.`);
49
+ const mountApp = async ({ id, name }) => {
50
+ const app = (window.emui || {})[id] || {};
51
+ const { mount } = app;
52
+ if (!mount || typeof mount !== "function")
53
+ throw new Error(`Application ${name} with id ${id} doesn't expose mount method.`);
56
54
  return mount({
57
55
  containerId: `${APP_CONTAINER_ID_PREFIX}${id}`,
58
56
  hostBreakpoint: getCurrentBreakpoint(),
59
57
  hostViewportSize: getViewportSize()
60
58
  });
61
59
  };
62
- export const unmountApp = async ({
63
- id,
64
- name
65
- }) => {
60
+ const unmountApp = async ({ id, name }) => {
66
61
  const app = (window.emui || {})[id];
67
- if (!app) return null; // eslint-disable-next-line @typescript-eslint/unbound-method
68
-
69
- const {
70
- unmount
71
- } = app;
72
- if (!unmount) return null;
73
- if (typeof unmount !== 'function') throw new Error(`unmount failed for application ${name} with id ${id}. unmount is not a valid function`);
62
+ if (!app)
63
+ return null;
64
+ const { unmount } = app;
65
+ if (!unmount)
66
+ return null;
67
+ if (typeof unmount !== "function")
68
+ throw new Error(`unmount failed for application ${name} with id ${id}. unmount is not a valid function`);
74
69
  const currentState = await unmount({
75
70
  containerId: `${APP_CONTAINER_ID_PREFIX}${id}`
76
71
  });
77
-
78
72
  if (currentState) {
79
73
  await persistentStorage.set(`state-${id}`, currentState);
80
74
  }
81
-
82
75
  return Promise.resolve();
83
76
  };
84
-
85
77
  const addAppToActiveAppList = (id, elementIds) => {
86
- const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
87
-
88
- const {
89
- getRef
90
- } = app;
91
- activeApps[id] = {
92
- elementIds
93
- };
78
+ const app = (window.emui || {})[id] || {};
79
+ const { getRef } = app;
80
+ activeApps[id] = { elementIds };
94
81
  const host = CMicroAppHost.getInstance();
95
- if (host) host.activeGuests[id] = getRef && getRef() || {};
82
+ if (host)
83
+ host.activeGuests[id] = getRef && getRef() || {};
96
84
  return Promise.resolve();
97
85
  };
98
-
99
- const waitAndInitApplication = (appConfig, requests) => // wait for all assets to get downloaded
100
- Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(initApplication.bind(null, appConfig)).catch(err => {
86
+ const waitAndInitApplication = (appConfig, requests) => Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(initApplication.bind(null, appConfig)).catch((err) => {
101
87
  const logRecord = logRecords.APP_INIT_FAILED(appConfig.id, err.message);
102
- getLogger().error({ ...logRecord,
103
- exception: err
104
- });
88
+ getLogger().error({ ...logRecord, exception: err });
105
89
  throw new Error(logRecord.msg);
106
90
  });
107
-
108
91
  const removeAssetsFromDOM = (id, documentEle = document) => {
109
92
  const host = CMicroAppHost.getInstance();
110
- if (host) delete host.activeGuests[id];
111
- const {
112
- elementIds
113
- } = activeApps[id] || {};
114
-
93
+ if (host)
94
+ delete host.activeGuests[id];
95
+ const { elementIds } = activeApps[id] || {};
115
96
  if (elementIds) {
116
- elementIds.forEach(elementId => {
97
+ elementIds.forEach((elementId) => {
117
98
  const ele = documentEle.getElementById(elementId);
118
- if (ele) ele.remove();
99
+ if (ele)
100
+ ele.remove();
119
101
  });
120
102
  delete activeApps[id];
121
103
  }
122
- }; // const addGoogleTagManager = (appConfig: MicroAppConfig, counter: number) : Promise<string> | null => {
123
- // const { gtmId } = appConfig;
124
- // if (!gtmId) return null;
125
- // return addScriptToDOM(appConfig, 'https://www.googletagmanager.com/gtm.js?id=')
126
- // };
127
-
128
-
129
- export const loadApp = async appConfig => {
130
- // get application manifest & full asset name with hash value
104
+ };
105
+ const loadApp = async (appConfig) => {
131
106
  getLogger().info(logRecords.APP_LOADING(appConfig.id));
132
107
  let assets = appConfig.files;
133
108
  const manifest = await getAppManifest(appConfig);
134
- assets = getFullFileNameofAssetsFromManifest(manifest, appConfig.files); // download each asset by adding it to DOM
135
-
109
+ assets = getFullFileNameofAssetsFromManifest(manifest, appConfig.files);
136
110
  let counter = 0;
137
- const requests = assets.map(fileName => {
111
+ const requests = assets.map((fileName) => {
138
112
  counter += 1;
139
113
  return !isCss(fileName) ? addScriptToDOM(appConfig, fileName, counter) : addStylesToDOM(appConfig, fileName, counter);
140
- }); // wait for all assets to get loaded in DOM and init
141
-
114
+ });
142
115
  await waitAndInitApplication(appConfig, requests);
143
116
  getLogger().info(logRecords.APP_LOADING_COMPLETE(appConfig.id));
144
117
  };
145
- export const unloadApp = ({
118
+ const unloadApp = ({
146
119
  id,
147
120
  hostUrl,
148
121
  documentEle
149
122
  }) => {
150
123
  getLogger().info(logRecords.APP_UNLOADING(id));
151
124
  const app = (window.emui || {})[id];
152
- if (!app) return;
125
+ if (!app)
126
+ return;
153
127
  removeAssetsFromDOM(id, documentEle);
154
128
  removeDynamicImportedScripts(hostUrl, documentEle);
155
129
  removePrefetchLinks(hostUrl, documentEle);
156
130
  removeDynamicImportedStyles(hostUrl, documentEle);
157
- if (window.emui && window.emui[id]) delete window.emui[id];
131
+ if (window.emui && window.emui[id])
132
+ delete window.emui[id];
158
133
  getLogger().info(logRecords.APP_UNLOADING_COMPLETE(id));
159
- };
134
+ };
135
+ export {
136
+ loadApp,
137
+ mountApp,
138
+ unloadApp,
139
+ unmountApp
140
+ };
@@ -1 +1,4 @@
1
- export const APP_CONTAINER_ID_PREFIX = 'pui-app-container-';
1
+ const APP_CONTAINER_ID_PREFIX = "pui-app-container-";
2
+ export {
3
+ APP_CONTAINER_ID_PREFIX
4
+ };
@@ -1,15 +1,17 @@
1
- import _jsx from "@babel/runtime/helpers/jsx";
2
- import _styled from "styled-components";
3
- import { memo } from 'react';
4
- import { APP_CONTAINER_ID_PREFIX } from "./const.js";
5
- import { useAppWillRender } from "./use-app-will-render.js";
6
- export const MicroApp = /*#__PURE__*/memo(props => {
1
+ import { memo } from "react";
2
+ import styled from "styled-components";
3
+ import { APP_CONTAINER_ID_PREFIX } from "./const";
4
+ import { useAppWillRender } from "./use-app-will-render";
5
+ const Div = styled.div`
6
+ height: 100%;
7
+ width: 100%;
8
+ `;
9
+ const MicroApp = memo((props) => {
7
10
  useAppWillRender(props);
8
- return /*#__PURE__*/_jsx(_StyledDiv, {
11
+ return /* @__PURE__ */ React.createElement(Div, {
9
12
  id: `${APP_CONTAINER_ID_PREFIX}${props.id}`
10
13
  });
11
14
  });
12
-
13
- var _StyledDiv = /*#__PURE__*/_styled("div").withConfig({
14
- componentId: "sc-1bjah6z-0"
15
- })(["height:100%;width:100%;"]);
15
+ export {
16
+ MicroApp
17
+ };
@@ -1,38 +1,38 @@
1
- import { getHTTPClient } from "../../../communication/http-client/index.js";
2
- import { removeDoubleSlash } from "../../../utils/url.js";
3
- import { getLogger } from "../../../utils/micro-frontend/index.js";
4
- import { logRecords } from "../../../utils/log-records.js";
5
-
6
- const getUnVersionedManifestPath = path => path.replace(/\/\d+\.\d+/, '/latest');
7
-
8
- export const getAppManifest = async ({
1
+ import { getHTTPClient } from "../../../communication/http-client";
2
+ import { removeDoubleSlash } from "../../../utils/url";
3
+ import { getLogger } from "../../../utils/micro-frontend";
4
+ import { logRecords } from "../../../utils/log-records";
5
+ const getUnVersionedManifestPath = (path) => path.replace(/\/\d+\.\d+/, "/latest");
6
+ const getAppManifest = async ({
9
7
  hostUrl,
10
8
  manifestPath
11
9
  }) => {
12
- const url = new URL(`${manifestPath.replace(/\/?$/, '/')}manifest.json`, hostUrl);
10
+ const url = new URL(`${manifestPath.replace(/\/?$/, "/")}manifest.json`, hostUrl);
13
11
  const response = await getHTTPClient().get(removeDoubleSlash(url.href));
14
- const {
15
- headers
16
- } = response;
17
- if (headers['content-type'] && headers['content-type'].includes('application/json')) return response.data;
12
+ const { headers } = response;
13
+ if (headers["content-type"] && headers["content-type"].includes("application/json"))
14
+ return response.data;
18
15
  const unVersionedManifestPath = getUnVersionedManifestPath(manifestPath);
19
-
20
16
  if (manifestPath !== unVersionedManifestPath) {
21
17
  return getAppManifest({
22
18
  hostUrl,
23
19
  manifestPath: getUnVersionedManifestPath(manifestPath)
24
20
  });
25
21
  }
26
-
27
- throw new Error('manifest.json is not available for the application');
22
+ throw new Error("manifest.json is not available for the application");
28
23
  };
29
- export const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
24
+ const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
30
25
  const fullFileName = manifest[assetName];
31
- if (fullFileName) assets.push(fullFileName); // eslint-disable-next-line no-console
26
+ if (fullFileName)
27
+ assets.push(fullFileName);
32
28
  else {
33
29
  const logRecord = logRecords.ASSET_NOT_FOUND_IN_MANIFEST(assetName);
34
30
  getLogger().error(logRecord);
35
31
  throw new Error(logRecord.msg);
36
32
  }
37
33
  return assets;
38
- }, []);
34
+ }, []);
35
+ export {
36
+ getAppManifest,
37
+ getFullFileNameofAssetsFromManifest
38
+ };