@elliemae/pui-app-sdk 4.12.0-next.1 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/communication/http-client/baseQuery.js +42 -0
- package/dist/cjs/data/appMiddleware.js +51 -0
- package/dist/cjs/data/errorMiddleware.js +31 -0
- package/dist/cjs/data/index.js +3 -3
- package/dist/cjs/data/listenerMiddleware.js +58 -0
- package/dist/cjs/data/queryMiddleware.js +50 -0
- package/dist/cjs/data/react.js +32 -0
- package/dist/cjs/data/store.js +6 -2
- package/dist/cjs/data/useAppDispatch.js +25 -0
- package/dist/cjs/data/useAppMiddleware.js +34 -0
- package/dist/cjs/data/{react-redux.js → useAppSelector.js} +3 -5
- package/dist/cjs/data/useInjectListener.js +34 -0
- package/dist/cjs/data/useInjectQuery.js +33 -0
- package/dist/cjs/index.js +12 -5
- package/dist/cjs/view/breakpoint/use-breakpoint.js +2 -2
- package/dist/cjs/view/error-toast/index.js +3 -3
- package/dist/cjs/view/form/index.js +0 -1
- package/dist/cjs/view/live-message/index.js +3 -3
- package/dist/cjs/view/login/index.js +2 -2
- package/dist/cjs/view/modals/navigation-prompt/index.js +2 -2
- package/dist/cjs/view/modals/session-expiry/index.js +2 -2
- package/dist/cjs/view/session-timeout/index.js +2 -2
- package/dist/cjs/view/wait-message/index.js +17 -43
- package/dist/cjs/view/wait-message/wait-message-launcher.js +2 -2
- package/dist/esm/communication/http-client/baseQuery.js +22 -0
- package/dist/esm/data/appMiddleware.js +31 -0
- package/dist/esm/data/errorMiddleware.js +11 -0
- package/dist/esm/data/index.js +1 -1
- package/dist/esm/data/listenerMiddleware.js +38 -0
- package/dist/esm/data/queryMiddleware.js +30 -0
- package/dist/esm/data/react.js +12 -0
- package/dist/esm/data/store.js +7 -5
- package/dist/esm/data/useAppDispatch.js +5 -0
- package/dist/esm/data/useAppMiddleware.js +14 -0
- package/dist/esm/data/useAppSelector.js +5 -0
- package/dist/esm/data/useInjectListener.js +17 -0
- package/dist/esm/data/useInjectQuery.js +15 -0
- package/dist/esm/index.js +14 -1
- package/dist/esm/view/breakpoint/use-breakpoint.js +1 -1
- package/dist/esm/view/error-toast/index.js +1 -1
- package/dist/esm/view/form/index.js +0 -1
- package/dist/esm/view/live-message/index.js +1 -1
- package/dist/esm/view/login/index.js +1 -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/session-timeout/index.js +1 -1
- package/dist/esm/view/wait-message/index.js +16 -32
- package/dist/esm/view/wait-message/wait-message-launcher.js +1 -1
- package/dist/types/lib/communication/http-client/baseQuery.d.ts +14 -0
- package/dist/types/lib/communication/http-client/index.d.ts +1 -1
- package/dist/types/lib/data/appMiddleware.d.ts +8 -0
- package/dist/types/lib/data/errorMiddleware.d.ts +2 -0
- package/dist/types/lib/data/index.d.ts +1 -1
- package/dist/types/lib/data/listenerMiddleware.d.ts +11 -0
- package/dist/types/lib/data/queryMiddleware.d.ts +11 -0
- package/dist/types/lib/data/react.d.ts +5 -0
- package/dist/types/lib/data/store.d.ts +4 -3
- package/dist/types/lib/data/{react-redux.d.ts → useAppDispatch.d.ts} +0 -3
- package/dist/types/lib/data/useAppMiddleware.d.ts +5 -0
- package/dist/types/lib/data/useAppSelector.d.ts +3 -0
- package/dist/types/lib/data/useInjectListener.d.ts +5 -0
- package/dist/types/lib/data/useInjectQuery.d.ts +7 -0
- package/dist/types/lib/index.d.ts +3 -1
- package/dist/types/lib/utils/testing/render-with-redux.d.ts +2 -2
- package/dist/types/lib/utils/testing/render-with-router-redux.d.ts +2 -2
- package/dist/types/lib/view/visually-hidden/index.d.ts +1 -1
- package/dist/types/lib/view/wait-message/index.d.ts +2 -8
- package/package.json +36 -34
- package/dist/esm/data/react-redux.js +0 -7
|
@@ -23,12 +23,12 @@ __export(session_timeout_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(session_timeout_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react = require("react");
|
|
26
|
-
var
|
|
26
|
+
var import_react2 = require("../../data/react.js");
|
|
27
27
|
var import_actions = require("../../data/logout/actions.js");
|
|
28
28
|
var import_session = require("../../utils/session.js");
|
|
29
29
|
var import_session_expiry = require("../modals/session-expiry/index.js");
|
|
30
30
|
const SessionTimeout = () => {
|
|
31
|
-
const dispatch = (0,
|
|
31
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
32
32
|
const [showSessionExpiryWarning, setSessionExpiryWarning] = (0, import_react.useState)(false);
|
|
33
33
|
const [warningNotifiedAt, setwarningNotifiedAt] = (0, import_react.useState)();
|
|
34
34
|
(0, import_react.useEffect)(() => {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var wait_message_exports = {};
|
|
30
20
|
__export(wait_message_exports, {
|
|
@@ -33,29 +23,18 @@ __export(wait_message_exports, {
|
|
|
33
23
|
module.exports = __toCommonJS(wait_message_exports);
|
|
34
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_react = require("react");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var import_ds_circular_progress_indicator = require("@elliemae/ds-circular-progress-indicator");
|
|
39
|
-
var import_react_redux = require("../../data/react-redux.js");
|
|
26
|
+
var import_ds_loading_indicator = require("@elliemae/ds-loading-indicator");
|
|
27
|
+
var import_react2 = require("../../data/react.js");
|
|
40
28
|
var import_use_html_wait_message = require("./use-html-wait-message.js");
|
|
41
29
|
var import_user_wait_event = require("../../analytics/user-wait-event.js");
|
|
42
|
-
const StyledCircularIndicator = (0, import_styled_components.default)(import_ds_circular_progress_indicator.DSCircularIndeterminateIndicator)`
|
|
43
|
-
position: absolute;
|
|
44
|
-
left: 50%;
|
|
45
|
-
top: 50%;
|
|
46
|
-
transform: translate(-50%, -50%);
|
|
47
|
-
`;
|
|
48
30
|
const WaitMessage = (0, import_react.memo)(
|
|
49
31
|
({
|
|
50
|
-
size = "
|
|
51
|
-
|
|
52
|
-
showText = true,
|
|
53
|
-
withTooltip = false,
|
|
54
|
-
tooltipStartPlacementPreference = "center",
|
|
32
|
+
size = "m",
|
|
33
|
+
style = { color: "white", fontSize: "1.25rem" },
|
|
55
34
|
...rest
|
|
56
35
|
}) => {
|
|
57
|
-
const isOpen = (0,
|
|
58
|
-
const message = (0,
|
|
36
|
+
const isOpen = (0, import_react2.useAppSelector)((state) => state.waitMessage?.isOpen);
|
|
37
|
+
const message = (0, import_react2.useAppSelector)((state) => state.waitMessage?.message);
|
|
59
38
|
(0, import_react.useEffect)(() => {
|
|
60
39
|
if (isOpen)
|
|
61
40
|
(0, import_user_wait_event.waitStartEvent)();
|
|
@@ -63,21 +42,16 @@ const WaitMessage = (0, import_react.memo)(
|
|
|
63
42
|
(0, import_user_wait_event.waitEndEvent)();
|
|
64
43
|
}, [isOpen]);
|
|
65
44
|
(0, import_use_html_wait_message.useHTMLWaitMessage)(isOpen !== null);
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
...rest,
|
|
78
|
-
text: message
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
] }) : null;
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
import_ds_loading_indicator.DSLoadingIndicator,
|
|
47
|
+
{
|
|
48
|
+
id: "em-loading",
|
|
49
|
+
size,
|
|
50
|
+
style,
|
|
51
|
+
...rest,
|
|
52
|
+
loading: isOpen,
|
|
53
|
+
message
|
|
54
|
+
}
|
|
55
|
+
);
|
|
82
56
|
}
|
|
83
57
|
);
|
|
@@ -22,10 +22,10 @@ __export(wait_message_launcher_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(wait_message_launcher_exports);
|
|
24
24
|
var import_react = require("react");
|
|
25
|
-
var
|
|
25
|
+
var import_react2 = require("../../data/react.js");
|
|
26
26
|
var import_actions = require("../../data/wait-message/actions.js");
|
|
27
27
|
const WaitMessageLauncher = () => {
|
|
28
|
-
const dispatch = (0,
|
|
28
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
29
29
|
(0, import_react.useEffect)(() => {
|
|
30
30
|
dispatch(import_actions.waitMessage.open());
|
|
31
31
|
return () => {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getAuthHTTPClient } from "./index.js";
|
|
2
|
+
const sdkBaseQuery = ({ baseUrl } = {}) => async ({ url, method, data, params, headers }) => {
|
|
3
|
+
try {
|
|
4
|
+
const result = await getAuthHTTPClient({
|
|
5
|
+
baseURL: baseUrl,
|
|
6
|
+
headers
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
8
|
+
}).request({ url, method, data, params });
|
|
9
|
+
return { data: result.data };
|
|
10
|
+
} catch (axiosError) {
|
|
11
|
+
const err = axiosError;
|
|
12
|
+
return {
|
|
13
|
+
error: {
|
|
14
|
+
status: err.response?.status,
|
|
15
|
+
data: err.response?.data || err.message
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
sdkBaseQuery
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { compose } from "redux";
|
|
2
|
+
const middlewareDispatchFns = /* @__PURE__ */ new Map();
|
|
3
|
+
let store;
|
|
4
|
+
const appMiddleware = (_store) => {
|
|
5
|
+
store = _store;
|
|
6
|
+
const dispatchFns = Array.from(middlewareDispatchFns.values());
|
|
7
|
+
return (next) => (action) => (
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9
|
+
compose(...dispatchFns)(next)(action)
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
const addMiddleware = ({
|
|
13
|
+
key,
|
|
14
|
+
middleware
|
|
15
|
+
}) => {
|
|
16
|
+
if (middlewareDispatchFns.has(key) || !store)
|
|
17
|
+
return;
|
|
18
|
+
middlewareDispatchFns.set(key, middleware(store));
|
|
19
|
+
};
|
|
20
|
+
const removeMiddleware = (key) => {
|
|
21
|
+
middlewareDispatchFns.delete(key);
|
|
22
|
+
};
|
|
23
|
+
const resetMiddlewares = () => {
|
|
24
|
+
middlewareDispatchFns.clear();
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
addMiddleware,
|
|
28
|
+
appMiddleware,
|
|
29
|
+
removeMiddleware,
|
|
30
|
+
resetMiddlewares
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isRejectedWithValue } from "@reduxjs/toolkit";
|
|
2
|
+
import { actions as error } from "./error/index.js";
|
|
3
|
+
const errorMiddleware = (api) => (next) => (action) => {
|
|
4
|
+
if (isRejectedWithValue(action)) {
|
|
5
|
+
api.dispatch(error.set({ messageText: action?.error?.data?.message }));
|
|
6
|
+
}
|
|
7
|
+
return next(action);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
errorMiddleware
|
|
11
|
+
};
|
package/dist/esm/data/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
useInjectSaga,
|
|
4
4
|
createManager
|
|
5
5
|
} from "redux-injectors";
|
|
6
|
-
import { useAppDispatch, useAppSelector } from "./react
|
|
6
|
+
import { useAppDispatch, useAppSelector } from "./react.js";
|
|
7
7
|
import { createAppStore, getStore } from "./store.js";
|
|
8
8
|
export {
|
|
9
9
|
createAppStore as configureStore,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createListenerMiddleware } from "@reduxjs/toolkit";
|
|
2
|
+
let listenerAPI;
|
|
3
|
+
const rtkListenerMiddleware = createListenerMiddleware();
|
|
4
|
+
const listenerDispatchFns = /* @__PURE__ */ new Map();
|
|
5
|
+
const listenerMiddleware = (_listenerAPI) => {
|
|
6
|
+
listenerAPI = _listenerAPI;
|
|
7
|
+
return rtkListenerMiddleware.middleware(listenerAPI);
|
|
8
|
+
};
|
|
9
|
+
const addListener = ({
|
|
10
|
+
key,
|
|
11
|
+
listener
|
|
12
|
+
}) => {
|
|
13
|
+
if (listenerDispatchFns.has(key) && listenerAPI) {
|
|
14
|
+
listenerDispatchFns.set(key, listener);
|
|
15
|
+
return rtkListenerMiddleware.startListening(listener);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
const removeListener = (key) => {
|
|
20
|
+
const listener = listenerDispatchFns.get(key);
|
|
21
|
+
if (listener) {
|
|
22
|
+
listenerDispatchFns.delete(key);
|
|
23
|
+
return rtkListenerMiddleware.stopListening(listener);
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
const resetListeners = () => {
|
|
28
|
+
listenerDispatchFns.forEach((listener) => {
|
|
29
|
+
rtkListenerMiddleware.stopListening(listener);
|
|
30
|
+
});
|
|
31
|
+
listenerDispatchFns.clear();
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
addListener,
|
|
35
|
+
listenerMiddleware,
|
|
36
|
+
removeListener,
|
|
37
|
+
resetListeners
|
|
38
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { compose } from "redux";
|
|
2
|
+
const middlewareDispatchFns = /* @__PURE__ */ new Map();
|
|
3
|
+
let store;
|
|
4
|
+
const queryMiddleware = (_store) => {
|
|
5
|
+
store = _store;
|
|
6
|
+
return (next) => (action) => (
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8
|
+
compose(...middlewareDispatchFns.values())(next)(action)
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
const addMiddleware = ({
|
|
12
|
+
reducerPath,
|
|
13
|
+
middleware
|
|
14
|
+
}) => {
|
|
15
|
+
if (middlewareDispatchFns.has(reducerPath) || !store)
|
|
16
|
+
return;
|
|
17
|
+
middlewareDispatchFns.set(reducerPath, middleware(store));
|
|
18
|
+
};
|
|
19
|
+
const removeMiddleware = (reducerPath) => {
|
|
20
|
+
middlewareDispatchFns.delete(reducerPath);
|
|
21
|
+
};
|
|
22
|
+
const resetMiddlewares = () => {
|
|
23
|
+
middlewareDispatchFns.clear();
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
addMiddleware,
|
|
27
|
+
queryMiddleware,
|
|
28
|
+
removeMiddleware,
|
|
29
|
+
resetMiddlewares
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useInjectQuery } from "./useInjectQuery.js";
|
|
2
|
+
import { useInjectListener } from "./useInjectListener.js";
|
|
3
|
+
import { useAppDispatch } from "./useAppDispatch.js";
|
|
4
|
+
import { useAppSelector } from "./useAppSelector.js";
|
|
5
|
+
import { useAppMiddleware } from "./useAppMiddleware.js";
|
|
6
|
+
export {
|
|
7
|
+
useAppDispatch,
|
|
8
|
+
useAppMiddleware,
|
|
9
|
+
useAppSelector,
|
|
10
|
+
useInjectListener,
|
|
11
|
+
useInjectQuery
|
|
12
|
+
};
|
package/dist/esm/data/store.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { configureStore } from "@reduxjs/toolkit";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
} from "redux-injectors";
|
|
2
|
+
import { setupListeners } from "@reduxjs/toolkit/query/react";
|
|
3
|
+
import { createInjectorsEnhancer } from "redux-injectors";
|
|
5
4
|
import createSagaMiddleware from "redux-saga";
|
|
6
5
|
import { createReducer } from "./reducers.js";
|
|
7
6
|
import { enableHotReloading } from "./webpack-hmr.js";
|
|
7
|
+
import { queryMiddleware } from "./queryMiddleware.js";
|
|
8
|
+
import { listenerMiddleware } from "./listenerMiddleware.js";
|
|
8
9
|
const rootReducer = createReducer();
|
|
9
10
|
let appStore = null;
|
|
10
11
|
const setStore = (store) => {
|
|
11
12
|
appStore = store;
|
|
12
13
|
};
|
|
13
14
|
const getStore = () => appStore;
|
|
14
|
-
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
15
|
+
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {}) => {
|
|
15
16
|
const { run: runSaga } = sagaMiddleware;
|
|
16
17
|
const enhancers = [
|
|
17
18
|
createInjectorsEnhancer({
|
|
@@ -21,11 +22,12 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
|
21
22
|
];
|
|
22
23
|
const baseStore = configureStore({
|
|
23
24
|
reducer: rootReducer,
|
|
24
|
-
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware),
|
|
25
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).prepend(listenerMiddleware).concat([sagaMiddleware, queryMiddleware]),
|
|
25
26
|
devTools: true,
|
|
26
27
|
preloadedState: initialState,
|
|
27
28
|
enhancers
|
|
28
29
|
});
|
|
30
|
+
setupListeners(baseStore.dispatch);
|
|
29
31
|
enableHotReloading(baseStore);
|
|
30
32
|
return baseStore;
|
|
31
33
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { addMiddleware, removeMiddleware } from "./appMiddleware.js";
|
|
3
|
+
const useAppMiddleware = ({
|
|
4
|
+
key,
|
|
5
|
+
middleware
|
|
6
|
+
}) => useEffect(() => {
|
|
7
|
+
addMiddleware({ key, middleware });
|
|
8
|
+
return () => {
|
|
9
|
+
removeMiddleware(key);
|
|
10
|
+
};
|
|
11
|
+
}, [key, middleware]);
|
|
12
|
+
export {
|
|
13
|
+
useAppMiddleware
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
addListener,
|
|
4
|
+
removeListener
|
|
5
|
+
} from "./listenerMiddleware.js";
|
|
6
|
+
const useInjectListener = ({
|
|
7
|
+
key,
|
|
8
|
+
listener
|
|
9
|
+
}) => useEffect(() => {
|
|
10
|
+
addListener({ key, listener });
|
|
11
|
+
return () => {
|
|
12
|
+
removeListener(key);
|
|
13
|
+
};
|
|
14
|
+
}, [key, listener]);
|
|
15
|
+
export {
|
|
16
|
+
useInjectListener
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useInjectReducer } from "redux-injectors";
|
|
2
|
+
import {
|
|
3
|
+
addMiddleware
|
|
4
|
+
} from "./queryMiddleware.js";
|
|
5
|
+
const useInjectQuery = ({
|
|
6
|
+
reducerPath,
|
|
7
|
+
reducer,
|
|
8
|
+
middleware
|
|
9
|
+
}) => {
|
|
10
|
+
useInjectReducer({ key: reducerPath, reducer });
|
|
11
|
+
addMiddleware({ reducerPath, middleware });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
useInjectQuery
|
|
15
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
getHTTPClient,
|
|
4
4
|
getAuthHTTPClient
|
|
5
5
|
} from "./communication/http-client/index.js";
|
|
6
|
+
import { sdkBaseQuery } from "./communication/http-client/baseQuery.js";
|
|
6
7
|
import { onAuthorizationFailure } from "./communication/http-client/response-interceptor.js";
|
|
7
8
|
import { auth } from "./data/auth/actions.js";
|
|
8
9
|
import { RequireAuth } from "./view/require-auth.js";
|
|
@@ -10,12 +11,19 @@ import { authentication } from "./sideeffect/auth/index.js";
|
|
|
10
11
|
import { authReducer } from "./data/auth/reducer.js";
|
|
11
12
|
import { Page } from "./view/page.js";
|
|
12
13
|
import { default as default2 } from "./utils/constants.js";
|
|
13
|
-
import { useAppDispatch, useAppSelector } from "./data/react-redux.js";
|
|
14
14
|
import {
|
|
15
15
|
useInjectReducer,
|
|
16
16
|
useInjectSaga,
|
|
17
17
|
createManager
|
|
18
18
|
} from "redux-injectors";
|
|
19
|
+
import {
|
|
20
|
+
useInjectQuery,
|
|
21
|
+
useInjectListener,
|
|
22
|
+
useAppDispatch,
|
|
23
|
+
useAppSelector,
|
|
24
|
+
useAppMiddleware
|
|
25
|
+
} from "./data/react.js";
|
|
26
|
+
import { errorMiddleware } from "./data/errorMiddleware.js";
|
|
19
27
|
import { getAuthorizationHeader } from "./utils/auth/helper.js";
|
|
20
28
|
import { getRedirectUrl, removeDoubleSlash } from "./utils/url.js";
|
|
21
29
|
import { createAppStore } from "./data/store.js";
|
|
@@ -164,6 +172,7 @@ export {
|
|
|
164
172
|
createManager,
|
|
165
173
|
enableReactAppForHostIntegration,
|
|
166
174
|
actions2 as error,
|
|
175
|
+
errorMiddleware,
|
|
167
176
|
fetchHostAppData,
|
|
168
177
|
getUser as fetchUserSettings,
|
|
169
178
|
getApiActionCreator,
|
|
@@ -201,6 +210,7 @@ export {
|
|
|
201
210
|
renderWithRouter,
|
|
202
211
|
renderWithRouterRedux,
|
|
203
212
|
resetUserIdleTime,
|
|
213
|
+
sdkBaseQuery,
|
|
204
214
|
sendBAEvent,
|
|
205
215
|
sendMessageToHost,
|
|
206
216
|
setAppConfig,
|
|
@@ -213,7 +223,10 @@ export {
|
|
|
213
223
|
trackActivity,
|
|
214
224
|
updateBAEventParameters,
|
|
215
225
|
useAppDispatch,
|
|
226
|
+
useAppMiddleware,
|
|
216
227
|
useAppSelector,
|
|
228
|
+
useInjectListener,
|
|
229
|
+
useInjectQuery,
|
|
217
230
|
useInjectReducer,
|
|
218
231
|
useInjectSaga,
|
|
219
232
|
useMediaQueryList,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
import { ThemeContext } from "styled-components";
|
|
3
3
|
import { publish } from "pubsub-js";
|
|
4
|
-
import { useAppDispatch } from "../../data/react
|
|
4
|
+
import { useAppDispatch } from "../../data/react.js";
|
|
5
5
|
import { breakpoint } from "../../data/breakpoint/index.js";
|
|
6
6
|
import { useMediaQueryList } from "./use-media-query-list.js";
|
|
7
7
|
import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, memo } from "react";
|
|
3
3
|
import { ToastPosition, ToastType, DSToast, toast } from "@elliemae/ds-toast";
|
|
4
|
-
import { useAppSelector, useAppDispatch } from "../../data/react
|
|
4
|
+
import { useAppSelector, useAppDispatch } from "../../data/react.js";
|
|
5
5
|
import { actions as error } from "../../data/error/index.js";
|
|
6
6
|
const ErrorToast = memo((props) => {
|
|
7
7
|
const storeError = useAppSelector((state) => state?.error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { LiveMessage as AriaLiveMessage } from "react-aria-live";
|
|
3
|
-
import { useAppSelector } from "../../data/react
|
|
3
|
+
import { useAppSelector } from "../../data/react.js";
|
|
4
4
|
const LiveMessage = () => {
|
|
5
5
|
const message = useAppSelector((state) => state.liveMessage?.message);
|
|
6
6
|
const ariaLive = useAppSelector((state) => state.liveMessage?.ariaLive);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { useAppDispatch } from "../../data/react
|
|
3
|
+
import { useAppDispatch } from "../../data/react.js";
|
|
4
4
|
import { login } from "../../utils/auth/index.js";
|
|
5
5
|
import { LOGIN_SUCCESS } from "../../data/auth/actions.js";
|
|
6
6
|
const Login = ({
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
DSDialogSeparator,
|
|
11
11
|
DSDialogAddon
|
|
12
12
|
} from "@elliemae/ds-dialog";
|
|
13
|
-
import { useAppDispatch } from "../../../data/react
|
|
13
|
+
import { useAppDispatch } from "../../../data/react.js";
|
|
14
14
|
import { navigationPrompt } from "../../../data/navigation-prompt/actions.js";
|
|
15
15
|
const NavigationPrompt = memo(
|
|
16
16
|
({ open = false }) => {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
DSDialogFooter,
|
|
12
12
|
DSDialogSeparator
|
|
13
13
|
} from "@elliemae/ds-dialog";
|
|
14
|
-
import { useAppDispatch } from "../../../data/react
|
|
14
|
+
import { useAppDispatch } from "../../../data/react.js";
|
|
15
15
|
import { logout } from "../../../data/logout/actions.js";
|
|
16
16
|
import {
|
|
17
17
|
resetUserIdleTime,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { useAppDispatch } from "../../data/react
|
|
3
|
+
import { useAppDispatch } from "../../data/react.js";
|
|
4
4
|
import { logout } from "../../data/logout/actions.js";
|
|
5
5
|
import {
|
|
6
6
|
initSessionMonitoring,
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useEffect } from "react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { DSCircularIndeterminateIndicator } from "@elliemae/ds-circular-progress-indicator";
|
|
6
|
-
import { useAppSelector } from "../../data/react-redux.js";
|
|
3
|
+
import { DSLoadingIndicator } from "@elliemae/ds-loading-indicator";
|
|
4
|
+
import { useAppSelector } from "../../data/react.js";
|
|
7
5
|
import { useHTMLWaitMessage } from "./use-html-wait-message.js";
|
|
8
6
|
import {
|
|
9
7
|
waitStartEvent,
|
|
10
8
|
waitEndEvent
|
|
11
9
|
} from "../../analytics/user-wait-event.js";
|
|
12
|
-
const StyledCircularIndicator = styled(DSCircularIndeterminateIndicator)`
|
|
13
|
-
position: absolute;
|
|
14
|
-
left: 50%;
|
|
15
|
-
top: 50%;
|
|
16
|
-
transform: translate(-50%, -50%);
|
|
17
|
-
`;
|
|
18
10
|
const WaitMessage = memo(
|
|
19
11
|
({
|
|
20
|
-
size = "
|
|
21
|
-
|
|
22
|
-
showText = true,
|
|
23
|
-
withTooltip = false,
|
|
24
|
-
tooltipStartPlacementPreference = "center",
|
|
12
|
+
size = "m",
|
|
13
|
+
style = { color: "white", fontSize: "1.25rem" },
|
|
25
14
|
...rest
|
|
26
15
|
}) => {
|
|
27
16
|
const isOpen = useAppSelector((state) => state.waitMessage?.isOpen);
|
|
@@ -33,22 +22,17 @@ const WaitMessage = memo(
|
|
|
33
22
|
waitEndEvent();
|
|
34
23
|
}, [isOpen]);
|
|
35
24
|
useHTMLWaitMessage(isOpen !== null);
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
...rest,
|
|
48
|
-
text: message
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
] }) : null;
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
DSLoadingIndicator,
|
|
27
|
+
{
|
|
28
|
+
id: "em-loading",
|
|
29
|
+
size,
|
|
30
|
+
style,
|
|
31
|
+
...rest,
|
|
32
|
+
loading: isOpen,
|
|
33
|
+
message
|
|
34
|
+
}
|
|
35
|
+
);
|
|
52
36
|
}
|
|
53
37
|
);
|
|
54
38
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import { useAppDispatch } from "../../data/react
|
|
2
|
+
import { useAppDispatch } from "../../data/react.js";
|
|
3
3
|
import { waitMessage } from "../../data/wait-message/actions.js";
|
|
4
4
|
const WaitMessageLauncher = () => {
|
|
5
5
|
const dispatch = useAppDispatch();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseQueryFn } from '@reduxjs/toolkit/query';
|
|
2
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
|
+
import { RequestConfig } from './index.js';
|
|
4
|
+
type BaseQueryFunction = BaseQueryFn<{
|
|
5
|
+
url: string;
|
|
6
|
+
method: AxiosRequestConfig['method'];
|
|
7
|
+
data?: AxiosRequestConfig['data'];
|
|
8
|
+
params?: AxiosRequestConfig['params'];
|
|
9
|
+
headers?: RequestConfig;
|
|
10
|
+
}, unknown, unknown>;
|
|
11
|
+
export declare const sdkBaseQuery: ({ baseUrl }?: {
|
|
12
|
+
baseUrl?: string | undefined;
|
|
13
|
+
}) => BaseQueryFunction;
|
|
14
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance, RawAxiosRequestHeaders, HeadersDefaults } from 'axios';
|
|
2
2
|
type AxiosRequestHeaders = RawAxiosRequestHeaders | Partial<HeadersDefaults>;
|
|
3
|
-
type RequestConfig = {
|
|
3
|
+
export type RequestConfig = {
|
|
4
4
|
Authorization?: string;
|
|
5
5
|
} & AxiosRequestHeaders;
|
|
6
6
|
export declare const getHTTPClient: ({ baseURL, headers, }?: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Middleware } from 'redux';
|
|
2
|
+
export declare const appMiddleware: Middleware<any, any>;
|
|
3
|
+
export declare const addMiddleware: ({ key, middleware, }: {
|
|
4
|
+
key: string;
|
|
5
|
+
middleware: Middleware<any, any>;
|
|
6
|
+
}) => void;
|
|
7
|
+
export declare const removeMiddleware: (key: string) => void;
|
|
8
|
+
export declare const resetMiddlewares: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { useInjectReducer, useInjectSaga, createManager, } from 'redux-injectors';
|
|
2
|
-
export { useAppDispatch, useAppSelector } from './react
|
|
2
|
+
export { useAppDispatch, useAppSelector } from './react.js';
|
|
3
3
|
export { createAppStore as configureStore, getStore } from './store.js';
|
|
4
4
|
export type { RootState, AppStore } from './store.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Middleware, AnyAction } from 'redux';
|
|
2
|
+
declare const rtkListenerMiddleware: import("@reduxjs/toolkit").ListenerMiddlewareInstance<unknown, import("@reduxjs/toolkit").ThunkDispatch<unknown, unknown, AnyAction>, unknown>;
|
|
3
|
+
export type ListenerDispatchFn = Parameters<typeof rtkListenerMiddleware.startListening>[0];
|
|
4
|
+
export declare const listenerMiddleware: Middleware<any, any>;
|
|
5
|
+
export declare const addListener: ({ key, listener, }: {
|
|
6
|
+
key: string;
|
|
7
|
+
listener: Parameters<typeof rtkListenerMiddleware.startListening>[0];
|
|
8
|
+
}) => import("@reduxjs/toolkit").UnsubscribeListener | null;
|
|
9
|
+
export declare const removeListener: (key: string) => boolean;
|
|
10
|
+
export declare const resetListeners: () => void;
|
|
11
|
+
export {};
|