@pooflabs/web 0.0.54 → 0.0.56

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.
@@ -13066,7 +13066,7 @@ async function loadDependencies() {
13066
13066
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
13067
13067
  import('react'),
13068
13068
  import('react-dom/client'),
13069
- import('./index-6J8FcENr.esm.js')
13069
+ import('./index-Dy385TfE.esm.js')
13070
13070
  ]);
13071
13071
  // Extract default export from ESM module namespace
13072
13072
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -13176,6 +13176,11 @@ class PhantomWalletProvider {
13176
13176
  existingProviders.forEach(el => el.remove());
13177
13177
  this.containerElement = document.createElement('div');
13178
13178
  this.containerElement.setAttribute('data-phantom-provider', 'true');
13179
+ // Keep the provider root above host app overlays/modals and clickable.
13180
+ this.containerElement.style.position = 'fixed';
13181
+ this.containerElement.style.inset = '0';
13182
+ this.containerElement.style.zIndex = '2147483647';
13183
+ this.containerElement.style.pointerEvents = 'auto';
13179
13184
  document.body.appendChild(this.containerElement);
13180
13185
  const that = this;
13181
13186
  const { PhantomProvider: ReactPhantomProvider, usePhantom, useConnect, useDisconnect, useModal, useSolana, useDiscoveredWallets, AddressType, darkTheme, lightTheme } = phantomReactSdk;
@@ -13200,6 +13205,8 @@ class PhantomWalletProvider {
13200
13205
  const showDeeplink = isMobile && sdkProviders.includes('deeplink') && !hasPhantomInjected;
13201
13206
  // Track previous modal state to detect closes
13202
13207
  const prevModalOpen = React$1.useRef(false);
13208
+ // Track when modal was closed because user selected a wallet (not dismissed)
13209
+ const walletClickedRef = React$1.useRef(false);
13203
13210
  // Set up effect to expose methods to the class
13204
13211
  React$1.useEffect(() => {
13205
13212
  if (phantom) {
@@ -13307,9 +13314,12 @@ class PhantomWalletProvider {
13307
13314
  React$1.useEffect(() => {
13308
13315
  // Detect when modal was open and is now closed
13309
13316
  if (prevModalOpen.current && !showWalletModal && !modal.isOpened) {
13310
- // Modal just closed
13311
- if (that.loginInProgress && that.pendingLogin && !(phantom === null || phantom === void 0 ? void 0 : phantom.isConnected)) {
13312
- // User closed modal without connecting
13317
+ if (walletClickedRef.current) {
13318
+ // Modal closed because user selected a wallet don't reject
13319
+ walletClickedRef.current = false;
13320
+ }
13321
+ else if (that.loginInProgress && that.pendingLogin && !(phantom === null || phantom === void 0 ? void 0 : phantom.isConnected)) {
13322
+ // User dismissed modal without connecting
13313
13323
  that.pendingLogin.reject(new Error('User cancelled login'));
13314
13324
  that.pendingLogin = null;
13315
13325
  that.loginInProgress = false;
@@ -13317,6 +13327,28 @@ class PhantomWalletProvider {
13317
13327
  }
13318
13328
  prevModalOpen.current = showWalletModal || modal.isOpened;
13319
13329
  }, [showWalletModal, modal.isOpened, phantom === null || phantom === void 0 ? void 0 : phantom.isConnected]);
13330
+ // While custom modal is open, block pointer events on everything behind it.
13331
+ // This guarantees host app modals (e.g. z-50 stacks) can't steal clicks.
13332
+ React$1.useEffect(() => {
13333
+ if (!showWalletModal)
13334
+ return;
13335
+ const container = that.containerElement;
13336
+ if (!container || typeof document === 'undefined')
13337
+ return;
13338
+ const restored = new Map();
13339
+ const bodyChildren = Array.from(document.body.children);
13340
+ for (const el of bodyChildren) {
13341
+ if (el === container)
13342
+ continue;
13343
+ restored.set(el, el.style.pointerEvents);
13344
+ el.style.pointerEvents = 'none';
13345
+ }
13346
+ return () => {
13347
+ for (const [el, prev] of restored.entries()) {
13348
+ el.style.pointerEvents = prev;
13349
+ }
13350
+ };
13351
+ }, [showWalletModal]);
13320
13352
  // Handle connection errors
13321
13353
  React$1.useEffect(() => {
13322
13354
  if (connectError && that.pendingLogin) {
@@ -13398,6 +13430,7 @@ class PhantomWalletProvider {
13398
13430
  }, [phantom === null || phantom === void 0 ? void 0 : phantom.isConnected, phantom === null || phantom === void 0 ? void 0 : phantom.addresses, solana, solana === null || solana === void 0 ? void 0 : solana.connected, solanaHook.isAvailable]);
13399
13431
  // --- Custom wallet modal handlers ---
13400
13432
  const handleWalletClick = async (options) => {
13433
+ walletClickedRef.current = true;
13401
13434
  setShowWalletModal(false);
13402
13435
  try {
13403
13436
  if (options === null || options === void 0 ? void 0 : options.walletId) {
@@ -13416,6 +13449,7 @@ class PhantomWalletProvider {
13416
13449
  };
13417
13450
  const handleEmailClick = async () => {
13418
13451
  that.loginInProgress = false;
13452
+ walletClickedRef.current = true;
13419
13453
  setShowWalletModal(false);
13420
13454
  if (that.onSwitchToPrivy) {
13421
13455
  try {
@@ -13545,12 +13579,19 @@ class PhantomWalletProvider {
13545
13579
  display: 'flex',
13546
13580
  alignItems: 'center',
13547
13581
  justifyContent: 'center',
13548
- zIndex: '10000',
13582
+ zIndex: 2147483647,
13583
+ pointerEvents: 'auto',
13549
13584
  },
13550
13585
  onClick: (e) => {
13551
13586
  if (e.target === e.currentTarget)
13552
13587
  handleCloseModal();
13553
13588
  },
13589
+ onMouseDown: (e) => {
13590
+ e.stopPropagation();
13591
+ },
13592
+ onPointerDown: (e) => {
13593
+ e.stopPropagation();
13594
+ },
13554
13595
  },
13555
13596
  // Card
13556
13597
  React$1.createElement('div', {
@@ -13562,6 +13603,13 @@ class PhantomWalletProvider {
13562
13603
  padding: '24px',
13563
13604
  position: 'relative',
13564
13605
  boxShadow: '0 20px 60px rgba(0,0,0,0.3)',
13606
+ pointerEvents: 'auto',
13607
+ },
13608
+ onMouseDown: (e) => {
13609
+ e.stopPropagation();
13610
+ },
13611
+ onPointerDown: (e) => {
13612
+ e.stopPropagation();
13565
13613
  },
13566
13614
  },
13567
13615
  // Close button (X)
@@ -34608,4 +34656,4 @@ async function getIdToken() {
34608
34656
  }
34609
34657
 
34610
34658
  export { useAuth as A, getIdToken as B, PrivyWalletProvider as C, DEFAULT_TEST_ADDRESS as D, EventEmitter4 as E, buildSetDocumentsTransaction as F, clearCache as G, closeAllSubscriptions as H, convertRemainingAccounts as I, createSessionWithPrivy as J, createSessionWithSignature as K, genAuthNonce as L, MockAuthProvider as M, genSolanaMessage as N, OffchainAuthProvider as O, PhantomWalletProvider as P, getCachedData as Q, reconnectWithNewAuth as R, ServerSessionManager as S, refreshSession as T, signSessionCreateMessage as U, WebSessionManager as W, bs58 as a, bufferExports as b, commonjsRequire as c, onAuthLoadingChanged as d, getAuthLoading as e, logout as f, getCurrentUser as g, getConfig as h, init as i, getAuthProvider as j, get$2 as k, login as l, setMany as m, setFile as n, onAuthStateChanged as o, getFiles as p, runQuery as q, require$$0$1 as r, set$1 as s, runQueryMany as t, runExpression as u, runExpressionMany as v, signMessage as w, signTransaction as x, signAndSubmitTransaction as y, subscribe as z };
34611
- //# sourceMappingURL=index-cTlu_QF0.esm.js.map
34659
+ //# sourceMappingURL=index-RoZR68Bd.esm.js.map