@elliemae/pui-app-sdk 4.10.0-beta.3 → 4.10.0-beta.5
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/data/appMiddleware.js +51 -0
- package/dist/cjs/data/index.js +3 -3
- package/dist/cjs/data/queryMiddleware.js +5 -5
- package/dist/cjs/data/react.js +32 -0
- 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/{redux-injectors.js → useInjectListener.js} +4 -23
- package/dist/cjs/data/useInjectQuery.js +33 -0
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/view/breakpoint/use-breakpoint.js +2 -2
- package/dist/cjs/view/error-toast/index.js +3 -3
- package/dist/cjs/view/live-message/index.js +4 -4
- 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/modals/wait-message/index.js +3 -3
- package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +2 -2
- package/dist/cjs/view/session-timeout/index.js +2 -2
- package/dist/esm/data/appMiddleware.js +31 -0
- package/dist/esm/data/index.js +1 -1
- package/dist/esm/data/queryMiddleware.js +5 -5
- package/dist/esm/data/react.js +12 -0
- 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 +9 -3
- package/dist/esm/view/breakpoint/use-breakpoint.js +1 -1
- package/dist/esm/view/error-toast/index.js +1 -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/modals/wait-message/index.js +1 -1
- package/dist/esm/view/modals/wait-message/wait-message-launcher.js +1 -1
- package/dist/esm/view/session-timeout/index.js +1 -1
- package/dist/types/lib/data/appMiddleware.d.ts +8 -0
- package/dist/types/lib/data/index.d.ts +1 -1
- package/dist/types/lib/data/queryMiddleware.d.ts +8 -6
- package/dist/types/lib/data/react.d.ts +5 -0
- 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 +6 -0
- package/dist/types/lib/index.d.ts +2 -3
- package/package.json +1 -1
- package/dist/esm/data/react-redux.js +0 -7
- package/dist/esm/data/redux-injectors.js +0 -39
- package/dist/types/lib/data/redux-injectors.d.ts +0 -12
|
@@ -0,0 +1,51 @@
|
|
|
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 appMiddleware_exports = {};
|
|
20
|
+
__export(appMiddleware_exports, {
|
|
21
|
+
addMiddleware: () => addMiddleware,
|
|
22
|
+
appMiddleware: () => appMiddleware,
|
|
23
|
+
removeMiddleware: () => removeMiddleware,
|
|
24
|
+
resetMiddlewares: () => resetMiddlewares
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(appMiddleware_exports);
|
|
27
|
+
var import_redux = require("redux");
|
|
28
|
+
const middlewareDispatchFns = /* @__PURE__ */ new Map();
|
|
29
|
+
let store;
|
|
30
|
+
const appMiddleware = (_store) => {
|
|
31
|
+
store = _store;
|
|
32
|
+
const dispatchFns = Array.from(middlewareDispatchFns.values());
|
|
33
|
+
return (next) => (action) => (
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
35
|
+
(0, import_redux.compose)(...dispatchFns)(next)(action)
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const addMiddleware = ({
|
|
39
|
+
key,
|
|
40
|
+
middleware
|
|
41
|
+
}) => {
|
|
42
|
+
if (middlewareDispatchFns.has(key) || !store)
|
|
43
|
+
return;
|
|
44
|
+
middlewareDispatchFns.set(key, middleware(store));
|
|
45
|
+
};
|
|
46
|
+
const removeMiddleware = (key) => {
|
|
47
|
+
middlewareDispatchFns.delete(key);
|
|
48
|
+
};
|
|
49
|
+
const resetMiddlewares = () => {
|
|
50
|
+
middlewareDispatchFns.clear();
|
|
51
|
+
};
|
package/dist/cjs/data/index.js
CHANGED
|
@@ -21,12 +21,12 @@ __export(data_exports, {
|
|
|
21
21
|
configureStore: () => import_store.createAppStore,
|
|
22
22
|
createManager: () => import_redux_injectors.createManager,
|
|
23
23
|
getStore: () => import_store.getStore,
|
|
24
|
-
useAppDispatch: () =>
|
|
25
|
-
useAppSelector: () =>
|
|
24
|
+
useAppDispatch: () => import_react.useAppDispatch,
|
|
25
|
+
useAppSelector: () => import_react.useAppSelector,
|
|
26
26
|
useInjectReducer: () => import_redux_injectors.useInjectReducer,
|
|
27
27
|
useInjectSaga: () => import_redux_injectors.useInjectSaga
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(data_exports);
|
|
30
30
|
var import_redux_injectors = require("redux-injectors");
|
|
31
|
-
var
|
|
31
|
+
var import_react = require("./react.js");
|
|
32
32
|
var import_store = require("./store.js");
|
|
@@ -36,15 +36,15 @@ const queryMiddleware = (_store) => {
|
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
38
|
const addMiddleware = ({
|
|
39
|
-
|
|
39
|
+
reducerPath,
|
|
40
40
|
middleware
|
|
41
41
|
}) => {
|
|
42
|
-
if (middlewareDispatchFns.has(
|
|
42
|
+
if (middlewareDispatchFns.has(reducerPath) || !store)
|
|
43
43
|
return;
|
|
44
|
-
middlewareDispatchFns.set(
|
|
44
|
+
middlewareDispatchFns.set(reducerPath, middleware(store));
|
|
45
45
|
};
|
|
46
|
-
const removeMiddleware = (
|
|
47
|
-
middlewareDispatchFns.delete(
|
|
46
|
+
const removeMiddleware = (reducerPath) => {
|
|
47
|
+
middlewareDispatchFns.delete(reducerPath);
|
|
48
48
|
};
|
|
49
49
|
const resetMiddlewares = () => {
|
|
50
50
|
middlewareDispatchFns.clear();
|
|
@@ -0,0 +1,32 @@
|
|
|
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 react_exports = {};
|
|
20
|
+
__export(react_exports, {
|
|
21
|
+
useAppDispatch: () => import_useAppDispatch.useAppDispatch,
|
|
22
|
+
useAppMiddleware: () => import_useAppMiddleware.useAppMiddleware,
|
|
23
|
+
useAppSelector: () => import_useAppSelector.useAppSelector,
|
|
24
|
+
useInjectListener: () => import_useInjectListener.useInjectListener,
|
|
25
|
+
useInjectQuery: () => import_useInjectQuery.useInjectQuery
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(react_exports);
|
|
28
|
+
var import_useInjectQuery = require("./useInjectQuery.js");
|
|
29
|
+
var import_useInjectListener = require("./useInjectListener.js");
|
|
30
|
+
var import_useAppDispatch = require("./useAppDispatch.js");
|
|
31
|
+
var import_useAppSelector = require("./useAppSelector.js");
|
|
32
|
+
var import_useAppMiddleware = require("./useAppMiddleware.js");
|
|
@@ -0,0 +1,25 @@
|
|
|
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 useAppDispatch_exports = {};
|
|
20
|
+
__export(useAppDispatch_exports, {
|
|
21
|
+
useAppDispatch: () => useAppDispatch
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useAppDispatch_exports);
|
|
24
|
+
var import_react_redux = require("react-redux");
|
|
25
|
+
const useAppDispatch = () => (0, import_react_redux.useDispatch)();
|
|
@@ -0,0 +1,34 @@
|
|
|
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 useAppMiddleware_exports = {};
|
|
20
|
+
__export(useAppMiddleware_exports, {
|
|
21
|
+
useAppMiddleware: () => useAppMiddleware
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useAppMiddleware_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
var import_appMiddleware = require("./appMiddleware.js");
|
|
26
|
+
const useAppMiddleware = ({
|
|
27
|
+
key,
|
|
28
|
+
middleware
|
|
29
|
+
}) => (0, import_react.useEffect)(() => {
|
|
30
|
+
(0, import_appMiddleware.addMiddleware)({ key, middleware });
|
|
31
|
+
return () => {
|
|
32
|
+
(0, import_appMiddleware.removeMiddleware)(key);
|
|
33
|
+
};
|
|
34
|
+
}, [key, middleware]);
|
|
@@ -16,12 +16,10 @@ 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
|
-
useAppDispatch: () => useAppDispatch,
|
|
19
|
+
var useAppSelector_exports = {};
|
|
20
|
+
__export(useAppSelector_exports, {
|
|
22
21
|
useAppSelector: () => useAppSelector
|
|
23
22
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(useAppSelector_exports);
|
|
25
24
|
var import_react_redux = require("react-redux");
|
|
26
|
-
const useAppDispatch = () => (0, import_react_redux.useDispatch)();
|
|
27
25
|
const useAppSelector = import_react_redux.useSelector;
|
|
@@ -16,32 +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
|
-
useInjectListener: () => useInjectListener
|
|
22
|
-
useInjectQuery: () => useInjectQuery
|
|
19
|
+
var useInjectListener_exports = {};
|
|
20
|
+
__export(useInjectListener_exports, {
|
|
21
|
+
useInjectListener: () => useInjectListener
|
|
23
22
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(useInjectListener_exports);
|
|
25
24
|
var import_react = require("react");
|
|
26
|
-
var import_redux_injectors = require("redux-injectors");
|
|
27
|
-
var import_queryMiddleware = require("./queryMiddleware.js");
|
|
28
25
|
var import_listenerMiddleware = require("./listenerMiddleware.js");
|
|
29
|
-
const useInjectQuery = ({
|
|
30
|
-
key,
|
|
31
|
-
reducer,
|
|
32
|
-
queryMiddleware
|
|
33
|
-
}) => {
|
|
34
|
-
(0, import_redux_injectors.useInjectReducer)({ key, reducer });
|
|
35
|
-
return (0, import_react.useEffect)(() => {
|
|
36
|
-
if (!queryMiddleware)
|
|
37
|
-
return () => {
|
|
38
|
-
};
|
|
39
|
-
(0, import_queryMiddleware.addMiddleware)({ key, middleware: queryMiddleware });
|
|
40
|
-
return () => {
|
|
41
|
-
(0, import_queryMiddleware.removeMiddleware)(key);
|
|
42
|
-
};
|
|
43
|
-
}, [key, reducer, queryMiddleware]);
|
|
44
|
-
};
|
|
45
26
|
const useInjectListener = ({
|
|
46
27
|
key,
|
|
47
28
|
listener
|
|
@@ -0,0 +1,33 @@
|
|
|
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 useInjectQuery_exports = {};
|
|
20
|
+
__export(useInjectQuery_exports, {
|
|
21
|
+
useInjectQuery: () => useInjectQuery
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useInjectQuery_exports);
|
|
24
|
+
var import_redux_injectors = require("redux-injectors");
|
|
25
|
+
var import_queryMiddleware = require("./queryMiddleware.js");
|
|
26
|
+
const useInjectQuery = ({
|
|
27
|
+
reducerPath,
|
|
28
|
+
reducer,
|
|
29
|
+
middleware
|
|
30
|
+
}) => {
|
|
31
|
+
(0, import_redux_injectors.useInjectReducer)({ key: reducerPath, reducer });
|
|
32
|
+
(0, import_queryMiddleware.addMiddleware)({ reducerPath, middleware });
|
|
33
|
+
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -68,8 +68,8 @@ __export(lib_exports, {
|
|
|
68
68
|
auth: () => import_actions.auth,
|
|
69
69
|
authorize: () => import_auth.authorize,
|
|
70
70
|
configureStore: () => import_store.createAppStore,
|
|
71
|
-
createManager: () =>
|
|
72
|
-
enableReactAppForHostIntegration: () =>
|
|
71
|
+
createManager: () => import_redux_injectors.createManager,
|
|
72
|
+
enableReactAppForHostIntegration: () => import_react2.enableReactAppForHostIntegration,
|
|
73
73
|
error: () => import_error.actions,
|
|
74
74
|
errorMiddleware: () => import_errorMiddleware.errorMiddleware,
|
|
75
75
|
fetchHostAppData: () => import_fetch_host_app_data.fetchHostAppData,
|
|
@@ -121,12 +121,13 @@ __export(lib_exports, {
|
|
|
121
121
|
subscribeToSessionExpiryWarning: () => import_session.subscribeToSessionExpiryWarning,
|
|
122
122
|
trackActivity: () => import_session.trackActivity,
|
|
123
123
|
updateBAEventParameters: () => import_web_analytics.updateBAEventParameters,
|
|
124
|
-
useAppDispatch: () =>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
useAppDispatch: () => import_react.useAppDispatch,
|
|
125
|
+
useAppMiddleware: () => import_react.useAppMiddleware,
|
|
126
|
+
useAppSelector: () => import_react.useAppSelector,
|
|
127
|
+
useInjectListener: () => import_react.useInjectListener,
|
|
128
|
+
useInjectQuery: () => import_react.useInjectQuery,
|
|
129
|
+
useInjectReducer: () => import_redux_injectors.useInjectReducer,
|
|
130
|
+
useInjectSaga: () => import_redux_injectors.useInjectSaga,
|
|
130
131
|
useMediaQueryList: () => import_use_media_query_list.useMediaQueryList,
|
|
131
132
|
waitMessageAction: () => import_actions3.waitMessage,
|
|
132
133
|
withAppDecorator: () => import_decorator.withAppDecorator
|
|
@@ -140,9 +141,8 @@ var import_actions = require("./data/auth/actions.js");
|
|
|
140
141
|
var import_require_auth = require("./view/require-auth.js");
|
|
141
142
|
var import_page = require("./view/page.js");
|
|
142
143
|
var import_constants = __toESM(require("./utils/constants.js"));
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
var import_redux_injectors = require("./data/redux-injectors.js");
|
|
144
|
+
var import_redux_injectors = require("redux-injectors");
|
|
145
|
+
var import_react = require("./data/react.js");
|
|
146
146
|
var import_errorMiddleware = require("./data/errorMiddleware.js");
|
|
147
147
|
var import_helper = require("./utils/auth/helper.js");
|
|
148
148
|
var import_url = require("./utils/url.js");
|
|
@@ -158,7 +158,7 @@ var import_actions3 = require("./data/wait-message/actions.js");
|
|
|
158
158
|
var import_service_worker = require("./utils/service-worker.js");
|
|
159
159
|
var import_guest = require("./utils/micro-frontend/guest.js");
|
|
160
160
|
var import_host = require("./utils/micro-frontend/host.js");
|
|
161
|
-
var
|
|
161
|
+
var import_react2 = require("./utils/app-host-integration/react.js");
|
|
162
162
|
var import_config = require("./utils/app-config/config.js");
|
|
163
163
|
var import_micro_frontend = require("./utils/micro-frontend/index.js");
|
|
164
164
|
var import_app_config = require("./utils/app-config/index.js");
|
|
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(use_breakpoint_exports);
|
|
|
24
24
|
var import_react = require("react");
|
|
25
25
|
var import_styled_components = require("styled-components");
|
|
26
26
|
var import_pubsub_js = require("pubsub-js");
|
|
27
|
-
var
|
|
27
|
+
var import_react2 = require("../../data/react.js");
|
|
28
28
|
var import_breakpoint = require("../../data/breakpoint/index.js");
|
|
29
29
|
var import_use_media_query_list = require("./use-media-query-list.js");
|
|
30
30
|
var import_constants = require("../../utils/constants.js");
|
|
@@ -39,7 +39,7 @@ const useBreakpoint = () => {
|
|
|
39
39
|
["small", "medium", "large"],
|
|
40
40
|
"large"
|
|
41
41
|
);
|
|
42
|
-
const dispatch = (0,
|
|
42
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
43
43
|
(0, import_react.useEffect)(() => {
|
|
44
44
|
dispatch({ type: import_breakpoint.breakpoint.change, payload: currentBreakpoint });
|
|
45
45
|
(0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
|
|
@@ -24,11 +24,11 @@ module.exports = __toCommonJS(error_toast_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_ds_toast = require("@elliemae/ds-toast");
|
|
27
|
-
var
|
|
27
|
+
var import_react2 = require("../../data/react.js");
|
|
28
28
|
var import_error = require("../../data/error/index.js");
|
|
29
29
|
const ErrorToast = (0, import_react.memo)((props) => {
|
|
30
|
-
const storeError = (0,
|
|
31
|
-
const dispatch = (0,
|
|
30
|
+
const storeError = (0, import_react2.useAppSelector)((state) => state?.error);
|
|
31
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
32
32
|
(0, import_react.useEffect)(() => {
|
|
33
33
|
if (storeError && (storeError?.description || storeError?.messageText)) {
|
|
34
34
|
const toastProps = {
|
|
@@ -23,10 +23,10 @@ __export(live_message_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(live_message_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react_aria_live = require("react-aria-live");
|
|
26
|
-
var
|
|
26
|
+
var import_react = require("../../data/react.js");
|
|
27
27
|
const LiveMessage = () => {
|
|
28
|
-
const message = (0,
|
|
29
|
-
const id = (0,
|
|
30
|
-
const ariaLive = (0,
|
|
28
|
+
const message = (0, import_react.useAppSelector)((state) => state.liveMessage?.message);
|
|
29
|
+
const id = (0, import_react.useAppSelector)((state) => state.liveMessage?.id);
|
|
30
|
+
const ariaLive = (0, import_react.useAppSelector)((state) => state.liveMessage?.ariaLive);
|
|
31
31
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_aria_live.LiveMessage, { message, "aria-live": ariaLive, id });
|
|
32
32
|
};
|
|
@@ -23,7 +23,7 @@ __export(login_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(login_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_auth = require("../../utils/auth/index.js");
|
|
28
28
|
var import_actions = require("../../data/auth/actions.js");
|
|
29
29
|
const Login = ({
|
|
@@ -33,7 +33,7 @@ const Login = ({
|
|
|
33
33
|
children
|
|
34
34
|
}) => {
|
|
35
35
|
const [userAuthorized, setUserAuthorized] = (0, import_react.useState)(false);
|
|
36
|
-
const dispatch = (0,
|
|
36
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
37
37
|
(0, import_react.useEffect)(() => {
|
|
38
38
|
(0, import_auth.login)({ clientId, scope, responseType }).then(({ authorized }) => {
|
|
39
39
|
if (authorized)
|
|
@@ -26,11 +26,11 @@ var import_react = require("react");
|
|
|
26
26
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
27
27
|
var import_ds_button = require("@elliemae/ds-button");
|
|
28
28
|
var import_ds_dialog = require("@elliemae/ds-dialog");
|
|
29
|
-
var
|
|
29
|
+
var import_react2 = require("../../../data/react.js");
|
|
30
30
|
var import_actions = require("../../../data/navigation-prompt/actions.js");
|
|
31
31
|
const NavigationPrompt = (0, import_react.memo)(
|
|
32
32
|
({ open = false }) => {
|
|
33
|
-
const dispatch = (0,
|
|
33
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
34
34
|
const cancelDialog = () => dispatch(import_actions.navigationPrompt.cancel());
|
|
35
35
|
const confirmDialog = () => dispatch(import_actions.navigationPrompt.confirm());
|
|
36
36
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_dialog.DSDialog, { isOpen: open, onClickOutside: cancelDialog, centered: true, children: [
|
|
@@ -26,7 +26,7 @@ var import_react = require("react");
|
|
|
26
26
|
var import_ds_button = require("@elliemae/ds-button");
|
|
27
27
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
28
28
|
var import_ds_dialog = require("@elliemae/ds-dialog");
|
|
29
|
-
var
|
|
29
|
+
var import_react2 = require("../../../data/react.js");
|
|
30
30
|
var import_actions = require("../../../data/logout/actions.js");
|
|
31
31
|
var import_session = require("../../../utils/session.js");
|
|
32
32
|
var import_customHooks = require("./customHooks.js");
|
|
@@ -34,7 +34,7 @@ const SessionExpiry = (0, import_react.memo)(
|
|
|
34
34
|
({ open, warningNotifiedAt = 0 }) => {
|
|
35
35
|
const [isOpen, setIsOpen] = (0, import_react.useState)(open);
|
|
36
36
|
const timeLeft = (0, import_customHooks.useTrackSessionExpiry)(warningNotifiedAt);
|
|
37
|
-
const dispatch = (0,
|
|
37
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
38
38
|
(0, import_react.useEffect)(() => {
|
|
39
39
|
setIsOpen(open);
|
|
40
40
|
}, [open]);
|
|
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(wait_message_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_ds_loading_indicator = require("@elliemae/ds-loading-indicator");
|
|
27
|
-
var
|
|
27
|
+
var import_react2 = require("../../../data/react.js");
|
|
28
28
|
var import_use_html_wait_message = require("./use-html-wait-message.js");
|
|
29
29
|
var import_user_wait_event = require("../../../analytics/user-wait-event.js");
|
|
30
30
|
const WaitMessage = (0, import_react.memo)(
|
|
@@ -33,8 +33,8 @@ const WaitMessage = (0, import_react.memo)(
|
|
|
33
33
|
style = { color: "white", fontSize: "1.25rem" },
|
|
34
34
|
...rest
|
|
35
35
|
}) => {
|
|
36
|
-
const isOpen = (0,
|
|
37
|
-
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);
|
|
38
38
|
(0, import_react.useEffect)(() => {
|
|
39
39
|
if (isOpen)
|
|
40
40
|
(0, import_user_wait_event.waitStartEvent)();
|
|
@@ -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 () => {
|
|
@@ -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)(() => {
|
|
@@ -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
|
+
};
|
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,
|
|
@@ -10,15 +10,15 @@ const queryMiddleware = (_store) => {
|
|
|
10
10
|
);
|
|
11
11
|
};
|
|
12
12
|
const addMiddleware = ({
|
|
13
|
-
|
|
13
|
+
reducerPath,
|
|
14
14
|
middleware
|
|
15
15
|
}) => {
|
|
16
|
-
if (middlewareDispatchFns.has(
|
|
16
|
+
if (middlewareDispatchFns.has(reducerPath) || !store)
|
|
17
17
|
return;
|
|
18
|
-
middlewareDispatchFns.set(
|
|
18
|
+
middlewareDispatchFns.set(reducerPath, middleware(store));
|
|
19
19
|
};
|
|
20
|
-
const removeMiddleware = (
|
|
21
|
-
middlewareDispatchFns.delete(
|
|
20
|
+
const removeMiddleware = (reducerPath) => {
|
|
21
|
+
middlewareDispatchFns.delete(reducerPath);
|
|
22
22
|
};
|
|
23
23
|
const resetMiddlewares = () => {
|
|
24
24
|
middlewareDispatchFns.clear();
|
|
@@ -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
|
+
};
|
|
@@ -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
|
@@ -9,13 +9,18 @@ import { auth } from "./data/auth/actions.js";
|
|
|
9
9
|
import { RequireAuth } from "./view/require-auth.js";
|
|
10
10
|
import { Page } from "./view/page.js";
|
|
11
11
|
import { default as default2 } from "./utils/constants.js";
|
|
12
|
-
import { useAppDispatch, useAppSelector } from "./data/react-redux.js";
|
|
13
12
|
import {
|
|
14
13
|
useInjectReducer,
|
|
15
14
|
useInjectSaga,
|
|
16
15
|
createManager
|
|
17
|
-
} from "
|
|
18
|
-
import {
|
|
16
|
+
} from "redux-injectors";
|
|
17
|
+
import {
|
|
18
|
+
useInjectQuery,
|
|
19
|
+
useInjectListener,
|
|
20
|
+
useAppDispatch,
|
|
21
|
+
useAppSelector,
|
|
22
|
+
useAppMiddleware
|
|
23
|
+
} from "./data/react.js";
|
|
19
24
|
import { errorMiddleware } from "./data/errorMiddleware.js";
|
|
20
25
|
import { getAuthorizationHeader } from "./utils/auth/helper.js";
|
|
21
26
|
import { getRedirectUrl, removeDoubleSlash } from "./utils/url.js";
|
|
@@ -204,6 +209,7 @@ export {
|
|
|
204
209
|
trackActivity,
|
|
205
210
|
updateBAEventParameters,
|
|
206
211
|
useAppDispatch,
|
|
212
|
+
useAppMiddleware,
|
|
207
213
|
useAppSelector,
|
|
208
214
|
useInjectListener,
|
|
209
215
|
useInjectQuery,
|
|
@@ -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 id = useAppSelector((state) => state.liveMessage?.id);
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useEffect } from "react";
|
|
3
3
|
import { DSLoadingIndicator } from "@elliemae/ds-loading-indicator";
|
|
4
|
-
import { useAppSelector } from "../../../data/react
|
|
4
|
+
import { useAppSelector } from "../../../data/react.js";
|
|
5
5
|
import { useHTMLWaitMessage } from "./use-html-wait-message.js";
|
|
6
6
|
import {
|
|
7
7
|
waitStartEvent,
|
|
@@ -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();
|
|
@@ -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,
|
|
@@ -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';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createApi } from '@reduxjs/toolkit/query/react';
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export type QueryMiddleware = ReturnType<typeof createApi>['middleware'];
|
|
3
|
+
export type QueryReducerPath = ReturnType<typeof createApi>['reducerPath'];
|
|
4
|
+
export type QueryReducer = ReturnType<typeof createApi>['reducer'];
|
|
5
|
+
export declare const queryMiddleware: QueryMiddleware;
|
|
6
|
+
export declare const addMiddleware: ({ reducerPath, middleware, }: {
|
|
7
|
+
reducerPath: QueryReducerPath;
|
|
8
|
+
middleware: QueryMiddleware;
|
|
7
9
|
}) => void;
|
|
8
|
-
export declare const removeMiddleware: (
|
|
10
|
+
export declare const removeMiddleware: (reducerPath: string) => void;
|
|
9
11
|
export declare const resetMiddlewares: () => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useInjectQuery } from './useInjectQuery.js';
|
|
2
|
+
export { useInjectListener } from './useInjectListener.js';
|
|
3
|
+
export { useAppDispatch } from './useAppDispatch.js';
|
|
4
|
+
export { useAppSelector } from './useAppSelector.js';
|
|
5
|
+
export { useAppMiddleware } from './useAppMiddleware.js';
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Dispatch, PayloadAction, AnyAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { TypedUseSelectorHook } from 'react-redux';
|
|
3
|
-
import { RootState } from './store.js';
|
|
4
2
|
import { WaitMessageState } from './wait-message/reducer.js';
|
|
5
3
|
import { BreakpointState } from './breakpoint/index.js';
|
|
6
4
|
import { ErrorState } from './error/index.js';
|
|
7
5
|
import { LiveMessageState } from './live-message/index.js';
|
|
8
6
|
type AppDispatch = Dispatch<PayloadAction<WaitMessageState> | PayloadAction<BreakpointState> | PayloadAction<ErrorState> | PayloadAction<LiveMessageState> | AnyAction>;
|
|
9
7
|
export declare const useAppDispatch: () => AppDispatch;
|
|
10
|
-
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
|
11
8
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { QueryMiddleware, QueryReducerPath, QueryReducer } from './queryMiddleware.js';
|
|
2
|
+
export declare const useInjectQuery: ({ reducerPath, reducer, middleware, }: {
|
|
3
|
+
reducerPath: QueryReducerPath;
|
|
4
|
+
reducer: QueryReducer;
|
|
5
|
+
middleware: QueryMiddleware;
|
|
6
|
+
}) => void;
|
|
@@ -6,9 +6,8 @@ export { auth } from './data/auth/actions.js';
|
|
|
6
6
|
export { RequireAuth } from './view/require-auth.js';
|
|
7
7
|
export { Page } from './view/page.js';
|
|
8
8
|
export { default as globalConstants } from './utils/constants.js';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export { useInjectQuery, useInjectListener } from './data/redux-injectors.js';
|
|
9
|
+
export { useInjectReducer, useInjectSaga, createManager, } from 'redux-injectors';
|
|
10
|
+
export { useInjectQuery, useInjectListener, useAppDispatch, useAppSelector, useAppMiddleware, } from './data/react.js';
|
|
12
11
|
export { errorMiddleware } from './data/errorMiddleware.js';
|
|
13
12
|
export { getAuthorizationHeader } from './utils/auth/helper.js';
|
|
14
13
|
export { getRedirectUrl, removeDoubleSlash } from './utils/url.js';
|
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import { useInjectReducer } from "redux-injectors";
|
|
3
|
-
import {
|
|
4
|
-
addMiddleware,
|
|
5
|
-
removeMiddleware
|
|
6
|
-
} from "./queryMiddleware.js";
|
|
7
|
-
import {
|
|
8
|
-
addListener,
|
|
9
|
-
removeListener
|
|
10
|
-
} from "./listenerMiddleware.js";
|
|
11
|
-
const useInjectQuery = ({
|
|
12
|
-
key,
|
|
13
|
-
reducer,
|
|
14
|
-
queryMiddleware
|
|
15
|
-
}) => {
|
|
16
|
-
useInjectReducer({ key, reducer });
|
|
17
|
-
return useEffect(() => {
|
|
18
|
-
if (!queryMiddleware)
|
|
19
|
-
return () => {
|
|
20
|
-
};
|
|
21
|
-
addMiddleware({ key, middleware: queryMiddleware });
|
|
22
|
-
return () => {
|
|
23
|
-
removeMiddleware(key);
|
|
24
|
-
};
|
|
25
|
-
}, [key, reducer, queryMiddleware]);
|
|
26
|
-
};
|
|
27
|
-
const useInjectListener = ({
|
|
28
|
-
key,
|
|
29
|
-
listener
|
|
30
|
-
}) => useEffect(() => {
|
|
31
|
-
addListener({ key, listener });
|
|
32
|
-
return () => {
|
|
33
|
-
removeListener(key);
|
|
34
|
-
};
|
|
35
|
-
}, [key, listener]);
|
|
36
|
-
export {
|
|
37
|
-
useInjectListener,
|
|
38
|
-
useInjectQuery
|
|
39
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Reducer } from 'redux';
|
|
2
|
-
import { RTKQueryMiddleware } from './queryMiddleware.js';
|
|
3
|
-
import { ListenerDispatchFn } from './listenerMiddleware.js';
|
|
4
|
-
export declare const useInjectQuery: ({ key, reducer, queryMiddleware, }: {
|
|
5
|
-
key: string;
|
|
6
|
-
reducer: Reducer;
|
|
7
|
-
queryMiddleware?: import("redux").Middleware<{}, import("@reduxjs/toolkit/dist/query/core/apiState.js").RootState<import("@reduxjs/toolkit/dist/query/endpointDefinitions.js").EndpointDefinitions, string, string>, import("redux-thunk").ThunkDispatch<any, any, import("redux").AnyAction>> | undefined;
|
|
8
|
-
}) => void;
|
|
9
|
-
export declare const useInjectListener: ({ key, listener, }: {
|
|
10
|
-
key: string;
|
|
11
|
-
listener: ListenerDispatchFn;
|
|
12
|
-
}) => void;
|