@elliemae/pui-app-sdk 5.7.1 → 6.0.0-next.10
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/README.md +8 -0
- package/dist/cjs/analytics/appdynamics.js +1 -1
- package/dist/cjs/analytics/page-view-event.js +1 -1
- package/dist/cjs/api/helpers.js +14 -4
- package/dist/cjs/api/users/index.endpoint.cjs +12 -0
- package/dist/cjs/app.config.json +2 -2
- package/dist/cjs/communication/http-client/index.js +2 -2
- package/dist/cjs/communication/http-client/response-interceptor.js +2 -2
- package/dist/cjs/communication/http-client/retry-axios.js +14 -14
- package/dist/cjs/communication/http-client/retry.js +1 -1
- package/dist/cjs/communication/http-client/tests/hello.endpoint.cjs +12 -0
- package/dist/cjs/communication/http-client/tests/private.endpoint.cjs +13 -0
- package/dist/cjs/data/appMiddleware.js +2 -3
- package/dist/cjs/{view/fields/large-text-box/index.js → data/auth-state.js} +24 -20
- package/dist/cjs/data/breakpoint-state.js +46 -0
- package/dist/cjs/data/{error/index.js → error-state.js} +3 -3
- package/dist/cjs/data/errorMiddleware.js +2 -2
- package/dist/cjs/data/listenerMiddleware.js +5 -3
- package/dist/cjs/data/{live-message/index.js → live-message-state.js} +3 -3
- package/dist/cjs/data/{logout/actions.js → logout-actions.js} +6 -16
- package/dist/cjs/data/{navigation-prompt/actions.js → navigation-prompt-actions.js} +6 -16
- package/dist/cjs/data/queryMiddleware.js +3 -1
- package/dist/cjs/data/reducers.js +8 -8
- package/dist/cjs/data/store.js +12 -8
- package/dist/cjs/data/wait-message-state.js +46 -0
- package/dist/cjs/index.js +13 -35
- package/dist/cjs/sideeffect/auth/index.js +4 -4
- package/dist/cjs/sideeffect/error-toast/index.js +3 -3
- package/dist/cjs/sideeffect/wait-message/index.js +3 -3
- package/dist/cjs/utils/app-config/config.js +2 -2
- package/dist/cjs/utils/app-config/index.js +1 -1
- package/dist/cjs/utils/auth/helper.js +2 -2
- package/dist/cjs/utils/auth/index.js +2 -2
- package/dist/cjs/utils/font-size.js +1 -1
- package/dist/cjs/utils/micro-frontend/guest.js +9 -8
- package/dist/cjs/utils/micro-frontend/host.js +10 -8
- package/dist/cjs/utils/micro-frontend/index.js +15 -5
- package/dist/cjs/utils/micro-frontend/ssfguest-adapter.js +1 -1
- package/dist/cjs/utils/session.js +26 -4
- package/dist/cjs/{data/breakpoint/index.js → utils/storybook/main.js} +31 -26
- package/dist/cjs/utils/storybook/manager.js +2 -2
- package/dist/cjs/{data/wait-message/actions.js → utils/storybook/middleware.js} +7 -18
- package/dist/cjs/utils/storybook/preview.js +10 -5
- package/dist/cjs/utils/storybook/theme.js +5 -8
- package/dist/cjs/utils/storybook/vite.js +33 -0
- package/dist/cjs/{view/fields/date-input/index.js → utils/storybook/webpack.js} +22 -20
- package/dist/cjs/utils/testing/index.js +1 -1
- package/dist/cjs/utils/testing/render-with-redux.js +1 -5
- package/dist/cjs/utils/testing/render-with-router-redux.js +1 -2
- package/dist/cjs/utils/url.js +2 -0
- package/dist/cjs/utils/web-storage.js +1 -1
- package/dist/cjs/utils/window.js +1 -1
- package/dist/cjs/view/app-root/hosted-app.js +3 -3
- package/dist/cjs/view/app-root/index.js +2 -0
- package/dist/cjs/view/app-root/stand-alone-app.js +3 -3
- package/dist/cjs/view/app-root/style.js +1 -1
- package/dist/cjs/{data/auth/actions.js → view/app-root/use-prefetch-resources.js} +15 -31
- package/dist/cjs/view/breakpoint/use-breakpoint.js +4 -4
- package/dist/cjs/view/error-boundary/index.js +2 -2
- package/dist/cjs/view/error-toast/index.js +4 -4
- package/dist/cjs/view/fetch-host-app-data/index.js +1 -1
- package/dist/cjs/view/fetch-host-app-data/store.js +12 -2
- package/dist/cjs/view/fields/autocomplete/index.js +4 -1
- package/dist/cjs/view/fields/combo-box-v3/index.js +1 -1
- package/dist/cjs/view/fields/masked-input-text/index.js +1 -1
- package/dist/cjs/view/fields/watch-value.js +1 -1
- package/dist/cjs/view/form/index.js +1 -1
- package/dist/cjs/view/form/personal-info-section.js +5 -7
- package/dist/cjs/view/login/index.js +2 -2
- package/dist/cjs/view/micro-app/app-factory/index.js +17 -7
- package/dist/cjs/view/micro-app/index.js +1 -1
- package/dist/cjs/view/micro-app/resources/script.js +16 -8
- package/dist/cjs/view/micro-app/resources/style.js +14 -1
- package/dist/cjs/view/micro-app/use-app-will-render.js +15 -5
- package/dist/cjs/view/micro-iframe-app/app.js +1 -1
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +1 -2
- package/dist/cjs/view/modals/navigation-prompt/index.js +3 -3
- package/dist/cjs/view/modals/session-expiry/index.js +3 -3
- package/dist/cjs/view/page.js +1 -1
- package/dist/cjs/view/require-auth.js +3 -3
- package/dist/cjs/view/session-timeout/index.js +2 -2
- package/dist/cjs/view/storybook/decorator.js +1 -1
- package/dist/cjs/view/use-window-size-change.js +1 -1
- package/dist/cjs/view/visually-hidden/index.js +2 -1
- package/dist/cjs/view/wait-message/index.js +2 -2
- package/dist/cjs/view/wait-message/wait-message-launcher.js +3 -3
- package/dist/esm/analytics/page-view-event.js +1 -1
- package/dist/esm/api/users/index.endpoint.cjs +12 -0
- package/dist/esm/app.config.json +2 -2
- package/dist/esm/communication/http-client/response-interceptor.js +1 -1
- package/dist/esm/communication/http-client/retry-axios.js +13 -13
- package/dist/esm/communication/http-client/retry.js +1 -1
- package/dist/esm/communication/http-client/tests/hello.endpoint.cjs +12 -0
- package/dist/esm/communication/http-client/tests/private.endpoint.cjs +13 -0
- package/dist/esm/data/appMiddleware.js +2 -3
- package/dist/esm/data/auth-state.js +24 -0
- package/dist/esm/data/breakpoint-state.js +26 -0
- package/dist/esm/data/errorMiddleware.js +2 -2
- package/dist/esm/data/listenerMiddleware.js +5 -3
- package/dist/esm/data/logout-actions.js +8 -0
- package/dist/esm/data/navigation-prompt-actions.js +8 -0
- package/dist/esm/data/queryMiddleware.js +3 -1
- package/dist/esm/data/reducers.js +4 -4
- package/dist/esm/data/store.js +12 -8
- package/dist/esm/data/wait-message-state.js +26 -0
- package/dist/esm/index.js +11 -37
- package/dist/esm/sideeffect/auth/index.js +4 -8
- package/dist/esm/sideeffect/error-toast/index.js +2 -2
- package/dist/esm/sideeffect/wait-message/index.js +3 -3
- package/dist/esm/utils/auth/helper.js +1 -1
- package/dist/esm/utils/auth/index.js +2 -2
- package/dist/esm/utils/font-size.js +1 -1
- package/dist/esm/utils/micro-frontend/guest.js +8 -7
- package/dist/esm/utils/micro-frontend/host.js +6 -4
- package/dist/esm/utils/micro-frontend/index.js +14 -4
- package/dist/esm/utils/session.js +13 -1
- package/dist/esm/utils/storybook/main.js +33 -0
- package/dist/esm/utils/storybook/manager.js +2 -2
- package/dist/esm/utils/storybook/middleware.js +7 -0
- package/dist/esm/utils/storybook/preview.js +10 -5
- package/dist/esm/utils/storybook/theme.js +5 -8
- package/dist/esm/utils/storybook/vite.js +13 -0
- package/dist/esm/utils/storybook/webpack.js +22 -0
- package/dist/esm/utils/testing/index.js +1 -1
- package/dist/esm/utils/testing/render-with-redux.js +1 -5
- package/dist/esm/utils/testing/render-with-router-redux.js +1 -2
- package/dist/esm/utils/url.js +2 -0
- package/dist/esm/utils/window.js +1 -1
- package/dist/esm/view/app-root/hosted-app.js +1 -1
- package/dist/esm/view/app-root/index.js +2 -0
- package/dist/esm/view/app-root/stand-alone-app.js +1 -1
- package/dist/esm/view/app-root/style.js +1 -1
- package/dist/esm/view/app-root/use-prefetch-resources.js +15 -0
- package/dist/esm/view/breakpoint/use-breakpoint.js +7 -4
- package/dist/esm/view/error-boundary/index.js +1 -1
- package/dist/esm/view/error-toast/index.js +3 -3
- package/dist/esm/view/fields/autocomplete/index.js +4 -1
- package/dist/esm/view/fields/combo-box-v3/index.js +1 -1
- package/dist/esm/view/form/personal-info-section.js +5 -7
- package/dist/esm/view/login/index.js +2 -2
- package/dist/esm/view/micro-app/app-factory/index.js +21 -9
- package/dist/esm/view/micro-app/resources/script.js +17 -9
- package/dist/esm/view/micro-app/resources/style.js +15 -2
- package/dist/esm/view/micro-app/use-app-will-render.js +1 -1
- package/dist/esm/view/micro-iframe-app/iframe/index.js +0 -1
- package/dist/esm/view/modals/navigation-prompt/index.js +1 -1
- package/dist/esm/view/modals/session-expiry/index.js +1 -1
- package/dist/esm/view/require-auth.js +1 -1
- package/dist/esm/view/session-timeout/index.js +1 -1
- package/dist/esm/view/storybook/decorator.js +1 -1
- package/dist/esm/view/use-window-size-change.js +1 -1
- package/dist/esm/view/visually-hidden/index.js +1 -0
- package/dist/esm/view/wait-message/index.js +1 -1
- package/dist/esm/view/wait-message/wait-message-launcher.js +1 -1
- package/dist/types/docusaurus.config.d.ts +2 -0
- package/dist/types/lib/api/helpers.d.ts +1 -1
- package/dist/types/lib/communication/http-client/response-interceptor.d.ts +1 -3
- package/dist/types/lib/communication/http-client/retry-axios.d.ts +5 -5
- package/dist/types/lib/data/appMiddleware.d.ts +2 -2
- package/dist/types/lib/data/auth-state.d.ts +28 -0
- package/dist/types/lib/data/breakpoint-state.d.ts +15 -0
- package/dist/types/lib/data/{error/index.d.ts → error-state.d.ts} +5 -1
- package/dist/types/lib/data/listenerMiddleware.d.ts +38 -17
- package/dist/types/lib/data/{live-message/index.d.ts → live-message-state.d.ts} +5 -1
- package/dist/types/lib/data/logout-actions.d.ts +4 -0
- package/dist/types/lib/data/navigation-prompt-actions.d.ts +4 -0
- package/dist/types/lib/data/reducers.d.ts +12 -15
- package/dist/types/lib/data/saga.d.ts +3 -5
- package/dist/types/lib/data/store.d.ts +31 -38
- package/dist/types/lib/data/types.d.ts +6 -6
- package/dist/types/lib/data/wait-message-state.d.ts +17 -0
- package/dist/types/lib/index.d.ts +6 -16
- package/dist/types/lib/sideeffect/auth/index.d.ts +1 -1
- package/dist/types/lib/utils/app-config/config.d.ts +1 -3
- package/dist/types/lib/utils/app-host-integration/react.d.ts +2 -2
- package/dist/types/lib/utils/guest-with-service.d.ts +1 -3
- package/dist/types/lib/utils/micro-frontend/host.d.ts +4 -4
- package/dist/types/lib/utils/micro-frontend/index.d.ts +1 -0
- package/dist/types/lib/utils/micro-frontend/types.d.ts +5 -4
- package/dist/types/lib/utils/session.d.ts +3 -9
- package/dist/types/lib/utils/storybook/main.d.ts +2 -0
- package/dist/types/lib/utils/storybook/manager.d.ts +2 -1
- package/dist/types/lib/utils/storybook/middleware.d.ts +1 -0
- package/dist/types/lib/utils/storybook/preview.d.ts +5 -29
- package/dist/types/lib/utils/storybook/theme.d.ts +2 -5
- package/dist/types/lib/utils/storybook/vite.d.ts +10 -0
- package/dist/types/lib/utils/storybook/webpack.d.ts +17 -0
- package/dist/types/lib/utils/testing/render-with-redux.d.ts +15 -19
- package/dist/types/lib/utils/testing/render-with-router-redux.d.ts +14 -18
- package/dist/types/lib/utils/testing/render-with-router.d.ts +1 -1
- package/dist/types/lib/utils/testing/render-with-state-addons.d.ts +2 -2
- package/dist/types/lib/utils/url.d.ts +1 -0
- package/dist/types/lib/utils/window.d.ts +1 -3
- package/dist/types/lib/view/app-root/hosted-app.d.ts +2 -2
- package/dist/types/lib/view/app-root/index.d.ts +2 -2
- package/dist/types/lib/view/app-root/stand-alone-app.d.ts +2 -2
- package/dist/types/lib/view/app-root/use-prefetch-resources.d.ts +1 -0
- package/dist/types/lib/view/breakpoint/index.stories.d.ts +6 -3
- package/dist/types/lib/view/breakpoint/use-media-query-list.d.ts +1 -1
- package/dist/types/lib/view/error-toast/index.d.ts +1 -4
- package/dist/types/lib/view/error-toast/index.stories.d.ts +12 -5
- package/dist/types/lib/view/fields/autocomplete/advanced-autocomplete.stories.d.ts +6 -5
- package/dist/types/lib/view/fields/autocomplete/async-suggestions-autocomplete.stories.d.ts +6 -5
- package/dist/types/lib/view/fields/autocomplete/index.stories.d.ts +6 -5
- package/dist/types/lib/view/fields/check-box/index.stories.d.ts +8 -5
- package/dist/types/lib/view/fields/check-box/set-value.stories.d.ts +8 -5
- package/dist/types/lib/view/fields/combo-box-v3/index.stories.d.ts +8 -5
- package/dist/types/lib/view/fields/connect-form.d.ts +2 -2
- package/dist/types/lib/view/fields/date-range-picker/index.d.ts +2 -2
- package/dist/types/lib/view/fields/date-range-picker/index.stories.d.ts +8 -7
- package/dist/types/lib/view/fields/date-time-picker/index.stories.d.ts +19 -39
- package/dist/types/lib/view/fields/form-layout-block-item/index.stories.d.ts +8 -4
- package/dist/types/lib/view/fields/input-text/index.stories.d.ts +8 -10
- package/dist/types/lib/view/fields/masked-input-text/index.d.ts +2 -2
- package/dist/types/lib/view/fields/masked-input-text/index.stories.d.ts +10 -0
- package/dist/types/lib/view/fields/toggle/index.stories.d.ts +6 -10
- package/dist/types/lib/view/fields/watch-value.d.ts +2 -2
- package/dist/types/lib/view/form/index.d.ts +2 -2
- package/dist/types/lib/view/form/index.stories.d.ts +7 -3
- package/dist/types/lib/view/form/personal-info-section.d.ts +0 -1
- package/dist/types/lib/view/form/submit-button/index.d.ts +2 -2
- package/dist/types/lib/view/form/usecases.stories.d.ts +9 -12
- package/dist/types/lib/view/live-message/index.stories.d.ts +5 -3
- package/dist/types/lib/view/micro-app/app-factory/index.d.ts +1 -0
- package/dist/types/lib/view/micro-app/resources/manifest.d.ts +1 -1
- package/dist/types/lib/view/micro-app/resources/script.d.ts +4 -0
- package/dist/types/lib/view/micro-app/resources/style.d.ts +4 -0
- package/dist/types/lib/view/micro-app/types.d.ts +2 -2
- package/dist/types/lib/view/micro-app/utils.d.ts +2 -2
- package/dist/types/lib/view/micro-iframe-app/iframe/index.d.ts +2 -2
- package/dist/types/lib/view/modals/error/index.stories.d.ts +9 -6
- package/dist/types/lib/view/modals/navigation-prompt/index.stories.d.ts +9 -10
- package/dist/types/lib/view/modals/session-expiry/index.stories.d.ts +10 -6
- package/dist/types/lib/view/session-timeout/index.stories.d.ts +8 -4
- package/dist/types/lib/view/storybook/decorator.d.ts +1 -1
- package/dist/types/lib/view/visually-hidden/index.d.ts +1 -0
- package/dist/types/lib/view/wait-message/index.stories.d.ts +8 -8
- package/package.json +52 -50
- package/dist/cjs/data/auth/reducer.js +0 -49
- package/dist/cjs/data/wait-message/reducer.js +0 -51
- package/dist/cjs/utils/storybook/cjs/main.js +0 -58
- package/dist/cjs/utils/storybook/cjs/middleware.js +0 -6
- package/dist/cjs/utils/storybook/cjs/vite.js +0 -8
- package/dist/cjs/utils/storybook/cjs/webpack.js +0 -20
- package/dist/cjs/view/fields/combo-box/index.js +0 -50
- package/dist/cjs/view/fields/date-picker/index.js +0 -50
- package/dist/cjs/view/fields/form-item-layout/index.js +0 -43
- package/dist/cjs/view/fields/input-mask/index.js +0 -60
- package/dist/cjs/view/fields/radio/index.js +0 -48
- package/dist/cjs/view/fields/radio-group/index.js +0 -40
- package/dist/cjs/view/fields/text-box/index.js +0 -40
- package/dist/esm/data/auth/actions.js +0 -31
- package/dist/esm/data/auth/reducer.js +0 -19
- package/dist/esm/data/breakpoint/index.js +0 -28
- package/dist/esm/data/logout/actions.js +0 -18
- package/dist/esm/data/navigation-prompt/actions.js +0 -18
- package/dist/esm/data/wait-message/actions.js +0 -18
- package/dist/esm/data/wait-message/reducer.js +0 -21
- package/dist/esm/view/fields/combo-box/index.js +0 -32
- package/dist/esm/view/fields/date-input/index.js +0 -22
- package/dist/esm/view/fields/date-picker/index.js +0 -22
- package/dist/esm/view/fields/form-item-layout/index.js +0 -23
- package/dist/esm/view/fields/input-mask/index.js +0 -42
- package/dist/esm/view/fields/large-text-box/index.js +0 -22
- package/dist/esm/view/fields/radio/index.js +0 -30
- package/dist/esm/view/fields/radio-group/index.js +0 -22
- package/dist/esm/view/fields/text-box/index.js +0 -22
- package/dist/types/lib/data/auth/actions.d.ts +0 -22
- package/dist/types/lib/data/auth/reducer.d.ts +0 -6
- package/dist/types/lib/data/breakpoint/index.d.ts +0 -13
- package/dist/types/lib/data/logout/actions.d.ts +0 -9
- package/dist/types/lib/data/navigation-prompt/actions.d.ts +0 -9
- package/dist/types/lib/data/wait-message/actions.d.ts +0 -14
- package/dist/types/lib/data/wait-message/reducer.d.ts +0 -7
- package/dist/types/lib/utils/storybook/cjs/main.d.ts +0 -66
- package/dist/types/lib/utils/storybook/cjs/middleware.d.ts +0 -2
- package/dist/types/lib/utils/storybook/cjs/vite.d.ts +0 -5
- package/dist/types/lib/utils/storybook/cjs/webpack.d.ts +0 -17
- package/dist/types/lib/view/fields/combo-box/index.d.ts +0 -8
- package/dist/types/lib/view/fields/combo-box/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/date-input/index.d.ts +0 -8
- package/dist/types/lib/view/fields/date-input/index.stories.d.ts +0 -7
- package/dist/types/lib/view/fields/date-picker/index.d.ts +0 -9
- package/dist/types/lib/view/fields/date-picker/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/form-item-layout/index.d.ts +0 -9
- package/dist/types/lib/view/fields/form-item-layout/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/input-mask/index.d.ts +0 -15
- package/dist/types/lib/view/fields/input-mask/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/large-text-box/index.d.ts +0 -9
- package/dist/types/lib/view/fields/large-text-box/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/masked-input-text/with-money-mask.stories.d.ts +0 -11
- package/dist/types/lib/view/fields/masked-input-text/with-percentage-mask.stories.d.ts +0 -11
- package/dist/types/lib/view/fields/radio/index.d.ts +0 -9
- package/dist/types/lib/view/fields/radio/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/radio/set-value.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/radio-group/index.d.ts +0 -8
- package/dist/types/lib/view/fields/radio-group/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/text-box/index.d.ts +0 -8
- package/dist/types/lib/view/fields/text-box/index.stories.d.ts +0 -7
- /package/dist/esm/data/{error/index.js → error-state.js} +0 -0
- /package/dist/esm/data/{live-message/index.js → live-message-state.js} +0 -0
- /package/dist/types/lib/api/users/{index.endpoint.d.ts → index.endpoint.d.cts} +0 -0
- /package/dist/types/lib/communication/http-client/tests/{hello.endpoint.d.ts → hello.endpoint.d.cts} +0 -0
- /package/dist/types/lib/communication/http-client/tests/{private.endpoint.d.ts → private.endpoint.d.cts} +0 -0
package/README.md
CHANGED
|
@@ -12,6 +12,14 @@ Build: [
|
|
18
|
+
|
|
19
|
+
### v4 to v5
|
|
20
|
+
|
|
21
|
+
[ChangeLog](https://confluence.elliemae.io/display/FEAE/App+SDK+ChangeLog#AppSDKChangeLog-v5)
|
|
22
|
+
|
|
15
23
|
### v3 to v4
|
|
16
24
|
|
|
17
25
|
[ChangeLog](https://confluence.elliemae.io/display/FEAE/App+SDK+ChangeLog#AppSDKChangeLog-v4)
|
|
@@ -32,7 +32,7 @@ __export(appdynamics_exports, {
|
|
|
32
32
|
setAppDynamicsUserData: () => setAppDynamicsUserData
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(appdynamics_exports);
|
|
35
|
-
var brum = __toESM(require("@elliemae/pui-user-monitoring"));
|
|
35
|
+
var brum = __toESM(require("@elliemae/pui-user-monitoring"), 1);
|
|
36
36
|
let userData = {
|
|
37
37
|
envName: "localhost",
|
|
38
38
|
appId: "",
|
package/dist/cjs/api/helpers.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var helpers_exports = {};
|
|
20
30
|
__export(helpers_exports, {
|
|
@@ -23,16 +33,16 @@ __export(helpers_exports, {
|
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(helpers_exports);
|
|
25
35
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
26
|
-
var
|
|
36
|
+
var import_get = __toESM(require("lodash/get"), 1);
|
|
27
37
|
const getApiActionCreator = (api) => (operation) => ({
|
|
28
38
|
[operation]: (0, import_toolkit.createAction)(`${api}/${operation}`),
|
|
29
39
|
[`${operation}Success`]: (0, import_toolkit.createAction)(`${api}/${operation}Success`),
|
|
30
40
|
[`${operation}Error`]: (0, import_toolkit.createAction)(`${api}/${operation}Error`)
|
|
31
41
|
});
|
|
32
|
-
const getSelectField = (stateName) => (fieldName = "", defaultValue) => (state = {}, stateValue = (0,
|
|
33
|
-
(field, i) => (0,
|
|
42
|
+
const getSelectField = (stateName) => (fieldName = "", defaultValue) => (state = {}, stateValue = (0, import_get.default)(state, stateName)) => Array.isArray(fieldName) ? fieldName.map(
|
|
43
|
+
(field, i) => (0, import_get.default)(
|
|
34
44
|
stateValue,
|
|
35
45
|
field,
|
|
36
46
|
Array.isArray(defaultValue) ? defaultValue[i] : defaultValue
|
|
37
47
|
)
|
|
38
|
-
) : (0,
|
|
48
|
+
) : (0, import_get.default)(stateValue, fieldName, defaultValue);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const router = express.Router();
|
|
3
|
+
// eslint-disable-next-line import/extensions
|
|
4
|
+
const users = require('./users.json');
|
|
5
|
+
|
|
6
|
+
router.get('/', (req, res) => {
|
|
7
|
+
res.json(users);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports = (app) => {
|
|
11
|
+
app.use('/sdk/users', router);
|
|
12
|
+
};
|
package/dist/cjs/app.config.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"appId": "app-sdk",
|
|
3
3
|
"activeEnv": "localhost",
|
|
4
|
-
"sessionTimeoutWarnInterval": "
|
|
5
|
-
"sessionTimeoutInterval": "
|
|
4
|
+
"sessionTimeoutWarnInterval": "600000",
|
|
5
|
+
"sessionTimeoutInterval": "700000",
|
|
6
6
|
"serviceEndpoints": {
|
|
7
7
|
"api": "",
|
|
8
8
|
"idp": "https://int.idp.ellielabs.com",
|
|
@@ -32,10 +32,10 @@ __export(http_client_exports, {
|
|
|
32
32
|
getHTTPClient: () => getHTTPClient
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(http_client_exports);
|
|
35
|
-
var import_axios = __toESM(require("axios"));
|
|
35
|
+
var import_axios = __toESM(require("axios"), 1);
|
|
36
36
|
var import_config = require("../../utils/app-config/config.js");
|
|
37
37
|
var import_helper = require("../../utils/auth/helper.js");
|
|
38
|
-
var import_retry = __toESM(require("./retry.js"));
|
|
38
|
+
var import_retry = __toESM(require("./retry.js"), 1);
|
|
39
39
|
var import_request_interceptor = require("./request-interceptor.js");
|
|
40
40
|
var import_response_interceptor = require("./response-interceptor.js");
|
|
41
41
|
const REQUEST_TIMEOUT = 2 * 60 * 1e3;
|
|
@@ -33,7 +33,7 @@ __export(response_interceptor_exports, {
|
|
|
33
33
|
onAuthorizationFailure: () => onAuthorizationFailure
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(response_interceptor_exports);
|
|
36
|
-
var import_axios = __toESM(require("axios"));
|
|
36
|
+
var import_axios = __toESM(require("axios"), 1);
|
|
37
37
|
const HTTP_UNAUTHORIZED = 401;
|
|
38
38
|
let unAuthorizedFailureHandler = null;
|
|
39
39
|
const onAuthorizationFailure = (callback) => {
|
|
@@ -41,7 +41,7 @@ const onAuthorizationFailure = (callback) => {
|
|
|
41
41
|
};
|
|
42
42
|
const handleSuccess = (response) => response;
|
|
43
43
|
const handleFailure = (error) => {
|
|
44
|
-
const { status } =
|
|
44
|
+
const { status } = error?.response ?? {};
|
|
45
45
|
if (status === HTTP_UNAUTHORIZED && unAuthorizedFailureHandler && typeof unAuthorizedFailureHandler === "function") {
|
|
46
46
|
return unAuthorizedFailureHandler(error).then((authorizationHeader) => {
|
|
47
47
|
const { config } = error;
|
|
@@ -33,7 +33,7 @@ __export(retry_axios_exports, {
|
|
|
33
33
|
getConfig: () => getConfig
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(retry_axios_exports);
|
|
36
|
-
var import_axios = __toESM(require("axios"));
|
|
36
|
+
var import_axios = __toESM(require("axios"), 1);
|
|
37
37
|
const onFulfilled = (res) => res;
|
|
38
38
|
const detach = (interceptorId, instance) => {
|
|
39
39
|
instance = instance || import_axios.default;
|
|
@@ -45,13 +45,13 @@ const shouldRetryRequest = (err) => {
|
|
|
45
45
|
if (!config || config.retry === 0) {
|
|
46
46
|
return false;
|
|
47
47
|
}
|
|
48
|
-
if (!err.response && (config.currentRetryAttempt
|
|
48
|
+
if (!err.response && (config.currentRetryAttempt ?? 0) >= config.noResponseRetries) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
if (!err.config.method || config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
|
-
if (err.response
|
|
54
|
+
if (err.response?.status) {
|
|
55
55
|
let isInRange = false;
|
|
56
56
|
for (const [min, max] of config.statusCodesToRetry) {
|
|
57
57
|
const { status } = err.response;
|
|
@@ -64,7 +64,7 @@ const shouldRetryRequest = (err) => {
|
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
config.currentRetryAttempt = config.currentRetryAttempt
|
|
67
|
+
config.currentRetryAttempt = config.currentRetryAttempt ?? 0;
|
|
68
68
|
if (config.currentRetryAttempt >= config.retry) {
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
@@ -74,19 +74,19 @@ const onError = (err) => {
|
|
|
74
74
|
if (!err.config) {
|
|
75
75
|
return Promise.reject(err);
|
|
76
76
|
}
|
|
77
|
-
const config = err.config.retryConfig
|
|
78
|
-
config.currentRetryAttempt = config.currentRetryAttempt
|
|
79
|
-
config.retry = config.retry
|
|
80
|
-
config.retryDelay = config.retryDelay
|
|
81
|
-
config.instance = config.instance
|
|
82
|
-
config.httpMethodsToRetry = config.httpMethodsToRetry
|
|
77
|
+
const config = err.config.retryConfig ?? {};
|
|
78
|
+
config.currentRetryAttempt = config.currentRetryAttempt ?? 0;
|
|
79
|
+
config.retry = config.retry ?? 3;
|
|
80
|
+
config.retryDelay = config.retryDelay ?? 100;
|
|
81
|
+
config.instance = config.instance ?? import_axios.default;
|
|
82
|
+
config.httpMethodsToRetry = config.httpMethodsToRetry ?? [
|
|
83
83
|
"GET",
|
|
84
84
|
"HEAD",
|
|
85
85
|
"PUT",
|
|
86
86
|
"OPTIONS",
|
|
87
87
|
"DELETE"
|
|
88
88
|
];
|
|
89
|
-
config.noResponseRetries = config.noResponseRetries
|
|
89
|
+
config.noResponseRetries = config.noResponseRetries ?? 2;
|
|
90
90
|
const retryRanges = [
|
|
91
91
|
// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
|
|
92
92
|
// 1xx - Retry (Informational, request still processing)
|
|
@@ -99,9 +99,9 @@ const onError = (err) => {
|
|
|
99
99
|
[429, 429],
|
|
100
100
|
[500, 599]
|
|
101
101
|
];
|
|
102
|
-
config.statusCodesToRetry = config.statusCodesToRetry
|
|
102
|
+
config.statusCodesToRetry = config.statusCodesToRetry ?? retryRanges;
|
|
103
103
|
err.config.retryConfig = config;
|
|
104
|
-
const shouldRetryFn = config.shouldRetry
|
|
104
|
+
const shouldRetryFn = config.shouldRetry ?? shouldRetryRequest;
|
|
105
105
|
if (!shouldRetryFn(err)) {
|
|
106
106
|
return Promise.reject(err);
|
|
107
107
|
}
|
|
@@ -118,7 +118,7 @@ const attach = (instance) => {
|
|
|
118
118
|
return instance?.interceptors?.response ? instance.interceptors.response.use(onFulfilled, onError) : null;
|
|
119
119
|
};
|
|
120
120
|
const getConfig = (err) => {
|
|
121
|
-
if (err
|
|
121
|
+
if (err?.config) {
|
|
122
122
|
return err.config.retryConfig;
|
|
123
123
|
}
|
|
124
124
|
return null;
|
|
@@ -48,7 +48,7 @@ const getRaxConfig = (httpClient) => ({
|
|
|
48
48
|
// retry attempts have been made
|
|
49
49
|
onRetryAttempt: (err) => {
|
|
50
50
|
const cfg = (0, import_retry_axios.getConfig)(err);
|
|
51
|
-
if (cfg
|
|
51
|
+
if (cfg?.currentRetryAttempt)
|
|
52
52
|
console.log(`Retry attempt #${cfg.currentRetryAttempt}`);
|
|
53
53
|
}
|
|
54
54
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Important: This file should use CommonJS import exports rather ES6 import and export */
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const router = express.Router();
|
|
4
|
+
|
|
5
|
+
// define the route
|
|
6
|
+
router.get('/', (req, res) => {
|
|
7
|
+
res.json({ name: 'pui-app-sdk' });
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports = (app) => {
|
|
11
|
+
app.use('/hello', router);
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* Important: This file should use CommonJS import exports rather ES6 import and export */
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const router = express.Router();
|
|
4
|
+
|
|
5
|
+
// define the route
|
|
6
|
+
router.get('/', (req, res) => {
|
|
7
|
+
if (req.headers.authorization !== 'pui') res.status(401).send('unauthorized');
|
|
8
|
+
else res.send({ message: 'you are viewing a private message' });
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = (app) => {
|
|
12
|
+
app.use('/private', router);
|
|
13
|
+
};
|
|
@@ -30,9 +30,8 @@ let store;
|
|
|
30
30
|
const appMiddleware = (_store) => {
|
|
31
31
|
store = _store;
|
|
32
32
|
const dispatchFns = Array.from(middlewareDispatchFns.values());
|
|
33
|
-
return (next) => (action) => (
|
|
34
|
-
|
|
35
|
-
(0, import_redux.compose)(...dispatchFns)(next)(action)
|
|
33
|
+
return (next) => (action) => (0, import_redux.compose)(...dispatchFns)(next)(
|
|
34
|
+
action
|
|
36
35
|
);
|
|
37
36
|
};
|
|
38
37
|
const addMiddleware = ({
|
|
@@ -16,25 +16,29 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var auth_state_exports = {};
|
|
20
|
+
__export(auth_state_exports, {
|
|
21
|
+
actions: () => authActions,
|
|
22
|
+
authReducer: () => authReducer,
|
|
23
|
+
initialState: () => initialState
|
|
22
24
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
name,
|
|
36
|
-
rules,
|
|
37
|
-
defaultValue,
|
|
38
|
-
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_form.DSLargeInputText, { ...rest, ...field })
|
|
25
|
+
module.exports = __toCommonJS(auth_state_exports);
|
|
26
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
27
|
+
const initialState = {
|
|
28
|
+
authenticated: false
|
|
29
|
+
};
|
|
30
|
+
const authSlice = (0, import_toolkit.createSlice)({
|
|
31
|
+
name: "auth",
|
|
32
|
+
initialState,
|
|
33
|
+
reducers: {
|
|
34
|
+
loginSuccess: (state) => {
|
|
35
|
+
state.authenticated = true;
|
|
36
|
+
}
|
|
39
37
|
}
|
|
40
|
-
);
|
|
38
|
+
});
|
|
39
|
+
const { actions } = authSlice;
|
|
40
|
+
const authActions = Object.assign(actions, {
|
|
41
|
+
login: (0, import_toolkit.createAction)("auth/login"),
|
|
42
|
+
logout: (0, import_toolkit.createAction)("auth/logout")
|
|
43
|
+
});
|
|
44
|
+
const authReducer = authSlice.reducer;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var breakpoint_state_exports = {};
|
|
20
|
+
__export(breakpoint_state_exports, {
|
|
21
|
+
Breakpoints: () => Breakpoints,
|
|
22
|
+
actions: () => actions,
|
|
23
|
+
breakpointReducer: () => breakpointReducer
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(breakpoint_state_exports);
|
|
26
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
27
|
+
var Breakpoints = /* @__PURE__ */ ((Breakpoints2) => {
|
|
28
|
+
Breakpoints2["LARGE"] = "large";
|
|
29
|
+
Breakpoints2["MEDIUM"] = "medium";
|
|
30
|
+
Breakpoints2["SMALL"] = "small";
|
|
31
|
+
return Breakpoints2;
|
|
32
|
+
})(Breakpoints || {});
|
|
33
|
+
const initialState = {
|
|
34
|
+
value: "large" /* LARGE */
|
|
35
|
+
};
|
|
36
|
+
const breakpointSlice = (0, import_toolkit.createSlice)({
|
|
37
|
+
name: "breakpoint",
|
|
38
|
+
initialState,
|
|
39
|
+
reducers: {
|
|
40
|
+
change: (state, action) => {
|
|
41
|
+
state.value = action.payload;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const { actions } = breakpointSlice;
|
|
46
|
+
const breakpointReducer = breakpointSlice.reducer;
|
|
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var error_state_exports = {};
|
|
20
|
+
__export(error_state_exports, {
|
|
21
21
|
actions: () => actions,
|
|
22
22
|
errorReducer: () => errorReducer
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(error_state_exports);
|
|
25
25
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
26
26
|
const initialState = {
|
|
27
27
|
description: "",
|
|
@@ -22,10 +22,10 @@ __export(errorMiddleware_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(errorMiddleware_exports);
|
|
24
24
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
25
|
-
var
|
|
25
|
+
var import_error_state = require("./error-state.js");
|
|
26
26
|
const errorMiddleware = (api) => (next) => (action) => {
|
|
27
27
|
if ((0, import_toolkit.isRejectedWithValue)(action)) {
|
|
28
|
-
api.dispatch(
|
|
28
|
+
api.dispatch(import_error_state.actions.set({ messageText: action?.error?.message }));
|
|
29
29
|
}
|
|
30
30
|
return next(action);
|
|
31
31
|
};
|
|
@@ -20,6 +20,7 @@ var listenerMiddleware_exports = {};
|
|
|
20
20
|
__export(listenerMiddleware_exports, {
|
|
21
21
|
clearSideEffects: () => clearSideEffects,
|
|
22
22
|
createSideEffect: () => createSideEffect,
|
|
23
|
+
getListenerMiddleware: () => getListenerMiddleware,
|
|
23
24
|
listenerMiddleware: () => listenerMiddleware,
|
|
24
25
|
removeSideEffect: () => removeSideEffect,
|
|
25
26
|
startSideEffect: () => startSideEffect
|
|
@@ -27,7 +28,8 @@ __export(listenerMiddleware_exports, {
|
|
|
27
28
|
module.exports = __toCommonJS(listenerMiddleware_exports);
|
|
28
29
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
29
30
|
const listenerMiddleware = (0, import_toolkit.createListenerMiddleware)();
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
31
|
+
const getListenerMiddleware = () => listenerMiddleware.middleware;
|
|
32
|
+
const startSideEffect = listenerMiddleware.startListening.withTypes();
|
|
33
|
+
const createSideEffect = import_toolkit.addListener.withTypes();
|
|
34
|
+
const removeSideEffect = import_toolkit.removeListener.withTypes();
|
|
33
35
|
const clearSideEffects = listenerMiddleware.clearListeners;
|
|
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var live_message_state_exports = {};
|
|
20
|
+
__export(live_message_state_exports, {
|
|
21
21
|
actions: () => actions,
|
|
22
22
|
liveMessageReducer: () => liveMessageReducer
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(live_message_state_exports);
|
|
25
25
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
26
26
|
const initialState = {
|
|
27
27
|
message: "",
|
|
@@ -16,23 +16,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
actions: () => actions,
|
|
19
|
+
var logout_actions_exports = {};
|
|
20
|
+
__export(logout_actions_exports, {
|
|
22
21
|
logout: () => logout
|
|
23
22
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
|
|
26
|
-
CONFIRM: "log-out/CONFIRM",
|
|
27
|
-
CANCEL: "log-out/CANCEL"
|
|
28
|
-
};
|
|
23
|
+
module.exports = __toCommonJS(logout_actions_exports);
|
|
24
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
29
25
|
const logout = {
|
|
30
|
-
confirm: ()
|
|
31
|
-
|
|
32
|
-
payload: null
|
|
33
|
-
}),
|
|
34
|
-
cancel: () => ({
|
|
35
|
-
type: actions.CANCEL,
|
|
36
|
-
payload: null
|
|
37
|
-
})
|
|
26
|
+
confirm: (0, import_toolkit.createAction)("log-out/CONFIRM"),
|
|
27
|
+
cancel: (0, import_toolkit.createAction)("log-out/CANCEL")
|
|
38
28
|
};
|
|
@@ -16,23 +16,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
ACTIONS: () => ACTIONS,
|
|
19
|
+
var navigation_prompt_actions_exports = {};
|
|
20
|
+
__export(navigation_prompt_actions_exports, {
|
|
22
21
|
navigationPrompt: () => navigationPrompt
|
|
23
22
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
|
|
26
|
-
CONFIRM: "navigation-prompt/CONFIRM",
|
|
27
|
-
CANCEL: "navigation-prompt/CANCEL"
|
|
28
|
-
};
|
|
23
|
+
module.exports = __toCommonJS(navigation_prompt_actions_exports);
|
|
24
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
29
25
|
const navigationPrompt = {
|
|
30
|
-
confirm: ()
|
|
31
|
-
|
|
32
|
-
payload: null
|
|
33
|
-
}),
|
|
34
|
-
cancel: () => ({
|
|
35
|
-
type: ACTIONS.CANCEL,
|
|
36
|
-
payload: null
|
|
37
|
-
})
|
|
26
|
+
confirm: (0, import_toolkit.createAction)("navigation-prompt/CONFIRM"),
|
|
27
|
+
cancel: (0, import_toolkit.createAction)("navigation-prompt/CANCEL")
|
|
38
28
|
};
|
|
@@ -31,7 +31,9 @@ const queryMiddleware = (_store) => {
|
|
|
31
31
|
store = _store;
|
|
32
32
|
return (next) => (action) => (
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
34
|
-
(0, import_redux.compose)(...middlewareDispatchFns.values())(next)(
|
|
34
|
+
(0, import_redux.compose)(...middlewareDispatchFns.values())(next)(
|
|
35
|
+
action
|
|
36
|
+
)
|
|
35
37
|
);
|
|
36
38
|
};
|
|
37
39
|
const addMiddleware = ({
|
|
@@ -22,16 +22,16 @@ __export(reducers_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(reducers_exports);
|
|
24
24
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
25
|
+
var import_wait_message_state = require("./wait-message-state.js");
|
|
26
|
+
var import_error_state = require("./error-state.js");
|
|
27
|
+
var import_breakpoint_state = require("./breakpoint-state.js");
|
|
28
|
+
var import_live_message_state = require("./live-message-state.js");
|
|
29
29
|
const createReducer = (injectedReducers = {}) => {
|
|
30
30
|
const rootReducer = (0, import_toolkit.combineReducers)({
|
|
31
|
-
waitMessage:
|
|
32
|
-
error:
|
|
33
|
-
breakpoint:
|
|
34
|
-
liveMessage:
|
|
31
|
+
waitMessage: import_wait_message_state.waitMessageReducer,
|
|
32
|
+
error: import_error_state.errorReducer,
|
|
33
|
+
breakpoint: import_breakpoint_state.breakpointReducer,
|
|
34
|
+
liveMessage: import_live_message_state.liveMessageReducer,
|
|
35
35
|
...injectedReducers
|
|
36
36
|
});
|
|
37
37
|
return rootReducer;
|
package/dist/cjs/data/store.js
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(store_exports);
|
|
|
36
36
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
37
37
|
var import_react = require("@reduxjs/toolkit/query/react");
|
|
38
38
|
var import_redux_injectors = require("redux-injectors");
|
|
39
|
-
var import_redux_saga = __toESM(require("redux-saga"));
|
|
39
|
+
var import_redux_saga = __toESM(require("redux-saga"), 1);
|
|
40
40
|
var import_reducers = require("./reducers.js");
|
|
41
41
|
var import_webpack_hmr = require("./webpack-hmr.js");
|
|
42
42
|
var import_queryMiddleware = require("./queryMiddleware.js");
|
|
@@ -47,7 +47,11 @@ const setStore = (store) => {
|
|
|
47
47
|
appStore = store;
|
|
48
48
|
};
|
|
49
49
|
const getStore = () => appStore;
|
|
50
|
-
const createStore = (
|
|
50
|
+
const createStore = ({
|
|
51
|
+
initialState,
|
|
52
|
+
sagaMiddleware,
|
|
53
|
+
middlewareConfig
|
|
54
|
+
}) => {
|
|
51
55
|
const { run: runSaga } = sagaMiddleware;
|
|
52
56
|
const enhancers = [
|
|
53
57
|
(0, import_redux_injectors.createInjectorsEnhancer)({
|
|
@@ -57,23 +61,23 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
|
57
61
|
];
|
|
58
62
|
const baseStore = (0, import_toolkit.configureStore)({
|
|
59
63
|
reducer: rootReducer,
|
|
60
|
-
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).prepend(import_listenerMiddleware.
|
|
64
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).prepend((0, import_listenerMiddleware.getListenerMiddleware)()).concat([sagaMiddleware, import_queryMiddleware.queryMiddleware]),
|
|
61
65
|
devTools: true,
|
|
62
66
|
preloadedState: initialState,
|
|
63
|
-
enhancers
|
|
67
|
+
enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(enhancers)
|
|
64
68
|
});
|
|
65
69
|
(0, import_react.setupListeners)(baseStore.dispatch);
|
|
66
70
|
(0, import_webpack_hmr.enableHotReloading)(baseStore);
|
|
67
71
|
return baseStore;
|
|
68
72
|
};
|
|
69
|
-
const createAppStore = (
|
|
73
|
+
const createAppStore = (options = {}) => {
|
|
74
|
+
const { initialState = {}, middlewareConfig } = options;
|
|
70
75
|
const sagaMiddleware = (0, import_redux_saga.default)({});
|
|
71
|
-
const store = createStore(
|
|
76
|
+
const store = createStore({
|
|
72
77
|
initialState,
|
|
73
78
|
sagaMiddleware,
|
|
74
|
-
history,
|
|
75
79
|
middlewareConfig
|
|
76
|
-
);
|
|
80
|
+
});
|
|
77
81
|
setStore(store);
|
|
78
82
|
return store;
|
|
79
83
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var wait_message_state_exports = {};
|
|
20
|
+
__export(wait_message_state_exports, {
|
|
21
|
+
actions: () => actions,
|
|
22
|
+
initialState: () => initialState,
|
|
23
|
+
waitMessageReducer: () => waitMessageReducer
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(wait_message_state_exports);
|
|
26
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
27
|
+
const LOADING_MSG = "loading...";
|
|
28
|
+
const initialState = {
|
|
29
|
+
isOpen: null,
|
|
30
|
+
message: LOADING_MSG
|
|
31
|
+
};
|
|
32
|
+
const waitMessageSlice = (0, import_toolkit.createSlice)({
|
|
33
|
+
name: "waitMessage",
|
|
34
|
+
initialState,
|
|
35
|
+
reducers: {
|
|
36
|
+
open: (state, action) => {
|
|
37
|
+
state.isOpen = true;
|
|
38
|
+
state.message = action.payload ?? LOADING_MSG;
|
|
39
|
+
},
|
|
40
|
+
close: (state) => {
|
|
41
|
+
state.isOpen = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const { actions } = waitMessageSlice;
|
|
46
|
+
const waitMessageReducer = waitMessageSlice.reducer;
|