@elliemae/pui-app-sdk 2.21.5 → 2.21.6
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/view/app-root/hosted-app.js +6 -5
- package/dist/cjs/view/app-root/index.js +2 -16
- package/dist/es/view/app-root/hosted-app.js +5 -5
- package/dist/es/view/app-root/index.js +0 -11
- package/dist/types/view/app-root/hosted-app.d.ts +2 -1
- package/package.json +1 -1
- package/dist/cjs/sideeffect/error-toast/index.js +0 -35
- package/dist/cjs/sideeffect/wait-message/index.js +0 -45
- package/dist/es/sideeffect/error-toast/index.js +0 -24
- package/dist/es/sideeffect/wait-message/index.js +0 -34
- package/dist/types/sideeffect/error-toast/index.d.ts +0 -2
- package/dist/types/sideeffect/wait-message/index.d.ts +0 -2
|
@@ -15,17 +15,18 @@ var _index = require("../media-breakpoint/index.js");
|
|
|
15
15
|
|
|
16
16
|
var _index2 = require("../window-size/index.js");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _index3 = require("../error-toast/index.js");
|
|
19
|
+
|
|
20
|
+
var _index4 = require("../modals/wait-message/index.js");
|
|
19
21
|
|
|
20
22
|
var _style = _interopRequireDefault(require("./style.js"));
|
|
21
23
|
|
|
22
|
-
var _GlobalStyle, _MediaBreakpoint, _WindowSize,
|
|
24
|
+
var _GlobalStyle, _MediaBreakpoint, _WindowSize, _DefaultWaitMessage, _ErrorToast;
|
|
23
25
|
|
|
24
26
|
const HostedApp = ({
|
|
27
|
+
WaitMessage,
|
|
25
28
|
children
|
|
26
|
-
}) => /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/(0, _jsx2.default)(_style.default, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/(0, _jsx2.default)(_index.MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/(0, _jsx2.default)(_index2.WindowSize, {})),
|
|
27
|
-
close: true
|
|
28
|
-
})), children);
|
|
29
|
+
}) => /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/(0, _jsx2.default)(_style.default, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/(0, _jsx2.default)(_index.MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/(0, _jsx2.default)(_index2.WindowSize, {})), WaitMessage || _DefaultWaitMessage || (_DefaultWaitMessage = /*#__PURE__*/(0, _jsx2.default)(_index4.WaitMessage, {})), _ErrorToast || (_ErrorToast = /*#__PURE__*/(0, _jsx2.default)(_index3.ErrorToast, {})), children);
|
|
29
30
|
|
|
30
31
|
exports.HostedApp = HostedApp;
|
|
31
32
|
|
|
@@ -17,15 +17,9 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
17
17
|
|
|
18
18
|
var _puiTheme = require("@elliemae/pui-theme");
|
|
19
19
|
|
|
20
|
-
var _reduxInjectors = require("redux-injectors");
|
|
21
|
-
|
|
22
20
|
var _index = require("../../utils/micro-frontend/index.js");
|
|
23
21
|
|
|
24
|
-
var _index2 = require("
|
|
25
|
-
|
|
26
|
-
var _index3 = require("../../sideeffect/error-toast/index.js");
|
|
27
|
-
|
|
28
|
-
var _index4 = require("../error-boundary/index.js");
|
|
22
|
+
var _index2 = require("../error-boundary/index.js");
|
|
29
23
|
|
|
30
24
|
var _standAloneApp = require("./stand-alone-app.js");
|
|
31
25
|
|
|
@@ -34,14 +28,6 @@ var _hostedApp = require("./hosted-app.js");
|
|
|
34
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
29
|
|
|
36
30
|
const AppToRender = props => {
|
|
37
|
-
(0, _reduxInjectors.useInjectSaga)({
|
|
38
|
-
key: 'waitMessage',
|
|
39
|
-
saga: _index2.waitMessage
|
|
40
|
-
});
|
|
41
|
-
(0, _reduxInjectors.useInjectSaga)({
|
|
42
|
-
key: 'errorToast',
|
|
43
|
-
saga: _index3.errorToast
|
|
44
|
-
});
|
|
45
31
|
const isParent = (0, _index.isStandAloneGuest)() || (0, _index.isHost)();
|
|
46
32
|
return isParent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_standAloneApp.StandAloneApp, { ...props
|
|
47
33
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_hostedApp.HostedApp, { ...props
|
|
@@ -56,7 +42,7 @@ const AppRoot = ({
|
|
|
56
42
|
WaitMessage,
|
|
57
43
|
errorTemplate,
|
|
58
44
|
children
|
|
59
|
-
}) => /*#__PURE__*/(0, _jsx3.default)(
|
|
45
|
+
}) => /*#__PURE__*/(0, _jsx3.default)(_index2.ErrorBoundary, {
|
|
60
46
|
errorTemplate: errorTemplate
|
|
61
47
|
}, void 0, /*#__PURE__*/(0, _jsx3.default)(_reactRedux.Provider, {
|
|
62
48
|
store: store
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _jsx from "@babel/runtime/helpers/jsx";
|
|
2
2
|
import _styled from "styled-components";
|
|
3
3
|
|
|
4
|
-
var _GlobalStyle, _MediaBreakpoint, _WindowSize,
|
|
4
|
+
var _GlobalStyle, _MediaBreakpoint, _WindowSize, _DefaultWaitMessage, _ErrorToast;
|
|
5
5
|
|
|
6
6
|
import { MediaBreakpoint } from "../media-breakpoint/index.js";
|
|
7
7
|
import { WindowSize } from "../window-size/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ErrorToast } from "../error-toast/index.js";
|
|
9
|
+
import { WaitMessage as DefaultWaitMessage } from "../modals/wait-message/index.js";
|
|
9
10
|
import GlobalStyle from "./style.js";
|
|
10
11
|
export const HostedApp = ({
|
|
12
|
+
WaitMessage,
|
|
11
13
|
children
|
|
12
|
-
}) => /*#__PURE__*/_jsx(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/_jsx(GlobalStyle, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/_jsx(MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/_jsx(WindowSize, {})),
|
|
13
|
-
close: true
|
|
14
|
-
})), children);
|
|
14
|
+
}) => /*#__PURE__*/_jsx(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/_jsx(GlobalStyle, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/_jsx(MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/_jsx(WindowSize, {})), WaitMessage || _DefaultWaitMessage || (_DefaultWaitMessage = /*#__PURE__*/_jsx(DefaultWaitMessage, {})), _ErrorToast || (_ErrorToast = /*#__PURE__*/_jsx(ErrorToast, {})), children);
|
|
15
15
|
|
|
16
16
|
var _StyledDiv = /*#__PURE__*/_styled("div").withConfig({
|
|
17
17
|
componentId: "sc-njn2ro-0"
|
|
@@ -3,24 +3,13 @@ import { Provider } from 'react-redux';
|
|
|
3
3
|
import { ThemeProvider } from 'styled-components';
|
|
4
4
|
import { Router } from 'react-router-dom';
|
|
5
5
|
import { getDefaultTheme } from '@elliemae/pui-theme';
|
|
6
|
-
import { useInjectSaga } from 'redux-injectors';
|
|
7
6
|
import { isStandAloneGuest, isHost } from "../../utils/micro-frontend/index.js";
|
|
8
|
-
import { waitMessage } from "../../sideeffect/wait-message/index.js";
|
|
9
|
-
import { errorToast } from "../../sideeffect/error-toast/index.js";
|
|
10
7
|
import { ErrorBoundary } from "../error-boundary/index.js";
|
|
11
8
|
import { StandAloneApp } from "./stand-alone-app.js";
|
|
12
9
|
import { HostedApp } from "./hosted-app.js";
|
|
13
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
11
|
|
|
15
12
|
const AppToRender = props => {
|
|
16
|
-
useInjectSaga({
|
|
17
|
-
key: 'waitMessage',
|
|
18
|
-
saga: waitMessage
|
|
19
|
-
});
|
|
20
|
-
useInjectSaga({
|
|
21
|
-
key: 'errorToast',
|
|
22
|
-
saga: errorToast
|
|
23
|
-
});
|
|
24
13
|
const isParent = isStandAloneGuest() || isHost();
|
|
25
14
|
return isParent ? /*#__PURE__*/_jsx(StandAloneApp, { ...props
|
|
26
15
|
}) : /*#__PURE__*/_jsx(HostedApp, { ...props
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type HostedAppProps = {
|
|
3
|
+
WaitMessage: React.ReactNode;
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
};
|
|
5
|
-
export declare const HostedApp:
|
|
6
|
+
export declare const HostedApp: ({ WaitMessage, children }: HostedAppProps) => JSX.Element;
|
|
6
7
|
export {};
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.errorToast = errorToast;
|
|
7
|
-
|
|
8
|
-
var _effects = require("redux-saga/effects");
|
|
9
|
-
|
|
10
|
-
var _index = require("../../data/error/index.js");
|
|
11
|
-
|
|
12
|
-
var _guest = require("../../utils/micro-frontend/guest.js");
|
|
13
|
-
|
|
14
|
-
var _index2 = require("../../utils/micro-frontend/index.js");
|
|
15
|
-
|
|
16
|
-
var _logRecords = require("../../utils/log-records.js");
|
|
17
|
-
|
|
18
|
-
function* openErrorToast(action) {
|
|
19
|
-
try {
|
|
20
|
-
var _action$payload, _action$payload2;
|
|
21
|
-
|
|
22
|
-
const microApp = yield (0, _effects.call)(_guest.CMicroAppGuest.getInstance.bind(_guest.CMicroAppGuest));
|
|
23
|
-
const host = yield (0, _effects.call)(microApp.getHost.bind(microApp));
|
|
24
|
-
const message = (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.description) || (action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.messageText);
|
|
25
|
-
if (host && message) yield (0, _effects.call)(host.openErrorBanner.bind(host), message);
|
|
26
|
-
} catch (ex) {
|
|
27
|
-
(0, _index2.getLogger)().error({ ..._logRecords.logRecords.ERR_TOAST_OPEN_FAILED,
|
|
28
|
-
exception: ex
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function* errorToast() {
|
|
34
|
-
yield (0, _effects.takeLatest)(_index.actions.set.type, openErrorToast);
|
|
35
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.waitMessage = waitMessage;
|
|
7
|
-
|
|
8
|
-
var _effects = require("redux-saga/effects");
|
|
9
|
-
|
|
10
|
-
var _actions = require("../../data/wait-message/actions.js");
|
|
11
|
-
|
|
12
|
-
var _guest = require("../../utils/micro-frontend/guest.js");
|
|
13
|
-
|
|
14
|
-
var _index = require("../../utils/micro-frontend/index.js");
|
|
15
|
-
|
|
16
|
-
var _logRecords = require("../../utils/log-records.js");
|
|
17
|
-
|
|
18
|
-
function* openWaitMessage() {
|
|
19
|
-
try {
|
|
20
|
-
const microApp = yield (0, _effects.call)(_guest.CMicroAppGuest.getInstance.bind(_guest.CMicroAppGuest));
|
|
21
|
-
const host = yield (0, _effects.call)(microApp.getHost.bind(microApp));
|
|
22
|
-
if (host) yield (0, _effects.call)(host.openWaitMessage.bind(host));
|
|
23
|
-
} catch (ex) {
|
|
24
|
-
(0, _index.getLogger)().error({ ..._logRecords.logRecords.WAIT_MSG_OPEN_FAILED,
|
|
25
|
-
exception: ex
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function* closeWaitMessage() {
|
|
31
|
-
try {
|
|
32
|
-
const microApp = yield (0, _effects.call)(_guest.CMicroAppGuest.getInstance.bind(_guest.CMicroAppGuest));
|
|
33
|
-
const host = yield (0, _effects.call)(microApp.getHost.bind(microApp));
|
|
34
|
-
if (host) yield (0, _effects.call)(host.closeWaitMessage.bind(host));
|
|
35
|
-
} catch (ex) {
|
|
36
|
-
(0, _index.getLogger)().error({ ..._logRecords.logRecords.WAIT_MSG_CLOSE_FAILED,
|
|
37
|
-
exception: ex
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function* waitMessage() {
|
|
43
|
-
yield (0, _effects.takeLatest)(_actions.ACTIONS.OPEN, openWaitMessage);
|
|
44
|
-
yield (0, _effects.takeLatest)(_actions.ACTIONS.CLOSE, closeWaitMessage);
|
|
45
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { call, takeLatest } from 'redux-saga/effects';
|
|
2
|
-
import { actions } from "../../data/error/index.js";
|
|
3
|
-
import { CMicroAppGuest } from "../../utils/micro-frontend/guest.js";
|
|
4
|
-
import { getLogger } from "../../utils/micro-frontend/index.js";
|
|
5
|
-
import { logRecords } from "../../utils/log-records.js";
|
|
6
|
-
|
|
7
|
-
function* openErrorToast(action) {
|
|
8
|
-
try {
|
|
9
|
-
var _action$payload, _action$payload2;
|
|
10
|
-
|
|
11
|
-
const microApp = yield call(CMicroAppGuest.getInstance.bind(CMicroAppGuest));
|
|
12
|
-
const host = yield call(microApp.getHost.bind(microApp));
|
|
13
|
-
const message = (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.description) || (action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.messageText);
|
|
14
|
-
if (host && message) yield call(host.openErrorBanner.bind(host), message);
|
|
15
|
-
} catch (ex) {
|
|
16
|
-
getLogger().error({ ...logRecords.ERR_TOAST_OPEN_FAILED,
|
|
17
|
-
exception: ex
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function* errorToast() {
|
|
23
|
-
yield takeLatest(actions.set.type, openErrorToast);
|
|
24
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { call, takeLatest } from 'redux-saga/effects';
|
|
2
|
-
import { ACTIONS } from "../../data/wait-message/actions.js";
|
|
3
|
-
import { CMicroAppGuest } from "../../utils/micro-frontend/guest.js";
|
|
4
|
-
import { getLogger } from "../../utils/micro-frontend/index.js";
|
|
5
|
-
import { logRecords } from "../../utils/log-records.js";
|
|
6
|
-
|
|
7
|
-
function* openWaitMessage() {
|
|
8
|
-
try {
|
|
9
|
-
const microApp = yield call(CMicroAppGuest.getInstance.bind(CMicroAppGuest));
|
|
10
|
-
const host = yield call(microApp.getHost.bind(microApp));
|
|
11
|
-
if (host) yield call(host.openWaitMessage.bind(host));
|
|
12
|
-
} catch (ex) {
|
|
13
|
-
getLogger().error({ ...logRecords.WAIT_MSG_OPEN_FAILED,
|
|
14
|
-
exception: ex
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function* closeWaitMessage() {
|
|
20
|
-
try {
|
|
21
|
-
const microApp = yield call(CMicroAppGuest.getInstance.bind(CMicroAppGuest));
|
|
22
|
-
const host = yield call(microApp.getHost.bind(microApp));
|
|
23
|
-
if (host) yield call(host.closeWaitMessage.bind(host));
|
|
24
|
-
} catch (ex) {
|
|
25
|
-
getLogger().error({ ...logRecords.WAIT_MSG_CLOSE_FAILED,
|
|
26
|
-
exception: ex
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function* waitMessage() {
|
|
32
|
-
yield takeLatest(ACTIONS.OPEN, openWaitMessage);
|
|
33
|
-
yield takeLatest(ACTIONS.CLOSE, closeWaitMessage);
|
|
34
|
-
}
|