@elliemae/ssf-host 2.35.4 → 2.35.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/host.js +104 -19
- package/dist/esm/host.js +104 -19
- package/dist/public/callchain-host.html +1 -1
- package/dist/public/callchain-intermediate.html +1 -1
- package/dist/public/e2e-host.html +1 -1
- package/dist/public/e2e-index.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiSsfHost.cd7880c12c9813b29111.js +3 -0
- package/dist/public/js/emuiSsfHost.cd7880c12c9813b29111.js.br +0 -0
- package/dist/public/js/emuiSsfHost.cd7880c12c9813b29111.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.cd7880c12c9813b29111.js.map +1 -0
- package/dist/public/popup-focus-host.html +1 -1
- package/dist/public/v1-guest-v2-host.html +1 -1
- package/dist/public/v2-host-v1-guest.html +1 -1
- package/dist/types/lib/ihost.d.ts +22 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.br +0 -0
- package/dist/umd/index.js.gz +0 -0
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/public/js/emuiSsfHost.1a8728b1d4fe91140d17.js +0 -3
- package/dist/public/js/emuiSsfHost.1a8728b1d4fe91140d17.js.br +0 -0
- package/dist/public/js/emuiSsfHost.1a8728b1d4fe91140d17.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.1a8728b1d4fe91140d17.js.map +0 -1
package/dist/cjs/host.js
CHANGED
|
@@ -91,11 +91,29 @@ class SSFHost {
|
|
|
91
91
|
*/
|
|
92
92
|
#readyStateCallback = null;
|
|
93
93
|
/**
|
|
94
|
-
* Interval handle for polling
|
|
94
|
+
* Interval handle for polling guests whose context went away without an
|
|
95
|
+
* explicit {@link unloadGuest}: popup windows closed externally and, when
|
|
96
|
+
* {@link #detectDetachedEmbedGuests} is on, embed iframes no longer in the DOM.
|
|
95
97
|
*/
|
|
96
98
|
#guestLifecycleMonitor = null;
|
|
97
99
|
/**
|
|
98
|
-
*
|
|
100
|
+
* When true, the lifecycle poll also unloads embed guests whose iframe is no
|
|
101
|
+
* longer connected to the DOM. See {@link HostOption.detectDetachedEmbedGuests}.
|
|
102
|
+
*/
|
|
103
|
+
#detectDetachedEmbedGuests = true;
|
|
104
|
+
/**
|
|
105
|
+
* Embed guests the lifecycle poll has seen detached once. Keyed by the
|
|
106
|
+
* guest object, not its id, so a replacement guest that reuses an id never
|
|
107
|
+
* inherits the mark. The poll
|
|
108
|
+
* unloads an embed only when it is still detached on a later tick, so a
|
|
109
|
+
* host's own deferred {@link unloadGuest} (for example a React effect
|
|
110
|
+
* cleanup that runs after the DOM commit) gets at least one full interval
|
|
111
|
+
* to remove the guest silently first.
|
|
112
|
+
*/
|
|
113
|
+
#embedGuestsSeenDetached = /* @__PURE__ */ new WeakSet();
|
|
114
|
+
/**
|
|
115
|
+
* Observes embed iframe removal from its direct parent (fast path; the
|
|
116
|
+
* lifecycle poll in {@link #monitorGuests} covers ancestor removal).
|
|
99
117
|
*/
|
|
100
118
|
#embedDetachObservers = /* @__PURE__ */ new Map();
|
|
101
119
|
/**
|
|
@@ -184,8 +202,7 @@ class SSFHost {
|
|
|
184
202
|
if (option?.readyStateCallback && typeof option?.readyStateCallback !== "function")
|
|
185
203
|
throw new Error("readyStateCallback must be a function");
|
|
186
204
|
this.#readyStateCallback = option?.readyStateCallback || null;
|
|
187
|
-
this.#
|
|
188
|
-
this.#onGuestEventUnsubscribe = option?.onGuestEventUnsubscribe || null;
|
|
205
|
+
this.#applyOptionalHostOptions(option);
|
|
189
206
|
this.#soManager = new import_microfe_common.ScriptingObjectManager();
|
|
190
207
|
this.#remoting.initialize(window);
|
|
191
208
|
this.#connect();
|
|
@@ -195,6 +212,15 @@ class SSFHost {
|
|
|
195
212
|
`host is initialized. hostId: ${this.hostId}, correlationId: ${this.#correlationId}`
|
|
196
213
|
);
|
|
197
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Stores optional host callbacks and flags from the constructor options.
|
|
217
|
+
* @param {HostOption} option - options for the host
|
|
218
|
+
*/
|
|
219
|
+
#applyOptionalHostOptions(option) {
|
|
220
|
+
this.#onGuestEventSubscribe = option?.onGuestEventSubscribe || null;
|
|
221
|
+
this.#onGuestEventUnsubscribe = option?.onGuestEventUnsubscribe || null;
|
|
222
|
+
this.#detectDetachedEmbedGuests = option?.detectDetachedEmbedGuests ?? true;
|
|
223
|
+
}
|
|
198
224
|
#sendBAEvent = (event, data) => {
|
|
199
225
|
const baEvent = { event, ...data };
|
|
200
226
|
this.#analyticsObj.sendBAEvent(baEvent).catch((e) => {
|
|
@@ -827,10 +853,13 @@ class SSFHost {
|
|
|
827
853
|
);
|
|
828
854
|
};
|
|
829
855
|
/**
|
|
830
|
-
* Returns true when an embed guest's iframe is no longer in the host DOM
|
|
856
|
+
* Returns true when an embed guest's iframe is no longer in the host DOM,
|
|
857
|
+
* or its document has no window (the iframe lives inside a torn-down
|
|
858
|
+
* same-origin child document).
|
|
831
859
|
* @param guest embed guest to inspect
|
|
860
|
+
* @returns true when the embed iframe is detached
|
|
832
861
|
*/
|
|
833
|
-
#isEmbedGuestDetached = (guest) => guest.openMode === import_types.OpenMode.Embed && (!guest.domElement || !guest.domElement.isConnected);
|
|
862
|
+
#isEmbedGuestDetached = (guest) => guest.openMode === import_types.OpenMode.Embed && (!guest.domElement || !guest.domElement.isConnected || !guest.domElement.ownerDocument?.defaultView);
|
|
834
863
|
/**
|
|
835
864
|
* Invokes {@link onGuestClose} callbacks registered for a guest id.
|
|
836
865
|
* @param guestId guest application id
|
|
@@ -838,7 +867,14 @@ class SSFHost {
|
|
|
838
867
|
#fireGuestCloseCallbacks = (guestId) => {
|
|
839
868
|
const callbacks = this.#guestCloseCallbackList.get(guestId);
|
|
840
869
|
callbacks?.forEach((callback) => {
|
|
841
|
-
|
|
870
|
+
try {
|
|
871
|
+
Promise.resolve(callback({ id: guestId })).catch(ignoreRejectedPromise);
|
|
872
|
+
} catch (err) {
|
|
873
|
+
this.#logger.warn({
|
|
874
|
+
message: `onGuestClose callback threw for guest ${guestId}`,
|
|
875
|
+
exception: err
|
|
876
|
+
});
|
|
877
|
+
}
|
|
842
878
|
});
|
|
843
879
|
};
|
|
844
880
|
/**
|
|
@@ -909,33 +945,79 @@ class SSFHost {
|
|
|
909
945
|
}
|
|
910
946
|
};
|
|
911
947
|
/**
|
|
912
|
-
*
|
|
913
|
-
*
|
|
914
|
-
*
|
|
948
|
+
* Returns true when the lifecycle poll is responsible for this guest:
|
|
949
|
+
* every popup guest, and embed guests when detached-embed detection is on.
|
|
950
|
+
* @param guest guest to inspect
|
|
951
|
+
* @returns true when the poll should keep running for this guest
|
|
915
952
|
*/
|
|
916
|
-
#
|
|
953
|
+
#isMonitoredGuest = (guest) => guest.openMode === import_types.OpenMode.Popup || this.#detectDetachedEmbedGuests && guest.openMode === import_types.OpenMode.Embed;
|
|
954
|
+
/**
|
|
955
|
+
* Returns true when a monitored guest's context is gone: a popup whose
|
|
956
|
+
* window was closed, or an embed whose iframe is no longer in the DOM.
|
|
957
|
+
*
|
|
958
|
+
* An embed is unloaded only when it was already seen detached on an
|
|
959
|
+
* earlier tick (see {@link #embedGuestsSeenDetached}). Embeds with an
|
|
960
|
+
* unload already in flight are skipped so an explicit {@link unloadGuest}
|
|
961
|
+
* stays silent (no {@link onGuestClose}). If that unload is vetoed, a
|
|
962
|
+
* later tick picks the guest up.
|
|
963
|
+
* @param guest guest to inspect
|
|
964
|
+
* @returns true when the guest should be unloaded on this tick
|
|
965
|
+
*/
|
|
966
|
+
#isGuestContextGone = (guest) => {
|
|
967
|
+
if (guest.openMode === import_types.OpenMode.Popup) {
|
|
968
|
+
return this.#isPopupWindowClosed(guest.window);
|
|
969
|
+
}
|
|
970
|
+
if (!this.#detectDetachedEmbedGuests) return false;
|
|
971
|
+
if (!this.#isEmbedGuestDetached(guest)) {
|
|
972
|
+
this.#embedGuestsSeenDetached.delete(guest);
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
if (this.#guestsUnloading.has(guest.id)) return false;
|
|
976
|
+
if (!this.#embedGuestsSeenDetached.has(guest)) {
|
|
977
|
+
this.#embedGuestsSeenDetached.add(guest);
|
|
978
|
+
return false;
|
|
979
|
+
}
|
|
980
|
+
return true;
|
|
981
|
+
};
|
|
982
|
+
/**
|
|
983
|
+
* Polls guests and unloads any whose context went away without an explicit
|
|
984
|
+
* {@link unloadGuest}: popup windows closed externally and (unless
|
|
985
|
+
* `detectDetachedEmbedGuests` is false) embed iframes removed from the DOM.
|
|
986
|
+
*
|
|
987
|
+
* Embed guests also use {@link #observeEmbedGuestDetach} as a fast path.
|
|
988
|
+
* That observer only sees removal of the iframe from its direct parent at
|
|
989
|
+
* attach time, so ancestor removal and moved iframes are caught here,
|
|
990
|
+
* within about two intervals (one grace tick, then the unload). The poll
|
|
991
|
+
* reads only the state at each tick, so an iframe removed and re-inserted
|
|
992
|
+
* in the same task is not unloaded.
|
|
993
|
+
*/
|
|
994
|
+
#monitorGuests = () => {
|
|
917
995
|
if (this.#guestLifecycleMonitor) return;
|
|
918
996
|
this.#guestLifecycleMonitor = setInterval(() => {
|
|
919
997
|
const guestsToRemove = [];
|
|
920
998
|
this.#guests.forEach((guest) => {
|
|
921
|
-
if (
|
|
999
|
+
if (this.#isGuestContextGone(guest)) {
|
|
922
1000
|
guestsToRemove.push(guest);
|
|
923
1001
|
}
|
|
924
1002
|
});
|
|
925
1003
|
guestsToRemove.forEach((guest) => {
|
|
1004
|
+
if (guest.openMode === import_types.OpenMode.Embed) {
|
|
1005
|
+
this.#unobserveEmbedGuestDetach(guest.id);
|
|
1006
|
+
}
|
|
926
1007
|
this.#unloadGuestAndNotifyHost(guest.id);
|
|
927
1008
|
});
|
|
928
1009
|
}, 1e3);
|
|
929
1010
|
};
|
|
930
1011
|
/**
|
|
931
|
-
* Stops the
|
|
1012
|
+
* Stops the lifecycle poll when no monitored guests (popups, or embeds when
|
|
1013
|
+
* detached-embed detection is on) remain.
|
|
932
1014
|
*/
|
|
933
|
-
#
|
|
1015
|
+
#stopMonitoringGuests = () => {
|
|
934
1016
|
if (!this.#guestLifecycleMonitor) return;
|
|
935
|
-
const
|
|
936
|
-
|
|
1017
|
+
const hasMonitoredGuests = Array.from(this.#guests.values()).some(
|
|
1018
|
+
this.#isMonitoredGuest
|
|
937
1019
|
);
|
|
938
|
-
if (!
|
|
1020
|
+
if (!hasMonitoredGuests) {
|
|
939
1021
|
clearInterval(this.#guestLifecycleMonitor);
|
|
940
1022
|
this.#guestLifecycleMonitor = null;
|
|
941
1023
|
}
|
|
@@ -1034,7 +1116,7 @@ class SSFHost {
|
|
|
1034
1116
|
handshakeToken,
|
|
1035
1117
|
handshakeRetries
|
|
1036
1118
|
});
|
|
1037
|
-
this.#
|
|
1119
|
+
this.#monitorGuests();
|
|
1038
1120
|
}
|
|
1039
1121
|
return guest;
|
|
1040
1122
|
};
|
|
@@ -1143,6 +1225,7 @@ class SSFHost {
|
|
|
1143
1225
|
});
|
|
1144
1226
|
if (fitToContent) this.#registerFitToContentGuest(guest.id);
|
|
1145
1227
|
this.#observeEmbedGuestDetach(guest);
|
|
1228
|
+
if (this.#detectDetachedEmbedGuests) this.#monitorGuests();
|
|
1146
1229
|
return guest;
|
|
1147
1230
|
};
|
|
1148
1231
|
#getGuestUrl = (url, params) => {
|
|
@@ -1281,6 +1364,7 @@ class SSFHost {
|
|
|
1281
1364
|
this.#releaseCallContext
|
|
1282
1365
|
);
|
|
1283
1366
|
this.#fitToContentGuestIds.clear();
|
|
1367
|
+
this.#embedGuestsSeenDetached = /* @__PURE__ */ new WeakSet();
|
|
1284
1368
|
this.#guestCloseNotified.clear();
|
|
1285
1369
|
this.#unsubscribeFromGuestResizeEvent();
|
|
1286
1370
|
this.#guestCloseCallbackList.clear();
|
|
@@ -1641,6 +1725,7 @@ class SSFHost {
|
|
|
1641
1725
|
};
|
|
1642
1726
|
#finalizeGuestRemoval = (guest) => {
|
|
1643
1727
|
this.#releaseCallContext(guest);
|
|
1728
|
+
this.#embedGuestsSeenDetached.delete(guest);
|
|
1644
1729
|
guest.dispose();
|
|
1645
1730
|
if (this.#guestsByWindow.get(guest.window) === guest) {
|
|
1646
1731
|
this.#guestsByWindow.delete(guest.window);
|
|
@@ -1661,7 +1746,7 @@ class SSFHost {
|
|
|
1661
1746
|
message: `Guest is removed from host`,
|
|
1662
1747
|
...guest.getInfo()
|
|
1663
1748
|
});
|
|
1664
|
-
this.#
|
|
1749
|
+
this.#stopMonitoringGuests();
|
|
1665
1750
|
};
|
|
1666
1751
|
/**
|
|
1667
1752
|
* Unloads a guest application from the host.
|
package/dist/esm/host.js
CHANGED
|
@@ -80,11 +80,29 @@ class SSFHost {
|
|
|
80
80
|
*/
|
|
81
81
|
#readyStateCallback = null;
|
|
82
82
|
/**
|
|
83
|
-
* Interval handle for polling
|
|
83
|
+
* Interval handle for polling guests whose context went away without an
|
|
84
|
+
* explicit {@link unloadGuest}: popup windows closed externally and, when
|
|
85
|
+
* {@link #detectDetachedEmbedGuests} is on, embed iframes no longer in the DOM.
|
|
84
86
|
*/
|
|
85
87
|
#guestLifecycleMonitor = null;
|
|
86
88
|
/**
|
|
87
|
-
*
|
|
89
|
+
* When true, the lifecycle poll also unloads embed guests whose iframe is no
|
|
90
|
+
* longer connected to the DOM. See {@link HostOption.detectDetachedEmbedGuests}.
|
|
91
|
+
*/
|
|
92
|
+
#detectDetachedEmbedGuests = true;
|
|
93
|
+
/**
|
|
94
|
+
* Embed guests the lifecycle poll has seen detached once. Keyed by the
|
|
95
|
+
* guest object, not its id, so a replacement guest that reuses an id never
|
|
96
|
+
* inherits the mark. The poll
|
|
97
|
+
* unloads an embed only when it is still detached on a later tick, so a
|
|
98
|
+
* host's own deferred {@link unloadGuest} (for example a React effect
|
|
99
|
+
* cleanup that runs after the DOM commit) gets at least one full interval
|
|
100
|
+
* to remove the guest silently first.
|
|
101
|
+
*/
|
|
102
|
+
#embedGuestsSeenDetached = /* @__PURE__ */ new WeakSet();
|
|
103
|
+
/**
|
|
104
|
+
* Observes embed iframe removal from its direct parent (fast path; the
|
|
105
|
+
* lifecycle poll in {@link #monitorGuests} covers ancestor removal).
|
|
88
106
|
*/
|
|
89
107
|
#embedDetachObservers = /* @__PURE__ */ new Map();
|
|
90
108
|
/**
|
|
@@ -173,8 +191,7 @@ class SSFHost {
|
|
|
173
191
|
if (option?.readyStateCallback && typeof option?.readyStateCallback !== "function")
|
|
174
192
|
throw new Error("readyStateCallback must be a function");
|
|
175
193
|
this.#readyStateCallback = option?.readyStateCallback || null;
|
|
176
|
-
this.#
|
|
177
|
-
this.#onGuestEventUnsubscribe = option?.onGuestEventUnsubscribe || null;
|
|
194
|
+
this.#applyOptionalHostOptions(option);
|
|
178
195
|
this.#soManager = new ScriptingObjectManager();
|
|
179
196
|
this.#remoting.initialize(window);
|
|
180
197
|
this.#connect();
|
|
@@ -184,6 +201,15 @@ class SSFHost {
|
|
|
184
201
|
`host is initialized. hostId: ${this.hostId}, correlationId: ${this.#correlationId}`
|
|
185
202
|
);
|
|
186
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Stores optional host callbacks and flags from the constructor options.
|
|
206
|
+
* @param {HostOption} option - options for the host
|
|
207
|
+
*/
|
|
208
|
+
#applyOptionalHostOptions(option) {
|
|
209
|
+
this.#onGuestEventSubscribe = option?.onGuestEventSubscribe || null;
|
|
210
|
+
this.#onGuestEventUnsubscribe = option?.onGuestEventUnsubscribe || null;
|
|
211
|
+
this.#detectDetachedEmbedGuests = option?.detectDetachedEmbedGuests ?? true;
|
|
212
|
+
}
|
|
187
213
|
#sendBAEvent = (event, data) => {
|
|
188
214
|
const baEvent = { event, ...data };
|
|
189
215
|
this.#analyticsObj.sendBAEvent(baEvent).catch((e) => {
|
|
@@ -816,10 +842,13 @@ class SSFHost {
|
|
|
816
842
|
);
|
|
817
843
|
};
|
|
818
844
|
/**
|
|
819
|
-
* Returns true when an embed guest's iframe is no longer in the host DOM
|
|
845
|
+
* Returns true when an embed guest's iframe is no longer in the host DOM,
|
|
846
|
+
* or its document has no window (the iframe lives inside a torn-down
|
|
847
|
+
* same-origin child document).
|
|
820
848
|
* @param guest embed guest to inspect
|
|
849
|
+
* @returns true when the embed iframe is detached
|
|
821
850
|
*/
|
|
822
|
-
#isEmbedGuestDetached = (guest) => guest.openMode === OpenMode.Embed && (!guest.domElement || !guest.domElement.isConnected);
|
|
851
|
+
#isEmbedGuestDetached = (guest) => guest.openMode === OpenMode.Embed && (!guest.domElement || !guest.domElement.isConnected || !guest.domElement.ownerDocument?.defaultView);
|
|
823
852
|
/**
|
|
824
853
|
* Invokes {@link onGuestClose} callbacks registered for a guest id.
|
|
825
854
|
* @param guestId guest application id
|
|
@@ -827,7 +856,14 @@ class SSFHost {
|
|
|
827
856
|
#fireGuestCloseCallbacks = (guestId) => {
|
|
828
857
|
const callbacks = this.#guestCloseCallbackList.get(guestId);
|
|
829
858
|
callbacks?.forEach((callback) => {
|
|
830
|
-
|
|
859
|
+
try {
|
|
860
|
+
Promise.resolve(callback({ id: guestId })).catch(ignoreRejectedPromise);
|
|
861
|
+
} catch (err) {
|
|
862
|
+
this.#logger.warn({
|
|
863
|
+
message: `onGuestClose callback threw for guest ${guestId}`,
|
|
864
|
+
exception: err
|
|
865
|
+
});
|
|
866
|
+
}
|
|
831
867
|
});
|
|
832
868
|
};
|
|
833
869
|
/**
|
|
@@ -898,33 +934,79 @@ class SSFHost {
|
|
|
898
934
|
}
|
|
899
935
|
};
|
|
900
936
|
/**
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
*
|
|
937
|
+
* Returns true when the lifecycle poll is responsible for this guest:
|
|
938
|
+
* every popup guest, and embed guests when detached-embed detection is on.
|
|
939
|
+
* @param guest guest to inspect
|
|
940
|
+
* @returns true when the poll should keep running for this guest
|
|
904
941
|
*/
|
|
905
|
-
#
|
|
942
|
+
#isMonitoredGuest = (guest) => guest.openMode === OpenMode.Popup || this.#detectDetachedEmbedGuests && guest.openMode === OpenMode.Embed;
|
|
943
|
+
/**
|
|
944
|
+
* Returns true when a monitored guest's context is gone: a popup whose
|
|
945
|
+
* window was closed, or an embed whose iframe is no longer in the DOM.
|
|
946
|
+
*
|
|
947
|
+
* An embed is unloaded only when it was already seen detached on an
|
|
948
|
+
* earlier tick (see {@link #embedGuestsSeenDetached}). Embeds with an
|
|
949
|
+
* unload already in flight are skipped so an explicit {@link unloadGuest}
|
|
950
|
+
* stays silent (no {@link onGuestClose}). If that unload is vetoed, a
|
|
951
|
+
* later tick picks the guest up.
|
|
952
|
+
* @param guest guest to inspect
|
|
953
|
+
* @returns true when the guest should be unloaded on this tick
|
|
954
|
+
*/
|
|
955
|
+
#isGuestContextGone = (guest) => {
|
|
956
|
+
if (guest.openMode === OpenMode.Popup) {
|
|
957
|
+
return this.#isPopupWindowClosed(guest.window);
|
|
958
|
+
}
|
|
959
|
+
if (!this.#detectDetachedEmbedGuests) return false;
|
|
960
|
+
if (!this.#isEmbedGuestDetached(guest)) {
|
|
961
|
+
this.#embedGuestsSeenDetached.delete(guest);
|
|
962
|
+
return false;
|
|
963
|
+
}
|
|
964
|
+
if (this.#guestsUnloading.has(guest.id)) return false;
|
|
965
|
+
if (!this.#embedGuestsSeenDetached.has(guest)) {
|
|
966
|
+
this.#embedGuestsSeenDetached.add(guest);
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
969
|
+
return true;
|
|
970
|
+
};
|
|
971
|
+
/**
|
|
972
|
+
* Polls guests and unloads any whose context went away without an explicit
|
|
973
|
+
* {@link unloadGuest}: popup windows closed externally and (unless
|
|
974
|
+
* `detectDetachedEmbedGuests` is false) embed iframes removed from the DOM.
|
|
975
|
+
*
|
|
976
|
+
* Embed guests also use {@link #observeEmbedGuestDetach} as a fast path.
|
|
977
|
+
* That observer only sees removal of the iframe from its direct parent at
|
|
978
|
+
* attach time, so ancestor removal and moved iframes are caught here,
|
|
979
|
+
* within about two intervals (one grace tick, then the unload). The poll
|
|
980
|
+
* reads only the state at each tick, so an iframe removed and re-inserted
|
|
981
|
+
* in the same task is not unloaded.
|
|
982
|
+
*/
|
|
983
|
+
#monitorGuests = () => {
|
|
906
984
|
if (this.#guestLifecycleMonitor) return;
|
|
907
985
|
this.#guestLifecycleMonitor = setInterval(() => {
|
|
908
986
|
const guestsToRemove = [];
|
|
909
987
|
this.#guests.forEach((guest) => {
|
|
910
|
-
if (
|
|
988
|
+
if (this.#isGuestContextGone(guest)) {
|
|
911
989
|
guestsToRemove.push(guest);
|
|
912
990
|
}
|
|
913
991
|
});
|
|
914
992
|
guestsToRemove.forEach((guest) => {
|
|
993
|
+
if (guest.openMode === OpenMode.Embed) {
|
|
994
|
+
this.#unobserveEmbedGuestDetach(guest.id);
|
|
995
|
+
}
|
|
915
996
|
this.#unloadGuestAndNotifyHost(guest.id);
|
|
916
997
|
});
|
|
917
998
|
}, 1e3);
|
|
918
999
|
};
|
|
919
1000
|
/**
|
|
920
|
-
* Stops the
|
|
1001
|
+
* Stops the lifecycle poll when no monitored guests (popups, or embeds when
|
|
1002
|
+
* detached-embed detection is on) remain.
|
|
921
1003
|
*/
|
|
922
|
-
#
|
|
1004
|
+
#stopMonitoringGuests = () => {
|
|
923
1005
|
if (!this.#guestLifecycleMonitor) return;
|
|
924
|
-
const
|
|
925
|
-
|
|
1006
|
+
const hasMonitoredGuests = Array.from(this.#guests.values()).some(
|
|
1007
|
+
this.#isMonitoredGuest
|
|
926
1008
|
);
|
|
927
|
-
if (!
|
|
1009
|
+
if (!hasMonitoredGuests) {
|
|
928
1010
|
clearInterval(this.#guestLifecycleMonitor);
|
|
929
1011
|
this.#guestLifecycleMonitor = null;
|
|
930
1012
|
}
|
|
@@ -1023,7 +1105,7 @@ class SSFHost {
|
|
|
1023
1105
|
handshakeToken,
|
|
1024
1106
|
handshakeRetries
|
|
1025
1107
|
});
|
|
1026
|
-
this.#
|
|
1108
|
+
this.#monitorGuests();
|
|
1027
1109
|
}
|
|
1028
1110
|
return guest;
|
|
1029
1111
|
};
|
|
@@ -1132,6 +1214,7 @@ class SSFHost {
|
|
|
1132
1214
|
});
|
|
1133
1215
|
if (fitToContent) this.#registerFitToContentGuest(guest.id);
|
|
1134
1216
|
this.#observeEmbedGuestDetach(guest);
|
|
1217
|
+
if (this.#detectDetachedEmbedGuests) this.#monitorGuests();
|
|
1135
1218
|
return guest;
|
|
1136
1219
|
};
|
|
1137
1220
|
#getGuestUrl = (url, params) => {
|
|
@@ -1270,6 +1353,7 @@ class SSFHost {
|
|
|
1270
1353
|
this.#releaseCallContext
|
|
1271
1354
|
);
|
|
1272
1355
|
this.#fitToContentGuestIds.clear();
|
|
1356
|
+
this.#embedGuestsSeenDetached = /* @__PURE__ */ new WeakSet();
|
|
1273
1357
|
this.#guestCloseNotified.clear();
|
|
1274
1358
|
this.#unsubscribeFromGuestResizeEvent();
|
|
1275
1359
|
this.#guestCloseCallbackList.clear();
|
|
@@ -1630,6 +1714,7 @@ class SSFHost {
|
|
|
1630
1714
|
};
|
|
1631
1715
|
#finalizeGuestRemoval = (guest) => {
|
|
1632
1716
|
this.#releaseCallContext(guest);
|
|
1717
|
+
this.#embedGuestsSeenDetached.delete(guest);
|
|
1633
1718
|
guest.dispose();
|
|
1634
1719
|
if (this.#guestsByWindow.get(guest.window) === guest) {
|
|
1635
1720
|
this.#guestsByWindow.delete(guest.window);
|
|
@@ -1650,7 +1735,7 @@ class SSFHost {
|
|
|
1650
1735
|
message: `Guest is removed from host`,
|
|
1651
1736
|
...guest.getInfo()
|
|
1652
1737
|
});
|
|
1653
|
-
this.#
|
|
1738
|
+
this.#stopMonitoringGuests();
|
|
1654
1739
|
};
|
|
1655
1740
|
/**
|
|
1656
1741
|
* Unloads a guest application from the host.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>CallChain E2E Test - Root Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>CallChain E2E Test - Root Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body class="bg-gray-50"><header class="bg-indigo-600 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">CallChain E2E Test — Root Host (A)</h1><a href="./index.html" class="text-indigo-200 hover:text-white text-sm">← Back to main</a></header><main class="mx-auto max-w-7xl px-4 py-4"><div class="grid grid-cols-2 gap-4 mb-4"><div class="bg-blue-50 border border-blue-200 rounded-md p-3"><h2 class="text-sm font-bold text-blue-900 mb-2">Architecture</h2><pre class="text-xs text-blue-800 leading-relaxed">
|
|
2
2
|
Root Host (A) [localhost:4000]
|
|
3
3
|
├─ Exposes: <strong>TestService</strong> scripting object
|
|
4
4
|
├─ Loads guest <strong>"intermediateHost"</strong>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Intermediate Guest+Host (B)</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="http://localhost:4001/index.js"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Intermediate Guest+Host (B)</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="http://localhost:4001/index.js"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body class="bg-orange-50 p-2"><h2 class="text-sm font-semibold text-orange-800 mb-1">Intermediate (B) — Guest + Host</h2><div data-testid="intermediate-status" id="status" class="text-xs bg-orange-100 rounded p-2 mb-2 min-h-[30px]">Initializing...</div><div data-testid="grandchild-container" id="grandchild-container" class="border border-dashed border-orange-400 rounded h-[250px]"></div><script type="module">import{Analytics}from"./analytics-object-v2.js";import{getGuestBaseUrl,getHost}from"./utils.js";const statusEl=document.getElementById("status"),log=t=>{const e=(new Date).toLocaleTimeString();statusEl.innerHTML+=`<div>[${e}] ${t}</div>`};(async()=>{try{log("Connecting to Root Host (A) as V2 guest...");const t=new ice.guest.SSFGuest({logger:{index:"intermediate-guest",team:"ui platform",appName:"intermediate-b"},keepAlive:!1});await t.connect(),log("Connected to Root Host (A)");const e=await t.getObject("TestService");log("Got TestService proxy from Root Host (A)");const o=new Analytics,a=getHost(o);if(!a)return void log("ERROR: Failed to create intermediate SSFHost");log("Created intermediate SSFHost (B)");const n=a.cloneScriptingObject(e);a.addScriptingObject(n),log("Cloned TestService for grandchild guests");const i=await getGuestBaseUrl();a.loadGuest({id:"grandchildGuest",url:new URL("./callchain-grandchild.html",i).href,title:"Grandchild Guest (C)",targetElement:document.getElementById("grandchild-container"),metadata:{role:"validator",region:"US-East"},onLoad:()=>log("Grandchild guest (C) loaded"),onError:()=>log("ERROR: Grandchild guest (C) failed to load")}),log("Intermediate (B) ready")}catch(t){log(`ERROR: ${t.message}`)}})()</script></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E — Comprehensive Host Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.1a8728b1d4fe91140d17.js"></script></head><body class="bg-gray-50 text-sm"><header class="bg-indigo-700 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">Comprehensive E2E Host Test</h1><a href="./e2e-index.html" class="text-indigo-200 hover:text-white text-sm">← Test Suite</a></header><main class="mx-auto max-w-7xl px-4 py-3"><div class="grid grid-cols-2 gap-3 mb-3"><div class="bg-blue-50 border border-blue-200 rounded-md p-3"><h2 class="text-sm font-bold text-blue-900 mb-1">How to Use This Page</h2><ol class="text-xs text-blue-800 space-y-1 list-decimal list-inside"><li>Start the host dev server (port 4000) and guest dev server (port 4001).</li><li>Buttons in <strong>Column 1</strong> (left) execute host-side actions.</li><li><strong>Column 2</strong> (center) shows embedded guest iframes — interact with them to invoke methods, subscribe to events, etc.</li><li><strong>Column 3</strong> (right) shows live results: Event Log, callContext, dispatch results, and the guest list.</li><li>Work through the buttons <strong>top to bottom</strong> for the recommended flow. Each button is labelled with a test case ID (TC-xxx).</li></ol></div><div class="bg-amber-50 border border-amber-200 rounded-md p-3"><h2 class="text-sm font-bold text-amber-900 mb-1">Recommended Flow</h2><ol class="text-xs text-amber-800 space-y-1 list-decimal list-inside"><li><strong>Load guests</strong>: TC-LOAD-01 (embed) → TC-LOAD-02 (popup) → TC-LOAD-04 (with params). Check Event Log for "loaded" messages.</li><li><strong>Scripting objects</strong>: TC-SO-01 (add Inventory). In the guest iframe, call <code>getObject("Inventory")</code> and invoke <code>getStock()</code>. Check return value and callContext.</li><li><strong>Events</strong>: In the guest, subscribe to <code>Loan.onPreSave</code>. Then click TC-EVT-01 on the host. Guest should receive the event.</li><li><strong>Lifecycle</strong>: TC-LIFE-01 (unload), TC-LIFE-03 (close host). Verify guests are removed and host is destroyed.</li></ol></div></div><div class="grid grid-cols-3 gap-3"><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Loading</h2><div class="space-y-2"><button data-testid="btn-load-embed" id="btnLoadEmbed" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-01: Load Embedded Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe appears in center column, log shows "loaded"</p><button data-testid="btn-load-popup" id="btnLoadPopup" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-02: Load Popup Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: new browser popup window opens</p><button data-testid="btn-load-multiple" id="btnLoadMultiple" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-03: loadGuests (3 instances)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: 3 guest iframes load, "List all guests" shows 3+ entries</p><button data-testid="btn-load-with-params" id="btnLoadWithParams" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-04: Load with searchParams</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest shows URL params in its "Params:" line</p><button data-testid="btn-load-with-metadata" id="btnLoadWithMetadata" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-META-01: Load with metadata</button><p class="text-[10px] text-gray-400 -mt-1">Expected: when guest invokes a method, callContext.callChain shows metadata</p><button data-testid="btn-load-bad-url" id="btnLoadBadUrl" class="w-full rounded bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-700">TC-LOAD-05: Load invalid URL (onError)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows "ERROR" or onError callback fires</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Scripting Object Management</h2><div class="space-y-2"><button data-testid="btn-add-so" id="btnAddSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-01: Add "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest can now <code>getObject("Inventory")</code> and invoke its methods</p><button data-testid="btn-add-guest-so" id="btnAddGuestSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-04: Add Guest-Scoped Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the target guest can access this object, others get "not available"</p><button data-testid="btn-remove-so" id="btnRemoveSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02: Remove "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest's <code>getObject("Inventory")</code> now fails</p><button data-testid="btn-remove-all-so" id="btnRemoveAllSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02b: Remove All Objects</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all getObject calls fail until objects are re-added</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Dispatching</h2><div class="space-y-2"><button data-testid="btn-dispatch-all" id="btnDispatchAll" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-01: Dispatch onPreSave to all</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests subscribed to onPreSave receive the event</p><button data-testid="btn-dispatch-targeted" id="btnDispatchTargeted" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-02: Dispatch to specific guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the targeted guest receives the event</p><button data-testid="btn-dispatch-feedback" id="btnDispatchFeedback" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-03: Dispatch with timeout (feedback)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Dispatch Results shows the guest's feedback return value</p><button data-testid="btn-dispatch-amount" id="btnDispatchAmount" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-04: Dispatch onAmountChanged (criteria)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only guests subscribed with matching criteria receive it</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Lifecycle</h2><div class="space-y-2"><button data-testid="btn-unload-guest" id="btnUnloadGuest" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-01: Unload first embedded guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe removed, "List all guests" count decreases</p><button data-testid="btn-register-close" id="btnRegisterClose" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-02: Register onGuestClose</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows callback registered; fires when guest calls close()</p><button data-testid="btn-list-guests" id="btnListGuests" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">List all guests</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Guest List panel shows all currently loaded guests</p><button data-testid="btn-set-loglevel" id="btnSetLogLevel" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">Set Log Level (Debug)</button> <button data-testid="btn-close-host" id="btnCloseHost" class="w-full rounded bg-red-700 px-3 py-1.5 text-xs text-white hover:bg-red-800">TC-LIFE-03: Close host</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests unloaded, host destroyed, further actions fail</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Configuration</h2><div class="space-y-2"><button data-testid="btn-sandbox-default" id="btnSandboxDefault" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-01: Default sandbox</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has standard sandbox attributes</p><button data-testid="btn-sandbox-custom" id="btnSandboxCustom" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-02: Custom sandbox values</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe sandbox attribute reflects custom permissions</p><button data-testid="btn-sandbox-disabled" id="btnSandboxDisabled" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-03: Sandbox disabled</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has no sandbox attribute (full permissions)</p></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Embedded Guests</h2><div data-testid="embed-container" id="embedContainer" class="border-2 border-dashed border-indigo-300 rounded min-h-[300px] space-y-2"></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Test Container</h2><div data-testid="sandbox-container" id="sandboxContainer" class="border-2 border-dashed border-teal-300 rounded min-h-[150px] space-y-2"></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Log</h2><div data-testid="event-log" id="eventLog" class="text-xs bg-gray-100 rounded p-2 min-h-[200px] max-h-[350px] overflow-y-auto font-mono"></div><button data-testid="btn-clear-log" id="btnClearLog" class="mt-1 text-xs text-gray-400 hover:text-gray-600">Clear</button></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">callContext (last invocation)</h2><div data-testid="callcontext-panel"><h3 class="text-xs text-gray-500">callContext.guest</h3><pre data-testid="callcontext-guest" id="callContextGuest" class="text-xs bg-gray-100 rounded p-1 mb-1 whitespace-pre-wrap min-h-[30px]">
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E — Comprehensive Host Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body class="bg-gray-50 text-sm"><header class="bg-indigo-700 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">Comprehensive E2E Host Test</h1><a href="./e2e-index.html" class="text-indigo-200 hover:text-white text-sm">← Test Suite</a></header><main class="mx-auto max-w-7xl px-4 py-3"><div class="grid grid-cols-2 gap-3 mb-3"><div class="bg-blue-50 border border-blue-200 rounded-md p-3"><h2 class="text-sm font-bold text-blue-900 mb-1">How to Use This Page</h2><ol class="text-xs text-blue-800 space-y-1 list-decimal list-inside"><li>Start the host dev server (port 4000) and guest dev server (port 4001).</li><li>Buttons in <strong>Column 1</strong> (left) execute host-side actions.</li><li><strong>Column 2</strong> (center) shows embedded guest iframes — interact with them to invoke methods, subscribe to events, etc.</li><li><strong>Column 3</strong> (right) shows live results: Event Log, callContext, dispatch results, and the guest list.</li><li>Work through the buttons <strong>top to bottom</strong> for the recommended flow. Each button is labelled with a test case ID (TC-xxx).</li></ol></div><div class="bg-amber-50 border border-amber-200 rounded-md p-3"><h2 class="text-sm font-bold text-amber-900 mb-1">Recommended Flow</h2><ol class="text-xs text-amber-800 space-y-1 list-decimal list-inside"><li><strong>Load guests</strong>: TC-LOAD-01 (embed) → TC-LOAD-02 (popup) → TC-LOAD-04 (with params). Check Event Log for "loaded" messages.</li><li><strong>Scripting objects</strong>: TC-SO-01 (add Inventory). In the guest iframe, call <code>getObject("Inventory")</code> and invoke <code>getStock()</code>. Check return value and callContext.</li><li><strong>Events</strong>: In the guest, subscribe to <code>Loan.onPreSave</code>. Then click TC-EVT-01 on the host. Guest should receive the event.</li><li><strong>Lifecycle</strong>: TC-LIFE-01 (unload), TC-LIFE-03 (close host). Verify guests are removed and host is destroyed.</li></ol></div></div><div class="grid grid-cols-3 gap-3"><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Loading</h2><div class="space-y-2"><button data-testid="btn-load-embed" id="btnLoadEmbed" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-01: Load Embedded Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe appears in center column, log shows "loaded"</p><button data-testid="btn-load-popup" id="btnLoadPopup" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-02: Load Popup Guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: new browser popup window opens</p><button data-testid="btn-load-multiple" id="btnLoadMultiple" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-03: loadGuests (3 instances)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: 3 guest iframes load, "List all guests" shows 3+ entries</p><button data-testid="btn-load-with-params" id="btnLoadWithParams" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-LOAD-04: Load with searchParams</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest shows URL params in its "Params:" line</p><button data-testid="btn-load-with-metadata" id="btnLoadWithMetadata" class="w-full rounded bg-indigo-600 px-3 py-1.5 text-xs text-white hover:bg-indigo-700">TC-META-01: Load with metadata</button><p class="text-[10px] text-gray-400 -mt-1">Expected: when guest invokes a method, callContext.callChain shows metadata</p><button data-testid="btn-load-bad-url" id="btnLoadBadUrl" class="w-full rounded bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-700">TC-LOAD-05: Load invalid URL (onError)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows "ERROR" or onError callback fires</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Scripting Object Management</h2><div class="space-y-2"><button data-testid="btn-add-so" id="btnAddSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-01: Add "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest can now <code>getObject("Inventory")</code> and invoke its methods</p><button data-testid="btn-add-guest-so" id="btnAddGuestSO" class="w-full rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700">TC-SO-04: Add Guest-Scoped Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the target guest can access this object, others get "not available"</p><button data-testid="btn-remove-so" id="btnRemoveSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02: Remove "Inventory" Object</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest's <code>getObject("Inventory")</code> now fails</p><button data-testid="btn-remove-all-so" id="btnRemoveAllSO" class="w-full rounded bg-yellow-600 px-3 py-1.5 text-xs text-white hover:bg-yellow-700">TC-SO-02b: Remove All Objects</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all getObject calls fail until objects are re-added</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Dispatching</h2><div class="space-y-2"><button data-testid="btn-dispatch-all" id="btnDispatchAll" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-01: Dispatch onPreSave to all</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests subscribed to onPreSave receive the event</p><button data-testid="btn-dispatch-targeted" id="btnDispatchTargeted" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-02: Dispatch to specific guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only the targeted guest receives the event</p><button data-testid="btn-dispatch-feedback" id="btnDispatchFeedback" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-03: Dispatch with timeout (feedback)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Dispatch Results shows the guest's feedback return value</p><button data-testid="btn-dispatch-amount" id="btnDispatchAmount" class="w-full rounded bg-purple-600 px-3 py-1.5 text-xs text-white hover:bg-purple-700">TC-EVT-04: Dispatch onAmountChanged (criteria)</button><p class="text-[10px] text-gray-400 -mt-1">Expected: only guests subscribed with matching criteria receive it</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest Lifecycle</h2><div class="space-y-2"><button data-testid="btn-unload-guest" id="btnUnloadGuest" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-01: Unload first embedded guest</button><p class="text-[10px] text-gray-400 -mt-1">Expected: guest iframe removed, "List all guests" count decreases</p><button data-testid="btn-register-close" id="btnRegisterClose" class="w-full rounded bg-orange-600 px-3 py-1.5 text-xs text-white hover:bg-orange-700">TC-LIFE-02: Register onGuestClose</button><p class="text-[10px] text-gray-400 -mt-1">Expected: log shows callback registered; fires when guest calls close()</p><button data-testid="btn-list-guests" id="btnListGuests" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">List all guests</button><p class="text-[10px] text-gray-400 -mt-1">Expected: Guest List panel shows all currently loaded guests</p><button data-testid="btn-set-loglevel" id="btnSetLogLevel" class="w-full rounded bg-gray-600 px-3 py-1.5 text-xs text-white hover:bg-gray-700">Set Log Level (Debug)</button> <button data-testid="btn-close-host" id="btnCloseHost" class="w-full rounded bg-red-700 px-3 py-1.5 text-xs text-white hover:bg-red-800">TC-LIFE-03: Close host</button><p class="text-[10px] text-gray-400 -mt-1">Expected: all guests unloaded, host destroyed, further actions fail</p></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Configuration</h2><div class="space-y-2"><button data-testid="btn-sandbox-default" id="btnSandboxDefault" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-01: Default sandbox</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has standard sandbox attributes</p><button data-testid="btn-sandbox-custom" id="btnSandboxCustom" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-02: Custom sandbox values</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe sandbox attribute reflects custom permissions</p><button data-testid="btn-sandbox-disabled" id="btnSandboxDisabled" class="w-full rounded bg-teal-600 px-3 py-1.5 text-xs text-white hover:bg-teal-700">TC-SB-03: Sandbox disabled</button><p class="text-[10px] text-gray-400 -mt-1">Expected: iframe has no sandbox attribute (full permissions)</p></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Embedded Guests</h2><div data-testid="embed-container" id="embedContainer" class="border-2 border-dashed border-indigo-300 rounded min-h-[300px] space-y-2"></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Sandbox Test Container</h2><div data-testid="sandbox-container" id="sandboxContainer" class="border-2 border-dashed border-teal-300 rounded min-h-[150px] space-y-2"></div></div></div><div class="space-y-3"><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Event Log</h2><div data-testid="event-log" id="eventLog" class="text-xs bg-gray-100 rounded p-2 min-h-[200px] max-h-[350px] overflow-y-auto font-mono"></div><button data-testid="btn-clear-log" id="btnClearLog" class="mt-1 text-xs text-gray-400 hover:text-gray-600">Clear</button></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">callContext (last invocation)</h2><div data-testid="callcontext-panel"><h3 class="text-xs text-gray-500">callContext.guest</h3><pre data-testid="callcontext-guest" id="callContextGuest" class="text-xs bg-gray-100 rounded p-1 mb-1 whitespace-pre-wrap min-h-[30px]">
|
|
2
2
|
—</pre><h3 class="text-xs text-gray-500">callContext.callChain</h3><pre data-testid="callcontext-chain" id="callContextChain" class="text-xs bg-gray-100 rounded p-1 mb-1 whitespace-pre-wrap min-h-[30px]">
|
|
3
3
|
—</pre></div></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Dispatch Results</h2><pre data-testid="dispatch-result" id="dispatchResult" class="text-xs bg-gray-100 rounded p-2 min-h-[60px] whitespace-pre-wrap">
|
|
4
4
|
—</pre></div><div class="bg-white rounded-lg shadow p-3"><h2 class="font-semibold text-gray-700 mb-2 border-b pb-1">Guest List</h2><pre data-testid="guest-list" id="guestList" class="text-xs bg-gray-100 rounded p-2 min-h-[60px] whitespace-pre-wrap">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E Test Suite</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>SSF E2E Test Suite</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body class="bg-gray-50"><header class="bg-gray-900 text-white px-6 py-4"><h1 class="text-xl font-bold">SSF End-to-End Test Suite</h1><p class="text-sm text-gray-400 mt-1">Comprehensive blackbox tests for SSF Host & Guest. Each page includes test steps, expected values, and a verification checklist.</p></header><main class="mx-auto max-w-5xl px-6 py-6"><section class="mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4"><h2 class="text-sm font-semibold text-yellow-800 mb-2">Setup Instructions</h2><ol class="text-xs text-yellow-700 list-decimal ml-4 space-y-1"><li>Install dependencies: <code class="bg-yellow-100 px-1 rounded">pnpm install</code></li><li>Start SSF Host dev server: <code class="bg-yellow-100 px-1 rounded">pnpm nx run ssf-host:start-server</code> (port 4000)</li><li>Start SSF Guest dev server: <code class="bg-yellow-100 px-1 rounded">pnpm nx run ssf-guest:start</code> (port 4001)</li><li>Open <code class="bg-yellow-100 px-1 rounded">http://localhost:4000/e2e-index.html</code> in the browser</li><li>Each test page has <code class="bg-yellow-100 px-1 rounded">data-testid</code> attributes for Playwright/Cypress selectors</li></ol></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">1. Core Host-Guest Communication</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./e2e-host.html" data-testid="link-e2e-host" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Comprehensive E2E Host</h3><p class="text-xs text-gray-500 mt-1">All host-guest scenarios: guest loading, scripting objects, events, lifecycle, metadata, sandbox, guest-scoped objects.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Guests load in iframes/popups. Scripting objects can be added/removed/invoked. Events reach subscribed guests. Unload/close cleans up properly. Sandbox attrs applied.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-LOAD-01..05 • TC-SO-01..08 • TC-EVT-01..04 • TC-LIFE-01..03 • TC-META-01 • TC-SB-01..03</div></a><a href="./index.html" data-testid="link-main-demo" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Main Demo App</h3><p class="text-xs text-gray-500 mt-1">Original Loan Application demo with embedded and popup guests, events, scripting objects.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Loan form data flows to guests. Events (onLoanAmountChanged, etc.) update guest UIs. Popup guests open and interact with the Loan object.</p></a></div></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">2. Call Chain & Metadata Propagation</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./callchain-host.html" data-testid="link-callchain" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Nested CallChain Test (A → B → C)</h3><p class="text-xs text-gray-500 mt-1">Root Host (A) → Intermediate Guest+Host (B) → Grandchild Guest (C). Verifies callContext.callChain and metadata propagation.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Click buttons in Grandchild C. Host A should show <code>callContext.guest</code> = B and <code>callChain</code> containing C and B with their metadata. Return values should flow back to C.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-CC-01..07</div></a></div></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">3. Popup Guest Behavior</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./popup-focus-host.html" data-testid="link-popup-focus" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">Popup Focus & Lifecycle</h3><p class="text-xs text-gray-500 mt-1">Open, close, and refocus popup guests. Tests trusted vs untrusted domain behavior.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Trusted popups (localhost): re-open brings existing popup to front. Untrusted popups: opener is nulled, focus falls back to WindowProxy. Closed popup detection updates guest status.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-POP-01..11</div></a></div></section><section class="mb-6"><h2 class="text-lg font-semibold text-gray-800 border-b pb-1 mb-3">4. V1 / V2 Interoperability</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-3"><a href="./v2-host-v1-guest.html" data-testid="link-v2-host-v1-guest" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">V2 Host → V1 Guest</h3><p class="text-xs text-gray-500 mt-1">V2 host loads V1 guest. Loan object, save flow, event feedback.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> V1 guest connects, gets objects, subscribes to events, and returns feedback correctly.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-INTEROP-01..04</div></a><a href="./v2-host-v1-guest.html?nestV1GuestV2Host=true" data-testid="link-v2-v1-v2-chain" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">V2 Host → V1 Guest → V2 Host → V2 Guest</h3><p class="text-xs text-gray-500 mt-1">Full mixed-version chain. V1 guest acts as intermediate host for a V2 grandchild.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> Scripting objects are cloned across V1/V2 boundary. Events flow through all layers.</p><div class="mt-2 text-xs text-gray-400"><strong>Test Cases:</strong> TC-INTEROP-05..07</div></a></div><div class="grid grid-cols-1 md:grid-cols-2 gap-3 mt-3"><a href="./v1-host.html" data-testid="link-v1-host" class="block bg-white rounded-lg shadow p-4 hover:shadow-md transition"><h3 class="font-medium text-indigo-700">V1 Host → V1 Guest → V2 Host → V2 Guest</h3><p class="text-xs text-gray-500 mt-1">Starting from V1 host. Exercises the full V1-to-V2 upgrade path.</p><p class="text-xs text-gray-400 mt-2"><strong>What to verify:</strong> V1 host initializes. V1 guest connects. V2 host/guest chain works through V1 intermediate.</p></a></div></section></main></body></html>
|
package/dist/public/index.html
CHANGED
|
@@ -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://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.
|
|
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://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body><header class="bg-indigo-300 h-10 flex place-items-center justify-between"><div class="px-2">ICE Mortgage Product</div><nav class="flex gap-3 px-2 text-xs"><a href="./e2e-index.html" data-testid="nav-e2e-suite" class="text-indigo-800 hover:text-indigo-950 underline font-bold">E2E Test Suite</a> <a href="./e2e-host.html" data-testid="nav-e2e-host" class="text-indigo-800 hover:text-indigo-950 underline">Comprehensive E2E</a> <a href="./callchain-host.html" data-testid="nav-callchain-test" class="text-indigo-800 hover:text-indigo-950 underline">CallChain</a> <a href="./popup-focus-host.html" data-testid="nav-popup-focus-test" class="text-indigo-800 hover:text-indigo-950 underline">Popup Focus</a> <a href="./v2-host-v1-guest.html" data-testid="nav-v1-interop" class="text-indigo-800 hover:text-indigo-950 underline">V1 Interop</a></nav></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><h3 class="text-lg font-medium leading-6 text-gray-900">Order Services</h3></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><div class="mt-1 sm:mt-0"><button id="title" 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 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M7.502 6h7.128A3.375 3.375 0 0118 9.375v9.375a3 3 0 003-3V6.108c0-1.505-1.125-2.811-2.664-2.94a48.972 48.972 0 00-.673-.05A3 3 0 0015 1.5h-1.5a3 3 0 00-2.663 1.618c-.225.015-.45.032-.673.05C8.662 3.295 7.554 4.542 7.502 6zM13.5 3A1.5 1.5 0 0012 4.5h4.5A1.5 1.5 0 0015 3h-1.5z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M3 9.375C3 8.339 3.84 7.5 4.875 7.5h9.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 013 20.625V9.375zM6 12a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V12zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75zM6 15a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V15zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75zM6 18a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V18zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75z" clip-rule="evenodd"/></svg> Title</button></div><div class="mt-1 sm:mt-0"><button id="credit" 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 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M2.25 13.5a8.25 8.25 0 018.25-8.25.75.75 0 01.75.75v6.75H18a.75.75 0 01.75.75 8.25 8.25 0 01-16.5 0z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M12.75 3a.75.75 0 01.75-.75 8.25 8.25 0 018.25 8.25.75.75 0 01-.75.75h-7.5a.75.75 0 01-.75-.75V3z" clip-rule="evenodd"/></svg> Credit Score</button></div></div></div></div></div><div class="flex flex-col"><button id="saveLoan" type="button" class="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></div></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>
|