@elliemae/pui-app-sdk 5.14.1 → 5.15.0-beta.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.
@@ -43,6 +43,7 @@ var import_web_storage = require("../web-storage.js");
43
43
  var import_web_analytics = require("./scripting-objects/web-analytics.js");
44
44
  var import_appdynamics = require("../../analytics/appdynamics.js");
45
45
  var import_ssfguest_adapter = require("./ssfguest-adapter.js");
46
+ var import_host_app = require("./host-app.js");
46
47
  const isCrossDomain = () => {
47
48
  try {
48
49
  window.parent.document;
@@ -140,6 +141,7 @@ class CMicroAppGuest {
140
141
  const host = await this.getSSFAdapter();
141
142
  if (host) this.props.host = host;
142
143
  }
144
+ if (this.props.host) (0, import_host_app.setHostApp)(this.props.host);
143
145
  __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
144
146
  return (0, import_app_config.loadAppConfig)().then(() => {
145
147
  const instanceId = this.getSessionStorageItem("instanceId") || "";
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var host_app_exports = {};
20
+ __export(host_app_exports, {
21
+ getHostApp: () => getHostApp,
22
+ setHostApp: () => setHostApp
23
+ });
24
+ module.exports = __toCommonJS(host_app_exports);
25
+ let hostApp = null;
26
+ const setHostApp = (host) => {
27
+ hostApp = host;
28
+ };
29
+ const getHostApp = () => hostApp;
@@ -38,6 +38,7 @@ var import_appdynamics = require("../../analytics/appdynamics.js");
38
38
  var import_analytics = require("./scripting-objects/analytics.js");
39
39
  var import_web_analytics = require("./scripting-objects/web-analytics.js");
40
40
  var import_session = require("../session.js");
41
+ var import_host_app = require("./host-app.js");
41
42
  class CMicroAppHost {
42
43
  static instance;
43
44
  logger;
@@ -89,6 +90,7 @@ class CMicroAppHost {
89
90
  static getInstance(params) {
90
91
  if (!this.instance) {
91
92
  this.instance = new this(params);
93
+ (0, import_host_app.setHostApp)(this.instance);
92
94
  }
93
95
  return this.instance;
94
96
  }
@@ -10,6 +10,7 @@ import { removeStorageEvents } from "../web-storage.js";
10
10
  import { updateBAEventParameters } from "./scripting-objects/web-analytics.js";
11
11
  import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
12
12
  import { SSFGuestAdapter } from "./ssfguest-adapter.js";
13
+ import { setHostApp } from "./host-app.js";
13
14
  const isCrossDomain = () => {
14
15
  try {
15
16
  window.parent.document;
@@ -107,6 +108,7 @@ class CMicroAppGuest {
107
108
  const host = await this.getSSFAdapter();
108
109
  if (host) this.props.host = host;
109
110
  }
111
+ if (this.props.host) setHostApp(this.props.host);
110
112
  __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
111
113
  return loadAppConfig().then(() => {
112
114
  const instanceId = this.getSessionStorageItem("instanceId") || "";
@@ -0,0 +1,9 @@
1
+ let hostApp = null;
2
+ const setHostApp = (host) => {
3
+ hostApp = host;
4
+ };
5
+ const getHostApp = () => hostApp;
6
+ export {
7
+ getHostApp,
8
+ setHostApp
9
+ };
@@ -22,6 +22,7 @@ import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
22
22
  import { Analytics } from "./scripting-objects/analytics.js";
23
23
  import { updateBAEventParameters } from "./scripting-objects/web-analytics.js";
24
24
  import { renewSession } from "../session.js";
25
+ import { setHostApp } from "./host-app.js";
25
26
  class CMicroAppHost {
26
27
  static instance;
27
28
  logger;
@@ -73,6 +74,7 @@ class CMicroAppHost {
73
74
  static getInstance(params) {
74
75
  if (!this.instance) {
75
76
  this.instance = new this(params);
77
+ setHostApp(this.instance);
76
78
  }
77
79
  return this.instance;
78
80
  }
@@ -0,0 +1,11 @@
1
+ import { IMicroAppHost } from '@elliemae/pui-micro-frontend-base';
2
+ /**
3
+ * set the host app reference
4
+ * @param host global host object
5
+ */
6
+ export declare const setHostApp: (host: IMicroAppHost) => void;
7
+ /**
8
+ * get the reference to host app
9
+ * @returns the global host object
10
+ */
11
+ export declare const getHostApp: () => IMicroAppHost | null;