@elliemae/pui-app-sdk 2.21.1 → 3.0.0-beta.12
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.
- package/dist/cjs/analytics/appdynamics.js +40 -30
- package/dist/cjs/analytics/index.js +33 -26
- package/dist/cjs/analytics/page-view-event.js +35 -34
- package/dist/cjs/analytics/user-session-event.js +35 -27
- package/dist/cjs/analytics/user-wait-event.js +32 -17
- package/dist/cjs/analytics/web-analytics.js +33 -19
- package/dist/cjs/api/auth/index.js +42 -39
- package/dist/cjs/api/helpers.js +34 -99
- package/dist/cjs/api/users/index.js +29 -16
- package/dist/cjs/communication/http-client/index.js +50 -48
- package/dist/cjs/communication/http-client/request-interceptor.js +29 -12
- package/dist/cjs/communication/http-client/response-interceptor.js +47 -38
- package/dist/cjs/communication/http-client/retry-axios.js +74 -122
- package/dist/cjs/communication/http-client/retry.js +43 -36
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +48 -56
- package/dist/cjs/data/auth/actions.js +34 -26
- package/dist/cjs/data/auth/reducer.js +36 -18
- package/dist/cjs/data/breakpoint/index.js +44 -32
- package/dist/cjs/data/error/index.js +34 -18
- package/dist/cjs/data/index.js +35 -0
- package/dist/cjs/data/live-message/index.js +35 -25
- package/dist/cjs/data/logout/actions.js +29 -9
- package/dist/cjs/data/navigation-prompt/actions.js +29 -9
- package/dist/cjs/data/react-redux.js +30 -13
- package/dist/cjs/data/reducers.js +36 -23
- package/dist/cjs/data/saga.js +29 -9
- package/dist/cjs/data/store.js +51 -65
- package/dist/cjs/data/wait-message/actions.js +31 -13
- package/dist/cjs/data/wait-message/reducer.js +38 -24
- package/dist/cjs/index.js +195 -809
- package/dist/cjs/micro-frontend.js +34 -0
- package/dist/cjs/route/index.js +44 -32
- package/dist/cjs/route/page-view.js +36 -22
- package/dist/cjs/route/private-route/index.js +59 -60
- package/dist/cjs/sideeffect/auth/index.js +43 -30
- package/dist/cjs/sideeffect/error-toast/index.js +40 -26
- package/dist/cjs/sideeffect/wait-message/index.js +46 -29
- package/dist/cjs/typings/custom.d.js +0 -0
- package/dist/cjs/typings/elliemae.d.js +0 -0
- package/dist/cjs/typings/styled.d.js +1 -0
- package/dist/cjs/typings/thirdparty.d.js +0 -0
- package/dist/cjs/utils/app-config/config.js +39 -33
- package/dist/cjs/utils/app-config/index.js +48 -44
- package/dist/cjs/utils/app-host-integration/react.js +28 -14
- package/dist/cjs/utils/auth/helper.js +36 -18
- package/dist/cjs/utils/auth/index.js +77 -116
- package/dist/cjs/utils/await.js +20 -0
- package/dist/cjs/utils/constants.js +39 -21
- package/dist/cjs/utils/font-size.js +30 -14
- package/dist/cjs/utils/guest-with-service.js +28 -12
- package/dist/cjs/utils/helpers.js +32 -19
- package/dist/cjs/utils/history.js +30 -12
- package/dist/cjs/utils/log-records.js +55 -35
- package/dist/cjs/utils/micro-frontend/console-logger.js +40 -23
- package/dist/cjs/utils/micro-frontend/guest.js +86 -127
- package/dist/cjs/utils/micro-frontend/host.js +86 -125
- package/dist/cjs/utils/micro-frontend/index.js +66 -61
- package/dist/cjs/utils/micro-frontend/types.js +20 -5
- package/dist/cjs/utils/redact-pii.js +32 -17
- package/dist/cjs/utils/service-worker.js +37 -21
- package/dist/cjs/utils/session.js +65 -70
- package/dist/cjs/utils/storybook/cjs/main.js +53 -0
- package/dist/cjs/utils/storybook/cjs/middleware.js +5 -0
- package/dist/cjs/utils/storybook/cjs/vite.js +6 -0
- package/dist/cjs/utils/storybook/cjs/webpack.js +21 -0
- package/dist/cjs/utils/storybook/manager.js +32 -16
- package/dist/cjs/utils/storybook/preview.js +59 -50
- package/dist/cjs/utils/storybook/theme.js +31 -14
- package/dist/cjs/utils/testing/index.js +45 -50
- package/dist/cjs/utils/testing/render-with-redux.js +41 -27
- package/dist/cjs/utils/testing/render-with-router-redux.js +47 -37
- package/dist/cjs/utils/testing/render-with-router.js +41 -28
- package/dist/cjs/utils/testing/render-with-state-addons.js +47 -36
- package/dist/cjs/utils/types.js +20 -0
- package/dist/cjs/utils/url.js +29 -13
- package/dist/cjs/utils/web-storage.js +46 -30
- package/dist/cjs/utils/window.js +37 -28
- package/dist/cjs/view/app-root/hosted-app.js +42 -32
- package/dist/cjs/view/app-root/index.js +64 -62
- package/dist/cjs/view/app-root/stand-alone-app.js +45 -37
- package/dist/cjs/view/app-root/style.js +51 -12
- package/dist/cjs/view/error-boundary/default-error-template.js +33 -15
- package/dist/cjs/view/error-boundary/index.js +47 -43
- package/dist/cjs/view/error-toast/index.js +49 -32
- package/dist/cjs/view/fetch-host-app-data/index.js +40 -26
- package/dist/cjs/view/fetch-host-app-data/store.js +32 -24
- package/dist/cjs/view/fields/check-box/index.js +41 -39
- package/dist/cjs/view/fields/combo-box/index.js +44 -31
- package/dist/cjs/view/fields/connect-form.js +31 -15
- package/dist/cjs/view/fields/date-input/index.js +41 -26
- package/dist/cjs/view/fields/date-picker/index.js +41 -26
- package/dist/cjs/view/fields/form-item-layout/index.js +43 -30
- package/dist/cjs/view/fields/input-mask/index.js +42 -41
- package/dist/cjs/view/fields/large-text-box/index.js +41 -26
- package/dist/cjs/view/fields/radio/index.js +41 -30
- package/dist/cjs/view/fields/radio-group/index.js +39 -27
- package/dist/cjs/view/fields/text-box/index.js +41 -26
- package/dist/cjs/view/fields/watch-value.js +48 -35
- package/dist/cjs/view/form/index.js +48 -34
- package/dist/cjs/view/form/personal-info-section.js +63 -80
- package/dist/cjs/view/form/submit-button/index.js +41 -23
- package/dist/cjs/view/guest-unload-handlers/index.js +34 -22
- package/dist/cjs/view/header/center-region/index.js +68 -38
- package/dist/cjs/view/header/index.js +48 -35
- package/dist/cjs/view/header/logo-region/index.js +38 -23
- package/dist/cjs/view/header/nav-region/index.js +51 -30
- package/dist/cjs/view/header/nav-region/notification/index.js +35 -18
- package/dist/cjs/view/header/nav-region/user/index.js +35 -18
- package/dist/cjs/view/host-binding-events/index.js +27 -11
- package/dist/cjs/view/intro.stories.mdx +1 -1
- package/dist/cjs/view/live-message/index.js +40 -34
- package/dist/cjs/view/loadable/index.js +40 -27
- package/dist/cjs/view/login/index.js +43 -30
- package/dist/cjs/view/media-breakpoint/index.js +50 -34
- package/dist/cjs/view/message-to-host-app/index.js +32 -20
- package/dist/cjs/view/micro-app/app-factory/index.js +101 -135
- package/dist/cjs/view/micro-app/const.js +27 -7
- package/dist/cjs/view/micro-app/index.js +44 -27
- package/dist/cjs/view/micro-app/resources/manifest.js +44 -35
- package/dist/cjs/view/micro-app/resources/script.js +57 -53
- package/dist/cjs/view/micro-app/resources/style.js +45 -38
- package/dist/cjs/view/micro-app/types.js +20 -5
- package/dist/cjs/view/micro-app/use-app-will-render.js +59 -50
- package/dist/cjs/view/micro-app/utils.js +33 -21
- package/dist/cjs/view/micro-iframe-app/app.js +44 -39
- package/dist/cjs/view/micro-iframe-app/iframe/const.js +27 -7
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +58 -47
- package/dist/cjs/view/micro-iframe-app/index.js +43 -24
- package/dist/cjs/view/micro-iframe-app/types.js +20 -5
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +43 -37
- package/dist/cjs/view/modals/error/index.js +42 -28
- package/dist/cjs/view/modals/navigation-prompt/index.js +45 -37
- package/dist/cjs/view/modals/session-expiry/customHooks.js +41 -35
- package/dist/cjs/view/modals/session-expiry/index.js +53 -51
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +39 -18
- package/dist/cjs/view/modals/wait-message/index.js +57 -53
- package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +40 -21
- package/dist/cjs/view/render-with-delay/index.js +37 -19
- package/dist/cjs/view/render-with-host-data/index.js +42 -30
- package/dist/cjs/view/session-timeout/index.js +51 -35
- package/dist/cjs/view/storybook/decorator.js +39 -21
- package/dist/cjs/view/use-previous.js +30 -13
- package/dist/cjs/view/useMediaBreakpoints/index.js +35 -19
- package/dist/cjs/view/visually-hidden/index.js +48 -21
- package/dist/cjs/view/window-size/index.js +41 -22
- package/dist/es/analytics/appdynamics.js +14 -15
- package/dist/es/analytics/index.js +8 -14
- package/dist/es/analytics/page-view-event.js +11 -25
- package/dist/es/analytics/user-session-event.js +11 -13
- package/dist/es/analytics/user-wait-event.js +9 -5
- package/dist/es/analytics/web-analytics.js +12 -10
- package/dist/es/api/auth/index.js +21 -26
- package/dist/es/api/helpers.js +8 -81
- package/dist/es/api/users/index.js +6 -7
- package/dist/es/communication/http-client/index.js +19 -25
- package/dist/es/communication/http-client/request-interceptor.js +5 -2
- package/dist/es/communication/http-client/response-interceptor.js +20 -21
- package/dist/es/communication/http-client/retry-axios.js +45 -105
- package/dist/es/communication/http-client/retry.js +22 -25
- package/dist/es/communication/http-client/tests/index.test-disable.js +25 -44
- package/dist/es/data/auth/actions.js +13 -19
- package/dist/es/data/auth/reducer.js +8 -6
- package/dist/es/data/breakpoint/index.js +19 -21
- package/dist/es/data/error/index.js +11 -9
- package/dist/es/data/index.js +11 -0
- package/dist/es/data/live-message/index.js +12 -16
- package/dist/es/data/logout/actions.js +9 -5
- package/dist/es/data/navigation-prompt/actions.js +9 -5
- package/dist/es/data/react-redux.js +7 -3
- package/dist/es/data/reducers.js +6 -3
- package/dist/es/data/saga.js +8 -5
- package/dist/es/data/store.js +24 -51
- package/dist/es/data/wait-message/actions.js +11 -9
- package/dist/es/data/wait-message/reducer.js +9 -9
- package/dist/es/index.js +192 -83
- package/dist/es/micro-frontend.js +10 -0
- package/dist/es/route/index.js +16 -18
- package/dist/es/route/page-view.js +8 -8
- package/dist/es/route/private-route/index.js +24 -31
- package/dist/es/sideeffect/auth/index.js +24 -11
- package/dist/es/sideeffect/error-toast/index.js +11 -10
- package/dist/es/sideeffect/wait-message/index.js +14 -10
- package/dist/es/typings/custom.d.js +0 -0
- package/dist/es/typings/elliemae.d.js +0 -0
- package/dist/es/typings/styled.d.js +1 -0
- package/dist/es/typings/thirdparty.d.js +0 -0
- package/dist/es/utils/app-config/config.js +11 -9
- package/dist/es/utils/app-config/index.js +17 -27
- package/dist/es/utils/app-host-integration/react.js +8 -6
- package/dist/es/utils/auth/helper.js +7 -3
- package/dist/es/utils/auth/index.js +51 -75
- package/dist/es/utils/constants.js +18 -13
- package/dist/es/utils/font-size.js +7 -3
- package/dist/es/utils/guest-with-service.js +6 -7
- package/dist/es/utils/helpers.js +10 -6
- package/dist/es/utils/history.js +7 -3
- package/dist/es/utils/log-records.js +34 -31
- package/dist/es/utils/micro-frontend/console-logger.js +16 -12
- package/dist/es/utils/micro-frontend/guest.js +44 -100
- package/dist/es/utils/micro-frontend/host.js +41 -77
- package/dist/es/utils/micro-frontend/index.js +35 -33
- package/dist/es/utils/micro-frontend/types.js +0 -1
- package/dist/es/utils/redact-pii.js +10 -11
- package/dist/es/utils/service-worker.js +13 -10
- package/dist/es/utils/session.js +45 -46
- package/dist/es/utils/storybook/manager.js +7 -4
- package/dist/es/utils/storybook/preview.js +27 -24
- package/dist/es/utils/storybook/theme.js +9 -6
- package/dist/es/utils/testing/index.js +12 -18
- package/dist/es/utils/testing/render-with-redux.js +12 -11
- package/dist/es/utils/testing/render-with-router-redux.js +18 -19
- package/dist/es/utils/testing/render-with-router.js +15 -16
- package/dist/es/utils/testing/render-with-state-addons.js +19 -18
- package/dist/es/utils/url.js +7 -3
- package/dist/es/utils/web-storage.js +21 -17
- package/dist/es/utils/window.js +18 -18
- package/dist/es/view/app-root/hosted-app.js +10 -13
- package/dist/es/view/app-root/index.js +29 -33
- package/dist/es/view/app-root/stand-alone-app.js +11 -12
- package/dist/es/view/app-root/style.js +30 -5
- package/dist/es/view/error-boundary/default-error-template.js +5 -5
- package/dist/es/view/error-boundary/index.js +18 -25
- package/dist/es/view/error-toast/index.js +15 -14
- package/dist/es/view/fetch-host-app-data/index.js +14 -11
- package/dist/es/view/fetch-host-app-data/store.js +10 -7
- package/dist/es/view/fields/check-box/index.js +17 -18
- package/dist/es/view/fields/combo-box/index.js +20 -19
- package/dist/es/view/fields/connect-form.js +8 -6
- package/dist/es/view/fields/date-input/index.js +17 -14
- package/dist/es/view/fields/date-picker/index.js +17 -14
- package/dist/es/view/fields/form-item-layout/index.js +15 -15
- package/dist/es/view/fields/input-mask/index.js +22 -14
- package/dist/es/view/fields/large-text-box/index.js +17 -14
- package/dist/es/view/fields/radio/index.js +17 -18
- package/dist/es/view/fields/radio-group/index.js +15 -15
- package/dist/es/view/fields/text-box/index.js +17 -14
- package/dist/es/view/fields/watch-value.js +20 -24
- package/dist/es/view/form/index.js +23 -22
- package/dist/es/view/form/personal-info-section.js +28 -48
- package/dist/es/view/form/submit-button/index.js +13 -10
- package/dist/es/view/guest-unload-handlers/index.js +10 -9
- package/dist/es/view/header/center-region/index.js +41 -23
- package/dist/es/view/header/index.js +16 -15
- package/dist/es/view/header/logo-region/index.js +9 -9
- package/dist/es/view/header/nav-region/index.js +21 -13
- package/dist/es/view/header/nav-region/notification/index.js +6 -6
- package/dist/es/view/header/nav-region/user/index.js +6 -6
- package/dist/es/view/host-binding-events/index.js +7 -3
- package/dist/es/view/intro.stories.mdx +1 -1
- package/dist/es/view/live-message/index.js +13 -22
- package/dist/es/view/loadable/index.js +13 -15
- package/dist/es/view/login/index.js +12 -15
- package/dist/es/view/media-breakpoint/index.js +16 -13
- package/dist/es/view/message-to-host-app/index.js +10 -9
- package/dist/es/view/micro-app/app-factory/index.js +67 -82
- package/dist/es/view/micro-app/const.js +4 -1
- package/dist/es/view/micro-app/index.js +12 -9
- package/dist/es/view/micro-app/resources/manifest.js +17 -16
- package/dist/es/view/micro-app/resources/script.js +35 -35
- package/dist/es/view/micro-app/resources/style.js +22 -21
- package/dist/es/view/micro-app/types.js +0 -1
- package/dist/es/view/micro-app/use-app-will-render.js +35 -26
- package/dist/es/view/micro-app/utils.js +11 -13
- package/dist/es/view/micro-iframe-app/app.js +14 -20
- package/dist/es/view/micro-iframe-app/iframe/const.js +4 -1
- package/dist/es/view/micro-iframe-app/iframe/index.js +27 -31
- package/dist/es/view/micro-iframe-app/index.js +10 -10
- package/dist/es/view/micro-iframe-app/types.js +0 -1
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +15 -19
- package/dist/es/view/modals/error/index.js +13 -10
- package/dist/es/view/modals/navigation-prompt/index.js +11 -14
- package/dist/es/view/modals/session-expiry/customHooks.js +11 -13
- package/dist/es/view/modals/session-expiry/index.js +13 -20
- package/dist/es/view/modals/wait-message/html-wait-message.js +11 -10
- package/dist/es/view/modals/wait-message/index.js +30 -37
- package/dist/es/view/modals/wait-message/wait-message-launcher.js +8 -6
- package/dist/es/view/render-with-delay/index.js +8 -10
- package/dist/es/view/render-with-host-data/index.js +10 -13
- package/dist/es/view/session-timeout/index.js +20 -10
- package/dist/es/view/storybook/decorator.js +8 -5
- package/dist/es/view/use-previous.js +6 -3
- package/dist/es/view/useMediaBreakpoints/index.js +11 -9
- package/dist/es/view/visually-hidden/index.js +20 -10
- package/dist/es/view/window-size/index.js +12 -10
- package/dist/types/communication/http-client/retry.d.ts +1 -1
- package/dist/types/data/index.d.ts +4 -0
- package/dist/types/data/react-redux.d.ts +11 -11
- package/dist/types/data/reducers.d.ts +6 -6
- package/dist/types/data/store.d.ts +29 -29
- package/dist/types/index.d.ts +79 -79
- package/dist/types/micro-frontend.d.ts +6 -0
- package/dist/types/route/private-route/index.d.ts +1 -1
- package/dist/types/sideeffect/auth/index.d.ts +1 -1
- package/dist/types/utils/app-host-integration/react.d.ts +1 -1
- package/dist/types/utils/micro-frontend/guest.d.ts +2 -2
- package/dist/types/utils/micro-frontend/host.d.ts +1 -1
- package/dist/types/utils/micro-frontend/index.d.ts +2 -2
- package/dist/types/utils/micro-frontend/types.d.ts +1 -1
- package/dist/types/utils/storybook/cjs/main.d.ts +63 -0
- package/dist/types/utils/storybook/{middleware.d.ts → cjs/middleware.d.ts} +0 -0
- package/dist/types/utils/storybook/cjs/vite.d.ts +4 -0
- package/dist/types/utils/storybook/cjs/webpack.d.ts +16 -0
- package/dist/types/utils/storybook/preview.d.ts +9 -3
- package/dist/types/utils/testing/render-with-redux.d.ts +20 -20
- package/dist/types/utils/testing/render-with-router-redux.d.ts +20 -20
- package/dist/types/utils/window.d.ts +1 -1
- package/dist/types/view/app-root/index.d.ts +1 -1
- package/dist/types/view/fields/check-box/index.stories.d.ts +1 -1
- package/dist/types/view/fields/check-box/set-value.stories.d.ts +1 -1
- package/dist/types/view/fields/combo-box/index.stories.d.ts +1 -1
- package/dist/types/view/fields/date-input/index.stories.d.ts +1 -1
- package/dist/types/view/fields/date-picker/index.stories.d.ts +1 -1
- package/dist/types/view/fields/form-item-layout/index.stories.d.ts +1 -1
- package/dist/types/view/fields/input-mask/index.stories.d.ts +1 -1
- package/dist/types/view/fields/large-text-box/index.stories.d.ts +1 -1
- package/dist/types/view/fields/radio/index.stories.d.ts +1 -1
- package/dist/types/view/fields/radio/set-value.stories.d.ts +1 -1
- package/dist/types/view/fields/radio-group/index.stories.d.ts +1 -1
- package/dist/types/view/fields/text-box/index.stories.d.ts +1 -1
- package/dist/types/view/form/usecases.stories.d.ts +1 -1
- package/dist/types/view/header/index.d.ts +1 -1
- package/dist/types/view/header/index.stories.d.ts +1 -1
- package/dist/types/view/micro-app/app-factory/index.d.ts +2 -2
- package/dist/types/view/micro-app/index.d.ts +1 -1
- package/dist/types/view/micro-app/resources/script.d.ts +1 -1
- package/dist/types/view/micro-app/resources/style.d.ts +1 -1
- package/dist/types/view/micro-app/use-app-will-render.d.ts +1 -1
- package/dist/types/view/micro-iframe-app/app.d.ts +2 -2
- package/dist/types/view/micro-iframe-app/index.d.ts +1 -1
- package/dist/types/view/micro-iframe-app/types.d.ts +1 -1
- package/dist/types/view/micro-iframe-app/use-frame-loaded.d.ts +1 -1
- package/dist/types/view/modals/error/index.stories.d.ts +1 -1
- package/dist/types/view/modals/navigation-prompt/index.stories.d.ts +1 -1
- package/dist/types/view/modals/session-expiry/index.stories.d.ts +1 -1
- package/dist/types/view/modals/wait-message/index.stories.d.ts +1 -1
- package/dist/types/view/storybook/decorator.d.ts +1 -1
- package/dist/types/view/visually-hidden/index.d.ts +1 -3
- package/package.json +36 -25
- package/dist/cjs/api/users/index.endpoint.js +0 -14
- package/dist/cjs/communication/http-client/tests/hello.endpoint.js +0 -14
- package/dist/cjs/communication/http-client/tests/private.endpoint.js +0 -14
- package/dist/cjs/utils/storybook/main.js +0 -38
- package/dist/cjs/utils/storybook/middleware.js +0 -9
- package/dist/cjs/view/error-toast/index.stories.js +0 -128
- package/dist/cjs/view/fields/check-box/index.stories.js +0 -64
- package/dist/cjs/view/fields/check-box/set-value.stories.js +0 -83
- package/dist/cjs/view/fields/combo-box/index.stories.js +0 -65
- package/dist/cjs/view/fields/date-input/index.stories.js +0 -53
- package/dist/cjs/view/fields/date-input/index1.stories.js +0 -53
- package/dist/cjs/view/fields/date-picker/index.stories.js +0 -53
- package/dist/cjs/view/fields/form-item-layout/index.stories.js +0 -43
- package/dist/cjs/view/fields/input-mask/index.stories.js +0 -52
- package/dist/cjs/view/fields/large-text-box/index.stories.js +0 -47
- package/dist/cjs/view/fields/radio/index.stories.js +0 -60
- package/dist/cjs/view/fields/radio/set-value.stories.js +0 -81
- package/dist/cjs/view/fields/radio-group/index.stories.js +0 -85
- package/dist/cjs/view/fields/text-box/index.stories.js +0 -48
- package/dist/cjs/view/form/index.stories.js +0 -71
- package/dist/cjs/view/form/usecases.stories.js +0 -59
- package/dist/cjs/view/header/index.stories.js +0 -24
- package/dist/cjs/view/live-message/index.stories.js +0 -53
- package/dist/cjs/view/media-breakpoint/index.stories.js +0 -24
- package/dist/cjs/view/modals/error/index.stories.js +0 -36
- package/dist/cjs/view/modals/navigation-prompt/index.stories.js +0 -32
- package/dist/cjs/view/modals/session-expiry/index.stories.js +0 -30
- package/dist/cjs/view/modals/wait-message/index.stories.js +0 -47
- package/dist/cjs/view/session-timeout/index.stories.js +0 -28
- package/dist/es/api/users/index.endpoint.js +0 -14
- package/dist/es/communication/http-client/tests/hello.endpoint.js +0 -14
- package/dist/es/communication/http-client/tests/private.endpoint.js +0 -14
- package/dist/es/utils/storybook/main.js +0 -38
- package/dist/es/utils/storybook/middleware.js +0 -9
- package/dist/es/view/error-toast/index.stories.js +0 -108
- package/dist/es/view/fields/check-box/index.stories.js +0 -47
- package/dist/es/view/fields/check-box/set-value.stories.js +0 -65
- package/dist/es/view/fields/combo-box/index.stories.js +0 -48
- package/dist/es/view/fields/date-input/index.stories.js +0 -35
- package/dist/es/view/fields/date-input/index1.stories.js +0 -35
- package/dist/es/view/fields/date-picker/index.stories.js +0 -35
- package/dist/es/view/fields/form-item-layout/index.stories.js +0 -27
- package/dist/es/view/fields/input-mask/index.stories.js +0 -35
- package/dist/es/view/fields/large-text-box/index.stories.js +0 -30
- package/dist/es/view/fields/radio/index.stories.js +0 -43
- package/dist/es/view/fields/radio/set-value.stories.js +0 -63
- package/dist/es/view/fields/radio-group/index.stories.js +0 -68
- package/dist/es/view/fields/text-box/index.stories.js +0 -31
- package/dist/es/view/form/index.stories.js +0 -56
- package/dist/es/view/form/usecases.stories.js +0 -43
- package/dist/es/view/header/index.stories.js +0 -14
- package/dist/es/view/live-message/index.stories.js +0 -32
- package/dist/es/view/media-breakpoint/index.stories.js +0 -10
- package/dist/es/view/modals/error/index.stories.js +0 -21
- package/dist/es/view/modals/navigation-prompt/index.stories.js +0 -18
- package/dist/es/view/modals/session-expiry/index.stories.js +0 -18
- package/dist/es/view/modals/wait-message/index.stories.js +0 -33
- package/dist/es/view/session-timeout/index.stories.js +0 -13
- package/dist/types/utils/storybook/main.d.ts +0 -30
- package/dist/types/view/fields/date-input/index1.stories.d.ts +0 -24
|
@@ -1,38 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var media_breakpoint_exports = {};
|
|
29
|
+
__export(media_breakpoint_exports, {
|
|
30
|
+
MediaBreakpoint: () => MediaBreakpoint
|
|
5
31
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _reactRedux = require("../../data/react-redux.js");
|
|
15
|
-
|
|
16
|
-
var _index = require("../../data/breakpoint/index.js");
|
|
17
|
-
|
|
18
|
-
var _index2 = require("../useMediaBreakpoints/index.js");
|
|
19
|
-
|
|
20
|
-
var _constants = require("../../utils/constants.js");
|
|
21
|
-
|
|
22
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
var import_styled_components = require("styled-components");
|
|
35
|
+
var import_pubsub_js = require("pubsub-js");
|
|
36
|
+
var import_react_redux = require("../../data/react-redux.js");
|
|
37
|
+
var import_breakpoint = require("../../data/breakpoint/index.js");
|
|
38
|
+
var import_useMediaBreakpoints = require("../useMediaBreakpoints/index.js");
|
|
39
|
+
var import_constants = require("../../utils/constants.js");
|
|
24
40
|
const MediaBreakpoint = () => {
|
|
25
|
-
const theme = (0,
|
|
26
|
-
const currentBreakpoint = (0,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(
|
|
41
|
+
const theme = (0, import_react.useContext)(import_styled_components.ThemeContext);
|
|
42
|
+
const currentBreakpoint = (0, import_useMediaBreakpoints.useMediaBreakpoints)([
|
|
43
|
+
`(max-width: ${theme.breakpoints.small})`,
|
|
44
|
+
`(max-width: ${theme.breakpoints.medium})`,
|
|
45
|
+
`(max-width: ${theme.breakpoints.large})`
|
|
46
|
+
], ["small", "medium", "large"], "large");
|
|
47
|
+
const dispatch = (0, import_react_redux.useAppDispatch)();
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
dispatch({ type: import_breakpoint.breakpoint.change, payload: currentBreakpoint });
|
|
50
|
+
(0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
|
|
34
51
|
}, [currentBreakpoint, dispatch]);
|
|
35
|
-
return
|
|
52
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
36
53
|
};
|
|
37
|
-
|
|
38
|
-
exports.MediaBreakpoint = MediaBreakpoint;
|
|
54
|
+
module.exports = __toCommonJS(media_breakpoint_exports);
|
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
11
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(module2))
|
|
13
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
14
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
19
|
+
return (module2, temp) => {
|
|
20
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
21
|
+
};
|
|
22
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
23
|
+
var message_to_host_app_exports = {};
|
|
24
|
+
__export(message_to_host_app_exports, {
|
|
25
|
+
getHostAppData: () => getHostAppData,
|
|
26
|
+
sendMessageToHost: () => sendMessageToHost
|
|
5
27
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (event.data.id === 'host-app-data') {
|
|
12
|
-
action(event.data); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
|
|
15
|
-
(0, _index.removeEvent)(window, 'message', getHostAppData());
|
|
28
|
+
var import_host_binding_events = require("../host-binding-events/index.js");
|
|
29
|
+
const getHostAppData = (action, resolve) => (event) => {
|
|
30
|
+
if (event.data.id === "host-app-data") {
|
|
31
|
+
action(event.data);
|
|
32
|
+
(0, import_host_binding_events.removeEvent)(window, "message", getHostAppData());
|
|
16
33
|
}
|
|
17
|
-
|
|
18
34
|
resolve();
|
|
19
35
|
};
|
|
20
|
-
|
|
21
|
-
exports.getHostAppData = getHostAppData;
|
|
22
|
-
|
|
23
36
|
const sendMessageToHost = (message, hostedAppUrl = document.referrer) => {
|
|
24
37
|
window.parent.postMessage(message, hostedAppUrl);
|
|
25
38
|
};
|
|
26
|
-
|
|
27
|
-
exports.sendMessageToHost = sendMessageToHost;
|
|
39
|
+
module.exports = __toCommonJS(message_to_host_app_exports);
|
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
11
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(module2))
|
|
13
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
14
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
19
|
+
return (module2, temp) => {
|
|
20
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
21
|
+
};
|
|
22
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
23
|
+
var app_factory_exports = {};
|
|
24
|
+
__export(app_factory_exports, {
|
|
25
|
+
loadApp: () => loadApp,
|
|
26
|
+
mountApp: () => mountApp,
|
|
27
|
+
unloadApp: () => unloadApp,
|
|
28
|
+
unmountApp: () => unmountApp
|
|
5
29
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _const = require("../const.js");
|
|
17
|
-
|
|
18
|
-
var _window = require("../../../utils/window.js");
|
|
19
|
-
|
|
20
|
-
var _style = require("../resources/style.js");
|
|
21
|
-
|
|
22
|
-
var _script = require("../resources/script.js");
|
|
23
|
-
|
|
24
|
-
var _manifest = require("../resources/manifest.js");
|
|
25
|
-
|
|
26
|
-
/* eslint-disable max-lines */
|
|
30
|
+
var import_web_storage = require("../../../utils/web-storage.js");
|
|
31
|
+
var import_host = require("../../../utils/micro-frontend/host.js");
|
|
32
|
+
var import_micro_frontend = require("../../../utils/micro-frontend/index.js");
|
|
33
|
+
var import_log_records = require("../../../utils/log-records.js");
|
|
34
|
+
var import_const = require("../const.js");
|
|
35
|
+
var import_window = require("../../../utils/window.js");
|
|
36
|
+
var import_style = require("../resources/style.js");
|
|
37
|
+
var import_script = require("../resources/script.js");
|
|
38
|
+
var import_manifest = require("../resources/manifest.js");
|
|
27
39
|
const cssType = new RegExp(/\.css$/);
|
|
28
|
-
|
|
29
|
-
const isCss = fileName => cssType.test(fileName);
|
|
30
|
-
|
|
40
|
+
const isCss = (fileName) => cssType.test(fileName);
|
|
31
41
|
const activeApps = {};
|
|
32
|
-
|
|
33
42
|
const initApplication = async ({
|
|
34
43
|
id,
|
|
35
44
|
name,
|
|
@@ -39,152 +48,109 @@ const initApplication = async ({
|
|
|
39
48
|
manifestPath,
|
|
40
49
|
homeRoute
|
|
41
50
|
}) => {
|
|
42
|
-
const app = (window.emui || {})[id] || {};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
init
|
|
46
|
-
|
|
47
|
-
if (!init || typeof init !== 'function') throw new Error(`Application ${name} with id ${id} doesn't expose init method.`);
|
|
48
|
-
const prevState = await _webStorage.persistentStorage.get(`state-${id}`);
|
|
51
|
+
const app = (window.emui || {})[id] || {};
|
|
52
|
+
const { init } = app;
|
|
53
|
+
if (!init || typeof init !== "function")
|
|
54
|
+
throw new Error(`Application ${name} with id ${id} doesn't expose init method.`);
|
|
55
|
+
const prevState = await import_web_storage.persistentStorage.get(`state-${id}`);
|
|
49
56
|
return init({
|
|
50
|
-
host:
|
|
57
|
+
host: import_host.CMicroAppHost.getInstance(),
|
|
51
58
|
hostUrl,
|
|
52
59
|
manifestPath,
|
|
53
60
|
homeRoute,
|
|
54
61
|
prevState,
|
|
55
62
|
history,
|
|
56
63
|
theme,
|
|
57
|
-
hostBreakpoint: (0,
|
|
58
|
-
hostViewportSize: (0,
|
|
64
|
+
hostBreakpoint: (0, import_window.getCurrentBreakpoint)(),
|
|
65
|
+
hostViewportSize: (0, import_window.getViewportSize)()
|
|
59
66
|
});
|
|
60
67
|
};
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
67
|
-
|
|
68
|
-
const {
|
|
69
|
-
mount
|
|
70
|
-
} = app;
|
|
71
|
-
if (!mount || typeof mount !== 'function') throw new Error(`Application ${name} with id ${id} doesn't expose mount method.`);
|
|
68
|
+
const mountApp = async ({ id, name }) => {
|
|
69
|
+
const app = (window.emui || {})[id] || {};
|
|
70
|
+
const { mount } = app;
|
|
71
|
+
if (!mount || typeof mount !== "function")
|
|
72
|
+
throw new Error(`Application ${name} with id ${id} doesn't expose mount method.`);
|
|
72
73
|
return mount({
|
|
73
|
-
containerId: `${
|
|
74
|
-
hostBreakpoint: (0,
|
|
75
|
-
hostViewportSize: (0,
|
|
74
|
+
containerId: `${import_const.APP_CONTAINER_ID_PREFIX}${id}`,
|
|
75
|
+
hostBreakpoint: (0, import_window.getCurrentBreakpoint)(),
|
|
76
|
+
hostViewportSize: (0, import_window.getViewportSize)()
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
|
-
|
|
79
|
-
exports.mountApp = mountApp;
|
|
80
|
-
|
|
81
|
-
const unmountApp = async ({
|
|
82
|
-
id,
|
|
83
|
-
name
|
|
84
|
-
}) => {
|
|
79
|
+
const unmountApp = async ({ id, name }) => {
|
|
85
80
|
const app = (window.emui || {})[id];
|
|
86
|
-
if (!app)
|
|
87
|
-
|
|
88
|
-
const {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
|
|
81
|
+
if (!app)
|
|
82
|
+
return null;
|
|
83
|
+
const { unmount } = app;
|
|
84
|
+
if (!unmount)
|
|
85
|
+
return null;
|
|
86
|
+
if (typeof unmount !== "function")
|
|
87
|
+
throw new Error(`unmount failed for application ${name} with id ${id}. unmount is not a valid function`);
|
|
93
88
|
const currentState = await unmount({
|
|
94
|
-
containerId: `${
|
|
89
|
+
containerId: `${import_const.APP_CONTAINER_ID_PREFIX}${id}`
|
|
95
90
|
});
|
|
96
|
-
|
|
97
91
|
if (currentState) {
|
|
98
|
-
await
|
|
92
|
+
await import_web_storage.persistentStorage.set(`state-${id}`, currentState);
|
|
99
93
|
}
|
|
100
|
-
|
|
101
94
|
return Promise.resolve();
|
|
102
95
|
};
|
|
103
|
-
|
|
104
|
-
exports.unmountApp = unmountApp;
|
|
105
|
-
|
|
106
96
|
const addAppToActiveAppList = (id, elementIds) => {
|
|
107
|
-
const app = (window.emui || {})[id] || {};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
elementIds
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const host = _host.CMicroAppHost.getInstance();
|
|
117
|
-
|
|
118
|
-
if (host) host.activeGuests[id] = getRef && getRef() || {};
|
|
97
|
+
const app = (window.emui || {})[id] || {};
|
|
98
|
+
const { getRef } = app;
|
|
99
|
+
activeApps[id] = { elementIds };
|
|
100
|
+
const host = import_host.CMicroAppHost.getInstance();
|
|
101
|
+
if (host)
|
|
102
|
+
host.activeGuests[id] = getRef && getRef() || {};
|
|
119
103
|
return Promise.resolve();
|
|
120
104
|
};
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const logRecord = _logRecords.logRecords.APP_INIT_FAILED(appConfig.id, err.message);
|
|
125
|
-
|
|
126
|
-
(0, _index.getLogger)().error({ ...logRecord,
|
|
127
|
-
exception: err
|
|
128
|
-
});
|
|
105
|
+
const waitAndInitApplication = (appConfig, requests) => Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(initApplication.bind(null, appConfig)).catch((err) => {
|
|
106
|
+
const logRecord = import_log_records.logRecords.APP_INIT_FAILED(appConfig.id, err.message);
|
|
107
|
+
(0, import_micro_frontend.getLogger)().error({ ...logRecord, exception: err });
|
|
129
108
|
throw new Error(logRecord.msg);
|
|
130
109
|
});
|
|
131
|
-
|
|
132
110
|
const removeAssetsFromDOM = (id, documentEle = document) => {
|
|
133
|
-
const host =
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const {
|
|
137
|
-
elementIds
|
|
138
|
-
} = activeApps[id] || {};
|
|
139
|
-
|
|
111
|
+
const host = import_host.CMicroAppHost.getInstance();
|
|
112
|
+
if (host)
|
|
113
|
+
delete host.activeGuests[id];
|
|
114
|
+
const { elementIds } = activeApps[id] || {};
|
|
140
115
|
if (elementIds) {
|
|
141
|
-
elementIds.forEach(elementId => {
|
|
116
|
+
elementIds.forEach((elementId) => {
|
|
142
117
|
const ele = documentEle.getElementById(elementId);
|
|
143
|
-
if (ele)
|
|
118
|
+
if (ele)
|
|
119
|
+
ele.remove();
|
|
144
120
|
});
|
|
145
121
|
delete activeApps[id];
|
|
146
122
|
}
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
// return addScriptToDOM(appConfig, 'https://www.googletagmanager.com/gtm.js?id=')
|
|
151
|
-
// };
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const loadApp = async appConfig => {
|
|
155
|
-
// get application manifest & full asset name with hash value
|
|
156
|
-
(0, _index.getLogger)().info(_logRecords.logRecords.APP_LOADING(appConfig.id));
|
|
123
|
+
};
|
|
124
|
+
const loadApp = async (appConfig) => {
|
|
125
|
+
(0, import_micro_frontend.getLogger)().info(import_log_records.logRecords.APP_LOADING(appConfig.id));
|
|
157
126
|
let assets = appConfig.files;
|
|
158
|
-
const manifest = await (0,
|
|
159
|
-
assets = (0,
|
|
160
|
-
|
|
127
|
+
const manifest = await (0, import_manifest.getAppManifest)(appConfig);
|
|
128
|
+
assets = (0, import_manifest.getFullFileNameofAssetsFromManifest)(manifest, appConfig.files);
|
|
161
129
|
let counter = 0;
|
|
162
|
-
const requests = assets.map(fileName => {
|
|
130
|
+
const requests = assets.map((fileName) => {
|
|
163
131
|
counter += 1;
|
|
164
|
-
return !isCss(fileName) ? (0,
|
|
165
|
-
});
|
|
166
|
-
|
|
132
|
+
return !isCss(fileName) ? (0, import_script.addScriptToDOM)(appConfig, fileName, counter) : (0, import_style.addStylesToDOM)(appConfig, fileName, counter);
|
|
133
|
+
});
|
|
167
134
|
await waitAndInitApplication(appConfig, requests);
|
|
168
|
-
(0,
|
|
135
|
+
(0, import_micro_frontend.getLogger)().info(import_log_records.logRecords.APP_LOADING_COMPLETE(appConfig.id));
|
|
169
136
|
};
|
|
170
|
-
|
|
171
|
-
exports.loadApp = loadApp;
|
|
172
|
-
|
|
173
137
|
const unloadApp = ({
|
|
174
138
|
id,
|
|
175
139
|
hostUrl,
|
|
176
140
|
documentEle
|
|
177
141
|
}) => {
|
|
178
|
-
if (!hostUrl)
|
|
179
|
-
|
|
142
|
+
if (!hostUrl)
|
|
143
|
+
throw new Error("Unable to unload app. hostUrl is required");
|
|
144
|
+
(0, import_micro_frontend.getLogger)().info(import_log_records.logRecords.APP_UNLOADING(id));
|
|
180
145
|
const app = (window.emui || {})[id];
|
|
181
|
-
if (!app)
|
|
146
|
+
if (!app)
|
|
147
|
+
return;
|
|
182
148
|
removeAssetsFromDOM(id, documentEle);
|
|
183
|
-
(0,
|
|
184
|
-
(0,
|
|
185
|
-
(0,
|
|
186
|
-
if (window.emui && window.emui[id])
|
|
187
|
-
|
|
149
|
+
(0, import_script.removeDynamicImportedScripts)(hostUrl, documentEle);
|
|
150
|
+
(0, import_script.removePrefetchLinks)(hostUrl, documentEle);
|
|
151
|
+
(0, import_style.removeDynamicImportedStyles)(hostUrl, documentEle);
|
|
152
|
+
if (window.emui && window.emui[id])
|
|
153
|
+
delete window.emui[id];
|
|
154
|
+
(0, import_micro_frontend.getLogger)().info(import_log_records.logRecords.APP_UNLOADING_COMPLETE(id));
|
|
188
155
|
};
|
|
189
|
-
|
|
190
|
-
exports.unloadApp = unloadApp;
|
|
156
|
+
module.exports = __toCommonJS(app_factory_exports);
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
11
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(module2))
|
|
13
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
14
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
19
|
+
return (module2, temp) => {
|
|
20
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
21
|
+
};
|
|
22
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
23
|
+
var const_exports = {};
|
|
24
|
+
__export(const_exports, {
|
|
25
|
+
APP_CONTAINER_ID_PREFIX: () => APP_CONTAINER_ID_PREFIX
|
|
5
26
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.APP_CONTAINER_ID_PREFIX = APP_CONTAINER_ID_PREFIX;
|
|
27
|
+
const APP_CONTAINER_ID_PREFIX = "pui-app-container-";
|
|
28
|
+
module.exports = __toCommonJS(const_exports);
|
|
@@ -1,30 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var micro_app_exports = {};
|
|
29
|
+
__export(micro_app_exports, {
|
|
30
|
+
MicroApp: () => MicroApp
|
|
7
31
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(0, _useAppWillRender.useAppWillRender)(props);
|
|
22
|
-
return /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {
|
|
23
|
-
id: `${_const.APP_CONTAINER_ID_PREFIX}${props.id}`
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
35
|
+
var import_const = require("./const.js");
|
|
36
|
+
var import_use_app_will_render = require("./use-app-will-render.js");
|
|
37
|
+
const Div = import_styled_components.default.div`
|
|
38
|
+
height: 100%;
|
|
39
|
+
width: 100%;
|
|
40
|
+
`;
|
|
41
|
+
const MicroApp = (0, import_react.memo)((props) => {
|
|
42
|
+
(0, import_use_app_will_render.useAppWillRender)(props);
|
|
43
|
+
return /* @__PURE__ */ React.createElement(Div, {
|
|
44
|
+
id: `${import_const.APP_CONTAINER_ID_PREFIX}${props.id}`
|
|
24
45
|
});
|
|
25
46
|
});
|
|
26
|
-
exports
|
|
27
|
-
|
|
28
|
-
var _StyledDiv = /*#__PURE__*/(0, _styledComponents.default)("div").withConfig({
|
|
29
|
-
componentId: "sc-1bjah6z-0"
|
|
30
|
-
})(["height:100%;width:100%;"]);
|
|
47
|
+
module.exports = __toCommonJS(micro_app_exports);
|
|
@@ -1,55 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
11
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(module2))
|
|
13
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
14
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
19
|
+
return (module2, temp) => {
|
|
20
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
21
|
+
};
|
|
22
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
23
|
+
var manifest_exports = {};
|
|
24
|
+
__export(manifest_exports, {
|
|
25
|
+
getAppManifest: () => getAppManifest,
|
|
26
|
+
getFullFileNameofAssetsFromManifest: () => getFullFileNameofAssetsFromManifest
|
|
5
27
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _index2 = require("../../../utils/micro-frontend/index.js");
|
|
13
|
-
|
|
14
|
-
var _logRecords = require("../../../utils/log-records.js");
|
|
15
|
-
|
|
16
|
-
const getUnVersionedManifestPath = path => path.replace(/\/\d+\.\d+/, '/latest');
|
|
17
|
-
|
|
28
|
+
var import_http_client = require("../../../communication/http-client/index.js");
|
|
29
|
+
var import_url = require("../../../utils/url.js");
|
|
30
|
+
var import_micro_frontend = require("../../../utils/micro-frontend/index.js");
|
|
31
|
+
var import_log_records = require("../../../utils/log-records.js");
|
|
32
|
+
const getUnVersionedManifestPath = (path) => path.replace(/\/\d+\.\d+/, "/latest");
|
|
18
33
|
const getAppManifest = async ({
|
|
19
34
|
hostUrl,
|
|
20
35
|
manifestPath
|
|
21
36
|
}) => {
|
|
22
|
-
if (!hostUrl || !manifestPath)
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
if (!hostUrl || !manifestPath)
|
|
38
|
+
throw new Error("Unable to get app manifest. hostUrl and manifestPath are required.");
|
|
39
|
+
const url = new URL(`${manifestPath.replace(/\/?$/, "/")}manifest.json`, hostUrl);
|
|
40
|
+
const response = await (0, import_http_client.getHTTPClient)().get((0, import_url.removeDoubleSlash)(url.href));
|
|
41
|
+
const { headers } = response;
|
|
42
|
+
if (headers["content-type"] && headers["content-type"].includes("application/json"))
|
|
43
|
+
return response.data;
|
|
29
44
|
const unVersionedManifestPath = getUnVersionedManifestPath(manifestPath);
|
|
30
|
-
|
|
31
45
|
if (manifestPath !== unVersionedManifestPath) {
|
|
32
46
|
return getAppManifest({
|
|
33
47
|
hostUrl,
|
|
34
48
|
manifestPath: getUnVersionedManifestPath(manifestPath)
|
|
35
49
|
});
|
|
36
50
|
}
|
|
37
|
-
|
|
38
|
-
throw new Error('manifest.json is not available for the application');
|
|
51
|
+
throw new Error("manifest.json is not available for the application");
|
|
39
52
|
};
|
|
40
|
-
|
|
41
|
-
exports.getAppManifest = getAppManifest;
|
|
42
|
-
|
|
43
53
|
const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
|
|
44
54
|
const fullFileName = manifest[assetName];
|
|
45
|
-
if (fullFileName)
|
|
55
|
+
if (fullFileName)
|
|
56
|
+
assets.push(fullFileName);
|
|
46
57
|
else {
|
|
47
|
-
const logRecord =
|
|
48
|
-
|
|
49
|
-
(0, _index2.getLogger)().error(logRecord);
|
|
58
|
+
const logRecord = import_log_records.logRecords.ASSET_NOT_FOUND_IN_MANIFEST(assetName);
|
|
59
|
+
(0, import_micro_frontend.getLogger)().error(logRecord);
|
|
50
60
|
throw new Error(logRecord.msg);
|
|
51
61
|
}
|
|
52
62
|
return assets;
|
|
53
63
|
}, []);
|
|
54
|
-
|
|
55
|
-
exports.getFullFileNameofAssetsFromManifest = getFullFileNameofAssetsFromManifest;
|
|
64
|
+
module.exports = __toCommonJS(manifest_exports);
|