@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.
- package/dist/css/modal.css +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/modal/ParaModal.js +57 -98
- package/dist/modal/components/Body/Body.d.ts +1 -2
- package/dist/modal/components/Body/Body.js +119 -231
- package/dist/modal/components/Controls/ChainSelect.js +3 -4
- package/dist/modal/components/Controls/Controls.js +2 -4
- package/dist/modal/components/Footer/Footer.js +3 -12
- package/dist/modal/components/Header/Header.js +13 -14
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
- package/dist/modal/components/Header/hooks/useStepTitle.js +88 -71
- package/dist/modal/components/ModalContent/ModalContent.d.ts +1 -1
- package/dist/modal/components/ModalContent/ModalContent.js +6 -14
- package/dist/modal/components/OnRampComponents/AddingFunds.js +2 -2
- package/dist/modal/components/WalletCard/WalletCard.js +9 -9
- package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +13 -18
- package/dist/modal/components/common.d.ts +5 -0
- package/dist/modal/components/common.js +17 -10
- package/dist/modal/components/{Account → flows/account/Account}/Account.js +30 -27
- package/dist/modal/components/{Account/AccountHeader.d.ts → flows/account/Account/Header.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountHeader.js → flows/account/Account/Header.js} +8 -8
- package/dist/modal/components/{Account/AccountWalletSelect.d.ts → flows/account/Account/WalletSelect.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountWalletSelect.js → flows/account/Account/WalletSelect.js} +17 -22
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.d.ts +12 -0
- package/dist/modal/components/flows/account/AccountFlow/AccountFlow.js +126 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.d.ts +11 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountContext.js +42 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.d.ts +4 -0
- package/dist/modal/components/flows/account/AccountProvider/AccountProvider.js +110 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.js +12 -12
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.js +3 -3
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.js +7 -8
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.d.ts +1 -1
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsContext.js +11 -11
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.js +8 -9
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.js +2 -2
- package/dist/modal/components/flows/account/AddFunds/AddFundsProvider.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsProvider.js +13 -12
- package/dist/modal/components/flows/account/AddFunds/AddFundsReceive.d.ts +1 -0
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsReceive.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.js +10 -10
- package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.js +1 -1
- package/dist/modal/components/flows/account/AddFunds/utils.d.ts +3 -0
- package/dist/modal/components/flows/account/AddFunds/utils.js +16 -0
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.js +7 -10
- package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.js +1 -1
- package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.js +13 -13
- package/dist/modal/components/flows/account/Profile/FarcasterLink.d.ts +2 -0
- package/dist/modal/components/{OAuth → flows/account/Profile}/FarcasterLink.js +6 -6
- package/dist/modal/components/{Account/AccountProfile.d.ts → flows/account/Profile/Profile.d.ts} +1 -1
- package/dist/modal/components/{Account/AccountProfile.js → flows/account/Profile/Profile.js} +20 -24
- package/dist/modal/components/{Account/AccountProfileEntry.js → flows/account/Profile/ProfileEntry.js} +13 -15
- package/dist/modal/components/flows/account/Profile/ProfileLink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLink.js → flows/account/Profile/ProfileLink.js} +19 -34
- package/dist/modal/components/flows/account/Profile/ProfileLinkOptions.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileLinkOptions.js → flows/account/Profile/ProfileLinkOptions.js} +11 -11
- package/dist/modal/components/flows/account/Profile/ProfileUnlink.d.ts +1 -0
- package/dist/modal/components/{Account/AccountProfileUnlink.js → flows/account/Profile/ProfileUnlink.js} +6 -6
- package/dist/modal/{hooks/useTelegramLogin.d.ts → components/flows/account/Profile/useTelegramLink.d.ts} +1 -5
- package/dist/modal/{hooks/useTelegramLogin.js → components/flows/account/Profile/useTelegramLink.js} +16 -23
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.js +1 -1
- package/dist/modal/components/flows/account/Send/SendAsset.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendAsset.js → flows/account/Send/SendAsset.js} +11 -12
- package/dist/modal/components/flows/account/Send/SendForm.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendForm.js → flows/account/Send/SendForm.js} +15 -16
- package/dist/modal/components/flows/account/Send/SendNetwork.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNetwork.js → flows/account/Send/SendNetwork.js} +9 -10
- package/dist/modal/components/flows/account/Send/SendNoAssets.d.ts +1 -0
- package/dist/modal/components/{Account/AccountSend/AccountSendNoAssets.js → flows/account/Send/SendNoAssets.js} +8 -9
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.js +19 -6
- package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.js +11 -11
- package/dist/modal/components/flows/account/SwitchWallets/SwitchWallets.d.ts +1 -0
- package/dist/modal/components/{SwitchWalletsStep/SwitchWalletsStep.js → flows/account/SwitchWallets/SwitchWallets.js} +4 -4
- package/dist/modal/components/flows/account/Wallet/Wallet.d.ts +1 -0
- package/dist/modal/components/{Account/AccountWallet.js → flows/account/Wallet/Wallet.js} +12 -18
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.d.ts +10 -0
- package/dist/modal/components/flows/auth/AuthFlow/AuthFlow.js +94 -0
- package/dist/modal/components/flows/auth/AuthMain/AuthMain.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStep.js → flows/auth/AuthMain/AuthMain.js} +10 -21
- package/dist/modal/components/flows/auth/AuthMain/AuthMainContent.d.ts +9 -0
- package/dist/modal/components/{AuthMainStep/AuthMainStepContent.js → flows/auth/AuthMain/AuthMainContent.js} +49 -24
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingAccountSetup/AwaitingAccountSetup.js +31 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingBiometrics/AwaitingBiometrics.js +21 -0
- package/dist/modal/components/flows/auth/AwaitingOAuth/AwaitingOAuth.d.ts +1 -0
- package/dist/modal/components/{AwaitingOAuthStep/AwaitingOAuthStep.js → flows/auth/AwaitingOAuth/AwaitingOAuth.js} +4 -4
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.d.ts +1 -0
- package/dist/modal/components/flows/auth/AwaitingPassword/AwaitingPassword.js +22 -0
- package/dist/modal/components/flows/auth/BiometricCreation/BiometricCreation.d.ts +1 -0
- package/dist/modal/components/{BiometricCreationStep/BiometricCreationStep.js → flows/auth/BiometricCreation/BiometricCreation.js} +25 -22
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.d.ts +1 -0
- package/dist/modal/components/flows/auth/BiometricLogin/BiometricLogin.js +72 -0
- package/dist/modal/components/flows/auth/LoginDone/LoginDone.d.ts +5 -0
- package/dist/modal/components/{LoginDoneStep/LoginDoneStep.js → flows/auth/LoginDone/LoginDone.js} +9 -13
- package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.js +15 -23
- package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.js +9 -11
- package/dist/modal/components/flows/auth/Setup2FA/Setup2FA.d.ts +5 -0
- package/dist/modal/components/{Setup2FAStep/Setup2FAStep.js → flows/auth/Setup2FA/Setup2FA.js} +42 -19
- package/dist/modal/components/flows/auth/Verification/Verification.d.ts +1 -0
- package/dist/modal/components/flows/auth/Verification/Verification.js +36 -0
- package/dist/modal/components/flows/auth/WalletCreationDone/WalletCreationDone.d.ts +6 -0
- package/dist/modal/components/{WalletCreationDoneStep/WalletCreationDoneStep.js → flows/auth/WalletCreationDone/WalletCreationDone.js} +19 -46
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.d.ts +2 -2
- package/dist/modal/components/{AuthOptions → shared}/AuthOptions.js +18 -15
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.d.ts → shared/ConnectExternalWallet/ConnectExternalWallet.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletStep/ExternalWalletStep.js → shared/ConnectExternalWallet/ConnectExternalWallet.js} +17 -37
- package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.js +1 -1
- package/dist/modal/components/{AuthInput/AuthInput.d.ts → shared/EmailOrPhone/EmailOrPhoneInput.d.ts} +4 -4
- package/dist/modal/components/{AuthInput/AuthInput.js → shared/EmailOrPhone/EmailOrPhoneInput.js} +14 -10
- package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.js +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts → shared/ExternalWalletNetworkSelect.d.ts} +1 -1
- package/dist/modal/components/{ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js → shared/ExternalWalletNetworkSelect.js} +9 -9
- package/dist/modal/components/{ExternalWallets → shared}/ExternalWallets.js +17 -12
- package/dist/modal/components/shared/IFrame.d.ts +1 -0
- package/dist/modal/components/shared/IFrame.js +87 -0
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.d.ts → shared/VerificationCode.d.ts} +3 -4
- package/dist/modal/components/{VerificationCodeStep/VerificationCodeStep.js → shared/VerificationCode.js} +4 -28
- package/dist/modal/components/shared/VerifyExternalWallet.d.ts +1 -0
- package/dist/modal/components/{ExternalWalletVerificationStep/ExternalWalletVerificationStep.js → shared/VerifyExternalWallet.js} +10 -17
- package/dist/modal/hooks/index.d.ts +1 -2
- package/dist/modal/hooks/index.js +1 -2
- package/dist/modal/hooks/useAuthView.d.ts +4 -0
- package/dist/modal/hooks/useAuthView.js +115 -0
- package/dist/modal/hooks/useCanbGoBack.d.ts +3 -0
- package/dist/modal/hooks/useCanbGoBack.js +47 -0
- package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.d.ts +1 -1
- package/dist/modal/hooks/useDropdownPosition.js +41 -0
- package/dist/modal/hooks/useGoBack.d.ts +4 -1
- package/dist/modal/hooks/useGoBack.js +60 -36
- package/dist/modal/hooks/useSendMutations.js +4 -5
- package/dist/modal/hooks/useTransactionMonitoring.js +8 -8
- package/dist/modal/index.d.ts +1 -2
- package/dist/modal/index.js +1 -3
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/index.js +0 -1
- package/dist/modal/types/modalProps.d.ts +18 -8
- package/dist/provider/ParaProviderMin.js +34 -38
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/index.d.ts +43 -49
- package/dist/provider/actions/index.js +4 -0
- package/dist/provider/components/CosmosWalletWrapper.js +0 -3
- package/dist/provider/components/EvmWalletWrapper.js +0 -3
- package/dist/provider/components/ExternalWalletWrapper.js +8 -2
- package/dist/provider/hooks/mutations/index.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.js +4 -0
- package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +7 -12
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +28 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +28 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +7 -13
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +4 -1
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +7 -6
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +6 -3
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +7 -93
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +7 -15
- package/dist/provider/hooks/mutations/useCreateWallet.js +4 -1
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +7 -27
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +7 -12
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +2 -7
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +7 -13
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +7 -21
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +6 -7
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +2 -2
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +7 -25
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useLogout.d.ts +7 -12
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +7 -13
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +4 -1
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +7 -7
- package/dist/provider/hooks/mutations/useSetup2fa.js +2 -2
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +7 -31
- package/dist/provider/hooks/mutations/useSignTransaction.js +4 -1
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +7 -19
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +4 -1
- package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +7 -30
- package/dist/provider/hooks/mutations/useSwitchWallets.js +4 -1
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +7 -15
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +4 -1
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +7 -30
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +7 -19
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +7 -31
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +7 -66
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +4 -1
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +7 -37
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +7 -22
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +7 -30
- package/dist/provider/hooks/mutations/useWaitForLogin.js +4 -1
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +7 -18
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +7 -27
- package/dist/provider/hooks/mutations/utils.js +1 -1
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +4 -1
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +6 -1
- package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +2 -4
- package/dist/provider/hooks/queries/useParaStatus.d.ts +0 -1
- package/dist/provider/hooks/queries/useParaStatus.js +0 -2
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +1 -1
- package/dist/provider/hooks/utils/useEventListeners.js +0 -7
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +1 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +9 -5
- package/dist/provider/hooks/utils/useModal.d.ts +4 -3
- package/dist/provider/hooks/utils/useModal.js +17 -9
- package/dist/provider/hooks/utils/useWalletState.d.ts +3 -3
- package/dist/provider/hooks/utils/useWalletState.js +14 -6
- package/dist/provider/providers/AccountLinkProvider.js +21 -19
- package/dist/provider/providers/AuthProvider/AuthContext.d.ts +19 -0
- package/dist/provider/providers/AuthProvider/AuthContext.js +35 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.d.ts +9 -0
- package/dist/provider/providers/AuthProvider/AuthProvider.js +261 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +12 -4
- package/dist/provider/providers/ExternalWalletProvider.js +285 -283
- package/dist/provider/stores/getters.d.ts +1 -1
- package/dist/provider/stores/getters.js +5 -5
- package/dist/provider/stores/setters.js +2 -2
- package/dist/provider/stores/slices/accountFlow.d.ts +3 -0
- package/dist/provider/stores/slices/accountFlow.js +30 -0
- package/dist/provider/stores/slices/authFlow.d.ts +3 -0
- package/dist/provider/stores/slices/authFlow.js +63 -0
- package/dist/provider/stores/slices/externalWallets.js +10 -0
- package/dist/provider/stores/slices/index.d.ts +4 -0
- package/dist/provider/stores/slices/index.js +4 -0
- package/dist/provider/stores/slices/modal.js +8 -2
- package/dist/provider/stores/slices/onRamp.d.ts +3 -0
- package/dist/provider/stores/slices/onRamp.js +20 -0
- package/dist/provider/stores/slices/paraState.d.ts +3 -0
- package/dist/provider/stores/slices/paraState.js +9 -0
- package/dist/provider/stores/types.d.ts +117 -5
- package/dist/provider/stores/types.js +9 -0
- package/dist/provider/stores/useStore.d.ts +5 -3
- package/dist/provider/stores/useStore.js +15 -8
- package/package.json +8 -8
- package/dist/modal/components/Account/AccountProfileLink.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +0 -1
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendAsset.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendForm.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNetwork.d.ts +0 -1
- package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.d.ts +0 -1
- package/dist/modal/components/Account/AccountWallet.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.d.ts +0 -1
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +0 -21
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -21
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -24
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -67
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.js +0 -118
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -83
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -5
- package/dist/modal/components/OAuth/FarcasterLink.d.ts +0 -2
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -1
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -53
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -8
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -91
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.d.ts +0 -1
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/hooks/useFarcasterLogin.d.ts +0 -9
- package/dist/modal/hooks/useFarcasterLogin.js +0 -77
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/actions.js +0 -146
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -119
- package/dist/modal/stores/modal/useModalStore.js +0 -80
- package/dist/modal/utils/steps.d.ts +0 -162
- package/dist/modal/utils/steps.js +0 -335
- package/dist/provider/providers/AuthProvider.d.ts +0 -43
- package/dist/provider/providers/AuthProvider.js +0 -777
- /package/dist/modal/components/{Account → flows/account/Account}/Account.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFunds.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAsset.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsAwaiting.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsDone.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsNetwork.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/AddFundsSettings.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/MoonPayEmbed.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.d.ts +0 -0
- /package/dist/modal/components/{AddFunds → flows/account/AddFunds}/index.js +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/ChainSwitch.d.ts +0 -0
- /package/dist/modal/components/{ChainSwitch → flows/account/ChainSwitch}/config.d.ts +0 -0
- /package/dist/modal/components/{Account → flows/account/Profile}/AccountMonitorTx.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountProfileEntry.d.ts → flows/account/Profile/ProfileEntry.d.ts} +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/AssetNetwork.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/context.d.ts +0 -0
- /package/dist/modal/components/{Account/AccountSend → flows/account/Send}/index.d.ts +0 -0
- /package/dist/modal/components/{OAuth → flows/auth/OAuth}/OAuth.d.ts +0 -0
- /package/dist/modal/components/{RecoverySecretStep → flows/auth/RecoverySecretStep}/RecoverySecretStep.d.ts +0 -0
- /package/dist/modal/components/{ExternalWalletStep → shared/ConnectExternalWallet}/config.d.ts +0 -0
- /package/dist/modal/components/{AuthInput → shared/EmailOrPhone}/phoneMasks.d.ts +0 -0
- /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 {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
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
|
-
|
|
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
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const setAccountAddFundTab =
|
|
67
|
-
const modalError =
|
|
68
|
-
const 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
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
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
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
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
|
-
|
|
105
|
-
|
|
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 (
|
|
235
|
-
case
|
|
141
|
+
switch (accountView) {
|
|
142
|
+
case "ACCOUNT_ADD_FUNDS_BUY":
|
|
236
143
|
setAccountAddFundTab(EnabledFlow.BUY);
|
|
237
144
|
break;
|
|
238
|
-
case
|
|
145
|
+
case "ACCOUNT_ADD_FUNDS_RECEIVE":
|
|
239
146
|
setAccountAddFundTab(EnabledFlow.RECEIVE);
|
|
240
147
|
break;
|
|
241
|
-
case
|
|
148
|
+
case "ACCOUNT_ADD_FUNDS_WITHDRAW":
|
|
242
149
|
setAccountAddFundTab(EnabledFlow.WITHDRAW);
|
|
243
150
|
break;
|
|
244
151
|
default:
|
|
245
152
|
break;
|
|
246
153
|
}
|
|
247
|
-
}, [
|
|
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:
|
|
254
|
-
/* @__PURE__ */ jsx(
|
|
255
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
{
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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,
|
|
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:
|
|
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
|
|
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:
|
|
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 {
|
|
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
|
|
11
|
-
const
|
|
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
|
-
|
|
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
|
|
17
|
-
const {
|
|
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" &&
|
|
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,
|
|
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
|
|
37
|
-
|
|
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(
|
|
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:
|
|
4
|
+
title: string | null;
|
|
5
5
|
isTitleDisplayed: boolean;
|
|
6
6
|
isControls: boolean | undefined;
|
|
7
7
|
};
|