@elliemae/pui-app-sdk 5.44.0 → 5.44.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 (192) hide show
  1. package/build/docs/404.html +1 -1
  2. package/build/docs/api/classes/Analytics/index.html +1 -1
  3. package/build/docs/api/classes/CMicroAppGuest/index.html +1 -1
  4. package/build/docs/api/classes/CMicroAppHost/index.html +1 -1
  5. package/build/docs/api/classes/ErrorBoundary/index.html +1 -1
  6. package/build/docs/api/classes/GuestModule/index.html +1 -1
  7. package/build/docs/api/functions/AppRoot/index.html +1 -1
  8. package/build/docs/api/functions/Autocomplete/index.html +1 -1
  9. package/build/docs/api/functions/CheckBox/index.html +1 -1
  10. package/build/docs/api/functions/ComboBox/index.html +1 -1
  11. package/build/docs/api/functions/ComboBoxV3/index.html +1 -1
  12. package/build/docs/api/functions/ConnectForm/index.html +1 -1
  13. package/build/docs/api/functions/DateInput/index.html +1 -1
  14. package/build/docs/api/functions/DatePicker/index.html +1 -1
  15. package/build/docs/api/functions/DateRangePicker/index.html +1 -1
  16. package/build/docs/api/functions/DateTimePicker/index.html +1 -1
  17. package/build/docs/api/functions/Form/index.html +1 -1
  18. package/build/docs/api/functions/FormItemLayout/index.html +1 -1
  19. package/build/docs/api/functions/FormLayoutBlockItem/index.html +1 -1
  20. package/build/docs/api/functions/FormSubmitButton/index.html +1 -1
  21. package/build/docs/api/functions/InputMask/index.html +1 -1
  22. package/build/docs/api/functions/InputText/index.html +1 -1
  23. package/build/docs/api/functions/LargeTextBox/index.html +1 -1
  24. package/build/docs/api/functions/MaskedInputText/index.html +1 -1
  25. package/build/docs/api/functions/Page/index.html +1 -1
  26. package/build/docs/api/functions/Radio/index.html +1 -1
  27. package/build/docs/api/functions/RadioGroup/index.html +1 -1
  28. package/build/docs/api/functions/RegisterService/index.html +1 -1
  29. package/build/docs/api/functions/RenderWithStateAddOns/index.html +1 -1
  30. package/build/docs/api/functions/RequireAuth/index.html +1 -1
  31. package/build/docs/api/functions/SessionTimeout/index.html +1 -1
  32. package/build/docs/api/functions/TextBox/index.html +1 -1
  33. package/build/docs/api/functions/Toggle/index.html +1 -1
  34. package/build/docs/api/functions/authSaga/index.html +1 -1
  35. package/build/docs/api/functions/authorize/index.html +1 -1
  36. package/build/docs/api/functions/buildModuleParams/index.html +1 -1
  37. package/build/docs/api/functions/cleanup/index.html +1 -1
  38. package/build/docs/api/functions/configureStore/index.html +1 -1
  39. package/build/docs/api/functions/createGuestModule/index.html +1 -1
  40. package/build/docs/api/functions/createManager/index.html +1 -1
  41. package/build/docs/api/functions/enableReactAppForHostIntegration/index.html +1 -1
  42. package/build/docs/api/functions/fetchHostAppData/index.html +1 -1
  43. package/build/docs/api/functions/fetchUserSettings/index.html +1 -1
  44. package/build/docs/api/functions/getApiActionCreator/index.html +1 -1
  45. package/build/docs/api/functions/getAppConfig/index.html +1 -1
  46. package/build/docs/api/functions/getAppConfigValue/index.html +1 -1
  47. package/build/docs/api/functions/getAuthHTTPClient/index.html +1 -1
  48. package/build/docs/api/functions/getAuthorizationHeader/index.html +1 -1
  49. package/build/docs/api/functions/getHTTPClient/index.html +1 -1
  50. package/build/docs/api/functions/getHostAppDataByKey/index.html +1 -1
  51. package/build/docs/api/functions/getLogger/index.html +1 -1
  52. package/build/docs/api/functions/getMicroFrontEndAppConfig/index.html +1 -1
  53. package/build/docs/api/functions/getNavigationLinks/index.html +1 -1
  54. package/build/docs/api/functions/getRedirectUrl/index.html +1 -1
  55. package/build/docs/api/functions/getSelectField/index.html +1 -1
  56. package/build/docs/api/functions/getStore/index.html +1 -1
  57. package/build/docs/api/functions/initServiceWorker/index.html +1 -1
  58. package/build/docs/api/functions/isCIBuild/index.html +1 -1
  59. package/build/docs/api/functions/isProd/index.html +1 -1
  60. package/build/docs/api/functions/isUserAuthorized/index.html +1 -1
  61. package/build/docs/api/functions/listenStorageEvents/index.html +1 -1
  62. package/build/docs/api/functions/loadAppConfig/index.html +1 -1
  63. package/build/docs/api/functions/loadable/index.html +1 -1
  64. package/build/docs/api/functions/login/index.html +1 -1
  65. package/build/docs/api/functions/notifyGuestUnloadComplete/index.html +1 -1
  66. package/build/docs/api/functions/onAuthorizationFailure/index.html +1 -1
  67. package/build/docs/api/functions/onGuestUnloadStart/index.html +1 -1
  68. package/build/docs/api/functions/redactPii/index.html +1 -1
  69. package/build/docs/api/functions/removeDoubleSlash/index.html +1 -1
  70. package/build/docs/api/functions/removeStorageEvents/index.html +1 -1
  71. package/build/docs/api/functions/render/index.html +1 -1
  72. package/build/docs/api/functions/renderHook/index.html +1 -1
  73. package/build/docs/api/functions/renderWithHostData/index.html +1 -1
  74. package/build/docs/api/functions/renderWithRedux/index.html +1 -1
  75. package/build/docs/api/functions/renderWithRouter/index.html +1 -1
  76. package/build/docs/api/functions/renderWithRouterRedux/index.html +1 -1
  77. package/build/docs/api/functions/sdkBaseQuery/index.html +1 -1
  78. package/build/docs/api/functions/sendBAEvent/index.html +1 -1
  79. package/build/docs/api/functions/sendMessageToHost/index.html +1 -1
  80. package/build/docs/api/functions/setAppConfig/index.html +1 -1
  81. package/build/docs/api/functions/setAppConfigValue/index.html +1 -1
  82. package/build/docs/api/functions/setHostAppData/index.html +1 -1
  83. package/build/docs/api/functions/setLoginParams/index.html +1 -1
  84. package/build/docs/api/functions/subscribeToResetSession/index.html +1 -1
  85. package/build/docs/api/functions/subscribeToSessionExpiry/index.html +1 -1
  86. package/build/docs/api/functions/subscribeToSessionExpiryWarning/index.html +1 -1
  87. package/build/docs/api/functions/trackActivity/index.html +1 -1
  88. package/build/docs/api/functions/useAppDispatch/index.html +1 -1
  89. package/build/docs/api/functions/useAppMiddleware/index.html +1 -1
  90. package/build/docs/api/functions/useInjectQuery/index.html +1 -1
  91. package/build/docs/api/functions/useInjectReducer/index.html +1 -1
  92. package/build/docs/api/functions/useInjectSaga/index.html +1 -1
  93. package/build/docs/api/functions/useInjectSideEffect/index.html +1 -1
  94. package/build/docs/api/functions/useMediaQueryList/index.html +1 -1
  95. package/build/docs/api/functions/useStateSelector/index.html +1 -1
  96. package/build/docs/api/functions/useStateSelectorShallow/index.html +1 -1
  97. package/build/docs/api/functions/waitFor/index.html +1 -1
  98. package/build/docs/api/functions/waitForElementToBeRemoved/index.html +1 -1
  99. package/build/docs/api/functions/withAppDecorator/index.html +1 -1
  100. package/build/docs/api/index.html +1 -1
  101. package/build/docs/api/interfaces/AppConfig/index.html +1 -1
  102. package/build/docs/api/interfaces/GuestProps/index.html +1 -1
  103. package/build/docs/api/interfaces/UseStateSelectorOptions/index.html +1 -1
  104. package/build/docs/api/type-aliases/AppDispatch/index.html +1 -1
  105. package/build/docs/api/type-aliases/AppStore/index.html +1 -1
  106. package/build/docs/api/type-aliases/Await/index.html +1 -1
  107. package/build/docs/api/type-aliases/EMUI/index.html +1 -1
  108. package/build/docs/api/type-aliases/HostOptions/index.html +1 -1
  109. package/build/docs/api/type-aliases/HostProvidedParams/index.html +1 -1
  110. package/build/docs/api/type-aliases/ModuleOverrides/index.html +1 -1
  111. package/build/docs/api/type-aliases/OnHostInitCallback/index.html +1 -1
  112. package/build/docs/api/type-aliases/OnInitCallback/index.html +1 -1
  113. package/build/docs/api/type-aliases/OnMountCallback/index.html +1 -1
  114. package/build/docs/api/type-aliases/OnUnMountCallback/index.html +1 -1
  115. package/build/docs/api/type-aliases/RootState/index.html +1 -1
  116. package/build/docs/api/type-aliases/SelectStateFieldFunction/index.html +1 -1
  117. package/build/docs/api/variables/ErrorToast/index.html +1 -1
  118. package/build/docs/api/variables/FormPropsContext/index.html +1 -1
  119. package/build/docs/api/variables/GuestMicroApp/index.html +1 -1
  120. package/build/docs/api/variables/MASK_PIPES/index.html +1 -1
  121. package/build/docs/api/variables/MASK_TYPES/index.html +1 -1
  122. package/build/docs/api/variables/MicroApp/index.html +1 -1
  123. package/build/docs/api/variables/MicroIFrameApp/index.html +1 -1
  124. package/build/docs/api/variables/NavigationPrompt/index.html +1 -1
  125. package/build/docs/api/variables/NavigationPromptActions/index.html +1 -1
  126. package/build/docs/api/variables/Themes/index.html +1 -1
  127. package/build/docs/api/variables/VisuallyHidden/index.html +1 -1
  128. package/build/docs/api/variables/WaitMessage/index.html +1 -1
  129. package/build/docs/api/variables/act/index.html +1 -1
  130. package/build/docs/api/variables/ariaLive/index.html +1 -1
  131. package/build/docs/api/variables/auth/index.html +1 -1
  132. package/build/docs/api/variables/authReducer/index.html +1 -1
  133. package/build/docs/api/variables/clearSideEffects/index.html +1 -1
  134. package/build/docs/api/variables/createSideEffect/index.html +1 -1
  135. package/build/docs/api/variables/decorators/index.html +1 -1
  136. package/build/docs/api/variables/endSession/index.html +1 -1
  137. package/build/docs/api/variables/error/index.html +1 -1
  138. package/build/docs/api/variables/errorMiddleware/index.html +1 -1
  139. package/build/docs/api/variables/fireEvent/index.html +1 -1
  140. package/build/docs/api/variables/globalConstants/index.html +1 -1
  141. package/build/docs/api/variables/history/index.html +1 -1
  142. package/build/docs/api/variables/httpClientProps/index.html +1 -1
  143. package/build/docs/api/variables/logout/index.html +1 -1
  144. package/build/docs/api/variables/memoryHistory/index.html +1 -1
  145. package/build/docs/api/variables/removeSideEffect/index.html +1 -1
  146. package/build/docs/api/variables/resetUserIdleTime/index.html +1 -1
  147. package/build/docs/api/variables/screen/index.html +1 -1
  148. package/build/docs/api/variables/startSideEffect/index.html +1 -1
  149. package/build/docs/api/variables/updateBAEventParameters/index.html +1 -1
  150. package/build/docs/api/variables/useAppSelector/index.html +1 -1
  151. package/build/docs/api/variables/waitMessageAction/index.html +1 -1
  152. package/build/docs/api/variables/within/index.html +1 -1
  153. package/build/docs/assets/js/{main.f6a3322e.js → main.1bc3906d.js} +2 -2
  154. package/build/docs/index.html +1 -1
  155. package/build/docs/usage-guide/index.html +1 -1
  156. package/demo/{docs/1896.1c742108.iframe.bundle.js → 1896.f079560a.iframe.bundle.js} +1 -1
  157. package/demo/1896.f079560a.iframe.bundle.js.br +0 -0
  158. package/demo/{docs/1896.1c742108.iframe.bundle.js.gz → 1896.f079560a.iframe.bundle.js.gz} +0 -0
  159. package/demo/{1896.1c742108.iframe.bundle.js → docs/1896.f079560a.iframe.bundle.js} +1 -1
  160. package/demo/docs/1896.f079560a.iframe.bundle.js.br +0 -0
  161. package/demo/{1896.1c742108.iframe.bundle.js.gz → docs/1896.f079560a.iframe.bundle.js.gz} +0 -0
  162. package/demo/docs/iframe.html +1 -1
  163. package/demo/docs/index.html +1 -1
  164. package/demo/docs/main.b01a6dc6.iframe.bundle.js +5 -0
  165. package/demo/docs/main.b01a6dc6.iframe.bundle.js.br +0 -0
  166. package/demo/docs/main.b01a6dc6.iframe.bundle.js.gz +0 -0
  167. package/demo/docs/{main.8e67bf2a43b910cc0a1f.manager.bundle.js → main.e50da2045dbe0d31db54.manager.bundle.js} +1 -1
  168. package/demo/docs/{main.8e67bf2a43b910cc0a1f.manager.bundle.js.br → main.e50da2045dbe0d31db54.manager.bundle.js.br} +0 -0
  169. package/demo/docs/{main.8e67bf2a43b910cc0a1f.manager.bundle.js.gz → main.e50da2045dbe0d31db54.manager.bundle.js.gz} +0 -0
  170. package/demo/docs/project.json +1 -1
  171. package/demo/iframe.html +1 -1
  172. package/demo/index.html +1 -1
  173. package/demo/main.b01a6dc6.iframe.bundle.js +5 -0
  174. package/demo/main.b01a6dc6.iframe.bundle.js.br +0 -0
  175. package/demo/main.b01a6dc6.iframe.bundle.js.gz +0 -0
  176. package/demo/{main.8e67bf2a43b910cc0a1f.manager.bundle.js → main.e50da2045dbe0d31db54.manager.bundle.js} +1 -1
  177. package/demo/{main.8e67bf2a43b910cc0a1f.manager.bundle.js.br → main.e50da2045dbe0d31db54.manager.bundle.js.br} +0 -0
  178. package/demo/{main.8e67bf2a43b910cc0a1f.manager.bundle.js.gz → main.e50da2045dbe0d31db54.manager.bundle.js.gz} +0 -0
  179. package/demo/project.json +1 -1
  180. package/dist/cjs/utils/micro-frontend/guest.js +39 -36
  181. package/dist/esm/utils/micro-frontend/guest.js +39 -36
  182. package/dist/types/tsconfig.tsbuildinfo +1 -1
  183. package/package.json +1 -1
  184. package/demo/1896.1c742108.iframe.bundle.js.br +0 -0
  185. package/demo/docs/1896.1c742108.iframe.bundle.js.br +0 -0
  186. package/demo/docs/main.643b2148.iframe.bundle.js +0 -5
  187. package/demo/docs/main.643b2148.iframe.bundle.js.br +0 -0
  188. package/demo/docs/main.643b2148.iframe.bundle.js.gz +0 -0
  189. package/demo/main.643b2148.iframe.bundle.js +0 -5
  190. package/demo/main.643b2148.iframe.bundle.js.br +0 -0
  191. package/demo/main.643b2148.iframe.bundle.js.gz +0 -0
  192. /package/build/docs/assets/js/{main.f6a3322e.js.LICENSE.txt → main.1bc3906d.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- (globalThis.webpackChunk_elliemae_pui_app_sdk=globalThis.webpackChunk_elliemae_pui_app_sdk||[]).push([[792],{11792(i,t,o){"use strict";var p=o(59443),m=o(96778),v=Object.defineProperty,l=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,f=(e,a,r)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,b=(e,a)=>{for(var r in a||(a={}))s.call(a,r)&&f(e,r,a[r]);if(l)for(var r of l(a))_.call(a,r)&&f(e,r,a[r]);return e},d=(e,a)=>{var r={};for(var n in e)s.call(e,n)&&a.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&l)for(var n of l(e))a.indexOf(n)<0&&_.call(e,n)&&(r[n]=e[n]);return r};const h=e=>{var a=e,{base:r="light",brandTitle:n="Platform UI Components"}=a,u=d(a,["base","brandTitle"]);return(0,m.vt)(b({base:r,brandTitle:`${n} v5.44.0`},u))};(e=>{p.MC.setConfig({panelPosition:"bottom",theme:h(e)})})({brandTitle:"Application SDK",brandUrl:"https://git.elliemae.io/platform-ui/pui-app-sdk.git"})},22179(){}},i=>{var t=p=>i(i.s=p);i.O(0,[659],()=>(t(54176),t(11792),t(68082),t(34023),t(72247),t(40652),t(41420),t(48510),t(75963),t(4547),t(15869),t(74157),t(28061),t(99789),t(40166),t(29923)));var o=i.O()}]);
1
+ (globalThis.webpackChunk_elliemae_pui_app_sdk=globalThis.webpackChunk_elliemae_pui_app_sdk||[]).push([[792],{11792(i,t,o){"use strict";var p=o(59443),m=o(96778),v=Object.defineProperty,l=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,f=(e,a,r)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,b=(e,a)=>{for(var r in a||(a={}))s.call(a,r)&&f(e,r,a[r]);if(l)for(var r of l(a))_.call(a,r)&&f(e,r,a[r]);return e},d=(e,a)=>{var r={};for(var n in e)s.call(e,n)&&a.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&l)for(var n of l(e))a.indexOf(n)<0&&_.call(e,n)&&(r[n]=e[n]);return r};const h=e=>{var a=e,{base:r="light",brandTitle:n="Platform UI Components"}=a,u=d(a,["base","brandTitle"]);return(0,m.vt)(b({base:r,brandTitle:`${n} v5.44.1`},u))};(e=>{p.MC.setConfig({panelPosition:"bottom",theme:h(e)})})({brandTitle:"Application SDK",brandUrl:"https://git.elliemae.io/platform-ui/pui-app-sdk.git"})},22179(){}},i=>{var t=p=>i(i.s=p);i.O(0,[659],()=>(t(54176),t(11792),t(68082),t(34023),t(72247),t(40652),t(41420),t(48510),t(75963),t(4547),t(15869),t(74157),t(28061),t(99789),t(40166),t(29923)));var o=i.O()}]);
package/demo/project.json CHANGED
@@ -1 +1 @@
1
- {"generatedAt":1784913674146,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"pnpm","version":"8.15.9"},"typescriptOptions":{"check":false,"checkOptions":{},"reactDocgen":false,"reactDocgenTypescriptOptions":{"shouldExtractLiteralValuesFromEnum":true,"compilerOptions":{"allowSyntheticDefaultImports":false,"esModuleInterop":false}}},"features":{"fastRefresh":true,"storyStoreV7":true},"language":"javascript","storybookPackages":{},"framework":{"options":{"fastRefresh":true,"strictMode":true,"legacyRootApi":true}},"addons":{"@storybook/addon-docs":{"options":{"sourceLoaderOptions":{"injectStoryParameters":false}},"version":"6.5.16"},"@storybook/addon-essentials":{"options":{"docs":false},"version":"6.5.16"},"@storybook/addon-storysource":{"version":"6.5.16"},"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-events":{"version":"6.2.9"},"@storybook/addon-interactions":{"version":"6.5.16"},"@storybook/addon-a11y":{"version":"6.5.16"},"storybook-addon-turbo-build":{"options":{"optimizationLevel":2,"esbuildMinifyOptions":{"target":"es2022"}},"version":"1.1.0"}}}
1
+ {"generatedAt":1784919464096,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"pnpm","version":"8.15.9"},"typescriptOptions":{"check":false,"checkOptions":{},"reactDocgen":false,"reactDocgenTypescriptOptions":{"shouldExtractLiteralValuesFromEnum":true,"compilerOptions":{"allowSyntheticDefaultImports":false,"esModuleInterop":false}}},"features":{"fastRefresh":true,"storyStoreV7":true},"language":"javascript","storybookPackages":{},"framework":{"options":{"fastRefresh":true,"strictMode":true,"legacyRootApi":true}},"addons":{"@storybook/addon-docs":{"options":{"sourceLoaderOptions":{"injectStoryParameters":false}},"version":"6.5.16"},"@storybook/addon-essentials":{"options":{"docs":false},"version":"6.5.16"},"@storybook/addon-storysource":{"version":"6.5.16"},"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-events":{"version":"6.2.9"},"@storybook/addon-interactions":{"version":"6.5.16"},"@storybook/addon-a11y":{"version":"6.5.16"},"storybook-addon-turbo-build":{"options":{"optimizationLevel":2,"esbuildMinifyOptions":{"target":"es2022"}},"version":"1.1.0"}}}
@@ -49,6 +49,7 @@ var import_ssf_host2 = require("./ssf-host.js");
49
49
  var import_webpack_public_path = require("./webpack-public-path.js");
50
50
  const DEFAULT_CONTAINER_ID = "app-container";
51
51
  const MODULE_SCRIPTING_OBJECT_TIMEOUT_MS = 2e3;
52
+ const SSF_CONNECT_TIMEOUT_MS = 1e3;
52
53
  const isCrossDomain = () => {
53
54
  try {
54
55
  window.parent.document;
@@ -311,22 +312,31 @@ class CMicroAppGuest {
311
312
  }
312
313
  return value;
313
314
  }
314
- async findHost() {
315
- let host = null;
316
- if (!isCrossDomain()) {
317
- host = window.parent?.emui?.MicroAppHost ?? null;
318
- }
319
- if (!host && this.#useV2Guest) {
320
- host = new import_ssf_guest.SSFGuest({ appLogger: this.logger });
321
- if (await (0, import_helpers.abortPromise)({
322
- promise: host.connect(),
323
- delay: 1e3,
324
- retValue: false
325
- })) {
326
- host = null;
327
- } else this.#communicationMethod = "ssf" /* SSF */;
315
+ #getLegacyParentHost() {
316
+ if (isCrossDomain()) return null;
317
+ return window.parent?.emui?.MicroAppHost ?? null;
318
+ }
319
+ async #tryConnectSSFGuest() {
320
+ const ssfGuest = new import_ssf_guest.SSFGuest({ appLogger: this.logger });
321
+ try {
322
+ const failed = await (0, import_helpers.abortPromise)({
323
+ promise: ssfGuest.connect(),
324
+ delay: SSF_CONNECT_TIMEOUT_MS,
325
+ retValue: true
326
+ });
327
+ if (!failed) {
328
+ this.#communicationMethod = "ssf" /* SSF */;
329
+ return ssfGuest;
330
+ }
331
+ } catch {
328
332
  }
329
- return host;
333
+ return null;
334
+ }
335
+ async findHost() {
336
+ const legacyHost = this.#getLegacyParentHost();
337
+ if (legacyHost) return legacyHost;
338
+ if (!this.#useV2Guest) return null;
339
+ return this.#tryConnectSSFGuest();
330
340
  }
331
341
  get uuid() {
332
342
  return this.#uuid;
@@ -362,23 +372,10 @@ class CMicroAppGuest {
362
372
  if (window.emui?.__host) {
363
373
  return window.emui.__host;
364
374
  }
365
- if (!isCrossDomain()) {
366
- const legacyHost = window.parent?.emui?.MicroAppHost ?? null;
367
- if (legacyHost) return legacyHost;
368
- }
369
- if (this.#useV2Guest) {
370
- const ssfGuest = new import_ssf_guest.SSFGuest({ appLogger: this.logger });
371
- const failed = await (0, import_helpers.abortPromise)({
372
- promise: ssfGuest.connect(),
373
- delay: 1e3,
374
- retValue: true
375
- });
376
- if (!failed) {
377
- this.#communicationMethod = "ssf" /* SSF */;
378
- return ssfGuest;
379
- }
380
- }
381
- return null;
375
+ const legacyHost = this.#getLegacyParentHost();
376
+ if (legacyHost) return legacyHost;
377
+ if (!this.#useV2Guest) return null;
378
+ return this.#tryConnectSSFGuest();
382
379
  }
383
380
  #exposeGetHost() {
384
381
  window.emui = window.emui || {};
@@ -457,10 +454,16 @@ class CMicroAppGuest {
457
454
  */
458
455
  #bindModuleUnmountListener() {
459
456
  if (this.#moduleUnmountSubToken || !this.props.host) return;
460
- this.#moduleUnmountSubToken = this.subscribe({
461
- eventId: MODULE_UNMOUNT_EVENT_ID,
462
- callback: this.#handleModuleUnmount
463
- });
457
+ try {
458
+ this.#moduleUnmountSubToken = this.subscribe({
459
+ eventId: MODULE_UNMOUNT_EVENT_ID,
460
+ callback: this.#handleModuleUnmount
461
+ });
462
+ } catch {
463
+ this.logger.warn(
464
+ "Unable to subscribe to module.unmount from host \u2014 continuing without host teardown listener"
465
+ );
466
+ }
464
467
  }
465
468
  #unbindModuleUnmountListener() {
466
469
  if (!this.#moduleUnmountSubToken) return;
@@ -16,6 +16,7 @@ import { getSSFHost, setSSFHost } from "./ssf-host.js";
16
16
  import { syncWebpackPublicPathFromAssetPath } from "./webpack-public-path.js";
17
17
  const DEFAULT_CONTAINER_ID = "app-container";
18
18
  const MODULE_SCRIPTING_OBJECT_TIMEOUT_MS = 2e3;
19
+ const SSF_CONNECT_TIMEOUT_MS = 1e3;
19
20
  const isCrossDomain = () => {
20
21
  try {
21
22
  window.parent.document;
@@ -278,22 +279,31 @@ class CMicroAppGuest {
278
279
  }
279
280
  return value;
280
281
  }
281
- async findHost() {
282
- let host = null;
283
- if (!isCrossDomain()) {
284
- host = window.parent?.emui?.MicroAppHost ?? null;
285
- }
286
- if (!host && this.#useV2Guest) {
287
- host = new SSFGuest({ appLogger: this.logger });
288
- if (await abortPromise({
289
- promise: host.connect(),
290
- delay: 1e3,
291
- retValue: false
292
- })) {
293
- host = null;
294
- } else this.#communicationMethod = "ssf" /* SSF */;
282
+ #getLegacyParentHost() {
283
+ if (isCrossDomain()) return null;
284
+ return window.parent?.emui?.MicroAppHost ?? null;
285
+ }
286
+ async #tryConnectSSFGuest() {
287
+ const ssfGuest = new SSFGuest({ appLogger: this.logger });
288
+ try {
289
+ const failed = await abortPromise({
290
+ promise: ssfGuest.connect(),
291
+ delay: SSF_CONNECT_TIMEOUT_MS,
292
+ retValue: true
293
+ });
294
+ if (!failed) {
295
+ this.#communicationMethod = "ssf" /* SSF */;
296
+ return ssfGuest;
297
+ }
298
+ } catch {
295
299
  }
296
- return host;
300
+ return null;
301
+ }
302
+ async findHost() {
303
+ const legacyHost = this.#getLegacyParentHost();
304
+ if (legacyHost) return legacyHost;
305
+ if (!this.#useV2Guest) return null;
306
+ return this.#tryConnectSSFGuest();
297
307
  }
298
308
  get uuid() {
299
309
  return this.#uuid;
@@ -329,23 +339,10 @@ class CMicroAppGuest {
329
339
  if (window.emui?.__host) {
330
340
  return window.emui.__host;
331
341
  }
332
- if (!isCrossDomain()) {
333
- const legacyHost = window.parent?.emui?.MicroAppHost ?? null;
334
- if (legacyHost) return legacyHost;
335
- }
336
- if (this.#useV2Guest) {
337
- const ssfGuest = new SSFGuest({ appLogger: this.logger });
338
- const failed = await abortPromise({
339
- promise: ssfGuest.connect(),
340
- delay: 1e3,
341
- retValue: true
342
- });
343
- if (!failed) {
344
- this.#communicationMethod = "ssf" /* SSF */;
345
- return ssfGuest;
346
- }
347
- }
348
- return null;
342
+ const legacyHost = this.#getLegacyParentHost();
343
+ if (legacyHost) return legacyHost;
344
+ if (!this.#useV2Guest) return null;
345
+ return this.#tryConnectSSFGuest();
349
346
  }
350
347
  #exposeGetHost() {
351
348
  window.emui = window.emui || {};
@@ -424,10 +421,16 @@ class CMicroAppGuest {
424
421
  */
425
422
  #bindModuleUnmountListener() {
426
423
  if (this.#moduleUnmountSubToken || !this.props.host) return;
427
- this.#moduleUnmountSubToken = this.subscribe({
428
- eventId: MODULE_UNMOUNT_EVENT_ID,
429
- callback: this.#handleModuleUnmount
430
- });
424
+ try {
425
+ this.#moduleUnmountSubToken = this.subscribe({
426
+ eventId: MODULE_UNMOUNT_EVENT_ID,
427
+ callback: this.#handleModuleUnmount
428
+ });
429
+ } catch {
430
+ this.logger.warn(
431
+ "Unable to subscribe to module.unmount from host \u2014 continuing without host teardown listener"
432
+ );
433
+ }
431
434
  }
432
435
  #unbindModuleUnmountListener() {
433
436
  if (!this.#moduleUnmountSubToken) return;