@elliemae/pui-app-sdk 3.6.0 → 4.0.0-alpha.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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/app.config.json +42 -25
  3. package/dist/cjs/utils/app-config/config.js +2 -1
  4. package/dist/cjs/utils/app-config/index.js +3 -2
  5. package/dist/cjs/utils/micro-frontend/guest.js +9 -17
  6. package/dist/cjs/utils/micro-frontend/host.js +6 -1
  7. package/dist/cjs/utils/micro-frontend/ssfguest-adapter.js +47 -0
  8. package/dist/cjs/utils/storybook/preview.js +1 -1
  9. package/dist/cjs/utils/window.js +2 -0
  10. package/dist/cjs/view/app-root/index.js +3 -2
  11. package/dist/cjs/view/error-boundary/default-error-template.js +4 -1
  12. package/dist/cjs/view/micro-app/resources/script.js +19 -15
  13. package/dist/cjs/view/micro-app/resources/style.js +15 -11
  14. package/dist/cjs/view/micro-iframe-app/app.js +1 -1
  15. package/dist/esm/app.config.json +42 -25
  16. package/dist/esm/utils/app-config/config.js +2 -1
  17. package/dist/esm/utils/app-config/index.js +3 -2
  18. package/dist/esm/utils/micro-frontend/guest.js +9 -17
  19. package/dist/esm/utils/micro-frontend/host.js +6 -1
  20. package/dist/esm/utils/micro-frontend/ssfguest-adapter.js +25 -0
  21. package/dist/esm/utils/storybook/preview.js +1 -1
  22. package/dist/esm/utils/window.js +2 -0
  23. package/dist/esm/view/app-root/index.js +3 -2
  24. package/dist/esm/view/error-boundary/default-error-template.js +4 -1
  25. package/dist/esm/view/micro-app/resources/script.js +19 -15
  26. package/dist/esm/view/micro-app/resources/style.js +15 -11
  27. package/dist/esm/view/micro-iframe-app/app.js +1 -1
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/utils/app-config/config.d.ts +5 -7
  30. package/dist/types/utils/app-config/index.d.ts +1 -1
  31. package/dist/types/utils/micro-frontend/guest.d.ts +1 -1
  32. package/dist/types/utils/micro-frontend/host.d.ts +3 -1
  33. package/dist/types/utils/micro-frontend/ssfguest-adapter.d.ts +7 -0
  34. package/dist/types/utils/window.d.ts +3 -0
  35. package/dist/types/view/error-boundary/default-error-template.d.ts +1 -1
  36. package/dist/types/view/error-boundary/index.d.ts +2 -1
  37. package/dist/types/view/fields/form-item-layout/index.d.ts +1 -1
  38. package/dist/types/view/micro-app/resources/script.d.ts +1 -1
  39. package/dist/types/view/micro-app/resources/style.d.ts +2 -2
  40. package/package.json +38 -38
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Software Development Kit / API for developing React Web applications. Implements cross cutting concerns as reusable APIs
4
4
 
5
- Build: [![Build Status](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/build/job/master/badge/icon)](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/build/job/master/) Deploy: [![Deploy Status](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/deploy/badge/icon)](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/deploy/) Test: [![Test Status](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/test/badge/icon)](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/test/) Infra: [![Infra Status](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/infra/badge/icon)](https://jenkins.dco.elmae/job/Platform%20UI/job/App%20SDK/job/infra/)
5
+ Build: [![Build Status](https://jenkins.dco.elmae/buildStatus/icon?job=UIPlatform/Dev/AppSDK/build/master)](https://jenkins.dco.elmae/job/UIPlatform/job/Dev/job/AppSDK/job/build/job/master/) Deploy: [![Build Status](https://jenkins.dco.elmae/buildStatus/icon?job=UIPlatform/Dev/AppSDK/deploy)](https://jenkins.dco.elmae/job/UIPlatform/Dev/AppSDK/deploy) Test: [![Build Status](https://jenkins.dco.elmae/buildStatus/icon?job=UIPlatform/QA/AppSDK/test)](https://jenkins.dco.elmae/job/UIPlatform/QA/AppSDK/test) SecScan: [![Build Status](https://jenkins.dco.elmae/buildStatus/icon?job=UIPlatform/Dev/AppSDK/secscan)](https://jenkins.dco.elmae/job/UIPlatform/job/Dev/job/AppSDK/job/secscan/)
6
6
 
7
7
  [SonarQube Report](https://sonar.ellielabs.com/overview?id=elliemae.pui.app.sdk-master)
8
8
 
@@ -1,128 +1,145 @@
1
1
  {
2
2
  "appId": "app-sdk",
3
- "brand": "primary",
4
3
  "activeEnv": "localhost",
5
- "hosted": true,
6
4
  "sessionTimeoutWarnInterval": "60000",
7
5
  "sessionTimeoutInterval": "70000",
8
6
  "serviceEndpoints": {
9
7
  "api": "",
10
- "idp": ""
8
+ "idp": "https://int.idp.ellielabs.com",
9
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
11
10
  },
12
- "walkMeUrl": "https://cdn.walkme.com/users/897bcebc13fd48038c790e2866e6a9fb/test/walkme_897bcebc13fd48038c790e2866e6a9fb_https.js",
13
11
  "env": {
14
12
  "localhost": {
15
13
  "serviceEndpoints": {
16
14
  "api": "",
17
- "idp": ""
15
+ "idp": "https://int.idp.ellielabs.com",
16
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
18
17
  }
19
18
  },
20
19
  "dev": {
21
20
  "serviceEndpoints": {
22
- "api": "https://dev-api.appsdk.rd.elliemae.io",
23
- "idp": "https://int.idp.ellielabs.com"
21
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
22
+ "idp": "https://int.idp.ellielabs.com",
23
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
24
24
  }
25
25
  },
26
26
  "dev2": {
27
27
  "serviceEndpoints": {
28
28
  "api": "https://int.api.ellielabs.com",
29
- "idp": "https://int.idp.ellielabs.com"
29
+ "idp": "https://int.idp.ellielabs.com",
30
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
30
31
  }
31
32
  },
32
33
  "qa": {
33
34
  "serviceEndpoints": {
34
- "api": "https://qa-api.appsdk.rd.elliemae.io",
35
- "idp": "https://int.idp.ellielabs.com"
35
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
36
+ "idp": "https://int.idp.ellielabs.com",
37
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
36
38
  }
37
39
  },
38
40
  "qa2": {
39
41
  "serviceEndpoints": {
40
42
  "api": "https://int.api.ellielabs.com",
41
- "idp": "https://int.idp.ellielabs.com"
43
+ "idp": "https://int.idp.ellielabs.com",
44
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
42
45
  }
43
46
  },
44
47
  "qa3": {
45
48
  "serviceEndpoints": {
46
49
  "api": "https://int.api.ellielabs.com",
47
- "idp": "https://int.idp.ellielabs.com"
50
+ "idp": "https://int.idp.ellielabs.com",
51
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
48
52
  }
49
53
  },
50
54
  "int": {
51
55
  "serviceEndpoints": {
52
56
  "api": "https://int.api.ellielabs.com",
53
- "idp": "https://int.idp.ellielabs.com"
57
+ "idp": "https://int.idp.ellielabs.com",
58
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
54
59
  }
55
60
  },
56
61
  "peg-osb1": {
57
62
  "serviceEndpoints": {
58
63
  "api": "https://encompass-peg-api.elliemae.com",
59
- "idp": "https://peg.idp.ellielabs.com/authorize"
64
+ "idp": "https://peg.idp.ellielabs.com/authorize",
65
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
60
66
  }
61
67
  },
62
68
  "peg-osb2": {
63
69
  "serviceEndpoints": {
64
70
  "api": "https://encompass-peg2-api.elliemae.com",
65
- "idp": "https://peg.idp.ellielabs.com/authorize"
71
+ "idp": "https://peg.idp.ellielabs.com/authorize",
72
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
66
73
  }
67
74
  },
68
75
  "peg": {
69
76
  "serviceEndpoints": {
70
77
  "api": "https://peg2-west.api.ellielabs.com",
71
- "idp": "https://peg.idp.ellielabs.com/authorize"
78
+ "idp": "https://peg.idp.ellielabs.com/authorize",
79
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
72
80
  }
73
81
  },
74
82
  "peg-oapi-west": {
75
83
  "serviceEndpoints": {
76
84
  "api": "https://peg2-west.api.ellielabs.com",
77
- "idp": "https://peg.idp.ellielabs.com/authorize"
85
+ "idp": "https://peg.idp.ellielabs.com/authorize",
86
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
78
87
  }
79
88
  },
80
89
  "peg-oapi-east": {
81
90
  "serviceEndpoints": {
82
91
  "api": "https://peg2-east.api.ellielabs.com",
83
- "idp": "https://peg.idp.ellielabs.com/authorize"
92
+ "idp": "https://peg.idp.ellielabs.com/authorize",
93
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
84
94
  }
85
95
  },
86
96
  "peg2-oapi-east": {
87
97
  "serviceEndpoints": {
88
98
  "api": "https://peg2-east.api.ellielabs.com",
89
- "idp": "https://peg.idp.ellielabs.com/authorize"
99
+ "idp": "https://peg.idp.ellielabs.com/authorize",
100
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
90
101
  }
91
102
  },
92
103
  "peg3": {
93
104
  "serviceEndpoints": {
94
105
  "api": "https://pel1.api.ellielabs.com",
95
- "idp": "https://peg3.idp.ellielabs.com/authorize"
106
+ "idp": "https://peg3.idp.ellielabs.com/authorize",
107
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
96
108
  }
97
109
  },
98
110
  "stage": {
99
111
  "serviceEndpoints": {
100
112
  "api": "https://stg.api.elliemae.com",
101
- "idp": "https://stg.idp.elliemae.com/authorize"
113
+ "idp": "https://stg.idp.elliemae.com/authorize",
114
+ "logger": "https://stg.api.puidiagnostics.elliemae.com/v1/logging"
102
115
  }
103
116
  },
104
117
  "beta": {
105
118
  "serviceEndpoints": {
106
119
  "api": "https://concept.api.elliemae.com",
107
- "idp": "https://concept.idp.elliemae.com/authorize"
120
+ "idp": "https://concept.idp.elliemae.com/authorize",
121
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
108
122
  }
109
123
  },
110
124
  "demo": {
111
125
  "serviceEndpoints": {
112
126
  "api": "https://concept.api.elliemae.com",
113
- "idp": "https://concept.idp.elliemae.com/authorize"
127
+ "idp": "https://concept.idp.elliemae.com/authorize",
128
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
114
129
  }
115
130
  },
116
131
  "epc": {
117
132
  "serviceEndpoints": {
118
133
  "api": "https://concept.api.elliemae.com",
119
- "idp": "https://concept.idp.elliemae.com/authorize"
134
+ "idp": "https://concept.idp.elliemae.com/authorize",
135
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
120
136
  }
121
137
  },
122
138
  "prod": {
123
139
  "serviceEndpoints": {
124
140
  "api": "https://api.elliemae.com",
125
- "idp": "https://idp.elliemae.com/authorize"
141
+ "idp": "https://idp.elliemae.com/authorize",
142
+ "logger": "https://api.puidiagnostics.elliemae.com/v1/logging"
126
143
  }
127
144
  }
128
145
  }
@@ -27,7 +27,8 @@ __export(config_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(config_exports);
29
29
  var import_lodash = __toESM(require("lodash"));
30
- let gAppConfig = APP_CONFIG;
30
+ var import_app_config = __toESM(require("../../app.config.json"));
31
+ let gAppConfig = import_app_config.default;
31
32
  const setAppConfig = (config) => {
32
33
  gAppConfig = config;
33
34
  };
@@ -28,6 +28,7 @@ var import_http_client = require("../../communication/http-client/index.js");
28
28
  var import_config = require("./config.js");
29
29
  var import_appdynamics = require("../../analytics/appdynamics.js");
30
30
  var import_web_analytics = require("../../analytics/web-analytics.js");
31
+ var import_window = require("../window.js");
31
32
  const parseAppConfig = (data) => {
32
33
  const { activeEnv } = data;
33
34
  const activeEnvConfig = data.env[activeEnv] || {};
@@ -38,8 +39,8 @@ const parseAppConfig = (data) => {
38
39
  (0, import_appdynamics.setAppDynamicsUserData)({ envName: activeEnv });
39
40
  (0, import_web_analytics.updateBAEventParameters)({ envName: activeEnv });
40
41
  };
41
- const loadAppConfig = (hostUrl = "./") => new Promise((resolve, reject) => {
42
- (0, import_http_client.getHTTPClient)({ baseURL: hostUrl }).get("app.config.json").then(({ data }) => {
42
+ const loadAppConfig = () => new Promise((resolve, reject) => {
43
+ (0, import_http_client.getHTTPClient)().get(`${(0, import_window.getAssetPath)()}app.config.json`).then(({ data }) => {
43
44
  parseAppConfig(data);
44
45
  resolve();
45
46
  }).catch((err) => {
@@ -23,9 +23,7 @@ __export(guest_exports, {
23
23
  CMicroAppGuest: () => CMicroAppGuest
24
24
  });
25
25
  module.exports = __toCommonJS(guest_exports);
26
- var import_react_dom = __toESM(require("react-dom"));
27
26
  var import_lodash = __toESM(require("lodash"));
28
- var import_em_ssf_guest = __toESM(require("@elliemae/em-ssf-guest"));
29
27
  var import_pui_theme = require("@elliemae/pui-theme");
30
28
  var import_window = require("../window.js");
31
29
  var import_app_config = require("../app-config/index.js");
@@ -35,6 +33,7 @@ var import_console_logger = require("./console-logger.js");
35
33
  var import_web_storage = require("../web-storage.js");
36
34
  var import_web_analytics = require("../../analytics/web-analytics.js");
37
35
  var import_appdynamics = require("../../analytics/appdynamics.js");
36
+ var import_ssfguest_adapter = require("./ssfguest-adapter.js");
38
37
  const isCrossDomain = () => {
39
38
  try {
40
39
  window.parent.document;
@@ -101,20 +100,16 @@ class CMicroAppGuest {
101
100
  }
102
101
  return value;
103
102
  }
104
- async getSSFHost() {
103
+ async getSSFAdapter() {
105
104
  let host = null;
106
105
  if (window.parent !== window) {
107
106
  if (!isCrossDomain()) {
108
107
  host = window.parent?.emui?.MicroAppHost || null;
109
- } else if (import_em_ssf_guest.default && this.props.hostName) {
110
- await import_em_ssf_guest.default.connect();
111
- const timeout = new Promise((resolve) => {
112
- setTimeout(resolve, 100, null);
113
- });
114
- host = await Promise.race([
115
- import_em_ssf_guest.default.getObject(this.props.hostName),
116
- timeout
117
- ]);
108
+ } else {
109
+ const ssfAdapter = new import_ssfguest_adapter.SSFGuestAdapter();
110
+ if (!await ssfAdapter.init())
111
+ return null;
112
+ host = ssfAdapter;
118
113
  }
119
114
  }
120
115
  return host;
@@ -123,12 +118,12 @@ class CMicroAppGuest {
123
118
  this.props = import_lodash.default.merge(this.props, options);
124
119
  this.props.history = options?.history || this.props.history;
125
120
  if (!this.props.host) {
126
- const host = await this.getSSFHost();
121
+ const host = await this.getSSFAdapter();
127
122
  if (host)
128
123
  this.props.host = host;
129
124
  }
130
125
  __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
131
- return (0, import_app_config.loadAppConfig)(__webpack_public_path__).then(() => {
126
+ return (0, import_app_config.loadAppConfig)().then(() => {
132
127
  const instanceId = this.getSessionStorageItem("instanceId") || "";
133
128
  const userId = this.getSessionStorageItem("userId") || "";
134
129
  (0, import_web_analytics.updateBAEventParameters)({ appId: this.appId, instanceId, userId });
@@ -145,9 +140,6 @@ class CMicroAppGuest {
145
140
  });
146
141
  }
147
142
  unmount(options) {
148
- const appEle = document.getElementById(this.containerId);
149
- if (appEle)
150
- import_react_dom.default.unmountComponentAtNode(appEle);
151
143
  (0, import_web_storage.removeStorageEvents)();
152
144
  return Promise.resolve().then(() => this.onUnmount ? this.onUnmount(options) : null);
153
145
  }
@@ -48,13 +48,15 @@ class CMicroAppHost {
48
48
  theme: (0, import_pui_theme.getDefaultTheme)()
49
49
  };
50
50
  this.activeGuests = {};
51
+ this.domainObjects = {};
51
52
  this.getProps = this.getProps.bind(this);
52
53
  this.getLogger = this.getLogger.bind(this);
53
54
  this.getGuests = this.getGuests.bind(this);
54
55
  this.getGuest = this.getGuest.bind(this);
56
+ this.getObject = this.getObject.bind(this);
55
57
  this.renewSessionTimer = this.renewSessionTimer.bind(this);
56
58
  this.setSystemVersion = this.setSystemVersion.bind(this);
57
- (0, import_app_config.loadAppConfig)(__webpack_public_path__).then(() => {
59
+ (0, import_app_config.loadAppConfig)().then(() => {
58
60
  if (this.onInit)
59
61
  this.onInit(this.props);
60
62
  }).catch(() => {
@@ -154,4 +156,7 @@ class CMicroAppHost {
154
156
  sendBAEvent(data) {
155
157
  (0, import_analytics.sendBAEvent)({ data, self: true });
156
158
  }
159
+ getObject(name) {
160
+ return this.domainObjects[name];
161
+ }
157
162
  }
@@ -0,0 +1,47 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var ssfguest_adapter_exports = {};
22
+ __export(ssfguest_adapter_exports, {
23
+ SSFGuestAdapter: () => SSFGuestAdapter
24
+ });
25
+ module.exports = __toCommonJS(ssfguest_adapter_exports);
26
+ var import_em_ssf_guest = __toESM(require("@elliemae/em-ssf-guest"));
27
+ class SSFGuestAdapter {
28
+ async init() {
29
+ if (!import_em_ssf_guest.default)
30
+ return false;
31
+ await import_em_ssf_guest.default.connect();
32
+ return true;
33
+ }
34
+ async getObject(name) {
35
+ return import_em_ssf_guest.default.getObject(name);
36
+ }
37
+ subscribe(message, func) {
38
+ const callback = (domainObject, eventData) => {
39
+ func(message, eventData);
40
+ };
41
+ const [objectId, eventName] = message.split(".");
42
+ return import_em_ssf_guest.default.subscribe(objectId, eventName || "", callback);
43
+ }
44
+ unsubscribe(token, objectId, eventName) {
45
+ return import_em_ssf_guest.default.unsubscribe(objectId, eventName, token);
46
+ }
47
+ }
@@ -65,6 +65,6 @@ const getParameters = (storyBookTheme) => ({
65
65
  const decorators = [appDecorator];
66
66
  const loaders = [
67
67
  async () => {
68
- await (0, import_app_config.loadAppConfig)(__webpack_public_path__ || "./");
68
+ await (0, import_app_config.loadAppConfig)();
69
69
  }
70
70
  ];
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
  var window_exports = {};
19
19
  __export(window_exports, {
20
+ getAssetPath: () => getAssetPath,
20
21
  getCurrentBreakpoint: () => getCurrentBreakpoint,
21
22
  getViewportSize: () => getViewportSize,
22
23
  getWindow: () => getWindow
@@ -45,3 +46,4 @@ const getCurrentBreakpoint = () => {
45
46
  return "medium";
46
47
  return "large";
47
48
  };
49
+ const getAssetPath = () => window?.emui?._ASSET_PATH || "latest/";
@@ -38,6 +38,7 @@ __export(app_root_exports, {
38
38
  });
39
39
  module.exports = __toCommonJS(app_root_exports);
40
40
  var React = __toESM(require("react"));
41
+ var import_react = require("react");
41
42
  var import_react_redux = require("react-redux");
42
43
  var import_styled_components = require("styled-components");
43
44
  var import_pui_theme = require("@elliemae/pui-theme");
@@ -58,7 +59,7 @@ const AppRoot = ({
58
59
  WaitMessage,
59
60
  errorTemplate,
60
61
  children
61
- }) => /* @__PURE__ */ React.createElement(import_error_boundary.ErrorBoundary, {
62
+ }) => /* @__PURE__ */ React.createElement(import_react.StrictMode, null, /* @__PURE__ */ React.createElement(import_error_boundary.ErrorBoundary, {
62
63
  errorTemplate
63
64
  }, /* @__PURE__ */ React.createElement(import_react_redux.Provider, {
64
65
  store
@@ -69,4 +70,4 @@ const AppRoot = ({
69
70
  }, /* @__PURE__ */ React.createElement(AppToRender, {
70
71
  manageSession,
71
72
  WaitMessage
72
- }, children)))));
73
+ }, children))))));
@@ -24,4 +24,7 @@ __export(default_error_template_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(default_error_template_exports);
26
26
  var React = __toESM(require("react"));
27
- const DefaultErrorTemplate = (props) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "We are unable to process your request"), /* @__PURE__ */ React.createElement("section", null, "Please close your browser and login again"));
27
+ const DefaultErrorTemplate = ({
28
+ error = new Error("We are unable to process your request"),
29
+ errorInfo = { componentStack: "Please close your browser and login again" }
30
+ }) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, error?.message), /* @__PURE__ */ React.createElement("section", null, errorInfo?.componentStack));
@@ -28,21 +28,25 @@ var import_url = require("../../../utils/url.js");
28
28
  const APP_SCRIPT_ID_PREFIX = "emui-script-";
29
29
  const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/;
30
30
  const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
31
- const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) => new Promise((resolve, reject) => {
32
- const ele = documentEle.createElement("script");
33
- if (!ele)
34
- reject(new Error("Unable to insert Application scripts."));
35
- ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
36
- const url = new URL(fileName, hostUrl);
37
- ele.src = (0, import_url.removeDoubleSlash)(url.href);
38
- ele.onload = resolve.bind(null, ele.id);
39
- ele.onerror = reject.bind(null, ele.id);
40
- ele.async = false;
41
- if (isHeadScript(ele.src))
42
- documentEle.head.appendChild(ele);
43
- else
44
- documentEle.body.appendChild(ele);
45
- });
31
+ const addScriptToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
32
+ if (!hostUrl || !manifestPath)
33
+ throw new Error("Unable to add scripts to DOM. hostUrl and manifestPath are required.");
34
+ return new Promise((resolve, reject) => {
35
+ const ele = documentEle.createElement("script");
36
+ if (!ele)
37
+ reject(new Error("Unable to insert Application scripts."));
38
+ ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
39
+ const url = new URL(`${manifestPath.replace(/\/?$/, "/")}${fileName}`, hostUrl);
40
+ ele.src = (0, import_url.removeDoubleSlash)(url.href);
41
+ ele.onload = resolve.bind(null, ele.id);
42
+ ele.onerror = reject.bind(null, ele.id);
43
+ ele.async = false;
44
+ if (isHeadScript(ele.src))
45
+ documentEle.head.appendChild(ele);
46
+ else
47
+ documentEle.body.appendChild(ele);
48
+ });
49
+ };
46
50
  const removeScriptFromDOM = (elementId = "", documentEle = document) => new Promise((resolve) => {
47
51
  const ele = documentEle.getElementById(elementId);
48
52
  if (!ele)
@@ -25,17 +25,21 @@ __export(style_exports, {
25
25
  module.exports = __toCommonJS(style_exports);
26
26
  var import_url = require("../../../utils/url.js");
27
27
  const APP_STYLE_ID_PREFIX = "emui-style-";
28
- const addStylesToDOM = ({ name, hostUrl, documentEle }, fileName, index) => new Promise((resolve, reject) => {
29
- const ele = documentEle.createElement("link");
30
- if (!ele)
31
- reject(new Error("Unable to insert Application styles."));
32
- ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
33
- ele.rel = "stylesheet";
34
- const url = new URL(fileName, hostUrl);
35
- ele.href = (0, import_url.removeDoubleSlash)(url.href);
36
- ele.onload = resolve.bind(null, ele.id);
37
- documentEle.head.appendChild(ele);
38
- });
28
+ const addStylesToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
29
+ if (!hostUrl || !manifestPath)
30
+ throw new Error("Unable to add styles to DOM. hostUrl and manifestPath are required.");
31
+ return new Promise((resolve, reject) => {
32
+ const ele = documentEle.createElement("link");
33
+ if (!ele)
34
+ reject(new Error("Unable to insert Application styles."));
35
+ ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
36
+ ele.rel = "stylesheet";
37
+ const url = new URL(`${manifestPath.replace(/\/?$/, "/")}${fileName}`, hostUrl);
38
+ ele.href = (0, import_url.removeDoubleSlash)(url.href);
39
+ ele.onload = resolve.bind(null, ele.id);
40
+ documentEle.head.appendChild(ele);
41
+ });
42
+ };
39
43
  const removeStyleFromDOM = (elementId = "", documentEle = document) => new Promise((resolve) => {
40
44
  const ele = documentEle.getElementById(elementId);
41
45
  if (!ele)
@@ -54,7 +54,7 @@ __export(app_exports, {
54
54
  module.exports = __toCommonJS(app_exports);
55
55
  var React = __toESM(require("react"));
56
56
  var import_react = require("react");
57
- var import_iframe = __toESM(require("file-loader?name=iframe.[contenthash].[ext]!./iframe/index.html"));
57
+ var import_iframe = __toESM(require("./iframe/index.html?resource"));
58
58
  var import_iframe2 = require("./iframe/index.js");
59
59
  var import_use_frame_loaded = require("./use-frame-loaded.js");
60
60
  var import_use_app_will_render = require("../micro-app/use-app-will-render.js");
@@ -1,128 +1,145 @@
1
1
  {
2
2
  "appId": "app-sdk",
3
- "brand": "primary",
4
3
  "activeEnv": "localhost",
5
- "hosted": true,
6
4
  "sessionTimeoutWarnInterval": "60000",
7
5
  "sessionTimeoutInterval": "70000",
8
6
  "serviceEndpoints": {
9
7
  "api": "",
10
- "idp": ""
8
+ "idp": "https://int.idp.ellielabs.com",
9
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
11
10
  },
12
- "walkMeUrl": "https://cdn.walkme.com/users/897bcebc13fd48038c790e2866e6a9fb/test/walkme_897bcebc13fd48038c790e2866e6a9fb_https.js",
13
11
  "env": {
14
12
  "localhost": {
15
13
  "serviceEndpoints": {
16
14
  "api": "",
17
- "idp": ""
15
+ "idp": "https://int.idp.ellielabs.com",
16
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
18
17
  }
19
18
  },
20
19
  "dev": {
21
20
  "serviceEndpoints": {
22
- "api": "https://dev-api.appsdk.rd.elliemae.io",
23
- "idp": "https://int.idp.ellielabs.com"
21
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
22
+ "idp": "https://int.idp.ellielabs.com",
23
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
24
24
  }
25
25
  },
26
26
  "dev2": {
27
27
  "serviceEndpoints": {
28
28
  "api": "https://int.api.ellielabs.com",
29
- "idp": "https://int.idp.ellielabs.com"
29
+ "idp": "https://int.idp.ellielabs.com",
30
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
30
31
  }
31
32
  },
32
33
  "qa": {
33
34
  "serviceEndpoints": {
34
- "api": "https://qa-api.appsdk.rd.elliemae.io",
35
- "idp": "https://int.idp.ellielabs.com"
35
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
36
+ "idp": "https://int.idp.ellielabs.com",
37
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
36
38
  }
37
39
  },
38
40
  "qa2": {
39
41
  "serviceEndpoints": {
40
42
  "api": "https://int.api.ellielabs.com",
41
- "idp": "https://int.idp.ellielabs.com"
43
+ "idp": "https://int.idp.ellielabs.com",
44
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
42
45
  }
43
46
  },
44
47
  "qa3": {
45
48
  "serviceEndpoints": {
46
49
  "api": "https://int.api.ellielabs.com",
47
- "idp": "https://int.idp.ellielabs.com"
50
+ "idp": "https://int.idp.ellielabs.com",
51
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
48
52
  }
49
53
  },
50
54
  "int": {
51
55
  "serviceEndpoints": {
52
56
  "api": "https://int.api.ellielabs.com",
53
- "idp": "https://int.idp.ellielabs.com"
57
+ "idp": "https://int.idp.ellielabs.com",
58
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
54
59
  }
55
60
  },
56
61
  "peg-osb1": {
57
62
  "serviceEndpoints": {
58
63
  "api": "https://encompass-peg-api.elliemae.com",
59
- "idp": "https://peg.idp.ellielabs.com/authorize"
64
+ "idp": "https://peg.idp.ellielabs.com/authorize",
65
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
60
66
  }
61
67
  },
62
68
  "peg-osb2": {
63
69
  "serviceEndpoints": {
64
70
  "api": "https://encompass-peg2-api.elliemae.com",
65
- "idp": "https://peg.idp.ellielabs.com/authorize"
71
+ "idp": "https://peg.idp.ellielabs.com/authorize",
72
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
66
73
  }
67
74
  },
68
75
  "peg": {
69
76
  "serviceEndpoints": {
70
77
  "api": "https://peg2-west.api.ellielabs.com",
71
- "idp": "https://peg.idp.ellielabs.com/authorize"
78
+ "idp": "https://peg.idp.ellielabs.com/authorize",
79
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
72
80
  }
73
81
  },
74
82
  "peg-oapi-west": {
75
83
  "serviceEndpoints": {
76
84
  "api": "https://peg2-west.api.ellielabs.com",
77
- "idp": "https://peg.idp.ellielabs.com/authorize"
85
+ "idp": "https://peg.idp.ellielabs.com/authorize",
86
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
78
87
  }
79
88
  },
80
89
  "peg-oapi-east": {
81
90
  "serviceEndpoints": {
82
91
  "api": "https://peg2-east.api.ellielabs.com",
83
- "idp": "https://peg.idp.ellielabs.com/authorize"
92
+ "idp": "https://peg.idp.ellielabs.com/authorize",
93
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
84
94
  }
85
95
  },
86
96
  "peg2-oapi-east": {
87
97
  "serviceEndpoints": {
88
98
  "api": "https://peg2-east.api.ellielabs.com",
89
- "idp": "https://peg.idp.ellielabs.com/authorize"
99
+ "idp": "https://peg.idp.ellielabs.com/authorize",
100
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
90
101
  }
91
102
  },
92
103
  "peg3": {
93
104
  "serviceEndpoints": {
94
105
  "api": "https://pel1.api.ellielabs.com",
95
- "idp": "https://peg3.idp.ellielabs.com/authorize"
106
+ "idp": "https://peg3.idp.ellielabs.com/authorize",
107
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
96
108
  }
97
109
  },
98
110
  "stage": {
99
111
  "serviceEndpoints": {
100
112
  "api": "https://stg.api.elliemae.com",
101
- "idp": "https://stg.idp.elliemae.com/authorize"
113
+ "idp": "https://stg.idp.elliemae.com/authorize",
114
+ "logger": "https://stg.api.puidiagnostics.elliemae.com/v1/logging"
102
115
  }
103
116
  },
104
117
  "beta": {
105
118
  "serviceEndpoints": {
106
119
  "api": "https://concept.api.elliemae.com",
107
- "idp": "https://concept.idp.elliemae.com/authorize"
120
+ "idp": "https://concept.idp.elliemae.com/authorize",
121
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
108
122
  }
109
123
  },
110
124
  "demo": {
111
125
  "serviceEndpoints": {
112
126
  "api": "https://concept.api.elliemae.com",
113
- "idp": "https://concept.idp.elliemae.com/authorize"
127
+ "idp": "https://concept.idp.elliemae.com/authorize",
128
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
114
129
  }
115
130
  },
116
131
  "epc": {
117
132
  "serviceEndpoints": {
118
133
  "api": "https://concept.api.elliemae.com",
119
- "idp": "https://concept.idp.elliemae.com/authorize"
134
+ "idp": "https://concept.idp.elliemae.com/authorize",
135
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
120
136
  }
121
137
  },
122
138
  "prod": {
123
139
  "serviceEndpoints": {
124
140
  "api": "https://api.elliemae.com",
125
- "idp": "https://idp.elliemae.com/authorize"
141
+ "idp": "https://idp.elliemae.com/authorize",
142
+ "logger": "https://api.puidiagnostics.elliemae.com/v1/logging"
126
143
  }
127
144
  }
128
145
  }
@@ -1,5 +1,6 @@
1
1
  import _ from "lodash";
2
- let gAppConfig = APP_CONFIG;
2
+ import appConfig from "../../app.config.json";
3
+ let gAppConfig = appConfig;
3
4
  const setAppConfig = (config) => {
4
5
  gAppConfig = config;
5
6
  };
@@ -3,6 +3,7 @@ import { getHTTPClient } from "../../communication/http-client/index.js";
3
3
  import { setAppConfig } from "./config.js";
4
4
  import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
5
5
  import { updateBAEventParameters } from "../../analytics/web-analytics.js";
6
+ import { getAssetPath } from "../window.js";
6
7
  const parseAppConfig = (data) => {
7
8
  const { activeEnv } = data;
8
9
  const activeEnvConfig = data.env[activeEnv] || {};
@@ -13,8 +14,8 @@ const parseAppConfig = (data) => {
13
14
  setAppDynamicsUserData({ envName: activeEnv });
14
15
  updateBAEventParameters({ envName: activeEnv });
15
16
  };
16
- const loadAppConfig = (hostUrl = "./") => new Promise((resolve, reject) => {
17
- getHTTPClient({ baseURL: hostUrl }).get("app.config.json").then(({ data }) => {
17
+ const loadAppConfig = () => new Promise((resolve, reject) => {
18
+ getHTTPClient().get(`${getAssetPath()}app.config.json`).then(({ data }) => {
18
19
  parseAppConfig(data);
19
20
  resolve();
20
21
  }).catch((err) => {
@@ -1,6 +1,4 @@
1
- import ReactDOM from "react-dom";
2
1
  import _ from "lodash";
3
- import ssfGuest from "@elliemae/em-ssf-guest";
4
2
  import { getDefaultTheme } from "@elliemae/pui-theme";
5
3
  import { getWindow } from "../window.js";
6
4
  import { loadAppConfig } from "../app-config/index.js";
@@ -10,6 +8,7 @@ import { logger } from "./console-logger.js";
10
8
  import { removeStorageEvents } from "../web-storage.js";
11
9
  import { updateBAEventParameters } from "../../analytics/web-analytics.js";
12
10
  import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
11
+ import { SSFGuestAdapter } from "./ssfguest-adapter.js";
13
12
  const isCrossDomain = () => {
14
13
  try {
15
14
  window.parent.document;
@@ -76,20 +75,16 @@ class CMicroAppGuest {
76
75
  }
77
76
  return value;
78
77
  }
79
- async getSSFHost() {
78
+ async getSSFAdapter() {
80
79
  let host = null;
81
80
  if (window.parent !== window) {
82
81
  if (!isCrossDomain()) {
83
82
  host = window.parent?.emui?.MicroAppHost || null;
84
- } else if (ssfGuest && this.props.hostName) {
85
- await ssfGuest.connect();
86
- const timeout = new Promise((resolve) => {
87
- setTimeout(resolve, 100, null);
88
- });
89
- host = await Promise.race([
90
- ssfGuest.getObject(this.props.hostName),
91
- timeout
92
- ]);
83
+ } else {
84
+ const ssfAdapter = new SSFGuestAdapter();
85
+ if (!await ssfAdapter.init())
86
+ return null;
87
+ host = ssfAdapter;
93
88
  }
94
89
  }
95
90
  return host;
@@ -98,12 +93,12 @@ class CMicroAppGuest {
98
93
  this.props = _.merge(this.props, options);
99
94
  this.props.history = options?.history || this.props.history;
100
95
  if (!this.props.host) {
101
- const host = await this.getSSFHost();
96
+ const host = await this.getSSFAdapter();
102
97
  if (host)
103
98
  this.props.host = host;
104
99
  }
105
100
  __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
106
- return loadAppConfig(__webpack_public_path__).then(() => {
101
+ return loadAppConfig().then(() => {
107
102
  const instanceId = this.getSessionStorageItem("instanceId") || "";
108
103
  const userId = this.getSessionStorageItem("userId") || "";
109
104
  updateBAEventParameters({ appId: this.appId, instanceId, userId });
@@ -120,9 +115,6 @@ class CMicroAppGuest {
120
115
  });
121
116
  }
122
117
  unmount(options) {
123
- const appEle = document.getElementById(this.containerId);
124
- if (appEle)
125
- ReactDOM.unmountComponentAtNode(appEle);
126
118
  removeStorageEvents();
127
119
  return Promise.resolve().then(() => this.onUnmount ? this.onUnmount(options) : null);
128
120
  }
@@ -33,13 +33,15 @@ class CMicroAppHost {
33
33
  theme: getDefaultTheme()
34
34
  };
35
35
  this.activeGuests = {};
36
+ this.domainObjects = {};
36
37
  this.getProps = this.getProps.bind(this);
37
38
  this.getLogger = this.getLogger.bind(this);
38
39
  this.getGuests = this.getGuests.bind(this);
39
40
  this.getGuest = this.getGuest.bind(this);
41
+ this.getObject = this.getObject.bind(this);
40
42
  this.renewSessionTimer = this.renewSessionTimer.bind(this);
41
43
  this.setSystemVersion = this.setSystemVersion.bind(this);
42
- loadAppConfig(__webpack_public_path__).then(() => {
44
+ loadAppConfig().then(() => {
43
45
  if (this.onInit)
44
46
  this.onInit(this.props);
45
47
  }).catch(() => {
@@ -139,6 +141,9 @@ class CMicroAppHost {
139
141
  sendBAEvent(data) {
140
142
  sendBAEvent({ data, self: true });
141
143
  }
144
+ getObject(name) {
145
+ return this.domainObjects[name];
146
+ }
142
147
  }
143
148
  export {
144
149
  CMicroAppHost
@@ -0,0 +1,25 @@
1
+ import ssfGuest from "@elliemae/em-ssf-guest";
2
+ class SSFGuestAdapter {
3
+ async init() {
4
+ if (!ssfGuest)
5
+ return false;
6
+ await ssfGuest.connect();
7
+ return true;
8
+ }
9
+ async getObject(name) {
10
+ return ssfGuest.getObject(name);
11
+ }
12
+ subscribe(message, func) {
13
+ const callback = (domainObject, eventData) => {
14
+ func(message, eventData);
15
+ };
16
+ const [objectId, eventName] = message.split(".");
17
+ return ssfGuest.subscribe(objectId, eventName || "", callback);
18
+ }
19
+ unsubscribe(token, objectId, eventName) {
20
+ return ssfGuest.unsubscribe(objectId, eventName, token);
21
+ }
22
+ }
23
+ export {
24
+ SSFGuestAdapter
25
+ };
@@ -41,7 +41,7 @@ const getParameters = (storyBookTheme) => ({
41
41
  const decorators = [appDecorator];
42
42
  const loaders = [
43
43
  async () => {
44
- await loadAppConfig(__webpack_public_path__ || "./");
44
+ await loadAppConfig();
45
45
  }
46
46
  ];
47
47
  export {
@@ -21,7 +21,9 @@ const getCurrentBreakpoint = () => {
21
21
  return "medium";
22
22
  return "large";
23
23
  };
24
+ const getAssetPath = () => window?.emui?._ASSET_PATH || "latest/";
24
25
  export {
26
+ getAssetPath,
25
27
  getCurrentBreakpoint,
26
28
  getViewportSize,
27
29
  getWindow
@@ -15,6 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  import * as React from "react";
18
+ import { StrictMode } from "react";
18
19
  import { Provider } from "react-redux";
19
20
  import { ThemeProvider } from "styled-components";
20
21
  import { getDefaultTheme } from "@elliemae/pui-theme";
@@ -35,7 +36,7 @@ const AppRoot = ({
35
36
  WaitMessage,
36
37
  errorTemplate,
37
38
  children
38
- }) => /* @__PURE__ */ React.createElement(ErrorBoundary, {
39
+ }) => /* @__PURE__ */ React.createElement(StrictMode, null, /* @__PURE__ */ React.createElement(ErrorBoundary, {
39
40
  errorTemplate
40
41
  }, /* @__PURE__ */ React.createElement(Provider, {
41
42
  store
@@ -46,7 +47,7 @@ const AppRoot = ({
46
47
  }, /* @__PURE__ */ React.createElement(AppToRender, {
47
48
  manageSession,
48
49
  WaitMessage
49
- }, children)))));
50
+ }, children))))));
50
51
  export {
51
52
  AppRoot
52
53
  };
@@ -1,5 +1,8 @@
1
1
  import * as React from "react";
2
- const DefaultErrorTemplate = (props) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, "We are unable to process your request"), /* @__PURE__ */ React.createElement("section", null, "Please close your browser and login again"));
2
+ const DefaultErrorTemplate = ({
3
+ error = new Error("We are unable to process your request"),
4
+ errorInfo = { componentStack: "Please close your browser and login again" }
5
+ }) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, error?.message), /* @__PURE__ */ React.createElement("section", null, errorInfo?.componentStack));
3
6
  export {
4
7
  DefaultErrorTemplate
5
8
  };
@@ -2,21 +2,25 @@ import { removeDoubleSlash } from "../../../utils/url.js";
2
2
  const APP_SCRIPT_ID_PREFIX = "emui-script-";
3
3
  const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/;
4
4
  const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
5
- const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) => new Promise((resolve, reject) => {
6
- const ele = documentEle.createElement("script");
7
- if (!ele)
8
- reject(new Error("Unable to insert Application scripts."));
9
- ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
10
- const url = new URL(fileName, hostUrl);
11
- ele.src = removeDoubleSlash(url.href);
12
- ele.onload = resolve.bind(null, ele.id);
13
- ele.onerror = reject.bind(null, ele.id);
14
- ele.async = false;
15
- if (isHeadScript(ele.src))
16
- documentEle.head.appendChild(ele);
17
- else
18
- documentEle.body.appendChild(ele);
19
- });
5
+ const addScriptToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
6
+ if (!hostUrl || !manifestPath)
7
+ throw new Error("Unable to add scripts to DOM. hostUrl and manifestPath are required.");
8
+ return new Promise((resolve, reject) => {
9
+ const ele = documentEle.createElement("script");
10
+ if (!ele)
11
+ reject(new Error("Unable to insert Application scripts."));
12
+ ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
13
+ const url = new URL(`${manifestPath.replace(/\/?$/, "/")}${fileName}`, hostUrl);
14
+ ele.src = removeDoubleSlash(url.href);
15
+ ele.onload = resolve.bind(null, ele.id);
16
+ ele.onerror = reject.bind(null, ele.id);
17
+ ele.async = false;
18
+ if (isHeadScript(ele.src))
19
+ documentEle.head.appendChild(ele);
20
+ else
21
+ documentEle.body.appendChild(ele);
22
+ });
23
+ };
20
24
  const removeScriptFromDOM = (elementId = "", documentEle = document) => new Promise((resolve) => {
21
25
  const ele = documentEle.getElementById(elementId);
22
26
  if (!ele)
@@ -1,16 +1,20 @@
1
1
  import { removeDoubleSlash } from "../../../utils/url.js";
2
2
  const APP_STYLE_ID_PREFIX = "emui-style-";
3
- const addStylesToDOM = ({ name, hostUrl, documentEle }, fileName, index) => new Promise((resolve, reject) => {
4
- const ele = documentEle.createElement("link");
5
- if (!ele)
6
- reject(new Error("Unable to insert Application styles."));
7
- ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
8
- ele.rel = "stylesheet";
9
- const url = new URL(fileName, hostUrl);
10
- ele.href = removeDoubleSlash(url.href);
11
- ele.onload = resolve.bind(null, ele.id);
12
- documentEle.head.appendChild(ele);
13
- });
3
+ const addStylesToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
4
+ if (!hostUrl || !manifestPath)
5
+ throw new Error("Unable to add styles to DOM. hostUrl and manifestPath are required.");
6
+ return new Promise((resolve, reject) => {
7
+ const ele = documentEle.createElement("link");
8
+ if (!ele)
9
+ reject(new Error("Unable to insert Application styles."));
10
+ ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
11
+ ele.rel = "stylesheet";
12
+ const url = new URL(`${manifestPath.replace(/\/?$/, "/")}${fileName}`, hostUrl);
13
+ ele.href = removeDoubleSlash(url.href);
14
+ ele.onload = resolve.bind(null, ele.id);
15
+ documentEle.head.appendChild(ele);
16
+ });
17
+ };
14
18
  const removeStyleFromDOM = (elementId = "", documentEle = document) => new Promise((resolve) => {
15
19
  const ele = documentEle.getElementById(elementId);
16
20
  if (!ele)
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import * as React from "react";
33
33
  import { memo, useState } from "react";
34
- import frameHtml from "file-loader?name=iframe.[contenthash].[ext]!./iframe/index.html";
34
+ import frameHtml from "./iframe/index.html?resource";
35
35
  import { IFrame } from "./iframe/index.js";
36
36
  import { useFrameLoaded } from "./use-frame-loaded.js";
37
37
  import {
@@ -75,5 +75,5 @@ export type { EMUI } from './utils/window.js';
75
75
  export type { Await } from './utils/await.js';
76
76
  export type { RootState, AppStore } from './data/store.js';
77
77
  export type { AppConfig } from './utils/app-config/config.js';
78
- export type { OnInitCallback, OnMountCallback, } from './utils/micro-frontend/guest.js';
78
+ export type { OnInitCallback, OnMountCallback, OnUnMountCallback, } from './utils/micro-frontend/guest.js';
79
79
  export type { OnInitCallback as OnHostInitCallback } from './utils/micro-frontend/host.js';
@@ -1,6 +1,6 @@
1
1
  interface ServiceEndpoints {
2
- api: string;
3
- idp: string;
2
+ api?: string;
3
+ idp?: string;
4
4
  logger: string;
5
5
  }
6
6
  interface Env {
@@ -8,13 +8,11 @@ interface Env {
8
8
  }
9
9
  export interface AppConfig {
10
10
  appId: string;
11
- brand: string;
11
+ brand?: string;
12
12
  activeEnv: string;
13
- hosted: boolean;
14
- sessionTimeoutWarnInterval: string;
15
- sessionTimeoutInterval: string;
13
+ sessionTimeoutWarnInterval?: string;
14
+ sessionTimeoutInterval?: string;
16
15
  serviceEndpoints: ServiceEndpoints;
17
- walkMeUrl: string;
18
16
  env: {
19
17
  [key: string]: Env;
20
18
  };
@@ -1 +1 @@
1
- export declare const loadAppConfig: (hostUrl?: string) => Promise<void>;
1
+ export declare const loadAppConfig: () => Promise<void>;
@@ -38,7 +38,7 @@ export declare class CMicroAppGuest implements IMicroAppGuest {
38
38
  getLogger(): MicroFrontEndLogger;
39
39
  getProps(): GuestProps;
40
40
  private getSessionStorageItem;
41
- private getSSFHost;
41
+ private getSSFAdapter;
42
42
  init(this: CMicroAppGuest, options: InitOptions): Promise<void>;
43
43
  mount(this: CMicroAppGuest, options?: MountOptions): Promise<void>;
44
44
  unmount(this: CMicroAppGuest, options: MountOptions): Promise<JSONValue>;
@@ -1,4 +1,4 @@
1
- import { IMicroAppHost, ResizeEventHandler, BreakpointChangeEventHandler, SubscriptionListener, BAEvent } from '@elliemae/pui-micro-frontend-base';
1
+ import { IMicroAppHost, ResizeEventHandler, BreakpointChangeEventHandler, SubscriptionListener, BAEvent, IDomainObject } from '@elliemae/pui-micro-frontend-base';
2
2
  import { History, To } from 'history';
3
3
  import { DefaultTheme } from 'styled-components';
4
4
  import { MicroFrontEndLogger } from './console-logger.js';
@@ -21,6 +21,7 @@ export declare class CMicroAppHost implements IMicroAppHost {
21
21
  activeGuests: Record<string, unknown>;
22
22
  private readonly onInit?;
23
23
  private readonly onRenewSessionTimer?;
24
+ domainObjects: Record<string, IDomainObject>;
24
25
  private constructor();
25
26
  static getInstance(params?: ConstructorParams): CMicroAppHost;
26
27
  static isInitialized(): boolean;
@@ -50,5 +51,6 @@ export declare class CMicroAppHost implements IMicroAppHost {
50
51
  onBreakpointChangeEvent(eventHandler: BreakpointChangeEventHandler): string;
51
52
  setSystemVersion(version?: string): void;
52
53
  sendBAEvent(this: void, data: BAEvent): void;
54
+ getObject<T extends IDomainObject>(name: string): T;
53
55
  }
54
56
  export {};
@@ -0,0 +1,7 @@
1
+ import { SubscriptionListener, IDomainObject } from '@elliemae/pui-micro-frontend-base';
2
+ export declare class SSFGuestAdapter {
3
+ init(): Promise<boolean>;
4
+ getObject<T extends IDomainObject>(name: string): Promise<T>;
5
+ subscribe<T>(message: string, func: SubscriptionListener<T>): string | number;
6
+ unsubscribe(token: string, objectId: string, eventName: string): void;
7
+ }
@@ -4,6 +4,8 @@ import { Logger } from '@elliemae/pui-diagnostics';
4
4
  export declare type EMUI = {
5
5
  [key: string]: IMicroAppGuest;
6
6
  } & {
7
+ _BASE_PATH: string;
8
+ _ASSET_PATH: string;
7
9
  version: string;
8
10
  MicroAppHost?: IMicroAppHost;
9
11
  logger?: Logger;
@@ -21,3 +23,4 @@ export declare const getViewportSize: () => {
21
23
  height: number;
22
24
  };
23
25
  export declare const getCurrentBreakpoint: () => BreakPoint;
26
+ export declare const getAssetPath: () => string;
@@ -5,4 +5,4 @@ export interface ErrorTemplateProps {
5
5
  componentStack: string;
6
6
  } | null;
7
7
  }
8
- export declare const DefaultErrorTemplate: (props: ErrorTemplateProps) => JSX.Element;
8
+ export declare const DefaultErrorTemplate: ({ error, errorInfo, }: ErrorTemplateProps) => JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface ErrorBoundaryProps {
3
+ children?: React.ReactNode;
3
4
  errorTemplate?: React.ComponentType;
4
5
  }
5
6
  export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
@@ -7,6 +8,6 @@ export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
7
8
  componentDidCatch(error: Error, errorInfo: {
8
9
  componentStack: string;
9
10
  }): void;
10
- render(): React.ReactNode;
11
+ render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
11
12
  }
12
13
  export {};
@@ -2,7 +2,7 @@
2
2
  export declare type FormItemLayoutProps = {
3
3
  name: string;
4
4
  floatingLabel?: boolean;
5
- inputComponent: React.ReactNode;
5
+ inputComponent: React.ComponentType<any>;
6
6
  labelText?: string;
7
7
  [x: string]: any;
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import { MicroAppConfig } from '../../../utils/micro-frontend/types.js';
2
2
  export declare const APP_SCRIPT_ID_PREFIX = "emui-script-";
3
- export declare const addScriptToDOM: ({ name, hostUrl, documentEle }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
3
+ export declare const addScriptToDOM: ({ name, hostUrl, documentEle, manifestPath }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
4
4
  export declare const removeScriptFromDOM: (elementId?: string, documentEle?: Document) => Promise<void>;
5
5
  export declare const removeDynamicImportedScripts: (hostUrl: string, documentEle: HTMLDocument) => void;
6
6
  export declare const removePrefetchLinks: (hostUrl: string, documentEle: HTMLDocument) => void;
@@ -1,5 +1,5 @@
1
1
  import { MicroAppConfig } from '../../../utils/micro-frontend/types.js';
2
2
  export declare const APP_STYLE_ID_PREFIX = "emui-style-";
3
- export declare const addStylesToDOM: ({ name, hostUrl, documentEle }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
3
+ export declare const addStylesToDOM: ({ name, hostUrl, documentEle, manifestPath }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
4
4
  export declare const removeStyleFromDOM: (elementId?: string, documentEle?: Document) => Promise<void>;
5
- export declare const removeDynamicImportedStyles: (hostUrl: string, documentEle: HTMLDocument) => void;
5
+ export declare const removeDynamicImportedStyles: (hostUrl: string, documentEle: Document) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "3.6.0",
3
+ "version": "4.0.0-alpha.1",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -103,48 +103,48 @@
103
103
  "indent": 4
104
104
  },
105
105
  "peerDependencies": {
106
- "@elliemae/app-react-dependencies": "^3.5.0",
107
- "@elliemae/ds-basic": "^2.4.19",
108
- "@elliemae/ds-button": "^2.4.19",
109
- "@elliemae/ds-controlled-form": "^2.4.19",
110
- "@elliemae/ds-date-picker": "^2.4.19",
111
- "@elliemae/ds-date-range-picker": "^2.4.19",
112
- "@elliemae/ds-dialog": "^2.4.19",
113
- "@elliemae/ds-form": "^2.4.19",
114
- "@elliemae/ds-form-layout-blocks": "^2.4.19",
115
- "@elliemae/ds-grid": "^2.4.19",
116
- "@elliemae/ds-loading-indicator": "^2.4.19",
117
- "@elliemae/ds-modal": "^2.4.19",
118
- "@elliemae/ds-popperjs": "^2.4.19",
119
- "@elliemae/ds-toast": "^2.4.19",
106
+ "@elliemae/app-react-dependencies": "^4.0.0-beta.1",
107
+ "@elliemae/ds-basic": "^3.0.3",
108
+ "@elliemae/ds-button": "^3.0.3",
109
+ "@elliemae/ds-controlled-form": "^3.0.3",
110
+ "@elliemae/ds-date-picker": "^3.0.3",
111
+ "@elliemae/ds-date-range-picker": "^3.0.3",
112
+ "@elliemae/ds-dialog": "^3.0.3",
113
+ "@elliemae/ds-form": "^3.0.3",
114
+ "@elliemae/ds-form-layout-blocks": "^3.0.3",
115
+ "@elliemae/ds-grid": "^3.0.3",
116
+ "@elliemae/ds-loading-indicator": "^3.0.3",
117
+ "@elliemae/ds-modal": "^3.0.3",
118
+ "@elliemae/ds-popperjs": "^3.0.3",
119
+ "@elliemae/ds-toast": "^3.0.3",
120
120
  "@elliemae/em-ssf-guest": "^1.11.1",
121
- "@elliemae/pui-diagnostics": "^2.7.3",
122
- "@elliemae/pui-micro-frontend-base": "^1.10.1",
123
- "@elliemae/pui-theme": "^2.4.1",
124
- "@elliemae/pui-user-monitoring": "^1.15.0"
121
+ "@elliemae/pui-diagnostics": "^2.7.4",
122
+ "@elliemae/pui-micro-frontend-base": "^1.11.2",
123
+ "@elliemae/pui-theme": "^2.5.0",
124
+ "@elliemae/pui-user-monitoring": "^1.15.1"
125
125
  },
126
126
  "devDependencies": {
127
- "@elliemae/app-react-dependencies": "~3.5.0",
127
+ "@elliemae/app-react-dependencies": "~4.0.0-beta.1",
128
128
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.4.2",
129
- "@elliemae/ds-basic": "2.4.19",
130
- "@elliemae/ds-button": "2.4.19",
131
- "@elliemae/ds-controlled-form": "2.4.19",
132
- "@elliemae/ds-date-picker": "2.4.19",
133
- "@elliemae/ds-date-range-picker": "2.4.19",
134
- "@elliemae/ds-dialog": "2.4.19",
135
- "@elliemae/ds-form": "2.4.19",
136
- "@elliemae/ds-form-layout-blocks": "2.4.19",
137
- "@elliemae/ds-grid": "2.4.19",
138
- "@elliemae/ds-loading-indicator": "2.4.19",
139
- "@elliemae/ds-modal": "2.4.19",
140
- "@elliemae/ds-popperjs": "2.4.19",
141
- "@elliemae/ds-toast": "2.4.19",
129
+ "@elliemae/ds-basic": "~3.0.3",
130
+ "@elliemae/ds-button": "~3.0.3",
131
+ "@elliemae/ds-controlled-form": "~3.0.3",
132
+ "@elliemae/ds-date-picker": "~3.0.3",
133
+ "@elliemae/ds-date-range-picker": "~3.0.3",
134
+ "@elliemae/ds-dialog": "~3.0.3",
135
+ "@elliemae/ds-form": "~3.0.3",
136
+ "@elliemae/ds-form-layout-blocks": "~3.0.3",
137
+ "@elliemae/ds-grid": "~3.0.3",
138
+ "@elliemae/ds-loading-indicator": "~3.0.3",
139
+ "@elliemae/ds-modal": "~3.0.3",
140
+ "@elliemae/ds-popperjs": "~3.0.3",
141
+ "@elliemae/ds-toast": "~3.0.3",
142
142
  "@elliemae/em-ssf-guest": "~1.11.1",
143
- "@elliemae/pui-cli": "~6.14.2",
144
- "@elliemae/pui-diagnostics": "~2.7.3",
143
+ "@elliemae/pui-cli": "~7.0.0-beta.12",
144
+ "@elliemae/pui-diagnostics": "~2.7.4",
145
145
  "@elliemae/pui-e2e-test-sdk": "~7.3.3",
146
- "@elliemae/pui-micro-frontend-base": "~1.10.1",
147
- "@elliemae/pui-theme": "2.4.1",
148
- "@elliemae/pui-user-monitoring": "~1.15.0"
146
+ "@elliemae/pui-micro-frontend-base": "~1.11.2",
147
+ "@elliemae/pui-theme": "~2.5.0",
148
+ "@elliemae/pui-user-monitoring": "~1.15.1"
149
149
  }
150
150
  }