@elliemae/pui-app-bridge 2.5.3 → 2.6.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 (57) hide show
  1. package/dist/cjs/appBridge.js +8 -16
  2. package/dist/cjs/config/app.js +1 -2
  3. package/dist/cjs/config/microFE.js +3 -6
  4. package/dist/cjs/eventManager.js +4 -8
  5. package/dist/cjs/frame.js +1 -2
  6. package/dist/cjs/loaders/manifest.js +2 -4
  7. package/dist/cjs/loaders/script.js +3 -6
  8. package/dist/cjs/loaders/style.js +1 -2
  9. package/dist/cjs/tests/flights/23.1/app.checksum1.js +1 -2
  10. package/dist/cjs/tests/flights/latest/app.checksum.js +1 -2
  11. package/dist/cjs/tests/hotels/23.1/app.checksum.js +1 -2
  12. package/dist/cjs/tests/hotels/latest/app.checksum.js +1 -2
  13. package/dist/cjs/tests/scriptingObjects/appraisalServiceModule.js +2 -0
  14. package/dist/cjs/typings/window.js +2 -4
  15. package/dist/esm/appBridge.js +8 -16
  16. package/dist/esm/config/app.js +1 -2
  17. package/dist/esm/config/microFE.js +3 -6
  18. package/dist/esm/eventManager.js +4 -8
  19. package/dist/esm/frame.js +1 -2
  20. package/dist/esm/loaders/manifest.js +2 -4
  21. package/dist/esm/loaders/script.js +3 -6
  22. package/dist/esm/loaders/style.js +1 -2
  23. package/dist/esm/tests/flights/23.1/app.checksum1.js +1 -2
  24. package/dist/esm/tests/flights/latest/app.checksum.js +1 -2
  25. package/dist/esm/tests/hotels/23.1/app.checksum.js +1 -2
  26. package/dist/esm/tests/hotels/latest/app.checksum.js +1 -2
  27. package/dist/esm/tests/scriptingObjects/appraisalServiceModule.js +2 -0
  28. package/dist/esm/typings/window.js +2 -4
  29. package/dist/public/frame.html +1 -1
  30. package/dist/public/index.html +1 -1
  31. package/dist/public/js/emuiAppBridge.882dac406befb0fb41d5.js +25 -0
  32. package/dist/public/js/emuiAppBridge.882dac406befb0fb41d5.js.br +0 -0
  33. package/dist/public/js/emuiAppBridge.882dac406befb0fb41d5.js.gz +0 -0
  34. package/dist/public/js/emuiAppBridge.882dac406befb0fb41d5.js.map +1 -0
  35. package/dist/public/latest/app.config.json +21 -41
  36. package/dist/public/utils.js +1 -1
  37. package/dist/public/utils.js.br +0 -0
  38. package/dist/public/utils.js.gz +0 -0
  39. package/dist/public/utils.js.map +1 -1
  40. package/dist/types/appBridge.d.ts +1 -1
  41. package/dist/types/config/microFE.d.ts +1 -1
  42. package/dist/types/tests/scriptingObjects/appraisalServiceModule.d.ts +2 -1
  43. package/dist/types/tests/utils.d.ts +2 -2
  44. package/dist/umd/index.js +10 -6
  45. package/dist/umd/index.js.br +0 -0
  46. package/dist/umd/index.js.gz +0 -0
  47. package/dist/umd/index.js.map +1 -1
  48. package/dist/umd/latest/app.config.json +21 -41
  49. package/dist/umd/utils.js +1 -1
  50. package/dist/umd/utils.js.br +0 -0
  51. package/dist/umd/utils.js.gz +0 -0
  52. package/dist/umd/utils.js.map +1 -1
  53. package/package.json +10 -11
  54. package/dist/public/js/emuiAppBridge.a5cadcabb35056ac6244.js +0 -21
  55. package/dist/public/js/emuiAppBridge.a5cadcabb35056ac6244.js.br +0 -0
  56. package/dist/public/js/emuiAppBridge.a5cadcabb35056ac6244.js.gz +0 -0
  57. package/dist/public/js/emuiAppBridge.a5cadcabb35056ac6244.js.map +0 -1
@@ -49,8 +49,7 @@ class CAppBridge {
49
49
  */
50
50
  constructor(params) {
51
51
  const { logger } = params;
52
- if (!logger)
53
- throw new Error("logger is required");
52
+ if (!logger) throw new Error("logger is required");
54
53
  this.#logger = params.logger;
55
54
  this.#version = params.version;
56
55
  this.#appConfig = new import_app.CAppConfig({
@@ -67,8 +66,7 @@ class CAppBridge {
67
66
  if (elementIds) {
68
67
  elementIds.forEach((elementId) => {
69
68
  const ele = documentEle.getElementById(elementId);
70
- if (ele)
71
- ele.remove();
69
+ if (ele) ele.remove();
72
70
  });
73
71
  }
74
72
  };
@@ -178,14 +176,12 @@ class CAppBridge {
178
176
  #unloadApp = ({ id, hostUrl, documentEle }) => {
179
177
  this.#logger.debug(`Application ${id} unloading...`);
180
178
  const app = window.emui?.[id];
181
- if (!app)
182
- return;
179
+ if (!app) return;
183
180
  this.#removeAssetsFromDOM(id, documentEle);
184
181
  this.#scriptLoader.removeDynamicImportedScripts(hostUrl, documentEle);
185
182
  this.#scriptLoader.removePrefetchLinks(hostUrl, documentEle);
186
183
  this.#styleLoader.removeDynamicImportedStyles(hostUrl, documentEle);
187
- if (window.emui?.[id])
188
- delete window.emui[id];
184
+ if (window.emui?.[id]) delete window.emui[id];
189
185
  this.#activeApps.delete(id);
190
186
  this.#logger.info({ message: "Application unloaded", appId: id });
191
187
  };
@@ -203,8 +199,7 @@ class CAppBridge {
203
199
  };
204
200
  #unmountApp = ({ id, name }) => {
205
201
  const app = window.emui?.[id] || {};
206
- if (!app?.unmount)
207
- return null;
202
+ if (!app?.unmount) return null;
208
203
  if (typeof app.unmount !== "function")
209
204
  throw new Error(
210
205
  `Application ${name} with id ${id} doesn't expose unmount method`
@@ -232,8 +227,7 @@ class CAppBridge {
232
227
  * @param id unique id of guest application
233
228
  */
234
229
  closeApp = async (id) => {
235
- if (!id)
236
- throw new Error("id is required");
230
+ if (!id) throw new Error("id is required");
237
231
  const appConfig = this.#microFEConfig.getConfigById(id);
238
232
  if (!appConfig) {
239
233
  throw new Error(`Application with id ${id} is not found`);
@@ -283,8 +277,7 @@ class CAppBridge {
283
277
  * @throws Error if application with given id is not found in configuration
284
278
  */
285
279
  mountApp = async (id) => {
286
- if (!id)
287
- throw new Error("id is required");
280
+ if (!id) throw new Error("id is required");
288
281
  const appConfig = this.#microFEConfig.getConfigById(id);
289
282
  if (!appConfig) {
290
283
  throw new Error(`Application with id ${id} is not found`);
@@ -355,8 +348,7 @@ class CAppBridge {
355
348
  * @throws Error if application with given id is not found in configuration
356
349
  */
357
350
  unmountApp = async (id) => {
358
- if (!id)
359
- throw new Error("id is required");
351
+ if (!id) throw new Error("id is required");
360
352
  const appConfig = this.#microFEConfig.getConfigById(id);
361
353
  if (!appConfig) {
362
354
  throw new Error(`Application with id ${id} is not found`);
@@ -50,8 +50,7 @@ class CAppConfig {
50
50
  #parse = (data) => {
51
51
  const { activeEnv } = data;
52
52
  const activeEnvConfig = data.env[activeEnv] || {};
53
- if (data.env)
54
- delete data.env;
53
+ if (data.env) delete data.env;
55
54
  this.#gAppConfig = (0, import_merge.default)(data, activeEnvConfig);
56
55
  };
57
56
  /**
@@ -38,10 +38,8 @@ var import_common = require("../typings/common.js");
38
38
  const CONFIG_KEY = "microFrontendApps";
39
39
  const isCIBuild = () => process.env.CI === "true";
40
40
  const isProduction = (mode) => {
41
- if (isCIBuild())
42
- return true;
43
- if (mode)
44
- return mode === "production";
41
+ if (isCIBuild()) return true;
42
+ if (mode) return mode === "production";
45
43
  return true;
46
44
  };
47
45
  const getPathName = (url) => url ? new URL(url).pathname : "";
@@ -58,8 +56,7 @@ const getVersionedPath = (path, version) => {
58
56
  );
59
57
  };
60
58
  const isFileListValid = (files) => {
61
- if (!files || !files.length)
62
- return false;
59
+ if (!files || !files.length) return false;
63
60
  return files.every((file) => typeof file === "string");
64
61
  };
65
62
  const validate = (id, mfeConfig) => {
@@ -101,8 +101,7 @@ class EventManager {
101
101
  eventParams,
102
102
  feedbackWaitTime = 1e3
103
103
  } = param;
104
- if (!id)
105
- throw new Error("Event Id is required");
104
+ if (!id) throw new Error("Event Id is required");
106
105
  const listeners = this.#listeners.get(id) || [];
107
106
  if (!requiresFeedback) {
108
107
  this.#emitEvent({
@@ -127,10 +126,8 @@ class EventManager {
127
126
  */
128
127
  subscribe = (param) => {
129
128
  const { eventId, listener } = param;
130
- if (!eventId)
131
- throw new Error("eventId is required");
132
- if (!listener)
133
- throw new Error("Listener is required");
129
+ if (!eventId) throw new Error("eventId is required");
130
+ if (!listener) throw new Error("Listener is required");
134
131
  const listeners = this.#listeners.get(eventId) || [];
135
132
  const subscriptionId = (0, import_uuid.v4)();
136
133
  listeners.push({
@@ -146,8 +143,7 @@ class EventManager {
146
143
  */
147
144
  unsubscribe = (param) => {
148
145
  const { eventId, subscriptionId } = param;
149
- if (!eventId)
150
- throw new Error("eventId id is required");
146
+ if (!eventId) throw new Error("eventId id is required");
151
147
  if (subscriptionId) {
152
148
  const listeners = this.#listeners.get(eventId) || [];
153
149
  const index = listeners.findIndex(
package/dist/cjs/frame.js CHANGED
@@ -37,8 +37,7 @@ const create = (appId, options) => new Promise((resolve, reject) => {
37
37
  frame.setAttribute("allowfullscreen", "true");
38
38
  frame.setAttribute("allowtransparency", "true");
39
39
  frame.setAttribute("allow", "microphone; camera");
40
- if (options.sandbox)
41
- frame.setAttribute("sandbox", options.sandbox);
40
+ if (options.sandbox) frame.setAttribute("sandbox", options.sandbox);
42
41
  frame.setAttribute(
43
42
  "style",
44
43
  options.style ?? "flex-grow: 1;border: none;margin: 0;padding: 0;display: block;min-width: 100%;height: 100%;"
@@ -58,10 +58,8 @@ const get = async ({
58
58
  };
59
59
  const getFullFileNameofAssets = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
60
60
  const fullFileName = manifest[assetName];
61
- if (fullFileName)
62
- assets.push(fullFileName);
63
- else if (isValidHttpUrl(assetName))
64
- assets.push(assetName);
61
+ if (fullFileName) assets.push(fullFileName);
62
+ else if (isValidHttpUrl(assetName)) assets.push(assetName);
65
63
  else {
66
64
  throw new Error(`unable to locate ${assetName} in manifest`);
67
65
  }
@@ -51,8 +51,7 @@ class ScriptLoader {
51
51
  );
52
52
  };
53
53
  ele.async = false;
54
- if (!(0, import_utils.isJSDOM)() && isDeferEligible(ele.src))
55
- ele.defer = true;
54
+ if (!(0, import_utils.isJSDOM)() && isDeferEligible(ele.src)) ele.defer = true;
56
55
  documentEle.head.appendChild(ele);
57
56
  });
58
57
  remove = (elementId = "", documentEle = document) => new Promise((resolve) => {
@@ -70,8 +69,7 @@ class ScriptLoader {
70
69
  for (let index = scriptElements.length - 1; index >= 0; index -= 1) {
71
70
  const scriptEle = scriptElements[index];
72
71
  const { src } = scriptEle;
73
- if (hostPattern.test(src))
74
- scriptEle.remove();
72
+ if (hostPattern.test(src)) scriptEle.remove();
75
73
  }
76
74
  };
77
75
  removePrefetchLinks = (hostUrl, documentEle) => {
@@ -80,8 +78,7 @@ class ScriptLoader {
80
78
  for (let index = prefetchElements.length - 1; index >= 0; index -= 1) {
81
79
  const ele = prefetchElements[index];
82
80
  const { href } = ele;
83
- if (hostPattern.test(href))
84
- ele.remove();
81
+ if (hostPattern.test(href)) ele.remove();
85
82
  }
86
83
  };
87
84
  }
@@ -66,8 +66,7 @@ class StyleLoader {
66
66
  for (let index = prefetchElements.length - 1; index >= 0; index -= 1) {
67
67
  const ele = prefetchElements[index];
68
68
  const { href } = ele;
69
- if (hostPattern.test(href))
70
- ele.remove();
69
+ if (hostPattern.test(href)) ele.remove();
71
70
  }
72
71
  };
73
72
  }
@@ -37,8 +37,7 @@
37
37
  };
38
38
  browserWindow.emui[appId].unmount = () => {
39
39
  const mainEle = document.getElementsByTagName("main")[0];
40
- if (mainEle)
41
- mainEle.remove();
40
+ if (mainEle) mainEle.remove();
42
41
  return Promise.resolve();
43
42
  };
44
43
  })();
@@ -37,8 +37,7 @@
37
37
  };
38
38
  browserWindow.emui[appId].unmount = () => {
39
39
  const mainEle = document.getElementsByTagName("main")[0];
40
- if (mainEle)
41
- mainEle.remove();
40
+ if (mainEle) mainEle.remove();
42
41
  return Promise.resolve();
43
42
  };
44
43
  })();
@@ -35,8 +35,7 @@
35
35
  };
36
36
  browserWindow.emui[appId].unmount = () => {
37
37
  const mainEle = document.getElementsByTagName("main")[0];
38
- if (mainEle)
39
- mainEle.remove();
38
+ if (mainEle) mainEle.remove();
40
39
  return Promise.resolve();
41
40
  };
42
41
  })();
@@ -35,8 +35,7 @@
35
35
  };
36
36
  browserWindow.emui[appId].unmount = () => {
37
37
  const mainEle = document.getElementsByTagName("main")[0];
38
- if (mainEle)
39
- mainEle.remove();
38
+ if (mainEle) mainEle.remove();
40
39
  return Promise.resolve();
41
40
  };
42
41
  })();
@@ -70,6 +70,8 @@ class AppraisalService extends import_microfe_common.ScriptingObject {
70
70
  delete = () => {
71
71
  throw new Error("Not implemented");
72
72
  };
73
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
74
+ showError = (data) => Promise.resolve();
73
75
  unload = async () => {
74
76
  };
75
77
  }
@@ -46,9 +46,7 @@ const convertBreakpointToNumber = (breakpoint) => Number(breakpoint.replace("px"
46
46
  const getCurrentBreakpoint = () => {
47
47
  const { width } = getViewportSize();
48
48
  const { breakpoints } = (0, import_pui_theme.getDefaultTheme)();
49
- if (width <= convertBreakpointToNumber(breakpoints.small))
50
- return "small";
51
- if (width <= convertBreakpointToNumber(breakpoints.medium))
52
- return "medium";
49
+ if (width <= convertBreakpointToNumber(breakpoints.small)) return "small";
50
+ if (width <= convertBreakpointToNumber(breakpoints.medium)) return "medium";
53
51
  return "large";
54
52
  };
@@ -26,8 +26,7 @@ class CAppBridge {
26
26
  */
27
27
  constructor(params) {
28
28
  const { logger } = params;
29
- if (!logger)
30
- throw new Error("logger is required");
29
+ if (!logger) throw new Error("logger is required");
31
30
  this.#logger = params.logger;
32
31
  this.#version = params.version;
33
32
  this.#appConfig = new CAppConfig({
@@ -44,8 +43,7 @@ class CAppBridge {
44
43
  if (elementIds) {
45
44
  elementIds.forEach((elementId) => {
46
45
  const ele = documentEle.getElementById(elementId);
47
- if (ele)
48
- ele.remove();
46
+ if (ele) ele.remove();
49
47
  });
50
48
  }
51
49
  };
@@ -155,14 +153,12 @@ class CAppBridge {
155
153
  #unloadApp = ({ id, hostUrl, documentEle }) => {
156
154
  this.#logger.debug(`Application ${id} unloading...`);
157
155
  const app = window.emui?.[id];
158
- if (!app)
159
- return;
156
+ if (!app) return;
160
157
  this.#removeAssetsFromDOM(id, documentEle);
161
158
  this.#scriptLoader.removeDynamicImportedScripts(hostUrl, documentEle);
162
159
  this.#scriptLoader.removePrefetchLinks(hostUrl, documentEle);
163
160
  this.#styleLoader.removeDynamicImportedStyles(hostUrl, documentEle);
164
- if (window.emui?.[id])
165
- delete window.emui[id];
161
+ if (window.emui?.[id]) delete window.emui[id];
166
162
  this.#activeApps.delete(id);
167
163
  this.#logger.info({ message: "Application unloaded", appId: id });
168
164
  };
@@ -180,8 +176,7 @@ class CAppBridge {
180
176
  };
181
177
  #unmountApp = ({ id, name }) => {
182
178
  const app = window.emui?.[id] || {};
183
- if (!app?.unmount)
184
- return null;
179
+ if (!app?.unmount) return null;
185
180
  if (typeof app.unmount !== "function")
186
181
  throw new Error(
187
182
  `Application ${name} with id ${id} doesn't expose unmount method`
@@ -209,8 +204,7 @@ class CAppBridge {
209
204
  * @param id unique id of guest application
210
205
  */
211
206
  closeApp = async (id) => {
212
- if (!id)
213
- throw new Error("id is required");
207
+ if (!id) throw new Error("id is required");
214
208
  const appConfig = this.#microFEConfig.getConfigById(id);
215
209
  if (!appConfig) {
216
210
  throw new Error(`Application with id ${id} is not found`);
@@ -260,8 +254,7 @@ class CAppBridge {
260
254
  * @throws Error if application with given id is not found in configuration
261
255
  */
262
256
  mountApp = async (id) => {
263
- if (!id)
264
- throw new Error("id is required");
257
+ if (!id) throw new Error("id is required");
265
258
  const appConfig = this.#microFEConfig.getConfigById(id);
266
259
  if (!appConfig) {
267
260
  throw new Error(`Application with id ${id} is not found`);
@@ -332,8 +325,7 @@ class CAppBridge {
332
325
  * @throws Error if application with given id is not found in configuration
333
326
  */
334
327
  unmountApp = async (id) => {
335
- if (!id)
336
- throw new Error("id is required");
328
+ if (!id) throw new Error("id is required");
337
329
  const appConfig = this.#microFEConfig.getConfigById(id);
338
330
  if (!appConfig) {
339
331
  throw new Error(`Application with id ${id} is not found`);
@@ -17,8 +17,7 @@ class CAppConfig {
17
17
  #parse = (data) => {
18
18
  const { activeEnv } = data;
19
19
  const activeEnvConfig = data.env[activeEnv] || {};
20
- if (data.env)
21
- delete data.env;
20
+ if (data.env) delete data.env;
22
21
  this.#gAppConfig = lodashMerge(data, activeEnvConfig);
23
22
  };
24
23
  /**
@@ -5,10 +5,8 @@ import { SecurityContext } from "../typings/common.js";
5
5
  const CONFIG_KEY = "microFrontendApps";
6
6
  const isCIBuild = () => process.env.CI === "true";
7
7
  const isProduction = (mode) => {
8
- if (isCIBuild())
9
- return true;
10
- if (mode)
11
- return mode === "production";
8
+ if (isCIBuild()) return true;
9
+ if (mode) return mode === "production";
12
10
  return true;
13
11
  };
14
12
  const getPathName = (url) => url ? new URL(url).pathname : "";
@@ -25,8 +23,7 @@ const getVersionedPath = (path, version) => {
25
23
  );
26
24
  };
27
25
  const isFileListValid = (files) => {
28
- if (!files || !files.length)
29
- return false;
26
+ if (!files || !files.length) return false;
30
27
  return files.every((file) => typeof file === "string");
31
28
  };
32
29
  const validate = (id, mfeConfig) => {
@@ -78,8 +78,7 @@ class EventManager {
78
78
  eventParams,
79
79
  feedbackWaitTime = 1e3
80
80
  } = param;
81
- if (!id)
82
- throw new Error("Event Id is required");
81
+ if (!id) throw new Error("Event Id is required");
83
82
  const listeners = this.#listeners.get(id) || [];
84
83
  if (!requiresFeedback) {
85
84
  this.#emitEvent({
@@ -104,10 +103,8 @@ class EventManager {
104
103
  */
105
104
  subscribe = (param) => {
106
105
  const { eventId, listener } = param;
107
- if (!eventId)
108
- throw new Error("eventId is required");
109
- if (!listener)
110
- throw new Error("Listener is required");
106
+ if (!eventId) throw new Error("eventId is required");
107
+ if (!listener) throw new Error("Listener is required");
111
108
  const listeners = this.#listeners.get(eventId) || [];
112
109
  const subscriptionId = uuidv4();
113
110
  listeners.push({
@@ -123,8 +120,7 @@ class EventManager {
123
120
  */
124
121
  unsubscribe = (param) => {
125
122
  const { eventId, subscriptionId } = param;
126
- if (!eventId)
127
- throw new Error("eventId id is required");
123
+ if (!eventId) throw new Error("eventId id is required");
128
124
  if (subscriptionId) {
129
125
  const listeners = this.#listeners.get(eventId) || [];
130
126
  const index = listeners.findIndex(
package/dist/esm/frame.js CHANGED
@@ -12,8 +12,7 @@ const create = (appId, options) => new Promise((resolve, reject) => {
12
12
  frame.setAttribute("allowfullscreen", "true");
13
13
  frame.setAttribute("allowtransparency", "true");
14
14
  frame.setAttribute("allow", "microphone; camera");
15
- if (options.sandbox)
16
- frame.setAttribute("sandbox", options.sandbox);
15
+ if (options.sandbox) frame.setAttribute("sandbox", options.sandbox);
17
16
  frame.setAttribute(
18
17
  "style",
19
18
  options.style ?? "flex-grow: 1;border: none;margin: 0;padding: 0;display: block;min-width: 100%;height: 100%;"
@@ -35,10 +35,8 @@ const get = async ({
35
35
  };
36
36
  const getFullFileNameofAssets = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
37
37
  const fullFileName = manifest[assetName];
38
- if (fullFileName)
39
- assets.push(fullFileName);
40
- else if (isValidHttpUrl(assetName))
41
- assets.push(assetName);
38
+ if (fullFileName) assets.push(fullFileName);
39
+ else if (isValidHttpUrl(assetName)) assets.push(assetName);
42
40
  else {
43
41
  throw new Error(`unable to locate ${assetName} in manifest`);
44
42
  }
@@ -27,8 +27,7 @@ class ScriptLoader {
27
27
  );
28
28
  };
29
29
  ele.async = false;
30
- if (!isJSDOM() && isDeferEligible(ele.src))
31
- ele.defer = true;
30
+ if (!isJSDOM() && isDeferEligible(ele.src)) ele.defer = true;
32
31
  documentEle.head.appendChild(ele);
33
32
  });
34
33
  remove = (elementId = "", documentEle = document) => new Promise((resolve) => {
@@ -46,8 +45,7 @@ class ScriptLoader {
46
45
  for (let index = scriptElements.length - 1; index >= 0; index -= 1) {
47
46
  const scriptEle = scriptElements[index];
48
47
  const { src } = scriptEle;
49
- if (hostPattern.test(src))
50
- scriptEle.remove();
48
+ if (hostPattern.test(src)) scriptEle.remove();
51
49
  }
52
50
  };
53
51
  removePrefetchLinks = (hostUrl, documentEle) => {
@@ -56,8 +54,7 @@ class ScriptLoader {
56
54
  for (let index = prefetchElements.length - 1; index >= 0; index -= 1) {
57
55
  const ele = prefetchElements[index];
58
56
  const { href } = ele;
59
- if (hostPattern.test(href))
60
- ele.remove();
57
+ if (hostPattern.test(href)) ele.remove();
61
58
  }
62
59
  };
63
60
  }
@@ -42,8 +42,7 @@ class StyleLoader {
42
42
  for (let index = prefetchElements.length - 1; index >= 0; index -= 1) {
43
43
  const ele = prefetchElements[index];
44
44
  const { href } = ele;
45
- if (hostPattern.test(href))
46
- ele.remove();
45
+ if (hostPattern.test(href)) ele.remove();
47
46
  }
48
47
  };
49
48
  }
@@ -36,8 +36,7 @@
36
36
  };
37
37
  browserWindow.emui[appId].unmount = () => {
38
38
  const mainEle = document.getElementsByTagName("main")[0];
39
- if (mainEle)
40
- mainEle.remove();
39
+ if (mainEle) mainEle.remove();
41
40
  return Promise.resolve();
42
41
  };
43
42
  })();
@@ -36,8 +36,7 @@
36
36
  };
37
37
  browserWindow.emui[appId].unmount = () => {
38
38
  const mainEle = document.getElementsByTagName("main")[0];
39
- if (mainEle)
40
- mainEle.remove();
39
+ if (mainEle) mainEle.remove();
41
40
  return Promise.resolve();
42
41
  };
43
42
  })();
@@ -34,8 +34,7 @@
34
34
  };
35
35
  browserWindow.emui[appId].unmount = () => {
36
36
  const mainEle = document.getElementsByTagName("main")[0];
37
- if (mainEle)
38
- mainEle.remove();
37
+ if (mainEle) mainEle.remove();
39
38
  return Promise.resolve();
40
39
  };
41
40
  })();
@@ -34,8 +34,7 @@
34
34
  };
35
35
  browserWindow.emui[appId].unmount = () => {
36
36
  const mainEle = document.getElementsByTagName("main")[0];
37
- if (mainEle)
38
- mainEle.remove();
37
+ if (mainEle) mainEle.remove();
39
38
  return Promise.resolve();
40
39
  };
41
40
  })();
@@ -49,6 +49,8 @@ class AppraisalService extends ScriptingObject {
49
49
  delete = () => {
50
50
  throw new Error("Not implemented");
51
51
  };
52
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
53
+ showError = (data) => Promise.resolve();
52
54
  unload = async () => {
53
55
  };
54
56
  }
@@ -21,10 +21,8 @@ const convertBreakpointToNumber = (breakpoint) => Number(breakpoint.replace("px"
21
21
  const getCurrentBreakpoint = () => {
22
22
  const { width } = getViewportSize();
23
23
  const { breakpoints } = getDefaultTheme();
24
- if (width <= convertBreakpointToNumber(breakpoints.small))
25
- return "small";
26
- if (width <= convertBreakpointToNumber(breakpoints.medium))
27
- return "medium";
24
+ if (width <= convertBreakpointToNumber(breakpoints.small)) return "small";
25
+ if (width <= convertBreakpointToNumber(breakpoints.medium)) return "medium";
28
26
  return "large";
29
27
  };
30
28
  export {
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="mobile-web-app-capable" content="yes"/><link rel="icon" href="/favicon.ico"/><title>Application</title><script>!function(e,t,n,a,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=t.createElement(n),s=t.getElementsByTagName(n)[0],o.async=1,o.src="https://www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga")</script><style>.full-width{width:100%}.full-height{height:100%}</style><script defer="defer" src="js/emuiAppBridge.a5cadcabb35056ac6244.js"></script></head><body class="full-width full-height"><noscript>If you're seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>, please <strong>enable JS</strong> to make this app work.</noscript><div id="pui-app-container-" class="full-width full-height"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="mobile-web-app-capable" content="yes"/><link rel="icon" href="/favicon.ico"/><title>Application</title><script>!function(e,t,n,a,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=t.createElement(n),s=t.getElementsByTagName(n)[0],o.async=1,o.src="https://www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga")</script><style>.full-width{width:100%}.full-height{height:100%}</style><script defer="defer" src="js/emuiAppBridge.882dac406befb0fb41d5.js"></script></head><body class="full-width full-height"><noscript>If you're seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>, please <strong>enable JS</strong> to make this app work.</noscript><div id="pui-app-container-" class="full-width full-height"></div></body></html>
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script defer="defer" src="js/emuiAppBridge.a5cadcabb35056ac6244.js"></script></head><body><header class="bg-indigo-300 h-10 flex place-items-center"><div class="px-2">ICE Mortgage Product</div></header><main class="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8"><div class="min-w-0 flex-1 mt-4"><h1 class="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">Loan Application</h1></div><div id="successFeedback" class="hidden rounded-md bg-green-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-green-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"/></svg></div><div class="ml-3"><p class="text-sm font-medium text-green-800">Loan Saved Successfully</p></div></div></div><div id="errorFeedback" class="hidden rounded-md bg-red-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd"/></svg></div><div class="ml-3"><h3 class="text-sm font-medium text-red-800">Credit Score is not meeting the requirement</h3></div></div></div><div class="mt-2 sm:grid sm:grid-cols-2 sm:gap-2"><form class="px-2 py-2 space-y-8 divide-y divide-gray-200 bg-gray-50"><div class="space-y-8 divide-y divide-gray-200 sm:space-y-5"><div class="space-y-6 sm:space-y-5"><div><h3 class="text-lg font-medium leading-6 text-gray-900">Personal Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="firstName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">First name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="firstName" id="firstName" autocomplete="given-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="John" placeholder="John"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="lastName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Last name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="lastName" id="lastName" autocomplete="family-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="Doe" placeholder="Doe"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="ssn" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">SSN</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="ssn" id="ssn" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="123456789" placeholder="123456789"/></div></div></div><div><h3 class="text-lg font-medium leading-6 text-gray-900">Loan Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="amount" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Amount</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="amount" id="amount" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="500000" placeholder="500000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="Term" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Term (years)</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="term" id="term" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="30" placeholder="30"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="downPayment" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Down Payment</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="downPayment" id="downPayment" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="50000" placeholder="50000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="creditScore" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Credit Score</label><div class="mt-1 sm:mt-0"><output id="creditScore" class="block w-full max-w-lg pl-2 pt-2 sm:max-w-xs sm:text-sm">NA</output></div><div class="mt-1 sm:mt-0"><button id="getCreditScore" type="button" class="inline-flex items-center rounded-full border border-transparent bg-indigo-600 p-1 text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg></button></div></div></div></div></div><button id="saveLoan" type="button" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">Save</button></form><div id="aside-container" class="flex flex-col gap-4 items-start mt-4 border-2 p-2 rounded-lg border-dashed border-cyan-300 sm:mt-0"></div></div><div id="bottom-container" class="flex flex-col gap-4 items-start mt-4 p-2 sm:mt-0"></div></main><script src="./init.js" type="module"></script></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script defer="defer" src="js/emuiAppBridge.882dac406befb0fb41d5.js"></script></head><body><header class="bg-indigo-300 h-10 flex place-items-center"><div class="px-2">ICE Mortgage Product</div></header><main class="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8"><div class="min-w-0 flex-1 mt-4"><h1 class="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">Loan Application</h1></div><div id="successFeedback" class="hidden rounded-md bg-green-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-green-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"/></svg></div><div class="ml-3"><p class="text-sm font-medium text-green-800">Loan Saved Successfully</p></div></div></div><div id="errorFeedback" class="hidden rounded-md bg-red-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd"/></svg></div><div class="ml-3"><h3 class="text-sm font-medium text-red-800">Credit Score is not meeting the requirement</h3></div></div></div><div class="mt-2 sm:grid sm:grid-cols-2 sm:gap-2"><form class="px-2 py-2 space-y-8 divide-y divide-gray-200 bg-gray-50"><div class="space-y-8 divide-y divide-gray-200 sm:space-y-5"><div class="space-y-6 sm:space-y-5"><div><h3 class="text-lg font-medium leading-6 text-gray-900">Personal Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="firstName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">First name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="firstName" id="firstName" autocomplete="given-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="John" placeholder="John"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="lastName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Last name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="lastName" id="lastName" autocomplete="family-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="Doe" placeholder="Doe"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="ssn" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">SSN</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="ssn" id="ssn" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="123456789" placeholder="123456789"/></div></div></div><div><h3 class="text-lg font-medium leading-6 text-gray-900">Loan Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="amount" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Amount</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="amount" id="amount" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="500000" placeholder="500000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="Term" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Term (years)</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="term" id="term" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="30" placeholder="30"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="downPayment" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Down Payment</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="downPayment" id="downPayment" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="50000" placeholder="50000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="creditScore" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Credit Score</label><div class="mt-1 sm:mt-0"><output id="creditScore" class="block w-full max-w-lg pl-2 pt-2 sm:max-w-xs sm:text-sm">NA</output></div><div class="mt-1 sm:mt-0"><button id="getCreditScore" type="button" class="inline-flex items-center rounded-full border border-transparent bg-indigo-600 p-1 text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg></button></div></div></div></div></div><button id="saveLoan" type="button" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">Save</button></form><div id="aside-container" class="flex flex-col gap-4 items-start mt-4 border-2 p-2 rounded-lg border-dashed border-cyan-300 sm:mt-0"></div></div><div id="bottom-container" class="flex flex-col gap-4 items-start mt-4 p-2 sm:mt-0"></div></main><script src="./init.js" type="module"></script></body></html>