@getpara/react-sdk-lite 2.11.0 → 2.13.0

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 (311) hide show
  1. package/dist/css/modal.css +0 -3
  2. package/dist/index.d.ts +1 -0
  3. package/dist/modal/ParaModal.js +57 -98
  4. package/dist/modal/components/Body/Body.d.ts +1 -2
  5. package/dist/modal/components/Body/Body.js +119 -231
  6. package/dist/modal/components/Controls/ChainSelect.js +3 -4
  7. package/dist/modal/components/Controls/Controls.js +2 -4
  8. package/dist/modal/components/Footer/Footer.js +3 -12
  9. package/dist/modal/components/Header/Header.js +13 -14
  10. package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
  11. package/dist/modal/components/Header/hooks/useStepTitle.js +88 -71
  12. package/dist/modal/components/ModalContent/ModalContent.d.ts +1 -1
  13. package/dist/modal/components/ModalContent/ModalContent.js +6 -14
  14. package/dist/modal/components/OnRampComponents/AddingFunds.js +2 -2
  15. package/dist/modal/components/WalletCard/WalletCard.js +9 -9
  16. package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +13 -18
  17. package/dist/modal/components/common.d.ts +5 -0
  18. package/dist/modal/components/common.js +17 -10
  19. package/dist/modal/components/{Account → flows/account/Account}/Account.js +30 -27
  20. package/dist/modal/components/{Account/AccountHeader.d.ts → flows/account/Account/Header.d.ts} +1 -1
  21. package/dist/modal/components/{Account/AccountHeader.js → flows/account/Account/Header.js} +8 -8
  22. package/dist/modal/components/{Account/AccountWalletSelect.d.ts → flows/account/Account/WalletSelect.d.ts} +1 -1
  23. package/dist/modal/components/{Account/AccountWalletSelect.js → flows/account/Account/WalletSelect.js} +17 -22
  24. package/dist/modal/components/flows/account/AccountFlow/AccountFlow.d.ts +12 -0
  25. package/dist/modal/components/flows/account/AccountFlow/AccountFlow.js +126 -0
  26. package/dist/modal/components/flows/account/AccountProvider/AccountContext.d.ts +11 -0
  27. package/dist/modal/components/flows/account/AccountProvider/AccountContext.js +42 -0
  28. package/dist/modal/components/flows/account/AccountProvider/AccountProvider.d.ts +4 -0
  29. package/dist/modal/components/flows/account/AccountProvider/AccountProvider.js +110 -0
  30. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.js +12 -12
  31. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.js +3 -3
  32. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.js +7 -8
  33. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.d.ts +1 -1
  34. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.js +11 -11
  35. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.js +8 -9
  36. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.js +2 -2
  37. package/dist/modal/components/flows/account/AddFunds/AddFundsProvider.d.ts +1 -0
  38. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsProvider.js +13 -12
  39. package/dist/modal/components/flows/account/AddFunds/AddFundsReceive.d.ts +1 -0
  40. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsReceive.js +10 -10
  41. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.js +10 -10
  42. package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.js +1 -1
  43. package/dist/modal/components/flows/account/AddFunds/utils.d.ts +3 -0
  44. package/dist/modal/components/flows/account/AddFunds/utils.js +16 -0
  45. package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.js +7 -10
  46. package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.js +1 -1
  47. package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.js +13 -13
  48. package/dist/modal/components/flows/account/Profile/FarcasterLink.d.ts +2 -0
  49. package/dist/modal/components/{OAuth → flows/account/Profile}/FarcasterLink.js +6 -6
  50. package/dist/modal/components/{Account/AccountProfile.d.ts → flows/account/Profile/Profile.d.ts} +1 -1
  51. package/dist/modal/components/{Account/AccountProfile.js → flows/account/Profile/Profile.js} +20 -24
  52. package/dist/modal/components/{Account/AccountProfileEntry.js → flows/account/Profile/ProfileEntry.js} +13 -15
  53. package/dist/modal/components/flows/account/Profile/ProfileLink.d.ts +1 -0
  54. package/dist/modal/components/{Account/AccountProfileLink.js → flows/account/Profile/ProfileLink.js} +19 -34
  55. package/dist/modal/components/flows/account/Profile/ProfileLinkOptions.d.ts +1 -0
  56. package/dist/modal/components/{Account/AccountProfileLinkOptions.js → flows/account/Profile/ProfileLinkOptions.js} +11 -11
  57. package/dist/modal/components/flows/account/Profile/ProfileUnlink.d.ts +1 -0
  58. package/dist/modal/components/{Account/AccountProfileUnlink.js → flows/account/Profile/ProfileUnlink.js} +6 -6
  59. package/dist/modal/{hooks/useTelegramLogin.d.ts → components/flows/account/Profile/useTelegramLink.d.ts} +1 -5
  60. package/dist/modal/{hooks/useTelegramLogin.js → components/flows/account/Profile/useTelegramLink.js} +16 -23
  61. package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.js +1 -1
  62. package/dist/modal/components/flows/account/Send/SendAsset.d.ts +1 -0
  63. package/dist/modal/components/{Account/AccountSend/AccountSendAsset.js → flows/account/Send/SendAsset.js} +11 -12
  64. package/dist/modal/components/flows/account/Send/SendForm.d.ts +1 -0
  65. package/dist/modal/components/{Account/AccountSend/AccountSendForm.js → flows/account/Send/SendForm.js} +15 -16
  66. package/dist/modal/components/flows/account/Send/SendNetwork.d.ts +1 -0
  67. package/dist/modal/components/{Account/AccountSend/AccountSendNetwork.js → flows/account/Send/SendNetwork.js} +9 -10
  68. package/dist/modal/components/flows/account/Send/SendNoAssets.d.ts +1 -0
  69. package/dist/modal/components/{Account/AccountSend/AccountSendNoAssets.js → flows/account/Send/SendNoAssets.js} +8 -9
  70. package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.js +19 -6
  71. package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.js +11 -11
  72. package/dist/modal/components/flows/account/SwitchWallets/SwitchWallets.d.ts +1 -0
  73. package/dist/modal/components/{SwitchWalletsStep/SwitchWalletsStep.js → flows/account/SwitchWallets/SwitchWallets.js} +4 -4
  74. package/dist/modal/components/flows/account/Wallet/Wallet.d.ts +1 -0
  75. package/dist/modal/components/{Account/AccountWallet.js → flows/account/Wallet/Wallet.js} +12 -18
  76. package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.d.ts +10 -0
  77. package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.js +94 -0
  78. package/dist/modal/components/flows/auth/AuthMain/AuthMain.d.ts +9 -0
  79. package/dist/modal/components/{AuthMainStep/AuthMainStep.js → flows/auth/AuthMain/AuthMain.js} +10 -21
  80. package/dist/modal/components/flows/auth/AuthMain/AuthMainContent.d.ts +9 -0
  81. package/dist/modal/components/{AuthMainStep/AuthMainStepContent.js → flows/auth/AuthMain/AuthMainContent.js} +49 -24
  82. package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.d.ts +1 -0
  83. package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.js +31 -0
  84. package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.d.ts +1 -0
  85. package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.js +21 -0
  86. package/dist/modal/components/flows/auth/AwaitingOAuth/AwaitingOAuth.d.ts +1 -0
  87. package/dist/modal/components/{AwaitingOAuthStep/AwaitingOAuthStep.js → flows/auth/AwaitingOAuth/AwaitingOAuth.js} +4 -4
  88. package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.d.ts +1 -0
  89. package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.js +22 -0
  90. package/dist/modal/components/flows/auth/BiometricCreation/BiometricCreation.d.ts +1 -0
  91. package/dist/modal/components/{BiometricCreationStep/BiometricCreationStep.js → flows/auth/BiometricCreation/BiometricCreation.js} +25 -22
  92. package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.d.ts +1 -0
  93. package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.js +72 -0
  94. package/dist/modal/components/flows/auth/LoginDone/LoginDone.d.ts +5 -0
  95. package/dist/modal/components/{LoginDoneStep/LoginDoneStep.js → flows/auth/LoginDone/LoginDone.js} +9 -13
  96. package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.js +15 -23
  97. package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.js +9 -11
  98. package/dist/modal/components/flows/auth/Setup2FA/Setup2FA.d.ts +5 -0
  99. package/dist/modal/components/{Setup2FAStep/Setup2FAStep.js → flows/auth/Setup2FA/Setup2FA.js} +42 -19
  100. package/dist/modal/components/flows/auth/Verification/Verification.d.ts +1 -0
  101. package/dist/modal/components/flows/auth/Verification/Verification.js +36 -0
  102. package/dist/modal/components/flows/auth/WalletCreationDone/WalletCreationDone.d.ts +6 -0
  103. package/dist/modal/components/{WalletCreationDoneStep/WalletCreationDoneStep.js → flows/auth/WalletCreationDone/WalletCreationDone.js} +19 -46
  104. package/dist/modal/components/{AuthOptions → shared}/AuthOptions.d.ts +2 -2
  105. package/dist/modal/components/{AuthOptions → shared}/AuthOptions.js +18 -15
  106. package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.d.ts → shared/ConnectExternalWallet/ConnectExternalWallet.d.ts} +1 -1
  107. package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.js → shared/ConnectExternalWallet/ConnectExternalWallet.js} +17 -37
  108. package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.js +1 -1
  109. package/dist/modal/components/{AuthInput/AuthInput.d.ts → shared/EmailOrPhone/EmailOrPhoneInput.d.ts} +4 -4
  110. package/dist/modal/components/{AuthInput/AuthInput.js → shared/EmailOrPhone/EmailOrPhoneInput.js} +14 -10
  111. package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.js +1 -1
  112. package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts → shared/ExternalWalletNetworkSelect.d.ts} +1 -1
  113. package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js → shared/ExternalWalletNetworkSelect.js} +9 -9
  114. package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.js +17 -12
  115. package/dist/modal/components/shared/IFrame.d.ts +1 -0
  116. package/dist/modal/components/shared/IFrame.js +87 -0
  117. package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.d.ts → shared/VerificationCode.d.ts} +3 -4
  118. package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.js → shared/VerificationCode.js} +4 -28
  119. package/dist/modal/components/shared/VerifyExternalWallet.d.ts +1 -0
  120. package/dist/modal/components/{ExternalWalletVerificationStep/ExternalWalletVerificationStep.js → shared/VerifyExternalWallet.js} +10 -17
  121. package/dist/modal/hooks/index.d.ts +1 -2
  122. package/dist/modal/hooks/index.js +1 -2
  123. package/dist/modal/hooks/useAuthView.d.ts +4 -0
  124. package/dist/modal/hooks/useAuthView.js +115 -0
  125. package/dist/modal/hooks/useCanbGoBack.d.ts +3 -0
  126. package/dist/modal/hooks/useCanbGoBack.js +47 -0
  127. package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.d.ts +1 -1
  128. package/dist/modal/hooks/useDropdownPosition.js +41 -0
  129. package/dist/modal/hooks/useGoBack.d.ts +4 -1
  130. package/dist/modal/hooks/useGoBack.js +60 -36
  131. package/dist/modal/hooks/useSendMutations.js +4 -5
  132. package/dist/modal/hooks/useTransactionMonitoring.js +8 -8
  133. package/dist/modal/index.d.ts +1 -2
  134. package/dist/modal/index.js +1 -3
  135. package/dist/modal/stores/index.d.ts +0 -1
  136. package/dist/modal/stores/index.js +0 -1
  137. package/dist/modal/types/modalProps.d.ts +18 -8
  138. package/dist/provider/ParaProviderMin.js +34 -38
  139. package/dist/provider/actions/getWallet.d.ts +1 -1
  140. package/dist/provider/actions/index.d.ts +43 -49
  141. package/dist/provider/actions/index.js +4 -0
  142. package/dist/provider/components/CosmosWalletWrapper.js +0 -3
  143. package/dist/provider/components/EvmWalletWrapper.js +0 -3
  144. package/dist/provider/components/ExternalWalletWrapper.js +8 -2
  145. package/dist/provider/hooks/mutations/index.d.ts +2 -0
  146. package/dist/provider/hooks/mutations/index.js +4 -0
  147. package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +7 -12
  148. package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
  149. package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +28 -0
  150. package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
  151. package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +28 -0
  152. package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +7 -13
  153. package/dist/provider/hooks/mutations/useClaimPregenWallets.js +4 -1
  154. package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +7 -6
  155. package/dist/provider/hooks/mutations/useCreateGuestWallets.js +6 -3
  156. package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +7 -93
  157. package/dist/provider/hooks/mutations/useCreatePregenWallet.js +4 -1
  158. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +7 -15
  159. package/dist/provider/hooks/mutations/useCreateWallet.d.ts +7 -15
  160. package/dist/provider/hooks/mutations/useCreateWallet.js +4 -1
  161. package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +7 -27
  162. package/dist/provider/hooks/mutations/useEnable2fa.d.ts +7 -12
  163. package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +2 -7
  164. package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +7 -13
  165. package/dist/provider/hooks/mutations/useIssueJwt.d.ts +7 -21
  166. package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +6 -7
  167. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +2 -2
  168. package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +7 -25
  169. package/dist/provider/hooks/mutations/useLoginExternalWallet.js +4 -1
  170. package/dist/provider/hooks/mutations/useLogout.d.ts +7 -12
  171. package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +7 -13
  172. package/dist/provider/hooks/mutations/useResendVerificationCode.js +4 -1
  173. package/dist/provider/hooks/mutations/useSetup2fa.d.ts +7 -7
  174. package/dist/provider/hooks/mutations/useSetup2fa.js +2 -2
  175. package/dist/provider/hooks/mutations/useSignMessage.d.ts +7 -31
  176. package/dist/provider/hooks/mutations/useSignTransaction.d.ts +7 -31
  177. package/dist/provider/hooks/mutations/useSignTransaction.js +4 -1
  178. package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +7 -19
  179. package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +4 -1
  180. package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +7 -30
  181. package/dist/provider/hooks/mutations/useSwitchWallets.js +4 -1
  182. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +7 -15
  183. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +4 -1
  184. package/dist/provider/hooks/mutations/useVerify2fa.d.ts +7 -30
  185. package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +7 -19
  186. package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +4 -1
  187. package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +7 -31
  188. package/dist/provider/hooks/mutations/useVerifyFarcaster.js +4 -1
  189. package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +7 -66
  190. package/dist/provider/hooks/mutations/useVerifyNewAccount.js +4 -1
  191. package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +7 -37
  192. package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +7 -22
  193. package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +7 -30
  194. package/dist/provider/hooks/mutations/useWaitForLogin.js +4 -1
  195. package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +7 -18
  196. package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +7 -27
  197. package/dist/provider/hooks/mutations/utils.js +1 -1
  198. package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +4 -1
  199. package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +6 -1
  200. package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +2 -4
  201. package/dist/provider/hooks/queries/useParaStatus.d.ts +0 -1
  202. package/dist/provider/hooks/queries/useParaStatus.js +0 -2
  203. package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
  204. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +1 -1
  205. package/dist/provider/hooks/utils/useEventListeners.js +0 -7
  206. package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +1 -0
  207. package/dist/provider/hooks/utils/useFormattedBiometricHints.js +9 -5
  208. package/dist/provider/hooks/utils/useModal.d.ts +4 -3
  209. package/dist/provider/hooks/utils/useModal.js +17 -9
  210. package/dist/provider/hooks/utils/useWalletState.d.ts +3 -3
  211. package/dist/provider/hooks/utils/useWalletState.js +14 -6
  212. package/dist/provider/providers/AccountLinkProvider.js +21 -19
  213. package/dist/provider/providers/AuthProvider/AuthContext.d.ts +19 -0
  214. package/dist/provider/providers/AuthProvider/AuthContext.js +35 -0
  215. package/dist/provider/providers/AuthProvider/AuthProvider.d.ts +9 -0
  216. package/dist/provider/providers/AuthProvider/AuthProvider.js +261 -0
  217. package/dist/provider/providers/ExternalWalletProvider.d.ts +12 -4
  218. package/dist/provider/providers/ExternalWalletProvider.js +285 -283
  219. package/dist/provider/stores/getters.d.ts +1 -1
  220. package/dist/provider/stores/getters.js +5 -5
  221. package/dist/provider/stores/setters.js +2 -2
  222. package/dist/provider/stores/slices/accountFlow.d.ts +3 -0
  223. package/dist/provider/stores/slices/accountFlow.js +30 -0
  224. package/dist/provider/stores/slices/authFlow.d.ts +3 -0
  225. package/dist/provider/stores/slices/authFlow.js +63 -0
  226. package/dist/provider/stores/slices/externalWallets.js +10 -0
  227. package/dist/provider/stores/slices/index.d.ts +4 -0
  228. package/dist/provider/stores/slices/index.js +4 -0
  229. package/dist/provider/stores/slices/modal.js +8 -2
  230. package/dist/provider/stores/slices/onRamp.d.ts +3 -0
  231. package/dist/provider/stores/slices/onRamp.js +20 -0
  232. package/dist/provider/stores/slices/paraState.d.ts +3 -0
  233. package/dist/provider/stores/slices/paraState.js +9 -0
  234. package/dist/provider/stores/types.d.ts +117 -5
  235. package/dist/provider/stores/types.js +9 -0
  236. package/dist/provider/stores/useStore.d.ts +5 -3
  237. package/dist/provider/stores/useStore.js +15 -8
  238. package/package.json +8 -8
  239. package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
  240. package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
  241. package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
  242. package/dist/modal/components/Account/AccountSend/AccountSendAsset.d.ts +0 -1
  243. package/dist/modal/components/Account/AccountSend/AccountSendForm.d.ts +0 -1
  244. package/dist/modal/components/Account/AccountSend/AccountSendNetwork.d.ts +0 -1
  245. package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.d.ts +0 -1
  246. package/dist/modal/components/Account/AccountWallet.d.ts +0 -1
  247. package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
  248. package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
  249. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  250. package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
  251. package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
  252. package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.d.ts +0 -1
  253. package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +0 -21
  254. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
  255. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  256. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
  257. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
  258. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -21
  259. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
  260. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -24
  261. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
  262. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
  263. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -67
  264. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
  265. package/dist/modal/components/Hero/Hero.d.ts +0 -1
  266. package/dist/modal/components/Hero/Hero.js +0 -118
  267. package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
  268. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -83
  269. package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
  270. package/dist/modal/components/OAuth/FarcasterLink.d.ts +0 -2
  271. package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -1
  272. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -53
  273. package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
  274. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -91
  275. package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
  276. package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.d.ts +0 -1
  277. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
  278. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
  279. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
  280. package/dist/modal/hooks/useFarcasterLogin.d.ts +0 -9
  281. package/dist/modal/hooks/useFarcasterLogin.js +0 -77
  282. package/dist/modal/stores/modal/actions.d.ts +0 -3
  283. package/dist/modal/stores/modal/actions.js +0 -146
  284. package/dist/modal/stores/modal/useModalStore.d.ts +0 -119
  285. package/dist/modal/stores/modal/useModalStore.js +0 -80
  286. package/dist/modal/utils/steps.d.ts +0 -162
  287. package/dist/modal/utils/steps.js +0 -335
  288. package/dist/provider/providers/AuthProvider.d.ts +0 -43
  289. package/dist/provider/providers/AuthProvider.js +0 -777
  290. /package/dist/modal/components/{Account → flows/account/Account}/Account.d.ts +0 -0
  291. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.d.ts +0 -0
  292. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.d.ts +0 -0
  293. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.d.ts +0 -0
  294. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.d.ts +0 -0
  295. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.d.ts +0 -0
  296. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.d.ts +0 -0
  297. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.d.ts +0 -0
  298. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.d.ts +0 -0
  299. /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.js +0 -0
  300. /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.d.ts +0 -0
  301. /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.d.ts +0 -0
  302. /package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.d.ts +0 -0
  303. /package/dist/modal/components/{Account/AccountProfileEntry.d.ts → flows/account/Profile/ProfileEntry.d.ts} +0 -0
  304. /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.d.ts +0 -0
  305. /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.d.ts +0 -0
  306. /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.d.ts +0 -0
  307. /package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.d.ts +0 -0
  308. /package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.d.ts +0 -0
  309. /package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.d.ts +0 -0
  310. /package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.d.ts +0 -0
  311. /package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.d.ts +0 -0
@@ -2,57 +2,27 @@
2
2
  import "../../../chunk-MMUBH76A.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { safeStyled, WarningBanner, BODY_MOTION_VARIANTS, BODY_TRANSITION, MOBILE_SIZE } from "@getpara/react-common";
5
- import { IFrameSteps, ModalStep } from "../../utils/steps.js";
6
- import { VerificationCodeStep } from "../VerificationCodeStep/VerificationCodeStep.js";
7
- import { useModalStore } from "../../stores/index.js";
8
- import { BiometricLoginStep } from "../BiometricLoginStep/BiometricLoginStep.js";
9
- import { Setup2FAStep } from "../Setup2FAStep/Setup2FAStep.js";
10
- import { LoginDoneStep } from "../LoginDoneStep/LoginDoneStep.js";
11
5
  import { EnabledFlow } from "@getpara/web-sdk";
12
- import { AwaitingBiometricsStep } from "../AwaitingBiometricsStep/AwaitingBiometricsStep.js";
13
- import { AwaitingWalletCreationStep } from "../AwaitingWalletCreationStep/AwaitingWalletCreationStep.js";
14
- import { WalletCreationDoneStep } from "../WalletCreationDoneStep/WalletCreationDoneStep.js";
15
- import { RecoverySecretStep } from "../RecoverySecretStep/RecoverySecretStep.js";
16
- import { TwoFactorDoneStep } from "../TwoFactorDoneStep/TwoFactorDoneStep.js";
17
- import { BiometricCreationStep } from "../BiometricCreationStep/BiometricCreationStep.js";
18
- import { AwaitingOAuthStep } from "../AwaitingOAuthStep/AwaitingOAuthStep.js";
19
- import { AddFundsAwaiting, AddFundsDone, AddFunds } from "../AddFunds/index.js";
20
- import { FarcasterOAuthStep } from "../OAuth/FarcasterOAuthStep.js";
21
6
  import { Header } from "../Header/Header.js";
22
- import { AuthMainStep } from "../AuthMainStep/AuthMainStep.js";
23
- import { Account } from "../Account/Account.js";
24
- import { AuthOptions } from "../AuthOptions/AuthOptions.js";
25
- import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
26
- import { ExternalWalletStep } from "../ExternalWalletStep/ExternalWalletStep.js";
27
7
  import { AnimatedHeightWrapper } from "./AnimatedHeightWrapper.js";
28
- import { ChainSwitch } from "../ChainSwitch/ChainSwitch.js";
29
8
  import { motion, AnimatePresence } from "framer-motion";
30
9
  import { Controls } from "../Controls/Controls.js";
31
- import { useEffect } from "react";
32
- import { TelegramOAuthStep } from "../OAuth/TelegramOAuthStep.js";
33
- import { AwaitingPasswordStep } from "../AwaitingPasswordStep/AwaitingPasswordStep.js";
34
- import { IFrameStep } from "../IFrameStep/IFrameStep.js";
10
+ import { memo, useEffect, useMemo, useRef } from "react";
35
11
  import { useStore } from "../../../provider/stores/useStore.js";
36
- import { ExternalWalletVerificationStep } from "../ExternalWalletVerificationStep/ExternalWalletVerificationStep.js";
37
12
  import { NetworkSpeedBanner } from "@getpara/react-common";
38
- import { AccountProfile } from "../Account/AccountProfile.js";
39
- import { AccountProfileLinkOptions } from "../Account/AccountProfileLinkOptions.js";
40
- import { AccountProfileLink } from "../Account/AccountProfileLink.js";
41
- import { AccountProfileUnlink } from "../Account/AccountProfileUnlink.js";
42
- import { ExternalWalletNetworkSelectStep } from "../ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js";
43
- import { AwaitingAccountStep } from "../AwaitingAccountStep/AwaitingAccountStep.js";
44
- import { SwitchWalletsStep } from "../SwitchWalletsStep/SwitchWalletsStep.js";
45
13
  import { Footer } from "../Footer/Footer.js";
46
14
  import { renderTextWithLinks } from "../../utils/renderTextWithLinks.js";
47
- import { AccountWallet } from "../Account/AccountWallet.js";
48
- import { AccountSend } from "../Account/AccountSend/index.js";
49
- import { AccountMonitorTx } from "../Account/AccountMonitorTx.js";
15
+ import { AuthFlow } from "../flows/auth/AuthFlow/AuthFlow.js";
16
+ import { IFrame } from "../shared/IFrame.js";
17
+ import { AccountFlow } from "../flows/account/AccountFlow/AccountFlow.js";
18
+ import { useAuthView } from "../../hooks/useAuthView.js";
19
+ import { useLogout } from "../../../provider/index.js";
50
20
  const MIN_HEIGHT = {
51
- [ModalStep.ADD_FUNDS_AWAITING]: "680px"
21
+ ACCOUNT_ADD_FUNDS_AWAITING: "680px"
52
22
  };
23
+ const MemoizedIFrame = memo(IFrame);
53
24
  const Body = ({
54
25
  oAuthMethods,
55
- twoFactorAuthEnabled,
56
26
  disableEmailLogin,
57
27
  disablePhoneLogin,
58
28
  isGuestModeEnabled = false,
@@ -60,40 +30,89 @@ const Body = ({
60
30
  onDisconnect,
61
31
  isDisconnecting
62
32
  }) => {
63
- const currentStep = useModalStore((state) => state.step);
64
- const stepDirection = useModalStore((state) => state.stepDirection);
65
- const setStepDirection = useModalStore((state) => state.setStepDirection);
66
- const setAccountAddFundTab = useModalStore((state) => state.setAccountAddFundTab);
67
- const modalError = useModalStore((state) => state.modalError);
68
- const setModalError = useModalStore((state) => state.setModalError);
33
+ const { authView } = useAuthView();
34
+ const { logout } = useLogout();
35
+ const accountView = useStore((state) => state.accountView);
36
+ const setAccountAddFundTab = useStore((state) => state.setAccountAddFundTab);
37
+ const modalError = useStore((state) => state.modalError);
38
+ const setModalError = useStore((state) => state.setModalError);
69
39
  const embeddedModal = useStore((state) => {
70
40
  var _a;
71
41
  return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
72
42
  });
73
- const Content = () => {
74
- switch (currentStep) {
75
- case ModalStep.AUTH_MAIN: {
43
+ const paraState = useStore((state) => state.paraState);
44
+ const isUsingIFrame = useStore((state) => !!state.iFrameUrl);
45
+ const showPostAuthFlow = useStore((state) => state.showPostAuthFlow);
46
+ const isNavigatingBack = useStore((state) => state.isNavigatingBack);
47
+ const setIsNavigatingBack = useStore((state) => state.setIsNavigatingBack);
48
+ const screenKey = useMemo(() => {
49
+ if (["ACCOUNT_ADD_FUNDS_BUY", "ACCOUNT_ADD_FUNDS_RECEIVE", "ACCOUNT_ADD_FUNDS_WITHDRAW"].includes(accountView)) {
50
+ return "ACCOUNT_ADD_FUNDS";
51
+ }
52
+ if (["ACCOUNT_SEND", "ACCOUNT_SEND_ASSET", "ACCOUNT_SEND_NETWORK"].includes(accountView)) {
53
+ return "ACCOUNT_SEND";
54
+ }
55
+ return authView || accountView;
56
+ }, [authView, accountView]);
57
+ const prevIsUsingIFrameRef = useRef(isUsingIFrame);
58
+ const prevScreenKeyRef = useRef(screenKey);
59
+ const directionRef = useRef(1);
60
+ if (screenKey !== prevScreenKeyRef.current) {
61
+ const isBackward = (screenKey === "AUTH_MAIN" || screenKey === "ACCOUNT_MAIN") && prevScreenKeyRef.current !== "AUTH_MAIN" && prevScreenKeyRef.current !== "ACCOUNT_MAIN";
62
+ directionRef.current = isBackward ? -1 : 1;
63
+ prevScreenKeyRef.current = screenKey;
64
+ }
65
+ useEffect(() => {
66
+ prevIsUsingIFrameRef.current = isUsingIFrame;
67
+ }, [isUsingIFrame]);
68
+ useEffect(() => {
69
+ if ((paraState == null ? void 0 : paraState.corePhase) === "error") {
70
+ logout();
71
+ }
72
+ }, [paraState == null ? void 0 : paraState.corePhase]);
73
+ const Content = useMemo(() => {
74
+ if (isUsingIFrame || prevIsUsingIFrameRef.current && !isUsingIFrame && isNavigatingBack) {
75
+ return null;
76
+ }
77
+ if (isNavigatingBack) {
78
+ setIsNavigatingBack(false);
79
+ }
80
+ switch (paraState == null ? void 0 : paraState.corePhase) {
81
+ case "error":
82
+ case "auth_flow":
83
+ case "wallet_flow":
84
+ case "logging_out": {
76
85
  return /* @__PURE__ */ jsx(
77
- AuthMainStep,
86
+ AuthFlow,
78
87
  {
79
88
  oAuthMethods,
80
89
  disableEmailLogin,
81
90
  disablePhoneLogin,
82
- isGuestModeEnabled
91
+ isGuestModeEnabled,
92
+ onClose
83
93
  }
84
94
  );
85
95
  }
86
- case ModalStep.EX_WALLET_MORE: {
87
- return /* @__PURE__ */ jsx(ExternalWallets, {});
88
- }
89
- case ModalStep.AWAITING_GUEST_WALLET_CREATION: {
90
- return /* @__PURE__ */ jsx(AwaitingWalletCreationStep, { isGuestMode: true });
91
- }
92
- case ModalStep.AUTH_MORE:
93
- case ModalStep.AUTH_GUEST_SIGNUP: {
96
+ case "authenticated":
97
+ case "guest_mode": {
98
+ if (showPostAuthFlow) {
99
+ return /* @__PURE__ */ jsx(
100
+ AuthFlow,
101
+ {
102
+ oAuthMethods,
103
+ disableEmailLogin,
104
+ disablePhoneLogin,
105
+ isGuestModeEnabled,
106
+ onClose
107
+ }
108
+ );
109
+ }
94
110
  return /* @__PURE__ */ jsx(
95
- AuthOptions,
111
+ AccountFlow,
96
112
  {
113
+ onDisconnect,
114
+ isDisconnecting,
115
+ onClose,
97
116
  oAuthMethods,
98
117
  disableEmailLogin,
99
118
  disablePhoneLogin,
@@ -101,196 +120,65 @@ const Body = ({
101
120
  }
102
121
  );
103
122
  }
104
- case ModalStep.VERIFICATIONS: {
105
- return /* @__PURE__ */ jsx(VerificationCodeStep, {});
106
- }
107
- case ModalStep.EXTERNAL_WALLET_VERIFICATION: {
108
- return /* @__PURE__ */ jsx(ExternalWalletVerificationStep, {});
109
- }
110
- case ModalStep.BIOMETRIC_LOGIN: {
111
- return /* @__PURE__ */ jsx(BiometricLoginStep, {});
112
- }
113
- case ModalStep.SETUP_2FA:
114
- case ModalStep.VERIFY_2FA: {
115
- return /* @__PURE__ */ jsx(Setup2FAStep, { onClose });
116
- }
117
- case ModalStep.LOGIN_DONE: {
118
- return /* @__PURE__ */ jsx(LoginDoneStep, { onClose });
119
- }
120
- case ModalStep.AWAITING_BIOMETRIC_LOGIN:
121
- case ModalStep.AWAITING_BIOMETRIC_CREATION: {
122
- return /* @__PURE__ */ jsx(AwaitingBiometricsStep, {});
123
- }
124
- case ModalStep.AWAITING_PASSWORD_LOGIN:
125
- case ModalStep.AWAITING_PASSWORD_CREATION: {
126
- return /* @__PURE__ */ jsx(AwaitingPasswordStep, {});
127
- }
128
- case ModalStep.AWAITING_WALLET_CREATION: {
129
- return /* @__PURE__ */ jsx(AwaitingWalletCreationStep, {});
130
- }
131
- case ModalStep.WALLET_CREATION_DONE: {
132
- return /* @__PURE__ */ jsx(WalletCreationDoneStep, { twoFactorAuthEnabled, onClose });
133
- }
134
- case ModalStep.SECRET: {
135
- return /* @__PURE__ */ jsx(RecoverySecretStep, {});
136
- }
137
- case ModalStep.TWO_FACTOR_DONE: {
138
- return /* @__PURE__ */ jsx(TwoFactorDoneStep, { onClose });
139
- }
140
- case ModalStep.BIOMETRIC_CREATION: {
141
- return /* @__PURE__ */ jsx(BiometricCreationStep, {});
142
- }
143
- case ModalStep.AWAITING_OAUTH: {
144
- return /* @__PURE__ */ jsx(AwaitingOAuthStep, {});
145
- }
146
- case ModalStep.FARCASTER_OAUTH: {
147
- return /* @__PURE__ */ jsx(FarcasterOAuthStep, {});
148
- }
149
- case ModalStep.TELEGRAM_OAUTH: {
150
- return /* @__PURE__ */ jsx(TelegramOAuthStep, {});
151
- }
152
- case ModalStep.ADD_FUNDS_BUY:
153
- case ModalStep.ADD_FUNDS_RECEIVE:
154
- case ModalStep.ADD_FUNDS_WITHDRAW: {
155
- return /* @__PURE__ */ jsx(AddFunds, { "data-testid": "add-funds" });
156
- }
157
- case ModalStep.ADD_FUNDS_AWAITING: {
158
- return /* @__PURE__ */ jsx(AddFundsAwaiting, {});
159
- }
160
- case ModalStep.ADD_FUNDS_SUCCESS: {
161
- return /* @__PURE__ */ jsx(AddFundsDone, { isSuccess: true, onClose });
162
- }
163
- case ModalStep.ADD_FUNDS_FAILURE: {
164
- return /* @__PURE__ */ jsx(AddFundsDone, { onClose });
165
- }
166
- case ModalStep.ACCOUNT_MAIN: {
167
- return /* @__PURE__ */ jsx(Account, {});
168
- }
169
- case ModalStep.ACCOUNT_PROFILE: {
170
- return /* @__PURE__ */ jsx(AccountProfile, { onDisconnect, isDisconnecting });
171
- }
172
- case ModalStep.ACCOUNT_PROFILE_LIST: {
173
- return /* @__PURE__ */ jsx(AccountProfileLinkOptions, {});
174
- }
175
- case ModalStep.ACCOUNT_PROFILE_ADD: {
176
- return /* @__PURE__ */ jsx(AccountProfileLink, {});
177
- }
178
- case ModalStep.ACCOUNT_PROFILE_REMOVE: {
179
- return /* @__PURE__ */ jsx(AccountProfileUnlink, {});
180
- }
181
- case ModalStep.ACCOUNT_WALLET: {
182
- return /* @__PURE__ */ jsx(AccountWallet, {});
183
- }
184
- case ModalStep.EX_WALLET_SELECTED: {
185
- return /* @__PURE__ */ jsx(ExternalWalletStep, {});
186
- }
187
- case ModalStep.CHAIN_SWITCH: {
188
- return /* @__PURE__ */ jsx(ChainSwitch, {});
189
- }
190
- case ModalStep.EX_WALLET_NETWORK_SELECT: {
191
- return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "CONNECT" });
192
- }
193
- case ModalStep.ADD_EX_WALLET_NETWORK_SELECT: {
194
- return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "ADD_EXTERNAL" });
195
- }
196
- case ModalStep.LINK_EX_WALLET_NETWORK_SELECT: {
197
- return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "ACCOUNT_LINKING" });
198
- }
199
- case ModalStep.ADD_EX_WALLET_MORE: {
200
- return /* @__PURE__ */ jsx(ExternalWallets, { isAddingWallets: true });
201
- }
202
- case ModalStep.ADD_EX_WALLET_SELECTED: {
203
- return /* @__PURE__ */ jsx(ExternalWalletStep, { isAddingWallets: true });
204
- }
205
- case ModalStep.ADD_EX_WALLET_NETWORK_SELECT: {
206
- return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "ADD_EXTERNAL" });
207
- }
208
- case ModalStep.AWAITING_ACCOUNT: {
209
- return /* @__PURE__ */ jsx(AwaitingAccountStep, {});
210
- }
211
- case ModalStep.SWITCH_WALLETS: {
212
- return /* @__PURE__ */ jsx(SwitchWalletsStep, {});
213
- }
214
- case ModalStep.ACCOUNT_SEND: {
215
- return /* @__PURE__ */ jsx(AccountSend, { step: "SEND_FORM" });
216
- }
217
- case ModalStep.ACCOUNT_SEND_ASSET: {
218
- return /* @__PURE__ */ jsx(AccountSend, { step: "SEND_ASSET" });
219
- }
220
- case ModalStep.ACCOUNT_SEND_NETWORK: {
221
- return /* @__PURE__ */ jsx(AccountSend, { step: "SEND_NETWORK" });
222
- }
223
- case ModalStep.ACCOUNT_MONITOR_TX: {
224
- return /* @__PURE__ */ jsx(AccountMonitorTx, {});
225
- }
226
- default: {
227
- if (IFrameSteps.includes(currentStep)) {
228
- return null;
229
- }
230
- }
123
+ default:
124
+ console.warn(`No component found for phase: ${paraState == null ? void 0 : paraState.corePhase}`);
125
+ return null;
231
126
  }
232
- };
127
+ }, [
128
+ isUsingIFrame,
129
+ isNavigatingBack,
130
+ showPostAuthFlow,
131
+ paraState,
132
+ oAuthMethods,
133
+ disableEmailLogin,
134
+ disablePhoneLogin,
135
+ isGuestModeEnabled,
136
+ onClose,
137
+ onDisconnect,
138
+ isDisconnecting
139
+ ]);
233
140
  useEffect(() => {
234
- switch (currentStep) {
235
- case ModalStep.ADD_FUNDS_BUY:
141
+ switch (accountView) {
142
+ case "ACCOUNT_ADD_FUNDS_BUY":
236
143
  setAccountAddFundTab(EnabledFlow.BUY);
237
144
  break;
238
- case ModalStep.ADD_FUNDS_RECEIVE:
145
+ case "ACCOUNT_ADD_FUNDS_RECEIVE":
239
146
  setAccountAddFundTab(EnabledFlow.RECEIVE);
240
147
  break;
241
- case ModalStep.ADD_FUNDS_WITHDRAW:
148
+ case "ACCOUNT_ADD_FUNDS_WITHDRAW":
242
149
  setAccountAddFundTab(EnabledFlow.WITHDRAW);
243
150
  break;
244
151
  default:
245
152
  break;
246
153
  }
247
- }, [currentStep]);
154
+ }, [accountView]);
248
155
  return /* @__PURE__ */ jsxs(Container, { slot: "body", "data-testid": "modal-content", children: [
249
156
  !embeddedModal && /* @__PURE__ */ jsxs(Fragment, { children: [
250
157
  /* @__PURE__ */ jsx(Controls, { onClose }),
251
158
  /* @__PURE__ */ jsx(Header, {})
252
159
  ] }),
253
- /* @__PURE__ */ jsxs(AnimatedWrapper, { noAnimate: IFrameSteps.includes(currentStep), children: [
254
- /* @__PURE__ */ jsx(
255
- AnimatePresence,
160
+ /* @__PURE__ */ jsxs(AnimatedWrapper, { noAnimate: isUsingIFrame, children: [
161
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, custom: directionRef.current, children: /* @__PURE__ */ jsxs(
162
+ BodyContainer,
256
163
  {
257
- mode: "popLayout",
258
- initial: false,
259
- onExitComplete: () => {
260
- setStepDirection(1);
261
- },
262
- custom: stepDirection,
263
- children: /* @__PURE__ */ jsxs(
264
- BodyContainer,
265
- {
266
- "data-step": currentStep.toLowerCase().replace(/_/g, "-"),
267
- custom: stepDirection,
268
- variants: BODY_MOTION_VARIANTS,
269
- initial: "enter",
270
- animate: "center",
271
- exit: "exit",
272
- transition: BODY_TRANSITION,
273
- children: [
274
- /* @__PURE__ */ jsxs(
275
- InnerContainer,
276
- {
277
- $embeddedModal: !!embeddedModal,
278
- $step: currentStep,
279
- $isIFrameStep: IFrameSteps.includes(currentStep),
280
- children: [
281
- !IFrameSteps.includes(currentStep) && /* @__PURE__ */ jsx(NetworkSpeedBanner, { fontSize: "12px", iconSize: "16px" }),
282
- Content()
283
- ]
284
- }
285
- ),
286
- modalError && /* @__PURE__ */ jsx(WarningBanner, { onClose: () => setModalError(void 0), children: renderTextWithLinks(modalError) })
287
- ]
288
- },
289
- ["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : ["ACCOUNT_SEND", "ACCOUNT_SEND_ASSET", "ACCOUNT_SEND_NETWORK"].includes(currentStep) ? "ACCOUNT_SEND" : currentStep
290
- )
291
- }
292
- ),
293
- /* @__PURE__ */ jsx(IFrameStep, {}),
164
+ custom: directionRef.current,
165
+ "data-step": (authView || accountView).toLowerCase().replace(/_/g, "-"),
166
+ variants: BODY_MOTION_VARIANTS,
167
+ initial: "enter",
168
+ animate: "center",
169
+ exit: "exit",
170
+ transition: BODY_TRANSITION,
171
+ children: [
172
+ /* @__PURE__ */ jsxs(InnerContainer, { $embeddedModal: !!embeddedModal, $step: accountView, $isIFrameStep: isUsingIFrame, children: [
173
+ !isUsingIFrame && /* @__PURE__ */ jsx(NetworkSpeedBanner, { fontSize: "12px", iconSize: "16px" }),
174
+ Content
175
+ ] }),
176
+ modalError && /* @__PURE__ */ jsx(WarningBanner, { onClose: () => setModalError(void 0), children: renderTextWithLinks(modalError) })
177
+ ]
178
+ },
179
+ screenKey
180
+ ) }),
181
+ /* @__PURE__ */ jsx(MemoizedIFrame, {}),
294
182
  /* @__PURE__ */ jsx(Footer, {})
295
183
  ] })
296
184
  ] });
@@ -6,10 +6,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { CpslText } from "@getpara/react-components";
7
7
  import { getNetworkFromChainId, getNetworkName, safeStyled } from "@getpara/react-common";
8
8
  import { useEffect, useRef } from "react";
9
- import { useDropdownPosition } from "../AuthInput/hooks/useDropdownPosition.js";
10
9
  import { useWallet } from "../../../provider/index.js";
11
10
  import { HeaderSelect, HeaderSelectContainer, HeaderSelectItem, NetworkIcon } from "../common.js";
12
11
  import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
12
+ import { useDropdownPosition } from "../../hooks/useDropdownPosition.js";
13
13
  const Chain = ({
14
14
  chain: { id, name },
15
15
  slot,
@@ -48,7 +48,7 @@ const ChainSelect = () => {
48
48
  return null;
49
49
  }
50
50
  const chainIdToUse = chainIdSwitchingTo != null ? chainIdSwitchingTo : chainId;
51
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(HeaderSelectContainer, { ref: containerRef, id: "inputContainer", children: /* @__PURE__ */ jsxs(
51
+ return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(HeaderSelectContainer, { ref: containerRef, children: /* @__PURE__ */ jsxs(
52
52
  HeaderSelect,
53
53
  {
54
54
  selectedValue: (_a = chainIdToUse == null ? void 0 : chainIdToUse.toString()) != null ? _a : "",
@@ -57,10 +57,9 @@ const ChainSelect = () => {
57
57
  },
58
58
  showFormattedSelectedItem: true,
59
59
  placeholder: "Choose chain...",
60
- anchorElId: "inputContainer",
61
60
  dropdownMaxHeight,
62
61
  $width: dropdownWidth != null ? dropdownWidth : 0,
63
- $top: (mobileAnchor != null ? mobileAnchor : 0) + 16 + 1,
62
+ $top: mobileAnchor != null ? mobileAnchor : void 0,
64
63
  autoWidth: true,
65
64
  alignCenter: true,
66
65
  selectedItemVariant: "bodyXS",
@@ -3,7 +3,6 @@ import "../../../chunk-MMUBH76A.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { CpslIcon } from "@getpara/react-components";
5
5
  import { safeStyled } from "@getpara/react-common";
6
- import { useModalStore } from "../../stores/index.js";
7
6
  import { useGoBack } from "../../hooks/useGoBack.js";
8
7
  import { ChainSelect } from "./ChainSelect.js";
9
8
  import { HeaderButton } from "@getpara/react-common";
@@ -14,8 +13,7 @@ const Controls = ({ onClose }) => {
14
13
  var _a;
15
14
  return (_a = state.modalConfig) == null ? void 0 : _a.bareModal;
16
15
  });
17
- const hasPreviousStep = useModalStore((state) => state.hasPreviousStep());
18
- const goBack = useGoBack();
16
+ const { goBack, canGoBack } = useGoBack();
19
17
  const { isControls } = useStepTitle();
20
18
  const handleBackClick = () => {
21
19
  goBack();
@@ -26,7 +24,7 @@ const Controls = ({ onClose }) => {
26
24
  {
27
25
  variant: "ghost",
28
26
  style: {
29
- visibility: hasPreviousStep ? "visible" : "hidden"
27
+ visibility: canGoBack ? "visible" : "hidden"
30
28
  },
31
29
  onClick: handleBackClick,
32
30
  "data-testid": "modal-back-button",
@@ -3,19 +3,10 @@ import "../../../chunk-MMUBH76A.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { safeStyled, PARA_TERMS_AND_CONDITIONS } from "@getpara/react-common";
5
5
  import { CpslIcon, CpslText } from "@getpara/react-components";
6
- import { useModalStore } from "../../stores/index.js";
7
- import { ModalStep } from "../../utils/steps.js";
8
- import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
6
+ import { useAuthView } from "../../hooks/useAuthView.js";
9
7
  const Footer = () => {
10
- const currentStep = useModalStore((state) => state.step);
11
- const { accountLinkInProgress } = useAccountLinking();
12
- const showFooter = !accountLinkInProgress && [
13
- ModalStep.AUTH_MAIN,
14
- ModalStep.AUTH_MORE,
15
- ModalStep.EX_WALLET_NETWORK_SELECT,
16
- ModalStep.EX_WALLET_MORE,
17
- ModalStep.EX_WALLET_SELECTED
18
- ].includes(currentStep);
8
+ const { authView } = useAuthView();
9
+ const showFooter = authView === "AUTH_MAIN" || authView === "AUTH_ALL_OPTIONS" || authView === "AUTH_ALL_EXTERNAL_WALLETS";
19
10
  if (!showFooter) {
20
11
  return null;
21
12
  }
@@ -5,22 +5,23 @@ import { getAuthDisplay, safeStyled, BODY_MOTION_VARIANTS, BODY_TRANSITION } fro
5
5
  import { useStepTitle } from "./hooks/useStepTitle.js";
6
6
  import { CenteredText } from "../common.js";
7
7
  import { AnimatePresence, motion } from "framer-motion";
8
- import { useModalStore } from "../../stores/index.js";
9
8
  import { useAccount } from "../../../provider/index.js";
10
9
  import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
11
10
  import { CpslIcon, CpslText } from "@getpara/react-components";
12
- import { ModalStep } from "../../utils/steps.js";
13
11
  import { useMemo } from "react";
14
- const StepTitle = () => {
12
+ import { useStore } from "../../../provider/stores/useStore.js";
13
+ import { useAuthView } from "../../hooks/useAuthView.js";
14
+ const StepTitle = ({ title }) => {
15
15
  const para = useInternalClient();
16
- const currentStep = useModalStore((state) => state.step);
17
- const { title, isTitleDisplayed } = useStepTitle();
16
+ const accountView = useStore((state) => state.accountView);
17
+ const { authView } = useAuthView();
18
+ const { isTitleDisplayed } = useStepTitle();
18
19
  const { isConnected, connectionType } = useAccount();
19
20
  const content = useMemo(() => {
20
21
  if (!isTitleDisplayed) {
21
22
  return null;
22
23
  }
23
- if ((para == null ? void 0 : para.authInfo) && connectionType !== "external" && currentStep === ModalStep.ACCOUNT_MAIN) {
24
+ if (!authView && (para == null ? void 0 : para.authInfo) && isConnected && connectionType !== "external" && accountView === "ACCOUNT_MAIN") {
24
25
  const { name, icon, src } = getAuthDisplay(para.authInfo);
25
26
  return /* @__PURE__ */ jsxs(AuthDisplay, { children: [
26
27
  /* @__PURE__ */ jsx(CpslIcon, { src, icon, size: "14px", rounded: !!src }),
@@ -28,18 +29,16 @@ const StepTitle = () => {
28
29
  ] });
29
30
  }
30
31
  return /* @__PURE__ */ jsx(CenteredText, { weight: "semiBold", color: "secondary", children: title });
31
- }, [isTitleDisplayed, para, currentStep, isConnected, connectionType, title]);
32
+ }, [isTitleDisplayed, para, accountView, isConnected, connectionType, title, authView]);
32
33
  return /* @__PURE__ */ jsx("div", { style: { height: "100%", width: "100%" }, children: content });
33
34
  };
34
35
  const Header = () => {
35
- const { isControls } = useStepTitle();
36
- const stepDirection = useModalStore((state) => state.stepDirection);
37
- const currentStep = useModalStore((state) => state.step);
38
- return /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, custom: stepDirection, children: /* @__PURE__ */ jsx(
36
+ const { isControls, title } = useStepTitle();
37
+ const accountView = useStore((state) => state.accountView);
38
+ return /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsx(
39
39
  Container,
40
40
  {
41
41
  $isVisible: !isControls,
42
- custom: stepDirection,
43
42
  variants: BODY_MOTION_VARIANTS,
44
43
  initial: "enter",
45
44
  animate: "center",
@@ -47,9 +46,9 @@ const Header = () => {
47
46
  transition: BODY_TRANSITION,
48
47
  slot: "header",
49
48
  id: "header",
50
- children: /* @__PURE__ */ jsx(StepTitle, {})
49
+ children: /* @__PURE__ */ jsx(StepTitle, { title })
51
50
  },
52
- ["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : currentStep
51
+ ["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(accountView) ? "ADD_FUNDS" : title
53
52
  ) });
54
53
  };
55
54
  const Container = safeStyled(motion.div)`
@@ -1,7 +1,7 @@
1
1
  export declare const signUpOrLogInTitle = "Sign Up or Login";
2
2
  export declare const connectWalletTitle = "Connect Wallet";
3
3
  export declare const useStepTitle: () => {
4
- title: any;
4
+ title: string | null;
5
5
  isTitleDisplayed: boolean;
6
6
  isControls: boolean | undefined;
7
7
  };