@lumiapassport/ui-kit 1.3.0 → 1.3.2

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/index.cjs CHANGED
@@ -2365,6 +2365,7 @@ var init_iframe_manager = __esm({
2365
2365
  this.iframeUrl = config.iframeUrl;
2366
2366
  this.projectId = config.projectId;
2367
2367
  this.debug = config.debug || false;
2368
+ this.onWalletReadyCallback = config.onWalletReady;
2368
2369
  this.readyPromise = new Promise((resolve) => {
2369
2370
  this.readyResolve = resolve;
2370
2371
  });
@@ -2428,6 +2429,7 @@ var init_iframe_manager = __esm({
2428
2429
  }
2429
2430
  const validIframeTypes = [
2430
2431
  "LUMIA_PASSPORT_IFRAME_READY",
2432
+ "LUMIA_PASSPORT_WALLET_READY",
2431
2433
  "LUMIA_PASSPORT_SHOW_IFRAME",
2432
2434
  "LUMIA_PASSPORT_HIDE_IFRAME",
2433
2435
  "LUMIA_PASSPORT_SDK_AUTH_SUCCESS",
@@ -2448,7 +2450,7 @@ var init_iframe_manager = __esm({
2448
2450
  }
2449
2451
  const iframeOrigin = new URL(this.iframeUrl).origin;
2450
2452
  if (event.origin !== iframeOrigin) {
2451
- this.log("[IframeManager] \u26A0\uFE0F Ignored message from invalid origin:", event.origin, "expected:", iframeOrigin);
2453
+ this.log("[IframeManager] \u26A0\uFE0F Ignored message from invalid origin:", { received: event.origin, expected: iframeOrigin });
2452
2454
  return;
2453
2455
  }
2454
2456
  if (message.type === "LUMIA_PASSPORT_IFRAME_READY") {
@@ -2457,6 +2459,13 @@ var init_iframe_manager = __esm({
2457
2459
  this.readyResolve();
2458
2460
  return;
2459
2461
  }
2462
+ if (message.type === "LUMIA_PASSPORT_WALLET_READY") {
2463
+ this.log("[IframeManager] \u{1F4E8} Received LUMIA_PASSPORT_WALLET_READY", message.data);
2464
+ if (this.onWalletReadyCallback) {
2465
+ this.onWalletReadyCallback(message.data);
2466
+ }
2467
+ return;
2468
+ }
2460
2469
  if (message.type === "LUMIA_PASSPORT_SHOW_IFRAME") {
2461
2470
  this.log("[IframeManager] \u{1F4E8} Received LUMIA_PASSPORT_SHOW_IFRAME");
2462
2471
  this.showIframe();
@@ -3087,7 +3096,8 @@ var LumiaPassportProvider = ({
3087
3096
  const iframeManager = getIframeManager({
3088
3097
  iframeUrl,
3089
3098
  projectId: projectId2,
3090
- debug: config.features?.mpcSecurity ?? true
3099
+ debug: config.features?.mpcSecurity ?? true,
3100
+ onWalletReady: callbacks?.onWalletReady
3091
3101
  });
3092
3102
  iframeManager.initialize().then(() => {
3093
3103
  console.log("[LumiaPassport] \u2705 Secure iframe wallet initialized successfully");