@getpara/react-sdk-lite 2.12.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 +46 -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 +1 -1
- 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 +7 -5
- 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} +13 -11
- 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} +15 -22
- 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 +5 -5
- 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} +11 -12
- 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} +16 -36
- 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.js +3 -3
- 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/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/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 +2 -2
- package/dist/provider/hooks/utils/useModal.js +9 -8
- 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/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 -120
- package/dist/modal/stores/modal/useModalStore.js +0 -81
- 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
- /package/dist/modal/{components/AuthInput/hooks → hooks}/useDropdownPosition.d.ts +0 -0
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
3
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { Fragment as Fragment2, useMemo } from "react";
|
|
5
7
|
import { CpslButton, CpslDivider, CpslIcon, CpslIconGroup } from "@getpara/react-components";
|
|
6
8
|
import { ACCOUNT_TYPES, safeStyled } from "@getpara/react-common";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import { connectWalletTitle, signUpOrLogInTitle } from "../Header/hooks/useStepTitle.js";
|
|
17
|
-
const AuthMainStepContent = ({
|
|
9
|
+
import { AuthLayout } from "../../../../types/modalProps.js";
|
|
10
|
+
import { useExternalWallets } from "../../../../../provider/providers/ExternalWalletProvider.js";
|
|
11
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
12
|
+
import { useAccount, useParaStatus } from "../../../../../provider/index.js";
|
|
13
|
+
import { connectWalletTitle, signUpOrLogInTitle } from "../../../Header/hooks/useStepTitle.js";
|
|
14
|
+
import { useAuth } from "../../../../../provider/providers/AuthProvider/AuthProvider.js";
|
|
15
|
+
import { AuthOptions } from "../../../shared/AuthOptions.js";
|
|
16
|
+
import { ExternalWallets } from "../../../shared/ExternalWallets.js";
|
|
17
|
+
const AuthMainContent = ({
|
|
18
18
|
oAuthMethods,
|
|
19
19
|
disableEmailLogin,
|
|
20
20
|
disablePhoneLogin,
|
|
21
|
-
isGuestModeEnabled
|
|
21
|
+
isGuestModeEnabled
|
|
22
22
|
}) => {
|
|
23
|
+
const { createGuestWallets } = useAuth();
|
|
23
24
|
const { wallets, connectFarcasterMiniApp } = useExternalWallets();
|
|
24
|
-
const { createGuestWallets } = useAuthActions();
|
|
25
25
|
const { isFarcasterMiniApp } = useParaStatus();
|
|
26
26
|
const { embedded } = useAccount();
|
|
27
|
-
const authLayout =
|
|
28
|
-
const
|
|
27
|
+
const authLayout = useStore((state) => state.authLayout);
|
|
28
|
+
const selectedAuthView = useStore((state) => state.selectedAuthView);
|
|
29
|
+
const setSelectedAuthView = useStore((state) => state.setSelectedAuthView);
|
|
29
30
|
const oAuthLogoVariant = useStore((state) => state.oAuthLogoVariant);
|
|
30
31
|
const isDark = useStore((state) => {
|
|
31
32
|
var _a, _b;
|
|
@@ -34,13 +35,28 @@ const AuthMainStepContent = ({
|
|
|
34
35
|
const isGuestMode = (embedded == null ? void 0 : embedded.isConnected) && embedded.isGuestMode;
|
|
35
36
|
const useBrandedLogos = oAuthLogoVariant === "default";
|
|
36
37
|
const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== "dark";
|
|
38
|
+
const isMainStep = selectedAuthView === "AUTH_MAIN";
|
|
37
39
|
const handleCondensedAuthClick = () => {
|
|
38
|
-
|
|
40
|
+
setSelectedAuthView("AUTH_ALL_OPTIONS");
|
|
39
41
|
};
|
|
40
42
|
const handleCondensedExternalClick = () => {
|
|
41
|
-
|
|
43
|
+
setSelectedAuthView("AUTH_ALL_EXTERNAL_WALLETS");
|
|
42
44
|
};
|
|
43
45
|
const Content = useMemo(() => {
|
|
46
|
+
if (selectedAuthView === "AUTH_ALL_OPTIONS") {
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
AuthOptions,
|
|
49
|
+
{
|
|
50
|
+
oAuthMethods,
|
|
51
|
+
disableEmailLogin,
|
|
52
|
+
disablePhoneLogin,
|
|
53
|
+
isGuestModeEnabled
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if (selectedAuthView === "AUTH_ALL_EXTERNAL_WALLETS") {
|
|
58
|
+
return /* @__PURE__ */ jsx(ExternalWallets, {});
|
|
59
|
+
}
|
|
44
60
|
const methods = [];
|
|
45
61
|
if (isFarcasterMiniApp) {
|
|
46
62
|
methods.push([
|
|
@@ -130,18 +146,27 @@ const AuthMainStepContent = ({
|
|
|
130
146
|
reactNode,
|
|
131
147
|
methods.length > 1 && index < methods.length - 1 && /* @__PURE__ */ jsx(CpslDivider, { children: "or" }, "or")
|
|
132
148
|
] }, key)) });
|
|
133
|
-
}, [
|
|
149
|
+
}, [
|
|
150
|
+
isFarcasterMiniApp,
|
|
151
|
+
oAuthMethods,
|
|
152
|
+
disableEmailLogin,
|
|
153
|
+
disablePhoneLogin,
|
|
154
|
+
isGuestModeEnabled,
|
|
155
|
+
wallets,
|
|
156
|
+
authLayout,
|
|
157
|
+
selectedAuthView
|
|
158
|
+
]);
|
|
134
159
|
return /* @__PURE__ */ jsxs(Container, { "data-testid": "main-auth-step-content", children: [
|
|
135
160
|
Content,
|
|
136
|
-
isGuestModeEnabled && !isGuestMode && !isFarcasterMiniApp && /* @__PURE__ */ jsx(
|
|
161
|
+
isMainStep && isGuestModeEnabled && !isGuestMode && !isFarcasterMiniApp && /* @__PURE__ */ jsx(
|
|
137
162
|
GuestMode,
|
|
138
163
|
{
|
|
139
164
|
href: "#",
|
|
140
165
|
$isDark: isDark,
|
|
141
|
-
onClick: (e) => {
|
|
166
|
+
onClick: (e) => __async(void 0, null, function* () {
|
|
142
167
|
e.preventDefault();
|
|
143
|
-
createGuestWallets();
|
|
144
|
-
},
|
|
168
|
+
yield createGuestWallets();
|
|
169
|
+
}),
|
|
145
170
|
"data-testid": "para-guest-continue",
|
|
146
171
|
children: "Continue as Guest"
|
|
147
172
|
}
|
|
@@ -196,5 +221,5 @@ const FarcasterButton = safeStyled(CpslButton)`
|
|
|
196
221
|
--button-primary-active-color: white;
|
|
197
222
|
`;
|
|
198
223
|
export {
|
|
199
|
-
|
|
224
|
+
AuthMainContent
|
|
200
225
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingAccountSetup: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
5
|
+
import { StepContainer } from "../../../common.js";
|
|
6
|
+
import { Waiting } from "../../../Waiting/Waiting.js";
|
|
7
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
8
|
+
const AwaitingAccountSetup = () => {
|
|
9
|
+
var _a;
|
|
10
|
+
const para = useInternalClient();
|
|
11
|
+
const paraState = useStore((state) => state.paraState);
|
|
12
|
+
const isLogin = useStore((state) => {
|
|
13
|
+
var _a2, _b;
|
|
14
|
+
return ((_b = (_a2 = state.paraState) == null ? void 0 : _a2.authStateInfo) == null ? void 0 : _b.isNewUser) === false;
|
|
15
|
+
});
|
|
16
|
+
const refs = useStore((state) => state.refs);
|
|
17
|
+
const hideWallets = useStore((state) => {
|
|
18
|
+
var _a2;
|
|
19
|
+
return (_a2 = state.modalConfig) == null ? void 0 : _a2.hideWallets;
|
|
20
|
+
});
|
|
21
|
+
const isPopup = ((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) === false;
|
|
22
|
+
if (!paraState || paraState.corePhase !== "wallet_flow") {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
let headingText = para.isGuestMode ? hideWallets ? "Linking Guest Account..." : "Linking Guest Wallet..." : isLogin ? "Logging You In..." : paraState.authPhase === "guest_mode" ? "Creating Guest Account..." : "Creating Your Account...";
|
|
26
|
+
let subheadingText = isPopup ? "Follow the prompts presented by your browser." : "This should only take a couple of seconds.";
|
|
27
|
+
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsx(Waiting, { heading: headingText, subheading: subheadingText }) });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
AwaitingAccountSetup
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingBiometrics: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
5
|
+
import { Waiting } from "../../../Waiting/Waiting.js";
|
|
6
|
+
const AwaitingBiometrics = () => {
|
|
7
|
+
const isLogin = useStore((state) => {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
return ((_b = (_a = state.paraState) == null ? void 0 : _a.authStateInfo) == null ? void 0 : _b.isNewUser) === false;
|
|
10
|
+
});
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Waiting,
|
|
13
|
+
{
|
|
14
|
+
heading: isLogin ? "Waiting for Passkey" : "Creating Passkey",
|
|
15
|
+
subheading: "Follow the prompts presented by your browser."
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
AwaitingBiometrics
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingOAuth: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { Waiting } from "
|
|
5
|
-
const
|
|
4
|
+
import { Waiting } from "../../../Waiting/Waiting.js";
|
|
5
|
+
const AwaitingOAuth = () => {
|
|
6
6
|
return /* @__PURE__ */ jsx(Waiting, { heading: "Complete Login", subheading: "Follow the prompts presented by your browser." });
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
AwaitingOAuth
|
|
10
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingPassword: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
5
|
+
import { Waiting } from "../../../Waiting/Waiting.js";
|
|
6
|
+
const AwaitingPassword = () => {
|
|
7
|
+
const isLogin = useStore((state) => {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
return ((_b = (_a = state.paraState) == null ? void 0 : _a.authStateInfo) == null ? void 0 : _b.isNewUser) === false;
|
|
10
|
+
});
|
|
11
|
+
const isPIN = useStore((state) => state.authMethod === "PIN");
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Waiting,
|
|
14
|
+
{
|
|
15
|
+
heading: isLogin ? `Waiting for ${isPIN ? "PIN" : "Password"}` : `Creating ${isPIN ? "PIN" : "Password"}`,
|
|
16
|
+
subheading: "Follow the prompts presented by your browser."
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
AwaitingPassword
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BiometricCreation: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { CpslButton, CpslDivider, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
5
|
-
import {
|
|
6
|
-
import { InnerStepContainer, StepContainer, Heading, QRContainer } from "../common.js";
|
|
5
|
+
import { InnerStepContainer, StepContainer, Heading, QRContainer } from "../../../common.js";
|
|
7
6
|
import { useCopyToClipboard, UserIdentifier } from "@getpara/react-common";
|
|
8
|
-
import { useInternalClient } from "
|
|
9
|
-
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
7
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
10
8
|
import { AuthMethod } from "@getpara/web-sdk";
|
|
11
|
-
import { useStore } from "
|
|
12
|
-
|
|
9
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
10
|
+
import { useAuth } from "../../../../../provider/providers/AuthProvider/AuthProvider.js";
|
|
11
|
+
const BiometricCreation = () => {
|
|
12
|
+
var _a, _b, _c, _d;
|
|
13
13
|
const para = useInternalClient();
|
|
14
14
|
const authInfo = para.authInfo;
|
|
15
15
|
const appName = useStore((state) => state.appName);
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const authStateInfo = useStore((state) => {
|
|
17
|
+
var _a2;
|
|
18
|
+
return (_a2 = state.paraState) == null ? void 0 : _a2.authStateInfo;
|
|
19
|
+
});
|
|
20
|
+
const passkeyUrl = (_a = authStateInfo == null ? void 0 : authStateInfo.passkeyUrl) != null ? _a : null;
|
|
21
|
+
const passwordUrl = (_b = authStateInfo == null ? void 0 : authStateInfo.passwordUrl) != null ? _b : null;
|
|
22
|
+
const isPasskeySupported = (_c = authStateInfo == null ? void 0 : authStateInfo.isPasskeySupported) != null ? _c : false;
|
|
23
|
+
const pinUrl = (_d = authStateInfo == null ? void 0 : authStateInfo.pinUrl) != null ? _d : null;
|
|
24
|
+
const { openBiometricUrl } = useAuth();
|
|
19
25
|
const [isCopied, copy] = useCopyToClipboard();
|
|
20
26
|
const handleCopy = () => {
|
|
21
|
-
if (
|
|
22
|
-
copy(
|
|
27
|
+
if (passkeyUrl) {
|
|
28
|
+
copy(passkeyUrl);
|
|
23
29
|
}
|
|
24
30
|
};
|
|
25
31
|
const onClick = (method) => () => {
|
|
26
|
-
|
|
32
|
+
openBiometricUrl(method);
|
|
27
33
|
};
|
|
28
|
-
const isBoth = !!
|
|
29
|
-
const isPIN = !!
|
|
30
|
-
if (!signupState) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
34
|
+
const isBoth = !!passkeyUrl && (!!passwordUrl || !!pinUrl);
|
|
35
|
+
const isPIN = !!pinUrl;
|
|
33
36
|
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
34
37
|
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
35
38
|
/* @__PURE__ */ jsx(Heading, { children: para.isExternalWalletAuth ? `Finish setup for your${appName ? ` ${appName}` : ""} wallet` : isBoth ? "Secure Your Account" : "Create Passkey" }),
|
|
@@ -37,12 +40,12 @@ const BiometricCreationStep = () => {
|
|
|
37
40
|
/* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: isBoth ? `Choose a ${isPIN ? "PIN" : "password"} or set up a passkey` : "Your Passkey keeps your account safe." })
|
|
38
41
|
] }),
|
|
39
42
|
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
40
|
-
|
|
43
|
+
isPasskeySupported ? /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: onClick(AuthMethod.PASSKEY), "data-testid": "para-create-passkey", children: [
|
|
41
44
|
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
42
45
|
isBoth ? "Create Passkey" : "Create"
|
|
43
46
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
47
|
/* @__PURE__ */ jsx(CpslText, { weight: "semiBold", children: "Scan with your mobile device" }),
|
|
45
|
-
/* @__PURE__ */ jsx(QRContainer, { children: !
|
|
48
|
+
/* @__PURE__ */ jsx(QRContainer, { children: !passkeyUrl ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: passkeyUrl, "data-testid": "para-passkey-qr" }) }),
|
|
46
49
|
/* @__PURE__ */ jsxs(CpslButton, { size: "small", variant: "ghost", onClick: handleCopy, "data-testid": "para-passkey-copy-link", children: [
|
|
47
50
|
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: isCopied ? "check" : "copy" }),
|
|
48
51
|
isCopied ? "Copied" : "Copy Link"
|
|
@@ -55,7 +58,7 @@ const BiometricCreationStep = () => {
|
|
|
55
58
|
{
|
|
56
59
|
fullWidth: true,
|
|
57
60
|
onClick: onClick(isPIN ? AuthMethod.PIN : AuthMethod.PASSWORD),
|
|
58
|
-
disabled:
|
|
61
|
+
disabled: !(isPIN ? pinUrl : passwordUrl),
|
|
59
62
|
"data-testid": "para-choose-password",
|
|
60
63
|
children: [
|
|
61
64
|
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "passcode" }),
|
|
@@ -69,5 +72,5 @@ const BiometricCreationStep = () => {
|
|
|
69
72
|
] });
|
|
70
73
|
};
|
|
71
74
|
export {
|
|
72
|
-
|
|
75
|
+
BiometricCreation
|
|
73
76
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BiometricLogin: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslButton, CpslDivider, CpslIcon } from "@getpara/react-components";
|
|
5
|
+
import { Heading, StepContainer, InnerStepContainer } from "../../../common.js";
|
|
6
|
+
import { safeStyled } from "@getpara/react-common";
|
|
7
|
+
import { AuthMethod } from "@getpara/web-sdk";
|
|
8
|
+
import { KnownDevices, UserIdentifier } from "@getpara/react-common";
|
|
9
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
10
|
+
import { useAuth } from "../../../../../provider/providers/AuthProvider/AuthProvider.js";
|
|
11
|
+
import { useFormattedBiometricHints } from "../../../../../provider/hooks/utils/useFormattedBiometricHints.js";
|
|
12
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
13
|
+
const BiometricLogin = () => {
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
const para = useInternalClient();
|
|
16
|
+
const { openBiometricUrl } = useAuth();
|
|
17
|
+
const authStateInfo = useStore((state) => {
|
|
18
|
+
var _a2;
|
|
19
|
+
return (_a2 = state.paraState) == null ? void 0 : _a2.authStateInfo;
|
|
20
|
+
});
|
|
21
|
+
const passkeyUrl = (_a = authStateInfo == null ? void 0 : authStateInfo.passkeyUrl) != null ? _a : null;
|
|
22
|
+
const passwordUrl = (_b = authStateInfo == null ? void 0 : authStateInfo.passwordUrl) != null ? _b : null;
|
|
23
|
+
const pinUrl = (_c = authStateInfo == null ? void 0 : authStateInfo.pinUrl) != null ? _c : null;
|
|
24
|
+
const passkeyKnownDeviceUrl = (_d = authStateInfo == null ? void 0 : authStateInfo.passkeyKnownDeviceUrl) != null ? _d : null;
|
|
25
|
+
const isPasskeySupported = (_e = authStateInfo == null ? void 0 : authStateInfo.isPasskeySupported) != null ? _e : false;
|
|
26
|
+
const { data: biometricHints } = useFormattedBiometricHints();
|
|
27
|
+
const { isOnKnownDevice = false, formattedHints } = biometricHints || {};
|
|
28
|
+
const isPasskey = !!passkeyUrl, isPassword = !!passwordUrl, isPIN = !!pinUrl, isNeither = !isPasskey && !isPassword, hasHints = (_f = formattedHints == null ? void 0 : formattedHints.length) != null ? _f : 0 > 0, isPasskeyOnKnownDevice = isPasskeySupported && isOnKnownDevice, isPasskeyUnavailable = hasHints && !isOnKnownDevice || !isPasskeySupported || isNeither, displayKnownDevices = isPasskeyUnavailable && !!biometricHints && (hasHints || !!passkeyKnownDeviceUrl), displayWelcomeBack = isPasskeyOnKnownDevice || isPassword || isPIN;
|
|
29
|
+
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
30
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
31
|
+
displayWelcomeBack && /* @__PURE__ */ jsx(Heading, { children: "Welcome back," }),
|
|
32
|
+
/* @__PURE__ */ jsx(UserIdentifier, { authInfo: para.authInfo })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsxs(MainContainer, { children: [
|
|
35
|
+
(isPassword || isPIN) && /* @__PURE__ */ jsxs(
|
|
36
|
+
CpslButton,
|
|
37
|
+
{
|
|
38
|
+
fullWidth: true,
|
|
39
|
+
onClick: () => openBiometricUrl(isPIN ? AuthMethod.PIN : AuthMethod.PASSWORD),
|
|
40
|
+
"data-testid": "para-login-password",
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "passcode" }),
|
|
43
|
+
isPIN && isPassword ? "Login" : isPIN ? "Login with PIN" : "Login with Password"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
isPasskey && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
+
displayKnownDevices && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
KnownDevices,
|
|
51
|
+
{
|
|
52
|
+
hints: biometricHints,
|
|
53
|
+
link: passkeyKnownDeviceUrl != null ? passkeyKnownDeviceUrl : void 0,
|
|
54
|
+
"data-testid": "para-known-devices"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsx(CpslDivider, { children: "or" })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: () => openBiometricUrl(AuthMethod.PASSKEY), "data-testid": "para-login-passkey", children: isPasskeyUnavailable ? "Continue anyway" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
61
|
+
"Login with Passkey"
|
|
62
|
+
] }) })
|
|
63
|
+
] })
|
|
64
|
+
] })
|
|
65
|
+
] });
|
|
66
|
+
};
|
|
67
|
+
const MainContainer = safeStyled(InnerStepContainer)`
|
|
68
|
+
gap: 16px;
|
|
69
|
+
`;
|
|
70
|
+
export {
|
|
71
|
+
BiometricLogin
|
|
72
|
+
};
|
package/dist/modal/components/{LoginDoneStep/LoginDoneStep.js → flows/auth/LoginDone/LoginDone.js}
RENAMED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useEffect, useMemo } from "react";
|
|
5
|
-
import { Heading, HeroIcon, StepContainer } from "
|
|
6
|
-
import { ExternalWalletCard, WalletCard, WalletCards } from "
|
|
7
|
-
import { useInternalClient } from "
|
|
8
|
-
import { useStore } from "
|
|
9
|
-
|
|
10
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
11
|
-
const LoginDoneStep = ({ onClose }) => {
|
|
5
|
+
import { Heading, HeroIcon, StepContainer } from "../../../common.js";
|
|
6
|
+
import { ExternalWalletCard, WalletCard, WalletCards } from "../../../WalletCard/WalletCard.js";
|
|
7
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
8
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
9
|
+
const LoginDone = ({ onClose }) => {
|
|
12
10
|
const para = useInternalClient();
|
|
13
11
|
const bareModal = useStore((state) => {
|
|
14
12
|
var _a;
|
|
15
13
|
return (_a = state.modalConfig) == null ? void 0 : _a.bareModal;
|
|
16
14
|
});
|
|
17
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
18
|
-
const setFlow = useModalStore((state) => state.setFlow);
|
|
19
15
|
const hideWallets = useStore((state) => {
|
|
20
16
|
var _a;
|
|
21
17
|
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
22
18
|
});
|
|
19
|
+
const setShowPostAuthFlow = useStore((state) => state.setShowPostAuthFlow);
|
|
23
20
|
const content = useMemo(() => {
|
|
24
21
|
var _a, _b;
|
|
25
22
|
if (para.externalWalletConnectionType === "CONNECTION_ONLY" || para.externalWalletConnectionType === "VERIFICATION") {
|
|
@@ -32,8 +29,7 @@ const LoginDoneStep = ({ onClose }) => {
|
|
|
32
29
|
useEffect(() => {
|
|
33
30
|
const timerId = setTimeout(() => {
|
|
34
31
|
if (bareModal) {
|
|
35
|
-
|
|
36
|
-
setStep(ModalStep.ACCOUNT_MAIN);
|
|
32
|
+
setShowPostAuthFlow(false);
|
|
37
33
|
} else {
|
|
38
34
|
onClose();
|
|
39
35
|
}
|
|
@@ -49,5 +45,5 @@ const LoginDoneStep = ({ onClose }) => {
|
|
|
49
45
|
] });
|
|
50
46
|
};
|
|
51
47
|
export {
|
|
52
|
-
|
|
48
|
+
LoginDone
|
|
53
49
|
};
|
|
@@ -1,44 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { ACCOUNT_TYPES, safeStyled } from "@getpara/react-common";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { useStore } from "../../../provider/stores/useStore.js";
|
|
12
|
-
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
7
|
+
import { getTileButtonFlex } from "../../../../utils/getTileButtonFlex.js";
|
|
8
|
+
import { StyledCpslTileButton } from "../../../common.js";
|
|
9
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
10
|
+
import { useAuth } from "../../../../../provider/providers/AuthProvider/AuthProvider.js";
|
|
13
11
|
const HAS_MORE_LENGTH = 3;
|
|
14
12
|
const OAuth = ({ methods }) => {
|
|
13
|
+
const {
|
|
14
|
+
authenticateWithOAuth: { authenticate }
|
|
15
|
+
} = useAuth();
|
|
16
|
+
const setSelectedAuthView = useStore((state) => state.setSelectedAuthView);
|
|
17
|
+
const selectedAuthView = useStore((state) => state.selectedAuthView);
|
|
18
|
+
const accountView = useStore((state) => state.accountView);
|
|
15
19
|
const oAuthLogoVariant = useStore((state) => state.oAuthLogoVariant);
|
|
16
20
|
const isDark = useStore((state) => state.isDarkTheme);
|
|
17
|
-
const
|
|
18
|
-
const showAll = useModalStore((state) => state.step === ModalStep.AUTH_MORE || state.step === ModalStep.AUTH_GUEST_SIGNUP);
|
|
19
|
-
const { verifyOAuth } = useAuthActions();
|
|
21
|
+
const showAll = selectedAuthView === "AUTH_ALL_OPTIONS" || accountView === "ACCOUNT_GUEST_SIGNUP";
|
|
20
22
|
const hasMore = methods.length > HAS_MORE_LENGTH;
|
|
21
23
|
const methodsToShow = showAll || !hasMore ? methods : methods.slice(0, HAS_MORE_LENGTH - 1);
|
|
22
24
|
const handleShowAll = () => {
|
|
23
|
-
|
|
25
|
+
setSelectedAuthView("AUTH_ALL_OPTIONS");
|
|
24
26
|
};
|
|
25
27
|
const handleMethodClick = (method) => () => __async(void 0, null, function* () {
|
|
26
|
-
|
|
27
|
-
case "FARCASTER":
|
|
28
|
-
setStep(ModalStep.FARCASTER_OAUTH);
|
|
29
|
-
break;
|
|
30
|
-
case "TELEGRAM":
|
|
31
|
-
setStep(ModalStep.TELEGRAM_OAUTH);
|
|
32
|
-
break;
|
|
33
|
-
default:
|
|
34
|
-
verifyOAuth(method);
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
28
|
+
yield authenticate(method);
|
|
37
29
|
});
|
|
38
30
|
const useBrandedLogos = oAuthLogoVariant === "default";
|
|
39
31
|
const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== "dark";
|
|
40
32
|
const showMoreButton = !showAll && hasMore;
|
|
41
|
-
return /* @__PURE__ */ jsxs(OAuthContainer, {
|
|
33
|
+
return /* @__PURE__ */ jsxs(OAuthContainer, { children: [
|
|
42
34
|
methodsToShow.map((method, index) => /* @__PURE__ */ jsx(
|
|
43
35
|
OAuthButton,
|
|
44
36
|
{
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__async
|
|
4
|
-
} from "
|
|
4
|
+
} from "../../../../../chunk-MMUBH76A.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CpslButton, CpslText } from "@getpara/react-components";
|
|
7
|
-
import {
|
|
8
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
9
|
-
import { Heading, InnerStepContainer, StepContainer, StyledCpslTileButton } from "../common.js";
|
|
7
|
+
import { Heading, InnerStepContainer, StepContainer, StyledCpslTileButton } from "../../../common.js";
|
|
10
8
|
import { safeStyled } from "@getpara/react-common";
|
|
11
9
|
import { useCopyToClipboard } from "@getpara/react-common";
|
|
12
|
-
import { getMailtoLink } from "
|
|
10
|
+
import { getMailtoLink } from "../../../../utils/getMailtoLink.js";
|
|
13
11
|
import { useState } from "react";
|
|
14
|
-
import { useStore } from "
|
|
15
|
-
import { useInternalClient } from "
|
|
12
|
+
import { useStore } from "../../../../../provider/stores/useStore.js";
|
|
13
|
+
import { useInternalClient } from "../../../../../provider/hooks/utils/useInternalClient.js";
|
|
16
14
|
const SaveRecoverySecret = ({
|
|
17
15
|
email,
|
|
18
16
|
value,
|
|
@@ -55,12 +53,12 @@ const RecoverySecretStep = () => {
|
|
|
55
53
|
var _a;
|
|
56
54
|
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
57
55
|
});
|
|
58
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
59
56
|
const authInfo = para.authInfo;
|
|
60
|
-
const
|
|
61
|
-
const
|
|
57
|
+
const recoverySecret = useStore((state) => state.recoverySecret);
|
|
58
|
+
const setRecoverySecret = useStore((state) => state.setRecoverySecret);
|
|
59
|
+
const backupDecryptionKey = JSON.parse(recoverySecret || "{}").backupDecryptionKey;
|
|
62
60
|
const onComplete = () => __async(void 0, null, function* () {
|
|
63
|
-
|
|
61
|
+
setRecoverySecret(null);
|
|
64
62
|
});
|
|
65
63
|
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
66
64
|
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|