@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,9 +1,9 @@
1
- import { combineReducers } from '@reduxjs/toolkit';
2
- import { waitMessageReducer } from "./wait-message/reducer.js";
3
- import { errorReducer } from "./error/index.js";
4
- import { breakpointReducer } from "./breakpoint/index.js";
5
- import { liveMessageReducer } from "./live-message/index.js";
6
- export const createReducer = (injectedReducers = {}) => {
1
+ import { combineReducers } from "@reduxjs/toolkit";
2
+ import { waitMessageReducer } from "./wait-message/reducer";
3
+ import { errorReducer } from "./error";
4
+ import { breakpointReducer } from "./breakpoint";
5
+ import { liveMessageReducer } from "./live-message";
6
+ const createReducer = (injectedReducers = {}) => {
7
7
  const rootReducer = combineReducers({
8
8
  waitMessage: waitMessageReducer,
9
9
  error: errorReducer,
@@ -12,4 +12,7 @@ export const createReducer = (injectedReducers = {}) => {
12
12
  ...injectedReducers
13
13
  });
14
14
  return rootReducer;
15
- };
15
+ };
16
+ export {
17
+ createReducer
18
+ };
@@ -1,5 +1,8 @@
1
- export const AllowedModes = {
2
- RestartOnRemount: 'RESTART_ON_REMOUNT',
3
- Daemon: 'DAEMON',
4
- OnceTillUnmount: 'ONCE_TILL_UNMOUNT'
5
- };
1
+ const AllowedModes = {
2
+ RestartOnRemount: "RESTART_ON_REMOUNT",
3
+ Daemon: "DAEMON",
4
+ OnceTillUnmount: "ONCE_TILL_UNMOUNT"
5
+ };
6
+ export {
7
+ AllowedModes
8
+ };
@@ -1,67 +1,49 @@
1
- /* eslint-disable max-params */
2
- // @strip-block
3
- import { configureStore } from '@reduxjs/toolkit';
4
- import { createInjectorsEnhancer, forceReducerReload } from 'redux-injectors';
5
- import { routerMiddleware } from 'connected-react-router';
6
- import createSagaMiddleware from 'redux-saga';
7
- import { createReducer } from "./reducers.js";
1
+ import { configureStore } from "@reduxjs/toolkit";
2
+ import { createInjectorsEnhancer, forceReducerReload } from "redux-injectors";
3
+ import createSagaMiddleware from "redux-saga";
4
+ import { createReducer } from "./reducers";
8
5
  const rootReducer = createReducer();
9
- // global variable
10
6
  let appStore = null;
11
- export const setStore = store => {
7
+ const setStore = (store) => {
12
8
  appStore = store;
13
9
  };
14
- export const getStore = () => appStore;
15
-
16
- const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
17
- thunk: false
18
- }) => {
19
- // eslint-disable-next-line @typescript-eslint/unbound-method
20
- const {
21
- run: runSaga
22
- } = sagaMiddleware;
23
- const enhancers = [createInjectorsEnhancer({
24
- createReducer,
25
- runSaga
26
- })];
10
+ const getStore = () => appStore;
11
+ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = { thunk: false }) => {
12
+ const { run: runSaga } = sagaMiddleware;
13
+ const enhancers = [
14
+ createInjectorsEnhancer({
15
+ createReducer,
16
+ runSaga
17
+ })
18
+ ];
27
19
  const baseStore = configureStore({
28
20
  reducer: rootReducer,
29
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
30
- // @ts-ignore
31
- middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat(routerMiddleware(history)),
32
- devTools: process.env.NODE_ENV !== 'production',
33
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
34
- // @ts-ignore
21
+ middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware),
22
+ devTools: true,
35
23
  preloadedState: initialState,
36
24
  enhancers
37
25
  });
38
26
  let hotModule = null;
39
-
40
27
  try {
41
- var _module;
42
-
43
- hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
28
+ hotModule = module?.hot;
44
29
  } catch (err) {
45
- var _import$meta;
46
-
47
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
48
- // @ts-ignore
49
- // block:start
50
- hotModule = (_import$meta = import.meta) === null || _import$meta === void 0 ? void 0 : _import$meta.webpackHot; // block:end
30
+ hotModule = import.meta?.webpackHot;
51
31
  }
52
-
53
32
  if (hotModule) {
54
- hotModule.accept('./reducers', () => {
33
+ hotModule.accept("./reducers", () => {
55
34
  forceReducerReload(baseStore);
56
35
  });
57
36
  }
58
-
59
37
  return baseStore;
60
38
  };
61
-
62
- export const createAppStore = (initialState = {}, history, middlewareConfig) => {
39
+ const createAppStore = (initialState = {}, history, middlewareConfig) => {
63
40
  const sagaMiddleware = createSagaMiddleware({});
64
41
  const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
65
42
  setStore(store);
66
43
  return store;
67
- };
44
+ };
45
+ export {
46
+ createAppStore,
47
+ getStore,
48
+ setStore
49
+ };
@@ -1,16 +1,18 @@
1
- export const ACTIONS = {
2
- OPEN: 'wait-message/OPEN',
3
- CLOSE: 'wait-message/CLOSE'
1
+ const ACTIONS = {
2
+ OPEN: "wait-message/OPEN",
3
+ CLOSE: "wait-message/CLOSE"
4
4
  };
5
- export const waitMessage = {
6
- open: (message = 'loading...') => ({
5
+ const waitMessage = {
6
+ open: (message = "loading...") => ({
7
7
  type: ACTIONS.OPEN,
8
- payload: {
9
- message
10
- }
8
+ payload: { message }
11
9
  }),
12
10
  close: () => ({
13
11
  type: ACTIONS.CLOSE,
14
12
  payload: null
15
13
  })
16
- };
14
+ };
15
+ export {
16
+ ACTIONS,
17
+ waitMessage
18
+ };
@@ -1,21 +1,21 @@
1
- /* eslint-disable no-param-reassign */
2
- import produce from 'immer';
3
- import { ACTIONS } from "./actions.js";
4
- // The initial state of the App
5
- export const initialState = {
1
+ import produce from "immer";
2
+ import { ACTIONS } from "./actions";
3
+ const initialState = {
6
4
  isOpen: null,
7
- message: 'loading...'
5
+ message: "loading..."
8
6
  };
9
- export const waitMessageReducer = (state = initialState, action) => produce(state, draft => {
10
- // eslint-disable-next-line default-case
7
+ const waitMessageReducer = (state = initialState, action) => produce(state, (draft) => {
11
8
  switch (action.type) {
12
9
  case ACTIONS.OPEN:
13
10
  draft.isOpen = true;
14
11
  draft.message = action.payload.message;
15
12
  break;
16
-
17
13
  case ACTIONS.CLOSE:
18
14
  draft.isOpen = false;
19
15
  break;
20
16
  }
21
- });
17
+ });
18
+ export {
19
+ initialState,
20
+ waitMessageReducer
21
+ };
package/dist/es/index.js CHANGED
@@ -1,84 +1,183 @@
1
- export { isUserAuthorized, login, authorize } from "./utils/auth/index.js";
2
- export { PrivateRoute } from "./route/private-route/index.js";
3
- export { AppRoute as Route } from "./route/index.js";
4
- export { getHTTPClient, getAuthHTTPClient } from "./communication/http-client/index.js";
5
- export { onAuthorizationFailure } from "./communication/http-client/response-interceptor.js";
6
- export { auth } from "./data/auth/actions.js";
7
- export { default as globalConstants } from "./utils/constants.js";
8
- export { useAppDispatch, useAppSelector } from "./data/react-redux.js";
9
- export { useInjectReducer, useInjectSaga } from 'redux-injectors';
10
- export { getAuthorizationHeader } from "./utils/auth/helper.js";
11
- export { getRedirectUrl, removeDoubleSlash } from "./utils/url.js";
12
- export { createAppStore as configureStore } from "./data/store.js";
13
- export { browserHistory as history, memoryHistory } from "./utils/history.js";
14
- export { Themes } from "./utils/constants.js";
15
- export { ACTIONS as NavigationPromptActions } from "./data/navigation-prompt/actions.js";
16
- export { loadable } from "./view/loadable/index.js";
17
- export { WaitMessage } from "./view/modals/wait-message/index.js";
18
- export { SessionTimeout } from "./view/session-timeout/index.js";
19
- export { subscribeToSessionExpiryWarning, subscribeToSessionExpiry, resetUserIdleTime, trackActivity } from "./utils/session.js";
20
- export { waitMessage as waitMessageAction } from "./data/wait-message/actions.js";
21
- export { initServiceWorker } from "./utils/service-worker.js"; // micro app apis
22
-
23
- export { CMicroAppGuest } from "./utils/micro-frontend/guest.js";
24
- export { CMicroAppHost } from "./utils/micro-frontend/host.js";
25
- export { enableReactAppForHostIntegration } from "./utils/app-host-integration/react.js";
26
- export { getAppConfigValue, setAppConfigValue, setAppConfig } from "./utils/app-config/config.js";
27
- export { getMicroFrontEndAppConfig } from "./utils/micro-frontend/index.js";
28
- export { loadAppConfig } from "./utils/app-config/index.js";
29
- export { AppRoot } from "./view/app-root/index.js";
30
- export { ErrorBoundary } from "./view/error-boundary/index.js";
31
- export { isProd, isCIBuild } from "./utils/helpers.js";
32
- export { listenStorageEvents, removeStorageEvents } from "./utils/web-storage.js";
33
- export { getHostAppDataByKey, setHostAppData } from "./view/fetch-host-app-data/store.js";
34
- export { sendMessageToHost } from "./view/message-to-host-app/index.js";
35
- export { onGuestUnloadStart, notifyGuestUnloadComplete } from "./view/guest-unload-handlers/index.js";
36
- export { renderWithHostData } from "./view/render-with-host-data/index.js";
37
- export { fetchHostAppData } from "./view/fetch-host-app-data/index.js"; // testing utils
38
-
39
- export * from "./utils/testing/index.js";
40
- export { renderWithRouterRedux } from "./utils/testing/render-with-router-redux.js";
41
- export { renderWithRedux } from "./utils/testing/render-with-redux.js";
42
- export { renderWithRouter } from "./utils/testing/render-with-router.js";
43
- export { RenderWithStateAddOns } from "./utils/testing/render-with-state-addons.js"; // util methods
44
-
45
- export { getApiActionCreator, getSelectField } from "./api/helpers.js";
46
- export { getUser as fetchUserSettings } from "./api/users/index.js";
47
- export { useMediaBreakpoints } from "./view/useMediaBreakpoints/index.js"; // storybook
48
-
49
- export { withAppDecorator } from "./view/storybook/decorator.js"; // components
50
-
51
- export { Header } from "./view/header/index.js";
52
- export { ErrorToast } from "./view/error-toast/index.js";
53
- export { Form } from "./view/form/index.js";
54
- export { ConnectForm } from "./view/fields/connect-form.js";
55
- export { FormItemLayout } from "./view/fields/form-item-layout/index.js";
56
- export { TextBox } from "./view/fields/text-box/index.js";
57
- export { LargeTextBox } from "./view/fields/large-text-box/index.js";
58
- export { InputMask, MASK_TYPES, MASK_PIPES } from "./view/fields/input-mask/index.js";
59
- export { ComboBox } from "./view/fields/combo-box/index.js";
60
- export { CheckBox } from "./view/fields/check-box/index.js";
61
- export { Radio } from "./view/fields/radio/index.js";
62
- export { RadioGroup } from "./view/fields/radio-group/index.js";
63
- export { DateInput } from "./view/fields/date-input/index.js";
64
- export { DatePicker } from "./view/fields/date-picker/index.js";
65
- export { FormSubmitButton } from "./view/form/submit-button/index.js";
66
- export { MediaBreakpoint } from "./view/media-breakpoint/index.js";
67
- export { VisuallyHidden } from "./view/visually-hidden/index.js"; // redux actions
68
-
69
- export { actions as ariaLive } from "./data/live-message/index.js";
70
- export { actions as error } from "./data/error/index.js";
71
- export { actions as logout } from "./data/logout/actions.js"; // micro apps
72
-
73
- export { MicroApp } from "./view/micro-app/index.js";
74
- export { MicroIFrameApp } from "./view/micro-iframe-app/index.js";
75
- export { getNavigationLinks } from "./view/micro-app/utils.js"; // app host
76
-
77
- export { getStore } from "./data/store.js";
78
- export { RegisterService } from "./utils/guest-with-service.js"; // analytics
79
-
80
- export { setAppDynamicsUserData } from "./analytics/appdynamics.js";
81
- export { sendBAEvent } from "./analytics/index.js";
82
- export { updateBAEventParameters } from "./analytics/web-analytics.js"; // security utils
83
-
84
- export { redactPii } from "./utils/redact-pii.js"; // Type utils
1
+ import { isUserAuthorized, login, authorize } from "./utils/auth";
2
+ import { PrivateRoute } from "./route/private-route";
3
+ import { AppRoute } from "./route";
4
+ import { getHTTPClient, getAuthHTTPClient } from "./communication/http-client";
5
+ import { onAuthorizationFailure } from "./communication/http-client/response-interceptor";
6
+ import { auth } from "./data/auth/actions";
7
+ import { default as default2 } from "./utils/constants";
8
+ import { useAppDispatch, useAppSelector } from "./data/react-redux";
9
+ import { useInjectReducer, useInjectSaga } from "redux-injectors";
10
+ import { getAuthorizationHeader } from "./utils/auth/helper";
11
+ import { getRedirectUrl, removeDoubleSlash } from "./utils/url";
12
+ import { createAppStore } from "./data/store";
13
+ import { browserHistory, memoryHistory } from "./utils/history";
14
+ import { Themes } from "./utils/constants";
15
+ import { ACTIONS } from "./data/navigation-prompt/actions";
16
+ import { loadable } from "./view/loadable";
17
+ import { WaitMessage } from "./view/modals/wait-message";
18
+ import { SessionTimeout } from "./view/session-timeout";
19
+ import {
20
+ subscribeToSessionExpiryWarning,
21
+ subscribeToSessionExpiry,
22
+ resetUserIdleTime,
23
+ trackActivity
24
+ } from "./utils/session";
25
+ import { waitMessage } from "./data/wait-message/actions";
26
+ import { initServiceWorker } from "./utils/service-worker";
27
+ import { CMicroAppGuest } from "./utils/micro-frontend/guest";
28
+ import { CMicroAppHost } from "./utils/micro-frontend/host";
29
+ import { enableReactAppForHostIntegration } from "./utils/app-host-integration/react";
30
+ import {
31
+ getAppConfigValue,
32
+ setAppConfigValue,
33
+ setAppConfig
34
+ } from "./utils/app-config/config";
35
+ import { getMicroFrontEndAppConfig } from "./utils/micro-frontend";
36
+ import { loadAppConfig } from "./utils/app-config";
37
+ import { AppRoot } from "./view/app-root";
38
+ import { ErrorBoundary } from "./view/error-boundary";
39
+ import { isProd, isCIBuild } from "./utils/helpers";
40
+ import { listenStorageEvents, removeStorageEvents } from "./utils/web-storage";
41
+ import {
42
+ getHostAppDataByKey,
43
+ setHostAppData
44
+ } from "./view/fetch-host-app-data/store";
45
+ import { sendMessageToHost } from "./view/message-to-host-app";
46
+ import {
47
+ onGuestUnloadStart,
48
+ notifyGuestUnloadComplete
49
+ } from "./view/guest-unload-handlers";
50
+ import { renderWithHostData } from "./view/render-with-host-data";
51
+ import { fetchHostAppData } from "./view/fetch-host-app-data";
52
+ export * from "./utils/testing";
53
+ import { renderWithRouterRedux } from "./utils/testing/render-with-router-redux";
54
+ import { renderWithRedux } from "./utils/testing/render-with-redux";
55
+ import { renderWithRouter } from "./utils/testing/render-with-router";
56
+ import { RenderWithStateAddOns } from "./utils/testing/render-with-state-addons";
57
+ import { getApiActionCreator, getSelectField } from "./api/helpers";
58
+ import { getUser } from "./api/users";
59
+ import { useMediaBreakpoints } from "./view/useMediaBreakpoints";
60
+ import { withAppDecorator } from "./view/storybook/decorator";
61
+ import { Header } from "./view/header";
62
+ import { ErrorToast } from "./view/error-toast";
63
+ import { Form } from "./view/form";
64
+ import { ConnectForm } from "./view/fields/connect-form";
65
+ import { FormItemLayout } from "./view/fields/form-item-layout";
66
+ import { TextBox } from "./view/fields/text-box";
67
+ import { LargeTextBox } from "./view/fields/large-text-box";
68
+ import { InputMask, MASK_TYPES, MASK_PIPES } from "./view/fields/input-mask";
69
+ import { ComboBox } from "./view/fields/combo-box";
70
+ import { CheckBox } from "./view/fields/check-box";
71
+ import { Radio } from "./view/fields/radio";
72
+ import { RadioGroup } from "./view/fields/radio-group";
73
+ import { DateInput } from "./view/fields/date-input";
74
+ import { DatePicker } from "./view/fields/date-picker";
75
+ import { FormSubmitButton } from "./view/form/submit-button";
76
+ import { MediaBreakpoint } from "./view/media-breakpoint";
77
+ import { VisuallyHidden } from "./view/visually-hidden";
78
+ import { actions } from "./data/live-message";
79
+ import { actions as actions2 } from "./data/error";
80
+ import { actions as actions3 } from "./data/logout/actions";
81
+ import { MicroApp } from "./view/micro-app";
82
+ import { MicroIFrameApp } from "./view/micro-iframe-app";
83
+ import { getNavigationLinks } from "./view/micro-app/utils";
84
+ import { getStore } from "./data/store";
85
+ import { RegisterService } from "./utils/guest-with-service";
86
+ import { setAppDynamicsUserData } from "./analytics/appdynamics";
87
+ import { sendBAEvent } from "./analytics";
88
+ import { updateBAEventParameters } from "./analytics/web-analytics";
89
+ import { redactPii } from "./utils/redact-pii";
90
+ export {
91
+ AppRoot,
92
+ CMicroAppGuest,
93
+ CMicroAppHost,
94
+ CheckBox,
95
+ ComboBox,
96
+ ConnectForm,
97
+ DateInput,
98
+ DatePicker,
99
+ ErrorBoundary,
100
+ ErrorToast,
101
+ Form,
102
+ FormItemLayout,
103
+ FormSubmitButton,
104
+ Header,
105
+ InputMask,
106
+ LargeTextBox,
107
+ MASK_PIPES,
108
+ MASK_TYPES,
109
+ MediaBreakpoint,
110
+ MicroApp,
111
+ MicroIFrameApp,
112
+ ACTIONS as NavigationPromptActions,
113
+ PrivateRoute,
114
+ Radio,
115
+ RadioGroup,
116
+ RegisterService,
117
+ RenderWithStateAddOns,
118
+ AppRoute as Route,
119
+ SessionTimeout,
120
+ TextBox,
121
+ Themes,
122
+ VisuallyHidden,
123
+ WaitMessage,
124
+ actions as ariaLive,
125
+ auth,
126
+ authorize,
127
+ createAppStore as configureStore,
128
+ enableReactAppForHostIntegration,
129
+ actions2 as error,
130
+ fetchHostAppData,
131
+ getUser as fetchUserSettings,
132
+ getApiActionCreator,
133
+ getAppConfigValue,
134
+ getAuthHTTPClient,
135
+ getAuthorizationHeader,
136
+ getHTTPClient,
137
+ getHostAppDataByKey,
138
+ getMicroFrontEndAppConfig,
139
+ getNavigationLinks,
140
+ getRedirectUrl,
141
+ getSelectField,
142
+ getStore,
143
+ default2 as globalConstants,
144
+ browserHistory as history,
145
+ initServiceWorker,
146
+ isCIBuild,
147
+ isProd,
148
+ isUserAuthorized,
149
+ listenStorageEvents,
150
+ loadAppConfig,
151
+ loadable,
152
+ login,
153
+ actions3 as logout,
154
+ memoryHistory,
155
+ notifyGuestUnloadComplete,
156
+ onAuthorizationFailure,
157
+ onGuestUnloadStart,
158
+ redactPii,
159
+ removeDoubleSlash,
160
+ removeStorageEvents,
161
+ renderWithHostData,
162
+ renderWithRedux,
163
+ renderWithRouter,
164
+ renderWithRouterRedux,
165
+ resetUserIdleTime,
166
+ sendBAEvent,
167
+ sendMessageToHost,
168
+ setAppConfig,
169
+ setAppConfigValue,
170
+ setAppDynamicsUserData,
171
+ setHostAppData,
172
+ subscribeToSessionExpiry,
173
+ subscribeToSessionExpiryWarning,
174
+ trackActivity,
175
+ updateBAEventParameters,
176
+ useAppDispatch,
177
+ useAppSelector,
178
+ useInjectReducer,
179
+ useInjectSaga,
180
+ useMediaBreakpoints,
181
+ waitMessage as waitMessageAction,
182
+ withAppDecorator
183
+ };
@@ -1,28 +1,25 @@
1
- import _jsx2 from "@babel/runtime/helpers/jsx";
2
- import { Helmet } from 'react-helmet';
3
- import { useCallback } from 'react';
4
- import { Route } from 'react-router-dom';
5
- import { onPageView } from "./page-view.js";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import { Fragment as _Fragment } from "react/jsx-runtime";
8
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
- export const AppRoute = ({
1
+ import { Helmet } from "react-helmet";
2
+ import { useCallback } from "react";
3
+ import { Route } from "react-router-dom";
4
+ import { onPageView } from "./page-view";
5
+ const AppRoute = ({
10
6
  component: Component,
11
7
  render,
12
8
  children,
13
- pageTitle = 'ICE',
9
+ pageTitle = "ICE",
14
10
  ...rest
15
11
  }) => {
16
- var _Helmet;
17
-
18
- const memoizedRender = useCallback(routeProps => render && typeof render === 'function' ? render(routeProps) : Component && /*#__PURE__*/_jsx(Component, { ...routeProps
12
+ const memoizedRender = useCallback((routeProps) => render && typeof render === "function" ? render(routeProps) : Component && /* @__PURE__ */ React.createElement(Component, {
13
+ ...routeProps
19
14
  }), [Component, render]);
20
- return /*#__PURE__*/_jsx(Route, { ...rest,
21
- render: routeProps => {
15
+ return /* @__PURE__ */ React.createElement(Route, {
16
+ ...rest,
17
+ render: (routeProps) => {
22
18
  onPageView(pageTitle);
23
- return /*#__PURE__*/_jsxs(_Fragment, {
24
- children: [_Helmet || (_Helmet = /*#__PURE__*/_jsx2(Helmet, {}, void 0, /*#__PURE__*/_jsx2("title", {}, void 0, pageTitle))), children || memoizedRender(routeProps)]
25
- });
19
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Helmet, null, /* @__PURE__ */ React.createElement("title", null, pageTitle)), children || memoizedRender(routeProps));
26
20
  }
27
21
  });
28
- };
22
+ };
23
+ export {
24
+ AppRoute
25
+ };
@@ -1,15 +1,15 @@
1
- import * as brum from '@elliemae/pui-user-monitoring';
2
- import { pageViewEvent } from "../analytics/page-view-event.js";
3
- export const onPageView = pageTitle => {
1
+ import * as brum from "@elliemae/pui-user-monitoring";
2
+ import { pageViewEvent } from "../analytics/page-view-event";
3
+ const onPageView = (pageTitle) => {
4
4
  try {
5
5
  if (brum && pageTitle) {
6
6
  brum.setCustomVirtualPageName(pageTitle);
7
7
  brum.startVirtualPageMonitoringWithAutoEnd(pageTitle);
8
8
  }
9
- } catch {// eslint-disable-next-line no-empty
9
+ } catch {
10
10
  }
11
-
12
- pageViewEvent({
13
- pageTitle
14
- });
15
- };
11
+ pageViewEvent({ pageTitle });
12
+ };
13
+ export {
14
+ onPageView
15
+ };
@@ -1,53 +1,45 @@
1
- import _jsx2 from "@babel/runtime/helpers/jsx";
2
- import { useCallback } from 'react';
3
- import { useInjectReducer, useInjectSaga } from 'redux-injectors';
4
- import enums from "../../utils/constants.js";
5
- import { RenderWithDelay } from "../../view/render-with-delay/index.js";
6
- import { authReducer } from "../../data/auth/reducer.js";
7
- import { authentication } from "../../sideeffect/auth/index.js";
8
- import { Login } from "../../view/login/index.js";
9
- import { isUserAuthorized } from "../../utils/auth/index.js";
10
- import { AppRoute } from "../index.js";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- const key = 'auth';
13
- export const PrivateRoute = ({
1
+ import { useCallback } from "react";
2
+ import { useInjectReducer, useInjectSaga } from "redux-injectors";
3
+ import enums from "../../utils/constants";
4
+ import { RenderWithDelay } from "../../view/render-with-delay";
5
+ import { authReducer } from "../../data/auth/reducer";
6
+ import { authentication } from "../../sideeffect/auth";
7
+ import { Login } from "../../view/login";
8
+ import { isUserAuthorized } from "../../utils/auth";
9
+ import { AppRoute } from "../index";
10
+ const key = "auth";
11
+ const PrivateRoute = ({
14
12
  component: Component,
15
13
  render,
16
14
  children,
17
15
  clientId = enums.CLIENT_ID,
18
- scope = 'loc',
19
- responseType = 'code',
16
+ scope = "loc",
17
+ responseType = "code",
20
18
  ...rest
21
19
  }) => {
22
- var _Login;
23
-
24
- useInjectReducer({
25
- key,
26
- reducer: authReducer
27
- });
28
- useInjectSaga({
29
- key,
30
- saga: authentication
31
- });
32
- const memoizedRender = useCallback(routeProps => render && typeof render === 'function' ? render(routeProps) : Component && /*#__PURE__*/_jsx(Component, { ...routeProps
20
+ useInjectReducer({ key, reducer: authReducer });
21
+ useInjectSaga({ key, saga: authentication });
22
+ const memoizedRender = useCallback((routeProps) => render && typeof render === "function" ? render(routeProps) : Component && /* @__PURE__ */ React.createElement(Component, {
23
+ ...routeProps
33
24
  }), [Component, render]);
34
- return /*#__PURE__*/_jsx(AppRoute, { ...rest,
35
- render: routeProps => {
25
+ return /* @__PURE__ */ React.createElement(AppRoute, {
26
+ ...rest,
27
+ render: (routeProps) => {
36
28
  const userAuthorized = isUserAuthorized();
37
-
38
29
  if (userAuthorized) {
39
30
  return children || memoizedRender(routeProps);
40
31
  }
41
-
42
- const getAuthComp = () => _Login || (_Login = /*#__PURE__*/_jsx2(Login, {
43
- clientId: clientId,
44
- scope: scope,
45
- responseType: responseType
46
- }));
47
-
48
- return /*#__PURE__*/_jsx2(RenderWithDelay, {
32
+ const getAuthComp = () => /* @__PURE__ */ React.createElement(Login, {
33
+ clientId,
34
+ scope,
35
+ responseType
36
+ });
37
+ return /* @__PURE__ */ React.createElement(RenderWithDelay, {
49
38
  render: getAuthComp
50
39
  });
51
40
  }
52
41
  });
53
- };
42
+ };
43
+ export {
44
+ PrivateRoute
45
+ };