@elliemae/pui-app-sdk 3.0.0 → 3.1.1

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.
@@ -156,8 +156,9 @@ const authorize = async ({
156
156
  (0, import_appdynamics.setAppDynamicsUserData)({ instanceId, userId: userName });
157
157
  const data = await (0, import_users.getUser)({ userName });
158
158
  sessionStorage.setItem("userSettings", JSON.stringify(data));
159
- import_history.browserHistory.push(`${new URL(redirectUri).pathname}/rerender`);
160
- import_history.browserHistory.replace(new URL(redirectUri).pathname);
159
+ const pathName = new URL(redirectUri).pathname;
160
+ import_history.browserHistory.push(`${pathName.replace(/\/$/, "")}/_rerender`);
161
+ import_history.browserHistory.replace(pathName);
161
162
  } catch (err) {
162
163
  const code = err?.response?.data?.code;
163
164
  await endSession({ clientId, redirectUri, code, scope, responseType });
@@ -127,6 +127,7 @@ class CMicroAppGuest {
127
127
  }
128
128
  async init(options) {
129
129
  this.props = import_lodash.default.merge(this.props, options);
130
+ this.props.history = options?.history || this.props.history;
130
131
  if (!this.props.host) {
131
132
  const host = await this.getSSFHost();
132
133
  if (host)
@@ -31,6 +31,8 @@ __export(hosted_app_exports, {
31
31
  });
32
32
  var React = __toESM(require("react"));
33
33
  var import_styled_components = __toESM(require("styled-components"));
34
+ var import_error_toast = require("../error-toast/index.js");
35
+ var import_wait_message = require("../modals/wait-message/index.js");
34
36
  var import_use_breakpoint = require("../breakpoint/use-breakpoint.js");
35
37
  var import_use_window_size_change = require("../use-window-size-change.js");
36
38
  var import_use_html_wait_message = require("../modals/wait-message/use-html-wait-message.js");
@@ -38,10 +40,10 @@ var import_style = __toESM(require("./style.js"));
38
40
  const Div = import_styled_components.default.div`
39
41
  height: 100%;
40
42
  `;
41
- const HostedApp = ({ children }) => {
43
+ const HostedApp = ({ WaitMessage, children }) => {
42
44
  (0, import_use_breakpoint.useBreakpoint)();
43
45
  (0, import_use_html_wait_message.useHTMLWaitMessage)(true);
44
46
  (0, import_use_window_size_change.useWindowSizeChange)();
45
- return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), children);
47
+ return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), WaitMessage || /* @__PURE__ */ React.createElement(import_wait_message.WaitMessage, null), /* @__PURE__ */ React.createElement(import_error_toast.ErrorToast, null), children);
46
48
  };
47
49
  module.exports = __toCommonJS(hosted_app_exports);
@@ -47,17 +47,12 @@ var React = __toESM(require("react"));
47
47
  var import_react_redux = require("react-redux");
48
48
  var import_styled_components = require("styled-components");
49
49
  var import_pui_theme = require("@elliemae/pui-theme");
50
- var import_redux_injectors = require("redux-injectors");
51
50
  var import_app_router = require("../app-router.js");
52
51
  var import_micro_frontend = require("../../utils/micro-frontend/index.js");
53
- var import_wait_message = require("../../sideeffect/wait-message/index.js");
54
- var import_error_toast = require("../../sideeffect/error-toast/index.js");
55
52
  var import_error_boundary = require("../error-boundary/index.js");
56
53
  var import_stand_alone_app = require("./stand-alone-app.js");
57
54
  var import_hosted_app = require("./hosted-app.js");
58
55
  const AppToRender = (props) => {
59
- (0, import_redux_injectors.useInjectSaga)({ key: "waitMessage", saga: import_wait_message.waitMessage });
60
- (0, import_redux_injectors.useInjectSaga)({ key: "errorToast", saga: import_error_toast.errorToast });
61
56
  const isParent = (0, import_micro_frontend.isStandAloneGuest)() || (0, import_micro_frontend.isHost)();
62
57
  return isParent ? /* @__PURE__ */ React.createElement(import_stand_alone_app.StandAloneApp, __spreadValues({}, props)) : /* @__PURE__ */ React.createElement(import_hosted_app.HostedApp, __spreadValues({}, props));
63
58
  };
@@ -131,8 +131,9 @@ const authorize = async ({
131
131
  setAppDynamicsUserData({ instanceId, userId: userName });
132
132
  const data = await getUser({ userName });
133
133
  sessionStorage.setItem("userSettings", JSON.stringify(data));
134
- history.push(`${new URL(redirectUri).pathname}/rerender`);
135
- history.replace(new URL(redirectUri).pathname);
134
+ const pathName = new URL(redirectUri).pathname;
135
+ history.push(`${pathName.replace(/\/$/, "")}/_rerender`);
136
+ history.replace(pathName);
136
137
  } catch (err) {
137
138
  const code = err?.response?.data?.code;
138
139
  await endSession({ clientId, redirectUri, code, scope, responseType });
@@ -96,6 +96,7 @@ class CMicroAppGuest {
96
96
  }
97
97
  async init(options) {
98
98
  this.props = _.merge(this.props, options);
99
+ this.props.history = options?.history || this.props.history;
99
100
  if (!this.props.host) {
100
101
  const host = await this.getSSFHost();
101
102
  if (host)
@@ -1,5 +1,7 @@
1
1
  import * as React from "react";
2
2
  import styled from "styled-components";
3
+ import { ErrorToast } from "../error-toast/index.js";
4
+ import { WaitMessage as DefaultWaitMessage } from "../modals/wait-message/index.js";
3
5
  import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
4
6
  import { useWindowSizeChange } from "../use-window-size-change.js";
5
7
  import { useHTMLWaitMessage } from "../modals/wait-message/use-html-wait-message.js";
@@ -7,11 +9,11 @@ import GlobalStyle from "./style.js";
7
9
  const Div = styled.div`
8
10
  height: 100%;
9
11
  `;
10
- const HostedApp = ({ children }) => {
12
+ const HostedApp = ({ WaitMessage, children }) => {
11
13
  useBreakpoint();
12
14
  useHTMLWaitMessage(true);
13
15
  useWindowSizeChange();
14
- return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), children);
16
+ return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children);
15
17
  };
16
18
  export {
17
19
  HostedApp
@@ -18,17 +18,12 @@ import * as React from "react";
18
18
  import { Provider } from "react-redux";
19
19
  import { ThemeProvider } from "styled-components";
20
20
  import { getDefaultTheme } from "@elliemae/pui-theme";
21
- import { useInjectSaga } from "redux-injectors";
22
21
  import { AppRouter } from "../app-router.js";
23
22
  import { isStandAloneGuest, isHost } from "../../utils/micro-frontend/index.js";
24
- import { waitMessage } from "../../sideeffect/wait-message/index.js";
25
- import { errorToast } from "../../sideeffect/error-toast/index.js";
26
23
  import { ErrorBoundary } from "../error-boundary/index.js";
27
24
  import { StandAloneApp } from "./stand-alone-app.js";
28
25
  import { HostedApp } from "./hosted-app.js";
29
26
  const AppToRender = (props) => {
30
- useInjectSaga({ key: "waitMessage", saga: waitMessage });
31
- useInjectSaga({ key: "errorToast", saga: errorToast });
32
27
  const isParent = isStandAloneGuest() || isHost();
33
28
  return isParent ? /* @__PURE__ */ React.createElement(StandAloneApp, __spreadValues({}, props)) : /* @__PURE__ */ React.createElement(HostedApp, __spreadValues({}, props));
34
29
  };
@@ -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: ({ children }: HostedAppProps) => JSX.Element;
6
+ export declare const HostedApp: ({ WaitMessage, children }: HostedAppProps) => JSX.Element;
6
7
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "3.0.0",
3
+ "version": "3.1.1",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -103,20 +103,20 @@
103
103
  "indent": 4
104
104
  },
105
105
  "peerDependencies": {
106
- "@elliemae/app-react-dependencies": "^3.0.0",
107
- "@elliemae/ds-basic": "^2.2.5",
108
- "@elliemae/ds-button": "^2.2.5",
109
- "@elliemae/ds-controlled-form": "^2.2.5",
110
- "@elliemae/ds-date-picker": "^2.2.5",
111
- "@elliemae/ds-date-range-picker": "^2.2.5",
112
- "@elliemae/ds-dialog": "^2.2.5",
113
- "@elliemae/ds-form": "^2.2.5",
114
- "@elliemae/ds-form-layout-blocks": "^2.2.5",
115
- "@elliemae/ds-grid": "^2.2.5",
116
- "@elliemae/ds-loading-indicator": "^2.2.5",
117
- "@elliemae/ds-modal": "^2.2.5",
118
- "@elliemae/ds-popperjs": "^2.2.5",
119
- "@elliemae/ds-toast": "^2.2.5",
106
+ "@elliemae/app-react-dependencies": "^3.1.0",
107
+ "@elliemae/ds-basic": "^2.3.2",
108
+ "@elliemae/ds-button": "^2.3.2",
109
+ "@elliemae/ds-controlled-form": "^2.3.2",
110
+ "@elliemae/ds-date-picker": "^2.3.2",
111
+ "@elliemae/ds-date-range-picker": "^2.3.2",
112
+ "@elliemae/ds-dialog": "^2.3.2",
113
+ "@elliemae/ds-form": "^2.3.2",
114
+ "@elliemae/ds-form-layout-blocks": "^2.3.2",
115
+ "@elliemae/ds-grid": "^2.3.2",
116
+ "@elliemae/ds-loading-indicator": "^2.3.2",
117
+ "@elliemae/ds-modal": "^2.3.2",
118
+ "@elliemae/ds-popperjs": "^2.3.2",
119
+ "@elliemae/ds-toast": "^2.3.2",
120
120
  "@elliemae/em-ssf-guest": "^1.11.1",
121
121
  "@elliemae/pui-diagnostics": "^2.7.3",
122
122
  "@elliemae/pui-micro-frontend-base": "^1.10.1",
@@ -124,25 +124,25 @@
124
124
  "@elliemae/pui-user-monitoring": "^1.13.0"
125
125
  },
126
126
  "devDependencies": {
127
- "@elliemae/app-react-dependencies": "~3.0.0",
127
+ "@elliemae/app-react-dependencies": "~3.1.0",
128
128
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.3.0",
129
- "@elliemae/ds-basic": "~2.2.5",
130
- "@elliemae/ds-button": "~2.2.5",
131
- "@elliemae/ds-controlled-form": "~2.2.5",
132
- "@elliemae/ds-date-picker": "~2.2.5",
133
- "@elliemae/ds-date-range-picker": "~2.2.5",
134
- "@elliemae/ds-dialog": "~2.2.5",
135
- "@elliemae/ds-form": "~2.2.5",
136
- "@elliemae/ds-form-layout-blocks": "~2.2.5",
137
- "@elliemae/ds-grid": "~2.2.5",
138
- "@elliemae/ds-loading-indicator": "~2.2.5",
139
- "@elliemae/ds-modal": "~2.2.5",
140
- "@elliemae/ds-popperjs": "~2.2.5",
141
- "@elliemae/ds-toast": "~2.2.5",
129
+ "@elliemae/ds-basic": "~2.3.2",
130
+ "@elliemae/ds-button": "~2.3.2",
131
+ "@elliemae/ds-controlled-form": "~2.3.2",
132
+ "@elliemae/ds-date-picker": "~2.3.2",
133
+ "@elliemae/ds-date-range-picker": "~2.3.2",
134
+ "@elliemae/ds-dialog": "~2.3.2",
135
+ "@elliemae/ds-form": "~2.3.2",
136
+ "@elliemae/ds-form-layout-blocks": "~2.3.2",
137
+ "@elliemae/ds-grid": "~2.3.2",
138
+ "@elliemae/ds-loading-indicator": "~2.3.2",
139
+ "@elliemae/ds-modal": "~2.3.2",
140
+ "@elliemae/ds-popperjs": "~2.3.2",
141
+ "@elliemae/ds-toast": "~2.3.2",
142
142
  "@elliemae/em-ssf-guest": "~1.11.1",
143
- "@elliemae/pui-cli": "~6.0.0",
143
+ "@elliemae/pui-cli": "~6.2.0",
144
144
  "@elliemae/pui-diagnostics": "~2.7.3",
145
- "@elliemae/pui-e2e-test-sdk": "~6.10.0",
145
+ "@elliemae/pui-e2e-test-sdk": "~6.10.1",
146
146
  "@elliemae/pui-micro-frontend-base": "~1.10.1",
147
147
  "@elliemae/pui-theme": "~2.3.0",
148
148
  "@elliemae/pui-user-monitoring": "~1.13.0"
File without changes
File without changes
@@ -1 +0,0 @@
1
- var import_styled_components = require("styled-components");
File without changes
File without changes
File without changes
@@ -1 +0,0 @@
1
- import "styled-components";
File without changes